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..d5fc8e5631 100644 --- a/Dict.md +++ b/Dict.md @@ -1,163 +1,79 @@ +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 中。 +#### Repo/Repository -#### J #### +Repository 主要用于两个场景,一个是用于版本管理的代码仓库,一个是用于分发软件/组件/制品的软件仓库。 -#### K #### +鉴于两种场景的差异,建议在使用时,分别注明“代码仓库”或“软件仓库”,也可简称为 “代码仓”或“软件仓”。 -#### L #### -### 1. live CD:现场版 CD -> 通常不翻译,但是如果翻译,可以译作“现场版”。 -### 2. live patch: 实时补丁/热补丁 -> 指 Linux 内核的 live patch 支持。 +### S -### 2. LTS(Long Term Support):长期支持 -> 该缩写词多见于操作系统发行版或者软件发行版名称中,表明该版本属于长期支持版。 +#### Shebang [ʃɪ'bæŋ]:释伴 -#### M #### +Shebang(也称为 Hashbang)是一个由井号和叹号构成的字符序列(`#!`),出现在脚本文件的第一行的前两个字符,后跟解释器路径,如:`#!/bin/sh`,这通常是 Linux 中 shell 脚本的标准起始行。 -#### N #### +长期以来,Shebang 都没有正式的中文名称。提议者将其翻译为:“释伴”,即解释伴随行的简称,同时又是 Shebang 的音译。(关于这个词汇的翻译,在下面的首次链接中有其它的建议和讨论。) -#### O #### -### 1. Orchestration:编排 -> 描述复杂计算机系统、中间件(middleware)和业务的自动化的安排、协调和管理(来自维基百科)。 +- 提议者:GoLinux +- 首次链接:https://linux.cn/article-3664-1.html -#### P #### -### 1. P-code(Pseudo-code):伪代码语言 -> 一种解释型语言,执行方式介于编译型语言和解释型语言之间。和解释型语言一样,伪代码编程语言无需编译,在执行时自动转换成二进制形式。然而,和编译型语言不同的是,这种可执行的二进制文件是以伪代码的形式而不是机器语言的形式存储的。伪代码语言的例子有 Java、Python 和 REXX/Object REXX。 +#### Shell :交互界面 -### 2. PAM(Pluggable Authentication Modules):可插拔认证模块 -> 用于系统安全性的可替换的用户认证模块,它允许在不知道将使用何种认证方案的情况下进行编程。这允许将来用其它模块来替换某个模块,却无需重写软件。 +Shell 是 Unix/Linux 等系统的 `sh`、`bash` 等命令行的接口程序,包括 DOS/Windows 的 `command.com`/`cmd.exe` 等其实也属于此类,只是通常不这样称呼。 -### 3. Port/Ported/Porting:移植 -> 一个过程,即获取为某个操作系统平台编写的程序,并对其进行修改使之能在另一 OS 上运行,并且具有类似的功能。 +这个词汇也是一个一直没有翻译而径直使用的计算机词汇。我们也没有见到(找到)合适的翻译。但是我们在 LCTT 译者 CanYellow 翻译的一篇文章中见到他将其翻译为 “交互界面”,我们认为这是一种好的翻译。 -### 4. POSIX(Portable Operating System Interface for uniX):UNIX 可移植操作系统接口 -> 一组编程接口标准,它们规定如何编写应用程序源代码以便应用程序可在操作系统之间移植。POSIX 基于 UNIX,它是 The Open Group 的 X/Open 规范的基础。 +注:有些人对此次条的翻译持反对意见,此词条建议尝试性在部分语境中使用。 -#### Q #### +- 提议者:CanYellow +- 首次链接:https://linux.cn/article-15469-1.html -#### R #### -### 1. RCS(Revision Control System):修订控制系统 -> 一组程序,它们控制组环境下文件的共享访问并跟踪文本文件的变化。常用于维护源代码模块的编码工作。 +### 说明 -### 2. RFS(Remote File Sharing):远程文件共享 -> 一个程序,它让用户访问其它计算机上的文件,就好象文件在用户的系统上一样。 - -#### S #### -### 1. shebang [ʃɪ'bæŋ]:释伴 -> Shebang(也称为Hashbang)是一个由井号和叹号构成的字符序列(#!),出现在文本文件的第一行的前两个字符,后跟解释器路径,如:#!/bin/sh,这通常是Linux中shell脚本的标准起始行。 -> 长期以来,shebang都没有正式的中文名称。Linux中国翻译组将其翻译为:释伴,即解释伴随行的简称,同时又是shebang的音译。 - -### 2. Spool(Simultaneous Peripheral Operation On-Line):假脱机 -> 将数据发送给一个程序,该程序将该数据信息放入队列以备将来使用(例如,打印假脱机程序) - -### 2. Steganography:隐写术 -> 将一段信息隐藏在另一段信息中的做法。一个示例是在数字化照片中放置不可见的数字水印。 - -### 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 ,欢迎大家提交议题或拉取请求来完善它。 \ 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/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 similarity index 100% rename from published/20200105 Friend of a Friend- The Facebook That Could Have Been.md rename to published/202212/20200105 Friend of a Friend- The Facebook That Could Have Been.md 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/20210922 Install PowerShell on Fedora Linux.md b/published/202212/20210922 Install PowerShell on Fedora Linux.md similarity index 100% rename from published/20210922 Install PowerShell on Fedora Linux.md rename to published/202212/20210922 Install PowerShell on Fedora Linux.md 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/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 similarity index 100% rename from published/20221025.3 ⭐️ How to Change Login Screen Background in Ubuntu.md rename to published/202212/20221025.3 ⭐️ How to Change Login Screen Background in Ubuntu.md diff --git a/published/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 similarity index 100% rename from published/20221026.0 ⭐️⭐️⭐️ Doing 64-bit math on a 16-bit system.md rename to published/202212/20221026.0 ⭐️⭐️⭐️ Doing 64-bit math on a 16-bit system.md 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/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 similarity index 100% rename from published/20221107.5 ⭐️ How to Install OpenOffice in Arch Linux [Beginner’s Guide].md rename to published/202212/20221107.5 ⭐️ How to Install OpenOffice in Arch Linux [Beginner’s Guide].md diff --git a/published/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 similarity index 100% rename from published/20221115.0 ⭐️ You Can Now Install Unity 7.6 Desktop on Arch Linux.md rename to published/202212/20221115.0 ⭐️ You Can Now Install Unity 7.6 Desktop on Arch Linux.md diff --git a/translated/tech/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 similarity index 66% rename from translated/tech/20221116.0 ⭐️⭐️ How to Install GNOME Desktop Environment in Linux Mint.md rename to published/202212/20221116.0 ⭐️⭐️ How to Install GNOME Desktop Environment in Linux Mint.md index 2547594576..f521aaceed 100644 --- a/translated/tech/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 @@ -3,48 +3,50 @@ [#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" [#]: collector: "lkxed" [#]: translator: "robsean" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15350-1.html" 如何在 Linux Mint 上安装 GNOME 桌面环境 ====== +![][0] + Linux Mint 是一款极好的 Linux 发行版,特别适合初学者。 -我喜欢它仍然保持常见的 Ubuntu/Debian 字体,但是它还做了一些 [比 Ubuntu 更好的][1] 工作。其中之一就是它没有使用 Snaps 。 +我喜欢它仍然保持常见的 Ubuntu/Debian 习惯,但是它还做了一些 [比 Ubuntu 更好的][1] 工作,其中之一就是它没有使用 Snap。 然而,我不是 Cinnamon 桌面环境的粉丝,因为我从来没有真正地喜欢过 Windows XP 或 7 的默认设置。 -当我在为 Linux Mint 寻找能提供稳定使用 GNOME 的能力时,这便是我最终获得的结果: +当我寻求保持 Linux Mint 稳定的同时而提供 GNOME 的能力时,这便是我最终获得的结果: ![install gnome in linux mint][2] -这就是我运行 GNOME 42.5 的 Linux Mint 21 。 +不太炫,这就是我运行 GNOME 42.5 的 Linux Mint 21 。 如果你想在 Linux Mint 上安装 GNOME ,那么这篇指南非常适合你。 ### 在 Linux Mint 上安装GNOME 之前所要知道的事 -你真的应该有足够的理由来在 Mint 上安装 GNOME 。如果你只是为了尝鲜,可以在虚拟机中尝试。我使用 [在 VirtualBox 中安装的 Linux Mint][3] 来演示这篇教程。 +要在 Mint 上安装 GNOME,你务必需要有足够的理由。如果你只是为了尝鲜,可以在虚拟机中尝试。我使用 [在 VirtualBox 中安装的 Linux Mint][3] 来演示这篇教程。 -在发行版上安装一种桌面环境与直接使用来自发行版所提供的桌面环境相比,移除桌面环境部分会使其变成一件很复杂化的事。 +安装除发行版提供的桌面环境之外的其他桌面环境,移除桌面环境部分会使其变成一件很复杂的事。 -Cinnamon 使用一些 GNOME 元素。如果你决定稍后移除 GNOME ,这可能会影响到 Cinnamon 的一部分功能。 +Cinnamon 使用了一些 GNOME 元素。如果你决定稍后移除 GNOME ,这可能会影响到 Cinnamon 的一部分功能。 这可能会导致缺少实战经验用户的恐慌。当然,在 TTY 屏幕中重新安装 Cinnamon 桌面环境可能是一种可行的解决方案。 -最重要的一点是,如果你很容易惊慌地不知所措和不喜欢解决难题,那么你就不应该在你的主力计算机上做这些 ‘试验’ 。 +最重要的一点是,如果你很容易惊慌地不知所措和不喜欢解决难题,那么你就不应该在你的主力计算机上做这些 “试验” 。 抛开这些顾虑,让我们看看在 Linux Mint 上获取 GNOME 的简单过程。 ### 在 Linux Mint 上安装 GNOME 桌面环境 -在这里,你有两个选项。1、你可以使用包含所有的 GNOME 实用程序的完整的 GNOME 桌面,2、你也可以使用包含极少数软件包的 GNOME 精简版本、 +在这里,你有两个选项:1、你可以使用包含所有的 GNOME 实用程序的完整的 GNOME 桌面,2、你也可以使用包含极少数软件包的 GNOME 精简版本。 我都将讲解一下。 -为 **安装精简版本的 GNOME** ,你需要安装一个名称为 `vanilla-GNOME` 的软件包,使用下面给定的命令: +为 **安装精简版本的 GNOME** ,你需要安装一个名称为 `vanilla-gnome-desktop` 的软件包,使用下面给定的命令: ``` sudo apt install vanilla-gnome-desktop @@ -60,29 +62,29 @@ sudo apt install gnome ![choose display manager][4] -`gdm3` 是 GNOME 桌面的显示管理器,而 Linux Mint 使用 `lightdm` 作为默认的显示管理器,这两种显示器都可以正常工作,但是,我建议你使用 gdm3 来获取完整的 GNOME 体验。 +`gdm3` 是 GNOME 桌面的显示管理器,而 Linux Mint 使用 `lightdm` 作为默认的显示管理器,这两种显示器都可以正常工作,但是,我建议你使用 `gdm3` 来获取完整的 GNOME 体验。 #### 切换到 GNOME -在完成后,注销并按一次 enter 按键,在这里,你将看到一个小齿轮图标。从这里选择 GNOME : +在完成后,注销并按一次回车键,在这里,你将看到一个小齿轮图标。从这里选择 “GNOME” : ![choose gnome while logging in][5] 现在,你拥有以 Linux Mint 为基础的 GNOME 桌面环境! -#### 额外提示:如何应用整体风格一致的主题 +#### 额外提示:如何应用整体风格一致的主题 你可以继续使用 Cinnamon 桌面的主题,但是它们大多不能如前工作,因此,我建议使用 GNOME 桌面的主题(例如 Adwaita )来保持桌面环境的一致性。 -对我而言,其默认的字体没有一点效果。并且,我更喜欢 Fedora 提供的一些字体。因此,从系统菜单打开 GNOME 调整GNOME tweaks 窗口,并作出如下更改: +对我而言,其默认的字体没有一点效果。并且,我更喜欢 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)** 用于窗口标题。 +- `Cantarell Regular (11)` 用于界面和文档文本。 +- `Noto Sans Mono Regular (13)` 用于等宽字体文本。 +- `Cantarell Bold (11)` 用于窗口标题。 它们的结果是,比默认的 Ubuntu 字体方案要好得多。 @@ -101,7 +103,7 @@ via: https://itsfoss.com/install-gnome-linux-mint/ 作者:[Sagar Sharma][a] 选题:[lkxed][b] 译者:[robsean](https://github.com/robseans) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -114,3 +116,4 @@ via: https://itsfoss.com/install-gnome-linux-mint/ [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/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 similarity index 100% rename from published/20221117.1 ⭐️ Authenticator A Simple Open-Source App to Replace Authy on Linux.md rename to published/202212/20221117.1 ⭐️ Authenticator A Simple Open-Source App to Replace Authy on Linux.md diff --git a/published/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 similarity index 100% rename from published/20221121.2 ⭐️⭐️ Learn Git 3 commands to level up your skill.md rename to published/202212/20221121.2 ⭐️⭐️ Learn Git 3 commands to level up your skill.md diff --git a/published/20221122.0 ⭐️ Find bugs with the git bisect command.md b/published/202212/20221122.0 ⭐️ Find bugs with the git bisect command.md similarity index 100% rename from published/20221122.0 ⭐️ Find bugs with the git bisect command.md rename to published/202212/20221122.0 ⭐️ Find bugs with the git bisect command.md 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/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 similarity index 100% rename from published/20221127.1 ⭐️ How to Automatically Indent Your Code in Visual Studio Code.md rename to published/202212/20221127.1 ⭐️ How to Automatically Indent Your Code in Visual Studio Code.md diff --git a/published/20221128.1 ⭐️⭐️ 3 open source audio tools for creators.md b/published/202212/20221128.1 ⭐️⭐️ 3 open source audio tools for creators.md similarity index 100% rename from published/20221128.1 ⭐️⭐️ 3 open source audio tools for creators.md rename to published/202212/20221128.1 ⭐️⭐️ 3 open source audio tools for creators.md diff --git a/published/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 similarity index 100% rename from published/20221128.2 ⭐️ Elon Musk's Twitter to Add Open-Source Signal Protocol for Encrypted DMs.md rename to published/202212/20221128.2 ⭐️ Elon Musk's Twitter to Add Open-Source Signal Protocol for Encrypted DMs.md diff --git a/published/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 similarity index 100% rename from published/20221129.1 ⭐️ Bodhi Linux 7.0.0 Testing Begins with New Features, Packages.md rename to published/202212/20221129.1 ⭐️ Bodhi Linux 7.0.0 Testing Begins with New Features, Packages.md diff --git a/published/20221129.3 ⭐️⭐️ Parse arguments with Lua.md b/published/202212/20221129.3 ⭐️⭐️ Parse arguments with Lua.md similarity index 100% rename from published/20221129.3 ⭐️⭐️ Parse arguments with Lua.md rename to published/202212/20221129.3 ⭐️⭐️ Parse arguments with Lua.md diff --git a/published/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 similarity index 100% rename from published/20221130.1 ⭐️⭐️ Get to know Lua for loops in 4 minutes.md rename to published/202212/20221130.1 ⭐️⭐️ Get to know Lua for loops in 4 minutes.md diff --git a/published/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 similarity index 100% rename from published/20221201.2 ⭐️⭐️ Microsoft Office 365 Declared illegal for German Schools, Again!.md rename to published/202212/20221201.2 ⭐️⭐️ Microsoft Office 365 Declared illegal for German Schools, Again!.md diff --git a/translated/tech/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 similarity index 60% rename from translated/tech/20221201.3 ⭐️⭐️ Monica An Open-Source App for Personal Relationship Management.md rename to published/202212/20221201.3 ⭐️⭐️ Monica An Open-Source App for Personal Relationship Management.md index 4da016170e..c159ea92bb 100644 --- a/translated/tech/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 @@ -3,18 +3,20 @@ [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lkxed" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15346-1.html" -Monica:个人关系管理的开源应用 +Monica:人际关系管理的开源应用 ====== -你可能已经知道 CRM 代表 **客户关系管理**。 我们已经有了一份帮助小型企业的[开源 CRM 软件][1]列表。 +![][0] -在这里,我将讨论一个有趣的开源 Web 应用,它采用相同的人际关系概念。 听起来很独特,对吧? +你可能已经知道 CRM 代表 客户关系管理Customer Relationship Management。 我们已经有了一份帮助小型企业的 [开源 CRM 软件][1] 列表。 -Monica 是一款可让你组织和记录你与亲人互动的应用。 **如果你自行托管,它是免费的,如果你需要托管版本那么订阅**。 +在这里,我将讨论一个有趣的开源 Web 应用,它采用相同的人际关系概念。听起来很独特,对吧? + +Monica 是一款可让你组织和记录你与亲人互动的应用。**如果你自行托管,它是免费的,如果你需要托管版本那么订阅**。 ### Monica:跟踪社交互动 @@ -22,11 +24,11 @@ Monica 是一款可让你组织和记录你与亲人互动的应用。 **如果 很难记住与家人、朋友或同事互动的每一个细节。 -你可以使用[笔记应用][3]或 [CubyText][4] 等知识管理应用来添加一些信息。 但这些并不是为记录你的互动而量身定制的。 因此,你将不得不付出一些努力,以在需要时得心应手的方式添加信息。 +你可以使用 [笔记应用][3] 或 [CubyText][4] 等知识管理应用来添加一些信息。但这些并不是为记录你的互动而量身定制的。 因此,你将不得不付出一些努力,以在需要时得心应手的方式添加信息。 使用 Monica,添加你的家庭、工作、联系人之间的关系、活动、日记、重要日期的提醒、债务等信息变得更加容易。 -可以将其安装在自己的服务器上或选择 **$90/年**的订阅以获得托管版本。 +可以将其安装在自己的服务器上或选择 **$90/年** 的订阅以获得托管版本。 有趣的是,开发人员最初是根据他的个人要求构建它的。 @@ -34,26 +36,26 @@ Monica 是一款可让你组织和记录你与亲人互动的应用。 **如果 ![dashboard][5] -你可以获得大量选项来添加有关你日常生活中的人和互动的信息。 其中一些包括: +你可以获得大量选项来添加有关你日常生活中的人和互动的信息。其中一些包括: - 添加关于一个人的注释 - 列出与联系人相关的重要其他人的姓名(他们的孩子、宠物等) - 通话记录 - 每个联系人的备用联系方式 -- 重要约会和重要事件提醒。 生日会自动设置为提醒。 +- 重要约会和重要事件提醒。生日会自动设置为提醒。 - 管理礼物信息 - 有用的仪表板,一目了然 - 支持日记条目 Monica 似乎配备了各种功能,使其成为写日记、做笔记、添加联系信息、添加事件等的一体化工具。 -不幸的是,没有可用的移动应用。 你可以从 Web 浏览器访问它,但它可能不是每个人的最佳体验。 所以,如果你坚持用智能手机做笔记和其他东西,你可能想看看其他的。 +不幸的是,没有可用的移动应用。你可以从 Web 浏览器访问它,但它可能不是每个人的最佳体验。所以,如果你坚持用智能手机做笔记和其他东西,你可能想看看其他的。 ### 自托管或订阅访问 -如果你想要 Monica 的托管版本,可以查看它的[定价页面][6]了解更多信息。 +如果你想要 Monica 的托管版本,可以查看它的 [定价页面][6] 了解更多信息。 -对于自托管,你需要前往其 [GitHub 页面][7]并按照说明下载并安装它。 可以选择在 Platform.sh 或 Heroku 上快速部署。 +对于自托管,你需要前往其 [GitHub 页面][7] 并按照说明下载并安装它。可以选择在 Platform.sh 或 Heroku 上快速部署。 在选择服务器来托管 Monica 之前,请检查最低系统要求。 @@ -61,7 +63,7 @@ Monica 似乎配备了各种功能,使其成为写日记、做笔记、添加 这一切都很方便。 所以,选择对你来说不错的。 -前往其[官方网站][8]获取所有详细信息并开始使用。 +前往其 [官方网站][8] 获取所有详细信息并开始使用。 -------------------------------------------------------------------------------- @@ -84,3 +86,4 @@ via: https://itsfoss.com/monica/ [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/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 similarity index 100% rename from published/20221204.1 ⭐️ 4MLinux 41.0 stable is now available with SDL games + More.md rename to published/202212/20221204.1 ⭐️ 4MLinux 41.0 stable is now available with SDL games + More.md diff --git a/published/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 similarity index 100% rename from published/20221204.2 ⭐️⭐️ Trinity Desktop Environment R14.0.13 is now out with updates!.md rename to published/202212/20221204.2 ⭐️⭐️ Trinity Desktop Environment R14.0.13 is now out with updates!.md diff --git a/published/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 similarity index 99% rename from published/20221205.3 ⭐️⭐️ Why you should try the Nemo file manager on Linux.md rename to published/202212/20221205.3 ⭐️⭐️ Why you should try the Nemo file manager on Linux.md index b7b5a83fe8..9dfda0adff 100644 --- a/published/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 @@ -31,7 +31,7 @@ $ sudo dnf install cinnamon-desktop 在 Linux Mint、Debian 和类似系统上: ``` -$ sudo dnf install cinnamon-desktop-environment +$ sudo apt install cinnamon-desktop-environment ``` 当然,作为该桌面的发源地,Linux Mint 也预装了 Cinnamon。 diff --git a/published/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 similarity index 100% rename from published/20221206.1 ⭐️ Gnoppix Linux 22.12 is out with GNOME 43, Kernel 6.0, + More.md rename to published/202212/20221206.1 ⭐️ Gnoppix Linux 22.12 is out with GNOME 43, Kernel 6.0, + More.md diff --git a/published/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 similarity index 100% rename from published/20221207.0 ⭐️ How to Find a Process ID and Kill it in Linux [CLI & GUI].md rename to published/202212/20221207.0 ⭐️ How to Find a Process ID and Kill it in Linux [CLI & GUI].md 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/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 similarity index 100% rename from published/20221207.5 ⭐️ Kali Linux's Last Update for the Year Brings a Lot of Early Christmas Gifts.md rename to published/202212/20221207.5 ⭐️ Kali Linux's Last Update for the Year Brings a Lot of Early Christmas Gifts.md 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/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 similarity index 100% rename from published/20221209.2 ⭐️⭐️ Tea Raises $8.9M to Introduce a New Protocol Helping Open-Source Developers Get Paid.md rename to published/202212/20221209.2 ⭐️⭐️ Tea Raises $8.9M to Introduce a New Protocol Helping Open-Source Developers Get Paid.md 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/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/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/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/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/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/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/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/sources/news/20221202.2 ⭐️⭐️ Privacy-Preserving Ads Make a Debut on Brave Search.md b/sources/news/20221202.2 ⭐️⭐️ Privacy-Preserving Ads Make a Debut on Brave Search.md deleted file mode 100644 index 2d0561c3c3..0000000000 --- a/sources/news/20221202.2 ⭐️⭐️ Privacy-Preserving Ads Make a Debut on Brave Search.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: subject: "Privacy-Preserving Ads Make a Debut on Brave Search" -[#]: via: "https://news.itsfoss.com/brave-search-ads/" -[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Privacy-Preserving Ads Make a Debut on Brave Search -====== - -Brave Search is testing privacy-preserving ads. But, the Brave browser does not seem to block them by default. - -![Privacy-Preserving Ads Make a Debut on Brave Search][1] - -Brave Search is an independent search engine that claims not to track its users and provides a safe and secure search experience. - -It aims to be a privacy-friendly alternative to the extensive tech services from Microsoft and Google. - -With a [recent announcement][2], they introduced a new feature to Brave Search. The search will now show '_privacy-preserving_' ads as part of a global beta program. - -What does this mean? Allow me to explain. - -### Privacy-Preserving Ads: Meaning? - -![brave search privacy preserving ads][3] - -Brave is planning to run ads on their search platform; they claim that these ads are anonymous, are marked, and follow its commitment of putting users first. - -These ads are said to be clearly labeled and are integrated into Brave Search. - -To display relevant advertisements, Brave Search will only use your **search query, country, and device type**. - -So, in theory, this should stop them from keeping a profile of your searches. - -They also add that: - -> Brave Search ads protect users’ data and anonymity, while supporting their access to independent and transparent search as a true alternative to Big Tech search engines. - -This has been released as a beta test globally, where Brave Search users will be shown text-based ads in search results. - -Users who opted for Brave Private Ads (for _Brave Rewards_) and are using the latest version of Brave won't be shown search ads since these are not yet eligible for BAT earnings. - -Additionally, they offer a '**Search Premium**' subscription for an ad-free search experience, which costs **$3 per month**. - -With this subscription, you get a completely ad-free search experience while also supporting Brave. - -### Is This a Step in the Right Direction? - -Even though Brave Search is based on an **open-source search project**[Tailcat][4], they have no plans to make it open-source. - -So, Brave Search already has a red flag 🚩 for many privacy enthusiasts who prefer open-source solutions for their transparency. - -**Will privacy-preserving ads make a difference, just like Brave Search's original claims for its search engine?** - -Well, I certainly hope so. Why? **Because we need more competitors to Google**. And something is better than nothing. - -Even without open-source code, we will have to sit back and see what kind of transparency they provide in their advertisement testing soon. - -Though, the implementation of Brave's privacy-preserving ads has got a few users upset. - -A [comment][5] made by a Reddit user on the official Subreddit of Brave Browser mentions: - -> Putting in an exception for your own ads is in exceptionally bad taste. All the marketing fluff around "independent, private search" is not an excuse. - -Brave Browser seems to be **not blocking Brave search ads** with its in-built ad-blocker (Brave Shields). - -On that, a member of the Brave support team clarified: - -> Shields at this time does not block 1st part, non tracking ads by default anyway (with the exception of setting to Aggressive, I believe) so it's actually just following the standard we've already set. - -So, you can block the Brave search ads with the privacy protection settings set to aggressive, I believe? - -However, not everyone prefers the aggressive blocker. So, let us see how things turn out for Brave search ad experimentation. - -💭 **Thoughts? Feel free to share them in the comments section.** - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/brave-search-ads/ - -作者:[Sourav Rudra][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/sourav/ -[b]: https://github.com/lkxed -[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/brave-privacy-preserving-ads.png -[2]: https://brave.com/private-search-ads/ -[3]: https://news.itsfoss.com/content/images/2022/12/Brave_Search_Ads.jpg -[4]: https://www.tailcat.com -[5]: https://www.reddit.com/r/brave_browser/comments/z9t171/comment/iyjledp/?utm_source=share&utm_medium=web2x&context=3 diff --git a/sources/news/20221205.0 ⭐️⭐️ Linux Mint 21.1 beta is now available for testing.md b/sources/news/20221205.0 ⭐️⭐️ Linux Mint 21.1 beta is now available for testing.md deleted file mode 100644 index 871161bbc8..0000000000 --- a/sources/news/20221205.0 ⭐️⭐️ Linux Mint 21.1 beta is now available for testing.md +++ /dev/null @@ -1,90 +0,0 @@ -[#]: subject: "Linux Mint 21.1 beta is now available for testing" -[#]: via: "https://debugpointnews.com/linux-mint-21-1-beta/" -[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Linux Mint 21.1 beta is now available for testing -====== - -![][1] - -**Check out the new features of Linux Mint 21.1 beta, which is now slowly available for download in mirrors. The official announcement is awaited.** - -![Linux Mint 21.1 beta Cinnamon desktop][2] - -Linux Mint 21.1 is the first point release of the 21 series and will be released before Christmas this year. Codenamed “Vera”, which was [announced a few weeks back][3], is now available for beta testing. - -The beta testing is expected to continue for at least a week before the final release. Since it is the first point, the feature list is not at that higher end. But some significant updates are arriving in the final release. - -### Linux Mint 21.1 beta & new features - -One of the biggest updates to the Driver Manager in this release is the ability to run the app with your user account without requiring a password to launch it. This is a major convenience, as it means you don’t have to enter a password every time you want to use the Driver Manager. In addition, when you remove a driver, the app now purges it from the system completely, ensuring that no trace of the driver remains on your computer. - -Another key update to the Driver Manager is the ability to detect USB installation media and help you mount them. This is particularly useful if you’re installing software or drivers from a USB drive, as it makes the process much easier and more streamlined. - -In addition to these updates, the Mint team has also included a feature for verifying the checksum of ISO files. This is an important part of any installation process, as it ensures that your ISO file is legitimate and hasn’t been tampered with. While other [utilities][4] are available for verifying ISO checksums, including command line tools, it’s nice to see this feature included in the default desktop environment. - -Another change in this release is the default desktop view, which is expected to be updated. The default icons for the Computer, Home, Trash, and Network are now hidden from view, as the Computer icon is already included in the Panel, and the other icons are not used as frequently. - -Other noteworthy updates in this release include the inclusion of Timeshift backports for prior releases (such as Mint 20.x) and an updated version of Blueman. Overall, this is a solid point release that includes several useful updates and bug fixes. - -![New default icon set and bibata cursor][5] - -Finally, you may notice the “green” icon sets and the cursor is different in the Cinnamon flavour. Linux Mint 21.1 brings the “Mint-y-Aqua” theme and the stunning “Bibata-modern” cursor theme to pair with it. Both of them look awesome together, giving a much-needed fresh vibe. - -### Summary of changes - -- First point release of Linux Mint 21, based on Ubuntu 22.04.1 release -- Linux Kernel 5.15 LTS -- Cinnamon 5.6.4 desktop -- Xfce 4.16 desktop -- MATE 1.26 desktop -- Friendly driver manager -- Cleaner default desktop view with fewer icons -- Default theme changes to “Mint-Y-Aqua” from the green-based icons -- New cursor theme: Bibata (one of the best cursor theme in Linux) -- A bunch of stunning wallpapers -- And an array of bug fixes - -### Download and bug reporting for beta - -While the team is preparing for the official announcement, the ISO images are slowly becoming available to the public. As always, being a beta release, it may have bugs. So use it with caution. - -If you are running Linux Mint 21.0, don’t upgrade it yet. Wait for the final release. - -Still, if you want to try it on a virtual machine, download the Cinnamon, Xfce and MATE flavours of this beta release from the torrent links below. - -- [linuxmint-21.1-cinnamon-64bit-beta.iso.torrent][6] -- [linuxmint-21.1-mate-64bit-beta.iso.torrent][7] -- [linuxmint-21.1-xfce-64bit-beta.iso.torrent][8] - -I will update the changelog here once it is available. And finally, report any issues or bugs at the dedicated [21.1 beta bug tracking page][9]. - -Cheers. - --------------------------------------------------------------------------------- - -via: https://debugpointnews.com/linux-mint-21-1-beta/ - -作者:[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/2022/12/21-1-beta-head.jpg -[2]: https://debugpointnews.com/wp-content/uploads/2022/12/Linux-Mint-21.1-beta-Cinnamon-desktop.jpg -[3]: https://debugpointnews.com/linux-mint-21-1-announcement/ -[4]: https://www.debugpoint.com/collision/ -[5]: https://debugpointnews.com/wp-content/uploads/2022/12/New-default-icon-set-and-bibata-cursor.jpg -[6]: https://linuxmint.com/torrents/linuxmint-21.1-cinnamon-64bit-beta.iso.torrent -[7]: https://linuxmint.com/torrents/linuxmint-21.1-mate-64bit-beta.iso.torrent -[8]: https://linuxmint.com/torrents/linuxmint-21.1-xfce-64bit-beta.iso.torrent -[9]: https://github.com/linuxmint/mint21.1-beta/issues diff --git a/sources/news/20221205.1 ⭐️⭐️ Linen is a Google-Searchable Open-Source Alternative to Slack and Discord.md b/sources/news/20221205.1 ⭐️⭐️ Linen is a Google-Searchable Open-Source Alternative to Slack and Discord.md deleted file mode 100644 index e0478f7f27..0000000000 --- a/sources/news/20221205.1 ⭐️⭐️ Linen is a Google-Searchable Open-Source Alternative to Slack and Discord.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: subject: "Linen is a Google-Searchable Open-Source Alternative to Slack and Discord" -[#]: via: "https://news.itsfoss.com/linen/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Linen is a Google-Searchable Open-Source Alternative to Slack and Discord -====== - -An interesting open-source alternative to Slack and Discord. - -![Linen is a Google-Searchable Open-Source Alternative to Slack and Discord][1] - -Linen is an interesting open-source project brewing up. - -It aims to be an **open alternative to Slack and Discord**, focusing on making communities more accessible and helping reduce the support burden. - -It could be worth adding it as an open-source Slack alternative, but it is in its **early stages of development** when publishing this. - -**_What's different with Linen, exactly?_** - -- **Open Source** -- **Unlimited history retention** -- **Communities are Google searchable** -- **Supports sync from Slack and Discord** -- **Eliminate the need to join Slack/Discord for information** - -### Community-Focused Slack Alternative - -[Linen][2] pitches itself as an open-source app for communities rather than primarily targeting teams for collaboration/communication. - -![linen ui][3] - -In contrast, Slack is primarily for team discussions and collaboration. You cannot share the conversation through a URL or find the discussions indexed on search engines like Google. - -But with Linen, you can **find a URL for every conversation** that can be shared with anyone to view/join the conversation. - -![linen message url][4] - -Here's something for the test: [https://linen.dev/s/itsfoss/t/5099789/topic][5] - -**You can also find this conversation listed on Google** (it may take time to find it exactly). - -For example, suppose we are a community of an open-source project where we discuss an issue or a solution; listing it on Google enables more users to find out about it. - -Here's an example of a conversation listed on Google that could help me if I was exploring solutions to fix my code issues with Kotlin: - -![linen google search][6] - -As a developer/user, I could view the conversation, get my answer, and move on without troubling anyone else in the community with a repeat question. - -**Sounds lovely, right? Linen helps you enhance community support.** - -Sure, you can use it for your team communication as well. But, it is a more appropriate solution to create an open community chat network. - -Currently, it does not provide the feature to create a private community for the public. They only use it for internal team discussions, per their [GitHub page][7]. - -![][8] - -### How To Get Started? - -Linen does not support self-hosting at the moment. But, their roadmap on [GitHub][9] indicates that it has been planned for the near future. - -So, you can [sign up for a free account][10] using the official cloud instance or opt for the business/premium edition to use custom domain/branding benefits for your team. - -You can **import your Slack/Discord conversations for free**. - -> 💡 The free community edition is hosted under Linen.dev where you rely on community support. Opt for its premium edition to get priority support. - -Linen may not be for everyone, but it sounds like a useful idea for many communities and teams. - -_💬 What do you think about it? Let me know in the comments below._ - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/linen/ - -作者:[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/11/linen-slack-discord-alternative.png -[2]: https://www.linen.dev -[3]: https://news.itsfoss.com/content/images/2022/11/linen-example.png -[4]: https://news.itsfoss.com/content/images/2022/11/linen-conversation-url.png -[5]: https://linen.dev/s/itsfoss/t/5099789/topic -[6]: https://news.itsfoss.com/content/images/2022/11/linen-google-seo.png -[7]: https://github.com/linen-dev/linen.dev -[8]: https://news.itsfoss.com/content/images/2022/11/linen-settings.png -[9]: https://github.com/Linen-dev/linen.dev -[10]: https://www.linen.dev/signup diff --git a/sources/news/20221208.5 ⭐️⭐️ Apple Silicon GPU Driver is Now Available in Asahi Linux.md b/sources/news/20221208.5 ⭐️⭐️ Apple Silicon GPU Driver is Now Available in Asahi Linux.md deleted file mode 100644 index 8e115ba0d8..0000000000 --- a/sources/news/20221208.5 ⭐️⭐️ Apple Silicon GPU Driver is Now Available in Asahi Linux.md +++ /dev/null @@ -1,91 +0,0 @@ -[#]: subject: "Apple Silicon GPU Driver is Now Available in Asahi Linux" -[#]: via: "https://news.itsfoss.com/apple-gpu-driver-asahi-linux/" -[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Apple Silicon GPU Driver is Now Available in Asahi Linux -====== - -We finally have a GPU driver for Apple M silicon systems on Asahi Linux. - -![Apple Silicon GPU Driver is Now Available in Asahi Linux][1] - -Asahi Linux aims to be a port of Linux for Apple Silicon Macs; work started on it back in 2020, right after the launch of Apple's M1 chips at the WWDC event. - -A small team is behind all the development behind Asahi Linux and reverse engineering stuff; they have been quite busy since the last time we looked at their work. - -Previously, they worked on improving support for Apple SoCs such as the M1, M1 Pro, and M1 Max. They provided varying levels of support for devices that used these chips. - -It still is a work in progress, but promising results in 2022. - -They have now taken it further by providing initial support for Apple Silicon GPUs by releasing drivers (in _alpha_). - -That sounds great! 😃 - -Let me take you through the gist of it. - -### Hardware Acceleration With Desktop Environments and Old Games - -![asahi linux running quake3][2] - -Introduced as an alpha-stage GPU driver, it can run desktop environments and a few games smoothly. - -**The implementation:** The driver features a work-in-progress implementation of OpenGL 2.1 and OpenGL ES 2.0 for current Apple M-series systems. - -They also mention that: - -> These drivers have not yet passed the OpenGL (ES) conformance tests. There will be bugs! - -So, you can expect plenty of hiccups along the way should you choose to run applications using these drivers. - -**How it works now?:** In its current form, the driver can run desktop environments like GNOME and KDE Plasma with hardware acceleration. - -Even older games like [Quake3][3] and [Neverball][4] can run quite well, with these and the desktop environments running at a solid **60 fps at 4k resolution**. - -Many users may also notice that quite a few apps don't work with this driver right away. On that, the developers mention: - -> Since the driver is still in development, there are lots of known issues and we’re still working hard on improving conformance test results. Please don’t open new bugs for random apps not working! It’s still the early days and we know there’s a lot of work to do. - -**What does the future hold?:** The developers have said that while OpenGL (ES) 2 suffices for some applications, newer applications will require new features such as multiple render targets, multisampling, and transform feedback. - -All of this can be achieved with OpenGL (ES) 3, and work on that has already started. But, it will need a lot of developmental effort to get ready. - -They have also hinted at support for Vulkan in the future, although it is a long time in the making. - -Here's what they tell about it: - -> We’re working on it! Although we’re only shipping OpenGL right now, we’re designing with Vulkan in mind. Most of the work we’re putting toward OpenGL will be reused for Vulkan. We estimated that we could ship working OpenGL 2 drivers much sooner than a working Vulkan 1.0 driver, and we wanted to get hardware accelerated desktops into your hands as soon as possible. - -When a Reddit user [asked][5] about **120 Hz support for MacBook Pro**, one of the maintainers had this to say: - -> 120Hz is disabled because it still is capped at 60Hz if we do nothing and was having other weird issues. It's still unclear exactly how VRR works on macOS, we need to figure that out first. - -It seems like Asahi Linux has a lot of room to grow, and improvements like this to GPU drivers on a new Silicon system should finally open up new opportunities in terms of performance. - -Linux users have been asking for something like this for a long time, and it is now closer to becoming a reality than ever before. - -If you are feeling adventurous and want to try the new GPU driver, you can try installing it on your Asahi Linux system. Refer to the [official announcement][6] for instructions to experiment with it. - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/apple-gpu-driver-asahi-linux/ - -作者:[Sourav Rudra][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/sourav/ -[b]: https://github.com/lkxed -[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/apple-gpu-asahi-linux.png -[2]: https://news.itsfoss.com/content/images/2022/12/AsahiLinux_Quake3.jpg -[3]: https://ioquake3.org -[4]: https://neverball.org -[5]: https://www.reddit.com/r/AsahiLinux/comments/zeucpz/comment/iza3wwv/?utm_source=share&utm_medium=web2x&context=3 -[6]: https://asahilinux.org/2022/12/gpu-drivers-now-in-asahi-linux/ diff --git a/sources/news/20221208.6 ⭐️⭐️ Mastodon's Adoption Gets a Boost With Vivaldi Browser Integration.md b/sources/news/20221208.6 ⭐️⭐️ Mastodon's Adoption Gets a Boost With Vivaldi Browser Integration.md deleted file mode 100644 index 63cc15a25f..0000000000 --- a/sources/news/20221208.6 ⭐️⭐️ Mastodon's Adoption Gets a Boost With Vivaldi Browser Integration.md +++ /dev/null @@ -1,90 +0,0 @@ -[#]: subject: "Mastodon's Adoption Gets a Boost With Vivaldi Browser Integration" -[#]: via: "https://news.itsfoss.com/vivaldi-mastodon-integration/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Mastodon's Adoption Gets a Boost With Vivaldi Browser Integration -====== - -Vivaldi's making an effort to have more users join Mastodon with its new update. That's nice to see! - -![Mastodon's Adoption Gets a Boost With Vivaldi Browser Integration][1] - -Vivaldi browser is one of the best web browsers for Linux (Windows, macOS, and mobile platforms). - -I know it is not an open-source pick, but it gets all the lead with its tab management, customizability, and productivity features. And it treats me better than Firefox nowadays (Mozilla, we still need you to do better)🙄 - -**Note:**_Vivaldi is **not open-source**. Most of it is based on Chromium, for which you can find the [source code][2]._ - -If you did not know, Vivaldi recently built a Mastodon instance (**Vivaldi Social**) to encourage people to use open-source and decentralized social media platforms. - -It is one of the best Mastodon instances you can join: - -To take this further, **Vivaldi 5.6 update** has integrated access to its Mastodon instance from within its web browser. - -> 🐘 Hey! We are on [Mastodon][3] for a while; follow **us if you haven't already**! 😄 - -### Access Mastodon From Web Panels - -Web panels on Vivaldi make it a breeze to multitask. You can keep browsing or working on what you want and still access additional services in a single click. - -Here's what it looks like: - -![mastodon on vivaldi][4] - -I can access Vivaldi's Mastodon instance quickly. - -Of course, you can add your custom web panel for any Mastodon instance you like. - -![vivaldi web panel addition][5] - -However, I believe out-of-the-box integration should encourage Vivaldi users to try Mastodon if they haven't yet. - -In the official announcement, Vivaldi also explains it properly for its users: - -> [Vivaldi Social][6] came into existence as we love the idea of distributed social networks based on open standards. We want to offer better alternatives to people to communicate in an algorithm-free environment with no surveillance capitalism, devoid of tracking or data profiling.The Mastodon server platform communicates through the [Activity Pub][7] standard, a decentralized social networking and messaging protocol recommended by the [World Wide Web Consortium (W3C)][8]. Any platform or application that implements ActivityPub becomes a part of a massive social network. This big social network is also called the [Fediverse][9] (“federated” + “universe”). - -Before anyone gets their pitchfork ready, I want Vivaldi to be 100% open-source, but we also want more companies in the mainstream to adopt and encourage the use of open-source tech. - -And I think Vivaldi has got an excellent approach to that. - -So, this integration should ultimately let every Vivaldi (or Linux user) use Mastodon more than often. - -In addition to this change, Vivaldi 5.6 release involves a couple of improvements that include: - -- A new search engine (You.com) -- Panels joining editable toolbars -- Revamped settings page -- Pin tab stacks (_this is exciting!_) - -You can update the browser to get the latest version or download Vivaldi 5.6 on its official website. - -[Download Vivaldi 5.6][10] - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/vivaldi-mastodon-integration/ - -作者:[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/mastodon-integration-in-vivaldi-browser-1.png -[2]: https://vivaldi.com/source/ -[3]: https://mastodon.social/web/@itsfoss -[4]: https://news.itsfoss.com/content/images/2022/12/mastodon-vivaldi.jpg -[5]: https://news.itsfoss.com/content/images/2022/12/add-custom-panel.jpg -[6]: https://vivaldi.com/blog/news/vivaldi-social-a-new-mastodon-instance/ -[7]: https://en.wikipedia.org/wiki/ActivityPub -[8]: https://www.w3.org/ -[9]: https://en.wikipedia.org/wiki/Fediverse -[10]: https://vivaldi.com/download/ 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 197795acea..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: "CanYellow" -[#]: 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/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/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 258d401019..0000000000 --- a/sources/talk/20210209 Understanding Linus-s Law for open source security.md +++ /dev/null @@ -1,90 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (CanYellow) -[#]: 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/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/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/20220825 Happy birthday, Linux! Here are 6 Linux origin stories.md b/sources/talk/20220825 Happy birthday, Linux! Here are 6 Linux origin stories.md deleted file mode 100644 index ba0c619a0b..0000000000 --- a/sources/talk/20220825 Happy birthday, Linux! Here are 6 Linux origin stories.md +++ /dev/null @@ -1,131 +0,0 @@ -[#]: subject: "Happy birthday, Linux! Here are 6 Linux origin stories" -[#]: via: "https://opensource.com/article/22/8/linux-birthday-origin-stories" -[#]: author: "AmyJune Hineline https://opensource.com/users/amyjune" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Happy birthday, Linux! Here are 6 Linux origin stories -====== -Our contributors share their first Linux experience on the 31st anniversary of the Linux kernel. - -On August 25, 1991, Linux 0.01 was announced. All of us have a story to tell about Linux. I told my story a couple of months ago, but for those who weren't here: My first exposure to Linux was when my grassroots hospice organization moved from paper to digital charting. We didn't have the funding to get something proprietary, but the IT department had Linux set up on our old machine, and we used the GNOME desktop and OpenOffice to start our journey in creating digital assets. - -I recently asked some Opensource.com authors this simple question: - -*What was your first Linux experience?* - -### From VAX to Linux - -For my junior year of high school, I was shipped off to a state-run "nerd farm" (that's the North Carolina School of Science and Mathematics.) Our first day on campus, the juniors were each assigned a senior big brother or sister. My senior big sister ditched me because she had tickets to go to a big outdoor music festival with her boyfriend, but when they came back all sunburned, we hung out in my mostly empty dorm room eating takeout on the floor. That was when I first met Matt. - -As the year wound on, Matt showed me how to help as a student sysadmin changing backup reels for the VAX mainframe and doing basic tasks on the "big" workstation that doubled as a campus-wide UNIX server. He had a PC in his room, with GNU and XWindows on a Minix kernel, but found this cool new alternative that some Finnish student had started posting the source code for on Usenet. I knew, right then and there, that was my future. - -When I got home for the summer, the first thing I did was buy a shiny new 486 with some of my savings from odd jobs, fired up a SLIP connection through our local BBS, and downloaded and decoded all the bits and pieces I'd need to bootstrap and compile Linux 0.96. - -Matt and I mostly lost touch after he graduated, but I'll always owe him for introducing me to the operating system kernel I'd use for the rest of my life. I think of him every time I see that tattered old copy of **Running Linux** adorning my office shelf. - -The "Matt" in this story is Matthew D. Welsh. After we lost touch, he became the original maintainer of [The Linux Documentation Project][2], and the author of the first edition of the O'Reilly Press book **Running Linux**. - -**[—Jeremy Stanley][3]** - -### Computer club - -Friends at a [computer club][4] inspired me to try Linux. - -I used Linux to help students learn more about other operating systems from 2012 to 2015, and I would say that Linux has taught me more about computers in general. - -It has probably affected my "volunteer career" because to this day I write articles about being a neurodiverse person in the Linux world. I also attend and join different Linux events and groups, so I've had access to a community I probably wouldn't have known otherwise. - -**[—Rikard Grossman-Nielsen][5]** - -### Galaxy - -My Linux story started a long time ago in a galaxy far, far away. In the early 90s, I spent a year in the US as a high school student. Over there, I had access to e-mail and the Internet. When I came back home to Hungary, I finished high school without any Internet access. There were no public Internet providers in Hungary at that time. Only higher education, and some research labs, had Internet. But in 1994, I started university. - -The very first wee of school, I was at the IT department asking for an email address. At that time, there was no Gmail, Hotmail, or anything similar. Not even teachers got an email address automatically at the university. It took some time and persistence, but I eventually received my first university email address. At the same time, I was invited to work in the faculty-student IT group. At first, I got access to a Novell and a FreeBSD server, but soon I was asked to give Linux a try. - -It was probably late 1994 when I installed my first Linux at home. It was Slackware, from a huge pile of floppy disks. At first, I only did a minimal installation, but later I also installed X so I could have a GUI. In early 1995, I installed my first-ever Linux server at the university on a spare machine, which was also the first Linux server at the university. At that time, I used the [Fvwm2][6] window manager both at home and at the university. - -At first, I studied environmental protection at the university, but my focus quickly became IT and IT security. After a while, I was running all the Linux and Unix servers of the faculty. I also had a part time job elsewhere, running web and e-mail servers. I started a PhD about an environmental topic, but I ended up in IT. I've worked with FreeBSD and Linux ever since, helping [sudo][7] and `syslog-ng` users. - -**[—Peter Czanik][8]** - -### Education - -I got introduced to Linux in the late 1990s by my brother and another friend. My first distro was Red Hat 5, and I didn't like it at the time. I couldn't get a GUI running, and all I could see was the command-line, and I thought, "This is like MS-DOS." I didn't much care for that. - -Then a year or more passed, and I picked up a copy of Red Hat 6.1 (I still have that copy) and got it installed on and HP Vectra with a Cyrix chip installed. It had plenty of hard disk space, which was fortunate because the Red Hat Linux software came on a CD. I got the GUI working, and set it up in our technology office at the school district I was employed at. I started experimenting with Linux and used the browser and Star Office (an ancestor of the modern [LibreOffice][9]), which was part of the included software. - -A couple years later, our school district needed a content filter, and so I created one on an extra computer we had in our office. I got Squid, Squidguard, and later Dansguardian installed on Linux, and we had the first self-hosted open source content filter in a public school district in Western New York State. Using this distribution, and later Mandrake Linux (an ancestor of [Mageia][10] Linux) on old Pentium II and Pentium III computers, I set up devices that used [SAMBA][11] to provide backup and profile storage for teachers and other staff. Teaming with members of area school districts I set up spam filtering for a fraction of the cost that proprietary solutions were offering at the time. - -Franklinville Central School District is situated in an area of high rural poverty. I could see that using Linux and open source software was a way to level the playing field for our students, and as I continued to repurpose and refurbish the "cast-off" computers in our storage closets, I built a prototype Linux terminal server running Fedora Core 3 and 4. The software was part of the K12LTSP project. Older computers could be repurposed and PXE booted from this terminal server. At one point, we had several computer labs running the LTSP software. Our staff email server ran on RHEL 2.1, and later RHEL 3.0. - -That journey, which began 25 years ago, continues to this day as I continue to learn and explore Linux. As my brother once said, "Linux is a software Erector set." - -**[—Don Watkins][13]** - -### Out in the open - -My first experience with Linux was brief, and it involved a lot of floppies. As I recall, it was entertaining until my dear wife discovered that her laptop no longer had Windows 98 installed (she was only moderately relieved when I swapped back in the original drive and the "problem" disappeared). That was around 1998, with a Red Hat release that came with a book and a poor unsuspecting ThinkPad. - -But really, at work I always had a nice Sun Workstation on my desktop, so why bother? In 2005, we decided to move to France for a while, and I had to get a (usefully) working Toshiba laptop, which meant Linux. After asking around, I decided to go with Ubuntu, so that was my first "real" experience. I think I installed the first distro (codenamed Warty Warthog,) but soon I was on the latest. There were a few tears along the way, caused mostly by Toshiba's choice of hardware, but once it was running that darned laptop was every bit as fast, and way more functional, for me than the old Sun. Eventually, we returned home, and I had a nice new Dell PC desktop. I installed Feisty Fawn, and I've never looked back. - -I've tried a few other distros, but familiarity has its advantages, particularly when configuring stuff at the lowest of levels. Really though, if forced to switch, I think I would be happy with any decent Linux distro. - -At a few points in time, I have had to do "kernel stuff", like bisecting for bugs and fiddling around with device drivers. I really can't remember the last time something that complicated was necessary, though. - -Right now, I have two desktops and one laptop, all running Ubuntu 22.04, and two aging Cubox i4-pro devices running Armbian, a great Debian-based distro created for people using single-board computers and similar devices. I'm also responsible for a very small herd of various virtual private running several distros, from CentOS to various versions of Ubuntu. That's not to mention a lot of Android-based stuff laying around, and we should recognize that it's Linux, too. - -What really strikes me, as I read this back over, is how weird it all must sound to someone who has never escaped the clutches of a proprietary operating system. - -**[—Chris Hermansen][15]** - -### Getting involved - -The first computer I bought was an Apple, the last Apple was a IIe. I got fed up with the strong proprietorship of Apple over the software and hardware, and switched to an Amiga, which had a nice GUI (incidentally, I have never owned another Apple product.) - -Amiga eventually crumbled, and so I switched to Windows—what an awful transition! About this time, somewhere in the mid- to latter-90s, I was finding out about Linux, and began reading Linux magazines and how to set up Linux machines. I decided to set up a dual-boot machine with Windows, then bought Red Hat Linux, which at the time came on a number of floppy disks. The kernel would have been 2.0-something. I loaded it on my hard drive, and Presto! I was using Linux—the command-line. At that time, Linux didn't read all of your hardware and make automatic adjustments, and it didn't have all the drivers you needed, as it does today. - -So next came the process of looking up in BBSes or wherever to find out where to get drivers for the particular hardware I had, such as the graphics chip. Practically, this meant booting into Windows, saving the drivers to floppy disk, booting back into Linux, and loading the drivers to the hard drive. You then had to hand-edit the configuration files so that Linux knew which drivers to use. This all took weeks to accomplish, but I can still recall the delight I felt when I typed `startx`, and up popped X-Windows!! - -If you wanted to update your kernel without waiting for and buying the next release, you had to compile it yourself. I remember I had to shut down every running program so the compiler didn't crash. - -It's been smooth sailing ever since, with the switch to Fedora (then called "Fedora Core"), and the ease of updating software and the kernel. - -Later, I got involved with the [Scribus][16] project, and I started reading and contributing to the mail list. Eventually, I began contributing to the documentation. Somewhere around 2009, Christoph Schaefer and I, communicating over the internet and sharing files, were able to write **Scribus, The Official Manual** in the space of about 9 months. - -**[—Greg Pittman][17]** - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/8/linux-birthday-origin-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/sites/default/files/lead-images/rh_003499_01_linux31x_cc.png -[2]: https://tldp.org/ -[3]: https://opensource.com/users/fungi -[4]: https://opensource.com/article/22/5/my-journey-c-neurodiverse-perspective -[5]: https://opensource.com/users/rikardgn -[6]: https://opensource.com/article/19/12/fvwm-linux-desktop -[7]: https://opensource.com/article/22/8/debunk-sudo-myths -[8]: https://opensource.com/users/czanik -[9]: https://opensource.com/article/21/9/libreoffice-tips -[10]: http://mageia.org -[11]: https://opensource.com/article/21/12/file-sharing-linux-samba -[12]: https://opensource.com/article/22/5/essential-linux-commands -[13]: https://opensource.com/users/don-watkins -[14]: https://www.redhat.com/sysadmin/linux-kernel-tuning -[15]: https://opensource.com/users/clhermansen -[16]: http://scribus.net -[17]: https://opensource.com/users/greg-p diff --git a/sources/talk/20220914 Why Enterprises Should Opt for Platform as a Service.md b/sources/talk/20220914 Why Enterprises Should Opt for Platform as a Service.md deleted file mode 100644 index e2a6004472..0000000000 --- a/sources/talk/20220914 Why Enterprises Should Opt for Platform as a Service.md +++ /dev/null @@ -1,125 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Why Enterprises Should Opt for Platform as a Service -====== -*Platform as a Service enables quick and easy creation of Web applications without the necessity of buying and maintaining the software and infrastructure underneath it. This article explains why it’s useful.* - -Platform as a Service (PaaS) refers to cloud computing services that provide a platform for customers to develop, run and manage applications without the complexity of building and maintaining the infrastructure associated with developing and launching them. This is the core platform on which cloud native applications and supporting systems are based. - -PaaS typically involves diverse application software infrastructure capabilities including application platforms, integration platforms, business analytics platforms, event-streaming services and mobile back-end services. In addition, it includes a set of monitoring, management, deployment and related capabilities. - -Developers are keen on getting their environments up without waiting, while operations teams care about performance and stability. This often gives rise to some conflict between them. PaaS creates a peaceful environment for both groups. An application platform delivered as a service is described as PaaS, and is used to deploy the user code. Cloud Foundry, Cloudify and OpenShift open source environments can be used as PaaS. - -### PaaS adoption pattern - -Cloud computing must satisfy five essential characteristics — on demand service, access network, resource pooling, elasticity and measured services. To achieve these, cloud computing provides three kinds of service models: Software as a Service (SaaS), Platform as a Service (PaaS) and Infrastructure as a Service (IaaS). - -The key business drivers of PaaS adoption are: - -* Reduction of capex and opex to deliver business services -* Minimising IT costs by improving the delivery time and quality of the application development and delivery -* Increasing the flexibility and integration between middleware components - -**Simple PaaS** is the entry point into the PaaS space. It allows provisioning of application services and exposes them into a self-service catalogue; it automates the deployment and meters the resources used by this service. - -*Manage PaaS* manages the SLA and QoS aspects of the provisioned applications such as resiliency, application performance, security, etc. - -*Programming PaaS* allows applications to integrate with external applications or public clouds, and to implement auto-scaling and cloud-bursting scenarios. - -*Process-oriented PaaS* allows implementation of a DevOps process by creating a continuous delivery flow that automates the build, test and delivery of applications into a cloud environment. - -In addition to these adoption patterns, there are other variations of PaaS, as listed below. These variations might align to one of the patterns explained above. - -**iPaaS:** Integration Platform as a Service (iPaaS) is a suite of cloud services that enables development, execution and governance of integration flows connecting any combination of on-premises and cloud-based processes, services, applications and data within individuals or across multiple organisations. Examples are MuleSoft CloudHub and BizTalk. - -**mPaaS:** Mobile Platform as a Service (mPaaS) is a provision of an interactive development environment (IDE) for the creation of mobile apps. It supports multiple mobile operating platforms. - -**dbPaaS:** Database Platform as a Service (dbPaas) is an on-demand, secure and scalable self-service database platform that automates the provisioning and administration of databases. dbPaaS makes it easier to scale databases and makes them more reliable. - -**IoTPaaS:** This provides common infrastructure to enable communication, security, analytics and management for heterogeneous IoT topologies. It provides simpler and agile models for building IoT solutions. - -**bpmPaaS:** Business process management PaaS (bpmPaaS) is a complete pre-integrated BPM platform hosted in the cloud and delivered as a service. It is leveraged for the development and execution of business processes and workflow-centric applications across enterprises. Examples are Pega cloud, and OpenText Cordys cloud. - -Some basic characteristics of PaaS are: - -* Services to develop, test, deploy, host and maintain applications in the same integrated development environment -* Multi-tenant architecture, in which multiple concurrent users use the same development application -* Built-in scalability of deployed software, including load balancing and failover -* Integration with heterogeneous platforms and systems -* Support for development team collaboration -* Tools to handle billing and subscription management - -### Key open source Platforms as a Service - -Before choosing a PaaS, enterprises must consider the following: - -* Deployment flexibility -* Ease of operations -* Choice of application stacks -* Language, database and framework support -* Scaling capabilities -* QoS -* Tooling for development and operations -* How well it fits your business - -Let’s now take a quick look at some popular open source PaaS. - -**Cloud Foundry:** This PaaS provides a choice of clouds, developer frameworks and application services. Cloud Foundry makes it faster and easier to build, test, deploy and scale applications. - -It has different distributions, of which the popular ones are Pivotal and IBM. It contains application runtime and container runtime. It also has Pivotal application service and Pivotal container service. - -**OpenShift:** This is Red Hat’s cloud computing PaaS offering. It is an application platform in the cloud, where application developers and teams can build, test, deploy and run their applications. - -**Cloudify:** Cloudify was developed and designed on the principles of openness to power the IT transformation revolution. It enables organisations to design, build and deliver various business applications and network services. The latest version of Cloudify is 4.3, which incorporates enhanced features like advanced security, control and true self-service. Cloudify 4.3 introduced a totally new concept for container orchestration with Kubernetes. - -| Functionality | Cloud Foundry | Cloudify | OpenShift | -| :- | :- | :- | :- | -| Core functionality | Cloud controller | Manager | Broker | -| Providing third party database services | Service broker | Agent | Cartridge | -| Routing of incoming traffic | Router | Manager | REST API | -| Querying the state of apps | Cloud controller | CLI client | Broker | -| Messaging | Message bus | Manager | Broker | -| App instance management | Droplet execution agent | Agent | Node | -| Application state management | Health manager | Manager | Broker | -| Broker | Warden | Agent | Gear | -| Load balancing of user requests | Droplet execution agent | Manager | Broker | -| Framework provider | Blob store | Agent | Cartridge | -| Technology | -| Languages | Java, Ruby, Scala, Node.js, Groovy, Grails, PHP, Go, Python | Java, PHP, Ruby | Java, Ruby, Node.js, PHP, Python, Perl, JavaScript | -| Databases | MongoDB, MySQL, -PostgreSQL | MySQL, MongoDB | MongoDB, MySQL, PostgreSQL | -| Frameworks | Spring, Rails, Grails, Play Sinatra | JavaScript, Node.js | Rails, Flask, Django, Drupal, Vertx | -| Horizontal scaling | Yes | Yes | Yes | -| Vertical scaling | Yes | No | Yes | -| Auto scaling | Yes | Yes | Yes | - -Table 1 lists the basic functionality and its corresponding Cloud Foundry, Cloudify and OpenShift architectural components. This is purely based on my views and the authenticity of the features supported needs to be validated with the cloud provider. - -From the industry adoption statistics we can clearly make out that PaaS adoption is picking up very rapidly. PaaS enables enterprise applications to be cloud-agnostic, so that they can run on any cloud platform — whether public or private. This means that a PaaS application developed on Amazon AWS can easily be ported to Microsoft Azure, to VMWare vSphere, to Red Hat RHEV, etc. - -PaaS is useful when multiple developers are working on a development project or when external users need to collaborate with the development process. So it is best suited for agile software development, because it eases the difficulties around rapid development and iteration of software. - -### Acknowledgements - -The author thanks Kiran M.R. and Raju Alluri of the digital architecture practice of Wipro Ltd for giving their time and support to this article. - --------------------------------------------------------------------------------- - -via: https://www.opensourceforu.com/2022/09/why-enterprises-should-opt-for-platform-as-a-service/ - -作者:[Gopala Krishna Behara][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/gopalakrishna-behara/ -[b]: https://github.com/lkxed diff --git a/sources/talk/20220919 I got my first pull request merged!.md b/sources/talk/20220919 I got my first pull request merged!.md deleted file mode 100644 index a1d2a7c32a..0000000000 --- a/sources/talk/20220919 I got my first pull request merged!.md +++ /dev/null @@ -1,94 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -I got my first pull request merged! -====== -Experience the joy that contributing to open source brings. - -![Dandelion zoomed in][1] - -Image by: Photo by Rob Tiller, CC BY-SA 4.0 - -Words cannot express my joy when I got the notification about the merge below, and I owe it to my current engineering school, [AltSchool Africa][2]. - -![successful merge message][3] - -Before this, I had been introduced to open source many times, told about its importance in the tech space, and even attended open source conferences (e.g., OSCAFest). I had all the instant excitement to start, but imposter syndrome set in on opening GitHub to create something. - -Fast forward to Monday, the 8th of August, 2022, when I watched Bolaji's video on contributing to open source. I felt pumped again, but I wanted to apply what I learned, so I noted some steps. - -The steps: - -1. I made up my mind I was going to contribute to a project. -2. I was focused on a site ([good first issue][4]) to pick my first project from, which I filtered to suit my skill level. I kept opening the next page till I found one. -3. I made sure I was equipped with the required [Git and GitHub][5] knowledge to complete the project. - -### The project - -After long hours searching for projects, I finally found one titled, [Ensure no missing alt attributes][6]. I was to give descriptive alt values to images from the site. Alt values in images help to improve the accessibility of the site such that screen readers can provide a detailed description of the image to, say, a visually impaired person. Easy right? Yes, but if I didn't make up my mind to get the first contribution, I wouldn't find it, and open source would continue to be a myth to me. - -I was still pumped until I discovered it was from [MDN][7]. Wait, MDN? As in Mozilla developer? Will they merge my contribution even with how seemingly easy it looks? [Imposter syndrome][8] set in. - -Upon checking the issue, I saw that people were already contributing. I summoned my courage and started reading about it. Taking my time to read and understand the project and how I needed to approach the issue was another challenge I had to overcome. - -The project is as easy as you try to understand it. - -So, I picked two images to begin with. I gave alt values to them, committed my changes, then made a pull request. The time between when I made the pull request and when I got the approval mail was full of self-doubts. Should I close the pull request? This is MDN. Well, it's not coding... What if I don't get merged? I might never contribute again. All it took to clear all of the doubts were the emails I got from my reviewer below: - -![Email of approved pull request][9] - -![mail showing that pull request has been merged][10] - -![congratulatory mail on contributing and merging of pull request][11] - -I was indeed delighted, and this inspired me to check for more. It gave me the courage I needed to request additional issues to solve. - -![Mail of issue assignment][12] - -### Summary - -A few lessons I'd love you to take home from this article are: - -* Open source is for all. Do you see that typo on that site you just visited? You helping to correct it is a way of contributing. -* No skillset is too small. A basic understanding of HTML was what I needed to contribute. -* Only you can stop yourself from contributing. -* The first contribution is all you need to get the ball rolling. - -I hope you have been able to pick something from my story and apply it today. This is another space I'd like to keep contributing to, so see you in my next article, and happy open sourcing! - -*[This article originally appeared on I got my first Pull Request merged! and is republished with permission.][13]* - -Image by: (Awosise Oluwaseun, CC BY-SA 4.0) - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/9/first-pull-request-merged - -作者:[Oluwaseun][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/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 diff --git a/sources/talk/20221001 What-s new with Awk-.md b/sources/talk/20221001 What-s new with Awk-.md index 3f6a791230..dc8e496c05 100644 --- a/sources/talk/20221001 What-s new with Awk-.md +++ b/sources/talk/20221001 What-s new with Awk-.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/22/10/whats-new-awk" [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lkxed" -[#]: translator: " " +[#]: translator: "connermemory" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " diff --git a/sources/talk/20221016.0 ⭐️⭐️ What’s new in GNOME 43.md b/sources/talk/20221016.0 ⭐️⭐️ What’s new in GNOME 43.md deleted file mode 100644 index 3e6109f32f..0000000000 --- a/sources/talk/20221016.0 ⭐️⭐️ What’s new in GNOME 43.md +++ /dev/null @@ -1,74 +0,0 @@ -[#]: subject: "What’s new in GNOME 43?" -[#]: via: "https://opensource.com/article/22/10/whats-new-gnome-43-linux" -[#]: author: "Jim Hall https://opensource.com/users/jim-hall" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -What’s new in GNOME 43? -====== - -I love the [GNOME][1] desktop, and I use it as my daily [Linux desktop environment][2]. I find with GNOME, I can focus on the stuff I need to get done, but I still have flexibility to make the desktop look and act the way I want. - -The GNOME Project recently released GNOME 43, the latest version of the GNOME desktop. I met with GNOME developer Emmanuele Bassi to ask a few questions about this latest release: - -**Jim Hall (Jim): GNOME has lots of great desktop features. What are some of the new features in GNOME 43?** - -**Emmanuele Bassi (Emmanuele):** GNOME 43 has a complete redesign of the system status menu in the Shell. The new design is meant to give quick and easy access to various settings: network connections and VPNs; audio input and output sources and volumes; toggling between light and dark styles. It also has a shortcut for taking a screenshot or starting a screen recording. - -GNOME core applications have also been ported to the new major version of the GNOME toolkit, GTK4. GTK4 is more efficient when it comes to its rendering pipeline, which leads to smoother transitions and animations. Additionally, GNOME applications use libadwaita, which provides new UI elements and adaptive layouts that can seamlessly scale between desktop and mobile form factors. - -The GNOME file manager, Nautilus, is one of the applications that has been ported over to GTK4 and libadwaita, and it has benefitted from the new features in the core platform; it’s now faster, and it adapts its UI when the window is resized. - -The system settings can now show device security information, including manufacturing errors and hardware misconfiguration, as well as possible security issues like device tampering. Lots of work is planned for future releases, as device security is an area of growing concern. - -**Jim: What do you love most about GNOME 43?** - -**Emmanuele:** The most important feature of GNOME, one that I constantly take advantage of and that I always miss when I have to deal with other operating systems is how much the OS does not get in the way of what I’m doing. Everything is designed to let me concentrate on my job, without interruptions. I don’t have bells and whistles constantly on my screen, competing for attention. Everything is neatly tucked away, ready to be used only when I need to. - -**Jim: Many folks are familiar with GNOME today, but may not be familiar with its history. How did GNOME get started?** - -**Emmanuele:** GNOME started in 1997, 25 years ago, as a project for using existing free and open source components to create a desktop environment for everyone that would be respectful of users’ and developers’ freedom. At the time there were only commercial desktops for Unix, or desktops that were based on non-free components. Being able to take the entire desktop, learn from it, and redistribute it has always been a powerful motivator for contributors—even commercial ones. - -Over the past 25 years, GNOME contributors have worked not just on making the desktop, but creating a platform capable of developing and distributing applications. - -**Jim: Open source projects keep going because of a strong community. What keeps the GNOME community strong?** - -**Emmanuele:** I don’t pretend to speak for everyone in the project, but for myself I think the main component is the respect of every voice within the community of contributors, which comes from the shared vision of creating an entirely free and open platform. We all know where we want to go, and we are all working towards the same goal. Sometimes, we may end up pulling in different directions, which is why donating to entities like the GNOME Foundation, which sponsor gatherings and conferences, is crucial: they allow a more comprehensive communication between all the involved parties, and at the end we get better results for it. - -GNOME also takes very seriously respectful communication between members of the community; we have a strong code of conduct, which is enforced within the community itself and covers all venues of communication, including in person events. - -**Jim: GNOME established the Human Interface Guidelines (HIG) to unify the GNOME design and GNOME app interfaces. How did the HIG come about?** - -**Emmanuele****:**The Human Interface Guidelines (HIG) came into being after Sun did a usability study on GNOME 1, one of the very first usability studies for a free software project. The findings from that study led to the creation of a standardized document that projects under the GNOME umbrella would have to follow, which is how we ended up with GNOME 2, back in 2002. - -The HIG was a rallying point and a symbol, a way to demonstrate that the entire project cared about usability and accessibility, and it provided the tools to both desktop and application developers to create a consistent user experience. - -Over the years, the HIG moved away from being a complete checklist of pixels of padding and grids of components, and instead it now provides design principles, UI patterns, conventions, and resources for contributors and application developers. The HIG now has its own implementation library, called libadwaita, which application developers can use when targeting GNOME, and immediately benefit from a deeper integration within the platform without having to re-implement the various styles and patterns manually. - -_Thanks to Emmanuele Bassi for answering this interview. You can find GNOME at_[_https://www.gnome.org/_][3] - -_Read the release announcement for GNOME 43 at_[_https://release.gnome.org/43/_][4] - -_Learn about what’s new in GNOME 43 for developers at_[_https://release.gnome.org/43/developers/_][5] - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/10/whats-new-gnome-43-linux - -作者:[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/article/19/12/gnome-linux-desktop -[2]: https://opensource.com/article/20/5/linux-desktops -[3]: https://www.gnome.org/ -[4]: https://release.gnome.org/43/ -[5]: https://release.gnome.org/43/developers/ diff --git a/sources/talk/20221019.5 ⭐️⭐️ Our open source startup journey.md b/sources/talk/20221019.5 ⭐️⭐️ Our open source startup journey.md deleted file mode 100644 index c95461a3c6..0000000000 --- a/sources/talk/20221019.5 ⭐️⭐️ Our open source startup journey.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Our open source startup journey -====== - -[ToolJet][1] is an open source, low-code framework for rapidly building and deploying internal tools. Our codebase is 100% JavaScript and TypeScript. - -A lone developer in April 2021 started ToolJet. The public beta launched in June 2021 and was an instant hit. With this traction, ToolJet raised funding, and currently, we have a team of 20 members. - -### Why open source? - -Before working on ToolJet, I worked with a few enterprise clients as a consultant. Many of these clients were large enough to build and maintain dozens of internal tools. Despite the constant requests from sales, support, and operations teams to add more features and fix the bugs in their internal tools, engineering teams struggled to find the bandwidth to work on the internal utilities. - -I tried using a few platforms to build and maintain internal tools. Most of these tools were very expensive, and frequently, they didn't really fit the requirements. We needed modifications, and most utilities didn't support on-premise hosting. - -As a Ruby developer, I primarily used ActiveAdmin and RailsAdmin to build internal tools. Both utilities are amazing, but making them work with more than one data source is difficult. I then realized there is a need in the market for a framework that could build user interfaces and connect to multiple data sources. I believe any tool built for developers should be open source. Most of the tools and frameworks that developers use daily result from people from all over the world collaborating in public. - -### The first commit - -Building something like ToolJet needed a full-time commitment. Selling one of my side projects gave me a runway of 5-6 months, and I immediately started working on an idea I'd had in mind for at least two years. - -The first commit (rails new) of ToolJet was on April 1, 2021. - -Wait! I said the codebase is 100% JavaScript. Continue reading to discover why. - -### Building and pitching investors - -I sat in front of my screens for most of April and May, coding and pitching to investors for a pre-seed round. - -My work also included creating the drag-and-drop application builder, documenting everything, ensuring there was documentation for setting ToolJet up on popular platforms, creating a website, creating posters and blog posts for launch, and more. The process went well without any major challenges. At this point, the frontend of ToolJet was built using React, with the backend using Ruby on Rails. - -While the coding was going well, investor pitches weren't going great. I sent around 40 cold emails to venture capitalist firms and "angel investors" focused on early-stage funding. While most of them ignored the email, some shared their reason for rejection, and some scheduled a call. - -Most of the calls were the same; I couldn't convince them of an open source business model. - -### The launch - -June 7th was the day of the launch. First, we launched on ProductHunt. Six hours passed, and there were only 70 new signups. But we were trending as the #1 product of the day (and ended up as the #3 product of the week). For posterity, here's the original [post][2]. - -I also posted on [HackerNews][3] around 6 PM, and within an hour, the post was #1. I was very happy that many visitors signed up and starred the repository. Many of these visitors and users reported bugs in the application and documentation. Within eight hours of posting on HN, more than 1,000 GitHub users starred ToolJet's GitHub repository, and there were hundreds of signups for ToolJet cloud. The trend continued for three days, and the repo had 2.4k stars. - -![ToolJet repo stats on GitHub][4] - -Image by: - -GitHub StarTrack for ToolJet. (Navaneeth PK, CC BY-SA 4.0) - -### Getting funding - -The traction on GitHub was enough to be noticed by the venture capitalist (VC) world. The days following the launch were packed with calls. We had other options, but did not consider seriously consider them, including: - -- Bootstrapping: During the early stages of the product, it was hard to find paying customers, and I did not have enough savings to fund the project until that happened. -- Building as a side project: While this strategy works great for smaller projects, I didn't feel it would work for ToolJet because we needed to create dozens of integrations and UI widgets before the platform could become useful for customers. As a side project, it might take months or years to achieve that. - -I knew it could take months to build the platform I wanted if ToolJet became just a side project. I wanted to accelerate growth by expanding the team, and VC funding was the obvious choice, given the traction. - -The good news is that we raised[$1.55 million in funding][5] within two weeks of the HN launch. - -### Stack matters in open source - -Soon after the launch, we found that many people wanted to contribute to ToolJet, but they were mostly JavaScript developers. We also realized that for a framework like ToolJet that in the future should have hundreds of data source connectors, only a plugin-based architecture made sense. We decided to migrate from Ruby to TypeScript in August 2021. Even though this took about a month and significant effort, this was one of the best decisions we've made for the project. Today, we have an extensible plugin-based architecture powered by our [plugin development kit][6]. We have contributions from over 200 developers. We've written extensively about this migration [here][7] and [here][8]. - -### Launching v1.0 - -Many users have been using ToolJet on production environments since August, and the platform did not show any stability or scalability issues. We were waiting to wrap up the developer platform feature before we called it v1.0. The ToolJet developer platform allows any JavaScript developer to build and publish plugins for ToolJet. Developers are now able to make connectors for ToolJet. Creating a ToolJet connector can take just 30 minutes, including integration tests. - -### Building a growing community - -![ToolJet star history][9] - -Image by: - -ToolJet Star History (Navaneeth PK, CC BY-SA 4.0) - -We didn't spend money on marketing. Most of our efforts in spreading the news about ToolJet have been writing about our learnings and being active in developer communities. We have a team of three members who take care of community queries. - -### The business model - -ToolJet won't be a sustainable business without a [commercial product][10] to pay the bills. We've built an enterprise edition of ToolJet, for which customers must pay. There's no limit on usage for the free community edition, and additional features in the enterprise edition are relevant only to large teams. We have very large companies as paying customers right now, but we haven't started monetizing ToolJet aggressively. We have enough money left in the bank to build an even better ToolJet, so our focus currently is on product improvement. - -### What's next? - -We frequently release better versions of ToolJet with the help of constant feedback and contributions from the open source community. Many major improvements and dozens of connectors and UI components are in progress. We're moving faster than ever towards our initial goal of being the open framework that can connect to hundreds of data sources and build even the most complicated user interfaces! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/10/tooljet-open-source-journey - -作者:[Navaneeth PK][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/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 diff --git a/sources/talk/20221028.1 ⭐️⭐️ Write documentation like you develop code.md b/sources/talk/20221028.1 ⭐️⭐️ Write documentation like you develop code.md deleted file mode 100644 index eb64f1fb7a..0000000000 --- a/sources/talk/20221028.1 ⭐️⭐️ Write documentation like you develop code.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Write documentation like you develop code -====== - -Don't want documentation to be an afterthought? Try a new approach. - -Many engineers and craftspeople are particular about their tools. To do a job well, you need the best tools and the skills to use them. The best tools in software development can be very powerful when applied to other kinds of digital creation. The [Docs as Code][1] approach is a great example. Docs as Code entails writing documentation using the same tools and workflows used for developing code. Proponents of Docs as Code report that this method leads to better documentation while easing the workload of the people who write it. - -### Text formats and source control - -The most significant adjustment when moving from a more traditional documentation platform to the Docs as Code approach is that the content is stored in a text-based markup format. This change makes all the tools for text-based materials available for generating documentation. Whether you choose [DocBook][2], [Markdown][3], or another markup language, the transition from using just one tool to using a standard format and a variety of tools is a big change. - -Finding tools that support your workflow is really important. Many developers use their [coding editors][4] when working on Docs as Code projects. Since they are already advanced-level users with that tool, it works well for them. Finding tooling that fits the other professionals on the team, such as technical writers, editors, information architects, and documentation product owners, may take more effort. A few options to consider: - -- One of the many [good markdown editors][5] available -- Coding editors with good preview tools, which make them approachable for non-coders -- The web interfaces of popular Git hosting services, especially for occasional contributors - -Once content is safely in a markup format, the project can use source control such as [Git][6], an open source tool with many more features than most documentation platforms can claim: - -- A clear and detailed version history of who changed what and when. If you have good commit message culture, you may even be able to learn why the change was made. -- Easy parallel change processes. Working in branches in Git means everyone can make all the changes they want to and combine them at the end. -- Advanced collaboration and review tooling. All the source-control platforms are designed to review each change in detail and have as much discussion as needed until everyone is confident that the change can go ahead. -- Automated quality checks such as spellchecking and link checking. This saves time and catches errors that might otherwise be missed. - -Source control has many benefits. Just keep in mind that if you're new to source control, it has a learning curve. There are some excellent [learning resources][7] and [articles for writers][8] that can help. You can also let your curious documentarians find the learning materials that work for them rather than asking your engineers to teach them. (Ask me how I learned this—the hard way of course!) - -### Pull requests and review cycles - -All source-control platforms are designed around the concept of pull requests, sometimes also called merge requests. Someone, or some team, puts together a set of changes and then requests that the changes are pulled into the main project. In many ways, working with many changes at once is easier in documentation than in code. Changing one article in one place in documentation has fewer side effects than when you change code and find that there were several other sections depending on it. - -The most powerful collaboration tool is the [diff][9], which shows the difference between old and new versions in a way that's easy to follow. There are many versions of this tool available to make the comparison view easier to look at: side-by-side, inline, or even as rendered markdown rather than just text. Each team member can use the tool or tools that work best for them. For example, the web view is commonly used to look at a small change, but for something bigger I would want to look at it locally using `vimdiff` or [Meld][10]. - -Review comments can be added to the change as a whole or to individual lines in the proposed change. Some projects adopt a maximum line length, called a hard wrap, or start each sentence on a new line to make it easier to attach comments to specific parts of a block of text. Further changes and comments can be added until the review process is complete and the change is accepted. Since the pull requests are shown in a queue on the repository for the project, this is a good way to show what's in progress and what needs review attention. The tools make it easy for reviewers to add their thoughts. In particular, if you are working with technical audiences it can be easier to get reviews from these folks via the tools they use daily. - -### Continuous integration and deployment - -Having the source of your documentation available in plain text has many benefits, such as making it easy to find every occurrence of something that needs changing and using existing tools such as [wc][11], [grep][12], or `tree` to work with potentially large document sets. When you combine this with a source-control platform, even more existing tools become available, and they're all open source. - -One big workflow improvement is the ability to have continuous deployment in place. This simply means that when a pull request is merged into the main project, the project is immediately and automatically deployed. If the change is good enough to be accepted into the project, it is also good enough to be live on the documentation site, helping your readers. Typically, continuous deployment is set up with either a separate automation server, such as [Jenkins][13], or [Git Hooks][14]. Either way, the text-based markup is combined with the Docs as Code platform (usually a static site generator such as [Hugo][15] or [Sphinx][16]) to produce the documentation website, which is then deployed. - -The same automation can be used before deployment to add some excellent checks to the pull requests before they are merged. On a coding project, it's common to run code linters, tests, and other quality checks that a machine can do itself. Documentation projects can get the same treatment, with tools like [Vale][17] to do prose linting and check for correct heading styles, spellings, and so on. It's also useful to add other tools here, such as a link checker to make sure all the links go somewhere valid. - -### Code tools for docs workflows - -The tools known and loved by engineers are very good tools, but they are useful for all sorts of other projects too. For documentation, they contribute valuable efficiency, especially when you need your documentation to be moving at the same speed as your development teams. All the tools discussed here are open source, so you can try them for yourself, deploy them for a huge global team, or anything in between. May your docs process be as smooth as any code process. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/10/docs-as-code - -作者:[Lorna Mitchell][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/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 diff --git a/sources/talk/20221107.1 ⭐️⭐️ What you actually need to know about open source to get started.md b/sources/talk/20221107.1 ⭐️⭐️ What you actually need to know about open source to get started.md deleted file mode 100644 index be8a97423b..0000000000 --- a/sources/talk/20221107.1 ⭐️⭐️ What you actually need to know about open source to get started.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -What you actually need to know about open source to get started -====== - -A beginner's guide to open source explained in plain terms. - -So you want (or need) to figure out what ["open source"][1] really means. I'll cover the basics of open source, whether you're interested in contributing to a project or want to be in the loop at a new job where the term keeps getting thrown around. - -Full disclosure: I am a person with little technical experience, working in the content-design fringes of a very technical open source environment. Given my background in marketing and communication, I felt like a fish out of water when I made this career switch. [Git][2], data science, the ins and outs of software… It was, and still is a year later, a lot to comprehend. - -But that's why I'm writing this piece. I want to help make open source a little less intimidating. After all, at the center of open source is a supportive learning community—built for everyone, technically experienced or not. - -I'll start with the absolute basics. - -### What is open source? - -For the record, the industry definition of open source is available at the [Open Source Initiative][3] site. - -However, the popular perception of "open source" software is usually that it doesn't cost anything, the source code is accessible, anyone can contribute to it, and you can redistribute it or do whatever else you want with it. - -Some of that is true, and some of it plays into a few common misconceptions, one of which is cost. - -#### Open source costs $0 - -Is it true? Usually, but not always. By nature of its code being publicly available, open source software can be obtained at no cost. However, for-profit companies do exist around open source projects. But if the software is available at no cost, how do open source companies even exist? How do they make money? - -The concept of having a "free product" is counter-intuitive. But that's just the thing: A company doesn't have to sell software to profit from the management of products, storage of data, and customer support. - -Many companies follow a subscription model, offering customer support in case of bugs or general confusion. Data storage isn't free, so that is another area where these companies can bring in income. In this regard, the "product" isn't the software; it's the benefit of a subscription. - -- **The source code is accessible**: Is it true? Yes, always. This accessibility is a prerequisite for adopting the term "open source." The source code must be available to view, use, modify, and redistribute. -- **You can do whatever you want with the code**: Is it true? It depends. Subject to licensing terms, there are some limitations on how you can use code, but you can generally use it however you'd like. Whether that means tweaking a project to fit a specific need or using it as the basis for something else, open source software is yours, and everyone else's, to modify. -- **Anyone can contribute to open source projects**: Is it true? Yes - within limits. Anyone with the [right skill set][4] can contribute to open source. However, that doesn't mean all contributions are always accepted and implemented. - -For example, say you're interested in a project where the end goal is a catalog of all the types of birds in the world. You're really into dinosaurs, specifically dinosaurs that may have eventually evolved into modern-day birds. So, you contribute entries for all of the most bird-like dinosaurs. The project owners could see this and think, "Sweet, those are some great prehistoric birds." However, they're also allowed to say, "Hmm, those dinosaurs are like birds, but they're technically not birds yet. They probably don't belong on Birdpedia." - -Luckily, projects don't usually work under lawless conditions. Open source projects typically come with contribution guidelines and codes of conduct, so you don't have to worry about your additions flying off the rails. - -### Why open source? - -So, after all the contributions are made (if it's ever actually done), why would people give away their software for no cost? If so many people put their time and effort into creating something, why wouldn't they band together and slap a price tag on it? - -This question comes with a lot of answers. Here are a few: - -- Starting a business is hard, especially if the project you're working on doesn't form the strong foundation for a money machine. It can be easier to rally a bunch of like-minded people without commitments or the expectation of paychecks. -- Most open source communities consist of people interested in improving software or bringing it into existence but don't have the time or interest to commit to working full-time on a project. Sometimes open source represents passion projects, geek groups, and crowd-sourced solutions to annoying problems. -- The groups that form around open source projects of all sizes foster supportive communities where contributors and onlookers alike can practice their skills, improve software they regularly use, teach and learn from each other, and feel empowered to make their voices heard. Many open source communities are essentially hyper-focused online hobby clubs. - -### Where do I get involved? - -Now you may ask yourself, "But what do I do with this information? Can I contribute to open source projects? What if I'm not good enough yet?" - -Never fear—even [beginners][5] are welcome to contribute to open source projects. It's a great way to hone your skills while working with a community towards a larger goal. And, as I talked about earlier, the worst that can happen is your changes aren't merged into Birdpedia (and that's because those product owners just can't see your vision of a Birdpedia where birds and their ancestors gleefully coexist in an online world of bird-related knowledge). - -Do you have to know how to code to contribute to projects? Contrary to popular belief, [no, you don't][6]. Projects "take a village" to thrive, which means they need input from people of all different backgrounds. Visual designers, writers, marketers, reviewers, translators, subject matter enthusiasts, and even just users of the resulting product are all valuable contributors. Not only do they help build out and improve products, but they identify bugs, suggest improvements, spread the word about the project, and generally strengthen the community. - -In short, no matter what your background or experience, if you're interested in open source or a specific project, you're nearly guaranteed to be welcomed with open arms. - -### Get started with open source now - -Still not sure where to begin? Here are some ideas and resources to get you started: - -- [Up For Grabs][7] is a "list of open source projects which have curated tasks specifically for new contributors." This is a great place to find an easy first PR opportunity, which is a great way to find out what kind of contributions you'll enjoy. -- Check out this list of [beginner-friendly projects][8] on GitHub. -- If you're still not feeling inspired, consider [contributing][9] to (or flying with) [PatternFly][10], Red Hat's open design system. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/11/get-started-open-source - -作者:[Katie Edwards][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/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 diff --git a/sources/talk/20221110.6 ⭐️⭐️ 4 key differences between Twitter and Mastodon.md b/sources/talk/20221110.6 ⭐️⭐️ 4 key differences between Twitter and Mastodon.md deleted file mode 100644 index 47d1016c92..0000000000 --- a/sources/talk/20221110.6 ⭐️⭐️ 4 key differences between Twitter and Mastodon.md +++ /dev/null @@ -1,81 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -4 key differences between Twitter and Mastodon -====== - -Mastodon is not a corporation. All of its instances are staffed and supported by each server's contributors. Here are a few other advantages. - -Social media is not always sociable, and sometimes we need a sufficient impetus to change what we do and what we read. I began using Twitter as a replacement for my RSS reader in 2008, which revolutionized how I read and learned up to that point. Tweets from educators and free and open source (FOSS) advocates worldwide kept me informed and engaged in a learning network that was without equal. That's changed over the past half dozen years, and recently a change in ownership and the shaping of what I read was driven more by an algorithm than by my personal interests and choices. During a yearly meetup of correspondents and editors of Opensource.com a few years ago, [Seth Kenlon][1] suggested giving [Mastodon][2] a try. I joined [Fosstodon][3] in 2019. Fosstodon is a Mastodon instance for a community of like-minded people who enjoy free and open source software. - -### Mastodon vs Twitter - -Change is not easy. Being a creature of habit, I stayed with my old standby even though it was becoming increasingly tiresome. The threat of its sale in the spring of 2022 invited me to reconsider Fosstodon. - -### 1. Favorite instead of like - -The Mastodon interface is similar to Twitter. Rather than "liking" a post, you "favorite" a post on Mastodon by clicking the star icon under the post content. - -![Favorite button][4] - -### 2. Share a post - -Re-sharing on my old network is a "retweet," but on Mastodon, it's a "boost." You click the double-arrow icon under the post content to boost a post. - -![Boost button][5] - -### 3. Mastodon instances - -Because anyone can run a Mastodon instance, different instances not only have unique communities (like the ones that form around specific hashtags on Twitter, but Mastodon also has hashtags). Some have a unique set of rules. For instance, unlike my former social network, there were content moderation rules on Fosstodon that seemed strict initially. I made a post unrelated to FOSS software, and my post was removed. I was told it had been removed because I'd not issued a "content warning." That irked me, so I looked for another instance and found a couple more to my liking. One was [Mastodon.social][6], and the other [Scholar.social][7]. The former is a general server with no expectation about what you will post. The latter was an instance dedicated to academics. In all cases, there are well-enforced codes of conduct. - -Each instance has rules, and while they differ slightly in the description, they clearly spell out what is and is not acceptable behavior. Fosstodon published its [code of conduct][8], which established the rules and expectations of behavior on the site. - -### 4. Open source social networking - -If you want to run your own Mastodon instance or help develop one, you'll be happy to know that Mastodon is open source. It uses an AGPLv3 license, and its source code is available as a [Git repository][9]. The software provides a social network server that uses the [ActivityPub][10] protocol to communicate with other servers worldwide. - -Mastodon is not a single site on the internet but a series of sites spanning the globe and communicating with each other. This federated network is referred to as the "fediverse." Unlike other social networks, where there's a single owner of the network, Mastodon and other ActivityPub sites are owned by anyone who runs a server. - -From a user's perspective, this doesn't matter at first. You can sign up on any Mastodon instance and then connect to all other instances. - -There is power to this distributed design, though. If you encounter an instance with a community producing content you'd rather not see, you can block either a single user from that instance or the whole instance. - -In the past month, I've returned to Fosstodon primarily because open source is my passion. I enjoy sharing open source content on Fosstodon because the other users of Fosstodon are generally receptive to posts about free and open source software. When I have something to share that's not considered appropriate on Fosstodon, I share it on Scholar.social or Mastodon.social. - -Not all instances have topics they focus on, and even those that do often use their topical interests as a guideline rather than grounds for strict removal of posts. If you have a particular interest, you might be able to find a community built around that topic, and you're likely to see that you have an instant audience. Of course, you'll still always be able to communicate with users of other instances, too. - -### Try Mastodon - -Mastodon is not a corporation. All of its instances are staffed and supported by each server's contributors. Some instances make it easy to support them with Patreon or PayPal. - -I have found the fediverse a welcoming place that brings joy back into social networking. Have you joined Mastodon? What are your takeaways? Let us know in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/11/twitter-vs-mastodon - -作者:[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/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 diff --git a/sources/talk/20221202.0 ⭐️⭐️ 8 ideas for measuring your open source software usage.md b/sources/talk/20221202.0 ⭐️⭐️ 8 ideas for measuring your open source software usage.md deleted file mode 100644 index 892fce0de0..0000000000 --- a/sources/talk/20221202.0 ⭐️⭐️ 8 ideas for measuring your open source software usage.md +++ /dev/null @@ -1,142 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -8 ideas for measuring your open source software usage -====== - -Those of us who support open source project communities are often asked about usage metrics — a lot. The goal of these metrics is usually to demonstrate the software's importance as measured by its user base and awareness. We typically want to know: how many people use the software, how many installations are there, and how many lives are being touched. - -To make a long story short: We cannot answer these questions directly. - -Sorry to disappoint you if you were hoping for a definitive solution. No one has the perfect answers to questions about usage metrics. At least, no precise answers. - -The good news is that there are approximations and alternative metrics that can satisfy your thirst for knowledge about the software's usage, at least partially. This article explores these alternatives including their benefits and shortcomings. - -### Downloads - -When you visit websites that offer software, you can often see how many times the software has been downloaded. An example that comes to mind is Firefox, which used to have a download counter. It was an impressive number and gave the impression that Firefox was a popular browser—which it was for a while. - -However, individual behavior can directly impact the accuracy of this number. For example, when a person wipes their machine regularly, each rebuild incurs a separate download. To account for this reality, there needs to be a way to subtract a few dozen (maybe hundreds) downloads from the number because of that one person. - -Not only can downloads overestimate usage, but they can also underestimate usage. For instance, a system administrator may download a new version of Firefox once to a flash drive and then install it on hundreds of devices. - -Download metrics are easy to collect because you can log each download request on the server. The problem is that you don't know what happens to the software after it is downloaded. Was the person able to use the software as anticipated? Or did the person run into issues and abandon the software? - -For open source projects, you can consider a variety of download metrics, such as the number of binaries downloaded from: - -- the project website -- package managers such as npm, PyPi, and Maven -- code repositories like GitHub, GitLab, and Gitee - -You may also be interested in downloads of the source code because downstream projects are most likely to use this format (also read [How to measure the impact of your open source project][1]). Relevant download metrics include: - -- The number of clones (source code downloads) from code repositories like GitHub, GitLab, and Gitee -- The number of archives (tar, zip) downloaded from the website -- The number of source code downloads through package managers like npm, PyPi, and Maven - -Download metrics for source code are an even less reliable measure than binary downloads (although there is no research to demonstrate this). Just imagine that a developer wants to use the most recent version of your source code and has configured their build pipeline to always clone your repository for every build. Now imagine that an automated build process was failing and retrying to build, constantly cloning your repository. You can also imagine a scenario where the metric is lower than expected—say the repository is cached somewhere, and downloads are served by the cache. - -**[ Related read [5 metrics to track in your open source community][2] ]** - -In conclusion, download metrics are good proxies for detecting trends and providing context around current usage. We cannot define specifically how a download translates to usage. But we can say that an increase in downloads is an indicator of more potential users. For example, if you advertise your software and see that download numbers are higher during the campaign, it would be fair to assume that the advertisement prompted more people to download the software. The source and metadata of the download can also provide additional context for usage patterns. What versions of your software are still in use? What operating system or language-specific versions are more popular? This helps the community prioritize which platforms to support and test. - -### Issues - -As an open source project, you probably have an issue tracker. When someone opens an issue, two common goals are to report a bug or request a feature. The issue author has likely used your software. As a user, they would have found a bug or identified the need for a new feature. - -Obviously, most users don't take the extra step to file an issue. Issue authors are dedicated users and we are thankful for them. Also, by opening an issue, they have become a non-code contributor. They may become a code contributor. A rule of thumb is that for every 10,000 users, you may get 100 who open an issue and one who contributes code. Depending on the type of user, these ratios may differ. - -With regard to metrics, you can count the number of issue authors as a lower-bound estimation for usage. Related metrics can include: - -- The number of issue authors -- The number of active issue authors (opened an issue in the last 6 months) -- The number of issue authors who also contribute code -- The number of issues opened -- The number of issue comments written - -### User mailing lists, forums, and Q&A sites - -Many open source projects have mailing lists for users, a forum, and presence on a Q&A site, such as Stack Overflow. Similar to issue authors, people who post there can be considered the tip of the iceberg of users. Metrics around how active a community is in these mailing lists, forums, and Q&A sites can also be used as a proxy for increasing or decreasing the user base. Related metrics can focus on the activity in these places, including: - -- The number of user mailing list subscribers -- The number of forum users -- The number of questions asked -- The number of answers provided -- The number of messages created - -### Call-home feature - -To get accurate counts of users, one idea is to have your software report back when it is in use. - -This can be creepy. Imagine a system administrator whose firewall reports an unexpected connection to your server. Not only could the report never reach you (it was blocked), but your software may be banned from future use. - -Responsible ways to have a call-home feature is an optional service to look for updates and let the user know to use the latest version. Another optional feature can focus on usage telemetry where you ask the user whether your software may, anonymously, report back how the software is used. When implemented thoughtfully, this approach can allow users to help improve the software by their style of using it. A user may have the opinion: "I often don't allow this usage information sharing but for some software I do because I hope the developers will make it better for me in the long term." - -### Stars and forks - -Stars and forks are features on social coding platforms like GitHub, GitLab, and Gitee. Users on these platforms can star a project. Why do they star projects? GitHub's documentation explains, "You can star repositories and topics to keep track of projects you find interesting and discover related content in your news feed." Starring is the equivalent of bookmarking and also provides a way to show appreciation to a repository maintainer. Stars have been used as an indicator of the popularity of a project. When a project has a big announcement that attracts considerable attention, the star count tends to increase. The star metric does not indicate the usage of the software. - -Forks on these social coding platforms are clones of a repository. Non-maintainers can make changes in their fork and submit them for review through a pull request. Forks are more a reflection of community size than stars. Developers may also fork a project to save a copy they can access even after the original repository has disappeared. Due to the use of forks in the contribution workflow, the metric is a good indicator for the developer community. Forks do not typically indicate usage by non-developers because non-developers usually do not create forks. - -### Social media - -Social media platforms provide gathering places for people with shared interests, including Facebook, Instagram, LinkedIn, Reddit, Twitter, and more. Using a social media strategy, open source projects can attract people with interest and affinity for their projects by setting up respective gathering spaces on these platforms. Through these social media channels, open source projects can share news and updates and highlight contributors and users. They can also be used to meet people who would not otherwise interact with your project. - -We are hesitant to suggest the following metrics because they have no clear connection to actual usage of your software and often require analysis for positive, negative, and neutral sentiment. People may be excited about your project for many different reasons and want to follow it without actually using it. However, like other metrics already discussed, showing that you are able to draw a crowd in social media spaces is an indicator of the interest in your project overall. Metrics for different social media platforms may include: - -- The number of followers or subscribers -- The number of messages -- The number of active message authors -- The number of likes, shares, reactions, and other interactions - -### Web analytics and documentation - -Website traffic is a useful metric as well. This metric is influenced more by your outreach and marketing activities than your number of users. However, we have an ace up our sleeve: our user documentation, tutorials, handbooks, and API documentation. We can see what topics on our website draw attention, including documentation. The number of visitors to the documentation would arguably increase with an increase in the number of discrete users of the software. We can therefore detect general interest in the project with visitors to the website and more specifically observe user trends by observing visitors to the documentation. Metrics may include: - -- The number of website visitors -- The number of documentation visitors -- The duration visitors spend on your website or in documentation - -### Events - -Event metrics are available if you are hosting events around your project. This is a great way to build community. How many people submit abstracts to speak at your events? How many people show up to your events? This can be interesting for both in-person and virtual events. Of course, how you advertise your event strongly influences how many people show up. Also, you may co-locate your event with a larger event where people travel anyway, and thus, are in town and can easily attend your event. As long as you use a consistent event strategy, you can make a case that a rise in speaker submissions and attendee registrations are indicative of increasing popularity and user base. - -You don't need to host your own event to collect insightful metrics. If you host talks about your project at open source events, you can measure how many people show up to your session focused on your project. At events like FOSDEM, some talks are specifically focused on updates or announcements of open source projects and the rooms are filled to the brim (like almost all sessions at FOSDEM). - -Metrics you might consider: - -- The number of attendees at your project-centric event -- The number of talks submitted to your project-centric event -- The number of attendees at your project-centric talks - -### Conclusion about approximating usage of open source software - -As we've illustrated, there are many metrics that can indicate trends around the usage of your software, and all are imperfect. In most cases, these metrics can be heavily influenced by individual behavior, system design, and noise. As such, we suggest that you never use any of these metrics in isolation, given the relative uncertainty of each one. But if you collect a set of metrics from a variety of sources, you should be able to detect trends in behavior and usage. If you have the means to compare the same set of metrics across multiple open source projects with commonalities—such as similar functionality, strong interdependencies, hosted under the same foundation, and other characteristics—you can improve your sense of behavioral baselines. - -Note that in this overview, we've also chosen to highlight metrics that evaluate direct usage. As most software depends on a variety of other software packages, we would be remiss if we did not mention that usage and behavior can also be heavily impacted by indirect usage as part of a dependency chain. As such, we recommend incorporating the count of upstream and downstream dependencies as another layer of context in your analysis. - -In closing, as the wielder of data and metrics, we encourage you to recognize the power and responsibility that you have for your stakeholders. Any metric that you publish has the potential to influence behavior. It is a best practice to always share your context—bases, sources, estimations, and other critical contextual information—as this will help others to interpret your results. - -We thank the CHAOSS Community for the insightful conversation at CHAOSScon EU 2022 in Dublin, Ireland that sparked the idea for this blog post and to the CHAOSS Community members who reviewed and helped improve this article. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/12/open-source-usage-metrics - -作者:[Georg Link][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/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 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/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/20210128 Open Source Security Foundation (OpenSSF)- Reflection and Future.md b/sources/tech/20210128 Open Source Security Foundation (OpenSSF)- Reflection and Future.md index 493b72b562..f0e03c9672 100644 --- 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 @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (cool-summer-021) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -65,7 +65,7 @@ via: https://www.linux.com/news/open-source-security-foundation-openssf-reflecti 作者:[The Linux Foundation][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[cool-summer-021](https://github.com/cool-summer-021) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 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 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 47f72b8d66..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: ( ) 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..0caa009171 --- /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: " " +[#]: 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/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 a51532e521..0000000000 --- a/sources/tech/20210316 Get started with edge computing by programming embedded systems.md +++ /dev/null @@ -1,167 +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: "lkxed" -[#]: 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] - -Image by: opensource.com - -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] -选题:[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/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 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/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/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/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/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 index 836627323c..169656e876 100644 --- 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 @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/10/open-source-tools" [#]: author: "Don Watkins https://opensource.com/users/don-watkins" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "XiaotingHuang22" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " 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/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/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/20220729 Learn Rust by debugging Rust.md b/sources/tech/20220729 Learn Rust by debugging Rust.md deleted file mode 100644 index 0abe7c217e..0000000000 --- a/sources/tech/20220729 Learn Rust by debugging Rust.md +++ /dev/null @@ -1,242 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Learn Rust by debugging Rust -====== -Rustlings is an open source project by the Rust team that helps you learn Rust through the process of debugging. - -![Ferris the crab under the sea, unofficial logo for Rust programming language][1] - -Image by: Opensource.com - -In my previous [article about rustup][2], I showed you how to install the Rust toolchain. Well, what good is the toolchain if you won’t be using it to get more hands-on with Rust? Learning any language involves reading existing code and writing a lot of sample programs. That's a good way to become proficient in a language. However, there's a third way: debugging code. - -Learning through debugging involves trying to compile a pre-written (buggy) sample program, understanding the errors generated by the compiler, fixing the sample code, and then re-compiling it. Repeat that process until the code successfully compiles and runs. - -[Rustlings][3] is an open source project by the Rust team that helps you learn Rust through the process of debugging. It also provides you with a lot of hints along the way. If you're a beginner to Rust and have either started or completed reading the Rust book, then rustlings is the ideal next step. Rustlings helps you apply what you've learned from the book, and move to working on bigger projects. - -### Installing rustlings - -I'm using (and recommend) a Fedora machine to try rustlings, but any Linux distribution works. To install rustlings, you must download and run its install script. It's recommended that you do this as a normal user (not root) without any special privileges. - -Remember, for you to be able to use rustlings, you need the Rust toolchain available on your system. If you don't have that already, please refer to my [article on rustup][4]. - -Once you're ready, download the installation script: - -``` -$ 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 -``` - -Inspect the script to learn what it does: - -``` -$ less rustlings_install.sh -``` - -And then run it to install: - -``` -$ bash rustlings_install.sh -[...] -Installing /home/tux/.cargo/bin/rustlings -Installed package `rustlings v4.8.0 (/home/tux/rustlings)` (executable `rustlings`) -All done! -``` - -Run 'rustlings' to get started. - -### Rustlings exercises - -The installation provides you with the `rustlings` command. Run it along with the `--help` flag to see what options are available. - -``` -$ rustlings --help -``` - -The installation script also clones the rustlings Git repository, and installs all the dependencies required to run the sample programs. You can view the sample programs within the exercises directory under `rustlings` : - -``` -$ 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 -``` - -### List all exercises from the command line - -The `rustlings` command provides you with a `list` command which displays each sample program, its complete path, and the status (which defaults to **pending**.) - -``` -$ 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 -[...] -``` - -Near the end of the output, you're given a progress report so you can track your work. - -``` -Progress: You completed 0 / 84 exercises (0.00 %). -``` - -### View sample programs - -The `rustings list` command shows you what programs are available, so at any time you can view the code of those programs by copying the complete paths into your terminal as an argument for the [cat][5] or [less][6] commands: - -``` -$ cat exercises/intro/intro1.rs -``` - -### Verify your programs - -Now you can start debugging programs. You can do that using the `verify` command. Notice that rustlings chooses the first program in the list (`intro1.rs` ), tries to compile it, and succeeds: - -``` -$ 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 | -``` - -As you can see from the output, even though the sample code compiles, there's work yet to be done. Each sample program has the following comment in its source file: - -``` -$ grep "NOT DONE" exercises/intro/intro1.rs -// I AM NOT DONE -``` - -Although the compilation of the first program worked fine, rustlings won't move to the next program until you remove the `I AM NOT DONE` comment. - -### Moving to the next exercise - -Once you have removed the comment from `intro1.rs`, you can move to the next exercise by running the `rustlings verify` command again. This time, you may notice that rustlings tries to compile the next program (`intro2.rs` ) in the series, but runs into an error. You're expected to debug that issue, fix it, and then move forward. This is a critical step, allowing you to understand why Rust says a program has bugs. - -``` -$ 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 -``` - -### Getting a hint - -Rustlings has a handy `hint` argument, which tells you exactly what's wrong with the sample program, and how to fix it. You can think of it as an add-on help option, in addition to what the compiler error message tells you. - -``` -$ rustlings hint intro2 -Add an argument after the format string. -``` - -Based on the above hint, fixing the program is easy. All you need to do is add an additional argument to the `println` statement. This diff should help you understand the changes: - -``` -< println!("Hello {}!", "world"); ---- -> println!("Hello {}!"); -``` - -Once you make that change, and removed the `NOT DONE` comment from the source code, you can run `rustlings verify` again to compile and run the code. - -``` -$ rustlings verify -Progress: [>-------------------------------------] 1/84 -✅ Successfully ran exercises/intro/intro2.rs! -``` - -### Track progress - -You aren't going to finish all of the exercises in a day, and it's easy to lose track of where you left off. You can run the `list` command to see the status of your work. - -``` -$ 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 -[...] -``` - -### Run specific exercises - -If you don't want to start from the beginning and skip a few exercises, rustlings allows you to focus on specific exercises using the `rustlings run` command. This runs a specific program without requiring the previous lesson to be verified. For example: - -``` -$ rustlings run intro2 -Hello world! -✅ Successfully ran exercises/intro/intro2.rs -$ rustlings run variables1 -``` - -Typing exercise names can become tedious, but rustlings provides you with a handy `next` command so you can move to the next exercise in the series. - -``` -$ rustlings run next -``` - -### Alternative watch command - -If you don't want to keep typing `verify` after each modification you make, you can run the `watch` command in a terminal window, and then keep modifying the source code to fix issues. The `watch` command detects these modifications, and keeps re-compiling the program to see whether the issue has been fixed. - -``` -$ rustlings watch -``` - -### Learn by debugging - -The Rust compiler is known to provide very meaningful error messages, which helps you understand issues in your code. This usually leads to faster debugging. Rustlings is a great way to practice Rust, to get used to reading error messages, and understand the Rust language. Check out the recent features of Rustlings 5.0.0 on [GitHub][7]. - -**[[ Practice programming with Rust. Download our Rust cheat sheet. ]][8]** - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/7/learn-rust-rustlings - -作者:[Gaurav Kamathe][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/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/sources/tech/20220802 Pandas- The Popular Python Library for Data Analysis and Data Science.md b/sources/tech/20220802 Pandas- The Popular Python Library for Data Analysis and Data Science.md deleted file mode 100644 index a7a8859ec7..0000000000 --- a/sources/tech/20220802 Pandas- The Popular Python Library for Data Analysis and Data Science.md +++ /dev/null @@ -1,100 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Pandas: The Popular Python Library for Data Analysis and Data Science -====== - -*Pandas is a popular Python library. This article describes a few features and functions available in this library, and encourages readers to use it for practical business problems.* - -Pandas provides fundamental and high-level building blocks for practical, real world data analysis in Python. It is one of the most powerful and flexible open source tools for data analysis and manipulation, and provides data structures for modelling and manipulating tabular data (data in rows and columns). - -Pandas has two primary data structures. The first is a ‘series’ data structure that helps to retrieve data from the array or dictionary of Python objects. Data can be retrieved either by position or by specifying the index name. The second is the ‘dataframes’ data structure to store data in rows and columns. Columns have column names and rows are accessed using indexes. Columns can have different types of data including lists, dictionaries, pandas series, another dataframe, NumPy arrays, etc. - -### Processing various file types - -Data is often available in various formats. It is imperative that the tool used for data analysis is able to provide a wide range of methods for handling it. - -With Pandas, one can read various file types like CSV, JSON, XML, Parquet, SQL (see Table 1). - -| | Write | Read | -| :- | :- | :- | -| 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 | - -### Data cleansing using Pandas - -In real-world scenarios, data is often incomplete and includes bad data. It is sometimes duplicated. Also, data includes sensitive and confidential information, which needs to be masked. Pandas offers ways to handle bad data by using methods like cleaning, dropping, replacing, masking, etc. - -a.  Empty rows can be removed with the *df.dropna(inplace=True)* operation. - -b.  Empty values can be replaced with *df.fillna(, inplace=True)*. We can specify the column name to be placed in a particular column. - -c. You can mask the values for sensitive and non-public data for all items NOT satisfying the condition *my_list.where(my_list < 5)*. Masking of values satisfying the condition can be done with*my_list.mask(my_list < 5)*. - -d. Duplicates can be dropped from a dataframe using: - -``` -df.drop_duplicates(‘’, keep = False) -df.drop_duplicates(‘’, keep = ‘first’) -df.drop_duplicates(‘’, keep = ‘last’) -``` - -### Data analysis using Pandas - -Table 2 lists the various functions in Pandas that perform data analysis as well as the syntax for usage. (Note: df stands for dataframe.) - -| Function | Description | Syntax | -| :- | :- | :- | -| Head | Head() function returns the first five rows | df.head(x) | -| tail | tail() function returns the last five rows by default | df.tail(x) | -| Loc | Loc function returns a particular row. Slicing of the data is also possible | loc(x:y) | -| Groupby | Groups data on a particular column | groupby(‘’) | -| Sum | Sum of values in a particular column | df[‘column’].sum() | -| Mean | Average of values in a particular column | df[‘column’]. mean() | -| Min | Minimum value in a particular column | df[‘column’].min() | -| Max | Maximum value in a particular column | df[‘column’].max() | -| Sort | Sorts dataframe in a column | df.sort_values([‘column’]) | -| Size | Rows * columns | df.size | -| Describe | Describes details of the dataframe | df.describe | -| Crosstab | Creates a frequency tabulation of rows and columns | pd.crosstab(df[‘column1’], df[‘column2’], margins = True) | -| Duplicated | Returns True or False based on duplicate values in Column1 and Column2 | df.duplicated([column1, ‘column2’]) | - -### Advantages of Pandas - -* It supports multi-index (hierarchical index) used for easy analysis of data having a large number of dimensions. -* It supports the creation of pivot tables, stack and unstack operations. -* Categorical data containing finite values can be processed with Pandas. -* It supports grouping and aggregations. -* Sorting can be explicitly disabled. -* It supports filtering at both row-level (gets the rows satisfying the filter condition) and column-level (selects only the required columns). -* Helps in reshaping of data sets. You can also transpose the values of the array and convert to a List. When you are processing data using Python, you can convert the Pandas dataframe to a multi-dimensional NumPy array; the values member variable is used for this. -* Supports label-oriented slicing of data. - -### The disadvantages - -The code and syntax of Pandas is different from Python, which leads to a steep learning curve for some users. Also, a few concepts like three dimensional data are better handled in other libraries like NumPy. - -Pandas really elevates the data analysis process in an efficient manner. Its compatibility with other libraries makes it very conducive for use in various scenarios. - --------------------------------------------------------------------------------- - -via: https://www.opensourceforu.com/2022/08/pandas-the-popular-python-library-for-data-analysis-and-data-science/ - -作者:[Phani Kiran][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/phani-kiran/ -[b]: https://github.com/lkxed diff --git a/sources/tech/20220810 How to Record Streaming Audio in Ubuntu and other Linux Distributions.md b/sources/tech/20220810 How to Record Streaming Audio in Ubuntu and other Linux Distributions.md deleted file mode 100644 index ac6e8dca33..0000000000 --- a/sources/tech/20220810 How to Record Streaming Audio in Ubuntu and other Linux Distributions.md +++ /dev/null @@ -1,187 +0,0 @@ -[#]: 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: " " -[#]: publisher: " " -[#]: url: " " - -How to Record Streaming Audio in Ubuntu and other Linux Distributions -====== -How to record audio in Ubuntu and other Linux distributions? - -If you want to record a voice over through the microphone of your computer, you can use GNOME Sound recorder or Audacity. - -Using GNOME Sound Recorder is easy but it lacks features. Audacity could be overwhelming initially but it has plenty of features for professional level recording. However, I am not going into that detail in this tutorial. - -GNOME Sound Recorder works with the microphone. There is another tool called Audio recorder and you can use it to record streaming music (from Sptify, YouTube, internet radio, Skype and most other sources) apart from microphone input. - -To summarize, I’ll show you the steps: - -* To record sound using GNOME Sound Recorder -* To record streaming audio using Audio Recorder - -### Using Sound Recorder to record audio from the microphone - -GNOME desktop environment has a good variety of useful applications. Sound Recorder is one of them. - -You can install the [Sound Recorder][1] from the Ubuntu Software Center. - -![Sound Recorder can be installed from the Ubuntu Software Center][2] - -Or, you can use this command in the terminal to install it: - -``` -sudo apt install gnome-sound-recorder -``` - -Once installed, you can find it in the system menu and start from there. - -![GNOME Sound Recorder][3] - -Before you start using it, you should ensure that you have the correct input source chosen in the system settings. GNOME Sound Recorder - -![Ensure that you have chosen correct input in system settings][4] - -Once you open the Sound Recorder application, it will show an interface like the one below. - -![Hit the Record button to start audio recording][5] - -Hit on the record button and it starts recording audio instantly. While recording, you get options to pause, stop or discord the recording. - -![Options while recording audio][6] - -Your recordings are saved and available from the application interface itself. Click on the saved recordings to highlight it. - -You can replay the recordings or delete it. You can choose to save it to another location by clicking the save/download button. You may also rename the recordings using the edit button. - -![Saved recordings][7] - -That’s quite convenient, right? You can choose to record in MP3, FLAC and a couple of more formats. - -#### Removing GNOME Sound Recorder - -Don’t like it or find it lacking in terms of features? - -You can remove GNOME Sound Recorder from the Ubuntu Software Center or use the following command: - -``` -sudo apt remove gnome-sound-recorder -``` - -The application of GNOME Sound recorder is limited. It only records from the microphone and this is not what you would want in certain situations. - -Imagin you want to record a Skype call or something which is playing in an application or web browser? The nifty Audio Recorder helps in such cases. - -### Using Audio Recorder to record streaming audio - -You can watch this video to see how to use Audio Recorder. It’s a bit old but the steps are the same. - -![A Video from YouTube][8] - -[Subscribe to our YouTube channel for more Linux videos][9] - -You can use the [official PPA][10] to install Audio Recorder in Ubuntu and Linux Mint. Use the following commands in the terminal (Ctrl+Alt+T) one by one: - -``` -sudo apt-add-repository ppa:audio-recorder/ppa -sudo apt update -sudo apt install audio-recorder -``` - -Alternatively, you can download the source code from [launchpad][11]. Once installed, you can start the application from the Activity Overview: - -![Audio Recorder][12] - -#### Record all kinds of sound from various sources - -Audio Recorder records all kinds of sounds your computer makes. - -It records audio played through your system’s soundcard, microphones, browsers, webcams and more. - -In other words, it records even if your system sneezes (given that you want to record it). It allows you to select the recording device such as webcam, microphone, Skype, etc. - -To record the streaming music, select the appropriate source. For example, if you are playing streaming radio in Rhythmbox, then select Rythmbox. - -![Audio-Recorder Audio Settings][13] - -#### Record at your convenience - -Audio Recorder also gives you the option of setting timer. You can start, stop or pause recording at a given clock time or at a pre-defined interval. You can also set the limit on the recorded file size. - -Moreover, you can pause (and stop) when there is no audio (or very low sound) and resume it when sound comes back. - -All you have to do is to edit the text in the Timer panel. Comment out the “rules” you don’t want to apply and edit the ones per your requirement. - -![Audio-recorder Timer Settings][14] - -It provides additional settings like auto start at login, show tray icon and other record settings. - -![Audio-recorder Additional Settings][15] - -#### Save the recorded music file in various file formats - -Another gem. You can save the recorded file in your favourite file format. Supported file formats are OGG audio, Flac, MP3, SPX and WAV. I prefer MP3 for my recordings. - -The **recorded files are stored in ~/Audio** i.e., in the Audio folder inside your home directory. - -![Audio-recorder Audio Formats][16] - -#### How good is Audio Recorder? - -I used Audio Recorder in Ubuntu to [record the music played on YouTube][17]. I saved a 2-minute video in MP3 format that took 934 KB of space. But I must say I was not expecting the recorded sound quality to be so good. Honestly, I could not distinguish it from the original YouTube song. - -#### Removing Audio Recorder - -If you don’t find Audio Recorder to your liking, you can remove it using the following commands: - -``` -sudo apt remove audio-recorder -``` - -It will be a good idea to [remove the PPA as well][18]: - -``` -sudo apt-add-repository -r ppa:audio-recorder/ppa -``` - -### Conclusion - -There are probably several other tools for audio recording in Linux. Like GNOME, other desktop environments may also have sound recording apps. I know Deepin has one for sure. - -GNOME Sound Recorder is a decent tool for recording sound from your microphone. For recording sound from various sources, Audio Recorder is a good choice. - -I hope it helps with your audio recording needs. Let me know if you have any suggestions. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/record-streaming-audio/ - -作者:[Abhishek Prakash][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/FYJNEVERFOLLOWS) -校对:[校对者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://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/ diff --git a/sources/tech/20220906 How to Analyse Sentiments Using Machine Learning.md b/sources/tech/20220906 How to Analyse Sentiments Using Machine Learning.md deleted file mode 100644 index 1cac4f4b89..0000000000 --- a/sources/tech/20220906 How to Analyse Sentiments Using Machine Learning.md +++ /dev/null @@ -1,213 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Analyse Sentiments Using Machine Learning -====== -This article will help you understand the concept of sentiment analysis and learn how it is done. It uses different machine learning algorithms for sentiment analysis, and then compares them to decide which one is the best for the particular problem described here. - -Sentiment analysis is a major area in the field of natural language processing. A sentiment is any opinion or feeling that we have about an event, a product, a situation or anything else. Sentiment analysis is the field of research in which human sentiments are automatically extracted from the text. This field started evolving in the early 90s. - -This article will help you understand how machine learning (ML) can be used for sentiment analysis, and compare the different ML algorithms that can be used. It does not try to improve the performance of any of the algorithms or methods. - -In today’s fast paced world, everything is online and everyone can post their views. A few negative online comments may hurt a company’s reputation and, thereby, its sales. Now that everything’s online, everyone can post their views and opinions. It becomes very important for companies to go through these to understand what their customers really want. But since there is so much data, it cannot be gone through manually. This is where sentiment analysis comes in. - -Let us now start developing a model to do a basic sentiment analysis. - -### Let’s start! - -The first step is to select a data set. You can choose from any publicly available reviews or comments such as tweets or movie reviews. The two columns that should definitely be there in the data set are the label and the actual piece of text. - -Figure 1 shows a small sample of how the data looks. - -![Figure 1: Data sample][1] - -Now we need to import the required libraries: - -``` -import pandas as pd -import numpy as np -from nltk.stem.porter import PorterStemmer -import re -import string -``` - -As you can see in the above code, we have imported NumPy and Pandas for processing the data. We will look at the other imported libraries when we use them. - -Now that the data set is ready and the libraries are imported, we need to bring the former into our project. The Pandas library is used for this purpose. We bring the data set into the Pandas data frame using the following line of code: - -``` -sentiment_dataframe = pd.read_csv(“/content/drive/MyDrive/Data/sentiments - sentiments.tsv”,sep = ‘\t’) -``` - -Now that we have the data set in our project, let us manipulate it so that our algorithm can understand the features better. We begin by giving names to our columns in the data set. This is done by using the line of code given below: - -``` -sentiment_dataframe.columns = [“label”,”body_text”] -``` - -We then assign numerical labels to the classes — negative is replaced with 1 and positive is replaced with 0. Figure 2 shows how the data frame looks at this stage. - -![Figure 2: Data frame with basic modifications][2] - -The next step is the preprocessing of the data. This is a very important step as it helps us to convert string/text data into numerical data (machine learning algorithms can understand/process numerical data and not text). Also, the redundant and useless data needs to be removed as it may taint our training model. We remove the noisy data, missing values and other non-consistent data in this step. - -We will add the features text length and punctuation count in the data frame specifically for this application. We will also do the stemming, i.e., we will convert all similar words (like ‘give’, ‘giving’, etc) into a single form. Once this is done, we divide the data set into two — X and Y — where X is the features and Y is the prediction class. - -This is done using the following piece of code. Figure 3 shows the data frame after these steps are taken. - -![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’] -``` - -We now need to convert the string into numerical data. We use a count vectorizer for this purpose; that is, we get the counts of each word and convert it into a vector. - -After this, features such as length of text and punctuation count in the dataframe, i.e., X, are calculated. A sample of X is shown in Figure 4. - -![Figure 4: Sample of final features][4] - -Now the data is ready for training. The next step is to determine which algorithms we are going to use for training our model. As has been mentioned before, we are going to try several algorithms and determine the best one for sentiment analysis. Since we are basically trying to do binary classification, the following algorithms can be used: - -* K-nearest neighbors (KNN) -* Logistic regression -* Support vector machines (SVMs) -* Stochastic gradient descent -* Naive Bayes -* Decision tree -* Random Forest - -We first need to split our data set into testing and training data. This is done by using the sklearn library using the following code: - -``` -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) -``` - -We will use 20 per cent of the data for testing and 80 per cent for the training part. We will separate the data because we want to test on a new set of data whether our model is working properly or not. - -Now let us start with the first model. We will try the KNN algorithm first, and use the sklearn library for this. We will first train the model and then assess its performance (all of this can be done using the sklearn library in Python itself). The following piece of code does this, and we get an accuracy of around 50 per cent. - -``` -from sklearn.neighbors import KNeighborsClassifier -model = KNeighborsClassifier (n_neighbors=3) -model.fit(X_train, y_train) -model.score (X_test,y_test) - -0.5056689342403629 -``` - -The code is similar in the logistic regression model — we first import the function from the library, fit the model, and then test it. The following piece of code uses the logistic regression algorithm. The output shows we got an accuracy of around 66 per cent. - -``` -from sklearn.linear_model import LogisticRegression -model = LogisticRegression() -model.fit (X_train,y_train) -model.score (X_test,y_test) - -0.6621315192743764 -``` - -The following piece of code uses SVM. The output shows we got an accuracy of around 67 per cent. - -``` -from sklearn import svm -model = svm.SVC(kernel=’linear’) -model.fit(X_train, y_train) -model.score(X_test,y_test) - -0.6780045351473923 -``` - -The following piece of code uses the Random Forest algorithm, and we get an accuracy of around 69 per cent. - -``` -from sklearn.ensemble import RandomForestClassifier -model = RandomForestClassifier() -model.fit(X_train, y_train) -model.score(X_test,y_test) - -0.6938775510204082 -``` - -Next we use the Decision tree algorithm, which gives an accuracy of around 61 per cent. - -``` -from sklearn.tree import DecisionTreeClassifier -model = DecisionTreeClassifier() -model = model.fit(X_train,y_train) -model.score(X_test,y_test) - -0.6190476190476191 -``` - -The following piece of code uses the stochastic gradient descent algorithm. The output shows that we got an accuracy of around 49 per cent. - -``` -from sklearn.linear_model import SGDClassifier -model = SGDClassifier() -model = model.fit(X_train,y_train) -model.score(X_test,y_test) - -0.49206349206349204 -``` - -The following piece of code uses Naive Bayes. We get an accuracy of around 60 per cent. - -``` -from sklearn.naive_bayes import GaussianNB -model = GaussianNB() -model.fit(X_train, y_train) -model.score(X_test,y_test) - -0.6009070294784581 -``` - -Now that we have checked out all the algorithms, let us graph their accuracy performance. The graph is shown in Figure 5. - -![Figure 5: Accuracy performance of the different algorithms][5] - -As you can see, the random forest algorithm gave the best accuracy for this problem and we can conclude that it is the best fit for sentiment analysis amongst ML algorithms. We can improve the accuracy much more by getting better features, trying out other vectorising techniques, and using a better data set or newer classification algorithms. - -Now that random forest is seen as the best algorithm for this problem, I am going to show you a sample prediction. In Figure 6, you can see that the right predictions are being made! Do try this out to improve upon this project! - -![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] -译者:[译者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 -[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 diff --git a/sources/tech/20220922 How to Install and Use GNOME Boxes to Create Virtual Machines.md b/sources/tech/20220922 How to Install and Use GNOME Boxes to Create Virtual Machines.md index 1e2eeb7abc..1f8d265d2d 100644 --- a/sources/tech/20220922 How to Install and Use GNOME Boxes to Create Virtual Machines.md +++ b/sources/tech/20220922 How to Install and Use GNOME Boxes to Create Virtual Machines.md @@ -2,7 +2,7 @@ [#]: via: "https://www.debugpoint.com/install-use-gnome-boxes/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lkxed" -[#]: translator: " " +[#]: translator: "void-mori" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " diff --git a/sources/tech/20221004 Learn the OSI model in 5 minutes.md b/sources/tech/20221004 Learn the OSI model in 5 minutes.md deleted file mode 100644 index 717e6d1946..0000000000 --- a/sources/tech/20221004 Learn the OSI model in 5 minutes.md +++ /dev/null @@ -1,100 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Learn the OSI model in 5 minutes -====== -Get the basics of the Open Systems Interconnection (OSI) framework for conceptualizing communication within a computer system. - -The Open Systems Interconnection (OSI) model is a standard for how computers, servers, and people communicate within a system. It was the first standard model for network communications and was adopted in the early 1980s by all major computer and telecommunications companies. - -The OSI model provides a universal language for describing networks and thinking about them in discrete chunks, or layers. - -### Layers of the OSI model - -The model describes the seven layers through which computer systems communicate over a network. - -1. [Application layer][2] -2. [Presentation layer][3] -3. [Session layer][4] -4. [Transport layer][5] -5. [Network layer][6] -6. [Data link layer][7] -7. [Physical layer][8] - -Each of these layers has its own way of working, with its own set of protocols that distinguish it from the others. This article provides a breakdown of the layers one by one. - -### Application layer - -The application layer is implemented in software. It is the layer used to interact with applications. - -Consider the example of sending a message. The sender will interact with the application layer and send the message. The application layer sends the message to the next layer in the OSI Model, the presentation layer. - -### Presentation layer - -The data from the application layer is forwarded to the presentation layer. The presentation layer receives the data in the form of words, characters, letters, numbers, and so on, and converts them into machine representable binary format. This process is known as translation. - -At this stage, ASCII characters (American Standard Code for Information Interchange) are converted into Extended Binary Coded Decimal Interchange Code (EBCDIC). Before the converted data goes further, it also undergoes encoding and encryption processes, using the SSL protocol for encryption and decryption. - -The presentation layer provides abstraction and assumes that the layers following it will take care of the data forwarded to them from this layer. It also plays a role in compression of the data. The compression can be lossy or lossless, depending on various factors beyond this article's scope. - -### Session layer - -The session layer helps in setting up and managing connections. The main work of this layer is to establish a session. For example, on an online shopping site, a session is created between your computer and the site's server. - -The session layer enables the sending and receiving of data, followed by the termination of connected sessions. Authentication is done before a session is established, followed by authorization. Like the previous layers, the session layer also assumes that, after its work is done, the data will be correctly handled by the subsequent layers. - -### Transport layer - -The transport layer manages data transportation and its own set of protocols for how data will be transferred. The data received here from the session layer is divided into smaller data units called segments. This process is known as segmentation. Every segment contains the source's and destination's port numbers and a sequence number. Port numbers identify the application on which the data needs to be sent. Note that the data is transferred in chunks. The sequence numbers are used to reassemble the segments in the correct order. - -The transport layer takes care of the flow control, or the amount of data transferred at a given time. It also accounts for error control, such as data loss, data corruption, and so on. It makes use of an error-detecting value known as a checksum. The transport layer adds a checksum to every data segment to check whether the sent data is received correctly. Data is then transferred to the network layer. - -### Network layer - -The network layer helps communicate with other networks. It works to transmit received data segments from one computer to another located in a different network. The router lives in the network layer. - -The function of the network layer is logical addressing (IP Addressing). It assigns the sender's and receiver's IP addresses to each data packet to ensure it is received at the correct destination. The network layer then routes the data packets. Load balancing also happens in the network layer to make sure that no overloading takes place. Next, the data is transported to the data link layer. - -### Data link layer - -The data link layer allows direct communication with other devices, such as computers and hosts. - -It receives data packets containing the IP addresses of the sender and receiver from the network layer and does the physical addressing, assigning the media access control (MAC) addresses of the sender and receiver to a data packet to form a frame. - -### Physical layer - -This layer consists of all the hardware and mechanical elements of a system, including the configuration of wires, pins, adapters, and so forth. The data received here by the preceding layers is in the form of 0s and 1s. The physical layer converts this data and transports it to local media via various means, including wires, electrical signals, light signals (as in optical fiber cables), and radio signals (as in WiFi). - -Note that the physical layer works at the receiver's end and transports the received signal to the data link as a frame (by converting it back to bits). The frame is moved to the higher layers, and ultimately the required data is received at the application layer, which is the software. - -### Conclusion - -The OSI model is helpful when you need to describe network architecture or troubleshoot network problems. I hope this article gave you a clearer understanding of the elements this model. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/10/osi-model-network-communications - -作者:[Anamika][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/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 diff --git a/sources/tech/20221024.0 ⭐️⭐️ Give your Terminal a Retro Look Using this Neat Application.md b/sources/tech/20221024.0 ⭐️⭐️ Give your Terminal a Retro Look Using this Neat Application.md deleted file mode 100644 index 368c395c73..0000000000 --- a/sources/tech/20221024.0 ⭐️⭐️ Give your Terminal a Retro Look Using this Neat Application.md +++ /dev/null @@ -1,115 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Give your Terminal a Retro Look Using this Neat Application -====== - -**Want to give your Terminal a retro look? This guide contains instructions to help you to install Cool Retro Terminal application in all Linux distributions.** - -![Cool Retro Terminal][1] - -Cool Retro Terminal - -Have you ever wondered how you can mimic the look of those old CRT monitors displayed in your Linux terminal? - -Those CRT screens have their own fan base. Like the Apple 2 or the IBM 3278 terminals – they are really cool looking if you compare them to today’s 4K monitor displays. I am not saying 4K is bad, but sometimes legacy displays remind us of those bygone days. Enough of these ramblings. Let’s get started installing the app. - -### Cool Retro Term - -The application is free and open-sourced. And it is called [cool-retro-term][2]. It is lightweight and has many customization options with pre-set profiles, such as Apple 2, etc. It also gives you those static noises and scan-lines effects in your terminal. Cool, isn’t it? - -It is built in Qt and requires Qt 5.2 and higher. If you are using the latest Linux distributions, you should be good in terms of dependencies. - -![Green Scanlines Theme][3] - -Green Scanlines Theme - -### How to Download and Install Cool Retro Terminal - -#### Ubuntu, Linux Mint and other Debian-based distributions - -The following simple command will install this application in your Ubuntu and other related distributions. - -``` -sudo apt install cool-retro-term -``` - -#### Arch Linux - -This package is available in Arch User Repository AUR. If you do not have AUR enabled, enable it using [this guide][4] and then use the following commands to install it. - -``` -pacman -S cool-retro-term -``` - -#### Fedora, RHEL and other related distributions - -For Fedora and other related Linux, use the following command to install this app. - -``` -sudo dnf install cool-retro-term -``` - -#### Appimage - -A self-contained executable as AppImage is also available, which you can just download and run. No installation is required. Follow the below commands to do that. - -``` -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 -``` - -Note: Version 1.2.0 onwards there are no AppImage build in the GitHub. - -### Configurations - -After the installation is finished, you can find the terminal application “Cool Retro Term” in the application menu. So, launch the application and enjoy. - -Remember, this is not overriding your default console/terminal application in your Linux distributions. It is a stand-alone console application. - -The configuration options are available via the Right Click context menu. - -The context menu gives you the following pre-sets. You can then configure each of them for colour, and appearance settings via the settings window. For example, if you want more transparency, contrast or more noise, ambient light or flickering – all of them can be configured from the below settings window via several options. - -And easily you can make your own theme. - -![Pre-loaded Themes in Cool Retro Term][5] - -Pre-loaded Themes in Cool Retro Term - -![Various Effects in Settings][6] - -Various Effects in Settings - -### Summary - -Cool Retro Terminal is an old tube-style terminal for Linux desktops that allows you to experience it as if you are sitting in front of a retro terminal. You may or may not like it, and one hardly uses it for a daily driver. But still, a nice-looking terminal to experience from time to time to get away from the mundane terminal. - -Do you like the retro look? What is your favourite theme? Let me know in the comment section below. - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/cool-retro-terminal/ - -作者:[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/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/sources/tech/20221031.1 ⭐️⭐️⭐️ 10 universal steps for open source code review.md b/sources/tech/20221031.1 ⭐️⭐️⭐️ 10 universal steps for open source code review.md deleted file mode 100644 index f432506bf1..0000000000 --- a/sources/tech/20221031.1 ⭐️⭐️⭐️ 10 universal steps for open source code review.md +++ /dev/null @@ -1,134 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -10 universal steps for open source code review -====== - -Code review doesn't have to be scary when you follow this universal process. - -Have you ever found yourself in a situation where you needed to do a code review but didn't fully understand the project? Maybe you did not review it to avoid looking like you didn't know what you were doing. - -This article assures you that there's a better way. You don't need to know everything to provide a code review. In fact, based on my experience, that's quite common. - -I remember when I joined Red Hat as an intern and was asked to help with code reviews. We used a system of +1 or -1 votes, and I was initially very hesitant to weigh in. I found myself asking whether when I gave a +1 on a change but then someone else voted -1, would I look foolish? - -What does happen if someone votes -1 on a change you've vote +1? The answer is nothing! You might have missed a detail that the other person noticed. It's not the end of the world. That's why we have this voting system. Like the rest of open source, merging code is a collaborative effort. - -Lately, I've been so inundated with code reviews that I can hardly keep up with them. I also noticed that the number of contributors doing these reviews steadily decreased. - -For this reason, I'm writing about my point of view on writing a code review. In this article, I'll share some helpful tips and tricks. I'll show you a few questions you should ask yourself and a few ideas of what to look for when doing a code review. - -### What is the purpose of a code review? - -Have you ever written a really simple patch? Something you think is so trivial that it doesn't require a review? Maybe you merged it straight away. Later, it turns out there was a mistake, something obvious or silly, like the wrong indentation or a few duplicated lines of code instead of a function call (yes, I'm speaking from experience!). - -A code review by someone else would have caught these things. - -The point of a code review is to bring a fresh pair of eyes with a new perspective on the problem you're trying to solve. That new context is exactly the reason a code review is crucial. - -You may think that you must be an expert in the language to review someone else's code, the project, or both. Here's a secret all code reviewers want you to know: That's wrong! You don't need to fully understand the project or the language to provide a fresh perspective on a change. There's a universal process of code review. - -### The universal process of a code review - -Here's my process for code review, grouped into a couple of points. The process provides questions I ask myself to help me focus on a code change and its consequences. You don't need to go in this specific order. If there's a step, you can't execute for any reason, just move to another step. - -### 1. Understand the change, what it's trying to solve, and why - -The explanation of why the change is needed and any relevant context should be in the commit message. If it isn't, request it and feel free to -1 until it's provided. - -Is it something that needs to be solved? Is it something the project should focus on, or is it completely out of scope? - -### 2. How would you implement the solution? Would it be different? - -At this point, you know what the code change is about. How would you have done it? Think about this before reviewing the change in detail. If the solution you have in mind is different from the one you're reviewing, and you think it's better, bring that up in the review. You don't need to -1 it; just ask why the author didn't go in this direction and see how the discussion evolves. - -### 3. Run the code with and without the change - -I usually put a few breakpoints into the code, run it, and inspect how the new code interacts with the rest. - -If you can't run the whole code, try to copy the function containing the new code to a new local file, simulate the input data, and run that. This is helpful when you either don't know how to run the whole project or when it requires a specific environment to which you don't have access. - -### 4. Can the new code break anything? - -I mean, really anything. Think about the consequences. - -In the case of a new command-line option, will it always be accepted by the target? - -Can a situation occur when the option wouldn't be accepted or when it could conflict with something? - -Maybe it's a new import. Is the new library, and possibly a new dependency, available in the older releases or systems you ship the project for? - -What about security? Is the new dependency safe to use? The least you can do is run a quick Internet search to find out. Also, look for warnings in the console log. Sometimes there are more secure methods within the same library. - -### 5. Is the code effective? - -You've determined that the proposed solution is probably correct. Now it's time to check the code itself, its effectiveness, and its necessity. - -Check the style of the new code. Does it match the style of the project? Any open source project has (or should have) a document informing (new) contributors about the styles and good practices the project follows. - -For instance, every project in the OpenStack community has a HACKING.rst file. There's often also [a guide for new contributors][1] with all the must-know information. - -### 6. Check that all new variables and imports are used - -Often, there have been many iterations of the code you're reviewing, and sometimes the final version is very different from when it started. It's easy to forget an import or a new variable that was needed in a former version of the new code. Automation usually checks these things using linting tools like [flake8][2] in the case of Python code. - -Can you rewrite the code without declaring new variables? Well, usually, yes, but the question is whether it's better that way. Does it bring any benefit? The goal isn't to create as many one-liners as possible. The goal is to write code that is both efficient and easy to read. - -### 7. Are the new functions or methods necessary? - -Is there a similar function that can be reused somewhere in the project? It's always worth helping to avoid reinventing the wheel and re-implementing logic that's already been defined. - -### 8. Are there unit tests? - -If the patch adds a new function or new logic in a function, it should also include new unit tests for that. It's always better when the author of a new function also writes unit tests for it. - -### 9. Verify refactoring - -If the commit refactors existing code (it renames a variable, changes variable scope, changes the footprint of a function by adding or removing arguments, or removes something), ask yourself: - -- Can this be removed? Will it affect the stable branch? -- Are all the occurrences deleted? - -You can use the [grep command][3] to find out. You wouldn't believe how many times I've voted -1 just because of this. This is a simple mistake that anyone can make, but that also means anyone can uncover it. - -The owner of the commit can easily overlook these things, which is totally understandable. It's happened to me many times too. I'd finally figured out the root of the problem I'd been fixing, so I was in a rush to propose the review, and then I forgot to check the whole repo. - -Apart from the project's repository, sometimes it's also necessary to check other code consumers. If some other project imports this one, they may need refactoring, too. In the OpenStack community, we have a tool that searches across every community project. - -### 10. Does project documentation need to be modified? - -Again, you can use the [grep command][4] to check whether the project documentation mentions anything related to the code change. Apply common sense to determine whether a change needs to be documented for end users or it's just an internal change that doesn't affect user experience. - -### Bonus tip: Be considerate - -Be considerate, precise, and descriptive if you make a suggestion or comment on something after you've reviewed the new code. Ask questions if you don't understand something. If you think the code is wrong, explain why you think so. Remember, the author can't fix it if they don't know what's broken. - -### Final words - -The only bad review is no review. By reviewing and voting, you provide your point of view and vote only for that. Nobody expects you to give the final yes or no (unless you're a core maintainer!), but the voting system allows you to provide your perspective and opinion. A patch owner will be glad you did it, trust me. - -Can you think of any other steps for a good review? Do you have any special technique different from mine? Let us all know in the comments! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/10/code-review - -作者:[Martin Kopec][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/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 diff --git a/sources/tech/20221103.6 ⭐️⭐️⭐️ How To Securely Transfer Files With SCP In Linux.md b/sources/tech/20221103.6 ⭐️⭐️⭐️ How To Securely Transfer Files With SCP In Linux.md deleted file mode 100644 index 29e1dbb48d..0000000000 --- a/sources/tech/20221103.6 ⭐️⭐️⭐️ How To Securely Transfer Files With SCP In Linux.md +++ /dev/null @@ -1,537 +0,0 @@ -[#]: 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: " " -[#]: publisher: " " -[#]: url: " " - -How To Securely Transfer Files With SCP In Linux -====== - -File transfer over a network can be done in various ways and using different protocols. The most commonly used protocols for **copying files remotely** are **Rsync**, **SCP** and **SFTP**. In this guide, we will look at **what is SCP** and how to **securely transfer files between local and remote computers with SCP** in Linux and Unix-like operating systems. - -### What is SCP? - -SCP, stands for **Secure Copy**, is a command line program to copy files and directories between a local and a remote system or between two remote systems in a secure way in Linux and Unix-like operating systems. - -Using `scp` command, you can securely copy a file or a directory, - -- from your local system to a remote system, -- from a remote system to your local system, -- between remote systems from your local system. - -When transferring data with the scp command, the files and directories are both encrypted. So even if your network is compromised, the perpetrators can't get any meaningful data. - -SCP is a component of the openSSH program and it uses the SSH protocol to securely transfer files. OpenSSH comes pre-installed with almost all modern Linux and Unix distributions, so don't bother installing it. - -#### A word of caution: - -According to the **official announcement** from the openSSH developers, - -> The **scp protocol is outdated**, inflexible and not readily fixed. We recommend the use of more modern protocols like sftp and rsync for file transfer instead. -> -> Link - [https://lists.mindrot.org/pipermail/openssh-unix-dev/2019-March/037672.html][1] - -However, the majority of the users still prefer SCP over other protocols. Because, SCP handles remote-to-remote file transfers more efficiently than its counterparts such as SFTP and Rsync. - -And also, SCP works exactly like `cp` command, while `rsync` changes its behavior based on whether the source directory has a **trailing slash** or not. Take a look at the following commands: - -- `rsync source destination/` - would copy the source into the destination folder. -- `rsync source/ destination/` - would copy the contents of the source folder into the destination folder. - -So you must always double check if you've put the trailing slash in the path. - -I personally use **[Rsync][2]** for copying large size files between two hosts and SCP for copying single files over a network. - -### SCP Command Syntax - -The general syntax for SCP command is given below: - -``` -scp [-346ABCpqrTv] [-c cipher] [-F ssh_config] [-i identity_file] [-J destination] [-l limit] [-o ssh_option] [-P port] [-S program] source ... target -``` - -Depending upon the file transfer path, the syntax will differ. Here I have included some example syntax format. - -Copy a file from your local system to a remote system: - -``` -scp SourceFile User@RemoteHost:RemotePath -``` - -Similarly, to copy a directory from your local system to a remote system, use `-r` flag: - -``` -scp -r SourceDirectory User@RemoteHost:RemotePath -``` - -Copy multiple files to a remote system: - -``` -scp SourceFile1 SourceFile2 User@RemoteHost:RemotePath -``` - -Copy a file from remote system to your local system: - -``` -scp User@RemoteHost:RemoteFilePath DestinationFile -``` - -Copy a directory from remote system to local system: - -``` -scp -r User@RemoteHost:RemoteDirectoryPath DestinationDirectory -``` - -Copy a file from one remote system to another remote system from your local system: - -``` -scp User@RemoteHost1:RemoteFile1 User@RemoteHost2:RemotePath -``` - -Please note that when you copy files between two remote systems, the traffic will not pass through the local system. The operation takes place directly between two remote systems. You can, however, pass the traffic from the system on which you run scp command using `-3` option. - -Copy a directory from one remote system to another remote system from your local system: - -``` -scp -r User@RemoteHost1:RemoteDirectory User@RemoteHost2:DestinationPath -``` - -### SCP Command Options - -The most commonly used options of SCP command are: - -- **`-C`** : Enable compression. Here, C stands for Compression. When you use this option, the data transfer speed will be faster, because the data is compressed. SCP will automatically enable the compression at the source system and decompression at the destination system. -- **`-c `** : c stands for cipher. By default, SCP uses **'AES-128'** encryption method for encrypting data. You can change the encryption method using `-c` option. -- **`-i `** : i stands for Identity file or Private key. As you already know, there are password-based and key-based authentication used in SSH. If you want to use key-based authentication while transferring files, you can use the -i option to specify the Identity file or Private key. -- **`-l limit`** : l stands for limit bandwidth. Using this option, you can set the maximum bandwidth used for transferring data. The limit should be specified in **`Kbit/s`**. -- **`-F `** : Some times, you may need to use different networks to connect to your Linux systems. Or you may be behind a proxy server. In such situations, you can use different `ssh_config` file using `-F` option. -- **`-P port`** - P stands for Port. Please note that it is uppercase P. By default, SSH uses port number 22. You might have changed the port number in the destination host for security reasons. In that case, you should explicitly mention the new port number using `-P` option. -- **`-p`** : if you want to preserve modification times, access times, and modes from the original file, you need to use -p option while copying files. Please note that it is lowercase p. -- **`-r`** : Recursively copy entire directories. -- **`-B`** : B stands for batch mode. It is used for selecting batch mode while transferring files. It prevents asking for passwords or passphrases. -- **`-S program`** : Name of the program to use for the encrypted connection. -- **`-v`** : v stands for verbose. When using the `-v` option, the command will print the progress in your Terminal screen. So, you will see the what exactly is going on when the files are being transferred. It is useful in debugging connection, authentication, and configuration problems. - -SCP has so many options. You can check the man pages of SCP command to learn about other options. Let us see some **useful scp command examples**. - -### Important Notes to Remember before You Begin - -- The `scp` command relies on `ssh` for secure file transfer. So you must have either a **ssh key** or **password** to authenticate to the remote systems. -- To be able to transfer files, you must have **read permission on the source files** and **write permission on the destination** location. -- The `scp` command will not check the destination location before writing. Any files in the destination with the same name will be **overwritten without notification**. -- To be able to distinguish between local and remote locations, use a **colon** (**`:`**). -- When transferring large files, it is recommended to start the task inside a **[Screen][3]** or **[Tmux][4]** session. - -### Transfer Files With SCP in Linux - -As I already mentioned, we can use `scp` command to copy a file or a directory from a local system to a remote system and vice versa and copy files and folders between one remote computer to another remote computer. - -#### 1 Copy Files with SCP from Local System to Remote System - -To copy a file from a local system to a remote system using `scp` command, run: - -``` -$ scp File1.txt ostechnix@192.168.1.40:/home/ostechnix/ -``` - -**Sample Output:** - -``` -ostechnix@192.168.1.40's password: -File1.txt 100% 104 814.0KB/s 00:00 -``` - -Let us break down the above command and see what each option does. - -- `**File1.txt**` - The source file to be copied to the destination. -- `**ostechnix**` - The username of the remote system. -- `**192.168.1.40**` - The IP address of the remote system. -- `**/home/ostechnix/**` - The destination directory in the remote system. This is the absolute path where we want to transfer the source file i.e. `File.txt`. - -You can also copy the file and rename it as well. The following command transfers the **`File1.txt`** to the destination and saves the file with different name **`myfile.txt`**. - -``` -$ scp File1.txt ostechnix@192.168.1.40:/home/ostechnix/myfile.txt -``` - -![Copy Files From Local System To Remote System][5] - -Copy Files from Local System to Remote System - -#### 2. Copy Multiple Files with SCP from Local System to Remote System - -To transfer multiple files from a local system to a remote system with `scp` command, run: - -``` -$ scp File1.txt File2.txt ostechnix@192.168.1.40:/home/ostechnix/ -``` - -**Sample Output:** - -``` -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 -``` - -![Copy Multiple Files from Local System to Remote System][6] - -Copy Multiple Files from Local System to Remote System - -Here, - -- `**File1.txt**` and **`File2.txt`** - The name of the sources that will be copied to the specified destination. -- `**ostechnix@192.168.1.40**` - The username and IP address of the remote system. -- `**/home/ostechnix**` - The destination path where we want to put the copied files. - -If the files have same extension, you can use the following alternative commands to achieve the same goal. - -``` -$ scp {File1,File2}.txt ostechnix@192.168.1.40:/home/ostechnix/ -``` - -Or, - -``` -$ scp *.txt ostechnix@192.168.1.40:/home/ostechnix/ -``` - -#### 3. Recursively Copy Directories with SCP from Local System to Remote System - -To recursively copy an entire directory including the sub-directories and its contents from your local system to a remote system, use **`-r`** flag like below. - -``` -$ scp -r Documents/ ostechnix@192.168.1.40:/home/ostechnix/ -``` - -![Copy a Directory from Local System to Remote System][7] - -Copy a Directory from Local System to Remote System - -The above command will copy the entire directory **'`Documents`'** including its contents to the destination system. - -Here, - -- **`-r`** : Copy files and directories recursively including the sub-directories and its contents. -- **`Documents`** : The name of the source directory that we want to copy to the destination. -- `**ostechnix@192.168.1.40**` : The username and IP address of the remote system. -- `**/home/ostechnix**` : The destination path where we want to put the copied directory. - -#### 4. Transfer Files with SCP from Remote System to Local System - -Remember we copied `FIle1.txt` to the remote system from our local system. Let us copy it back to the local system. - -To copy a file from a remote system to your local system with `scp`, run: - -``` -$ scp ostechnix@192.168.1.40:/home/ostechnix/File1.txt Downloads/ -``` - -Here, - -- `**ostechnix@192.168.1.40**` : The username and IP address of the remote system. -- **`/home/ostechnix/File.txt`** : The absolute path of file that we want to copy to the local system. -- **`Downloads`** - The location where to save the copied file. - -![Transfer Files from Remote System to Local System][8] - -Transfer Files from Remote System to Local System - -#### 5. Transfer Multiple Files using SCP from Remote System to Local System - -To copy multiple files from a remote system to your local system, mention the absolute path of the files that you want to copy **within the curly braces** as shown below. - -``` -$ scp ostechnix@192.168.1.40:/home/ostechnix/\{File1.txt,File2.txt\} Downloads/ -``` - -![Transfer Multiple Files from Remote System to Local System][9] - -Transfer Multiple Files from Remote System to Local System - -The above command will copy the `File1.txt` and `File2.txt` from the `/home/ostechnix/` directory of the remote system to the `Downloads` directory of the local system. - -Please note that there is **no spaces after the commas within the curly braces**. - -#### 6. Recursively Copy Directories from Remote System to Local System - -To copy an entire directory including the sub-directories and its contents recursively from a remote computer to your local system using `scp`, use **`-r`** flag. - -``` -$ scp -r ostechnix@192.168.1.40:/home/ostechnix/Documents Downloads/ -``` - -The above command will copy the entire **`Documents`** from the remote system to the **`Downloads`** directory in your local system. - -#### 7. Copy Files using SCP between Two Remote Computers - -To copy files directly from one remote system to another remote system with `scp`, run: - -``` -$ scp senthil@192.168.1.40:/home/senthil/File1.txt kumar@192.168.1.20:/home/kumar/ -``` - -You will be asked to enter the password of the both remote systems. - -Here, - -- **`senthil@192.168.1.40`** - The username and IP address of the remote system from the file is currently located. -- **`/home/senthil/File1.txt`** - The name the file1 that is being copied and its location. -- `**kumar@192.168.1.20**` - The username and IP address of the remote system where we want to copy the file. -- **`/home/kumar`** - The location where to save the copied file on the remote system. - -The above command will copy the `/home/senthil/File1.txt` from the remote host `192.168.1.40` to `/home/kumar/` directory on the remote host `192.168.1.20`. - -In this method, the data will be transferred directly from one remote system to another remote system. If you want to route the traffic through the machine on which the command is run, use `**-3**` flag like below. - -``` -$ scp -3 senthil@192.168.1.40:/home/senthil/File1.txt kumar@192.168.1.20:/home/kumar/ -``` - -#### 8. Enable Compression while Copying Files with SCP - -So far we have transferred files without compressing them. Now we will enable compression while transferring files using **`-C`** flag. - -``` -$ scp -C File1.txt ostechnix@192.168.1.40:/home/ostechnix/ -``` - -The `-C` flag will enable compression of data at the source and automatically decompress the data at destination side. - -By enabling compression, you can increase the file copy or transfer speed significantly. - -#### 9. Limit Bandwidth while Transferring Files using SCP - -We can limit the bandwidth while copying files with SCP using `-l` flag. Please note that the maximum bandwidth is specified in Kbits/s. 1 byte=8 bits. So if you want to limit bandwidth to 200 KB/s, the value for `-l` would be **1600** (200*8). - -``` -$ scp -l 1600 File1.txt ostechnix@192.168.1.40:/home/ostechnix/ -``` - -This is useful when transferring large files to prevent SCP from throttling the bandwidth. - -#### 10. Use Different Port while Copying Files using SCP - -As a system admin, you might **[have changed the default port of your SSH protocol][10]** on the remote servers for security reasons. In such cases, you can specify the port number with `-P` flag when transferring files. Please note that this is **uppercase P**. - -``` -$ scp -P 2022 File1.txt ostechnix@192.168.1.40:/home/ostechnix/ -``` - -#### 11. Use Different Cipher while Copying Files with SCP - -By default, SCP uses **'`AES-128`'** for encrypting files. If you want to use different cipher, use **`-c`** flag followed by the cipher name. - -For example, if you want to use **'`3des-cbc`'** cipher, the command would be like below: - -``` -$ scp -c 3des-cbc File1.txt ostechnix@192.168.1.40:/home/ostechnix/ -``` - -To view the list of supported ciphers, run: - -``` -$ ssh -Q cipher localhost | paste -d, -s - -``` - -**Sample Output:** - -``` -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. Copying Files with SCP in Verbose Mode - -if you want to know what's going on behind the scenes while copying files with scp, you can use `**-v**` flag. When transferring files with SCP in Verbose mode, the step by step process of the SCP command execution will be displayed in the terminal. This comes in handy when troubleshooting times. - -``` -$ scp -v File1.txt ostechnix@192.168.1.40:/home/ostechnix/ -``` - -You will see a whole lot of output when sending files in Verbose mode as shown in the following output. - -![Copying Files with SCP in Verbose Mode][11] - -Copying Files with SCP in Verbose Mode - -#### 13. Transferring Files with SCP in Quiet Mode - -We can transfer files in quiet mode with **`-q`** flag. When sharing files in quiet mode, it will not show the copy progress, warning or diagnostic message in the output. - -``` -$ scp -q File1.txt ostechnix@192.168.1.40:/home/ostechnix/ -``` - -#### 14. Preserve File Attributes when Transferring Files with SCP - -To preserve file attributes such as file modification times, access times, and modes when copying files with SCP, use **`-p`** flag. Please note that this is **lowercase p**. - -``` -$ scp -p File1.txt ostechnix@192.168.1.40:/home/ostechnix/ -``` - -#### 15. Use Identity File when Copying Files with SCP - -SSH supports both password-based and key-based authentication. Key-based authentication is most widely used authentication method in Linux environments. - -If you want to use key-based authentication while transferring files, use the **`-i`** option to specify the Identity file or Private key. - -``` -$ scp -i my_private_key.pem File1.txt ostechnix@192.168.1.40:/home/ostechnix/ -``` - -#### 16. Use Different ssh_config File when Transferring Files with SCP - -There are situations where you need to use different networks to connect to your Linux systems. Or you may be behind a proxy server. In such situations, you can use different `ssh_config` file using `**-F**` option. - -``` -$ scp -F /home/ostechnix/my_ssh_config File1.txt ostechnix@192.168.1.40:/home/ostechnix/ -``` - -#### 17. Copy files with SCP using IPv4 or IPv6 - -We can force SCP to only use IPv4 or IPv6 addresses when copying files. This can be achieved by adding **`-4`** for IPv4 networks and **`-6`** for IPv6 networks. - -``` -$ scp -6 File1.txt ostechnix@192.168.1.40:/home/ostechnix/ -``` - -### Frequently Asked Questions - -#### Question 1: What is SCP? - -**Answer:** SCP is a command line program to securely transfer files and directories from a local system to a remote system and vice versa, or between two remote systems directly. - -#### Question 2: How to copy a file from the local computer to remote computer using SCP? - -To copy a file from your local system to a remote system, the command would be: - -``` -scp SourceFile.txt User@RemoteHost:/some/remote/directory -``` - -#### Question 3: How to copy recursively copy files and directories? - -To recursively copy a directory including the sub-directories, use `-r` flag. - -``` -scp -r /some/local/directory User@RemoteHost:/some/remote/directory -``` - -#### Question 4: Can I transfer multiple files using SCP? - -Yes, you can. Just mention the source file names with space separated. - -Copy multiple files from local to remote: - -``` -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 -``` - -Copy multiple files from remote to local: - -``` -scp User@RemoteHost:/some/remote/directory/\{file1.txt,file2.txt,file3.txt\} /some/local/directory -``` - -Copy multiple files from remote to remote: - -``` -$ scp User@RemoteHost1:/some/remote/directory/\{file1.txt,file2.txt,file3.txt\} User@RemoteHost2:/some/remote/directory/ -``` - -#### Question 5: How to transfer all files in a directory? - -To transfer all files in a directory, switch to that directory: - -``` -cd dir_name -``` - -``` -scp *.txt User@RemoteHost:/some/remote/directory -``` - -#### Question 6: Can I compress files? - -Yes, you can. Use **`-C`** to compress files. The files are compressed at source and decompress at destination automatically. - -``` -scp -C /some/large/file User@RemoteHost:/some/remote/directory -``` - -#### Question 7: Can I preserve file attributes? - -To preserve file attributes such as modification times, access times, and modes from the original file, use `-p` flag. - -``` -scp -p file.txt User@RemoteHost:/some/remote/directory -``` - -#### Question 8: Can I use different port? - -Yes. SCP allows you to use different port with `-P` flag. - -``` -scp -P 2022 file.txt User@RemoteHost:/some/remote/directory -``` - -#### Question 9: Can I use different cipher? - -Yes, you can. Use -c flag to use different cipher. - -``` -scp -c 3des-cbc User@RemoteHost:/some/remote/directory -``` - -#### Question 10: How do I list the supported ciphers by SSH? - -To view the list of supported ciphers by SSH and SCP, use the following command - -``` -ssh -Q cipher localhost | paste -d, -s - -``` - -#### Question 11: Is SCP really secure? - -Yes, it is completely secure to use. SCP uses the same SSH mechanism used by openSSH. The data in transit is encrypted at the source side and decrypted at destination. - -#### Question 12: Can I transfer files from a Windows system to a Linux system? - -Yes, you can. Use either **PSCP** program to transfer files from windows platform to Linux platform. You can also use **WinSCP**. - -### Conclusion - -In this comprehensive guide, we learned what is SCP, and how to **securely transfer files with SCP** in Linux. We provided **17 SCP command examples**. We also looked at the commonly asked questions about SCP. - -Whether you're a Linux Admin, or a Developer or a Regular user, you will have to copy files to and from a remote system at some point. Knowing how to **use SCP to securely copy files** will be definitely useful. - --------------------------------------------------------------------------------- - -via: https://ostechnix.com/securely-transfer-files-with-scp-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://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 diff --git a/sources/tech/20221105.3 ⭐️⭐️ How to Install GNOME Desktop in Arch Linux [Complete Guide].md b/sources/tech/20221105.3 ⭐️⭐️ How to Install GNOME Desktop in Arch Linux [Complete Guide].md deleted file mode 100644 index 221dd39e19..0000000000 --- a/sources/tech/20221105.3 ⭐️⭐️ How to Install GNOME Desktop in Arch Linux [Complete Guide].md +++ /dev/null @@ -1,290 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Install GNOME Desktop in Arch Linux [Complete Guide] -====== - -**This guide explains the steps you need to install GNOME Desktop in Arch Linux.** - -This guide has two parts. The first part deals with installing the base Arch system. The second part is installing the complete GNOME desktop environment on top of Arch Linux. - -### What is the GNOME Desktop? - -GNOME is a popular desktop environment that is a default desktop choice for many top-tier desktops-based Linux distributions such as Ubuntu and Fedora. Almost all flavors provide a GNOME desktop option. - -The GNOME desktop is one of the stable and user-friendly desktops, hence it is preferred by many average, advanced users. If you want a desktop that remains invisible while you carry out your work, GNOME is the one. It never gets into your way while working. Hence it is still popular and default option for many despite many controversies about being GNOME3 (current iteration) being slow, resource-heavy, etc, - -With all that said, let’s take a look at how you can install a GNOME desktop in bare metal Arch installations. - -### Install GNOME Desktop in Arch Linux - -#### Part 1: Install Arch Linux - -If you have already Arch Linux installed, you can skip this step and directly go to the install GNOME Desktop section below. - -For a quick Arch Linux base installation, follow the below steps. You can also visit [this guide][1] for a complete tutorial on how to install Arch Linux as Dual Boot or in a virtual machine. - -The following steps are a straightforward legacy way of installing Arch. Follow the guide below for a more modern way of using the archinstall script. Once you are done, come back to resume GNOME installation via [step 2][2]. - -Modern method: Install using archinstall script (recommended) - -##### Legacy method: Download Arch Linux - -Download Arch Linux .iso from the below link. There are magnet and torrent links available. Once you download, write the ISO to a USB drive. And then boot from the drive. - -[Download Arch Linux][3] - -If you are planning to install it as a virtual machine image via GNOME Boxes, virt-manager – then you do not need to write it to a USB drive. - -##### Boot and Configure Partitions - -After you boot from the Arch Linux iso, you have to run a series of commands to install the base system. - -First, run the below command to find out the device identifier. - -``` -fdisk -l -``` - -![fdisk -l before][4] - -Then with the device identifier, run the below command to start partitioning your disk. Make sure to change `/dev/sda` as per your system. - -``` -cfdisk /dev/sda -``` - -Select `label type = dos` in the next prompt. - -Select the free space and choose option NEW from the bottom. In this example, I will create three partitions as per below. - -``` -/dev/sda1 - 1G - for /boot/dev/sda2 - 5G - for root/dev/sda3 - 1G - for swap -``` - -![cfdisk][5] - -In the next screen provide partition size for the boot partition (for this example, I gave 1 GB). Select it as the primary partition. - -Repeat the same step for the main root partition of size 5GB. - -![Swap partition type change][6] - -Create a swap partition using the same steps with size 1G (you may change it as per your need). After you create the swap partition, make sure to choose Type at the bottom and mark it as a swap with the option “Linux Swap/Solaris”. - -![final partition list in cfdisk][7] - -Once done, write the changes to the disk using the Write option at the bottom. Make sure you take a backup before you write as this is a permanent change in your system. - -Run the below command to check before you proceed. You can see in this example, three partitions are listed. - -``` -fdisk -l -``` - -![final partition list in fdisk][8] - -Run the following commands in sequence to format and create an ext4 file system in the newly created partition above. Make sure you change the /dev/sda1 and /dev/sda2 as per your need. - -``` -mkfs.ext4 /dev/sda1mkfs.ext4 /dev/sda2mkswap /dev/sda3swapon /dev/sda3 -``` - -After completion, mount the system and create necessary directories. - -``` -mount /dev/sda2 /mntmkdir /mnt/boot /mnt/var /mnt/homemount /dev/sda1 /mnt/boot -``` - -Again, make sure you change /dev/sda1, /dev/sda2 and /dev/sda3 as per your system. - -![prepare file system][9] - -##### Install the base system - -I hope you are already connected to the internet. If not, try using a USB dongle or wired internet connection which Arch installer automatically configure and detect. If you do not have a wired connection available, follow [this guide][10] to configure a wireless or wifi network using Arch Linux installer. - -Run the below commands in sequence to install the base system in the mounted partition. The download size is approx 400 MB. - -``` -pacman -Syypacstrap /mnt base base-devel linux linux-firmware nano dhcpcd net-tools grub -``` - -![Install base system][11] - -Once complete, generate file system table without which you can’t boot the system. - -``` -genfstab -U /mnt >> /mnt/etc/fstab -``` - -##### Configure the base system - -Follow the below commands in sequence to configure the base system. This involves setting up your locale, language, add a login user, and setting up the internet. - -``` -arch-chroot /mntnano /etc/locale.gen -``` - -Uncomment the locale of your choice by removing # at the beginning. For this guide, I have chosen en_US.UTF-8 UTF-8. Press CTRL+O, Enter, and CTRL+X to exit from nano. - -![change locale][12] - -Generate the locale using: - -``` -locale-gen -``` - -Setup the language using the below command. - -``` -echo LANG=en_US.UTF-8 > /etc/locale.confexport LANG=en_US.UTF-8 -``` - -Setup the local time zone. - -``` -ln -s /usr/share/zoneinfo/America/New_York /etc/localtime -``` - -Again, you can choose them as per your need. You can list the local timezones via the below commands. - -``` -ls /usr/share/zoneinfo -ls /usr/share/zoneinfo/America -``` - -Setup the hardware clock, create a hostname, and enable the DHCP for the internet using the below commands in sequence. You can change `"arindam-pc"` to any hostname as per your desire. - -``` -hwclock --systohc --utcecho arindam-pc > /etc/hostnamesystemctl enable dhcpcd -``` - -The next step is to set up the root user password, create an admin user, and add the user in the sudoers file. - -Follow the below commands in sequence. Make sure to change the user name from `debugpoint` to something else as per your need. - -``` -passwd rootuseradd -m -g users -G wheel -s /bin/bash debugpointpasswd debugpoint -``` - -![create user][13] - -Open the sudoers file and add the below lines. - -``` -nano /etc/sudoers -``` - -Add below lines. As you already created the root user, the entry should be there. - -``` -root ALL=(ALL) ALLdebugpoint ALL=(ALL) ALL -``` - -![update sudoers file][14] - -Install grub, setup the initial ramdisk environment, unmount the system using the below commands in sequence. - -``` -grub-install /dev/sdagrub-mkconfig -o /boot/grub/grub.cfgmkinitcpio -p linuxexit -``` - -![configure grub][15] - -Then reboot your system. If you are isntalling in a physical system, unplug the USB media at this step. - -``` -umount /mnt/boot -umount /mnt -reboot -``` - -You have now successfully installed the Arch Linux base system. It’s time to install the complete GNOME desktop. - -![Arch is installed][16] - -#### Part 2: Install GNOME in Arch Linux - -After reboot, choose Arch Linux from grub. In the Arch Linux prompt start running the following commands in sequence. These commands install Xorg server, display manager, GNOME desktop components, controller packages, and additional applications. - -For all the commands use default, i.e. press enter when asked. - -- **Install Xorg server. Approx install size is 80 MB.** - -``` -sudo pacman -S --needed xorg -``` - -- **Install display manager, GNOME desktop. Approx install size is 300 MB.** - -``` -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 -``` - -The above installation would ask for several options for packages. Choose any of the ones you want. If you are unsure, choose jack, noto-sans and xdg-portal-desktop-gnome when asked. - -- **Install applications** - -This is just a reference. You can also install the ones you require. - -``` -sudo pacman -S --needed firefox vlc filezilla leafpad xscreensaver archlinux-wallpaper -``` - -Now it’s time to enable the display manager and network manager as service. So that next time you log on, they can run automatically by systemd. - -``` -systemctl enable gdm -systemctl enable NetworkManager -``` - -Reboot the system using the reboot command. - -``` -reboot -``` - -![Arch Linux Running GNOME 43 Desktop][17] - -If all goes well, you should see a nice login prompt on the GNOME desktop. Login using the credential you just created. You should be greeted with a nice and clean GNOME 43 desktop in Arch Linux. - -I hope this guide helps you to install GNOME desktop in a bare metal Arch instalation. - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/gnome-arch-linux-install/ - -作者:[Arindam][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lkxed -[1]: https://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 diff --git a/sources/tech/20221106.1 ⭐️ How to Install MATE Desktop in Arch Linux [Complete Guide].md b/sources/tech/20221106.1 ⭐️ How to Install MATE Desktop in Arch Linux [Complete Guide].md deleted file mode 100644 index cfcdccd046..0000000000 --- a/sources/tech/20221106.1 ⭐️ How to Install MATE Desktop in Arch Linux [Complete Guide].md +++ /dev/null @@ -1,98 +0,0 @@ -[#]: subject: "How to Install MATE Desktop in Arch Linux [Complete Guide]" -[#]: via: "https://www.debugpoint.com/mate-desktop-arch-linux-install/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Install MATE Desktop in Arch Linux [Complete Guide] -====== - -**This guide explains the steps you need to install MATE Desktop in Arch Linux.** - -This guide has two parts. The first part deals with installing the base Arch system. The second part is installing the complete MATE desktop environment on top of Arch Linux. - -This article tested in the following versions: MATE 1.24, and MATE 1.26. - -### What is the MATE Desktop? - -When the GNOME desktop changed its direction from GNOME 2 to GNOME 3 – by changing the user interaction and interface, the MATE desktop continued the older/Legacy GNOME 2 development. So, the MATE desktop environment continues the GNOME 2 desktop, which preserved the traditional desktop experience in Linux. It is fast and low on memory consumption. In my opinion, one of the underrated desktop environments which need more love! - -The MATE team continued development as it is one of the popular GNOME 2 based desktop while supporting newer technologies. You can learn more on its [official website][1]. - -### Install MATE Desktop in Arch Linux - -#### Part 1: Install Arch Linux - -If you already have Arch Linux installed, you can skip this step and directly go to the [installation of MATE Desktop section below][2]. - -For a quick Arch Linux installation, follow this automated archinstall guide which is super easy to follow. And once installed, continue to Part 2. - -#### Part 2: Install MATE Desktop in Arch Linux - -After reboot, choose Arch Linux from grub. In the Arch Linux prompt, start running the following commands in sequence. These commands install the Xorg server, display manager, MATE desktop components, controller packages, and additional applications. - -For all the commands, use default, i.e. press enter when asked. - -- **Install Xorg. Approx install size is 80 MB.** - -``` -sudo pacman -S --needed xorg -``` - -- **Install display manager, and MATE desktop components. Approx install size is 380 MB.** - -``` -sudo pacman -S --needed mate mate-extra ttf-freefont lightdm lightdm-gtk-greeter -``` - -![Installing MATE Packages][3] - -- **Install applications** - -This is just a reference. You can also install the ones you require. - -``` -sudo pacman -S --needed firefox vlc filezilla leafpad xscreensaver archlinux-wallpaper -``` - -Now it’s time to enable the display manager and network manager as a service. So that the next time you log on, they can run automatically by systemd. - -``` -systemctl enable lightdm -systemctl enable NetworkManager -``` - -Reboot the system using the reboot command. - -``` -reboot -``` - -You should see a login prompt on the MATE desktop if all goes well. - -And you can now log in using the user ID and password which you just created. A superfast and legacy MATE Desktop would welcome you. - -![MATE Desktop in Arch Linux][4] - -I hope this guide helps you create your own Arch Linux environment with a legacy MATE desktop from scratch. Please let me know if you run into trouble using the comment box below. - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/mate-desktop-arch-linux-install/ - -作者:[Arindam][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lkxed -[1]: https://mate-desktop.org/ -[2]: https://www.debugpoint.com/archinstall-guide/ -[3]: https://www.debugpoint.com/wp-content/uploads/2021/08/Installing-MATE-Packages.jpg -[4]: https://www.debugpoint.com/wp-content/uploads/2021/08/MATE-Desktop-in-Arch-Linux-1.jpg diff --git a/sources/tech/20221109.3 ⭐️⭐️ A Guide to systemd journal Maintenance [With Examples].md b/sources/tech/20221109.3 ⭐️⭐️ A Guide to systemd journal Maintenance [With Examples].md deleted file mode 100644 index 1623dec544..0000000000 --- a/sources/tech/20221109.3 ⭐️⭐️ A Guide to systemd journal Maintenance [With Examples].md +++ /dev/null @@ -1,188 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -A Guide to systemd journal Maintenance [With Examples] -====== - -**Systemd comes with many built-in features to manage the system logs. In this guide, we explain how you can manage system journals, logs and take action on them such as rotating, archiving, and clear logs.****We also explain the manual systems journal clean method and using config file changes.** - -If your Linux distribution supports [systemd][1], then it collects logs from all processes, applications of the system every second which starts from the boot. All these logging events are managed by `journald` daemon of systemd. The journald collects all the logs (info, warnings, errors, etc) and stores them as binary data in the disk files.  - -As the logs remain in the disk and every second it is collected, it takes up huge disk space; especially for older systems, servers. For example, in one of my test systems which are running for around one year, the log file size is in GBs. - -If you manage multiple systems, servers, it is always recommended to properly manage journald logs for efficient operation. Let’s take a look at how you can manage the log files. - -### The systemd journal Maintenance - -Using the journalctl utility of systemd, you can query these logs, perform various operations on them. For example, viewing the log files from different boots, check for last warnings, errors from a specific process or applications. If you are unaware of these, I would suggest you quickly go through this tutorial – [“use journalctl to View and Analyze Systemd Logs [With Examples]][2]” before you follow this guide.  - -#### Where are the physical journal log files? - -The systemd’s journald daemon collects logs from every boot. That means, it classifies the log files as per the boot.  - -The logs are stored as binary in the path `/var/log/journal` with a folder as machine id. - -**For example:** - -![Screenshot of physical journal file -1][3] - -![Screenshot of physical journal files -2][4] - -Also, remember that based on system configuration, runtime journal files are stored at `/run/log/journal/`. And these are removed in each boot.  - -#### Can I manually delete the log files? - -You can, but don’t do it. Instead, follow the below instructions to clear the log files to free up disk space using journalctl utilities. - -#### How much disk space is used by systemd log files? - -Open up a terminal and run the below command. - -``` -journalctl --disk-usage -``` - -This should provide you with how much is actually used by the log files in your system. - -![journalctl disk usage command][5] - -If you have a graphical desktop environment, you can open the file manager and browse the path `/var/log/journal` and check the properties. - -#### systemd journal clean process - -The effective way of clearing the log files should be done by `journald.conf` a configuration files. Ideally, you should not manually delete the log files even if the journalctl provides the utility to do that. - -Let’s take a look at how you can delete it [manually][6], then I will explain the configuration changes in `journald.conf` so that you do not need to manually delete the files from time to time; Instead, the systemd takes care of it automatically based on your configuration.  - -##### Manual delete - -First, you have to `flush` and `rotate` the log files. Rotating is a way of marking the current active log files as an archive and creating a fresh logfile from this moment. The flush switch asks the journal daemon to flush any log data stored in `/run/log/journal/` into `/var/log/journal/`, if persistent storage is enabled. - -Then, after flushing and rotating, you need to run journalctl with`vacuum-size`, `vacuum-time`, and `vacuum-files` switches to force systemd to clear the logs.  - -**Example 1:** - -``` -sudo journalctl --flush --rotate -``` - -``` -sudo journalctl --vacuum-time=1s -``` - -The above set of commands removes all archived journal log files until the last second. This effectively clears everything. So, be careful while running the command.  - -![journal clean up - example][7] - -After clean up: - -![After clean up - journal space usage][8] - -You can also provide the following suffixes as per your need following the number. - -- s: seconds -- m: minutes -- h: hours -- days -- months -- weeks -- years - -**Example 2:** - -``` -sudo journalctl --flush --rotate -``` - -``` -sudo journalctl --vacuum-size=400M -``` - -This clears all archived journal log files and retains the last 400MB files. Remember this switch applies to only archived log files only, not on active journal files. You can also use suffixes as below. - -- K: KB -- M: MB -- G: GB - -**Example 3:** - -``` -sudo journalctl --flush --rotate -``` - -``` -sudo journalctl --vacuum-files=2 -``` - -The vacuum-files switch clears all the journal files below the number specified. So, in the above example, only the last 2 journal files are kept and everything else is removed. Again, this only works on the archived files. - -You can combine the switches if you want, but I would recommend not to. However, make sure to run with `--rotate` switch first. - -### Automatic delete using config files - -While the above methods are good and easy to use, it is recommended that you control the journal log file cleanup process using the journald configuration files which present at `/etc/systemd/journald.conf`.  - -The systemd provides many parameters for you to effectively manage the log files. By combining these parameters you can effectively limit the disk space used by the journal files. Let’s take a look. - -| **journald.conf parameter** | **Description** | **Example** | -| :- | :- | :- | -| SystemMaxUse | Specifies the maximum disk space that can be used by the journal in persistent storage | SystemMaxUse=500M | -| SystemKeepFree | Specifies the amount of space that the journal should leave free when adding journal entries to persistent storage. | SystemKeepFree=100M | -| SystemMaxFileSize | Controls how large individual journal files can grow to in persistent storage before being rotated. | SystemMaxFileSize=100M | -| RuntimeMaxUse | Specifies the maximum disk space that can be used in volatile storage (within the /run filesystem). | RuntimeMaxUse=100M | -| RuntimeKeepFree | Specifies the amount of space to be set aside for other uses when writing data to volatile storage (within the /run filesystem). | RuntimeMaxUse=100M | -| RuntimeMaxFileSize | Specifies the amount of space that an individual journal file can take up in volatile storage (within the /run filesystem) before being rotated. | RuntimeMaxFileSize=200M | - -If you add these values in a running system in `/etc/systemd/journald.conf` file, then you have to restart the journald after updating the file. To restart use the following command.  - -``` -sudo systemctl restart systemd-journald -``` - -### Verification of log files - -It is wiser to check the integrity of the log files after you clean up the files. To do that run the below command. The command shows the PASS, FAIL against the journal file. - -``` -journalctl --verify -``` - -![verify log files][9] - -### Closing Notes - -I hope this guide helps you to understand the basics of the systemd journal management process. With these, you can manage the disk space used by the log files in your system or servers by limiting the space, clearing old log files. These are just the guideline commands, you can combine these in multiple ways to achieve your system demands.  - -- [journalctl manual][10] -- [journald.conf manual][11] - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/systemd-journald-clean/ - -作者:[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.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 diff --git a/sources/tech/20221109.4 ⭐️⭐️ How to use journalctl to View and Analyze Systemd Logs [With Examples].md b/sources/tech/20221109.4 ⭐️⭐️ How to use journalctl to View and Analyze Systemd Logs [With Examples].md deleted file mode 100644 index aa7d864ff8..0000000000 --- a/sources/tech/20221109.4 ⭐️⭐️ How to use journalctl to View and Analyze Systemd Logs [With Examples].md +++ /dev/null @@ -1,257 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to use journalctl to View and Analyze Systemd Logs [With Examples] -====== - -**This guide explains the basics of the journalctl utility of [Systemd][1] and its various commands. You can use these commands for troubleshooting desktop and server logs in Linux. This is how you can use journalctl to view and analyze Systemd Logs with different examples.** - -### Introduction - -Many say that Systemd is not good, it is heavy on the system and it is a debated topic always. But you can not deny that it provides a well set of utilities to manage, troubleshoot a system. Imagine you end up with a broken system with no GUI. You probably messed up boot and GRUB as well. In those kinds of scenarios or in general – you can boot from a LIVE system, mount your Linux partition and explore the Systemd logs to find out about the problem. - -Systemd has three basic components as follows – - -- **systemd**: System and service manager for Linux operating systems. -- **systemctl**: Command to introspect and control the state of the systemd system and service manager. -- **systemd-analyze**: Provides system boot-up performance statistics and retrieve other state and tracing information from the system and service manager - -Apart from these three, there are additional services that systemd provides such as – journald, logind, networkd, etc. In this guide we will talk about the journald service of systemd. - -### journald – systemd journal daemon - -By design, systemd provides a centralized way of handing all operating system logs from processes, applications, etc. All these logging events are handled by journald daemon of systemd. The journald daemon collects all logs from everywhere of the Linux operating systems and stores themes as binary data in files. - -The advantages of centralized logging of events, system problems as binary data are many. For example, as the system logs are stored as binary and not text – you can translate in many ways such as text, JSON objects for various needs. Also, it is super easy to track down to a single event as the logs are stored sequentially via date/time manipulation of the logs. - -Remember the log files that journald collects are in thousands of lines and it gets updated for every event, every boot. So if you have a long time running Linux operating system – the journal logs size should in GBs. As the logs are in thousands, it’s better to filter with basic commands to find out more about the system problems. - -#### The journald Configuration File - -The configuration file of the journald is present in the below path. It contains various flags on how the logging happens. You can take a look at the file and make the changes necessary. But I would recommend not to modify this file unless you know what you are doing. - -``` -/etc/systemd/journald.conf -``` - -#### Where journald stores the binary log files - -The journald stores the logs in binary format. They are stored inside a directory under this path. - -``` -/var/log/journal -``` - -For example, in the below path there is a directory that contains all the system logs to date. - -![journalctl log file path][2] - -Do not use cat command or use nano or vi to open these files. They would not be displayed properly. - -### Use journalctl to View and Analyze Systemd Logs - -#### Basic journald command - -The basic command to view logs using journal daemon is – - -``` -journalctl -``` - -![journalctl][3] - -This gives you all the journal entries including errors, warnings, etc from all applications and processes. It shows the list with the oldest log at the top and current logs at the bottom. You need to keep pressing ENTER to scroll through it line by line. You can also use PAGE UP and PAGE DOWN keys to scroll. Press q to exit from this view. - -#### How to view journal entries for time zones - -By default, the journalctl shows the log time in the current system time zone. However, you can easily provide the timezone in your command to convert the same log to a different time zone. For example, to view the logs in UTC, use the below command. - -``` -journalctl --utc -``` - -![journalctl --utc][4] - -#### How to view only errors, warnings, etc in journal logs - -The logs that a system generates have different priorities. Some logs may be a warning which can be ignored or some may be critical errors. You might want to look at only errors, not warnings. That is also possible using the below command. - -To view emergency system messages use: - -``` -journalctl -p 0 -``` - -![journalctl -p 0][5] - -Error codes - -``` -0: emergency -1: alerts -2: critical -3: errors -4: warning -5: notice -6: info -7: debug -``` - -When you specify the error code, it shows all messages from that code and above. For example, if you specify the below command, it shows all messages with priority 2, 1 and 0 - -``` -journalctl -p 2 -``` - -#### How to view journal logs for a specific boot - -When you are running the journalctl command it shows the information from the current boot that is from the current session which you are running. But it is also possible to view information about past boots as well. - -Journal logs keep on updating in every reboot. The journald keeps track of the logs in different boots. To view, the boot-wise logs use the below command. - -``` -journalctl --list-boots -``` - -![journalctl list-boots][6] - -- The first number shows the unique journald boot track number which you can use in the next command to analyze that specific boot. -- The second number the boot ID which also you can specify in the commands. -- The next two date, time combinations are the duration of the logs stored in the respective file. This is super handy if you want to find out a log or error from a specific date, time. - -To view a specific boot number you the first number or the boot ID as below. - -``` -journalctl -b -45 -``` - -``` -journalctl -b 8bab42c7e82440f886a3f041a7c95b98 -``` - -![journalctl -b 45][7] - -You can also use `-x` switch which can add an explanation of the systemd error messages in your display. This is a lifesaver in certain situations. - -``` -journalctl -xb -p 3 -``` - -![journalctl -xb][8] - -#### How to view journal logs for a specific time, date duration - -The journalctl is powerful enough to provide “english” like argument in the command itself for time and date manipulation. - -You can use`--since` switch with a combination of `“yesterday”, “today”, “tomorrow”, or “now”.` - -Some of the examples of different commands below. You can modify them as per your need. They are self-explanatory. The date, time format in the below commands are `"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] - -You can combine the above with the error level switches as well. - -#### How to see Kernel specific journal logs - -The Linux Kernel messages can be extracted from journal logs as well. To view the Kernel messages from the current boot only use the below command. - -``` -journalctl -k -``` - -#### How to see journal logs for a service, PID - -You can filter out specific logs from a systemd service unit only from the journald logs. For example, to find out the logs from NetworkManager service use the below command. - -``` -journalctl -u NetworkManager.service -``` - -![journalctl NetworkManager service][10] - -If you do not know the service name, you can use the below command to list the systemd services in your system. - -``` -systemctl list-units --type=service -``` - -#### How to view journal logs for a user, group - -If you are analyzing server logs this command is helpful where multiple users are logged in. You can first find out about the user id using the below command from the user name. For example, to find out the id of user “`debugpoint`” – - -``` -id -u debugpoint -``` - -Then use that ID with `_UID` switch to view the logs generated by the user. - -``` -journalctl _UID=1000 --since today -``` - -![journalctl _UID][11] - -Similarly use `_GID` switch to find out the same for user groups. - -#### How to view journal logs for an executable - -You can also find out journald logs of a specific program or executable. For example, if you want to find out the messages of gnome-shell, you can run the below command. - -``` -journalctl /usr/bin/gnome-shell --since today -``` - -![journalctl gnome-shell][12] - -### Closing notes - -I hope this guide helps you to use journalctl to view analyze systemd logs on your Linux desktop or server troubleshooting. The systemd journal management extremely powerful if you know how to use the commands, it makes your life a bit easy during debugging time. All major mainstream Linux distribution uses Systemd these days. Ubuntu, Debian, Fedora, Arch – they all use systemd for their default OS offerings. In case if you are wondering about systemd-free Linux distributions, you might want to check out [MX-Linux][13], Gentoo, Slackware, Void Linux. - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/systemd-journalctl/ - -作者:[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://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 diff --git a/sources/tech/20221111.4 ⭐️⭐️ Drop swap for zram on Linux.md b/sources/tech/20221111.4 ⭐️⭐️ Drop swap for zram on Linux.md deleted file mode 100644 index df8dd3e3fa..0000000000 --- a/sources/tech/20221111.4 ⭐️⭐️ Drop swap for zram on Linux.md +++ /dev/null @@ -1,191 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Drop swap for zram on Linux -====== - -Zram is a tool for creating an in-RAM compressed cache, specifically for use as swap space. - -I spend a lot of time playing (I mean working) on my computers, and I've found a lot of interesting things. One that has most recently come to my attention is the `zram0` device. I first noticed it when working on one of my Opensource.com articles several months ago. It showed up in the output from the `lsblk` command: - -``` -# lsblk -NAME          MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS -sda             8:00 931.5G  0 disk -├─sda1          8:10   600M  0 part -[...] -zram0         252:00     8G  0 disk [SWAP] -``` - -It's identified as swap space, which is what first piqued my curiosity, so I did some exploration. Zram was originally called "compcache," which stands for "compressed cache." It turns out that zram is a tool for creating an in-RAM compressed cache, specifically for use as swap space. - -But Why? - -When I began researching zram, all I found were a couple of basic articles about using zram for swap space. At first, this seemed a bit counterintuitive to me. After all, if you're running out of RAM and you swap pages into a virtual drive in RAM, what's gained? - -I then found the Fedora Project wiki page that proposed the use of [Swap on zram][1]. The proposal says: "Swap is useful, except when it's slow. zram is a RAM drive that uses compression. Create a swap-on-zram during start-up. And no longer use swap partitions by default." - -The rest of the page is about details, benefits, side effects, and feedback. - -### Zram for swap space on Linux - -Using zram for swap space is intended to do the same thing as regular partition-based or file-based swap space. When memory pressure becomes too great, some of the least recently used data is moved to swap space. On average, it's compressed to about 50% of its original size, and placed in zram space in RAM. This is much faster than storing those memory pages on a hard drive and frees up the RAM it was using for other use. - -### Saving on swap - -I tried to find revised recommendations for how much swap or zram swap to configure. This led me back to a reassessment of swap, and my previous article, [What's the right amount of swap space for a modern Linux system?][2] As far as I can tell from the most current documentation for RHEL and Fedora, the recommended amount of swap space has not changed. That documentation, however, ignores the use of zram. - -However, the tables in that previous article still provide a good starting point for swap space allocation when using older releases of Linux that don't use zram or in cases where zram has been disabled. - -The documents I found for the Zram feature are inconsistent in terms of how zram is allocated with respect to RAM size, and the amount of space allocated to zram swap. - -Due to the lack of authoritative documentation, I performed some experiments to empirically determine the algorithm used to allocate zram swap. I used my own physical and virtual systems for this. The results are interesting and do not match any documentation I've so far found. - -The default size of zram is 8 GB on all systems large enough to support that, but it's typically reduced significantly on hosts with small amounts of RAM. On one virtual machine (VM) I use for testing, with access to 4 GB of RAM, the zram virtual swap space is allocated to 3.8 GB. One old Dell I have contains 8 GB of RAM, and the zram is set to 7.6 GB. When RAM is reduced to 2 GB, Zram is reduced to 1.9 GB. - -All physical and virtual hosts I have with more than 8 GB of RAM show exactly 8 GB of zram. This includes my primary workstation with 64 GB of RAM and other hosts with 16 GB or 32 GB of RAM. - -Based on these few data points, I can draw the conclusion that the current default settings are for 8 GB of zram at most, and for zram to be 95% of RAM on hosts with 8 GB or less. - -I have read a number of articles that mention other sizes for zram swap, even up to 100% of RAM, but those all seem to be theoretical rather than reality. - -Your distribution may be different, but here are the actual zram swap allocations for Fedora and similar distributions: - -- **RAM ⇐ 8 GB:** 0.95 × RAM -- **RAM > 8 GB:** 8 GB - -Be aware that the zram swap size algorithm is not based on any recommendations for the "best" swap size for any given real-world system or application. This zram swap allocation is a rather probabilistic approach to what should work well on a wide range of Linux hosts. However, the fact that the maximum zram swap size is configured for 8 GB and the fact that I have always recommended 8 GB as the maximum amount of traditional swap, I think I can say it's reflective of the optimum sizes for zram swap. - -### Managing zram swap - -Zram defaults are stored in the `/usr/lib/systemd/zram-generator.conf` configuration file. The following is from one of my test VMs with 5097 GB of RAM allocated. - -``` -# 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) -``` - -You can change the default Zram swap size in the last line of the `zram-generator.conf` configuration file. I recommend against doing that, unless you can definitively show a reason for doing so, and test your results once you make any changes. Like many other configuration defaults in Linux, the zram ones have been well-tested and are appropriate for most use cases. - -### Monitor zram - -The zramctl utility can be used to view the current state of zram. - -``` -# zramctl -NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT -/dev/zram0 lzo-rle       4.8G   4K   80B   12K       4[SWAP] -``` - -The traditional `swapon` command can also be used to view swap including zram used as swap: - -``` -# swapon --show -NAME       TYPE      SIZE USED PRIO -/dev/zram0 partition 4.8G   0B  100 -``` - -One thing to be aware of is that `zramctl` does not report on zram when it contains no data, so the results contain null output. Tools like `lsblk`, `swapon`, `top`, `free`, `htop`, and so on, do show zram even when it contains no data. - -### Deactivate zram - -The `swapoff -a` command turns off `zram` swap as well as traditional HDD or SSD storage used as swap. The `swapon -a` command does not show zram when it is empty. Use `zramctl /dev/zram0` instead. - -``` -# 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 -``` - -Note that `/dev/zram0` doesn't show up in these commands as swap space until it's being used for that purpose. This caused me some confusion until my experiments showed it to be the case. - -### Creating Zram Swap - -Zram itself has been around for about 20 years, but has only been in use as swap space on some distributions for the last year or two. The current Linux installation on some or all of your hosts may not have been created with zram for swap. If that's the case, it can be easily remedied. - -For Fedora 32, the last release prior to the default use of zram for swap, it only takes three easy commands. - -First, verify the presence of the `zram-swap.service` file, installed as part of the `zram` RPM package. - -``` -# 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) -``` - -Next, install the `zram-generator-defaults` and `zram-generator` packages. - -``` -# dnf install zram-generator-defaults zram-generator -``` - -Enable and start the zram-swap service: - -``` -# systemctl enable zram-swap.service# systemctl start zram-swap.service -``` - -And then verify that `zram0` exists, and is being used as swap space: - -``` -# 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] -``` - -### Improve swap with zram - -That's all there is to it. It was easy with Fedora. Different distributions will likely be just as easy, with some possible different details in the package names and commands. Give zram swap a try on your computer. In my next article, I'll demonstrate some further zram options. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/11/zram-swap-linux - -作者:[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://fedoraproject.org/wiki/Changes/SwapOnZRAM -[2]: https://opensource.com/article/19/2/swap-space-poll diff --git a/sources/tech/20221117.0 ⭐️⭐️ How to Install and Use htop in Linux.md b/sources/tech/20221117.0 ⭐️⭐️ How to Install and Use htop in Linux.md index b4c89ddb3c..e6c7b75fd5 100644 --- a/sources/tech/20221117.0 ⭐️⭐️ How to Install and Use htop in Linux.md +++ b/sources/tech/20221117.0 ⭐️⭐️ How to Install and Use htop in Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/use-htop/" [#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" [#]: collector: "lkxed" -[#]: translator: " " +[#]: translator: "perfiffer" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " diff --git a/sources/tech/20221118.0 ⭐️⭐️ Fixing “Key is stored in legacy trusted.gpg keyring” Issue in Ubuntu.md b/sources/tech/20221118.0 ⭐️⭐️ Fixing “Key is stored in legacy trusted.gpg keyring” Issue in Ubuntu.md deleted file mode 100644 index 45b626bd9d..0000000000 --- a/sources/tech/20221118.0 ⭐️⭐️ Fixing “Key is stored in legacy trusted.gpg keyring” Issue in Ubuntu.md +++ /dev/null @@ -1,144 +0,0 @@ -[#]: subject: "Fixing “Key is stored in legacy trusted.gpg keyring” Issue in Ubuntu" -[#]: via: "https://itsfoss.com/key-is-stored-in-legacy-trusted-gpg/" -[#]: author: "Abhishek Prakash https://itsfoss.com/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Fixing “Key is stored in legacy trusted.gpg keyring” Issue in Ubuntu -====== - -If you use a PPA or add an external repository in Ubuntu 22.04 and later versions, chances are that you will see a message like this: - -``` -W: https://packagecloud.io/slacktechnologies/slack/debian/dists/jessie/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. -``` - -![ubuntu key is stored legacy][1] - -First thing first. It is not an error, it is a warning message. A warning does not stop the procedure. You can continue upgrading your system even if you see this warning message during an update. - -If you don’t like seeing the warning message, you can take some manual steps to get rid of it. - -There are two ways; the proper way and the quick and dirty way. Read both methods and see which one you feel comfortable with. - -### Method 1: Import the key [Proper but complicated way] - -First, list all the GPG keys added to your system. - -``` -sudo apt-key list -``` - -This will show a huge list of keys stored in your system. What you have to do here is to look for the keys associated with the warning message. - -``` -[email protected]:~$ sudo apt-key list -[sudo] password for abhishek: -Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). -/etc/apt/trusted.gpg --------------------- -pub rsa4096 2014-01-13 [SCEA] [expired: 2019-01-12] - 418A 7F2F B0E1 E6E7 EABF 6FE8 C2E7 3424 D590 97AB -uid [ expired] packagecloud ops (production key) <[email protected]> - -pub rsa4096 2016-02-18 [SCEA] - DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD -uid [ unknown] https://packagecloud.io/slacktechnologies/slack (https://packagecloud.io/docs#gpg_signing) <[email protected]> -sub rsa4096 2016-02-18 [SEA] - -/etc/apt/trusted.gpg.d/audio-recorder-ubuntu-ppa.gpg ----------------------------------------------------- -pub rsa4096 2015-08-30 [SC] - 42EF 41ED 9813 B713 D4F1 F06D 5CF1 2638 ACF9 669F -uid [ unknown] Launchpad PPA for Team audio-recorder - -/etc/apt/trusted.gpg.d/danielrichter2007-ubuntu-grub-customizer.gpg -------------------------------------------------------------------- -pub rsa1024 2010-10-08 [SC] - 59DA D276 B942 642B 1BBD 0EAC A8AA 1FAA 3F05 5C03 -``` - -How do you do that? Read the message carefully. - -``` -W: https://packagecloud.io/slacktechnologies/slack/debian/dists/jessie/InRelease: Key is stored in legacy -``` - -In my case, the repository has keywords like packagecloud, slacktechnologies. It is shown at the top of the apt-key list output. You may have to scroll a bit in your case. - -In this rare case, the external repository added by Slack, has two GPG keys. One of them is expired and I’ll ignore it. You may not have such a situation. - -You should the last 8 characters (excluding the space) under the line after pub. - -``` -/etc/apt/trusted.gpg --------------------- -pub rsa4096 2014-01-13 [SCEA] [expired: 2019-01-12] - 418A 7F2F B0E1 E6E7 EABF 6FE8 C2E7 3424 D590 97AB -uid [ expired] packagecloud ops (production key) <[email protected]> - -pub rsa4096 2016-02-18 [SCEA] - DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD -uid [ unknown] https://packagecloud.io/slacktechnologies/slack (https://packagecloud.io/docs#gpg_signing) <[email protected]> -``` - -So from the line “DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD”, I’ll take the last 8 characters “0386 51BD”, remove the space and then use it to import the GPG key in its dedicated file under the /etc/apt/trusted.gpg.d directory: - -``` -sudo apt-key export 038651BD | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/slack.gpg -``` - -I created a new file slack.gpg here, in case you didn’t notice it. I named it slack.gpg because it is associated with Slack application I installed earlier. The filename does not matter but it’s good for identification. - -If the command runs successfully, you won’t see any message. You can verify that by checking if the newly created gpg file exists or not. - -![import gpg key to trusted ubuntu][2] - -Run the update again and now you should not see the warning message anymore. - -### Method 2: Copy to the trusted.gpd.d directory [Quick and dirty way] - -If you don’t feel comfortable doing all the above stuff manually, well, you can ignore the warning message. I mean, ignoring it is always an option. - -Another option is to copy the /etc/apt/trusted.gpg file to /etc/apt/trusted.gpg.d directory. After all, Ubuntu only complains that it needs the GPG keys in /etc/apt/trusted.gpg.d directory. - -You’ll still have to use the terminal. Open it and use the following command: - -``` -sudo cp /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d -``` - -Now, if you run the update, you won’t see the “Key is stored in legacy trusted.gpg keyring” warning message anymore. - -![quick dirty way to fix apt key stored legacy][3] - -### Conclusion - -I have written a detailed article on [apt-key deprecation][4]. Apparently, that article had some readers confused and hence I wrote this one to give them direct steps for getting rid of the message. - -As I said before, it is a warning message and can be ignored for now. The onus to ‘fix’ this issue lies on the external software developers and Ubuntu developers. The external software developers should make sure that their GPG keys are no longer added in the /etc/apt/trusted.gpg file. - -The end users should not take the pain for their laziness. - -So, which method did you use to get rid of the ‘key is stored in legacy’ warning message? The first one or the second one? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/key-is-stored-in-legacy-trusted-gpg/ - -作者:[Abhishek Prakash][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/ -[b]: https://github.com/lkxed -[1]: https://itsfoss.com/wp-content/uploads/2022/11/ubuntu-key-is-stored-legacy.png -[2]: https://itsfoss.com/wp-content/uploads/2022/11/import-gpg-key-to-trusted-ubuntu.png -[3]: https://itsfoss.com/wp-content/uploads/2022/11/quick-dirty-way-to-fix-apt-key-stored-legacy.png -[4]: https://itsfoss.com/apt-key-deprecated/ diff --git a/sources/tech/20221119.0 ⭐️⭐️ 7 Reasons Why Cinnamon is a Fantastic (Yet Underrated) Linux Desktop Environment.md b/sources/tech/20221119.0 ⭐️⭐️ 7 Reasons Why Cinnamon is a Fantastic (Yet Underrated) Linux Desktop Environment.md deleted file mode 100644 index 9a06dfdbc8..0000000000 --- a/sources/tech/20221119.0 ⭐️⭐️ 7 Reasons Why Cinnamon is a Fantastic (Yet Underrated) Linux Desktop Environment.md +++ /dev/null @@ -1,185 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -7 Reasons Why Cinnamon is a Fantastic (Yet Underrated) Linux Desktop Environment -====== - -Linux Mint is one of my favorite distributions. The flagship (or default) Cinnamon desktop is why I like it so much. - -The user experience offered by Cinnamon desktop may not be mind-blowing or fancy. But, the desktop environment provides enough reasons for users to like it and easily work with it to get things done. - -At the end of the day, that’s what we want. A user interface that works as expected and does not get in the way. - -I think Cinnamon desktop does a few things right to give you an exciting experience. Let me mention some of those here. - -**If you did not know**, the Cinnamon desktop is a fork of the GNOME 3 created in **2011** by **Clement Lefebvre** (Linux Mint creator) with enhancements over the years. - -### 1. Familiar User Interface - -![linux mint 21 full][1] - -The primary objective of building Cinnamon was to keep the GNOME 2 desktop style alive. - -And that is why you get a familiar desktop layout compared to the most popular consumer desktop operating system, i.e., Windows. - -Of course, Windows 11 has evolved its usual layout with time. But, accessing a start menu, a taskbar, system icons in the tray, and a couple of window decorations make it easy to grasp. - -Whether you are a Windows user or a macOS user, the Cinnamon desktop layout should not feel challenging at all. - -![linux mint welcome][2] - -To help you further, the “**Welcome Screen**” in Linux Mint provides you with all the information quickly. - -### 2. Lightweight - -To get a comfortable experience with Cinnamon desktop (usually with Linux Mint), you have the following system requirements: - -- 4 GB RAM -- 100 GB of disk space -- 1024×768 resolution screen - -In the modern computing age, these specifications should suit almost everyone. So, you do not have to worry about needing an insane amount of memory or disk space to run a Linux distro powered by Cinnamon. - -Of course, you can try [installing Cinnamon desktop on Ubuntu][3]. - -But, for this article, we consider Linux Mint as the ideal use case. - -### 3. Fast Performance Without Sacrificing User Experience - -When we think about a lightweight desktop environment—we usually imagine a bland user interface that focuses on performance. - -![linux mint perf][4] - -With Cinnamon desktop, that is not the case. It does include subtle animations and features icons/themes that make up for a modern look, if not the best. - -It looks pleasing to the eyes with a minimal approach. - -Typically, I am a sucker for pretty user interfaces, but I can still live with Linux Mint’s straightforward user experience running it on a dual-monitor setup (**1440p + 1080p**). - -It may not be the best dual-monitor experience with Linux Mint Cinnamon edition (no dock/panel on the second screen for me). So, there is little room for improvement. - -### 4. Default Customization Options - -You might already know that KDE is probably the king when it comes to giving the ability to customize out-of-the-box. - -We have super useful guides if you are curious about going that way: - -- [KDE Customization Guide][5] -- [How to Properly Theme KDE Plasma [In-depth Guide]][6] -- [Best Gorgeous KDE Plasma Themes][7] - -But, for many users, it is **overwhelming**. - -I think Linux Mint gives the right amount of extra controls/customizations, which you also learn on its **Welcome Screen**. - -![cinnamon theme customize][8] - -Some of the elements that you can easily customize include: - -- Desktop color (accent) -- Light/Dark theme toggle -- Panel layout -- Icons, buttons, and mouse pointer. - -You can head to the system settings and navigate to “Themes” to find the essential tweaks. - -**Recommended Read:**[7 Ways to Customize Cinnamon Desktop on Linux][9] - -### 5. Official Add-ons to Spice Up Your Experience - -![cinnamon desklet][10] - -Linux Mint supports various add-ons to enhance your experience. These are all part of its [Cinnamon Spices][11] offering. They include: - -- Themes -- Extensions -- Applets -- Desklets - -Applets and Desklets are tiny programs that you can add on top of the panel (near the system tray) and the desktop, respectively. - -![applet cinnamon][12] - -You can manage system default applets or download more from the official repositories: - -![applets cinnamon][13] - -Similarly, you can add a Desklet from the available defaults or get a new one from the repositories. - -![desklet cinnamon][14] - -Plenty of valuable utilities to monitor system resources, check the weather, and more. - -In addition, you get access to various themes built by the community that could easily give you a look you always wanted. - -![cinnamon theme][15] - -To complement all the above spices, you can use extensions to make the panel transparent, add a watermark to your desktop, enable windows tiling, and add some exciting window animations. - -![linux mint extensions][16] - -### 6. Compatible and Seamless User Experience - -Why do I highlight the user experience again? - -The best part about Cinnamon desktop is that it evolves in a way that respects and supports all functionalities. - -For instance, if you want to install an app you enjoyed using on KDE Plasma, it should work the same way here. There’s nothing special with Cinnamon desktop that would break the experience. - -![gnome accounts cinnamon][17] - -Similarly, the desktop adds features that try to co-exist with services from other desktop environments. For instance, calendar events support using GNOME Online Accounts. - -### 7. Panel Customization - -![linux mint panel][18] - -The dock, taskbar, or panel comprises an integral part of the user interface. - -Yes, other desktop environments allow you to customize the same to some extent. With Cinnamon, you get a good amount of control to tweak it. - -I think you get all the essential options a user would want. - -### Wrapping Up - -GNOME and KDE Plasma are popular desktop environments. However, Cinnamon is not far off on essential parts to provide an optimal user experience. - -_What do you think of the Cinnamon desktop environment? Do you prefer to try it with Linux Mint? Share your thoughts in the comments section below._ - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/why-cinnamon/ - -作者:[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/11/linux-mint-21-full.jpg -[2]: https://itsfoss.com/wp-content/uploads/2022/11/linux-mint-welcome.png -[3]: https://itsfoss.com/install-cinnamon-on-ubuntu/ -[4]: https://itsfoss.com/wp-content/uploads/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/wp-content/uploads/2022/11/cinnamon-theme-customize.png -[9]: https://itsfoss.com/customize-cinnamon-desktop/ -[10]: https://itsfoss.com/wp-content/uploads/2022/11/cinnamon-desklet.png -[11]: https://cinnamon-spices.linuxmint.com -[12]: https://itsfoss.com/wp-content/uploads/2022/11/applet-cinnamon.png -[13]: https://itsfoss.com/wp-content/uploads/2022/11/applets-cinnamon.png -[14]: https://itsfoss.com/wp-content/uploads/2022/11/desklet-cinnamon.png -[15]: https://itsfoss.com/wp-content/uploads/2022/11/cinnamon-theme.png -[16]: https://itsfoss.com/wp-content/uploads/2022/11/linux-mint-extensions.png -[17]: https://itsfoss.com/wp-content/uploads/2022/11/gnome-accounts-cinnamon.png -[18]: https://itsfoss.com/wp-content/uploads/2022/11/linux-mint-panel.png diff --git a/sources/tech/20221121.0 ⭐️⭐️ How to Setup Python Development Environment in Ubuntu and Fedora.md b/sources/tech/20221121.0 ⭐️⭐️ How to Setup Python Development Environment in Ubuntu and Fedora.md deleted file mode 100644 index f7e578e4c6..0000000000 --- a/sources/tech/20221121.0 ⭐️⭐️ How to Setup Python Development Environment in Ubuntu and Fedora.md +++ /dev/null @@ -1,142 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Setup Python Development Environment in Ubuntu and Fedora -====== - -**This article helps you with the basics and steps to setup your Python development environment in Ubuntu and Fedora.** - -[Python][1] became popular in the last couple of years due to its powerful libraries, easy syntax, and portability. It is being used currently almost every system across businesses. - -So, if you are trying to set up your Python box and wondering how to begin etc., then you are at the right place. Here, I tried to give you some steps to get started. - -### Setup Python Development Environment in Ubuntu and Fedora - -#### Python Versions - -If you are starting up Python development fresh, then it is recommended that you use the latest Python 3.x for your development, as Python 2.x is already out of support. Almost all the leading Linux distributions removed the dependency on Python 2. - -If you are running the latest distributions as of today for Fedora or Ubuntu, then you should have Python 3.x already installed and set as the default interpreter. For example, Fedora 37 and Ubuntu 22.04 LTS, which are currently available, have [Python 3.11][2] as the default Python shell. - -A quick way to find out what Python version you have is by running the below command from a terminal in both Ubuntu and Fedora. - -``` -python2 -``` - -``` -python3 -``` - -![python3][3] - -If you are running earlier versions of Ubuntu or Fedora, then you can install the latest Python 3.x using the below commands: - -**Ubuntu** - -``` -sudo apt install python3 -``` - -**Fedora** - -``` -sudo dnf install python3 -``` - -Also, run the below command to find out the path of your Python executable in the current system: - -``` -which python -``` - -#### Switching Versions as the default interpreter - -If your system has multiple Python versions installed – 2.x and 3.x and you want to switch between them, it is possible.  - -_If you have only one version installed, you can skip this section._ - -To switch, first, run python from the terminal to find out the default executable path. Ideally, it should be `/usr/bin/python`. Now, run below to find out the symbolic link to the executable. - -``` -ln -l /usr/bin/python -``` - -``` -lrwxrwxrwx 1 root root .... /usr/bin/pyhton -> python2 -``` - -Now check out the `$PATH` variable to determine the order of path concatenation which the system looks up for executables. - -``` -echo $PATH -``` - -![PATH-Variable][4] - -As you can see `/usr/local/bin`is preceding the `/usr/bin/` then you can create a soft symbolic link to `python3`. Then your interpreter should pick up the latest Python 3 instead of Python 2 while running the python command.  - -``` -ls -s /usr/bin/python3 /usr/local/bin/python -``` - -Now you should logout and log in again to clear any hash entries, or you can run `hash -r` to clear them out. - -Now you can run python from the terminal, and you should have the latest Python 3 picked up. - -#### Python IDE - -An integrated development environment (IDE) helps you write and compile and execute your code. There are [several free Python IDE available][5] – such as PyCharm, Eclipse, Eric, etc., which you can use. That would be another write-up on their pros and cons.  - -If you download Python from the official [python.org][1] website, Python accompanies a default development environment called IDLE. IDLE is good for starting up your system, and later you can decide to pick any of the best free Python IDE available. - -IDLE is not included in Ubuntu and Fedora along with python as default, you have to install it manually. Run the below commands from the terminal to manually install IDLE. - -**Ubuntu** - -``` -sudo apt install idle -``` - -**Fedora** - -``` -sudo dnf install python-tools -``` - -Once installed, you can launch IDLE from the command line idle or search from the application. - -![IDLE-environment`][6] - -Now, you can use IDLE to start your development. Most of the basic options you can find in the File menu of IDLE. - -I hope this guide explains what you should know before starting your Python development. Although this guide is primarily targeted to Ubuntu and Fedora, you can still follow the instructions for all Ubuntu and Fedora-based distributions as well. If you are facing problems with the Python environment setup, let me know in the comment section below.  - -[Next:Learn Bash base64 Encode and Decode With Examples][7] - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/setup-python-environment-ubuntu-fedora/ - -作者:[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.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/sources/tech/20221121.1 ⭐️⭐️ 7 Git tips for technical writers.md b/sources/tech/20221121.1 ⭐️⭐️ 7 Git tips for technical writers.md index 02f5fa8a79..60d1e2dd9f 100644 --- a/sources/tech/20221121.1 ⭐️⭐️ 7 Git tips for technical writers.md +++ b/sources/tech/20221121.1 ⭐️⭐️ 7 Git tips for technical writers.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/22/11/git-tips-technical-writers" [#]: author: "Maximilian Kolb https://opensource.com/users/kolb" [#]: collector: "lkxed" -[#]: translator: " " +[#]: translator: "Donkey-Hao" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -110,7 +110,7 @@ via: https://opensource.com/article/22/11/git-tips-technical-writers 作者:[Maximilian Kolb][a] 选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Donkey-Hao](https://github.com/Donkey-Hao) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/sources/tech/20221122.2 ⭐️⭐️⭐️ Introducing Rust calls to C library functions.md b/sources/tech/20221122.2 ⭐️⭐️⭐️ Introducing Rust calls to C library functions.md deleted file mode 100644 index d275e3617b..0000000000 --- a/sources/tech/20221122.2 ⭐️⭐️⭐️ Introducing Rust calls to C library functions.md +++ /dev/null @@ -1,283 +0,0 @@ -[#]: 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: " " -[#]: publisher: " " -[#]: url: " " - -Introducing Rust calls to C library functions -====== - -Why call C functions from Rust? The short answer is software libraries. A longer answer touches on where C stands among programming languages in general and towards Rust in particular. C, C++, and Rust are systems languages, which give programmers access to machine-level data types and operations. Among these three systems languages, C remains the dominant one. The kernels of modern operating systems are written mainly in C, with assembly language accounting for the rest. The standard system libraries for input and output, number crunching, cryptography, security, networking, internationalization, string processing, memory management, and more, are likewise written mostly in C. These libraries represent a vast infrastructure for applications written in any other language. Rust is well along the way to providing fine libraries of its own, but C libraries—​around since the 1970s and still growing—​are a resource not to be ignored. Finally, C is still the [lingua franca][1] among programming languages: most languages can talk to C and, through C, to any other language that does so. - -### Two proof-of-concept examples - -Rust has an FFI (Foreign Function Interface) that supports calls to C functions. An issue for any FFI is whether the calling language covers the data types in the called language. For example, `ctypes` is an FFI for calls from Python into C, but Python doesn't cover the unsigned integer types available in C. As a result, `ctypes` must resort to workarounds. - -By contrast, Rust covers all the primitive (that is, machine-level) types in C. For example, the Rust `i32` type matches the C `int` type. C specifies only that the `char` type must be one byte in size and other types, such as `int`, must be at least this size; but nowadays every reasonable C compiler supports a four-byte `int`, an eight-byte `double` (in Rust, the `f64` type), and so on. - -There is another challenge for an FFI directed at C: Can the FFI handle C's raw pointers, including pointers to arrays that count as strings in C? C does not have a string type, but rather implements strings as character arrays with a non-printing terminating character, the _null terminator_ of legend. By contrast, Rust has two string types: `String` and `&str` (string slice). The question, then, is whether the Rust FFI can transform a C string into a Rust one—​and the answer is _yes_. - -Pointers to structures also are common in C. The reason is efficiency. By default, a C structure is passed _by_value (that is, by a byte-per-byte copy) when a structure is either an argument passed to a function or a value returned from one. C structures, like their Rust counterparts, can include arrays and nest other structures and so be arbitrarily large in size. Best practice in either language is to pass and return structures by reference, that is, by passing or returning the structure's address rather than a copy of the structure. Once again, the Rust FFI is up to the task of handling C pointers to structures, which are common in C libraries. - -The first code example focuses on calls to relatively simple C library functions such as `abs` (absolute value) and `sqrt` (square root). These functions take non-pointer scalar arguments and return a non-pointer scalar value. The second code example, which covers strings and pointers to structures, introduces the [bindgen][2] utility, which generates Rust code from C interface (header) files such as `math.h` and `time.h`. C header files specify the calling syntax for C functions and define structures used in such calls. The two code examples are [available on my homepage][3]. - -### Calling relatively simple C functions - -The first code example has four Rust calls to C functions in the standard mathematics library: one call apiece to `abs` (absolute value) and `pow` (exponentiation), and two calls to `sqrt` (square root). The program can be built directly with the `rustc` compiler, or more conveniently with the `cargo build` command: - -``` -use std::os::raw::c_int; // 32 bits -use std::os::raw::c_double; // 64 bits - -// Import three functions from the standard library libc. -// Here are the Rust declarations for the C functions: -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!("\nAbsolute value of {x}: {}.", unsafe { abs(x) }); - - let n: f64 = 9.0; - let p: f64 = 3.0; - println!("\n{n} raised to {p}: {}.", unsafe { pow(n, p) }); - - let mut y: f64 = 64.0; - println!("\nSquare root of {y}: {}.", unsafe { sqrt(y) }); - - y = -3.14; - println!("\nSquare root of {y}: {}.", unsafe { sqrt(y) }); //** NaN = NotaNumber -} -``` - -The two `use` declarations at the top are for the Rust data types `c_int` and `c_double`, which match the C types `int` and `double`, respectively. The standard Rust module `std::os::raw` defines fourteen such types for C compatibility. The module `std::ffi` has the same fourteen type definitions together with support for strings. - -The `extern "C"` block above the `main` function then declares the three C library functions called in the `main` function below. Each call uses the standard C function's name, but each call must occur within an `unsafe` block. As every programmer new to Rust discovers, the Rust compiler enforces memory safety with a vengeance. Other languages (in particular, C and C++) do not make the same guarantees. The `unsafe` block thus says: Rust takes no responsibility for whatever unsafe operations may occur in the external call. - -The first program's output is: - -``` -Absolute value of -123: 123. -9 raised to 3: 729 -Square root of 64: 8. -Square root of -3.14: NaN. -``` - -In the last output line, the `NaN` stands for Not a Number: the C `sqrt` library function expects a non-negative value as its argument, which means that the argument -3.14 generates `NaN` as the returned value. - -### Calling C functions involving pointers - -C library functions in security, networking, string processing, memory management, and other areas regularly use pointers for efficiency. For example, the library function `asctime` (time as an ASCII string) expects a pointer to a structure as its single argument. A Rust call to a C function such as `asctime` is thus trickier than a call to `sqrt`, which involves neither pointers nor structures. - -The C structure for the `asctime` function call is of type `struct tm`. A pointer to such a structure also is passed to library function `mktime` (make a time value). The structure breaks a time into units such as the year, the month, the hour, and so forth. The structure's fields are of type `time_t`, an alias for for either `int` (32 bits) or `long` (64 bits). The two library functions combine these broken-apart time pieces into a single value: `asctime` returns a string representation of the time, whereas `mktime` returns a `time_t` value that represents the number of elapsed seconds since the _epoch_, which is a time relative to which a system's clock and timestamp are determined. Typical epoch settings are January 1 00:00:00 (zero hours, minutes, and seconds) of either 1900 or 1970. - -The C program below calls `asctime` and `mktime`, and uses another library function `strftime` to convert the `mktime` returned value into a formatted string. This program acts as a warm-up for the Rust version: - -``` -#include -#include - -int main () { - struct tm sometime; /* time broken out in detail */ - 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; - sometime.tm_hour = 1; - sometime.tm_wday = 1; - sometime.tm_yday = 1; - - printf("Date and time: %s\n", asctime(&sometime)); - - utc = mktime(&sometime); - if( utc < 0 ) { - fprintf(stderr, "Error: unable to make time using mktime\n"); - } else { - printf("The integer value returned: %d\n", utc); - strftime(buffer, sizeof(buffer), "%c", &sometime); - printf("A more readable version: %s\n", buffer); - } - - return 0; -} -``` - -The program outputs: - -``` -Date and time: Fri Feb  1 01:01:01 1901 -The integer value returned: 2120218157 -A more readable version: Fri Feb  1 01:01:01 1901 -``` - -In summary, the Rust calls to library functions `asctime` and `mktime` must deal with two issues: - -- Passing a raw pointer as the single argument to each library function. -- Converting the C string returned from `asctime` into a Rust string. - -### Rust calls to `asctime` and `mktime` - -The `bindgen` utility generates Rust support code from C header files such as `math.h` and `time.h`. In this example, a simplified version of `time.h` will do but with two changes from the original: - -- The built-in type `int` is used instead of the alias type `time_t`. The bindgen utility can handle the `time_t` type but generates some distracting warnings along the way because `time_t` does not follow Rust naming conventions: in `time_t` an underscore separates the `t` at the end from the `time` that comes first; Rust would prefer a CamelCase name such as `TimeT`. -- The type `struct tm` type is given `StructTM` as an alias for the same reason. - -Here is the simplified header file with declarations for `mktime` and `asctime` at the bottom: - -``` -typedef struct tm { - int tm_sec; /* seconds */ - int tm_min; /* minutes */ - int tm_hour; /* hours */ - int tm_mday; /* day of the month */ - int tm_mon; /* month */ - int tm_year; /* year */ - int tm_wday; /* day of the week */ - int tm_yday; /* day in the year */ - int tm_isdst; /* daylight saving time */ -} StructTM; - -extern int mktime(StructTM*); -extern char* asctime(StructTM*); -``` - -With `bindgen` installed, `%` as the command-line prompt, and `mytime.h` as the header file above, the following command generates the required Rust code and saves it in the file `mytime.rs`: - -``` -% bindgen mytime.h > mytime.rs -``` - -Here is the relevant part of `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)) - ); - ... -``` - -The Rust structure `struct tm`, like the C original, contains nine 4-byte integer fields. The field names are the same in C and Rust. The `extern "C"` blocks declare the library functions `asctime` and `mktime` as taking one argument apiece, a raw pointer to a mutable `StructTM` instance. (The library functions may mutate the structure via the pointer passed as an argument.) - -The remaining code, under the `#[test]` attribute, tests the layout of the Rust version of the time structure. The test can be run with the `cargo test` command. At issue is that C does not specify how the compiler must lay out the fields of a structure. For example, the C `struct tm` starts out with the field `tm_sec` for the second; but C does not require that the compiled version has this field as the first. In any case, the Rust tests should succeed and the Rust calls to the library functions should work as expected. - -### Getting the second example up and running - -The code generated from `bindgen` does not include a `main` function and, therefore, is a natural module. Below is the `main` function with the `StructTM` initialization and the calls to `asctime` and `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; // raw pointer - - // make the call, convert and then own - // the returned C string - 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); - } -} -``` - -The Rust code can be compiled (using either `rustc` directly or `cargo`) and then run. The output is: - -``` -Ok( -    "Mon Feb  1 01:01:01 1901\n", -) -2120218157 -``` - -The calls to the C functions `asctime` and `mktime` again must occur inside an `unsafe` block, as the Rust compiler cannot be held responsible for any memory-safety mischief in these external functions. For the record, `asctime` and `mktime` are well behaved. In the calls to both functions, the argument is the raw pointer `ptr`, which holds the (stack) address of the `sometime` structure. - -The call to `asctime` is the trickier of the two calls because this function returns a pointer to a C `char`, the character `M` in `Mon` of the text output. Yet the Rust compiler does not know where the C string (the null-terminated array of `char`) is stored. In the static area of memory? On the heap? The array used by the `asctime` function to store the text representation of the time is, in fact, in the static area of memory. In any case, the C-to-Rust string conversion is done in two steps to avoid compile-time errors: - -- The call `Cstr::from_ptr(char_ptr)` converts the C string to a Rust string and returns a reference stored in the `c_str` variable. -- The call to `c_str.to_str()` ensures that `c_str` is the owner. - -The Rust code does not generate a human-readable version of the integer value returned from `mktime`, which is left as an exercise for the interested. The Rust module `chrono::format` includes a `strftime` function, which can be used like the C function of the same name to get a text representation of the time. - -### Calling C with FFI and bindgen - -The Rust FFI and the `bindgen` utility are well designed for making Rust calls out to C libraries, whether standard or third-party. Rust talks readily to C and thereby to any other language that talks to C. For calling relatively simple library functions such as `sqrt`, the Rust FFI is straightforward because Rust's primitive data types cover their C counterparts. - -For more complicated interchanges—​in particular, Rust calls to C library functions such as `asctime` and `mktime` that involve structures and pointers—​the `bindgen` utility is the way to go. This utility generates the support code together with appropriate tests. Of course, the Rust compiler cannot assume that C code measures up to Rust standards when it comes to memory safety; hence, calls from Rust to C must occur in `unsafe` blocks. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/11/rust-calls-c-library-functions - -作者:[Marty Kalin][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/mkalindepauledu -[b]: https://github.com/lkxed -[1]: https://en.wikipedia.org/wiki/Lingua_franca -[2]: https://github.com/rust-lang/rust-bindgen -[3]: https://condor.depaul.edu/mkalin - diff --git a/sources/tech/20221123.0 ⭐️⭐️ apt remove vs apt purge What’s the Difference.md b/sources/tech/20221123.0 ⭐️⭐️ apt remove vs apt purge What’s the Difference.md deleted file mode 100644 index 7eb690888a..0000000000 --- a/sources/tech/20221123.0 ⭐️⭐️ apt remove vs apt purge What’s the Difference.md +++ /dev/null @@ -1,121 +0,0 @@ -[#]: 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: "Tngze-G" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -apt remove vs apt purge: What’s the Difference? -====== - -To [uninstall an application in the Ubuntu terminal][1], you can use: - -``` -sudo apt remove package_name -``` - -But in various forums, you may come across the suggestion to use the apt purge command for removing applications completely. - -This leaves you confused because using apt purge is quite similar to apt remove: - -``` -sudo apt purge package_name -``` - -So, why are there two similar commands for removing packages? What’s the difference between the two? Let me explain it to you with a few examples. - -### What’s the difference between apt-remove and apt-purge? - -Both apt-remove and apt-purge do the same thing and that is to uninstall a package. The apt-purge removes the package and purges any configuration files associated with it. That’s the only difference between the two. Neither command touches the application files under the home directory of the user. - -Have you ever removed an application and installed it again, only to notice that all your settings are in place? It’s because the apt remove command doesn’t remove the configuration files. - -#### See what’s being removed and what remains - -Let me share a practical example of removing the mplayer application using both apt remove and apt purge commands. The focus is on seeing what files remain after each operation. - -Here are the files associated with mplayer before removal. - -![mplayer before removal][2] - -Now, if I run the apt remove command. - -![apt uninstall package ubuntu][3] - -Here are the files that remain in the system: - -![files after mplayer removal][4] - -As you can see, there are mplayer files remaining in two locations: /etc and /home/abhishek. - -Now, if I install mplayer again and use apt purge to remove mplayer application this time. - -![apt purge command][5] - -Let’s look for files associated mplayer now. - -![files after mplayer removal][6] - -As you can see, the files from /etc directory no longer exists. - -But what about the files in the home directory? Should apt purge not remove it? - -The answer is negative. The apt commands do not touch the configuration files located under the home directory. They remain in the system unless you manually remove them. Those files are really small in size and hardly take disk space. - -Do note that not all applications create configuration files under /etc or home directory. - -#### The effect of using apt remove or apt purge - -A practical example I can think of is Discord. You [install Discord on Ubuntu][7] with deb file. Start using it by logging into your account. Remove discord and install it again using deb file. - -Now if you start Discord, you’ll notice that you are already logged into your account. Surprising, no? - -But this is a feature because some applications like Discord, VirtualBox provide you updates similarly. You remove the current version and install the newer one (even if you don’t see this process). Since the application configuration files are not touched, you are logged back in without additional effort. - -The apt remove command gives you the option to reuse an application with similar configuration that you used in the past. - -However, you may not always want it. If you configured an application in a bad way and want to start from scratch, the apt purge command is the way to go forward. - -#### Does apt purge perform a wild-card removal? - -When you purge a package, you’ll notice that it mentions removing package-name*. This indicates that it will remove all the packages with names starting from package-name. - -![apt purge wild card][8] - -I didn’t find a definite answer on this point in the documentation (i.e. man page). So, I did a little test on my own. I installed espeak and espeak-ng packages. The espeak* should expand to espeak-ng as well. - -But when espeak was pruged, the espeak-ng package was untouched. So there seems to be a mechanism that protects against such wild card expansions. - -### So, should you use apt remove or apt purge? - -Few people just get addicted to using apt purge. - -In my opinion, apt remove is what you should use most of the time. Use apt purge when you have to get rid of the custom configuration files. - -In both cases, you’ll have to remove the remaining configuration files from the user’s home directory and run apt autoremove to eliminate any leftover dependencies. - -Over to you now. Do you understand the difference between apt remove and apt purge better now? Which one do you prefer to use? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/apt-remove/ - -作者:[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/apt-remove/ -[2]: https://itsfoss.com/wp-content/uploads/2022/11/mplayer-before-removal.png -[3]: https://itsfoss.com/wp-content/uploads/2022/11/apt-uninstall-package-ubuntu.png -[4]: https://itsfoss.com/wp-content/uploads/2022/11/files-after-mplayer-removal.png -[5]: https://itsfoss.com/wp-content/uploads/2022/11/apt-purge-command.png -[6]: https://itsfoss.com/wp-content/uploads/2022/11/files-after-apt-purge.png -[7]: https://itsfoss.com/install-discord-linux/ -[8]: https://itsfoss.com/wp-content/uploads/2022/11/apt-purge-wild-card.png diff --git a/sources/tech/20221123.1 ⭐️⭐️ Build an interactive timeline in React with this open source tool.md b/sources/tech/20221123.1 ⭐️⭐️ Build an interactive timeline in React with this open source tool.md deleted file mode 100644 index 3c5449b6da..0000000000 --- a/sources/tech/20221123.1 ⭐️⭐️ Build an interactive timeline in React with this open source tool.md +++ /dev/null @@ -1,54 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Build an interactive timeline in React with this open source tool -====== - -For several years, I worked in the TV online and video-on-demand (VOD) industry. While working on a scheduler web application, I realized that there were no good solutions for electronic program guides (EPG) and scheduling. Admittedly, this is a niche feature for most web developers, but it's a common requirement for TV applications. I've seen and analyzed a number of websites that have implemented their own EPG or timeline, and I often wondered why everyone seemed to be inventing their own solutions instead of working on a shared solution everyone could use. And that's when I started developing Planby. - -[Planby][1] is a React (JavaScript) component to help you create schedules, timelines, and electronic program guides (EPG) for online TV and video-on-demand (VOD) services, music and sporting events, and more. Planby uses a custom virtual view, allowing you to operate on a lot of data, and present it to your viewers in a friendly and useful way. - -Planby has a simple API that you can integrate with third party UI libraries. The component theme is customised to the needs of the application design. - -### Timeline performance - -The most significant thing when implementing a timeline feature is performance. You're potentially handling basically an endless stream of data across many many different channels. Applications can struggle with refreshing, moving, and scrolling. You want the user's interactions with the content to be fluid. - -There's also the potential for poor design. Sometimes, an app implements an EPG timeline in the form of a list that you must scroll vertically, meaning you must click on buttons to move left and right through time, which quickly becomes tiring. What's more, sometimes customization for interacting with an EPG (such as rating, choosing your favorite channels, reading right-to-left (RTL), and so on) aren't available at all, or when they are, they cause performance issues. - -Another problem I often face is that an app is too verbose in its data transfer. When an app requests data _while_ you scroll through the EPG, the timeline feels slow and can even crash. - -### What is Planby? - -This is where Planby comes in. Planby is built from scratch, using React and Typescript and a minimal amount of resources. It uses a custom virtual view, allowing you to operate on vast amounts of data. It displays programs and channels to the user, and automatically positions all elements according to hours and assigned channels. When a resource contains no content, Planby calculates the positioning so the time slots are properly aligned. - -Planby has a simple interface and includes all necessary features, such as a sidebar, the timeline itself, a pleasant layout, and live program refreshing. In addition, there's an optional feature allowing you to hide any element you don't want to include in the layout. - -Planby has a simple API that allows you as the developer to implement your own items along with your user preferences. You can use Planby's theme to develop new features, or you can make custom styles to fit in with your chosen design. You can easily integrate with other features, like a calendar, rating options, a list of user favorites, scroll, "now" buttons, a recording schedule, catch-up content, and much more. What's more, you can add custom global styles, including register-transfer level (RTL) functionality. - -And best of all, it uses the open source MIT licensed. - -### Try Planby - -If you would like to try Planby, or just to learn more about it, visit the [Git repository][1]. There, I've got some examples of what's possible and you can read the documentation for the details. The package is also available with `npm`. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/11/react-timeline-planby - -作者:[Karol Kozer][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/karolkozer -[b]: https://github.com/lkxed -[1]: https://github.com/karolkozer/planby diff --git a/sources/tech/20221124.0 ⭐️ 5 NeoVim GUI Editors You Could Try If You are Not a Total Terminal Junkie.md b/sources/tech/20221124.0 ⭐️ 5 NeoVim GUI Editors You Could Try If You are Not a Total Terminal Junkie.md deleted file mode 100644 index e8fcabb8c0..0000000000 --- a/sources/tech/20221124.0 ⭐️ 5 NeoVim GUI Editors You Could Try If You are Not a Total Terminal Junkie.md +++ /dev/null @@ -1,139 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -5 NeoVim GUI Editors You Could Try If You are Not a Total Terminal Junkie -====== - -Vim is awesome. NeoVim is newer and even more awesome. Both Vim and NeoVim are terminal-based text editors with similar features. - -If you are someone who is accustomed to using [GUI text editors like VS Code][1] and wish to have the similar functionality that NeoVim provides, you should explore GUI options. - -Although I know you can use NeoVim as an add-on for your current text editor, working directly with NeoVim is much more effective and convenient for managing plugins. - -There are a few different options available when choosing a NeoVim GUI, and I have put together a list of some of the best ones below. - -### 1. Neovide - -![neovide][2] - -**Key Features:** - -- Animated cursor -- Smooth scrolling -- Animated windows -- Blurred floating windows -- Emoji support - -[Neovide][3] aims to be a no-nonsense graphical user interface for NeoVim. - -While you won’t see many graphical elements, it only adds some GUI features, such as animations, using a library called Skulpin to render animations. - -And my favorite part of using Neovide is having an animated cursor and smooth scrolling. I mean, have a look at this: - -Looks cool. Right? - -### 2. Neovim Qt - -![neovim qt][4] - -**Key Features:** - -- Hover features -- Multiple GUI tabs -- Auto tab completion -- Cross-platform support - -As the name suggests, [Neovim Qt][5] is built with the Qt5 library, which you’ll often see being used by KDE. Nothing too fancy, adds some additional GUI features like multiple tabs, auto-tab completion, and more. - -So if you are already using Qt5 libraries and want a minimal GUI for NeoVim, this would work like a charm and save you some dependencies. - -**Recommended:**[Vim vs Nano: What Should You Choose?][6] - -### 3. Uivonim - -![uivonim][7] - -**Key Features:** - -- WebGL GPU rendering and multithreading -- Support for VSCode extensions -- Nyancat (ANSI-text program for classic cat animation) -- Hover and code actions - -[Uivonim][8] is a fork of Veonim (A simple IDE built on VSCode plugins and NeoVim) written in electron, making it the perfect choice if you switch from VSCode. - -And the only goal of uivonim is to provide a rich NeoVim experience that supports the latest features of NeoVim, including floating windows, built-in LSP, and more. You do not need to rely on VSCode extensions to get these features. - -[Uivonim][8] - -### 4. FVim - -![fvim][9] - -**Key Features:** - -- Detach windows (using `Ctrl+w and GE`). -- Custom popup menu entry icons. -- HiDPI support. -- GPU acceleration. - -[FVim][10] is a cross-platform GUI for NeoVim built with F# + Avalonia that comes with some groundbreaking features such as high-performance rendering (60FPS on 4K display). - -And I often use the detach window feature as I prefer to have separate windows for different text files. Also, if you are an advanced remote user, FVim won’t let you down either. - -### 5. Goneovim - -![goneovim][11] - -**Key Features:** - -- Support for a terminal with bash and zsh -- Minimap -- Animated cursor -- High DPI scaling -- External float window - -As its name suggests, [Goneovim][12] is written in GO and is a fork of Gonvim. And offers enough GUI features to get your job done such as an animated cursor, pixel scrolling, and more. - -And it does not compromise on getting you basic text editing features, such as drag-and-drop support for text files. - -**Useful Read**: [How to Install Latest Vim on Ubuntu Linux][13] - -### Wrapping Up - -This was my take on what are some good options when it comes to GUI for NeoVim and I hope you found what you were looking for. - -If I missed any of your favorites, let me know your thoughts in the comments. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/neovim-gui-editors/ - -作者:[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/best-modern-open-source-code-editors-for-linux/ -[2]: https://itsfoss.com/wp-content/uploads/2022/11/neovide.png -[3]: https://neovide.dev/index.html -[4]: https://itsfoss.com/wp-content/uploads/2022/11/neovim-qt.png -[5]: https://github.com/equalsraf/neovim-qt -[6]: https://itsfoss.com/vim-vs-nano/ -[7]: https://itsfoss.com/wp-content/uploads/2022/11/uivonim.png -[8]: https://github.com/smolck/uivonim -[9]: https://itsfoss.com/wp-content/uploads/2022/11/fvim-1.png -[10]: https://github.com/yatli/fvim -[11]: https://itsfoss.com/wp-content/uploads/2022/11/goneovim-1.png -[12]: https://github.com/akiyosi/goneovim -[13]: https://itsfoss.com/install-latest-vim-ubuntu/ diff --git a/sources/tech/20221124.4 ⭐️⭐️⭐️ Write a C++ extension module for Python.md b/sources/tech/20221124.4 ⭐️⭐️⭐️ Write a C++ extension module for Python.md deleted file mode 100644 index 14355235cb..0000000000 --- a/sources/tech/20221124.4 ⭐️⭐️⭐️ Write a C++ extension module for Python.md +++ /dev/null @@ -1,318 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Write a C++ extension module for Python -====== - -In a previous article, I gave an overview of [six Python interpreters][1]. On most systems, the CPython interpreter is the default, and also the poll in my last article showed that CPython is the most popular one. Specific to CPython is the ability to write Python modules in C using CPythons extensions API. Writing Python modules in C allows you to move computation-intensive code to C while preserving the ease of access of Python. - -In this article, I’ll show you how to write an extension module. Instead of plain C, I use C++ because most compilers usually understand both. I have to mention one major drawback in advance: Python modules built this way are not portable to other interpreters. They only work in conjunction with the CPython interpreter. So if you are looking for a more portable way of interacting with C libraries, consider using the [ctypes][2] module. - -### Source code - -As usual, you can find the related source code on [GitHub][3]. The C++ files in the repository have the following purpose: - -- `my_py_module.cpp`: Definition of the Python module _MyModule_ -- `my_cpp_class.h`: A header-only C++ class which gets exposed to Python -- `my_class_py_type.h/cpp`: Python representation of our C++ class -- `pydbg.cpp`: Separate application for debugging purpose - -The Python module you build in this article won’t have any meaningful use, but is a good example. - -### Build the module - -Before looking into the source code, you can check whether the module compiles on your system. [I use CMake][4] for creating the build configuration, so CMake must be installed on your system. In order to configure and build the module, you can either let Python run the process: - -``` -$ python3 setup.py build -``` - -Or run the process manually: - -``` -$ cmake -B build -$ cmake --build build -``` - -After that, you have a file called `MyModule.so` in the `/build` subdirectory. - -### Defining an extension module - -First, take a look on `my_py_module.cpp`, in particular, the function `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; -} -``` - -This is the most important code in this example because it acts as the entry point for CPython. In general, when a Python C extension is compiled and made available as a shared object binary, CPython searches for the function `PyInit_` in the eponymous binary (`.so`) and executes it when attempting to import it. - -All Python types, whether declarations or instances, are exposed as pointers to [PyObject][5]. In the first part of this function, the root definition of the module is created by running `PyModule_Create(...)`. As you can see in the module specification (`my_module`, same file), it doesn’t have any special functionality. - -Afterward, [PyType_FromSpec][6] is called to create a Python [heap type][7] definition for the custom type MyClass. A heap type corresponds to a Python class. The type definition is then assigned to the module MyModule. - -_Note that if one of the functions fails, the reference count of previously created PyObjects must be decremented so that they get deleted by the interpreter._ - -### Specifying a Python type - -The specification for the type MyClass is found inside [my_class_py_type.h][8] as an instance of [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 -}; -``` - -This structure defines some basic type information for the class. The value passed for the size consists of the size of the Python representation (`MyClassObject`) and the size of the plain C++ class (`MyClass`). The `MyClassObject` is defined as follows: - -``` -typedef struct { - PyObject_HEAD - int m_value; - MyClass* m_myclass; -} MyClassObject; -``` - -The Python representation is basically of type [PyObject][5], defined by the macro `PyObject_HEAD`, and some additional members. The member `m_value` is exposed as ordinary class member while the member `m_myclass` is only accessible from inside C++ code. - -The [PyType_Slot][10] defines some additional functionality: - -``` -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 */ -}; -``` - -Here, the jump addressed for some initialization and de-initialization functions are set as well as ordinary class methods and members. Additional functionality, like assigning an initial attribute dictionary, could also be set, but this is optional. Those definitions usually end with a sentinel, consisting of `NULL` values. - -To complete the type specification, here is the method and member table: - -``` -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 */ -}; -``` - -In the method table, the Python method `addOne` is defined, and it points to the related function `MyClass_addOne`. This function acts as a wrapper. It invokes the `addOne()` method in the C++ class. - -In the member table, there is just one member defined for demonstration purposes. Unfortunately, the use of [offsetof][11] in [PyMemberDef][12] doesn’t allow C++ specific types to be added to `MyClassObject`. If you try to place some C++ type container (such as [std::optional][13]), the compiler complains about it in the form of warnings related to memory layout. - -### Initialization and de-initialization - -The method `MyClass_new` acts only to provide initial values for `MyClassObject` and allocates memory for the base type: - -``` -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){ // -> allocation successfull - // assign initial values - self->m_value = 0; - self->m_myclass = NULL; - } - return (PyObject*) self; -} -``` - -Actual initialization takes place in `MyClass_init`, which corresponds to the [__init__()][14] method in Python: - -``` -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; -} -``` - -If you want to have arguments passed during initialization, you must call [PyArg_ParseTuple][15] at this point. For the sake of simplicity, all arguments passed during initialization are ignored in this example. In the first part of the function, the `PyObject` pointer (`self`) is reinterpreted to a pointer to `MyClassObject` in order to get access to our additional members. Additionally, the memory for the C++ class is allocated and its constructor is executed. - -Note that exception handling and memory allocation (and de-allocation) must be carefully done in order to prevent memory leaks. When the reference count drops to zero, the `MyClass_dealloc` function takes care of freeing all related heap memory. There’s a [dedicated chapter][16] in the documentation about memory management for C and C++ extensions. - -### Method wrapper - -Calling a related C++ class method from the Python class is easy: - -``` -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); -} -``` - -Again, the `PyObject*` argument (`self`) is casted to `MyClassObject*` in order to get access to `m_myclass`, a pointer to the C++ class instance. With this information, the classes method `addOne()` is called and the result is returned in form of a [Python integer object][17]. - -### 3 ways to debug - -For debugging purposes, it can be valuable to compile the CPython interpreter in debugging configuration. A detailed description can be found in the [official documentation][18]. It’s possible to follow the next steps, as long as additional debug symbols for the pre-installed interpreter are downloaded. - -#### GNU Debugger - -Good old [GNU Debugger (GDB)][19] is, of course, also useful here. I include a [gdbinit][20] file, defining some options and breakpoints. There’s also the [gdb.sh][21] script, which creates a debug build and initiates a GDB session: - -![Gnu Debugger (GDB) is useful for your Python C and C++ extensions.][22] - -GDB invokes the CPython interpreter with the script file [main.py][23]. The script file allows you to easily define all the actions you want to perform with the Python extension module. - -#### C++ application - -Another approach is to embed the CPython interpreter in a separate C++ application. In the repository, this can be found in the file [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; -} -``` - -Using the [high level interface][25], it’s possible to include the extension module and perform actions on it. This allows you to debug in the native IDE environment. It also gives you finer control of the variables passed from and to the extension module. - -The drawback is the high expense of creating an extra application. - -#### VSCode and VSCodium LLDB extension - -Using a debugger extension like [CodeLLDB][26] is probably the most convenient debugging option. The repository includes the VSCode or VSCodium configuration files for building the extension ([task.json][27], [CMake Tools][28]) and invoking the debugger ([launch.json][29]). This approach combines the advantages of the previous ones: Debugging in an graphical IDE, defining actions in a Python script file or even dynamically in the interpreter prompt. - -![VSCodium features an integrated debugger.][30] - -### Extend C++ with Python - -All functionality available from Python code is also available from within a C or C++ extension. While coding in Python is often considered as an easy win, extending Python in C or C++ can also be a pain. On the other hand, while native Python code is slower than C++, a C or C++ extension makes it possible to elevate a computation-intensive task to the speed of native machine code. - -You must also consider the usage of an ABI. The stable ABI provides a way to maintain backwards compatibility to older versions of CPython as described in [the documentation][31]. - -In the end, you must weigh the advantages and disadvantages yourself. Should you decide to use C extensions to make certain functionality available to you in Python, you’ve seen how it can be done. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/11/extend-c-python - -作者:[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/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 diff --git a/sources/tech/20221125.2 ⭐️ Rnote An Open-Source Drawing App for Notes and Annotation.md b/sources/tech/20221125.2 ⭐️ Rnote An Open-Source Drawing App for Notes and Annotation.md deleted file mode 100644 index e4284fe38c..0000000000 --- a/sources/tech/20221125.2 ⭐️ Rnote An Open-Source Drawing App for Notes and Annotation.md +++ /dev/null @@ -1,108 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Rnote: An Open-Source Drawing App for Notes and Annotation -====== - -**_Brief:_**_Rnote allows you to take notes, draw, and annotate documents. Sounds like you need it? Let us explore more._ - -We have featured numerous note-taking applications, but options that support handwritten notes are a handful. - -Rnote is one such helpful application that lets you take handwritten notes and annotate documents/pictures. - -Of course, you need a drawing tablet or a setup with a stylus to use Rnote. - -### Rnote: Vector-based Drawing App for Sketching and Handwritten Notes - -![rnote screenshot][1] - -Rnote is an impressive open-source app written in Rust and GTK 4. - -It provides an adaptive UI focused on stylus input. It looks pretty minimal and yet offers some of the essential features that one would need for handwritten notes. - -Let me highlight some of the things it can do. - -**Recommended Read**: [**Best Note-Taking Apps for Linux Users**][2] - -### Features of Rnote - -![rnote settings][3] - -[Rnote][4] is a simple yet capable sketching/note-taking app. Some features include: - -- Supports pressure-sensitive stylus input with various stroke styles -- Add different shapes with the shape tool -- A selection tool to move, rotate, resize, and modify the content you add/draw. -- Document expand layouts -- Customizable page format -- Customizable background colors, patterns, and sizes -- Pen sound support for feedback -- Reconfigurable stylus button shortcuts -- Integrated workspace browser for quick media file access -- Drag and drop support -- Clipboard support -- Common page formats supported (A6, A5, US letter, etc) -- Import from PDF, bitmap, and SVG files. -- Native .rnote file to save/load documents. -- Export to SVG and PDF supported -- Autosave functionality -- Dark/Light mode - -The developers note that the native file format used by Rnote may not be stable enough for compatibility between newer versions of the application. - -So, it is best to export your work when you are done before upgrading Rnote to its latest version. - -In addition to its features, you get a good user experience with the available options. It does not feel overwhelming, and you can access all the tools quickly. - -Some customization is available to hide the scrollbars, change the cursor, and tweak the drawing cursor. - -You can also adjust the time interval for autosave to kick in, which should come in handy for various use cases. - -![rnote screenshot 1][5] - -### Installing Rnote on Linux - -Rnote is available as a Flatpak on [Flathub][6]. So, as long as you have [Flatpak enabled on your system][7], you can install it on any Linux distribution. - -You can find it in your software center (if Flatpak integration has been enabled) or type in the following command to get it installed: - -``` -flatpak install flathub com.github.flxzt.rnote -``` - -To explore more about Rnote, head to its [GitHub page][8]. - -### Wrapping Up - -Rnote is actively developed and making good progress with its feature set. If you like Rnote, you might want to look at [Xournal++][9], another app that enables you to take handwritten notes. - -_Do you know of any other exciting apps like Rnote? What do you think of Rnote? Share your thoughts in the comments down below._ - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/rnote/ - -作者:[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/11/rnote-screenshot.png -[2]: https://itsfoss.com/note-taking-apps-linux/ -[3]: https://itsfoss.com/wp-content/uploads/2022/11/rnote-settings.png -[4]: https://rnote.flxzt.net -[5]: https://itsfoss.com/wp-content/uploads/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/sources/tech/20221126.1 ⭐️ How I Fixed Buzzing Noise Coming from Speakers in Linux.md b/sources/tech/20221126.1 ⭐️ How I Fixed Buzzing Noise Coming from Speakers in Linux.md deleted file mode 100644 index a6e34a26fe..0000000000 --- a/sources/tech/20221126.1 ⭐️ How I Fixed Buzzing Noise Coming from Speakers in Linux.md +++ /dev/null @@ -1,130 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How I Fixed Buzzing Noise Coming from Speakers in Linux -====== - -I used a laptop for a long time but only recently switched to a desktop setup for my remote work at It’s FOSS. - -I noticed a constant buzzing sound coming from the speakers. It was annoying and gave me headaches. I started out to fix the issue. It was quite interesting to know the root cause of the issue. - -I will share my experience of fixing the buzzing noise from speakers in Linux. I found it working with Ubuntu, Debian and Pop OS on the same hardware. - -One thing to consider is that you may have a serious hardware issue if this guide does not work for you. For most users, the given solution should get the job done. - -**Before you try the fix …** - -I have tried to make things easy to follow safely. You try the temporary fix and if it works, you make the changes permanent. However, it would be a good idea to make system snapshots with Timeshift. If you are easily panicked when things do not work, you can restore the system to the earlier state. - -Also, check your sound card. In my case, it was snd_hda_intel. For USB card, it could be snd_usb_audio. You have to change the commands according to your sound card. - -``` -cat /proc/asound/modules -``` - -### The reason behind the buzzing noise from speakers in Linux - -After combing through numerous forum posts and websites, I learned the root cause of the issue. It is because of capacitor discharge in the speakers. And it can be solved by turning off the power-saving setting of a sound card. - -By turning off power saving, you are allowing the system to charge those capacitors when they get discharged. It is similar to using a phone while charging constantly. - -And you can check whether the power-saving setting for the sound card is enabled on your system by using the given command: - -``` -cat /sys/module/snd_hda_intel/parameters/power_save -``` - -![power saving setting in sound card making buzzing sound in linux][1] - -And if you get 1 in output like mine, the power saving is turned on. So let’s have a look at the solution. - -Don’t worry. This will not affect your battery percentage drastically, as the shown method is only applied to the sound card. - -### Try fixing the buzzing noise issue (temporary) - -The reason why I included the temporary way is to identify whether the humming sound is being caused due to capacitor discharge or if there is any serious hardware problem going on. - -If this temporary solution works, you can go ahead with the permanent solution. - -The first step is to switch to the root user: - -``` -sudo su -``` - -And then, execute the given command, and it should stop the buzzing sound until the next boot: - -``` -echo 0 > /sys/module/snd_hda_intel/parameters/power_save -``` - -If you are using **a USB sound card**, you have to interchange `snd_hda_intel` with `snd_usb_audio` as given: - -``` -echo 0 > /sys/module/snd_usb_audio/parameters/power_save -``` - -If the above trick fixed the issue, you have to make things permanent. Otherwise, the changes will be lost when you next reboot your system. - -### Fixing the buzzing noise issue (permanently) - -Here, I’m going to make changes in kernel parameters. - -Change your working directory to /etc/modprobe.d: - -``` -cd /etc/modprobe.d -``` - -And now, create a new file named `audio_disable_powersave.conf` and open with the nano text editor using the given command: - -``` -sudo nano audio_disable_powersave.conf -``` - -And put the following lines in that file to turn off the power-saving setting in the sound card permanently: - -``` -options snd_hda_intel power_save=0 -``` - -![fix buzzing sound in linux][2] - -For **a USB sound card**, you can use `snd_usb_audio`: - -``` -options snd_usb_audio power_save=0 -``` - -Now, [save changes and exit the Nano text editor][3] by pressing Ctrl+X keys. Reboot your system, and you can enjoy a noise-free workspace. - -### Wrapping Up - -This guide explains the cause of the buzzing noise and how you can straightforwardly solve that issue. - -Again, you may have some other issue rather than discharging capacitors, so you should always try the temporary method. - -Let me know if you were able to fix the buzzing noise from speakers in Linux this way or not. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/buzzing-noise-speaker-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://itsfoss.com/wp-content/uploads/2022/11/power-saving-setting-in-sound-card-making-buzzing-sound-in-linux.png -[2]: https://itsfoss.com/wp-content/uploads/2022/11/fix-buzzing-sound-in-linux.png -[3]: https://linuxhandbook.com/nano-save-exit/ diff --git a/sources/tech/20221126.2 ⭐️⭐️ Create a holiday light display with your Raspberry Pi and ping pong balls.md b/sources/tech/20221126.2 ⭐️⭐️ Create a holiday light display with your Raspberry Pi and ping pong balls.md deleted file mode 100644 index c1e4f1b306..0000000000 --- a/sources/tech/20221126.2 ⭐️⭐️ Create a holiday light display with your Raspberry Pi and ping pong balls.md +++ /dev/null @@ -1,130 +0,0 @@ -[#]: 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: " " -[#]: publisher: " " -[#]: url: " " - -Create a holiday light display with your Raspberry Pi and ping pong balls -====== - -I love Christmas decorations and lights, and I'd been wanting to do an programmable LED project for a long time. Recently, I built a light array made of LED lights, ping pong balls, and a Raspberry Pi Zero. I thought it was worth sharing, because it ended up being relatively easy but also educational. - -It's mostly my own design, with some inspiration from YouTube videos. You can find the source code and build instructions in my [Git repository][1]. - -### Shopping list - -- [Raspberry Pi Zero][2] -- [Pibow Case][3] -- 5v 2A USB power supply -- Poster frame -- 255 ping pong balls -- Hot glue gun and LOTS of hot glue sticks -- Soldering iron -- Solder -- 22 AWG 0.35mm solid core wiring -- 10 meters of WS2812(B) LED strip lights (30 pixels per meter) -- Multimeter -- Wire cutters -- Wire strippers - -### Design the Raspberry Pi light display - -My design was driven by the size of the poster frame I happened to have available. I got 30 pixel per meter tape from Ali Express, which cut nicely into 0.5m sections, so that gave me 15 LEDs across. Ping pong balls are 40mm, so I measured and placed the lines 40mm apart, with the LED Strip in the middle of each 40mm section. This gave me 17 lines down in total. My array was therefore 15×17. If you try this yourself, yours can be a different size. - -To get power to the array and the Raspberry Pi, I placed the open connections for both data and power at the bottom of the board. I didn't have that many LEDs needing power, so I was able to use the 5v out GPIO from the Raspberry Pi Zero to power them. I run them at 50% brightness, which is easily bright enough to see in the day and at night through my window. - -### Wiring - -In my design, I started at the bottom of the board and wired up in an S-curve. This made soldering easier because loops at the end of each row didn't have to return all the way back to the start of each line. The WS2812 data lines do require you to wire the data the correct way: power can be fed from either side of the strip, but data must be fed from the side with the arrows pointing away. - -My wiring looks like this (this is abbreviated for clarity, in real life it's 17 lines deep): - -``` -<---------------\ -                | -/---------------/ -| -\---------------< # Pi connected here -``` - -### Build the display with your Raspberry Pi - -Once the design and wiring plan was sorted, it was time to get started on the build. - -I measured and drew my lines in pencil on the poster backboard. The WS2812 strips I got came with sticky tape on the back, so I just removed the backing and attached that directly to the backboard. I was sure to position each strip so that the data arrows went one way, then back the other, to ensure that the lights could be daisy-chained correctly for the Pi's instructions. - -Once all light strips were attached, I cut three similar lengths of wire and connected the 5v, data, and ground lines from the end of each light section to the one above it. - -![Connect each light strip at the end of each line.][4] - -After completing each row, I checked continuity between the 5v and ground lines between each strip to ensure my joins were correct. I also checked that I had not accidentally bridged any connections, so I verified that there was no continuity between the 5v and ground lines (in other words, a 5v wire on one line didn't bridge to the ground on the next line.) I also ran some tests to ensure everything was lighting up correctly (see [the code][5] section for my strand tests.) - -Once this was complete, I started to cut holes in the ping pong balls by stabbing scissors into the bottom of them, and cutting a small hole for the LED to shine into. There was no exact science to this, and each one was different, but the effect really worked. I was working with 30 pixels per meter, so my lighting had about 30mm between each LED. A ping pong ball is 40mm across, but I wasn't about to start soldering each LED individually! First of all, I'm not that good at soldering (as my photos show), and anyway, I thought "Well, they're ping pong balls. I can just squash them together!" - -And that's what I did. - -I placed a hot glue blob around each LED and then placed a ping pong ball onto the LED, held it for about five seconds, and moved on to the next one. I held onto the previous ping pong ball as I slid the next one in, pushing it against the first before "folding" it into its neighbor. The effect worked really well. I was happy with what it was looking like straight away. It also had the nice bonus of hiding my bad soldering job ;) - -![It's a tight fit, but the 40mm ping pong balls fit in a 30mm space just fine.][6] - -I continued doing this for 255 LEDs and ping pong balls. There were a few crushed ping pong balls in the process, but in the end, I got there. - -![255 LEDs and 255 ping pong balls in an array.][7] - -### Test the code - -For the test code to ensure that everything was working, I used this [Adafruit guide][8] which lights each LED in red, green, and blue, and then does a rainbow cycle. I used this when I was building to ensure my connections were correct and that everything was soldered correctly. - -After that, I designed a grid in a spreadsheet to map each pixel to a grid position. This helped to make building the images easier. Since my pixel numbers run in a zig-zag pattern, it would have been hard to keep track of each LED (e.g. LED A1 was 256 and B1 was 226).  - -Once this was all set, it was time to design some images on paper and in the spreadsheet. Then it was time to code! It got a bit addictive and I started adding some animation (using loops and turning pixels onto one color and then another color).  - -The end result was everything I'd hoped it would be. - -![A Christmas gift in LED.][9] - -![Reindeer painted with light.][10] - -![An LED snowflake.][11] - -### A Raspberry Pi light display all year - -I am not sure this will ever be truly finished. Nearly every night since it's been up in the window, I've added some new images and animations. I'm already thinking about what to do for New Year's Eve. I also won't be putting this back in storage with my Christmas decorations in January. I just need to think of other things to draw on it to make it a year-round project! A friend of mine suggested a pixel Mario and I love that idea! - -My code also needs a little work. For example, I do some scrolling text, but I redraw the whole board for each position of the text, so it took quite a bit of time to do. I think I can do something with loops, or perhaps the image library can help scroll the letters easier, and make it easier to add text rather than turning each pixel on and off at every step. - -I've got a photo record of my progress from start to finish: [LED Ping Pong Wall][12]. - -You can also see a video of it in action here: [XMas light display][13]. - -I'm really pleased with how this turned out, and I think it looks amazing. I'm very excited to try some other LED projects in the future. I encourage you to try a light array of your own even as your first project. It's easier than it looks! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/11/raspberry-pi-holiday-light-display - -作者:[Brian McCafferty][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/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 diff --git a/sources/tech/20221127.0 ⭐️ lnav Advanced Log File Viewer for Linux Desktops and Servers.md b/sources/tech/20221127.0 ⭐️ lnav Advanced Log File Viewer for Linux Desktops and Servers.md deleted file mode 100644 index ab3e8307ac..0000000000 --- a/sources/tech/20221127.0 ⭐️ lnav Advanced Log File Viewer for Linux Desktops and Servers.md +++ /dev/null @@ -1,127 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -lnav: Advanced Log File Viewer for Linux Desktops and Servers -====== - -**If you want to debug or troubleshoot any issues, you need an advanced log file viewer like lnav – which works wonders in the terminal for any Linux system.** - -### lnav: Log file viewer - -lnav can unzip all the compressed log files on the fly and merge them together for a nice display. The display is parsed and formatted based on the types of errors/warnings – this helps to quickly glance through the thousands of logs, especially in servers. - -While analysing the logs, timestamps are very important. So lnav merges multiple logs based on timestamps, which is very helpful for tracking down system issues. - -Most of the important log file format detection is built-in; see below: - -- Common Web Access Log format -- CUPS page_log -- Syslog -- Glog -- VMware ESXi/vCenter Logs -- dpkg.log -- uwsgi -- “Generic” – Any message that starts with a timestamp -- Strace -- sudo -- GZIP, BZIP - -That is not all; lnav is also capable of the below features, making it an important app for Linux systems. - -- Filter messages based on regular expression -- A timeline view of errors -- Pretty-Print view- helps to reformat -- Query Log using SQL -- A log is updated in real-time while being searched. -- Syntax highlight via regular expression (say you want to find out an IP address in the entire log) -- Tab completion of any word from the log which is displayed !! - -![lnav-running-in-ubutu][1] - -To view the screenshots of the above features and learn more, visit [this page.][2] - -### How to Install - -This program is available in official Ubuntu, Debian repo. Install it using the following command. - -``` -sudo apt install lnav -``` - -And for Fedora, RHEL users, use the below command: - -``` -sudo dnf install lnav -``` - -Also the developers provides an offline standalone executable which you don’t need to install. You can download the zip from the [GitHub release page][3] and execute as: - -``` -./lnav -``` - -**Note**: It’s also available for macOS which you can find in the above GitHub page. - -### lnav: How to use (Basics) - -The simple command syntax is: - -``` -lnav [options] [logfile1 logfile2 …] -``` - -If you run just lnav from the command, it shows all the logs from your system (/var/log/messages and /var/log/syslog) - -``` -lnav -``` - -To view any specific log file, provide it via the command line: - -``` -lnav /var/log/syslog -``` - -Add timestamp in your log output using -t parameter - -``` -lnav -t /var/log/syslog -``` - -Here are some of the key switches of lnav - -``` --d file Write debug messages to the given file.-a Load all of the most recent log file types.-r Load older rotated log files as well.-t Prepend timestamps to the lines of data being read inon the standard input.-w file Write the contents of the standard input to this file.-c cmd Execute a command after the files have been loaded.-f path Execute the commands in the given file.-n Run without the curses UI. (headless mode) -``` - -![lnav running in Ubuntu 22.04][4] - -For further reading and exploration, visit the [official documentation][5]. - -[Next:How to Make LibreOffice Look Like Microsoft Office][6] - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/advanced-log-file-viewer-lnav-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/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 -[6]: https://www.debugpoint.com/libreoffice-like-microsoft-office/ diff --git a/sources/tech/20221201.5 ⭐️⭐️ What is Firefox ESR How to Install it in Ubuntu.md b/sources/tech/20221201.5 ⭐️⭐️ What is Firefox ESR How to Install it in Ubuntu.md deleted file mode 100644 index ab1be90f2f..0000000000 --- a/sources/tech/20221201.5 ⭐️⭐️ What is Firefox ESR How to Install it in Ubuntu.md +++ /dev/null @@ -1,142 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -What is Firefox ESR? How to Install it in Ubuntu? -====== - -The snap version of Ubuntu is not to your liking? Don’t like constantly changing things with every Firefox release? You can try the Firefox ESR version if you value stability over features. - -### What is Firefox ESR? - -Firefox ESR is a special edition of Firefox browser that doesn’t necessarily get new features monthly as the regular edition but it provides a stable and secure browsing experience. This is suitable for enterprises, organizations and institutes where stability and core features matter more than shiny new features. - -Think of Firefox ESR as the long-term stable release of Linux distributions. They do not necessarily get brand-new features but they get regular security and maintenance updates. This gives the users a familiar and stable environment. - -#### Why should you care for Firefox ESR? - -Firefox releases a new version almost every month. It contains security and feature updates. - -But some people may not like the inclusion and removal of features. If, after an update, you keep wondering where did certain settings go or do not like things that are different than before, Firefox ESR could be worth a try. - -Basically, if you value stability more than new features, Firefox ESR is for you. This is the same version of Firefox that ships with Debian, which is known for being one of the most stable distros you can get in the market. - -Let me show you how to get Firefox ESR on Ubuntu. **_You can have both Firefox and Firefox-ESR versions installed simultaneously. There is no visual difference in their logos so you have to pay attention to which Firefox version you are opening._** - -### Installing Firefox ESR in Ubuntu - -Before I jump to the installation part, let me share what’s the version difference between regular Firefox and Firefox-ESR. While writing, - -- Firefox is running at version **107.0-2**. -- Firefox-ESR is currently having **102.5.0esr**. - -So if that’s fine for you, let’s look at the first method. - -#### Method 1: Install Firefox-ESR using PPA - -Firefox-ESR is not available in the default repository of Ubuntu, so you can use the PPA. - -PPA is nothing but a repository being maintained by individual techies or developers to have what the default repository does not. - -And if you want to learn more about PPA, I would recommend checking our other guide that explains [how you can use PPA on Linux.][1] - -Open your terminal and use the given command to add PPA for Firefox-ESR: - -``` -sudo add-apt-repository ppa:mozillateam/ppa -``` - -And press Enter to confirm you want to add PPA: - -![add firefox esr repository in ubuntu][2] - -Once done, you will have to update the repository index in Ubuntu to take effect from the changes: - -``` -sudo apt update -``` - -And now, you can install Firefox-ESR by using the given command: - -``` -sudo apt install firefox-esr -``` - -Next, you can use the given command to check the installed version of Firefox-ESR in your system: - -``` -firefox-esr -v -``` - -![check installed version of firefox esr in ubuntu][3] - -##### Uninstalling Firefox-ESR from Ubuntu - -If the ESR felt too outdated for your work or for any other reason you want to remove it from your system, you can follow the steps to remove the Firefox-ESR package and the repository. - -First, let’s remove the Firefox-ESR package using the following: - -``` -sudo apt remove firefox-esr -``` - -Now, you can use the given command to [remove PPA from Ubuntu][4]: - -``` -sudo add-apt-repository --remove ppa:mozillateam/ppa -``` - -And that’s it! - -#### Method 2: Install Firefox-ESR using Snap - -Love it or hate it, Snaps comes pre-configured on Ubuntu and I find using snaps a neat way of installing packages, especially when you want to avoid building them for source or using PPA. - -All you need to do to install Firefox-ESR using snaps is to follow the given command: - -``` -sudo snap install firefox --channel=esr/stable -``` - -![install firefox esr using snaps in ubuntu][5] - -##### Removing Firefox-ESR Snap - -To remove Firefox-ESR (snap package), use the [snap remove command][6]: - -``` -sudo snap remove firefox -``` - -And that’s it! - -### Wrapping Up - -I explained how to install Firefox-ESR in Ubuntu using multiple methods in this guide. I personally use Firefox-ESR instead of the regular version as I was having random crashes. - -Since I shifted to Firefox-ESR, things have been going rock-solid for me. And if you were having the same, you should give it a try. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/firefox-esr-ubuntu/ - -作者:[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/ppa-guide/ -[2]: https://itsfoss.com/wp-content/uploads/2022/11/add-firefox-esr-repository-in-ubuntu.png -[3]: https://itsfoss.com/wp-content/uploads/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/wp-content/uploads/2022/11/install-firefox-esr-using-snaps-in-ubuntu.png -[6]: https://itsfoss.com/remove-snap/ diff --git a/sources/tech/20221206.0 ⭐️⭐️ Top 5 Live Streaming Applications for Ubuntu and Other Linux [2022 Edition].md b/sources/tech/20221206.0 ⭐️⭐️ Top 5 Live Streaming Applications for Ubuntu and Other Linux [2022 Edition].md deleted file mode 100644 index 93ee5ab1e4..0000000000 --- a/sources/tech/20221206.0 ⭐️⭐️ Top 5 Live Streaming Applications for Ubuntu and Other Linux [2022 Edition].md +++ /dev/null @@ -1,185 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Top 5 Live Streaming Applications for Ubuntu and Other Linux [2022 Edition] -====== - -**This post lists the top five live streaming applications for Ubuntu Linux with features, highlights, download details, and comparison.** - -It is the best time to incorporate online video content for your business. Why? Because research suggests that the global online video market is growing at a rate of ~20% per year. - -And thanks to some excellent software from developers, it has become easy for anyone to create video content and stream them over several popular platforms such as YouTube and Twitch. If you think about it, you see you are consuming more video content today while online than text-based content. - -So, in this post, we will list out some of the free software for Ubuntu and other Linux primarily that are easy to use for creating super interesting live streaming content for you and your businesses. - -### Top 5 Live Streaming Applications for Linux in 2022 - -#### OBS Studio - -The first free application in this list is OBS Studio (also known as Open Broadcaster Software). It is a live streaming application with screencasting capabilities available for Linux, Windows and macOS. - -OBS Studio is the best one on this list because several reasons. The encoding is built-in, and it supports RTMP broadcasting, multiple sources, webcams, green-screen, capture cards and your application windows. - -The user interface is reasonably straightforward and feature-rich. You can get help from third-party developed plugins to extend their functionalities, such as – mixing live tweets from Twitter on your streaming media while live streaming. However, OBS does not support multi-bitrate streaming. - -![OBS Studio - Live Streaming Applications for Linux][1] - -**How to Install** - -OBS Studio is available in all Linux Distribution’s official repositories. Detailed instruction for installations is present in the below link. - -[Download OBS Studio][2] - -More Information - -- [Home Page][3] -- [Documentation][4] - -#### VokoscreenNG - -The second application we would feature in this list is VokoscreenNG. It is a fork of the discontinued Vokoscreen project. The new application is entirely written in Qt with the GStreamer library. It can record your screen and accept multiple audio and video sources. VokoscreenNG’s toolbox is also quite impressive. It includes a magnifying glass, timer, system tray plugins that ease up your workflow. - -It is available for Linux and Windows for free. - -![vokoscreenNG - Live Streaming Applications for Linux][5] - -**How to Install** - -You can download the compressed executable from the below link for Linux systems. Once downloaded, extract them. Then execute the binary to launch the application. - -Remember, this application requires X11, PulseAudio and GStreamer plugins installed in your Linux system to work. If you use a modern Linux system with Wayland and Pipewire sound server (e.g. Fedora), this application may not work. - -[Download VokoscreenNG][6] - -**More Information** - -- [Home page][7] - -#### Restreamer - -The Restreamer application lets you live stream videos and screencasts directly to your website without any streaming provider. It is also possible to use popular streaming solutions, such as YouTube, Twitch, etc., with this application. - -This application is feature-rich and comes with a fair list of features. Here’s a quick peek at its features: - -- H.264 streaming support -- Built-in HTML5 video play -- Available for Linux, macOS, Windows and as Docker images -- Supports your own website plus YouTube, Twitchm, Facebook, Vimeo, Wowza and more -- Multiple video source support – [IP Camera][8], USB Cameram or any H.2645 streams -- Encoding and Audio source support -- Snapshots as form of JPEG support in regular interval -- Access stream status via JSON HTTP API for additional programming - -![Restreamer][9] - -**How to Install** - -The installation of Restreamer is a little tricky because it’s distributed via Docker images. You can find the instructions to install Linux, Windows, and macOS on the below link. - -[Download Restreamer][10] - -**More Information** - -- [Home Page][11] -- [Documentation][12] -- [Source Code][13] - -#### ffscreencast - -The ffscreencast is a command-line streaming application that uses the ffmpeg library. It leverages the power of ffmpeg and acts as a wrapper for it. Although it is available as a command line, you can use its powerful features, such as multiple sources and recordings devices, directly via the terminal. It supports multiple display setups as well. You can also overlay your camera feed on top of your desktop screencast. - -![Open Streaming Platform - - Live Streaming Applications for Linux][14] - -**How to Install** - -To install this application, you need to clone the git repo and then copy the contents to /bin directory for the global execution of the `ffscreencast` command. - -``` -git clone https://github.com/cytopia/ffscreencastcd ffscreencastsudo cp bin/ffscreencast /usr/local/bin -``` - -You can run this application with `ffscreencast` command from the terminal. - -[Source code & Home page][15] - -#### Open Streaming platforms - -The final application in this list is Open Streaming Platform (OSP), an open-source RTMP streamer software that can act as a self-hosted alternative to YouTube LIVE, Twitch.tv, etc. - -This application is feature-rich and powerful when used correctly. Because of the below essential features: - -- RTMP Streaming from an input source like Open Broadcast Software (OBS). -- Multiple Channels per User, allowing a single user to broadcast multiple streams simultaneously without needing multiple accounts. -- Video Stream Recording and On-Demand Playback. -- Manual Video Uploading of MP4s that are sourced outside of OSP -- Video Clipping – Create Shorter Videos of Notable Moments -- Real-Time Chat Moderation by Channel Owners (Banning/Unbanning) -- Admin-Controlled Adaptive Streaming -- Protected Channels – Allow Access only to the audience you want. -- Live Channels – Keep chatting and hang out when a stream isn’t on -- Webhooks – Connect OSP to other services via fully customizable HTTP requests, which will pass information -- Embed your stream or video directly into another web page easily -- Share channels or videos via Facebook or Twitter quickly -- Ability to Customize the UI as a Theme for your own personal look - -**How to Install** - -To install the Open Streaming Platform, follow the below page for detailed instructions. - -[Download Open Streaming Platform][16] - -**More Information** - -- [Home Page][17] -- [Source Code][18] -- [Documentation][19] - -### Closing Notes - -There are very few free and open-source live streaming applications available for Linux. However, several commercial live streaming applications are available, which may give you more options, quality, and support. But as I said, they may cost you some bucks. So, if you are new to the streaming world, you may want to get started with the above-listed free live streaming applications in Ubuntu or other Linux systems. I hope this article gives you ideas about which to use based on your need and get you started. - -Let me know your favourite live streaming software in the comment box below. - -Cheers. - -[Next:How to Create Ubuntu, Linux OS Bootable USB in Windows][20] - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/live-streaming-applications-linux-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/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/ diff --git a/sources/tech/20221207.2 ⭐️ How to Access UEFI Settings in Linux Systems.md b/sources/tech/20221207.2 ⭐️ How to Access UEFI Settings in Linux Systems.md deleted file mode 100644 index 3ff19e8639..0000000000 --- a/sources/tech/20221207.2 ⭐️ How to Access UEFI Settings in Linux Systems.md +++ /dev/null @@ -1,122 +0,0 @@ -[#]: 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: " " -[#]: publisher: " " -[#]: url: " " - -How to Access UEFI Settings in Linux Systems -====== - -Want to check the boot order or the power settings at the firmware level? **You can access the UEFI settings by pressing the F2, F10 or Del buttons when your system boots**. - -The problem with this approach is that you may not know the exact key and must be alert about pressing those keys at the right time. - -![Mr. Bean][1a] - -If you don’t want to feel like Mr. Bean in the above Gif, you can access the UEFI settings from the [Grub bootloader][1] screen in Linux. - -![uefi firmware settings grub linux][2] - -You see this screen when you turn on your Linux system. Most Linux distributions like Fedora and Ubuntu use Grub and they allow you to access the UEFI settings from the Grub screen like this. - -What if you don’t see this screen or your distro doesn’t use Grub? There are still ways to access UEFI settings from within Linux. - -Before you see how to do that, please [ensure that your system uses UEFI][3]. - -**_Another important thing. Your system will reboot into UEFI settings._** _You cannot access and modify the firmware settings from within an operating system._ - -### Boot into UEFI settings from Linux - -This method will only work on Linux distros having systemd. This means this method will work on anything based on Ubuntu, Debian, Fedora, and any mainstream Arch-based distros, including Manjaro and EndeavourOS. - -It is still a good idea to [ensure that your Linux distro uses systemd][4]. Use the given command and if it returns systemd you are good to go: - -``` -ps --no-headers -o comm 1 -``` - -![how to know if i am using systemd on linux?][5] - -Once you figure out that your distro is utilizing systemd, you can use the given command to boot into UEFI settings: - -``` -systemctl reboot --firmware-setup -``` - -Let me break down the used options first: - -- `reboot`: As its name suggest, it will reboot your system. -- `--firmware-setup`: When this option is used with `reboot`, it will indicate to the system’s firmware to boot into the firmware setup interface. - -Yup, that was it! A single command and you will be kicked into UEFI settings. I know Windows allows [booting into UEFI firmware settings from within Windows][6]. It’s good to see something similar in Linux as well. - -#### Create a desktop shortcut to boot into UEFI settings (optional) - -If you often find yourself booting into the UEFI settings and don’t remember the command all the time, you can make your life easier by creating a desktop shortcut. This will let you boot into UEFI by clicking on desktop icon. - -_**Now, this is unnecessary and not required for most Linux users. Do it only if you feel the need for it. The method requires [editing files in the command line][7].**_ - -First, use the given command to create a desktop shortcut file for UEFI settings: - -``` -sudo nano /usr/share/applications/uefi-reboot.desktop -``` - -And paste the following content in the file: - -``` -[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] - -Once done, [save the changes and exit from the nano][9] text editor. - -And now, you will find the shortcut for UEFI Firmware Setup in your system menu: - -![boot into uefi firmware from system menu][10] - -That’s it! A neat way to get into UEFI settings. - -### Wrapping Up - -The classic ways of accessing the boot settings may be a little inconvenient for some people. The grub screen may not show the UEFI option for older versions. - -And this is where the systemd method shines. I found this method a lifesaver when my system crashed and my function keys were not responding, which are necessary to boot into UEFI (that’s what I thought then!). - -I hope you find it equally helpful. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/access-uefi-from-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 -[1a]: https://external-preview.redd.it/dxmsKYDmzgfb1thu3EFI8Ni-DNfprNX8W8xDtff4QWU.gif?format=mp4&s=c31204644ac6a2a348133986714ff97cf3c4a48a -[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 diff --git a/sources/tech/20221208.1 ⭐️ Convert and Manipulate Images With ‘Converter’ GUI Tool in Linux.md b/sources/tech/20221208.1 ⭐️ Convert and Manipulate Images With ‘Converter’ GUI Tool in Linux.md deleted file mode 100644 index 318da04906..0000000000 --- a/sources/tech/20221208.1 ⭐️ Convert and Manipulate Images With ‘Converter’ GUI Tool in Linux.md +++ /dev/null @@ -1,87 +0,0 @@ -[#]: 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: " " -[#]: publisher: " " -[#]: url: " " - -Convert and Manipulate Images With ‘Converter’ GUI Tool in Linux -====== - -You can always [install ImageMagick][1] on your system to convert images, but not everyone likes to use the terminal for converting and manipulating images. - -So, what if you have a GUI app as a front-end to help with that? **Converter** is precisely that. - -It is a front-end to ImageMagick. So you do not need to use commands to convert and manipulate images. - -Note that most Ubuntu systems usually have ImageMagick pre-installed. You can always refer to our [installation guide][1] if you do not have it on your system. - -### Converter: A Graphical Front-end to ImageMagick - -![converter gui][2] - -It should not take a lot of effort to convert images. It is a simple task, and that is how it should be. - -I do not want to type a command to convert an image quickly. Hence, I prefer graphical tools that enable me to do things faster. - -[Converter][3] is an open-source graphical front-end that enables you to do that. It is a GTK4+libadwaita application. - -You can convert the images to various file formats that include **png, webp, jpeg, heif, heic, and bmp**. It is safe to say that you get support for the most popular image file formats. So, it should come in pretty handy. - -![file format converter][4] - -You can set a location to save all the files, and the converted images will automatically be stored at that location. - -![customize converter][5] - -You can also adjust an image’s quality, size, and background color. To access these options, click on “**More Options**” in the user interface before converting the image. - -![converter more options][6] - -The image size can be customized using its percentage, exact pixels, or ratio. For precise manipulation, changing the dimensions should help. - -If you want the image scaled to an extent, the percentage or ratio functionality should help you do that. You can also choose to add filters to your images. - -Overall, you get the basic options to re-size, convert, and optimize the image quality with Converter. - -You can also [tweak Nautilus][7] to have the [resize option in the right-click context menu][8]. It won’t be as versatile as this tool. - -### Install Converter on Linux - -Converter is available as a Flatpak on [Flathub][9] to install on any Linux distribution of your choice. - -Unfortunately, you do not get any binary packages to install on your Linux system. So, you might want to refer to our [Flatpak guide][10] to get it installed. - -``` -flatpak install flathub io.gitlab.adhami3310.Converter -``` - -You can explore more about it on its [GitLab page][3]. - -_Do you have any suggestions to nifty tools like this for us to highlight next? Let us know in the comments._ - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/converter-tool/ - -作者:[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/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/ diff --git a/sources/tech/20221208.2 ⭐️⭐️ 7 pro tips for using the GDB step command.md b/sources/tech/20221208.2 ⭐️⭐️ 7 pro tips for using the GDB step command.md deleted file mode 100644 index 8d0a0fecfd..0000000000 --- a/sources/tech/20221208.2 ⭐️⭐️ 7 pro tips for using the GDB step command.md +++ /dev/null @@ -1,255 +0,0 @@ -[#]: 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: " " -[#]: publisher: " " -[#]: url: " " - -7 pro tips for using the GDB step command -====== - -A debugger is software that runs your code and examines any problems it finds. [GNU Debugger][1] (GBD) is one of the most popular debuggers, and in this article, I examine GDB's `step` command and related commands for several common use cases. Step is a widely used command but there are a few lesser known things about it which might be confusing. Also, there are ways to step into a function without actually using the `step` command itself such as using the less known `advance` command. - -### No debugging symbols - -Consider a simple example program: - -``` -#include - -int num() { - return 2; -} - -void bar(int i) { - printf("i = %d\n", i); -} - -int main() { - bar(num()); - return 0; -} -``` - -If you compile without the debugging symbols first, set a breakpoint on `bar` and then try to step within it. The GDB gives an error message about 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 () -``` - -### Stepi - -It is still possible to step inside the function that has no line number information but the `stepi` command should be used instead. Stepi executes just one instruction at a time. When using GDB's `stepi` command, it's often useful to first do `display/i $pc`. This causes the program counter value and corresponding machine instruction to be displayed after each step: - -``` -(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 -``` - -In the above `display` command, the `i` stands for machine instructions and `$pc` is the program counter register. - -It can be useful to use info registers and print some register contents: - -``` -(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) -``` - -### Complicated function call - -After recompiling the example program with debugging symbols you can set the breakpoint on the `bar` call in main using its line number and then try to step into `bar` again: - -``` -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()); -``` - -Now, let's step into`bar()`: - -``` -(gdb) step -num () at exmp.c:4 -4 return 2; -``` - -The arguments for a function call need to be processed before the actual function call, so `num()` is expected to execute before `bar()`is called. But how do you step into the `bar` as was desired? You need to use the `finish` command and `step` again: - -``` -(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); -``` - -### Tbreak - -The `tbreak` command sets a temporary breakpoint. It's useful for situations where you don't want to set a permanent breakpoint. For example, if you want to step into a complicated function call like `f(g(h()), i(j()), ...)` , in such a case you need a long sequence of `step/finish/step` to step into `f` . Setting a temporary breakpoint and then using continue can help to avoid using such sequences. To demonstrate this, you need to set the breakpoint to the `bar` call in `main` as before. Then set the temporary breakpoint on `bar`.  As a temporary breakpoint it is automatically removed after being hit: - -``` -(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. -``` - -After hitting the breakpoint on the call to `bar` and setting a temporary breakpoint on `bar`, you just need to continue to end up in  `bar`. - -``` -(gdb) continue -Continuing. -Temporary breakpoint 2, bar (i=2) at exmp.c:9 -9 printf("i = %d\n", i); -``` - -### Disable command - -Alternatively, you could set a normal breakpoint on `bar` , continue, and then disable this second breakpoint when it's no longer needed. This way you can achieve the same results as with the `tbreak` with one extra command: - -``` -(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 -``` - -As you can see, the `info breakpoints`  command displays `n` under `Enb`which means it’s disabled but you can enable it later if it’s needed again. - -``` -(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 -``` - -### Advance location - -Another option you can use is an `advance` command. Instead of `tbreak bar ; continue` , you can simply do `advance bar` . This command continues running the program up to the given location. - -The other cool thing about `advance` is that if the location that you try to advance to is not reached, GDB will stop after the current frame's function finishes. Thus, execution of the program is constrained: - -``` -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); -``` - -### Skipping a function - -Yet another way to step into the `bar,` avoiding `num`, is using the `skip` command: - -``` -(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); -``` - -To know which functions are currently skipped,  `info skip` is used.  The `num` function is marked as enabled to be skipped by `y`: - -``` -(gdb) info skip -Num Enb Glob File RE Function -1 y n n num -``` - -If `skip` is not needed any more it can be disabled (and re-enabled later) or deleted altogether. You can add another `skip` and disable the first one and then delete them all. To disable a certain `skip`, its number has to be specified, if not specified, each `skip`is disabled. It works the same for enabling or deleting a `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 command - -Using GDB's `step` command is a useful tool for debugging your application. There are several ways to step into even complicated functions, so give these GDB techniques a try next time you're troubleshooting your code. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/12/gdb-step-command - -作者:[Alexandra][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/ahajkova -[b]: https://github.com/lkxed -[1]: https://opensource.com/article/21/3/debug-code-gdb diff --git a/sources/tech/20221209.0 ⭐️⭐️ Install open source solar power at home.md b/sources/tech/20221209.0 ⭐️⭐️ Install open source solar power at home.md deleted file mode 100644 index 7f9e86514d..0000000000 --- a/sources/tech/20221209.0 ⭐️⭐️ Install open source solar power at home.md +++ /dev/null @@ -1,61 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Install open source solar power at home -====== - -You might have already given some thought to powering your home with solar. Solar photovoltaic panels, which convert sunlight directly into electricity, have fallen so far down in cost that it makes economic sense everywhere. That is why large companies have put in a lot of solar, and even the electric utilities have started installing massive solar farms—it simply costs less than antiquated fossil fuels. Like most homeowners, you would like to save money and eviscerate your electric bill, but you are probably cringing a bit at the upfront cost. To get a rough idea of the cost, a 5kW system that would power an average home installed at $3/W would cost about $15,000, while a larger home might need 10kW to offset all of their electricity purchases and cost $30,000. If you want batteries, double the cost (you don’t need batteries as most solar arrays connect to the grid, but if the grid goes down, so does your solar array until it is turned back on.) Paying for all your electricity for the next several decades is an investment, even if you save a lot of money. - -There is some good financial news. First, both the US and Canada have enacted a 30% tax credit for solar. This credit drops the price down to about $2/W. Second, [Opensource.com previously discussed][1] how you could get a free book, [_To Catch the Sun_][2], that walks you through how to design your own system (you will still need a certified electrician and inspections to attach it to the grid). If you are a little handy, you can cut the remaining cost by about 50%. These costs are primarily for materials, including solar panels, wiring, electronics, and racking. Amazingly, solar panel costs have dropped so low for small solar systems (like the ones for your house) the racking (mechanical structures that hold the solar panels up) can cost more than the panels! - -### Open source to the rescue again - -Applying the open source development paradigm to software results in faster innovation, better products, and lower costs. The same is true of open source hardware—and even in the relatively obscure area of photovoltaic racking. Nearly all commercial photovoltaic racking is made from proprietary odd aluminum extrusions. They cost a lot of money. If you have a bit of unshaded backyard, you have a few open source racking solutions to choose from. - -### Open source solar rack designs - -The first DIY solar rack design meets the following criteria: (1) made from locally-accessible renewable materials, (2) 25-year lifetime to match solar warranties, (3) able to be fabricated by average consumers, (4) able to meet Canadian structural building codes (if you live where there is no snow this is a bit overkill, but, hey, you might have other weather extremes like hurricanes to deal with), (5) low cost and (6) that it is shared using an open source license. [The open source wood-based fixed-tilt ground-mounted bifacial photovoltaic rack design][3] works throughout North America. The racking system saves from 49% to 77% compared to commercial proprietary racking. The racking design, however, is highly dependent on the cost of lumber, which varies worldwide. - -Check your local cost of wood before you dive into this open source design. - -![Non-tilting solar rack plans][4] - -If you are even more adventurous, you might consider this second design that allows you to change the tilt angle. The results of [the second study][5] show the racking systems with an optimal variable seasonal tilt angle have the best lifetime energy production, with 5.2% more energy generated compared to the fixed-tilt system (or 4.8% more energy, if limited to a maximum tilt angle of 60°). Both fixed and variable wooden racking systems show similar electricity costs, which are only 29% of that of proprietary commercial metal racking. The variable tilt rack provides the lowest cost option even when modest labor costs are included and also may provide specific advantages for applications such as [agrivoltaics][6] (i.e., you can garden underneath the panels and amazingly get increases in yields for shade-tolerant crops like lettuce). This design has been certified by [OSHWA with CERN-OHL-S-2.0 licenses][7]. - -IMAGE - -![Tilt-adjustable solar racks][8] - -There is about 1kW for each of the 2 PV module racks shown. So a house would need about five of them. Both papers provide full calculations and step-by-step build instructions. - -As anyone with a solar system will tell you, getting a negative electricity bill is pretty rewarding. This happens if you size your system to meet all of your load and live in a net-metered part of the country. Please note that the electric utilities don’t pay you; the credit carries over until you use it in the winter. - -Have fun with a little open source solar! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/12/open-source-solar-power-home - -作者:[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/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 diff --git a/sources/tech/20221210.0 ⭐️ How to use the Linux file manager for GNOME 2.md b/sources/tech/20221210.0 ⭐️ How to use the Linux file manager for GNOME 2.md deleted file mode 100644 index f14b97ed3f..0000000000 --- a/sources/tech/20221210.0 ⭐️ How to use the Linux file manager for GNOME 2.md +++ /dev/null @@ -1,74 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to use the Linux file manager for GNOME 2 -====== - -Before GNOME 3 there was (unsurprisingly) GNOME 2, which had gained an ardent fanbase during its reign as one of the common default Linux desktops. The [Mate project][1] (named after the _yerba mate_ plant) began as an effort to continue the GNOME 2 desktop, at first using GTK 2 (the toolkit GNOME 2 was based upon) and later incorporating GTK 3. Today, Mate delivers a familiar desktop environment that looks and feels exactly like GNOME 2 did, using the GTK 3 toolkit. Part of that desktop is the Caja file manager, a simple but robust application that helps you sort and organize your data. - -### Install Caja - -Caja isn't exactly a stand-alone application. It's tightly coupled to the Mate desktop, so to try it you must install Mate. - -You may find Mate included in your Linux distribution's software repository, or you can download and install a distribution that ships Mate as its default desktop. Before you do, though, be aware that it's meant to provide a full desktop experience, so many Mate apps are installed along with the desktop. If you're running a different desktop, you may find yourself with redundant applications (two PDF readers, two media players, two file managers, and so on). To evaluate Caja without making major changes to your computer, install a Mate-based distribution in a virtual machine using [GNOME Boxes][2]. - -![Image of the ​Caja file manager.][3] - -### Clear layout - -The thing that you're likely to notice first about Caja is its clear and direct layout. There's a toolbar across the top of the Caja window with buttons for common tasks. I love this kind of design. Function isn't hidden away in a right-click menu, nor discoverable only after an action, nor buried in a menu. The "obvious" actions for the window are listed right across the top. - -Under the main toolbar is the location bar. This displays your current path, either as a series of buttons or as editable text. Use the **Edit** button to the left of the path to toggle whether it's editable or not. - -### Configurable - -For longtime users of GNOME 2 or Caja, the main toolbar can be redundant, especially once you know the keyboard shortcuts to invoke common actions. That's why the Caja interface is configurable. You can disable major components of the Caja window from the **View** menu, including: - -- Main toolbar -- Location bar -- Side panel -- Extra panel -- Status bar - -In short, you can make Caja as minimal as you want it to be. - -![Image of ​a minimal Caja layout.][4] - -### Tag your folders - -Some people are "visual" people. They like to organize files and folders according to how they perceive their data, rather than how the computer interprets it. For instance, if the two most significant folders for you are **Music** and **Work**, it can be hard to convince a computer that there's any relationship between those two. Alphabetically, there's a lot that should get started between the two, and the contents of each may be completely different (media files in one, spreadsheets in another). - -### Caja offers some assistance. - -With Caja, you can place directories manually within a window, and Caja remembers that placement. What's more, Caja has a variety of emblems available for you to use as visual labels. You can find them in the **Edit** menu, in **Backgrounds and Emblems**. Drag and drop them onto files and folders to help them stand apart. - -![Image of emblems in Caja.][5] - -### Caja - -As file managers go, Caja is one of the most inviting. It's configurable enough to appeal to many different use cases, and in those configuration options, you're likely to find a workflow that works for you. If you're a fan of GNOME 2, then you're sure to find Caja familiar, and if you've never used GNOME 2 then you might just find your new favorite desktop in Mate. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/12/linux-file-manager-caja - -作者:[Seth Kenlon][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lkxed -[1]: https://opensource.com/article/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 diff --git a/sources/tech/20221210.2 ⭐️ How to Update Flatpak Packages in Linux.md b/sources/tech/20221210.2 ⭐️ How to Update Flatpak Packages in Linux.md deleted file mode 100644 index ea9e63b118..0000000000 --- a/sources/tech/20221210.2 ⭐️ How to Update Flatpak Packages in Linux.md +++ /dev/null @@ -1,127 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Update Flatpak Packages in Linux -====== - -I believe almost all Linux users keep their systems updated. - -But that update is usually for the default [package manager][1]. For example, [updating Ubuntu][2] often means updating all the APT packages. - -However, there are other packaging formats like Snap and Flatpak. The Snap applications get updated automatically but not the Flatpak ones. - -How do you update the Flatpak packages then? Well, you can update all the installed and updatable Flatpak packages using this command: - -``` -flatpak update -``` - -That’s quite simple. But let me discuss a few more things about updating Flatpak, such as: - -- Updating all or specific Flatpak packages -- Updating Flatpak packages via Software Center - -Let’s start with the terminal method first. - -### Method 1: Using the terminal for updating Flatpak packages - -Let me first start with the most practical approach that you should also begin with. - -#### Update every outdated Flatpak package - -Updating the whole catalog of existing flatpak packages is quite easy. - -Enter the given command, and it will get you the list of outdated packages: - -``` -flatpak update -``` - -![3. update flatpak packages in linux][3] - -You just have to enter “Y” and press the Enter key, which will take care of every update. - -#### Updating specific Flatpak package - -To update specific packages, you’d need the list of the packages that can be updated. You used the same command you saw earlier. - -``` -flatpak update -``` - -![3. update flatpak packages in linux][4] - -Copy the name of the package you want to update from the output. Use the package name in the following fashion: - -``` -flatpak update package_name -``` - -For example, if you want to update Telegram, the following command will get the job done: - -``` -flatpak update org.telegram.desktop -``` - -![4. update specific package in flatpak][5] - -That’s it! - -### Method 2: Update Flatpak applications from the software center - -Distributions that come up with Flatpak buil-in support provide updates to Flatpak applications in the software center. Fedora and Linux Mint are such distributions. - -But if you are using Ubuntu, you’d need to add flatpak support to the GNOME software center: - -``` -sudo apt install gnome-software-plugin-flatpak -``` - -Once done, you will have two software centers in Ubuntu. That’s because the default software center is not GNOME’s but Snap Store. - -Open this new software center from the system menu: - -![1. open software center in ubuntu][6] - -Go to the `Updates` section and you will find the list of outdated packages. This includes both APT and Flatpak packages. - -![2. update flatpak from software center][7] - -From here, you can update all the packages at once, or you can be selective with what to update. - -### Wrapping Up - -Many Linux desktop users tend to forget to update the Flatpak packages as they are not included in the regular system updates. - -As Flatpak is a sandboxed packaging solution, you may not face any issues related to outdated packages, but you will miss out on new features and fixes for sure. - -This is why I recommend running the Flatpak update command once ever few weeks. - -I hope you like this quick little Flatpak tip helpful. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/update-flatpak/ - -作者:[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/package-manager/ -[2]: https://itsfoss.com/update-ubuntu/ -[3]: https://itsfoss.com/wp-content/uploads/2022/12/3.-update-flatpak-packages-in-linux.png -[4]: https://itsfoss.com/wp-content/uploads/2022/12/3.-update-flatpak-packages-in-linux.png -[5]: https://itsfoss.com/wp-content/uploads/2022/12/4.-update-specific-package-in-flatpak.png -[6]: https://itsfoss.com/wp-content/uploads/2022/12/1.-open-software-center-in-ubuntu.png -[7]: https://itsfoss.com/wp-content/uploads/2022/12/2.-update-flatpak-from-software-center.png diff --git a/sources/tech/20221211.0 ⭐️ Simplify your Linux PC with the PCManFM file manager.md b/sources/tech/20221211.0 ⭐️ Simplify your Linux PC with the PCManFM file manager.md deleted file mode 100644 index 0ff3f068de..0000000000 --- a/sources/tech/20221211.0 ⭐️ Simplify your Linux PC with the PCManFM file manager.md +++ /dev/null @@ -1,78 +0,0 @@ -[#]: 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: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Simplify your Linux PC with the PCManFM file manager -====== - -The PCMan File Manager, or PCManFM for short, is a fast and lightweight file manager that's full of features. It was developed for the [LXDE][1] desktop environment, but is a stand-alone application and can be used with the desktop or window manager of your choice. - -### Install PCManFM - -On Linux, you can probably find PCManFM in your software repository. For instance, on Fedora, Mageia, and similar: - -``` -$ sudo dnf install pcmanfm -``` - -On Debian, Elementary, and similar: - -``` -$ sudo apt install pcmanfm -``` - -![Image of the PCMan file manager.][2] - -PCManFM doesn't have to replace your desktop's file manager, but some distributions assume that when you install a "third party" file manager, you want it to take precedence over the default. Depending on the desktop you're using, there are different ways of setting your default file manager. Usually, it's in **System Settings** under **Default Applications**. - -If your desktop environment or window manager has no interface to select your default applications, you can set your preference in the `~/.local/share/applications/mimeapps.list` file. To designate a file manager as default, place it at the top of the `[Default Applications]` section, first specifying the file type and then the name of the application file (as it appears in `/usr/share/applications`) you want to use to open it: - -``` -inode/directory=myfilemanager.desktop; -``` - -### PCManFM - -If you're a fan of GNOME 2 or the Mate project's [Caja file manager][3], then PCManFM is a great alternative to consider. PCManFM is a lot like Caja in design, but it's not bound to the desktop in the way Caja is, so it's available even on the latest GNOME desktop. - -The default layout of PCManFM has a helpful toolbar near the top of the window, a side panel providing quick access to common directories and drives, and a status bar with details about your current selection. You can hide or show any of these elements using the **View** menu. - -### Tabs and panels - -PCManFM also uses tabs. If you've never used a tabbed file manager before, then think of a web browser and how it uses tabs to let you open multiple web pages in just one window. PCManFM can similarly open several directories in the same window. - -To transfer a file or folder from one tab to another, just drag the file's icon to the tab and hover. After a nominal delay, PCManFM brings the target tab to the front so you can continue your drag-and-drop operation. It takes some getting used to if you're not used to interacting with tabs in a file manager, but it doesn't take long, and it's a very powerful feature for decluttering your workspace. - -Another nice feature of the PCManFM interface is its ability to split a window into two panels. Each panel is effectively a tab, but each one only takes up half of the window. - -![Image of dual panels in PCMan.png][4] - -This makes dragging from one to the other just as easy and natural as dragging a file into a folder. I find it useful for comparing the contents of folders, too. - -### File management with PCMan - -PCManFM is a great little file manager with all the basic features you need on an everyday basis. It's a natural replacement for a file manager you might find too complicated, as well as a great option on [old computers][5] that might struggle with a file manager that's constantly drawing thumbnails and refreshing and generating animations. PCMan focuses on the core task of a file manager: managing files. Try it out on your Linux PC. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/12/linux-file-manager-pcmanfm - -作者:[Seth Kenlon][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lkxed -[1]: https://opensource.com/article/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 diff --git a/sources/tech/20221212.1 ⭐️⭐️ How to Install the Minimalist ArchBang Linux Distro.md b/sources/tech/20221212.1 ⭐️⭐️ How to Install the Minimalist ArchBang Linux Distro.md new file mode 100644 index 0000000000..2a0195401f --- /dev/null +++ b/sources/tech/20221212.1 ⭐️⭐️ How to Install the Minimalist ArchBang Linux Distro.md @@ -0,0 +1,301 @@ +[#]: subject: "How to Install the Minimalist ArchBang Linux Distro" +[#]: via: "https://itsfoss.com/install-archbang/" +[#]: author: "Sreenath https://itsfoss.com/author/sreenath/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install the Minimalist ArchBang Linux Distro +====== + +ArchBang is a minimal and lightweight [Arch Linux based distribution][1]. It uses the i3 window manager. With its minimal nature, ArchBang can help you revive your old computer or low-end devices. + +There are two ways to install Arch Bang: + +- Using the guided installer script +- Following Arch wiki + +No prizes for guessing that using the guided installer script will be easier to follow. + +In this tutorial, I’ll show you the steps for installing ArchBang with its text-based installer script. + +Please [check if your computer has UEFI or the legacy BIOS system][2]. Some steps are different for them. + +I have performed the demo in a virtual machine. And hence the wifi configuration part is not there. Internet connection is not mandatory here; you can also install it offline. You can connect to wifi from within the system after successfully installing ArchBang. + +Also, this method will remove any other operating system installed on your disk. Please be mindful of that. + +### Download ArchBang Live ISO + +To install ArchBang, you need the live ISO first. + +You can go to their [official website and download the required ISO][3], as shown in the below screenshot. + +![go to archbang iso images to download the iso file from sourceforge][4] + +It brings you to their Sourceforge page. Download the ISO, which is approximately 1.2 GiB in size. + +### Create the Live USB of ArchBang + +Once downloaded, you should make a bootable USB of ArchBang. You can [use software like Balena Etcher][5] to create it. It’s quite simple to use. + +Plug in your USB, browse to the downloaded ISO file and then hit the Flash button. + +![etcher flash][6] + +### Using text-based ArchBang installer + +ArchBang live ISO will bring you to the default i3 desktop with conky running. + +![archbang live iso home screen][7] + +You have two methods to start the installation process: + +- Press **Super + I** (as per desktop conky) to start installation directly. +- Press **Super + T** to enter the terminal and use the command: `sudo abinstall` + +A terminal with several options will appear when you do the above step: + +![archbang installer][8] + +The above screenshot shows the main menu of ArchBang installer. You can select each section with the associated number. + +When you complete each category of the above installer, it will return to this menu and you can select the next category by pressing the corresponding number and Enter key. + +Also, the completed sections will be checked with an “x” mark. + +#### Step 1: Select / Set Partition + +On the new installer screen, enter “1” to start [partitioning the disk][9]. + +Inside this, select the **Default** option. The installer has several tools to partition the disk, like cfdisk, fdisk, parted, etc. I used fdisk to do the job. + +##### Partitioning for Non-UEFI system + +Once the tool is selected, it will ask to choose the storage device. In my case, it was `/dev/sda` . Select the appropriate choice in your context. + +To start partitioning, enter “n” for a new partition. After that, select **Primary Partition.** + +![creating partition for non uefi system][10] + +For [non-UEFI systems][2], you can create one single root partition for all purposes. So, accept all the default values for “First Sector” and “Last Sector”. Then, press “w” to write the changes. + +On the next screen, you have to choose your filesystem and swap method. In this tutorial, I am using the EXT4 file system and Swap to File as the swap method. + +So set those according to the screenshot. + +![format the disk and select ext4 partition][11] + +##### Partitioning for UEFI system + +For UEFI users, you need to have two partitions, one EFI, with a 550 MB space, and another main root partition with the rest of the space (Swap as a file setting). + +Press n and select **Primary Partition.** Then select the Partition number as 1. + +Accept the default value for “First sector”. Now enter “+550M” as the value for “Last Sector”. + +Once again, press “n” and select **Primary Partition**. Accept the default value for the first and last sectors. + +![create two partitions for efi system][12] + +Press “t” to change the type and select the partition number “1” or `/dev/sda1`, whose type is to be changed from “Linux” to “EFI”. + +Select the partition type as EFI, as shown below: + +![change type of smaller partition to efi][13] + +Press “w” to write the changes. Then it will ask for filesystem selection. Here, you need to select the larger partition as the root partition (/dev/sda2, that is option 2 in the below screenshot). + +![select larger partition for root partition in efi system][14] + +Select EXT4 filesystem. This will again ask for mounting EFI partition. + +![select efi partition][15] + +In this step, you need to select the EFI partition at `/dev/sda1` and choose the mount point as `/boot/efi` . This will ask for format. Give consent by pressing “y”. + +Also, don’t forget to choose the swap to file option. + +#### Step 2: Start ArchBang installation + +This is pretty simple. Select the Install ArchBang option from the main menu by pressing the corresponding number (2 in this case). It will start the installation process. + +![installing archbang progress bar][16] + +You should wait for some time to complete the installation. + +#### Step 3: Set Hostname + +Once installation is completed, Select the 3rd option on the main menu, which is for setting the hostname. You need to enter a hostname. + +![provide hostname and press enter][17] + +#### Step 4: Set Location + +Location/Time Zone is typically mentioned in Zone/City format. I used Asia/Kolkata as the time zone. + +The installer provides the list of available zones and cities; you need to enter the number corresponding to your choice. + +![set time zone info][18] + +Also, set your location the same way. + +#### Step 5: Set Hardware Clock + +You have two options; Set Hardware Clock to UTC or Local Time. + +![set hardware clock time][19] + +There are two time standards:** localtime** and Coordinated Universal Time (UTC). The localtime standard depends on the current time zone, while UTC is the global time standard and is independent of time zone values. + +Enter your choice and press Enter key. + +#### Step 6: Set Locale + +Usually, you set the locale to en_US, if you are unsure what to do. That should be fine for most English-speaking users. + +If you want to use the operating system in some other language like French, Spanish, Dutch etc, you can choose the appropriate locale from the list. + +![set locale][20] + +#### Step 7: Desktop Keyboard Layout + +Similarly, most users should be fine with US keyboard. If you have some other keyboard (like French, or Italian), enter the appropriate choice from the available ones. + +![set desktop keyboard layout][21] + +#### Step 8: Configure Bootloader + +In ArchBang, you get GRUB2, Syslinux, or Systemd for the bootloader. To make it simple, I am selecting GRUB2 from the choice. + +![select grub2 as bootloader][22] + +Now, it will ask you to specify the method to install GRUB. Select **Automatic** and press enter. + +![select automatic grub][23] + +#### Step 9: Set Root Password + +Now, you should enter the root password. Select “Root Password” from the main menu. + +![enter and confirm root password][24] + +Here, enter and confirm the root password. + +#### Step 10: Create a New User + +Using a system with only a Root User is not secure. So, you should create a new user. In this installer, select the 10th option. Here, you should type a user name, password and confirm the password. + +![create user and password][25] + +Once done, press Enter to go to the main menu. + +#### Step 11: Finish configuration + +At this stage, you have reviewed all the configurations needed. You can now make it to effect by entering the letter “d” as shown in the screenshot below: + +![enter d option to finish the installation][26] + +This will ask permission to reboot your system. + +![press y to reboot your system to new archbang][27] + +Entering “y” will reboot your system to the newly installed ArchBang system. + +### Post Installation Tweaks + +Once rebooted, you will land in the same console. Probably there is no [display manager][28] installed. Here you should enter the username and password and press enter. + +![login to archbang through tty][29] + +This will bring you to the i3WM. + +![installed archbang with i3wm][30] + +Once installed, you need to do a couple of update tasks. **Connect to the internet first**. + +Firstly, you need to update the Pacman keys and archlinux-keyring. + +To do the same, open a terminal by pressing **Super + T** and run the following commands one by one: + +``` +sudo pacman-key –init +sudo pacman-key –populate +sudo pacman -Syyu archlinux-keyring +``` + +This will update system packages and keyrings. Reboot your system. + +Now, you should install a display manager. I prefer LightDM display manager. So open a terminal and enter the following command to install it: + +``` +sudo pacman -S lightdm lightdm-gtk-greeter +``` + +Once installed, use the following command to start the Lightdm service: + +``` +sudo systemctl enable lightdm.service +``` + +You will get a good and minimal login screen from the next reboot. + +![lightdm login screen in archbang][31] + +You can now enjoy ArchBang Linux according to your liking. + +### Wrapping Up + +ArchBang brings a good Arch Linux experience coupled with a not-so-hard installer and i3WM as the window manager. + +I understand that using a text-based installer like this one could be intimidating for some users. But then, it is [one of the joys of the Arch Linux][32] domain. It feels like a challenge and when you successfully install it, it gives you a sense of accomplishment. + +I have tried to detail all the steps with the necessary explanation. Please let me know if you face any issues or if you have any questions. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-archbang/ + +作者:[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/arch-based-linux-distros/ +[2]: https://itsfoss.com/check-uefi-or-bios/ +[3]: https://sourceforge.net/projects/archbang/files/ +[4]: https://itsfoss.com/wp-content/uploads/2022/12/go-to-archbang-iso-images-to-download-the-iso-file-from-sourceforge.png +[5]: https://itsfoss.com/install-etcher-linux/ +[6]: https://itsfoss.com/wp-content/uploads/2022/06/etcher-flash.png +[7]: https://itsfoss.com/wp-content/uploads/2022/12/archbang-live-iso-home-screen.webp +[8]: https://itsfoss.com/wp-content/uploads/2022/12/archbang-installer.png +[9]: https://itsfoss.com/partition-managers-linux/ +[10]: https://itsfoss.com/wp-content/uploads/2022/12/creating-partition-for-non-uefi-system.png +[11]: https://itsfoss.com/wp-content/uploads/2022/12/format-the-disk-and-select-ext4-partition.png +[12]: https://itsfoss.com/wp-content/uploads/2022/12/create-two-partitions-for-efi-system.png +[13]: https://itsfoss.com/wp-content/uploads/2022/12/change-type-of-smaller-partition-to_efi.png +[14]: https://itsfoss.com/wp-content/uploads/2022/12/select-larger-partition-for-root-partition-in-efi-system.png +[15]: https://itsfoss.com/wp-content/uploads/2022/12/select-efi-partition.png +[16]: https://itsfoss.com/wp-content/uploads/2022/12/installing-archbang-progress-bar.png +[17]: https://itsfoss.com/wp-content/uploads/2022/12/provide-hostname-and-press-enter.png +[18]: https://itsfoss.com/wp-content/uploads/2022/12/set-time-zone-info.png +[19]: https://itsfoss.com/wp-content/uploads/2022/12/set-hardware-clock-time.png +[20]: https://itsfoss.com/wp-content/uploads/2022/12/set-locale.png +[21]: https://itsfoss.com/wp-content/uploads/2022/12/set-desktop-keyboard-layout.png +[22]: https://itsfoss.com/wp-content/uploads/2022/12/select-grub2-as-bootloader.png +[23]: https://itsfoss.com/wp-content/uploads/2022/12/select-automatic-grub.png +[24]: https://itsfoss.com/wp-content/uploads/2022/12/enter-and-confirm-root-password.png +[25]: https://itsfoss.com/wp-content/uploads/2022/12/create-user-and-password.png +[26]: https://itsfoss.com/wp-content/uploads/2022/12/enter-d-option-to-finish-the-installation.png +[27]: https://itsfoss.com/wp-content/uploads/2022/12/press-y-to-reboot-your-system-to-new-archbang.png +[28]: https://itsfoss.com/display-manager/ +[29]: https://itsfoss.com/wp-content/uploads/2022/12/login-to-archbang-through-tty.png +[30]: https://itsfoss.com/wp-content/uploads/2022/12/installed-archbang-with-i3wm.png +[31]: https://itsfoss.com/wp-content/uploads/2022/12/lightdm-login-screen-in-archbang.png +[32]: https://itsfoss.com/why-arch-linux/ diff --git a/sources/tech/20221212.2 ⭐️⭐️ A sysadmin's guide to Carbonio.md b/sources/tech/20221212.2 ⭐️⭐️ A sysadmin's guide to Carbonio.md new file mode 100644 index 0000000000..aad2bc5ffa --- /dev/null +++ b/sources/tech/20221212.2 ⭐️⭐️ A sysadmin's guide to Carbonio.md @@ -0,0 +1,119 @@ +[#]: subject: "A sysadmin's guide to Carbonio" +[#]: via: "https://opensource.com/article/22/12/carbonio-community-edition-sysadmin" +[#]: author: "Arman Khosravi https://opensource.com/users/arman-khosravi" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A sysadmin's guide to Carbonio +====== + +[Carbonio Community Edition (Carbonio CE)][1] is an open source no-cost email and collaboration platform by Zextras. It provides privacy for organizations seeking digital sovereignty by using on-premises self-hosted servers. Using self-hosted servers offers a deeper level of control over infrastructure and data. However, it requires more attention to server configurations and infrastructure management to guarantee data sovereignty. Tasks done by system administrators play an important role in this matter. This makes administrative tasks a crucial part of achieving digital sovereignty, therefore, an administrative console dedicated to such tasks becomes extremely valuable to facilitate sysadmins' everyday jobs. + +This is why Zextras launched the first release of its own admin panel for Carbonio CE on October 2022. For Carbonio CE system administrators, it is the first step toward the creation of an all-inclusive admin console. + +In this article, I go into detail about the Carbonio CE Admin Panel and take a deeper look into what it can accomplish. + +![Image of the Carbonio admin panel.][2] + +### What is the Carbonio CE Admin Panel? + +The Carbonio CE Admin Panel is designed to assist the Carbonio CE system administrators with the most repetitive and frequent tasks such as user management and domain configuration. It is a browser-based application that runs on a particular port and is available for system administrators to use in production environments as soon as Carbonio CE is installed. + +### Why do you need the admin panel? + +Everything done in Carbonio CE Admin Panel can be done through the command-line interface as well. This raises the question: why might system administrators prefer using the admin panel rather than the command-line interface? + +Using the admin panel has its own obvious advantages such as: + +- Making repetitive activities much easier to perform +- Saving system administrators' time monitoring servers +- Providing a much easier learning process for junior system administrators + +Even though using the admin panel makes administrative tasks easier to perform, there is more to using this native user interface for Carboino CE. In essence, the Carbonio CE Admin Panel gives you the ability to monitor and manage your organization server from a single centralized location. Even when you're far away, you may still access your admin panel to check the status of servers and carry out various administrative activities. + +### Creating and managing user accounts + +Managing users has always been one of the most, if not the most, performed action by sysadmins. Therefore it should be an essential part of every administrative GUI available for system administrators. Suppose you, as the system administrator of the company have received some request by users to edit some information on their account. For instance, giving them access to some features, or your company has hired new employees, or some employees have left the company. All these scenarios require a sysadmin to manage user accounts frequently. + +Using the Carbonio CE Admin Panel you can simply go to **Domains > select a domain > Accounts** and select any account to modify, or press the **+** button to add a new account. + +![Image of the accounts Carbonio adminpanel.][3] + +### Creating and managing mailing lists + +Besides creating user accounts, a system administrator is often required to create different mailing lists that reflect the organizational structure of the company. Using mailing lists, users can simply send emails to a group of users by inserting the list address instead of every user address one by one. + +Creating mailing lists in Carbonio CE is extremely easy using the admin panel. You need to go to **Domains > select a domain > Mailing List > press the + button**. You can now use the wizard that opens up to create a mailing list. + +![Image of the Carbonio admin panel mailing list.][4] + +The essential steps to follow are: + +- Insert the name +- Insert the mailing list address +- Press **NEXT** +- Insert the members +- Press **CREATE**. + +You can follow the same path to edit mail lists created before. + +### Creating and managing domains + +Managing domains is another task frequently done by system administrators. Similar to accounts, creating a domain is very easy in the Carbonio Admin Panel. You only need to go to **Domains > select a domain > under the details** and find different entries to monitor the status of the domain. To create a new domain simply click on the **CREATE** button on the top bar and select **Create New Domain** and insert the necessary information such as: + +- Domain name +- Maximum number of accounts and maximum email quota +- Mail server where the domain is hosted + +![Image of the Carbonio admin domains panel.][5] + +### Creating and managing mailstore servers + +The Carbonio CE Admin Panel allows system administrators to manage different servers present in the infrastructure and provide them with different tools to configure them. To monitor a new mailstore server you can go to **Mailstores > Servers List** and find all the available mailstore servers in your infrastructure in a list (when just one server is installed, only one server is shown in this area). + +Under **Server Details**, you can select any of the available servers in the list and select **Data Volumes** to show more details of the storage volumes attached to it. While multiple volumes can be mounted simultaneously, only one primary volume, one secondary volume, and one index volume can be designated as active. You can add new volumes using the **NEW VOLUME +** button in the same section. You can also change the volume properties simply by clicking on them to open their detail window. + +![Image of the Carbonio admin panel volumes.][6] + +### Creating and managing classes of service + +Another scenario that can be facilitated with the help of the admin panel is creating classes of service (COS). After the installation, a system administrator might need to create different classes (groups) and assign different properties to them. This way, later in the process each user or a group of users can be easily nominated to a class of service in order to have access to the features and properties assigned to that specific COS. + +![Image of the Carbonio admin panel COS features.][7] + +To create a COS simply click on the **CREATE** button and select **Create New COS** or alternatively go to **COS** on the left panel and click on **CREATE NEW COS +**. You can then insert the name of the COS and define the different services available to this specific class. + +To edit a COS, go to **COS** on the left panel and select a COS from the dropdown menu at top of the list. + +You can define settings like quotas, the mail servers that can host accounts from this COS, or enable features for this COS. You can also define features for general features like Mail, Calendar, and Contacts. Additional customizable options include Tagging, Out of Office Reply, Distribution List Folders, and so on. + +![Image of the Carbonio admin panel classes of service preferences.][8] + +### Conclusion + +In this article, you saw a few scenarios in which the Carbonio CE Admin Panel saves you time and effort. The admin panel is an evolution of classical administrative tools in a new and centralized interface that gives the possibility of accessing different functionalities and monitoring tools from the same location. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/carbonio-community-edition-sysadmin + +作者:[Arman Khosravi][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/arman-khosravi +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/22/3/open-source-collaboration-carbonio +[2]: https://opensource.com/sites/default/files/2022-11/carbonio_admin_panel.webp +[3]: https://opensource.com/sites/default/files/2022-11/accounts_carbonio_admin_panel.webp +[4]: https://opensource.com/sites/default/files/2022-11/mailing_list_carbonio_admin_panel.webp +[5]: https://opensource.com/sites/default/files/2022-11/domains_carbonio_admin_panel.webp +[6]: https://opensource.com/sites/default/files/2022-11/volumes_carbonio_admin_panel.webp +[7]: https://opensource.com/sites/default/files/2022-11/cos_features_carbonio_admin_panel.webp +[8]: https://opensource.com/sites/default/files/2022-11/cos_preferences_carbonio_admin_panel.webp diff --git a/sources/tech/20221213.4 ⭐️⭐️ Use Django to send emails with SMTP.md b/sources/tech/20221213.4 ⭐️⭐️ Use Django to send emails with SMTP.md new file mode 100644 index 0000000000..7e6ab1dc0a --- /dev/null +++ b/sources/tech/20221213.4 ⭐️⭐️ Use Django to send emails with SMTP.md @@ -0,0 +1,300 @@ +[#]: subject: "Use Django to send emails with SMTP" +[#]: via: "https://opensource.com/article/22/12/django-send-emails-smtp" +[#]: author: "Sofiia Tarhonska https://opensource.com/users/sofiiatarhonska" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Use Django to send emails with SMTP +====== + +Numerous professions utilize simple mail transfer protocol (SMTP) to deliver emails to their end users. SMTP also retrieves messages, though that has not been its primary use case. Open source frameworks like Django, a Python-based web framework, allows more control for sending emails using functions and expressions. + +This article shows how to configure an SMTP server and send emails in Django using SMTP. + +### Project setup and overview + +Before proceeding, this tutorial requires a code editor (such as [VS Code or Codium][1]) on your preferred device. + +Start by creating a new directory using the command in the terminal: + +``` +mkdir exampledirectory +``` + +Then change into the directory using the command: + +``` +cd exampledirectory +``` + +Within the newly created directory, create a [virtual environment][2] using the built-in venv module in the command terminal: + +``` +python -m venv +``` + +This command creates a virtual environment within the folder created earlier. To activate it, use the following command in the terminal: + +On Linux and Mac: + +``` +source .virtenv/bin/activate +``` + +On Windows: + +``` +\Scripts\activate +``` + +### Creating a Django project + +After activating the virtual environment, proceed to install the Django package from [pip][3]: + +``` +pip install django +``` + +Create a new Django project: + +``` +python -m django startproject NewEmailProject +``` + +This command creates a project with the name `NewEmailProject`. To run the project, head to the project directory (`NewEmailProject`) and run the server: + +``` +python manage.py runserver +``` + +Open the link for the developmental server in a browser. You see the Django homepage with release notes. + +### Configuration for sending emails + +Next, open the `settings.py` file (in the `NewEmailProject` folder) to customize configurations for sending emails using Django. + +Scroll to the end of the code and update the file with the following code: + +``` +EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' +EMAIL_HOST = 'smtp.yourserver.com' +EMAIL_USE_TLS = False +EMAIL_PORT = 465 +EMAIL_USE_SSL = True +EMAIL_HOST_USER = 'your@djangoapp.com' +EMAIL_HOST_PASSWORD = 'your password' +``` + +Change the value of the `EMAIL_HOST` depending on your email client. Here are the acceptable values for common email clients: + +- **Gmail:**`smtp.gmail.com` +- **Outlook:**`smtp-mail.outlook.com` +- **Yahoo:**`smtp.mail.yahoo.com` + +You can change the `EMAIL_PORT` or leave 465 as the default. + +You can use the secure socket layer (SSL) and transport socket layer (TSL) interchangeably as they specify connection security. + +To figure out other custom configurations for your email server, check out the full [Django Project documentation][4]. + +### SMTP email backend + +The `EMAIL_BACKEND` expression helps determine the most suitable backend when sending emails through the Django SMTP server. This variable points to `smtp.EmailBackend`, which receives all the parameters needed for sending emails. It tells Django to send the email to the recipient email using SMTP and not to the console. + +### Sending emails with SMTP + +When the environment is set up and `settings.py` is updated, you can send emails in Django. You can use an HTML form that sends a post request of the necessary information needed for sending an email. + +Create a Django application for sending emails: + +``` +python manage.py startapp mail +``` + +Next, open the `settings.py` file and add the Django application (mail) to the `INSTALLED_APPS` list: + +``` +INSTALLED_APPS = [ +"django.contrib.admin", +"django.contrib.auth", +"django.contrib.contenttypes", +"django.contrib.sessions", +"django.contrib.messages", +"django.contrib.staticfiles", +"mail"] +``` + +### Send mail function + +In the mail application's `views.py` file, start by importing the `EmailMessage` and `get_connection` from `django.core.mail`: + +``` +from django.core.mail import EmailMessage, get_connection +``` + +The `EmailMessage` class is responsible for creating the email message itself. The `get_connection()` function returns an instance of the email backend specified in `EMAIL_BACKEND`. + +Now create a function that accepts a `POST` request, which contains form data submitted from the client side. Followed by the `get_connection()` functions parameters containing the email configurations created in the project `settings.py` file. + +Next, import the settings: + +``` +from django.conf import settings +``` + +This import allows access to the email configurations created in the `settings.py`. Next, create the variables: + +``` +subject, recipient_list, +``` + +Then you can `message`, and store the corresponding attributes used in the HTML form. The `email_from` variable contains the sender email, which is obtained from `EMAIL_HOST_USER` in the `settings.py` file. + +After the variables are processed, the `EmailMessage` class sends an email using the `sends()` method, and then closes the connection. The `send_email()` function renders the `home.html` file containing the email form. + +You can create a templates folder within your mail application and store the HTML files within that folder: + +``` +from django.core.mail import EmailMessage, get_connectionfrom django.conf import settingsdef send_email(request):   +   if request.method == "POST": +       with get_connection(   +           host=settings.EMAIL_HOST, +     port=settings.EMAIL_PORT,   +     username=settings.EMAIL_HOST_USER, +     password=settings.EMAIL_HOST_PASSWORD, +     use_tls=settings.EMAIL_USE_TLS   +       ) as connection:   +           subject = request.POST.get("subject")   +           email_from = settings.EMAIL_HOST_USER   +           recipient_list = [request.POST.get("email"), ]   +           message = request.POST.get("message")   +           EmailMessage(subject, message, email_from, recipient_list, connection=connection).send()   +  +   return render(request, 'home.html') +``` + +This is a bootstrap form for generating a message: + +``` +
+ {% csrf_token %} + 
+      +      +   
+   
+      +      +   
+   
+      +      +   
+   
+``` + +This form sends a post request to the `send_email()` function. This processes the form data and sends the email to the recipients. + +Now open the `urls.py` file in the `NewEmailProject` folder to create the homepage URL. Update the `urlpattern` list by adding the code `path("", send_email)` . + +### Sending email to multiple recipients + +To specify multiple recipients when sending the same email, create a new function called `send_emails` within the `views.py` file and modify the send function code: + +``` +def send_emails(request):   +    if request.method == "POST": +        with get_connection(   +              host=settings.EMAIL_HOST, +        port=settings.EMAIL_PORT,   +       username=settings.EMAIL_HOST_USER,   +       password=settings.EMAIL_HOST_PASSWORD,   +        use_tls=settings.EMAIL_USE_TLS +        ) as connection:   +            recipient_list = request.POST.get("email").split()   +            subject = request.POST.get("subject")   +            email_from = settings.EMAIL_HOST_USER   +            message = request.POST.get("message")   +            print(type(recipient_list)) +            EmailMessage(subject, message, email_from, recipient_list, connection=connection).send()   +  +    return render(request, 'send_emails.html') +``` + +For the `recipient_list` variable, I'm using the Python `split()` method to convert the recipients email string to list so that I can email all of them. + +Next, create another HTML file called `send_emails.html` in the templates folder and use the same form code for the `home.html` file within it. + +To specify multiple email recipients, use a space between each email address: + +``` +first@gmail.com second@gmail.com third@gmail.com +``` + +You should also update the `urlpattern` list by adding the code: + +``` +path("send-emails/", send_email) +``` + +### Sending HTML emails + +You can also send HTML emails with Django using a slightly modified version of the `send_email` function: + +``` +html_message = '''

this is an automated message

''' +msg = EmailMessage(subject, html_message, email_from,recipient_list, connection=connection) +msg.content_subtype = "html" +msg.send() +``` + +### Sending emails with attachment + +To include attachment to mails, create a variable and put it in the file path in a string like this: + +``` +attachment = "mail/templates/example.png" +``` + +Then, move the `EmailMessage` function to a variable and call the `attach_file` method followed by the `send` method: + +``` +msg = EmailMessage(subject, message, email_from, recipient_list, connection=connection) +msg.attach_file(attachment) +msg.send() +``` + +### Django email libraries + +This guide on sending emails in Django would not be complete if I didn't mention the email libraries that are available to users. Here are some noteworthy email libraries. + +- **Django mailer** is a Django app for queuing as it saves emails in a database and sends the mail out at a designated time. +- **Django templated email** aims to send templated emails. It offers features like configurable template naming and location, template inheritance, and adding recipients to the CC and BCC lists. +- **Anymail** allows the use of an email service provider (ESP). By using `django.core.mail`, it provides a sustained API that avoids tying your code to a single ESP. + +### Emailing with Django + +Sending emails in Django can sound daunting, but it's as simple as creating a virtual environment. You can add Django to the environment and create an email backend. Finally, you can set up an HTML template. Give it a try. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/django-send-emails-smtp + +作者:[Sofiia Tarhonska][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/sofiiatarhonska +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/20/6/open-source-alternatives-vs-code#vscodium +[2]: https://opensource.com/article/21/2/python-virtualenvwrapper +[3]: https://www.redhat.com/sysadmin/install-python-pip-linux +[4]: https://docs.djangoproject.com/en/3.2/ref/settings/#email-backend + diff --git a/sources/tech/20221213.5 ⭐️⭐️ Drupal 10 is worth a fresh look.md b/sources/tech/20221213.5 ⭐️⭐️ Drupal 10 is worth a fresh look.md new file mode 100644 index 0000000000..408b105756 --- /dev/null +++ b/sources/tech/20221213.5 ⭐️⭐️ Drupal 10 is worth a fresh look.md @@ -0,0 +1,79 @@ +[#]: subject: "Drupal 10 is worth a fresh look" +[#]: via: "https://opensource.com/article/22/12/drupal-10-fresh-look" +[#]: author: "Martin Anderson-Clutz https://opensource.com/users/mandclu" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Drupal 10 is worth a fresh look +====== + +The popular Drupal open source content management system (CMS) reaches a significant milestone when version 10 is released on December 14. Personally, I think Drupal X sounds way cooler, but so far, my calls to name it that haven't gotten much traction. I enlisted the help of my friend Aaron Judd of [Northern Commerce][1] to give us a sense of how cool Drupal X could look: + +![New Drupal 10 racing 10 logo][2] + +### What's a Drupal, anyway? + +Drupal is an open source CMS and development framework. While other CMS options focus on simple long-form content (think blogs) or entirely free-form content (like in Wix or Squarespace), Drupal has made a name for itself in handling more complex content architectures, in multiple languages, with robust content governance. Drupal sites (like this site, Opensource.com!) benefit from a strong role-based access control (RBAC) system, unlimited custom roles and workflows, and a powerful and extensible media library. + +Here's a rundown for anyone who hasn't kept tabs on what's coming in the newest major version. + +### A fresh face + +Most Drupal sites use custom themes to give them a unique look and feel. Still, the initial experience you have when installing a CMS matters. In Drupal, themes define the look and feel of a site, and you can use different themes for public and administrative experiences. Until recently, the Bartik and Seven themes had been the default face of Drupal for more than a decade. To put that in context, when Bartik was released, the most popular browser in the world was Internet Explorer 8. A lot has changed since then, particularly around best practices for building websites. + +In fact, a significant change in Drupal 10 will be the removal of support for Internet Explorer (IE), which is itself no longer supported by Microsoft and hasn't seen major updates since 2013. That may not sound like an improvement, but continued support for IE kept the community from adopting modern markup and styling. For example, thanks to being unencumbered by support for legacy browsers, Drupal 10 includes a new responsive grid layout that's so innovative it got a writeup in [CSS Tricks][3]. + +![Responsive grid configuration][4] + +The new faces of Drupal are two brand new themes: Olivero for visitors and Claro for admins. In addition to being fresh and modern designs, both were developed with accessibility as a top priority. + +### Improvements under the hood + +More than a decade ago, the Drupal community decided to "Get Off the Drupal Island." That meant adopting solutions shared across popular projects and frameworks instead of ones developed and maintained exclusively by the Drupal community. Today Drupal leverages a variety of projects and libraries whose names will be familiar to open source developers who have never touched Drupal: Symfony, Composer, CKEditor, Twig, Nightwatch, and more. + +That has brought a variety of powerful capabilities to Drupal and allowed it to contribute back to those solutions, benefitting a broader set of developers. It has also become a determining factor for the cadence of Drupal's major version releases. + +To illustrate, consider that Drupal 7 was released in early 2011. Drupal 8 was released almost five years later, towards the end of 2015. Drupal 9 was released in June of 2020, with a key motivator being the move to supported versions of underlying dependencies and removing deprecated code. And now, roughly two and half years later, we're already planning to release Drupal 10. This new major version will leverage updated versions of PHP, Symfony, and Composer, among others. + +### An all-new editor + +An upgrade of particular note is the move to CKEditor 5. Although notionally an incremental update, under the hood CKEditor 5 was completely rewritten, much the same as the transition from Drupal 7 to 8. In addition to a sleeker interface, CKEditor 5 has the potential for exciting new capabilities, such as real-time collaboration. Drupal's CKEditor integration for version 5 has already been augmented with a number of UI enhancements. For example, media placed within content can be configured using an overlaid toolbar ribbon instead of needing to launch a modal dialog to access these settings. Also, the styles dropdown now includes a preview of each type available. + +![Real-time collaboration][5] + +### A look ahead + +Earlier in 2022, Drupal creator and project lead Dries Buytaert announced a focus on "ambitious site builders." This means that while the community will continue to work on making the developer experience better in general, moving forward there is a particular focus on making it easier to create engaging experiences in Drupal without having to write code or use command-line tools. Three strategic initiatives embody this new focus: Automatic Updates, the Project Browser, and Recipes. + +**Automatic Updates** will reduce the total cost of ownership for Drupal sites and help them be more secure by ensuring they always have the latest core security patches. This will be a major benefit for site owners and Drupal development teams everywhere. However, judging by personal experience, Wednesday night pizza sales may take a hit (traditionally, the Drupal security team releases updates on the third Wednesday of the month). There is now a stable release of Automatic Updates as a contrib module. Work has begun to move this into Drupal core, so all Drupal sites will eventually be able to leverage this capability. + +The **[Project Browser][6]** makes Drupal sites easier to build, maintain, and evolve by allowing site builders to search and browse through a subset of Drupal's vast catalog of available modules, prefiltered to the site's Drupal version, for security, stability, and more. A site builder can select, download, and install a module without leaving the site's web interface. In fact, there's an "app store" like interface meant to promote the most popular modules available that are compatible with the current site's version of Drupal. While other CMS options have had similar offerings, this advancement means you don't need to sacrifice ease-of-use to take advantage of the power of Drupal. Also, all of the thousands of modules listed are 100% free. + +For many years Drupal has had a concept of distributions. These are opinionated versions of Drupal designed to meet specific use cases such as media publishing, fundraising, intranet portals, and more. While distributions have proven an excellent way to accelerate initial development, in practice, they have been known to require significant work to maintain and create extra work for site owners during maintenance. The **Recipes** initiative aims to make more granular, composable functionality available when building a site. Want to add a staff directory, events calendar, or locations map to your site? In the future, this will be as easy as installing a recipe and then customizing it to meet your site's specific needs. + +### It's an exciting time to try Drupal + +Drupal 10 is the culmination of work contributed by thousands of dedicated and talented community members worldwide. If you're not already using Drupal, we hope you'll try it out for your next project. There's a common saying among Drupalists: "Come for the code, stay for the community." + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/drupal-10-fresh-look + +作者:[Martin Anderson-Clutz][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/mandclu +[b]: https://github.com/lkxed +[1]: https://www.northern.co/ +[2]: https://opensource.com/sites/default/files/2022-12/DrupalX-RacerSticker-DrupalBlue-300ppi.png +[3]: https://css-tricks.com/an-auto-filling-css-grid-with-max-columns +[4]: https://opensource.com/sites/default/files/2022-11/responsive-grid-config.png +[5]: https://opensource.com/sites/default/files/2022-11/realtime-collaboration_0.gif +[6]: https://www.drupal.org/project/project_browser diff --git a/sources/tech/20221214.0 ⭐️⭐️ Experience Linux desktop nostalgia with Rox.md b/sources/tech/20221214.0 ⭐️⭐️ Experience Linux desktop nostalgia with Rox.md new file mode 100644 index 0000000000..301f8b485e --- /dev/null +++ b/sources/tech/20221214.0 ⭐️⭐️ Experience Linux desktop nostalgia with Rox.md @@ -0,0 +1,104 @@ +[#]: subject: "Experience Linux desktop nostalgia with Rox" +[#]: via: "https://opensource.com/article/22/12/linux-file-manager-rox" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Experience Linux desktop nostalgia with Rox +====== + +Rox-Filer is an open source file manager for Linux, once intended for the defunct Rox desktop but now a streamlined application for any window manager or desktop. There hasn't been much activity on the Rox project since 2014, and even then it is mostly in maintenance mode. And that's part of Rox-Filer's charm. In a way, Rox-Filer is a snapshot of an old desktop style that was progressive for its time but has given way to a more or less standardized, or at least conventional, interface. + +### Install Rox-Filer + +On Linux, your distribution's software repository may have Rox available for install. For instance, Debian packages it: + +``` +$ sudo apt install rox-filer +``` + +If your Linux distribution doesn't package Rox-Filer but you want to try it out, you can [compile from source][1] by downloading the [source code][2], installing its build dependencies, and then compiling: + +``` +$ sudo dnf install gtk2-devel libSM-devel \ +  shared-mime-info glade-libs xterm +$ wget https://codeload.github.com/rox-desktop/rox-filer/zip/refs/heads/master +$ unzip rox*zip +$ cd rox-filer-master +$ ./ROX-Filer/AppRun +``` + +### Configuring Rox + +The Rox file manager is based on the look and feel of RISC OS, an operating system developed by Acorn in Cambridge England (the same group responsible for the popular Arm microprocessor). Today, there's an [open source RISC OS][3] you can install on a Raspberry Pi, but for now, Rox is close enough. + +Rox has a simple layout. It has no menu bar, but there's a toolbar across the top, and the file panel is at the bottom. + +![Image of the Rox file manager.][4] + +As with the KDE Plasma Desktop, the default action of a single click in Rox is to open an item, whether it's a folder or a file. Unfortunately, no version of Rox, either packaged or compiled directly from the source, seems to be completely integrated with the mimetype definitions of the modern Linux desktop. For instance, Rox on CentOS renders an error when I click on even a basic text file, while the packaged version of Rox on Debian opens a plain text file but not a JPEG or archive file. You can fix this by setting a **Run Action** in the right-click context menu. + +![​Setting a run action in the Rox file manager.][5] + +Setting a run action can have broad definitions, so you don't have to set a separate run action for JPEG, PNG, WEBP, and all other image types, instead set the same run command for all mimetypes starting with `image`. + +Once you set that, you're ready to manage files with Rox. + +### Navigation + +You can navigate through your file system using the arrow icon in the top toolbar. The **Up** arrow takes you to the parent directory of your current location (in other words, the folder your current folder is in). To descend into a folder, click on it. + +### Refreshing the view + +Rox may not redraw the screen for every action, so sometimes you may need to prompt it to refresh. Click the **Circle** arrow in the Rox toolbar to refresh your current location's contents. + +### Copy or move a file + +There are two ways to copy or move a file in Rox. First, you can launch a second Rox window and drag and drop files from one window to the other. When you do, you're prompted to copy, move, or link the item you've dropped. + +Alternatively, you can right-click an item and open the **File** submenu from the context menu. In the **File** submenu, choose **Copy** and then enter the destination path for the item you want to move or copy. After you've confirmed that the file has successfully been copied to the target location, you can optionally select the item again, choosing **Delete** from the **File** menu. + +### Options + +You can customize some aspects of Rox by selecting **Options** from the right-click menu. This brings up a Rox configuration screen that's admittedly only partially relevant to Rox. The Rox options assume you're running a window manager, like [Windowmaker][6] which provides a traditional dock (or "pinboard" in Rox terminology). I wasn't able to get the pinboard options to work on [Fluxbox][7], my preferred window manager, or Windowmaker. In both cases, the window manager handled iconified windows, and I wasn't able to configure Rox to override the control. It's possible that I wasn't drastic enough in some of my configurations, but considering that Linux window managers are very capable of managing iconified windows, the pinboard mechanism of Rox isn't a vital feature (and probably not as flexible as the window manager's options). + +The other options, however, still work as expected. For instance, Rox by default resizes its window size to fit the contents of a folder. When you change from a directory containing twelve items to a directory containing just three, Rox shrinks its footprint. I find this jarring, so I chose the **Never automatically resize** option, forcing Rox to stay whatever size I set. + +### Window commands + +Some of my favorite features are four menu items hidden away at the bottom of the **Window** submenu in the right-click context menu. They are: + +- **Enter path**: Enter an arbitrary path and change directory to it. +- **Shell command**: Enter an arbitrary shell command and execute it. +- **Terminal here**: Open a terminal at your current location. +- **Switch to terminal**: Open a terminal at your current location, and close the Rox. + +I love options that allow for quick navigation or quick commands, so it's nice to have these close at hand. + +### Oldies + +Rox is a "blast from the past," whether or not you've ever used RISC OS or something like it. Rox represents a style of digital file management and even desktop configuration that just doesn't quite exist anymore. I've run Fluxbox, on and off again, at work and at home for the past decade, and I love manually configuring menus and configuration files. However, most of the Linux desktop has moved on from the conventions Rox relies upon. It's not impossible to make Rox fully functional, but it would take a lot of work, and most of what you'd be configuring are already provided by modern window managers and desktops. Even so, Rox is fun to use and experience. It's a great demonstration of how flexible a traditional Linux desktop setup was (and still can be, if you use only a window manager), and much of its charm is in its simplicity. I can't imagine a file manager today not having a dedicated move function, but Rox dares to force you to copy and delete instead. It's a different kind of file manager, and it might not be the one you use all day every day, but it's something you have to try if you miss, or literally missed, the "old days" of the Linux (or RISC OS) desktop. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/linux-file-manager-rox + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/21/11/compiling-code +[2]: https://sourceforge.net/projects/rox/files/rox/ +[3]: https://www.riscosopen.org/content/downloads +[4]: https://opensource.com/sites/default/files/2022-10/rox-filemanager.png +[5]: https://opensource.com/sites/default/files/2022-10/rox-menu-run.png +[6]: https://opensource.com/article/19/12/linux-window-maker-desktop +[7]: https://opensource.com/article/19/12/fluxbox-linux-desktop diff --git a/sources/tech/20221214.2 ⭐️⭐️ Best Screen Recorders for Wayland in Linux [Compared & Tested].md b/sources/tech/20221214.2 ⭐️⭐️ Best Screen Recorders for Wayland in Linux [Compared & Tested].md new file mode 100644 index 0000000000..a67e813001 --- /dev/null +++ b/sources/tech/20221214.2 ⭐️⭐️ Best Screen Recorders for Wayland in Linux [Compared & Tested].md @@ -0,0 +1,182 @@ +[#]: subject: "Best Screen Recorders for Wayland in Linux [Compared & Tested]" +[#]: via: "https://www.debugpoint.com/screen-recorders-linux-wayland/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Best Screen Recorders for Wayland in Linux [Compared & Tested] +====== + +**Here’s a list of screen recorders which work in Wayland currently in most modern Linux distributions.** + +![][1] + +Modern Wayland protocol is used by default in most frontrunner Linux distributions, such as Ubuntu and Fedora. However, this X.Org successor comes with work for the app developers to re-platform their app for Wayland because Wayland is more secure and follows modern standards. + +Linux legacy applications, those written with X.Org in mind, don’t work well in most cases unless it is modified. + +Screen recorder apps fall into that category. There are many popular screen recorders which were developed for X.Org – doesn’t work anymore in Wayland. + +However, few of them work. In this list, I will walk you through a few that I tested in the Wayland session. And they work well. + +### Best screen recorder apps for Wayland in Linux distros + +#### 1. Kooha + +The first on this list is Kooha, written in GTK and supports X11 and Wayland. It’s a fast and simple screen recorder for the GNOME desktop. This application is one of the best GNOME apps that provides hassle-free recording experiences. This utility supports hardware acceleration, a timer, multiple sources as input and many advanced features. Here’s a summary: + +- Option to select monitor for multiple displays or any window +- Hardware accelerated encoding (disabled by default; enable it via settings) +- Option to record the area of a screen +- Record mic and computer sound together +- Delay timer for records +- Option to choose the frame rate +- Support for WebM, mp4, gif, Mkv file types + +![Kooha - Best Screen Recoder for GNOME][2] + +![Kooha Settings][3] + +Installing Kooha is easy using Flatpak. [Set up your system for Flatpak & Flathub][4] and run the following command to install it. + +``` +flatpak install io.github.seadve.Kooha +``` + +We tested it in the latest Ubuntu 22.10 and Fedora 37 with Wayland session, it works flawlessly. + +**More details about Kooha** + +- [Home page][5] +- [Source code][6] + +#### 2. GNOME screen recorder + +The second in the list is GNOME Shell’s built-in screen recorder. It’s part of the GNOME’s new screenshot utility which you can launch by searching “screenshot” in the application menu. + +GNOME Screen recorder provides you option to record the entire screen or a rectangular portion. In addition, you have the option to record the cursor as well. + +However it only supports recording to webM format. And you can’t do a delayed start of your recording. + +You don’t need to install anything extra to use this. Since it comes by default with GNOME desktop. + +Use the keyboard shortcut `CTRL+SHIFT+ALT+R` to launch it. And select your option, then hit the record button. + +The recordings saved at ~/home/Videos/Screencasts. + +![GNOME Screen recorder][7] + +#### 3. OBS Studio + +The popular free and open-source streaming application OBS Studio recently started supporting Wayland. Although it is primarily used for live streaming, but it’s screen recording feature actually works in Wayland and you can use it. + +Since its a professional grade software, you can take advantage of it’s recording feature. In addition, you can also record the sound from the mic of your system while recording the screen. + +Installing OBS Studio is easy with Flatpak. [Set up your system for Flathub][4] and install it using the following command. + +``` +flatpak install com.obsproject.Studio +``` + +Note: OBS Studio need FFmpeg to run. We have a guide [here][8], if you want to install FFmpeg. + +After you launch OBS Studio, click on + sign under Sources to add source. Then select “Screen capture..”. And then click ok. + +![Screen capture option][9] + +![recording in OBS Studio in Wayland][10] + +After you stop the recording, it is saved at your ~/home directory. + +**More details about OBS Studio** + +- [Home page][11] +- [Source code][12] + +#### 4. vokoscreenNG + +The vokoscreenNG is a little different screen recording app which is totally underrated. It’s an old application and supports window capture, rectangular caption. In addition, it also support audio capture alongside screen, system tray control, magnifying glass, countdown, timer and many cool features. + +Recently, an experimental Wayland support introduced which you can try out. It works fairly well. Currently it supports webm, m4, mkv, mov and avi formats for Wayland. However, audio recording is not yet available for Wayland sessions. + +You can download the pre-compiled executable for Linux distros which require no installation from the below link. And run. + +[Download][13] + +![vokoscreenNG][14] + +**More details about vokoscreenNG** + +- [Home page][15] + +#### 5. Wayfarer + +The final screen recorder in this list is Wayfarer, based on GTK4. It currently supports all the modern protocols such as Wayland, Pipewire with wireplumber. It’s simple user interface supports screen recording with audio capture. You can also select a portion of your desktop or the entire screen for recording. + +Furthermore, you can select the frame rate, select mouse capture and have the ability to delay the recording. Currently it supports webm, mp4 and mkv formats. + +![Wayfarer screen recorder for Linux][16] + +However, it is currently available in Arch User repository (AUR) for Arch Linux. You can setup any AUR helper such as Yay and install it using the following command. + +``` +yay -S wayfarer-git +``` + +**More details about Wayfarer** + +[Home page & source code][17] + +### Other excellent screen recorders which are currently not working with Wayland + +Other than the above list, there are some excellent screen recorders available for X.Org which is currently broken in Wayland. As per my test in Ubuntu 22.10 and Fedora 37 wayland session, none of these works. You can only see a black screen in the recording file. I hope they get fixed in coming days and become compatible with Wayland. + +- [Peek][18] (may work with XWayland backend) +- [Simple screen recorder][19] +- [Blue Recorder][20] (supports Wayland but is currently broken) + +### Wrapping Up + +From my personal experience, Wayland is faster and better. Since many modern distros are moving towards Wayland, you must change your workflow with replacement apps. I hope this list of screen recorders in Wayland helps you pick the one that suits you best. + +Do let me know if you know of any other apps of a similar category which work with Wayland. + +[Next:Top 10 32-Bit Linux Distributions in 2022 [Compared]][21] + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/screen-recorders-linux-wayland/ + +作者:[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/12/wayrec.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2021/12/Kooha-Best-Screen-Recoder-for-GNOME.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/12/Kooha-Settings.jpg +[4]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[5]: https://apps.gnome.org/app/io.github.seadve.Kooha/ +[6]: https://github.com/SeaDve/Kooha +[7]: https://www.debugpoint.com/wp-content/uploads/2022/12/GNOME-Screen-recorder.jpg +[8]: https://www.debugpoint.com/install-ffmpeg-ubuntu/ +[9]: https://www.debugpoint.com/wp-content/uploads/2022/12/Screen-capture-option.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/12/recording-in-OBS-Studio-in-Wayland.jpg +[11]: https://obsproject.com/ +[12]: https://github.com/obsproject/obs-studio +[13]: https://linuxecke.volkoh.de/vokoscreen/vokoscreen-download.html +[14]: https://www.debugpoint.com/wp-content/uploads/2022/12/vokoscreenNG.jpg +[15]: https://linuxecke.volkoh.de/vokoscreen +[16]: https://www.debugpoint.com/wp-content/uploads/2022/12/Wayfarer-screen-recorder-for-Linux.jpg +[17]: https://github.com/stronnag/wayfarer +[18]: https://github.com/phw/peek +[19]: https://www.maartenbaert.be/simplescreenrecorder/ +[20]: https://github.com/xlmnxp/blue-recorder +[21]: https://www.debugpoint.com/32-bit-linux-distributions/ diff --git a/sources/tech/20221215.1 ⭐️⭐️ Why Drupal is the future of content strategy.md b/sources/tech/20221215.1 ⭐️⭐️ Why Drupal is the future of content strategy.md new file mode 100644 index 0000000000..572d40c963 --- /dev/null +++ b/sources/tech/20221215.1 ⭐️⭐️ Why Drupal is the future of content strategy.md @@ -0,0 +1,90 @@ +[#]: subject: "Why Drupal is the future of content strategy" +[#]: via: "https://opensource.com/article/22/12/drupal-content-strategy" +[#]: author: "Suzanne Dergacheva https://opensource.com/users/pixelite" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Why Drupal is the future of content strategy +====== + +As a long-time advocate for open source and a contributor to Drupal, I spend a lot of time thinking about how organizations can leverage the platform. I've been thinking about Drupal's position in the larger digital ecosystem and how it compares to the other options on the market. And how Drupal can lean more on its strengths when planning out the strategy for a new project. + +### How Drupal fits into the digital landscape + +In 2022, putting a site online can be as fast as the time it takes to make a coffee. This is made possible because websites have many similar features and there's usually no need to build one from scratch. When I started my career, frameworks like Ruby on Rails were appealing because of their flexibility. But I quickly learned that the lack of standard solutions for common things like multilingual content, media management, and workflows, meant that each project required a huge investment in custom development. + +On the other hand, web builders that have emerged over the last ten years, like Wix and Squarespace offer the dream of "drag-and-drop" website construction and customizable templates. But in reality, their flexibility is very surface-level. They don't offer enough flexibility to build a solid content model, create an experience, or provide the level of content compliance that large organizations need. + +This is where Drupal stands out, providing both powerful functionality out-of-the-box, and the tools to build out custom functionality on top of that content. + +### Drupal, the content management system + +When I started using Drupal 15 years ago, it was described as a content management system. And it is, as it gives content editors the power to log in and manage content, rather than relying on a webmaster or a web developer to do it. + +But there was also the promise that site builders could update not just the content, but the content model. Site builders could extend Drupal using configuration instead of writing code. This set it apart from the frameworks that were out at the time. From years of teaching people Drupal, I can tell you that there's a certain amount of joy and empowerment that people get when they realize how much they can do through the Drupal admin UI. + +At its core, this is still Drupal's strength. You can control not just the content, but how content is organized. The fact that taxonomy and localization are baked into Drupal's content model, gives a huge advantage over other systems that have a more limited concept of content. + +### Drupal, the platform + +Shortly after adopting Drupal as our agency's technology of choice, I started calling it a platform. As an ambitious 20-something, I was keen to build more than nice-looking content-rich websites. The ambition was to create more powerful tools to organize the flow of information. This includes integrating Drupal with other systems to build functionality and workflows around your content. You can also create content synchronizations between a CRM and Drupal. Finally, you can search interfaces that allow you to search diverse content sources and filter content in new ways. + +The fact that Drupal is so adaptable to these architectures distinguishes it immediately from other CMSs. When talking to large organizations, teams of developers or IT leaders see the benefit of using a technology that is so flexible and adaptable to functional needs. + +### Drupal, the digital experience platform + +While these attributes are still very compelling, Drupal is now referred to as a digital experience platform (DXP). Its main difference from the proprietary DXPs of the world is that it's open. It doesn't ship with a stack of integrated technologies but rather lets you decide what your stack will be. Whether it's for marketing integrations or multi-channel experiences, you can decide how content feeds into and out of Drupal. This flexibility is one of Drupal's strengths. But it can be a challenge when pitching Drupal against other DXPs that come with a complete marketing toolset. + +Marketing folks often look for a packaged solution. And while an agency can package Drupal with a stack of tools, it's hard for Drupal to market this type of ready-to-go solution. + +### Drupal's strength as a content strategy platform + +So how does Drupal position itself when talking to marketers? Drupal's core strength is still its flexible content architecture. This means that it's an ideal platform for implementing a content strategy and content governance plan. These are two things that plenty of organizations are missing. They are also the two reasons for marketers to adopt a platform like Drupal. + +### Better content strategy with Drupal + +While Drupal can already be adapted to the content strategy of any organization, it doesn't mean that every Drupal website has a strong content strategy. Drupal implementers have to proactively make choices that prioritize the needs of content and content editors. This means doing things like: + +- Organizing content around user needs, not organizational structure +- Structuring content to be reusable, adaptable, personalized, translatable +- Integrating content with digital services by making content available via API +- Setting up tools so that content compliance is checked systematically + +Meanwhile, beyond the website, organizations need to use best practices to prioritize their content strategy practice. This means: + +- Empowering communicators and treating content editors as first-class users +- Sharing best practices for web publishing across the organization +- Creating a clear, actionable content governance plan +- Using tools like the digital asset management (DAM) tool that fosters content governance +- Creating a smooth flow of content and feedback between content experts and users + +With new expectations of platforms to handle personalization and faster cycles for re-branding or implementing a completely new marketing strategy, it's more important than ever for your website to be a tool to help your content strategy. If you're looking for ways to orient your practice around a strong content strategy, here are some places to start: + +- Get content editors involved in the process when launching a new web project +- Build [documentation][1] that's driven by content needs, not just technology. Use real content examples in your documentation and talk about the "why" of the content. +- Prioritize ongoing content governance rather than just relying on big projects to revamp your content every 3-5 years +- Invest in cleaning up legacy content instead of migrating content as-is when you do invest in a website redesign +- Invest in the content editor experience, something that Drupal facilitates and continues to invest in, but still takes active effort to do for each project + +To sum up, Drupal is already a CMS and a DXP. But this is beside the point. There is a need to leverage Drupal's capabilities towards creating a strong content strategy to really get the most out of the platform. + +_This article is based on the author's talk at DrupalCon Portland: [Future of content management: using Drupal as a content strategy platform][2]._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/drupal-content-strategy + +作者:[Suzanne Dergacheva][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/pixelite +[b]: https://github.com/lkxed +[1]: https://opensource.com/tags/documentation +[2]: https://www.youtube.com/watch?v=iexCIUuMWDU diff --git a/sources/tech/20221215.3 ⭐️⭐️ Enjoy two-panel file management on Linux with far2l.md b/sources/tech/20221215.3 ⭐️⭐️ Enjoy two-panel file management on Linux with far2l.md new file mode 100644 index 0000000000..53340252a5 --- /dev/null +++ b/sources/tech/20221215.3 ⭐️⭐️ Enjoy two-panel file management on Linux with far2l.md @@ -0,0 +1,148 @@ +[#]: subject: "Enjoy two-panel file management on Linux with far2l" +[#]: via: "https://opensource.com/article/22/12/linux-file-manager-far2l" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Enjoy two-panel file management on Linux with far2l +====== + +Far2l is a port of the Windows text-based file manager **Far**. And to be clear, that's a lower-case **L** (as in "Linux") not a number **1**. It runs in the terminal and is designed around a plug-in structure, enabling compatibility with SSH, WebDAV, NFS, and more. You can compile and run far2l on Linux, Mac, and BSD, or Far on Windows. + +### Install far2l + +Far2l is currently in beta, so you're unlikely to find it in your Linux distribution's software repository. However, you can [compile it from source][1] by downloading cloning its [Git repository][2]: + +``` +$ git clone --depth 1 https://github.com/elfmz/far2l.git +``` + +You can browse through the source code to see all of its different components. The main source files are in `utils/src`: + +``` +SharedResource.cpp +StackSerializer.cpp +StringConfig.cpp +StrPrintf.cpp +TestPath.cpp +Threaded.cpp +ThreadedWorkQueue.cpp +TimeUtils.cpp +TTYRawMode.cpp +utils.cpp +WideMB.cpp +ZombieControl.cpp +``` + +The file `ZombieControl.cpp` works to [mitigate a zombie apocalypse][3] (at least, in terms of processes), the file `ThreadedWorkQueue.cpp` helps speed processes along by using threading. Far2l isn't just built for extensibility, it's built responsibly! + +Assuming you've already prepared your system for compiling code, as described in the [compiling from source][1] article, you must also install some development libraries required by far2l. On Fedora, CentOS, OpenMandriva, and Mageia, the minimal list is: + +- wxGTK3-devel +- spdlog-devel +- xerces-c-devel +- uchardet-devel (your repository may not have this one, but there's a workaround) + +On Debian, the minimal list is: + +- libwxgtk3.0-gtk3-dev +- libuchardet-dev +- libspdlog-dev +- libxerces-c-dev + +Use [CMake][4] to prepare the makefiles: + +``` +$ mkdir build +$ cd !$ +$ cmake .. -DUSEUCD=no +``` + +The `-DUSECD=no` option is required only if you don't have the development libraries for `chardet` installed. If you do, then you can omit that option. + +Finally, compile the code and install far2l to a temporary location: + +``` +$ make -j$(nproc --all) +$ mkdir ~/far2l +$ make install DESTDIR=~/far2l +``` + +If you prefer to install it to your system instead of to a temporary directory, then omit the `DESTDIR=~/far2l` option. + +To launch far2l, invoke the binary stored in the `bin` subdirectory of your install path. For instance: + +``` +$ ~/far2l/local/bin/far2l +``` + +### Using far2l + +When you first launch far2l, it creates a configuration directory in `~/.config` and prompts you to choose what font you'd like to use. On my system, 16 pt font size was the default, and anything less than that was impossible to read. I used the open source Fantasque Mono Regular as my font, but any monospace font ought to work. + +Far2l is a two-panel file manager, meaning that the default view has a place to display two separate directories. At launch, both directories happen to be your home directory. To maximize the amount of screen space used for listing files, far2l uses two columns in each panel, and you can use the **Left** and **Right** arrows to change from one column to the other. + +In the right column, you can also use the **Right** arrow to move "down" the list of files by one screen. In the left column, use the **Left** arrow to move "up" the list of files by one screen. + +![Image of ​the far2l file manager.][5] + +This navigation takes some getting used to, especially if you're used to terminal file managers that only use the **Right** arrow to descend into a directory. However, once you get used to far2l's navigation, you're likely to appreciate the added speed you gain from this simple pagination. + +### Open a file or folder + +To open a folder, select a folder in your file list and press the **Return** key. This causes the active panel to change to a view of that directory. The inactive panel doesn't change, so it's not uncommon for far2l to always be showing two different directories at the same time. That's a feature of the two-panel file manager design, although it can take some getting used to if you're not in the habit of splitting windows. + +After you've moved into a directory, you can move back into its parent folder by selecting the double dots (`..`) at the top of the file listing and pressing **Return**. + +To open a file, select a folder in your file list and press the **Return** key. The file opens according to your desktop's mimetype preferences. + +### Panel and window navigation + +To move from one panel to another, press the **Tab** key. + +The fun thing about far2l is that its file listing is actually a layer over the top of your terminal. To hide the file listing temporarily, and to reveal it once it's gone, press **Ctrl+O** (that's the letter `O` not the digit zero). + +You can also adjust how much of your terminal the file panels take up. Press **Ctrl+Up** and **Ctrl+Down** to adjust the vertical size of the file panels. + +Make no mistake, though, you're not just suspending far2l when you access the terminal underneath. This isn't your usual terminal, it's a far2l terminal that interacts with the file manager and adds a few features to your standard terminal experience. For example, the [`find` command][6] gains graphical auto-completion. + +![Image of ​far2l responsive terminal.][7] + +### Copying and moving files + +All the usual file management functions are available within far2l are available with function keys. These are listed along the bottom of the far2l window. There are lots of options for some of the actions, which is either over-complex or really really powerful, depending on your preference. + +![Image of far21 move options.][8] + +### Exiting far2l + +To close far2l, type `exit far` into the command prompt at the bottom of the far2l window. + +### Far out + +Far2l is a dynamic and responsive text-based file manager. If you're a fan of classic two-panel file managers, then you'll feel at home with far2l. Far2l provides an interesting and novel interpretation of a terminal, and if you don't try far2l for its two-panel file management, you should at least try it for its terminal. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/linux-file-manager-far2l + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/21/11/compiling-code +[2]: https://github.com/elfmz/far2l +[3]: https://www.redhat.com/sysadmin/killing-zombies-linux-style +[4]: https://opensource.com/article/21/5/cmake +[5]: https://opensource.com/sites/default/files/2022-10/far2l.filemanager.png +[6]: https://www.redhat.com/sysadmin/linux-find-command +[7]: https://opensource.com/sites/default/files/2022-10/far2l-popup.png +[8]: https://opensource.com/sites/default/files/2022-10/far2l-move-options.png diff --git a/sources/tech/20221216.2 ⭐️⭐️ 5 reasons to love Linux GNOME Files.md b/sources/tech/20221216.2 ⭐️⭐️ 5 reasons to love Linux GNOME Files.md new file mode 100644 index 0000000000..fda0ea984f --- /dev/null +++ b/sources/tech/20221216.2 ⭐️⭐️ 5 reasons to love Linux GNOME Files.md @@ -0,0 +1,96 @@ +[#]: subject: "5 reasons to love Linux GNOME Files" +[#]: via: "https://opensource.com/article/22/12/linux-file-manager-gnome" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +5 reasons to love Linux GNOME Files +====== + +The GNOME desktop is a common default desktop for most Linux distributions and, as with most operating systems, you manage your data on GNOME with software called a file manager. GNOME promotes a simple and clear naming scheme for its applications, and so its file manager is called, simply, Files. Its intuitive interface is simple enough that you forget what operating system you're using altogether. You're just using a computer, managing files in the most obvious way. GNOME Files is a shining example of thoughtful, human-centric design, and it's an integral part of modern computing. These are my top five favorite things about GNOME Files, and why I love using it. + +### 1. Intuitive design + +![THe GNOME Files file manager is an intuitive and friendly application.][1] + +As long as you've managed files on a computer before, you basically already know how to use GNOME Files. Sure, everybody loves innovation, and everybody loves seeing new ideas that make the computer world a little more exciting. However, there's a time and a place for everything, and frankly sometimes the familiar just feels better. Good file management is like breathing. It's something you do without thinking about what you're doing. When it becomes difficult for any reason, it's disruptive and uncomfortable. + +GNOME Files doesn't have any surprises in store for you, at least not the kind that make you stop what you thought you were doing in order to recalculate and start again. And my favorite aspect of the "do it the way you think you should do it" design of GNOME Files is that there isn't only one way to accomplish a task. One thing I've learned from teaching people how to do things on computers is that everyone seems to have a slightly different workflow for even the simplest of tasks, so it's a relief that GNOME Files accounts for that. + +When you need to move a file, do you open a second window so you can drag and drop between the two? Or do you right-click and Cut the file and then navigate to the destination and Paste the file? Or do you drag the file onto a button or folder icon, blazing a trail through directories as they open for you? In GNOME Files, the "standard" assumptions usually apply (insofar as there are standard assumptions.) + +### 2. Space saver + +If you manage a lot of files for a lot of the time you're at your computer, you're probably familiar with just how much screen real estate a file manager can take up. Many file managers have lots of buttons across several toolbars, a menu bar, and a status bar, such that just one file manager window takes up a good portion of your screen. To make matters worse, many users prefer to open several folders, each in its own window, which takes even more space. + +GNOME Files tends to optimize space. What takes up three separate toolbars in other file managers is in a single toolbar in GNOME Files, and that toolbar is what would traditionally be the window title bar. In the top bar, there's a forward and back button, file path information, a view settings button, and a drop-down menu with access to common functions. + +![The GNOME Files toolbar has just the essential buttons, and in a compact space.][2] + +### 3. Other locations + +Not all operating systems or file managers make it so you can interact with your network as naturally as you can interact with your own computer. Linux has a long tradition of viewing the network as just another computer, and in fact, the name "GNOME" was an acronym for "GNU Network Object Model Environment." + +In GNOME Files, it's trivial to open a folder on a computer you're not sitting in front of. Whether it's a server in a data center or just your office desktop while you're relaxing in your lounge with a laptop, the **Other Locations** bookmark in the GNOME Files side panel allows you to access files as if they were on your hard drive. + +![It's easy to connect to remote systems through GNOME Files.][3] + +To use it, you enter the file sharing protocol you want to use, along with the username and IP address of the computer you want to access. The `ssh://` protocol is most common between Linux or Unix machines, while `smb://` is useful for an environment with [Windows machines][4], and `dav://` is useful for applications running on the Internet. Assuming the target computer is accessible over the protocol you're using, and that its [firewall is set correctly][5] to permit you to pass through it, you can interact with a remote system as naturally as though they were on your local machine. + +### 4. Preferences + +Most file managers have configuration options, and to be fair GNOME Files actually doesn't give you very many choices compared to others. However, the options that it does offer are, like the modes of working it offers its users, the "standard" ones. I'm misusing the word "standard" intentionally: There is no standard, and what feels standard to one person is niche to someone else. But if you like what you're experiencing with GNOME Files under normal circumstances, and you feel that you're its intended audience, then the configuration options it offers are in line with the experience it promotes. For example: + +- Sort folders before files +- Expand folders in _list view_ +- Show the **Create link** option in the contextual menu +- Show the **Delete Permanently** option in the contextual menu +- Adjust visible information beneath a filename in _icon view_ + +That's nearly all the options you're given, and in a way it's surface-level choices. But that's GNOME Files. If you want something with more options, there are several very good alternatives that may better fit your style of work. If you're looking for a file manager that just covers the most common use cases, then try GNOME Files. + +### 5. It's full of stars + +I love the concept of metadata, and I generally hate the way it's _not_ implemented. Metadata has the potential to be hugely useful in a pragmatic way, but it's usually relegated to specialized metadata editing applications, hidden from view and out of reach. GNOME Files humbly contributes to improving this situation with one simple feature: The gold star. + +In GNOME Files, you can star any file or folder. It's a bit of metadata so simple that it's almost silly to call it metadata, but in my experience, it makes a world of difference. Instead of desperately running [find][6] command to filter files by recent changes, or re-sorting a folder by modification time, or using [grep][7] to find that one string I just know is in an important file, I can star the files that are important to me. + +Making plans for the zombie apocalypse all day? Star it so you can find it tomorrow when you resume your important work. After it's over and the brain-eaters have been dealt with, un-star the folder and resume normal operation. It's simple. Maybe too simple for some. But I'm a heavy star-user, and it saves me several methods of searching and instead reduces "what was I working on?" to the click of a single button. + +### Install GNOME Files + +If you've downloaded a mainstream Linux distribution, then chances are good that you already have GNOME and GNOME Files installed. However, not all distributions default to GNOME, and even those that do often have different desktops available for download. The development name of GNOME Files is `nautilus`, so to find out whether you have GNOME Files installed, open a terminal and type `nautilus &` and then press **Return**. If you see this error, you don't have GNOME Files available: + +``` +bash: nautilus: command not found... +``` + +To install GNOME Files, you must install the GNOME desktop. If you're happy with your current desktop, though, that's probably not what you want to do. Instead, consider trying [PCManFM][8] or [Thunar][9]. + +If you're interested in GNOME, though, this is a great reason to try it. You can probably install GNOME from your distribution's repository or software center. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/linux-file-manager-gnome + +作者:[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/2022-10/gnome-files.webp +[2]: https://opensource.com/sites/default/files/2022-10/gnome-files-toolbar.webp +[3]: https://opensource.com/sites/default/files/2022-10/gnome-files-connect.webp +[4]: https://opensource.com/article/21/4/share-files-linux-windows +[5]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd +[6]: https://opensource.com/article/21/9/linux-find-command +[7]: https://www.redhat.com/sysadmin/how-to-use-grep +[8]: http://linnk-to-pcmanfm-article +[9]: http://link-to-article diff --git a/sources/tech/20221218.0 ⭐️⭐️ Use my Groovy color wheel calculator.md b/sources/tech/20221218.0 ⭐️⭐️ Use my Groovy color wheel calculator.md new file mode 100644 index 0000000000..8b00c4240f --- /dev/null +++ b/sources/tech/20221218.0 ⭐️⭐️ Use my Groovy color wheel calculator.md @@ -0,0 +1,384 @@ +[#]: subject: "Use my Groovy color wheel calculator" +[#]: via: "https://opensource.com/article/22/12/groovy-color-wheel" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Use my Groovy color wheel calculator +====== + +Every so often, I find myself needing to calculate complementary colors. For example, I might be making a line graph in a web app or bar graphs for a report. When this happens, I want to use complementary colors to have the maximum "visual difference" between the lines or bars. + +Online calculators can be useful in calculating two or maybe three complementary colors, but sometimes I need a lot more–for instance, maybe 10 or 15. + +Many online resources explain how to do this and offer formulas, but I think it's high time for a Groovy color calculator. So please follow along. First, you might need to install Java and Groovy. + +### Install Java and Groovy + +Groovy is based on Java and requires a Java installation as well. Both a recent/decent version of Java and Groovy might be in your Linux distribution's repositories. Or you can install Groovy by following the instructions on the above link. + +A nice alternative for Linux users is [SDKMan][1], which can get multiple versions of Java, Groovy, and many other related tools. For this article, I'm using SDK's releases of: + +- Java: version 11.0.12-open of OpenJDK 11 +- Groovy: version 3.0.8 + +### Using a color wheel + +Before you start coding, look at a real color wheel. If you open [GIMP (the GNU Image Manipulation Program)][2] and look on the upper left-hand part of the screen, you'll see the controls to set the foreground and background colors, circled in red on the image below: + +![Controls to set foreground and background colors][3] + +If you click on the upper left square (the foreground color), a window will open that looks like this: + +![Set foreground color][4] + +If it doesn't quite look like that, click on the fourth from the left button on the top left row, which looks like a circle with a triangle inscribed in it. + +The ring around the triangle represents a nearly continuous range of colors. In the image above, starting from the triangle pointer (the black line that interrupts the circle on the left), the colors shade from blue into cyan into green, yellow, orange, red, magenta, violet, and back to blue. This is the color wheel. If you pick two colors opposite each other on that wheel, you will have two complementary colors. If you choose 17 colors evenly spaced around that wheel, you'll have 17 colors that are as distinct as possible. + +Make sure you have selected the **HSV** button in the top right of the window, then look at the sliders marked H, S, and V, respectively. These are **h**ue, **s**aturation, and **v**alue. When choosing contrasting colors, the hue is the interesting parameter. + +Its value runs from zero to 360 degrees; in the image above, it's 192.9 degrees. + +You can use this color wheel to calculate the complementary color to another manually–just add 180 to your color's value, giving you 372.9. Next, subtract 360, leaving 17.9 degrees. Type that 17.9 into the **H** box, replacing the 192.9, and poof, you have its complementary color: + +![Change foreground color][5] + +If you inspect the text box labeled **HTML notation** you'll see that the color you started with was **#0080a3,** and its complement is **#a33100**. Look at the fields marked **Current** and **Old** to see the two colors complementing each other. + +There is a most excellent and detailed [article on Wikipedia explaining HSL (hue, saturation, and lightness) and HSV (hue, saturation, and value) color models][6] and how to convert between them and the RGB standard most of us know. + +I'll automate this in Groovy. Because you might want to use this in various ways, create a **Color** class that provides constructors to create an instance of Color and then several methods to query the color of the instance in HSV and RGB. + +Here's the **Color** class, with an explanation following: + +``` +     1  /** +     2   *  This class based on the color transformation calculations +     3   *  in https://en.wikipedia.org/wiki/HSL_and_HSV +     4   * +     5   *  Once an instance of Color is created, it can be transformed +     6   *  between RGB triplets and HSV triplets and converted to and +     7   *  from hex codes. +     8   */ +        +     9  public class Color { +        +    10      /** +    11       * May as well keep the color as both RGB and HSL triplets +    12       * Keep each component as double to avoid as many rounding +    13       * errors as possible. +    14       */ +        +    15      private final Map rgb // keys 'r','g','b'; values 0-1,0-1,0-1 double +    16      private final Map hsv // keys 'h','s','v'; values 0-360,0-1,0-1 double +        +    17      /** +    18       * If constructor provided a single int, treat it as a 24-bit RGB representation +    19       * Throw exception if not a reasonable unsigned 24 bit value +    20       */ +        +    21      public Color(int color) { +    22          if (color < 0 || color > 0xffffff) { +    23              throw new IllegalArgumentException('color value must be between 0x000000 and 0xffffff') +    24          } else { +    25              this.rgb = [r: ((color & 0xff0000) >> 16) / 255d, g: ((color & 0x00ff00) >> 8) / 255d, b: (color & 0x0000ff) / 255d] +    26              this.hsv = rgb2hsv(this.rgb) +    27          } +    28      } +        +    29      /** +    30       * If constructor provided a Map, treat it as: +    31       * - RGB if map keys are 'r','g','b' +    32       *   - Integer and in range 0-255 ⇒ scale +    33       *   - Double and in range 0-1 ⇒ use as is +    34       * - HSV if map keys are 'h','s','v' +    35       *   - Integer and in range 0-360,0-100,0-100 ⇒ scale +    36       *   - Double and in range 0-360,0-1,0-1 ⇒ use as is +    37       * Throw exception if not according to above +    38       */ +        +    39      public Color(Map triplet) { +    40          def keySet = triplet.keySet() +    41          def types = triplet.values().collect { it.class } +    42          if (keySet == ['r','g','b'] as Set) { +    43              def minV = triplet.min { it.value }.value +    44              def maxV = triplet.max { it.value }.value +    45              if (types == [Integer,Integer,Integer] && 0 <= minV && maxV <= 255) { +    46                  this.rgb = [r: triplet.r / 255d, g: triplet.g / 255d, b: triplet.b / 255d] +    47                  this.hsv = rgb2hsv(this.rgb) +    48              } else if (types == [Double,Double,Double] && 0d <= minV && maxV <= 1d) { +    49                  this.rgb = triplet +    50                  this.hsv = rgb2hsv(this.rgb) +    51              } else { +    52                  throw new IllegalArgumentException('rgb triplet must have integer values between (0,0,0) and (255,255,255) or double values between (0,0,0) and (1,1,1)') +    53              } +    54          } else if (keySet == ['h','s','v'] as Set) { +    55              if (types == [Integer,Integer,Integer] && 0 <= triplet.h && triplet.h <= 360 +    56              && 0 <= triplet.s && triplet.s <= 100 && 0 <= triplet.v && triplet.v <= 100) { +    57                  this.hsv = [h: triplet.h as Double, s: triplet.s / 100d, v: triplet.v / 100d] +    58                  this.rgb = hsv2rgb(this.hsv) +    59              } else if (types == [Double,Double,Double] && 0d <= triplet.h && triplet.h <= 360d +    60              && 0d <= triplet.s && triplet.s <= 1d && 0d <= triplet.v && triplet.v <= 1d) { +    61                  this.hsv = triplet +    62                  this.rgb = hsv2rgb(this.hsv) +    63              } else { +    64                  throw new IllegalArgumentException('hsv triplet must have integer values between (0,0,0) and (360,100,100) or double values between (0,0,0) and (360,1,1)') +    65              } +    66          } else { +    67              throw new IllegalArgumentException('triplet must be a map with keys r,g,b or h,s,v') +    68          } +    69      } +        +    70      /** +    71       * Get the color representation as a 24 bit integer which can be +    72       * rendered in hex in the familiar HTML form. +    73       */ +        +    74      public int getHex() { +    75          (Math.round(this.rgb.r * 255d) << 16) + +    76          (Math.round(this.rgb.g * 255d) << 8) + +    77          Math.round(this.rgb.b * 255d) +    78      } +        +    79      /** +    80       * Get the color representation as a map with keys r,g,b +    81       * and the corresponding double values in the range 0-1 +    82       */ +        +    83      public Map getRgb() { +    84          this.rgb +    85      } +        +    86      /** +    87       * Get the color representation as a map with keys r,g,b +    88       * and the corresponding int values in the range 0-255 +    89       */ +        +    90      public Map getRgbI() { +    91          this.rgb.collectEntries {k, v -> [(k): Math.round(v*255d)]} +    92      } +        +    93      /** +    94       * Get the color representation as a map with keys h,s,v +    95       * and the corresponding double values in the ranges 0-360,0-1,0-1 +    96       */ +        +    97      public Map getHsv() { +    98          this.hsv +    99      } +        +   100      /** +   101       * Get the color representation as a map with keys h,s,v +   102       * and the corresponding int values in the ranges 0-360,0-100,0-100 +   103       */ +        +   104      public Map getHsvI() { +   105          [h: Math.round(this.hsv.h), s: Math.round(this.hsv.s*100d), v: Math.round(this.hsv.v*100d)] +   106      } +        +   107      /** +   108       * Internal routine to convert an RGB triple to an HSV triple +   109       * Follows the Wikipedia section https://en.wikipedia.org/wiki/HSL_and_HSV#Hue_and_chroma +   110       * (almost) - note that the algorithm given there does not adjust H for G < B +   111       */ +        +   112      private static def rgb2hsv(Map rgbTriplet) { +   113          def max = rgbTriplet.max { it.value } +   114          def min = rgbTriplet.min { it.value } +   115          double c = max.value - min.value +   116          if (c) { +   117              double h +   118              switch (max.key) { +   119              case 'r': h = ((60d * (rgbTriplet.g - rgbTriplet.b) / c) + 360d) % 360d; break +   120              case 'g': h = ((60d * (rgbTriplet.b - rgbTriplet.r) / c) + 120d) % 360d; break +   121              case 'b': h = ((60d * (rgbTriplet.r - rgbTriplet.g) / c) + 240d) % 360d; break +   122              } +   123              double v = max.value // hexcone model +   124              double s = max.value ? c / max.value : 0d +   125              [h: h, s: s, v: v] +   126          } else { +   127              [h: 0d, s: 0d, v: 0d] +   128          } +   129      } +        +   130      /** +   131       * Internal routine to convert an HSV triple to an RGB triple +   132       * Follows the Wikipedia section https://en.wikipedia.org/wiki/HSL_and_HSV#HSV_to_RGB +   133       */ +        +   134      private static def hsv2rgb(Map hsvTriplet) { +   135          double c = hsvTriplet.v * hsvTriplet.s +   136          double hp = hsvTriplet.h / 60d +   137          double x = c * (1d - Math.abs(hp % 2d - 1d)) +   138          double m = hsvTriplet.v - c +   139          if (hp < 1d)      [r: c  + m, g: x  + m, b: 0d + m] +   140          else if (hp < 2d) [r: x  + m, g: c  + m, b: 0d + m] +   141          else if (hp < 3d) [r: 0d + m, g: c  + m, b: x  + m] +   142          else if (hp < 4d) [r: 0d + m, g: x  + m, b: c  + m] +   143          else if (hp < 5d) [r: x  + m, g: 0d + m, b: c  + m] +   144          else if (hp < 6d) [r: c  + m, g: 0d + m, b: x  + m] +   145      } +        +   146  } +``` + +The **Color** class definition, which begins on line 9 and ends on line 146, looks a lot like a Java class definition (at first glance, anyway) that would do the same thing. But this is Groovy, so you have no imports up at the beginning, just comments. Plus, the details illustrate some more Groovyness. + +Line 15 creates the private final variable **rgb** that contains the color value supplied to the class constructor. You'll keep this value as **Map** with keys `r`, `g`, and `b` to access the RGB values. Keep the values as double values between 0 and 1 so that 0 would indicate a hexadecimal value of **#00** or an integer value of 0 and 1 would mean a hexadecimal value of **#ff** or an integer value of 255. Use double to avoid accumulating rounding errors when converting inside the class. + +Similarly, line 16 creates the private final variable **hsv** that contains the same color value but in HSV format–also a **Map**, but with keys `h`, `s`, and `v` to access the HSV values, which will be kept as double values between 0 and 360 (hue) and 0 and 1 (saturation and value). + +Lines 21-28 define a **Color** constructor to be called when passing in an int argument. For example, you might use this as: + +``` +def blue = new Color(0x0000ff) +``` + +- On lines 22-23, check to make sure the argument passed to the constructor is in the allowable range for a 24-bit integer RGB constructor, and throw an exception if not. +- On line 25, initialize the **rgb** private variable as the desired RGB Map, using bit shifts and dividing each by a double value 255 to scale the numbers between 0 and 1. +- On line 26, convert the RGB triplet to HSV and assign it to the **hsv** private variable. + +Lines 39-69 define another **Color** constructor to be called when passing in either an RGB or HSV triple as a **Map**. You might use this as: + +``` +def green = new Color([r: 0, g: 255, b: 0]) +``` + +or + +``` +def cyan = new Color([h: 180, s: 100, v: 100]) +``` + +Or similarly with double values scaled between 0 and 1 instead of integers between 0 and 255 in the RGB case and between 0 and 360, 0 and 1, and 0 and 1 for hue, saturation, and value, respectively. + +This constructor looks complicated, and in a way, it is. It checks the **keySet()** of the map argument to decide whether it denotes an RGB or HSV tuple. It checks the class of the values passed in to determine whether the values are to be interpreted as integers or double values and, therefore, whether they are scaled into 0-1 (or 0-360 for hue). + +Arguments that can't be sorted out using this checking are deemed incorrect, and an exception is thrown. + +Worth noting is the handy streamlining provided by Groovy: + +``` +def types = triplet.values().collect { it.class } +``` + +This uses the **values()** method on the map to get the values as a **List** and then the **collect()** method on that **List** to get the class of each value so that they can later be checked against **[Integer,Integer,Integer]** or **[Double,Double,Double]** to ensure that arguments meet expectations. + +Here is another useful streamlining provided by Groovy: + +``` +def minV = triplet.min { it.value }.value +``` + +The **min()** method is defined on **Map**; it iterates over the **Map** and returns the **MapEntry**—a (key, value) pair—having the minimum value encountered. The **.value** on the end selects the value field from that **MapEntry**, which gives something to check against later to determine whether the values need to be normalized. + +Both rely on the Groovy Closure, similar to a Java lambda–a kind of anonymous procedure defined where it is called. For example, **collect()** takes a single **Closure** argument and passes it to each **MapEntry** encountered, known as the parameter within the closure body. Also, the various implementations of the Groovy Collection interface, including here **Map**, define the **collect()** and **min()** methods that iterate over the elements of the **Collection** and call the **Closure** argument. Finally, the syntax of Groovy supports compact and low-ceremony invocations of these various features. + +Lines 70-106 define five "getters" that return the color used to create the instance in one of five formats: + +- **getHex()** returns an int corresponding to a 24-bit HTML RGB color. +- **getRgb()** returns a **Map** with keys `r`, `g`, `b` and corresponding double values in the range 0-1. +- **getRgbI()** returns a **Map** with keys `r`, `g`, `b` and corresponding int values in the range 0-255. +- **getHsv()** returns a **Map** with keys `h`, `s`, `v` and corresponding double values in the range 0-360, 0-1 and 0-1, respectively. +- **getHsvI()** returns a **Map** with keys `h`, `s`, `v` and corresponding int values in the range 0-360, 0-100 and 0-100, respectively. + +Lines 112-129 define a static private (internal) method **rgb2hsv()** that converts an RGB triplet to an HSV triplet. This follows the algorithm described in the Wikipedia article [section on Hue and chroma][7], except that the algorithm there yields negative hue values when the green value is less than the blue value, so the version is modified slightly. This code isn't particularly Groovy other than using the **max()** and **min()****Map** methods and returning a **Map** instance declaratively without a return statement. + +This method is used by the two getter methods to return the **Color** instance value in the correct form. Since it doesn't refer to any instance fields, it is static. + +Similarly, lines 134-145 define another private (internal) method **hsv2rgb()**, that converts an HSV triplet to an RGB triplet, following the algorithm described in the Wikipedia article [section on HSV to RGB conversion][8]. The constructor uses this method to convert HSV triple arguments into RGB triples. Since it doesn't refer to any instance fields, it is static. + +That's it. Here's an example of how to use this class: + +``` +     1  def favBlue = new Color(0x0080a3) +        +     2  def favBlueRgb = favBlue.rgb +     3  def favBlueHsv = favBlue.hsv +        +     4  println "favBlue hex = ${sprintf('0x%06x',favBlue.hex)}" +     5  println "favBlue rgbt = ${favBlue.rgb}" +     6  println "favBlue hsvt = ${favBlue.hsv}" +        +     7  int spokeCount = 8 +     8  double dd = 360d / spokeCount +     9  double d = favBlue.hsv.h +    10  for (int spoke = 0; spoke < spokeCount; spoke++) { +    11      def color = new Color(h: d, s: favBlue.hsv.s, v: favBlue.hsv.v) +    12      println "spoke $spoke $d° hsv ${color.hsv}" +    13      println "    hex ${sprintf('0x%06x',color.hex)} hsvI ${color.hsvI} rgbI ${color.rgbI}" +    14      d = (d + dd) % 360d +    15  } +``` + +As my starting value, I've chosen the lighter blue from the [opensource.com][9] header **#0080a3**, and I'm printing a set of seven more colors that give maximum separation from the original blue. I call each position going around the color wheel a spoke and compute its position in degrees in the variable **d**, which is incremented each time through the loop by the number of degrees **dd** between each spoke. + +As long as `Color.groovy` and this test script are in the same directory, you can compile and run them as follows: + +``` +$ groovy test1Color.groovy +favBlue hex = 0x0080a3 +favBlue rgbt = [r:0.0, g:0.5019607843137255, b:0.6392156862745098] +favBlue hsvt = [h:192.88343558282207, s:1.0, v:0.6392156862745098] +spoke 0 192.88343558282207° hsv [h:192.88343558282207, s:1.0, v:0.6392156862745098] +    hex 0x0080a3 hsvI [h:193, s:100, v:64] rgbI [r:0, g:128, b:163] +spoke 1 237.88343558282207° hsv [h:237.88343558282207, s:1.0, v:0.6392156862745098] +    hex 0x0006a3 hsvI [h:238, s:100, v:64] rgbI [r:0, g:6, b:163] +spoke 2 282.8834355828221° hsv [h:282.8834355828221, s:1.0, v:0.6392156862745098] +    hex 0x7500a3 hsvI [h:283, s:100, v:64] rgbI [r:117, g:0, b:163] +spoke 3 327.8834355828221° hsv [h:327.8834355828221, s:1.0, v:0.6392156862745098] +    hex 0xa30057 hsvI [h:328, s:100, v:64] rgbI [r:163, g:0, b:87] +spoke 4 12.883435582822074° hsv [h:12.883435582822074, s:1.0, v:0.6392156862745098] +    hex 0xa32300 hsvI [h:13, s:100, v:64] rgbI [r:163, g:35, b:0] +spoke 5 57.883435582822074° hsv [h:57.883435582822074, s:1.0, v:0.6392156862745098] +    hex 0xa39d00 hsvI [h:58, s:100, v:64] rgbI [r:163, g:157, b:0] +spoke 6 102.88343558282207° hsv [h:102.88343558282207, s:1.0, v:0.6392156862745098] +    hex 0x2fa300 hsvI [h:103, s:100, v:64] rgbI [r:47, g:163, b:0] +spoke 7 147.88343558282207° hsv [h:147.88343558282207, s:1.0, v:0.6392156862745098] +    hex 0x00a34c hsvI [h:148, s:100, v:64] rgbI [r:0, g:163, b:76] +``` + +You can see the degree position of the spokes reflected in the HSV triple. I've also printed the hex RGB value and the int version of the RGB and HSV triples. + +I could have built this in Java. Had I done so, I probably would have created separate **RgbTriple** and **HsvTriple** helper classes because Java doesn't provide the declarative syntax for **Map**. That would have made finding the min and max values more verbose. So, as usual, the Java would have been more lengthy without improving readability. There would have been three constructors, though, which might be a more straightforward proposition. + +I could have used 0-1 for the hue as I did for saturation and value, but somehow I like 0-360 better. + +Finally, I could have added–and I may still do so one day–other conversions, such as HSL. + +### Wrap up + +Color wheels are useful in many situations and building one in Groovy is a great exercise to learn both how the wheel works and the, well, grooviness of Groovy. Take your time; the code above is long. However, you can build your own practical color calculator and learn a lot along the way. + +#### Groovy resources + +The Apache Groovy language site provides [a good tutorial-level overview][10] of working with Collection, particularly Map classes. This documentation is quite concise and easy to follow, at least partly because the facility it is documenting has been designed to be itself concise and easy to use! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/groovy-color-wheel + +作者:[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://sdkman.io/ +[2]: https://www.gimp.org/ +[3]: https://opensource.com/sites/default/files/2022-12/1controls.png +[4]: https://opensource.com/sites/default/files/2022-12/2foregroundcolor.png +[5]: https://opensource.com/sites/default/files/2022-12/3changeforegroundcolor_0.png +[6]: https://en.wikipedia.org/wiki/HSL_and_HSV +[7]: https://en.wikipedia.org/wiki/HSL_and_HSV#Hue_and_chroma +[8]: https://en.wikipedia.org/wiki/HSL_and_HSV#HSV_to_RGB +[9]: https://opensource.com/ +[10]: https://groovy-lang.org/databases.html + diff --git a/sources/tech/20221219.0 ⭐️⭐️ Use Rexx for scripting in 2023.md b/sources/tech/20221219.0 ⭐️⭐️ Use Rexx for scripting in 2023.md new file mode 100644 index 0000000000..6ede79a4bf --- /dev/null +++ b/sources/tech/20221219.0 ⭐️⭐️ Use Rexx for scripting in 2023.md @@ -0,0 +1,169 @@ +[#]: subject: "Use Rexx for scripting in 2023" +[#]: via: "https://opensource.com/article/22/12/rexx-scripting" +[#]: author: "Howard Fosdick https://opensource.com/users/howtech" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Use Rexx for scripting in 2023 +====== + +In a [previous article][1], I showed how the Rexx scripting language is both powerful and easy to use. It uses specific techniques to reconcile these two goals that are often considered in conflict. + +This article walks you through two example Rexx scripts so you can get a feel for the language. Rexx purports to be highly capable yet easy to work with. + +### An example of a Rexx script + +The [LISP programming language][2] is famous for its overuse of parentheses. It can be a real challenge for programmers to ensure they're all matched up correctly. + +This short script reads a line of LISP code from the user and determines whether the parentheses in the input are properly matched. If the parentheses aren't properly balanced, the program displays a syntax error. + +Below are three sample interactions with the program. In the first, the LISP code I entered was correctly typed. But the next two contain mismatched parentheses that the Rexx script identifies: + +``` +Enter a line to analyze: +(SECOND (LAMBDA (LIS) (FIRST (CDR LIS)) )) +Parentheses are balanced + +Enter a line to analyze: +((EQSTR (CAR LIS1) (CAR LIS2)) +Syntax error: too many left parens, not balanced + +Enter a line to analyze: +(EQSTR (CAR LIS1) CAR LIS2)) +Syntax error: right paren before or without left paren +``` + +Here's the Rexx program: + +``` +counter = 0 /* counts parentheses */ + +say 'Enter a line to analyze:' /* prompts user for input */ +pull input_string /* reads line of user input */ + +length_of_string = length(input_string) + +/* process each character of the input line, one at a time */ + +do j = 1 to length_of_string while counter >= 0 + + character = substr(input_string,j,1) + if character = '(' then counter = counter + 1 + if character = ')' then counter = counter - 1 + +end + +/* display the appropriate message to the user */ + +if counter = 0 then + say 'Parentheses are balanced' +else if counter < 0 then + say 'Syntax error: right paren before or without left paren' +else + say 'Syntax error: too many left parens, not balanced' +``` + +First, the program prompts the user to enter a line of input with the `say` instruction. Then it reads it with a `pull` instruction. + +`The say` and `pull`  instructions are used for conversational input/output, or direct interaction with users. Rexx also supports character-oriented and line- or record- oriented I/O. + +Next, the script uses the `length` function to place the length of the input line into the variable `length_of_string`. + +The `do` loop processes each character from the input line, one at a time. It increments the `counter` each time it encounters a left parenthesis, and decrements it each time it recognizes a right parenthesis. + +If the `counter` ends up as zero after processing the entire input line, the program knows that any parentheses in the input line match up correctly. If the `counter` is not 0 after processing, the input line has mismatched parentheses. + +The final `if` statements display the proper message to the user. One could code these `if` statements in any number of styles, as per individual preference. (The main requirement is that whenever multiple statements are coded within a branch, they must be enclosed in a `do...end` group.) + +This program shows that Rexx is free-form and case-insensitive. It does not rely on reserved words, so you're free to use common words like `counter` or `character` to represent variables. + +The one key requirement Rexx does impose is that any function must immediately be followed by a left parenthesis. Examples in the program are the `length` and `substr` functions. Put a space between a function name and its following parenthesis, and Rexx won't recognize the function. + +Outside of a few minimal requirements like these, Rexx requires very little from the programmer in terms of syntax, special characters, or restrictive coding rules. + +Rexx programs look and read like pseudo-code. This makes them relatively easy to read and work with. + +### A real-world example of a Rexx script + +Here's a program from the real world: + +Les Koehler, a Rexx user, had a legacy accounting program that matched accounting records on hand against those that a vendor sent to him daily. The legacy program ran for several hours every day to process 25,000 records. It employed a sequential "walk the list" technique to match one set of records against the other. + +Les replaced the legacy program with a Rexx script. The Rexx script performs matching by using associative arrays: + +``` +/* Create an associative array reflecting */ +/* the values in the first list of names */ +/* by Les Koehler */ + +flag. = 0 /* Create array, set all items to 0 */ +do a = 1 to list_a.0 /* Process all existing records */ + aa = strip(list_a.a) /* Strip preceding/trailing blanks */ + flag.aa = 1 /* Mark each record with a 1 */ +end + +/* Try to match names in the second list */ +/* against those in the associative array */ + +m = 0 /* M counts number of missing names */ +do b = 1 to list_b.0 /* Look for matching name from LIST_B */ + bb = strip(list_b.b) /* Put LIST_B name into variable BB */ + if \ flag.bb then do /* If name isn't in FLAG array */ + m = m+1 /* add 1 to count of missing names */ + missing.m = bb /* add missing name to MISSING array */ + end +end + +missing.0 = m /* Save the count of unmatched names */ +``` + +Les was able to reduce processing time from several hours down to a matter of seconds. + +The first line of code (`flag. = 0`) creates a new array called `flag` and initializes every element in that array to `0`. + +The array `list_a` contains all the existing accounting records. Its first element (`list_a.0`) by convention contains the number of elements in the array. + +So the first `do` loop processes all elements in the array of existing records (`list_a`) and marks each of them as existing in the `flag` array. The statement `flag.aa = 1` marks the content-addressable item in the `flag` array as present. + +The second `do` loop peddles through each item in the set of new records, contained in the array called `list_b`. + +The `if` statement checks whether an item from the second array of records is marked present in the `flag` array. If not, the program increments the number of items present in the new list of accounting records that do not exist in the old list of records. And it puts the missing item into the `missing` array: `missing.m = bb`. + +The final statement (`missing.0 = m`) simply updates the number of items in the `missing` array, by convention stored in array position 0. + +### Rexx improvements + +Why is this Rexx program so fast compared to the legacy code it replaces? First, the associative arrays allow direct lookup of a new record against the old records. Direct access is much faster than the sequential "walk-the-list" technique it replaced. + +Secondly, all the array elements reside in memory. Once the files of the old and new accounting records have been initialized into the Rexx arrays, no further disk I/O is needed. Disk I/O is always orders of magnitude slower than memory access. + +A Rexx array expands as much as memory allows. This script takes advantage of modern computers with seemingly endless amounts of RAM, and frees the programmer from managing memory. + +### Conclusion + +I hope these two simple programs have shown how easy Rexx is to read, write, and maintain. Rexx is designed to put the burden of programming on the machine instead of the programmer. Yet the language still has plenty of power, due to the design techniques I've described in this series of articles. + +For free Rexx downloads, tools, tutorials, and more, visit [RexxInfo.org][3]. You can join the [Rexx Language Association][4] for free. + +_This article is dedicated to the memory of Les Koehler, who was active with Rexx and the Rexx community since their very earliest days._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/rexx-scripting + +作者:[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/article/22/10/rexx-scripting-language +[2]: https://opensource.com/article/21/5/learn-lisp +[3]: http://www.RexxInfo.org +[4]: http://www.RexxLA.org diff --git a/sources/tech/20221219.1 ⭐️⭐️ How I use my old camera as a webcam with Linux.md b/sources/tech/20221219.1 ⭐️⭐️ How I use my old camera as a webcam with Linux.md new file mode 100644 index 0000000000..51a20186e9 --- /dev/null +++ b/sources/tech/20221219.1 ⭐️⭐️ How I use my old camera as a webcam with Linux.md @@ -0,0 +1,260 @@ +[#]: 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: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I use my old camera as a webcam with Linux +====== + +This year after largely abandoning my MacBook in favor of a NixOS machine, I started getting requests to "turn my camera on" when video calling people. This was a problem because I didn't have a webcam. I thought about buying one, but then I realized I had a perfectly good Canon EOS Rebel XS DSLR from 2008 lying around on my shelf. This camera has a mini-USB port, so naturally, I pondered: Did a DSLR, mini-USB port, and a desktop PC mean I could have a webcam? + +There's just one problem. My Canon EOS Rebel XS isn't capable of recording video. It can take some nice pictures, but that's about it. So that's the end of that. + +Or is it? + +There happens to be some amazing open source software called [gphoto2][1]. Once installed, it allows you to control various supported cameras from your computer and it takes photos and videos. + +### Supported cameras + +First, find out whether yours is supported: + +``` +$ gphoto2 --list-cameras +``` + +### Capture an image + +You can take a picture with it: + +``` +$ gphoto2 --capture-image-and-download +``` + +The shutter activates, and the image is saved to your current working directory. + +### Capture video + +I sensed the potential here, so despite the aforementioned lack of video functionality on my camera, I decided to try `gphoto2 --capture-movie`. Somehow, although my camera does not support video natively, gphoto2 still manages to spit out an MJPEG file! + +On my camera, I need to put it in "live-view" mode before gphoto2 records video. This consists of setting the camera to portrait mode and then pressing the **Set** button so that the viewfinder is off and the camera screen displays an image. Unfortunately, though, this isn't enough to be able to use it as a webcam. It still needs to get assigned a video device, such as `/dev/video0`. + +### Install ffmpeg and v4l2loopback + +Not surprisingly, there's an open source solution to this problem. First, use your package manager to install `gphoto2`, `ffmpeg`, and `mpv`. For example, on Fedora, CentOS, Mageia, and similar: + +``` +$ sudo dnf install gphoto2 ffmpeg mpv +``` + +On Debian, Linux Mint, and similar: + +``` +$ sudo apt install gphoto2 ffmpeg mpv +``` + +I use NixOS, so here's my configuration: + +``` +# configuration.nix +... +environment.systemPackages = with pkgs; [ +  ffmpeg +  gphoto2 +  mpv +... +``` + +Creating a virtual video device requires the `v4l2loopback` Linux kernel module. At the time of this writing, that capability is not included in the mainline kernel, so you must download and compile it yourself: + +``` +$ git clone https://github.com/umlaeute/v4l2loopback +$ cd v4l2loopback +$ make +$ sudo make install +$ sudo depmod -a +``` + +If you're using NixOS like me, you can just add the extra module package in `configuration.nix`: + +``` +[...] +boot.extraModulePackages = with config.boot.kernelPackages; +[ v4l2loopback.out ]; +boot.kernelModules = [ +  "v4l2loopback" +]; +boot.extraModprobeConfig = '' +  options v4l2loopback exclusive_caps=1 card_label="Virtual Camera" +''; +[...] +``` + +On NixOS, run `sudo nixos-rebuild switch` and then reboot. + +### Create a video device + +Assuming your computer currently has no `/dev/video` device, you can create one on demand thanks to the `v4l2loopback`. + +Run this command to send data from `gphoto2` to `ffmpeg`, using a device such as `/dev/video0` device: + +``` +$ gphoto2 --stdout --capture-movie | + ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -f v4l2 /dev/video0 +``` + +You get output like this: + +``` +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 +``` + +To see the video feed from your webcam, use `mpv`: + +``` +$ mpv av://v4l2:/dev/video0 --profile=low-latency --untimed +``` + +![Streaming a live feed from the webcam][2] + +### Start your webcam automatically + +It's a bit annoying to execute a command every time you want to use your webcam. Luckily, you can run this command automatically at startup. I implement it as a `systemd` service: + +``` +# 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" ]; +  }; +... +``` + +On NixOS, run `sudo nixos-rebuild switch` and then reboot your computer. Your webcam is on and active. + +To check for any problems, you can use `systemctl status webcam`. This tells you the last time the service was run and provides a log of its previous output. It's useful for debugging. + +### Iterating to make it better + +It's tempting to stop here. However, considering the current global crises, it may be pertinent to wonder whether it's necessary to have a webcam on all the time. It strikes me as sub-optimal for two reasons: + +- It's a waste of electricity. +- There are privacy concerns associated with this kind of thing. + +My camera has a lens cap, so to be honest, the second point doesn't really bother me. I can always put the lens cap on when I'm not using the webcam. However, leaving a big power-hungry DSLR camera on all day (not to mention the CPU overhead required for decoding the video) isn't doing anything for my electricity bill. + +The ideal scenario: + +- I leave my camera plugged in to my computer all the time but switched off. +- When I want to use the webcam, I switch on the camera with its power button. +- My computer detects the camera and starts the systemd service. +- After finishing with the webcam, I switch it off again. + +To achieve this, you need to use a custom [udev rule][3]. + +A udev rule tells your computer to perform a certain task when it discovers that a device has become available. This could be an external hard drive or even a non-USB device. In this case, you need it to [recognize the camera through its USB connection][4]. + +First, specify what command to run when the udev rule is triggered. You can do that as a shell script (`systemctl restart webcam` should work). I run NixOS, so I just create a derivation (a Nix package) that restarts the systemd service: + +``` +# 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'' +``` + +Next, actually define the udev rule. Find the device and vendor ID of the camera. Do this by using the `lsusb` command. That command is likely already installed on your distribution, but I don't use it often, so I just install it as needed using `nix-shell`: + +``` +$ nix-shell -p usbutils +``` + +Whether you already have it on your computer or you've just installed it, run `lsusb`: + +``` +$ lsusb +Bus 002 Device 008: ID 04a9:317b Canon, Inc. Canon Digital Camera[...] +``` + +In this output, the vendor ID is 04a9 and the device ID is 317b. That's enough to create the udev rule: + +``` +ACTION=="add", SUBSYSTEM=="usb", +ATTR{idVendor}=="04a9", +ATTR{idProduct}=="317b", +RUN+="/usr/local/bin/start-webcam.sh" +``` + +Alternatively, if you're using 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"'';[...] +``` + +Finally, remove the **wantedBy = ["multi-user.target"];** line in your `start-webcam` systemd service. (If you leave it, then the service starts automatically when you next reboot, whether the camera is switched on or not.) + +### Reuse old technology + +I hope this article has made you think twice before chucking some of your old tech. Linux can breathe life back into technology, whether it's your [computer][5] or something simple like a digital camera or some other peripheral. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/old-camera-webcam-linux + +作者:[Tom Oliver][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/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 + diff --git a/sources/tech/20221220.0 ⭐️⭐️ Writing a Macro in LibreOffice Calc Getting Started.md b/sources/tech/20221220.0 ⭐️⭐️ Writing a Macro in LibreOffice Calc Getting Started.md new file mode 100644 index 0000000000..9ae1c0d10f --- /dev/null +++ b/sources/tech/20221220.0 ⭐️⭐️ Writing a Macro in LibreOffice Calc Getting Started.md @@ -0,0 +1,144 @@ +[#]: subject: "Writing a Macro in LibreOffice Calc: Getting Started" +[#]: via: "https://www.debugpoint.com/writing-a-macro-in-libreoffice-calc-getting-started/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Writing a Macro in LibreOffice Calc: Getting Started +====== + +**Planning to automate stuff in LibreOffice? Start writing your first LibreOffice Calc macro using this guide.** + +LibreOffice provides a way to write your macro to automate various repetitive tasks in your office application. You can use Python or basic for your macro development. This tutorial focuses on writing a macro in LibreOffice with a ‘Hello World’ macro in the Basic programming language. + +### Write your first macro in LibreOffice Calc + +### Macro Objective + +We are going to create a macro that would put the string ‘Hello World’ in the first cell of LibreOffice calc, i.e. the cell of row 1 and col A. + +### Creating the Macro + +- Open LibreOffice Calc from `Applications => Office => LibreOffice Calc`. + +![LibreOffice_1][1] + +- Go to the option from the menu: `Tools ==> Macros ==> Organize Macros ==> LibreOffice Basic`. Below ‘LibreOffice basic macros’ window will open. + +![LibreOffice_2][2] + +- Give your desired name in the macro name box and click New. You can use any name you want. For this tutorial, I have used hello_world. + +![LibreOffice_3][3] + +- Once you have clicked the New button, the macro editor will open. Here are some things to note in this window. This is the place where you should be writing your code, debugging your code, etc. You can see the macro’s name became the function name of your basic macro. + +![LibreOffice_4][4] + +- Now, it’s time to code the first macro. Let’s declare two variables of type objects. + +``` +dim document as object dim dispatcher as object +``` + +- Let’s assign two values to the above variables. + +``` +document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") +``` + +`ThisComponent` refers to the current document. + +In LibreOffice, everything you do, e.g. type, colour, insert, is “watched” by a controller. The controller then dispatches the changes to the document frame, i.e. the main window area of the Calc. So the document variable refers to the main area of Calc. + +The `createUnoService` creates an instance of the `DispatchHelper` service. This service will help us to dispatch the tasks from the macro to the frame. Almost all LibreOffice macro tasks can be executed using the dispatcher. + +- Now we will declare an array of properties. Properties are always in a name/value pair. Thus the name contains the property name, and the value contains the value of that property. + +``` +dim args1(0) as new com.sun.star.beans.PropertyValue +``` + +Our objective is to put ‘Hello World’ in the first Cell. To point to the first cell A1 and put a text, we would use two properties – `ToPoint` and `StringName`. + +Once we set the properties, it’s time to call the dispatch to send these to the document. So call the `executeDispatch` event of the dispatcher using two commands: `.uno:GoToCell`, and `.uno:EnterString`. + +``` +dim args2(0) as new com.sun.star.beans.PropertyValueargs1(0).Name = "ToPoint" args1(0).Value = "$A$1" args2(0).Name = "StringName" args2(0).Value = "Hello World!" +``` + +These commands tell the frame what needs to be executed and also pass the entire property array with values. + +![LibreOffice_5][5] + +Now put a message box to notify when the execution is completed. + +### Running the Macro + +- It’s time to run the macro. To run the macro, press `F5` or click Run Macro from the toolbar (see above). +- After execution, the message box would pop up. If you go back and check the Calc spreadsheet, you should see ‘Hello World!’ written in the first Cell. + +![LibreOffice_6][6] + +![LibreOffice_7][7] + +### Complete Code + +``` +REM ***** BASIC ***** +sub hello_world + + dim document as object + dim dispatcher as object + + document = ThisComponent.CurrentController.Frame + dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") + + dim args1(0) as new com.sun.star.beans.PropertyValue + dim args2(0) as new com.sun.star.beans.PropertyValue + + args1(0).Name = "ToPoint" + args1(0).Value = "$A$1" + dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1()) + + args2(0).Name = "StringName" + args2(0).Value = "Hello World!" + dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args2()) + + msgbox "Completed!" +end sub +``` + +### Looking for Something Else? + +If you are looking for more LibreOffice macro tutorials Or wants to learn more about it, please follow the below link for a complete Macro Tutorials Index: + +[Macro tutorial index][8] + +[Next:How to Find Out Ubuntu Version: 6 Methods][9] + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/writing-a-macro-in-libreoffice-calc-getting-started/ + +作者:[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/2015/02/LibreOffice_1_p.png +[2]: https://www.debugpoint.com/wp-content/uploads/2015/02/LibreOffice_2_p.png +[3]: https://www.debugpoint.com/wp-content/uploads/2015/02/LibreOffice_3_p.png +[4]: https://www.debugpoint.com/wp-content/uploads/2015/02/LibreOffice_4_p.png +[5]: https://www.debugpoint.com/wp-content/uploads/2015/02/LibreOffice_5_p.png +[6]: https://www.debugpoint.com/wp-content/uploads/2014/09/LibreOffice_6.png +[7]: https://www.debugpoint.com/wp-content/uploads/2015/02/LibreOffice_7_p.png +[8]: http://www.debugpoint.com/libreoffice-basic-macro-tutorial-index/ +[9]: https://www.debugpoint.com/find-ubuntu-version/ diff --git a/sources/tech/20221220.3 ⭐️⭐️ Explore the features of the Linux Double Commander file manager.md b/sources/tech/20221220.3 ⭐️⭐️ Explore the features of the Linux Double Commander file manager.md new file mode 100644 index 0000000000..94d236bf17 --- /dev/null +++ b/sources/tech/20221220.3 ⭐️⭐️ Explore the features of the Linux Double Commander file manager.md @@ -0,0 +1,99 @@ +[#]: subject: "Explore the features of the Linux Double Commander file manager" +[#]: via: "https://opensource.com/article/22/12/linux-file-manager-double-commander" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Explore the features of the Linux Double Commander file manager +====== + +Double Commander is a graphical dual-pane file manager for Linux, in the tradition of [Midnight Commander][1] (`mc`). While Midnight Commander (like the DOS application **Norton Commander** before it) has its fans, its audience is limited by the fact that it only runs in a terminal window. Not everyone wants to use a "flat" interface embedded in a terminal to browse their file system, and so Double Commander provides a similar interface in a way that feels familiar to many desktop users. + +![Image of Double Commander's 2 panel view.][2] + +### Install Double Commander + +To install Double Commander, visit its [website][3] and download [a package][4]. It's not packaged for a specific Linux distribution, so just download an archive for your CPU architecture. + +If you only want to try it out, you can unarchive it and then launch it from your Downloads folder. + +To install it permanently, unarchive the package, move it into a location [in your path][5], and then symlink `doublecmd` to the executable in the source directory: + +``` +$ tar xvf doublecmd*tar.xz +$ mv doublecmd ~/.local/bin/doublecmd-X.Y.Z +$ ln -s ~/.local/bin/doublecmd-X.Y.Z/doublecmd ~~/.local/bin/doublecmd +``` + +### How to start Double Commander + +To start Double Commander, use the command `doublecmd`. + +Alternatively, you can add an entry for Double Commander in your application menu. First, create the file `~/.local/share/applications/doublecmd.desktop` and enter this text into it: + +``` +[Desktop Entry]Encoding=UTF-8Name=doublecmdGenericName=Double CommanderComment=doublecmdExec=../bin/doublecmdIcon=/usr/share/icons//Adwaita/scalable/apps/system-file-manager-symbolic.svgTerminal=falseType=ApplicationCategories=System;FileTools;Utility;Core;GTK;FileManager; +``` + +Now Double Commander appears in your desktop application menu. Note that this does not make Double Commander your default file manager. It only adds it as an application you can launch when you want to. + +### Two panels + +Dual-panel file management is a tradition within a subset of file managers, and to some users it's a little unsettling. If you think about it, though, most file management tasks involve a _source_ location and a _destination_ location. You might be used to a workflow that goes something like this: + +- Open a file manager and find a file you want to move. +- Open another file manager window and navigate to the folder you want to move the file into. +- Drag and drop the file from one window to the other. + +You might use a variation of this involving, for instance, a right-click to copy combined with some navigation and another right-click to paste. Either way, the ingredients are the same. You locate the source, you locate the destination, and then you make the transfer. + +Given that common factor, it makes sense that a file manager like Double Command has a persistent view of the source location and the destination location. At the very least, it saves you from having to open another window. + +### Double Commander interface + +Once you get used to the idea of two concurrent views in your file system, there are a lot more features to discover in Double Commander. + +- **Menu bar**: At the top of the window is a menu bar. That's pretty standard conceptually, but the menu entries are probably unlike any menu bar you've seen before: **File**, **Mark**, **Commands**, **Network**, **Tabs**, and more. These are task-specific menus, which is great because you can ignore an entire submenu you don't use. +- **Toolbar**: Under the menu bar, there are buttons for common tasks such as opening a terminal, copying a file, synchronizing two directories, and more. +- **Locations**: The location bar is situated just under the toolbar. It lists devices and file system locations, including your boot partition, optical media drive, virtual shared locations, the root directory, your home directory (listed as `~`), and more. +- **File list**: Most of the Double Commander window is occupied by the dual panel view of your file system. +- **Command**: My favorite feature of Double Commander is the single command field below the file list pane. This allows you to enter an arbitrary command to run within the active pane. This is great for the odd command you need to run in a directory that _no_ file manager expects you to run, and so no file manager has a function for. It's the brute force method of the plugin model: Provide a command line and let users run what they need to run whenever they need to run it. +- **Functions**: Along the very bottom of the Double Commander window, as with Midnight Commander, there's a list of common functions, each assigned to a Function key on your keyboard. + +### Using Double Commander + +Using Double Commander is a lot like using any file manager, except that Double Commander is focused on groups of actions. For instance, the **File** menu isn't an obligatory entry with just **New Window** and **New Tab**, it's full of useful functions, like creating a symlink or hard link, changing attributes, comparing contents, bulk renaming, splitting and combining files, and more. Double Commander is direct. It gets straight to the point, serving as a stand-in for all the commands you'd normally run in a terminal. + +### Graphical command interface + +More than any other file manager I've seen, Double Commander feels like it's meant to be a graphical interface for commands. You can map almost everything in its interface to a command or series of commands you're used to running in a terminal. + +Of course, the question then is whether you need a graphical command line. Why not just run the commands in a terminal? Interestingly, I had the opportunity to witness the value of this recently. There are times, as a support person for other computer users, when trying to get a user to navigate the terminal can be overwhelming. This is particularly true when your user is texting on an app on their mobile phone, and you're giving them commands to type into a terminal on their desktop. This introduces several opportunities for mistakes, and what was meant to be "the fast way" of doing something ends up taking an hour. + +It's counter-intuitive to a terminal user, and it's not even always true, but there are times when a graphical interface really is easier to give instructions for. Picture it: A zombie apocalypse rages outside your compound, and the file permissions of a vital file need to be changed in order to activate the firewall. "Open a terminal and type chmod a+x /usr/local/bin/foo…​no, that's `ch` as in _change_, `mod` as in _mode_ but without the _e_…​no, and then a space. Not between the `ch` and the `mod`, just after the `mod`. And then a space. It's `chmod` and _then_ a space. Not the word _space_, just press the spacebar. It's the really long key under your thumb…​" + +Or you could just say this: "Click on the file, now with that selected, go to the File menu up at the top and click on Change Attributes…​" + +Double Command's central feature is in its powerful features disguised as a non-threatening graphical file manager. Download and try it out for yourself. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/linux-file-manager-double-commander + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/22/12/linux-file-manager-midnight-commander +[2]: https://opensource.com/sites/default/files/2022-10/doublecmd-2panelview.png +[3]: https://doublecmd.sourceforge.io/ +[4]: https://github.com/doublecmd/doublecmd/releases +[5]: https://opensource.com/article/17/6/set-path-linux diff --git a/sources/tech/20221220.6 ⭐️ How to Update Pi-hole Easily.md b/sources/tech/20221220.6 ⭐️ How to Update Pi-hole Easily.md new file mode 100644 index 0000000000..a667eec761 --- /dev/null +++ b/sources/tech/20221220.6 ⭐️ How to Update Pi-hole Easily.md @@ -0,0 +1,177 @@ +[#]: subject: "How to Update Pi-hole Easily" +[#]: via: "https://itsfoss.com/update-pi-hole/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Update Pi-hole Easily +====== + +Pi-hole is one of the most effective ad-blockers available for you to use. You can install it on your router or a dedicated system and get an ad-free experience for all the devices connected through it. + +In an earlier article, I discussed the [steps for installing Pi-hole][1]. But you must update it regularly to win the cat-and-mouse game between ad blockers and ad providers (Google, Facebook, etc). Another aspect is to patch a security vulnerability that might affect you negatively. + +The update method depends on the installation method. To recall, I discussed two methods: + +- **Method 1**: The existing Pi-hole installation was conducted using a script. The script was `curl -sSL https://install.pi-hole.net | bash` (or something similar). +- **Method 2**: You installed Pi-hole using either Podman or Docker as a container. + +I will cover how to update Pi-hole with both of these methods. + +### Method 1: Updating Pi-hole that was installed by a script + +You will not believe how easy this is. All you have to do is run the following command in your terminal! + +``` +pihole -up +``` + +Of course, you have to run this command on the device where you have installed Pi-hole. In other words, you may have to [SSH into your Raspberry Pi][2] or router to run the above-mentioned command. + +Doing so will update Pi-hole. Below is the output of running the `pihole -up` command on my computer: + +``` +$ pihole -up + [✓] Update local cache of available packages + [i] Existing PHP installation detected : PHP version 8.1.2-1ubuntu2.8 + [✓] Checking for git + [✓] Checking for iproute2 + [✓] Checking for dialog + [✓] Checking for ca-certificates + + [i] Checking for updates... + [i] Pi-hole Core: up to date + [i] Web Interface: up to date + [i] FTL: up to date + + [✓] Everything is up to date! +``` + +💡Though I haven’t encountered this myself, it is still a possibility that Pi-hole might require updates for _other_ packages (like PHP) be installed. So try and run the update command that is applicable for your package manager on a regular basis. Keeping other packages up-to-date is _just as important_ ;) + +#### Optional: Automate Pi-hole update with cron job + +This says that everything is up to date. But how can a normal person remember to keep everything up to date? Fret not! We can create a cron job to automatically update Pi-hole every day. + +But before we edit the cron job, let us find the absolute path of the `pihole` command. This can be done either using the `which` command or the `command` command. You only need to run either one of the two commands listed below: + +``` +command -v pihole +which pihole +``` + +Executing either of the commands listed above will give you the absolute path to the `pihole` command. In my case, the absolute path for the `pihole` command is `/usr/local/bin/pihole`. + +Next, we will edit the [cron job][3]. To edit cron jobs, type the following command in your terminal (please do **NOT** use `sudo`): + +``` +crontab -e +``` + +Doing so will open a file in either the `nano` editor or the `vim` editor. Next, _append_ the following lines to the currently opened file: + +``` +0 1 * * * /usr/local/bin/pihole -up +``` + +All you need to do now is to save and exit the editor. + +What we just did was that we made updating Pi-hole an automatic task. This will automatically run the `pihole up` command at 01:00 hours, every day. + +### Method 2: Update Pi-hole that was installed via Podman or Docker + +If you installed Pi-hole using either Podman or Docker, all you can do initially is to pull the image. + +⚠️ If you used a `docker-compose.yml` file to create your container, please have it handy because we need to delete the current container and create a new one. (No data or configuration will be changed if volumes are backed up properly or if bind mounts were used.) + +#### Step 1: Check if a newer image is available + +To check for updates, you can run either of the following commands based on what you use: + +``` +# command for Podman users +podman pull docker.io/pihole/pihole:latest + +# command for Docker users +docker pull docker.io/pihole/pihole:latest +``` + +If there is a newer version of the image, it will be fetched. If a newer version is not available, nothing extra will happen and you should try again later. + +#### Step 2: Stop and remove the container + +If a new image was downloaded, we can proceed further. Our next step should be to restart the container. To know which container to restart, we can check the output of the `docker ps` or `podman ps` command. + +``` +$ docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +73528d5ca4e8 docker.io/pihole/pihole:latest 14 hours ago Up 14 hours ago 53/tcp pihole-aditi +``` + +This shows that I have a container named `pihole-aditi`. Let’s stop and remove this container. This can be done with the following commands: + +``` +# command for Podman users +podman stop pihole-aditi +docker rm pihole-aditi + +# command for Docker users +docker stop pihole-aditi +docker rm pihole-aditi +``` + +#### Step 4: Create a new container + +I hope you took my warning seriously and have your `docker-compose.yml` file handy ;) + +Let’s re-create a new container. You can re-create your container using the following command: + +``` +docker-compose up -d +``` + +Please verify that the Pi-hole container is up and running using either the `podman ps` command or the `docker ps` command. + +#### Step 5: Remove old image(s) + +Once the Pi-hole container starts up with the updated image, we can remove the old image and free up disk, space. + +To remove **all the _unused_ images**, use the following command: + +``` +# command for Podman users +podman image prune + +# command for Docker users +docker image prune +``` + +Upon running the above command, **all the _unused_** **images** will be removed. **Please take caution with this command.** + +Done! That was all that we needed to do to update our Pi-hole container. + +### Conclusion + +This article goes over the two methods of updating Pi-hole based on the installation method initially used. I have also discussed setting up auto-updates for Pi-hole which was installed using the official script. There is no such option for the container method, unfortunately. + +Do let me know if you face any issues. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/update-pi-hole/ + +作者:[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/setup-pi-hole/ +[2]: https://itsfoss.com/ssh-into-raspberry/ +[3]: https://itsfoss.com/cron-job/ diff --git a/sources/tech/20221221.1 ⭐️ Debugging LibreOffice Basic Macro using Breakpoint and Watch.md b/sources/tech/20221221.1 ⭐️ Debugging LibreOffice Basic Macro using Breakpoint and Watch.md new file mode 100644 index 0000000000..89ec7eaf19 --- /dev/null +++ b/sources/tech/20221221.1 ⭐️ Debugging LibreOffice Basic Macro using Breakpoint and Watch.md @@ -0,0 +1,118 @@ +[#]: subject: "Debugging LibreOffice Basic Macro using Breakpoint and Watch" +[#]: via: "https://www.debugpoint.com/debugging-libreoffice-macro-basic-using-breakpoint-and-watch/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Debugging LibreOffice Basic Macro using Breakpoint and Watch +====== + +**A simple guide for you to learn how to debug LibreOffice basic macro using breakpoint and watch.** + +While writing complex macros to automate various tasks in LibreOffice, you definitely encounter errors. Some run-time errors are self-explanatory. But some of them are very generic. To debug those, you need to carefully put breakpoints and step through the code to see where the problem is in your code. + +Hence this tutorial. These techniques apply to all the macros written in Calc, Writer or Impress. And should be applied to OpenOffice macros as well. + +### Debug a LibreOffice Macro written in Basic + +It’s easier to demonstrate this concept using an example. + +#### Define + +Let’s define three variables which we would use for our exercise. + +``` +dim i, j, cnt +``` + +Define a `for` loop, which would execute from 1 to 10. Inside the loop, increment two variables as below. This is just for just this demo; however, you can put any logic you want. + +``` +for cnt = 1 to 10 + i = i + 1 + j = i + 1 +next cnt +``` + +#### Adding Breakpoint + +Now, we want to put two breakpoints in the statement `"for cnt = 1 to 10"` and `"j = i + 1"`. When you put a breakpoint inside your program, it runs in debug mode and holds the execution at the breakpoint. + +To put a breakpoint in a LibreOffice Basic macro, put the cursor in the statement. And then, press `F9` or press the below button from the toolbar. + +![Breakpoint toolbar button in LibreOffice Macro editor][1] + +Once you do that, you will see a red circle on the left side of the statement, which means a breakpoint has been added _to that statement_. See the below image. In addition, you can add multiple breakpoints as per your needs. + +![After adding breakpoints][2] + +If you want to remove a breakpoint from a statement, press `F9` again in the statement, OR you can `double-click` the red circle. + +#### Adding Watch + +Now, we would add a ‘watch’ to the variable `"cnt"`. + +When the program executes in debug mode, the watch helps monitor a variable’s value between program steps. To add a watch on `"cnt"`variable, select the variable and press `F7` or click the glass icon in the toolbar. + +![Watch button in the toolbar in LibreOffice Macro editor][3] + +Once you do that, you will see the variable added to the watch list at the bottom of the editor. + +![Watch section appears at the bottom of the editor][4] + +#### Execute by Step + +We are all set with tools. + +Run the program by pressing `F5`. As we already added breakpoints, you would see the execution halts at the first breakpoint with a little **yellow arrow**. + +![Execution halts at the breakpoint][5] + +Now you have two options. + +Press `F5` again to continue the execution of the program, and it will halt again at the next breakpoint.Press `F8` (step execution), which would execute step by step, and you can see the ‘watched’ variable `'cnt'` value is changing as below. + +Lets press `F8`. You can see the yellow arrow comes to the next statement, and the compiler waits. Now the fun part, if you take a closer look at the watch window, you can see the `'cnt'`variable’s value is 1. + +![Variable contents during execution][6] + +So this way, you can debug, add breakpoints and add watch any LibreOffice or OpenOffice macro using its editor. + +Furthermore, you can add many watch variables as you want and debug your program for successful execution. + +### Closing Notes + +Although the above example is specific to LibreOffice macros, the same concept applies to programming and debugging in general. I hope this article helps you to understand the basics of debugging, step execution and watch in programming and macros in LibreOffice. + +### Looking for Something Else? + +If you are looking for something else in LibreOffice macro tutorials Or wants to learn more about it, please follow the below link for the complete Macro Tutorials Index: + +[Macro Tutorial Index][7] + +[Next:How to Save and Open Tabs from Last Session in Web Browser][8] + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/debugging-libreoffice-macro-basic-using-breakpoint-and-watch/ + +作者:[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/2014/09/LibreOffice_Debug_watch_BreakPoint_1.png +[2]: https://www.debugpoint.com/wp-content/uploads/2014/09/LibreOffice_Debug_watch_BreakPoint_2.png +[3]: https://www.debugpoint.com/wp-content/uploads/2014/09/LibreOffice_Debug_watch_BreakPoint_3.png +[4]: https://www.debugpoint.com/wp-content/uploads/2014/09/LibreOffice_Debug_watch_BreakPoint_4.png +[5]: https://www.debugpoint.com/wp-content/uploads/2014/09/LibreOffice_Debug_watch_BreakPoint_5.png +[6]: https://www.debugpoint.com/wp-content/uploads/2014/09/LibreOffice_Debug_watch_BreakPoint_6.png +[7]: http://www.debugpoint.com/libreoffice-basic-macro-tutorial-index/ +[8]: https://www.debugpoint.com/open-tabs-last-session-browser/ diff --git a/sources/tech/20221221.2 ⭐️⭐️ How to migrate your code from PHP 7.4 to 8.1.md b/sources/tech/20221221.2 ⭐️⭐️ How to migrate your code from PHP 7.4 to 8.1.md new file mode 100644 index 0000000000..fe2f579bb3 --- /dev/null +++ b/sources/tech/20221221.2 ⭐️⭐️ How to migrate your code from PHP 7.4 to 8.1.md @@ -0,0 +1,160 @@ +[#]: subject: "How to migrate your code from PHP 7.4 to 8.1" +[#]: via: "https://opensource.com/article/22/12/migrate-php-code" +[#]: author: "Paul Gilzow https://opensource.com/users/gilzow" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to migrate your code from PHP 7.4 to 8.1 +====== + +The end-of-life (EOL) for [PHP 7.4][1] was Monday, November 28, 2022. If you’re like me, that date snuck up much faster than anticipated. While your PHP 7.4 code isn’t going to immediately stop working, you do need to begin making plans for the future of this codebase. + +### What are your options? + +You could continue to remain on PHP 7.4, but there are several benefits to updating. The biggest are security risk and support. As we move farther and farther away from the EOL date, attackers will turn their focus to PHP 7.4 knowing that any vulnerabilities they discover will go unpatched in the majority of systems. Staying on PHP 7.4 drastically increases the risk of your site being compromised in the future. In a similar vein, finding support for issues you encounter with PHP 7.4 will become increasingly more difficult. In addition, you will most likely begin to encounter compatibility issues with third-party code/packages as they update their code to be compatible with later versions and drop support for 7.4. You’ll also be missing out on significant speed and performance improvements [introduced in 8.0][2] and further [improved in 8.1][3]. But upgrading all that legacy code is daunting! + +### Where to start? + +Luckily, PHP provides an [official migration guide][4] from PHP 7.4 to 8.0 to get you started (and an [8.0 to 8.1 migration guide][5] as well). Be sure to read through the Backward Incompatible Changes and Deprecated Features sections. While these guides are incredibly handy, you may very well have tens of thousands of lines of code to check, some of which you may have inherited. Luckily there are some options to help pinpoint potential problem areas in the migration. + +#### PHPCodeSniffer + PHPCompatibility sniffs + +[PHPCodeSniffer][6] (PCS) is a package for syntax checking of PHP Code. It checks your code against a collection of defined rules (aka “sniffs”) referred to as “standards”. PHPCodeSniffer ships with a collection of standards you can use including PEAR, PSR1, PSR2, PSR12, Squiz, and Zend. Luckily, you can write your own collection of sniffs to define any set of rules you like. + +> PHPCompability has entered the chat + +[PHPCompatibility][7] “is a set of sniffs for PHP CodeSniffer that checks for PHP cross-version compatibility” allowing you to test your codebase for compatibility with different versions of PHP, including PHP 8.0 and 8.1. This means you can use PHPCodeSniffer to scan your codebase, applying the rules from PHPCompability to sniff out any incompatibilities with PHP 8.1 that might be present. + +### Before I continue… + +While PHP8.2 was released on [December 8, 2022][8], and I encourage you to begin looking over the [official 8.1 to 8.2 migration guide][9] and begin making plans to upgrade, most of the checkers I mention in this article have not completed full support for 8.2 at this time. For those reasons, I’ll be focusing on migrating the code to PHP8.1, and not 8.2. + +In the process of writing this article, I discovered PHPCompatiblity has a [known issue][10] when checking for compatibility with PHP 8.0/8.1 where it will report issues that should be **Errors** as **Warnings**. The only workaround for now is to use the `develop` branch for PHPCompatibility instead of `master`. While they state it is stable, please be aware that in this article, I’m using the non-stable branch. You may want to weigh the pros and cons of using the `develop` branch before implementing it anywhere else than in a local development environment. While I found PCS+PHPCompatibility to be the most straightforward and comprehensive solution for checking for incompatible code, if you do not want to use a non-stable version of PCS, see the section at the end of the article about alternative options. + +For the purposes of this article, I’ll be using the [1.4.6 version of SimpleSAMLphp][11] to test for incompatibilities. This is a six-year-old version of the code base. I do this not to pick on SimpleSAMLphp, but because I wanted something that would _definitely_ have some errors. As it turns out, all of the platform.sh code I tested, as well as my own code was already compatible with PHP8.1 and required no changes. + +### Get started + +To get started, first clone your codebase, and then create a new branch. You’ll now need to decide if you want to install the dependencies and run the scans on your local machine or in a local development environment using something like [DDEV][12], [Lando][13], or [Docksal][14]. In this demo, I’m using DDEV. I suggest using a local development environment vs running directly on your local machine because while it’s not required to use the version of PHP you want to test against, for the best results, it is recommended you do so. If you don’t have PHP installed, or don’t have the target version installed, a local development environment allows you to create an ephemeral environment with exactly what you need without changing your machine. + +After setting up your environment for PHP 8.1, at a terminal prompt (in my case, I’ve run `ddev start` and once the containers are available, shell into the web app using `ddev ssh`), you need to add these new packages so you use them to test with. I’ll be adding them with composer, however, there are [multiple][15][ways][16] to [install][17][them][18] if you would prefer to do so differently. If your codebase isn’t already using composer, you’ll need to do [composer init][19] before continuing. + +Because you'll be using the develop branch of PHPCompatibility there are a couple of extra steps to do that aren’t in the regular installation instructions. First is that the develop branch of PHPCompatibility requires an alpha version of `phpcsstandards/phpcsutils`. Because it is marked as alpha, you'll need to let composer know this one package is OK to install even though it is below your minimum stability requirements. + +`$ composer require --dev phpcsstandards/phpcsutils:"^1.0@dev"` + +Next, install PHPCompatibility targeting the `develop` branch + +`$ composer require --dev phpcompatibility/php-compatibility:dev-develop` + +The `develop` branch also installs `dealerdirect/phpcodesniffer-composer-installer` so you don’t need to add it manually or direct PCS to this new standard. + +To verify our new standards are installed, you'll have PCS display the standards it is aware of. + +``` +$ phpcs -i +The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, PHPCompatibility, PHPCS23Utils and PHPCSUtils +``` + +Now that you know your standards are available, you can have PCS scan our code. To instruct PCS to use a specific standard, use the `--standard` option and tell it to use `PHPCompatibility`. However, you also need to tell PHPCompatibility which PHP version you want to test against. For that, use PCS’ `--runtime-set` option and pass it the key `testVersion` and value of `8.1`. + +Before you start the scan, the one issue remaining is that code you want to scan is in the root of the project (`.`) but the `vendor` directly is also in the project root. You don’t want the code in `vendor` scanned, as those aren’t packages you necessarily control. PCS allows you to tell it to not scan files/directories with the `--ignore` option. Finally, you want to see the progress as PCS parses the file so you'll pass in the `-p` option. + +Putting it all together: + +`$ phpcs -p . --standard=PHPCompatibility --runtime-set testVersion 8.1 --ignore=*/vendor/*` + +This kicks off PCS which will output its progress as it scans through your project’s code. `W` indicates **Warnings**, and `E` indicates **Errors**. At the end of the scan it will output: a full report with the file containing the issue, the line number where the issue occurs, whether the issue is a **Warning** or an **Error**, and the specific issue discovered. + +In general, **Errors** are things that will cause a fatal error in PHP 8.1 and will need to be fixed before you can migrate. **Warnings** can be things that have been deprecated in 8.0/8.1 but not yet removed or issues that PCS ran into while trying to parse the file. + +![asciicast][20] + +Given that the report might be long, and is output all at once into your terminal, there are [numerous options][21] for changing the information that is included in the report, as well as multiple reporting formats. + +As you begin to fix your code, you can rerun the report as many times as needed. However, at some point, you’ll need to test the code on an actual PHP8.1 environment with real data. If you’re using [Platform.sh][22], which is as easy as creating a branch, changing a single line in your configuration file, and pushing that branch to us. You can check out [this video][23] to see how easy it is! + +### There’s too much to fix! + +Now that you have a solid idea of what needs to be updated before you can migrate, you might be facing an incredible amount of work ahead of you. Luckily, you have some options to help you out. PCS ships with a code fixer called [PHP Code Beautifier and Fixer][24] (`phpcbf`). Running phpcbf is almost identical to running phpcs and most of the options are identical. The other option is [Rector][25]. Usage of these tools is beyond the scope of this article, but as with any automation, you’ll want to test and verify before promoting changes to production. + +### Alternative options + +If for any reason you don’t feel comfortable using a non-stable version of PCS, you do have other options for checking your code. + +#### Phan + +Phan is a static code analyzer for PHP. It offers multiple levels of analysis and allows for incrementally strengthening that analysis. + +“Static analysis needs to be introduced slowly if you want to avoid your team losing their minds.” + +Phan doesn’t target just compatibility with newer versions, it can highlight areas of code that will error in later versions. However, there are some caveats when using Phan for checking compatibility: + +- Slower than PCS+PHPCompatibility. +- Phan requires the [ast php extension][26] which is not available by default on Platform.sh (or in DDEV). You’ll need to install it in your local development environment and add it to your php.ini file. Alternatively, you can use the `--allow-polyfill-parser` option, but it is considerably slower. +- Phan’s default reporting output isn’t as easy to read as other options +- I came across an issue where if your code base sets a different `vendor` directory via composer’s `[config:vendor-dir](https://getcomposer.org/doc/06-config.md#vendor-dir)` option, it will error out stating it can’t find certain files in the `vendor` directory +- As mentioned, Phan analyzes much more than just PHP8.1 compatibility. While certainly a strength in other situations, if your goal is to migrate from 7.4 to 8.1 as quickly as possible, you will have to parse through errors that are unrelated to version compatibility. +- Requires you run it on the PHP version you want to target + +#### PHPStan + +Similar to Phan, PHPStan is a static code analyzer for PHP that promises to “find bugs without writing tests.” And a similar set of caveats apply: + +- Slower than either PCS or Phan +- Analyzes much more than just PHP8.1 compatibility so depending on your current codebase, you will have to possibly parse through a bunch of errors that are unrelated to version compatibility +- Requires you run it on the PHP version you want to target + +#### PHP Parallel Lint + +A very fast PHP linter that can lint your codebase for issues, but can also check for deprecations. While it is exceptionally fast, it is only a linter, and therefore can only surface deprecations that are thrown at compile time, not at runtime. In my example code, it only found 2 deprecations vs the 960 deprecations PCS uncovered. + +### Summary + +Code migrations, while never fun, are crucial to minimizing organizational risk. Platform.sh gives you the flexibility to test your code using the same data and configurations as your production site, but in a siloed environment. Combine this with the tools above, and you have everything you need for a strong, efficient code migration. + +_This article originally published on the [Platform.sh community site][27] and has been republished with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/migrate-php-code + +作者:[Paul Gilzow][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/gilzow +[b]: https://github.com/lkxed +[1]: https://www.php.net/eol.php +[2]: https://platform.sh/blog/2020/php-80-feature-focus-just-in-time-compilation +[3]: https://platform.sh/blog/2021/php-81-lays-new-ground-at-platformsh +[4]: https://www.php.net/manual/en/migration80.php +[5]: https://www.php.net/manual/en/migration81.php +[6]: https://github.com/squizlabs/PHP_CodeSniffer +[7]: https://github.com/PHPCompatibility/PHPCompatibility +[8]: https://www.php.net/archive/2022.php#2022-12-08-1 +[9]: https://www.php.net/manual/en/migration82.php +[10]: https://github.com/PHPCompatibility/PHPCompatibility/issues/1344 +[11]: https://github.com/simplesamlphp/simplesamlphp/releases/tag/v1.14.6 +[12]: https://opensource.com/article/22/12/ddev +[13]: https://lando.dev/ +[14]: https://docksal.io/ +[15]: https://github.com/squizlabs/PHP_CodeSniffer#phive +[16]: https://github.com/squizlabs/PHP_CodeSniffer#git-clone +[17]: https://github.com/squizlabs/PHP_CodeSniffer#installation +[18]: https://github.com/PHPCompatibility/PHPCompatibility#installation-via-a-git-check-out-to-an-arbitrary-directory-method-2 +[19]: https://getcomposer.org/doc/03-cli.md#init +[20]: https://asciinema.org/a/MGKsC3RkNaWMcGtJGiyMHorWy.svg +[21]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Reporting +[22]: https://platform.sh/ +[23]: https://www.youtube.com/watch?v=mAb8DO7Jp0Q +[24]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically#using-the-php-code-beautifier-and-fixer +[25]: https://github.com/rectorphp/rector +[26]: https://github.com/nikic/php-ast +[27]: https://community.platform.sh/t/migrating-php-7-4-code-to-8-1-on-platform-sh/1156 diff --git a/sources/tech/20221221.4 ⭐️⭐️ My 4 favorite features of the 4pane file manager on Linux.md b/sources/tech/20221221.4 ⭐️⭐️ My 4 favorite features of the 4pane file manager on Linux.md new file mode 100644 index 0000000000..f64399c4eb --- /dev/null +++ b/sources/tech/20221221.4 ⭐️⭐️ My 4 favorite features of the 4pane file manager on Linux.md @@ -0,0 +1,100 @@ +[#]: subject: "My 4 favorite features of the 4pane file manager on Linux" +[#]: via: "https://opensource.com/article/22/12/linux-file-manager-4pane" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +My 4 favorite features of the 4pane file manager on Linux +====== + +4Pane is a multi-pane file manager for Linux that allows for customized layout, and provides quick access to traditional desktop conveniences as well as common Linux tools. 4Pane aims for speed over visual effects, and places the way you want to work above all else. In honor of its name, I've got a list of my four favorite features of this fine file manager. + +### 1. Flexible interface + +![The 4Pane file manager is a fast multi-pane application for managing files.][1] + +The most prominent feature of the 4Pane window is the same as its name: there are four panes in the window by default. In a way, though, there's actually only two, or said another way, each of the two panes is divided into two columns. The column on the left is a directory tree of your current location (home, by default.) Files are never displayed in the left column. It's only a directory tree. + +The adjacent column displays the contents of the selected directory. When you double-click on a file, it opens in its default application. When you double-click on a directory, that directory is revealed in the left column and the right column displays its contents. + +This same model is duplicated in the other window pane. + +4Pane only has 4 panes by default, but it doesn't enforce that view. If you're overwhelmed by the four-pane view, click on the **View** menu and select **Unsplit panes**. This displays just one pane of two columns. It's a simplified view compared to what's possible, but it's a nice place to start while you're getting used to the column-style for browsing files. + +#### Splitting panes + +The advantage of a split view is that you don't have to open another window to drag and drop a file or folder from one location to another. This isn't the predominant model for file managers, but it's a popular subset. 4Pane is one of the few, in my experience, that recognizes that it's not always convenient to work laterally. If you prefer to have your second pane at the bottom of the window, go to the **View** menu and select **Split panes horizontally** (meaning that the _split_ is horizontal, so the panes are situated vertically to one another). + +![You can create horizontal splits in 4Pane.][2] + +### 2. Tooltip preview + +One of my favorite features of 4Pane is the tooltip preview. To activate this, click the photo icon in the top toolbar. With this active, all you have to do is roll your mouse over a file to see a preview of its contents in a tooltip. It may not be a feature you want active all the time. The tooltips can be distracting when you're just browsing files. However, if you're looking for something specific or if you're just not sure exactly what's in a directory, a quick wave of your mouse to get an overview of the contents of several files is satisfyingly efficient. + +### 3. Menu + +The menu bar of 4Pane isn't quite like most file manager menu bars you may be accustomed to. There's a menu dedicated to archiving actions, mounting devices, and popular Linux commands such as [grep][3] and [find][4]. + +For instance, in the **Archive** menu, you can choose to extract an archive or compressed file, create a new archive, add a file to an existing archive, compress a file, and more. I love [Ark][5] and similar utilities, but I also recognize how useful it is for a file manager to make those utilities unnecessary. Especially when you're on an [old computer][6], the fewer applications you have to launch, the better. + +Also impressive are the built-in front ends for `grep` and `find`. I'll admit that I probably won't use it often myself, but I never complain when a developer brings the power of Linux commands to users who aren't [yet] familiar with the terminal. + +![4Pane can run grep and locate commands to help you find your data.][7] + +The `locate` front end is probably the most useful of the bunch. It's fast and effective. There's just one field in the dialogue box, so it makes a file system search _fast_. + +For example, say you're searching for the file `Zombie-Apocalypse-Plan-B.txt` because Plan A fell through, but in the heat of the moment (what with zombies knocking down your door, and all) you can't remember where you saved it. Go to the **Tools** menu and select **locate**. Type `zombie` in the search field, click the `-i` box so that your system ignores capitalization, and click **OK**. This returns both `Zombie-Apocalypse-Plan-A.txt` and `Zombie-Apocalypse-Plan-B.txt`. + +Maybe that's good enough for you, or maybe you need a little more precision. In addition to `-i` for case insensitivity, you can click the `-r` option to leverage the power of [regex][8]. Type `zombie.B.` to narrow your search to a file starting with `zombie` and containing the letter `B` somewhere in the filename. + +Effective and fast. + +### 4. Undo + +Finally, my (other) very favorite feature of 4pane is the **Undo** button. When you right click on a file or folder and select **Delete**, the item is sent to a secret location (it's not actually secret, but it's out of sight and out of mind). The item isn't scrubbed from the hard drive until you close the 4pane window. Up until then, you can always click the **Undo** button in the top toolbar to reverse decisions you've come to regret. + +This is a separate action from sending a file to your system trash, so it _is_ meant to masquerade as an actual delete action. The difference is that it's a delayed delete. That may not suit you. Some users are disciplined enough to send files to the system trash, but others skip the trash. This feature is designed to protect you from yourself by delaying deletion until you close the window. I find it a reasonable and invaluable feature, and it's the one feature that I've already benefited from several times. + +### Install 4Pane on Linux + +If you're sold on 4Pane, or at least curious about it, then you should install it and try it out! On Linux, your distribution may package 4Pane in its software repository. If so, you can use your package manager to install. For example, on Fedora, Mageia, OpenMandriva, and similar: + +``` +$ sudo dnf install 4pane +``` + +On Debian and Debian-based systems: + +``` +$ sudo apt install 4pane +``` + +If your distribution doesn't carry 4Pane, you can download it from [4pane.co.uk][9]. + +Once installed, launch 4Pane from your application menu. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/linux-file-manager-4pane + +作者:[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/2022-10/4pane.webp +[2]: https://opensource.com/sites/default/files/2022-10/4pane-split-horizontally.webp +[3]: https://opensource.com/article/21/3/grep-cheat-sheet +[4]: https://opensource.com/article/18/4/how-use-find-linux +[5]: https://opensource.com/article/22/2/archives-files-linux-ark-kde +[6]: https://opensource.com/article/19/7/how-make-old-computer-useful-again +[7]: https://opensource.com/sites/default/files/2022-10/4pane-grep.webp +[8]: https://opensource.com/article/18/5/getting-started-regular-expressions +[9]: http://www.4pane.co.uk/ diff --git a/sources/tech/20230109.1 ⭐️⭐️ Use this open source API gateway to scale your API.md b/sources/tech/20230109.1 ⭐️⭐️ Use this open source API gateway to scale your API.md new file mode 100644 index 0000000000..67bba6c7e0 --- /dev/null +++ b/sources/tech/20230109.1 ⭐️⭐️ Use this open source API gateway to scale your API.md @@ -0,0 +1,149 @@ +[#]: subject: "Use this open source API gateway to scale your API" +[#]: via: "https://opensource.com/article/23/1/api-gateway-apache-apisix" +[#]: author: "Bobur Umurzokov https://opensource.com/users/iambobur" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Use this open source API gateway to scale your API +====== + +An API gateway is a single point of entry for incoming calls to an [application programming interface (API)][1]. The gateway aggregates the services being requested and then returns the appropriate response. To make your API gateway effective, it's vital for you to design a reliable, efficient, and simple API. This is an architectural puzzle, but it's one you can solve as long as you understand the most important components. + +### API-Led approach + +An API-Led approach puts an API at the heart of communication between applications and the business capabilities they need to access in order to consistently deliver seamless functionality across all digital channels. **API-Led connectivity** refers to the technique of using a reusable and well-designed API to link data and applications. + +### API-Led architecture + +API-Led architecture is an architectural approach that looks at the best ways of reusing an API. API-Led architecture addresses things like: + +- Protecting an API from unauthorized access. +- Ensuring that consuming applications can always find the right API endpoint. +- Throttling or limiting the number of calls made to an API to ensure continuous availability. +- Supporting continuous integration, testing, lifecycle management, monitoring, operations, and so on. +- Preventing error propagation across the stack. +- Real-time monitoring of an API with rich analytics and insight. +- Implementing scalable and flexible business capabilities (for example, supporting a [microservice][2] architecture.) + +### API resource routing + +Implementing an API gateway as the single entry point to all services means that API consumers only have to be aware of one URL. It becomes the API gateway's responsibility to route traffic to the corresponding service endpoints, and to enforce policies. + +![Image depicting the API routing traffic.][3] + +This reduces complexity on the API consumer side because the client applications don't need to consume functionality from multiple HTTP endpoints. There's alsono need to implement a separate layer for authentication, authorization, throttling, and rate limiting for each service. Most API gateways, like the open source [Apache APISIX][4] project, already have these core features built in. + +### API content-based routing + +A content-based routing mechanism also uses an API gateway to route calls based on the content of a request. For example, a request might be routed based on the HTTP header or message body instead of just its target URI. + +Consider a scenario when database sharding is applied in order to distribute the load across multiple database instances. This technique is typically applied when the overall number of records stored is huge and a single instance struggles to manage the load. + +A better solution is to spread records across multiple database instances. Then you implement multiple services, one for each unique datastore, and adopt an API gateway as the only entry point to all services. You can then configure your API gateway to route calls to the corresponding service based on a key obtained either from the HTTP header or the payload. + +![Image of the API gateway exposing a single customer.][5] + +In the above diagram, an API gateway is exposing a single `/customers` resource for multiple customer services, each with a different data store. + +### API geo-routing + +An API geo-routing solution routes an API call to the nearest API gateway based on its origin. In order to prevent latency issues due to distance (for example, a consuming application from Asia calling an API located in North America), you can deploy an API gateway in multiple regions across the world. You can use a different subdomain for each API gateway in each region, letting the consuming application determine the nearest gateway based on application logic. Then, an API gateway provides internal load balancing to make sure that incoming requests are distributed across available instances. + +![Image of a DNS traffic management system.][6] + +It's common to use a DNS traffic management service and an API gateway to resolve each subdomain against the region's load balancer to target the nearest gateway. + +### API aggregator + +This technique performs operations (for example, queries) against multiple services, and returns the result to the client service with a single HTTP response. Instead of having a client application make several calls to multiple APIs, an API aggregator uses an API gateway to do this on behalf of the consumer on the server side. + +Suppose you have a mobile app that makes multiple calls to different APIs. This increases complexity in the client-side code, it causes over-utilization of network resources, and produces a poor user experience due to increased latency. An API gateway can accept all information required as input, and can request authentication and validation, and understand the data structures from each API it interacts with. It's also capable of transforming the response payloads so they can be sent back to the mobile app as a uniform payload needed for the consumer. + +![Image of an API gateway.][7] + +### API centralized authentication + +In this design, an API gateway acts as a centralized authentication gateway. As an authenticator, an API gateway looks for access credentials in the HTTP header (such as a bearer token.) It then implements business logic that validates those credentials with an identity provider. + +![Image of a tree showing API gateway's centralized authentication.][8] + +Centralized authentication with an API gateway can solve many problems. It completely offloads user management from an application, improving performance by responding quickly to authentication requests received from client applications. Apache APISIX offers a [variety of plugins][9] to enable different methods of API gateway authentication. + +![Image showing Apache ASPISIS and various plugins.][10] + +### API format conversion + +API format conversion is the ability to convert payloads from one format to another over the same transport. For example, you can transfer from XML/SOAP over HTTPS to JSON over HTTPS, and back again. An API gateway offers capabilities in support of a [REST API][11] and can do payload conversions and transport conversions. For instance, a gateway can convert from a message queue telemetry transport (MQTT) over TCP (a very popular transport in IoT) to JSON over HTTPS. + +![Image depicting APISIX transfers.][12] + +Apache APISIX is able to receive an HTTP request, transcode it, and then forward it to a gRPC service. It gets the response and returns it back to the client in HTTP format by means of its [gRPC Transcode][13] plug-in. + +### API observability + +By now, you know that an API gateway offers a central control point for incoming traffic to a variety of destinations. But it can also be a central point for observation, because it's uniquely qualified to monitor all traffic moving between the client and service networks. You can adjust an API gateway so that the data (structured logs, metrics, and traces) can be collected for use with specialized monitoring tools**.** + +Apache APISIX provides [pre-built connectors][14] so you can integrate with external monitoring tools. You can leverage these connectors to collect log data from your API gateway to further derive useful metrics and gain complete visibility into how your services are being used. You can also manage the performance and security of your API in your environment. + +### API caching + +API caching is usually implemented inside the API gateway. It can reduce the number of calls made to your endpoint, and also improve the latency of requests to your API by caching a response from upstream. If the API gateway cache has a fresh copy of the requested resource, it uses that copy to satisfy the request directly instead of making a request to the endpoint. If the cached data is not found, the request travels to the intended upstream services. + +![Image depicting how the API gateway cache functions.][15] + +### API fault handling + +API services may fail due to any number of reasons. In such scenarios, your API service must be resilient enough to deal with predictable failures. You also want to ensure that any resilience mechanisms you have in place work properly. This includes error handling code, circuit breakers, health checks, fallbacks, redundancy, and so on. Modern API gateways support all the most common error-handling features, including automatic retries and timeouts. + +![Image depicting some of the many mechanisms that the modern API Gatway can support.][16] + +An API gateway acts as an orchestrator that can use a status report to decide how to manage traffic, send load balances to a healthy node, and can fail fast. It can also alert you when something goes wrong. An API gateway also ensures that routing and other network-level components work together successfully to deliver a request to the API process. It helps you detect a problem in the early stage, and to fix issues. A fault injection mechanism (like the one Apache APISIX uses) at the API gateway level can be used to test the resiliency of an application or microservices API against various forms of failures. + +### API versioning + +This refers to having the ability to define and run multiple concurrent versions of an API. This is particularly important, because an API evolves over time. Having the ability to manage concurrent versions of an API enables API consumers to incrementally switch to newer versions of an API. This means older versions can be deprecated and ultimately retired. This is important because an API, just like any other software application, should be able to evolve either in support of new features or in response to bug fixes. + +![Image of using the API Gateway to implement API versioning.][17] + +You can use an API gateway to implement API versioning. The versioning can be a header, query parameter, or path. + +### Gateway to APISIX + +If you want to scale your API services, you need an API gateway. The Apache APISIX project provides essential features for a robust entrypoint, and its benefits are clear. It aligns with an API-Led architecture, and is likely to transform the way your clients interact with your hosted services. + +_This article has been adapted and republished from the [Apache APISIX blog][18] with the author's permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/1/api-gateway-apache-apisix + +作者:[Bobur Umurzokov][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/iambobur +[b]: https://github.com/lkxed +[1]: https://www.redhat.com/en/topics/api/what-are-application-programming-interfaces +[2]: https://www.redhat.com/en/topics/microservices/what-are-microservices?intcmp=7013a000002qLH8AAM +[3]: https://opensource.com/sites/default/files/2022-12/API.routing.traffic.png +[4]: https://apisix.apache.org/docs/apisix/terminology/api-gateway/ +[5]: https://opensource.com/sites/default/files/2022-12/API%20gateway%20%20exposing%20a%20singlecustomer.png +[6]: https://opensource.com/sites/default/files/2022-12/DNS-traffic%20management%20.png +[7]: https://opensource.com/sites/default/files/2022-12/API-gateway.png +[8]: https://opensource.com/sites/default/files/2022-12/Apigateway.centralized.png +[9]: https://apisix.apache.org/docs/apisix/plugins/openid-connect/ +[10]: https://opensource.com/sites/default/files/2022-12/Apache.ASPISISplugins.png +[11]: https://www.redhat.com/en/topics/api/what-is-a-rest-api?intcmp=7013a000002qLH8AAM +[12]: https://opensource.com/sites/default/files/2022-12/APISIX.transfers.png +[13]: https://apisix.apache.org/docs/apisix/plugins/grpc-transcode/ +[14]: https://apisix.apache.org/docs/apisix/plugins/prometheus/ +[15]: https://opensource.com/sites/default/files/2022-12/APIgatewaycache.png +[16]: https://opensource.com/sites/default/files/2022-12/ModernAPIGatways.png +[17]: https://opensource.com/sites/default/files/2022-12/API.gateway.version.png +[18]: https://apisix.apache.org/blog/2022/10/27/ten-use-cases-api-gateway/ diff --git a/sources/tech/20230118.2 ⭐️⭐️ Beyond Bash 9 Lesser-Known Linux Shells and Their Capabilities.md b/sources/tech/20230118.2 ⭐️⭐️ Beyond Bash 9 Lesser-Known Linux Shells and Their Capabilities.md new file mode 100644 index 0000000000..a16da415aa --- /dev/null +++ b/sources/tech/20230118.2 ⭐️⭐️ Beyond Bash 9 Lesser-Known Linux Shells and Their Capabilities.md @@ -0,0 +1,346 @@ +[#]: subject: "Beyond Bash: 9 Lesser-Known Linux Shells and Their Capabilities" +[#]: via: "https://itsfoss.com/shells-linux/" +[#]: author: "Sreenath https://itsfoss.com/author/sreenath/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Beyond Bash: 9 Lesser-Known Linux Shells and Their Capabilities +====== + +A Shell provides an interface to Linux and Unix-like systems by interpreting commands and acts as an intermediary between the user and the core workings of the operating system. + +Undoubtedly, the **bash shell is the most popular one**, and some users prefer other shells like ZSH, which is the default shell in macOS. But many shells exist other than these popular ones, with different features and use cases. + +In this article, we will take a look at some less popular shells that are actively maintained and provide a different user experience. + +### 1. Fish Shell + +When talking about shells other than bash/zsh, the first name coming to our mind is the fish shell. + +Fish is a **smart, user-friendly command line shell** primarily for UNIX-like operating systems. + +![fish shell][1] + +**Features of Fish Shell** + +- Autosuggestion of commands based on history and completions. +- Supports 24-bit color. +- It supports syntax highlighting, and all features work out of the box. + +**Install Fish** + +Fish is available in the official repos of almost all Linux distributions. In Ubuntu, you can install it by: + +``` +sudo apt install fish +``` + +The version in the Ubuntu repos is a bit old. If you want to install the latest version, you can use the official PPA provided by the team. + +``` +sudo apt-add-repository ppa:fish-shell/release-3 +sudo apt update +sudo apt install fish +``` + +[Fish Shell][2] + +### 2. Nushell + +Nushell is a new type of shell that works in **Linux, macOS, Windows, BSD**, etc. **Nu**, as it’s also called, it takes its philosophy and inspiration from projects like [PowerShell][3], functional programming languages, and modern [CLI][4] tools. + +![nushell][5] + +**Features of Nushell** + +- **Everything is data:** Nu pipelines use structured data so you can safely select, filter, and sort the same way every time. +- **Powerful plugins:** It's easy to extend Nu using a powerful plugin system. +- **Easy to read error messages.** Nu operates on typed data, so it catches bugs that other shells don’t. And when things break, Nu tells you exactly where and why. +- Clean IDE support. + +**Install Nushell** + +If you’re on Ubuntu, you won’t find an apt repository to install Nushell. But you can build it by installing the required dependencies, as per its [instructions on GitHub][6]. + +Fortunately, there is a way to install it on any distro using **Homebrew**. You can refer to our tutorial on [installing and using Homebrew Package Manager on Linux][7]. + +Once you successfully set it up on Linux, you need to type in the following command to install Nushell: + +``` +brew install nushell +``` + +Head to its official website to explore more installation options. + +[Nushell][8] + +### 3. Dune + +The project's creator describes **Dune** as a shell by the beach. Dune is a **fast, useful and pretty shell**, offering a few niche metaprogramming features such as quoting. + +![dune shell][9] + +**Features of Dune Shell** + +- Before entering the interactive mode, Dune executes _the prelude,_ a startup file stored in the home directory. +- Dune's REPL is entirely customizable +- You can define aliases by assigning a variable to a program's name +- Use a macro to write functions that modify your shell's environment and act like commands or programs +- Dune offers an extensive standard library and also provides a pretty interface to see all the functions available in each module. + +**Install Dune Shell** + +Dune shell is available in the Arch Linux repository as **dunesh**. + +For all other users, the Dune shell can be installed with cargo. So first, you need to [install the latest version of rust][10]. If you already have rust installed, ensure you have the latest version and then proceed to install Dune. + +``` +cargo install -f dune +``` + +Once installed, you can access the shell by entering the following: + +``` +dunesh +``` + +[Dune Shell][11] + +### 4. Xonsh + +Xonsh is a **Python-powered, cross-platform shell** and command prompt. It combines Python and bash shell so that you can run Python commands directly in the shell. You can even combine Python and shell commands. + +![xonsh shell][12] + +We had a separate article on Xonsh if you are curious to learn more: + +**Features of Xonsh Shell** + +- The Xonsh language has shell primitives that you are used to from Bash +- Prepare environment variables and arguments in Python and use them in shell commands +- Xontribs is a 3rd-party extension system +- Customizable tab completion, key bindings, color styles +- Rich interface to discover history + +**Installing Xonsh Shell** + +Xonsh is available in the repos of many Linux distributions like Ubuntu, Fedora, etc. So, to install it on Ubuntu, run: + +``` +sudo apt install xonsh +``` + +Xonsh also provides an AppImage package, which can be downloaded from their download page. You may refer to our [AppImage guide][13] if you are new to the file format. + +[Xonsh][14] + +### 5. Hilbish + +Hilbish is an **extensible shell** that is very customizable via the Lua programming language. The shell is aimed at both casual users and power users. + +![hilbish shell][15] + +Features of Hilbish + +- Simple and Easy Scripting +- History and Completion Menus: Provides the user with proper menus for completions and history searching +- Syntax highlighting and hinting are available via the Lua API +- It works on Unix systems and Windows, but on Windows, there may encounter issues. + +**Installing Hilbish** + +Hilbish is not available in the package repositories of Ubuntu. So, you will be building it from the source. + +To install it, you need **Go and task** installed. + +``` +sudo apt install golang-go +sudo snap install task --classic +``` + +Once the dependencies are installed, run the following commands to install Hilbish shell: + +``` +git clone --recursive https://github.com/Rosettea/Hilbish +cd Hilbish +go get -d ./... +``` + +If you want a stable branch, run these commands: + +``` +git checkout $(git describe --tags `git rev-list --tags --max-count=1`) +task build +sudo task install +``` + +[Hilbish][16] + +### 6. Elvish + +Elvish is an expressive programming language and a versatile interactive shell. It runs on Linux, Mac, and Windows. Even if **v1.0** has not been released, it is already suitable for most daily interactive use. + +![elvish shell][17] + +**Features of Elvish** + +- **Powerful Pipelines:** Pipelines in Elvish can carry structured data, not just text. You can stream lists, maps, and even functions through the pipeline. +- **Intuitive Control Structures** +- **Directory History:** Elvish remembers all the directories you have been to. You can access it by pressing `CTRL+L`. +- **Command History** +- **Built-in File Manager:** Accessible by pressing CTRL + N + +**Install Elvish** + +Elvish shell is available in Ubuntu and Arch Linux package managers. So to install it, open a terminal and run: + +``` +sudo apt install elvish +``` + +[Elvish][18] + +### 7. Oh + +According to its developers, Oh is a reimagining of the Unix shell. + +It aims to become a more powerful and robust replacement to modern options while respecting the conventions established by the Unix shell over the last half-century. + +![][19] + +**Features of Oh Shell** + +- First-class channels, pipes, environments, and functions +- Rich return values that work with standard shell constructs +- Support for modularity. +- A simplified set of evaluation and quoting rules. +- A syntax that deviates as little as possible from established conventions; + +**Installing Oh** + +Oh provides a pre-compiled binary. You need to download it from their [official GitHub page][20]. + +You need to give execution permission to the file using the command: + +``` +chmod +x filename +``` + +Now, you can run it by : + +``` +./ +``` + +[Oh][21] + +### 8. Solidity + +Solidity is an interactive shell with lightweight session recording and remote compiler support. When you change the solidity pragma/language, it automatically fetches a matching remote compiler. + +![][22] + +**Features of Solidity** + +- `pragma solidity ` attempts to dynamically load the selected compiler version +- Sessions can be saved and restored using the `.session`  command. +- Settings are saved on exit (not safe when running concurrent shells). +- `$_` is a placeholder for the last known result. +- Special commands are dot-prefixed. Everything else is evaluated as Solidity code. + +**Install Solidity** + +You can install solidity shell through npm. + +[Ensure you have the latest version of nodejs][23] and npm installed, then type the following command: + +``` +npm install -g solidity-shell +``` + +Once installed, run **solidity-shell** to start the session. + +[Solidity Shell][24] + +### 9. Yash + +Yash, or yet another shell is a POSIX-compliant command line shell written in C99 (ISO/IEC 9899:1999). It has features for daily interactive and scripting use. + +![][25] + +**Features of Yash Shell** + +- Global aliases +- Socket redirection, pipeline redirection, and process redirection +- Prompt command and command-not-found handler +- Command line completion with predefined completion scripts for more than 100 commands +- Command line prediction based on command history + +**Installing Yash Shell** + +To install the shell, you need to go to their [GitHub releases][26] page and download the tar file. Now extract the tar file; inside it, you will find an INSTALL file with instructions to install it. + +Typically, you should execute the below command inside the extracted folder. + +``` +./configure && make && sudo make install +``` + +[Yash][27] + +### Honorable Mentions + +- **Ion:** [Ion Shell][28] is a modern system shell written in Rust, primarily for **RedoxOS**. It is still a work in progress, and users should expect syntax changes. +- **Closh:** [Closh][29] is a bash-like shell that combines the best of traditional UNIX shells with the power of [Clojure][30]. It aims to be a modern alternative to bash. This, too, is in the early stages of development. +- **Dash**: [Dash][31] is a POSIX-compliant, fast and lightweight shell from Debian. + +💬 _What do you think about these shells listed? Would you experiment by changing the default shell to some of the options here? What's your favorite one? Share your thoughts in the comments box below._ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/shells-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/content/images/2023/01/fish-shell.png +[2]: https://fishshell.com/ +[3]: https://itsfoss.com/microsoft-open-sources-powershell/ +[4]: https://itsfoss.com/gui-cli-tui/ +[5]: https://itsfoss.com/content/images/2023/01/nushell.png +[6]: https://github.com/nushell/nushell +[7]: https://itsfoss.com/homebrew-linux/ +[8]: https://www.nushell.sh/ +[9]: https://itsfoss.com/content/images/2023/01/dunesh.png +[10]: https://itsfoss.com/install-rust-cargo-ubuntu-linux/ +[11]: https://github.com/adam-mcdaniel/dune +[12]: https://itsfoss.com/content/images/2023/01/xonsh.png +[13]: https://itsfoss.com/use-appimage-linux/ +[14]: https://xon.sh/ +[15]: https://itsfoss.com/content/images/2023/01/hilbish.png +[16]: https://rosettea.github.io/Hilbish/ +[17]: https://itsfoss.com/content/images/2023/01/elvish.png +[18]: https://elv.sh/ +[19]: https://itsfoss.com/content/images/2023/01/oh_Shell.png +[20]: https://github.com/michaelmacinnis/oh#linux +[21]: https://github.com/michaelmacinnis/oh +[22]: https://itsfoss.com/content/images/2023/01/solidity-shell.png +[23]: https://itsfoss.com/install-nodejs-ubuntu/ +[24]: https://github.com/tintinweb/solidity-shell +[25]: https://itsfoss.com/content/images/2023/01/yash.png +[26]: https://github.com/magicant/yash/releases/tag/2.53 +[27]: https://yash.osdn.jp/index.html.en +[28]: https://gitlab.redox-os.org/redox-os/ion +[29]: https://github.com/dundalek/closh +[30]: https://clojure.org/ +[31]: https://linuxhandbook.com/dash-shell/ + diff --git a/sources/tech/20230201.1 ⭐️⭐️⭐️ A guide to fuzzy queries with Apache ShardingSphere.md b/sources/tech/20230201.1 ⭐️⭐️⭐️ A guide to fuzzy queries with Apache ShardingSphere.md new file mode 100644 index 0000000000..c27795c9af --- /dev/null +++ b/sources/tech/20230201.1 ⭐️⭐️⭐️ A guide to fuzzy queries with Apache ShardingSphere.md @@ -0,0 +1,423 @@ +[#]: subject: "A guide to fuzzy queries with Apache ShardingSphere" +[#]: via: "https://opensource.com/article/23/2/fuzzy-query-apache-shardingsphere" +[#]: author: "Xiong Gaoxiang https://opensource.com/users/xionggaoxiang" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A guide to fuzzy queries with Apache ShardingSphere +====== + +[Apache ShardingSphere][1] is an open source distributed database and an ecosystem users and developers need for their databases to provide a customized and cloud-native experience. Its [latest release][2] contains many new features, including data encryption integrated with existing SQL workflows. Most importantly, it allows fuzzy queries of the encrypted data. + +### The problem + +By parsing a user's SQL input and rewriting the SQL according to the user's encryption rules, the original data is encrypted and stored with ciphertext data in the underlying database simultaneously. + +When a user queries the data, it fetches the ciphertext data from the database, decrypts it, and returns the decrypted original data to the user. However, because the encryption algorithm encrypts the whole string, users cannot run fuzzy queries. + +Nevertheless, many businesses need fuzzy queries after the data is encrypted. In version 5.3.0, Apache ShardingSphere provides users with a default fuzzy query algorithm that supports encrypted fields. The algorithm also supports hot plugging, which users can customize. The fuzzy query can be achieved through configuration. + +### How to achieve fuzzy query in encrypted scenarios + +#### Load data to the in-memory database (IMDB) + +First, load all the data into the IMDB to decrypt it. Then, it'll be like querying the original data. This method can achieve fuzzy queries. If the amount of data is small, this method will prove simple and cost-effective. However, if the quantity of data is large, it'll be a disaster. + +#### Implement encryption and decryption functions consistent with database programs + +The second method is to modify fuzzy query conditions and use the database decryption function to decrypt data first and then implement fuzzy query. This method's advantage is the low cost of implementation, development, and use. + +Users only need to modify the previous fuzzy query conditions slightly. However, the ciphertext and encryption functions are stored together in the database, which cannot cope with the problem of account data leaks. + +Native SQL: + +``` +select * from user where name like "%xxx%" +``` + +After implementing the decryption function: + +``` +ѕеlесt * frоm uѕеr whеrе dесоdе(namе) lіkе "%ххх%" +``` + +#### Store after data masking + +Implement data masking on ciphertext and then store it in a fuzzy query column. This method could lack precision. + +For example, mobile number **13012345678** becomes **130****5678** after the masking algorithm is performed. + +#### Perform encrypted storage after tokenization and combination + +This method performs tokenization and combination on ciphertext data and then encrypts the resultset by grouping characters with fixed length and splitting a field into multiple ones. For example, we take four English characters and two Chinese characters as a query condition: **ningyu1** uses the four-character as a group to encrypt, so the first group is **ning**, the second group **ingy**, the third group **ngyu**, the fourth group **gyu1**, and so on. All the characters are encrypted and stored in the fuzzy query column. If you want to retrieve all data that contains four characters, such as **ingy**, encrypt the characters and use a key `like"%partial%"` to query. + +Shortcomings: + +- Increased storage costs: Free grouping will increase the amount of data, and the data length will increase after being encrypted. +- Limited length in fuzzy query: Due to security issues, the length of free grouping cannot be too short or the [rainbow table][3] will easily crack it. Like the example I mentioned above, the length of fuzzy query characters must be greater than or equal to four letters/digits or two Chinese characters. + +#### Single-character digest algorithm (default fuzzy query algorithm provided in ShardingSphere version 5.3.0) + +Although the above methods are all viable, it's only natural to wonder if there's a better alternative. In our community, we find that single-character encryption and storage can balance performance and query but fails to meet security requirements. + +So what's the ideal solution? Inspired by masking algorithms and cryptographic hash functions, we find that data loss and one-way functions can be used. + +The cryptographic hash function should have the following four features: + +- It should be easy to calculate the hash value for any given message. +- It should be difficult to infer the original message from a known hash value. +- It should not be feasible to modify the message without changing the hash value. +- There should only be a very low chance that two different messages produce the same hash value. + +Security: Because of the one-way function, it's impossible to infer the original message. To improve the accuracy of the fuzzy query, we want to encrypt a single character, but the rainbow table will crack it. + +So we take a one-way function (to ensure every character is the same after encryption) and increase the frequency of collisions (to ensure every string is **1: N** backward), which greatly enhances security. + +### Fuzzy query algorithm + +Apache ShardingSphere implements a universal fuzzy query algorithm using the below single-character digest algorithm `org.apache.shardingsphere.encrypt.algorithm.like.CharDigestLikeEncryptAlgorithm`. + +``` +public final class CharDigestLikeEncryptAlgorithm implements LikeEncryptAlgorithm { + + private static final String DELTA = "delta"; + + private static final String MASK = "mask"; + + private static final String START = "start"; + + private static final String DICT = "dict"; + + private static final int DEFAULT_DELTA = 1; + + private static final int DEFAULT_MASK = 0b1111_0111_1101; + + private static final int DEFAULT_START = 0x4e00; + + private static final int MAX_NUMERIC_LETTER_CHAR = 255; + + @Getter + private Properties props; + + private int delta; + + private int mask; + + private int start; + + private Map charIndexes; + + @Override + public void init(final Properties props) { + this.props = props; + delta = createDelta(props); + mask = createMask(props); + start = createStart(props); + charIndexes = createCharIndexes(props); + } + + private int createDelta(final Properties props) { + if (props.containsKey(DELTA)) { + String delta = props.getProperty(DELTA); + try { + return Integer.parseInt(delta); + } catch (NumberFormatException ex) { + throw new EncryptAlgorithmInitializationException("CHAR_DIGEST_LIKE", "delta can only be a decimal number"); + } + } + return DEFAULT_DELTA; + } + + private int createMask(final Properties props) { + if (props.containsKey(MASK)) { + String mask = props.getProperty(MASK); + try { + return Integer.parseInt(mask); + } catch (NumberFormatException ex) { + throw new EncryptAlgorithmInitializationException("CHAR_DIGEST_LIKE", "mask can only be a decimal number"); + } + } + return DEFAULT_MASK; + } + + private int createStart(final Properties props) { + if (props.containsKey(START)) { + String start = props.getProperty(START); + try { + return Integer.parseInt(start); + } catch (NumberFormatException ex) { + throw new EncryptAlgorithmInitializationException("CHAR_DIGEST_LIKE", "start can only be a decimal number"); + } + } + return DEFAULT_START; + } + + private Map createCharIndexes(final Properties props) { + String dictContent = props.containsKey(DICT) && !Strings.isNullOrEmpty(props.getProperty(DICT)) ? props.getProperty(DICT) : initDefaultDict(); + Map result = new HashMap<>(dictContent.length(), 1); + for (int index = 0; index < dictContent.length(); index++) { + result.put(dictContent.charAt(index), index); + } + return result; + } + + @SneakyThrows + private String initDefaultDict() { + InputStream inputStream = CharDigestLikeEncryptAlgorithm.class.getClassLoader().getResourceAsStream("algorithm/like/common_chinese_character.dict"); + LineProcessor lineProcessor = new LineProcessor() { + + private final StringBuilder builder = new StringBuilder(); + + @Override + public boolean processLine(final String line) { + if (line.startsWith("#") || 0 == line.length()) { + return true; + } else { + builder.append(line); + return false; + } + } + + @Override + public String getResult() { + return builder.toString(); + } + }; + return CharStreams.readLines(new InputStreamReader(inputStream, Charsets.UTF_8), lineProcessor); + } + + @Override + public String encrypt(final Object plainValue, final EncryptContext encryptContext) { + return null == plainValue ? null : digest(String.valueOf(plainValue)); + } + + private String digest(final String plainValue) { + StringBuilder result = new StringBuilder(plainValue.length()); + for (char each : plainValue.toCharArray()) { + char maskedChar = getMaskedChar(each); + if ('%' == maskedChar) { + result.append(each); + } else { + result.append(maskedChar); + } + } + return result.toString(); + } + + private char getMaskedChar(final char originalChar) { + if ('%' == originalChar) { + return originalChar; + } + if (originalChar <= MAX_NUMERIC_LETTER_CHAR) { + return (char) ((originalChar + delta) & mask); + } + if (charIndexes.containsKey(originalChar)) { + return (char) (((charIndexes.get(originalChar) + delta) & mask) + start); + } + return (char) (((originalChar + delta) & mask) + start); + } + + @Override + public String getType() { + return "CHAR_DIGEST_LIKE"; + } +} +``` + +- Define the binary `mask` code to lose precision `0b1111_0111_1101` (mask). +- Save common Chinese characters with disrupted order like a `map` dictionary. +- Obtain a single string of `Unicode` for digits, English, and Latin. +- Obtain an `index` for a Chinese character belonging to a dictionary. +- Other characters fetch the `Unicode` of a single string. +- Add `1 (delta)`to the digits obtained by different types above to prevent any original text from appearing in the database. +- Then convert the offset `Unicode` into binary, perform the `AND` operation with `mask`, and carry out a two-bit digit loss. +- Directly output digits, English, and Latin after the loss of precision. +- The remaining characters are converted to decimal and output with the common character `start` code after the loss of precision. + +### The fuzzy algorithm development progress + +#### The first edition + +Simply use `Unicode` and `mask` code of common characters to perform the `AND` operation. + +``` +Mask: 0b11111111111001111101 +The original character: 0b1000101110101111讯 +After encryption: 0b1000101000101101設 +``` + +Assuming we know the key and encryption algorithm, the original string after a backward pass is: + +``` +1.0b1000101100101101 謭 +2.0b1000101100101111 謯 +3.0b1000101110101101 训 +4.0b1000101110101111 讯 +5.0b1000101010101101 読 +6.0b1000101010101111 誯 +7.0b1000101000101111 訯 +8.0b1000101000101101 設 +``` + +Based on the missing bits, we find that each string can be derived `2^n` Chinese characters backward. When the `Unicode` of common Chinese characters is decimal, their intervals are very large. Notice that the Chinese characters inferred backward are not common characters, and it's more likely to infer the original characters. + +![Inference of Chinese characters][4] + +#### The second edition + +The interval of common Chinese characters in `Unicode` is irregular. We planned to leave the last few bits of Chinese characters in `Unicode` and convert them into decimal as an `index` to fetch some common Chinese characters. This way, when the algorithm is known, uncommon characters won't appear after a backward pass, and distractors are no longer easy to eliminate. + +If we leave the last few bits of Chinese characters in `Unicode`, it has something to do with the relationship between the accuracy of fuzzy query and anti-decryption complexity. The higher the accuracy, the lower the decryption difficulty. + +Let's take a look at the collision degree of common Chinese characters under our algorithm: + +1. When `mask`=0b0011_1111_1111: + +![Mask results][5] + +2. When `mask`=0b0001_1111_1111: + +![Mask results][6] + +For the mantissa of Chinese characters, leave 10 and 9 digits. The 10-digit query is more accurate because its collision is much weaker. Nevertheless, if the algorithm and the key are known, the original text of the 1:1 character can be derived backward. + +The nine-digit query is less accurate because nine-digit collisions are relatively stronger, but there are fewer 1:1 characters. Although we change the collisions regardless of whether we leave ten or nine digits, the distribution is unbalanced due to the irregular `Unicode` of Chinese characters. The overall collision probability cannot be controlled. + +#### The third edition + +In response to the unevenly distributed problem found in the second edition, we take common characters with disrupted order as the dictionary table. + +1. The encrypted text first looks up the `index` in the out-of-order dictionary table. We use the `index` and subscript to replace the `Unicode` without rules. Use `Unicode` in case of uncommon characters. (Note: Evenly distribute the code to be calculated as far as possible.) + +2. The next step is to perform the `AND` operation with a `mask` and lose two-bit precision to increase the frequency of collisions. + +Let's take a look at the collision degree of common Chinese characters under our algorithm: + +1. When `mask`=0b1111_1011_1101: + +![Mask results][7] + +2. When `mask`=0b0111_1011_1101: + +![Mask results][8] + +When the `mask` leaves 11 bits, you can see that the collision distribution is concentrated at 1:4. When the `mask` leaves ten bits, the number becomes 1:8. At this time, we only need to adjust the number of precision losses to control whether the collision is 1:2, 1:4 or 1:8. + +If the `mask` is selected as 1, and the algorithm and key are known, there will be a 1:1 Chinese character because we calculate the collision degree of common characters at this time. If we add the missing four bits before the 16-bit binary of Chinese characters, the situation becomes `2^5=32` cases. + +Since we encrypt the whole text, even if the individual character is inferred backward, there will be little impact on overall security and will not cause mass data leaks. At the same time, the premise of backward pass is to know the algorithm, key, `delta`, and dictionary, so it's impossible to achieve from the data in the database. + +### How to use fuzzy query + +Fuzzy query requires the configuration of `encryptors` (encryption algorithm configuration), `likeQueryColumn` (fuzzy query column name), and `likeQueryEncryptorName` (encryption algorithm name of fuzzy query column ) in the encryption configuration. + +Please refer to the following configuration. Add your own sharding algorithm and data source. + +``` +dataSources: + ds_0: + dataSourceClassName: com.zaxxer.hikari.HikariDataSource + driverClassName: com.mysql.jdbc.Driver + jdbcUrl: jdbc:mysql://127.0.0.1:3306/test?allowPublicKeyRetrieval=true + username: root + password: root + +rules: +- !ENCRYPT + encryptors: + like_encryptor: + type: CHAR_DIGEST_LIKE + aes_encryptor: + type: AES + props: + aes-key-value: 123456abc + tables: + user: + columns: + name: + cipherColumn: name + encryptorName: aes_encryptor + assistedQueryColumn: name_ext + assistedQueryEncryptorName: aes_encryptor + likeQueryColumn: name_like + likeQueryEncryptorName: like_encryptor + phone: + cipherColumn: phone + encryptorName: aes_encryptor + likeQueryColumn: phone_like + likeQueryEncryptorName: like_encryptor + queryWithCipherColumn: true + + +props: + sql-show: true +``` + +Insert + +``` +Logic SQL: insert into user ( id, name, phone, sex) values ( 1, '熊高祥', '13012345678', '男') +Actual SQL: ds_0 ::: insert into user ( id, name, name_ext, name_like, phone, phone_like, sex) values (1, 'gyVPLyhIzDIZaWDwTl3n4g==', 'gyVPLyhIzDIZaWDwTl3n4g==', '佹堝偀', 'qEmE7xRzW0d7EotlOAt6ww==', '04101454589', '男') +``` + +Update + +``` +Logic SQL: update user set name = '熊高祥123', sex = '男1' where sex ='男' and phone like '130%' +Actual SQL: ds_0 ::: update user set name = 'K22HjufsPPy4rrf4PD046A==', name_ext = 'K22HjufsPPy4rrf4PD046A==', name_like = '佹堝偀014', sex = '男1' where sex ='男' and phone_like like '041%' +``` + +Select + +``` +Logic SQL: select * from user where (id = 1 or phone = '13012345678') and name like '熊%' +Actual SQL: ds_0 ::: select `user`.`id`, `user`.`name` AS `name`, `user`.`sex`, `user`.`phone` AS `phone`, `user`.`create_time` from user where (id = 1 or phone = 'qEmE7xRzW0d7EotlOAt6ww==') and name_like like '佹%' +``` + +Select: federated table sub-query + +``` +Logic SQL: select * from user LEFT JOIN user_ext on user.id=user_ext.id where user.id in (select id from user where sex = '男' and name like '熊%') +Actual SQL: ds_0 ::: select `user`.`id`, `user`.`name` AS `name`, `user`.`sex`, `user`.`phone` AS `phone`, `user`.`create_time`, `user_ext`.`id`, `user_ext`.`address` from user LEFT JOIN user_ext on user.id=user_ext.id where user.id in (select id from user where sex = '男' and name_like like '佹%') +``` + +Delete + +``` +Logic SQL: delete from user where sex = '男' and name like '熊%' +Actual SQL: ds_0 ::: delete from user where sex = '男' and name_like like '佹%' +``` + +The above example demonstrates how fuzzy query columns rewrite SQL in different SQL syntaxes to support fuzzy queries. + +### Wrap up + +This article introduced you to the working principles of fuzzy query and used specific examples to demonstrate how to use it. I hope that through this article, you will have a basic understanding of fuzzy queries. + +_This article was originally published on [Medium][9] and has been republished with the author's permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/fuzzy-query-apache-shardingsphere + +作者:[Xiong Gaoxiang][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/xionggaoxiang +[b]: https://github.com/lkxed +[1]: https://shardingsphere.apache.org/ +[2]: https://opensource.com/article/23/1/apache-shardingsphere-new-features +[3]: https://www.techtarget.com/whatis/definition/rainbow-table +[4]: https://opensource.com/sites/default/files/2023-01/41chinesecharacters.jpg +[5]: https://opensource.com/sites/default/files/2023-01/42-1-characters.jpg +[6]: https://opensource.com/sites/default/files/2023-01/42-2-characters.jpg +[7]: https://opensource.com/sites/default/files/2023-01/43-1-characters.png +[8]: https://opensource.com/sites/default/files/2023-01/43-2-characters.png +[9]: https://medium.com/codex/fuzzy-query-for-ciphercolumn-shardingsphere-5-3-0-deep-dive-ad09faea67d3 diff --git a/sources/tech/20230206.2 ⭐️⭐️ Reinvent your release strategy with an API gateway.md b/sources/tech/20230206.2 ⭐️⭐️ Reinvent your release strategy with an API gateway.md new file mode 100644 index 0000000000..53b2491906 --- /dev/null +++ b/sources/tech/20230206.2 ⭐️⭐️ Reinvent your release strategy with an API gateway.md @@ -0,0 +1,87 @@ +[#]: subject: "Reinvent your release strategy with an API gateway" +[#]: via: "https://opensource.com/article/23/2/api-gateway" +[#]: author: "Bobur Umurzokov https://opensource.com/users/iambobur" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Reinvent your release strategy with an API gateway +====== + +One benefit of moving to an API-based architecture is that you can iterate quickly and deploy new changes to our services. There is also the concept of traffic and routing established with an API gateway for the modernized part of the architecture. API gateway provides stages to allow you to have multiple deployed APIs behind the same gateway and is capable of in-place updates with no downtime. Using an API gateway enables you to leverage the service's numerous API management features, such asauthentication, ratethrottling, observability, multiple API versioning, and stage deployment management (deploying an API in multiple stages such as dev, test, stage, and prod). + +Open source API gateway ([Apache APISIX][1] and [Traefik][2]) and service mesh ([Istio][3] and Linkerd) solutions are capable of doing traffic splitting and implementing functionalities like canary release and [blue green deployment][4]. With canary testing, you can make a critical examination of a new release of an API by selecting only a small portion of your user base. + +### What is a canary release? + +A canary release introduces a new version of the API and flows a small percentage of the traffic to the canary. In API gateways, traffic splitting makes it possible to gradually shift or migrate traffic from one version of a target service to another. For example, a new version, `v1.1`, of a service can be deployed alongside the original, `v1.0`. Traffic shifting enables you to canary test or release your new service by at first only routing a small percentage of user traffic, say `1%`, to `v1.1`, then shifting all of your traffic over time to the new service. + +![Image of the API Canary release.][5] + +This allows you to monitor the new service, look for technical problems, such as increased latency or error rates, and look for the desired business impact. This includes checking for an increase in key performance indicators like customer conversion ratio or the average shopping checkout value. Traffic splitting enables you to run A/B or multivariate tests by dividing traffic destined for a target service between multiple versions of the service. For example, you can split traffic `50/50` across your `v1.0` and `v1.1` of the target service and see which performs better over a specific period of time. Learn more about the traffic split feature in Apache APISIX Ingress Controller. + +When appropriate, canary releases are an excellent option, as the percentage of traffic exposed to the canary is highly controlled. The trade-off is that the system must have good monitoring in place to be able to quickly identify an issue and roll back if necessary (which can be automated). This guide shows you how to use [Apache APISIX and Flagger][6] to quickly implement a canary release solution. + +![Image showing API traffic splitting.][7] + +### Traffic mirroring + +In addition to using traffic splitting to run experiments, you can also use traffic mirroring to copy or duplicate traffic. You can send this to an additional location or a series of locations. Frequently with traffic mirroring, the results of the duplicated requests are not returned to the calling service or end user. Instead, the responses are evaluated out-of-band for correctness. For instance, it compares the results generated by a refactored and existing service. + +![Image showing API traffic mirroring.][8] + +Using traffic mirroring enables you to "dark release" services, where a user is kept in the dark about the new release, but you can internally observe for the required effect. + +Implementing traffic mirroring at the edge of systems has become increasingly popular over the years. APISIX offers the [proxy-mirror][9] plugin to mirror client requests. It duplicates the real online traffic to the mirroring service and enables specific analysis of the online traffic or request content without interrupting the online service. + +### What is a blue green deployment? + +Blue green deployment is usually implemented at a point in the architecture that uses a router, gateway, or load balancer. Behind this sits a complete blue environment and a green environment. The current blue environment represents the current live environment, and the green environment represents the next version of the stack. The green environment is checked prior to switching to live traffic. When it goes live, the traffic is flipped over from blue to green. The blue environment is now off, but if a problem is spotted the rollback is quick. The next change is to go from green to blue, oscillating from the first release onward. + +![Image showing Blue and Green release strategies.][10] + +Blue green works well due to its simplicity, and it is one of the better deployment options for coupled services. It is also easier to manage persisting services, though you still need to be careful in the event of a rollback. It also requires double the number of resources to be able to run cold in parallel to the currently active environment. + +### Traffic management with Argo Rollouts + +The strategies discussed add a lot of value, but the rollout itself is a task that you would not want to have to manage manually. This is where a tool such as [Argo Rollouts][11] is valuable for demonstrating some of the concerns discussed. + +Using Argo, it is possible to define a [Rollout CRD][12] that represents the strategy you can take for rolling out a new canary of your API. A custom resource definition (CRD) allows Argo to extend the Kubernetes API to support rollout behavior. CRDs are a popular pattern with Kubernetes. They allow the user to interact with one API with the extension to support different features. + +You can use the Apache APISIX and Apache APISIX Ingress Controller for traffic management with Argo Rollouts. This [guide][13] shows you how to integrate `ApisixRoute` with Argo Rollouts using it as a weighted round-robin load balancer. + +### Summary + +The ability to separate the deployment and release of service (and corresponding API) is a powerful technique, especially with the rise in the progressive delivery approach. A canary release service can make use of the API gateway traffic split and mirroring features, and provides a competitive advantage. This helps your business with both mitigating risk of a bad release and also understanding your customer's requirements. + +_This article was originally published on the [API7.ai blog][14] and has been republished with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/api-gateway + +作者:[Bobur Umurzokov][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/iambobur +[b]: https://github.com/lkxed +[1]: https://apisix.apache.org/ +[2]: https://opensource.com/article/20/3/kubernetes-traefik +[3]: https://www.redhat.com/architect/istio-CNI-plugin +[4]: https://www.redhat.com/en/topics/devops/what-is-blue-green-deployment?intcmp=7013a000002qLH8AAM +[5]: https://opensource.com/sites/default/files/2023-01/ApiCanaryrelease.png +[6]: https://github.com/fluxcd/flagger/blob/6c29c2118478a69207e2ff23a7afe6006f5518dc/docs/gitbook/tutorials/apisix-progressive-delivery.md +[7]: https://opensource.com/sites/default/files/2023-01/APITrafficsplitting.png +[8]: https://opensource.com/sites/default/files/2023-01/APItrafficMirroring.png +[9]: https://apisix.apache.org/docs/apisix/plugins/proxy-mirror +[10]: https://opensource.com/sites/default/files/2023-01/APIBLueGreen.png +[11]: https://argoproj.github.io/argo-rollouts/ +[12]: https://argoproj.github.io/argo-rollouts/concepts/ +[13]: https://argoproj.github.io/argo-rollouts/features/traffic-management/apisix/ +[14]: https://api7.ai/blog/api-release-strategies-with-api-gateway diff --git a/sources/tech/20230208.1 ⭐️⭐️ Improve your coding skills with temporal values in MySQL.md b/sources/tech/20230208.1 ⭐️⭐️ Improve your coding skills with temporal values in MySQL.md new file mode 100644 index 0000000000..11df777198 --- /dev/null +++ b/sources/tech/20230208.1 ⭐️⭐️ Improve your coding skills with temporal values in MySQL.md @@ -0,0 +1,229 @@ +[#]: subject: "Improve your coding skills with temporal values in MySQL" +[#]: via: "https://opensource.com/article/23/2/temporal-values-mysql" +[#]: author: "Hunter Coleman https://opensource.com/users/hunterc" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Improve your coding skills with temporal values in MySQL +====== + +Both new and experienced users of the popular MySQL database system can often get confused about how temporal values are handled by the database. Sometimes users don't bother learning much about temporal value data types. This may be because they think there isn't much to know about them. A date is a date, right? Well, not always. Taking a few minutes to learn how MySQL stores and displays dates and times is beneficial. Learning how to best take advantage of the temporal values in your database tables can help make you a better coder. + +### MySQL temporal data types + +When you are building your tables in MySQL, you choose the proper data type which most efficiently holds the data you intend to insert into the table (`INT`, `FLOAT`, `CHAR`,and so on). MySQL provides you with five data types for temporal values. They are: `DATE`, `TIME`, `DATETIME`, `TIMESTAMP`, and `YEAR`. + +MySQL uses the `ISO 8601` format to store the values in the following formats: + +- **DATE**  YYYY-MM-DD +- **TIME**   HH:MM:SS +- **TIMESTAMP** YYYY-MM-DD  HH:MM:SS +- **YEAR** YYYY + +### Datetime compared to Timestamp + +You may have noticed that the `DATETIME` and `TIMESTAMP` data types hold the same data. You might wonder if there are any differences between the two. There are differences. + +First, the range of dates that can be used differ. `DATETIME` can hold dates between 1000-01-01 00:00:00 and 9999-12-31 23:59:59, whereas `TIMESTAMP` has a much more limited range of 1970-01-01 00:00:01 to 2038-01-19 03:14:07 UTC. + +Second, while both data types allow you to `auto_initialize` or `auto_update` their respective values (with `DEFAULT CURRENT_TIMESTAMP` and `ON UPDATE CURRENT_TIMESTAMP` respectively), doing so was not available for `DATETIME` values until version 5.6.5. You can use one of the MySQL synonyms for `CURRENT_TIMESTAMP` if you choose, such as `NOW()` or `LOCALTIME()`. + +If you use `ON UPDATE CURENT_TIMESTAMP` (or one of its synonyms) for a `DATETIME` value, but do not use the `DEFAULT CURRENT_TIMESTAMP` clause, then the column will default to `NULL`. This happens unless you include `NOT NULL` in the table definition, in which case it defaults to zero. + +Another important thing to keep in mind is that although normally neither a `DATETIME` nor a `TIMESTAMP` column have a default value unless you declare one, there is one exception to this rule. The first `TIMESTAMP` column in your table is implicitly created with both `DEFAULT CURRENT_TIMESTAMP` and `ON UPDATE CURRENT_TIMESTAMP` clauses if neither is specified and if the variable `explicit_defaults_for_timestamp` is disabled. + +To check this variable's status, run: + +``` +mysql> show variables like 'explicit_default%'; +``` + +If you want to turn it on or off, run this code, using 0 for off and 1 for on: + +``` +mysql> set explicit_defaults_for_timestamp = 0; +``` + +### Time + +MySQL's `TIME` data type may seem simple enough, but there are a few things that a good programmer should keep in mind. + +First, be aware that although time is often thought of as the time of day, it is in fact elapsed time. In other words, it can be a negative value or can be greater than 23:59:59. A `TIME` value in MySQL can be in the range of -838:59:59 to 838:59:59. + +Also, if you abbreviate a time value, MySQL interprets it differently depending on whether you use a colon. For example, the value 10:34 is seen by MySQL as 10:34:00. That is, 34 minutes past ten o'clock. But if you leave out the colon, 1034', MySQL sees that as 00:10:34. That is, ten minutes and 34 seconds. + +Finally, you should know that `TIME` values (as well as the time portion of `DATETIME` and `TIMESTAMP` columns) can, as of version 5.6.4, take a fractional unit. To use it, add an integer (max value six) in parentheses at the end of the data type definition. + +``` +time_column TIME(2) +``` + +### Time zones + +Time zone changes not only cause confusion and fatigue in the real world, but have also been known to cause problems in database systems. The earth is divided into 24 separate time zones which usually change with every 15 degrees of longitude. I say usually because some nations choose to do things differently. China, for example, operates under a single time zone instead of the five that would be expected. + +The question is, how do you handle users of a database system who are in different time zones. Fortunately, MySQL doesn't make this too difficult. + +To check your session time zone, run: + +``` +mysql> select @@session.time_zone; +``` + +If it says `System`, that means that it is using the timezone set in your `my.cnf`configuration file. If you are running your MsSQL server on your local computer, this is probably what you'll get, and you don't need to make any changes. + +If you would like to change your session's time zone, run a command such as: + +``` +mysql> set time_zone = '-05:00'; +``` + +This sets your time zone to five hours behind UTC. (US/Eastern). + +### Getting the day of the week + +To follow along with the code in the rest of this tutorial, you should create a table with date values on your system. For example: + +``` +mysql> create table test +( row_id smallint not null auto_increment primary key, +the_date date not null); +``` + +Then insert some random dates into the table using the ISO 8601 format, such as: + +``` +mysql> insert into test (the_date) VALUES ('2022-01-05'); +``` + +I put four rows of date values in my test table, but put as few or as many as you'd like. + +Sometimes you may wish to know what day of the week a particular day happened to be. MySQL gives you a few options. + +The first, and perhaps most obvious way, is to use the `DAYNAME()` function. Using the example table, `DAYNAME()` tells you the day of the week for each of the dates: + +``` +mysql> SELECT the_date, DAYNAME(the_date) FROM test ; ++------------+-------------------------------+ +| the_date | DAYNAME(the_date) | ++------------+-------------------------------+ +| 2021-11-02 | Tuesday | +| 2022-01-05 | Wednesday | +| 2022-05-03 | Tuesday | +| 2023-01-13 | Friday | ++------------+-------------------------------+ +4 rows in set (0.00 sec) +``` + +The other two methods for getting the day of the week return integer values instead of the name of the day. They are `WEEKDAY()`and `DAYOFWEEK()`. They both return numbers, but they do not return the same number. The `WEEKDAY()` function returns a number from 0 to 6, with 0 being Monday and 6 being Sunday. On the other hand, `DAYOFWEEK()` returns a number from 1 to 7, with 1 being Sunday and 7 being Saturday. + +``` +mysql> SELECT the_date, DAYNAME(the_date), +WEEKDAY(the_date), DAYOFWEEK(the_date) FROM test; ++------------+------------------+------------------+--------------------+ +| the_date | DAYNAME(the_date)| WEEKDAY(the_date)| DAYOFWEEK(the_date)| +| 2021-11-02 | Tuesday | 1 | 3 | +| 2022-01-05 | Wednesday | 2 | 4 | +| 2022-05-03 | Tuesday | 1 | 3 | +| 2023-01-13 | Friday | 4 | 6 | ++------------+------------------+------------------+--------------------+ +4 rows in set (0.00 sec) +``` + +### When you only want part of the date + +Sometimes you may have a date stored in your MySQL table, but you only wish to access a portion of the date. This is no problem. + +There are several conveniently-named functions in MySQL that allow for easy access to a particular portion of a date object. To show just a few examples: + +``` +mysql> SELECT the_date, YEAR(the_date), MONTHNAME(the_date),  +DAYOFMONTH(the_date) FROM test ; ++-----------+---------------+-------------------+---------------------+ +| the_date | YEAR(the_date)|MONTHNAME(the_date)| DAYOFMONTH(the_date)| ++-----------+---------------+-------------------+---------------------+ +| 2021-11-02| 2021 | November | 2 | +| 2022-01-05| 2022 | January | 5 | +| 2022-05-03| 2022 | May | 3 | +| 2023-01-13| 2023 | January | 13 | ++-----------+---------------+-------------------+---------------------+ +4 rows in set (0.00 sec) +``` + +MySQL also allows you to use the `EXTRACT() function` to access a portion of a date. The arguments you provide to the function are a unit specifier (be sure that it's singular), `FROM`, and the column name. So, to get just the year from our test table, you could write: + +``` +mysql> SELECT EXTRACT(YEAR FROM the_date) FROM test; ++----------------------------------------------+ +| EXTRACT(YEAR FROM the_date) | ++----------------------------------------------+ +| 2021 | +| 2022 | +| 2022 | +| 2023 | ++----------------------------------------------+ +4 rows in set (0.01 sec) +``` + +### Inserting and reading dates with different formats + +As mentioned earlier, MySQL stores date and time values using the `ISO 8601` format. But what if you want to store date and time values another way, such as MM-DD-YYYY for dates? Well, first off, don't try. MySQL stores dates and times in the `8601 format` and that's the way it is. Don't try to change that. However, that doesn't mean you have to convert your data to that particular format before you enter it into your database, or that you cannot display the data in whatever format you desire. + +If you would like to enter a date into your table that is formatted in a non-ISO way, you can use `STR_TO_DATE()`. The first argument is the string value of the date you want to store in your database. The second argument is the formatting string which lets MySQL know how the date is organized. Let's look at a quick example, and then I'll delve a little deeper into what that odd-looking formatting string is all about. + +``` +mysql> insert into test (the_date) values (str_to_date('January 13, 2023','%M %d, %Y')); + +Query OK, 1 row affected (0.00 sec) +``` + +You put the formatting string in quotes, and precede each of the special characters with a percent sign. The format sequence in the above code tells MySQL that my date consists of a full month name `(%M)`, followed by a two-digit day `(%d)`, then a comma, and finally a four-digit year `(%Y)`. Note that capitalization matters. + +Some of the other commonly used formatting string characters are: + +- `%b` abbreviated month name (example: Jan) +- `%c` numeric month (example: 1) +- `%W` name of day (example: Saturday) +- `%a` abbreviated name of day (example: Sat) +- `%T` 24-hour time (example: 22:01:22) +- `%r` 12-hour time with AM/PM (example: 10:01:22 PM) +- `%y` 2-digit year (example: 23) + +Note that for the 2-digit year (`%y`) the range of years is 1970 to 2069. So numbers from 70 through 99 are assumed 20th century, while numbers from 00 to 69 are assumed to be 21st century. + +If you have a date stored in your database, and you would like to display it using a different format, you can use the `DATE_FORMAT()` function: + +``` +mysql> SELECT DATE_FORMAT(the_date, '%W, %b. %d, %y') FROM test; ++-----------------------------------------+ +| DATE_FORMAT(the_date, '%W, %b. %d, %y') | ++-----------------------------------------+ +| Tuesday, Nov. 02, 21 | +| Wednesday, Jan. 05, 22 | +| Tuesday, May. 03, 22 | +| Friday, Jan. 13, 23 | ++-----------------------------------------+ +4 rows in set (0.00 sec) +``` + +### Conclusion + +This tutorial should give you a helpful overview of date and time values in MySQL. I hope that this article has taught you something new that allows you to have both better control and a greater understanding into how your MySQL database handles temporal values. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/temporal-values-mysql + +作者:[Hunter Coleman][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/hunterc +[b]: https://github.com/lkxed/ +[1]: https://opensource.com/downloads/mariadb-mysql-cheat-sheet diff --git a/sources/tech/20230213.0 ⭐️⭐️ Learn Expect by writing and automating a simple game.md b/sources/tech/20230213.0 ⭐️⭐️ Learn Expect by writing and automating a simple game.md new file mode 100644 index 0000000000..362c2ac6c8 --- /dev/null +++ b/sources/tech/20230213.0 ⭐️⭐️ Learn Expect by writing and automating a simple game.md @@ -0,0 +1,251 @@ +[#]: subject: "Learn Expect by writing and automating a simple game" +[#]: via: "https://opensource.com/article/23/2/learn-expect-automate-simple-game" +[#]: author: "James Farrell https://opensource.com/users/jamesf" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Learn Expect by writing and automating a simple game +====== + +While trying to automate my workflow, I hit upon a configuration utility that defied meaningful automation. It was a Java process that didn't support a silent installer, or support `stdin`, and had an inconsistent set of prompts. Ansible's `expect` module was inadequate for this task. But I found that the `expect` command was just the tool for the job. + +My journey to learn Expect meant [learning a bit of Tcl][1]. Now that I have the background to create simple programs, I can better learn to program in Expect. I thought it would be fun to write an article that demonstrates the cool functionality of this venerable utility. + +This article goes beyond the typical simple game format. I plan to use parts of Expect to create the game itself. Then I demonstrate the real power of Expect with a separate script to automate playing the game. + +This programming exercise shows several classic programming examples of variables, input, output, conditional evaluation, and loops. + +### Install Expect + +For Linux based systems use: + +``` +$ sudo dnf install expect +$ which expect +/bin/expect +``` + +I found that my version of Expect was included in the base operating system of macOS: + +``` +$ which expect +/usr/bin/expect +``` + +On macOS, you can also load a slightly newer version using brew: + +``` +$ brew install expect +$ which expect +/usr/local/bin/expect +``` + +### Guess the number in Expect + +The number guessing game using Expect is not that different from the base Tcl I used in my [previous article][1]. + +All things in Tcl are strings, including variable values. Code lines are best contained by curly braces (Instead of trying to use line continuation). Square brackets are used for command substitution. Command substitution is useful for deriving values from other functions. It can be used directly as input where needed. You can see all of this in the subsequent script. + +Create a new game file `numgame.exp`, set it to be executable, and then enter the script below: + +``` +#!/usr/bin/expect + +proc used_time {start} { + return [expr [clock seconds] - $start] +} + +set num [expr round(rand()*100)] +set starttime [clock seconds] +set guess -1 +set count 0 + +send "Guess a number between 1 and 100\n" + +while { $guess != $num } { + incr count + send "==> " + + expect { + -re "^(\[0-9]+)\n" { + send "Read in: $expect_out(1,string)\n" + set guess $expect_out(1,string) + } + + -re "^(.*)\n" { + send "Invalid entry: $expect_out(1,string) " + } + } + + if { $guess < $num } { + send "Too small, try again\n" + } elseif { $guess > $num } { + send "Too large, try again\n" + } else { + send "That's right!\n" + } +} + +set used [used_time $starttime] + +send "You guessed value $num after $count tries and $used elapsed seconds\n" +``` + +Using `proc` sets up a function (or procedure) definition. This consists of the name of the function, followed by a list containing the parameters (1 parameter `{start}`) and then followed by the function body. The return statement shows a good example of nested Tcl command substitution. The `set` statements define variables. The first two use command substitution to store a random number and the current system time in seconds. + +The `while` loop and if-elseif-else logic should be familiar. Note again the particular placement of the curly braces to help group multiple command strings together without needing line continuation. + +The big difference you see here (from the previous Tcl program) is the use of the functions `expect` and `send` rather than using `puts` and `gets`. Using `expect` and `send` form the core of Expect program automation. In this case, you use these functions to automate a human at a terminal. Later you can automate a real program. Using the `send` command in this context isn't much more than printing information to screen. The `expect` command is a bit more complex. + +The `expect` command can take a few different forms depending on the complexity of your processing needs. The typical use consists of one of more pattern-action pairs such as: + +``` +expect "pattern1" {action1} "pattern2" {action2} +``` + +More complex needs can place multiple pattern action pairs within curly braces optionally prefixed with options that alter the processing logic. The form I used above encapsulates multiple pattern-action pairs. It uses the option `-re` to apply regex processing (instead of glob processing) to the pattern. It follows this with curly braces encapsulating one or more statements to execute. I've defined two patterns above. The first is Is intended to match a string of 1 or more numbers: + +``` +"^(\[0-9]+)\n" +``` + +The second pattern is designed to match anything else that is not a string of numbers: + +``` +"^(.*)\n" +``` + +Take note that this use of `expect` is executed repeatedly from within a `while` statement. This is a perfectly valid approach to reading multiple entries. In the automation, I show a slight variation of Expect that does the iteration for you. + +Finally, the `$expect_out` variable is an array used by `expect` to hold the results of its processing. In this case, the variable `$expect_out(1,string)` holds the first captured pattern of the regex. + +### Run the game + +There should be no surprises here: + +``` +$ ./numgame.exp +Guess a number between 1 and 100 +==> Too small, try again +==> 100 +Read in: 100 +Too large, try again +==> 50 +Read in: 50 +Too small, try again +==> 75 +Read in: 75 +Too small, try again +==> 85 +Read in: 85 +Too large, try again +==> 80 +Read in: 80 +Too small, try again +==> 82 +Read in: 82 +That's right! +You guessed value 82 after 8 tries and 43 elapsed seconds +``` + +One difference you may notice is the impatiencethis version exhibits. If you hesitate long enough, expect timeouts with an invalid entry. It then prompts you again. This is different from `gets` which waits indefinitely. The `expect` timeout is a configurable feature. It helps deal with hung programs or during an unexpected output. + +### Automate the game in Expect + +For this example, the Expect automation script needs to be in the same folder as your `numgame.exp` script. Create the `automate.exp` file, make it executable, open your editor, and enter the following: + +``` +#!/usr/bin/expect + +spawn ./numgame.exp + +set guess [expr round(rand()*100)] +set min 0 +set max 100 + +puts "I'm starting to guess using the number $guess" + +expect { + -re "==> " { + send "$guess\n" + expect { + "Too small" { + set min $guess + set guess [expr ($max+$min)/2] + } + "Too large" { + set max $guess + set guess [expr ($max+$min)/2] + } + -re "value (\[0-9]+) after (\[0-9]+) tries and (\[0-9]+)" { + set tries $expect_out(2,string) + set secs $expect_out(3,string) + } + } + exp_continue + } + + "elapsed seconds" +} + +puts "I finished your game in about $secs seconds using $tries tries" +``` + +The `spawn` function executes the program you want to automate. It takes the command as separate strings followed by the arguments to pass to it. I set the initial number to guess, and the real fun begins. The `expect` statement is considerably more complicated and illustrates the power of this utility. Note that there is no looping statement here to iterate over the prompts. Because my game has predictable prompts, I can ask `expect`to do a little more processing for me. The outer `expect` attempts to match the game input prompt of `==>` . Seeing that, it uses `send` to guess and then uses an additional `expect` to figure out the results of the guess. Depending on the output, variables are adjusted and calculated to set up the next guess. When the prompt `==>` is matched, the `exp_continue` statement is invoked. That causes the outer `expect` to be re-evaluated. So a loop here is no longer needed. + +This input processing relies on another behavior of Expect's processing. Expect buffers the terminal output until it matches a pattern. This buffering includes any embedded end of line and other unprintable characters. This is different than the typical regex line matching you are used to with Awk and Perl. When a pattern is matched, anything coming after the match remains in the buffer. It's made available for the next match attempt. I've exploited this to cleanly end the outer `expect` statement: + +``` +-re "value (\[0-9]+) after (\[0-9]+) tries and (\[0-9]+)" +``` + +You can see that the inner pattern matches the correct guess and does not consume all of the characters printed by the game. The very last part of the string (elapsed seconds) is still buffered after the successful guess. On the next evaluation of the outer `expect` , this string is matched from the buffer to cleanly end (no action is supplied). Now for the fun part, let's run the full automation: + +``` +$ ./automate.exp +spawn ./numgame.exp +I'm starting to guess with the number 99 +Guess a number between 1 and 100 +==> 99 +Read in: 99 +Too large, try again +==> 49 +Read in: 49 +Too small, try again +==> 74 +Read in: 74 +Too large, try again +==> 61 +Read in: 61 +Too small, try again +==> 67 +Read in: 67 +That's right! +You guessed value 67 after 5 tries and 0 elapsed seconds +I finished your game in about 0 seconds using 5 tries +``` + +Wow! My number guessing efficiency dramatically increased thanks to automation! A few trial runs resulted in anywhere from 5-8 guesses on average. It also always completed in under 1 second. Now that this pesky, time-consuming fun can be dispatched so quickly, I have no excuse to delay other more important tasks like working on my home-improvement projects :P + +### Never stop learning + +This article was a bit lengthy but well worth the effort. The number guessing game offered a good base for demonstrating a more interesting example of Expect processing. I learned quite a bit from the exercise and was able to complete my work automation successfully. I hope you found this programming example interesting and that it helps you to further your automation goals. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/learn-expect-automate-simple-game + +作者:[James Farrell][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jamesf +[b]: https://github.com/lkxed/ +[1]: https://opensource.com/article/23/2/learn-tcl-writing-simple-game + diff --git a/sources/tech/20230214.0 ⭐️⭐️ Create a modern user interface with the Tkinter Python library.md b/sources/tech/20230214.0 ⭐️⭐️ Create a modern user interface with the Tkinter Python library.md new file mode 100644 index 0000000000..1e62dd5d37 --- /dev/null +++ b/sources/tech/20230214.0 ⭐️⭐️ Create a modern user interface with the Tkinter Python library.md @@ -0,0 +1,337 @@ +[#]: subject: "Create a modern user interface with the Tkinter Python library" +[#]: via: "https://opensource.com/article/23/2/user-interface-tkinter-python" +[#]: author: "Patrik Dufresne https://opensource.com/users/patrik-dufresne" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Create a modern user interface with the Tkinter Python library +====== + +Python's Tkinter library isn't exactly known for its good looks. I've developed a library to help create a modern graphical user interface for Python. + +I spent a lot of time searching for a simple but modern GUI toolkit before developing a new library called TKVue that creates graphical interfaces for desktop applications. Through my research, I realized that there were [several different libraries][1] to create graphical interfaces. However, most involve adding new dependencies to bind with graphical libraries. For example, there's a library for Qt, another for wxWidgets, and a third for GTK. None are native to Python or entirely coded in Python. That's a problem. If you want to code a GUI with Qt, it's necessary to compile the Qt source code on each platform you want to support. I wanted to target the three leading platforms: Linux, Windows, and Mac. + +The big advantage of Tkinter is that it's embedded in Python. There's no need for new dependencies or to compile new libraries. Everything's already done for you. + +In short, it is best to use Tkinter to create something portable. + +### Tkinter with a modern theme + +Creating a GUI with Tkinter is easy, but there's no denying that by default, it looks like a GUI from the 1980s. In addition to creating graphical interfaces that aren't very pleasing to the eye, the programming methodology is also from the 1980s: Programming the Tkinter graphical interface is not declarative. + +Motivated by Tkinter's portability, I was determined to use it to create a professional and modern graphical interface. My research led me to discover a whole system for modifying Tkinter's appearance using [themes][2]. Tkinter themes are similar to the CSS file of a web page. They allow you to configure the appearance of the components that make up the graphical interface by declaring new styles. The creation of these styles requires some work, but the system is flexible enough to allow the creation of a modern-looking graphical interface. This work is similar to customizing a CSS theme in web development. If you create a web page without CSS, the appearance is not modern, and a lot of work is needed to improve it. This is why CSS libraries such as bootstrap are used to speed up the creation of the graphic interface. + +In the Tkinter universe, there is no CSS library. Some pre-existing themes exist, but it's preferable for any project to customize the color palette to match your product branding and give it a web look-and-feel. + +To achieve that, the most important element in creating a modern interface with Tkinter is changing the background color and the buttons' appearance. + +Once properly personalized to your liking, the result is a clean and visually attractive graphical interface. + +Here is the "default" theme: + +![Default theme][3] + +The "clam" theme looks like this: + +![Clam theme][4] + +Then with my personalization: + +![Personalized theme][5] + +**TKVue:** + +``` +import tkvue +import tkinter.ttk as ttk + +tkvue.configure_tk(theme="clam") + + +class RootDialog(tkvue.Component): + template = """ + + +