diff --git a/translated/tech/20180712 An introduction to Go arrays and slices.md b/published/20180712 An introduction to Go arrays and slices.md similarity index 90% rename from translated/tech/20180712 An introduction to Go arrays and slices.md rename to published/20180712 An introduction to Go arrays and slices.md index 40e3f9a3b6..9dcac9545c 100644 --- a/translated/tech/20180712 An introduction to Go arrays and slices.md +++ b/published/20180712 An introduction to Go arrays and slices.md @@ -3,17 +3,16 @@ [#]: author: "Mihalis Tsoukalos https://opensource.com/users/mtsouk" [#]: collector: "lkxed" [#]: translator: "lkxed" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14665-1.html" Go 数组和切片的介绍 ====== -了解使用数组和切片在 Go 中存储数据的优缺点,以及为什么其中一个比另一个更好。 -![][1] +![](https://img.linux.net.cn/data/attachment/album/202206/02/105657zahhco3612vv1bbo.jpg) -图源:carrotmadman6,经 Opensource.com 修改,CC BY-SA 2.0 +> 了解使用数组和切片在 Go 中存储数据的优缺点,以及为什么其中一个更好。 在本系列的第四篇文章中,我将解释 [Go][5] 数组和切片,包括如何使用它们,以及为什么你通常要选择其中一个而不是另一个。 @@ -26,6 +25,7 @@ Go 数组和切片的介绍 ``` anArray := [4]int{-1, 2, 0, -4} ``` + 数组的大小应该在它的类型之前声明,而类型应该在声明元素之前定义。`len()` 函数可以帮助你得到任何数组的长度。上面数组的大小是 4。 如果你熟悉其他编程语言,你可能会尝试使用 `for` 循环来遍历数组。Go 当然也支持 `for` 循环,不过,正如你将在下面看到的,Go 的 `range` 关键字可以让你更优雅地遍历数组或切片。 @@ -39,7 +39,6 @@ twoD := [3][3]int{ {10, 11, 12}} ``` -The `arrays.go` source file explains the use of Go arrays. The most important code in `arrays.go` is: `arrays.go` 源文件中包含了 Go 数组的示例代码。其中最重要的部分是: ``` @@ -101,7 +100,6 @@ Go 切片与 Go 数组类似,但是它没有后者的缺点。 此外,切片是通过引用传递给函数的,这意味着实际传递给函数的是切片变量的内存地址,这样一来,你对函数内部的切片所做的任何修改,都不会在函数退出后丢失。因此,将大切片传递给函数,要比将具有相同数量元素的数组传递给同一函数快得多。这是因为 Go 不必拷贝切片 —— 它只需传递切片变量的内存地址。 -Go slices are illustrated in `slice.go`, which contains the following code: `slice.go` 源文件中有 Go 切片的代码示例,其中包含以下代码: ``` @@ -141,7 +139,7 @@ func main() { } ``` -切片和数组在定义方式上的最大区别就在于:你不需要指定切片的大小。实际上,切片的大小取决于你要放入其中的元素数量。此外,`append()` 函数允许你将元素添加到现有切片 —— 请注意,即使切片的容量允许你将元素添加到该切片,它的长度也不会被修改,除非你调用 `append ()`。上述代码中的 `printSlice()` 函数是一个辅助函数,用于打印切片中的所有元素,而 `negative()` 函数将切片中的每个元素都变为各自的相反数。 +切片和数组在定义方式上的最大区别就在于:你不需要指定切片的大小。实际上,切片的大小取决于你要放入其中的元素数量。此外,`append()` 函数允许你将元素添加到现有切片 —— 请注意,即使切片的容量允许你将元素添加到该切片,它的长度也不会被修改,除非你调用 `append()`。上述代码中的 `printSlice()` 函数是一个辅助函数,用于打印切片中的所有元素,而 `negative()` 函数将切片中的每个元素都变为各自的相反数。 运行 `slice.go` 将得到以下输出: @@ -192,7 +190,7 @@ Array: [1 -2 3 -4 5] 你可以在 [GitHub][6] 上找到 `arrays.go`、`slice.go` 和 `refArray.go` 的源代码。 -如果您有任何问题或反馈,请在下方发表评论或在 [Twitter][7] 上与我联系。 +如果你有任何问题或反馈,请在下方发表评论或在 [Twitter][7] 上与我联系。 -------------------------------------------------------------------------------- @@ -201,7 +199,7 @@ via: https://opensource.com/article/18/7/introduction-go-arrays-and-slices 作者:[Mihalis Tsoukalos][a] 选题:[lkxed][b] 译者:[lkxed](https://github.com/lkxed) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/20190131 OOP Before OOP with Simula.md b/published/20190131 OOP Before OOP with Simula.md new file mode 100644 index 0000000000..c5d9c97a84 --- /dev/null +++ b/published/20190131 OOP Before OOP with Simula.md @@ -0,0 +1,183 @@ +[#]: subject: "OOP Before OOP with Simula" +[#]: via: "https://twobithistory.org/2019/01/31/simula.html" +[#]: author: "Two-Bit History https://twobithistory.org" +[#]: collector: "lujun9972" +[#]: translator: "aREversez" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14682-1.html" + +Simula 诞生之前的面向对象程序设计 +====== + +想象一下,你坐在河边,河岸上如茵绿草,不远处湍急河流;午后的阳光慵懒惬意,使人陷入冥想哲思,不觉开始思考眼前的河流是否真实存在。诚然,几米外确实有河水奔流而下。不过,我们所称为“河流”的存在究竟是什么呢?毕竟,河水奔流不息,一直处于变化之中。似乎,“河流”这个词无法指代任何固定不变的事物。 + +2009 年,Clojure 的创始人 里奇·希基Rich Hickey 发表了 [一场精彩的演讲][1],探讨了为什么上文那样的哲学窘境会给面向对象程序的编程范式带来难题。他认为,人们看待计算机程序中的对象与看待河流的逻辑是一样的:我们想象对象是固定不变的,即使对象的许多或者说全部的属性都无时无刻不处于变化之中。所以,这种逻辑并不正确,我们无法区分在不同状态下同一对象实例的不同之处。程序中没有明确的时间的概念。人们只是单纯地用着同一个名字,以期在引用对象时,对象能够处于预期的状态中。这样,我们也就难免会遇到 故障bug。 + +希基总结道,这一难题的应对办法就是人们应该将世界建模成作用于不可变数据的 进程process 的集合,而不是可变的对象的集合。换句话说,我们应把每个对象看作一条“河流”,因果相连。总结说来,你应该使用 Clojure 等函数式语言。 + +![][2] + +_作者在远足途中思考面向对象程序设计的本体论问题。_ + +自从希基发表演讲之后,人们对函数式编程语言的兴趣不断提升,主流的面向对象编程语言也大多都采用了函数式编程语言。尽管如此,大多数程序员依旧沿用自己的老一套,继续将对象实例化,不断改变其状态。这些人长此以往,很难做到用不同的视角看待编程。 + +我曾经想写一篇关于 Simula 的文章,大概会写到我们今天所熟知的面向对象的理念是何时又是如何应用到程序语言之中的。但是,我觉得写当初的 Simula 与如今的面向对象程序设计的 _迥然不同之处_,会更有趣一些,这我敢打包票。毕竟,我们现在熟知的面向对象程序设计还未完全成型。Simula 有两个主要版本:Simula I 和 Simula 67。Simula 67 为世界带来了 class类的继承class hierarchy 以及 虚拟方法virtual method;但 Simula I 是一个初稿,它实验了如何能够将数据和进程捆绑起来的其他设想。Simula I 的模型不是希基提出的函数式模型,不过这一模型关注的是随时间展开的 _进程_,而非有着隐藏状态的对象之间的相互作用。如果 Simula 67 采用了 Simula I 的理念,那么我们如今所知的面向对象程序设计可能会大有不同——这类偶然性启示我们,不要想着现在的程序设计范式会一直占据主导地位。 + +### 从 Simula 0 到 Simula 67 + +Simula 是由两位挪威人 克里斯汀·尼加德Kristen Nygaard奥利-约翰·达尔Ole-Johan Dahl 创建的。 + +20 世纪 50 年代末,尼加德受雇于 挪威防务科学研究中心Norwegian Defense Research Establishment(NDRE),该研究中心隶属于挪威军方。在那里,他负责设计 蒙特卡洛模拟方法Monte Carlo simulations,用于核反应堆设计与操作研究。最初,那些模拟实验是由人工完成的;后来,实验在 Ferranti Mercury 电脑 [^1] 上编入程序运行。尼加德随后发现,将这些模拟实验输入电脑需要一种更有效的方式。 + +尼加德设计的这种模拟实验就是人们所知的“离散事件模型discrete event model”,这种模拟记录了一系列事件随着时间改变系统状态的进程。但是问题的关键在于模拟可以从一个事件跳跃到另一个事件中,因为事件是离散的,事件之间的系统不存在任何变化。根据尼加德和达尔在 1966 年发表的一篇关于 Simula 的论文,这种模型被迅速应用于“神经网络、通信系统、交通流量、生产系统、管理系统、社会系统等” [^2] 领域的分析。因此,尼加德认为,其他人描述模拟实验时,可能也需要更高层级的模型。于是他开始物色人才,帮助他完成他称之为“模拟语言Simulation Language”或者“蒙特卡洛编译器Monte Carlo Compiler”的项目 [^3]。 + +达尔当时也受雇于挪威防务科学研究中心,专攻语言设计,此时也加入了尼加德的项目,扮演“沃兹尼亚克”的角色(LCTT 译注:指苹果公司联合创始人斯蒂夫·盖瑞·沃兹尼亚克)。在接下来一年左右的时间,尼加德和达尔携手开发了 Simula 0 语言。[^4] 这一语言的早期版本仅仅是在 ALGOL 60 基础上进行的较小拓展,当时也只是打算将其用作预处理程序而已。当时的语言要比后来的编程语言抽象得多,其基本语言结构是“车站stations”与“乘客customers”,这些结构可以用于针对具体某些离散事件网络建立模型。尼加德和达尔给出了一个模拟飞机离港的例子。[^5] 但是尼加德和达尔最后想出了一个更加通用的语言结构,可以同时表示“车站”和“乘客”,也可以为更广泛的模拟建立模型。这是两个主要的概括,它改变了 Simula 作为 ALGOL 专属包的定位,使其转变为通用编程语言。 + +Simula I 没有“车站stations”和“乘客customers”的语言结构,但它可以通过使用“进程process”再现这些结构。(LCTT 译注:此处使用的“进程”,与当前计算机中用来指代一个已执行程序的实体的概念不同,大致上,你可以将本文中所说的“进程”理解为一种“对象”。)一个进程包含大量数据属性,这些属性与作为进程的 _操作规程_ 的单个行为相联系。你可能会把进程当作是只有单个方法的对象,比如 `run()` 之类的。不过,这种类比并不全面,因为每个进程的操作规程都可以随时暂停、随时恢复,因为这种操作规程属于 协程coroutine 的一种。Simula I 程序会将系统建立为一套进程的模型,在概念上这些进程并行运行。实际上,一个时间点上能称为“当前进程”的只有一个进程。但是,一旦某个进程暂停运行,那么下一个进程就会自动接替它的位置。随着模拟的运行,Simula 会保持一个 “事件通知event notices” 的时间线,跟踪记录每个进程恢复的时间。为了恢复暂停运行的进程,Simula 需要记录多个 调用栈call stacks 的情况。这就意味着 Simula 无法再作为 ALGOL 的预处理程序了,因为 ALGOL 只有一个 调用栈call stacks。于是,尼加德和达尔下定决心,开始编写自己的编译器。 + +尼加德和达尔在介绍该系统的论文中,借助图示,通过模拟一个可用机器数量有限的工厂,阐明了其用法。[^6] 在该案例中,进程就好比订单:通过寻找可用的机器,订单得以发出;如果没有可用的机器,订单就会搁置;而一旦有机器空出来,订单就会执行下去。有一个订单进程的定义,用来实例化若干种不同的订单实例,不过这些实例并未调用任何方法。该程序的主体仅仅是创建进程,并使其运行。 + +历史上第一个 Simula I 编译器发布于 1965 年。尼加德和达尔在离开挪威防务科学研究中心之后,就进入了 挪威计算机中心Norwegian Computer Center 工作,Simula I 也是在这里日渐流行起来的。当时,Simula I 在 UNIVAC 公司的计算机和 Burroughs 公司的 B5500 计算机上均可执行。[^7] 尼加德和达尔两人与一家名为 ASEA 的瑞典公司达成了咨询协议,运用 Simula 模拟加工车间。但是,尼加德和达尔随后就意识到 Simula 也可以写一些和模拟完全不搭边的程序。 + +奥斯陆大学University of Oslo教授 斯坦因·克罗达尔Stein Krogdahl 曾写过关于 Simula 的发展史,称“真正能够促使新开发的通用语言快速发展的催化剂”就是 [一篇题为《记录处理》Record Handling的论文][10],作者是英国计算机科学家 查尔斯·安东尼·理查德·霍尔C.A.R. Hoare。[^8] 假如你现在读霍尔的这篇论文,你就不会怀疑这句话。当人们谈及面向对象语言的发展史时,一定会经常提起霍尔的大名。以下内容摘自霍尔的《记录处理》一文: + +> 该方案设想,在程序执行期间,计算机内部存在任意数量的记录,每条记录都代表着程序员在过去、现在或未来所需的某个对象。程序对现有记录的数量保持动态控制,并可以根据当前任务的要求创建新的记录或删除现有记录。 +> +> 计算机中的每条记录都必须属于数量有限但互不重合的记录类型中的一类;程序员可以根据需要声明尽可能多的记录类型,并借助标识符为各个类型命名。记录类型的命名可能是普通词汇,比如“牛”、“桌子”以及“房子”,同时,归属于这些类型的记录分别代表一头“牛”、一张“桌子”以及一座“房子”。 + +霍尔在这片论文中并未提到子类的概念,但是达尔由衷地感谢霍尔,是他引导了两人发现了这一概念。[^9] 尼加德和达尔注意到 Simula I 的进程通常具有相同的元素,所以引入父类来执行共同元素就会非常方便。这也强化了“进程”这一概念本身可以用作父类的可能性,也就是说,并非每种类型都必须用作只有单个操作规程的进程。这就是 Simula 语言迈向通用化的第二次飞跃,此时,Simula 67 真正成为了通用编程语言。正是如此变化让尼加德和达尔短暂地萌生了给 Simula 改名的想法,想让人们意识到 Simula 不仅仅可以用作模拟。[^10] 不过,考虑到 “Simula”这个名字的知名度已经很高了,另取名字恐怕会带来不小的麻烦。 + +1967 年,尼加德和达尔与 控制数据公司Control Data 签署协议,着手开发Simula 的新版本:Simula 67。同年六月份的一场会议中,来自控制数据公司、奥斯陆大学以及挪威计算机中心的代表与尼加德和达尔两人会面,意在为这门新语言制定标准与规范。最终,会议发布了 [《Simula 67 通用基础语言》][14],确定了该语言的发展方向。 + +Simula 67 编译器的开发由若干家供应商负责。Simula 用户协会The Association of Simula Users(ASU)也随后成立,并于每年举办年会。不久,Simula 67 的用户就遍及了 23 个国家。[^11] + +### 21 世纪的 Simula 语言 + +人们至今还记得 Simula,是因为后来那些取代它的编程语言都受到了它的巨大影响。到了今天,你很难找到还在使用 Simula 写程序的人,但是这并不意味着 Simula 已经从这个世界上消失了。得益于 [GNU cim][16],人们在今天依然能够编写和运行 Simula 程序。 + +cim 编译器遵循 1986 年修订后的 Simula 标准,基本上也就是 Simula 67 版本。你可以用它编写类、子类以及虚拟方法,就像是在使用 Simula 67 一样。所以,用 Python 或 Ruby 轻松写出短短几行面向对象的程序,你照样也可以用 cim 写出来: + +``` +! dogs.sim ; +Begin + Class Dog; + ! The cim compiler requires virtual procedures to be fully specified ; + Virtual: Procedure bark Is Procedure bark;; + Begin + Procedure bark; + Begin + OutText("Woof!"); + OutImage; ! Outputs a newline ; + End; + End; + + Dog Class Chihuahua; ! Chihuahua is "prefixed" by Dog ; + Begin + Procedure bark; + Begin + OutText("Yap yap yap yap yap yap"); + OutImage; + End; + End; + + Ref (Dog) d; + d :- new Chihuahua; ! :- is the reference assignment operator ; + d.bark; +End; +``` + +你可以按照下面代码执行程序的编译与运行: + +``` +$ cim dogs.sim +Compiling dogs.sim: +gcc -g -O2 -c dogs.c +gcc -g -O2 -o dogs dogs.o -L/usr/local/lib -lcim +$ ./dogs +Yap yap yap yap yap yap +``` + +(你可能会注意到,cim 先将 Simula 语言编译为 C 语言,然后传递给 C 语言编译器。) + +这就是 1967 年的面向对象程序设计,除了语法方面的不同,和 2019 年的面向对象程序设计并无本质区别。如果你同意我的这一观点,你也就懂得了为什么人们会认为 Simula 在历史上是那么的重要。 + +不过,我更想介绍一下 Simula I 的核心概念——进程模型。Simula 67 保留了进程模型,不过只有在使用 `Process` 类 和 `Simulation` 块的时候才能调用。 + +为了表现出进程是如何运行的,我决定模拟下述场景。想象一下,有这么一座住满了村民的村庄,村庄的旁边有条小河边,小河里有很多的鱼。但是,村里的村民却只有一条鱼竿。村民们胃口很大,每隔一个小时就饿了。他们一饿,就会拿着鱼竿去钓鱼。如果一位村民正在等鱼竿,另一位村民自然也用不了。这样一来,村民们就会为了钓鱼排起长长的队伍。假如村民要等五、六分钟才能钓到一条鱼,那么这样等下去,村民们的身体状况就会变得越来越差。再假如,一位村民已经到了骨瘦如柴的地步,最后他可能就会饿死。 + +这个例子多少有些奇怪,虽然我也不说不出来为什么我脑袋里最先想到的是这样的故事,但是就这样吧。我们把村民们当作 Simula 的各个进程,观察在有着四个村民的村庄里,一天的模拟时间内会发生什么。 + +完整程序可以通过此处 [GitHub Gist][17] 的链接获取。 + +我把输出结果的最后几行放在了下面。我们来看看一天里最后几个小时发生了什么: + +``` +1299.45: 王五饿了,要了鱼竿。 +1299.45: 王五正在钓鱼。 +1311.39: 王五钓到了一条鱼。 +1328.96: 赵六饿了,要了鱼竿。 +1328.96: 赵六正在钓鱼。 +1331.25: 李四饿了,要了鱼竿。 +1340.44: 赵六钓到了一条鱼。 +1340.44: 李四饿着肚子等着鱼竿。 +1340.44: 李四在等鱼竿的时候饿死了。 +1369.21: 王五饿了,要了鱼竿。 +1369.21: 王五正在钓鱼。 +1379.33: 王五钓到了一条鱼。 +1409.59: 赵六饿了,要了鱼竿。 +1409.59: 赵六正在钓鱼。 +1419.98: 赵六钓到了一条鱼。 +1427.53: 王五饿了,要了鱼竿。 +1427.53: 王五正在钓鱼。 +1437.52: 王五钓到了一条鱼。 +``` + +可怜的李四最后饿死了,但是他比张三要长寿,因为张三还没到上午 7 点就饿死了。赵六和王五现在一定过得很好,因为需要鱼竿的就只剩下他们两个了。 + +这里,我要说明,这个程序最重要的部分只是创建了进程(四个村民),并让它们运行下去。各个进程操作对象(鱼竿)的方式与我们今天对对象的操作方式相同。但是程序的主体部分并没有调用任何方法,也没有修改进程的任何属性。进程本身具有内部状态,但是这种内部状态的改变只有进程自身才能做到。 + +在这个程序中,仍然有一些字段发生了变化,这类程序设计无法直接解决纯函数式编程所能解决的问题。但是正如克罗达尔所注意到的那样,“这一机制引导进行模拟的程序员为底层系统建立模型,生成一系列进程,每个进程表示了系统内的自然事件顺序。”[^12] 我们不是主要从名词或行动者(对其他对象做事的对象)的角度来思考正在进行的进程。我们可以将程序的总控制权交予 Simula 的事件通知系统,克罗达尔称其为 “时间管理器time manager”。因此,尽管我们仍然在适当地改变进程,但是没有任何进程可以假设其他进程的状态。每个进程只能间接地与其他进程进行交互。 + +这种模式如何用以编写编译器、HTTP 服务器以及其他内容,尚且无法确定。(另外,如果你在 Unity 游戏引擎上编写过游戏,就会发现两者十分相似。)我也承认,尽管我们有了“时间管理器”,但这可能并不完全是希基的意思,他说我们在程序中需要一个明确的时间概念。(我认为,希基想要的类似于 [阿达·洛芙莱斯Ada Lovelace 用于区分一个变量随时间变化产生的不同数值的上标符号][19]。)尽管如此,我们可以发现,面向对象程序设计前期的设计方式与我们今天所习惯的面向对象程序设计并非完全一致,我觉得这一点很有意思。我们可能会理所当然地认为,面向对象程序设计的方式千篇一律,即程序就是对事件的一长串记录:某个对象以特定顺序对其他对象产生作用。Simula I 的进程系统表明,面向对象程序设计的方式不止一种。仔细想一下,函数式语言或许是更好的设计方式,但是 Simula I 的发展告诉我们,现代面向对象程序设计被取代也很正常。 + +_如果你喜欢这篇文章,欢迎关注推特 [@TwoBitHistory][20],也可通过 [RSS feed][21] 订阅,获取最新文章(每四周更新一篇)。_ + + +[^1]: Jan Rune Holmevik, “The History of Simula,” accessed January 31, 2019, .  +[^2]: Ole-Johan Dahl and Kristen Nygaard, “SIMULA—An ALGOL-Based Simulation Langauge,” Communications of the ACM 9, no. 9 (September 1966): 671, accessed January 31, 2019, [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.95.384&rep=rep1&type=pdf][24].  +[^3]: Stein Krogdahl, “The Birth of Simula,” 2, accessed January 31, 2019, .  +[^4]: 出处同上。  +[^5]: Ole-Johan Dahl and Kristen Nygaard, “The Development of the Simula Languages,” ACM SIGPLAN Notices 13, no. 8 (August 1978): 248, accessed January 31, 2019, .  +[^6]: Dahl and Nygaard (1966), 676.  +[^7]: Dahl and Nygaard (1978), 257.  +[^8]: Krogdahl, 3.  +[^9]: Ole-Johan Dahl, “The Birth of Object-Orientation: The Simula Languages,” 3, accessed January 31, 2019, .  +[^10]: Dahl and Nygaard (1978), 265.  +[^11]: Holmevik.  +[^12]: Krogdahl, 4.  + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2019/01/31/simula.html + +作者:[Two-Bit History][a] +选题:[lujun9972][b] +译者:[aREversez](https://github.com/aREversez) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twobithistory.org +[b]: https://github.com/lujun9972 +[1]: https://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey +[2]: https://twobithistory.org/images/river.jpg +[10]: https://archive.computerhistory.org/resources/text/algol/ACM_Algol_bulletin/1061032/p39-hoare.pdf +[14]: http://web.eah-jena.de/~kleine/history/languages/Simula-CommonBaseLanguage.pdf +[16]: https://www.gnu.org/software/cim/ +[17]: https://gist.github.com/sinclairtarget/6364cd521010d28ee24dd41ab3d61a96 +[19]: https://twobithistory.org/2018/08/18/ada-lovelace-note-g.html +[20]: https://twitter.com/TwoBitHistory +[21]: https://twobithistory.org/feed.xml +[22]: https://twitter.com/TwoBitHistory/status/1075075139543449600?ref_src=twsrc%5Etfw +[24]: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.95.384&rep=rep1&type=pdf diff --git a/translated/tech/20210115 Learn awk by coding a -guess the number- game.md b/published/20210115 Learn awk by coding a -guess the number- game.md similarity index 71% rename from translated/tech/20210115 Learn awk by coding a -guess the number- game.md rename to published/20210115 Learn awk by coding a -guess the number- game.md index 30040b9347..24738ff4be 100644 --- a/translated/tech/20210115 Learn awk by coding a -guess the number- game.md +++ b/published/20210115 Learn awk by coding a -guess the number- game.md @@ -1,57 +1,57 @@ [#]: collector: (lujun9972) -[#]: translator: (FYJNEVERFOLLOWS ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: translator: (FYJNEVERFOLLOWS) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14668-1.html) [#]: subject: (Learn awk by coding a "guess the number" game) [#]: via: (https://opensource.com/article/21/1/learn-awk) [#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) -编写一个“猜数”游戏的程序来学习 awk +通过编写“猜数字”游戏来学习 Awk ====== -编程语言往往具有许多共同特征。学习一门新语言的好方法是去写一个熟悉的程序。在本文中,我将会使用 awk 编写一个“猜数”程序来展示熟悉的概念。 -![question mark in chalk][1] +> 编程语言往往具有许多共同特征。学习一门新语言的好方法是去写一个熟悉的程序。在本文中,我将会使用 Awk 编写一个“猜数字”程序来展示熟悉的概念。 + +![](https://img.linux.net.cn/data/attachment/album/202206/03/130545jthh1vtoadahwahd.jpg) 当你学习一门新的编程语言时,最好把重点放在大多数编程语言都有的共同点上: + * 变量 —— 存储信息的地方 * 表达式 —— 计算的方法 * 语句 —— 在程序中表示状态变化的方法 - 这些概念是大多是编程语言的基础。 -一旦你理解了这些概念,你就可以开始把其他的弄清楚。例如,大多数语言都有得到其设计支持的“处理方式”,这些方式在不同语言之间可能有很大的不同。这些方法包括模块化(将相关功能分组在一起)、声明性与命令性、面向对象、低级与高级语法特性等等。许多程序员熟悉的一个例子是“仪式”,即,在处理问题之前设置场景所需的工作量。据说 Java 编程语言有一个重要的仪式要求,这源于它的设计,要求所有代码都在一个类中定义。 +一旦你理解了这些概念,你就可以开始把其他的弄清楚。例如,大多数语言都有由其设计所支持的“处理方式”,这些方式在不同语言之间可能有很大的不同。这些方法包括模块化(将相关功能分组在一起)、声明式与命令式、面向对象、低级与高级语法特性等等。许多程序员比较熟悉的是编程“仪式”,即,在处理问题之前设置场景所需花费的工作。据说 Java 编程语言有一个源于其设计的重要仪式要求,就是所有代码都在一个类中定义。 -但是回到最基本的,编程语言通常有相似之处。一旦你掌握了一种编程语言,就从学习另一种语言的基本知识开始,去品味这种新语言的不同之处。 +但从根本上讲,编程语言通常有相似之处。一旦你掌握了一种编程语言,就可以从学习另一种语言的基本知识开始,品味这种新语言的不同之处。 -继续进行的一个好方法是创建一组基本的测试程序。有了这些,就可以从这些相似之处开始学习。 +一个好方法是创建一组基本的测试程序。有了这些,就可以从这些相似之处开始学习。 你可以选择创建的一个测试程序是“猜数字”程序。电脑从 1 到 100 之间选择一个数字,让你猜这个数字。程序一直循环,直到你猜对为止。 “猜数字”程序练习了编程语言中的几个概念: + * 变量 * 输入 * 输出 * 条件判断 * 循环 - 这是学习一门新的编程语言的一个很好的实践实验。 - -**注**:本文改编自 Moshe Zadka 关于在 [Julia][2] 中使用这种方法的文章和Jim Hall关于在 [Bash][3] 中使用这种方法的文章。 +**注**:本文改编自 Moshe Zadka 在 [Julia][2] 中使用这种方法和 Jim Hall在 [Bash][3] 中使用这种方法的文章。 ### 在 awk 程序中猜数 -让我们编写一个实现“猜数字”游戏的 awk 程序。 -Awk 是动态类型的,是一种面向数据转换的脚本语言,并且对交互使用有着令人惊讶的良好支持。Awk 出现于 20 世纪 70 年代,最初是 Unix 操作系统的一部分。如果你不了解 Awk,但是喜欢电子表格,可以看一下这个链接 [去学习 Awk][4]! +让我们编写一个实现“猜数字”游戏的 Awk 程序。 -您可以通过编写一个版本的“猜数字”游戏来开始对 Awk 的探索。 +Awk 是动态类型的,这是一种面向数据转换的脚本语言,并且对交互使用有着令人惊讶的良好支持。Awk 出现于 20 世纪 70 年代,最初是 Unix 操作系统的一部分。如果你不了解 Awk,但是喜欢电子表格,这就是一个你可以 [去学习 Awk][4] 的信号! + +您可以通过编写一个“猜数字”游戏版本来开始对 Awk 的探索。 以下是我的实现(带有行号,以便我们可以查看一些特定功能): - ```      1    BEGIN {      2        srand(42) @@ -71,20 +71,21 @@ Awk 是动态类型的,是一种面向数据转换的脚本语言,并且对     16        }     17    } ``` + 我们可以立即看到 Awk 控制结构与 C 或 Java 的相似之处,但与 Python 不同。 -在像 *if-then-else*、*while* 这样的语句中,*then*、*else* 和 *while* 部分接受一个语句或一组被 **{** 和 **}** 包围的语句。然而,Awk 有一个很大的区别需要从一开始就了解: +在像 `if-then-else`、`while` 这样的语句中,`then`、`else` 和 `while` 部分接受一个语句或一组被 `{` 和 `}` 包围的语句。然而,Awk 有一个很大的区别需要从一开始就了解: 根据设计,Awk 是围绕数据管道构建的。 这是什么意思呢?大多数 Awk 程序都是一些代码片段,它们接收一行输入,对数据做一些处理,然后将其写入输出。认识到这种转换管道的需要,Awk 默认情况下提供了所有的转换管道。让我们通过关于上面程序的一个基本问题来探索:“从控制台读取数据”的结构在哪里? -答案是——“内置的”。特别的,第 7-17 行告诉 Awk 如何处理被读取的每一行。在这种情况下,很容易看到第 1-6 行在读取任何内容之前被执行。 +答案是——“内置的”。特别的,第 7-17 行告诉 Awk 如何处理被读取的每一行。在这种情况下,很容易看到第 1-6 行是在读取任何内容之前被执行的。 -更具体地说,第 1 行上的 **BEGIN** 关键字是一种“模式”,在本例中,它指示 Awk 在读取任何数据之前,应该先执行 { … } 中 **BEGIN** 后面的内容。另一个类似的关键字 **END**,在这个程序中没有被使用,它指示 Awk 在读取完所有内容后要做什么。 +更具体地说,第 1 行上的 `BEGIN` 关键字是一种“模式”,在本例中,它指示 Awk 在读取任何数据之前,应该先执行 `{ ... }` 中 `BEGIN` 后面的内容。另一个类似的关键字 `END`,在这个程序中没有被使用,它指示 Awk 在读取完所有内容后要做什么。 -回到第 7-17 行,我们看到它们创建了一个类似代码块 { … } 的片段,但前面没有关键字。因为在 **{** 之前没有任何东西可以让 Awk 匹配,所以它将把这一行用于接收每一行输入。每一行的输入都将由用户输入作为猜测。 +回到第 7-17 行,我们看到它们创建了一个类似代码块 `{ ... }` 的片段,但前面没有关键字。因为在 `{` 之前没有任何东西可以让 Awk 匹配,所以它将把这一行用于接收每一行输入。每一行的输入都将由用户输入作为猜测。 -让我们看看正在执行的代码。首先,在读取任何输入之前发生的序言。 +让我们看看正在执行的代码。首先,是在读取任何输入之前发生的序言部分。 在第 2 行,我们用数字 42 初始化随机数生成器(如果不提供参数,则使用系统时钟)。为什么要用 42?[当然要选 42!][5] 第 3 行计算 1 到 100 之间的随机数,第 4 行输出该随机数以供调试使用。第 5 行邀请用户猜一个数字。注意这一行使用的是 `printf`,而不是 `print`。和 C 语言一样,`printf` 的第一个参数是一个用于格式化输出的模板。 @@ -94,7 +95,6 @@ Awk 是动态类型的,是一种面向数据转换的脚本语言,并且对 考虑到 Awk 程序不同寻常的结构,代码片段会对特定的输入行配置做出反应,并处理数据,让我们看看另一种结构,看看过滤部分是如何工作的: - ```      1    BEGIN {      2        srand(42) @@ -120,7 +120,6 @@ Awk 是动态类型的,是一种面向数据转换的脚本语言,并且对 为了完整起见,我们可以使用这些模式将普通的计算与只适用于特定环境的计算分离开来。下面是第三个版本: - ```      1    BEGIN {      2        srand(42) @@ -142,20 +141,21 @@ Awk 是动态类型的,是一种面向数据转换的脚本语言,并且对     18        exit     19    } ``` + 认识到这一点,无论输入的是什么值,都需要将其转换为整数,因此我们创建了第 7-9 行来完成这一任务。现在第 10-12、13-15 和 16-19 行这三组代码,都是指已经定义好的变量 guess,而不是每次都对输入行进行转换。 让我们回到我们想要学习的东西列表: + * 变量 —— 是的,Awk 有这些;我们可以推断出,输入数据以字符串形式输入,但在需要时可以转换为数值 * 输入 —— Awk 只是通过它的“数据转换管道”的方式发送输入来读取数据 * 输出 —— 我们已经使用了 Awk 的 `print` 和 `printf` 函数来将内容写入输出 - * 条件判断 —— 我们已经学习了 Awk 的 *if-then-else* 和对应特定输入行配置的输入过滤器 - * 循环 —— 嗯,想象一下!我们在这里不需要循环,这还是多亏了 Awk 采用的“数据转换管道”方法;循环“就这么发生了”。注意,用户可以通过向 Awk 发送一个文件结束信号(当使用 Linux 终端窗口时可通过快捷键 **CTRL-D**)来提前退出管道。 + * 条件判断 —— 我们已经学习了 Awk 的 `if-then-else` 和对应特定输入行配置的输入过滤器 + * 循环 —— 嗯,想象一下!我们在这里不需要循环,这还是多亏了 Awk 采用的“数据转换管道”方法;循环“就这么发生了”。注意,用户可以通过向 Awk 发送一个文件结束信号(当使用 Linux 终端窗口时可通过快捷键 `CTRL-D`)来提前退出管道。 -考虑不需要循环来处理输入的重要性是非常值得的。Awk 能够长期存在的一个原因是 Awk 程序是紧凑的,而它们紧凑的一个原因是不需要从控制台或文件中读取样板文件。 +不需要循环来处理输入的重要性是非常值得的。Awk 能够长期保持存在的一个原因是 Awk 程序是紧凑的,而它们紧凑的一个原因是不需要从控制台或文件中读取的那些格式代码。 让我们运行下面这个程序: - ``` $ awk -f guess.awk random number is 25 @@ -167,14 +167,15 @@ that's right $ ``` -我们没有涉及的一件事是注释。Awk 注释以“#”开头,以行尾结束。 +我们没有涉及的一件事是注释。Awk 注释以 `#` 开头,以行尾结束。 ### 总结 -Awk 非常强大,这种“猜数字”游戏是入门的好方法。但这不应该是你探索 Awk 的终点。你可以 [阅读关于 Awk 和 Gawk (GNU Awk) 的历史][6],Gawk是 Awk 的扩展版本,如果你在电脑上运行Linux,可能会有这个。或者,你可以 [阅读所有关于它最初开发者的原始版本][7]。 +Awk 非常强大,这种“猜数字”游戏是入门的好方法。但这不应该是你探索 Awk 的终点。你可以看看 [Awk 和 Gawk(GNU Awk)的历史][6],Gawk 是 Awk 的扩展版本,如果你在电脑上运行 Linux,可能会有这个。或者,从它的原始开发者那里阅读关于 [最初版本][7] 的各种信息。 你还可以 [下载我们的备忘单][8] 来帮你记录下你所学的一切。 +> **[Awk 备忘单][8]** -------------------------------------------------------------------------------- @@ -183,7 +184,7 @@ via: https://opensource.com/article/21/1/learn-awk 作者:[Chris Hermansen][a] 选题:[lujun9972][b] 译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/20210131 How to teach open source beyond business.md b/published/20210131 How to teach open source beyond business.md new file mode 100644 index 0000000000..1e8afecdf6 --- /dev/null +++ b/published/20210131 How to teach open source beyond business.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: (duoluoxiaosheng) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14686-1.html) +[#]: subject: (How to teach open source beyond business) +[#]: via: (https://opensource.com/article/21/1/open-source-beyond-business) +[#]: author: (Irit Goihman https://opensource.com/users/iritgoihman) + +在商业之外,为学生们教授开源知识 +====== + +> Beyond 计划连接起未来科技行业的人才和开源文化。 + +![](https://img.linux.net.cn/data/attachment/album/202206/08/095200eezhuq7ssd4x4d66.jpg) + +那时,我还是一个大学生,我不明白人们为什么那么吹捧开源软件。我也使用 Linux 和开源软件,但是我不明白开源的运作模式,不知道如何参加一个开源项目,也不知道这对我未来的职业有什么好处。我的开发经验主要是家庭作业和学位需要的一个大型期末项目。 + +所以,当我开始踏足科技行业时,我发现我还有很多知识需要学习。我需要了解如何加入一个既定的、可能很大并且分散在不同地方的团队,为一个正在进行中的项目工作。我还要学会正确的沟通以保证我付出的努力不白费。 + +在这方面,我并不特别。我只是众多毕业生中的一员。 + +### 开源让毕业生的起点更高 + +作为一个工程师,一个管理者,从那时起我开始帮助刚入行的工程师。我发现,有开源经验的毕业生比没有开源经验的毕业生能更快的入门。 + +通过将开源方法纳入学术研究,学生们可以获得相关的行业经验,学会利用他们自己的知识,并建立一个陈述观点和分享知识的平台。参与开源项目可以对学生的技术知识和经验产生积极影响。这可以帮助他们更好的规划自己的职业生涯。 + +开源在科技行业的价值是公认的,它塑造了全球软件公司的文化。参与开源项目并采用 [开放组织文化][2] 正在成为行业普遍现象。公司寻求知道如何在开源领域工作并培养其文化的思想新颖、才华横溢的员工。因此,科技行业必须推动学术界将开源文化作为学习科技研究的基本方法之一。 + +### 商业之上是开源文化 + +当我遇到红帽的高级软件工程师 [Liora Milbaum][3] 时,我发现,我们对将开源文化和规则引入学术界有着共同的兴趣。Liora 之前创立了 [DevOps Loft][4], 在其中,她与有兴趣进入这个行业的人们分享了 DevOps 实践,并希望发起一个类似的项目,教授大学生开源。我们决定启动 [Beyond][5] 计划,将科技行业拥抱开源精神的人才与红帽的实践联系起来。 + +我们在 [Tel Aviv-Yafo 技术学院][6] 开始了 Beyond 计划,在那里,我们受到了信息系统学院的热烈欢迎。我们从介绍 DevOps 技术栈的 “DevOps 入门” 开始。我们开始时最大的挑战是怎么讲明白开源是什么。答案似乎很简单:实践出真理。我们不想给学生们讲授什么老套的学院课程,相反,我们想让学生接触到行业标准。 + +我们创建了一个包含常见的开源项目和工具的教学大纲来教授 DevOps 技术栈。该课程由工程师教授的讲座和实践组成。学生们被分成小组,每组都由一名工程师指导和支持。他们练习团队合作,分享知识(在团队内外),并有效的协作。 + +在我们为计算机科学学院的通讯准备的高级课程 “开源开发的基础” 中,我们遇到了另外的困难。当我们的课程开始两周以后,随着新冠疫情在全球的流行,我们完全靠远程沟通。我们通过与学生一起使用我们在红帽日常工作中使用的相同远程协作工具解决了这个问题。我们惊讶于过渡的是如此简单和顺利。 + +![Beyond teaching online][7] + +(Irit Goihman, [CC BY-SA 4.0][8]) + +### 成果展示 + +这两个课程取得了巨大的成功,我们甚至雇佣了我们最优秀的学生之一。我们收到了非常棒的反馈,同学们表示,我们对他们的知识、思维和软技能产生了积极影响。一些学生因为在课程期间的开源贡献而得到了他们第一份技术工作。 + +其他学术机构对这些课程表达出了极大的兴趣,因此我们将这个项目扩展到了另外一所大学。 + +很荣幸,在一群优秀工程师的参与下,与 Liora 一起领导这个成功的项目。我们一起助力开源社区的成长。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/open-source-beyond-business + +作者:[Irit Goihman][a] +选题:[lujun9972][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/iritgoihman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-lead-teacher-learner.png?itok=rMJqBN5G (Teacher or learner?) +[2]: https://opensource.com/open-organization/resources/open-org-definition +[3]: https://www.linkedin.com/in/lioramilbaum +[4]: https://www.devopsloft.io/ +[5]: https://research.redhat.com/blog/2020/05/24/open-source-development-course-and-devops-methodology/ +[6]: https://www.int.mta.ac.il/ +[7]: https://opensource.com/sites/default/files/pictures/beyond_mta.png (Beyond teaching online) +[8]: https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/published/20210210 Manage your budget on Linux with this open source finance tool.md b/published/20210210 Manage your budget on Linux with this open source finance tool.md new file mode 100644 index 0000000000..7434c9614f --- /dev/null +++ b/published/20210210 Manage your budget on Linux with this open source finance tool.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: (hanszhao80) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14679-1.html) +[#]: subject: (Manage your budget on Linux with this open source finance tool) +[#]: via: (https://opensource.com/article/21/2/linux-skrooge) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +使用 Linux 上的开源财务工具 Skrooge 管理你的预算 +====== + +> 使用开源预算工具 Skrooge 让你的财务管理更加轻松。 + +![](https://img.linux.net.cn/data/attachment/album/202206/06/115449f0uy9guxxokj0umo.jpg) + +2021 年,人们喜欢 Linux 的理由比以往任何时候都多。在本系列中,我将分享使用 Linux 的 21 个不同理由。本篇介绍的是个人财务管理。 + +个人财务可能很难管理。当你没有足够的钱在没有经济援助的情况下度日时,这可能是令人沮丧甚至不安的,而当你确实有所需的钱却又不清楚每个月的去向时,这可能会令人惊讶地难以接受。更糟糕的是,我们经常被告知要“制定预算”,好像宣布你每个月的花销就能在某种程度上体现出你需要多少钱。底线是:制定预算是困难的,没有达到你的财务目标是令人沮丧的。但这仍然很重要,Linux 有几个工具可以帮助使任务变得可管理。 + +### 理财 + +就像生活中的其他事情一样,我们都有自己的方法来跟踪我们的财务。我过去常常采取一种简单而直接的方法:我的薪水支票被存入一个账户,然后我会提取一定比例的现金。一旦我钱包里的钱没了,我就得等到下一个发薪日才能花钱。我用了一天没有午餐的时间,就明白了我必须认真对待我的目标,并相应地调整了我的消费行为。对于当时我的简单的生活方式来说,这是一种让我对自己的收入保持诚实的有效手段,但它并不能很好地转化为在线商业交易、长期公用事业合同、投资等等。 + +随着我不断完善我的财务跟踪方式,我了解到个人会计始终是一个不断发展的过程。我们每个人都有独特的财务状况,这告诉我们可以或应该使用什么样的解决方案来跟踪我们的收入和债务。如果你失业了,那么你的预算目标可能是尽可能少花钱。如果你在工作,但在还学生贷款,那么你的目标可能是向银行汇款。如果你在工作,但计划退休,那么你可能会尽可能多地存钱。 + +关于预算,要记住的一点是,它是为了将你的财务现实与你的财务 _目标_ 进行比较。你无法避免一些开支,但在这些之后,你可以设定自己的优先事项。如果你没有达到你的目标,你可以调整自己的行为或改写你的目标,使其更好地反映现实。调整你的财务计划并不意味着你失败了,这只是意味着你最初的预测并不准确。在困难时期,你可能无法达到任何预算目标,但如果你坚持你的预算,你会学到很多关于维持你目前的生活方式(无论它是什么)所需要的财务手段。随着时间的推移,你可以学习调整你可能从未意识到的变化。例如,由于远程工作已成为一种被广泛接受的选择,人们正在搬到农村城镇以降低生活成本。看到这样一种生活方式的转变可以改变你的预算报告,真是令人震惊。 + +重点是,预算编制是一项经常被低估的活动,这在很大程度上是因为它令人生畏。重要的是要认识到,无论你的专业水平或对财务的兴趣如何,你都可以进行预算。无论你 [只使用 LibreOffice 电子表格][2],还是尝试专用的财务应用程序,你都可以设定目标,跟踪自己的行为,并学到许多宝贵的经验教训,这些经验教训最终可能会带来回报。 + +### 开源会计 + +有几个专用于 [Linux 的个人理财应用程序][3],包括 [HomeBank][4]、[Money Manager EX][5]、[GNUCash][6]、[KMyMoney][7] 和 [Skrooge][8]。所有这些应用程序本质上都是账本,你可以在每个月底(或每当你查看帐户时)退回到一个地方,从你的银行导入数据,并审查你的支出如何与你为自己设定的预算保持一致。 + +![显示财务数据的 Skrooge 界面][9] + +我使用 Skrooge 作为我的个人预算跟踪器。即便面对多个银行账户,它也能轻松自如的设置。与大多数开源金融应用程序一样,Skrooge 可以导入多种文件格式,因此我的工作流程大致如下: + + 1. 登录我的银行。 + 2. 将当月的银行对账单导出为 QIF 文件。 + 3. 打开 Skrooge。 + 4. 导入 QIF 文件。每个文件都会自动分配到相应的帐户。 + 5. 对照我为自己设定的预算目标审查我的支出。如果我超支了,那么我就会扣减下个月的目标(这样我就会理性地少花钱来弥补差额)。如果我尚未超出我的目标预算,那么我会把多余的部分移到 12 月的预算中(这样我在年底就会有更多的支出份额)。 + +我只跟踪了 Skrooge 中的家庭预算的一部分。Skrooge 通过一个动态数据库简化了这一过程,该数据库允许我使用自定义标签一次对多个交易进行分类。这使我可以轻松地从一般家庭和公用事业支出中提取我的个人支出,并且我可以在查看 Skrooge 提供的自动生成的报告时利用这些类别。 + +![Skrooge 预算饼图][10] + +最重要的是,流行的 Linux 财务应用程序使我能够以最适合我的方式管理我的预算。例如,我的合作伙伴更喜欢使用 LibreOffice 电子表格,但我只需要付出很少的努力就可以从家庭预算中提取 CSV 文件,将其导入到 Skrooge,并使用一组更新的数据集。不存在供应商锁定和不兼容。该系统灵活敏捷,使我们能够在更多地了解有效预算和生活中的情况时调整我们的预算和跟踪支出的方法。 + +### 开放选择 + +世界各地的货币市场各不相同,我们每个人与之互动的方式也决定了我们可以使用哪些工具。归根结底,你对财务类软件的选择必须基于自己的需求。开源做得特别好的一件事是为用户提供了选择的自由。 + +在设定自己的财务目标时,我很欣赏我可以使用最适合我个人计算风格的任何应用程序。我可以控制我在生活中如何处理数据,即使是我不一定喜欢处理的数据。Linux 及其令人惊叹的应用程序集使它不再是一件苦差事。 + +在 Linux 上尝试一些财务应用程序,看看你是否可以激励自己设定一些目标并节省开支吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-skrooge + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[hanszhao80](https://github.com/hanszhao80) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/Medical%20Costs%20Transparency_1.jpg?itok=CkZ_J88m (2 cents penny money currency) +[2]: https://opensource.com/article/20/3/libreoffice-templates +[3]: https://opensource.com/life/17/10/personal-finance-tools-linux +[4]: http://homebank.free.fr/en/index.php +[5]: https://www.moneymanagerex.org/download +[6]: https://opensource.com/article/20/2/gnucash +[7]: https://kmymoney.org/download.html +[8]: https://apps.kde.org/en/skrooge +[9]: https://opensource.com/sites/default/files/skrooge.jpg +[10]: https://opensource.com/sites/default/files/skrooge-pie_0.jpg diff --git a/published/20210405 How different programming languages do the same thing.md b/published/20210405 How different programming languages do the same thing.md new file mode 100644 index 0000000000..0d8a476397 --- /dev/null +++ b/published/20210405 How different programming languages do the same thing.md @@ -0,0 +1,409 @@ +[#]: subject: "How different programming languages do the same thing" +[#]: via: "https://opensource.com/article/21/4/compare-programming-languages" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: "VeryZZJ" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14687-1.html" + +不同编程语言是如何完成同一件事 +====== + +> 通过一个简单的小游戏比较 13 种编程语言。 + +![](https://img.linux.net.cn/data/attachment/album/202206/08/113845fs81srd5s8rjryt5.jpg) + +当我开始学习一种新的编程语言时,会把重点放在定义变量、书写声明以及计算表达式,一旦对这些概念有一个大致的了解,通常就能够自己弄清剩下的部分。大多数编程语言都具有相似性,所以如果你掌握了一种编程语言,学习下一种语言的重点就是弄清楚独有的概念以及区分不同。 + +我喜欢写一些测试程序来帮助练习新的编程语言。其中我经常写的是一个叫做“猜数字”的小游戏,计算机选出 1 到 100 里的任一数字,然后我来猜。程序循环进行,直到猜出正确数字。通过伪代码可以看出,这是个非常简单的程序: + +* 计算机在 1 到 100 之间选出一个随机数字 +* 循环进行直到猜出该随机数字 + + 计算机读取我的猜测 + + 告诉我我的猜测过高还是过低 + +我们发表了一些文章,用不同的语言写这个程序。这是一个比较不同语言做同样事情的有趣机会。大多数编程语言具有相似性,所以当你在学习下一种新的编程语言时,主要是学习它的独特之处。 + +C 语言由 Dennis Ritchie 于 1972 年在贝尔实验室创建,是一种早期的通用编程语言。C 语言非常受欢迎,并迅速成为 Unix 系统上的标准编程语言。正是因为它的流行,许多其他编程语言也采用了类似的编程语法。这就是为什么如果你已经知道如何使用 C 语言编程,学习 C++、Rust、Java、Groovy、JavaScript、awk 或 Lua 会更容易。 + +接下来我们看看这些不同的编程语言是如何实现 “猜数字” 游戏的主要步骤。我将把重点放在基本元素的相似或不同,跳过一些外围代码,如分配临时变量。 + +### 计算机在 1 到 100 之间选出一个随机数字 + +你可以看到这里有许多相似之处。大多数编程语言使用类似 `rand()` 的函数,你可以设定一个范围来生成随机数。而其他一些语言使用一个特殊的函数来设定范围生成随机数。 + +C: + +``` +// Using the Linux `getrandom` system call +getrandom(&randval, sizeof(int), GRND_NONBLOCK); +number = randval % maxval + 1; + +// Using the standard C library +number = rand() % 100 + 1; +``` + +C++: + +``` +int number = rand() % 100+1; +``` + +Rust: + +``` +let random = rng.gen_range(1..101); +``` + +Java: + +``` +private static final int NUMBER = r.nextInt(100) + 1; +``` + +Groovy: + +``` +int randomNumber = (new Random()).nextInt(100) + 1 +``` + +JavaScript: + +``` +const randomNumber = Math.floor(Math.random() * 100) + 1 +``` + +awk: + +``` +randomNumber = int(rand() * 100) + 1 +``` + +Lua: + +``` +number = math.random(1,100) +``` + +### 循环进行直到我猜出该随机数字 + +循环通常是用控制流程来实现的,如 `while` 或 `do-while`。JavaScript 中的实现没有使用循环,而是 “实时 ”更新 HTML 页面,直到用户猜出正确的数字。Awk 虽然支持循环,但是通过循环读取输入信息是没有意义的,因为 Awk 是基于数据管道的,所以它从文件而不是直接从用户读取输入信息。 + +C: + +``` +do { + … +} while (guess != number); +``` + +C++: + +``` +do { + … +} while ( number != guess ); +``` + +Rust: + +``` +for line in std::io::stdin().lock().lines() { + … + break; +} +``` + +Java: + +``` +while ( guess != NUMBER ) { + … +} +``` + +Groovy: + +``` +while ( … ) { + … + break; +} +``` + +Lua: + +``` +while ( player.guess ~= number ) do + … +end +``` + +### 计算机读取我的猜测 + +不同编程语言对输入的处理方式不同。例如,JavaScript 直接从 HTML 表单中读取数值,而 Awk 则从数据管道中读取数据。 + +C: + +``` +scanf("%d", &guess); +``` + +C++: + +``` +cin >> guess; +``` + +Rust: + +``` +let parsed = line.ok().as_deref().map(str::parse::); +if let Some(Ok(guess)) = parsed { + … +} +``` + +Java: + +``` +guess = player.nextInt(); +``` + +Groovy: + +``` +response = reader.readLine() +int guess = response as Integer +``` + +JavaScript: + +``` +let myGuess = guess.value +``` + +Awk: + +``` +guess = int($0) +``` + +Lua: + +``` +player.answer = io.read() +player.guess = tonumber(player.answer) +``` + +### 告诉我猜测过高还是过低 + +在这些类 C 语言中,通常是通过 `if` 语句进行比较的。每种编程语言打印输出的方式有一些变化,但打印语句在每个样本中都是可识别的。 + +C: + +``` +if (guess < number) { + puts("Too low"); +} +else if (guess > number) { + puts("Too high"); +} +… +puts("That's right!"); +``` + +C++: + +``` +if ( guess > number) { cout << "Too high.\n" << endl; } +else if ( guess < number ) { cout << "Too low.\n" << endl; } +else { + cout << "That's right!\n" << endl; + exit(0); +} +``` + +Rust: + +``` +_ if guess < random => println!("Too low"), +_ if guess > random => println!("Too high"), +_ => { + println!("That's right"); + break; +} +``` + +Java: + +``` +if ( guess > NUMBER ) { + System.out.println("Too high"); +} else if ( guess < NUMBER ) { + System.out.println("Too low"); +} else { + System.out.println("That's right!"); + System.exit(0); +} +``` + +Groovy: + +``` +if (guess < randomNumber) + print 'too low, try again: ' +else if (guess > randomNumber) + print 'too high, try again: ' +else { + println "that's right" + break +} +``` + +JavaScript: + +``` +if (myGuess === randomNumber) { + feedback.textContent = "You got it right!" +} else if (myGuess > randomNumber) { + feedback.textContent = "Your guess was " + myGuess + ". That's too high. Try Again!" +} else if (myGuess < randomNumber) { + feedback.textContent = "Your guess was " + myGuess + ". That's too low. Try Again!" +} +``` + +Awk: + +``` +if (guess < randomNumber) { + printf "too low, try again:" +} else if (guess > randomNumber) { + printf "too high, try again:" +} else { + printf "that's right\n" + exit +} +``` + +Lua: + +``` +if ( player.guess > number ) then + print("Too high") +elseif ( player.guess < number) then + print("Too low") +else + print("That's right!") + os.exit() +end +``` + +### 非类 C 编程语言会怎么样呢? + +非类 C 编程语言会有很大的不同,需要学习特定的语法来完成每一步。Racket 源于 Lisp 和 Scheme,所以它使用 Lisp 的前缀符和大量括号。Python 使用空格而不是括号来表示循环之类的块。Elixir 是一种函数式编程语言,有自己的语法。Bash 是基于 Unix 系统中的 Bourne shell,它本身借鉴了 Algol68,并支持额外的速记符,如 `&&` 作为 `and` 的变体。Fortran 是在使用打孔卡片输入代码的时期创建的,所以它依赖于一些重要列的 80 列布局。 + +我将通过比较 `if` 语句,举例表现这些编程语言的不同。`if` 判断一个值是否小于或大于另一个值,并向用户打印适当信息。 + +Racket: + +``` +(cond [(> number guess) (displayln "Too low") (inquire-user number)] + [(< number guess) (displayln "Too high") (inquire-user number)] + [else (displayln "Correct!")])) +``` + +Python: + +``` +if guess < random: + print("Too low") +elif guess > random: + print("Too high") +else: + print("That's right!") +``` + +Elixir: + +``` +cond do + guess < num -> + IO.puts "Too low!" + guess_loop(num) + guess > num -> + IO.puts "Too high!" + guess_loop(num) + true -> + IO.puts "That's right!" +end +``` + +Bash: + +``` +[ "0$guess" -lt $number ] && echo "Too low" +[ "0$guess" -gt $number ] && echo "Too high" +``` + +Fortran: + +``` +IF (GUESS.LT.NUMBER) THEN + PRINT *, 'TOO LOW' +ELSE IF (GUESS.GT.NUMBER) THEN + PRINT *, 'TOO HIGH' +ENDIF +``` + +### 更多 + +当你在学习一种新的编程语言时 “猜数字” 游戏是一个很友好的入门程序,通过一种简单的方式练习了几个常见的编程概念。通过不同编程语言实现这个简单游戏,你可以理解一些核心概念和每种语言的细节。 + +学习如何用 C 和类 C 语言编写 “猜数字” 游戏: + +* [C][2], Jim Hall +* [C++][3], Seth Kenlon +* [Rust][4], Moshe Zadka +* [Java][5], Seth Kenlon +* [Groovy][6], Chris Hermansen +* [JavaScript][7], Mandy Kendall +* [awk][8], Chris Hermansen +* [Lua][9], Seth Kenlon + +其他语言: + +* [Racket][10], Cristiano L. Fontana +* [Python][11], Moshe Zadka +* [Elixir][12], Moshe Zadka +* [Bash][13], Jim Hall +* [Fortran][14], Jim Hall + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/compare-programming-languages + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[VeryZZJ](https://github.com/VeryZZJ) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_development_programming.png?itok=M_QDcgz5 "Developing code." +[2]: https://opensource.com/article/21/1/learn-c +[3]: https://opensource.com/article/20/12/learn-c-game +[4]: https://opensource.com/article/20/12/learn-rust +[5]: https://opensource.com/article/20/12/learn-java +[6]: https://opensource.com/article/20/12/groovy +[7]: https://opensource.com/article/21/1/learn-javascript +[8]: https://opensource.com/article/21/1/learn-awk +[9]: https://opensource.com/article/20/12/lua-guess-number-game +[10]: https://opensource.com/article/21/1/racket-guess-number +[11]: https://opensource.com/article/20/12/learn-python +[12]: https://opensource.com/article/20/12/elixir +[13]: https://opensource.com/article/20/12/learn-bash +[14]: https://opensource.com/article/21/1/fortran diff --git a/published/20210724 How to Fix yay- error while loading shared libraries- libalpm.so.12.md b/published/20210724 How to Fix yay- error while loading shared libraries- libalpm.so.12.md new file mode 100644 index 0000000000..befb210be1 --- /dev/null +++ b/published/20210724 How to Fix yay- error while loading shared libraries- libalpm.so.12.md @@ -0,0 +1,68 @@ +[#]: subject: "How to Fix yay: error while loading shared libraries: libalpm.so.12" +[#]: via: "https://www.debugpoint.com/2021/07/yay-error-libalpm-so-12/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14683-1.html" + +如何修复 “yay: error while loading shared libraries: libalpm.so.12” +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/07/144052x9tpvo93zhthdh6x.jpg) + +> 这篇快速指南是为了帮助你修复 “yay error: while loading shared libraries: libalpm.so.12” 错误。 + +如果你在系统中运行 [Arch Linux][1] 的时间比较长,那么由于其滚动发布性质以及你的硬件支持,程序可能会损坏。 如果你使用 AUR 助手 Yay,那么有时,由于其他软件包的多次安装升级,Yay 可能会损坏。 + +Yay 助手一般是非常稳定的,但有时它会被搞乱,在修复好之前,你不能使用它安装任何程序。而其中一个令人头疼的错误是这样的: + +``` +yay: error while loading shared libraries: libalpm.so.12: cannot open shared object file: No such file or directory +``` + +这个错误特别是在升级到 pacman 6.0 后出现的,因为共享库不兼容。 + +![error while loading shared libraries - yay][2] + +### 如何解决 “yay: error while loading shared libraries: libalpm.so.12” + +这个错误只能通过完全卸载 `yay` 来解决,包括它的依赖。然后重新安装 `yay`。 + +没有其他方法来解决这个错误。 + +我们已经有一个 [如何安装 Yay][3] 的指南,然而,以下是修复的步骤。 + +从 AUR 克隆 yay 仓库并构建。在终端窗口中依次运行以下命令。 + +``` +cd /tmp +git clone 'https://aur.archlinux.org/yay.git' +cd /tmp/yay +makepkg -si +cd ~ +rm -rf /tmp/yay/ +``` + +安装完成后,你可以尝试运行给你带来这个错误的命令。然后就好了。如果你仍然有这个错误,请在下面的评论区告诉我。 + +很多人都遇到了这个问题,网络上有 [几个讨论][4]。以上是解决这个错误的唯一办法。而且我在任何地方都找不到这个问题的确切根源,除了它是在 pacman 6.0 更新后开始的。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/07/yay-error-libalpm-so-12/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://archlinux.org/ +[2]: https://www.debugpoint.com/wp-content/uploads/2021/07/error-while-loading-shared-libraries-yay.jpg +[3]: https://www.debugpoint.com/2021/01/install-yay-arch/ +[4]: https://github.com/Jguer/yay/issues/1519 diff --git a/published/20210725 How to Recover Arch Linux Install via chroot.md b/published/20210725 How to Recover Arch Linux Install via chroot.md new file mode 100644 index 0000000000..fdadf9e7be --- /dev/null +++ b/published/20210725 How to Recover Arch Linux Install via chroot.md @@ -0,0 +1,117 @@ +[#]: subject: "How to Recover Arch Linux Install via chroot" +[#]: via: "https://www.debugpoint.com/2021/07/recover-arch-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14708-1.html" + +如何通过 chroot 恢复 Arch Linux 系统 +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/14/111204hm20rzjmmf5ib9nr.jpg) + +> 这个快速指南解释了恢复 Arch Linux 安装的一些方便步骤。 + +作为一个滚动发布的版本,[Arch Linux][1] 中有时会出现一些问题。不是因为你自己的行为,而是数以百计的其他原因,如新内核与你的硬件或软件的兼容性。但是,Arch Linux 仍然很棒,它提供了最新的软件包和应用。 + +但有时,它也会给你带来麻烦,你最终只能看到一个闪烁的光标,其他什么都没有。 + +所以,在这种情况下,与其重新格式化或重新安装,不如在放弃希望之前尝试恢复安装和数据。本指南概述了这个方向的一些步骤。 + +### 恢复 Arch Linux 安装 + +第一步是用 Arch Linux 创建一个可启动的现场Live USB。从 [这个链接][3] 下载 .ISO 并创建一个可启动的 USB。你可以查看这个 [如何使用 Etcher 创建可启动的 USB][2] 的指南。记住这一步需要另一个稳定的工作系统,因为你目前的系统不能使用。 + +你需要知道你的 Arch Linux 安装在哪个分区上。这是一个非常重要的步骤。如果你不知道,你可以用 GParted 来查找。或者在你的 GRUB 菜单中查看,或者你可以运行下面的命令来了解。这将列出你所有的磁盘分区及其大小、标签: + +``` +sudo lsblk -o name,mountpoint,label,size,uuid +``` + +完成后,插入 USB 盘并从它启动。你应该在现场介质中看到 Arch Linux 的提示符。 + +现在,用下面的方法挂载 Arch Linux 分区。记得把 `/dev/sda3` 改成你对应的分区。 + +``` +mount /dev/sda3 /mnt +arch-chroot /mnt +``` + +`arch-chroot` 命令将在终端挂载你的 Arch Linux 分区,所以用你的 Arch 凭证登录。现在,在这个阶段,根据你的需要,你有以下选择。 + +* 你可以通过 `/home` 文件夹来备份你的数据。如果,故障排除方式无效的话。你可以把文件复制到外部 USB 或其他分区。 +* 核查日志文件,特别是 pacman 日志。因为,不稳定的系统可能是由升级某些软件包引起的,如图形驱动或任何其他驱动。根据日志,如果你需要的话,可以降级任何特定的软件包。 + +你可以使用下面的命令来查看 pacman 日志文件的最后 200 行,以找出任何失败的项目或依赖性删除。 + +``` +tail -n 200 /var/log/pacman.log | less +``` + +上面的命令给出了你的 `pacman.log` 文件末尾的 200 行来验证。现在,仔细检查哪些软件包在你成功启动后被更新了。 + +并记下软件包的名称和版本。你可以尝试逐一降级软件包,或者如果你认为某个特定的软件包产生了问题。使用 `pacman -U` 开关来降级。 + +``` +pacman -U +``` + +如果有的话,你可以在降级后运行以下命令来启动你的 Arch 系统。 + +``` +exec /sbin/init +``` + +检查你的显示管理器的状态,是否有任何错误。有时,显示管理器会产生一个问题,无法与 X 服务器通信。例如,如果你正在使用 Lightdm,那么你可以通过以下方式检查它的状态。 + +``` +systemctl status lightdm +``` + +或者,可以通过下面的命令启动它,并检查出现了错误。 + +``` +lightdm --test-mode --debug +``` + +下面是一个 Lightdm 失败的例子,它导致了一个不稳定的 Arch 系统。 + +![lightdm - test mode][4] + +或者通过使用 `startx` 启动 X 服务器来检查。 + +``` +startx +``` + +根据我的经验,如果你在上述命令中看到错误,尝试安装另一个显示管理器并启用它,如 sddm。它可能会消除这个错误。 + +根据你的系统状态,尝试上述步骤,并进行故障排除。对于特定于显示管理器 lightdm 的错误,我们有一个 [指南][5],你可以看看。 + +如果你使用的是 sddm,那么请查看 [这些故障排除步骤][6]。 + +### 总结 + +每个安装环境都是不同的。上述步骤可能对你不起作用。但它值得一试,根据经验,它是有效的。如果它起作用,那么,对你来说是好事。无论哪种方式,请在下面的评论区中告诉我结果如何。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/07/recover-arch-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/tag/arch-linux +[2]: https://www.debugpoint.com/2021/01/etcher-bootable-usb-linux/ +[3]: https://archlinux.org/download/ +[4]: https://www.debugpoint.com/wp-content/uploads/2021/03/lightdm-test-mode.jpg +[5]: https://www.debugpoint.com/2021/03/failed-to-start-lightdm/ +[6]: https://wiki.archlinux.org/title/SDDM#Troubleshooting diff --git a/published/20220510 6 easy ways to make your first open source contribution with LibreOffice.md b/published/20220510 6 easy ways to make your first open source contribution with LibreOffice.md new file mode 100644 index 0000000000..de5efae413 --- /dev/null +++ b/published/20220510 6 easy ways to make your first open source contribution with LibreOffice.md @@ -0,0 +1,58 @@ +[#]: subject: "6 easy ways to make your first open source contribution with LibreOffice" +[#]: via: "https://opensource.com/article/22/5/first-open-source-contribution-libreoffice" +[#]: author: "Klaatu https://opensource.com/users/klaatu" +[#]: collector: "lkxed" +[#]: translator: "lkskjjk" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14719-1.html" + +使用 LibreOffice 进行首次开源贡献的 6 种简单方法 +====== + +> 2022 年 5 月是 LibreOffice 月。这里有一些简单的方法来完成你的第一个开源贡献。 + +![](https://img.linux.net.cn/data/attachment/album/202206/16/230450d6u6u9hb1q9wx69c.jpg) + +“参与”开源似乎有点令人困惑。你从哪里开始?如果你不会编程怎么办?你取得谁的同意?别人怎么知道你做出了贡献,会有人关心吗? + +这类问题实际上有答案(你自己选择就行;没关系;不用谁的同意;你告诉他们;是的),但在 2022 年 5 月,有一个简单的答案:LibreOffice。5 月是参与 LibreOffice 及其管理机构 文档基金会The Document Foundation 的月份。他们正在邀请各种各样的贡献者以六种不同的方式提供帮助,其中只有一种与代码有任何关系。无论你的技能如何,你都可以找到一种方法来帮助这个世界上最好的办公套件。 + +### 为 LibreOffice 做出贡献的 6 种方式 + +以下是你可以做的: + +* Handy Helper:在 [Ask LibreOffice][3] 上回答其他 LibreOffice 用户的问题。如果你是 LibreOffice 的狂热用户,并且认为你有可以帮助他人的有用提示和技巧,那么这就是你一直在等待的角色。 +* First Responder:当错误报告得到不止一个用户确认时会更好。如果你擅长安装软件(有时错误报告是针对比你通常使用的版本更旧的版本),那么请访问 [LibreOffice Bugzilla][4] 并查找尚未确认的新错误。当你找到时,试着复制所报告的内容。假设你可以做到这一点,请添加一条评论,例如 “CONFIRMED on Linux (Fedora 35) and LibreOffice 7.3.2”。 +* Drum Beater:开源项目很少有大公司投入营销资金来推广它们。如果所有声称喜欢开源的公司都能提供帮助,那就太好了,但不是所有的公司都这样做,那么为什么不发出你的声音呢?在社交媒体上告诉你的朋友你为什么喜欢 LibreOffice,或者你用它做什么(当然还要加上#libreoffice 标签。) +* Globetrotter:LibreOffice 已经支持多种不同的语言,但并不是所有语言。 LibreOffice 正在积极开发中,因此它的界面翻译需要保持最新。[在这里参与][5]。 +* Docs Doctor:LibreOffice 有在线帮助和用户手册。如果你擅长向其他人解释事情,或者如果你擅长校对其他人的文档,那么你应该联系 [文档团队][6]。 +* Code Cruncher:你可能不会立即深入了解 LibreOffice 的代码库并进行重大更改,但这通常不是项目所需要的。如果你知道如何编码,那么你可以[按照此 wiki 页面上的说明][8]加入[开发人员社区][7]。 + +### 免费贴纸 + +我不想提前提到这一点,因为很明显你参与 LibreOffice 只是因为你喜欢参与一个优秀的开源项目。但是,你最终会发现,所以我不妨告诉你:通过为 LibreOffice 做出贡献,你可以注册然后从文档基金会获得免费贴纸。你肯定一直想 [装饰你的笔记本电脑吧][2]? + +不过,不要被战利品的承诺分心。如果你对参与开源感到困惑但很兴奋,那么这是一个很好的机会。它代表了你参与开源的一般方式:寻找需要做的事情,去做它,然后你和其他人讨论它,这样你就可以获得下一步可以做什么的想法。经常这样做,你就会找到进入社区的方式。最终,你不会再纠结于如何参与开源,因为你已经忙于贡献! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/first-open-source-contribution-libreoffice + +作者:[Klaatu][a] +选题:[lkxed][b] +译者:[lkskjjk](https://github.com/lkskjjk) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/klaatu +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/dandelion_zoom.jpg +[2]: https://opensource.com/business/15/11/open-source-stickers +[3]: http://ask.libreoffice.org/ +[4]: https://bugs.documentfoundation.org/buglist.cgi?bug_status=__open__&content=&no_redirect=1&order=changeddate%20DESC%2Cpriority%2Cbug_severity&product=&query_based_on=&query_format=specific +[5]: https://www.libreoffice.org/community/localization/ +[6]: https://www.libreoffice.org/community/docs-team +[7]: https://www.libreoffice.org/community/developers/ +[8]: https://wiki.documentfoundation.org/Development/GetInvolved diff --git a/published/20220514 Hidden Features! 25 Fun Things You Can Do With DuckDuckGo Search Engine.md b/published/20220514 Hidden Features! 25 Fun Things You Can Do With DuckDuckGo Search Engine.md new file mode 100644 index 0000000000..af80f8bfac --- /dev/null +++ b/published/20220514 Hidden Features! 25 Fun Things You Can Do With DuckDuckGo Search Engine.md @@ -0,0 +1,236 @@ +[#]: subject: "Hidden Features! 25 Fun Things You Can Do With DuckDuckGo Search Engine" +[#]: via: "https://itsfoss.com/duckduckgo-easter-eggs/" +[#]: author: "sreenath https://itsfoss.com/author/sreenath/" +[#]: collector: "lkxed" +[#]: translator: "TravinDreek" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14696-1.html" + +隐藏功能!在 DuckDuckGo 搜索引擎中,你可以做这 25 件有趣的事情 +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/11/142806ebr5xtzgcwcr5955.jpg) + +比起无处不在的 Google,[有些搜索引擎替代品更加尊重隐私][1],而 DuckDuckGo 就是其中之一。 + +最近,这个搜索引擎有了很大的改进,搜索一般网页十分顺畅。在搜索本地地点方面,则还远不及 Google。 + +不过,DuckDuckGo(简称为 DDG)有一些很酷的功能,大部分用户还没注意到。如果你是一位 DDG 狂热粉,你可能会喜欢用这些小技巧来提升你的搜索体验。 + +### 1、跳转到特定网页 + +在你最喜欢的网站名称前输入 `!` 即可直接进入这个网站。则类似于 Google 的 “运气不错” 功能,但用 DDG 的话来说,这就叫 “叹号搜索”。 + +有一些网站有缩写形式,开始输入时便会提示。 + +![duckduckgo bang feature][2] + +在网站名后面输入搜索词,就可以直接抵达那个网站的搜索结果处。 + +### 2、文本转 ASCII + +Figlet 是一个 [有趣的 Linux 命令][3],可以将任意文本转换为漂亮的 ASCII 画格式。 + +在任意搜索词前输入 `figlet`,就会显示 ASCII 输出。无需打开终端。 + +![Figlet in DDG][4] + +### 3、检查社交媒体的状态 + +在某个人的 Twitter 名前加上 `@`,就会显示 TA 的状态(关注者等)。 + +![Itsfoss Twitter][5] + +### 4、生成强密码 + +输入 `password` 并加上需要的字符数,就可以生成一个独特的强密码。 + +![Generating password in DuckDuckGo][6] + +### 5、生成随机密码短语 + +输入 `random passphrase` 可生成一段密码短语,通常长度为 4 个词。 + +![Random Passphrase][7] + +### 6、获取一份速查表 + +在需要看速查表的搜索词后面,可输入 `cheatsheet`。如果要搜索的东西有速查表,就会立即显示在搜索页面。 + +![Vim Cheatsheet][8] + +### 7、通过色码获取颜色 + +输入 `color` 并加上你想查的颜色的十六进制码,便可显示这个颜色。 + +![Color][9] + +### 8、生成随机数 + +搜索 `random number` 会输出一个 0 到 1 之间的随机数。 + +![Random Number][10] + +你也可以指定需要的范围。 + +![Random Number between 1 and 1000][11] + +### 9、转换为二进制等形式 + +输入一个二进制数并加上 `binary`,可将其从二进制转换为十进制。 + +![Binary to Decimal][12] + +类似地,它也能用于十六进制和八进制,但我不清楚它们的处理逻辑。 + +### 10、寻找韵词 + +输入 `what rhymes with` 并带上要找同韵词的词语。作诗能力变强了,对吧? + +![What rhymes with rain][13] + +### 11、获取拉马努金数、圆周率等常数 + +输入想获取数值的常数名,便可在搜索结果中看到它。 + +![Ramanujan Number][14] + +### 12、查询现在谁在太空中 + +输入 `people in space` 获取当前在太空中的人员名单。同时还会显示他们在太空中居住的时间。 + +![People in Space][15] + +### 13、查询网页是否无法访问 + +如果你想知道某个网站是你无法访问了,还是大家都无法访问了,只需在搜索词中输入 `is xyz.com down`。 + +![Is down?][16] + +### 14、获取特定话题的名言 + +输入一个词并带上 `quotes`,就会显示与这个词相关的名言。 + +![Get quotes in DDG][17] + +### 15、获取占位文本 + +搜索 `lorem ipsum` 就可以获取 5 段占位文本。对 Web 开发者应该会有用。 + +![Lorem ipsum][18] + +### 16、获取任意月份的日历 + +在年、月、日后面输入 `calendar`,就会为你显示该月份的交互式日历。 + +![Calendar][19] + +### 17、生成二维码 + +在文字、链接等后面输入 `qr`,就会生成对应的二维码。 + +![QRCode][20] + +### 18、获取一些 CSS 动画 + +搜索 `css animations` 以获取一些 CSS 动画例子。 + +![CSS Animations][21] + +### 19、展开短链接 + +如果有一个 Bitly 链接或其他短链接,但不确定它指向哪里,不必再跳转到充满垃圾信息的网页了,只需展开短链接,看看真正的网址。 + +在短链接后面输入关键词 `expand`,就会显示真正的目标 URL。 + +![Expand Link][22] + +### 20、获取特殊字符的 HTML 代码 + +搜索 `html chars`,可以获取一份很长的列表,上面有 HTML 实体及其描述,按下后会在结果中显示更多信息。 + +![HTML Chars][23] + +### 21、我用这东西干啥? + +这功能没什么用。如果你输入 `why should I use this?` ,它就会在搜索结果顶部显示 `cause it's awesome`。显然,DuckDuckGo 在说他自己。 + +![Why should I use this?][24] + +### 22、转换大小写 + +大小写都可转换。`lowercase <大写搜索词>` 就会显示小写的结果 + +![Lowercase][25] + +`uppercase <小写搜索词>` 就会显示大写的结果。 + +![Uppercase][26] + +### 23、编码 URL + +搜索 `encode` 并加上 URL,就会给出编码后的结果 + +![URL Encode][27] + +### 24、Motherboard + +搜索 `Motherboard` 就会看见左侧的 DuckDuckGo 的 logo 变了。它会显示选好的几个随机 logo。 + +![Motherboard][28] + +### 25、获取 HTML 色码 + +搜索 `color codes` 便可获得一份颜色表。一样,这个功能多为 Web 开发者和设计师所用。 + +![Color Codes][29] + +### 还有很多别的··· + +我的伙伴 Sreenath 想到本贴的主意。他说 DuckDuckGo 中还有许多 “彩蛋”,我觉得没错。但全部列出来有诸多不便。 + +如果你知道更多这样有趣的 DDG 搜索功能,请在评论中分享。如果你又发现了你喜欢的搜索功能,也提出来吧。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/duckduckgo-easter-eggs/ + +作者:[sreenath][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/sreenath/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/privacy-search-engines/ +[2]: https://itsfoss.com/wp-content/uploads/2022/05/duckduckgo-bang-feature-800x449.png +[3]: https://itsfoss.com/funny-linux-commands/ +[4]: https://itsfoss.com/wp-content/uploads/2022/05/figlet-800x272.png +[5]: https://itsfoss.com/wp-content/uploads/2022/05/itsfoss-twitter-800x278.jpg +[6]: https://itsfoss.com/wp-content/uploads/2022/05/password-30-800x185.jpg +[7]: https://itsfoss.com/wp-content/uploads/2022/05/random-pqssphrase-800x179.png +[8]: https://itsfoss.com/wp-content/uploads/2022/05/vim-cheatsheet-800x367.png +[9]: https://itsfoss.com/wp-content/uploads/2022/05/color-800x289.jpg +[10]: https://itsfoss.com/wp-content/uploads/2022/05/random-number-800x235.png +[11]: https://itsfoss.com/wp-content/uploads/2022/05/random-number-between-1-and-1000-800x244.png +[12]: https://itsfoss.com/wp-content/uploads/2022/05/binary-800x184.png +[13]: https://itsfoss.com/wp-content/uploads/2022/05/What-rhymes-with-rain-800x257.png +[14]: https://itsfoss.com/wp-content/uploads/2022/05/ramanujan-number-800x238.png +[15]: https://itsfoss.com/wp-content/uploads/2022/05/people-in-space-800x313.jpg +[16]: https://itsfoss.com/wp-content/uploads/2022/05/is-down-800x204.png +[17]: https://itsfoss.com/wp-content/uploads/2022/05/life-quotes-800x303.png +[18]: https://itsfoss.com/wp-content/uploads/2022/05/lorem-ipsum-800x227.png +[19]: https://itsfoss.com/wp-content/uploads/2022/05/calendar-800x331.png +[20]: https://itsfoss.com/wp-content/uploads/2022/05/qrcode-800x255.png +[21]: https://itsfoss.com/wp-content/uploads/2022/05/css-animations-800x385.jpg +[22]: https://itsfoss.com/wp-content/uploads/2022/05/expand-shortened-link-ddg-800x209.png +[23]: https://itsfoss.com/wp-content/uploads/2022/05/html-chars-800x174.png +[24]: https://itsfoss.com/wp-content/uploads/2022/05/why-should-i-use-this-800x160.png +[25]: https://itsfoss.com/wp-content/uploads/2022/05/lowercase-800x179.png +[26]: https://itsfoss.com/wp-content/uploads/2022/05/uppercase-800x185.png +[27]: https://itsfoss.com/wp-content/uploads/2022/05/url-encode-800x177.png +[28]: https://itsfoss.com/wp-content/uploads/2022/05/motherboard.png +[29]: https://itsfoss.com/wp-content/uploads/2022/05/color-codes-800x554.png diff --git a/published/20220516 How to Dual Boot Ubuntu 22.04 LTS and Windows 11.md b/published/20220516 How to Dual Boot Ubuntu 22.04 LTS and Windows 11.md new file mode 100644 index 0000000000..4004bcb938 --- /dev/null +++ b/published/20220516 How to Dual Boot Ubuntu 22.04 LTS and Windows 11.md @@ -0,0 +1,196 @@ +[#]: subject: "How to Dual Boot Ubuntu 22.04 LTS and Windows 11" +[#]: via: "https://www.linuxtechi.com/dual-boot-ubuntu-22-04-and-windows-11/" +[#]: author: "James Kiarie https://www.linuxtechi.com/author/james/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14699-1.html" + +如何双启动 Ubuntu 22.04 LTS 和 Windows 11 +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/12/110546fff10ck07e2p0z2f.jpg) + +嗨,伙计们,在这篇指南中,我们将演示如何在 Windows 11 的之外配置 Ubuntu 22.04 LTS(Jammy Jellyfish)的双启动设置。 + +为使其能工作,你需要在你的计算机上已经安装好了 Windows 11 。接下来,你将需要在你的硬盘驱动器上创建一个单独的分区,你将在此分区上安装 Ubuntu 22.04 。我们将包含这点知识,因此不要担心。 + +**前置条件:** + +在设置双启动前,这些是你所需要的: + +* 一个 Ubuntu 22.04 的可启动 USB 驱动器,你可以转到 [Ubuntu 22.04 下载页面][1] 来下载 Ubuntu 22.04 的 ISO 镜像文件。在 ISO 镜像文件到位后,拿一个 16GB USB 驱动器,并使用 Rufus 应用程序来使其可启动。 +* 快速稳定的互联网连接 + +### 步骤 1、在你的硬盘驱动器上创建一个可用的分区  + +正如介绍中所提到的,我们首先需要在硬盘驱动器上创建一个单独的分区,我们将在其中安装 Ubuntu 22.04 。 + +因此,通过按下 `Windows + R` 组合键来打开磁盘管理器实用程序。 + +在对话框中,输入 `diskmgmt.msc` ,并按下回车键。 + +![][2] + +磁盘管理disk management控制台将显示当前磁盘分区,如你将在下面所看到的一样。我们将通过压缩 “卷 E” 来创建一个用于安装 Ubuntu 的分区。这在你的安装过程中可能有所不同,但是只需要跟着做,你就会理解其中的大体意思。 + +![][3] + +因此,在你想要压缩的磁盘驱动器卷上点击鼠标右键,并在弹出的菜单中选择 压缩卷Shrink 选项。 + +![][4] + +将会出现一个弹出对话框,如下所示。具体指定压缩的控件大小(以 MB 为单位),并单击 压缩卷Shrink 。 + +这是指定给 Ubuntu 22.04 安装所用的空间。 + +![][5] + +在缩小磁盘空间后,它将显示为 未分配Unallocated可用空间Free Space,如图所示。 + +![][6] + +随着有了可用空间,现在将可启动 USB 驱动器插入到你的 PC ,并重新启动你的系统。此外,要确保访问 BIOS 设置,并修改启动优先级,来使 USB 驱动器成为第一优先级。保存 BIOS 更改并继续启动。 + +### 步骤 2、开始安装 + +在第一个屏幕中,你将得到如图所示的 GRUB 菜单。选择第一个选项 尝试或安装 UbuntuTry or Install Ubuntu ,并按下 回车键ENTER 按键。 + +![][7] + +Ubuntu 22.04 将开始加载,如下所示。这最多需要一分钟。 + +![][8] + +此后,安装程序向导将弹出,向你提供两个选项: 尝试 UbuntuTry Ubuntu安装 UbuntuInstall Ubuntu。因为我们的使命是安装 Ubuntu ,所以选择后者。 + +![][9] + +接下来,选择你的首选键盘布局,并单击 继续Continue 按钮。 + +![][10] + +在 更新和其它软件Updates and Other Software 步骤中,选择 正常安装Normal Installation 以便安装 Ubuntu的 GUI 版本,通过勾选其它剩余选项来允许下载更新和安装第三方的针对于图像、WIFI 硬件和其它实用程序的软件包。 + +接下来,单击 继续Continue 按钮。 + +![][11] + +下一步提供两个安装选项。第一个选项 - 清除整个磁盘并安装 UbuntuErase disk and install Ubuntu – 完全地擦除你的驱动器并安装。但是由于这是一个双启动设置,这个选项对于你现有安装的 Windows 系统来说会是灾难性的。 + +因此,选择 其它选项Something else,单击 继续Continue 按钮。 + +![][12] + +分区表将显示所有现有的磁盘分区。到目前为止,我们仅有 NTFS 分区和我们之前压缩出来的可用分区。 + +针对 Ubuntu 22.04 ,我们将创建下面的分区: + +* `/boot`        –        1 GB +* `/home`        –        10 GB +* `/`            –        12 GB +* 交换分区        –         2 GB +* EFI           –       300 MB + +为开始使用这些分区,单击 可用空间Free Space分区下面的 “+” 符号。 + +![][13] + +如图显示填写 `/boot` 分区的详细信息,然后单击 确定OK 按钮。 + +![][14] + +接下来,具体指定 `/home` 分区,并单击 确定OK 按钮。 + +![][15] + +接下来,定义 `/`(根)分区,并单击 确定OK 按钮。 + +![][16] + +为定义交换空间,设置大小,并在 使用为Use as:选项中选择 交换区域Swap area。 + +![][17] + +最后,如果你正在使用 UEFI 启动模式,那么创建一个 EFI 系统分区。我们将分配 300MB 到 EFI 分区。 + +![][18] + +下图是一份我们的分区表的分区摘要: + +![][19] + +为继续安装,单击 现在安装Install Now。在下图显示的弹出窗口中,单击 继续Continue来保存更改到磁盘。 + +![][20] + +接下来,安装程序向导将自动侦测出你的位置,只需要单击 继续Continue 按钮。 + +![][21] + +接下来,通过具体指定姓名、计算机的名称和密码来创建一个登录用户。接下来单击 继续Continue 按钮。 + +![][22] + +此时,安装程序向导将复制所有的 Ubuntu 文件和软件包到手动创建的硬盘驱动器分区,并安装必要的软件包。 + +这个过程将需要很长一段时间,因此,要有耐心。在我们的实例中,它需要大约 30 分钟。 + +![][23] + +在安装过程完成后,单击 立刻重新启动Restart Now 按钮来重新启动系统。 + +![][24] + +在这时,移除你的可启动 USB 驱动器,并按下回车键。 + +![][25] + +在系统重新启动时,你将找到包括 Ubuntu 和 Windows 11 在内的各种选项。 + +选择 “Ubuntu” 来启动到你的新 Ubuntu 22.04 安装。要启动到 Windows 11,请选择标有 Windows 恢复环境Windows Recovery Environment 的条目。 + +![][26] + +就这样。我们演示了如何双启动 Windows 11 和 Ubuntu 22.04。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/dual-boot-ubuntu-22-04-and-windows-11/ + +作者:[James Kiarie][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/james/ +[b]: https://github.com/lkxed +[1]: https://releases.ubuntu.com/22.04/ +[2]: https://www.linuxtechi.com/wp-content/uploads/2022/05/diskmgmt-msc-command-windows11.png +[3]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Disk-Management-Console-Windows11.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Shrink-Volume-Windows11.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Shrink-Volume-Size-Windows11.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Free-Space-Disk-Management-Console-Windows11.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Select-Install-Ubuntu-Linux.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Ubuntu-22-04-Loading-Screen.png +[9]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Choose-Install-Ubuntu-Linux.png +[10]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Keyboard-Layout-Ubuntu-22-04.png +[11]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Normal-Installation-Option-During-Ubuntu-22-04-Installation.png +[12]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Something-else-ubuntu-installation.png +[13]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Select-Free-Space-for-Ubuntu-22-04-Installation.png +[14]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Boot-Partition-Ubuntu-22-04-LTS.png +[15]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Home-Partition-For-Ubuntu-22-04.png +[16]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Root-Partition-For-Ubuntu-22-04.png +[17]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Swap-Area-Ubuntu-22-04.png +[18]: https://www.linuxtechi.com/wp-content/uploads/2022/05/EFI-System-Partition-Ubuntu-22-04.png +[19]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Install-Now-Ubuntu-22-04.png +[20]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Write-Changes-Disk-Ubuntu-22-04.png +[21]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Location-for-Ubuntu-22-04-Installation.png +[22]: https://www.linuxtechi.com/wp-content/uploads/2022/05/UserName-Hostname-Ubuntu-22-04-lts-Installation.png +[23]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Installation-Progress-Ubuntu-22-04.png +[24]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Restart-After-Ubuntu-22-04-LTS-Installation.png +[25]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Remove-Installation-Media-after-Ubuntu-22-04-Installation.png +[26]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Dual-Boot-Grub-Bootloader-Screen-Ubuntu-22-04.png diff --git a/published/20220518 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 22.04 - 20.04 - 18.04.md b/published/20220518 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 22.04 - 20.04 - 18.04.md new file mode 100644 index 0000000000..77459650a8 --- /dev/null +++ b/published/20220518 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 22.04 - 20.04 - 18.04.md @@ -0,0 +1,276 @@ +[#]: subject: "How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 22.04 / 20.04 / 18.04" +[#]: via: "https://ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14709-1.html" + +详解在 Ubuntu 中引导到救援模式或紧急模式 +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/14/153639n33fg3e2gc7xnvv3.jpg) + +这篇教程将介绍如何在 Ubuntu 22.04、20.04 和 18.04 LTS 版本中引导到 救援Rescue 模式或 紧急Emergency 模式。 + +> 你可能已经知道,在 RHEL 7 、RHEL 8 、Ubuntu 16.04 LTS 及其更新的版本的 Linux 发行版中 运行等级Runlevels 已经被 系统目标Systemd target 所替代。更多关于 运行等级Runlevel系统目标Systemd targets 的信息,参考 [这篇指南][1] 。 + +这篇指南是针对 Ubuntu 编写的,但是,下面所给的步骤应该也适用于大多数使用 systemd 作为默认服务管理器的 Linux 发行版。 + +在进入主题前,让我们简单的理解:什么是 救援rescue 模式 和 紧急Emergency 模式,以及这两种模式的目的是什么。 + +### 什么是救援模式? + +在 Linux 发行版中,救援模式等效于使用 SysV 作为默认的服务器管理器的 单用户single user 模式。在救援模式中,将挂载所有的本地文件系统,将仅启动一些重要的服务。但是,不会启动一般的服务(例如,网络服务)。 + +救援模式在不能正常引导系统的情况下是很有用的。此外,我们可以在救援模式下执行一些重要的救援操作,例如,[重新设置 root 密码][2] 。 + +### 什么是紧急模式? + +与救援模式相比,在紧急模式中,不会启动任何的东西。不会启动服务、不会挂载挂载点、不会建立套接字、什么都不会启动。你将所拥有的只是一个 **原始的 shell** 。紧急模式适用于调试目的。 + +首先,我们将看到如何在 Ubuntu 22.04 和 20.04 LTS 发行版中引导到救援模式或紧急模式。在 Ubuntu 22.04 和 20.04 LTS 中的过程是完全相同的! + +### 在 Ubuntu 22.04 / 20.04 LTS 中引导到救援模式 + +我们可以使用两种方法来引导到救援模式。 + +#### 方法 1 + +打开你的 Ubuntu 系统。在 BIOS 徽标出现后,按下 `ESC` 按键来显示 GRUB 菜单。 + +在 GRUB 菜单中,选择第一项,并按下 `e` 按键来编辑它。 + +![GRUB Menu In Ubuntu 22.04 / 20.04 LTS][3] + +按下 `↓` 按键,并找到以单词 `linux` 开头的一行代码,并在其结尾处添加下面的一行代码。为到达其结尾处,只需要按下 `Ctrl + e` 组合键,或使用你键盘上的 `END` 按键或 `←`/`→` 按键。 + +``` +systemd.unit=rescue.target +``` + +![Edit Grub Boot Menu Entries To Enter Into Rescue Mode In Ubuntu 22.04 / 20.04 LTS][4] + +在添加上面的代码行后,按下 `Ctrl + x` 组合键或按下 `F10` 按键来引导到救援模式。 + +数秒后,你将作为 root 用户来登录到救援模式(即单用户模式)。将会提示你按下回车键来进入维护。 + +下图是 Ubuntu 22.04 / 20.04 LTS 系统的救援模式的样子: + +![Boot Into Rescue Mode In Ubuntu 22.04 / 20.04 LTS][5] + +现在,在救援模式中做你想做的任何事。在救援模式中,在你执行任何操作前,你可能需要以 读/写模式来挂载根(`/`)文件系统。 + +``` +mount -n -o remount,rw / +``` + +![Mount Root File System In Read Write Mode In Ubuntu 22.04 / 20.04 LTS][6] + +在完成后,按下 `Ctrl + d` 组合键来引导到正常模式。或者,你可以输入下面的任意一个命令来引导到正常模式。 + +``` +systemctl default +``` + +或者, + +``` +exit +``` + +如果你想重新启动系统,而不是引导到正常的模式,输入: + +``` +systemctl reboot +``` + +#### 方法 2 + +在这种方法中,你不需要编辑 GRUB 启动菜单项目。 + +打开系统电源,并从 GRUB 启动菜单中选择 Ubuntu 高级选项Advanced options for Ubuntu。 + +![Choose Advanced Options For Ubuntu From Grub Boot Menu][7] + +接下来,你将看到一个带有内核版本的可用的 Ubuntu 版本的列表。在 Ubuntu 中的 GRUB 启动菜单中选择 恢复模式Recovery mode 。 + +![Choose Recovery Mode In Grub Boot Menu In Ubuntu 22.04 / 20.04 LTS][8] + +数秒后,你将看到 Ubuntu 的 恢复Recovery 菜单。从恢复菜单中,选择 进入 root 的 shell 提示符Drop to root shell prompt 选项 ,并按下回车键。 + +![Enter Into Root Shell Prompt In Ubuntu 22.04 / 20.04 LTS][9] + +现在,你将进入维护。 + +![Ubuntu Maintenance Mode][10] + +通过输入下面的命令来 以读/写模式的方式 来挂载根(`/`)文件系统: + +``` +mount -n -o remount,rw / +``` + +![Mount Root File System In Read Write Mode In Ubuntu][11] + +在救援模式中做你想做的任何事。 + +在完成后,输入 `exit` 来返回到恢复菜单。 + +``` +exit +``` + +最后,选择 救援正常启动Resume normal boot 选项,并按下回车键。 + +![Boot Into Normal Mode In Ubuntu][12] + +再次按下回车键来退出恢复模式,并继续引导到正常模式。 + +![Exit The Recovery Mode In Ubuntu][13] + +如果你不想引导到正常模式,从救援模式中输入 `reboot` 并按下回车键来重新启动你的系统。 + +### 在 Ubuntu 22.04 / 20.04 LTS 中引导到紧急模式 + +当 GRUB 菜单出现时,按下 `e` 按键来编辑它。 + +![GRUB Menu In Ubuntu 22.04 / 20.04 LTS][14] + +找到以单词 `linux` 开头的一行代码,并在其结尾处添加下面的一行代码: + +``` +systemd.unit=emergency.target +``` + +![Edit Grub Boot Menu Entries To Enter Into Emergency Mode In Ubuntu 22.04 / 20.04 LTS][15] + +在添加上面的代码行后,按下 `Ctrl + x` 组合键,或按下 `F10` 按键来引导到紧急模式。 + +数秒后,你将作为 `root` 用户来进入维护。将会提示你按下回车键来进入紧急模式。 + +下图是 Ubuntu 22.04 / 20.04 LTS 系统的紧急模式的样子: + +![Boot Into Emergency Mode In Ubuntu 22.04 / 20.04 LTS][16] + +现在,在紧急模式中做你想做的任何事。在紧急模式中,在你执行任何操作前,你可能需要以读/写模式来挂载根(`/`)文件系统。 + +``` +mount -n -o remount,rw / +``` + +在完成后,按下 `Ctrl + d` 组合键来引导到正常模式。或者,你可以输入下面的任意一个命令来引导到正常模式。 + +``` +systemctl default +``` + +或者, + +``` +exit +``` + +如果你想重新启动系统,而不是引导到正常模式,输入: + +``` +systemctl reboot +``` + +### 在 Ubuntu 18.04 LTS 中引导到救援模式 + +启动你的 Ubuntu 系统。当 GRUB 菜单出现时,选择第一项并按下按键 `e` 来编辑。(为到达其行尾处,只需要按下 `Ctrl + e` 组合键,或使用你键盘上的 `END` 按键或 `←`/`→` 按键): + +![Grub Menu][17] + +如果你没有看到 GRUB 菜单,只需要在 BIOS 徽标出现后,按下 `ESC` 按键来显示 GRUB 菜单。 + +找到以单词 `linux` 开头的一行代码,并在其结尾处添加下面的一行代码(为到达其行尾处,只需要按下 `Ctrl + e` 组合键,或使用你键盘上的 END` 按键或 `←`/`→` 按键): + +``` +systemd.unit=rescue.target +``` + +![Edit Grub Menu][18] + +在添加上面的代码行后,只需要按下 `Ctrl + x` 组合键,或按下 `F10` 按键来引导到救援模式。数秒后,你将作为 `root` 用户进入维护(即单用户模式)。 + +下图是 Ubuntu 18.04 LTS 服务器系统的救援模式的样子: + +![Ubuntu Rescue Mode][19] + +接下来,输入下面的命令来挂载根(`/`)文件系统为读/写模式。 + +``` +mount -n -o remount,rw / +``` + +### 在 Ubuntu 18.04 LTS 中引导到紧急模式 + +引导你的 Ubuntu 到紧急模式基本与上述方法相同。你所需要做的全部工作是,在编辑 GRUB 菜单时,将 `systemd.unit=rescue.target` 替换为 `systemd.unit=emergency.target` 。 + +![Edit Grub Menu][20] + +在你添加 `systemd.unit=emergency.target` 后,按下 `Ctrl + x` 组合键,或按下 `F10` 按键来引导到紧急模式。 + +![Ubuntu Emergency Mode][21] + +最后,你可以使用下面的命令来以读/写模式的方式来挂载根(`/`)文件系统: + +``` +mount -n -o remount,rw / +``` + +### 在救援模式和紧急模式之间切换 + +如果你正在救援模式中,你不必像我上述提到的那样来编辑 GRUB 的菜单启动项。相反,你只想要输入下面的命令来立刻切换到紧急模式: + +``` +systemctl emergency +``` + +同样,为从紧急模式切换到救援模式,输入: + +``` +systemctl rescue +``` + +### 总结 + +现在,你知道了什么是救援模式和紧急模式,以及如何在 Ubuntu 22.04 、20.04 和 18.04 LTS 系统中启动到这些模式。正如我已经提到的,在这里提供的这些步骤应该也适用于大多数当前使用 systemd 作为默认服务管理器的 Linux 发行版。 + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/check-runlevel-linux/ +[2]: https://ostechnix.com/how-to-reset-or-recover-root-user-password-in-linux/ +[3]: https://ostechnix.com/wp-content/uploads/2022/05/GRUB-Menu-In-Ubuntu-22.04-LTS.png +[4]: https://ostechnix.com/wp-content/uploads/2022/05/Edit-Grub-Boot-Menu-Entries-To-Enter-Into-Rescue-Mode-In-Ubuntu-22.04-LTS.png +[5]: https://ostechnix.com/wp-content/uploads/2022/05/Boot-Into-Rescue-Mode-In-Ubuntu-22.04.png +[6]: https://ostechnix.com/wp-content/uploads/2022/05/Mount-Root-File-System-In-Read-Write-Mode-In-Ubuntu.png +[7]: https://ostechnix.com/wp-content/uploads/2022/05/Choose-Advanced-Options-For-Ubuntu-From-Grub-Boot-Menu.png +[8]: https://ostechnix.com/wp-content/uploads/2022/05/Choose-Recovery-Mode-In-Grub-Boot-Menu-In-Ubuntu.png +[9]: https://ostechnix.com/wp-content/uploads/2022/05/Enter-Into-Root-Shell-Prompt-In-Ubuntu.png +[10]: https://ostechnix.com/wp-content/uploads/2022/05/Ubuntu-Maintenance-Mode.png +[11]: https://ostechnix.com/wp-content/uploads/2022/05/Mount-Root-File-System-In-Read-Write-Mode-In-Ubuntu-1.png +[12]: https://ostechnix.com/wp-content/uploads/2022/05/Boot-Into-Normal-Mode-In-Ubuntu.png +[13]: https://ostechnix.com/wp-content/uploads/2022/05/Exit-The-Recovery-Mode-In-Ubuntu.png +[14]: https://ostechnix.com/wp-content/uploads/2022/05/GRUB-Menu-In-Ubuntu-22.04-LTS.png +[15]: https://ostechnix.com/wp-content/uploads/2022/05/Edit-Grub-Boot-Menu-Entries-To-Enter-Into-Emergency-Mode-In-Ubuntu.png +[16]: https://ostechnix.com/wp-content/uploads/2018/12/Boot-Into-Emergency-Mode-In-Ubuntu-20.04-LTS.png +[17]: https://ostechnix.com/wp-content/uploads/2018/12/Grub-menu.png +[18]: https://ostechnix.com/wp-content/uploads/2018/12/Edit-grub-menu.png +[19]: https://ostechnix.com/wp-content/uploads/2018/12/Ubuntu-rescue-mode.png +[20]: https://ostechnix.com/wp-content/uploads/2018/12/emergency-mode.png +[21]: https://ostechnix.com/wp-content/uploads/2018/12/emergency-mode-1.png diff --git a/translated/tech/20220519 Use this open source screen reader on Windows.md b/published/20220519 Use this open source screen reader on Windows.md similarity index 59% rename from translated/tech/20220519 Use this open source screen reader on Windows.md rename to published/20220519 Use this open source screen reader on Windows.md index 27bcf2fe00..a553667e53 100644 --- a/translated/tech/20220519 Use this open source screen reader on Windows.md +++ b/published/20220519 Use this open source screen reader on Windows.md @@ -3,32 +3,32 @@ [#]: author: "Peter Cheer https://opensource.com/users/petercheer" [#]: collector: "lkxed" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14664-1.html" -在 Windows 上使用这个开源屏幕阅读器 +在 Windows 上使用开源屏幕阅读器 NVDA ====== -为纪念全球无障碍意识日,了解 NVDA 开源屏幕阅读器,以及你如何参与其中,为所有网络用户提高无障碍性。 -![Working from home at a laptop][1] -图片提供:Opensource.com +![](https://img.linux.net.cn/data/attachment/album/202206/02/101911ds5t1xts1o52vmss.jpg) + +> 为纪念全球无障碍意识日,让我们了解一下 NVDA 开源屏幕阅读器,以及你该如何参与其中,为所有网络用户提高无障碍性。 屏幕阅读器是辅助技术软件的一个专门领域,它可以阅读并说出计算机屏幕上的内容。完全没有视力的人只是视力障碍者的一小部分,屏幕阅读器软件可以帮助所有群体。屏幕阅读器大多特定于操作系统,供有视觉障碍的人和无障碍培训师使用,以及想要测试网站或应用的无障碍访问程度的开发人员和无障碍顾问。 ### 如何使用 NVDA 屏幕阅读器 -[WebAIM 屏幕阅读器用户调查][2]始于 2009 年,一直持续到 2021 年。在第一次调查中,最常用的屏幕阅读器是 JAWS,占 74%。它是 Microsoft Windows 的商业产品,并且是长期的市场领导者。 NVDA 当时是一个相对较新的 Windows 开源屏幕阅读器,仅占 8%。快进到 2021 年,JAWS 占 53.7%,NVDA 占 30.7%。 +[WebAIM 屏幕阅读器用户调查][2] 始于 2009 年,一直持续到 2021 年。在第一次调查中,最常用的屏幕阅读器是 JAWS,占 74%。它是微软 Windows 的商业产品,并且是长期的市场领导者。NVDA 当时是一个相对较新的 Windows 开源屏幕阅读器,仅占 8%。快进到 2021 年,JAWS 占 53.7%,NVDA 占 30.7%。 -你可以从 [NVAccess 网站][3]下载最新版本的 NVDA。为什么我要使用 NVDA 并将它推荐给我使用微软 Windows 的客户?嗯,它是开源的,速度快,功能强大,易于安装,支持多种语言,可以作为便携式应用运行,拥有庞大的用户群,并且有定期发布新版本的周期。 +你可以从 [NVAccess 网站][3] 下载最新版本的 NVDA。为什么我要使用 NVDA 并将它推荐给我使用微软 Windows 的客户?嗯,它是开源的、速度快、功能强大、易于安装、支持多种语言、可以作为便携式应用运行、拥有庞大的用户群,并且有定期发布新版本的周期。 -NVDA 已被翻译成 55 种语言,并在 175 个不同的国家/地区使用。还有一个活跃的开发者社区,拥有自己的[社区插件网站][4]。你选择安装的任何附加组件都将取决于你的需求,并且有很多可供选择,包括常见视频会议平台的扩展。 +NVDA 已被翻译成 55 种语言,并在 175 个不同的国家/地区使用。还有一个活跃的开发者社区,拥有自己的 [社区插件网站][4]。你选择安装的任何附加组件都将取决于你的需求,并且有很多可供选择,包括常见视频会议平台的扩展。 与所有屏幕阅读器一样,NVDA 有很多组合键需要学习。熟练使用任何屏幕阅读器都需要培训和练习。 ![Image of NVDA welcome screen][5] -向熟悉计算机和会使用键盘的人教授 NVDA 并不太难。向一个完全初学者教授基本的计算机技能(没有鼠标、触摸板和键盘技能)和使用 NVDA 是一个更大的挑战。个人的学习方式和偏好不同。此外,如果人们只想浏览网页和使用电子邮件,他们可能不需要学习如何做所有事情。NVDA 教程和资源的一个很好的链接来源是[无障碍中心][6]。 +向熟悉计算机和会使用键盘的人教授 NVDA 并不太难。向一个完全初学者教授基本的计算机技能(没有鼠标、触摸板和键盘技能)和使用 NVDA 是一个更大的挑战。个人的学习方式和偏好不同。此外,如果人们只想浏览网页和使用电子邮件,他们可能不需要学习如何做所有事情。NVDA 教程和资源的一个很好的链接来源是 [无障碍中心][6]。 当你掌握了使用键盘命令操作 NVDA,它就会变得更容易,但是还有一个菜单驱动的系统可以完成许多配置任务。 @@ -36,13 +36,11 @@ NVDA 已被翻译成 55 种语言,并在 175 个不同的国家/地区使用 ### 测试无障碍性 -多年来,屏幕阅读器用户无法访问某些网站一直是个问题,尽管美国残疾人法案(ADA)等残疾人平等立法仍然存在。 NVDA 在有视力的社区中的一个很好的用途是用于网站无障碍性测试。NVDA 可以免费下载,并且通过运行便携式版本,网站开发人员甚至不需要安装它。运行 NVDA,关闭显示器或闭上眼睛,看看你在浏览网站或应用时的表现如何。 +多年来,屏幕阅读器用户无法访问某些网站一直是个问题,尽管美国残疾人法案(ADA)等残疾人平等立法仍然存在。NVDA 在有视力的社区中的一个很好的用途是用于网站无障碍性测试。NVDA 可以免费下载,并且通过运行便携式版本,网站开发人员甚至不需要安装它。运行 NVDA,关闭显示器或闭上眼睛,看看你在浏览网站或应用时的表现如何。 -NVDA 也可用于测试(通常被忽略的)正确[标记 PDF 文档以实现无障碍性][8]任务。 +NVDA 也可用于测试(通常被忽略的)正确 [标记 PDF 文档以实现无障碍性][8] 任务。 -有几个指南专注于使用 NVDA 进行无障碍性测试。我可以推荐[使用 NVDA 测试网页][9]和使用 [NVDA 评估 Web 无障碍性][10]。 - -图片提供:(Peter Cheer,CC BY-SA 4.0) +有几个指南专注于使用 NVDA 进行无障碍性测试。我可以推荐 [使用 NVDA 测试网页][9] 和使用 [NVDA 评估 Web 无障碍性][10]。 -------------------------------------------------------------------------------- @@ -51,7 +49,7 @@ via: https://opensource.com/article/22/5/open-source-screen-reader-windows-nvda 作者:[Peter Cheer][a] 选题:[lkxed][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/20220523 7 pieces of Linux advice for beginners.md b/published/20220523 7 pieces of Linux advice for beginners.md new file mode 100644 index 0000000000..3a2c4d76ad --- /dev/null +++ b/published/20220523 7 pieces of Linux advice for beginners.md @@ -0,0 +1,141 @@ +[#]: subject: "7 pieces of Linux advice for beginners" +[#]: via: "https://opensource.com/article/22/5/linux-advice-beginners" +[#]: author: "Opensource.com https://opensource.com/users/admin" +[#]: collector: "lkxed" +[#]: translator: "lightchaserhy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14712-1.html" + +给 Linux 初学者的 7 条建议 +====== + +> 我们咨询了我们社区作者们,分享了他们的初学经验。 + +![](https://img.linux.net.cn/data/attachment/album/202206/15/143733yhdrxhbnhojbxn2a.jpg) + +对 Linux 的新用户有什么建议?我们请社区的作者们分享了他们初学时的最佳经验。 + +### 1、用好 Linux 资源 + +我哥们儿告诉我,Linux 就像一个“软件积木搭建套装”(这是一个过时的词汇,指的是上世纪五六十年代流行的建筑积木玩具),这个比喻比较恰当。在 2001、2002 年那时,我曾经利用 Windows 3.1 和 Windows NT,尝试搭建一个安全、有用的 K12 学区网站,当时网上可用的资料不多。其中被推荐的《ROOT 用户指南》是一本“大部头”专业教程,信息丰富,但是有一定上手难度。 + +于我而言,Mandrake Linux 的线上课程是最有用的资源。该课程对使用和管理 Linux 桌面或服务器进行了详细的解读。我学习了该课程,并同时利用红帽公司维护的一个邮件列表服务,有问题时就在社区提问寻求帮助。 + +—— [Don Watkins][2] + +### 2、在 Linux 社区寻求帮助 + +我的建议是要多问,你可以从网上搜索信息开始,看看其他人类似的问题(甚至是更好的提问)。问什么和如何问,需要花一定时间熟悉。 + +一旦你对 Linux 更加熟悉了,查看你感兴趣的各种相关论坛,在提问前,先看看是否有人已经提过相同问题,并获得了答案。 + +加入邮件列表也很有用,最后你会发现自己也能专业地答复提问。正如他们说的,通过回答他人的问题也会学到更多知识。 + +同时,你会越来越熟悉这个操作系统内部运行机制,再也不是初学时的一无所知。 + +—— [Greg Pittman][3] + +我的建议是利用 `man`、`info` 等帮助命令获取信息。另外,尽可能花时间熟悉命令行界面,且真正理解 UNIX 的设计理念。事实上,我最喜欢的书之一就是一本 80 年代的 UNIX 书籍,对理解文件、目录、设备、基础命令等非常有帮助。 + +—— [Alan Formy-Duval][4] + +我最好的建议是充分相信社区的答复、手册页的详细信息、介绍不同选项的 HOW-TO 文档。不管怎么说,我是在 2009 年左右开始学习的,当时有很多可用的工具和资源。有一个叫 “Linux from Scratch(LFS)”的项目 —— 从源码开始创建 Linux 系统,在这个项目我学会了很多内部原理知识,以及如何创建一个 LFS 镜像。 + +—— [Sumantro Mukherjee][6] + +我的建议是泛读。利用像 “Ask Fedora”、“Fedora Matrix chat” 等论坛,阅读他人的经验观点,并且尝试实践。我通过阅读他人的网上争论学习到很多东西,然后我会尝试找出问题的原因。 + +—— [Steve Morris][8] + +### 3、安装双操作系统 + +我在 90 年代末就开始安装双操作系统(Windows 和 Linux),虽然我真正想使用的是 Linux 操作系统,但我最终还是启动了 Windows 系统,以便在熟悉的桌面环境中工作。最好的建议之一是改变计算机系统启动顺序,所以每次我都反应不够快,自动进入了 Linux 系统。: ) + +—— [Heike Jurzik][9] + +我的团队里的一个人挑战我,要做一个知识交换。 + +他是我们的 Linux 系统管理员,利用 Joomla 搭建了一个网站(我们的 Web 团队擅长这个,他想学习更多知识),而我则安装了 Linux(以前一直是用 Windows)。我们一开始就用了双启动,因为我还有一堆依赖于操作系统的软件需要用于业务,但这让我对 Linux 的使用有了一个飞跃。 + +在我们各自学习新系统时,对方作为专家来互相帮助有助于共同成长,“一个都不能少!”,坚持不懈是一个很大的挑战。 + +我经历一个相当尴尬的低级错误后,在显示器上贴了一个大便签,上面写着“在使用任何 `rm` 操作前,首先要思考一下”。管理员给我写了一个命令行大全(网上有很多类似的),对于熟悉基础操作非常有用。我开始使用 Ubuntu 的 KDE 桌面环境时,发现对习惯于使用图形界面的初学者很有帮助。 + +从那以后我就开始长期使用 Linux(除了我的工作计算机),而那位管理员仍然在用 Joomla,看起来我俩都得到了成长。 + +—— [Ruth Cheesley][12] + +### 4、为了安全请先备份 + +我的建议是使用一个带有简单且强大的备份软件的发行版。Linux 新用户会创建、编辑、破坏和恢复系统配置。当操作系统无法启动、丢失数据时,会让他们非常沮丧。 + +有了备份软件,他们的数据就有了保障。 + +我们都喜爱 Linux,因为它能让我们自由飞翔,但这是“双刃剑”,使用不当也有可能发生非常严重的错误。 + +—— [Giuseppe Cassibba][13] + +### 5、分享你的 Linux 经验 + +我的建议是分享你的 Linux 使用经验。我曾经认为有一些发行版更适合新用户,所以当他们咨询使用 Linux 时,我总是推荐这些为“新用户准备的”发行版。但是当我坐在他们的计算机前,看起来却像是我从未用过 Linux 一样,因为一些新功能我也不熟悉。现在当有人咨询时,我会推荐自己使用的发行版,虽说这不一定是初学者的“最佳”版本,但毕竟我熟悉,他们遇到的问题我能够快速解决(当然我自己也会在分享中学到新东西)。 + +—— [Seth Kenlon][14] + +以前有句俗话叫“不要随便使用杂志封面上宣传的发行版,使用你朋友都在用的,当你遇到问题时才能更好地需求帮助”。将关键词“杂志封面”替换为“互联网”,这句话依然有效 : -) 。我从未听从过这个建议,因为我是方圆五十公里内唯一使用 Linux 的人,周围的人都在用 FreeBSD、IRIX、Solaris 和 Windows 3.11 等操作系统,最后,我就是那个被人们寻求 Linux 帮助的人。 + +—— [Peter Czanik][15] + +### 6、坚持学习 Linux + +在到 Red Hat 工作前,我是一名分销商合作伙伴,我有几个提供旅行护士的家庭健康代理机构客户,他们使用了一个叫“Carefacts”的软件包,最初用于 DOS,在旅行笔记本电脑和中心数据库同步中总是出错。 + +早期我听到的最好建议是认真研究一下开源运动。开源在 2022 年是主流思想,但在一代人以前,从 Red Hat 的零售商购买 Linux 安装光盘是带有革命性的创新行为。开源打破了常规,我认为要客观看待开源,但确实惊叹到了相当一部分人。 + +我的公司在 20 世纪 90 年代中期搭建了第一个客户防火墙,那是基于 Windows NT 和 Altavista 的一个产品,但是经常发生错误崩溃。我们自己又搭建了一个基于 Linux 的防火墙,再也没有出问题了。因此,我们用 Linux 替换了客户的那套 Altavista 系统,稳定地运行了多年。我们在 1999 年底搭建了另一个客户防火墙,当时我花三周读完了一本关书,介绍了数据包过滤和 ipchains 的正确使用,当我完成时感觉超赞,它解决了所有问题。在接下来的 15 年,我搭建安装了数百个防火墙系统,主要采用 iptables 技术,有些利用桥接或 ARP 代理以及 QOS 保障视频会议传输,有些利用 IPSEC 和 OpenVPN 隧道。我靠管理个人防火墙和一些双机热备系统赚取生活费,非常不错,而以前都是用的 Windows 系统。我甚至还建了一些虚拟防火墙。 + +但是技术在高速发展,2022 年,iptables 已过时,我以前的防火墙技术也成了美好的回忆。 + +目前的经验之谈?永远不要停止探索。 + +—— [Greg Scott][19] + +### 7、享受过程 + +耐心点,Linux 和之前你熟悉的操作系统不太相同,准备拥抱一个充满无限可能的新世界,尽情享受吧。 + +—— [Alex Callejas][20] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/linux-advice-beginners + +作者:[Opensource.com][a] +选题:[lkxed][b] +译者:[lightchaserhy](https://github.com/lightchaserhy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/admin +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/yearbook-haff-rx-linux-file-lead_0.png +[2]: https://opensource.com/users/don-watkins +[3]: https://opensource.com/users/greg-p +[4]: https://opensource.com/users/alanfdoss +[5]: https://linuxfromscratch.org/ +[6]: https://opensource.com/users/sumantro +[7]: https://ask.fedoraproject.org +[8]: https://opensource.com/users/smorris12 +[9]: https://opensource.com/users/hej +[10]: https://opensource.com/downloads/linux-common-commands-cheat-sheet +[11]: https://opensource.com/article/22/2/why-i-love-linux-kde +[12]: https://opensource.com/users/rcheesley +[13]: https://opensource.com/users/peppe8o +[14]: https://opensource.com/users/seth +[15]: https://opensource.com/users/czanik +[16]: https://www.redhat.com/sysadmin/run-your-own-vpn-libreswan +[17]: https://opensource.com/article/21/8/openvpn-server-linux +[18]: https://opensource.com/article/19/7/make-linux-stronger-firewalls +[19]: https://opensource.com/users/greg-scott +[20]: https://opensource.com/users/darkaxl diff --git a/translated/tech/20220524 Collision- Linux App to Verify ISO and Other Files.md b/published/20220524 Collision- Linux App to Verify ISO and Other Files.md similarity index 66% rename from translated/tech/20220524 Collision- Linux App to Verify ISO and Other Files.md rename to published/20220524 Collision- Linux App to Verify ISO and Other Files.md index 7d59ad4431..a60f32620a 100644 --- a/translated/tech/20220524 Collision- Linux App to Verify ISO and Other Files.md +++ b/published/20220524 Collision- Linux App to Verify ISO and Other Files.md @@ -3,21 +3,24 @@ [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lkxed" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14671-1.html" Collision:用于验证 ISO 和其他文件的 Linux 应用 ====== -本教程概述了 Collision 的功能和使用指南。它是一个基于 GUI 且易于使用的程序,可让你使用加密哈希函数验证文件。 + +![](https://img.linux.net.cn/data/attachment/album/202206/04/111427jzkwsocv4oug3vso.jpg) + +> 本教程概述了 Collision 的功能和使用指南。它是一个基于 GUI 且易于使用的程序,可让你使用加密哈希函数验证文件。 ### 为什么需要验证文件? -每个人每天都通过 Internet 下载文件。但许多用户从不费心去验证他们的完整性或真实性。这意味着该文件是否合法且未被任何恶意代码篡改。 +人们每天都通过互联网下载文件。但许多用户从不费心去验证他们的完整性或真实性。这意味着不知道该文件是否合法且未被任何恶意代码篡改。 -以作为标准安装镜像的 [Linux 发行版][1]的 ISO 文件为例。所有流行的发行版制造商还提供哈希文件和 ISO 文件。使用该文件,你可以轻松比较下载文件的哈希值。你可以放心,你的文件是正确的并且没有以任何方式损坏。 +以作为标准安装镜像的 [Linux 发行版][1] 的 ISO 文件为例。所有流行的发行版制造商在 ISO 文件还提供哈希文件。使用该文件,你可以轻松比较下载文件的哈希值。让你可以放心你的文件是正确的并且没有以任何方式损坏。 -此外,如果你通过不稳定的互联网连接下载大文件,该文件可能会损坏。在这些情况下,它也有助于验证。 +此外,如果你通过不稳定的互联网连接下载大文件,该文件可能会损坏。在这些情况下,它也有需要验证。 ### Collision – 功能和使用方法 @@ -27,29 +30,29 @@ Collision:用于验证 ISO 和其他文件的 Linux 应用 ![Collision – First Screen][3] -首先,它有两个主要特点。 a) 上传文件以获取校验和和或哈希值 b) 将校验和与上传的文件进行比较。 +首先,它有两个主要特点。 a、上传文件以获取校验和和或哈希值;b、将校验和与上传的文件进行比较。 -例如,如果你有一个简单的文件,你可以通过“打开文件”按钮或“打开”按钮重新上传另一个文件。 +例如,如果你有一个简单的文件,你可以通过“打开文件Open a File”按钮上传一个文件,或“打开Open”按钮重新上传另一个文件。 -如下图所示,文本文件具有以下各种哈希函数的校验和。现在你可以通过互联网/与任何人共享该文件,以及用于验证的校验和值。 +如下图所示,该文本文件具有以下各种哈希函数的校验和。现在你可以通过互联网/与任何人共享该文件,以及用于验证的校验和值。 ![Hash values of a test file][4] 此外,如果有人篡改文件(即使是单个字节)或文件在分发过程中被破坏,那么哈希值就会完全改变。 -其次,如果要验证已下载文件的完整性,请点击“验证”选项卡。然后上传文件,输入你收到的上传文件的哈希值。 +其次,如果要验证已下载文件的完整性,请点击“验证Verify”选项卡。然后上传文件,输入你收到的上传文件的哈希值。 如果匹配,你应该会看到一个绿色勾号,显示其真实性。 ![Collision verifies a sample file with SHA-256][5] -此外,这是另一个示例,我修改了测试文件并保持值相同。这个场景清楚地表明它对该文件无效。 +此外,这是另一个示例,我修改了测试文件并保持大小相同。这个场景清楚地表明它对该文件无效。 ![Collision showing that a file is not valid][6] #### 重要说明 -这里值得一提的是,哈希方法不会验证文件元属性,如修改时间、修改日期等。如果有人篡改了文件并将其还原为原始内容,哈希方法将其称为有效文件。 +这里值得一提的是,哈希方法不会验证文件元属性,如修改时间、修改日期等。如果有人篡改了文件并将其还原为原始内容,这种哈希方式将其称为有效文件。 现在,让我们看一个验证 ISO 文件的典型示例。 @@ -59,21 +62,21 @@ Collision:用于验证 ISO 和其他文件的 Linux 应用 ![Ubuntu server ISO file and checksums][7] -SHA256SUMS 文件具有以下安装程序的校验和值,如上所示。 +`SHA256SUMS` 文件带有上面的该安装程序的以下校验和值: ![SHA-256 value of Ubuntu server ISO image][8] -下载后,打开 Collision 应用并通过验证选项卡上传 ISO 文件。然后复制 SHA-256 值并将其粘贴到左侧的校验和框中。 +下载后,打开 Collision 应用并通过“验证Verify”选项卡上传 ISO 文件。然后复制 SHA-256 值并将其粘贴到左侧的校验和框中。 -如果你已正确下载并按照步骤操作,你应该会看到该文件是真实的。 +如果你已正确下载并按照步骤操作,你应该会看到该文件是真实有效的。 ![Ubuntu server ISO image verified][9] ### 如何安装 Collision -使用 Flatpak 可以轻松安装 Collision 应用。你需要为你的 Linux 发行版[设置 Flatpak][10],并单击以下链接以安装 Collision。 +使用 Flatpak 可以轻松安装 Collision 应用。你需要为你的 Linux 发行版 [设置 Flatpak][10],并单击以下链接以安装 Collision。 -[通过 Flathub 安装 Collision][11] +> **[通过 Flathub 安装 Collision][11]** 安装后,你应该通过发行版的应用菜单找到它。 @@ -101,7 +104,7 @@ sha256sum <文件名> ### 结束语 -我希望本指南可以帮助你使用 Collision GTK 应用验证你的文件。它使用起来很简单。此外,你可以在终端中使用命令行方法来验证您想要的任何文件。另外,最好的做法是尽可能始终检查文件完整性。 +我希望本指南可以帮助你使用 Collision GTK 应用验证你的文件。它使用起来很简单。此外,你可以在终端中使用命令行方法来验证您想要的任何文件。尽可能始终检查文件完整性总是应该的。 -------------------------------------------------------------------------------- @@ -110,7 +113,7 @@ via: https://www.debugpoint.com/2022/05/collision/ 作者:[Arindam][a] 选题:[lkxed][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20220525 Machine Learning- Classification Using Python.md b/published/20220525 Machine Learning- Classification Using Python.md similarity index 64% rename from translated/tech/20220525 Machine Learning- Classification Using Python.md rename to published/20220525 Machine Learning- Classification Using Python.md index bb0d734528..0ae672fac4 100644 --- a/translated/tech/20220525 Machine Learning- Classification Using Python.md +++ b/published/20220525 Machine Learning- Classification Using Python.md @@ -3,19 +3,20 @@ [#]: author: "Gayatri Venugopal https://www.opensourceforu.com/author/gayatri-venugopal/" [#]: collector: "lkxed" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "turbokernel" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14676-1.html" 机器学习:使用 Python 进行分类 ====== -在机器学习 (ML) 中,分析一组数据以预测结果。 Python 被认为是 ML 的最佳编程语言选择之一。在本文中,我们将讨论使用 Python 进行分类的机器学习。 + +> 机器学习(ML)就是,分析一组数据以预测结果。Python 被认为是 ML 的最佳编程语言选择之一。在本文中,我们将讨论使用 Python 进行分类的机器学习。 ![machine-learning-classification][1] 假设你想教孩子区分苹果和橙子。有多种方法可以做到这一点。你可以让孩子触摸这两种水果,让他们熟悉形状和柔软度。你还可以向她展示苹果和橙子的多个例子,以便他们可以直观地发现差异。这个过程的技术等价物被称为机器学习。 -机器学习教计算机解决特定问题,并通过经验变得更好。这里讨论的示例是一个分类问题,其中机器被赋予各种标记示例,并期望使用它从标记样本中获得的知识来标记未标记样本。机器学习问题也可以采用回归的形式,其中期望根据已知样本及其解决方案来预测给定问题的实值解决方案。分类和回归被广泛称为监督学习。机器学习也可以是无监督的,机器识别未标记数据中的模式,并形成具有相似模式的样本集群。机器学习的另一种形式是强化学习,机器通过犯错从环境中学习。 +机器学习教计算机解决特定问题,并通过经验变得更好。这里讨论的示例是一个分类问题,其中机器被赋予各种标记示例,并期望使用它从标记样本中获得的知识来对未标记样本进行标记。机器学习问题也可以采用回归的形式,其中期望根据已知样本及其解决方案来预测给定问题的实值real-valued解决方案。分类Classification回归Regression被广泛称为监督学习supervised learning。机器学习也可以是无监督unsupervised的,机器识别未标记数据中的模式,并形成具有相似模式的样本集群。机器学习的另一种形式是强化学习reinforcement learning,机器通过犯错从环境中学习。 ### 分类 @@ -23,41 +24,40 @@ 在该表中,最后一列的值,即贷款批准,预计将基于其他变量进行预测。在接下来的部分中,我们将学习如何使用 Python 训练和评估分类器。 -| - | - | - | - | - | -| :- | :- | :- | :- | :- | | 年龄 | 信用等级 | 工作 | 拥有房产 | 贷款批准 | +| :- | :- | :- | :- | :- | | 35 | 好 | 是 | 是 | 是 | | 32 | 差 | 是 | 不 | 不 | | 22 | 一般 | 不 | 不 | 不 | | 42 | 好 | 是 | 不 | 是 | -表格 1 +*表 1* ### 训练和评估分类器 -为了训练分类器,我们需要一个包含标记示例的数据集。尽管本节不涉及清理数据的过程,但建议你在将数据集输入分类器之前阅读各种数据预处理和清理技术。为了在 Python 中处理数据集,我们将导入 pandas 包和 data frame 结构。然后,你可以从多种分类算法中进行选择,例如决策树、支持向量分类器、随机森林、XG boost、ADA boost 等。我们将看看随机森林分类器,它是使用多个决策树形成的集成分类器。 +为了训练分类器classifier,我们需要一个包含标记示例的数据集。尽管本节不涉及清理数据的过程,但建议你在将数据集输入分类器之前阅读各种数据预处理和清理技术。为了在 Python 中处理数据集,我们将导入 `pandas` 包和数据帧DataFrame结构。然后,你可以从多种分类算法中进行选择,例如决策树decision tree支持向量分类器support vector classifier随机森林random forest、XG boost、ADA boost 等。我们将看看随机森林分类器,它是使用多个决策树形成的集成分类器。 ``` from sklearn.ensemble import RandomForestClassifier from sklearn import metrics - + classifier = RandomForestClassifier() - + #creating a train-test split with a proportion of 70:30 X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33) - -classifier.fit(X_train, y_train) #train the classifier on the training set - -y_pred = classifier.predict(X_test) #evaluate the classifier on unknown data - -print(“Accuracy: “, metrics.accuracy_score(y_test, y_pred)) #compare the predictions with the actual values in the test set + +classifier.fit(X_train, y_train) # 在训练集上训练分类器 + +y_pred = classifier.predict(X_test) # 用未知数据评估分类器 + +print("Accuracy: ", metrics.accuracy_score(y_test, y_pred)) # 用测试计划中的实际值比较准确率 ``` 虽然这个程序使用准确性作为性能指标,但应该使用多种指标的组合,因为当测试集不平衡时,准确性往往会产生非代表性的结果。例如,如果模型对每条记录都给出了相同的预测,而用于测试模型的数据集是不平衡的,即数据集中的大多数记录与模型预测的类别相同,我们就会得到很高的准确率。 ### 调整分类器 -调优是指修改模型的超参数值以提高其性能的过程。超参数是可以改变其值以改进算法的学习过程的参数。 +调优是指修改模型的超参数hyperparameter值以提高其性能的过程。超参数是可以改变其值以改进算法的学习过程的参数。 以下代码描述了随机搜索超参数调整。在此,我们定义了一个搜索空间,算法将从该搜索空间中选择不同的值,并选择产生最佳结果的那个: @@ -71,8 +71,8 @@ grid = {‘min_samples_split’ : min_samples_split, ‘min_samples_leaf’ : mi classifier = RandomizedSearchCV(classifier, grid, n_iter = 100) -#n_iter represents the number of samples to extract from the search space -#result.best_score and result.best_params_ can be used to obtain the best performance of the model, and the best values of the parameters +# n_iter 代表从搜索空间提取的样本数 +# result.best_score 和 result.best_params_ 可以用来获得模型的最佳性能,以及参数的最佳值 classifier.fit(X_train, y_train) ``` @@ -81,7 +81,7 @@ classifier.fit(X_train, y_train) 你也可以使用多个分类器和它们的预测来创建一个模型,根据各个预测给出一个预测。这个过程(只考虑为每个预测投票的分类器的数量)被称为硬投票。软投票是一个过程,其中每个分类器产生一个给定记录属于特定类别的概率,而投票分类器产生的预测是获得最大概率的类别。 -A code snippet for creating a soft voting classifier is given below: +下面给出了一个创建软投票分类器的代码片段: ``` soft_voting_clf = VotingClassifier( @@ -99,7 +99,7 @@ via: https://www.opensourceforu.com/2022/05/machine-learning-classification-usin 作者:[Gayatri Venugopal][a] 选题:[lkxed][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[turbokernel](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20220525 Package is -set to manually installed-- What does it Mean-.md b/published/20220525 Package is -set to manually installed-- What does it Mean-.md similarity index 61% rename from translated/tech/20220525 Package is -set to manually installed-- What does it Mean-.md rename to published/20220525 Package is -set to manually installed-- What does it Mean-.md index 13f06a1f14..127e111531 100644 --- a/translated/tech/20220525 Package is -set to manually installed-- What does it Mean-.md +++ b/published/20220525 Package is -set to manually installed-- What does it Mean-.md @@ -3,62 +3,67 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lkxed" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14675-1.html" -软件包 “set to manually installed”?这是什么意思? +软件包 “被标记为手动安装”?这是什么意思? ====== -如果你使用 apt 命令在终端中安装软件包,你将看到各种输出。 + +![](https://img.linux.net.cn/data/attachment/album/202206/05/154517uqnqdfi79yqidi79.jpg) + +如果你使用 `apt` 命令在终端中安装软件包,你将看到各种输出。 如果你注意并查看输出,有时你会注意到一条消息: -**package_name set to manually installed** +``` +package_name set to manually installed +``` 你有没有想过这条消息是什么意思,为什么你没有在所有包上看到它?让我在本篇中分享一些细节。 -### 理解 “Package set to manually installed” +### 理解 “软件包被标记为手动安装” -当你尝试安装已安装的库或开发包时,你会看到此消息。此依赖包是与另一个包一起自动安装的。如果删除了主包,则使用 apt autoremove 命令删除依赖包。 +当你尝试安装已安装的库或开发包时,你会看到此消息。此依赖包是与另一个包一起自动安装的。如果删除了主包,则使用 `apt autoremove` 命令删除依赖包。 但是由于你试图显式安装依赖包,你的 Ubuntu 系统认为你需要这个包独立于主包。因此,该软件包被标记为手动安装,因此不会自动删除。 -不是很清楚,对吧?以[在 Ubuntu 上安装 VLC][1] 为例。 +不是很清楚,对吧?以 [在 Ubuntu 上安装 VLC][1] 为例。 -由于主 vlc 包依赖于许多其他包,因此这些包会自动安装。 +由于主 VLC 包依赖于许多其他包,因此这些包会自动安装。 ![installing vlc with apt ubuntu][2] -如果你检查名称中包含 vlc 的[已安装软件包列表][3],你会看到除了 vlc,其余都标记为“自动”。这表明这些软件包是自动安装的(使用 vlc),它们将使用 apt autoremove 命令自动删除(当 vlc 被卸载时)。 +如果你检查名称中包含 `vlc` 的 [已安装软件包列表][3],你会看到除了 VLC,其余都标记为“自动”。这表明这些软件包是(跟着 vlc)自动安装的,当 VLC 被卸载时,它们将使用 `apt autoremove` 命令自动删除。 ![list installed packages vlc ubuntu][4] -现在假设你出于某种原因考虑安装 “vlc-plugin-base”。如果你在其上运行 apt install 命令,系统会告诉你该软件包已安装。同时,它将标记从自动更改为手动,因为系统认为你在尝试手动安装时明确需要此 vlc-plugin-base。 +现在假设你出于某种原因考虑安装 `vlc-plugin-base`。如果你在其上运行 `apt install` 命令,系统会告诉你该软件包已安装。同时,它将标记从自动更改为手动,因为系统认为在尝试手动安装表明你明确需要此 `vlc-plugin-base`。 ![package set manually][5] -可以看到它的状态已经从 [installed,automatic] 变成了 [installed]。 +可以看到它的状态已经从 `[installed,automatic]` 变成了 `[installed]`。 ![listing installed packages with vlc][6] -现在,让我删除 VLC 并运行 autoremove 命令。你可以看到 “vlc-plugin-base” 不在要删除的软件包列表中。 +现在,让我删除 VLC 并运行 `autoremove` 命令。你可以看到 `vlc-plugin-base` 不在要删除的软件包列表中。 ![autoremove vlc ubuntu][7] -再次检查已安装软件包的列表。vlc-plugin-base 仍然安装在系统上。 +再次检查已安装软件包的列表。`vlc-plugin-base` 仍然安装在系统上。 ![listing installed packages after removing vlc][8] -你可以在这里看到另外两个与 vlc 相关的包。这些是 vlc-plugin-base 包的依赖项,这就是为什么它们也存在于系统上但标记为 “automatic” 的原因。 +你可以在这里看到另外两个与 VLC 相关的包。这些是 `vlc-plugin-base` 包的依赖项,这就是为什么它们也存在于系统上但标记为 `automatic` 的原因。 -我相信现在有了这些例子,事情就更清楚了。让我给你一个额外提示。 +我相信现在有了这些例子,事情就更清楚了。让我给你一个额外的技巧。 ### 将包重置为自动 如果包的状态从自动更改为手动,你可以通过以下方式将其设置回自动: ``` -sudo apt-mark auto 包名 +sudo apt-mark auto package_name ``` ![set package to automatic][9] @@ -67,7 +72,7 @@ sudo apt-mark auto 包名 这不是一个重大错误,也不会阻止你在系统中进行工作。但是,了解这些小事会增加你的知识。 -**好奇心可能会害死猫,但它会让企鹅变得更聪明**。这是为这篇原本枯燥的文章增添幽默感的原始引述 :) +**好奇心可能会害死猫,但它会让企鹅变得更聪明**。这是为这篇原本枯燥的文章增添幽默感的原始引述 : ) 如果你想阅读更多这样的文章,这些文章可能看起来微不足道,但可以帮助你更好地了解您的 Linux 系统,请告诉我。 @@ -78,7 +83,7 @@ via: https://itsfoss.com/package-set-manually-installed/ 作者:[Abhishek Prakash][a] 选题:[lkxed][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/20220530 Dynamically linking libraries while compiling code.md b/published/20220530 Dynamically linking libraries while compiling code.md new file mode 100644 index 0000000000..200b9a7fda --- /dev/null +++ b/published/20220530 Dynamically linking libraries while compiling code.md @@ -0,0 +1,136 @@ +[#]: subject: "Dynamically linking libraries while compiling code" +[#]: via: "https://opensource.com/article/22/5/compile-code-ldlibrarypath" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14690-1.html" + +编译代码时动态地链接库 +====== + +![](https://linux.cn/article-14690-1.html) + +> 编译软件在你如何运行你的系统方面给你很大的灵活性。`LD_LIBRARY_PATH` 变量,以及 GCC 的 `-L` 和 `-l` 选项,是这种灵活性的组成部分。 + +编译软件是开发者经常做的事情,在开源世界中,一些用户甚至选择自己动手。Linux 播客 Dann Washko 称源码为“通用包格式”,因为它包含了使一个应用在任何平台上运行所需的所有组件。当然,并不是所有的源码都是为所有的系统编写的,所以它只是在目标系统的子集内是“通用”的,但问题是,源码是非常灵活的。有了开源,你可以决定代码的编译和运行方式。 + +当你在编译代码时,你通常要处理多个源文件。开发人员倾向于将不同的类或模块放在不同的文件中,这样它们可以被单独维护,甚至可能被不同的项目使用。但当你编译这些文件时,许多文件会被编译成一个可执行文件。 + +这通常是通过创建共享库来完成的,然后从可执行文件中动态链接回它们。这样可以通过保持模块化功能的外部性来保持可执行文件的小型化,并确保库可以独立于使用它们的应用而被更新。 + +### 在编译过程中定位一个共享对象 + +当你 [用 GCC 编译][2] 时,你通常需要在你的工作站上安装一个库,以便 GCC 能够定位到它。默认情况下,GCC 假定库在系统库路径中,例如 `/lib64` 和 `/usr/lib64`。然而,如果你要链接到一个你自己的尚未安装的库,或者你需要链接到一个没有安装在标准位置的库,那么你必须帮助 GCC 找到这些文件。 + +有两个选项对于在 GCC 中寻找库很重要: + +* `-L`(大写字母 L)在 GCC 的搜索位置上增加一个额外的库路径。 +* `-l`(小写字母 L)设置你要链接的库的名字。 + +例如,假设你写了一个叫做 `libexample.so` 的库,并且你想在编译你的应用 `demo.c` 时使用它。首先,从 `demo.c` 创建一个对象文件: + +``` +$ gcc -I ./include -c src/demo.c +``` + +`-I` 选项在 GCC 搜索头文件的路径中增加了一个目录。在这个例子中,我假设自定义头文件在一个名为 `include` 的本地目录中。`-c` 选项防止 GCC 运行链接器,因为这个任务只是为了创建一个对象文件。结果如下: + +``` +$ ls +demo.o include/ lib/ src/ +``` + +现在你可以使用 `-L` 选项为你的库设置一个路径,然后进行编译: + +``` +$ gcc -L`pwd`/lib -o myDemo demo.o -lexample +``` + +注意,`-L` 选项在 `-l` 选项*之前*。这很重要,因为如果在你告诉 GCC 查找非默认库之前没有将 `-L` 添加到 GCC 的搜索路径中,GCC 就不知道要在你的自定义位置上搜索。编译成功了,但当你试图运行它时,却出现了问题: + +``` +$ ./myDemo +./myDemo: error while loading shared libraries: +libexample.so: cannot open shared object file: +No such file or directory +``` + +### 用 ldd 排除故障 + +`ldd` 工具可以打印出共享对象的依赖关系,它在排除类似问题时很有用: + +``` +$ ldd ./myDemo + linux-vdso.so.1 (0x00007ffe151df000) + libexample.so => not found + libc.so.6 => /lib64/libc.so.6 (0x00007f514b60a000) + /lib64/ld-linux-x86-64.so.2 (0x00007f514b839000) +``` + +你已经知道定位不到 `libexample`,但 `ldd` 输出至少确认了它对*工作*库的期望位置。例如,`libc.so.6 `已经被定位,`ldd` 显示其完整路径。 + +### LD_LIBRARY_PATH + +`LD_LIBRARY_PATH` [环境变量][3] 定义了库的路径。如果你正在运行一个依赖于没有安装到标准目录的库的应用程,你可以使用 `LD_LIBRARY_PATH` 添加到系统的库搜索路径。 + +有几种设置环境变量的方法,但最灵活的是在运行命令前放置环境变量。看看设置 `LD_LIBRARY_PATH` 对 `ldd` 命令在分析一个“损坏”的可执行文件时的作用: + +``` +$ LD_LIBRARY_PATH=`pwd`/lib ldd ./ + linux-vdso.so.1 (0x00007ffe515bb000) + libexample.so => /tmp/Demo/lib/libexample.so (0x0000... + libc.so.6 => /lib64/libc.so.6 (0x00007eff037ee000) + /lib64/ld-linux-x86-64.so.2 (0x00007eff03a22000) +``` + +这也同样适用于你的自定义命令: + +``` +$ LD_LIBRARY_PATH=`pwd`/lib myDemo +hello world! +``` + +然而,如果你移动库文件或可执行文件,它又会失效: + +``` +$ mv lib/libexample.so ~/.local/lib64 +$ LD_LIBRARY_PATH=`pwd`/lib myDemo +./myDemo: error while loading shared libraries... +``` + +要修复它,你必须调整 `LD_LIBRARY_PATH` 以匹配库的新位置: + +``` +$ LD_LIBRARY_PATH=~/.local/lib64 myDemo +hello world! +``` + +### 何时使用 LD_LIBRARY_PATH + +在大多数情况下,`LD_LIBRARY_PATH` 不是你需要设置的变量。按照设计,库安装到 `/usr/lib64` 中,因此应用自然会在其中搜索所需的库。在两种情况下,你可能需要使用 `LD_LIBRARY_PATH`: + +* 你正在编译的软件需要链接到本身刚刚编译但尚未安装的库。良好设计的构建系统,例如 [Autotools][4] 和 [CMake][5],可以帮助处理这个问题。 +* 你正在使用设计为在单个目录之外运行的软件,它没有安装脚本,或安装脚本将库放置在非标准目录中。一些应用具有 Linux 用户可以下载、复制到 `/opt` 并在“不安装”的情况下运行的版本。`LD_PATH_LIBRARY` 变量是通过封装脚本设置的,因此用户通常甚至不知道它已被设置。 + +编译软件为你在运行系统方面提供了很大的灵活性。`LD_LIBRARY_PATH` 变量以及 `-L` 和 `-l` GCC 选项是这种灵活性的组成部分。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/compile-code-ldlibrarypath + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/collab-team-pair-programming-code-keyboard2.png +[2]: https://opensource.com/article/22/5/what-happens-behind-scenes-during-gcc-compilation-c-programs +[3]: https://opensource.com/article/19/8/what-are-environment-variables +[4]: https://opensource.com/article/19/7/introduction-gnu-autotools +[5]: https://opensource.com/article/21/5/cmake diff --git a/translated/tech/20220530 Using a Machine Learning Model to Make Predictions.md b/published/20220530 Using a Machine Learning Model to Make Predictions.md similarity index 74% rename from translated/tech/20220530 Using a Machine Learning Model to Make Predictions.md rename to published/20220530 Using a Machine Learning Model to Make Predictions.md index 94a7feb229..7fb0ad690d 100644 --- a/translated/tech/20220530 Using a Machine Learning Model to Make Predictions.md +++ b/published/20220530 Using a Machine Learning Model to Make Predictions.md @@ -3,13 +3,16 @@ [#]: author: "Jishnu Saurav Mittapalli https://www.opensourceforu.com/author/jishnu-saurav-mittapalli/" [#]: collector: "lkxed" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14689-1.html" -使用机器学习模型进行预测 +机器学习:使用 Python 进行预测 ====== -机器学习基本上是人工智能的一个子集,它使用以前存在的数据对新数据进行预测。当然,现在我们所有人都知道这个道理了!这篇文章展示了如何将 Python 中开发的机器学习模型作为 Java 代码的一部分来进行预测。 + +> 机器学习基本上是人工智能的一个子集,它使用以前存在的数据对新数据进行预测。 + +当然,现在我们所有人都知道这个道理了!这篇文章展示了如何将 Python 中开发的机器学习模型作为 Java 代码的一部分来进行预测。 ![Machine-learning][1] @@ -28,14 +31,15 @@ import matplotlib.pyplot as plt ``` from google.colab import files uploaded = files.upload() -for fn in uploaded.keys(): print(‘User uploaded file “{name}” with length {length} bytes’.format( -name=fn, length=len(uploaded[fn]))) -Choose files No file chosen +for fn in uploaded.keys(): + print('User uploaded file "{name}" with length {length} bytes'.format(name=fn, length=len(uploaded[fn]))) ``` -只有在当前浏览器会话中执行了该单元格时,上传部件才可用。请重新运行此单元,上传文件 *“Hoppers Crossing-Hourly-River-Level.csv”*,大小 2207036 字节。 +如果没有选择文件的话,选择上传的文件。 -完成后,我们就可以使用 *sklearn 库*来训练我们的模型。为此,我们首先需要导入该库和算法模型,如图 1 所示。 +只有在当前浏览器会话中执行了该单元格时,上传部件才可用。请重新运行此单元,上传文件 `Hoppers Crossing-Hourly-River-Level.csv`,大小 2207036 字节。 + +完成后,我们就可以使用 `sklearn` 库来训练我们的模型。为此,我们首先需要导入该库和算法模型,如图 1 所示。 ![Figure 1: Training the model][2] @@ -51,7 +55,7 @@ regressor.fit(X_train, y_train) ### 在 Java 中使用 ML 模型 -我们现在需要做的是把 ML 模型转换成一个可以被 Java 程序使用的模型。有一个叫做 sklearn2pmml 的库可以帮助我们做到这一点: +我们现在需要做的是把 ML 模型转换成一个可以被 Java 程序使用的模型。有一个叫做 `sklearn2pmml` 的库可以帮助我们做到这一点: ``` # Install the library @@ -75,7 +79,7 @@ via: https://www.opensourceforu.com/2022/05/using-a-machine-learning-model-to-ma 作者:[Jishnu Saurav Mittapalli][a] 选题:[lkxed][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/20220601 GNOME Shell for Mobile- A Promising Start with Huge Expectations [Opinion].md b/published/20220601 GNOME Shell for Mobile- A Promising Start with Huge Expectations [Opinion].md new file mode 100644 index 0000000000..878c857eba --- /dev/null +++ b/published/20220601 GNOME Shell for Mobile- A Promising Start with Huge Expectations [Opinion].md @@ -0,0 +1,93 @@ +[#]: subject: "GNOME Shell for Mobile: A Promising Start with Huge Expectations [Opinion]" +[#]: via: "https://www.debugpoint.com/2022/06/gnome-shell-mobile-announcement/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14672-1.html" + +移动版 GNOME Shell:希望之始,期望满满 +====== + +![GNOME Shell 在一台 Pinephone 原型机上运行][3] + +> GNOME 开发人员在最近的一篇博文中提出了将 GNOME Shell 完全移植到手机上的想法。下面是我对这个项目的一些看法。 + +### 移动版 GNOME Shell + +作为一个桌面环境,GNOME 在过去的十年中发展成为了 [GNOME 40][1]。GNOME 40 是一个重要的版本,它以一种现代的方式改变了完整的用户界面设计。 + +看着 GNOME 40 的设计方式,你可能会觉得 Shell 和它的底层技术已经为小屏幕做好了准备。手势驱动的工作区、图标网格和停靠区 —— 在某种程度上感觉更接近于像安卓这样的移动操作系统,而不是桌面环境。 + +此外,系统托盘、日历、通知和原生的应用程序,可以有效地在较小尺寸的设备上工作。得益于 GTK4 和 libadwaita,其设计是响应式的,应用程序和控件的外观与移动平台很匹配。 + +在 GNOME 40 之后,GNOME 开发者为较小尺寸的设备(如平板电脑和手机)设计了几个 GNOME Shell 的概念验证。 + +#### 为什么是现在? + +任何项目的开发和研究工作都要花费时间和金钱。虽然有来自主要科技公司对 GNOME 的捐赠,但这次有一个 “原型基金Prototype Fund” 帮助该团队继续进行这项努力。[原型基金][2] 是德国教育部(BMBF)支持公共利益软件的资助项目。 + +#### 包括什么? + +设计一个完整的移动用户界面,并将其与移动操作系统整合是一个非常复杂的项目。它需要一个精心设计的愿景来支持成千上万的移动硬件和用户支持。更不用说,用户在移动设备上的隐私和安全问题了。 + +因此,有了这个基金,团队可以集中精力进行概念验证,以满足 GNOME Shell 中一些基本的用户互动。 + +* 启动器 +* 应用程序网格 +* 轻扫、手势和导航 +* 用手机键盘搜索 +* 检测屏幕大小和支持屏幕旋转 +* 工作空间和多任务 +* 设置 +* 屏幕键盘 + +![GNOME Shell 移动版模拟图][4] + +始终要记住的是,移动体验远不止用户界面这么简单。另外,GNOME 本身并不是一个操作系统。它由底层的稳定的操作系统组成,它提供了非常需要的隐私和安全。另外,“应用商店”的概念也是如此。手机制造商需要与 GNOME 开发者合作,让他们的产品采用这个概念。 + +#### 进展如何? + +在写这篇文章时,团队给我们快速演示了取得的进展。在下面的视频中可以看到: + +![][5] + +复杂的任务是识别触摸屏手机中的各种手势。例如,你可能会使用长触摸、短触摸、双指轻扫和拖动,以及许多只有在小尺寸设备中才可行的可能性。这需要在各自的 GNOME Shell 组件中推倒重构。 + +而完全在现有的 GNOME Shell 基础上开发它们是很有挑战性的工作。 + +此外,该团队使用著名的 Pinephone Pro 进行开发和测试。Pinephone 已经是一个商业产品,装有 “友商” KDE Plasma 手机和其他 Linux 操作系统。 + +![][6] + +### 结语 + +如果一切按计划进行,我们可能在一个完整的开源手机中获得原生的 GNOME 体验。而你可以重新拥有你的隐私! + +另外,我不确定 Phosh(它也是基于 GNOME 的)会发生什么。虽然 Phosh 是由 Purism 开发和管理的,但看看 GNOME Shell 在移动设备上的努力和 PHosh 在未来一段日子的发展方向将是很有趣的。 + +那么,你对这个项目的前景怎么看?请在下面的评论栏里告诉我。 + +*图片和视频来源:GNOME 开发者 [博客][7]* + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/06/gnome-shell-mobile-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://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/tag/gnome-40 +[2]: http://www.prototypefund.de +[3]: https://www.debugpoint.com/wp-content/uploads/2022/06/GNOME-Shell-Running-on-a-prototype-Pinephone.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/06/GNOME-Shell-Mobile-mock-up.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/06/phone.webm +[6]: https://www.debugpoint.com/wp-content/uploads/2022/06/tablet.webm +[7]: https://blogs.gnome.org/shell-dev/2022/05/30/towards-gnome-shell-on-mobile/ diff --git a/sources/tech/20220601 How to Create Local Yum-DNF Repository on RHEL 9.md b/published/20220601 How to Create Local Yum-DNF Repository on RHEL 9.md similarity index 51% rename from sources/tech/20220601 How to Create Local Yum-DNF Repository on RHEL 9.md rename to published/20220601 How to Create Local Yum-DNF Repository on RHEL 9.md index 990804f3f4..328acf878a 100644 --- a/sources/tech/20220601 How to Create Local Yum-DNF Repository on RHEL 9.md +++ b/published/20220601 How to Create Local Yum-DNF Repository on RHEL 9.md @@ -2,28 +2,31 @@ [#]: via: "https://www.linuxtechi.com/create-local-yum-dnf-repository-rhel/" [#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" [#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14697-1.html" -How to Create Local Yum/DNF Repository on RHEL 9 +如何在 RHEL 9 上创建本地 Yum/DNF 仓库 ====== -Hello techies, recently Red Hat has released its latest operating system RHEL 9. RHEL 9 fulfill all the requirements of hybrid cloud. It can be installed on physical server, virtual machine and inside the container image. -When we don’t have subscription and want to install packages for doing the POCs then setting up local yum or dnf repository will be handy. +![](https://img.linux.net.cn/data/attachment/album/202206/11/164149y9zzm7kkxwsxgszw.jpg) -In this guide, we will cover how to create local yum/dnf repository on RHEL 9 using DVD or ISO file step by step. +你好,技术兄弟,最近红帽发布了最新的操作系统 RHEL 9,RHEL 9 满足了混合云的所有要求。它可以安装在物理服务器、虚拟机和容器镜像中。 -Prerequisites for creating local Yum/DNF repository +当我们没有订阅的时候,想安装软件包来做实验,那么设置本地的 Yum 或 DNF 仓库将是很方便的。 -* Minimal Install RHEL 9 system -* Sudo User with admin privileges -* RHEL 9 DVD or ISO file +在本指南中,我们将介绍如何在 RHEL 9 上使用 DVD 或 ISO 文件一步一步地创建本地 Yum/DNF 资源库。 -### 1 ) Mount RHEL 9 ISO File or DVD +创建本地 Yum/DNF 资源库的先决条件: -We are assuming RHEL 9 iso file is already copied into the system. Run following mount command to mount ISO file on /opt/repo folder. +* 最小化安装 RHEL 9 系统 +* 具有管理权限的 sudo 用户 +* RHEL 9 DVD 或 ISO 文件 + +### 1)挂载 RHEL 9 ISO 文件或 DVD + +我们假设 RHEL 9 iso 文件已经被复制到系统中。运行下面的挂载命令,将 ISO 文件挂载到 `/opt/repo` 文件夹。 ``` $ sudo mkdir /var/repo @@ -32,15 +35,15 @@ $ sudo mount -o loop rhel-baseos-9.0-x86_64-dvd.iso /var/repo/ ![Mount-RHEL9-ISO-File-Command][1] -In case of  dvd, run +如果是 DVD 光盘,运行: ``` $ sudo mount /dev/sr0 /var/repo/ ``` -### 2) Create Repo File in ‘/etc/yum.repos.d/’ Directory +### 2)在 /etc/yum.repos.d/ 目录中创建仓库文件 -Create a repo file with name ‘rhel9-local.repo’ under the folder /etc/yum.repos.d/ with following content +在 `/etc/yum.repos.d/` 目录下创建一个名为 “rhel9-local.repo` 的仓库文件,内容如下: ``` $ sudo vi /etc/yum.repos.d/rhel9-local.repo @@ -61,13 +64,13 @@ baseurl=file:///var/repo//AppStream/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release ``` -Save and close the file. +保存并关闭该文件。 ![RHEL8-Local-Repo-File][2] -### 3) Flush Yum/DNF & Subscription Manager Cache +### 3)刷新 Yum/DNF 和订阅管理器的缓存 -Execute following commands to clean yum or dnf and subscription manager cache. +执行以下命令来清理 Yum 或 DNF 和订阅管理器的缓存。 ``` $ sudo dnf clean all @@ -76,7 +79,7 @@ $ sudo subscription-manager clean ![DNF-Subscription-Manager-Clean][3] -In the above output, we are getting a warning message ‘This system is not registered with an entitlement’. So, to suppress this warning message, edit the file  ‘/etc/yum/pluginconf.d/subscription-manager.conf’ , change the parameter ‘enabled=1’ to ‘enabled=0’. +在上面的输出中,我们得到一个警告信息 `This system is not registered with an entitlement`(系统没有注册权限)。所以,为了抑制这个警告信息,编辑文件 `/etc/yum/pluginconf.d/subscription-manager.conf`,将参数 `enabled=1` 改为 `enabled=0`。 ``` $ sudo vi /etc/yum/pluginconf.d/subscription-manager.conf @@ -84,35 +87,35 @@ $ sudo vi /etc/yum/pluginconf.d/subscription-manager.conf ![Disable-Subscription-Parameter-RHEL-9][4] -Save and exit the file. +保存并退出该文件。 -### 4) Install Packages using Local Repository +### 4)使用本地仓库安装软件包 -Now we are all set to test our local repository. Run beneath command to view configure repository. +现在我们都准备好测试我们的本地仓库了。运行下面的命令来查看配置仓库。 ``` $ sudo dnf repolist ``` -Output, +输出: ![DNF-Repolist-RHEL-9][5] -Now, try Install packages using dnf command via above configure local repository. +现在,试试用 `dnf` 命令通过上面配置的本地仓库安装软件包。 ``` $ sudo dnf install nfs-utils ``` -Output, +输出: ![Install-RPM-Package-via-local-repo-rhel9][6] ![Package-Installation-Completion-RHEL9-DNF-Command][7] -Perfect, above output confirms that nfs-utils package along with its dependencies are installed successfully via locally configured yum or dnf repository. +完美,上述输出证实了 `nfs-utils` 包及其依赖项已经通过本地配置的 Yum 或 DNF 仓库成功安装。 -That’s all from this guide. I hope you have found it informative. Kindly do post your queries and feedback in below comments section. +这就是本指南的全部内容。我希望你觉得它有参考价值。请在下面的评论区发表你的疑问和反馈。 -------------------------------------------------------------------------------- @@ -120,8 +123,8 @@ via: https://www.linuxtechi.com/create-local-yum-dnf-repository-rhel/ 作者:[Pradeep Kumar][a] 选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/20220601 Linux Lite 6.0 Ditches Firefox to Favor Google Chrome as the Default Browser.md b/published/20220601 Linux Lite 6.0 Ditches Firefox to Favor Google Chrome as the Default Browser.md new file mode 100644 index 0000000000..85c9e25716 --- /dev/null +++ b/published/20220601 Linux Lite 6.0 Ditches Firefox to Favor Google Chrome as the Default Browser.md @@ -0,0 +1,134 @@ +[#]: subject: "Linux Lite 6.0 Ditches Firefox to Favor Google Chrome as the Default Browser" +[#]: via: "https://news.itsfoss.com/linux-lite-6-0-release/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14669-1.html" + +Linux Lite 6.0 发布:弃用 Firefox,默认浏览器使用 Chrome +====== + +> Linux Lite 6.0 是一个有趣的版本,有一个新的默认浏览器,改进了无障碍性、新的主题、新的系统监视器等等改进。 + +![linux lite][1] + +Linux Lite,是 [最好的类 Windows 发行版][2] 之一,刚刚发布了它的最新版本 6.0。 + +Linux Lite 6.0 基于 [Ubuntu 22.04 LTS][3],内置了 [Linux 内核 5.15 LTS][4]。 + +这次升级包含了相当多的令人兴奋的新功能,包括一个新的窗口主题和无障碍技术。 + +让我们深入了解一下新的内容! + +### Linux Lite 6.0 概述 + +Linux Lite 6.0 包括许多变化,包括: + +* 更新了软件 +* 新的窗口主题 +* 新的屏幕键盘 +* 屏幕阅读器 +* 屏幕放大镜 +* Chrome 取代 Firefox 成为默认浏览器 +* 新的 GRUB 菜单 + +#### 无障碍性的改进 + +![Linux Lite 6.0][5] + +Linux Lite 通过这一改变已经步入了大联盟。无障碍性,在历史上一直是 GNOME 特有的优势,它现在有了很大的改进。这主要体现在三个不同的工具上:一个屏幕键盘,一个屏幕阅读器(Orca),和一个屏幕放大镜。 + +屏幕键盘对于许多触摸屏用户和没有键盘的用户来说是相当有用的。另一方面,屏幕阅读器对于视障用户来说将是完美的。 + +![Linux Lite 6.0][6] + +最后一项无障碍改进屏幕放大镜,也是针对与屏幕阅读器相同的受众。然而,它与传统的桌面理念相当吻合,所以众多用户可能更青睐它,而不是屏幕阅读器。 + +这些无障碍性的改进有助于 Linux Lite 6.0 成为一个主流的选择。 + +#### 更新的软件 + +与几乎所有的发行版升级一样,Linux Lite 6.0 包括更新的软件。最值得注意的是最新的 LibreOffice 稳定版 7.2.6。 + +其他更新包括 VLC 3.0.16、Thunderbird 91.7、Chrome 100、GIMP 2.10.30 等等。 + +虽然本身不一定是大规模的升级,但它表明了所包含的 LibreOffice 版本的重大变化。 + +以前,由于提供了更多的稳定性,Linux Lite 停留在更多老版本上。然而,Linux Lite 的开发者现在觉得使用最新的稳定版本也很放心,因为测试新 LibreOffice 版本的人比以往任何时候都多。 + +#### 新的窗口主题 + +![Linux Lite 6.0][7] + +Linux Lite 6.0 引入了一个新的窗口主题,叫做 “Materia”。那些主题社区的人可能会对它相当熟悉,因为它已经被移植到几乎所有的平台。这些平台包括 GTK 2、3 和 4、GNOME Shell、Budgie、Cinnamon、MATE、Unity、Xfce、LightDM、GDM,甚至是 Chrome 浏览器。 + +改用 Materia 应该会让 ChromeOS 用户感觉界面很熟悉,因为它是基于谷歌开发的 Material UI 的。 + +#### 谷歌 Chrome 浏览器成为新的默认浏览器 + +![Linux Lite 6.0][8] + +随着 Ubuntu 将其 Firefox 版本转移到一个 Snap 应用中,Linux Lite 已经完全抛弃了 Firefox,转而使用谷歌 Chrome。虽然我不能说我是这个变化的粉丝,但它确实有意义,特别是对于一个针对 Windows 用户的发行版来说。 + +虽然你可以自由地安装任何你喜欢的东西,但无论如何,Chrome 是大多数用户的流行选择。 + +此外,如果你想在访问文件之前扫描文件,Linux Lite 的开发者在 Chrome 中包含了一个 Virus Total 扫描器扩展(默认是禁用的)。 + +注意,你可以从 Linux Lite 的软件中心安装 Firefox,但它是 Snap 版本的。 + +#### 系统监控中心替代了任务管理器 + +![Linux Lite 6.0][9] + +Linux Lite 6.0 现在打包了 [系统监控中心][10]System Monitoring Center 来替代任务管理器和进程查看器。 + +请注意,Linux Lite 的开发者复刻了这个应用程序,在系统标签中提供了关于发行版的具体信息。 + +它提供了所有关注你的资源的必要功能。 + +### 其他改进 + +除了基本的变化之外,Linux Lite 6.0 还包括对 GRUB 菜单的更新、推送紧急修复包的能力、新的 whisker 菜单,以及更多的调整。 + +![Linux Lite 6.0][11] + +正如你所注意到的,新的 GRUB 菜单还包括关闭和重启,同时删除了内存测试选项。 + +你可以在其 [官方公告帖子][12] 中了解更多的技术细节。 + +### 总结 + +Linux Lite 6.0 看起来是一个可靠的版本,特别是对于那些等待无障碍功能和新的视觉感受的人。 + +如果你想自己尝试一下,ISO 文件可以从官方下载页面获得。 + +> **[下载Linux Lite][13]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-lite-6-0-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/wp-content/uploads/2022/06/linux-lite-6.jpg +[2]: https://itsfoss.com/windows-like-linux-distributions/ +[3]: https://news.itsfoss.com/ubuntu-22-04-release/ +[4]: https://news.itsfoss.com/linux-kernel-5-15-release/ +[5]: https://news.itsfoss.com/wp-content/uploads/2022/05/Screen-Reader-Linux-Lite-6.0.png +[6]: https://news.itsfoss.com/wp-content/uploads/2022/06/linux-lite-accessibility.png +[7]: https://news.itsfoss.com/wp-content/uploads/2022/05/Materia-Linux-Lite-6.0.png +[8]: https://news.itsfoss.com/wp-content/uploads/2022/05/Chrome-Linux-Lite-6.0.png +[9]: https://news.itsfoss.com/wp-content/uploads/2022/05/system-monitoring-center-linux-lite.png +[10]: https://itsfoss.com/system-monitoring-center/ +[11]: https://news.itsfoss.com/wp-content/uploads/2022/06/grub-linux-lite-6.png +[12]: https://www.linuxliteos.com/forums/release-announcements/linux-lite-6-0-final-released/ +[13]: https://www.linuxliteos.com/download.php#current diff --git a/published/20220601 de-Googled -e-OS v1 Released Along with a New Brand -Murena- for Smartphone and Cloud Services.md b/published/20220601 de-Googled -e-OS v1 Released Along with a New Brand -Murena- for Smartphone and Cloud Services.md new file mode 100644 index 0000000000..e1412ef77a --- /dev/null +++ b/published/20220601 de-Googled -e-OS v1 Released Along with a New Brand -Murena- for Smartphone and Cloud Services.md @@ -0,0 +1,89 @@ +[#]: subject: "de-Googled /e/OS v1 Released Along with a New Brand ‘Murena’ for Smartphone and Cloud Services" +[#]: via: "https://news.itsfoss.com/murena-e-os/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14666-1.html" + +去谷歌化操作系统 /e/OS v1 及新品牌 Murena 一同发布 +====== + +> Murena 是一个与 e 基金会有关的新品牌,该品牌专注于提供隐私友好的 /e/OS 及新的智能手机和云服务。 + +![murena][1] + +/e/OS 是一个流行的、注重隐私的移动操作系统,是谷歌安卓的替代品之一。 + +这个复刻自 Lineage OS 的操作系统消除了任何与谷歌有关的依赖性,并鼓励你在使用中不要直接依赖任何谷歌的服务。 + +取而代之的是,它提供一些解决方案作为替代品,为你提供一个隐私友好的生态系统。 + +为了精简其产品,负责该操作系统的 e 基金会宣布了一个新的品牌 “Murena”,其中包括了一些以该操作系统为核心的新功能和一个新的智能手机。 + +### Murena 和 e 基金会 + +e 基金会作为一个致力于 /e/OS 的非营利组织将继续存在。因此,可以说这不是一次品牌重塑。 + +然而,[Murena][2] 作为一个新的创业公司,似乎是一个独立的商业实体,将专注于鼓励主流用户尝试 /e/OS,并促进支持该操作系统的智能手机的使用。 + +对该公司,/e/OS 的创建者提及: + +![][3] + +### /e/OS 1.0 有什么新内容? + +随着该操作系统的最新升级发布,他们的目标是让事情变得更容易理解,在提高使用便利性的同时,仍然考虑到隐私。 + +此外,还随同本次更新推出了新的应用程序商店(App Lounge)和新的隐私工具(Advanced Privacy)。 + +**App Lounge**:这个新的应用程序安装程序可以让你安装许多开源应用程序和 PWA(渐进式网页应用Progress Web App)。在你安装之前,它还会告知你每个应用程序中已有的跟踪器。 + +![][4] + +我相信一个量身定做的应用商店的存在将有助于消除新用户是否应该尝试用 /e/OS 安装 Play Store 或 F-Droid 的困惑。 + +除此之外,Advanced Privacy 工具将有助于限制用户在安装第三方应用程序后暴露的数据。 + +如果你想远离科技巨头,你还会发现 Murena 云服务可以用作私人电子邮件账户服务和云存储。该电子邮件服务提供的功能可以隐藏你的原始电子邮件地址。 + +### Murena One + +![][5] + +首款 Murena 品牌的智能手机将于 6 月下旬推出,并将向美国、加拿大、欧洲、英国和瑞士等地的用户发货。 + +这款智能手机将采用 6.5 英寸显示屏,配备 2500 万像素的前置摄像头,后置摄像头设置有三个传感器,分别是 4800 万像素、800 万像素和 500 万像素。 + +我们不太确定是什么处理器,但它提到了是一个八核芯片,加上 4GB 的内存。所有这些都由 4500 毫安时的电池供电。 + +除了它的第一款智能手机,你还可以从它的官方网站上购买 Fairphone 和 Teracube 的智能手机,这些手机预装了 /e/OS。 + +### 总结 + +你可以在其官方网站上了解更多关于新的 /e/OS 升级、云服务和可用的智能手机的信息。 + +> **[Murena][6]** + +该智能手机的定价还没有在新闻发布会上披露。所以,我们建议你如果有兴趣,可以关注一下。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/murena-e-os/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/murena.jpg +[2]: https://murena.com/ +[3]: https://news.itsfoss.com/wp-content/uploads/2022/06/murena-quote.jpeg +[4]: https://news.itsfoss.com/wp-content/uploads/2022/06/eos-app-lounge-1024x1024.jpg +[5]: https://news.itsfoss.com/wp-content/uploads/2022/06/murena-one-1024x576.jpeg +[6]: https://murena.com/ diff --git a/published/20220602 Linux Mint to Maintain Timeshift Backup Tool as an XApp.md b/published/20220602 Linux Mint to Maintain Timeshift Backup Tool as an XApp.md new file mode 100644 index 0000000000..b12e5175e9 --- /dev/null +++ b/published/20220602 Linux Mint to Maintain Timeshift Backup Tool as an XApp.md @@ -0,0 +1,73 @@ +[#]: subject: "Linux Mint to Maintain Timeshift Backup Tool as an XApp" +[#]: via: "https://news.itsfoss.com/linux-mint-timeshift/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "hadisi1993" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14681-1.html" + +Linux Mint 接管 Timeshift 备份工具的开发,并作为一款 XApp 来维护 +====== + +> Linux Mint 接管了 Timeshift 备份/恢复工具的开发。你可以在它新的 GitHub 仓库中找到它。 + +![linux mint][1] + +Timeshift 可以说是 [备份和恢复 Linux 系统的最佳工具][2]。 + +Linux Mint 也利用它帮助用户在系统更新时更方便地创建快照,确保快捷无碍的操作。 + +当然,这不是 [Linux Mint 可能比 Ubuntu 更好的唯一原因][3]。 + +不幸的是,Timeshift 背后的开发者([Tony George][4])计划把注意力集中在其他项目上,将不再继续维护这个项目。 + +Linux Mint 团队联系了这位开发者,并愿意为这个项目提供任何可能的帮助。最终,它们接管了 Timeshift 的开发。 + +所以,现在 Linux Mint 团队会对 Timeshift 的发布和修复,以及任何与之相关的开发工作负责。 + +### 将 Timeshift 调整成 XApp + +![][5] + +Linux Mint 倾向于将某些应用作为“XApp”来维护,以确保它们能在各种不同的桌面环境下工作,不会依赖于某个特殊的桌面。 + +考虑到他们计划将 Timeshift 调整成一个XApp,你可以期待该工具在很长一段时间内维持当前的外观和功能,而不用顾虑你的桌面环境是什么。 + +不像一些 GNOME 应用程序,为了获得最好的体验,它们通常会变成 GNOME 专用的应用程序。 + +Timeshift 是一个必不可少的备份/恢复工具。所以,Linux Mint 接管 Timeshift 的开发并作为一个 XApp 来维护的计划听上去相当完美! + +如果你想知道的话,那不妨告诉你,Timeshift 的迁移已经在 [Launchpad][6] 上完成了。 + +新的 [GitHub仓库][7](由 Linux Mint 复刻的)可以给你提供这个应用的更多细节以及它最近的开发活动。 + +你也可以在 [最近每月发布的博文][8] 中查阅官方对此的声明。 + +### 结语 + +作为 Timeshift 的维护者,Linux Mint 希望在不久的将来带来更多的新特性和改进。 + +你如何看待 Linux Mint 将 Timeshift 接管为一款 XApp?欢迎在下方的评论区内分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-mint-timeshift/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[hadisi1993](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/linux-mint-time-shift.jpg +[2]: https://itsfoss.com/backup-restore-linux-timeshift/ +[3]: https://itsfoss.com/linux-mint-vs-ubuntu/ +[4]: https://teejeetech.com/ +[5]: https://news.itsfoss.com/wp-content/uploads/2022/06/timeshiftlinux-mint.png +[6]: https://github.com/linuxmint/timeshift +[7]: https://github.com/linuxmint/timeshift +[8]: https://blog.linuxmint.com/?p=4323 diff --git a/published/20220603 How to Install FFmpeg in Ubuntu and Other Linux.md b/published/20220603 How to Install FFmpeg in Ubuntu and Other Linux.md new file mode 100644 index 0000000000..9d7a484114 --- /dev/null +++ b/published/20220603 How to Install FFmpeg in Ubuntu and Other Linux.md @@ -0,0 +1,173 @@ +[#]: subject: "How to Install FFmpeg in Ubuntu and Other Linux" +[#]: via: "https://www.debugpoint.com/2022/06/install-ffmpeg-ubuntu/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "aREversez" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14716-1.html" + +在 Linux 上安装 FFmpeg +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/16/103329av0zoz5m5o9ootz5.jpg) + +> 本教程介绍了在 Ubuntu 及其他 Linux 发行版上安装 FFmpeg 的步骤。 + +FFmpeg 是一套处理多媒体文件的软件库。凭借这些强大的库,FFmpeg 能够转换格式、推流以及处理音频和视频文件。许多 Linux 的前端应用都使用 FFmpeg 作为后端支持,所以这些应用对 FFmpeg 的依赖度非常高。举个例子,录屏软件可能会用到 FFmpeg 将录屏转换为 gif 动图。 + +VLC 多媒体播放器、YouTube、Blender、Kodi、Shotcut 和 Handbrake 等流行的应用与服务都在使用 FFmpeg,这仅仅一小部分。 + +趣事:NASA 火星 2020 计划的探测器“毅力”号在将图像和视频发送到地球之前,会先使用 FFmpeg 对其进行处理。 + +### 关于 FFmpeg + +[FFmpeg][1] 本身是一款非常强大的命令行实用程序,在 Linux 发行版、Windows 以及 macOS 等系统上均可运行,支持多种架构。FFmpeg 是用 C 语言和汇编语言编写的,性能强大,提供跨平台支持。 + +#### 核心 + +FFmpeg 的核心是命令行实用程序,既可在命令行上使用,也可以经由任何程序语言调用。比如,你可以在 Shell 程序或 python 脚本中使用 FFmpeg。 + +* `ffmpeg`:用于转换音视频格式,包括来自视频直播的信号源。 +* `ffplay`:FFmpeg 配套使用的媒体播放器 +* `ffprobe`:显示媒体文件信息的命令行工具,可将信息输出为 csv、xml、json 等格式。 + +### FFmpeg 安装 + +在 Ubuntu 等 Linux 发行版上, FFmpeg 的安装比较简单。打开终端,运行以下命令安装即可。 + +#### Ubuntu 及与其相似的发行版 + +``` +sudo apt install FFmpeg +``` + +#### Fedora + +在 Fedora Linux 上安装 FFmpeg,你需要添加 [RPM Fusion 仓库][2],因为 Fedora 官方仓库没有 FFmpeg 软件包。 + +``` +sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm +``` + +``` +sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree- +``` + +``` +sudo dnf install ffmpeg +``` + +#### Arch Linux + +``` +pacman -S ffmpeg +``` + +安装完成后,可输入以下命令查看安装是否成功。 + +``` +ffmpeg --version +``` + +![FFmpeg installed in Ubuntu Linux][3] + +### 示例:FFmpeg 的基本操作 + +首先,我们先来看看 FFmpeg 语法的一个简单例子。如下,该语法可以将 mp4 文件转换为 mkv 文件。 + +1、视频文件格式转换 + +``` +ffmpeg -i big_buck_bunny.mp4 big_buck_bunny.mkv +``` + +当然,这种写法最为简单易懂,但它并不完整,因为没有输入 比特率bit rate分辨率resolution 以及其他的视频文件属性。 + +2、音频文件格式转换 + +其次,输入与上面相似的命令可以转换音频文件的格式。 + +``` +ffmpeg -i sunny_day.ogg sunny_day.mp3 +``` + +3、使用音视频编解码器执行格式转换 + +最后,在下面的例子中,我们可以使用特定的 编解码器codec 来转换视频格式。参数 `-c` 搭配 `a` 或者 `v`,可以分别定义音频和视频文件。以下转换命令使用 `libvpx` 视频编解码器和 `libvorbis` 音频编解码器。 + +``` +ffmpeg -i big_buck_bunny.mp4 -c:v libvpx -c:a libvorbis big_buck_bunny.webm +``` + +### 如何确定自己系统中有哪些编码器和解码器? + +#### 显示所有编解码器 + +输入以下命令,打印所有编解码器。 + +``` +ffmpeg -codecs +``` + +该命令可以打印出所有可用的编解码器,并显示每个编解码器对应的功能信息,比如是否支持解码或编码。此外,如以下输出结果所示,打印出来的信息还会按照首字母顺序标注出每个编码器和解码器的位置。 + +``` +D..... = 支持解码 +.E.... = 支持编码 +..V... = 视频编解码器 +..A... = 音频编解码器 +..S... = 字幕编解码器 +...I.. = 仅限帧内编解码器 +....L. = 有损压缩 +.....S = 无损压缩 +``` + +![FFmpeg Codec list][4] + +#### 显示所有编码器 + +输入下列命令,打印出所有编码器 + +``` +ffmpeg -encoders +``` + +#### 显示所有解码器 + +同样,输入下列命令,打印出所有解码器。 + +``` +ffmpeg -decoders +``` + +#### 更多信息 + +输入参数 `-h`,获取更多关于编码器或解码器的信息。 + +``` +ffmpeg -h decoder=mp3 +``` + +### 总结 + +我希望这篇文章可以帮助你了解 FFmpeg 的基本知识及基本命令。若要了解更多信息,可前往 FFmpeg 官方网站浏览 [帮助文档][5]。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/06/install-ffmpeg-ubuntu/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[aREversez](https://github.com/aREversez) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://ffmpeg.org/ +[2]: https://www.debugpoint.com/2020/07/enable-rpm-fusion-fedora-rhel-centos/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/06/FFmpeg-installed-in-Ubuntu-Linux.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/06/FFmpeg-Codec-list.jpg +[5]: https://ffmpeg.org/documentation.html diff --git a/published/20220605 Contribute at the Fedora Linux 37 Test Week for Kernel 5.18.md b/published/20220605 Contribute at the Fedora Linux 37 Test Week for Kernel 5.18.md new file mode 100644 index 0000000000..41a873dfc9 --- /dev/null +++ b/published/20220605 Contribute at the Fedora Linux 37 Test Week for Kernel 5.18.md @@ -0,0 +1,45 @@ +[#]: subject: "Contribute at the Fedora Linux 37 Test Week for Kernel 5.18" +[#]: via: "https://fedoramagazine.org/contribute-at-the-fedora-linux-37-test-week-for-kernel-5-18/" +[#]: author: "Sumantro Mukherjee https://fedoramagazine.org/author/sumantrom/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14685-1.html" + +Fedora Linux 37 的内核 5.18 测试周到了,一起来做贡献吧! +====== +![][1] + +Fedora 内核团队正在为 Linux 内核 5.18 进行最终集成。这个版本刚刚发布,很快就会出现在 Fedora 中。因此,Fedora 内核和 QA 团队组织了一个测试周,截止日期为 **2022 年 6 月 12 日,星期日。** 请参阅 [维基页面][2] 来获取你将要参与的测试镜像链接。继续阅读下文,可了解更多细节~ + +### 测试周是如何运作的? + +测试周是一个人人都可以参与的活动。在测试周,任何人都可以为 Fedora 即将发布的版本查漏补缺,确保它最终能够运行良好。Fedora 社区成员会经常参与这个活动,我们同时也欢迎公众参加这些活动。如果你以前从未做过贡献,那么这是一个绝佳的上手机会。 + +要想做出贡献,你只需要能够执行以下操作即可: + +* 下载测试资料,包括一些大文件 +* 阅读并按照说明一步一步地进行操作 + +内核测试日的 [维基页面][2] 提供了很多关于测试内容和测试方法的有用信息。完成一些测试后,你可以在测试日的 [Web 应用][3] 上记录下你的测试结果。如果你在活动的当天或前后有空,请进行一些测试并报告你的结果。不知道该怎么做?没关系,我们有一份文件,其中提供了 [所有步骤][4]。 + +希望能在测试日见到你,预祝测试愉快~ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/contribute-at-the-fedora-linux-37-test-week-for-kernel-5-18/ + +作者:[Sumantro Mukherjee][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/sumantrom/ +[b]: https://github.com/lkxed +[1]: https://fedoramagazine.org/wp-content/uploads/2022/06/test-days-816x345.jpg +[2]: http://fedoraproject.org/wiki/Test_Day:2022-06-05_Kernel_5.18_Test_Week +[3]: https://testdays.fedoraproject.org/events/136 +[4]: https://docs.fedoraproject.org/en-US/quick-docs/kernel/howto-kernel-testday/ diff --git a/published/20220606 6 Linux word processors you need to try.md b/published/20220606 6 Linux word processors you need to try.md new file mode 100644 index 0000000000..9fd712d06f --- /dev/null +++ b/published/20220606 6 Linux word processors you need to try.md @@ -0,0 +1,82 @@ +[#]: subject: "6 Linux word processors you need to try" +[#]: via: "https://opensource.com/article/22/6/word-processors-linux" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lkxed" +[#]: translator: "duoluoxiaosheng" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14693-1.html" + +值得尝试的六款 Linux 文字处理程序 +====== + +> 选择一款最中意的文字处理程序把你的想法打印到纸上。 + +![](https://img.linux.net.cn/data/attachment/album/202206/10/120032h7jlo1ozm37fdyfv.jpg) + +作家们总是在寻找更好的方法将他们的文字和想法以更好的方式呈现给他们的读者。我对文字处理程序最早的印象是在 Apple II 上使用 AppleWorks 和后来的 FrEDWriter,后者是一个创建于 1985 年的免费文字处理程序。这是我的学生们的标配,他们许多人来自没有钱购买专有软件的家庭。 + +### Abiword + +在 20 世纪 90 年代时,我开始使用 Linux,寻找我可以使用的高质量的写作程序,并推荐给跟随我进入开源软件世界的学生们。我首先接触的文字处理程序是 [AbiWord][2]。AbiWord 来自西班牙语 Abierto,意思是“开放”。它最早发布于 1998 年,并且之后一直在升级。它使用 GPLv2 开源协议。它支持列表、缩进,字符格式等基本功能,支持 .doc、.html、.docx、.odt 等多种格式文件的导入和导出。 + +![Image of Abiword][3] + +### Etherpad + +[Etherpad][4] 是一个开源协作编辑项目。它可以让你像 Google Drive 那样实时编辑文档,主要的区别是它是完全开源的。据它的网站上介绍,你可以“与你的朋友、同学或同事一起写文章、新闻稿、待办事项,同时在同一个文件上工作”。其源代码可随时查看。Etherpad 采用 Apache 2.0 开源协议。你可以直接在线使用它,或者把它下载并 [安装][5] 到你的 Linux 电脑上。 + +### Cryptpad + +[CryptPad][6] 是一个端到端加密的写作套件。使用 GPLv3 开源协议,并且源代码公开在 [GitHub][7] 上。它由 [Xwiki][8] 实验室开发。可替代 Google Drive,并且是自主托管的。根据其网站描述,“CryptPad 旨在实现协作办公。实时同步文档的更改。由于所有数据都已加密,因此该服务及其管理员无法查看正在编辑和存储的内容。” Cryptpad 为用户提供了 [丰富的文档][9]。 + +### Focuswriter + +[FocusWriter][10] 是一个简单的免干扰的编辑器。它使用隐藏式界面,鼠标移动到屏幕边界时才显示界面。它使用 GPLv3 开源协议,并为 Linux 提供了 Flatpak 软件包,也为 [Ubuntu][11] 和 [Fedora][12] 提供了 DEB 和 RPM。下图是一个 FocusWriter 桌面的例子。这是一个非常简单直观的界面,菜单自动隐藏,当鼠标指向屏幕顶部或边缘时才会显示。文件默认保存为 .odt 格式,也支持纯文本、.docx 和富文本。 + +![Image of FocusWriter][13] + +### LibreOffice Writer + +[LibreOffice Writer][14] 是我最喜欢的,我已经使用了十多年了。它拥有我需要的所有特性,包括富文本格式化。它还拥有我见过的最多的导入、导出方式。类似于 [APA][15] 这样的问卷和出版模板它拥有十多种。我最喜欢的是它可以将文件导出为 PDF 和 epub。 LibreOffice Writer 是一个自由软件,使用 Mozilla 公开许可证(MPL)2.0 开源协议。其 [源代码][16] 由文档基金会提供。LibreOffice 支持大多数 Linux 发行版。同时它也提供 Flatpak、Snap 和 AppImage 软件包。另外,你也可以把它下载并安装到 MacOS 和 Windows 上。 + +![Image of LibreOffice work space][17] + +### OpenOffice Writer + +Apache [OpenOffice Writer][18] 是一个全功能的文字处理程序。它可以简单地用于备忘录,也可以复杂到足以编写你的第一本书。依据官网的描述,OpenOffice Writer 将文档自动保存为 .odt。它还支持将文档保存为 .doc、.docx、富文本和其他格式。OpenOffice Writer 使用 Apache 许可证 2.0 开源协议。源代码在 [GitHub][19] 上公开。 + +还有许多自由开源软件等着大家去发现。它们非常适合完成你的日常任务,你也可以为它们的发展做出贡献。你最喜欢的 Linux 文字处理器程序是什么呢? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/word-processors-linux + +作者:[Don Watkins][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/don-watkins +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/typewriter-hands.jpg +[2]: https://www.abisource.com/ +[3]: https://opensource.com/sites/default/files/2022-05/abiword.png +[4]: https://etherpad.org/# +[5]: https://github.com/ether/etherpad-lite#installation +[6]: https://cryptpad.fr/what-is-cryptpad.html +[7]: https://github.com/xwiki-labs/cryptpad +[8]: https://github.com/xwiki-labs +[9]: https://docs.cryptpad.fr/en/user_guide/index.html +[10]: https://gottcode.org/focuswriter/ +[11]: https://packages.ubuntu.com/jammy/focuswriter +[12]: https://src.fedoraproject.org/rpms/focuswriter +[13]: https://opensource.com/sites/default/files/2022-05/focuswriter.png +[14]: https://www.libreoffice.org/discover/writer/ +[15]: https://extensions.libreoffice.org/en/extensions/show/apa-style-paper-template +[16]: https://www.libreoffice.org/about-us/source-code/ +[17]: https://opensource.com/sites/default/files/2022-05/Libreofficewriter.png +[18]: https://www.openoffice.org/product/writer.html +[19]: https://github.com/apache/openoffice diff --git a/published/20220606 Amberol is a Stunning Looking Music Player for Linux That Just Plays Music and Nothing Else.md b/published/20220606 Amberol is a Stunning Looking Music Player for Linux That Just Plays Music and Nothing Else.md new file mode 100644 index 0000000000..0ccbb7c9bc --- /dev/null +++ b/published/20220606 Amberol is a Stunning Looking Music Player for Linux That Just Plays Music and Nothing Else.md @@ -0,0 +1,113 @@ +[#]: subject: "Amberol is a Stunning Looking Music Player for Linux That Just Plays Music and Nothing Else" +[#]: via: "https://itsfoss.com/amberol-music-player/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14700-1.html" + +Amberol 是一款外观漂亮的 Linux 音乐播放器,只播放音乐,不做其他事情 +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/12/155846b0sbsvtt1et70ttf.jpg) + +虽然音乐世界被流媒体服务所主导,但这并没有阻止开发者为桌面电脑创建音乐播放器。 + +最近,我发现了一个外观漂亮的新的 Linux 桌面音乐播放器。它名为 Amberol,我被它的美丽所震撼。 + +![amberol music player interface][1] + +看起来不错,不是吗?让我们仔细看看它。 + +### Amberol,Linux 上的可爱的音乐播放器 + +看起来不错是它所做的两件(或几件)事情中的一件。另一件事是播放音乐。 + +这就是它,[Amberol][2] 没有额外的花哨(和有用)的功能,如生成专辑封面、元数据编辑、歌词显示或播放列表和库管理。 + +这些功能也不像是会在未来的版本中加入。Amberol 只想播放音乐。就是这样。 + +#### 令人惊叹的用户界面 + +Amberol 和大多数新的 GNOME 应用一样,是用 Rust 和 GTK 编写的。 + +它有一个自适应的用户界面,可以根据你正在播放的专辑颜色来改变颜色。渐变效果给了它一个现代、时尚的外观,肯定会成为你的 Linux 美化Ricing截图的一部分。 + +![amberol music player][3] + +由于其 UI 没有传统的手柄和菜单,它给应用一个统一的外观。 + +#### 播放列表 + +它会从你添加的文件夹中的文件自动生成一个播放列表,显示在左手边的侧边栏。 + +![amberol playlist][4] + +你可以在左上角看到整个播放列表将播放多长时间的音乐。点击“勾选”符号,你可以选择歌曲,并从播放列表中删除它们。 + +如果你愿意,可以隐藏播放列表的侧边栏。 + +![amberol without playlist][5] + +#### 音乐播放选项 + +你可以在界面上看到歌曲的进度。该播放器与键盘上的媒体控制按钮整合得很好。你可以用专用的媒体键来播放、暂停和改变曲目(如果你的系统上有)。 + +Amberol 为你提供了一些播放音乐的选项。你可以打开随机播放功能,按随机顺序播放音乐。你也可以单曲循环,直到你厌倦它。 + +![amberol music playing options][6] + +底部的汉堡菜单让你可以选择添加文件或文件夹,并显示可用的键盘快捷方式。 + +![amberol keyboard shortcuts][7] + +你也可以从这里禁用 UI 颜色变化以配合专辑封面。 + +### 在 Linux 上安装 Amberol + +Amberol 是 [以 Flatpak 形式提供的][8]。请确保 [你的系统已启用 Flatpak 支持][9]。 + +要安装 Amberol,请打开终端并使用以下命令: + +``` +flatpak install flathub io.bassi.Amberol +``` + +安装完毕后,在菜单中搜索该应用,并点击启动。 + +第一次运行时,它会要求你添加音乐文件或文件夹。你也可以拖放文件播放。 + +![amberol first run][10] + +### 总结 + +就个人而言,我更喜欢流媒体服务,因为我没有本机音乐珍藏。但我知道有的人有大量的 CD 收藏,现在都保存在硬盘上。 + +Amberol 是一个外观漂亮的应用,对于播放本机音乐来说,它足够好。最吸引人的是它基于专辑封面的自适应用户界面。 + +请你试试它,并在评论区分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/amberol-music-player/ + +作者:[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/wp-content/uploads/2022/06/amberol-music-player-interface-800x693.png +[2]: https://apps.gnome.org/app/io.bassi.Amberol/ +[3]: https://itsfoss.com/wp-content/uploads/2022/06/amberol-music-player-800x580.png +[4]: https://itsfoss.com/wp-content/uploads/2022/06/Amberol-playlist-800x548.png +[5]: https://itsfoss.com/wp-content/uploads/2022/06/amberol-without-playlist-800x693.png +[6]: https://itsfoss.com/wp-content/uploads/2022/06/Amberol-music-playing-options-800x548.png +[7]: https://itsfoss.com/wp-content/uploads/2022/06/Amberol-keyboard-shortcuts-800x528.png +[8]: https://flathub.org/apps/details/io.bassi.Amberol +[9]: https://itsfoss.com/flatpak-guide/ +[10]: https://itsfoss.com/wp-content/uploads/2022/06/amberol-first-run-800x693.png diff --git a/published/20220607 Linux Kernel 5.19 RC1 Released, Concluding ARM Generic Kernel Work.md b/published/20220607 Linux Kernel 5.19 RC1 Released, Concluding ARM Generic Kernel Work.md new file mode 100644 index 0000000000..3e2c88b021 --- /dev/null +++ b/published/20220607 Linux Kernel 5.19 RC1 Released, Concluding ARM Generic Kernel Work.md @@ -0,0 +1,100 @@ +[#]: subject: "Linux Kernel 5.19 RC1 Released, Concluding ARM Generic Kernel Work" +[#]: via: "https://www.debugpoint.com/2022/06/linux-kernel-5-19-rc1/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14692-1.html" + +Linux 内核 5.19 RC1 发布,完成了 ARM 通用内核的工作 +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/10/100401b0t82bd0ww0o2tgn.jpg) + +> Linus Torvalds 发布了用来测试的 Linux 内核 5.19 RC1,带来了一些重大变化。 + +继上个月 [Linux 内核 5.18][1] 发布之后,Linus Torvalds 宣布了 Linux 内核 5.19 系列第一个候选版本。与此同时,Linux 内核 5.19 官方合并窗口关闭,这意味着除非是关键性的,否则不会再接受任何新功能。 + +简单看一下 Linux 内核 5.19 的新内容,会发现 CPU、GPU、网络、存储和核心模块都有常规的更新。此外,代码清理、淘汰过时硬件和对以后芯片组的持续支持是此版本的亮点。 + +在进一步介绍之前,让我们简单来看一下这些新特性。 + +### Linux 内核 5.19(RC1)的新特性 + +#### CPU + +首先需要提及的是,Linux 内核 5.19 开始 [初步支持][2] 龙芯架构的 CPU 系列。龙芯由中国龙芯中科公司设计开发。龙芯架构的 CPU 是兼容 MIPS 架构的通用微处理器。不过虽然现在提供了支持,但是你仍不能在龙芯 CPU 上启动 Linux,因为一些代码还在审核中。希望在 5.20 版本中能够使用。 + +新的 [英特尔 IFS 驱动][4] 在该版本中落地,这有助于在部署前后发现硬件问题。它能够在早期阶段检测电路层面的 CPU 错误。 + +在前几个针对英特尔 CPU 的内核版本中一直在对电源管理和散热方面进行开发,[这个版本][5] 也不例外。首先,为 Raptor 和 Alder Lake 家族添加了英特尔 运行时平均功率限制Run-Time Average Power Limiting(RAPL)的支持。其次,改进了 P-state 驱动以处理频率变化,并且基于 CPU 的缩放支持被添加到被动 devfreq 中。 + +虽然英特尔 CPU 主要是散热和电源管理方面的工作,但对 AMD CPU 系列来说有更多的性能更新。首先,计划在今年年底完成 ZMD Zen 4 CPU 的 基于指令的采样Instruction-Based Sampling(IBS)模块引入了更多更新。此外,此版本引入了 PerfMonV2,提供了更多性能监视能力。 + +此外,该版本中移除了 a.out 支持。同样,过时的 Renesas H8/300 CPU 也被移除了。 + +#### 主要 ARM 更新 + +终于,主线 Linux 内核能够 [支持 ARM 多平台][7] 了。在 Linus 的 RC1 开场白中可以看到,这是该版本中的巨大改变!从 Linux 3.7 开始,跨越了十多年的工作,这是多么漫长的过程。 + +![Linux 内核 5.19 Rc1 发布公告提到了 ARM 变化][8] + +#### 图形和存储升级 + +存储子系统在各种流行的文件系统中都有性能提升。最主要的变化包括苹果 M1 NVMe 控制器支持和对 XFS 文件系统的更好支持。此外,Btrfs、F2FS 以及 exFAT 文件系统也有增强。 + +在代码行数方面,有一个令人兴奋的指标是仅是图形驱动程序 Linux 内核 5.19 就增加了大约[50 万行代码][9]。它包括 AMD 的 RDNA、CDNA,英特尔的 Raptor Lake、DG2/Alchemist 等图形驱动更新。 + +#### 重要的网络变化 + +鉴于数据传输大幅增长,对 Big TCP 的支持有助于支持数据中心 400 GBit 级别的流量。它还可以在高性能网络环境中降低延迟。 + +继续改进了 多路径 TCPMulti-Path TCP(MPTCP)。此外,高通 ath11k WiFi 驱动程序在此版本中添加了网络唤醒功能。同样增加了对瑞昱的 8852ce 芯片、联发科的 T700 调制解调器以及瑞萨科技的 RZ/V2M 的支持。 + +#### 其他值得注意的功能 + +首先,内核中著名的随机函数生成器(RNG)在此版本中 [继续][10] 改进。 + +其次,著名的新兴的 Framework 模块化笔记本电脑获得了此版本 Chrome OS EC 驱动支持。Framework 笔记本现在可以作为一个非 Chromebook 设备利用 ChromeOS 的嵌入式控制器。 + +此外,Wacom 绘画板以及其他相关设备也有众多更新。[包括][11] 对联想 Thinkpad TrackPoint II、谷歌 Whiskers Touchpad、联想 X12 TrackPoint 等设备支持的提升。 + +### Linux 内核 5.19 下载 + +如果你想要测试并尝试该候选版本,可以在 [这里][12] 下载。 + +预计在 2022 年 7 月左右最终版本发布前,将会有多个版本更迭。 + +参考自:[内核邮件列表][17] + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/06/linux-kernel-5-19-rc1/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[Donkey-Hao](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/2022/05/linux-kernel-5-18/ +[2]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c6f2f3e2c80e975804360665d973211e4d9390cb +[3]: http://www.loongson.cn/ +[4]: https://lore.kernel.org/lkml/13e61c61-0d4b-5f48-6373-f056bf8b603f@redhat.com/ +[5]: https://lore.kernel.org/linux-acpi/CAJZ5v0hKBt3js65w18iKxzWoN5QuEc84_2xcM6paSv-ZHwe3Rw@mail.gmail.com/ +[6]: https://lore.kernel.org/lkml/You6yGPUttvBcg8s@gmail.com/ +[7]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ecf0aa5317b0ad6bb015128a5b763c954fd58708 +[8]: https://www.debugpoint.com/wp-content/uploads/2022/06/Linux-Kernel-5.19-Rc1-release-announcement-mentions-ARM-changes.jpg +[9]: https://lore.kernel.org/lkml/CAPM=9tw62EZfAm0PbiOPmMrpfR98QMFTWGEQcA34G4ap4xxNkA@mail.gmail.com/ +[10]: https://lore.kernel.org/lkml/20220522214457.37108-1-Jason@zx2c4.com/T/#u +[11]: https://lore.kernel.org/lkml/nycvar.YFH.7.76.2205241107530.28985@cbobk.fhfr.pm/ +[12]: https://www.kernel.org/ +[13]: https://git.kernel.org/torvalds/t/linux-5.19-rc1.tar.gz +[14]: https://git.kernel.org/torvalds/p/v5.19-rc1/v5.18 +[15]: https://git.kernel.org/torvalds/ds/v5.19-rc1/v5.18 +[16]: https://git.kernel.org/torvalds/h/v5.19-rc1 +[17]: https://lore.kernel.org/lkml/CAHk-=wgZt-YDSKfdyES2p6A_KJoG8DwQ0mb9CeS8jZYp+0Y2Rw@mail.gmail.com/T/#u diff --git a/published/20220607 OpenInfra Foundation Launches -directed funding- To Support Open Source Projects.md b/published/20220607 OpenInfra Foundation Launches -directed funding- To Support Open Source Projects.md new file mode 100644 index 0000000000..18e0fae1d8 --- /dev/null +++ b/published/20220607 OpenInfra Foundation Launches -directed funding- To Support Open Source Projects.md @@ -0,0 +1,47 @@ +[#]: subject: "OpenInfra Foundation Launches ‘directed funding’ To Support Open Source Projects" +[#]: via: "https://www.opensourceforu.com/2022/06/openinfra-foundation-launches-directed-funding-to-support-open-source-projects/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14707-1.html" + +OpenInfra 基金会启动“定向资助”以支持开源项目 +====== +![OpenInfra][1] + +OpenInfra 基金会的前身为 OpenStack 基金会,几年前它将范围扩展到其旗舰项目之外,于是改了名字。2022 年 6 月 7 日,它宣布了一种有趣的新方式,让企业资助基金会内的开源项目。一般来说,开源基金会的企业成员通过支付会员费来支持该组织,然后基金会按照他们认为合适的方式分发这些费用。OpenInfra 基金会现在推出了一种新的“定向资助”模式,允许成员将他们的资金直接用于项目。 + +此前,基金会并不允许这样做,因为正如 Bryce 指出的那样,它可能会产生混合激励和付费游戏动态,而该组织一直试图避免这种情况。然而,社区对支持特定项目有很大的兴趣,这是有道理的,因为该基金会现在拥有更多种类的项目,但并不是每个成员都对每个项目进行了大量投入。 + +Bryce 表示,基金会的领导层和董事会,花费了大量时间来考虑,如何使基金会的核心原则与这种新模式相协调。因此,该模型试图将过去十年运行良好的 OpenStack/OpenInfra 技术治理模型的优点,与这些新的财务考虑相结合。 + +在这种“定向资助”模式下,每个新项目都将拥有自己的法人实体来持有项目资金。为确保新项目的合法性,OpenInfra 白金会员(目前为 9 家,包括蚂蚁集团、华为、Meta、微软和红帽)必须担任项目的发起人,之后其他组织才能加入项目基金。如果赞助公司还不是 OpenInfra 成员,则必须成为成员。然后,所有这些资助成员组成一个项目基金管理委员会,决定创建预算的费用。与此同时,OpenInfra 基金会将为这些项目提供社区建设服务。 + +这种新模式暂时只适用于加入基金会的新项目。Bryce 和 Collier 指出,组织可能会在一些现有项目中追溯应用这种新模式,但这个考虑目前不在路线图上。 + +自从将范围扩展到 OpenStack 之外后,OpenInfra 基金会增加了一些新项目,例如用于提高容器安全性的 Kata Containers、用于基础设施生命周期管理的 Airship、Startling X 边缘计算堆栈以及 Zuul CI/CD 平台。 + +“我们从每个成功的项目中学到的最重要的一点是,协作是关键,支持生态系统的范围越广越好,” OpenInfra 基金会总经理 Thierry Carrez 说,“事实上,我们发现最成功的开源项目是由多家公司资助的,因为他们能够整合资源以实现更高的回报率。” + +这种新模式显然是 OpenInfra 基金会引入新项目和新成员的一种方式。正如领导团队欣然承认的那样,其在多方生态系统中管理开源项目的模型 —— 无论是通过新的定向资金还是更传统的方法 —— 可能并不适合每个项目。即使 OpenInfra 基金会只收到一小部分项目,随着对这些复杂云基础设施项目需求的增长,开源项目的数量也在增加,同时它们也变得更加复杂。 + +基金会还宣布了其各个项目的几个里程碑版本的发布,包括 Kata Containers 2.0 版、Zuul 5.0 版和 StarlingX 6.0 。 + +Collier 说:“基金会今年庆祝成立 10 周年,在展望下一个十年的开放基础设施之际,我们正在推动我们的模型如此成功的关键,那就是:将希望合作的公司和个人联合起来,为他们提供一个框架和有效协作的工具,并帮助他们投资资金以最好地帮助他们关心的项目。” + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/openinfra-foundation-launches-directed-funding-to-support-open-source-projects/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/open-infra-berlin-event.png diff --git a/published/20220609 Cloudflare Has Something New to Replace Annoying CAPTCHAs on the Internet.md b/published/20220609 Cloudflare Has Something New to Replace Annoying CAPTCHAs on the Internet.md new file mode 100644 index 0000000000..2fd9490dd6 --- /dev/null +++ b/published/20220609 Cloudflare Has Something New to Replace Annoying CAPTCHAs on the Internet.md @@ -0,0 +1,87 @@ +[#]: subject: "Cloudflare Has Something New to Replace Annoying CAPTCHAs on the Internet" +[#]: via: "https://news.itsfoss.com/cloudflare-pat/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14711-1.html" + +Cloudflare 有了一个新东西,它可以替代互联网上烦人的验证码 +====== + +不想通过正确输入 验证码CAPTCHA 来证明自己是个人类吗?Cloudflare 可能有了一个解决方案。 + +![Cloudflare][1] + +互联网服务巨头 Cloudflare 前两天 [宣布了][2] 私有访问令牌Private Access Tokens 功能。这项功能旨在减少你在网络上看到的验证码数量,同时改善你的隐私。 + +你可能已经发现,验证码在移动设备上是一种可怕的体验。通常,它们会最终会占据整个屏幕,有时甚至无法完成。 + +作为替代方案,网站可以选择收集唯一识别数据,以证明你是人类。当然,从隐私的角度来看,这种做法是很糟糕的。如果这么做,许多重视隐私的公司都几乎无法避免他们受到 僵尸攻击bot attacks。 + +幸运的是,私有访问令牌(PAT)的发布将改变这一点。 + +### 私有访问令牌会产生什么影响? + +简而言之,私有访问令牌能够做到下面这些事: + +* 在支持的设备上减少验证码数量 +* 增强用户隐私 +* 允许网站所有者确保访问者来自真实设备 + +然而,深入观察,我们可以看到私有访问令牌的影响力远不止于此。若使用传统的验证码,就有多个实体可以访问你的数据。 + +首先,你正在访问的网站知道你的 IP 地址和你正在访问的 URL。当然,这些数据是建立连接所需的最低要求。此外,对于更高级的功能,网站还会发送一些用户代理(UA)数据,还好这些数据并不是唯一可识别的。 + +然而,另一方,也就是验证码提供者,却可以收集更多的数据。与你要访问的网站一样,它也知道你的 IP 地址、用户代理数据和你访问的 URL。不幸的是,除此之外,他们还会收集其他数据,例如你的设备信息和交互数据。如果把这些信息,与你之前完成验证码的时间联系起来,你就会惊讶的发现,他们可以建立一个非常详细的属于你的个人资料。 + +幸运的是,有了 Cloudflare 的私有访问令牌,你就可以完全绕过验证码,从而阻止验证码提供者收集此类数据。 + +### 私有访问令牌是如何工作的? + +![][3] + +验证码的理念是集中尽可能多的数据,私人访问令牌则恰恰相反,它将数据去中心化,因此任何一方都无法唯一识别你。在你提到数据共享之前,Cloudflare 就已经特别指出了,数据不会在各方之间共享。 + +当你访问使用 Cloudflare 和私人访问令牌的网站的时候,共有三方将处理你的数据的不同部分。 + +1. 网站。它只会知道你的 IP、URL 和用户代理,这也是建立连接所必需的。 +2. 你的设备制造商。他们只会知道那些用于验证设备是否真实所需的设备数据,而不会知道你正在访问哪个网站,或你的 IP 地址是什么。验证了你的设备后,他们将生成一个令牌,该令牌将发送到 Cloudflare。 +3. Cloudflare。他们将收到这个令牌,令牌中不包含你的任何设备数据,只有制造商对它是正品的“保证”。他们知道的唯一其他数据,就是你正在访问的网站,同样,这是为你提供内容所必需的。 + +通过这种方式,Cloudflare 无需接触你的数据,就可以对“你是一个人”充满信心。 + +### 支持的操作系统:没有 Linux? + +你可能已经意识到,私人访问令牌需要特定的操作系统功能才能工作。目前,它们仅存在于苹果最新的操作系统上,即 iOS 和 iPadOS 16,以及 macOS Ventura。这是因为苹果的操作系统只在有限的硬件上运行,设备验证会更加容易。 + +另一方面,Linux 是一种通用操作系统,旨在在各种硬件上运行。因此,我认为,在可预见的未来,它都不会支持私人访问令牌。 + +回到苹果,我想到私人访问令牌也可能导致消费者维修设备的权利出现一些问题。例如,如果我用第三方的非正品电池更换了老旧的 iPhone 原装电池,私人访问令牌系统会特殊对待这种情况吗? + +如果是 Linux 手机呢?这些制造商,如 Pine64 和 Purism,可能没有支持这样一个系统的基础设施。是否可以在这些上使用私人访问令牌呢? + +Cloudflare 在 [公告][4] 中提到: + +> 我们正在积极努力让其他客户和设备制造商也使用私人访问令牌框架。每当新客户开始使用它时,从该客户进入你网站的流量将自动开始要求令牌,你的访问者将自动看到更少的验证码。 + +因此,我们希望看到它被更多的设备和操作系统采用。你如何看待 Cloudflare 的私人访问令牌呢?在下面的评论中发表你的看法吧! + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/cloudflare-pat/ + +作者:[Jacob Crume][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/cloudflare-private-access-tokens.jpg +[2]: https://blog.cloudflare.com/eliminating-captchas-on-iphones-and-macs-using-new-standard/ +[3]: https://news.itsfoss.com/wp-content/uploads/2022/06/PAT-Data-transfer-chart-1024x650.png +[4]: https://blog.cloudflare.com/eliminating-captchas-on-iphones-and-macs-using-new-standard/ diff --git a/published/20220609 openSUSE Leap 15.4 Release Adds Leap Micro 5.2, Updated Desktop Environments, and More.md b/published/20220609 openSUSE Leap 15.4 Release Adds Leap Micro 5.2, Updated Desktop Environments, and More.md new file mode 100644 index 0000000000..740bfc4082 --- /dev/null +++ b/published/20220609 openSUSE Leap 15.4 Release Adds Leap Micro 5.2, Updated Desktop Environments, and More.md @@ -0,0 +1,100 @@ +[#]: subject: "openSUSE Leap 15.4 Release Adds Leap Micro 5.2, Updated Desktop Environments, and More" +[#]: via: "https://news.itsfoss.com/opensuse-leap-15-4-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14695-1.html" + +openSUSE Leap 15.4 发布版本添加了 Leap Micro 5.2、更新桌面环境等等 +====== + +> 为奋起直追 SUSE Linux Enterprise 的 SP 4 ,openSUSE Leap 15.4 到来了,带来了新的升级和极其重要的改善。 + +![opensuse 15.4][1] + +即将到来的 openSUSE 小发布版本终于来了。如果你使用 openSUSE 作为你日常使用的桌面或服务器版本,你现在可能已经测试候选版本好几周了。 + +openSUSE Leap 15.4 的重点是软件包的更新,用以奋起直追 SUSE Linux Enterprise 的 SP 4 。因此,你将注意到一些弃用的软件包,以及可用于替换它们的新的升级。 + +当然,你应该有一些可用的软件包来确保兼容性。但是,大多数较旧的版本已经被移除。 + +### openSUSE Leap 15.4: 有什么新的变化? + +为与最新的 SUSE Linux Enterprise(SLE)相适应,像 Python 2 和 KDE 4 一样的软件包已经被移除。你可以在这次的发布版本中找到较新的桌面环境。 + +此外,在容器和 AI/ML 用例方面,更新了 Podman、Containerd、Tensorflow 和 Grafana。 + +#### Leap Micro 5.2 + +Leap Micro 是针对容器和虚拟化工作负载定制的轻量级操作系统的最新版本。它也是 Leap 版的 [MicroOS][2],是 Tumbleweed 的一种变体,提供了自动管理和修补。 + +#### 桌面环境 + +Xfce 4.16 继续保留,但你可以找到主要功能的一些新补充,包括新图标和调色板。 + +Xfce 4.16 中的设置管理器也获得了视觉上的刷新。类似地,文件管理器(Thunar)也有一些改善,新的状态托盘插件的深色模式支持等等。 + +KDE 4 软件包已经被弃用,Plasma 5.24 LTS 已经作为长期支持版本中包含于其中。 + +要深入了解这些变化,你可以查看我们之前针对 [KDE Plasma 5.24 LTS][3] 的报道。总体来说,新的 KDE Plasma 体验应该会令桌面用户赞叹。 + +说到 GNOME,你可以发现包含在 openSUSE Leap 15.4 中的 GNOME 41 带来了一系列的改善和新的特色功能。了解更多关于 [GNOME 41][4] 的信息,你可以期待它的一些新的特色功能。 + +对于其它的可用的桌面环境来说,Leap 15.4 包括: + +* MATE 桌面环境 1.26 +* Enlightenment 桌面环境0.25.3 +* 深度桌面环境 20.3 + +#### 弃用的软件包 + +移除了一些基础的软件包,包括 Python 2(生命终结)、Digikam、TensorFlow 1.x 和 Qt 4 等软件包。 + +在更新系统后,你可以使用 Qt 5 和 Plasma 5 。 + +#### 更新的软件包 + +很多重要的软件包在 Leap 15.4 中得到了更新,包含一些流行的软件包: + +* TensorFlow 2.6.2 +* Podman 3.4.4 +* GNU Health 4.0 +* sudo 1.9.9 +* systemd 249.10 +* AppArmor 3.04 +* DNF 4.10.0 +* LibreOffice 7.2.5 + +因此,你应该会注意到一些针对服务器用户和桌面用户的各种应用程序的有用更新。很多多媒体应用程序,像 VLC、GNOME MPV 等,都得到了升级。 + +#### 其它改善 + +随着基本软件的更新和清理,你也可以找到一个由 SUSE 维护的较新的 Linux 内核 5.14.21。 + +更新后的内核对硬件的支持应该会有改善。 + +更多信息,你可以参考针对 [openSUSE Leap 15.4][5] 的发布版本说明。 + +> **[下载 openSUSE Leap 15.4][6]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/opensuse-leap-15-4-release/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/opensuse-leap-15-4.jpg +[2]: https://microos.opensuse.org/ +[3]: https://news.itsfoss.com/kde-plasma-5-24-lts-release/ +[4]: https://news.itsfoss.com/gnome-41-release/ +[5]: https://doc.opensuse.org/release-notes/x86_64/openSUSE/Leap/15.4/#rnotes +[6]: https://get.opensuse.org/leap/15.4/ diff --git a/published/20220613 Thonny is an Ideal IDE for Teaching Python Programming in Schools.md b/published/20220613 Thonny is an Ideal IDE for Teaching Python Programming in Schools.md new file mode 100644 index 0000000000..2840423b72 --- /dev/null +++ b/published/20220613 Thonny is an Ideal IDE for Teaching Python Programming in Schools.md @@ -0,0 +1,128 @@ +[#]: subject: "Thonny is an Ideal IDE for Teaching Python Programming in Schools" +[#]: via: "https://itsfoss.com/thonny-python-ide/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14717-1.html" + +Thonny:在学校教授 Python 编程的理想 IDE +====== + +在 Linux 中运行一个 Python 程序只需要简单地在终端中执行 Python 文件就行。 + +但这对人们来说不是很方便,也不能帮助你调试你的程序。太原始了。 + +有几个 IDE 和文本编辑器可以用于 Python 开发。Linux 用户可以使用 [PyCharm 社区版][1]。 + +我最近发现了另一个专门为 Python 初学者制作的 IDE。我喜欢这个应用的想法,因此我在这里与你分享。 + +### Thonny 是一个跨平台、开源的 Python IDE,适合初学者使用 + +[Thonny][2] 在用户界面和用户体验方面,感觉就像 Python 版本的 Eclipse。考虑到大多数 C++ 和 Java 的初学者都是从 Eclipse 开始的,而且许多人后来一直使用它,这也不完全是一件坏事。 + +它不是一个新的工具。它已经出现好几年了。我没有用 Python 进行编码,所以直到最近才发现它。 + +Thonny 专注于 Python,提供了帮助 Python 初学者了解其程序行为的功能。让我们来看看这些功能。 + +#### 即装即用 + +Thonny 自带 Python,所以你不需要为安装 Python 做额外的努力。这对 Linux 用户来说不是什么大事,因为大多数发行版都默认安装了 Python。 + +界面很简单。它给你一个编辑器,你可以写你的 Python 程序,然后点击运行按钮或使用 `F5` 键来运行程序。输出显示在底部。 + +![thonny hello world][3] + +#### 查看变量 + +在 “查看View->变量Variables”,你可以看到所有变量的值。不需要将它们全部打印出来。 + +![thonny variable pane][4] + +#### 内置调试器 + +通过使用调试器一步步运行你的程序。你可以从顶部的菜单或使用 `Ctrl + F5` 键访问它。在这里你甚至不需要设置断点。你可以用 `F6` 进入大步骤,或用 `F7` 进入小步骤。 + +![thonny step by step f6][5] + +在小步骤中,你可以看到 Python 是如何看待你的表达式的。这对新的程序员理解他们的程序为什么以某种方式表现非常有帮助。 + +![thonny step by step f7][6] + +不止这样。对于函数调用,它会打开一个新的窗口,里面有独立的局部变量表和代码指针。超级酷! + +#### 语法错误高亮 + +初学者经常会犯一些简单的语法错误,如缺少小括号、引号等。Thonny 会在编辑器中立即指出来。 + +本地变量也可以从视觉上与全局变量区分开来。 + +#### 自动补全 + +你不需要输入所有的东西。Thonny 支持自动补全代码,这有助于加快编码。 + +![thonny auto complete][7] + +#### 访问系统 shell + +在工具中,你可以访问系统 shell。在这里你可以安装新的 Python 包或学习从命令行处理 Python。 + +![thonny shell terminal][8] + +请注意,如果你使用 Flatpak 或 Snap,Thonny 可能无法访问系统 shell。 + +#### 从 GUI 管理 Pip + +进入工具和管理包。它会打开一个窗口,你可以从这个 GUI 中安装 Pip 软件包。 + +![thonny manage packages][9] + +对于学习 Python 来说,功能足够好,对吗?让我们看看如何安装它。 + +### 在 Linux 上安装 Thonny + +Thonny 是一个跨平台的应用。它可用于 Windows、macOS 和 Linux。 + +它是一个流行的应用,你可以在大多数 Linux 发行版的仓库中找到它。只要在你的系统的软件中心寻找它。 + +另外,你也可以随时使用你的 Linux 发行版的包管理器。 + +在 Debian 和基于 Ubuntu 的发行版上,你可以使用 `apt` 命令来安装它。 + +``` +sudo apt install thonny +``` + +它会下载一堆依赖关系和大约 300MB 的软件包。 + +安装后,你可以在菜单中搜索它,并从那里安装它。 + +### 总结 + +Thonny 对于初级 Python 程序员来说是个不错的工具。不是说专家不能使用它,但它更适合在学校和学院使用。学生们会发现它有助于学习 Python 和理解他们的代码是如何以某种方式表现出来的。事实上,它最初是在爱沙尼亚的塔尔图大学开发的。 + +总的来说,对于 Python 学习者来说是一个很好的软件。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/thonny-python-ide/ + +作者:[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/install-pycharm-ubuntu/ +[2]: https://thonny.org/ +[3]: https://itsfoss.com/wp-content/uploads/2022/06/thonny-hello-world.png +[4]: https://itsfoss.com/wp-content/uploads/2022/06/thonny-variable-pane.png +[5]: https://itsfoss.com/wp-content/uploads/2022/06/thonny-step-by-step-f6.png +[6]: https://itsfoss.com/wp-content/uploads/2022/06/thonny-step-by-step-f7.png +[7]: https://itsfoss.com/wp-content/uploads/2022/06/thonny-auto-complete.png +[8]: https://itsfoss.com/wp-content/uploads/2022/06/thonny-shell-terminal.png +[9]: https://itsfoss.com/wp-content/uploads/2022/06/thonny-manage-packages.png diff --git a/published/20220614 Thunderbird, The Open Source Email Client, Is Coming To Android.md b/published/20220614 Thunderbird, The Open Source Email Client, Is Coming To Android.md new file mode 100644 index 0000000000..8d3dfe46e5 --- /dev/null +++ b/published/20220614 Thunderbird, The Open Source Email Client, Is Coming To Android.md @@ -0,0 +1,38 @@ +[#]: subject: "Thunderbird, The Open Source Email Client, Is Coming To Android" +[#]: via: "https://www.opensourceforu.com/2022/06/thunderbird-the-open-source-email-client-is-coming-to-android/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14715-1.html" + +开源电子邮件客户端 Thunderbird 即将登陆 Android +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/16/084004gdzgp4bqgigi9tpe.jpg) + +开源电子邮件客户端 Thunderbird 将通过 K-9 Mail Android 电子邮件应用项目登陆 Android,该项目与 Thunderbird 合并后的产品就是 Thunderbird Android 电子邮件应用。两年前,Thunderbird 被转移到了 Mozilla 基金会的子公司 MZLA Technologies Corporation 下,该公司的所有权结构与基金会子公司 Mozilla 公司旗下的 Firefox 类似。有了 OpenPGP 端到端加密和期待已久的移动应用等新功能,Thunderbird 项目能够开辟出一条自己的道路。 + +根据 Thunderbird 团队的说法,Thunderbird 产品经理 Ryan Lee Sipes 和 K-9 的主要维护者 Christian Ketterer,两人早在 2018 年就开始讨论可能的 Thunderbird 电子邮件应用合作了。到了 2022 年,两人决定不再让 Thunderbird 从头开始​​开发自己的应用程序,而是直接让 K-9 加入 Thunderbird。 + +Thunderbird 团队表示:“许多 Thunderbird 用户都要求在移动设备上获得 Thunderbird 体验,我们打算通过把 K-9 打造成令人惊叹的产品(并将其变成 Android 上的 Thunderbird)来提供这种体验。K-9 将补充提供 Thunderbird 体验,并增强它的使用场景和方式,让用户获得出色的电子邮件体验。我们对桌面 Thunderbird 的承诺没有改变,我们团队中的大多数人都致力于将其打造为一流的电子邮件客户端,并将保持这种状态。” + +虽然 K-9 在 Google Play 上并不是特别受欢迎的电子邮件应用,但它已经获得了 500 万次下载。K-9 Mail 的路线图目前包括:使用 Thunderbird 帐户自动配置的帐户设置、改进的文件夹管理、消息过滤器支持,以及桌面和移动 Thunderbird 之间的同步。虽然 Thunderbird 知道人们对 iOS 版 Thunderbird 应用程序也很感兴趣,但在常见问题解答(FAQ)中,该项目仅声明它正在“评估”这种可能性。 + +Thunderbird 团队还打算将 Firefox Sync 作为一种在 Thunderbird 和 K-9 Mail 之间同步帐户的方法。它应该会在 2023 年夏天正式投入使用。该项目还在研究将哪些 Thunderbird 功能引入 Android 应用程序,例如日历、任务、提要和聊天支持等。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/thunderbird-the-open-source-email-client-is-coming-to-android/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/android-developer.jpg diff --git a/sources/news/20220531 Rocket.Chat is Switching to Matrix to Enable Cross-App Messaging.md b/sources/news/20220531 Rocket.Chat is Switching to Matrix to Enable Cross-App Messaging.md deleted file mode 100644 index 8e6dbfde37..0000000000 --- a/sources/news/20220531 Rocket.Chat is Switching to Matrix to Enable Cross-App Messaging.md +++ /dev/null @@ -1,81 +0,0 @@ -[#]: subject: "Rocket.Chat is Switching to Matrix to Enable Cross-App Messaging" -[#]: via: "https://news.itsfoss.com/rocket-chat-matrix/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Rocket.Chat is Switching to Matrix to Enable Cross-App Messaging -====== -Rocket.Chat is embracing the Matrix protocol to enable decentralized communication for the platform. That’s a huge change, isn’t it? - -![rocket chat matrix][1] - -Rocket.Chat is an excellent open-source messaging (collaboration) platform. - -In fact, it is one of the [best open-source Slack alternatives][2] available. We use it as well for internal communication. - -Rocket.Chat is also making good progress compared to some of its open-source competitors. For instance, they [teamed up with Nextcloud to provide an alternative to Office 365][3]. - -And recently announced a switch to Matrix protocol to introduce federation capabilities that allow its users to communicate with users on other platforms. In other words, [Rocket.Chat][4] will be utilizing a decentralized network for communication with the Matrix integration. - -As a Rocket.Chat user; you can talk to users on any other app using the Matrix protocol. - -### Rocket.Chat is Switching to a Decentralized Protocol to Enhance Collaboration - -![][5] - -Matrix protocol is a fantastic choice to enable an interoperable federation. Now, with Rocket.Chat onboard; the decentralized network should be stronger than ever. - -Not to forget, we already have [Element][6], and [Gitter][7], as some of the platforms that already utilize Matrix. So, Rocket.Chat joining the network sounds exciting! - -The [official announcement][8] further explains the collaboration: - -> The Rocket.Chat adoption of Matrix makes it simple for organizations to easily connect with external parties, whether they’re using Rocket.Chat or any other Matrix compatible platform. This initiative is another step forward on Rocket.Chat’s journey to let every conversation flow without compromise and enable full interoperability with its ecosystem. - -The new change with the Matrix network is already available in the latest [alpha release for Rocket.Chat 4.7.0][9]. Unless you want to experiment with it, you should wait for the stable release to introduce the Matrix network support. - -**Aron Ogle** (*Core Developer at Rocket.Chat*) has put together a [guide][10] and a video to help you out if you want to explore the technical details of Rocket.Chat integration with the Matrix. Here’s the video for it: - -![Setting up Rocket Chat to talk with Matrix][11] - -### Is This a Good Move? - -While decentralized tech hasn’t taken the internet by storm, it is promising and makes more sense with its reliability and decentralized capabilities. Matrix protocol has been getting all the praise for a couple of years now, and it seems to be heading in the right direction. - -As of now, most of the big platforms rely on centralized infrastructure to make things work. - -And, with the current implementations, cross-communication is not possible with most of the chat applications. - -So, Rocket.Chat will be making a difference by offering cross-app interactions, like the ability to chat with an Element user on **matrix.org,** as shown in the image above. - -Rocket.Chat entering the scene with Matrix protocol could open up the potential for its competitors or other services to give a second thought to solutions like Matrix protocol. - -*What do you think about Rocket.Chat adopting the Matrix protocol? Share your thoughts in the comments section below.* - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/rocket-chat-matrix/ - -作者:[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/rocketchat-matrix-protocol.jpg -[2]: https://itsfoss.com/open-source-slack-alternative/ -[3]: https://news.itsfoss.com/rocket-chat-nextcloud-collaboration/ -[4]: https://itsfoss.com/rocket-chat/ -[5]: https://news.itsfoss.com/wp-content/uploads/2022/05/rocket-chat-matrix.jpg -[6]: https://itsfoss.com/element/ -[7]: https://itsfoss.com/gitter/ -[8]: https://rocket.chat/press-releases/rocket-chat-leverages-matrix-protocol-for-decentralized-and-interoperable-communications -[9]: https://github.com/RocketChat/Rocket.Chat/releases/tag/4.7.0 -[10]: https://geekgonecrazy.com/2022/05/30/rocketchat-and-the-matrix-protocol/ -[11]: https://youtu.be/oQhIH8kql9I diff --git a/sources/news/20220601 GNOME Shell for Mobile- A Promising Start with Huge Expectations [Opinion].md b/sources/news/20220601 GNOME Shell for Mobile- A Promising Start with Huge Expectations [Opinion].md deleted file mode 100644 index 3ac9e6a31d..0000000000 --- a/sources/news/20220601 GNOME Shell for Mobile- A Promising Start with Huge Expectations [Opinion].md +++ /dev/null @@ -1,92 +0,0 @@ -[#]: subject: "GNOME Shell for Mobile: A Promising Start with Huge Expectations [Opinion]" -[#]: via: "https://www.debugpoint.com/2022/06/gnome-shell-mobile-announcement/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -GNOME Shell for Mobile: A Promising Start with Huge Expectations [Opinion] -====== -The GNOME devs gave ideas about porting GNOME Shell entirely to a mobile phone in a recent blog post. Here are some insights about the project. - -### GNOME Shell for Mobile Phones - -GNOME as a desktop environment evolved over the last decade to become [GNOME 40][1]. The GNOME 40 was a significant release that changed the complete user interface design with a modern approach. - -Looking at how GNOME 40 is designed, you may feel that the Shell and its underlying tech are ready for smaller screens. Because the gesture-driven workspaces, icons grid, and dock – somehow feel closer to a mobile operating system such as Android than a desktop environment. - -Moreover, the system tray, calendar, notifications and the native apps – can efficiently work well in smaller form factor devices. Thanks to GTK4 and libadwaita, the design is responsive, and the looks of apps and controls match a mobile platform well. - -After GNOME 40, the GNOME developers worked on several concepts of GNOME Shell for smaller form factor devices such as tablets and mobile phones. - -#### Why Now? - -The development and research efforts cost time and money for any project. Although there are donations to GNOME from major tech companies, this time a “Prototype Fund” helped the team to carry on with this effort. The [Prototype Fund][2] is a grant program supporting public interest software by the German Ministry of Education (BMBF). - -#### What is in scope? - -Designing a complete mobile user interface and integrating it with a mobile operating system is a very complex project. It requires a well-designed vision to support thousands of mobile hardware and user support. Not to mention, the privacy and security of users on a mobile device. - -![GNOME Shell Running on a prototype Pinephone][3] - -Hence, with this fund, the team concentrates on a proof of concept that caters to some essential user interactions in GNOME Shell. - -* Launcher -* Application Grids -* Swipe, gestures and navigations -* Search with mobile keyboard -* Detect screen size and screen rotation support -* Workspaces and multitasking -* Settings -* on-screen keyboard - -![GNOME Shell Mobile mock-up][4] - -It is always important to remember that a mobile experience is much more than just the user interface. Also, GNOME itself is not an operating system. It consists of the underlying stable operating system, which gives much-needed privacy and security. Plus, the “App Store” like the concept. The phone manufacturers need to work with GNOME devs for their products to adopt this concept. - -#### The Progress - -The team gave us a quick demo of the progress made while writing this article. See yourself in the below video. - -![][5] - -The complex task is to recognize various gestures in a touchscreen mobile. For example, you may use long touch, a short touch, a two-finger swipe and drag, and many possibilities that are only feasible in a small form factor device. It requires an absolute rework in the respective GNOME shell components. - -And developing them entirely on the existing GNOME Shell base is challenging work. - -Furthermore, the team uses the famous Pinephone Pro for development and testing. The Pinephone is already a commercial product featuring the “friendly neighbour” KDE Plasma mobile and other Linux OSes. - -![][6] - -### Conclusion - -And if all goes according to plan, we all may get a native GNOME experience in a complete open-source mobile phone. And you can have your privacy back! - -On a side note, I am not sure what will happen to Phosh (which is also based on GNOME). Although Phosh is developed and managed by Purism, it will be interesting to see what direction both GNOME Shell for mobile initiative and PHosh takes in the coming days. - -So, what do you think about the prospects of this project? Let me know in the comment box below. - -*[Image and video credits: GNOME Developers. Via blogs.][7]* - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2022/06/gnome-shell-mobile-announcement/ - -作者:[Arindam][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lkxed -[1]: https://www.debugpoint.com/tag/gnome-40 -[2]: http://www.prototypefund.de -[3]: https://www.debugpoint.com/wp-content/uploads/2022/06/GNOME-Shell-Running-on-a-prototype-Pinephone.jpg -[4]: https://www.debugpoint.com/wp-content/uploads/2022/06/GNOME-Shell-Mobile-mock-up.jpg -[5]: -[6]: -[7]: https://blogs.gnome.org/shell-dev/2022/05/30/towards-gnome-shell-on-mobile/ diff --git a/sources/news/20220601 Linux Lite 6.0 Ditches Firefox to Favor Google Chrome as the Default Browser.md b/sources/news/20220601 Linux Lite 6.0 Ditches Firefox to Favor Google Chrome as the Default Browser.md deleted file mode 100644 index b36f57c2dd..0000000000 --- a/sources/news/20220601 Linux Lite 6.0 Ditches Firefox to Favor Google Chrome as the Default Browser.md +++ /dev/null @@ -1,133 +0,0 @@ -[#]: subject: "Linux Lite 6.0 Ditches Firefox to Favor Google Chrome as the Default Browser" -[#]: via: "https://news.itsfoss.com/linux-lite-6-0-release/" -[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Linux Lite 6.0 Ditches Firefox to Favor Google Chrome as the Default Browser -====== -Linux Lite 6.0 is an interesting release with a new default browser, accessibility improvements, new theme, a new system monitor, and more refinements. - -![linux lite][1] - -Linux Lite, one of the [best Windows-like distros][2], has just released its latest version, 6.0. - -Linux Lite 6.0 is based on [Ubuntu 22.04 LTS][3] and includes [Linux Kernel 5.15][4] LTS out of the box. - -This upgrade packs in a considerable number of exciting new features, including a new window theme and assistive technologies. - -Let’s dive into what’s new! - -### Linux Lite 6.0: Overview - -Linux Lite 6.0 includes numerous changes, including: - -* Updated software -* New window theme -* New on-screen keyboard -* Screen reader -* Screen magnifier -* Firefox replaced by Chrome as the default browser -* New grub menu - -#### Accessibility Improvements - -![Linux Lite 6.0][5] - -Linux Lite has stepped up into the big leagues with this change. Accessibility, which has historically been a GNOME-specific advantage, has greatly improved. This comes in three different tools: An on-screen keyboard, a screen reader (Orca), and a screen magnifier. - -The on-screen keyboard will be pretty useful for many touchscreen users and those without a keyboard. On the other hand, the screen reader will be perfect for sight-impaired users. - -![Linux Lite 6.0][6] - -The final accessibility improvement, the screen magnifier, also targets the same audience as the screen reader. However, it is quite a bit more aligned with the traditional desktop philosophy, so it may be preferred by numerous users over the screen reader. - -These accessibility improvements help bring Linux Lite 6.0 as a mainstream alternative. - -#### Updated Software - -As with almost all distribution upgrades, Linux Lite 6.0 includes updated software. Most notable is the latest stable LibreOffice version, 7.2.6. - -Other updates include VLC 3.0.16, Thunderbird 91.7, Chrome 100, GIMP 2.10.30, and more. - -Although not necessarily a massive upgrade in itself, it demonstrates a significant change in the included LibreOffice version. - -Previously, Linux Lite was held back with an older release due to the increased stability offered. However, the Linux Lite developers now feel comfortable using the latest stable release, with more people testing new LibreOffice versions than ever. - -#### New Window Theme - -![Linux Lite 6.0][7] - -Linux Lite 6.0 introduces a new window theme called ‘**Materia**.’ Those in the theming community will probably be quite familiar with it, as it has been ported to almost every platform. These include GTK 2, 3, and 4, GNOME Shell, Budgie, Cinnamon, MATE, Unity, Xfce, LightDM, GDM, and even Google Chrome. - -The switch to Materia should bring a familiar interface to ChromeOS users, as it is based on the Material UI that Google develops. - -#### Google Chrome is the new default browser - -![Linux Lite 6.0][8] - -With Ubuntu moving its Firefox version to a snap app, Linux Lite has completely ditched Firefox for Google Chrome. While I can’t say I’m a fan of this change, it does make sense, especially for a distro targeting Windows users. - -While you are free to install anything you like, Chrome is a popular option for most users, no matter what. - -Furthermore, Linux Lite developers include a Virus Total scanner extension (disabled by default) with Chrome if you want to scan files before accessing them. - -Note that you can install Firefox from the Linux Lite’s software center, but it will install the snap package. - -#### System Monitor Center as a replacement for Task Manager - -![Linux Lite 6.0][9] - -Linux Lite 6.0 now comes packed with the [System Monitoring Center][10] to replace the task manager and the process viewer. - -Note that Linux Lite developers have forked the application to provide specific information regarding the distribution in the system tab. - -It offers all the essential functionalities to help you keep an eye on your resources. - -### Other Improvements - -In addition to the fundamental changes, Linux Lite 6.0 involves updates to the grub menu, the ability to push emergency fixes to packages, a new whisker menu, and many more tweaks. - -![Linux Lite 6.0][11] - -As you can notice, the new grub menu also includes shut down and reboot while removing the memtest option. - -You can explore more technical details in its [official announcement post][12]. - -### Wrapping Up - -Linux Lite 6.0 appears to be a solid release, especially for those waiting for accessibility features and visual refreshments. - -The ISO file is available from the official download page if you want to try it out for yourself. - -[Download Linux Lite][13] - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/linux-lite-6-0-release/ - -作者:[Jacob Crume][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/jacob/ -[b]: https://github.com/lkxed -[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/linux-lite-6.jpg -[2]: https://itsfoss.com/windows-like-linux-distributions/ -[3]: https://news.itsfoss.com/ubuntu-22-04-release/ -[4]: https://news.itsfoss.com/linux-kernel-5-15-release/ -[5]: https://news.itsfoss.com/wp-content/uploads/2022/05/Screen-Reader-Linux-Lite-6.0.png -[6]: https://news.itsfoss.com/wp-content/uploads/2022/06/linux-lite-accessibility.png -[7]: https://news.itsfoss.com/wp-content/uploads/2022/05/Materia-Linux-Lite-6.0.png -[8]: https://news.itsfoss.com/wp-content/uploads/2022/05/Chrome-Linux-Lite-6.0.png -[9]: https://news.itsfoss.com/wp-content/uploads/2022/05/system-monitoring-center-linux-lite.png -[10]: https://itsfoss.com/system-monitoring-center/ -[11]: https://news.itsfoss.com/wp-content/uploads/2022/06/grub-linux-lite-6.png -[12]: https://www.linuxliteos.com/forums/release-announcements/linux-lite-6-0-final-released/ -[13]: https://www.linuxliteos.com/download.php#current diff --git a/sources/news/20220601 de-Googled -e-OS v1 Released Along with a New Brand -Murena- for Smartphone and Cloud Services.md b/sources/news/20220601 de-Googled -e-OS v1 Released Along with a New Brand -Murena- for Smartphone and Cloud Services.md deleted file mode 100644 index e3c35985d4..0000000000 --- a/sources/news/20220601 de-Googled -e-OS v1 Released Along with a New Brand -Murena- for Smartphone and Cloud Services.md +++ /dev/null @@ -1,88 +0,0 @@ -[#]: subject: "de-Googled /e/OS v1 Released Along with a New Brand ‘Murena’ for Smartphone and Cloud Services" -[#]: via: "https://news.itsfoss.com/murena-e-os/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -de-Googled /e/OS v1 Released Along with a New Brand ‘Murena’ for Smartphone and Cloud Services -====== -Murena is a new brand related to the e Foundation that focuses on offering privacy-friendly /e/OS with new smartphones, and cloud services. - -![murena][1] - -/e/OS is a popular privacy-focused mobile operating system as an alternative to Google’s Android. - -The operating system (fork of Lineage OS) eliminates any Google-related dependencies and encourages you to work without relying directly on any Google services. - -Instead, it offers some of its solutions as alternatives to offer you a privacy-friendly ecosystem. - -To streamline its offering, e Foundation responsible for the OS announced a new brand ‘**Murena**‘ that includes the operating system at its core, with new features and a new smartphone as well. - -### Murena or /e/ Foundation? - -The eFoundation is here to stay as a non-profit organization, working on /e/OS. Hence, it is safe to say that this is not a re-brand. - -However, [Murena][2] as a new startup company seems to be a separate commercial entity that will focus on encouraging mainstream users to try e/OS/ and promote the use of smartphones that support the operating system. - -The creator of /e/OS mentioned the following about the company: - -![][3] - -### /e/OS v1.0: What’s New? - -With the latest upgrade to the operating system, they aim to make things more accessible, improving the ease of use while still keeping privacy in mind. - -A new app store (App Lounge) and a new privacy tool (Advanced Privacy) have been introduced with the update. - -**App Lounge**: The new application installer lets you install numerous open-source applications and PWAs (Progress Web Apps). It also informs you of existing trackers in each application before you install it. - -![][4] - -I believe the existence of a tailored app store will help eliminate confusion for new users, whether they should try installing the Play Store or F-Droid with /e/OS. - -In addition to that, the Advanced Privacy tool will help limit exposing users’ data after they install third-party applications. - -You will also find a Murena cloud service as a private email account service and cloud storage if you want to get away from the big tech. The email service offers features to also hide your original email address. - -### Murena One - -![][5] - -The first Murena branded smartphone will be launching later in June and will ship to users in the USA, Canada, Europe, UK, and Switzerland. - -The smartphone will sport a 6.5-inch display, with a 25 Megapixel front shooter, and a rear camera setup with three sensors that include 48 MP, 8 MP, and 5 MP. - -We do not have clarity on the processor, but it mentions an octa-core chip coupled with 4 GB of RAM. All this is powered by a 4500 mAh battery. - -In addition to its first smartphone, you can also purchase smartphones by Fairphone and Teracube from its official website that packs in /e/OS out of the box. - -### Wrapping Up - -You can explore more about the new /e/OS upgrade, cloud services, and available smartphones on its official website. - -[Murena][6] - -The pricing for the smartphone hasn’t been disclosed in the press release. So, we suggest you to keep an eye on it if you’re interested. - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/murena-e-os/ - -作者:[Ankush Das][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lkxed -[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/murena.jpg -[2]: https://murena.com/ -[3]: https://news.itsfoss.com/wp-content/uploads/2022/06/murena-quote.jpeg -[4]: https://news.itsfoss.com/wp-content/uploads/2022/06/eos-app-lounge-1024x1024.jpg -[5]: https://news.itsfoss.com/wp-content/uploads/2022/06/murena-one-1024x576.jpeg -[6]: https://murena.com/ diff --git a/sources/news/20220616 Mattermost Extends workflow platform with 7.0 release.md b/sources/news/20220616 Mattermost Extends workflow platform with 7.0 release.md new file mode 100644 index 0000000000..fc377a640f --- /dev/null +++ b/sources/news/20220616 Mattermost Extends workflow platform with 7.0 release.md @@ -0,0 +1,39 @@ +[#]: subject: "Mattermost Extends workflow platform with 7.0 release" +[#]: via: "https://www.opensourceforu.com/2022/06/mattermost-extends-workflow-platform-with-7-0-release/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Mattermost Extends workflow platform with 7.0 release +====== +![marttermost][1] + +Mattermost has been developing a messaging platform with a growing number of use cases since it began as an open source project in 2016. The company today announced the Mattermost 7.0 platform, which includes new voice calls, workflow templates, and an application framework for open-source technology. The new release expands on capabilities introduced with the 6.0 update in October 2021. Mattermost competes for a piece of the growing market for collaboration tools with several large companies, including Slack, Atlassian, and Asana. Mattermost, on the other hand, focuses on developer enablement, though the platform can also be used for security and IT operations. + +Mattermost’s software is available in both commercial and open source versions, and both are now at version 7. Tien explained that Mattermost’s commercial platform is built on an open-source foundation. In the open-core model, open source software serves as the foundation, or core, while proprietary enterprise features are built into a commercial version. Compliance, scale, and advanced configuration are key enterprise features for Mattermost. Tien claims that the open source version is more than capable for small and mid-sized teams. He anticipates that organisations will need to consider the commercial release for teams of 500 or more users. + +Tien believes that open source is also about community contributions. The Mattermost open source project has over 4,000 individual contributors who have contributed over 30,000 lines of code. Mattermost previously relied on integration with third-party call services, such as Zoom, to enable voice call functionality. + +Mattermost 7.0 introduces direct integration of calling functionality via the open source WebRTC protocol, which is supported by all modern web browsers. The goal of directly integrating call functionality is to provide a single platform for collaboration, which is in line with Tien’s overall vision for Mattermost. Mattermost is now adding workflow templates to help organisations build repeatable processes, in addition to providing integrated tools to enable collaboration. + +The workflow concept employs playbooks, which contain a list of actions and operations to perform for a specific type of operation. For example, a company can create a workflow template for incident response in the event of a service failure or a cybersecurity incident. + +The checklist can be linked to Mattermost operations such as bringing specific users into a call and assisting with report generation. Tien stated that Mattermost also integrates with common developer tools, and that the capability of the workflow templates will expand over time to enable more automation with third-party tools. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/mattermost-extends-workflow-platform-with-7-0-release/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/marttermost-e1655377462300.jpeg diff --git a/sources/news/20220616 The Travis CI Vulnerability Exposes Sensitive Open Source Project Credentials.md b/sources/news/20220616 The Travis CI Vulnerability Exposes Sensitive Open Source Project Credentials.md new file mode 100644 index 0000000000..a32433bafd --- /dev/null +++ b/sources/news/20220616 The Travis CI Vulnerability Exposes Sensitive Open Source Project Credentials.md @@ -0,0 +1,35 @@ +[#]: subject: "The Travis CI Vulnerability Exposes Sensitive Open Source Project Credentials" +[#]: via: "https://www.opensourceforu.com/2022/06/the-travis-ci-vulnerability-exposes-sensitive-open-source-project-credentials/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +The Travis CI Vulnerability Exposes Sensitive Open Source Project Credentials +====== +![travis c][1] + +A flaw in Travis CI continuous integration software exposed sensitive data from thousands of open source projects online. This is not the first time the software has encountered such security issues. Travis is a CI tool that allows software developers to automate the testing and integration of new code into open source projects. Aqua researchers discovered that it is possible to access up to 770 million ‘logs’ from Travis CI free tier users, even those who have deleted their accounts, via one of the software’s APIs. + +Attackers can extract user authentication tokens used to log in to cloud services such as GitHub, Docker Hub, and AWS from these logs, which are stored in clear text format. The researchers discovered more than 70,000 sensitive tokens and other confidential credentials in a sample of eight million logs. “All Travis CI free tier users are potentially exposed,” the Aqua team says. According to 2019 data, Travis CI was used in over 932,977 open source projects by over 600,000 unique users. + +Such access to high-level user credentials poses a risk to the software developers who use the product as well as their customers. “If an attacker obtains these credentials, there is nothing stopping them from introducing malicious code into libraries or the build process,” explains Bharat Mistry, security Trend Micro’s technical director for the UK and Ireland. “This flaw could undoubtedly lead to digital supply chain attacks.” + +Supply chain attacks can be extremely damaging. In 2020, the Solar Winds attack gave state-sponsored Russian hackers access to the systems of thousands of businesses and government organisations. The Kaseya supply chain attack in 2021 allowed criminals to encrypt the data of over 1,500 companies at the same time, holding them all hostage. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/the-travis-ci-vulnerability-exposes-sensitive-open-source-project-credentials/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/travis-c.png diff --git a/sources/news/20220616 Ubuntu Core 22 is Here for IoT and Edge Devices.md b/sources/news/20220616 Ubuntu Core 22 is Here for IoT and Edge Devices.md new file mode 100644 index 0000000000..2df9b0cca4 --- /dev/null +++ b/sources/news/20220616 Ubuntu Core 22 is Here for IoT and Edge Devices.md @@ -0,0 +1,78 @@ +[#]: subject: "Ubuntu Core 22 is Here for IoT and Edge Devices" +[#]: via: "https://news.itsfoss.com/ubuntu-core-22-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Ubuntu Core 22 is Here for IoT and Edge Devices +====== +Based on Ubuntu 22.04 LTS, Ubuntu Core 22 brings the best of security and performance for IoT and embedded devices. + +![ubuntu][1] + +Ubuntu Core 22 is a containerized Ubuntu 22.04 LTS variant optimized for embedded and IoT devices. + +It should be a wonderful offering for developers looking to make use of Canonical’s latest operating system for edge devices. + +To address the Ubuntu Core 22 release, **Mark Shuttleworth**, CEO of Canonical, said: + +> “Our goal at Canonical is to provide secure, reliable open-source everywhere – from the development environment to the cloud, down to the edge and to devices,”. + +### Ubuntu Core 22: What’s New? + +![What is Ubuntu Core 22?][2] + +With Ubuntu Core 22 release, you get improvements focused on security and reliability. Some of them include: + +#### Real-time Compute + +As the announcement mentions, Ubuntu 22.04 LTS provides a real-time kernel (which is available in beta), delivering high performance, ultra-low latency, and workload predictability fit for time-sensitive industrial, automotive, and robotics use cases. + +Furthermore, if you have Ubuntu-certified hardware, you should be able to fully utilize advanced real-time features. + +#### Snapcraft Framework + +The entire Ubuntu image breaks down as packages (Snaps), making the kernel, OS, and the applications isolated in a sandbox. + +This should let you easily install applications without needing to worry about dependencies from the dedicated IoT App Store. For enterprises, software management solutions through the App Store should enable a range of on-premise opportunities. + +The framework also helps the system ensure the OTA updates work as expected, and do not break anything even if it fails for some reason. + +#### Security + +Out of the box, Ubuntu Core provides advanced security features that include secure boot, full-disk encryption, and more fit for mission-critical environments. + +Note that you also get 10 years of security update commitment with this release. + +#### Other Key Improvements + +* Easy migration from Ubuntu Core 20 and ensuring backward compatibility. +* Performance improvements. +* A new factory reset boot mode, to factory reset from run/recovery modes. + +For more information, you can refer to the [official a][3][n][4][nouncement][5]. + +In case you are curious about Ubuntu Core, you might want to head to its [homepage][6] to explore more about it. + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-core-22-release/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/ubuntu-22-core.jpg +[2]: https://youtu.be/6NDWqH1SrGs +[3]: https://ubuntu.com/blog/canonical-ubuntu-core-22-is-now-available-optimised-for-iot-and-embedded-devices +[4]: https://ubuntu.com/blog/canonical-ubuntu-core-22-is-now-available-optimised-for-iot-and-embedded-devices +[5]: https://ubuntu.com/blog/canonical-ubuntu-core-22-is-now-available-optimised-for-iot-and-embedded-devices +[6]: https://ubuntu.com/core diff --git a/sources/talk/20190131 OOP Before OOP with Simula.md b/sources/talk/20190131 OOP Before OOP with Simula.md deleted file mode 100644 index 5af32716d9..0000000000 --- a/sources/talk/20190131 OOP Before OOP with Simula.md +++ /dev/null @@ -1,231 +0,0 @@ -[#]: subject: "OOP Before OOP with Simula" -[#]: via: "https://twobithistory.org/2019/01/31/simula.html" -[#]: author: "Two-Bit History https://twobithistory.org" -[#]: collector: "lujun9972" -[#]: translator: "aREversez" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -OOP Before OOP with Simula -====== - -Imagine that you are sitting on the grassy bank of a river. Ahead of you, the water flows past swiftly. The afternoon sun has put you in an idle, philosophical mood, and you begin to wonder whether the river in front of you really exists at all. Sure, large volumes of water are going by only a few feet away. But what is this thing that you are calling a “river”? After all, the water you see is here and then gone, to be replaced only by more and different water. It doesn’t seem like the word “river” refers to any fixed thing in front of you at all. - -In 2009, Rich Hickey, the creator of Clojure, gave [an excellent talk][1] about why this philosophical quandary poses a problem for the object-oriented programming paradigm. He argues that we think of an object in a computer program the same way we think of a river—we imagine that the object has a fixed identity, even though many or all of the object’s properties will change over time. Doing this is a mistake, because we have no way of distinguishing between an object instance in one state and the same object instance in another state. We have no explicit notion of time in our programs. We just breezily use the same name everywhere and hope that the object is in the state we expect it to be in when we reference it. Inevitably, we write bugs. - -The solution, Hickey concludes, is that we ought to model the world not as a collection of mutable objects but a collection of _processes_ acting on immutable data. We should think of each object as a “river” of causally related states. In sum, you should use a functional language like Clojure. - -![][2] _The author, on a hike, pondering the ontological commitments -of object-oriented programming._ - -Since Hickey gave his talk in 2009, interest in functional programming languages has grown, and functional programming idioms have found their way into the most popular object-oriented languages. Even so, most programmers continue to instantiate objects and mutate them in place every day. And they have been doing it for so long that it is hard to imagine that programming could ever look different. - -I wanted to write an article about Simula and imagined that it would mostly be about when and how object-oriented constructs we are familiar with today were added to the language. But I think the more interesting story is about how Simula was originally so _unlike_ modern object-oriented programming languages. This shouldn’t be a surprise, because the object-oriented paradigm we know now did not spring into existence fully formed. There were two major versions of Simula: Simula I and Simula 67. Simula 67 brought the world classes, class hierarchies, and virtual methods. But Simula I was a first draft that experimented with other ideas about how data and procedures could be bundled together. The Simula I model is not a functional model like the one Hickey proposes, but it does focus on _processes_ that unfold over time rather than objects with hidden state that interact with each other. Had Simula 67 stuck with more of Simula I’s ideas, the object-oriented paradigm we know today might have looked very different indeed—and that contingency should teach us to be wary of assuming that the current paradigm will dominate forever. - -### Simula 0 Through 67 - -Simula was created by two Norwegians, Kristen Nygaard and Ole-Johan Dahl. - -In the late 1950s, Nygaard was employed by the Norwegian Defense Research Establishment (NDRE), a research institute affiliated with the Norwegian military. While there, he developed Monte Carlo simulations used for nuclear reactor design and operations research. These simulations were at first done by hand and then eventually programmed and run on a Ferranti Mercury.[1][3] Nygaard soon found that he wanted a higher-level way to describe these simulations to a computer. - -The kind of simulation that Nygaard commonly developed is known as a “discrete event model.” The simulation captures how a sequence of events change the state of a system over time—but the important property here is that the simulation can jump from one event to the next, since the events are discrete and nothing changes in the system between events. This kind of modeling, according to a paper that Nygaard and Dahl presented about Simula in 1966, was increasingly being used to analyze “nerve networks, communication systems, traffic flow, production systems, administrative systems, social systems, etc.”[2][4] So Nygaard thought that other people might want a higher-level way to describe these simulations too. He began looking for someone that could help him implement what he called his “Simulation Language” or “Monte Carlo Compiler.”[3][5] - -Dahl, who had also been employed by NDRE, where he had worked on language design, came aboard at this point to play Wozniak to Nygaard’s Jobs. Over the next year or so, Nygaard and Dahl worked to develop what has been called “Simula 0.”[4][6] This early version of the language was going to be merely a modest extension to ALGOL 60, and the plan was to implement it as a preprocessor. The language was then much less abstract than what came later. The primary language constructs were “stations” and “customers.” These could be used to model certain discrete event networks; Nygaard and Dahl give an example simulating airport departures.[5][7] But Nygaard and Dahl eventually came up with a more general language construct that could represent both “stations” and “customers” and also model a wider range of simulations. This was the first of two major generalizations that took Simula from being an application-specific ALGOL package to a general-purpose programming language. - -In Simula I, there were no “stations” or “customers,” but these could be recreated using “processes.” A process was a bundle of data attributes associated with a single action known as the process’ _operating rule_. You might think of a process as an object with only a single method, called something like `run()`. This analogy is imperfect though, because each process’ operating rule could be suspended or resumed at any time—the operating rules were a kind of coroutine. A Simula I program would model a system as a set of processes that conceptually all ran in parallel. Only one process could actually be “current” at any time, but once a process suspended itself the next queued process would automatically take over. As the simulation ran, behind the scenes, Simula would keep a timeline of “event notices” that tracked when each process should be resumed. In order to resume a suspended process, Simula needed to keep track of multiple call stacks. This meant that Simula could no longer be an ALGOL preprocessor, because ALGOL had only once call stack. Nygaard and Dahl were committed to writing their own compiler. - -In their paper introducing this system, Nygaard and Dahl illustrate its use by implementing a simulation of a factory with a limited number of machines that can serve orders.[6][8] The process here is the order, which starts by looking for an available machine, suspends itself to wait for one if none are available, and then runs to completion once a free machine is found. There is a definition of the order process that is then used to instantiate several different order instances, but no methods are ever called on these instances. The main part of the program just creates the processes and sets them running. - -The first Simula I compiler was finished in 1965. The language grew popular at the Norwegian Computer Center, where Nygaard and Dahl had gone to work after leaving NDRE. Implementations of Simula I were made available to UNIVAC users and to Burroughs B5500 users.[7][9] Nygaard and Dahl did a consulting deal with a Swedish company called ASEA that involved using Simula to run job shop simulations. But Nygaard and Dahl soon realized that Simula could be used to write programs that had nothing to do with simulation at all. - -Stein Krogdahl, a professor at the University of Oslo that has written about the history of Simula, claims that “the spark that really made the development of a new general-purpose language take off” was [a paper called “Record Handling”][10] by the British computer scientist C.A.R. Hoare.[8][11] If you read Hoare’s paper now, this is easy to believe. I’m surprised that you don’t hear Hoare’s name more often when people talk about the history of object-oriented languages. Consider this excerpt from his paper: - -> The proposal envisages the existence inside the computer during the execution of the program, of an arbitrary number of records, each of which represents some object which is of past, present or future interest to the programmer. The program keeps dynamic control of the number of records in existence, and can create new records or destroy existing ones in accordance with the requirements of the task in hand. - -> Each record in the computer must belong to one of a limited number of disjoint record classes; the programmer may declare as many record classes as he requires, and he associates with each class an identifier to name it. A record class name may be thought of as a common generic term like “cow,” “table,” or “house” and the records which belong to these classes represent the individual cows, tables, and houses. - -Hoare does not mention subclasses in this particular paper, but Dahl credits him with introducing Nygaard and himself to the concept.[9][12] Nygaard and Dahl had noticed that processes in Simula I often had common elements. Using a superclass to implement those common elements would be convenient. This also raised the possibility that the “process” idea itself could be implemented as a superclass, meaning that not every class had to be a process with a single operating rule. This then was the second great generalization that would make Simula 67 a truly general-purpose programming language. It was such a shift of focus that Nygaard and Dahl briefly considered changing the name of the language so that people would know it was not just for simulations.[10][13] But “Simula” was too much of an established name for them to risk it. - -In 1967, Nygaard and Dahl signed a contract with Control Data to implement this new version of Simula, to be known as Simula 67. A conference was held in June, where people from Control Data, the University of Oslo, and the Norwegian Computing Center met with Nygaard and Dahl to establish a specification for this new language. This conference eventually led to a document called the [“Simula 67 Common Base Language,”][14] which defined the language going forward. - -Several different vendors would make Simula 67 compilers. The Association of Simula Users (ASU) was founded and began holding annual conferences. Simula 67 soon had users in more than 23 different countries.[11][15] - -### 21st Century Simula - -Simula is remembered now because of its influence on the languages that have supplanted it. You would be hard-pressed to find anyone still using Simula to write application programs. But that doesn’t mean that Simula is an entirely dead language. You can still compile and run Simula programs on your computer today, thanks to [GNU cim][16]. - -The cim compiler implements the Simula standard as it was after a revision in 1986. But this is mostly the Simula 67 version of the language. You can write classes, subclass, and virtual methods just as you would have with Simula 67. So you could create a small object-oriented program that looks a lot like something you could easily write in Python or Ruby: - -``` - - ! dogs.sim ; - Begin - Class Dog; - ! The cim compiler requires virtual procedures to be fully specified ; - Virtual: Procedure bark Is Procedure bark;; - Begin - Procedure bark; - Begin - OutText("Woof!"); - OutImage; ! Outputs a newline ; - End; - End; - - Dog Class Chihuahua; ! Chihuahua is "prefixed" by Dog ; - Begin - Procedure bark; - Begin - OutText("Yap yap yap yap yap yap"); - OutImage; - End; - End; - - Ref (Dog) d; - d :- new Chihuahua; ! :- is the reference assignment operator ; - d.bark; - End; - -``` - -You would compile and run it as follows: - -``` - - $ cim dogs.sim - Compiling dogs.sim: - gcc -g -O2 -c dogs.c - gcc -g -O2 -o dogs dogs.o -L/usr/local/lib -lcim - $ ./dogs - Yap yap yap yap yap yap - -``` - -(You might notice that cim compiles Simula to C, then hands off to a C compiler.) - -This was what object-oriented programming looked like in 1967, and I hope you agree that aside from syntactic differences this is also what object-oriented programming looks like in 2019. So you can see why Simula is considered a historically important language. - -But I’m more interested in showing you the process model that was central to Simula I. That process model is still available in Simula 67, but only when you use the `Process` class and a special `Simulation` block. - -In order to show you how processes work, I’ve decided to simulate the following scenario. Imagine that there is a village full of villagers next to a river. The river has lots of fish, but between them the villagers only have one fishing rod. The villagers, who have voracious appetites, get hungry every 60 minutes or so. When they get hungry, they have to use the fishing rod to catch a fish. If a villager cannot use the fishing rod because another villager is waiting for it, then the villager queues up to use the fishing rod. If a villager has to wait more than five minutes to catch a fish, then the villager loses health. If a villager loses too much health, then that villager has starved to death. - -This is a somewhat strange example and I’m not sure why this is what first came to mind. But there you go. We will represent our villagers as Simula processes and see what happens over a day’s worth of simulated time in a village with four villagers. - -The full program is [available here as a Gist][17]. - -The last lines of my output look like the following. Here we are seeing what happens in the last few hours of the day: - -``` - - 1299.45: John is hungry and requests the fishing rod. - 1299.45: John is now fishing. - 1311.39: John has caught a fish. - 1328.96: Betty is hungry and requests the fishing rod. - 1328.96: Betty is now fishing. - 1331.25: Jane is hungry and requests the fishing rod. - 1340.44: Betty has caught a fish. - 1340.44: Jane went hungry waiting for the rod. - 1340.44: Jane starved to death waiting for the rod. - 1369.21: John is hungry and requests the fishing rod. - 1369.21: John is now fishing. - 1379.33: John has caught a fish. - 1409.59: Betty is hungry and requests the fishing rod. - 1409.59: Betty is now fishing. - 1419.98: Betty has caught a fish. - 1427.53: John is hungry and requests the fishing rod. - 1427.53: John is now fishing. - 1437.52: John has caught a fish. - -``` - -Poor Jane starved to death. But she lasted longer than Sam, who didn’t even make it to 7am. Betty and John sure have it good now that only two of them need the fishing rod. - -What I want you to see here is that the main, top-level part of the program does nothing but create the four villager processes and get them going. The processes manipulate the fishing rod object in the same way that we would manipulate an object today. But the main part of the program does not call any methods or modify and properties on the processes. The processes have internal state, but this internal state only gets modified by the process itself. - -There are still fields that get mutated in place here, so this style of programming does not directly address the problems that pure functional programming would solve. But as Krogdahl observes, “this mechanism invites the programmer of a simulation to model the underlying system as a set of processes, each describing some natural sequence of events in that system.”[12][18] Rather than thinking primarily in terms of nouns or actors—objects that do things to other objects—here we are thinking of ongoing processes. The benefit is that we can hand overall control of our program off to Simula’s event notice system, which Krogdahl calls a “time manager.” So even though we are still mutating processes in place, no process makes any assumptions about the state of another process. Each process interacts with other processes only indirectly. - -It’s not obvious how this pattern could be used to build, say, a compiler or an HTTP server. (On the other hand, if you’ve ever programmed games in the Unity game engine, this should look familiar.) I also admit that even though we have a “time manager” now, this may not have been exactly what Hickey meant when he said that we need an explicit notion of time in our programs. (I think he’d want something like the superscript notation [that Ada Lovelace used][19] to distinguish between the different values a variable assumes through time.) All the same, I think it’s really interesting that right there at the beginning of object-oriented programming we can find a style of programming that is not all like the object-oriented programming we are used to. We might take it for granted that object-oriented programming simply works one way—that a program is just a long list of the things that certain objects do to other objects in the exact order that they do them. Simula I’s process system shows that there are other approaches. Functional languages are probably a better thought-out alternative, but Simula I reminds us that the very notion of alternatives to modern object-oriented programming should come as no surprise. - -_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][20] on Twitter or subscribe to the [RSS feed][21] to make sure you know when a new post is out._ - -_Previously on TwoBitHistory…_ - -> Hey everyone! I sadly haven't had time to do any new writing but I've just put up an updated version of my history of RSS. This version incorporates interviews I've since done with some of the key people behind RSS like Ramanathan Guha and Dan Libby. -> -> — TwoBitHistory (@TwoBitHistory) [December 18, 2018][22] - - 1. Jan Rune Holmevik, “The History of Simula,” accessed January 31, 2019, . [↩︎][23] - - 2. Ole-Johan Dahl and Kristen Nygaard, “SIMULA—An ALGOL-Based Simulation Langauge,” Communications of the ACM 9, no. 9 (September 1966): 671, accessed January 31, 2019, [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.95.384&rep=rep1&type=pdf][24]. [↩︎][25] - - 3. Stein Krogdahl, “The Birth of Simula,” 2, accessed January 31, 2019, . [↩︎][26] - - 4. ibid. [↩︎][27] - - 5. Ole-Johan Dahl and Kristen Nygaard, “The Development of the Simula Languages,” ACM SIGPLAN Notices 13, no. 8 (August 1978): 248, accessed January 31, 2019, . [↩︎][28] - - 6. Dahl and Nygaard (1966), 676. [↩︎][29] - - 7. Dahl and Nygaard (1978), 257. [↩︎][30] - - 8. Krogdahl, 3. [↩︎][31] - - 9. Ole-Johan Dahl, “The Birth of Object-Orientation: The Simula Languages,” 3, accessed January 31, 2019, . [↩︎][32] - - 10. Dahl and Nygaard (1978), 265. [↩︎][33] - - 11. Holmevik. [↩︎][34] - - 12. Krogdahl, 4. [↩︎][35] - - - - --------------------------------------------------------------------------------- - -via: https://twobithistory.org/2019/01/31/simula.html - -作者:[Two-Bit History][a] -选题:[lujun9972][b] -译者:[aREversez](https://github.com/aREversez) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://twobithistory.org -[b]: https://github.com/lujun9972 -[1]: https://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey -[2]: https://twobithistory.org/images/river.jpg -[3]: tmp.2ZIthXB4S6#fn:1 -[4]: tmp.2ZIthXB4S6#fn:2 -[5]: tmp.2ZIthXB4S6#fn:3 -[6]: tmp.2ZIthXB4S6#fn:4 -[7]: tmp.2ZIthXB4S6#fn:5 -[8]: tmp.2ZIthXB4S6#fn:6 -[9]: tmp.2ZIthXB4S6#fn:7 -[10]: https://archive.computerhistory.org/resources/text/algol/ACM_Algol_bulletin/1061032/p39-hoare.pdf -[11]: tmp.2ZIthXB4S6#fn:8 -[12]: tmp.2ZIthXB4S6#fn:9 -[13]: tmp.2ZIthXB4S6#fn:10 -[14]: http://web.eah-jena.de/~kleine/history/languages/Simula-CommonBaseLanguage.pdf -[15]: tmp.2ZIthXB4S6#fn:11 -[16]: https://www.gnu.org/software/cim/ -[17]: https://gist.github.com/sinclairtarget/6364cd521010d28ee24dd41ab3d61a96 -[18]: tmp.2ZIthXB4S6#fn:12 -[19]: https://twobithistory.org/2018/08/18/ada-lovelace-note-g.html -[20]: https://twitter.com/TwoBitHistory -[21]: https://twobithistory.org/feed.xml -[22]: https://twitter.com/TwoBitHistory/status/1075075139543449600?ref_src=twsrc%5Etfw -[23]: tmp.2ZIthXB4S6#fnref:1 -[24]: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.95.384&rep=rep1&type=pdf -[25]: tmp.2ZIthXB4S6#fnref:2 -[26]: tmp.2ZIthXB4S6#fnref:3 -[27]: tmp.2ZIthXB4S6#fnref:4 -[28]: tmp.2ZIthXB4S6#fnref:5 -[29]: tmp.2ZIthXB4S6#fnref:6 -[30]: tmp.2ZIthXB4S6#fnref:7 -[31]: tmp.2ZIthXB4S6#fnref:8 -[32]: tmp.2ZIthXB4S6#fnref:9 -[33]: tmp.2ZIthXB4S6#fnref:10 -[34]: tmp.2ZIthXB4S6#fnref:11 -[35]: tmp.2ZIthXB4S6#fnref:12 diff --git a/sources/talk/20220510 6 easy ways to make your first open source contribution with LibreOffice.md b/sources/talk/20220510 6 easy ways to make your first open source contribution with LibreOffice.md deleted file mode 100644 index df7c631f1e..0000000000 --- a/sources/talk/20220510 6 easy ways to make your first open source contribution with LibreOffice.md +++ /dev/null @@ -1,56 +0,0 @@ -[#]: subject: "6 easy ways to make your first open source contribution with LibreOffice" -[#]: via: "https://opensource.com/article/22/5/first-open-source-contribution-libreoffice" -[#]: author: "Klaatu https://opensource.com/users/klaatu" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -6 easy ways to make your first open source contribution with LibreOffice -====== -May 2022 is LibreOffice month. Here are some easy ways to make your first open source contribution. - -![Dandelion zoomed in][1] -(Photo by Rob Tiller, CC BY-SA 4.0) - -"Getting involved" with open source can seem a little confusing. Where do you go to get started? What if you don't know how to code? Who do you talk to? How does anybody know that you have contributed, and besides that does anybody care? - -There are actually answers to questions like those (your choice, it's OK, nobody, you tell them, yes) but during the month of May 2022, there's one simple answer: LibreOffice. This month is a month of participation at LibreOffice and its governing body, The Document Foundation. They're inviting contributors of all sorts to help in any of six different ways, and only one of those has anything at all to do with code. No matter what your skill, you can probably find a way to help the world's greatest office suite. - -### 6 ways to contribute to LibreOffice - -Here's what you can do: - -* Handy Helper: Go answer questions from other LibreOffice users on Ask LibreOffice. If you're an avid user of LibreOffice and think you have useful tips and tricks that will help others, this is the role you've been waiting for. -* First Responder: Bug reports are better when they're confirmed by more than just one user. If you're good at installing software (sometimes bug reports are for older versions than what you might be using normally) then go to the LibreOffice Bugzilla and find new bugs that have yet to be confirmed. When you find one, try to replicate what's been reported. Assuming you can do that, add a comment like “CONFIRMED on Linux (Fedora 35) and LibreOffice 7.3.2”. -* Drum Beater: Open source projects rarely have big companies funneling marketing money into promoting them. It would be nice if all the companies claiming to love open source would help out, but not all of them do, so why not lend your voice? Get on social media and tell your friends why you love LibreOffice, or what you’re using it for (and of course add the #libreoffice hashtag.) -* Globetrotter: LibreOffice is already available in many different languages, but not literally all languages. And LibreOffice is actively being developed, so its interface translations need to be kept up-to-date. Get involved here. -* Docs Doctor: LibreOffice has online help as well as user handbooks. If you're great at explaining things to other people, or if you're great at proof-reading other people's documentation, then you should contact the docs team. -* Code Cruncher: You're probably not going to dive into LibreOffice's code base and make major changes right away, but that's not generally what projects need. If you know how to code, then you can join the developer community by following the instructions on this wiki page. - -``` -#libreoffice -``` - -### Free stickers - -I didn't want to mention this up-front because obviously you should get involved with LibreOffice just because you're excited to get involved with a great open source project. However, you're going to find out eventually so I may as well tell you: By contributing to LibreOffice, you can sign up to get free stickers from The Document Foundation. Surely you've been meaning to [decorate your laptop][2]? - -Don't get distracted by the promise of loot, though. If you're confused but excited to get involved with open source, this is a great opportunity to do so. And it is representative of how you get involved with open source in general: You look for something that needs to be done, you do it, and then you talk about it with others so you can get ideas for what you can do next. Do that often enough, and you find your way into a community. Eventually, you stop wondering how to get involved with open source, because you're too busy contributing! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/5/first-open-source-contribution-libreoffice - -作者:[Klaatu][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/klaatu -[b]: https://github.com/lkxed -[1]: https://opensource.com/sites/default/files/dandelion_zoom.jpg -[2]: https://opensource.com/business/15/11/open-source-stickers diff --git a/sources/talk/20220523 7 pieces of Linux advice for beginners.md b/sources/talk/20220523 7 pieces of Linux advice for beginners.md deleted file mode 100644 index bc902926eb..0000000000 --- a/sources/talk/20220523 7 pieces of Linux advice for beginners.md +++ /dev/null @@ -1,142 +0,0 @@ -[#]: subject: "7 pieces of Linux advice for beginners" -[#]: via: "https://opensource.com/article/22/5/linux-advice-beginners" -[#]: author: "Opensource.com https://opensource.com/users/admin" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -7 pieces of Linux advice for beginners -====== -We asked our community of writers for the best advice they got when they first started using Linux. - -![Why the operating system matters even more in 2017][1] - -Image by: Internet Archive Book Images. Modified by Opensource.com. CC BY-SA 4.0 - -What advice would you give a new Linux user? We asked our community of writers to share their favorite Linux advice. - -### 1. Use Linux resources - -My brother told me that Linux was like a "software erector set" (that's a dated reference to the old Erector sets that could be purchased in the 1950s and 1960s) which was a helpful metaphor. I was using Windows 3.1 and Windows NT at the time and was trying to build a useful and safe K-12 school district website. This was in 2001 and 2002 and there were very few texts or resources on the web that were helpful. One of the resources recommended was the "Root Users Guide," a very large book that had lots of printed information in it but was tough to decipher and know just how to proceed. - -One of the most useful resources for me was an online course that Mandrake Linux maintained. It was a step-by-step explanation of the nuances of using and administering a Linux computer or server. I used that along with a listserv that Red Hat maintained in those days, where you could pose questions and get answers. - -—— [Don Watkins][2] - -### 2. Ask the Linux community for help - -My advice is to ask questions, in all of their settings. You can start out with an Internet search, looking for others who have had the same or similar questions (maybe even better questions.) It takes a while to know what to ask and how to ask it. - -Once you become more familiar with Linux, check through the various forums out there, to find one or more that you like, and again, before you ask something yourself, look to see if someone else has already had the question and had it answered. - -Getting involved in a mail list is also helpful, and eventually, you may find yourself knowledgeable enough to answer some questions yourself. As they say, you learn the most about something by becoming able to answer someone else's questions about it. - -Meanwhile, you also become more familiar with using a system that's not a black box that you never understand how something is done except by paying for it. - -—— [Greg Pittman][3] - -My advice is to get familiar with help utilities such as man and info.  Also, spend as much time as possible at the command line interface and really get used to the fundamental UNIX design. As a matter of fact, one of my favorite books is a UNIX book from the 80s because it really helps in understanding files, directories, devices, basic commands, and more. - -—— [Alan Formy-Duval][4] - -The best advice I got was to trust the community with answers and manual pages for detailed information and "how-to" use different options. However, I started off around 2009-ish, there were a lot of tools and resources available, including a project called [Linux from Scratch (LFS)][5]. This project really taught me a lot about the internals and how to actually build an LFS image. - -—— [Sumantro Mukherjee][6] - -My advice is to read. Using places like [Ask Fedora][7] or the Fedora Matrix chat or other forum type areas. Just read what others are saying, and trying to fix. I learned a lot from just reading what others were struggling with, and then I would try to figure out how the issue was caused. - -—— [Steve Morris][8] - -### 3. Try dual booting - -I started with a dual-boot system in the late 90s (Windows and Linux), and while I wanted to really use Linux, I ended up booting Windows to work in my familiar desktop environment. One of the best pieces of advice was to change the boot order, so every time I wasn't quick enough, I ended up using Linux. ;) - -—— [Heike Jurzik][9] - -I was challenged by one of my team to do a knowledge swap. - -He (our Linux sysadmin) built his website in **Joomla!** (which our web team specialized in, and he wanted to know more about) and I adopted Linux (having been Windows only to that point.) We dual booted to start with, as I still had a bunch of OS-dependent software I needed to use for the business, but it jump-started my adoption of Linux. - -It was really helpful to have each other as an expert to call on while we were each learning our way into the new systems, and quite a challenge to keep going and not give up because he hadn't! - -I did have a big sticky note on my monitor saying "anything with `rm`  in the command, ask first" after a rather embarrassing blunder early on. He wrote a command-line cheat sheet (there are dozens [online now][10]) for me, which really helped me get familiar with the basics. I also started with the [KDE version][11] of Ubuntu, which I found really helpful as a novice used to working with a GUI. - -I've used Linux ever since (aside from my work computer) and he's still on Joomla, so it seemed to work for both of us! - -—— [Ruth Cheesley][12] - -### 4. Back it up for safety - -My advice is to use a distro with an easy and powerful backup app. A new Linux user will touch, edit, destroy and restore configurations. They probably will reach a time when their OS will not boot and losing data is frustrating. - -With a backup app, they're always sure that their data is safe. - -We all love Linux because it allows us to edit everything, but the dark side of this is that making fatal errors is always an option. - -—— [Giuseppe Cassibba][13] - -### 5. Share the Linux you know and use - -My advice is to share the Linux you use. I used to believe the hype that there were distributions that were "better" for new users, so when someone asked me to help them with Linux, I'd show them the distro "for new users." Invariably, this resulted in me sitting in front of their computer looking like I had never seen Linux before myself, because something would be just unfamiliar enough to confuse me.  Now when someone asks about Linux, I show them how to use what I use. It may not be branded as the "best" Linux for beginners, but it's the distro I know best, so when their problems become mine, I'm able to help solve them (and sometimes I learn something new, myself.) - -—— [Seth Kenlon][14] - -There was a saying back in the old days, "Do not just use a random Linux distro from a magazine cover. Use the distro your friend is using, so you can ask for help when you need it." Just replace "from a magazine cover" with "off the Internet" and it's still valid :-) I never followed this advice, as I was the only Linux user in a 50km radius. Everyone else was using FreeBSD, IRIX, Solaris, and Windows 3.11 around me. Later I was the one people were asking for Linux help. - -—— [Peter Czanik][15] - -### 6. Keep learning Linux - -I was a reseller partner prior to working at Red Hat, and I had a few home health agencies with traveling nurses. They used a quirky package named Carefacts, originally built for DOS, that always got itself out of sync between the traveling laptops and the central database. - -The best early advice I heard was to take a hard look at the open source movement. Open source is mainstream in 2022, but it was revolutionary a generation ago when nonconformists bought Red Hat Linux CDs from retailers. Open source turned conventional wisdom on its ear. I learned it was not communism and not cancer, but it scared powerful people. - -My company built its first customer firewall in the mid-1990s, based on Windows NT and a product from Altavista. That thing regularly crashed and often corrupted itself. We built a Linux-based firewall for ourselves and it never gave us a problem. And so, we replaced that customer Altavista system with a Linux-based system, and it ran trouble-free for years. I built another customer firewall in late 1999. It took me three weeks to go through a book on packet filtering and get the `ipchains` commands right. But it was beautiful when I finally finished, and it did everything it was supposed to do. Over the next 15+ years, I built and installed hundreds more, now with `iptables` ; some with bridges or proxy ARP and QOS to support video conferencing, some with [IPSEC][16] and [OpenVPN tunnels][17]. I got pretty good at it and earned a living managing individual firewalls and a few active/standby pairs, all with Windows systems behind them. I even built a few virtual firewalls. - -But progress never stops. By 2022, [iptables is obsolete][18] and my firewall days are a fond memory. - -The ongoing lesson? Never stop exploring. - -—— [Greg Scott][19] - -### 7. Enjoy the process - -Be patient. Linux is a different system than what you are used to, be prepared for a new world of endless possibilities. Enjoy it. - -—— [Alex Callejas][20] - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/5/linux-advice-beginners - -作者:[Opensource.com][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/admin -[b]: https://github.com/lkxed -[1]: https://opensource.com/sites/default/files/lead-images/yearbook-haff-rx-linux-file-lead_0.png -[2]: https://opensource.com/users/don-watkins -[3]: https://opensource.com/users/greg-p -[4]: https://opensource.com/users/alanfdoss -[5]: https://linuxfromscratch.org/ -[6]: https://opensource.com/users/sumantro -[7]: https://ask.fedoraproject.org -[8]: https://opensource.com/users/smorris12 -[9]: https://opensource.com/users/hej -[10]: https://opensource.com/downloads/linux-common-commands-cheat-sheet -[11]: https://opensource.com/article/22/2/why-i-love-linux-kde -[12]: https://opensource.com/users/rcheesley -[13]: https://opensource.com/users/peppe8o -[14]: https://opensource.com/users/seth -[15]: https://opensource.com/users/czanik -[16]: https://www.redhat.com/sysadmin/run-your-own-vpn-libreswan -[17]: https://opensource.com/article/21/8/openvpn-server-linux -[18]: https://opensource.com/article/19/7/make-linux-stronger-firewalls -[19]: https://opensource.com/users/greg-scott -[20]: https://opensource.com/users/darkaxl diff --git a/sources/talk/20220604 Attract contributors to your open source project with authenticity.md b/sources/talk/20220604 Attract contributors to your open source project with authenticity.md new file mode 100644 index 0000000000..d97d80f40d --- /dev/null +++ b/sources/talk/20220604 Attract contributors to your open source project with authenticity.md @@ -0,0 +1,141 @@ +[#]: subject: "Attract contributors to your open source project with authenticity" +[#]: via: "https://opensource.com/article/22/6/attract-contributors-open-source-project" +[#]: author: "Rizel Scarlett https://opensource.com/users/blackgirlbytes" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Attract contributors to your open source project with authenticity +====== +Check out these methods that open source maintainers can use to attract contributors in a genuine manner. + +![a big flag flying in a sea of other flags, teamwork][1] + +Image by: Opensource.com + +It's not a secret that maintaining an open source project is often thankless and time-consuming work. However, I've learned that there's one shared joy among open source maintainers: They love building with a group of technologists who passionately believe in their vision. + +### Marketing feels cringey + +Community support and teamwork are major incentives for open source maintainers. However, gaining community support and contributors is a challenge, especially as a new maintainer. The hope is that technologists will find our projects and start contributing by chance. The reality is we have to market our projects. Think about it: Developers create several public repositories daily, but nobody knows those repositories exist. Without adoption, community, or collaboration, we're not truly reaping the benefits of open source. + +Although marketing an open source project is necessary for a project's overall success, developers are hesitant to do it because marketing to other developers often feels inauthentic and cringey. In this article, I explore methods maintainers can use to attract contributors in a genuine manner. + +### Promote your open source project + +If you want people to contribute to your project, you have to tell them your project exists. So what can promotion look like for you? Instead of spamming discord channels or DMs about an open source project, maintainers can promote their projects through many channels, including: + +* Conference talks: People attend conferences to gain inspiration. Don't be afraid; they're not necessarily looking for a PhD-level lecture. Take the stage at an event like [All Things Open][2], [Open Source Series 101][3], [Codeland][4], or [Upstream][5] to talk about what you're building, why you're building it, issues you face, and discoveries you have made. After your talk, people may want to learn more about what you're building and how they can get involved. +* Blogging: Leverage popular developer blogging platforms such as [Aviyel][6], [Dev.to][7], or [Hashnode][8] to talk about your project. Add a link to your project within the blog posts so that the right people can find it. You can also [submit an article][9] to the editors here on Opensource.com to raise awareness about your open source project! +* Twitter: Twitter has a large tech audience, including Developers, UX Designers, Developer Advocates, and InfoSec professionals who want to collaborate and learn from each other. Twitter is the perfect platform to post in an authentic, non-pushy way about your discoveries, new releases, and bug fixes. Folks will learn from you through your tweets and may feel inclined to build with you. +* Podcasts or Twitter Spaces: Like conference talks, use podcasts and Twitter Spaces to build your project's brand. You don't have to talk about it in a marketing way. You can geek out with the host over your vision and the technical hiccups you've faced along the way. +* Twitch Streams: Stream yourself live coding your project to create awareness of its existence and pair the program with your viewers. Eventually, they might tell other people about your product, or they might ask to contribute themselves. +* Hacktoberfest: Hacktoberfest is a month-long event in October that encourages people to make their first contributions to projects. By participating in Hacktoberfest as a maintainer, you may recruit new contributors. +* Sponsorships: Contributions don't always have to include code. Corporations and individuals can contribute by sponsoring you. Learn more about creating an appealing Sponsor profile [here][10]. + +### Gain community support + +The proverb "it takes a village" applies to more than child-rearing. It also takes a village to maintain an open source project. Community is a large part of open source and just general life success. However, community support is a two-way street. To sustain community support, it's a best practice to give back to community members. + +What can community support look like for you? As you promote your project, you will find folks willing to support you. To encourage them to continue supporting and appeal to other potential supporters, you can: + +* Highlight contributors/supporters: Once you start getting contributors, you can motivate more people to contribute to your project by highlighting past, current, or consistent contributors in your README. This acknowledgment shows that you value and support your contributors. Send your contributors swag or a portion of your sponsorship money if you can afford it. Folks will naturally gravitate to your projects if you're known for genuinely supporting your open source community. + +![Acknowledge contributors on a profile page][11] + +* Establish a culture of kindness: Publish a Code of Conduct in your repository to ensure psychological safety for contributors. I strongly suggest you also adhere to those guidelines by responding kindly to people in comments, pull requests, and issues. It's also vital that you enforce your Code of Conduct. If someone in your community is not following the rules, make sure they face the outlined consequences without exception. Don't let a toxic actor ruin your project's environment with unkind language and harassment. +* Provide a space for open discussion: Often, contributors join an open source community to befriend like-minded technologists, or they have a technical question, and you won't always be available to chat. Open source maintainers often use one of the following tools to create a place for contributors to engage with each other and ask questions in the open: + * GitHub Discussions + * Discord + * Matrix.org + * Mattermost + +### Create a "good" open source project + +*Good* is subjective in code or art, but there are a few ways to indicate that your project is well thought out and a good investment. What does creating a good project look like for you? Your project doesn't have to include amazing code or be a life-changing project to indicate quality. Instead, ensure that your project has the following attributes. + +#### Easy to find + +To help other people find and contribute to your project, you can add topics to your repository related to your project's intended purpose, subject area, affinity groups, or other important qualities. When people go to github.com/topics to search for projects, your project has a higher chance of showing up. + +![GitHub Scientist page][12] + +#### Easy to use + +Make your project easy to use with a detailed README. It's the first thing new users and potential contributors see when visiting your project's repository. Your README should serve as a how-to guide for users. I suggest you include the following information in your README: + +* Project title +* Project description +* Installation instructions +* Usage instructions +* Link to your live web app +* Links to related documentation (code of conduct, license, contributing guidelines) +* Contributors highlights + +You can learn more about crafting the perfect README [here][13]. + +#### Easy to contribute to + +Providing guidelines and managing issues help potential contributors understand opportunities to help. + +* Contributing guidelines - Similar to a README, contributors look for a markdown file called Contributing.md for insight on how to contribute to your project. Guidelines are helpful for you and the contributor because they won't have to ask you too many questions. The contributing guidelines should answer frequently asked questions. I suggest including the following information in your Contributing.md file: + * Technologies used + * How to report bugs + * How to propose new features + * How to open a pull request + * How to claim an issue or task + * Environment set up + * Style guide/code conventions + * Link to a discussion forum or how people can ask for help + * Project architecture (nice to have) + * Known issues +* Good first issues - Highlight issues that don't need legacy project knowledge with the label good-first-issue, so new contributors can feel comfortable contributing to your project for the first time. + +![discover issues with GitHub][14] + +### Exercise persistence + +Even if no one contributes to your project, keep it active with your contributions. Folks will be more interested in contributing to an active project. What does exercising persistence look like for your project? Even if no one is contributing, continue to build your project. If you can't think of new features to add and you feel like you fixed all the bugs, set up ways to make your project easy to manage and scale when you finally get a ton of contributors. + +* Scalability: Once you get contributors, it will get harder to balance responding to every issue. While you're waiting for more contributors, automate the tasks that will eventually become time-consuming. You can leverage GitHub Actions to handle the release process, CI/CD, or enable users to self-assign issues. + +### TL;DR + +Attracting contributors to your open source project takes time, so be patient and don't give up on your vision. While you're waiting, promote your project by building in public and sharing your journey through blog posts, tweets, and Twitch streams. Once you start to gain contributors, show them gratitude in the form of acknowledgment, psychological safety, and support. + +### Next steps + +For more information on maintaining an open source project, check out [GitHub's Open Source Guide][15]. + +Image by: (Rizel Scarlett, CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/attract-contributors-open-source-project + +作者:[Rizel Scarlett][a] +选题:[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/blackgirlbytes +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/leader_flag_people_team_group.png +[2]: https://2021.allthingsopen.org/ +[3]: https://opensource101.com/ +[4]: https://codelandconf.com/ +[5]: https://upstream.live/ +[6]: http://aviyel.com/ +[7]: https://dev.to/ +[8]: https://hashnode.com/ +[9]: https://opensource.com/writers +[10]: https://dev.to/github/how-to-create-the-perfect-sponsors-profile-for-your-open-source-project-3747 +[11]: https://opensource.com/sites/default/files/2022-05/contributors.png +[12]: https://opensource.com/sites/default/files/2022-05/github-scientist.png +[13]: https://dev.to/github/how-to-create-the-perfect-readme-for-your-open-source-project-1k69 +[14]: https://opensource.com/sites/default/files/2022-05/label-issues.png +[15]: https://opensource.guide/ diff --git a/sources/talk/20220609 SSL Certificates- Make the Right Choice.md b/sources/talk/20220609 SSL Certificates- Make the Right Choice.md new file mode 100644 index 0000000000..7f66bd67f9 --- /dev/null +++ b/sources/talk/20220609 SSL Certificates- Make the Right Choice.md @@ -0,0 +1,120 @@ +[#]: subject: "SSL Certificates: Make the Right Choice" +[#]: via: "https://www.opensourceforu.com/2022/06/ssl-certificates-make-the-right-choice/" +[#]: author: "Jitendra Bhojwani https://www.opensourceforu.com/author/jitendra-bhojwani/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +SSL Certificates: Make the Right Choice +====== +Increasingly sophisticated techniques are being used to hack into data today. So it has become extremely important to use even better ways to protect your customers’ data. SSL certification is one such way. This article looks at the different types of SSL certificates and how to choose one that suits your organisation. + +![SSL-certificate][1] + +*Increasingly sophisticated techniques are being used to hack into data today. So it has become extremely important to use even better ways to protect your customers’ data. SSL certification is one such way. This article looks at the different types of SSL certificates and how to choose one that suits your organisation.* + +SSL certificates are an apt solution for securing data in transit. They create an automated mechanism to encrypt the transfer of data between the server and browser (or site and visitor). This encryption can only be decrypted by the intended system. So it discourages hackers from stealing data, and offers complete security against transit attacks on it. + +Along with securing communication, SSL certificates also build trust with customers and help you emerge as a credible business by displaying virtual trust icons like a padlock, HTTPS prefix, and a green address bar. So let’s learn about the major types of SSL certificates and how to choose the one that works best for you. + +### SSL certificate options: Similarities and differences + +Let’s first discuss the basic similarity all SSL certificates share. Regardless of their type, price and scope, every SSL certificate encrypts the to-and-fro communication between the site’s server and the Internet browser of your visitor. + +The difference lies in the terms and conditions of the validation process and the number of domains/subdomains it covers, etc. Proceeding to purchase an SSL certificate without first reviewing your present and future needs may result in costly mistakes, and you may end up paying a hefty amount for advanced features that are irrelevant to your business. Or you may get tempted to buy a cheap certificate that isn’t a perfect fit for your business needs. +Due to the crucial role it plays, an SSL certificate is issued by an official certificate authority after a thorough verification procedure to confirm the legitimacy of ownership. So, this certificate not only encrypts the communication between websites and audiences, but also ensures the legal position of a site. It plays a vital role in building trust. + +As you have now understood why we need a SSL certificate, we can discuss the different types of popular SSL certificates, along with their benefits and issuance procedures. + +### Domain validation (DV) SSL certificate + +The most basic of the three types of SSL certificates, the DV or domain validation certificate confirms the ownership of a domain through an automated online process. All you have to do is to complete a few basic steps to prove that you are the legitimate owner of the domain to get this certificate. Though easiest to get, this type of certificate helps in building only a basic level of trust. + +After completing the DV certification procedure, you are allocated trust-building visual elements — a static seal, a padlock icon, and an HTTPS prefix in your URL. + +Cheapest prices and quick, automated processes are the two major benefits of a DV certificate. On the flip side, you get only the basic trust signs that aren’t enough to satisfy the security concerns of more demanding customers or visitors. + +*Important to know:* DV misses the most important trust sign — vetting the real, legal business that owns the domain name. For instance, suppose Mr X buys a domain ‘abc.com’ to lure gullible people into investing money in a business that seems genuine. Being a legitimate domain owner, he can get a DV through an automated process. With HTTPS URLs and other trust signs, it is easy to gain people’s trust too. However, the company (or fraud mechanism) behind this domain isn’t vetted/verified, which makes it easier for Mr X to continue duping investors of their hard-earned money. + +Is DV SSL the right choice for you?: DV is best for a small and general website, which doesn’t demand or require any sensitive information that can be misused like credit card numbers, social security information, or details of a financial portfolio. For websites that post children’s stories, general e-magazines, personal blogs, professional portfolios, and other static websites on general topics, a DV certificate is a perfect and cheap solution. Securing more mission-critical sites that collect sensitive data like credit card numbers and social security details is a different story though. + +### Organisation validation (OV) SSL certificate + +As the name suggests, the OV certificate not only validates the domain ownership but also vets the real identity of the organisation to which the domain officially belongs. It builds an extra layer of trust for visitors who have stronger concerns, by displaying the key information about the business. Interested visitors just need to check the details of the certificate to ascertain the credibility of the company. + +As compared to a DV certificate, an OV certification requires a more detailed process carried out by an authorised certificate authority that demands and vets key documents representing the legal status of the company. Hence, along with domain ownership, this certificate also assures that it is owned by a legitimate organisation. + +Though the issuance process is more expensive and demanding, this type of certificate does empower you to position your company as a legal, real company doing legitimate business. It makes you stand out and even more concerned visitors are able to trust your organisation. + +Is OV the right choice for you?: Sites that ask for sensitive data that can be misused by threat actors should obtain this certificate. E-commerce sites with online payment gateways, digital health practitioners, government websites that demand citizens’ information, defence-related websites, online trading platforms, or professional networking sites are all the right candidates for obtaining an OV certificate. + +### Extended validation (EV) SSL certificate + +In the digital domain, visuals matter a lot. A company seal, security icons, or even assuring colours (like green) can go a long way in leaving a lasting impression, winning you a big deal or helping you forge business relations with dynamic brands. + +The vetting procedure for issuing an EV SSL certificate is quite stringent and involves a manual process as well. It starts by verifying the ownership of the domain. After that, the certification authority asks for your identification number. Next, it gets your legal working contact number from relevant authentic sources. That contact number is manually verified by calling your office and talking with the real person. Only after satisfying all such verification parameters can you get the EV certificate. + +Unlike an OV certificate, you don’t just get a static site seal with a basic look, but get dynamic seals as well. Additionally, the full legal company name is displayed in the address bar along with a green-coloured padlock. Added to this, the entire address bar turns green as soon as your site loads. All these visible signs vouch for the legality of your firm, build a ‘visual comfort zone’ and reaffirm the credibility of your organisation. + +Such certificates satisfy the sophisticated digital security vetting parameters of global brands and corporate conglomerates. If highly expensive items like gold and diamond jewellery are being sold on a website, then such superior trust factors satisfy the higher trust demands of buyers. Though this certificate is the most expensive among all the SSL certificates, it is worth investing in the extra dollars as it has the potential to significantly boost your sales revenue. + +### Scope of different SSL certificates + +Apart from the type of certificate, the other crucial question is: how many digital properties you want your certificate to cover? If you own a single domain property and do not want to expand in the foreseeable future, then a single DV would do for you. But what if you own, say, 20 different domains — most of which deal with e-commerce or collect sensitive client information? It wouldn’t be practical to buy the more expensive EV certificate for each of these domains. Here is some guidance on that. + +### Wildcard SSL certificate + +With a single wildcard SSL certificate you can protect the main domain and practically unlimited sub-domains related to it. For instance, yoursite.com (the main domain) may have three subdomains: + +* mail.yoursite.com +* login.yoursite.com +* ftp.yoursite.com + +This certificate relieves you from the stress and expenses of purchasing a separate certificate for every domain after going through the complete validation process, followed by an installation process for each. It also saves you a lot of time on repetitive processes and almost eliminates potential errors. + +| - | +| :- | +| Note: Both DV and OV offer wildcard certificate options. | + +### Multi-domain (or SAN SSL) certificate + +One level above the wildcard SSL certificate is the multi-domain certificate, which helps to secure primary domains and their related subdomains. It does everything that a wildcard certificate can do, and more. If you own multiple domains and want a uniform and standard SSL security for all, then a multi-domain certificate is the right choice for you. + +### Is SSL certification only about visual trust signs? + +Obviously, when you spend significant money on an SSL certificate you would like to get more than security icons or trust signals. Well, your certification authority does offer a specific amount of warranty or a payback if your customers become victims of a fraud. The amount of this warranty depends upon the type of certificate and how much it costs. + +### How to choose the ideal certificate authority (CA) for SSL + +The next question is: who can judge the judge? It is you. Carefully consider some of the prime factors while finding the right SSL certificate provider/CA for your site. Before buying any certificate, thoroughly vet the reputation, credentials and experience of the certificate authority. + +Also, ask questions. Do they have a credible history? What type of customers do they have in their repertoire? Do they have an impressive portfolio of regular customers? Most importantly, is the company passively following old industry standards, or is it actively investing in research and development on how to prevent the latest cyber frauds? All such questions will help you to make informed decisions and get the best value for your money. + +Also make another very important check: Has any major browser banned the CA? The very objective of the SSL certificate is defeated if the CA has been banned by a major browser. + +### How long does it take for an SSL certificate to be issued? + +The time taken to issue a certificate varies and depends upon the validation procedure and its requirements. A DV certificate, for instance, is issued within minutes as it has the least verification requirements. An OV SSL, with more detailed vetting requirements, can take up to three days for issuance. Since it has the most demanding vetting process, the EV certificate can take up to four days for issuance. + +The validation period of the certificate, along with its credibility and scope, plays an important role in influencing its price. It is always best to use your discretion, and find a fine balance between the price and value of the certificate. + +A few reputed SSL certificates go the extra mile and also offer extra security measures to customers. You can never be secure enough on a digital platform. So it is always best to see if such additional security elements will be helpful. However, your prime focus should be the credibility and portfolio of the company. It isn’t wise to compromise with that just to get some extra security elements. + +SSL certificates encrypt the data and information that customers share with organisations. They help to save customers from data theft and misuse by threat actors. But it’s always advisable to check the credibility and reviews of a certificate authority carefully before buying a SSL certificate from it. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/ssl-certificates-make-the-right-choice/ + +作者:[Jitendra Bhojwani][a] +选题:[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/jitendra-bhojwani/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/SSL-certificate.jpg diff --git a/sources/talk/20220615 SBOM – SB Doesn-t Stand for Silver Bullet.md b/sources/talk/20220615 SBOM – SB Doesn-t Stand for Silver Bullet.md new file mode 100644 index 0000000000..e43bd0baf5 --- /dev/null +++ b/sources/talk/20220615 SBOM – SB Doesn-t Stand for Silver Bullet.md @@ -0,0 +1,120 @@ +[#]: subject: "SBOM – SB Doesn’t Stand for Silver Bullet" +[#]: via: "https://www.linux.com/news/sbom-sb-doesnt-stand-for-silver-bullet/" +[#]: author: "Dan Whiting https://www.linuxfoundation.org/blog/sbom-sb-doesnt-stand-for-silver-bullet/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +SBOM – SB Doesn’t Stand for Silver Bullet +====== +Software Bill of Materials (SBOMs) are like ingredient labels on food. They are critical to keep consumers safe and healthy, they are somewhat standardized, but it is a lot more exciting to grow or make the food rather than the label. + +### What is an SBOM? + +What is an SBOM? In short, it is a way to tell another party all of the software that is used in the stack that makes up an application. One benefit of having a SBOM is you know what is in there when a vulnerability comes up. You can easily determine if you are vulnerable and where. + +As modern software is built utilizing a base of software already written (no sense in recreating the wheel), it is important that all of the components don’t get lost in the shuffle. It isn’t readily apparent what a particular piece of software utilizes. So, if a vulnerability for Software A arises, you need to know, do I have that piece of software somewhere in my ecosystem, and, if so, where. Then you can remediate if you need to. + +I can’t take credit for the food label analogy used in my introduction. I heard it from [Allan Friedman][1], a Senior Advisor and Strategist at the [U.S. Cybersecurity and Infrastructure Security Agency][2] (CISA) and a key SBOM advocate, when he presented about SBOMs at the RSA Conference 2022 with [Kate Stewart][3], the VP of Dependable Embedded Systems here at the Linux Foundation. Allan made the point that food labels only provide information. The consumer needs to read and understand them and take appropriate action. For instance, if they are allergic to peanuts, they can look at an ingredient label and determine if they can safely eat the food. + +SBOMs are similar – they tell a person what software is used as an “ingredient” so someone can determine if they need to take action if a vulnerability arises. It isn’t a silver bullet, but it is a vital tool. Without SBOMs no one can track what component “ingredients” are in their software applications. + +### SBOMs and the Software Supply Chain + +Supply chains are impacting our lives more than just restricting availability of consumer goods. Software supply chains are immensely more complicated now as software is built with pre-existing components. This makes software better, more effective, more powerful, etc. But it also introduces risk as more and more parties touch a particular piece of software. Much like our world has become so interdependent, so has our software. + +Understanding what is in the supply chain for our software helps us effectively secure it. When a new risk emerges, we know what we need to do. + +### SBOMs and Software Security + +SBOMs are increasingly being recognized as an important pillar in any comprehensive software security plan. A global [survey conducted in 2021 Q3 by the Linux Foundation][4] found that 78% of organizations responding plan to use SBOMs in 2022. Additionally, the recently published [Open Source Software Security Mobilization Plan][5] recommends SBOMs be universal and the [U.S. Executive Order on Improving the Nation’s Cybersecurity][6] requires SBOMs be provided for software purchased by the U.S. government. And, as Allan points out in his talk, “We buy everything.” The E.O. actually lays out a nice summary of SBOMs and their benefits: + +The term “Software Bill of Materials” or “SBOM” means a formal record containing the details and supply chain relationships of various components used in building software. Software developers and vendors often create products by assembling existing open source and commercial software components. The SBOM enumerates these components in a product. It is analogous to a list of ingredients on food packaging. An SBOM is useful to those who develop or manufacture software, those who select or purchase software, and those who operate software. Developers often use available open source and third-party software components to create a product; an SBOM allows the builder to make sure those components are up to date and to respond quickly to new vulnerabilities. Buyers can use an SBOM to perform vulnerability or license analysis, both of which can be used to evaluate risk in a product. Those who operate software can use SBOMs to quickly and easily determine whether they are at potential risk of a newly discovered vulnerability. A widely used, machine-readable SBOM format allows for greater benefits through automation and tool integration. The SBOMs gain greater value when collectively stored in a repository that can be easily queried by other applications and systems. Understanding the supply chain of software, obtaining an SBOM, and using it to analyze known vulnerabilities are crucial in managing risk. + +Allan and Kate spent time in their talk going into the current state of SBOMs, challenges, benefits, tools available for creating and sharing SBOMs, what is a minimum SBOM, standards being developed, making them fully automated, and more. Look for some future LF Blog posts digging into these. + +But there are things you can do now. + +### What can you and your organization do now? + +Allan and Kate laid out several things you and your organization can do, starting now. Starting within your organization: + +Next week: Understand origins of software your organization is using + +* Commercial: can you ask for an SBOM? +* Open source: do you have an SBOM for the binary or sources you’re importing? + +Three months: Understand what SBOMs your customers will require + +Expectations: which standards, dependency depth, licensing info? + +Six months: Prototype and deploy + +Implement SBOM through using an OSS tool and/or starting a conversation with vendor + +And participate in ongoing discussions to determine best practices for the ecosystem and contribute to open source project any code developed to support SBOMs. + +### But there are also steps you can take as an individual:  + +Next week: Start playing with an open source SBOM tool and apply it to a repo + +Three months: Have an SBOM strategy that explicitly identifies tooling needs + +Six months: + +Begin SBOM implementation through using an OSS tool or starting a conversation with vendor +Participate in a plugfest and try to consume another’s SBOM + +And make sure to share any open source and commercial tools you find helpful and work with the tools to help harden them, test and report bugs, and push them to scale. + +### How can you shape the future of SBOMs? + +First, I want to highlight some upcoming opportunities they shared to help shape the future of SBOMs. CISA is running public Tooling & Implementation work stream discussions in July 2022. They are the same, but occur at different times to help accommodate more time zones: + +* July 13, 2022 – 3:00-4:30 PM ET +* July 21, 2022 – 9:30-11:00 AM ET + +If you want to participate, please email [SBOM@cisa.dhs.gov][7]. + +Additionally, there will be “[plugfests][8]” to be announced soon, and they suggested organizations already adopting SBOMs publish case studies and reference tooling workflows to help others. + +### Conclusion + +SBOMs are here to stay. If you aren’t already, get on the train now. It is pulling out of the station, but you still have an opportunity to help shape where it is going and how well the journey goes. + +Allan’s and Kate’s slides are available [here][9]. If you registered to attend the RSA Conference, you can now watch their full presentation on demand [here][10]. + +### The Software Package Data ExchangeⓇ (SPDXⓇ) + +The Linux Foundation hosts SPDX, which is an open standard for communicating software bill of material information, including components, licenses, copyrights, and security references. SPDX reduces redundant work by providing a common format for companies and communities to share important data, thereby streamlining and improving compliance. The SPDX specification is an international open standard (ISO/IEC 5962:2021). Learn more at [spdx.dev][11]. + +The post [SBOM – SB Doesn’t Stand for Silver Bullet][12] appeared first on [Linux Foundation][13]. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/sbom-sb-doesnt-stand-for-silver-bullet/ + +作者:[Dan Whiting][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxfoundation.org/blog/sbom-sb-doesnt-stand-for-silver-bullet/ +[b]: https://github.com/lkxed +[1]: https://www.linkedin.com/in/allanafriedman/ +[2]: https://www.cisa.gov/ +[3]: https://www.linkedin.com/in/katestewartaustin/ +[4]: https://www.linuxfoundation.org/tools/the-state-of-software-bill-of-materials-sbom-and-cybersecurity-readiness/ +[5]: https://openssf.org/oss-security-mobilization-plan/ +[6]: https://openssf.org/blog/2021/05/14/how-lf-communities-enable-security-measures-required-by-the-us-executive-order-on-cybersecurity/ +[7]: https://www.linux.com/mailto:SBOM@cisa.dhs.gov +[8]: https://en.wikipedia.org/wiki/Plugtest +[9]: https://www.linuxfoundation.org/wp-content/uploads/Tooling-up-Getting-SBOMs-to-Scale_slides.pdf +[10]: https://www.rsaconference.com/usa/agenda/session/Tooling%20up%20Getting%20SBOMs%20to%20Scale +[11]: https://spdx.dev/ +[12]: https://www.linuxfoundation.org/blog/sbom-sb-doesnt-stand-for-silver-bullet/ +[13]: https://www.linuxfoundation.org/ 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 new file mode 100644 index 0000000000..9d4e58d4d6 --- /dev/null +++ b/sources/talk/20220616 -It-s time to contribute to open source-.md @@ -0,0 +1,134 @@ +[#]: subject: "“It’s time to contribute to open source”" +[#]: via: "https://www.opensourceforu.com/2022/06/its-time-to-contributing-to-open-source/" +[#]: author: "Abbinaya Kuzhanthaivel https://www.opensourceforu.com/author/abbinaya-swath/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +“It’s time to contribute to open source” +====== +Nilesh Vaghela is an AWS community hero and founder, ElectroMech Corporation, a cloud and open source company. According to him, contributing to open source is a rewarding act in itself. However, it needs commitment and there are many steps involved in the process, right from selecting a project to ensuring your contribution is noticed. In a conversation with Abbinaya Kuzhanthaivel of OSFY, he shares a few tips on how developers can help to improve India’s contributions to open source. + +![Nilesh Vaghela, +AWS community hero and +founder, ElectroMech Corporation][1] + +##### Q. Can you tell us a bit about your current role and contributions to open source. + +**A.** I am currently an architect working on automation. I lead multiple teams and also contribute majorly to Invinsense, an open source security service platform. I started open source groups in early 1998 and had around 1500 members even then. A group (https://groups.google.com/g/vglug) I am handling now has been very active since 2014-15. + +##### Q. How did you start working with open source projects? + +**A.** I am a mechanical engineer by qualification, and was dealing with modems and UPS systems at my firm ElectroMech Corporation. I slowly got dragged into handling PCs, networking and Linux. I started experimenting in 1996 after getting inspired by seeing over 150 computer servers running on Linux at a Nuclear Science Centre. That’s when I converted my company entirely, focusing on open source for training and support. + +I can proudly say that I was one of the first and early adopters of open source — helping customers to understand what is open source, what are its benefits, what’s available for free, security or code issues, and so on. We got at least four or five customers in Vadodara supporting us, and we eventually promoted ourselves through advertisements in the Yellow Pages. We partnered with Red Hat and the journey continues till now. + +##### Q. How do you think open source has evolved since then? + +A. I can say that, earlier, open source was a passion that fascinated and attracted people to participate. I was particularly impressed hearing user-friendly stories across the world when some Siberian contributors were working to improve water scarcity. It was more like a corporate social responsibility (CSR) activity. A board would be created by people and experts to govern and take projects forward. People would come in for the love of technology without expectations. + +I did not believe then that open source could get commercial, but it is the driving force for most of the innovation and technology today, and many more enterprises are adopting it. We are looking forward to a great balance in contribution to and use of open source, as we have people, communities and big companies coming into play. This is the real future and power of open source. + +##### Q. Could you share some of your challenges? + +A. Initially, I walked alone but people joined once they knew my intentions were good. I created a lot of communities without any expectation, but did get paid indirectly in terms of reputation or fame; some people understood that I was a technical expert and gave projects in the long term. As it was very early days, people started joining the community and contributing without much effort. The goal wasn’t to get business and hence I can say I didn’t really face any hurdles. + +##### Q. What are your leadership mantras and lessons from being a community leader? + +**A.** First, if you want to start a community, then be neutral and don’t harbour a biased opinion. It may look like you are running a community as a leader, but remember those joining you are contributing equally. And never demotivate anyone. Be polite while making comments and addressing queries. Whatever the question, if you don’t want to give an answer, then choose to be quiet. But don’t stop anyone from asking. Help them build expertise. + +Second, don’t involve the community in business. Do not mix and match the goals of your business and community. Have a clear differentiation. + +Always try to encourage people to participate instead of delivering instructions as an expert. If you find people are interested to lead and take initiatives, then give them the stage. Invite and engage them in the community. That will help you to make more community leaders. Also, keep your community simple and don’t involve sponsors in the initial stages. + +##### Q. Who do you look up to for inspiration? + +**A.** Richard Stallman, the father of the open source movement, is my inspiration and I have always admired his projects. + +Apart from him, I have an interesting incident to share that inspired me to work on open source. At the time when I started working on open source, most of the software for the Nuclear Science Centre was based on the Windows OS. However, many scientists wanted to work with Linux based software. And within two or three months, they actually created Linux drivers. This is what fascinated me – that the user can create these drivers which may not be possible in the case of proprietary software. I really liked the fact that open source empowered the user. + +##### Q. Your thoughts on the open source landscape in India and the scope for improvement. + +**A.** India is the largest consumer of open source and we are focusing on becoming a contributor. With so many developers around, we still do not have software giants in India. What we have mostly are service providers and not innovators. More people should become contributors to open source and develop something with international labels. + +The very thought of contributing to open source should begin from the level of schools and colleges. Fortunately, the Gujarat government has already introduced lessons based on Linux from Class 8 to Class 10. It is important to educate and make youngsters aware of open source models. + +Second, we have to develop good mentors. When people start contributing, it is important to find an open source mentor working in that particular project. The mentor gives a small assignment, tries the code and then commits it. If everything goes fine, the contribution is increased gradually. Unfortunately, we have very few mentors available in India. We need to prepare a lot of mentors or maybe connect to those across the world. + +Third, we need to encourage those who come forward to contribute. Once you are a recognised developer or a person contributing to open source development, you also progress in your career and business. + +India can be a major contributor to open source by following such simple methods. + +##### Q. What do you think about the coding requirements to contribute to open source? + +**A.** From my experience, if you know the internal parts, how to develop the application, what code standard you should maintain, and how to manage the team and other best practices, you may not have to actually worry about coding expertise. + +There are other roles too with respect to designing, security maintenance and integration. See what works for you. Develop and strengthen your skill in what you like to do. If you feel coding still interests you, then take the support of fellow developers to learn it. + +##### Q. How do you shortlist a project you would like to contribute to? + +A. You need to understand your top few interest areas and then do your research on the projects happening around them. You need to figure out the area of requirements or openings for contributors and more volunteers. You can start small to practice and then build expertise. + +Avoid going by the trendy topics; what’s important is your individual interest. For instance, DevOps is in high demand now and you may tend to go for a DevOps project. Do not make this mistake. + +You can find open source projects on Cloud Native Computing Foundation ([CNCF][2]), Apache, Fedora, Red Hat, and so on. This way you can also find mentors who are already working on projects and can get proper guidance. + +##### Q. Projects have their own purpose and target audience. Sometimes they even misalign with open source goals. So, what does one check before contributing? + +A. I agree it becomes challenging when somebody starts an open source project and then commercialises it. But this is always a risk, and should not discourage you. + +First try to check out the group — how popular are the contributors working in the group, how long have they been contributing, and how reputed are they. And once you join, observing everyone and everything is the key. Try to learn at least for three to six months, and understand how everything works. You can always leave the project if you find the intention is wrong. But if you feel it’s all right, then go ahead and contribute. + +![The team at ElectroMech Corporation][3] + +There are certain licence checks that you can do, say, like GPL version 3. You can also look at unmodified licence versions like the Apache open source licence. + +##### Q. Do you think big companies will accept contributions from freshers? + +A. Yes, of course. Companies also like mentoring. They usually don’t allow you to contribute directly, but may give you a small assignment initially. A mentor will first try to understand what skill you have and how good you are at it. Once they recognise you have the kind of skill that is needed, they will continue to guide you or assign you to some other mentor based on your skill. The initial stages are very crucial. Many companies do some sort of screening, and you may be allowed to contribute only after you have proved your ability. + +##### Q. What are the initial challenges that contributors have to overcome when picking up projects? + +A. First, you should be very serious about your contribution. There are no written commitments and contributors may tend to take the work lightly. That’s totally wrong. Try to dedicate 8-10 hours or whatever is feasible each day. If you are skipping this commitment because you feel there are no immediate returns, then you will not be a good contributor. +Always adhere to a mentor’s guidance strictly at the initial stages. This is very crucial for a healthy contribution. Sometimes it may happen that you believe you are good at something, while your mentor may not assign a project based on that skill. Simply approach your mentor in such scenarios and ask him what you should do, what is your role, and how you can contribute. + +##### Q. Many developers do not get replies after submitting the contribution to a project. How does one make a submission noticeable? + +A. Write a small blog on the project you are planning to contribute to, covering aspects like what you like in it, what you don’t like, and what can be improved. Such a positive and promotional approach can greatly help you. + +Be a part of the group and be involved in activities related to that particular project. Instead of contributing, first try to engage with the group, and this will increase the chances for you to get adopted as a contributor. + +Once you have a better understanding of the project, not only will your work be accepted but you will be able to better align yourself with that project. + +##### Q. How do you overcome a situation where your contribution is not accepted? + +A. Just understand that this can happen for many reasons — maybe you are not in the right project or you have not contributed correctly. If the project is country driven, your request may not be accepted. Hence, remember to have a checklist as stated earlier. Don’t worry if your contribution is not accepted because either you are not fit for the project or the project is not fit for you. + +All I would recommend is try to identify four or five projects, and at least one among those projects you work on will probably be accepted. + +##### Q. What is your message for our readers? + +A. Open source is the driving force behind most of the innovation happening today. Instead of just using open source, let us try to contribute according to our capacity and skills. Contributions can be in terms of code, documentation, testing, blogs, money, etc. It’s time to contribute. + +##### Q. Any hiring plans for ElectroMech Corporation — what are the roles and skill expectations? + +We have requirements in cloud DevOps, and are hiring cloud architects, Python developers, Linux architects and security professionals. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/its-time-to-contributing-to-open-source/ + +作者:[Abbinaya Kuzhanthaivel][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/abbinaya-swath/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Nilesh-Vaghela-AWS-community-hero-and-founder-ElectroMech-Corporation.jpg +[2]: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwib2vvv3dv3AhVa7XMBHfZSCsIQFnoECAgQAQ&url=https%3A%2F%2Fwww.cncf.io%2F&usg=AOvVaw2LnRyH4SZPDHntRLJU_b3q +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/The-team-at-ElectroMech-Corporation.jpg diff --git a/sources/talk/20220616 Using habits to practice open organization principles.md b/sources/talk/20220616 Using habits to practice open organization principles.md new file mode 100644 index 0000000000..f8992b3b80 --- /dev/null +++ b/sources/talk/20220616 Using habits to practice open organization principles.md @@ -0,0 +1,142 @@ +[#]: subject: "Using habits to practice open organization principles" +[#]: via: "https://opensource.com/open-organization/22/6/using-habits-practice-open-organization-principles" +[#]: author: "Ron McFarland https://opensource.com/users/ron-mcfarland" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Using habits to practice open organization principles +====== +Follow these steps to implement habits that support open culture and get rid of those that don't. + +![Selfcare, drinking tea on the porch][1] + +Image by: opensource.com + +Habits are a long-term interest of mine. Several years ago, I gave a presentation on habits, both good and bad, and how to expand on good habits and change bad ones. Just recently, I read the habits-focused book Smart Thinking by Art Markman. You might ask what this has to do with [open organization principles.][2] There is a connection, and I'll explain it in this two-part article on managing habits. + +In this first article, I talk about habits, how they work, and—most important—how you can start to change them. In the second article, I review Markman's thoughts as presented in his book. + +### The intersection of principles and habits + +Suppose you learned about open organization principles and although you found them interesting and valuable, you just weren't in the habit of using them. Here's how that might look in practice. + +Community: If you're faced with a significant challenge but think you can't address it alone, you're likely in the habit of just giving up. Wouldn't it be better to have the habit of building a community of like-minded people that collectively can solve the problem? + +Collaboration: Suppose you don't think you're a good collaborator. You like to do things alone. You know that there are cases when collaboration is required, but you don't have a habit of engaging in it. To counteract that, you must build a habit of collaborating more. + +Transparency: Say you like to keep most of what you do and know a secret. However, you know that if you don't share information, you're not likely to get good information from others. Therefore, you must create the habit of being more transparent. + +Inclusivity: Imagine you are uncomfortable working with people you don't know and who are different from you, whether in personality, culture, or language. You know that if you want to be successful, you must work with a wide variety of people. How do you create a habit of being more inclusive? + +Adaptability: Suppose you tend to resist change long after what you're doing is no longer achieving what you had hoped it would. You know you must adapt and redirect your efforts, but how can you create a habit of being adaptive? + +### What is a habit? + +Before I give examples regarding the above principles, I'll explain some of the relevant characteristics of a habit. + +* A habit is a behavior performed repeatedly—so much so that it's now performed without thinking. +* A habit is automatic and feels right at the time. The person is so used to it, that it feels good when doing it, and to do something else would require effort and make them feel uncomfortable. They might have second thoughts afterward though. +* Some habits are good and extremely helpful by saving you a lot of energy. The brain is 2% of the body's weight but consumes 20% of your daily energy. Because thinking and concentration require a lot of energy, your mind is built to save it through developing unconscious habits. +* Some habits are bad for you, so you desire to change them. +* All habits offer some reward, even if it is only temporary. +* Habits are formed around what you are familiar with and what you know, even habits you don’t necessarily like. + +### The three steps of a habit + +1. Cue (trigger): First, a cue or trigger tells the brain to go into automatic mode, using previously learned habitual behavior. Cues can be things like seeing a candy bar or a television commercial, being in a certain place at a certain time of day, or just seeing a particular person. Time pressure can trigger a routine. An overwhelming atmosphere can trigger a routine. Simply put, something reminds you to behave a certain way. +2. Routine: The routine follows the trigger. A routine is a set of physical, mental, and/or emotional behaviors that can be incredibly complex or extremely simple. Some habits, such as those related to emotions, are measured in milliseconds. +3. Reward: The final step is the reward, which helps your brain figure out whether a particular activity is worth remembering for the future. Rewards can range from food or drugs that cause physical sensations to joy, pride, praise, or personal self-esteem. + +### Bad habits in a business environment + +Habits aren't just for individuals. All organizations have good and bad institutional habits. However, some organizations deliberately design their habits, while others just let them evolve without forethought, possibly through rivalries or fear. These are some organizational habit examples: + +* Always being late with reports +* Working alone or working in groups when the opposite is appropriate +* Being triggered by excess pressure from the boss +* Not caring about declining sales +* Not cooperating among a sales team because of excess competition +* Allowing one talkative person to dominate a meeting + +### A step-by-step plan to change a habit + +Habits don't have to last forever. You can change your own behavior. First, remember that many habits can not be changed concurrently. Instead, find a keystone habit and work on it first. This produces small, quick rewards. Remember that one keystone habit can create a chain reaction. + +Here is a four-step framework you can apply to changing any habit, including habits related to open organization principles. + +##### Step one: identify the routine + +Identify the habit loop and the routine in it (for example, when an important challenge comes up that you can't address alone). The routine (the behaviors you do) is the easiest to identify, so start there. For example: "In my organization, no one discusses problems with anyone. They just give up before starting." Determine the routine that you want to modify, change, or just study. For example: "Every time an important challenge comes up, I should discuss it with people and try to develop a community of like-minded people who have the skills to address it." + +##### Step two: experiment with the rewards + +Rewards are powerful because they satisfy cravings. But, we're often not conscious of the cravings that drive our behavior. They are only evident afterward. For example, there may be times in meetings when you want nothing more than to get out of the room and avoid a subject of conversation, even though down deep you know you should figure out how to address the problem. + +To learn what a craving is, you must experiment. That might take a few days, weeks, or longer. You must feel the triggering pressure when it occurs to identify it fully. For example, ask yourself how you feel when you try to escape responsibility. + +Consider yourself a scientist, just doing experiments and gathering data. The steps in your investigation are: + +1. After the first routine, start adjusting the routines that follow to see whether there's a reward change. For example, if you give up every time you see a challenge you can't address by yourself, the reward is the relief of not taking responsibility. A better response might be to discuss the issue with at least one other person who is equally concerned about the issue. The point is to test different hypotheses to determine which craving drives your routine. Are you craving the avoidance of responsibility? +2. After four or five different routines and rewards, write down the first three or four things that come to mind right after each reward is received. Instead of just giving up in the face of a challenge, for instance, you discuss the issue with one person. Then, you decide what can be done. +3. After writing about your feeling or craving, set a timer for 15 minutes. When it rings, ask yourself whether you still have the craving. Before giving in to a craving, rest and think about the issue one or two more times. This forces you to be aware of the moment and helps you later recall what you were thinking about at that moment. +4. Try to remember what you were thinking and feeling at that precise instant, and then 15 minutes after the routine. If the craving is gone, you have identified the reward. + +##### Step three: isolate the cue or trigger + +The cue is often hard to identify because there's usually too much information bombarding you as your behaviors unfold. To identify a cue amid other distractions, you can observe four factors the moment the urge hits you: + +Location: Where did it occur? ("My biggest challenges come out in meetings.") + +Time: When did it occur? ("Meetings in the afternoon, when I'm tired, are the worst time, because I'm not interested in putting forth any effort.") + +Feelings: What was your emotional state? ("I feel overwhelmed and depressed when I hear the problem.") + +People: Who or what type of people were around you at the time, or were you alone? ("In the meetings, most other people don't seem interested in the problem either. Others dominate the discussion.") + +##### Step four: have a plan + +Once you have confirmed the reward driving your behavior, the cues that trigger it, and the behavior itself, you can begin to shift your actions. Follow these three easy steps: + +1. First, plan for the cue. ("In meetings, I'm going to look for and focus my attention on important problems that come up.") +2. Second, choose a behavior that delivers the same reward but without the penalties you suffer now. ("I'm going to explore a plan to address that problem and consider what resources and skills I need to succeed. I'm going to feel great when I create a community that's able to address the problem successfully.") +3. Third, make the behavior a deliberate choice each and every time, until you no longer need to think about it. ("I'm going to consciously pay attention to major issues until I can do it without thinking. I might look at agendas of future meetings, so I know what to expect in advance. Before and during every meeting, I will ask why should I be here, to make sure I'm focused on what is important." + +##### Plan to avoid forgetting something that must be done + +To successfully start doing something you often forget, follow this process: + +1. Plan what you want to do. +2. Determine when you want to complete it. +3. Break the project into small tasks as needed. +4. With a timer or daily planner, set up cues to start each task. +5. Complete each task on schedule. +6. Reward yourself for staying on schedule. + +### Habit change + +Change takes a long time. Sometimes a support group is required to help change a habit. Sometimes, a lot of practice and role play of a new and better routine in a low-stress environment is required. To find an effective reward, you need repeated experimentation. + +Sometimes habits are only symptoms of a more significant, deeper problem. In these cases, professional help may be required. But if you have the desire to change and accept that there will be minor failures along the way, you can gain power over any habit. + +In this article, I've used examples of community development using the cue-routine-reward process. It can equally be applied to the other open organization principles. I hope this article got you thinking about how to manage habits through knowing how habits work, taking steps to change habits, and making plans to avoid forgetting things you want done. Whether it's an open organization principle or anything else, you can now diagnose the cue, the routine, and the reward. That will lead you to a plan to change a habit when the cue presents itself. + +In my next article, I'll look at habits through the lens of Art Markman's thoughts on Smart Thinking. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/22/6/using-habits-practice-open-organization-principles + +作者:[Ron McFarland][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ron-mcfarland +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/coffee_tea_selfcare_wfh_porch_520.png +[2]: https://theopenorganization.org/definition/open-organization-definition/ diff --git a/sources/tech/20210101 Djinn- A Code Generator and Templating Language Inspired by Jinja2.md b/sources/tech/20210101 Djinn- A Code Generator and Templating Language Inspired by Jinja2.md index d903ef5abf..f5849ac6b2 100644 --- a/sources/tech/20210101 Djinn- A Code Generator and Templating Language Inspired by Jinja2.md +++ b/sources/tech/20210101 Djinn- A Code Generator and Templating Language Inspired by Jinja2.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (hanszhao80) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -236,7 +236,7 @@ via: https://theartofmachinery.com/2021/01/01/djinn.html 作者:[Simon Arneaud][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[hanszhao80](https://github.com/hanszhao80) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/sources/tech/20210104 Docker Compose- a nice way to set up a dev environment.md b/sources/tech/20210104 Docker Compose- a nice way to set up a dev environment.md index b2d719b02a..58277b591a 100644 --- a/sources/tech/20210104 Docker Compose- a nice way to set up a dev environment.md +++ b/sources/tech/20210104 Docker Compose- a nice way to set up a dev environment.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lkxed) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210122 Configure a Linux workspace remotely from the command line.md b/sources/tech/20210122 Configure a Linux workspace remotely from the command line.md index f7118f5ba8..373b850f80 100644 --- a/sources/tech/20210122 Configure a Linux workspace remotely from the command line.md +++ b/sources/tech/20210122 Configure a Linux workspace remotely from the command line.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Donke-Hao) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210131 How to teach open source beyond business.md b/sources/tech/20210131 How to teach open source beyond business.md deleted file mode 100644 index f9563e14ff..0000000000 --- a/sources/tech/20210131 How to teach open source beyond business.md +++ /dev/null @@ -1,72 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to teach open source beyond business) -[#]: via: (https://opensource.com/article/21/1/open-source-beyond-business) -[#]: author: (Irit Goihman https://opensource.com/users/iritgoihman) - -How to teach open source beyond business -====== -The Beyond program connects future talents in the tech industry with -open source culture. -![Teacher or learner?][1] - -When I was a university student, I didn't understand the fuss about open source software. I used Linux and open source software but didn't really understand the open source model, how to contribute to projects, or how it could benefit my future career. My development experience consisted mainly of homework assignments and a large final project required for my degree. - -So, when I took my first steps in the tech industry, there was a big learning curve before I felt comfortable. I needed to understand how to join established, sometimes large, and distributed teams working on an ongoing project. I also needed to know how to communicate properly so that my efforts could be recognized. - -I am not special in this regard. This is a common situation among new graduates. - -### Open source gives students a head start - -Since then, as an engineer and later as a manager, I have helped onboard many junior engineers. One of the things I've noticed is that the new graduates who have already contributed to open source projects could onboard quickly and start contributing faster than those without this experience. - -By incorporating open source methodology into academic studies, students can gain experience relevant to the industry, learn to reuse their existing knowledge, and establish a good platform for formulating ideas and sharing knowledge. Practicing open source can make a positive impact on students' technical knowledge and experience. This can help them become more successful in bootstrapping their careers. - -The value of open source methodologies in the tech industry is well-established and shapes the culture of software companies worldwide. Involvement in open source projects and adoption of the [open organization culture][2] has become an industry standard. Companies seek fresh-minded, talented employees who know how to work in open source and cultivate its culture. Therefore, the tech industry must drive the academic world to embrace open source culture as one of the fundamental methodologies to learn in tech studies. - -### Moving open source culture 'Beyond' business - -When I met [Liora Milbaum][3], a senior principal software engineer at Red Hat, I learned we shared an interest in bringing open source culture and principles into academics. Liora had previously founded [DevOps Loft][4], in which she shared DevOps practices with people interested in stepping into this world, and wished to start a similar initiative to teach open source to university students. We decided to launch the [Beyond][5] program to connect future talents in the tech industry with open source culture as Red Hat practices it. - -We started the Beyond program at the [Academic College of Tel Aviv-Yafo][6], where we were warmly welcomed by the information systems faculty. We started by teaching an "Introduction to DevOps'' course to introduce elements of the DevOps tech stack. Our biggest challenge at the start was deciding how to teach what open source is. The answer was simple: by practicing it, of course. We didn't want to deliver yet another old-school academic course; rather, we wanted to expose students to industry standards. - -We created a syllabus that incorporated common open source projects and tools to teach the DevOps stack. The course consisted of lectures and hands-on participation taught by engineers. The students were divided into groups, each one mentored and supported by an engineer. They practiced working in teams, sharing knowledge (both inside and outside of their groups), and collaborating effectively. - -During our second course, "Open source development pillars," for students in the computer science department, we encountered another big obstacle. Two weeks after the course started, we became fully remote as the COVID pandemic hit the globe. We solved this problem by using the same remote collaboration tools with our students that we were using for our daily work at Red Hat. We were amazed at how simple and smooth the transition was. - -![Beyond teaching online][7] - -(Irit Goihman, [CC BY-SA 4.0][8]) - -### Successful early outcomes - -The two courses were a huge success, and we even hired one of the top students we taught. The feedback we received was amazing; the students said we positively impacted their knowledge, thinking, and soft skills. A few students were hired for their first tech job based on their open source contributions during the course. - -Other academic institutions have expressed interest in adopting these courses, so we've expanded the program to another university. - -I am fortunate to co-lead this successful initiative with Liora, accompanied by a team of talented engineers. Together, we are helping increase the open source community a bit more. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/open-source-beyond-business - -作者:[Irit Goihman][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/iritgoihman -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-lead-teacher-learner.png?itok=rMJqBN5G (Teacher or learner?) -[2]: https://opensource.com/open-organization/resources/open-org-definition -[3]: https://www.linkedin.com/in/lioramilbaum -[4]: https://www.devopsloft.io/ -[5]: https://research.redhat.com/blog/2020/05/24/open-source-development-course-and-devops-methodology/ -[6]: https://www.int.mta.ac.il/ -[7]: https://opensource.com/sites/default/files/pictures/beyond_mta.png (Beyond teaching online) -[8]: https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/sources/tech/20210210 Manage your budget on Linux with this open source finance tool.md b/sources/tech/20210210 Manage your budget on Linux with this open source finance tool.md deleted file mode 100644 index 6e11979896..0000000000 --- a/sources/tech/20210210 Manage your budget on Linux with this open source finance tool.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (hanszhao80) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Manage your budget on Linux with this open source finance tool) -[#]: via: (https://opensource.com/article/21/2/linux-skrooge) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Manage your budget on Linux with this open source finance tool -====== -Make managing your finances easier with Skrooge, an open source -budgeting tool. -![2 cents penny money currency][1] - -In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. This article is about personal financial management. - -Personal finances can be difficult to manage. It can be frustrating and even scary when you don't have enough money to get by without financial assistance, and it can be surprisingly overwhelming when you do have the money you need but no clear notion of where it all goes each month. To make matters worse, we're often told to "make a budget" as if declaring the amount of money you can spend each month will somehow manifest the money you need. The bottom line is that making a budget is hard, and not meeting your financial goals is discouraging. But it's still important, and Linux has several tools that can help make the task manageable. - -### Money management - -As with anything else in life, we all have our own ways of keeping track of our money. I used to take a simple and direct approach: My paycheck was deposited into an account, and I'd withdraw some percentage in cash. Once the cash was gone from my wallet, I had to wait until the next payday to spend anything. It only took one day of missing out on lunch to learn that I had to take my goals seriously, and I adjusted my spending behavior accordingly. For the simple lifestyle I had at the time, it was an effective means of keeping myself honest with my income, but it didn't translate well to online business transactions, long-term utility contracts, investments, and so on. - -As I continue to refine the way I track my finances, I've learned that personal accounting is always an evolving process. We each have unique financial circumstances, which inform what kind of solution we can or should use to track our income and debt. If you're out of work, then your budgeting goal is likely to spend as little as possible. If you're working but paying off a student loan, then your goal probably favors sending money to the bank. And if you're working but planning for retirement, then you're probably trying to save as much as you can. - -The thing to remember about a budget is that it's meant to compare your financial reality with your financial _goals_. You can't avoid some expenses, but after those, you get to set your own priorities. If you don't hit your goals, you can adjust your own behavior or rewrite your goals so that they better reflect reality. Adapting your financial plan doesn't mean you've failed. It just means that your initial projection wasn't accurate. During hard times, you may not be able to hit any budget goals, but if you keep up with your budget, you'll learn a lot about what it takes financially to maintain your current lifestyle (whatever it may be). Over time, you can learn to adjust settings you may never have realized were available to you. For instance, people are moving to rural towns for the lower cost of living now that remote work is a widely accepted option. It's pretty stunning to see how such a lifestyle shift can alter your budget reports. - -The point is that budgeting is an often undervalued activity, and in no small part because it's daunting. It's important to realize that you can budget, no matter your level of expertise or interest in finances. Whether you [just use a LibreOffice spreadsheet][2], or try a dedicated financial application, you can set goals, track your own behavior, and learn a lot of valuable lessons that could eventually pay dividends. - -### Open source accounting - -There are several dedicated [personal finance applications for Linux][3], including [HomeBank][4], [Money Manager EX][5], [GNUCash][6], [KMyMoney][7], and [Skrooge][8]. All of these applications are essentially ledgers, a place you can retreat to at the end of each month (or whenever you look at your accounts), import data from your bank, and review how your expenditures align with whatever budget you've set for yourself. - -![Skrooge interface with financial data displayed][9] - -Skrooge - -I use Skrooge as my personal budget tracker. It's an easy application to set up, even with multiple bank accounts. Skrooge, as with most open source finance apps, can import multiple file formats, so my workflow goes something like this: - - 1. Log in to my banks. - 2. Export the month's bank statement as QIF files. - 3. Open Skrooge. - 4. Import the QIF files. Each gets assigned to their appropriate accounts automatically. - 5. Review my expenditures compared to the budget goals I've set for myself. If I've gone over, then I dock next month's goals (so that I'll ideally spend less to make up the difference). If I've come in under my goal, then I move the excess to December's budget (so I'll have more to spend at the end of the year). - - - -I only track a subset of the household budget in Skrooge. Skrooge makes that process easy through a dynamic database that allows me to categorize multiple transactions at once with custom tags. This makes it easy for me to extract my personal expenditures from general household and utility expenses, and I can leverage these categories when reviewing the autogenerated reports Skrooge provides. - -![Skrooge budget pie chart][10] - -Skrooge budget pie chart - -Most importantly, the popular Linux financial apps allow me to manage my budget the way that works best for me. For instance, my partner prefers to use a LibreOffice spreadsheet, but with very little effort, I can extract a CSV file from the household budget, import it into Skrooge, and use an updated set of data. There's no lock-in, no incompatibility. The system is flexible and agile, allowing us to adapt our budget and our method of tracking expenses as we learn more about effective budgeting and about what life has in store. - -### Open choice - -Money markets worldwide differ, and the way we each interact with them also defines what tools we can use. Ultimately, your choice of what to use for your finances is a decision you must make based on your own requirements. And one thing open source does particularly well is provide its users the freedom of choice. - -When setting my own financial goals, I appreciate that I can use whatever application fits in best with my style of personal computing. I get to retain control of how I process the data in my life, even when it's data I don't necessarily enjoy having to process. Linux and its amazing set of applications make it just a little less of a chore. - -Try some financial apps on Linux and see if you can inspire yourself to set some goals and save money! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/2/linux-skrooge - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[hanszhao80](https://github.com/hanszhao80) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/Medical%20Costs%20Transparency_1.jpg?itok=CkZ_J88m (2 cents penny money currency) -[2]: https://opensource.com/article/20/3/libreoffice-templates -[3]: https://opensource.com/life/17/10/personal-finance-tools-linux -[4]: http://homebank.free.fr/en/index.php -[5]: https://www.moneymanagerex.org/download -[6]: https://opensource.com/article/20/2/gnucash -[7]: https://kmymoney.org/download.html -[8]: https://apps.kde.org/en/skrooge -[9]: https://opensource.com/sites/default/files/skrooge.jpg -[10]: https://opensource.com/sites/default/files/skrooge-pie_0.jpg diff --git a/sources/tech/20210319 Create a countdown clock with a Raspberry Pi.md b/sources/tech/20210319 Create a countdown clock with a Raspberry Pi.md deleted file mode 100644 index bc376bd374..0000000000 --- a/sources/tech/20210319 Create a countdown clock with a Raspberry Pi.md +++ /dev/null @@ -1,393 +0,0 @@ -[#]: subject: (Create a countdown clock with a Raspberry Pi) -[#]: via: (https://opensource.com/article/21/3/raspberry-pi-countdown-clock) -[#]: author: (Chris Collins https://opensource.com/users/clcollins) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Create a countdown clock with a Raspberry Pi -====== -Start counting down the days to your next holiday with a Raspberry Pi -and an ePaper display. -![Alarm clocks with different time][1] - -For 2021, [Pi Day][2] has come and gone, leaving fond memories and [plenty of Raspberry Pi projects][3] to try out. The days after any holiday can be hard when returning to work after high spirits and plenty of fun, and Pi Day is no exception. As we look into the face of the Ides of March, we can long for the joys of the previous, well, day. But fear no more, dear Pi Day celebrant! For today, we begin the long countdown to the next Pi Day! - -OK, but seriously. I made a Pi Day countdown timer, and you can too! - -A while back, I purchased a [Raspberry Pi Zero W][4] and recently used it to [figure out why my WiFi was so bad][5]. I was also intrigued by the idea of getting an ePaper display for the little Zero W. I didn't have a good use for one, but, dang it, it looked like fun! I purchased a little 2.13" [Waveshare display][6], which fit perfectly on top of the Raspberry Pi Zero W. It's easy to install: Just slip the display down onto the Raspberry Pi's GIPO headers and you're good to go. - -I used [Raspberry Pi OS][7] for this project, and while it surely can be done with other operating systems, the `raspi-config` command, used below, is most easily available on Raspberry Pi OS. - -### Set up the Raspberry Pi and the ePaper display - -Setting up the Raspberry Pi to work with the ePaper display requires you to enable the Serial Peripheral Interface (SPI) in the Raspberry Pi software, install the BCM2835 C libraries (to access the GPIO functions for the Broadcom BCM 2835 chip on the Raspberry Pi), and install Python GPIO libraries to control the ePaper display. Finally, you need to install the Waveshare libraries for working with the 2.13" display using Python. - -Here's a step-by-step walkthrough of how to do these tasks. - -#### Enable SPI - -The easiest way to enable SPI is with the Raspberry Pi `raspi-config` command. The SPI bus allows serial data communication to be used with devices—in this case, the ePaper display: - - -``` -`$ sudo raspi-config` -``` - -From the menu that pops up, select **Interfacing Options** -> **SPI** -> **Yes** to enable the SPI interface, then reboot. - -#### Install BCM2835 libraries - -As mentioned above, the BCM2835 libraries are software for the Broadcom BCM2385 chip on the Raspberry Pi, which allows access to the GPIO pins and the ability to use them to control devices. - -As I'm writing this, the latest version of the Broadcom BCM 2835 libraries for the Raspberry Pi is v1.68. To install the libraries, you need to download the software tarball and build and install the software with `make`: - - -``` -# Download the BCM2853 libraries and extract them -$ curl -sSL -o - | tar -xzf - - -# Change directories into the extracted code -$ pushd bcm2835-1.68/ - -# Configure, build, check and install the BCM2853 libraries -$ sudo ./configure -$ sudo make check -$ sudo make install - -# Return to the original directory -$ popd -``` - -#### Install required Python libraries - -You also need some Python libraries to use Python to control the ePaper display, the `RPi.GPIO` pip package. You also need the `python3-pil` package for drawing shapes. Apparently, the PIL package is all but dead, but there is an alternative, [Pillow][8]. I have not tested Pillow for this project, but it may work: - - -``` -# Install the required Python libraries -$ sudo apt-get update -$ sudo apt-get install python3-pip python3-pil -$ sudo pip3 install RPi.GPIO -``` - -_Note: These instructions are for Python 3. You can find Python 2 instructions on Waveshare's website_ - -#### Download Waveshare examples and Python libraries - -Waveshare maintains a Git repository with Python and C libraries for working with its ePaper displays and some examples that show how to use them. For this countdown clock project, you will clone this repository and use the libraries for the 2.13" display: - - -``` -# Clone the WaveShare e-Paper git repository -$ git clone -``` - -If you're using a different display or a product from another company, you'll need to use the appropriate software for your display. - -Waveshare provides instructions for most of the above on its website: - - * [WaveShare ePaper setup instructions][9] - * [WaveShare ePaper libraries install instructions][10] - - - -#### Get a fun font (optional) - -You can display your timer however you want, but why not do it with a little style? Find a cool font to work with! - -There's a ton of [Open Font License][11] fonts available out there. I am particularly fond of Bangers. You've seen this if you've ever watched YouTube—it's used _all over_. It can be downloaded and dropped into your user's local shared fonts directory to make it available for any application, including this project: - - -``` -# The "Bangers" font is a Open Fonts License licensed font by Vernon Adams () from Google Fonts -$ mkdir -p ~/.local/share/fonts -$ curl -sSL -o fonts/Bangers-Regular.ttf -``` - -### Create a Pi Day countdown timer - -Now that you have installed the software to work with the ePaper display and a fun font to use, you can build something cool with it: a timer to count down to the next Pi Day! - -If you want, you can just grab the [countdown.py][12] Python file from this project's [GitHub repo][13] and skip to the end of this article. - -For the curious, I'll break down that file, section by section. - -#### Import some libraries - - -``` -#!/usr/bin/python3 -# -*- coding:utf-8 -*- -import logging -import os -import sys -import time - -from datetime import datetime -from pathlib import Path -from PIL import Image,ImageDraw,ImageFont - -logging.basicConfig(level=logging.INFO) - -basedir = Path(__file__).parent -waveshare_base = basedir.joinpath('e-Paper', 'RaspberryPi_JetsonNano', 'python') -libdir = waveshare_base.joinpath('lib') -``` - -At the start, the Python script imports some standard libraries used later in the script. You also need to add `Image`, `ImageDraw`, and `ImageFont` from the PIL package, which you'll use to draw some simple geometric shapes. Finally, set some variables for the local `lib` directory that contains the Waveshare Python libraries for working with the 2.13" display, and which you can use later to load the library from the local directory. - -#### Font size helper function - -The next part of the script has a helper function for setting the font size for your chosen font: Bangers-Regular.ttf. It takes an integer for the font size and returns an ImageFont object you can use with the display: - - -``` -def set_font_size(font_size): -    logging.info("Loading font...") -    return ImageFont.truetype(f"{basedir.joinpath('Bangers-Regular.ttf').resolve()}", font_size) -``` - -#### Countdown logic - -Next is a small function that calculates the meat of this project: how long it is until the next Pi Day. If it were, say, January, it would be relatively straightforward to count how many days are left, but you also need to consider whether Pi Day has already passed for the year (sadface), and if so, count how very, very many days are ahead until you can celebrate again: - - -``` -def countdown(now): -    piday = datetime(now.year, 3, 14) - -    # Add a year if we're past PiDay -    if piday < now: -        piday = datetime((now.year + 1), 3, 14) - -    days = (piday - now).days - -    logging.info(f"Days till piday: {days}") -    return day -``` - -#### The main function - -Finally, you get to the main function, which initializes the display and begins writing data to it. In this case, you'll write a welcome message and then begin the countdown to the next Pi Day. But first, you need to load the Waveshare library: - - -``` -def main(): - -    if os.path.exists(libdir): -        sys.path.append(f"{libdir}") -        from waveshare_epd import epd2in13_V2 -    else: -        logging.fatal(f"not found: {libdir}") -        sys.exit(1) -``` - -The snippet above checks to make sure the library has been downloaded to a directory alongside the countdown script, and then it loads the `epd2in13_V2` library. If you're using a different display, you will need to use a different library. You can also write your own if you are so inclined. I found it kind of interesting to read the Python code that Waveshare provides with the display. It's considerably less complicated than I would have imagined it to be, if somewhat tedious. - -The next bit of code creates an EPD (ePaper Display) object to interact with the display and initializes the hardware: - - -``` -    logging.info("Starting...") -    try: -        # Create an a display object -        epd = epd2in13_V2.EPD() - -        # Initialize the displace, and make sure it's clear -        # ePaper keeps it's state unless updated! -        logging.info("Initialize and clear...") -        epd.init(epd.FULL_UPDATE) -        epd.Clear(0xFF) -``` - -An interesting aside about ePaper: It uses power only when it changes a pixel from white to black or vice-versa. This means when the power is removed from the device or the application stops for whatever reason, whatever was on the screen remains. That's great from a power-consumption perspective, but it also means you need to clear the display when starting up, or your script will just write over whatever is already on the screen. Hence, `epd.Clear(0xFF)` is used to clear the display when the script starts. - -Next, create a "canvas" where you will draw the rest of your display output: - - -``` -    # Create an image object -    # NOTE: The "epd.heigh" is the LONG side of the screen -    # NOTE: The "epd.width" is the SHORT side of the screen -    # Counter-intuitive... -    logging.info(f"Creating canvas - height: {epd.height}, width: {epd.width}") -    image = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame -    draw = ImageDraw.Draw(image) -``` - -This matches the width and height of the display—but it is somewhat counterintuitive, in that the short side of the display is the width. I think of the long side as the width, so this is just something to note. Note that the `epd.height` and `epd.width` are set by the Waveshare library to correspond to the device you're using. - -#### Welcome message - -Next, you'll start to draw something. This involves setting data on the "canvas" object you created above. This doesn't draw it to the ePaper display yet—you're just building the image you want right now. Create a little welcome message celebrating Pi Day, with an image of a piece of pie, drawn by yours truly just for this project: - -![drawing of a piece of pie][14] - -(Chris Collins, [CC BY-SA 4.0][15]) - -Cute, huh? - - -``` -    logging.info("Set text text...") -    bangers64 = set_font_size(64) -    draw.text((0, 30), 'PI DAY!', font = bangers64, fill = 0) - -    logging.info("Set BMP...") -    bmp = Image.open(basedir.joinpath("img", "pie.bmp")) -    image.paste(bmp, (150,2)) -``` - -Finally, _finally_, you get to display the canvas you drew, and it's a little bit anti-climactic: - - -``` -    logging.info("Display text and BMP") -    epd.display(epd.getbuffer(image)) -``` - -That bit above updates the display to show the image you drew. - -Next, prepare another image to display your countdown timer. - -#### Pi Day countdown timer - -First, create a new image object that you can use to draw the display. Also, set some new font sizes to use for the image: - - -``` -    logging.info("Pi Date countdown; press CTRL-C to exit") -    piday_image = Image.new('1', (epd.height, epd.width), 255) -    piday_draw = ImageDraw.Draw(piday_image) - -    # Set some more fonts -    bangers36 = set_font_size(36) -    bangers64 = set_font_size(64) -``` - -To display a ticker like a countdown, it's more efficient to update part of the image, changing the display for only what has changed in the data you want to draw. The next bit of code prepares the display to function this way: - - -``` -    # Prep for updating display -    epd.displayPartBaseImage(epd.getbuffer(piday_image)) -    epd.init(epd.PART_UPDATE) -``` - -Finally, you get to the timer bit, starting an infinite loop that checks how long it is until the next Pi Day and displays the countdown on the ePaper display. If it actually _is_ Pi Day, you can handle that with a little celebration message: - - -``` -    while (True): -        days = countdown(datetime.now()) -        unit = get_days_unit(days) - -        # Clear the bottom half of the screen by drawing a rectangle filld with white -        piday_draw.rectangle((0, 50, 250, 122), fill = 255) - -        # Draw the Header -        piday_draw.text((10,10), "Days till Pi-day:", font = bangers36, fill = 0) - -        if days == 0: -            # Draw the Pi Day celebration text! -            piday_draw.text((0, 50), f"It's Pi Day!", font = bangers64, fill = 0) -        else: -            # Draw how many days until Pi Day -            piday_draw.text((70, 50), f"{str(days)} {unit}", font = bangers64, fill = 0) - -        # Render the screen -        epd.displayPartial(epd.getbuffer(piday_image)) -        time.sleep(5) -``` - -The last bit of the script does some error handling, including some code to catch keyboard interrupts so that you can stop the infinite loop with **Ctrl**+**C** and a small function to print "day" or "days" depending on whether or not the output should be singular (for that one, single day each year when it's appropriate): - - -``` -    except IOError as e: -        logging.info(e) - -    except KeyboardInterrupt: -        logging.info("Exiting...") -        epd.init(epd.FULL_UPDATE) -        epd.Clear(0xFF) -        time.sleep(1) -        epd2in13_V2.epdconfig.module_exit() -        exit() - -def get_days_unit(count): -    if count == 1: -        return "day" - -    return "days" - -if __name__ == "__main__": -    main() -``` - -And there you have it! A script to count down and display how many days are left until Pi Day! Here's an action shot on my Raspberry Pi (sped up by 86,400; I don't have nearly enough disk space to save a day-long video): - -![Pi Day Countdown Timer In Action][16] - -(Chris Collins, [CC BY-SA 4.0][15]) - -#### Install the systemd service (optional) - -If you'd like the countdown display to run whenever the system is turned on and without you having to be logged in and run the script, you can install the optional systemd unit as a [systemd user service][17]). - -Copy the [piday.service][18] file on GitHub to `${HOME}/.config/systemd/user`, first creating the directory if it doesn't exist. Then you can enable the service and start it: - - -``` -$ mkdir -p ~/.config/systemd/user -$ cp piday.service ~/.config/systemd/user -$ systemctl --user enable piday.service -$ systemctl --user start piday.service - -# Enable lingering, to create a user session at boot -# and allow services to run after logout -$ loginctl enable-linger $USER -``` - -The script will output to the systemd journal, and the output can be viewed with the `journalctl` command. - -### It's beginning to look a lot like Pi Day! - -And _there_ you have it! A Pi Day countdown timer, displayed on an ePaper display using a Raspberry Pi Zero W, and starting on system boot with a systemd unit file! Now there are just 350-something days until we can once again come together and celebrate the fantastic device that is the Raspberry Pi. And we can see exactly how many days at a glance with our tiny project. - -But in truth, anyone can hold Pi Day in their hearts year-round, so enjoy creating some fun and educational projects with your own Raspberry Pi! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/raspberry-pi-countdown-clock - -作者:[Chris Collins][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/clcollins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/clocks_time.png?itok=_ID09GDk (Alarm clocks with different time) -[2]: https://en.wikipedia.org/wiki/Pi_Day -[3]: https://opensource.com/tags/raspberry-pi -[4]: https://www.raspberrypi.org/products/raspberry-pi-zero-w/ -[5]: https://opensource.com/article/21/3/troubleshoot-wifi-go-raspberry-pi -[6]: https://www.waveshare.com/product/displays/e-paper.htm -[7]: https://www.raspberrypi.org/software/operating-systems/ -[8]: https://pypi.org/project/Pillow/ -[9]: https://www.waveshare.com/wiki/2.13inch_e-Paper_HAT -[10]: https://www.waveshare.com/wiki/Libraries_Installation_for_RPi -[11]: https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL -[12]: https://github.com/clcollins/epaper-pi-ex/blob/main/countdown.py -[13]: https://github.com/clcollins/epaper-pi-ex/ -[14]: https://opensource.com/sites/default/files/uploads/pie.png (drawing of a piece of pie) -[15]: https://creativecommons.org/licenses/by-sa/4.0/ -[16]: https://opensource.com/sites/default/files/uploads/piday_countdown.gif (Pi Day Countdown Timer In Action) -[17]: https://wiki.archlinux.org/index.php/systemd/User -[18]: https://github.com/clcollins/epaper-pi-ex/blob/main/piday.service diff --git a/sources/tech/20210405 How different programming languages do the same thing.md b/sources/tech/20210405 How different programming languages do the same thing.md deleted file mode 100644 index 01085f7526..0000000000 --- a/sources/tech/20210405 How different programming languages do the same thing.md +++ /dev/null @@ -1,372 +0,0 @@ -[#]: subject: (How different programming languages do the same thing) -[#]: via: (https://opensource.com/article/21/4/compare-programming-languages) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) -[#]: collector: (lujun9972) -[#]: translator: (VeryZZJ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How different programming languages do the same thing -====== -Compare 13 different programming languages by writing a simple game. -![Developing code.][1] - -Whenever I start learning a new programming language, I focus on defining variables, writing a statement, and evaluating expressions. Once I have a general understanding of those concepts, I can usually figure out the rest on my own. Most programming languages have some similarities, so once you know one programming language, learning the next one is a matter of figuring out the unique details and recognizing the differences. - -To help me practice a new programming language, I like to write a few test programs. One sample program I often write is a simple "guess the number" game, where the computer picks a number between one and 100 and asks me to guess it. The program loops until I guess correctly. This is a very simple program, as you can see using pseudocode like this: - -* The computer picks a random number between 1 and 100 -* Loop until I guess the random number - + The computer reads my guess - + It tells me if my guess is too low or too high - -Recently, Opensource.com ran an article series that wrote this program in different languages. This was an interesting opportunity to compare how to do the same thing in each language. I also found that most programming languages do things similarly, so learning the next programming language is mostly about learning its differences. - -C is an early general-purpose programming language, created in 1972 at Bell Labs by Dennis Ritchie. C proved popular and quickly became a standard programming language on Unix systems. Because of its popularity, many other programming languages adopted a similar programming syntax. That's why learning C++, Rust, Java, Groovy, JavaScript, awk, or Lua is easier if you already know how to program in C. - -For example, look at how these different programming languages implement the major steps in the "guess the number" game. I'll skip some of the surrounding code, such as assigning temporary variables, to focus on how the basics are similar or different. - -### The computer picks a random number between one and 100 - -You can see a lot of similarities here. Most of the programming languages generate a random number with a function like `rand()` that you can put into a range on your own. Other languages use a special function where you can specify the range for the random value. - -C -```c -// Using the Linux `getrandom` system call -getrandom(&randval, sizeof(int), GRND_NONBLOCK); -number = randval % maxval + 1; - -// Using the standard C library -number = rand() % 100 + 1; -``` - -C++ -```cpp -int number = rand() % 100+1; -``` - -Rust -```rust -let random = rng.gen_range(1..101); -``` - -Java -```java -private static final int NUMBER = r.nextInt(100) + 1; -``` - -Groovy -```groovy -int randomNumber = (new Random()).nextInt(100) + 1 -``` - -JavaScript -```javascript -const randomNumber = Math.floor(Math.random() * 100) + 1 -``` - -awk -```awk -randomNumber = int(rand() * 100) + 1 -``` - -Lua -```lua -number = math.random(1,100) -``` - -### Loop until I guess the random number - -Loops are usually done with a flow-control block such as `while` or `do-while`. The JavaScript implementation doesn't use a loop and instead updates the HTML page "live" until the user guesses the correct number. Awk supports loops, but it doesn't make sense to loop to read input because awk is based around data pipelines, so it reads input from a file instead of directly from the user.  - -C -```c -do { - … -} while (guess != number); -``` - -C++ -```cpp -do { - … -} while ( number != guess ); -``` - -Rust -```rust -for line in std::io::stdin().lock().lines() { - … - break; -} -``` - -Java -```java -while ( guess != NUMBER ) { - … -} -``` - -Groovy -```groovy -while ( … ) { - … - break; -} -``` - -Lua -```lua -while ( player.guess ~= number ) do - … -end -``` - -### The computer reads my guess - -Different programming languages handle input differently. So there's some variation here. For example, JavaScript reads values directly from an HTML form, and awk reads data from its data pipeline. - -C -```c -scanf("%d", &guess); -``` - -C++ -```cpp -cin >> guess; -``` - -Rust -```rust -let parsed = line.ok().as_deref().map(str::parse::); -if let Some(Ok(guess)) = parsed { - … -} -``` - -Java -```java -guess = player.nextInt(); -``` - -Groovy -```groovy -response = reader.readLine() -int guess = response as Integer -``` - -JavaScript -```javascript -let myGuess = guess.value -``` - -awk -```awk -guess = int($0) -``` - -Lua -```lua -player.answer = io.read() -player.guess = tonumber(player.answer) -``` - -### Tell me if my guess is too low or too high - -Comparisons are fairly consistent across these C-like programming languages, usually through an `if` statement. There's some variation in how each programming language prints output, but the print statement remains recognizable across each sample. - -C -```c -if (guess < number) { - puts("Too low"); -} -else if (guess > number) { - puts("Too high"); -} -… -puts("That's right!"); -``` - -C++ -```cpp -if ( guess > number) { cout << "Too high.\n" << endl; } -else if ( guess < number ) { cout << "Too low.\n" << endl; } -else { - cout << "That's right!\n" << endl; - exit(0); -} -``` - -Rust -```rust -_ if guess < random => println!("Too low"), -_ if guess > random => println!("Too high"), -_ => { - println!("That's right"); - break; -} -``` - -Java -```java -if ( guess > NUMBER ) { - System.out.println("Too high"); -} else if ( guess < NUMBER ) { - System.out.println("Too low"); -} else { - System.out.println("That's right!"); - System.exit(0); -} -``` - -Groovy -```groovy -if (guess < randomNumber) - print 'too low, try again: ' -else if (guess > randomNumber) - print 'too high, try again: ' -else { - println "that's right" - break -} -``` - -JavaScript -```javascript -if (myGuess === randomNumber) { - feedback.textContent = "You got it right!" -} else if (myGuess > randomNumber) { - feedback.textContent = "Your guess was " + myGuess + ". That's too high. Try Again!" -} else if (myGuess < randomNumber) { - feedback.textContent = "Your guess was " + myGuess + ". That's too low. Try Again!" -} -``` - -awk -```awk -if (guess < randomNumber) { - printf "too low, try again:" -} else if (guess > randomNumber) { - printf "too high, try again:" -} else { - printf "that's right\n" - exit -} -``` - -Lua -```lua -if ( player.guess > number ) then - print("Too high") -elseif ( player.guess < number) then - print("Too low") -else - print("That's right!") - os.exit() -end -``` - -### What about non-C-based languages? - -Programming languages that are not based on C can be quite different and require learning specific syntax to do each step. Racket derives from Lisp and Scheme, so it uses Lisp's prefix notation and lots of parentheses. Python uses whitespace rather than brackets to indicate blocks like loops. Elixir is a functional programming language with its own syntax. Bash is based on the Bourne shell from Unix systems, which itself borrows from Algol68—and supports additional shorthand notation such as `&&` as a variation of "and." Fortran was created when code was entered using punched cards, so it relies on an 80-column layout where some columns are significant. - -As an example of how these other programming languages can differ, I'll compare just the "if" statement that sees if one value is less than or greater than another and prints an appropriate message to the user. - -Racket -```racket -(cond [(> number guess) (displayln "Too low") (inquire-user number)] - [(< number guess) (displayln "Too high") (inquire-user number)] - [else (displayln "Correct!")])) -``` - -Python -```python -if guess < random: - print("Too low") -elif guess > random: - print("Too high") -else: - print("That's right!") -``` - -Elixir -```elixir -cond do - guess < num -> - IO.puts "Too low!" - guess_loop(num) - guess > num -> - IO.puts "Too high!" - guess_loop(num) - true -> - IO.puts "That's right!" -end -``` - -Bash -```bash -[ "0$guess" -lt $number ] && echo "Too low" -[ "0$guess" -gt $number ] && echo "Too high" -``` - -Fortran -```fortran -IF (GUESS.LT.NUMBER) THEN - PRINT *, 'TOO LOW' -ELSE IF (GUESS.GT.NUMBER) THEN - PRINT *, 'TOO HIGH' -ENDIF -``` - -### Read more - -This "guess the number" game is a great introductory program when learning a new programming language because it exercises several common programming concepts in a pretty straightforward way. By implementing this simple game in different programming languages, you can demonstrate some core concepts and compare each language's details. - -Learn how to write the "guess the number" game in C and C-like languages: - -* [C][2], by Jim Hall -* [C++][3], by Seth Kenlon -* [Rust][4], by Moshe Zadka -* [Java][5], by Seth Kenlon -* [Groovy][6], by Chris Hermansen -* [JavaScript][7], by Mandy Kendall -* [awk][8], by Chris Hermansen -* [Lua][9], by Seth Kenlon - -And in non-C-based languages: - -* [Racket][10], by Cristiano L. Fontana -* [Python][11], by Moshe Zadka -* [Elixir][12], by Moshe Zadka -* [Bash][13], by Jim Hall -* [Fortran][14], by Jim Hall - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/compare-programming-languages - -作者:[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/code_development_programming.png?itok=M_QDcgz5 (Developing code.) -[2]: https://opensource.com/article/21/1/learn-c -[3]: https://opensource.com/article/20/12/learn-c-game -[4]: https://opensource.com/article/20/12/learn-rust -[5]: https://opensource.com/article/20/12/learn-java -[6]: https://opensource.com/article/20/12/groovy -[7]: https://opensource.com/article/21/1/learn-javascript -[8]: https://opensource.com/article/21/1/learn-awk -[9]: https://opensource.com/article/20/12/lua-guess-number-game -[10]: https://opensource.com/article/21/1/racket-guess-number -[11]: https://opensource.com/article/20/12/learn-python -[12]: https://opensource.com/article/20/12/elixir -[13]: https://opensource.com/article/20/12/learn-bash -[14]: https://opensource.com/article/21/1/fortran diff --git a/sources/tech/20210503 Learn the Lisp programming language in 2021.md b/sources/tech/20210503 Learn the Lisp programming language in 2021.md deleted file mode 100644 index a1de95ead8..0000000000 --- a/sources/tech/20210503 Learn the Lisp programming language in 2021.md +++ /dev/null @@ -1,305 +0,0 @@ -[#]: subject: (Learn the Lisp programming language in 2021) -[#]: via: (https://opensource.com/article/21/5/learn-lisp) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Learn the Lisp programming language in 2021 -====== -A lot of Lisp code lurks inside big codebases, so it's smart to get -familiar with the language. -![Woman sitting in front of her laptop][1] - -Lisp was invented in 1958, which makes it the second-oldest computer programming language. It has spawned several modern derivatives, including Common Lisp, Emacs Lisp (Elisp), Clojure, Racket, Scheme, Fennel, and GNU Guile. - -People who love thinking about the design of programming languages often love Lisp because of how its syntax and data share the same structure: Lisp code is essentially a list of lists, and its name is an acronym for _LISt Processing_. People who love thinking about the aesthetics of programming languages often hate Lisp because of its frequent use of parentheses for scoping; in fact, it's a common joke that Lisp stands for _Lots of Irritating Superfluous Parentheses_. - -Whether you love or hate its design philosophies, Lisp is an interesting glimpse at the past and, thanks to Clojure and Guile, into the future. You might be surprised how much Lisp code there is lurking within big codebases in any given industry, so it's a good idea to have at least a passing familiarity with the language. - -### Install Lisp - -There are many implementations of Lisp. Popular open source versions include [SBCL][2] and [GNU Common Lisp][3] (GCL). You can install either of these with your distribution's package manager. - -On Fedora Linux: - - -``` -`$ sudo dnf install gcl` -``` - -On Debian: - - -``` -`$ sudo apt install gcl` -``` - -For macOS, you can use [MacPorts][4] or [Homebrew][5]: - - -``` -`$ sudo port install gcl` -``` - -For Windows, download a binary from [gnu.org/software/gcl][6]. - -For this article, I'm using GCL and its `clisp` command, but most of the principles apply to any Lisp. - -### List processing - -The basic unit of Lisp source code is an _expression_, which is written as a list. For instance, this is a list of an operator (`+`) and two integers (`1` and `2`): - - -``` -`(+ 1 2)` -``` - -It's also a Lisp expression, using a symbol (`+`) that evaluates to a function (addition) and two arguments (`1` and `2`). You can run this expression and others in an interactive Common Lisp environment called REPL (read-eval-print loop). If you're familiar with Python's IDLE, Lisp's REPL should feel somewhat familiar to you. - -To launch a REPL, launch Common Lisp: - - -``` -$ clisp -[1]> -``` - -At the REPL prompt, type a few expressions: - - -``` -[1]> (+ 1 2) -3 -[2]> (- 1 2) --1 -[3]> (- 2 1) -1 -[4]> (+ 2 3 4) -9 -``` - -### Functions - -Now that you know the basic structure of a Lisp expression, you can utilize Lisp functions in useful ways. The `print` function takes any argument you provide and displays it on your terminal, while the `pprint` function "pretty" prints it. There are other variations on the print function, but `pprint` is nice in REPL: - - -``` -[1]> (pprint "hello world") - -"hello world" - -[2]> -``` - -You can create your own functions with `defun`. The `defun` function requires a name for your function and any parameters you want your function to accept: - - -``` -[1]> (defun myprinter (s) (pprint s)) -MYPRINTER -[2]> (myprinter "hello world") - -"hello world" - -[3]> -``` - -### Variables - -You can create variables in Lisp with `setf`: - - -``` -[1]> (setf foo "hello world") -"hello world" -[2]> (pprint foo) - -"hello world" - -[3]> -``` - -You can nest expressions within expressions in a kind of pipeline. For instance, you can pretty print the contents of your variable after invoking the `string-upcase` function to convert its characters to uppercase: - - -``` -[3]> (pprint (string-upcase foo)) - -"HELLO WORLD" - -[4]> -``` - -Lisp is dynamically typed in the sense that you don't have to declare variable types when setting them. Lisp treats integers as integers by default: - - -``` -[1]> (setf foo 2) -[2]> (setf bar 3) -[3]> (+ foo bar) -5 -``` - -If you intend for an integer to be interpreted as a string, you can quote it: - - -``` -[4]> (setf foo "2")                                                                                                                       -"2"                                                                                                                                       -[5]> (setf bar "3")                                                                                                                       -"3" -[6]> (+ foo bar) - -*** - +: "2" is not a number -The following restarts are available: -USE-VALUE      :R1      Input a value to be used instead. -ABORT          :R2      Abort main loop -Break 1 [7]> -``` - -In this sample REPL session, both `foo` and `bar` are set to quoted numbers, so Lisp interprets them as strings. Math operators can't be used on strings, so REPL drops into a debugger mode. To get out of the debugger, press **Ctrl+D** on your keyboard. - -You can do some introspection on objects using the `typep` function, which tests for a specific data type. The tokens `T` and `NIL` represent _True_ and _False_, respectively. - - -``` -[4]> (typep foo 'string) -NIL -[5]> (typep foo 'integer) -T -``` - -The single quote (`'`) before `string` and `integer` prevents Lisp from (incorrectly) evaluating those keywords as variables: - - -``` -[6]> (typep foo string) -*** - SYSTEM::READ-EVAL-PRINT: variable STRING has no value -[...] -``` - -It's a shorthand way to protect the terms, normally done with the `quote` function: - - -``` -[7]> (typep foo (quote string)) -NIL -[5]> (typep foo (quote integer)) -T -``` - -### Lists - -Unsurprisingly, you can also create lists in Lisp: - - -``` -[1]> (setf foo (list "hello" "world")) -("hello" "world") -``` - -Lists can be indexed with the `nth` function: - - -``` -[2]> (nth 0 foo) -"hello" -[3]> (pprint (string-capitalize (nth 1 foo))) - -"World" -``` - -### Exiting REPL - -To end a REPL session, press **Ctrl+D** on your keyboard, or use the `quit` keyword in Lisp: - - -``` -[99]> (quit) -$ -``` - -### Scripting - -Lisp can be compiled or used as an interpreted scripting language. The latter is probably the easiest option when you're starting, especially if you're already familiar with Python or [shell scripting][7]. - -Here's a simple dice roller script written in GNU Common Lisp: - - -``` -#!/usr/bin/clisp - -(defun roller (num)   -  (pprint (random (parse-integer (nth 0 num)))) -) - -(setf userput *args*) -(setf *random-state* (make-random-state t)) -(roller userput) -``` - -The first line tells your [POSIX][8] terminal what executable to use to run the script. - -The `roller` function, created with `defun`, uses the `random` function to print a pseudo-random number up to, and not including, the zeroth item of the `num` list. The `num` list hasn't been created yet in the script, but the function doesn't get executed until it's called. - -The next line assigns any argument provided to the script at launch time to a variable called `userput`. The `userput` variable is a list, and it's what becomes `num` once it's passed to the `roller` function. - -The penultimate line of the script starts a _random seed_. This provides Lisp with enough entropy to generate a mostly random number. - -The final line invokes the custom `roller` function, providing the `userput` list as its sole argument. - -Save the file as `dice.lisp` and mark it executable: - - -``` -`$ chmod +x dice.lisp` -``` - -Finally, try running it, providing it with a maximum number from which to choose its random number: - - -``` -$ ./dice.lisp 21 - -13 -$ ./dice.lisp 21 - -7 -$ ./dice.lisp 21 - -20 -``` - -Not bad! - -### Learn Lisp - -Whether you can imagine using Lisp as a utilitarian language for personal scripts, to advance your career, or just as a fun experiment, you can see some particularly inventive uses at the annual [Lisp Game Jam][9] (most submissions are open source, so you can view the code to learn from what you play). - -Lisp is a fun and unique language with an ever-growing developer base and enough historic and emerging dialects to keep programmers from all disciplines happy. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/learn-lisp - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_4.png?itok=VGZO8CxT (Woman sitting in front of her laptop) -[2]: http://sbcl.org -[3]: https://www.gnu.org/software/gcl/ -[4]: https://opensource.com/article/20/11/macports -[5]: https://opensource.com/article/20/6/homebrew-linux -[6]: http://mirror.lagoon.nc/gnu/gcl/binaries/stable -[7]: https://opensource.com/article/20/4/bash-programming-guide -[8]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains -[9]: https://itch.io/jam/spring-lisp-game-jam-2021 diff --git a/sources/tech/20210630 9 reasons I love to use the Qt Creator IDE.md b/sources/tech/20210630 9 reasons I love to use the Qt Creator IDE.md index 44a5b4ad73..e542de2f38 100644 --- a/sources/tech/20210630 9 reasons I love to use the Qt Creator IDE.md +++ b/sources/tech/20210630 9 reasons I love to use the Qt Creator IDE.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/qtcreator) [#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (hadisi1993) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210722 Write your first JavaScript code.md b/sources/tech/20210722 Write your first JavaScript code.md deleted file mode 100644 index d02ca214cd..0000000000 --- a/sources/tech/20210722 Write your first JavaScript code.md +++ /dev/null @@ -1,204 +0,0 @@ -[#]: subject: (Write your first JavaScript code) -[#]: via: (https://opensource.com/article/21/7/javascript-cheat-sheet) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Write your first JavaScript code -====== -JavaScript was created for the web, but it can do so much more. Learn -the basics, then download our cheat sheet so you always have the details -at hand. -![Code with javascript on white background][1] - -JavaScript is a programming language full of pleasant surprises. Many people first encounter JavaScript as a language for the web. There's a JavaScript engine in all the major browsers, there are popular frameworks such as JQuery, Cash, and Bootstrap to help make web design easier, and there are even programming environments written in JavaScript. It seems to be everywhere on the internet, but it turns out that it's also a useful language for projects like [Electron][2], an open source toolkit for building cross-platform desktop apps with JavaScript. - -JavaScript is a surprisingly multipurpose language with a wide assortment of libraries for much more than just making websites. Learning the basics of the language is easy, and it's a gateway to building whatever you imagine. - -### Install JavaScript - -As you progress with JavaScript, you may find yourself wanting advanced JavaScript libraries and runtimes. When you're just starting, though, you don't have to install JavaScript at all. All major web browsers include a JavaScript engine to run the code. You can write JavaScript using your favorite text editor, load it into your web browser, and see what your code does. - -### Get started with JavaScript - -To write your first JavaScript code, open your favorite text editor, such as [Notepad++][3], [Atom][4], or [VSCode][5]. Because it was developed for the web, JavaScript works well with HTML, so first, just try some basic HTML: - - -``` -<[html][6]> -  <[head][7]> -    <[title][8]>JS</[title][8]> -  </[head][7]> -  <[body][9]> -    <[p][10] id="example">Nothing here.</[p][10]> -  </[body][9]> -</[html][6]> -``` - -Save the file, and then open it in a web browser. - -![HTML displayed in browser][11] - -(Seth Kenlon, [CC BY-SA 4.0][12]) - -To add JavaScript to this simple HTML page, you can either create a JavaScript file and refer to it in the page's `head` or just embed your JavaScript code in the HTML using the ` + +  + +``` + +在浏览器中重新加载页面。 + +![在浏览器中显示带有 JavaScript 的 HTML][7] + +如你所见,`

` 标签仍然包含字符串 “Nothing here”,但是当它被渲染时,JavaScript 会改变它,使其包含 “Hello world”。是的,JavaScript 具有重建​​(或只是帮助构建)网页的能力。 + +这个简单脚本中的 JavaScript 做了两件事。首先,它创建一个名为 `myvariable` 的变量,并将字符串 “Hello world!” 放置其中。然后,它会在当前文档(浏览器呈现的网页)中搜索 ID 为 “example” 的所有 HTML 元素。当它找到 `example` 时,它使用了 `innerHTML` 函数将 HTML 元素的内容替换为 `myvariable` 的内容。 + +当然,我们也可以不用自定义变量。因为,使用动态创建的内容来填充 HTML 元素也是容易的。例如,你可以使用当前时间戳来填充它: + +``` + +  +    JS +  +  +   

Date and time appears here.

+ +    +    +  + +``` + +重新加载页面,你就可以看到在呈现页面时生成的时间戳。再重新加载几次,你可以观察到秒数会不断增加。 + +### JavaScript 语法 + +在编程中,语法syntax 指的是如何编写句子(或“行”)的规则。在 JavaScript 中,每行代码必须以分号(`;`)结尾,以便运行代码的 JavaScript 引擎知道何时停止阅读。(LCTT 译注:从实用角度看,此处的“必须”其实是不正确的,大多数 JS 引擎都支持不加分号。Vue.js 的作者尤雨溪认为“没有应该不应该,只有你自己喜欢不喜欢”,他同时表示,“Vue.js 的代码全部不带分号”。详情可以查看他在知乎上对于此问题的 [回答][10]。) + +单词(或 “字符串”strings)必须用引号(`"`)括起来,而数字(或 “整数”integers)则不用。 + +几乎所有其他东西都是 JavaScript 语言的约定,例如变量、数组、条件语句、对象、函数等等。 + +### 在 JavaScript 中创建变量 + +变量是数据的容器。你可以将变量视为一个盒子,你在其中放置数据,以便与程序的其他部分共享它。要在 JavaScript 中创建变量,你可以选用关键字 `let` 和 `var` 中的一个,请根据你打算如何使用变量来选择:`var` 关键字用于创建一个供整个程序使用的变量,而 `let` 只为特定目的创建变量,通常在函数或循环的内部使用。(LCTT 译注:还有 `const` 关键字,它用于创建一个常量。) + +JavaScript 内置的 `typeof` 函数可以帮助你识别变量包含的数据的类型。使用第一个示例,你可以修改显示文本,来显示 `myvariable` 包含的数据的类型: + +``` + +let myvariable = "Hello world!"; +document.getElementById("example").innerHTML = typeof(myvariable); + +``` + +接着,你就会发现 Web 浏览器中显示出 “string” 字样,因为该变量包含的数据是 “Hello world!”。在 `myvariable` 中存储不同类型的数据(例如整数),浏览器就会把不同的数据类型打印到示例网页上。尝试将 `myvariable` 的内容更改为你喜欢的数字,然后重新加载页面。 + +### 在 JavaScript 中创建函数 + +编程中的函数是独立的数据处理器。正是它们使编程得以 *模块化*。因为函数的存在,程序员可以编写通用库,例如​​,调整图像大小或统计时间花费的库,以供其他和你一样的程序员在他们的代码中使用。 + +要创建一个函数,你可以为函数提供一个自定义名称,后面跟着用大括号括起来的、任意数量的代码。 + +下面是一个简单的网页,其中包含了一个剪裁过的图像,还有一个分析图像并返回真实图像尺寸的按钮。在这个示例代码中,` +    +    +   
+      +   
+    +    +    +  + +``` + +保存这个文件,并将其加载到 Web 浏览器中以尝试这段代码。 + +![自定义的 get_size 函数返回了图像尺寸][8] + +### 使用 JavaScript 的跨平台应用程序 + +你可以从代码示例中看到,JavaScript 和 HTML 紧密协作,从而创建了有凝聚力的用户体验。这是 JavaScript 的一大优势。当你使用 JavaScript 编写代码时,你继承了现代计算中最常见的用户界面之一,而它与平台无关,那就是 Web 浏览器。你的代码本质上是跨平台的,因此你的应用程序,无论是简单的图像大小分析器还是复杂的图像编辑器、视频游戏,或者你梦想的任何其他东西,都可以被所有人使用,无论是通过 Web 浏览器,还是桌面(如果你同时提供了一个 Electron 应用)。 + +学习 JavaScript 既简单又有趣。网络上有很多网站提供了相关教程,还有超过一百万个 JavaScript 库可帮助你与设备、外围设备、物联网、服务器、文件系统等进行交互。在你学习的过程中,请将我们的 [JavaScript 备忘单][9] 放在身边,以便记住语法和结构的细节。 + +正文中的配图来自:Seth Kenlon,CC BY-SA 4.0 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/javascript-cheat-sheet + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/code2.png +[2]: https://www.electronjs.org/ +[3]: https://opensource.com/article/16/12/notepad-text-editor +[4]: https://opensource.com/article/20/12/atom +[5]: https://opensource.com/article/20/6/open-source-alternatives-vs-code +[6]: https://opensource.com/sites/default/files/pictures/plain-html.jpg +[7]: https://opensource.com/sites/default/files/uploads/html-javascript.jpg +[8]: https://opensource.com/sites/default/files/uploads/get-size.jpg +[9]: https://opensource.com/downloads/javascript-cheat-sheet +[10]: https://www.zhihu.com/question/20298345/answer/49551142 diff --git a/translated/tech/20220607 How Garbage Collection works inside a Java Virtual Machine.md b/translated/tech/20220607 How Garbage Collection works inside a Java Virtual Machine.md new file mode 100644 index 0000000000..e102895b7c --- /dev/null +++ b/translated/tech/20220607 How Garbage Collection works inside a Java Virtual Machine.md @@ -0,0 +1,157 @@ +[#]: subject: "How Garbage Collection works inside a Java Virtual Machine" +[#]: via: "https://opensource.com/article/22/6/garbage-collection-java-virtual-machine" +[#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +JVM 垃圾回收的工作原理 +====== +对于程序员来说,掌握 Java 的内存管理机制并不是必须的,但它能够帮助你更好地理解 JVM 是如何处理程序中的变量和类实例的。 + +![咖啡豆][1] + +图源:Pixabay. CC0. + +Java 之所以能够如此流行,自动 垃圾回收Garbage Collection(GC)功不可没,它也是 Java 最重要的几个特性之一。在这篇文章中,我将说明为什么垃圾回收如此重要。本文的主要内容为:自动的分代垃圾回收、JVM 划分内存的依据,以及 JVM 垃圾回收的工作原理。 + +### Java 内存分配 + +Java 程序的内存空间被划分为以下四个区域: + +1. 堆区(Heap):对象实例就是在这个区域分配的。不过,当我们声明一个对象时,堆中不会有任何内存分配发生,只是在栈中创建了一个对象的引用而已。 +2. 栈区(Stack):方法、局部变量和类的实例变量就是在这个区域分配的。 +3. 代码区(Code):这个区域存放了程序的字节码。 +4. 静态区(Static):这个区域存放了程序的静态数据和静态方法。 + +### 什么是自动垃圾回收? + +自动垃圾回收是这样一个过程:首先,堆中的所有对象会被分类为“被引用的”和“未被引用的”;接着,“未被引用的对象”就会被做上标记,以待之后删除。其中,“被引用的对象”是指程序中的某一部分仍在使用的对象,“未被引用的对象”是指目前没有正在被使用的对象。 + +许多编程语言,例如 C 和 C++,都需要程序员手动管理内存的分配和释放。在 Java 中,这一过程是通过垃圾回收机制来自动完成的(尽管你也可以在代码中调用 `system.gc();` 来手动触发垃圾回收)。 + +垃圾回收的基本步骤如下: + +#### 1. 标记已使用和未使用的对象 + +在这一步骤中,已使用和未使用的对象会被分别做上标记。这是一个及其耗时的过程,因为需要扫描内存中的所有对象,才能够确定它们是否正在被使用。 + +![标记已使用和未使用的对象][2] + +#### 2. 扫描/删除对象 + +有两种不同的扫描和删除算法: + +**简单删除(标记清除)**:它的过程很简单,我们只需要删除未被引用的对象即可。但是,后续给新对象分配内存就会变得很困难了,因为可用空间被分割成了一块块碎片。 + +![标记清除的过程][3] + +**删除压缩(标记整理)**:除了会删除未被引用的对象,我们还会压缩被引用的对象(未被删除的对象)。这样以来,新对象的内存分配就相对容易了,并且内存分配的效率也有了提升。 + +![标记整理的过程][4] + +### 什么是分代垃圾回收,为什么需要它? + +正如我们在“扫描删除”模型中所看到的,一旦对象不断增长,我们就很难扫描所有未使用的对象以回收内存。不过,有一项实验性研究指出,在程序执行期间创建的大多数对象,它们的存活时间都很短。 + +既然大多数对象的存活时间都很短,那么我们就可以利用这个事实,从而提升垃圾回收的效率。该怎么做呢?首先,JVM 将内存划分为不同的“代”。接着,它将所有的对象都分类到这些内存“代”中,然后对这些“代”分别执行垃圾回收。这就是“分代垃圾回收”。 + +### 堆内存的“代”和分代垃圾回收过程 + +为了提升垃圾回收中的“标记清除”的效率,JVM 将对内存划分成以下三个“代”: + +* 年轻代 +* 老年代 +* 永久代 + +![Hotspot 堆内存结构][5] + +下面我将介绍每个“代”及其主要特征。 + +#### 年轻代 + +所有创建不久的对象都存放在这里。年轻代被进一步分为以下两个区域: + +1. 伊甸区(Eden):所有新创建的对象都在此处分配内存。 +2. 幸存者区(Survivor,分为 S0 和 S1):经历过一次垃圾回收后,仍然存活的对象会被移动到两个幸存者区中的一个。 + +![对象分配][6] + +在年轻代发生的分代垃圾回收被称为 “Minor GC”。Minor GC 过程中的每个阶段都是“停止世界Stop The World”(STW)的,这会导致其他应用程序暂停运行,直到垃圾回收结束。这也是 Minor GC 更快的原因。 + +一句话总结:伊甸区存放了所有新创建的对象,当它的可用空间被耗尽,第一次垃圾回收就会被触发。 + +![填充伊甸区][7] + +Minor GC:在该垃圾回收过程中,所有存活和死亡的对象都会被做上标记。其中,存活对象会被移动到 S0 幸存者区。当所有存活对象都被移动到了 S0,未被引用的对象就会被删除。 + +![拷贝被引用的对象][8] + +S0 中的对象年龄为 1,因为它们挺过了一次 Minor GC。此时,伊甸区和 S1 都是空的。 + +每当完成清理后,伊甸区就会再次接受新的存活对象。随着时间的推移,伊甸区和 S0 中的某些对象被宣判死亡(不再被引用),并且伊甸区的可用空间也再次耗尽(填满了),那么 Minor GC 又将再次被触发。 + +![对象年龄增长][9] + +这一次,伊甸区和 S0 中的死亡和存活的对象会被做上标记。其中,伊甸区的存活对象会被移动到 S1,并且年龄增加至 1。S0 中的存活对象也会被移动到 S1,并且年龄增加至 2(因为它们挺过了两次 Minor GC)。此时,伊甸区和 S0 又是空的了。每次 Minor GC 之后,伊甸区和两个幸存者区中的一个都会是空的。 + +新对象总是在伊甸区被创建,周而复始。当下一次垃圾回收发生时,伊甸区和 S1 都会被清理,它们中的存活对象会被移动到 S0 区。每次 Minor GC 之后,这两个幸存者区(S0 和 S1)就会交换一次。 + +![额外年龄增长][10] + +这个过程会一直进行下去,直到某个存活对象的年龄达到了某个阈值,然后它就会被移动到一个叫做“老年代”的地方,这是通过一个叫做“晋升”的过程来完成的。 + +使用 `-Xmn` 选项可以设置年轻代的大小。 + +### 老年代 + +这个区域存放着那些挺过了许多次 Minor GC,并且达到了某个年龄阈值的对象。 + +![晋升][11] + +在上面这个示例图表中,晋升的年龄阈值为 8。在老年代发生的垃圾回收被称为 “Major GC”。 + +使用 `-Xms` 和 `-Xmx` 选项可以分别设置堆内存大小的初始值和最大值。(LCTT 译注:结合上面的 `-Xmn` 选项,就可以间接设置老年代的大小了。) + +### 永久代 + +永久代存放着一些元数据,它们与应用程序、Java 标准环境以及 JVM 自用的库类及其方法相关。JVM 会在运行时,用到了什么类和方法,就会填充相应的数据。当 JVM 发现有未使用的类,就会卸载或是回收它们,从而为正在使用的类腾出空间。 + +使用 `-XX:PermGen` 和 `-XX:MaxPerGen` 选项可以分别设置永久代大小的初始值和最大值。 + +#### 元空间 + +Java 8 引入了元空间,并用它替换了永久代。这么做的好处是自动调整大小,避免了 内存不足OutOfMemory(OOM)错误。 + +### 总结 + +本文讨论了各种不同的 JVM 内存“代”,以及它们是如何在分代垃圾回收算法中起作用的。对于程序员来说,掌握 Java 的内存管理机制并不是必须的,但它能够帮助你更好地理解 JVM 处理程序中的变量和类实例的方式。这种理解使你能够规划和排除代码故障,并理解特定平台固有的潜在限制。 + +正文配图来自:Jayashree Huttanagoudar,CC BY-SA 4.0 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/garbage-collection-java-virtual-machine + +作者:[Jayashree Huttanagoudar][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jayashree-huttanagoudar +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/java-coffee-beans.jpg +[2]: https://opensource.com/sites/default/files/2022-06/1Marking.png +[3]: https://opensource.com/sites/default/files/2022-06/2NormalDeletion.png +[4]: https://opensource.com/sites/default/files/2022-06/3DeletionwithCompacting.png +[5]: https://opensource.com/sites/default/files/2022-06/4Hotspot.png +[6]: https://opensource.com/sites/default/files/2022-06/5ObjAllocation.png +[7]: https://opensource.com/sites/default/files/2022-06/6FillingEden.png +[8]: https://opensource.com/sites/default/files/2022-06/7CopyingRefdObjs.png +[9]: https://opensource.com/sites/default/files/2022-06/8ObjAging.png +[10]: https://opensource.com/sites/default/files/2022-06/9AddlAging.png +[11]: https://opensource.com/sites/default/files/2022-06/10Promotion.png diff --git a/translated/tech/20220607 How to Boot Ubuntu 22.04 into Rescue - Emergency Mode.md b/translated/tech/20220607 How to Boot Ubuntu 22.04 into Rescue - Emergency Mode.md new file mode 100644 index 0000000000..86f542b747 --- /dev/null +++ b/translated/tech/20220607 How to Boot Ubuntu 22.04 into Rescue - Emergency Mode.md @@ -0,0 +1,85 @@ +[#]: subject: "How to Boot Ubuntu 22.04 into Rescue / Emergency Mode" +[#]: via: "https://www.linuxtechi.com/boot-ubuntu-22-04-rescue-emergency-mode/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何启动 Ubuntu 22.04 进入救援/紧急模式 +====== +极客们好,将 Ubuntu 22.04(Jammy Jellyfish)启动到救援和紧急模式有助于重置忘记的用户密码,修复文件系统错误以及在启动过程中禁用或启用 systemd 服务。 + +在这篇文章中,我们将学习如何启动 Ubuntu 22.04 LTS 系统进入救援和应急模式。救援模式类似于单用户模式,所有的故障排除步骤都在这里进行。救援模式加载最小的环境并挂载根文件系统。 + +而在紧急模式下,我们得到的是单用户 shell,而不启动任何系统服务。因此,当我们无法启动系统进入救援模式时,就需要紧急模式。 + +### 启动 Ubuntu 22.04 进入救援或单用户模式 + +前往你想启动到救援或单用户模式的目标系统。在启动时按下 “SHIFT+ESC” 键,进入 grub bootloader 页面。 + +![Default-Grub-Screen-Ubuntu-22-04][1] + +选择第一个选项 Ubuntu,并按 “e” 键进入编辑模式。 + +在以 linux 开头的一行末尾,删除字符串 “$vt_handoff” 并添加字符串 “systemd.unit=rescue.target”。 + +![rescue-target-ubuntu-22-04][2] + +做完修改后,按 Ctrl+x 或 F10 在救援模式下启动。 + +![Troubleshooting-Commands-in-Rescue-Mode][3] + +进入救援模式后,运行所有的故障排除命令,并运行 “systemctl reboot” 命令来重启系统。 + +### 另一种启动系统进入救援模式的方法 + +重新启动系统并按下 “ESC+Shift” 键,进入 grub 启动界面。 + +选择第二个选项 “Advanced Options for Ubuntu”->选择恢复模式选项并点击回车->选择 Root(进入 root shell 提示)。 + +下面是一个例子 + +![Boot-Ubuntu-22-04-Rescue-Mode][4] + +当你有了 root shell,运行命令来恢复和修复系统问题,最后使用 “systemctl reboot” 来重启系统。 + +### 引导 Ubuntu 22.04 进入紧急模式 + +要启动系统进入紧急模式,首先进入 grub 页面。 + +![Default-Grub-Screen-Ubuntu-22-04][5] + +选择第一个选项 “Ubuntu” 并按 “e” 键进行编辑。寻找以 linux 开头的一行,移到该行的末尾,删除字符串 $vt_handoff 并添加字符串 “systemd.unit=emergency.target”。 + +![Emergency-Mode-Ubuntu-22-04][6] + +按 Ctrl+x 或 F10 将系统启动到紧急模式。 + +![Command-in-Emergency-Mode-Ubuntu-22-04][7] + +同样,在救援模式下,你可以在这个模式下执行所有的故障排除,完成后,就用 “systemctl reboot” 命令重启系统。 + +这篇文章的内容就这些。我发现它内容丰富,不要犹豫,在你的技术朋友中分享这个。请在下面的评论区发表你的疑问和反馈。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/boot-ubuntu-22-04-rescue-emergency-mode/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed +[1]: https://www.linuxtechi.com/wp-content/uploads/2022/06/Default-Grub-Screen-Ubuntu-22-04.png +[2]: https://www.linuxtechi.com/wp-content/uploads/2022/06/rescue-target-ubuntu-22-04.png +[3]: https://www.linuxtechi.com/wp-content/uploads/2022/06/Troubleshooting-Commands-in-Rescue-Mode.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/06/Boot-Ubuntu-22-04-Rescue-Mode.gif +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/06/Default-Grub-Screen-Ubuntu-22-04.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/06/Emergency-Mode-Ubuntu-22-04.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/06/Command-in-Emergency-Mode-Ubuntu-22-04.png diff --git a/translated/tech/20220609 Edit PDFs on Linux with these open source tools.md b/translated/tech/20220609 Edit PDFs on Linux with these open source tools.md new file mode 100644 index 0000000000..03ed204126 --- /dev/null +++ b/translated/tech/20220609 Edit PDFs on Linux with these open source tools.md @@ -0,0 +1,90 @@ + [#]: subject: "Edit PDFs on Linux with these open source tools" +[#]: via: "https://opensource.com/article/22/6/open-source-pdf-editors-linux" +[#]: author: "Michael Korotaev https://opensource.com/users/michaelk" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +用这些开源工具在 Linux 上编辑 PDF 文件 +====== +Adobe Acrobat 的开源替代品具有创建、编辑和注释 PDF 的所有必要功能。 + +![a checklist for a team][1] + +图片由:Opensource.com + +开源的 PDF 阅读和编辑工具通常比 “PDF 编辑器”搜索结果第一页中的应用更安全和可靠。在那里,你很可能看到带有隐藏限制和关税的专有应用,缺乏关于数据保护政策和托管的足够信息。你可以有更好的。 + +这里有五个应用,可以安装在你的 Linux 系统上(和其他系统)或托管在服务器上。每一个都是免费和开源的,具有创建、编辑和注释 PDF 文件的所有必要功能。 + +### LibreOffice + +使用 [LibreOffice][2] 套件,你对应用的选择取决于最初的任务。虽然文字处理器 LibreOffice Writer,可以让你创建 PDF 文件,并从 ODF 和其他文本格式导出,但 Draw 更适合于处理现有的 PDF 文件。 + +Draw 是用来创建和编辑图形文件的,如小册子、杂志和海报。因此,该工具集主要集中在视觉对象和布局上。然而,对于 PDF 编辑,当文件具有编辑属性时,LibreOffice Draw 提供了用于修改和添加 PDF 内容的工具。如果没有的话,你仍然可以在现有的内容层上添加新的文本字段,并对文件进行注释或完成。 + +Draw 和 Writer 都被捆绑在 LibreOffice 桌面套件中,可在 Linux 系统、macOS 和 Windows 上安装。 + +### ONLYOFFICE Docs + +ONLYOFFICE 一直在改进 PDF 的处理,并在 [ONLYOFFICE Docs][3] 的 7.1 版本中引入了一个全新的 PDF 和电子书的阅读器。 + +该文档编辑器允许从头开始创建 PDF 文件,使用 DOCX 作为文件的基础,然后可以转换为 PDF 或 PDF/A。通过内置的表单创建功能,ONLYOFFICE Docs 还可以建立可填充的文档模板,并将其导出为可编辑的 PDF,并为不同类型的内容设置可填充的字段:文本、图像、日期等。 + +除了可以识别 PDF 内的文本进行复制和提取外,ONLYOFFICE Docs 还可以将 PDF 转换为 DOCX,这样你就可以继续使用完全可编辑的文本格式的文件。ONLYOFFICE 还可以让你用密码保护文件,添加水印,并使用桌面版中的数字签名。 + +ONLYOFFICE Docs 可以作为一个网络套件(内部或云端)集成到文档管理系统(DMS)或作为一个独立的桌面应用程序使用。你可以将后者作为 DEB 或 RPM 文件、AppImage、Flatpack 和其他几种格式在 Linux 中安装。 + +### PDF Arranger + +[PDF Arranger][4] 是 PikePDF 库的一个前端应用。它不像 LibreOffice 和 ONLYOFFICE 那样对 PDF 的内容进行编辑,但它对于重新排序页面、将 PDF 分割成更小的文件、将几个 PDF 合并成一个、旋转或裁剪页面等都很好。它的界面是直观的,易于使用。 + +PDF Arranger 可用于 Linux 和 Windows。 + +### Okular + +[Okular][5] 是一个由 KDE 社区开发的免费开源文档查看器。该应用的功能非常成熟,可以查看 PDF、电子书、图片和漫画。 + +Okular 完全或部分支持大多数流行的 PDF 功能和使用场景,如添加注释和内联笔记或插入文本框、形状和印章。你还可以为文档添加数字加密签名,这样你的读者就可以确定文档的来源。 + +除了在 PDF 中添加文本和图像外,还可以从文档中检索到它们,以复制和粘贴到其他地方。Okular 中的区域选择工具可以识别所选区域内的组件,所以你可以从 PDF 中独立提取它们。 + +你可以使用你的发行版包管理器或以 Flatpak 的形式安装 Okular。 + +### Xournal++ + +[Xournal++][6] 是一款带有 PDF 文件注释工具的手写日记软件。 + +它是一款具有强化手写功能的记事软件,对于处理基于文本的内容和专业布局来说,它可能不是最佳选择。然而,它渲染图形的能力以及对书写和绘图的手写笔输入的支持使它作为一个小众生产力工具脱颖而出。 + +图层管理工具、可定制的笔尖设置以及对手写笔映射的支持,使 PDF 注释和草图绘制变得更加舒适。Xournal++ 还有一个文本工具,用于添加文本框,并能插入图像。 + +Xournal++ 可在 Linux 系统(Ubuntu、Debian、Arch、SUSE)、MacOS 和 Windows(10及以上)中安装。 + +### 总结 + +如果你正在寻找一个免费和安全的专有 PDF 浏览和编辑软件的替代品,不难找到一个开源的选择,无论是桌面还是在线使用。只要记住,目前可用的解决方案在不同的使用情况下有各自的优势,没有一个工具在所有可能的任务中都同样出色。 + +这五个方案因其功能或对小众 PDF 任务的有用性而脱颖而出。对于企业使用和协作,我建议 ONLYOFFICE 或 LibreOffice Draw。PDF Arranger 是一个简单的、轻量级的工具,当你不需要改变文本时,可以用它来处理页面。Okular 为多种文件类型提供了很好的查看功能,如果你想在 PDF 中画草图和做笔记,Xournal++ 是最佳选择。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/open-source-pdf-editors-linux + +作者:[Michael Korotaev][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/michaelk +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/checklist_hands_team_collaboration.png +[2]: https://opensource.com/article/21/9/libreoffice-tips +[3]: https://opensource.com/article/20/12/onlyoffice-docs +[4]: https://flathub.org/apps/details/com.github.jeromerobert.pdfarranger +[5]: https://opensource.com/article/22/4/linux-kde-eco-certification-okular +[6]: http://xournal.sourceforge.net/ diff --git a/translated/tech/20220610 Manage Flatpak Permission Using Flatseal.md b/translated/tech/20220610 Manage Flatpak Permission Using Flatseal.md new file mode 100644 index 0000000000..c912410576 --- /dev/null +++ b/translated/tech/20220610 Manage Flatpak Permission Using Flatseal.md @@ -0,0 +1,113 @@ +[#]: subject: "Manage Flatpak Permission Using Flatseal" +[#]: via: "https://www.debugpoint.com/2022/06/manage-flatpak-permission-flatseal/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用 Flatseal 管理 Flatpak 的权限 +====== +了解如何使用 Flatseal 应用管理 Flatpak 权限,它为你提供了一个友好的 GUI 和额外的功能。 + +从新用户的角度来看,在 Linux 中安装应用可能是一个挑战。主要原因是有这么多的 [Linux 发行版][1]。而你需要为各种 Linux 发行版提供不同的安装方法或说明。对于一些用户来说,这可能会让他们不知所措。此外,对于开发者来说,为不同的发行版创建独立的软件包和构建也很困难。 + +### Flatpak 解决了这个问题。如何解决? + +它使用了容器技术,使同一个应用的可执行文件在所有的 Linux 平台上都能类似地运行。例如,一个单一的可执行文件可以在 Ubuntu、Fedora、OpenSUSE、Arch Linux 和许多其他平台上运行。 + +此外,开发人员还可以减少为不同平台打包同一应用的努力。他们可以专注于应用的功能,而不是发行或部署。 + +此外,Flatpak 应用还能即时更新,当有了最新版本,你就能得到它。 + +所有这些好处也开启了一个重要的问题。Flatpak 应用需要的权限是什么?你如何轻松地管理它们?例如,一个应用可能只需要网络访问,而不需要磁盘空间。或者另一个可能有截图的权限,但可能根本就不需要。 + +所以,审查一个 Flatpak 应用的权限是非常必要的。这与你的安卓或 iOS 应用的权限类似。 + +最后,即使你是一个新用户,管理和审查权限也不是那么困难,这要感谢图形化的应用 - Flatseal。 + +### 什么是 Flatseal? + +Flatseal 是一个 Flatpak 应用,它为你提供了一个友好的用户界面来查看和改变你系统中所有 Flatpak 应用的权限。 + +它是一个优秀的小程序,每个应用的每个权限部分都有一个易于使用的切换按钮。下面是它的外观(图 1)。 + +![Figure 1 – Flatseal App][2] + +### 你如何使用 Flatseal 来管理 Flatpak 的权限? + +当打开 Flatseal 应用时,它应该在左边的导航栏列出所有的 Flatpak 应用。而当你选择了一个应用,它就会在右边的主窗口中显示可用的权限设置。 + +现在,对于每个 Flatpak 权限控制,当前值显示在切换开关中。如果该权限正在使用中,它应该被设置。否则,它应该是灰色的。 + +首先,要设置权限,你必须进入你的系统的应用。然后,你可以从权限列表中启用或禁用任何各自的控制。 + +其次,如果你想设置一个适用于你系统中所有 Flatpak 的全局控制,你可以在左上方选择“所有应用”并应用全局设置(图 2)。 + +![Figure 2: Manage Flatpak Permission using Flatseal][3] + +这真是超级简单。不是吗? + +### 使用 Flatseal 管理 Flatpak 权限的例子 + +让我们举个例子。 + +在我的系统中,我安装了上述 Flatpak(图 2)。让我们挑选 Telegram 桌面应用。目前,Telegram 桌面没有访问任何主目录或用户文件的权限(图 3)。 + +![Figure 3: Telegram Desktop Flatpak App does not have permission to the home folders][4] + +现在,如果我想允许所有的用户文件和任何特定的文件夹(例如:/home/Downloads),你可以通过打开启用开关来给予它。请看下面的图 4。 + +![Figure 4: Permission changed of Telegram Desktop to give access to folders][5] + +同样地,你可以启用或禁用你想要的权限。在内部,Flatseal 执行内部的 Flatpak 命令来实现这一点。 + +例如,上述情况可能转化为以下命令。 + +``` +flatpak override org.telegram.desktop --filesystem=/home/Downloads +``` + +而要删除: + +``` +flatpak override org.telegram.desktop --nofilesystem=/home/Downloads +``` + +Flatseal 还有一个很酷的功能,它在用户特定的权限变化旁边显示一个小的警报图标(见图 4)。 + +### 我可以在所有的 Linux 发行版中安装 Flatseal 吗? + +是的,你可以把 [Flatseal][6] 作为 Flatpak 安装在所有 Linux 发行版中。你可以使用[本指南][7]设置你的系统,并运行以下命令进行安装。或者,[点击这里][8]直接启动特定系统的安装程序。 + +``` +flatpak install flathub com.github.tchx84.Flatseal +``` + +### 结束语 + +我希望上面的 Flatpak 权限管理指南足够简单,让你了解并开始使用 Flatpak。它超级容易控制,使用起来也容易得多。另外,你可能想访问我们更多的 [Flatpak 指南][9]。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/06/manage-flatpak-permission-flatseal/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/category/distributions +[2]: https://www.debugpoint.com/wp-content/uploads/2022/06/Flatseal-App.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/06/Manage-Flatpak-Permission-using-Flatseal.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/06/Telegram-Desktop-Flatpak-App-does-not-have-permission-to-the-home-folders.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/06/Permission-changed-of-Telegram-Desktop-to-give-access-to-folders.jpg +[6]: https://flathub.org/apps/details/com.github.tchx84.Flatseal +[7]: https://flatpak.org/setup/ +[8]: https://dl.flathub.org/repo/appstream/com.github.tchx84.Flatseal.flatpakref +[9]: https://www.debugpoint.com/tag/flatpak/ diff --git a/translated/tech/20220614 Share your Linux terminal with tmate.md b/translated/tech/20220614 Share your Linux terminal with tmate.md new file mode 100644 index 0000000000..d601cfbbae --- /dev/null +++ b/translated/tech/20220614 Share your Linux terminal with tmate.md @@ -0,0 +1,107 @@ +[#]: subject: "Share your Linux terminal with tmate" +[#]: via: "https://opensource.com/article/22/6/share-linux-terminal-tmate" +[#]: author: "Sumantro Mukherjee https://opensource.com/users/sumantro" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +用 tmate 分享你的 Linux 终端 +====== +Tmate 扩展了你与 Linux 终端共享会话的选项。 + +![Terminal command prompt on orange background][1] + +图片提供: [iradaturrahmat][2] 通过 [Pixabay][3],CC0 + +作为 Fedora Linux QA 团队的一员,我有时会发现自己执行了一堆我想广播给其他开发者的命令。如果你曾经使用过像 [tmux][5] 或 [GNU Screen][6] 这样的[终端复用器][4],你可能会认为这是一个相对容易的任务。但并不是所有我想看我的演示的人都是从笔记本电脑或台式机连接到我的终端会话的。有些人可能是随便从他们的手机浏览器中打开的,他们可以很容易地做到这一点,因为我使用了[tmate][7]。 + +### 使用 tmate 共享 Linux终端 + +看别人在 Linux 终端工作是非常有教育意义的。你可以学到新的命令,新的工作流程,或者新的调试和自动化的方法。但要捕捉到你所看到的东西,以便你以后可以自己尝试,这可能很困难。你可能会诉诸于截图或共享终端会话的屏幕记录,这样你就可以在以后打出每个命令。唯一的选择是由演示命令的人使用 [Asciinema][8] 或 [script 和 scriptreplay][9] 等工具来记录会话。 + +但是通过 tmate,用户可以在只读模式下或通过 SSH 共享一个终端。SSH 和只读会话都可以通过终端或以 HTML 网页的形式访问。 + +当我为 Fedora QA 团队培训人员时,我使用只读模式,因为我需要运行命令并显示输出,但有了 tmate,人们可以通过从他们的浏览器复制和粘贴到文本编辑器来保持笔记。 + +### Linux tmate 上手 + +在 Linux 上,你可以用你的包管理器安装 tmate。例如,在 Fedora 上: + +``` +$ sudo dnf install tmate +``` + +在 Debian 和类似的发行版上: + +``` +$ sudo apt install tmate +``` + +在 macOS 上,你可以用 [Homebrew][10] 或 [MacPorts][11] 安装它。如果你需要其他 Linux 发行版的说明,请参考[安装][12]指南。 + +![Screenshot of terminal showing the options for tmate sharing: web session (regular and read-only) and ssh session (regular and read-only)][13] + +安装后,启动 tmate: + +``` +$ tmate +``` + +当 tmate 启动时,会产生链接,通过 HTTP 和 SSH 提供对终端会话的访问。每个协议都有一个只读选项以及一个反向的 SSH 会话。 + +下面是一个网络会话的样子: + +![Screenshot showing tmate terminal window and 2 versions of sharing sessions demonstrating the same code][14] + +Tmate 的网络控制台是 HTML5 的,因此,用户可以复制整个屏幕并粘贴到终端来运行相同的命令。 + +### 保持会话活跃 + +你可能想知道如果你不小心关闭了你的终端会发生什么。你也可能想知道如何与不同的控制台应用共享你的终端。毕竟,tmate 是一个多路复用器,所以它应该能够保持会话的活力,脱离并重新连接到一个会话,等等。 + +当然,这正是 tmate 所能做到的。如果你曾经使用过 tmux,这可能是相当熟悉的。 + +``` +$ tmate -F -n web new-session vi console +``` + +这个命令在 Vi 中打开了 `new-session`,`-F` 选项确保会话在关闭时也能重新产生。 + +![A screenshot of the terminal showing the output after using the new-session and -F options: connection information for either a web session (regular or read-only) or ssh session (regular or read-only)][15] + +### 社交复用 + +Tmate 给你带来了 tmux 或 GNU Screen 的自由,以及与他人共享会话的能力。对于教其他用户如何使用终端,演示一个新命令的功能,或调试意外的行为,这是一个有价值的工具。它是开源的,所以请试一试! + +图片提供(Sumantro Mukherjee,CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/share-linux-terminal-tmate + +作者:[Sumantro Mukherjee][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sumantro +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/terminal_command_linux_desktop_code.jpg +[2]: https://pixabay.com/en/users/iradaturrahmat-3964359/ +[3]: https://pixabay.com/en/ubuntu-computer-program-interface-3145957/ +[4]: https://opensource.com/article/21/5/linux-terminal-multiplexer +[5]: https://opensource.com/downloads/tmux-cheat-sheet +[6]: https://opensource.com/article/17/3/introduction-gnu-screen +[7]: https://tmate.io/ +[8]: https://opensource.com/article/22/1/record-your-terminal-session-asciinema +[9]: https://www.redhat.com/sysadmin/record-terminal-script-scriptreplay +[10]: https://opensource.com/article/20/6/homebrew-mac +[11]: https://opensource.com/article/20/11/macports +[12]: https://tmate.io/ +[13]: https://opensource.com/sites/default/files/2022-06/install%20tmate_0.png +[14]: https://opensource.com/sites/default/files/2022-06/tmate%20web%20session.png +[15]: https://opensource.com/sites/default/files/2022-06/tmate%20keeping%20session%20alive.png diff --git a/translated/tech/20220616 Analyze web pages with Python requests and Beautiful Soup.md b/translated/tech/20220616 Analyze web pages with Python requests and Beautiful Soup.md new file mode 100644 index 0000000000..deb43f6bc6 --- /dev/null +++ b/translated/tech/20220616 Analyze web pages with Python requests and Beautiful Soup.md @@ -0,0 +1,146 @@ +[#]: subject: "Analyze web pages with Python requests and Beautiful Soup" +[#]: via: "https://opensource.com/article/22/6/analyze-web-pages-python-requests-beautiful-soup" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用 Python 的 requests 和 Beautiful Soup 来分析网页 +====== +学习这个 Python 教程,轻松提取网页的有关信息。 + +![带问号的 Python 语言图标][1] + +图源:Opensource.com + +浏览网页可能占了你一天中的大部分时间。然而,你总是需要手动浏览,这很讨厌,不是吗?你必须打开浏览器,然后访问一个网站,单击按钮,移动鼠标……相当费时费力。如果能够通过代码与互联网交互,岂不是更好吗? + +在 Python 的 `requests` 模块的帮助下,你可以使用 Python 从互联网中获取数据: + +``` +import requests + +DATA = "https://opensource.com/article/22/5/document-source-code-doxygen-linux" +PAGE = requests.get(DATA) + +print(PAGE.text) +``` + +在以上代码示例中,你首先导入了 `requests` 模块。接着,你创建了两个变量:其中一个叫做 `DATA`,它用来保存你要下载的 URL。在之后的代码中,你将能够在每次运行应用程序时提供不同的 URL。不过,就目前而言,最简单的方法是“硬编码”一个测试 URL,以达到演示目的。 + +另一个变量是 `PAGE`。代码读取了存储在 `DATA` 中的 URL,然后把它作为参数传入 `requests.get` 函数,最后用变量 `PAGE` 来接收函数的返回值。`requests` 模块及其 `.get` 函数的功能是:“读取”一个互联网地址(一个 URL)、访问互联网,并下载位于该地址的任何内容。 + +当然,其中涉及到很多步骤。幸运的是,你不必自己弄清楚,这也正是 Python 模块存在的原因。最后,你告诉 Python 打印 `requests.get` 存储在 `PAGE` 变量的 `.text` 字段中的所有内容。 + +### Beautiful Soup + +如果你运行上面的示例代码,你会得到示例 URL 的所有内容,并且,它们会不加选择地输出到你的终端里。这是因为在代码中,你对 `requests` 收集到的数据所做的唯一事情,就是打印它。然而,解析文本才是更加有趣的。 + +Python 可以通过其最基本的功能来“读取”文本,但解析文本允许你搜索模式、特定单词、HTML 标签等。你可以自己解析 `requests` 返回的文本,不过,使用专门的模块会容易得多。针对 HTML 和 XML 文本,我们有 [Beautiful Soup][2] 库。 + +下面这段代码完成了同样的事情,只不过,它使用了 Beautiful Soup 来解析下载的文本。因为 Beautiful Soup 可以识别 HTML 元素,所以你可以使用它的一些内置功能,让输出对人眼更友好。 + +例如,在程序的末尾,你可以使用 Beautiful Soup 的 `.prettify` 函数来处理文本(使其更美观),而不是直接打印原始文本: + +``` +from bs4 import BeautifulSoup +import requests + +PAGE = requests.get("https://opensource.com/article/22/5/document-source-code-doxygen-linux") +SOUP = BeautifulSoup(PAGE.text, 'html.parser') + +# Press the green button in the gutter to run the script. +if __name__ == '__main__': +    # do a thing here +    print(SOUP.prettify()) +``` + +通过以上代码,我们确保了每个打开的 HTML 标签都输出在单独的一行,并带有适当的缩进,以帮助说明标签的继承关系。实际上,Beautiful Soup 能够通过更多方式来理解 HTML 标签,而不仅仅是将它打印出来。 + +你可以选择打印某个特定标签,而不是打印整个页面。例如,尝试将打印的选择器从 `print(SOUP.prettify())` 更改为: + +``` +print(SOUP.p) +``` + +这只会打印一个 `

` 标签。具体来说,它只打印遇到的第一个 `

` 标签。要打印所有的 `

` 标签,你需要使用一个循环。 + +### 循环 + +使用 Beautiful Soup 的 `find_all` 函数,你可以创建一个 for 循环,从而遍历 `SOUP` 变量中包含的整个网页。除了 `

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

` 标签。 + +函数不会自动执行,除非你显式地调用它。你可以在代码的末尾调用这个函数: + +``` +# Press the green button in the gutter to run the script. +if __name__ == '__main__': +    # do a thing here +    loopit() +``` + +运行代码以查看所有的 `

` 标签和它们的内容。 + +### 只获取内容 + +你可以通过指定只需要 “字符串”string(它是 “单词”words 的编程术语)来排除打印标签。 + +``` +def loopit(): +    for TAG in SOUP.find_all('p'): +        print(TAG.string) +``` + +当然,一旦你有了网页的文本,你就可以用标准的 Python 字符串库进一步解析它。例如,你可以使用 `len` 和 `split` 函数获得单词个数: + +``` +def loopit(): +    for TAG in SOUP.find_all('p'): +        if TAG.string is not None: +            print(len(TAG.string.split())) +``` + +这将打印每个段落元素中的字符串个数,省略那些没有任何字符串的段落。要获得字符串总数,你需要用到变量和一些基本数学知识: + +``` +def loopit(): +    NUM = 0 +    for TAG in SOUP.find_all('p'): +        if TAG.string is not None: +            NUM = NUM + len(TAG.string.split()) +    print("Grand total is ", NUM) +``` + +### Python 作业 + +你可以使用 Beautiful Soup 和 Python 提取更多信息。以下是有关如何改进你的应用程序的一些想法: + +* [接受输入][3],这样你就可以在启动应用程序时,指定要下载和分析的 URL。 +* 统计页面上图片( 标签)的数量。 +* 统计另一个标签中的图片( 标签)的数量(例如,仅出现在 `

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

` 标签之后的图片)。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/analyze-web-pages-python-requests-beautiful-soup + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/python_programming_question.png +[2]: https://beautiful-soup-4.readthedocs.io/en/latest/ +[3]: https://opensource.com/article/17/3/python-tricks-artists-interactivity-Python-scripts