diff --git a/published/20180523 Creating random, secure passwords in Go.md b/published/20180523 Creating random, secure passwords in Go.md new file mode 100644 index 0000000000..e472554850 --- /dev/null +++ b/published/20180523 Creating random, secure passwords in Go.md @@ -0,0 +1,124 @@ +[#]: subject: "Creating random, secure passwords in Go" +[#]: via: "https://opensource.com/article/18/5/creating-random-secure-passwords-go" +[#]: author: "Mihalis Tsoukalos https://opensource.com/users/mtsouk" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14621-1.html" + +在 Go 中生成随机的安全密码 +====== + +> Go 的随机数生成器是生成难以猜测的密码的好方法。 + +![](https://img.linux.net.cn/data/attachment/album/202205/21/152534k13a1wly39fuywu2.jpg) + +你可以使用 [Go 编程语言][2] 提供的随机数生成器来生成由 ASCII 字符组成的难以猜测的密码。尽管本文中提供的代码很容易阅读,但是你仍需要了解 Go 的基础知识,才能更好地理解它。如果你是对 Go 还不熟悉,请阅读 [Go 语言之旅][3] 来了解更多信息,然后返回此处。 + +在介绍实用程序和它的代码之前,让我们先来看看这个 ASCII 表的子集,它可以在 `man ascii` 命令的输出中找到: + +``` +30 40 50 60 70 80 90 100 110 120 + --------------------------------- +0:    (  2  <  F  P  Z  d   n   x +1:    )  3  =  G  Q  [  e   o   y +2:    *  4  >  H  R  \  f   p   z +3: !  +  5  ?  I  S  ]  g   q   { +4: "  ,  6  @  J  T  ^  h   r   | +5: #  -  7  A  K  U  _  i   s   } +6: $  .  8  B  L  V  `  j   t   ~ +7: %  /  9  C  M  W  a  k   u  DEL +8: &  0  :  D  N  X  b  l   v +9: '  1  ;  E  O  Y  c  m   w +``` + +在所有 ASCII 字符中,可打印字符的十进制值范围为 33 到 126,其他的 ASCII 值都不适合用于密码。因此,本文介绍的实用程序将生成该范围内的 ASCII 字符。 + +### 生成随机整数 + +第一个实用程序名为 `random.go`,它生成指定数量的随机整数,这些整数位于给定范围内。`random.go` 最重要的部分是这个函数: + +``` +func random(min, max int) int { + return rand.Intn(max-min) + min +} +``` + +此函数使用了 `rand.Intn()` 函数来生成一个属于给定范围的随机整数。请注意,`rand.Intn()` 返回一个属于 `[0,n)` 的非负随机整数。如果它的参数是一个负数,这个函数将会抛出异常,异常消息是:`panic: invalid argument to Intn`。你可以在 [math/rand 文档][4] 中找到 `math/rand` 包的使用说明。 + +`random.go` 实用程序接受三个命令行参数:生成的整数的最小值、最大值和个数。 + +编译和执行 `random.go` 会产生这样的输出: + +``` +$ go build random.go +$ ./random +Usage: ./random MIX MAX TOTAL +$ ./random 1 3 10 +2 2 1 2 2 1 1 2 2 1 +``` + +如果你希望在 Go 中生成更安全的随机数,请使用 Go 库中的 `crypto/rand` 包。 + +### 生成随机密码 + +第二个实用程序 `randomPass.go` 用于生成随机密码。`randomPass.go` 使用 `random()` 函数来生成随机整数,它们随后被以下 Go 代码转换为 ASCII 字符: + +``` +for { + myRand := random(MIN, MAX) + newChar := string(startChar[0] + byte(myRand)) + fmt.Print(newChar) + if i == LENGTH { + break + } + i++ +} +``` + +`MIN` 的值为 `0`,`MAX` 的值为 `94`,而 `startChar` 的值为 `!`,它是 ASCII 表中第一个可打印的字符(十进制 ASCII 码为 `33`)。因此,所有生成的 ASCII 字符都位于 `!` 和 `~` 之间,后者的十进制 ASCII 码为 `126`。 + +因此,生成的每个随机数都大于 `MIN`,小于 `MAX`,并转换为 ASCII 字符。该过程继续进行,直到生成的密码达到指定的长度。 + +`randomPass.go` 实用程序接受单个(可选)命令行参数,以定义生成密码的长度,默认值为 8,这是一个非常常见的密码长度。执行 `randomPass.go` 会得到类似下面的输出: + +``` +$ go run randomPass.go 1 +Z +$ go run randomPass.go 10 +#Cw^a#IwkT +$ go run randomPass.go +Using default values! +[PP8@'Ci +``` + +最后一个细节:不要忘记调用 `rand.Seed()`,并提供一个种子seed值,以初始化随机数生成器。如果你始终使用相同的种子值,随机数生成器将生成相同的随机整数序列。 + +![随机数生成代码][5] + +你可以在 [GitHub][6] 找到 `random.go` 和 `randomPass.go` 的源码。你也可以直接在 [play.golang.org][7] 上执行它们。 + +我希望这篇文章对你有所帮助。如有任何问题,请在下方发表评论或在 [Twitter][8] 上与我联系。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/5/creating-random-secure-passwords-go + +作者:[Mihalis Tsoukalos][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mtsouk +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/laptop-password.jpg +[2]: https://golang.org/ +[3]: https://tour.golang.org/welcome/1 +[4]: https://golang.org/pkg/math/rand/ +[5]: https://opensource.com/sites/default/files/styles/panopoly_image_original/public/uploads/random.png?itok=DG0QPUGX +[6]: https://github.com/mactsouk/opensource.com +[7]: https://play.golang.org/ +[8]: https://twitter.com/mactsouk diff --git a/published/20180529 Build a concurrent TCP server in Go.md b/published/20180529 Build a concurrent TCP server in Go.md new file mode 100644 index 0000000000..8cd93bf002 --- /dev/null +++ b/published/20180529 Build a concurrent TCP server in Go.md @@ -0,0 +1,153 @@ +[#]: subject: "Build a concurrent TCP server in Go" +[#]: via: "https://opensource.com/article/18/5/building-concurrent-tcp-server-go" +[#]: author: "Mihalis Tsoukalos https://opensource.com/users/mtsouk" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14623-1.html" + +在 Go 中实现一个支持并发的 TCP 服务端 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/22/115536nkfuuf4dklgg7fsx.jpg) + +> 仅用大约 65 行代码,开发一个用于生成随机数、支持并发的 TCP 服务端。 + +TCP 和 UDP 服务端随处可见,它们基于 TCP/IP 协议栈,通过网络为客户端提供服务。在这篇文章中,我将介绍如何使用 [Go 语言][2] 开发一个用于返回随机数、支持并发的 TCP 服务端。对于每一个来自 TCP 客户端的连接,它都会启动一个新的 goroutine(轻量级线程)来处理相应的请求。 + +你可以在 GitHub 上找到本项目的源码:[concTcp.go][3]。 + +### 处理 TCP 连接 + +这个程序的主要逻辑在 `handleConnection()` 函数中,具体实现如下: + +``` +func handleConnection(c net.Conn) { +        fmt.Printf("Serving %s\n", c.RemoteAddr().String()) +        for { +                netData, err := bufio.NewReader(c).ReadString('\n') +                if err != nil { +                        fmt.Println(err) +                        return +                } + +                temp := strings.TrimSpace(string(netData)) +                if temp == "STOP" { +                        break +                } + +                result := strconv.Itoa(random()) + "\n" +                c.Write([]byte(string(result))) +        } +        c.Close() +} +``` + +如果 TCP 客户端发送了一个 “STOP” 字符串,为它提供服务的 goroutine 就会终止;否则,TCP 服务端就会返回一个随机数给它。只要客户端不主动终止,服务端就会一直提供服务,这是由 `for` 循环保证的。具体来说,`for` 循环中的代码使用了 `bufio.NewReader(c).ReadString('\n')` 来逐行读取客户端发来的数据,并使用 `c.Write([]byte(string(result)))` 来返回数据(生成的随机数)。你可以在 Go 的 net 标准包 [文档][4] 中了解更多。 + + +### 支持并发 + +在 `main()` 函数的实现部分,每当 TCP 服务端收到 TCP 客户端的连接请求,它都会启动一个新的 goroutine 来为这个请求提供服务。 + +``` +func main() { +        arguments := os.Args +        if len(arguments) == 1 { +                fmt.Println("Please provide a port number!") +                return +        } + +        PORT := ":" + arguments[1] +        l, err := net.Listen("tcp4", PORT) +        if err != nil { +                fmt.Println(err) +                return +        } +        defer l.Close() +        rand.Seed(time.Now().Unix()) + +        for { +                c, err := l.Accept() +                if err != nil { +                        fmt.Println(err) +                        return +                } +                go handleConnection(c) +        } +} +``` + +首先,`main()` 确保程序至少有一个命令行参数。注意,现有代码并没有检查这个参数是否为有效的 TCP 端口号。不过,如果它是一个无效的 TCP 端口号,`net.Listen()` 就会调用失败,并返回一个错误信息,类似下面这样: + +``` +$ go run concTCP.go 12a +listen tcp4: lookup tcp4/12a: nodename nor servname provided, or not known +$ go run concTCP.go -10 +listen tcp4: address -10: invalid port +``` + +`net.Listen()` 函数用于告诉 Go 接受网络连接,因而承担了服务端的角色。它的返回值类型是 `net.Conn`,后者实现了 `io.Reader` 和 `io.Writer` 接口。此外,`main()` 函数中还调用了 `rand.Seed()` 函数,用于初始化随机数生成器。最后,`for` 循环允许程序一直使用 `Accept()` 函数来接受 TCP 客户端的连接请求,并以 goroutine 的方式来运行 `handleConnection(c)` 函数,处理客户端的后续请求。 + +### net.Listen() 的第一个参数 + +`net.Listen()` 函数的第一个参数定义了使用的网络类型,而第二个参数定义了服务端监听的地址和端口号。第一个参数的有效值为 `tcp`、`tcp4`、`tcp6`、`udp`、`udp4`、`udp6`、`ip`、`ip4`、`ip6`、`Unix`(Unix 套接字)、`Unixgram` 和 `Unixpacket`,其中:`tcp4`、`udp4` 和 `ip4` 只接受 IPv4 地址,而 `tcp6`、`udp6` 和 `ip6` 只接受 IPv6 地址。 + +### 服务端并发测试 + +`concTCP.go` 需要一个命令行参数,来指定监听的端口号。当它开始服务 TCP 客户端时,你会得到类似下面的输出: + +``` +$ go run concTCP.go 8001 +Serving 127.0.0.1:62554 +Serving 127.0.0.1:62556 +``` + +`netstat` 的输出可以确认 `congTCP.go` 正在为多个 TCP 客户端提供服务,并且仍在继续监听建立连接的请求: + +``` +$ netstat -anp TCP | grep 8001 +tcp4       0      0  127.0.0.1.8001         127.0.0.1.62556        ESTABLISHED +tcp4       0      0  127.0.0.1.62556        127.0.0.1.8001         ESTABLISHED +tcp4       0      0  127.0.0.1.8001         127.0.0.1.62554        ESTABLISHED +tcp4       0      0  127.0.0.1.62554        127.0.0.1.8001         ESTABLISHED +tcp4       0      0  *.8001                 *.*                    LISTEN +``` + +在上面输出中,最后一行显示了有一个进程正在监听 8001 端口,这意味着你可以继续连接 TCP 的 8001 端口。第一行和第二行显示了有一个已建立的 TCP 网络连接,它占用了 8001 和 62556 端口。相似地,第三行和第四行显示了有另一个已建立的 TCP 连接,它占用了 8001 和 62554 端口。 + +下面这张图片显示了 `concTCP.go` 在服务多个 TCP 客户端时的输出: + +![concTCP.go TCP 服务端测试][5] + +类似地,下面这张图片显示了两个 TCP 客户端的输出(使用了 `nc` 工具): + +![是用 nc 工具作为 concTCP.go 的 TCP 客户端][6] + +你可以在 [维基百科][7] 上找到更多关于 `nc`(即 `netcat`)的信息。 + +### 总结 + +现在,你学会了如何用大约 65 行 Go 代码来开发一个生成随机数、支持并发的 TCP 服务端,这真是太棒了!如果你想要让你的 TCP 服务端执行别的任务,只需要修改 `handleConnection()` 函数即可。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/5/building-concurrent-tcp-server-go + +作者:[Mihalis Tsoukalos][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mtsouk +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/go-golang.png +[2]: https://golang.org/ +[3]: https://github.com/mactsouk/opensource.com +[4]: https://golang.org/pkg/net/ +[5]: https://opensource.com/sites/default/files/uploads/tcp-in-go_server.png +[6]: https://opensource.com/sites/default/files/uploads/tcp-in-go_client.png +[7]: https://en.wikipedia.org/wiki/Netcat diff --git a/published/20190404 Why you should choose mindfulness over multitasking.md b/published/20190404 Why you should choose mindfulness over multitasking.md new file mode 100644 index 0000000000..1d773a3d7a --- /dev/null +++ b/published/20190404 Why you should choose mindfulness over multitasking.md @@ -0,0 +1,86 @@ +[#]: subject: "Why you should choose mindfulness over multitasking" +[#]: via: "https://opensource.com/article/19/4/mindfulness-over-multitasking" +[#]: author: "Sarah Wall https://opensource.com/users/sarahwall" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14581-1.html" + +你为什么应该选择专注而非一心多用 +====== + +> 如果你有时候会感觉大脑处于停滞状态,那么你可能正在遭受一心多用和决策疲劳。 + +![](https://img.linux.net.cn/data/attachment/album/202205/11/232939ixz3xfnhwxn5oz2i.jpg) + +想象一下,你刚完成了日常工作,坐在电脑前,手里拿着晨间咖啡,正准备开始新的一天。突然,一条 Slack 消息弹了出来,你扫了一眼邮件,然后切回 Slack。你打开日历,看看下一次会议是什么时候,令你惊讶的是,它 15 分钟后就要开始了!你回到办公桌前,开始检查待办事项,想看看在这短短 15 分钟内还能给自己安排什么任务,但不巧的是,这时你的一个同事请求你帮他解决一个问题。大半天就这样过去了,而你根本没有意识到…… + +我的许多日子都是这样度过的,不断地多个任务之间徘徊。有些时候,我发现自己盯着电脑,大脑完全停滞。如果你也发现自己处于这种情况,这可能是你的大脑发出的信号,提醒你休息一下。你可能正在遭受一心多用和决策疲劳。 + +平均而言,成年人每天要做大约 [35000 个决定][2]!它们可能是简单的决定,如吃什么或穿什么,也可能是需要更多思考的决定,如下一个假期去哪里或从事哪个职业。每天你都面临着大量的选择,它们占据了你的头脑。 + +### 分散注意力的一心多用 + +不只有你一个人每天面临着数以千计的决定,事实上,一心多用早已成为忙碌的、工作中的专业人士的常态。问题是,一心多用的伤害比它的帮助更大。你越是为了处理多任务而分散注意力,你的生产力就越是下降。 + +在一项研究中,自称是一心多用者的人,被要求以他们感觉自然的速度,在各种任务之间来回切换。同时,研究的对照组,被要求按顺序,一次完成一项工作。研究表明,多任务组的效率要低得多。每次他们切换任务时,都会出现速度减慢的情况,因为他们需要时间来回忆到目前为止所做的细节和步骤。这最终 [额外花费了大约 40% 的时间][3],并导致整体准确度降低。每次专注于一项任务的人,总体上花费的时间更少,并且完成了所有的任务。 + +### 选择专注 + +当大脑集中在一项活动上时,它的功能是最理想的。选择专注而不是一心多用,将使你在一天中获得更好的感受,并帮助你完成更好的工作。 + +“专注”可以被定义为有意识和察觉的。它实际上是指活在当下,并将注意力集中于眼前的事情上。在工作场所,专注有很多好处。它的诀窍在于建立边界和习惯,使你能够对每项任务给予充分的关注。 + +保持积极主动,为每天必须完成的项目排好优先级,并制定一个完成计划。这将使你能够在一些重要的事情上取得真正的进展,而不是被动应付。你的待办事项清单上的每个项目,都应该是独立、明确、可操作的。每天专注于三到五项任务,不要太多。 + +### 三种在工作日休息的方法 + +不要忘记把“休息”也放进一天的计划中。大脑每小时需要几分钟的休息,以休养生息,避免倦怠。休息一下对你的心理健康也有好处,最终 [有助于生产力的提高][4]。 + +这里有三种简单的“休息”方法,请把它们融入到你忙碌的一天中吧! + +#### 1、移动身体 + +花 10 分钟时间,离开你的椅子,站起来走一走。如果你的时间很紧张,可以站起来伸展两分钟。改变身体所处的位置,并专注于当下,将有助于缓解积聚在你心中的精神紧张。 + +#### 2、多笑 + +休息一下,与你的朋友和工作中的同事交谈。笑声可以减少压力荷尔蒙,并引发内啡肽的释放,内啡肽是人体天然的的化学物质,它会使人感觉良好。欢声笑语的小憩有助于放松你的头脑,对你的灵魂也有好处。 + +#### 3、深呼吸 + +用两分钟的休息时间来重置你的身心,使用腹部深呼吸。它可以使你的身心平静下来,改善氧气流动,并给你带来自然的能量提升。 + +1. 挺直坐正,将注意力放在腹部,感受它的柔软和放松。 +2. 从缓慢的深吸气开始,数三下,让氧气依次充满你的腹部、肋骨和上胸。 +3. 停顿一秒钟,然后与深吸气相反,从上胸、肋骨和腹部呼气,最后将腹部拉向脊柱。 +4. 再次停顿,然后重复。 + +### 重置自己 + +下次当你发现自己处于停滞状态,或是正在强迫状态不佳的自己完成一项任务时,请尝试上面的一些提示。最好是短暂休息一下,重置身心,而不要试图强行完成任务。相信我,你的身体和大脑会感谢你的! + +本文改编自《BodyMindSpirit》上的 [让自己休息一下][5] 和 ImageX 的博文 [专注而不是一心多用][6]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/mindfulness-over-multitasking + +作者:[Sarah Wall][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sarahwall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/life_tree_clouds.png +[2]: https://go.roberts.edu/leadingedge/the-great-choices-of-strategic-leaders +[3]: http://www.apa.org/research/action/multitask.aspx +[4]: https://opensource.com/article/19/3/guide-being-more-productive +[5]: https://body-mind-spirit-coach.com/2019/01/02/give-yourself-a-break/ +[6]: https://imagexmedia.com/mindfullness-over-multitasking +[7]: https://events.drupal.org/seattle2019/sessions/mindless-multitasking-dummy%E2%80%99s-guide-productivity +[8]: https://events.drupal.org/seattle2019 diff --git a/published/20200303 Watching activity on Linux with watch and tail commands.md b/published/20200303 Watching activity on Linux with watch and tail commands.md new file mode 100644 index 0000000000..bb8dd7b0d7 --- /dev/null +++ b/published/20200303 Watching activity on Linux with watch and tail commands.md @@ -0,0 +1,150 @@ +[#]: collector: (lujun9972) +[#]: translator: (Starryi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14557-1.html) +[#]: subject: (Watching activity on Linux with watch and tail commands) +[#]: via: (https://www.networkworld.com/article/3529891/watching-activity-on-linux-with-watch-and-tail-commands.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +使用 watch 和 tail 命令监视 Linux 上的活动 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/07/091736ja5yt2yottef0kl4.jpg) + +> watch 和 tail 命令可以帮助监视 Linux 系统上的活动。本文介绍了这两个命令的一些有用的使用方法。 + +`watch` 和 `tail` 命令为持续监视 Linux 系统上的活动提供了一些有趣的选项。 + +也就是说,你可以通过 `watch` 来显示谁已登录,并随着用户登录和注销不断更新,而不是仅仅提出问题并获得答案(例如询问 `who` 并获取当前登录用户的列表)。 + +使用 `tail`,你可以显示文件的底部并在添加内容时查看内容。这种监控一般非常有用,并且比定期运行命令所需的工作更少。 + +### 使用 watch 命令 + +使用 `watch` 的最简单示例之一是使用命令 `watch who`。你会看到一个列表,其中显示了谁登录了,以及他们登录的时间和登录位置。请注意,默认设置是每两秒更新一次显示(左上角),日期和时间(右上角)将按该间隔自行更新。用户列表将随着用户登录和注销而增长和缩小。 + +``` +$ watch who +``` + +此命令将显示如下所示的登录列表: + +``` +Every 2.0s: who dragonfly: Thu Feb 27 10:52:00 2020 + +nemo pts/0 2020-02-27 08:07 (192.168.0.11) +shs pts/1 2020-02-27 10:58 (192.168.0.5) +``` + +你可以通过添加 `-n` 选项(例如 `-n 10`)来修改更新间的不同秒数,以修改更新间隔,从而获取较少的更新频率。 + +``` +$ watch -n 10 who +``` + +上述命令将以新的间隔显示,并且显示的时间更新频率较低,从而使显示时间与所选间隔保持一致。 + +``` +Every 10.0s: who dragonfly: Thu Feb 27 11:05:47 2020 + +nemo pts/0 2020-02-27 08:07 (192.168.0.11) +shs pts/1 2020-02-27 10:58 (192.168.0.5) +``` + +如果你希望仅查看命令的输出,而不是标题(前 2 行),则可以通过添加 `-t`(无标题)选项来省略这些行。 + +``` +$ watch -t who +``` + +然后,你的屏幕将显示如下所示: + +``` +nemo pts/0 2020-02-27 08:07 (192.168.0.11) +shs pts/1 2020-02-27 10:58 (192.168.0.5) +``` + +如果每次运行监视的命令时,输出都是相同的,则只有标题行(如果未省略)会更改。其余显示的信息将保持不变。 + +如果你希望 `watch` 命令在它正在监视的命令的输出发生更新后立即退出,则可以使用 `-g`(将其视为“离开go away”)选项。例如,如果你只是在等待其他人开始登录系统,则可以选择执行此操作。 + +你还可以使用 `-d`(差异differences)选项突出显示显示输出中的更改。突出显示只会持续一个间隔(默认为 2 秒),但有助于引起你对更新的注意。 + +下面是一个更复杂的示例,该示例使用 `watch` 命令显示正在侦听连接的服务及其使用的端口。虽然输出不太可能更改,但它会提醒你任何新服务正在启动或关闭。 + +``` +$ watch 'sudo lsof -i -P -n | grep LISTEN' +``` + +值得注意的是,正在运行的命令需要用引号扩起来,以确保不会将 `watch` 命令的输出发送到 `grep` 命令。 + +使用 `watch -h` 命令将为你提供命令选项的列表。 + +``` +$ watch -h + +Usage: + watch [options] command + +Options: + -b, --beep beep if command has a non-zero exit + -c, --color interpret ANSI color and style sequences + -d, --differences[=] + highlight changes between updates + -e, --errexit exit if command has a non-zero exit + -g, --chgexit exit when output from command changes + -n, --interval seconds to wait between updates + -p, --precise attempt run command in precise intervals + -t, --no-title turn off header + -x, --exec pass command to exec instead of "sh -c" + + -h, --help display this help and exit + -v, --version output version information and exit +``` + +### 使用 tail -f + +`tail -f` 命令与 `watch` 有一些相同之处。它也会在添加文件时显示文件的底部和其他内容。你不必一次又一次地运行 `tail` 命令,而是运行一个命令并获得可重复更新显示视图的结果。例如,你可以使用如下命令查看系统日志: + +``` +$ tail -f /var/log/syslog +``` + +某些文件(如 `/var/log/wtmp`)不适合这种类型的处理,因为它们的格式不是普通文本文件,但是通过组合 `watch` 和 `tail`,你可以获得类似的结果,如下所示: + +``` +watch 'who /var/log/wtmp | tail -20' +``` + +无论有多少用户仍处于登录状态,此命令都将只显示最近的 5 次登录。如果发生其他登录,显示结果将添加一行记录并删除顶行记录。 + +``` +Every 60.0s: who /var/log/wtmp | tail -5 dragonfly: Thu Feb 27 12:46:07 2020 + +shs pts/0 2020-02-27 08:07 (192.168.0.5) +nemo pts/1 2020-02-27 08:26 (192.168.0.5) +shs pts/1 2020-02-27 10:58 (192.168.0.5) +nemo pts/1 2020-02-27 11:34 (192.168.0.5) +dory pts/1 2020-02-27 12:14 (192.168.0.5) +``` + +对你有时可能想要监视的信息,无论监视进程、登录名还是系统资源,`watch` 和 `tail -f` 命令都可以提供自动更新视图,从而使监视任务变得更加容易。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3529891/watching-activity-on-linux-with-watch-and-tail-commands.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[Starryi](https://github.com/Starryi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/newsletters/signup.html +[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world diff --git a/published/20200807 A Beginner-s Guide to Open Source.md b/published/20200807 A Beginner-s Guide to Open Source.md new file mode 100644 index 0000000000..a51f88eefe --- /dev/null +++ b/published/20200807 A Beginner-s Guide to Open Source.md @@ -0,0 +1,114 @@ +[#]: subject: "A Beginner's Guide to Open Source" +[#]: via: "https://ruthikegah.xyz/a-beginners-guide-to-open-source" +[#]: author: "Ruth Ikegah https://hashnode.com/@ikegah_ruth" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14600-1.html" + +开源新手指南 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/16/144822bal5z8ij44s4jcom.jpg) + +作为一名技术人员,你应该时不时会看到“开源Open Source”这个词。你有可能在浏览推文、博文时看到过它,也有可能是在学习某一门编程语言或使用某个工具时,看到它的部分介绍写着:这个工具/语言是“开源”的。总之,开源无处不在。 + +在本文中,我将介绍下面这三个话题: + +* 什么是开源 +* 贡献于开源的好处 +* 如何开始贡献 + +### 什么是开源 + +开源指的是这样一些软件、项目或社区:它们允许人们修改和分享,因为它们的设计目的就是为了让所有人都能访问。举一个关于菜谱的例子:你可以做你从未发明过的菜,因为发明这个菜谱的人公开了它。大多数时候,你也可以根据自己的口味烹饪,而不会呛到喉咙(开个玩笑)。 + +> 开源软件Open Source Software(OSS)是指源代码可供他人查看、复制、学习、修改或分享的软件。 + +下面是开源软件和语言的一些例子: + +* Linux 操作系统 +* Google 的 Android 操作系统 +* Firefox 浏览器 +* VLC 媒体播放器 +* Python 语言、PHP 语言、MySQL 数据库 + +与开源软件相反的是专有软件proprietary software / 闭源软件closed source software,只有软件的创造者才能自由使用,其他人若想使用,就得先获得法律许可才行。例如 Adobe Photoshop、微软 Office 等。 + +> 开源不仅限于软件或代码,技术领域的任何人都可以为开源做出贡献(各个角色)。有了开源,就有了透明度、可靠性、灵活性,并允许开放合作。 + +### 贡献于开源的好处 + +向开源项目或软件做贡献意味着“免费”让该项目变得更好。你应该会问自己,为什么我要关心或向自己强调“免费”呢?如果你是新手,你可以阅读 [Edidiong Asikpo][2] 的故事,她在 [这篇文章][3] 中说明了为什么开源是她成长的催化剂。 + +贡献开源的好处有很多,这里是其中一部分: + +* 它能够帮助你提高现有的技能,特别是对于新手而言,因为它允许你边做边学。 +* 无论身在何处,你都可以与世界各地的优秀科技人士协作或共事。 +* 你可以公开自己的想法,从而改善软件、项目或社区,让世界变得更美好。 +* 你可以通过贡献开源来得到大家的认可,或者成为独特或伟大事物的一部分(获得自豪感)。 +* 它让你有机会成为一个人才济济、活力四射的社区的一分子,你可以从中汲取灵感,并结识志同道合的人。 +* 你可以因为贡献开源而获得报酬(OoO)!比如你可以参与一些实习,包括 [谷歌编程之夏][4]Google Summer of Code、[Outreachy][5]、[谷歌文档季][6]Google Season of Docs,以及 Open Collective 的 [赏金计划][7]bounty program 等。(LCTT 译注:国内也有类似的开源实习机会,如“开源之夏”。) + +### 如何开始贡献 + +我相信你会对上面提到的最后一点感兴趣吧(^o^),那么,你该如何开始为开源软件做贡献呢? + +是时候介绍一下 GitHub 了! + +Github 是开源项目协作的大本营,因此它是一个开始贡献开源的好地方。没听说过 GitHub?没有关系!它提供了文档和指南,很容易就可以上手。不过我还是要提醒你,学习是一个循序渐进的过程,不要太心急喔。 + +Github 以公共存储库repositories的形式容纳了许多开源项目。对于某个项目,你可以提交一个议题issue,来说明你注意到的错误或问题(或进一步提出改进意见),也可以创建一个拉取请求pull request(PR),并说明你的更正和改进。 + +我不建议你在 GitHub 上搜索项目来开始贡献,这将是相当令人沮丧的。尽管你可以限定项目使用的编程语言来简化搜索过程,但仍然会有一大堆东西出现在你眼前。(LCCT 译注:对于可爱的小萌新来说,这实在是难以承受 >…<。) + +为了更精准地找到适合自己的项目,这里有一些可供开始的途径: + +* [First-timers only][8]:一个很好的资源网站,你可以在上面找到新手友好的开源项目来开始贡献。(设计师朋友,我没有忘记你!你可以查看 [Open Source Design][9] 这个网站,在上面也能找到新手友好的开源设计项目!) +* 你可以创建你自己的开源项目,把你美妙的想法变成现实,并允许其他人的合作和贡献。[这里][10] 有关于如何创建开源项目的指南。 +* 加入一个社区:你可以成为某个社区的成员,这也是传播开源思想的一种方式。你可以在谷歌上搜索当地的开源社区,并积极加入其中。 + +最后,我想给出几个有用的提示,供你在贡献开源项目时参考: + +* 在加入之前,先对项目、社区或组织做一些研究;当你在做的时候,针对不清楚的地方提出问题。 +* 当你加入社区时,尽量积极地介绍自己,并说明你能帮助项目的地方。 +* **不要**认为自己无法为项目提供任何帮助,停止这种念头!你有很好的想法可以分享! +* 在存储库中看看别人提交的议题,(如果有的话)看看你能在哪些方面提供帮助,你可以关注带有“good first issue”、“help-wanted”、“first-timers only”等标签的议题。 +* 在开始贡献之前,一定要先看一下贡献指南,这样你在贡献时就不会有冲突。 + +> 哪怕只是使用一个开源工具也是一种贡献;参加一个开源活动也是一种贡献;做开源项目的志愿者,或者为开源项目提供赞助也是一种贡献。 + +我想用非洲开源节的口号来结束:“未来是开放的”,所以快上车吧! + +感谢阅读! + +如果你还有疑问或需要帮助,请在 [这里][11] 联系我,我很乐意和你讨论开源,并帮助你做出首次贡献! + +**LCTT 译注:读了这篇文章,你是不是想要马上投身于开源贡献呢?那么请考虑加入“Linux 中国翻译组(LCTT)”吧!我们有能帮助你快速上手翻译的 [维基][12] ,有热心友爱的 QQ 群,你甚至还能够在我们的官网上获得属于自己的译者专页……心动了吗?那就立刻行动起来吧!阅读 [维基][12] 以了解如何加入我们~** + +-------------------------------------------------------------------------------- + +via: https://ruthikegah.xyz/a-beginners-guide-to-open-source + +作者:[Ruth Ikegah][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://hashnode.com/@ikegah_ruth +[b]: https://github.com/lkxed +[1]: https://ruthikegah.xyz/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1596742204400%2Fk9AJL1oNC.jpeg%3Fw%3D1600%26h%3D840%26fit%3Dcrop%26crop%3Dentropy%26auto%3Dcompress%2Cformat%26format%3Dwebp&w=3840&q=75 +[2]: https://hashnode.com/@didicodes +[3]: https://edidiongasikpo.com/open-source-contributions-a-catalyst-for-growth-b823fc5752b1 +[4]: https://summerofcode.withgoogle.com +[5]: https://www.outreachy.org/ +[6]: https://developers.google.com/season-of-docs +[7]: https://docs.opencollective.com/help/contributing/development/bounties +[8]: https://www.firsttimersonly.com/ +[9]: https://opensourcedesign.net/ +[10]: https://github.com/Ruth-ikegah/opensource.guide +[11]: https://twitter.com/IkegahRuth +[12]: https://lctt.github.io/wiki/intro/lctt.html diff --git a/published/20210102 Explore the night sky with this open source astronomy app.md b/published/20210102 Explore the night sky with this open source astronomy app.md new file mode 100644 index 0000000000..d25508a327 --- /dev/null +++ b/published/20210102 Explore the night sky with this open source astronomy app.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: (hanszhao80) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14599-1.html) +[#]: subject: (Explore the night sky with this open source astronomy app) +[#]: via: (https://opensource.com/article/21/1/kstars) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +使用开源天文应用程序 KStars 探索夜空 +====== + +> 使用 KStars 从你的 Linux 桌面或安卓设备眺望星辰。 + +![](https://img.linux.net.cn/data/attachment/album/202205/16/104339d0u39oiyzugzjf86.jpg) + +我一直对夜空很着迷。当我年轻的时候,唯一可用的参考资料是书籍,它们似乎描绘了一个与我从家里看到的不一样的天空。 + +五年多前,我曾介绍过两个开源天文馆应用程序 [Celestia 和 Stellarium][2] 的使用体验。最近,我又了解到一个应用 [KStars][3]。这是一个令人惊叹的开源应用程序,可以帮助儿童(和成人)参与科学和天文学。它的网站上说: + +> “KStars 是一款自由开源的、跨平台的天文学软件。它提供了从地球上的任何位置、任何日期和时间对夜空的一个精确的图形化模拟。可展示包括多达 1 亿颗恒星,13,000 个深空天体,所有 8 个行星,太阳和月亮,以及数千颗彗星,小行星,超新星和卫星。“ + +KStars 是 [KDE 教育项目][4] 的一部分。最新版本可用于 Linux、Windows 和 MacOS,它集成了 [StellarSolver][5],这是一个跨平台的 SExtractor 程序,它可以从天文图像构建一个天体目录。 + +### 安装 KStars + +KStars 采用 GPL 2.0 协议自由授权。源代码可以在官方的 [KDE GitLab 实例][6] 查看(这是 GitHub 的一个只读镜像)。KDE 教育项目有着优秀的 [安装文档][7]。 + +我用的系统是 [Pop!_OS][8],可以在 Pop!_Shop 找到这款应用程序。 + +可以从你的发行版的软件存储库中找到 KStars 在 Linux 上安装。而在安卓设备上,可以从 [Google Play 商店][9] 下载适配安卓的 KStars Lite。KDE 项目维护了一份优秀的 [KStars 手册][10] 来帮助用户。 + +### 使用 KStars + +安装完后,从你的“应用Applications”菜单启动程序。启动向导会指导你完成初始化设置。 + +![KStars 启动向导][11] + +这些指示很容易理解。向导会提示设置你住所的位置。不幸的是,我所在的小村庄不在列表里,但附近一个更大的社区在里面。 + +![KStars 位置设置][13] + +你还可以下载该程序的其他数据和额外功能。 + +![KStars 扩展][14] + +这里有很多可用的选项。我选择“在详细信息窗口中显示常见图像Common images displayed in the detail window”。 + +一旦完成设置,KStars 会呈现一张基于你的位置的夜空图。 + +![KStars 夜空显示][15] + +左上角显示了当前时区(这张图里是 2020 年 11 月 30 日傍晚 5 点 58 分)。 + +使用鼠标左键,可以向左、向右、向上和向下移动显示。你可以使用鼠标滚轮进行放大和缩小。将鼠标光标放在天体上并右键单击可查看当前天体的描述。 + +![KStars 天体描述][16] + +### 参与 + +KStars 正在积极寻求错误报告、天文学知识、代码、翻译等方面的帮助。主要开发者和维护者是 [Jasem Mutlaq][17]。如果你愿意贡献一份力量,请访问 [项目网站][18] 或加入邮件列表以了解更多信息。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/kstars + +作者:[Don Watkins][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/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_520x292_opensourcestars.png?itok=hnrMETFh (Open source stars.) +[2]: https://opensource.com/education/15/7/open-source-apps-explore-night-sky +[3]: https://edu.kde.org/kstars/ +[4]: https://edu.kde.org/ +[5]: https://github.com/rlancaste/stellarsolver +[6]: https://invent.kde.org/education/kstars +[7]: https://edu.kde.org/kstars/install.php +[8]: https://pop.system76.com/ +[9]: https://play.google.com/store/apps/details?id=org.kde.kstars.lite&hl=en +[10]: https://docs.kde.org/trunk5/en/extragear-edu/kstars/index.html +[11]: https://opensource.com/sites/default/files/uploads/kstars_startupwizard.png (KStars Startup Wizard) +[12]: https://creativecommons.org/licenses/by-sa/4.0/ +[13]: https://opensource.com/sites/default/files/uploads/kstars_setlocation.png (KStars location setup) +[14]: https://opensource.com/sites/default/files/uploads/kstars_addons.png (KStars add-ons) +[15]: https://opensource.com/sites/default/files/uploads/kstars_sky.png (KStars night sky display) +[16]: https://opensource.com/sites/default/files/uploads/kstars_objectdescription.png (KStars describes objects) +[17]: https://github.com/knro +[18]: https://edu.kde.org/kstars diff --git a/published/20210111 9 Decentralized, P2P and Open Source Alternatives to Mainstream Social Media Platforms Like Twitter, Facebook, YouTube and Reddit.md b/published/20210111 9 Decentralized, P2P and Open Source Alternatives to Mainstream Social Media Platforms Like Twitter, Facebook, YouTube and Reddit.md new file mode 100644 index 0000000000..1906887042 --- /dev/null +++ b/published/20210111 9 Decentralized, P2P and Open Source Alternatives to Mainstream Social Media Platforms Like Twitter, Facebook, YouTube and Reddit.md @@ -0,0 +1,242 @@ +[#]: collector: (lujun9972) +[#]: translator: (TravinDreek) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14529-1.html) +[#]: subject: (9 Decentralized, P2P and Open Source Alternatives to Mainstream Social Media Platforms Like Twitter, Facebook, YouTube and Reddit) +[#]: via: (https://itsfoss.com/mainstream-social-media-alternaives/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +9 个去中心化、端到端、开源的主流社交媒体平台替代品 +====== + +你多半知道,Facebook 因可能从它的“端到端加密”的聊天服务 WhatsApp 那里共享用户数据而 [遭到抨击][1]。 + +这些有争议的隐私政策变化使无数人转而使用 WhatsApp 替代品。 + +注重隐私的人们,早就料到了会有这事。毕竟,[Facebook 可是花了 190 亿美元收购了 WhatsApp 这样的手机应用][2],而当时靠它还赚不到什么钱。现在,Facebook 该回本了 —— 回那之前投进去的 190 亿美元的本。他们可能打算把你的数据共享给广告商,这样的话,你看到的广告就会更加个性化(侵入性)了。 + +要是你受够了 Facebook、Google、Twitter 等科技公司的“我说了算”的态度,那你应该试试一些社交媒体平台的替代品。 + +这些社交平台的替代品都是开源的,它们都用了端到端或区块链技术来实现去中心化,而且你可能能够自己托管其中一些平台。 + +### 开源和去中心化的社交网络 + +![Image Credit: Datonel on DeviantArt][3] + +先说句实话,这些替代平台的体验,可能会和你惯用平台的体验有所差异,但这些平台是不会侵犯你的隐私和言论自由的。这就是一种权衡。 + +#### 1、Minds + +- 用于替代:Facebook 和 YouTube +- 特点:代码开源、区块链 +- 自托管:否 + +在 Minds 上,你可以发视频、博客、图片,并设置当前状态。你也能向群聊,或者直接向好友,安全地发送消息或者进行视频聊天。通过热门内容和话题,你可以发现你感兴趣的文章。 + +还不止这些。你还能通过做贡献来赚取代币,这些代币可以用来升级你的频道。创作者可以从粉丝那里直接得到美元、比特币和以太坊的支付。 + +> **[Minds][4]** + +#### 2、Aether + +- 用于替代:Reddit +- 特点:开源、端到端 +- 自托管:否 + +![][5] + +Aether 是一个开源、端到端的平台,用于创建自我管理的社区,并可以审查管理记录以及选举版主。 + +Aether 上的内容,具有存在时间短的性质,并且内容只会留存六个月,除非有人把它保存下来。因为它是端到端的,所以中心服务器不复存在。 + +Aether 有趣的一点在于它的民主社区。社区可以选举版主,也能投票弹劾版主。 + +> **[Aether][6]** + +#### 3、Mastodon + +- 用于替代:Twitter +- 特点:开源、去中心化 +- 自托管:是 + +![][7] + +在自由开源软件爱好者中,[Mastodon][8] 已经很有名了。我们之前报道过 [Twitter 的开源替代品 Mastodon][9],并且 [你也可以在 Mastodon 上关注我们][10]。 + +Mastdon 并不像 Twitter 那样是一个单一网站,它是个由数千个社区组成的网络,这些社区都由不同的组织和个人运营,并且都提供无缝的社交媒体体验。这被称之为“Fediverse”。 + +你可以托管自己的 Mastodon 实例,并选择将其连接到其他 Mastodon 实例,或者直接加入一个已有的 Mastodon 实例,比如说 [Mastodon Social][11]。 + +> **[Mastodon][8]** + +#### 4、LBRY + +- 用于替代:YouTube +- 特点:开源、去中心化、区块链 +- 自托管:否 + +![][12] + +[LBRY][13] 的核心是一个基于区块链的去中心化协议。协议顶层,便是由其加密货币驱动的数字市场。 + +通过 LBRY,创作者可以提供多种数字化内容,例如影片、书籍和游戏。基本上,它是作为 YouTube 的替代而受到推崇的。你可以在 Odysee 上访问这个视频共享平台。 + +我们之前 [报道过 LBRY][14],你可以去读那篇文章了解详情。 + +> **[LBRY][15]** + + +#### 5、Pixelfed + +- 用于替代:Instagram +- 特点:去中心化、区块链 +- 自托管:否 + +![][31] + +Pixelfed 和 Mastodon 使用了相同的底层开放协议,即 ActivityPub。 + +因此,你也可以通过 Pixelfed 与 Mastodon 的实例进行互动。我还没有试过,但从理论上讲,你应该可以做到这一点。你应该找到几个活跃的 Pixelfed 实例来注册。 + +如果你想控制你的数据和隐私,Pixelfed 是 Instagram 的一个简单替代品。你可以控制你的图片的隐私,在平台上没有任何广告。 + +你可以得到与照片分享平台基本相同的功能。然而,它没有驱动时间线的算法,遵循时间顺序,不收集你的任何数据,以获得个性化的体验。 + +> **[Pixelfed][32]** + +#### 6、Peertube + +- 用于替代:YouTube +- 特点:去中心化、端到端 +- 自托管:否 + +![][19] + +PeerTube 由法国公司 Framasoft 开发,它是一个去中心化的视频平台。PeerTube 使用了 [BitTorrent 协议][20] 以在用户之间共享宽带。 + +PeerTube 旨在抵制企业的垄断,它不依靠广告,并且也不会追踪你。不过要注意,你的 IP 地址在这里不是匿名的。 + +目前有许多 PeerTube 的实例,你可以在那里托管你的视频。有些实例需要付费,不过大多数都是免费的。 + +> **[PeerTube][21]** + +#### 7、Diaspora + +- 用于替代:Facebook +- 特点:去中心化、开源 +- 自托管:是 + +Diaspora 是最早的去中心化社交网络之一。最早可以追溯到 2010 年,当时 Diaspora 就作为 Facebook 的替代品而受到吹捧。最初几年,它确实得到了一些应得的关注,但它只在小众范围内得到了使用。 + +和 Mastodon 类似,Diaspora 由许多“豆荚pod” (节点服务器)组成。你可以在一个“豆荚”上注册,或者托管你自己的“豆荚”。科技公司无法拥有你的数据,只有你可以。 + +> **[Diaspora][22]** + +#### 8、Dtube + +- 用于替代:YouTube +- 特点:去中心化、区块链 +- 自托管:否 + +![][23] + +Dtube 是一个基于区块链的去中心化 YouTube 复制品。之所以说它是 YouTube 复制品,是因为它界面太像 YouTube 了。 + +Dtube 像其他基于区块链的社交媒体一样,是由 DTube 币(DTC)驱动的。每当有人观看创作者的视频或者与之互动,创作者就会获得 DTC。这些硬币可以用于推广内容,或者通过合作的加密货币交换方来提现。 + +> **[DTube][24]** + +#### 9、Signal + +用于替代:WhatsApp、Facebook Messenger +特点:开源 +自托管:否 + +![][25] + +与端到端加密的 WhatsApp 聊天不同,Signal 不会跟踪你,不会共享你的数据,也不会侵犯你的隐私。 + +[Signal 一举成名][26],是在它得到 Edward Snowden 的认可之时。而当 WhatsApp 开始与 Facebook 共享数据时,Elon Musk 又发了关于 Signal 的推文,这便让 Signal 更受瞩目了。 + +Signal 使用了自己的开源 Signal 协议,以提供端到端加密的消息和通话服务。 + +> **[Signal][28]** + +#### KARMA(已终止) + +- 用于替代:Instagram +- 特点:去中心化、区块链 +- 自托管:否 + +![][16] + +这也是一个基于区块链的社交网络,由加密货币驱动。 + +KARMA 是 Instagram 的一个复制品,它构建于开源区块链平台 [EOSIO][17] 之上。每当你的内容获得了点赞和分享,你就会得到 KARMA 代币。你可以用这些代币来推广你的内容,或者通过一个合作的加密货币交换方,来将其转换为现实货币。 + +KARMA 只能在手机上使用,可以在 Play Store 及 App Store 上获取。 + +> **[KARMA][18]** + +#### 还有别的吗? + +还有一些其他的服务,它们虽然不是开源或者去中心化的,但也尊重你的隐私与言论自由。 + + * [MeWe][29]:Facebook 替代品 + * [Voice][30]:NFT 为数字艺术家赋能 + * [ProtonMail][33]:Gmail 替代品 + +还有一个基于 Matrix 协议的 [Element 聊天工具][34],你也可以试试。 + +我知道,应该还有几个别的社交媒体平台的替代品。也想分享一下?我可能会把他们加到列表中来。 + +要是你也得在这个列表中选一个平台,你想选哪个呢? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/mainstream-social-media-alternaives/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][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/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://arstechnica.com/tech-policy/2021/01/whatsapp-users-must-share-their-data-with-facebook-or-stop-using-the-app/ +[2]: https://money.cnn.com/2014/02/19/technology/social/facebook-whatsapp/index.html +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/1984-quote.png?resize=800%2C450&ssl=1 +[4]: https://www.minds.com/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/aether-reddit-alternative.png?resize=800%2C600&ssl=1 +[6]: https://getaether.net +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/mastodon.png?resize=800%2C623&ssl=1 +[8]: https://joinmastodon.org/ +[9]: https://itsfoss.com/mastodon-open-source-alternative-twitter/ +[10]: https://mastodon.social/@itsfoss +[11]: https://mastodon.social +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/lbry-interface.jpg?resize=800%2C420&ssl=1 +[13]: https://lbry.org +[14]: https://itsfoss.com/lbry/ +[15]: https://lbry.tv/$/invite/@itsfoss:0 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/karma-app.jpg?resize=800%2C431&ssl=1 +[17]: https://eos.io +[18]: https://karmaapp.io +[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/peertube-federation-multiplicity.jpg?resize=600%2C341&ssl=1 +[20]: https://www.slashroot.in/what-bittorrent-protocol-and-how-does-bittorrent-protocol-work +[21]: https://joinpeertube.org +[22]: https://diasporafoundation.org +[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/dtube.jpg?resize=800%2C516&ssl=1 +[24]: https://d.tube +[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/12/signal-shot.jpg?resize=800%2C565&ssl=1 +[26]: https://itsfoss.com/signal-messaging-app/ +[27]: https://www.britannica.com/biography/Elon-Musk +[28]: https://www.signal.org +[29]: https://mewe.com +[30]: https://www.voice.com +[31]: https://itsfoss.com/wp-content/uploads/2022/04/pixelfed-decentralized.jpg +[32]: https://pixelfed.org/ +[33]: https://itsfoss.com/recommends/protonmail/ +[34]: https://itsfoss.com/element/ \ No newline at end of file diff --git a/published/20210112 8 tips for the Linux command line.md b/published/20210112 8 tips for the Linux command line.md new file mode 100644 index 0000000000..3188935f71 --- /dev/null +++ b/published/20210112 8 tips for the Linux command line.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: (FYJNEVERFOLLOWS) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14570-1.html) +[#]: subject: (8 tips for the Linux command line) +[#]: via: (https://opensource.com/article/21/1/linux-commands) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) + +分享 8 篇使用 Linux 命令行的技巧 +====== + +> 要好好利用无所不能的 Linux 命令行提供的所有功能 + +![](https://img.linux.net.cn/data/attachment/album/202205/10/084827v23ia3wlkdirr6r5.jpg) + +Linux 命令行是极其灵活的。无论你是管理服务器还是在桌面系统上启动终端窗口,都可以通过命令行无所不包的工具包来更新文件、调整系统性能或者管理进程。命令行里发生的事情是非常有趣的。 + +我们发布了许多关于如何充分利用系统的优秀文章,证明了命令行的流行。以下是 8 篇关于 Linux 命令阅读量最高的文章: + +### 《使用这些技巧让 Bash 命令历史更加有用》 + +> **[文章地址][2]** + +Bash 是大多数 Linux 系统上的默认命令行 Shell。Seth Kenlon 编写了该指南,用于帮助你了解 Bash 命令历史。修改 Bash 命令历史通常没有听起来那么危险,特别是当你带有目的地修改它的时候。告诉 Bash 你希望它记住什么,甚至还可以直接通过删除你不想要或不需要的条目来重写命令历史。根据需要使用你的历史会话,明智地行使你对命令历史的权力。 + +### 《如何在 Linux 终端中兼顾特性和性能》 + +> **[文章地址][3]** + +Ricardo Gerardi 非常喜欢命令行应用程序,他花了很多时间在终端上工作。Ricardo 投入了一些时间,把命令行变成了一个令人愉快的工作环境。你可以通过了解如何自定义终端应用程序、主题和提示符,来创建一个功能丰富、易于使用系统资源的终端。 + +### 《放弃 Bash 转投拥有更优美配置的 fish》 + +> **[文章地址][4]** + +Matt Broberg 最近放弃了默认的命令行解释器 —— Bash,转而支持 fish。fish 自豪地宣称自己是 “90 年代的命令行 shell”。这个以鱼为主题的 “友好的交互式 shell” 为命令行创造了更愉快的体验。阅读 Matt 的文章来进一步了解如何充分利用 fish。如果你不想再对你的终端修修补补,换一个更漂亮的默认 shell,把更多精力放在代码上,不妨试一试 fish。 + +### 《分析 Linux 里二进制文件的 10 种方式》 + +> **[文章地址][5]** + +我们每天都在和二进制文件打交道,但我们对它们的了解甚少。Linux 提供了一组丰富的工具,使分析二进制文件变得轻而易举!这些简单的命令和工具可以帮助你顺利完成分析二进制文件的任务。无论你的工作角色是什么,了解这些工具的基本知识将帮助你更好地了解你的 Linux 系统。Gaurav Kamathe 介绍了一些最流行的用于管理二进制文件的 Linux 工具和命令,包括 `file`、`nm`、`strings` 和 `hexdump`。 + +### 《可用于 Linux 命令行的 4 种 Markdown 工具》 + +> **[文章地址][6]** + +当涉及使用 Markdown 格式的文件时,命令行工具占据了主导地位。它们轻巧、快速、强大而又灵活,其中大多数遵循 Unix “把一件事情做好”的哲学。Scott Nesbitt 回顾了 4 种命令行实用工具,它们可以帮助你更高效地处理 Markdown 文件。 + +### 《禁用 atime 来提高 Linux 系统性能》 + +> **[文章地址][7]** + +每当我在为家里的电脑升级 Linux 时,我都会把我通常要做的任务列出来。这些年来,它们已经成为了习惯:备份文件、还原系统、重新安装、恢复文件,然后重新安装额外的我最喜欢的应用程序。我还会对系统进行了一些调整。其中一个调整就是 `atime`,它是 Linux 里每个文件的三个时间戳之一。关掉 `atime` 是一种简单但有效的提升系统性能的方法。下面是关于 `atime` 的介绍,以及为什么它会有影响。 + +### 《使用 fstrim 延长固态硬盘的寿命》 + +> **[文章地址][8]** + +在过去的十年中,固态硬盘(SSD)带来了一种全新的管理存储的方式。相比传统的机械硬盘,固态硬盘具有一些优点,比如安静、更酷的操作和更快的接口规格。当然,新技术带来了新的维护和管理方法。Alan Formy-Duval 写了一个新的 systemd 服务让你更容易管理固态硬盘。 + +### 《Linux 命令行工具的 5 种新式替代品》 + +> **[文章地址][9]** + +在我们日常使用的 Linux 或 Unix 系统中,我们会使用许多命令行工具来完成我们的工作,并帮助我们更好地了解和管理我们的系统。多年来,这些工具已经现代化并移植到了不同的系统中。然而,总的来讲,它们仍然保持着最初的想法、外观和感觉。近年来,开源社区已经开发出了提供额外好处的替代工具。Ricardo Gerardi 向我们展示了如何通过这 5 种新的替代品改进旧的命令行工具来获得新的好处。 + +### 总结 + +把这些文章作为跳板,寻找你自己关于命令行的技巧和花招吧!这份清单里还缺少什么吗?请在下方评论,或者提交一篇你自己的文章! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/linux-commands + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) +[2]: https://linux.cn/article-12344-1.html +[3]: https://opensource.com/article/20/7/performance-linux-terminal +[4]: https://opensource.com/article/20/3/fish-shell +[5]: https://linux.cn/article-12187-1.html +[6]: https://linux.cn/article-12048-1.html +[7]: https://opensource.com/article/20/6/linux-noatime +[8]: https://linux.cn/article-11959-1.html +[9]: https://opensource.com/article/20/6/modern-linux-command-line-tools diff --git a/published/20210122 Convert your filesystem to Btrfs.md b/published/20210122 Convert your filesystem to Btrfs.md new file mode 100644 index 0000000000..00cfa03fc9 --- /dev/null +++ b/published/20210122 Convert your filesystem to Btrfs.md @@ -0,0 +1,316 @@ +[#]: collector: (lujun9972) +[#]: translator: (hwlife) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14577-1.html) +[#]: subject: (Convert your filesystem to Btrfs) +[#]: via: (https://fedoramagazine.org/convert-your-filesystem-to-btrfs/) +[#]: author: (Gergely Gombos https://fedoramagazine.org/author/gombosg/) + +如何将你的文件系统转换为 Btrfs +====== + +![][1] + +### 引言 + +这篇概述文章将告诉你为何以及如何迁移你的当前分区到 Btrfs 文件系统。如果你对此感兴趣,请阅读这篇分步指南来完成。 + +从 Fedora 33 开始,新安装的 Fedora 操作系统默认文件系统为 Btrfs。我确信大部分用户现在已经听说了它的优势:写时复制、内置校验、灵活的压缩方式、简易的快照和回滚方式。它确实是一个现代化的文件系统,为桌面存储带来新的功能。 + +在升级到 Fedora 33 后,我想利用 Btrfs 的优势,但对我个人来说,我不想因为“只是为了改变文件系统”而去重装整个系统。我发现(只有)寥寥无几的具体如何做转换的教程,所以我决定在这里分享我的详细经验。 + +### 小心! + +这样做你是在玩火。希望你阅读以下内容时不要感到惊讶: + +> 在编辑分区和转换文件系统时,你的数据可能会被破坏和丢失。最终,你可能会得到一个不能启动的操作系统,并面临数据恢复的风险。你可能会无意删除你的分区,或者以其它方式破坏了你的操作系统。 + +这些转换过程即使对于生产系统来说也是安全的 —— 前提是你提前做好了计划,对关键数据做好了备份和回滚计划。作为一个 _可以执行超级权限的系统管理员_,你可以在没有限制、没有任何常规安全防护措施的情况下,做任何事情。 + +### 安全的方式:重装 Fedora + +重装操作系统是转换文件系统到 Btrfs 的 “官方” 方式,推荐给大多数用户使用。因此,如果在这个教程中有那么一点不确定,就选择这种方式。步骤大致如下: + + 1. 备份你的主文件夹和你系统中可能会用到的任何数据,比如 `/etc`。(编者按:虚拟机也是这样) + 2. 将已安装的安装包以列表形式保存到到文件中。 + 3. 重新安装 Fedora,删除你当前的分区,并选择新的 Btrfs 默认分区方案。 + 4. 恢复主文件夹的内容,并使用软件包列表文件重装软件包。 + +对于详细的步骤和命令,请看一位社区用户在 [ask.fedoraproject.org][2] 站点的评论。如果正确完成,你将得到一个和之前一样的操作系统,使丢失数据的风险最小化。 + +### 转换的利弊 + +让我们快速澄清一下:这种文件系统转换有什么优势和劣势? + +**优势:** + + * 当然,不需要重新安装!你的系统里的所有文件和之前一模一样。 + * 技术上来说,没有备份的情况下,就地进行是可能的。 + * 你会学到许多关于 Btrfs 的知识! + * 如果所有都按计划进行,会是相当快的一个过程。 + +**劣势:** + + * 你必须熟悉终端环境和 shell 命令。 + * 你可能会丢失数据,参见上文。 + * 如果出了什么问题,你得自己解决。 + +**特别之处:** + + * 你需要大约 20% 的可用磁盘空间才能成功转换。但对于完整的备份和重装方式,你可能需要的空间更多。 + * 你可以在转换过程中自定义你分区的所有参数,但如果选择重装,你也可以从 Anaconda 自定义。 + +### LVM 怎么办? + +在近期几次 Fedora 安装中,LVM 布局一直是默认的。如果你有一个带有多个分区(例如 `/` 和 `/home`)的 LVM 分区布局,你得以某种方式合并它们,来获得 Btrfs 所有性能。 + +如果选择这样做,你可以单独转换分区到 Btrfs 文件系统,同时保留卷组。然而,迁移到 Btrfs 文件系统的优势之一是摆脱 LVM 分区布局强加的限制。你也可以利用 Btrfs 文件系统提供的收发功能在转换后来合并分区。 + +> 另见 《Fedora 杂志》: [利用 LVM 回收硬盘空间][3]、[从 Btrfs 快照中恢复文件][4] 以及 [在 Btrfs 和 LVM-ext4 两者之间做选择][5]。 + +### 了解 Btrfs + +建议阅读以下内容对 Btrfs 文件系统是什么有一个基础的了解。如果你没有把握,只有选择重装 Fedora 这种安全的方式。 + +必须了解的: + + * [Fedora Magazine:Btrfs 来到 Fedora 33][6] + * [Btrfs 系统管理指南][7], _尤其是_ 关于子卷和 flat 子卷布局。 + * [btrfs-convert 指南][8] + +有用的资源: + + * [man 8 btrfs][9] – 命令行界面 + * [man 5 btrfs][10] – 挂载参数 + * [man btrfs-convert][11] – 要用到的转换工具 + * [man btrfs-subvolume][12] – 管理子卷 + +### 转换步骤 + +#### 创建一个实时镜像 + +由于不能转换已挂载的文件系统,我们将通过 Fedora 实时镜像Live Image进行。安装 [Fedora 镜像写入工具][13],然后 “烧录” Fedora 33 到你的 U 盘中来创建实时镜像。 + +#### 释放磁盘空间 + +`btrfs-convert` 会在分区的剩余空间重新创建文件系统的元数据,同时保持所有已有的 ext4 文件系统数据还在它当前的位置上。 + +不幸的是,所需的剩余空间的大小无法提前知道:如果没有足够的空间,转换将会失败(但不会破坏数据)。这里有一些释放空间有用的方法: + + * 利用 `baobab` 来识别大容量的文件和文件夹,然后移除。如果可能的话,不要手动删除主文件夹以外的文件。 + * 清理旧的系统日志:`journalctl –vacuum-size=100M`。 + * 如果你正使用 Docker,请小心地使用类似 `docker volume prune`、`docker image prune -a` 这样的工具。 + * 清理 GNOME Boxes 之类的虚拟机内不用的镜像。 + * 清理不用的软件包和 Flatpak 包:`dnf autoremove`、`flatpak remove –unused`。 + * 清理软件包缓存:`pkcon refresh force -c -1`、`dnf clean all`。 + * 如果你有把握,你可以谨慎的清理 `~/.cache` 文件夹。 + +#### 转换到 Btrfs + +备份你所有有价值的数据,确保你的系统已完全更新,然后重启到实时镜像。运行 `gnome-disks` 工具找到你所拥有的设备的路径,比如 `/dev/sda1`(如果你在使用 LVM,它可能看起来有所不同)。检查文件系统然后执行转换:(编者按:以下命令使用 root 用户运行,谨慎使用!) + +``` +$ sudo su - +# fsck.ext4 -fyv /dev/sdXX (请替换为你的具体的设备路径) +# man btrfs-convert (阅读它) +# btrfs-convert /dev/sdXX (请替换为你的具体的设备路径) +``` + +这将会花十几分钟甚至几个小时,依据分区的大小和是机械硬盘还是固态硬盘。如果你看到错误,你可能需要更多剩余空间。作为最后的手段,你可以尝试 `btrfs-convert -n`。 + +#### 怎样回滚? + +如果因为某些原因转换失败,你的分区将保持在 ext4 文件系统或者它之前的状态。如果你想在成功转换之后回滚,简单如下: + +``` +# btrfs-convert -r /dev/sdXX +``` + +> **警告!** 如果你做了以下这些事情之一,你将永久失去回滚的功能:碎片整理、均衡或者删除 `ext2_saved` 子卷。 + +由于 Btrfs 文件系统的写时复制特性,你可以安全的复制/移动甚至删除文件、创建子卷,因为 `ext2_saved` 会保持引用旧数据。 + +#### 挂载和检查 + +现在这个分区应该已经有了 Btrfs 文件系统。挂载它然后查看你的文件……和子卷! + +``` +# mount /dev/sdXX /mnt (请替换为你的具体的设备路径) +# man btrfs-subvolume (阅读它) +# btrfs subvolume list / (使用 -t 以表格方式查看) +``` + +因为你已经阅读了 [相关的手册页][14],你应该知道创建子卷快照是安全的,并且有 `ext2-saved` 子卷作为你之前数据的简易备份。 + +> 是时候阅读 [Btrfs 系统管理指南][7]了,这样你就不会把常规文件夹和子卷混淆了。 + +#### 创建子卷 + +我们希望实现一个“扁平”子卷布局,这和 Anaconda 默认创建的布局相同: + +``` +toplevel (卷根目录,不能被默认挂载) + +-- root (子卷根目录,被挂载到 /) + +-- home (子卷根目录,被挂载到 /home) +``` + +你可以跳过这个步骤,或者使用一个不同的布局。这种特殊结构的优势是你可以轻松的创建 `/home` 的快照,并且对每个子卷使用不同的压缩和挂载参数。 + +``` +# cd /mnt +# btrfs subvolume snapshot ./ ./root2 +# btrfs subvolume create home2 +# cp -a home/* home2/ +``` + +这里我们已经创建了两个子卷。`root2` 是一个完整的分区快照,而 `home2` 开始是一个空子卷,然后我们往里复制内容。(这个 `cp` 命令不会重复数据,所以会很快。) + + * 在 `/mnt` 目录(顶层子卷),删除除了 `root2`、`home2` 和 `ext2_saved` 之外的所有内容。 + * 重命名 `root2` 和 `home2` 子卷为 `root` 和 `home`。 + * 在 `root` 子卷里,清空 `home` 目录,以便之后我们能够挂载 `home` 子卷。 + +如果都做对了,那就很简单了! + +#### 修改 fstab 分区表 + +为了重启之后挂载新卷,必须要修改 `fstab`,用新的行来代替旧的 ext4 文件系统挂载行。 + +你可以使用 `blkid` 命令来找到你的分区的 UUID。 + +``` +UUID=xx / btrfs subvol=root 0 0 (请替换为你的具体 UUID) +UUID=xx /home btrfs subvol=home 0 0 (请替换为你的具体 UUID) +``` + +(注意如果指向的是同一个分区,那么这两个 UUID 是相同的。) + +这些都是新安装的 Fedora 33 的默认值。在 `fstab` 中,你也可以选择自定义压缩和添加类似 `noatime` 这样的参数。 + +> 可以查看 [关于压缩参数的维基页面][15] 和 [man 5 btrfs][10] 了解所有相关的参数。 + +#### chroot 到系统 + +如果你曾经做过系统恢复,我想你肯定知道这些命令。这里,我们将得到一个 _基本上_ 在你系统里的 shell 提示符,可以访问网络。 + +首先,我们必须重新挂载 `root` 子卷到 `/mnt` 目录,然后挂载 `/boot` 和 `/boot/efi` 分区(它们可能有所不同,这取决于你的文件系统布局): + +``` +# umount /mnt +# mount -o subvol=root /dev/sdXX /mnt (请替换为你的具体的设备路径) +# mount /dev/sdXX /mnt/boot (请替换为你的具体的设备路径) +# mount /dev/sdXX /mnt/boot/efi (请替换为你的具体的设备路径) +``` + +然后我们继续挂载系统设备: + +``` +# mount -t proc /proc /mnt/proc +# mount --rbind /dev /mnt/dev +# mount --make-rslave /mnt/dev +# mount --rbind /sys /mnt/sys +# mount --make-rslave /mnt/sys +# cp /mnt/etc/resolv.conf /mnt/etc/resolv.conf.chroot +# cp -L /etc/resolv.conf /mnt/etc +# chroot /mnt /bin/bash +$ ping www.fedoraproject.org +``` + +#### 重装 GRUB 及内核 + +最容易的方法就是重装 GRUB 和 内核,因为它完成了所有必要的配置 —— 现在我们可以访问网络了。所以,在 chroot 环境内部: + +``` +# mount /boot/efi +# dnf reinstall grub2-efi shim +# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg +# dnf reinstall kernel-core +...或者干脆重新生成 initramfs: +# dracut --kver $(uname -r) --force +``` + +如果你是支持 UEFI 的系统,这里是适用的。如果你是 BIOS 的系统,请查看下面的文档。重启之前,让我们查看是否一切正常: + +``` +# cat /boot/grub2/grubenv +# cat /boot/efi/EFI/fedora/grub.cfg +# lsinitrd /boot/initramfs-$(uname -r).img | grep btrfs +``` + +你应该在 `grubenv` 和 `grub.cfg` 有正确的分区 UUID 或指向(`grubenv` 可能没有更新,如有必要可以编辑它),并在 `grub.cfg` 中看到 `insmod btrfs` 配置和在 initramfs 镜像中有 btrfs 模块。 + +> 参见: Fedora 系统管理指南中的 [重装 GRUB 2][16] 和 [验证初始 RAM 磁盘镜像][17] 。 + +#### 重启 + +现在系统能够正常启动。如果不能,别慌,回到实时镜像修复这个问题。最坏的情况下,你可以从那里重装 Fedora 。 + +#### 首次启动之后 + +检查你的新 Btrfs 文件系统一切都正常。如果你觉得没问题,你需要回收旧的 ext4 快照使用的空间,进行碎片整理和平衡子卷。后两者可能要花一些时间,并且相当耗费资源。 + +对此你必须这样挂载顶级子卷: + +``` +# mount /dev/sdXX -o subvol=/ /mnt/someFolder +# btrfs subvolume delete /mnt/someFolder/ext2_saved +``` + +然后,当机器有空闲时间时,运行这些命令: + +``` +# btrfs filesystem defrag -v -r -f / +# btrfs filesystem defrag -v -r -f /home +# btrfs balance start -m / +``` + +最后,有一个 “非写时复制” [属性][18],对于新系统,这个属性是为虚拟机镜像文件夹自动设置的。如果你使用虚拟机的话,可以设置它: + +``` +# chattr +C /var/lib/libvirt/images +``` + +``` +$ chattr +C ~/.local/share/gnome-boxes/images +``` + +这个属性只会对在这些文件夹里的新文件生效。复制镜像并删除原镜像,你可以通过 `lsattr` 确认结果。 + +### 总结 + +我真心希望你发现这个教程是有用的,并且能够对是否在你的系统上转换为 Btrfs 做出谨慎而明智的决定。祝你成功转换! + +欢迎在评论中分享你的经验,或者遇到更深层次的问题,请在 [ask.fedoraproject.org][19] 提问。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/convert-your-filesystem-to-btrfs/ + +作者:[Gergely Gombos][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwllife) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/gombosg/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/08/butterfs-816x346.png +[2]: https://ask.fedoraproject.org/t/conversion-of-an-existing-ext4-fedora-32-system-completely-to-btrfs/9446/6?u=gombosghttps://ask.fedoraproject.org/t/conversion-of-an-existing-ext4-fedora-32-system-completely-to-btrfs/9446/6?u=gombosg +[3]: https://fedoramagazine.org/reclaim-hard-drive-space-with-lvm/ +[4]: https://fedoramagazine.org/recover-your-files-from-btrfs-snapshots/ +[5]: https://fedoramagazine.org/choose-between-btrfs-and-lvm-ext4/ +[6]: https://fedoramagazine.org/btrfs-coming-to-fedora-33/ +[7]: https://btrfs.wiki.kernel.org/index.php/SysadminGuide +[8]: https://btrfs.wiki.kernel.org/index.php/Conversion_from_Ext3 +[9]: https://www.mankier.com/8/btrfs +[10]: https://www.mankier.com/5/btrfs +[11]: https://www.mankier.com/8/btrfs-convert +[12]: https://www.mankier.com/8/btrfs-subvolume +[13]: https://getfedora.org/en/workstation/download/ +[14]: https://www.mankier.com/8/btrfs-subvolume#Subvolume_and_Snapshot +[15]: https://btrfs.wiki.kernel.org/index.php/Compression +[16]: https://docs.fedoraproject.org/en-US/fedora/f33/system-administrators-guide/kernel-module-driver-configuration/Working_with_the_GRUB_2_Boot_Loader/#sec-Reinstalling_GRUB_2 +[17]: https://docs.fedoraproject.org/en-US/fedora/f33/system-administrators-guide/kernel-module-driver-configuration/Manually_Upgrading_the_Kernel/#sec-Verifying_the_Initial_RAM_Disk_Image +[18]: https://www.mankier.com/1/chattr#Attributes-C +[19]: https://ask.fedoraproject.org/ diff --git a/published/20210211 31 open source text editors you need to try.md b/published/20210211 31 open source text editors you need to try.md new file mode 100644 index 0000000000..2ce2044280 --- /dev/null +++ b/published/20210211 31 open source text editors you need to try.md @@ -0,0 +1,163 @@ +[#]: collector: (lujun9972) +[#]: translator: (CoWave-Fall) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14632-1.html) +[#]: subject: (31 open source text editors you need to try) +[#]: via: (https://opensource.com/article/21/2/open-source-text-editors) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +值得尝试的 30 个开源文本编辑器 +====== + +> 正在寻找新的文本编辑器?这里有 31 个编辑器可供尝试。 + +![](https://img.linux.net.cn/data/attachment/album/202205/24/184603krbzynnnikz8b0nc.jpg) + +计算机是基于文本的,因此你使用它们做的事情越多,你可能就越需要文本编辑应用程序。你在文本编辑器上花费的时间越多,你就越有可能对你使用的编辑器提出更多的要求。 + +如果你正在寻找一个好的文本编辑器,你会发现 Linux 可以提供很多。无论你是想在终端、桌面还是在云端工作,你都可以试一试。你可以每天一款编辑器,连续着试一个月(或每月试一个,能够试三年)。坚持不懈,你终将找到适合你的完美的编辑器。 + +### Vim 类编辑器 + +![][2] + +* [Vi][3] 通常随着 Linux 各发行版、BSD、Solaris 和 macOS 一起安装。它是典型的 Unix 文本编辑器,具有编辑模式和超高效的单键快捷键的独特组合。最初的 Vi 编辑器由 Bill Joy 编写(他也是 C shell 的作者)。Vi 的现代版本,尤其是 Vim,增加了许多特性,包括多级撤消、在插入模式下更好的导航、行折叠、语法高亮、插件支持等等。但它需要学习如何使用(它甚至有自己的教程程序,`vimtutor`)。 +* [Kakoune][4] 是一个受 Vim 启发的应用程序,它具有熟悉的简约界面、短键盘快捷键以及独立的编辑和插入模式。乍一看,它的外观和感觉很像 Vi,但它在设计和功能上有自己独特的风格。 它有一个小彩蛋:具有 Clippy 界面的实现。 + +### emacs 编辑器 + +![][5] + +* 从最初的免费 emacs 开始,发展到发起了自由软件运动的 GNU 项目的第一批官方应用程序,[GNU Emacs][6] 是一个广受欢迎的文本编辑器。它非常适合系统管理员、开发人员和日常用户的使用,具有大量功能和近乎无穷无尽的扩展。一旦你开始使用 emacs,你可能会发现很难想出一个理由来关闭它,因为它能做的事情非常多! +* 如果你喜欢 emacs,但觉得 GNU Emacs 过于臃肿,那么你可以试试 [Jove][7]。Jove 是一个基于终端的 emacs 编辑器。它很容易使用,但是如果你是使用 emacs 编辑器家族的新手,那么 Jove 也是很容易学习的,这要归功于 `teajove` 命令。 +* 另一个轻量级的 emacs 编辑器是 [Jed][8]。它的工作流程基于宏。它与其他编辑器的不同之处在于它使用了 [S-Lang][9],这是一种类似 C 的脚本语言,它为使用 C 而不是使用 Lisp 的开发人员提供了扩展的机会。 + +### 交互式编辑器 + +![][10] + +* [GNU nano][11] 对基于终端的文本编辑采取了大胆的立场:它提供了一个菜单。是的,这个不起眼的编辑器从 GUI 编辑器那里得到了提示,它告诉用户他们需要按哪个键来执行特定的功能。这是一种令人耳目一新的用户体验,所以难怪 nano 被设置为“用户友好”发行版的默认编辑器,而不是 Vi。 +* [JOE][12] 基于一个名为 WordStar 的旧文本编辑应用程序。如果你不熟悉 Wordstar,JOE 也可以模仿 Emacs 或 GNU nano。默认情况下,它是介于 Emacs 或 Vi 等相对神秘的编辑器和 GNU Nano 永远显示的冗长信息之间的一个很好的折衷方案(例如,它告诉你如何激活屏幕帮助显示,但默认情况下不启用)。 +* [e3][13] 是一个优秀的小型文本编辑器,具有五个内置的键盘快捷键方案,用来模拟 Emacs、Vi、nano、NEdit 和 WordStar。换句话说,无论你习惯使用哪种基于终端的编辑器,你都可能对 e3 感到宾至如归。 + +### ed 及像 ed 一样的编辑器 + +* [POSIX][15] 和 Open Group 定义了基于 Unix 的操作系统的标准,[ed][14] 行编辑器是它的一部分。它安装在你遇到的几乎所有 Linux 或 Unix 系统上。它小巧、简洁、一流。 +* 基于 ed,[Sed][16] 流编辑器因其功能和语法而广受欢迎。大多数 Linux 用户在搜索如何最简单、最快捷的更新配置文件中的行的方法时,至少会遇到一个 `sed` 命令,但它值得仔细研究一下。Sed 是一个强大的命令,包含许多有用的子命令。更好地了解了它,你可能会发现自己打开文本编辑器应用程序的频率要低得多。 +* 你并不总是需要文本编辑器来编辑文本。[heredoc][17](或 Here Doc)系统可在任何 POSIX 终端中使用,允许你直接在打开的终端中输入文本,然后将输入的内容通过管道传输到文本文件中。这不是最强大的编辑体验,但它用途广泛且始终可用。 + +### 极简风格的编辑器 + +![][18] + +如果你认为一个好的文本编辑器就是一个文字处理器(除了没有所有的处理功能)的话,你可能正在寻找这些经典编辑器。这些编辑器可让你以最少的干扰和最少的帮助写作和编辑文本。它们提供的功能通常以标记文本、Markdown 或代码为中心。有些名称遵循某种模式: + +* [Gedit][19] 来自 GNOME 团队; +* [medit][20] 有经典的 GNOME 手感; +* [Xedit][21] 仅使用最基本的 X11 库; +* [jEdit][22] 适用于 Java 爱好者。 + +KDE 用户也有类似的: + +* [Kate][23] 是一款低调的编辑器,拥有你需要的几乎所有功能; +* [KWrite][24] 在看似简单易用的界面中隐藏了大量有用的功能。 + +还有一些适用于其他平台: + +* [Pe][26] 适用于 Haiku OS(90 年代那个古怪的孩子 BeOS 的转世); +* [FeatherPad][27] 是适用于 Linux 的基本编辑器,但对 macOS 和 Haiku 有一些支持。如果你是一名希望移植代码的 Qt 黑客,请务必看一看! + +### 集成开发环境(IDE) + +![][28] + +文本编辑器和集成开发环境(IDE)有很多相同之处。后者实际上只是前者加上许多为特定代码而添加的功能。如果你经常使用 IDE,你可能会在扩展管理器中发现一个 XML 或 Markdown 编辑器: + +* [NetBeans][29] 是一个方便 Java 用户的文本编辑器。 +* [Eclipse][30] 提供了一个强大的编辑套件,其中包含许多扩展,可为你提供所需的工具。 + +### 云端编辑器 + +![][31] + +在云端工作?当然,你也可以在那里进行编辑。 + +* [Etherpad][32] 是在网上运行的文本编辑器应用程序。有独立免费的实例供你使用,或者你也可以设置自己的实例。 +* [Nextcloud][33] 拥有蓬勃发展的应用场景,包括内置文本编辑器和具有实时预览功能的第三方 Markdown 编辑器。 + +### 较新的编辑器 + +![][34] + +每个人都会有让文本编辑器变得更完美的想法。因此,几乎每年都会发布新的编辑器。有些以一种新的、令人兴奋的方式重新实现经典的旧想法,有些对用户体验有独特的看法,还有些则专注于特定的需求。 + +* [Atom][35] 是来自 GitHub 的多功能的现代文本编辑器,具有许多扩展和 Git 集成。 +* [Brackets][36] 是 Adobe 为 Web 开发人员提供的编辑器。 +* [Focuswriter][37] 旨在通过无干扰的全屏模式、可选的打字机音效和精美的配置选项等有用功能帮助你专注于写作。 +* [Howl][38] 是一个基于 Lua 和 Moonscript 的渐进式动态编辑器。 +* [Norka][39] 和 [KJots][40] 模仿笔记本,每个文档代表“活页夹”中的“页面”。你可以通过导出功能从笔记本中取出单个页面。 + +### 自己制作编辑器 + +![][41] + +俗话说得好:既然可以编写自己的应用程序,为什么要使用别人的(虽然其实没有这句俗语)?虽然 Linux 有超过 30 个常用的文本编辑器,但是再说一次,开源的一部分乐趣在于能够亲手进行实验。 + +如果你正在寻找学习编程的理由,那么制作自己的文本编辑器是一个很好的入门方法。你可以在大约 100 行代码中实现基础功能,并且你使用它的次数越多,你可能就越会受到启发,进而去学习更多知识,从而进行改进。准备好开始了吗?来吧,去 [创建你自己的文本编辑器][42]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/open-source-text-editors + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[CoWave-Fall](https://github.com/CoWave-Fall) +校对:[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/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx (open source button on keyboard) +[2]: https://opensource.com/sites/default/files/kakoune-screenshot.png +[3]: https://opensource.com/article/20/12/vi-text-editor +[4]: https://opensource.com/article/20/12/kakoune +[5]: https://opensource.com/sites/default/files/jed.png +[6]: https://opensource.com/article/20/12/emacs +[7]: https://opensource.com/article/20/12/jove-emacs +[8]: https://opensource.com/article/20/12/jed +[9]: https://www.jedsoft.org/slang +[10]: https://opensource.com/sites/default/files/uploads/nano-31_days-nano-opensource.png +[11]: https://opensource.com/article/20/12/gnu-nano +[12]: https://opensource.com/article/20/12/31-days-text-editors-joe +[13]: https://opensource.com/article/20/12/e3-linux +[14]: https://opensource.com/article/20/12/gnu-ed +[15]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[16]: https://opensource.com/article/20/12/sed +[17]: https://opensource.com/article/20/12/heredoc +[18]: https://opensource.com/sites/default/files/uploads/gedit-31_days_gedit-opensource.jpg +[19]: https://opensource.com/article/20/12/gedit +[20]: https://opensource.com/article/20/12/medit +[21]: https://opensource.com/article/20/12/xedit +[22]: https://opensource.com/article/20/12/jedit +[23]: https://opensource.com/article/20/12/kate-text-editor +[24]: https://opensource.com/article/20/12/kwrite-kde-plasma +[25]: https://opensource.com/article/20/12/notepad-text-editor +[26]: https://opensource.com/article/20/12/31-days-text-editors-pe +[27]: https://opensource.com/article/20/12/featherpad +[28]: https://opensource.com/sites/default/files/uploads/eclipse-31_days-eclipse-opensource.png +[29]: https://opensource.com/article/20/12/netbeans +[30]: https://opensource.com/article/20/12/eclipse +[31]: https://opensource.com/sites/default/files/uploads/etherpad_0.jpg +[32]: https://opensource.com/article/20/12/etherpad +[33]: https://opensource.com/article/20/12/31-days-text-editors-nextcloud-markdown-editor +[34]: https://opensource.com/sites/default/files/uploads/atom-31_days-atom-opensource.png +[35]: https://opensource.com/article/20/12/atom +[36]: https://opensource.com/article/20/12/brackets +[37]: https://opensource.com/article/20/12/focuswriter +[38]: https://opensource.com/article/20/12/howl +[39]: https://opensource.com/article/20/12/norka +[40]: https://opensource.com/article/20/12/kjots +[41]: https://opensource.com/sites/default/files/uploads/this-time-its-personal-31_days_yourself-opensource.png +[42]: https://opensource.com/article/20/12/31-days-text-editors-one-you-write-yourself diff --git a/published/20210305 Build a printer UI for Raspberry Pi with XML and Java.md b/published/20210305 Build a printer UI for Raspberry Pi with XML and Java.md new file mode 100644 index 0000000000..6d7c365d54 --- /dev/null +++ b/published/20210305 Build a printer UI for Raspberry Pi with XML and Java.md @@ -0,0 +1,255 @@ +[#]: subject: (Build a printer UI for Raspberry Pi with XML and Java) +[#]: via: (https://opensource.com/article/21/3/raspberry-pi-totalcross) +[#]: author: (Edson Holanda Teixeira Junior https://opensource.com/users/edsonhtj) +[#]: collector: (lujun9972) +[#]: translator: (CoWave-Fall) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14620-1.html) + +用 XML 和 Java 构建树莓派打印机的用户界面 +====== + +> 使用 TotalCross 来快速构建嵌入式系统程序的用户界面。 + +![](https://img.linux.net.cn/data/attachment/album/202205/21/110711zv3t7n1o7hllhodt.jpg) + +从头开始构建 GUI 是一个非常耗时的过程,以硬编码的方式处理所有的位置和对齐对于一些程序员来说确实很困难。所以在本文中,我将演示如何使用 XML 加快这一过程。 + +本项目使用 [TotalCross][2] 作为目标框架。TotalCross 是一个开源的跨平台软件开发工具包(SDK),旨在更快地为嵌入式设备创建 GUI。TotalCross 无需在设备上运行 Java 即可提供 Java 的开发优势,因为它使用自己的字节码和虚拟机(TC 字节码TC bytecode 和 TCVM)来增强性能。 + +我还使用了 Knowcode-XML,这是一个用于 TotalCross 框架的开源 XML 解析器,它可以将 XML 文件转换为 TotalCross 组件。 + +### 项目需求 + +要重现此项目,你需要: + + * [KnowCode-XML][3] + * [VSCode][4] 或 [VSCodium][5] + * [一个 Android 开发环境][6] + * [用于 VSCode 的 TotalCross 插件][7] + * 适用于你的开发平台([Linux][8]、[Mac][9] 或 [Windows][10])的 Java,需要 Java 11(或更高版本) + * [Git][11] + +### 制作嵌入式应用程序 + +该应用程序由一个具有扫描、打印和复印等基本打印功能的嵌入式 GUI 组成。 + +![打印机初始化画面][12] + +构建这个 GUI 需要几个步骤,包括使用 Android-XML 生成 GUI,然后使用 Knowcode-XML 解析器在 TotalCross 框架上运行它。 + +#### 1、生成 Android XML + +要创建 XML 文件,首先构建一个简单的 Android 屏幕,然后对其进行自定义。如果你不知道如何编写 Android-XML,或者你只是想简单尝试一下,你可以从这个 [GitHub 项目][14] 中下载这个应用程序的 XML。该项目还包含渲染 GUI 要用到的图片。 + +#### 2、调整 XML + +生成 XML 文件后,你需要进行一些微调以确保所有内容都已经对齐、比例正确并且图像的路径正确。 + +将 XML 布局添加到 `Layouts` 文件夹,将所有资源添加到 `Drawable` 文件夹。然后你就可以开始自定义 XML 了。 + +例如,如果想要更改 XML 对象的背景,可以更改 `android:background` 属性: + +``` +android:background="@drawable/scan" +``` + +你也可以使用 `tools:layout_editor_absoluteX` 和 `tools:layout_editor_absoluteY` 更改对象的位置: + +``` +tools:layout_editor_absoluteX="830dp" +tools:layout_editor_absoluteY="511dp" +``` + +或者使用 `android:layout_width` 和 `android:layout_height` 更改对象的大小: + +``` +android:layout_width="70dp" +android:layout_height="70dp" +``` + +如果要在对象上放置文本,可以使用 `android:textSize`、`android:text`、`android:textStyle` 和 `android:textColor`: + +``` +android:textStyle="bold" +android:textColor="#000000" +android:textSize="20dp" +android:text="2:45PM" +``` + +下面是一个完整的 XML 对象的示例: + +``` + +``` + +#### 3、在 TotalCross 上运行 GUI + +完成所有 XML 调整后,就可以在 TotalCross 上运行它了。在 TotalCross 扩展(LCTT 译注:在 VSCode 里面)上创建一个新项目,并将 `XML` 和 `Drawable` 文件夹添加到 `Main` 文件夹里。如果你仍然不确定如何创建 TotalCross 项目,请参阅我们的 [入门指南][15]。 + +配置好环境后,使用 `totalcross.knowcode.parse.XmlContainerFactory` 和 `import totalcross.knowcode.parse.XmlContainerLayout` 在 TotalCross 框架上使用 XML GUI。 你可以在其 [GitHub 页面][3] 上找到更多关于使用 KnowCode-XML 的信息。 + +#### 4、添加过渡效果 + +这个项目的平滑过渡效果是由 `SlidingNavigator` 类创建的,它使用 TotalCross 的 `ControlAnimation` 类从一个屏幕滑到另一个屏幕。 + +在 `XMLpresenter` 类上调用 `SlidingNavigator`: + +``` +new SlidingNavigator(this).present(HomePresenter.class); +``` + +在 `SlidingNavigator` 类上实现 `present` 函数: + +``` +public void present(Class presenterClass) + throws InstantiationException, IllegalAccessException { + final XMLPresenter presenter = cache.containsKey(presenterClass) ? cache.get(presenterClass) + : presenterClass.newInstance(); + if (!cache.containsKey(presenterClass)) { + cache.put(presenterClass, presenter); + } + + if (presenters.isEmpty()) { + window.add(presenter.content, LEFT, TOP, FILL, FILL); + } else { + XMLPresenter previous = presenters.lastElement(); + + window.add(presenter.content, AFTER, TOP, SCREENSIZE, SCREENSIZE, previous.content); +``` + +使用动画控件中的 `PathAnimation` 来创建从一个屏幕到另一个屏幕的滑动动画: + +``` + PathAnimation.create(previous.content, -Settings.screenWidth, 0, new ControlAnimation.AnimationFinished() { + @Override + public void onAnimationFinished(ControlAnimation anim) { + window.remove(previous.content); + } + }, 1000).with(PathAnimation.create(presenter.content, 0, 0, new ControlAnimation.AnimationFinished() { + @Override + public void onAnimation Finished(Control Animation anim) { + presenter.content.setRect(LEFT, TOP, FILL, FILL); + } + }, 1000)).start(); + } + presenter.setNavigator(this); + presenters.push(presenter); + presenter.bind2(); + if (presenter.isFirstPresent) { + presenter.onPresent(); + presenter.isFirstPresent = false; + } +``` + +#### 5、加载环形进度条 + +打印机应用程序的另一个不错的功能是显示进度的加载屏幕动画。它包括文本和旋转动画。 + +![加载环形进度条][18] + +通过添加定时器和定时器监听器来更新进度标签,然后调用函数 `spinner.start()` 来实现此功能。所有的动画都是由 TotalCross 和 KnowCode 自动生成的: + +``` +public void startSpinner() { + time = content.addTimer(500); + content.addTimerListener((e) -> { + try { + progress(); // Updates the Label + } catch (InstantiationException | IllegalAccessException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + }); + Spinner spinner = (Spinner) ((XmlContainerLayout) content).getControlByID("@+id/spinner"); + spinner.start(); + } +``` + +这里的环形进度条被实例化为对 XML 文件中描述的 `XmlContainerLayout` `spinner` 的引用: + +``` + +``` + +#### 6、构建应用程序 + +是时候构建应用程序了。你可以在 `pom.xml` 中查看和更改目标系统target systems。 请确保 `Linux Arm` 目标可用。 + +如果你使用的是 VSCode,请按下键盘上的 `F1` 键,选择 `TotalCross: Package` 并等待完成。 然后就可以在 `Target` 文件夹中看到安装文件了。 + +#### 7、在树莓派上部署和运行应用程序 + +要使用 SSH 协议在 [树莓派][19] 上部署应用程序,请按键盘上的 `F1`。选择 `TotalCross: Deploy&Run` 并提供有关你的 SSH 连接的信息,如:用户名、IP地址、密码和应用程序路径。 + +![TotalCross:部署与运行][20] + +![配置 SSH 用户名][21] + +![配置 IP 地址][22] + +![输入密码][23] + +![配置路径][24] + +### 总结 + +KnowCode 让使用 Java 创建和管理应用程序屏幕变得更加容易。Knowcode-XML 将你的 XML 转换为 TotalCross GUI 界面,然后生成二进制文件以在你的树莓派上运行。 + +将 KnowCode 技术与 TotalCross 相结合,使你能够更快地创建嵌入式应用程序。 你可以访问我们在 GitHub 上的 [嵌入式示例][25] 并编辑你自己的应用程序,了解你还可以做什么。 + +如果你有问题、需要帮助,或者只是想与其他嵌入式 GUI 开发人员互动,请随时加入我们的 [Telegram][26] 小组,讨论任何框架上的嵌入式应用程序。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/raspberry-pi-totalcross + +作者:[Edson Holanda Teixeira Junior][a] +选题:[lujun9972][b] +译者:[CoWave-Fall](https://github.com/CoWave-Fall) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/edsonhtj +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) +[2]: https://opensource.com/article/20/7/totalcross-cross-platform-development +[3]: https://github.com/TotalCross/knowcode-xml +[4]: https://code.visualstudio.com/ +[5]: https://opensource.com/article/20/6/open-source-alternatives-vs-code +[6]: https://developer.android.com/studio +[7]: https://marketplace.visualstudio.com/items?itemName=totalcross.vscode-totalcross +[8]: https://opensource.com/article/19/11/install-java-linux +[9]: https://opensource.com/article/20/7/install-java-mac +[10]: http://adoptopenjdk.net +[11]: https://opensource.com/life/16/7/stumbling-git +[12]: https://opensource.com/sites/default/files/uploads/01_printergui.png (printer init screen) +[13]: https://creativecommons.org/licenses/by-sa/4.0/ +[14]: https://github.com/TotalCross/embedded-samples/tree/main/printer-application/src/main/resources/layout +[15]: https://totalcross.com/get-started/?utm_source=opensource&utm_medium=article&utm_campaign=printer +[16]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+instantiationexception +[17]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+illegalaccessexception +[18]: https://opensource.com/sites/default/files/uploads/03progressspinner.png (Loading Spinner) +[19]: https://www.raspberrypi.org/products/raspberry-pi-4-model-b/ +[20]: https://opensource.com/sites/default/files/uploads/04_totalcross-deployrun.png (TotalCross: Deploy&Run) +[21]: https://opensource.com/sites/default/files/uploads/05_ssh.png (SSH user) +[22]: https://opensource.com/sites/default/files/uploads/06_ip.png (IP address) +[23]: https://opensource.com/sites/default/files/uploads/07_password.png (Password) +[24]: https://opensource.com/sites/default/files/uploads/08_path.png (Path) +[25]: https://github.com/TotalCross/embedded-samples +[26]: https://t.me/totalcrosscommunity diff --git a/published/20210310 Troubleshoot WiFi problems with Go and a Raspberry Pi.md b/published/20210310 Troubleshoot WiFi problems with Go and a Raspberry Pi.md new file mode 100644 index 0000000000..6a46d97f7f --- /dev/null +++ b/published/20210310 Troubleshoot WiFi problems with Go and a Raspberry Pi.md @@ -0,0 +1,203 @@ +[#]: subject: "Troubleshoot WiFi problems with Go and a Raspberry Pi" +[#]: via: "https://opensource.com/article/21/3/troubleshoot-wifi-go-raspberry-pi" +[#]: author: "Chris Collins https://opensource.com/users/clcollins" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "turbokernel" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14560-1.html" + +使用 Go 和树莓派排查 WiFi 问题 +====== + +> 实现一个 WiFi 扫描器玩玩~ + +![](https://img.linux.net.cn/data/attachment/album/202205/08/085020czfsvsfpdg0usuph.jpg) + +去年夏天,我和妻子变卖了家产,带着我们的两只狗移居了夏威夷。这里有美丽的阳光、温暖的沙滩、凉爽的冲浪等你能想到的一切。我们同样遇到了一些意料之外的事:WiFi 问题。 + +不过,这不是夏威夷的问题,而是我们租住公寓的问题。我们住在一个单身公寓里,与房东的公寓仅一墙之隔。我们的租房协议中包含了免费的网络连接!好耶!只不过,它是由房东的公寓里的 WiFi 提供的,哇哦…… + +说实话,它的效果还不错……吧?好吧,我承认它不尽如人意,并且不知道是哪里的问题。路由器明明就在墙的另一边,但我们的信号就是很不稳定,经常会自动断开连接。在家的时候,我们的 WiFi 路由器的信号能够穿过层层墙壁和地板。事实上,它所覆盖的区域比我们居住的 600 平方英尺(大约 55 平方米)的公寓还要大。 + +在这种情况下,一个优秀的技术人员会怎么做呢?既然想知道为什么,当然是开始排查咯! + +幸运的是,我们在搬家之前并没有变卖掉树莓派 Zero W。它是如此小巧便携! 我当然就把它一起带来了。我有一个机智的想法:通过树莓派和它内置的 WiFi 适配器,使用 Go 语言编写一个小程序来测量并显示从路由器收到的 WiFi 信号。我打算先简单快速地把它实现出来,以后再去考虑优化。真是麻烦!我现在只想知道这个 WiFi 是怎么回事! + +谷歌搜索了一番后,我发现了一个比较有用的 Go 软件包 [mdlayher/wifi][2],它专门用于 WiFi 相关操作,听起来很有希望! + +### 获取 WiFi 接口的信息 + +我的计划是查询 WiFi 接口的统计数据并返回信号强度,所以我需要先找到设备上的接口。幸运的是,`mdlayher/wifi` 包有一个查询它们的方法,所以我可以创建一个 `main.go` 来实现它,具体代码如下: + +``` +package main + +import ( + "fmt" + "github.com/mdlayher/wifi" +) + +func main() { + c, err := wifi.New() + defer c.Close() + + if err != nil { + panic(err) + } + + interfaces, err := c.Interfaces() + + for _, x := range interfaces { + fmt.Printf("%+v\n", x) + } +} +``` + +让我们来看看上面的代码都做了什么吧!首先是导入依赖包,导入后,我就可以使用 `mdlayher/wifi` 模块就在 `main` 函数中创建一个新的客户端(类型为 `*Client`)。接下来,只需要调用这个新的客户端(变量名为 `c`)的 `c.Interfaces()` 方法就可以获得系统中的接口列表。接着,我就可以遍历包含接口指针的切片(变长数组),然后打印出它们的具体信息。 + +注意到 `%+v` 中有一个 `+` 了吗?它意味着程序会详细输出 `*Interface` 结构体中的属性名,这将有助于我标识出我看到的东西,而不用去查阅文档。 + +运行上面的代码后,我得到了机器上的 WiFi 接口列表: + +``` +&{Index:0 Name: HardwareAddr:5c:5f:67:f3:0a:a7 PHY:0 Device:3 Type:P2P device Frequency:0} +&{Index:3 Name:wlp2s0 HardwareAddr:5c:5f:67:f3:0a:a7 PHY:0 Device:1 Type:station Frequency:2412} +``` + +注意,两行输出中的 MAC 地址(`HardwareAddr`)是相同的,这意味着它们是同一个物理硬件。你也可以通过 `PHY: 0` 来确认。查阅 Go 的 [wifi 模块文档][3],`PHY` 指的就是接口所属的物理设备。 + +第一个接口没有名字,类型是 `TYPE: P2P`。第二个接口名为 `wpl2s0`,类型是 `TYPE: Station`。`wifi` 模块的文档列出了 [不同类型的接口][4],以及它们的用途。根据文档,`P2P`(点对点传输) 类型表示“该接口属于点对点客户端网络中的一个设备”。我认为这个接口的用途是 [WiFi 直连][5] ,这是一个允许两个 WiFi 设备在没有中间接入点的情况下直接连接的标准。 + +`Station`(基站)类型表示“该接口是具有控制接入点controlling access point的客户端设备管理的基本服务集basic service set(BSS)的一部分”。这是大众熟悉的无线设备标准功能:作为一个客户端来连接到网络接入点。这是测试 WiFi 质量的重要接口。 + +### 利用接口获取基站信息 + +利用该信息,我可以修改遍历接口的代码来获取所需信息: + +``` +for _, x := range interfaces { + if x.Type == wifi.InterfaceTypeStation { + // c.StationInfo(x) returns a slice of all + // the staton information about the interface + info, err := c.StationInfo(x) + if err != nil { + fmt.Printf("Station err: %s\n", err) + } + for _, x := range info { + fmt.Printf("%+v\n", x) + } + } +} +``` + +首先,这段程序检查了 `x.Type`(接口类型)是否为 `wifi.InterfaceTypeStation`,它是一个基站接口(也是本练习中唯一涉及到的类型)。不幸的是名字出现了冲突,这个接口“类型”并不是 Golang 中的“类型”。事实上,我在这里使用了一个叫做 `interfaceType` 的 Go 类型来代表接口类型。呼,我花了一分钟才弄明白! + +然后,假设接口的类型正确,我们就可以调用 `c.StationInfo(x)` 来检索基站信息,`StationInfo()` 方法可以获取到关于这个接口 `x` 的信息。 + +这将返回一个包含 `*StationInfo` 指针的切片。我不大确定这里为什么要用切片,或许是因为接口可能返回多个 `StationInfo`?不管怎么样,我都可以遍历这个切片,然后使用之前提到的 `+%v` 技巧格式化打印出 `StationInfo` 结构的属性名和属性值。 + +运行上面的程序后,我得到了下面的输出: + +``` +&{HardwareAddr:70:5a:9e:71:2e:d4 Connected:17m10s Inactive:1.579s ReceivedBytes:2458563 TransmittedBytes:1295562 ReceivedPackets:6355 TransmittedPackets:6135 ReceiveBitrate:2000000 TransmitBitrate:43300000 Signal:-79 TransmitRetries:2306 TransmitFailed:4 BeaconLoss:2} +``` + +我感兴趣的是 `Signal`(信号)部分,可能还有 `TransmitFailed`(传输失败)和 `BeaconLoss`(信标丢失)部分。信号强度是以 dBm(分贝-毫瓦decibel-milliwatts)为单位来报告的。 + +#### 简短科普:如何读懂 WiFi dBm + +根据 [MetaGeek][6] 的说法: + +* -30 最佳,但它既不现实也没有必要 +* -67 非常好,它适用于需要可靠数据包传输的应用,例如流媒体 +* -70 还不错,它是实现可靠数据包传输的底线,适用于电子邮件和网页浏览 +* -80 很差,只是基本连接,数据包传输不可靠 +* -90 不可用,接近“背景噪声noise floor” + +*注意:dBm 是对数尺度,-60 比 -30 要低 1000 倍。* + +### 使它成为一个真的“扫描器” + +所以,看着上面输出显示的我的信号:-79。哇哦,感觉不大好呢。不过单看这个结果并没有太大帮助,它只能提供某个时间点的参考,只对 WiFi 网络适配器在特定物理空间的某一瞬间有效。一个连续的读数会更有用,借助于它,我们观察到信号随着树莓派的移动而变化。我可以再次修改 `main` 函数来实现这一点。 + +``` +var i *wifi.Interface + +for _, x := range interfaces { + if x.Type == wifi.InterfaceTypeStation { + // Loop through the interfaces, and assign the station + // to var x + // We could hardcode the station by name, or index, + // or hardwareaddr, but this is more portable, if less efficient + i = x + break + } +} + +for { + // c.StationInfo(x) returns a slice of all + // the staton information about the interface + info, err := c.StationInfo(i) + if err != nil { + fmt.Printf("Station err: %s\n", err) + } + + for _, x := range info { + fmt.Printf("Signal: %d\n", x.Signal) + } + + time.Sleep(time.Second) +} +``` + +首先,我命名了一个 `wifi.Interface` 类型的变量 `i`。因为它在循环的范围外,所以我可以用它来存储接口信息。循环内创建的任何变量在该循环的范围外都是不可访问的。 + +然后,我可以把这个循环一分为二。第一个遍历了 `c.Interfaces()` 返回的接口切片,如果元素是一个 `Station` 类型,它就将其存储在先前创建的变量 `i` 中,并跳出循环。 + +第二个循环是一个死循环,它将不断地运行,直到我按下 `Ctrl + C` 来结束程序。和之前一样,这个循环内部获取接口信息、检索基站信息,并打印出信号信息。然后它会休眠一秒钟,再次运行,反复打印信号信息,直到我退出为止。 + +运行上面的程序后,我得到了下面的输出: + +``` +[chris@marvin wifi-monitor]$ go run main.go +Signal: -81 +Signal: -81 +Signal: -79 +Signal: -81 +``` + +哇哦,感觉不妙。 + +### 绘制公寓信号分布图 + +不管怎么说,知道这些信息总比不知道要好。让树莓派连接上显示器或者电子墨水屏,并接上电源,我就可以让它在公寓里移动,并绘制出信号死角的位置。 + +剧透一下:由于房东的接入点在隔壁的公寓里,对我来说最大的死角是以公寓厨房的冰箱为顶点的一个圆锥体形状区域......这个冰箱与房东的公寓靠着一堵墙! + +我想如果用《龙与地下城》里的黑话来说,它就是一个“沉默之锥Cone of Silence”。或者至少是一个“糟糕的网络连接之锥Cone of Poor Internet”。 + +总之,这段代码可以直接在树莓派上运行 `go build -o wifi_scanner` 来编译,得到的二进制文件 `wifi_scanner` 可以运行在其他同样的ARM 设备上。另外,它也可以在常规系统上用正确的 ARM 设备库进行编译。 + +祝你扫描愉快!希望你的 WiFi 路由器不在你的冰箱后面!你可以在 [我的 GitHub 存储库][7] 中找到这个项目所用的代码。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/troubleshoot-wifi-go-raspberry-pi + +作者:[Chris Collins][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[turbokernel](https://github.com/turbokernel) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clcollins +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/coffee_tea_selfcare_wfh_porch_520.png +[2]: https://github.com/mdlayher/wifi +[3]: https://godoc.org/github.com/mdlayher/wifi#Interface +[4]: https://godoc.org/github.com/mdlayher/wifi#InterfaceType +[5]: https://en.wikipedia.org/wiki/Wi-Fi_Direct +[6]: https://www.metageek.com/training/resources/wifi-signal-strength-basics.html +[7]: https://github.com/clcollins/goPiWiFi diff --git a/published/20210323 WebAssembly Security, Now and in the Future.md b/published/20210323 WebAssembly Security, Now and in the Future.md new file mode 100644 index 0000000000..5957391c6f --- /dev/null +++ b/published/20210323 WebAssembly Security, Now and in the Future.md @@ -0,0 +1,87 @@ +[#]: subject: (WebAssembly Security, Now and in the Future) +[#]: via: (https://www.linux.com/news/webassembly-security-now-and-in-the-future/) +[#]: author: (Dan Brown https://training.linuxfoundation.org/announcements/webassembly-security-now-and-in-the-future/) +[#]: collector: (lujun9972) +[#]: translator: (hanszhao80) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14592-1.html) + +WebAssembly 安全的现在和未来 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/14/144316bb8kbwjephjyb427.jpg) + +### 简介 + +正如我们 [最近解释的][1],WebAssembly 是一种用于以任何语言编写的二进制格式的软件,旨在最终无需更改就能在任意平台运行。WebAssembly 的第一个应用是在 Web 浏览器中,以使网站更快、更具交互性。WebAssembly 有计划推向 Web 之外,从各种服务器到物联网(IoT),其创造了很多机会,但也存在很多安全问题。这篇文章是对这些问题和 WebAssembly 安全模型的一篇介绍性概述。 + +### WebAssembly 跟 JavaScript 很像 + +在 Web 浏览器内部,WebAssembly 模块由执行 JavaScript 代码的同一 虚拟机VM 管理。因此,WebAssembly 和 JavaScript 一样,造成的危害也是相同的,只是效率更高,更不易被察觉。由于 JavaScript 是纯文本,运行前需要浏览器编译,而 WebAssembly 是一种可立即运行的二进制格式,运行速度更快,也更难被扫描出(即使使用杀毒软件)其中的恶意指令。 + +WebAssembly 的这种 “代码混淆” 效果已经被用来弹出不请自来的广告,或打开假的 “技术支持” 窗口,要求提供敏感数据。另一个把戏则是自动将浏览器重定向到包含真正危险的恶意软件的 “落地” 页。 + +最后,就像 JavaScript 一样,WebAssembly 可能被用来 “窃取” 处理能力而不是数据。2019 年,[对 150 个不同的 WASM 模块的分析][2] 发现,其中约 _32%_ 被用于加密货币挖掘。 + +### WebAssembly 沙盒和接口 + +WebAssembly 代码在一个由虚拟机(而不是操作系统)管理的 [沙盒][3] 中封闭运行。这使它无法看到主机,也无法直接与主机交互。对系统资源(文件、硬件或互联网连接)的访问只能通过该虚拟机提供的 WebAssembly 系统接口WebAssembly System Interface(WASI) 进行。 + +WASI 不同于大多数其他应用程序编程接口(API),它具有独特的安全特性,真正推动了 WASM 在传统服务器和边缘Edge计算场景中的采用,这将是下一篇文章的主题。在这里,可以说,当从 Web 迁移到其他环境时,它的安全影响会有很大的不同。现代 Web 浏览器是极其复杂的软件,但它是建立在数十年的经验和数十亿人的日常测试之上的。与浏览器相比,服务器或物联网(IoT)设备几乎是未知领域。这些平台的虚拟机将需要扩展 WASI,因此,肯定会带来新的安全挑战。 + +### WebAssembly 中的内存和代码管理 + +与普通的编译程序相比,WebAssembly 应用程序对内存的访问非常受限,对它们自己也是如此。WebAssembly 代码不能直接访问尚未调用的函数或变量,不能跳转到任意地址,也不能将内存中的数据作为字节码指令执行。 + +在浏览器内部,WASM 模块只能获得一个连续字节的全局数组(线性内存linear memory)进行操作。WebAssembly 可以直接读写该区域中的任意位置,或者请求增加其大小,但仅此而已。这个线性内存linear memory也与包含其实际代码、执行堆栈、当然还有运行 WebAssembly 的虚拟机的区域分离。对于浏览器来说,所有这些数据结构都是普通的 JavaScript 对象,使用标准过程与所有其他对象隔离。 + +### 结果还好,但不完美 + +所有这些限制使得 WebAssembly 模块很难做出不当行为,但也并非不可能。 + +沙盒化的内存使 WebAssembly 几乎不可能接触到 __外部__ 的东西,也使操作系统更难防止 __内部__ 发生不好的事情。传统的内存监测机制,比如 [堆栈金丝雀][4]Stack Canaries 能注意到是否有代码试图扰乱它不应该接触的对象,[但在这里没用][5]。 + +事实上,WebAssembly 只能访问自己的线性内存linear memory,但可以直接访问,这也可能为攻击者的行为 _提供便利_。有了这些约束和对模块源代码的访问,就更容易猜测覆盖哪些内存位置可能造成最大的破坏。破坏局部变量似乎也是 [可能的][6],因为它们停留在线性内存linear memory中的无监督堆栈中。 + +2020 年的一篇关于 [WebAssembly 的二进制安全性][5] 的论文指出,WebAssembly 代码仍然可以在设定的常量内存中覆盖字符串文字。同一篇论文描述了在三个不同的平台(浏览器、Node.JS 上的服务端应用程序,和独立 WebAssembly 虚拟机的应用程序)上,WebAssembly 可能比编译为原生二进制文件时更不安全的其他方式。建议进一步阅读此主题。 + +通常,认为 WebAssembly 只能破坏其自身沙盒中的内容的想法可能会产生误导。WebAssembly 模块为调用它们的 JavaScript 代码做繁重的工作,每次都会交换变量。如果模块在这些变量中的任意一处写入不安全的调用 WebAssembly 的 JavaScript 代码,就 _会_ 导致崩溃或数据泄露。 + +### 未来的方向 + +WebAssembly 的两个新出现的特性:[并发][7] 和内部垃圾收集,肯定会影响其安全性(如何影响以及影响多少,现在下结论还为时过早)。 + +并发允许多个 WebAssembly 模块在同一个虚拟机中并行。目前,只有通过 JavaScript [web workers][8] 才能实现这一点,但更好的机制正在开发中。安全方面,他们可能会带来 [以前不需要的大量的代码][9],也就是更多出错的方法。 + +为了提高性能和安全性,我们需要一个 [本地的垃圾收集器][10],但最重要的是,要在经过良好测试的浏览器的 Java 虚拟机之外使用 WebAssembly,因为这些虚拟机无论如何都会在自己内部收集所有的垃圾。当然,甚至这个新代码也可能成为漏洞和攻击的另一个入口。 + +往好处想,使 WebAssembly 比现在更安全的通用策略也是存在的。再次引用 [这篇文章][5],这些策略包括:编译器改进、栈/堆和常量数据的 _分离_ 的线性存储机制,以及避免使用 **不安全的语言**(如 C)编译 WebAssembly 模块代码。 + +*本文 [WebAssembly 安全的现在和未来][11] 首次发表在 [Linux 基金会 - 培训][12]。* + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/webassembly-security-now-and-in-the-future/ + +作者:[Dan Brown][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://training.linuxfoundation.org/announcements/webassembly-security-now-and-in-the-future/ +[b]: https://github.com/lujun9972 +[1]: https://training.linuxfoundation.org/announcements/an-introduction-to-webassembly/ +[2]: https://www.sec.cs.tu-bs.de/pubs/2019a-dimva.pdf +[3]: https://webassembly.org/docs/security/ +[4]: https://ctf101.org/binary-exploitation/stack-canaries/ +[5]: https://www.usenix.org/system/files/sec20-lehmann.pdf +[6]: https://spectrum.ieee.org/tech-talk/telecom/security/more-worries-over-the-security-of-web-assembly +[7]: https://github.com/WebAssembly/threads +[8]: https://en.wikipedia.org/wiki/Web_worker +[9]: https://googleprojectzero.blogspot.com/2018/08/the-problems-and-promise-of-webassembly.html +[10]: https://github.com/WebAssembly/gc/blob/master/proposals/gc/Overview.md +[11]: https://training.linuxfoundation.org/announcements/webassembly-security-now-and-in-the-future/ +[12]: https://training.linuxfoundation.org/ diff --git a/published/20210428 Share files between Linux and Windows computers.md b/published/20210428 Share files between Linux and Windows computers.md new file mode 100644 index 0000000000..a5820c1b3d --- /dev/null +++ b/published/20210428 Share files between Linux and Windows computers.md @@ -0,0 +1,235 @@ +[#]: subject: (Share files between Linux and Windows computers) +[#]: via: (https://opensource.com/article/21/4/share-files-linux-windows) +[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) +[#]: collector: (lujun9972) +[#]: translator: (hanszhao80) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14537-1.html) + +如何在 Linux 和 Windows 电脑之间共享文件 +====== + +> 使用 Samba 设置跨平台文件共享。 + +![](https://img.linux.net.cn/data/attachment/album/202205/02/233859oqqjvfr6tqz9bfqp.jpg) + +如果你使用不同的操作系统,能够在它们之间共享文件会让你倍感方便。这篇文章介绍如何使用 [Samba][3] 和 [mount.cifs][4] 在 Linux ([Fedora 33][2])和 Windows 10 之间设置文件共享。 + +Samba 是 [SMB/CIFS][5] 协议的 Linux 实现,允许通过网络连接直接访问共享的文件夹和打印机。 mount.cifs 是 Samba 套件的一部分,可让你在 Linux 下挂载 [CIFS][5] 文件系统。 + +> **注意**: 这些说明适用于在你的私有本地网络内,或在 Linux 宿主机和虚拟化的 Windows 访客机之间的虚拟主机专用网络中共享文件。不要将本文视为你公司网络的操作指南,因为本文没有实现必要的网络安全考虑。 + +### 从 Windows 访问 Linux + +本节介绍从 Windows 文件资源管理器访问用户的 Linux 主目录。 + +#### 1、安装和配置 Samba + +进入你的系统安装 Samba: + +``` +dnf install samba +``` + +Samba 是一个系统守护进程,其配置文件位于 `/etc/samba/smb.conf`。它的默认配置应该就可以工作。如果不行,下面这个最小化配置应该可以解决问题: + +``` +[global] +        workgroup = SAMBA +        server string = %h server (Samba %v) +        invalid users = root +        security = user +[homes] +        comment = Home Directories +        browseable = no +        valid users = %S +        writable = yes +``` + +你可以在该项目网站的 [smb.conf][6] 部分找到参数的详细说明。 + +#### 2、修改 LinuxSE + +如果你的 Linux 发行版受 [SELinux][7] 保护(比如 Fedora),必须通过以下命令才能通过 Samba 共享主目录: + +``` +setsebool -P samba_enable_home_dirs on +``` + +通过以下命令查看这个值: + +``` +getsebool samba_enable_home_dirs +``` + +输出如下: + +![Sebool][8] + +#### 3、启用你的用户 + +Samba 使用一组用户/密码来管理连接权限。通过键入以下命令将你的 Linux 用户添加到该集合中: + +``` +smbpasswd -a <你的用户名> +``` + +系统提示你输入密码。这是一个 _全新_ 的密码;而不是你账户的当前密码。请输入你想用来登录 Samba 的密码。 + +键入以下命令得到有 Samba 使用权限的用户列表: + +``` +pdbedit -L -v +``` + +键入以下命令删除一个用户: + +``` +smbpasswd -x <用户名> +``` + +#### 4、开启 Samba + +既然 Samba 是一个系统守护进程,你可以在 Fedora 上键入以下命令启动它: + +``` +systemctl start smb +``` + +这将为当前会话开启 Samba 服务。如果想让它自启动,键入以下命令: + +``` +systemctl enable smb +``` + +在某些系统上,Samba 守护进程注册为 `smbd`。 + +#### 4、配置防火墙 + +你的防火墙会默认阻拦 Samba。通过配置防火墙允许 Samba 能永久访问网络。 + +你可以在命令行执行如下操作: + +``` +firewall-cmd --add-service=samba --permanent +``` + +或者,你可以使用 `firewall-config` 工具以图形化方式进行操作: + +![firewall-config][10] + +#### 5、从 Windows 访问 Samba + +在 Windows 中,打开文件资源管理器。在地址栏中,键入两个反斜杠(`\\`),紧跟你的 Linux 机器的地址(IP 地址或主机名): + +![从 Windows 访问 Linux][11] + +系统将提示你输入登录信息。输入第 3 步中的用户名和密码组合。你现在应该可以访问 Linux 机器上的主目录: + +![从 Windows 访问 Linux][12] + +### 从 Linux 访问 Windows + +以下步骤说明了如何从 Linux 访问共享的 Windows 文件夹。要实现这一点,需要你的 Windows 用户帐户具有管理员权限。 + +#### 1、启用文件共享 + +通过点击 “Windows 按钮” > “设置Settings” > “网络和 InternetNetwork & Internet” ,或者右键单击任务栏右下角的小监视器图标,打开网络和共享中心Open Network an d Sharing Center: + +![打开网络和共享中心][13] + +在打开的窗口中,找到你要使用的连接并记下其配置文件。我使用了 **以太网 3**,它被标记为 公用网络Public Network。 + +> **注意**:如果你的 PC 经常连接公用网络,请考虑将本地计算机的连接配置文件更改为 **私有**。 + +记住你的网络配置,然后单击 更改高级共享设置Change advanced sharing settings: + +![更改高级共享设置][14] + +选择与你的连接对应的配置文件并打开 网络发现network discovery文件和打印机共享file and printer sharing: + +![网络共享设置][15] + +#### 2、定义一个共享文件夹 + +通过右键单击你要共享的文件夹打开上下文菜单,导航到 授予访问权限Give access to,然后选择 特定用户...Specific people...: + +![授予访问权限][16] + +检查你当前的用户名是否在列表中。点击 共享Share 将此文件夹标记为共享: + +![标记为共享][17] + +你可以通过在文件资源管理器的地址栏中输入 `\\localhost` 来显示所有共享文件夹的列表: + +![共享文件夹][18] + +![共享文件夹][19] + +#### 3、在 Linux 下挂载共享文件夹 + +回到你的 Linux 系统,打开一个命令行,然后创建一个新文件夹,用于挂载 Windows 共享: + +``` +mkdir ~/WindowsShare +``` + +挂载 Windows 共享是使用 `mount.cifs` 完成的,它应该被默认安装。使用如下命令临时挂载你的共享文件夹: + +``` +sudo mount.cifs ///MySharedFolder ~/WindowsShare/ -o user=,uid=$UID +``` + +在这个命令里: + + * `` 是 Windows PC 的地址信息(IP 或主机名) + * `` 是允许访问共享文件夹的用户(见步骤 2) + +系统将提示你输入 Windows 密码。之后,你将能够使用普通 Linux 用户访问 Windows 上的共享文件夹。 + +要卸载共享文件夹: + +``` +sudo umount ~/WindowsShare/ +``` + +你还可以在系统启动时挂载 Windows 共享文件夹。按照 [这些步骤][20] 相应地配置你的系统。 + +### 总结 + +在这里展示了如何建立临时的文件夹共享访问权限,每次重启后都要重新设置,因此修改成永久访问会更便利。我经常在不同的系统之间来回切换,对我而言设置直接文件访问非常实用。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/share-files-linux-windows + +作者:[Stephan Avenwedde][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/hansic99 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_cloud21x_cc.png?itok=5UwC92dO (Blue folders flying in the clouds above a city skyline) +[2]: https://getfedora.org/en/workstation/download/ +[3]: https://www.samba.org/ +[4]: https://linux.die.net/man/8/mount.cifs +[5]: https://en.wikipedia.org/wiki/Server_Message_Block +[6]: https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html +[7]: https://www.redhat.com/en/topics/linux/what-is-selinux +[8]: https://opensource.com/sites/default/files/uploads/sebool.png (Enabling Samba to enable user directory access) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://opensource.com/sites/default/files/uploads/firewall_configuration.png (firewall-config tool) +[11]: https://opensource.com/sites/default/files/uploads/windows_access_shared_1.png (Accessing Linux machine from Windows) +[12]: https://opensource.com/sites/default/files/uploads/windows_acess_shared_2.png (Accessing Linux machine from Windows) +[13]: https://opensource.com/sites/default/files/uploads/open_network_and_sharing_center.png (Open network and sharing center) +[14]: https://opensource.com/sites/default/files/uploads/network_and_sharing_center_2.png (Change advanced sharing settings) +[15]: https://opensource.com/sites/default/files/uploads/network_sharing.png (Network sharing settings) +[16]: https://opensource.com/sites/default/files/pictures/give_access_to.png (Give access) +[17]: https://opensource.com/sites/default/files/pictures/tag_as_shared.png (Tag as shared) +[18]: https://opensource.com/sites/default/files/uploads/show_shared_folder_1.png (Shared folders) +[19]: https://opensource.com/sites/default/files/uploads/show_shared_folder_2.png (Shared folders) +[20]: https://timlehr.com/auto-mount-samba-cifs-shares-via-fstab-on-linux/ diff --git a/published/20210615 Listen to music on FreeDOS.md b/published/20210615 Listen to music on FreeDOS.md new file mode 100644 index 0000000000..cf546b1181 --- /dev/null +++ b/published/20210615 Listen to music on FreeDOS.md @@ -0,0 +1,95 @@ +[#]: subject: (Listen to music on FreeDOS) +[#]: via: (https://opensource.com/article/21/6/listen-music-freedos) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: (hanszhao80) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14603-1.html) + +在 FreeDOS 中聆听音乐 +====== + +> Mplayer 是 Linux、Windows、Mac 和 DOS 等操作系统上常见的一款开源媒体播放器。 + +![](https://img.linux.net.cn/data/attachment/album/202205/17/092828vffyeliiz33hqf31.jpg) + +听音乐是放松心情的好方法。在 Linux 上,我使用 Rhythmbox 听音乐。但是你可能不知道在 FreeDOS 上也可以听音乐。让我们看一下两款流行的音乐播放器吧: + +### 用 Mplayer 听音乐 + +[Mplayer][2] 是一款开源的媒体播放器,通常安装于 Linux、Windows 和 Mac 上,但也有 DOS 版本可用。这里我们讨论的就是在 FreeDOS 版本。虽然其 DOS 移植版基于旧版(2007 年的 1.0rc2-3-3-2 版),但它完全适用于在 DOS 上播放媒体。 + +我使用 MPlayer 在 FreeDOS 上听音乐文件。在这个例子中,我复制了我最喜欢的有声读物之一,[Big Finish Productions][3] 的神秘博士:闪点行动Doctor Who: Flashpoint,并在我的 FreeDOS 计算机上将其保存为 `C:\MUSIC\FLASHPNT.MP3`。为了在 FreeDOS 上收听闪点行动,我从 FreeDOS 命令行启动 MPlayer 并指定要播放的 MP3 文件名。MPlayer 的基本用法是 `mplayer [options] filename`,如果默认设置可用,你应该可以直接使用该文件名启动 MPlayer。在本例中,我运行以下命令将工作目录切换为 `\MUSIC`,然后使用 MPlayer 播放我的 MP3 有声读物文件: + +``` +CD \MUSIC +MPLAYER FLASHPNT.MP3 +``` + +FreeDOS _不区分大小写_,因此它将忽略 DOS 命令和任何文件或目录的大小写字母的区别。你键入 `cd \music` 或 `Cd \Music` 都可以切换到 Music 目录,效果相同。 + +![FreeDOS 上的 Mplayer][4] + +*你可以用 Mplayer 播放 MP3 文件* + +使用 MPlayer 在 FreeDOS 播放音乐文件时没有花哨的界面。但同时,它也不会分散注意力。所以我可以一边让 FreeDOS 在我的 DOS 计算机上播放 MP3 文件,一边使用另一台计算机做其他事情。然而,FreeDOS 一次只运行一个任务(换句话说,DOS 是一个单任务single-tasking操作系统),所以我不能将 MPlayer 置于 FreeDOS 的“后台”运行,而在 _同一台 FreeDOS 机_ 上处理其他事情。 + +请注意,MPlayer 是一个需要大量内存才能运行的大程序。虽然 DOS 本身并不需要太多的内存来运行,但我建议至少有 16M 的内存来运行 MPlayer。 + +### 使用 Open Cubic Player 听音频文件 + +FreeDOS 不止提供了 MPlayer 来播放媒体。还有 [Open Cubic Player][6],它支持多种文件格式,包括 Midi 和 WAV 文件。 + +1999 年,我录制了一段简短的音频文件,内容是我说:“你好,我是 Jim Hall,我把 ‘FreeDOS’ 发音为 _FreeDOS_。"这是一个玩笑,借鉴了 Linus Torvalds 录制的演示他如何发音 Linux 的 [类似的音频文件][7](`English.au`,包含在 1994 年的 Linux 源代码树中)中的创意。我们不会在 FreeDOS 中分发这段 FreeDOS 音频剪辑,但欢迎你从我们的 [Silly Sounds][8] 目录中下载它,该目录位于 [Ibiblio][9] 的 FreeDOS 文件存档中。 + +你可以使用 Open Cubic Player 收听 _FreeDOS_ 音频剪辑。通常从 `\APPS\OPENCP` 目录键入 `CP` 命令运行 Open Cubic Player。但 Open Cubic Player 是 32 位应用程序,运行它需要 32 位 DOS 扩展器。常见的 DOS 扩展器是 DOS/4GW。虽然可以免费使用,但 DOS/4GW 不是开源程序,因此我们不会将其作为 FreeDOS 包分发。 + +相反,FreeDOS 提供了另一个名为 DOS/32A 的开源32位扩展器。如果你在安装 FreeDOS 时没有安装所有内容,则可能需要使用 [FDIMPLES][10] 进行安装。我使用这两行命令切换到 `\APPS\OPENCP` 路径,并使用 DOS/32A 扩展器运行 Open Cubic Player: + +``` +CD \APPS\OPENCP +DOS32A CP +``` + +Open Cubic Player 没有花哨的用户界面,但你可以使用方向键将 文件选择器File Selector 导航到包含要播放的媒体文件的目录。 + +![Open Cubic Player][11] + +*Open Cubic Player 打开文件选择器* + +文本比在其他 DOS 应用程序中显示的要小,因为 Open Cubic Player 会自动将显示更改为使用 50 行文本,而不是通常的 25 行。当你退出程序时,Open Cubic Player 会将显示重置为 25 行。 + +选择媒体文件后,Open Cubic Player 将循环播放该文件(按键盘上的 `Esc` 键退出)。当文件通过扬声器播放时,Open Cubic Player 会显示一个频谱仪,以便你可以观察左右声道的音频。FreeDOS 音频剪辑是以单声道录制的,因此左右声道是相同的。 + +![Open Cubic Player][12] + +*Open Cubic Player 中播放 FreeDOS 音频文件* + +DOS 可能来自较早的年代,但这并不意味着你不能使用 FreeDOS 来执行现代任务或播放当前的媒体。如果你喜欢听数字音乐,试一试在 FreeDOS上 使用 Open Cubic Player 或 MPlayer 吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/listen-music-freedos + +作者:[Jim Hall][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/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming) +[2]: https://en.wikipedia.org/wiki/MPlayer +[3]: https://bigfinish.com/ +[4]: https://opensource.com/sites/default/files/uploads/mplayer.png (You can use Mplayer to listen to MP3 files) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://www.cubic.org/player/ +[7]: https://commons.wikimedia.org/wiki/File:Linus-linux.ogg +[8]: https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/util/sillysounds/ +[9]: https://www.ibiblio.org/ +[10]: https://opensource.com/article/21/6/freedos-package-manager +[11]: https://opensource.com/sites/default/files/uploads/opencp1.png (Open Cubic Player opens with a file selector) +[12]: https://opensource.com/sites/default/files/uploads/opencp2.png (Open Cubic Player playing the "FreeDOS" audio clip) diff --git a/published/20210617 Linux package management with dnf.md b/published/20210617 Linux package management with dnf.md new file mode 100644 index 0000000000..a2cb4a8853 --- /dev/null +++ b/published/20210617 Linux package management with dnf.md @@ -0,0 +1,177 @@ +[#]: subject: (Linux package management with dnf) +[#]: via: (https://opensource.com/article/21/6/dnf-linux) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (hanszhao80) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14542-1.html) + +使用 dnf 进行 Linux 包管理 +====== + +> 了解如何在 Linux 上使用 `dnf` 命令安装软件包,然后下载我们的速查表,让正确的命令触手可及。 + +![](https://img.linux.net.cn/data/attachment/album/202205/04/101526nlsnpu34ppgscsch.jpg) + +在计算机系统上安装应用程序非常简单:就是将档案(如 `.zip` 文件)中的文件复制到目标计算机上,放在操作系统预期放应用程序的位置。因为我们中的许多人习惯于使用花哨的安装“向导”来帮助我们在计算机上安装软件,所以这个过程似乎在技术上应该比实际更复杂。 + +然而,复杂的是,是什么构成了一个程序?用户认为的单个应用程序实际上包含了分散在操作系统中的软件库的各种依赖代码(例如:Linux 上的 .so 文件、Windows 上的 .dll 文件和 macOS 上的 .dylib 文件)。 + +为了让用户不必担心这些程序代码之间的复杂的互相依赖关系, Linux 使用 包管理系统package management system 来跟踪哪些应用程序需要哪些库,哪些库或应用程序有安全或功能更新,以及每个软件会附带安装哪些额外的数据文件。包管理器本质上是一个安装向导。它们易于使用,提供了图形界面和基于终端的界面,让你的生活更轻松。你越了解你的发行版的包管理器,你的生活就会越轻松。 + +### 在 Linux 上安装应用程序 + +如果你在使用 Linux 桌面时,偶尔想要安装一个应用程序,那么你可能正在寻找 [GNOME “软件”][2],它是一个桌面应用程序浏览器。 + +![GNOME “软件” 程序][3] + +它会按你的预期工作:点击它的界面,直到你找到一个看起来有用的应用程序,然后单击 “安装” 按钮。 + +或者,你可以在 GNOME “软件” 中打开从网络下载的 `.rpm` 或 `.flatpakref` 软件包,以便它进行安装。 + +但如果你更倾向于使用命令行,请继续阅读。 + +### 用 dnf 搜索软件 + +在安装应用程序之前,你可能需要确认它是否存在于你的发行版的服务器上。通常,使用 `dnf` 搜索应用程序的通用名称就足够了。例如,假设你最近阅读了 [一篇关于 Cockpit 的文章][4],并决定尝试一下。你可以搜索 `cockpit` 验证该发行版是否包含它: + +``` +$ dnf search cockpit + Last metadata expiration check: 0:01:46 ago on Tue 18 May 2021 19:18:15 NZST. + ==== Name Exactly Matched: cockpit ==== + cockpit.x86_64 : Web Console for Linux servers + +==== Name & Summary Matched: cockpit == + cockpit-bridge.x86_64 : Cockpit bridge server-side component + cockpit-composer.noarch : Composer GUI for use with Cockpit + [...] +``` + +有一个精确的匹配。上面列出的匹配的软件包名为 `cockpit.x86_64`,但名称中的 `.x86_64` 部分仅表示它兼容该 CPU 架构。默认情况下,你的系统会安装适配当前 CPU 架构的软件包,因此你可以忽略该扩展名。所以你确认你要查找的软件包确实简称为 `cockpit`。 + +现在你可以放心地使用 `dnf install` 安装它。 此步骤需要管理员权限: + +``` +$ sudo dnf install cockpit +``` + +一般来说,这就是典型的 `dnf` 工作流:搜索并安装。 + +然而,有时 `dnf search` 的结果并不清晰,或者你想要关于一个软件包的更多信息,而不仅仅是它的通用名称。有一些相关的 `dnf` 子命令,具体取决于你想要的信息。 + +### 软件包的元数据 + +如果你觉得你的搜索已 _接近_ 想要的结果,但还不确定,查看软件包的元数据通常会有所帮助,例如项目的网址和描述。要获取此信息,请使用顾名思义的 `dnf info` 命令: + +``` +$ dnf info terminator +Available Packages +Name : terminator +Version : 1.92 +Release : 2.el8 +Architecture : noarch +Size : 526 k +Source : terminator-1.92-2.el8.src.rpm +Repository : epel +Summary : Store and run multiple GNOME terminals in one window +URL : https://github.com/gnome-terminator +License : GPLv2 +Description : Multiple GNOME terminals in one window. This is a project to produce + : an efficient way of filling a large area of screen space with + : terminals. This is done by splitting the window into a resizeable + : grid of terminals. As such, you can produce a very flexible + : arrangements of terminals for different tasks. +``` + +这个信息告诉你可用软件包的版本、在你系统中注册的哪一个存储库提供了它、该项目的网站以及详细的功能描述。 + +### 哪个软件包提供的这个文件? + +软件包名称并不总是与你要查找的内容相匹配。例如,假设你正在阅读的文档告诉你必须安装名为 `qmake-qt5` 的东西: + +``` +$ dnf search qmake-qt5 +No matches found. +``` + +`dnf` 数据库非常广泛,因此你不要局限于搜索完全匹配的内容。你可以使用 `dnf provides` 命令来了解你正在寻找的东西是否作为某个更大的软件包的一部分而提供: + +``` +$ dnf provides qmake-qt5 +qt5-qtbase-devel-5.12.5-8.el8.i686 : Development files for qt5-qtbase +Repo : appstream +Matched from: +Filename : /usr/bin/qmake-qt5 + +qt5-qtbase-devel-5.15.2-3.el8.x86_64 : Development files for qt5-qtbase +Repo : appstream +Matched from: +Filename : /usr/bin/qmake-qt5 +``` + +可以确认应用程序 `qmake-qt5` 是名为 `qt5-qtbase-devel` 的软件包的一部分。它还告诉你,该应用程序会安装到 `/usr/bin`,因此你知道了安装后它的确切位置。 + +### 软件包中包含哪些文件? + +有时我发现自己会从完全不同的角度来对待 `dnf`。有时,我已经确认我的系统上安装了一个应用程序;我只是不知道我是怎么得到它的。还有一些时候,我知道我安装了一个特定的软件包,但我不清楚这个软件包到底在我的系统上安装了什么。 + +如果你需要对包的有效负载payload进行 “逆向工程reverse engineer”,可以使用 `dnf repoquery` 命令和 `--list` 选项。这将查看存储库中有关软件包的元数据,并列出该软件包提供的所有文件: + +``` +$ dnf repoquery --list qt5-qtbase-devel +/usr/bin/fixqt4headers.pl +/usr/bin/moc-qt5 +/usr/bin/qdbuscpp2xml-qt5 +/usr/bin/qdbusxml2cpp-qt5 +/usr/bin/qlalr +/usr/bin/qmake-qt5 +/usr/bin/qvkgen +/usr/bin/rcc-qt5 +[...] +``` + +这些列表可能很长,使用 `less` 或你喜欢的分页命令配合管道操作会有所帮助。 + +### 移除应用程序 + +如果你决定系统中不再需要某个应用程序,可以使用 `dnf remove` 卸载它,该软件包本身安装的文件以及不再需要的任何依赖项都会被移除: + +``` +$ dnf remove bigapp +``` + +有时,你发现随着一个应用程序一起安装的依赖项对后来安装的其他应用程序也有用。如果两个包需要相同的依赖项,`dnf remove` _不会_ 删除依赖项。在安装和卸载大量应用程序之后,孤儿软件包散落各处的现象并不少见。大约每年我都要执行一次 `dnf autoremove` 来清除所有未使用的软件包: + +``` +$ dnf autoremove +``` + +这不是必需的,但这是一个让我的电脑感觉更好的大扫除步骤。 + +### 了解 dnf + +你对包管理器的工作方式了解得越多,在必要时安装和查询应用程序就越容易。即便你不是 `dnf` 的重度使用者,当你发现自己与基于 RPM 的发行版交互时,了解它也会很有用。 + +告别 `yum` 后,我最喜欢的包管理器之一是 `dnf` 命令。虽然我不喜欢它的所有子命令,但我发现它是目前最健壮的 包管理系统package management system 之一。 [下载我们的 dnf 速查表][5] 习惯该命令,不要害怕尝试一些新技巧。一旦熟悉了它,你可能会发现很难使用其他任何东西替代它。 + +> **[dnf 速查表][5]** + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/dnf-linux + +作者:[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/brown-package-red-bow.jpg?itok=oxZYQzH- (Package wrapped with brown paper and red bow) +[2]: https://wiki.gnome.org/Apps/Software +[3]: https://opensource.com/sites/default/files/gnome-software.png (The GNOME Software app) +[4]: https://opensource.com/article/20/11/cockpit-server-management +[5]: https://opensource.com/downloads/dnf-cheat-sheet diff --git a/published/20210624 Linux package management with apt.md b/published/20210624 Linux package management with apt.md new file mode 100644 index 0000000000..719f02d766 --- /dev/null +++ b/published/20210624 Linux package management with apt.md @@ -0,0 +1,184 @@ +[#]: subject: (Linux package management with apt) +[#]: via: (https://opensource.com/article/21/6/apt-linux) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) +[#]: collector: (lujun9972) +[#]: translator: (hanszhao80) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14558-1.html) + +使用 apt 进行 Linux 包管理 +====== + +> 学习如何使用 apt 命令在基于 Debian 的 Linux 发行版上安装软件包,然后下载我们的速查表,让正确的命令触手可及。 + +![](https://img.linux.net.cn/data/attachment/album/202205/07/104236md5zqhpub9vqeaah.jpg) + +[包管理器][2] 可帮助你处理 Linux 系统的计算机上软件的更新、卸载、故障排除等问题。Seth Kenlon 写了 [使用 dnf 进行 Linux 包管理][3] 一文,介绍了如何使用 `dnf` 这款命令行包管理工具,在 RHEL、CentOS、Fedora、Mageia、OpenMandriva 等 Linux 发行版中安装软件。 + +Debian 和基于 Debian 的发行版(例如 MX Linux、Deepin、Ubuntu)以及基于 Ubuntu 的发行版(例如 Linux Mint 和 Pop!_OS)都有 `apt`,这是一个“相似但不同”的工具。在本文中,我将按照 Seth 的示例(但使用 `apt`)向你展示如何使用它。 + +在一开始,我想先提一下四个跟 `apt` 相关的软件安装工具: + + * [Synaptic][4] 是为 `apt` 服务的一个基于 GTK+ 的图形用户界面(GUI)的前端工具。 + * [Aptitude][5] 是为 `apt` 服务的一个基于 Ncurses 的全屏命令行前端工具。 + * `apt` 的前身有 `apt-get`、`apt-cache` 等工具。 + * [Dpkg][6] 是在 `apt` 包管理器背后处理繁杂事务的”幕后工作者“。 + +还有其他的包管理系统,例如 [Flatpak][7] 和 [Snap][8],你可能会在 Debian 和基于 Debian 的系统上遇到它们,但我不打算在这里讨论。还有一些应用程序“商店”,例如 [GNOME “软件”][9],与 `apt` 和其他打包技术重叠;我也不打算在这里讨论它们。最后,还有其他 Linux 发行版,例如 [Arch][10] 和 [Gentoo][11] 既不使用 `dnf` 也不使用 `apt`,我也不打算在这里讨论它们! + +上面我讲了这么多我不想提及的内容,你可能怀疑 `apt` 到底还能处理多少软件。这么说吧,在我的 Ubuntu 20.04 上,`apt` 可以让我使用 69,371 个软件包,从 `0ad`(一款古代战争题材的即时战略游戏)到 `zzuf`(一个透明的应用程序模糊测试工具),一点也不差。 + +### 使用 apt 搜索软件 + +使用 `apt` 软件包管理器的第一步是找到感兴趣的软件包。Seth 的 `dnf` 文章以 [Cockpit][12] 服务器管理应用程序为例。用 `apt` 我会输入如下命令: + +``` +$ apt search cockpit +Sorting... Done +Full Text Search... Done +389-ds/hirsute,hirsute 1.4.4.11-1 all +  389 Directory Server suite - metapackage + +cockpit/hirsute,hirsute 238-1 all +  Web Console for Linux servers + +... +$ +``` + +上面的第二个包就是你要的那个(以 `cockpit/hirsute` 开头的那一行)。如果你决定要安装它,输入: + +``` +$ sudo apt install cockpit +``` + +`apt` 将负责安装 Cockpit 以及使其工作所需的所有部件或 _依赖_。有时我们不太确定这是我们所需要的。了解更多的信息可能有助于你决定是否真的要安装此应用程序。 + +### 包元数据 + +要了解有关软件包的更多信息,使用 `apt show` 命令: + +``` +$ apt show cockpit +Package: cockpit +Version: 238-1 +Priority: optional +Section: universe/admin +Origin: Ubuntu +Maintainer: Ubuntu Developers +Original-Maintainer: Utopia Maintenance Team +Bugs: https://bugs.launchpad.net/ubuntu/+filebug +Installed-Size: 88.1 kB +Depends: cockpit-bridge (>= 238-1), cockpit-ws (>= 238-1), cockpit-system (>= 238-1) +Recommends: cockpit-storaged (>= 238-1), cockpit-networkmanager (>= 238-1), cockpit-packagekit (>= 238-1) +Suggests: cockpit-doc (>= 238-1), cockpit-pcp (>= 238-1), cockpit-machines (>= 238-1), xdg-utils +Homepage: https://cockpit-project.org/ +Download-Size: 21.3 kB +APT-Sources: http://ca.archive.ubuntu.com/ubuntu hirsute/universe amd64 Packages +Description: Web Console for Linux servers + The Cockpit Web Console enables users to administer GNU/Linux servers using a + web browser. + . + It offers network configuration, log inspection, diagnostic reports, SELinux + troubleshooting, interactive command-line sessions, and more. + +$ +``` + +特别要注意的是 `Description` 字段,它会告诉你更多关于应用程序的信息。`Depends` 字段说明还必须安装什么,而 `Recommends` 则显示建议安装的其他(如果有的话)合作组件。`Homepage` 字段会提供一个网址,通过它你可以了解更多。 + +### 哪个包提供的这个文件? + +有时你并不知道包名,但你知道包里一定包含着的某个文件。Seth 以 `qmake-qt5` 程序作为示例。使用 `apt search` 找不到它: + +``` +$ apt search qmake-qt5 +Sorting... Done +Full Text Search... Done +$ +``` + +但是,另一个有关联的命令 `apt-file` 可以用来探索包内部: + +``` +$ apt-file search qmake-qt5 +qt5-qmake-bin: /usr/share/man/man1/qmake-qt5.1.gz +$ +``` + +这时会显示一个 `qmake-qt5` 的手册页。它是一个名为 `qt5-qmake-bin` 的包的一部分。注意,此包名称颠倒了字符串 `qmake` 和 `qt5` 的顺序。 + +### 包里包含哪些文件? + +方便的 `apt-file` 命令会列出给定的包中包含哪些文件。例如: + +``` +$ apt-file list cockpit +cockpit: /usr/share/doc/cockpit/TODO.Debian +cockpit: /usr/share/doc/cockpit/changelog.Debian.gz +cockpit: /usr/share/doc/cockpit/copyright +cockpit: /usr/share/man/man1/cockpit.1.gz +cockpit: /usr/share/metainfo/cockpit.appdata.xml +cockpit: /usr/share/pixmaps/cockpit.png +$ +``` + +注意,这与 `apt show` 命令提供的信息不同,后者列出了包的依赖(其他必须安装的包)。 + +### 移除一个应用程序 + +你还可以使用 `apt` 移除软件包。例如,要移除`apt-file` 应用程序: + +``` +$ sudo apt purge apt-file +``` + +注意必须由超级用户运行 `apt` 才能安装或移除应用程序。 + +移除一个包并不会自动移除 `apt` 在此过程中安装的所有依赖项。不过,一点点的工作就很容易去除这些残留: + +``` +$ sudo apt autoremove +``` + +### 认识一下 apt + +正如 Seth 所写的,“你对包管理器的工作方式了解得越多,在需要安装和查询应用程序时就会越容易。” + +即便你不是 `apt` 的重度使用者,当你需要在命令行中安装或删除软件包时(例如,在一台远程服务器上或遵循某些热心肠发布的操作指南时),掌握一些 `apt` 的知识也会很有用。在某些软件创作者仅提供了一个裸 `.pkg` 文件的情况下,可能还需要了解一些关于 dpkg 的知识(如上所述)。 + +我发现 Synaptic 包管理器在我的桌面上是一个非常有用的工具,但出于各种目的,我也在少数维护的服务器上使用着 `apt`。 + +[下载我们的 apt 速查表][15] 习惯该命令并尝试一些新技巧。一旦你这样做了,你可能会发现很难再使用其他任何东西。 + +> **[apt 速查表][15]** + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/apt-linux + +作者:[Chris Hermansen][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/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background) +[2]: https://opensource.com/article/21/2/linux-package-management +[3]: https://linux.cn/article-14542-1.html +[4]: https://www.nongnu.org/synaptic/ +[5]: https://wiki.debian.org/Aptitude +[6]: https://wiki.debian.org/Teams/Dpkg +[7]: https://flatpak.org/ +[8]: https://snapcraft.io/ +[9]: https://wiki.gnome.org/Apps/Software +[10]: https://archlinux.org/ +[11]: https://www.gentoo.org/ +[12]: https://opensource.com/article/20/11/cockpit-server-management +[13]: mailto:ubuntu-devel-discuss@lists.ubuntu.com +[14]: mailto:pkg-utopia-maintainers@lists.alioth.debian.org +[15]: https://opensource.com/downloads/apt-cheat-sheet diff --git a/published/20210710 A new open source operating system for embedded systems.md b/published/20210710 A new open source operating system for embedded systems.md new file mode 100644 index 0000000000..2674c8d4dc --- /dev/null +++ b/published/20210710 A new open source operating system for embedded systems.md @@ -0,0 +1,91 @@ +[#]: subject: (A new open source operating system for embedded systems) +[#]: via: (https://opensource.com/article/21/7/rt-thread-smart) +[#]: author: (Zhu Tianlong https://opensource.com/users/zhu-tianlong) +[#]: collector: (lujun9972) +[#]: translator: (tendertime) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14552-1.html) + +一种新的开源嵌入式操作系统 +====== + +> RT-Thread Smart 致力于物联网和边缘计算领域的开源。 + +![](https://img.linux.net.cn/data/attachment/album/202205/06/131909kdb7f966j22qf7o9.jpg) + +目前对 [嵌入式操作系统][2] 有巨大的需求,你建立的操作系统最好是开源的。[RT-Thread][3] 项目的研发团队花了两年时间,研发出了该项目的最新成果:RT-Thread Smart。这是一款微内核的操作系统,主要针对中高端的处理器,如具有内存管理单元(MMU)的 RISC-V 或 Arm Cortex-A,为嵌入式领域的所有行业提供了一个具有竞争力的、基于 POSIX 的软件平台。 + +### 谁需要 RT-Thread Smart? + +RT-Thread Smart 是一款专业的、高性能的微内核操作系统,用于实时应用。它为所有市场的嵌入式设备提供了开源基础,如安全(IP 摄像头)、工业控制、车载设备、消费电子及其他嵌入式科技应用,可谓一切场景。它的意义在于:不像传统的物联网操作系统,一个微内核的操作系统可以填补传统实时操作系统 RTOS 和相对大型的操作系统如 Linux 之间的空白,实现实时性能、成本、安全、启动速度等等各方面之间的最佳平衡。 + +### RT-Thread Smart 的架构 + +RT-Thread Smart 通过 MMU 和系统调用将系统分割为内核模式和用户模式,并为每种模式区分了地址空间(一个 32 位系统可以提供 4G 地址空间)。 + +![RT-Thread Smart 架构][4] + +(RT-Thread, [CC BY-SA 4.0][5]) + +RT-Thread Smart 内核包括平台的基础功能,并支持定制化。RT-Thread Smart 的用户应用环境使用 [musl libc][6] 来提供 [POSIX][7] 接口调用和 C 语言的运行时支持。它也继承了原始的 RT-Thread 生态系统,使用 [SCons][8] 或者其他编译工具如 [Autotools][9]、Makefile、[CMake][10] 等等来支持开发,以及 RT-Thread 开箱即用的在线软件包(撰写本文时超过 342 个)。你甚至可以将 Linux 应用程序(如 wget/cURL、BusyBox、OpenSSL 和 Simple DirectMedia Layer)移植到你的平台。 + +压缩的 RT-Thread Smart 内核仅 217 KB,搭配一个 127 KB 的根文件系统。大约 2 MB的存储占用。包括了对文件系统、网络协议栈、多媒体的完整支持。RT-Thread 只需要 3 到 5 秒完成启动,而在不运行其他功能组件时,RT-Thread Smart 需要的启动及准备时间不到 500ms。 + +通过其集成的 Persimmon 用户界面(UI)组件,RT-Thread Smart 从上电到运行 UI 需要大约 1 秒。换句话说,这是一个非常轻巧快速的系统。当然,“实时”不是指启动,而是指系统随着时间推进而表现出的一致性。对于 RT-Thread ,实时性能需要优先考虑,中断时延小于 1μs,满足大部分实时性要求严格的场景需求。 + +### RT-Thread Smart 和 RT-Thread + +你可能想知道 RT-Thread Smart 和 RT-Thread 之间的不同。简单来说, RT-Thread Smart 是一个基于 RT-Thread RTOS 的操作系统,但它整合了用户态的处理过程。RT-Smart 的内核部分本质上是 RT-Thread RTOS,它在虚拟地址上运行,增加了进程管理,使用进程间通信机制(IPC)、虚拟内存/地址空间管理、ELF 加载器等等,以上特性全部在 RT-Thread RTOS 内实现,当这些组件被禁用时,RT-Smart 会回归 RT-Thread RTOS。 + +以下是对比: + +| | RT-Thread | RT-Thread Smart + :-----| :----: | :----: +支持芯片 | Cortex-M/R、RISC-V RV32IMAC(以及类似)、Cortex-A MPU | Cortex-A 等具有 MMU 的 MPU +编译 | 内核和应用都编译到一个镜像 | 内核和应用可以被分开编译和运行 +存储 | 使用线性地址空间(即使有 MMU),使用物理地址的虚拟寻址 | 运行在内核占用超过 1GB 的 32 位操作系统,拥有完整 4G 地址空间的用户态进程彼此隔离,外设驱动程序必须通过虚拟地址访问外设 +运行错误 | 当一个应用程序失败时,整个系统就会崩溃 | 当应用程序失败时,它不会影响内核和其他进程的执行 +运行模式 | 多线程模型 | 多进程模型(进程内支持多线程,内核线程由内核支持) +用户模型 | 单用户模型 | 单用户模型 +API | RT-Thread API、POSIX PSE52 | RT-Thread API(内核态和用户态),以及完整的 POSIX API +实时性 | 抢占式硬实时系统 | 抢占式硬实时系统 +资源使用 | 非常小 | 相对小 +调试 | 通常需要模拟器调试 | 支持 GDB 调试,不需要模拟器 + +RT-Thread RTOS 非常紧凑,它的所有应用和子系统都编译到镜像中,多线程应用运行并分享相同的地址空间。 + +RT-Thread Smart 是独立的。系统和应用是分别编译和运行的。应用拥有完整且互相隔离的地址空间。它也继承了 RT-Thread 优秀的实时性,同时也具有 POSIX 环境的特性。 + +类似地,它们都与 RT-Thread API 兼容。RT-Thread RTOS 的应用可以被平滑移植到 RT-Thread Smart。 + +### 嵌入式开源 + +RT-Thread Smart 是一个开源项目,项目地址:[GitHub][11]。你可以下载代码和文档,尝试一下,并提交评论和反馈,将该项目传播给更多开源倡导者。嵌入式系统属于它们的用户,有太多的嵌入式开发人员没有找到太多可用的嵌入式系统。 + +如果你是开发人员,请帮助改进 RT-Thread Smart。随着 RT-Thread 项目的不断推进,我们希望创建物联网和边缘计算的令人激动的开源世界。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/rt-thread-smart + +作者:[Zhu Tianlong][a] +选题:[lujun9972][b] +译者:[tendertime](https://github.com/tendertime) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/zhu-tianlong +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LAW-Internet_construction_9401467_520x292_0512_dc.png?itok=RPkPPtDe (An intersection of pipes.) +[2]: https://opensource.com/article/20/6/open-source-rtos +[3]: https://www.rt-thread.io/ +[4]: https://opensource.com/sites/default/files/uploads/rt-thread-smart.png (RT-Thread Smart architecture) +[5]: https://creativecommons.org/licenses/by-sa/4.0/legalcode +[6]: https://musl.libc.org/ +[7]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[8]: https://scons.org/ +[9]: https://opensource.com/article/19/7/introduction-gnu-autotools +[10]: https://opensource.com/article/21/5/cmake +[11]: https://github.com/RT-Thread/rt-thread/tree/rt-smart diff --git a/published/20211213 How I use open source to design my own card games.md b/published/20211213 How I use open source to design my own card games.md new file mode 100644 index 0000000000..b2d051df18 --- /dev/null +++ b/published/20211213 How I use open source to design my own card games.md @@ -0,0 +1,111 @@ +[#]: subject: "How I use open source to design my own card games" +[#]: via: "https://opensource.com/article/21/12/open-source-card-game" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "hadisi1993" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14551-1.html" + +我如何利用开源设计自己的卡牌游戏 +====== + +> 开源并不仅仅指的是软件。开源是一种文化现象,自然也适合桌面游戏。 + +![](https://img.linux.net.cn/data/attachment/album/202205/06/094320k8uug3i84pg8u0w2.jpg) + +我喜欢优秀的游戏,尤其是桌游,因为桌游的很多特性都和开源相同。在现实生活中,当你和朋友围坐在桌旁一起玩卡牌游戏时,作为一个团队,你们可以一起决定小丑牌是不是万能的。还有,你们可以随意地决定当出了小丑牌后,手上有 Ace 牌的人的要不要舍弃 Ace 牌,或者出了方块皇后以后,每个人是不是都要把手上的牌传给右手边的人。换句话说,你们可以随心所欲地重新制定规则,因为游戏不过是参与者们一致认同的条件集合罢了。对我来说,更棒的是你可以发明自己的游戏,而不用破坏别人的游戏规则。有时候,我会作为一个业余爱好者来开发桌游。因为我喜欢把自己的爱好结合起来,所以我倾向于只使用开源和开放的文化资源来设计游戏。 + +首先,游戏有大致有两个关键特征,风格和机制,理解这一点非常重要。游戏风格指的是游戏的故事或者主题,游戏机制指的是游戏的规则和条件。这两者并不总是完全脱离的,举个例子,在设计一款以赛车为主题的游戏时,自然而然就会要求玩家迅速完成动作。然而,风格和机制通常是被分开对待的,所以我们完全可以为了好玩就去创造一款使用标准扑克牌,却以太空羊驼为主题的游戏。 + +### 开源美术 + +如果你去过现代艺术博物馆,你可能会发现自己站在一幅纯蓝色的画布前,无意中听到有人说起老话:“见鬼,这我也能做!”。但事实是,艺术是一项艰巨的工作。创作赏心悦目的艺术品需要付出大量的思考、时间、信心和技巧。这也意味着艺术是你在设计游戏时中最难采购的部分之一。 + +我有一些“技巧”来解决这个典型难题。 + +#### 1、寻找同类素材 + +现在有很多免费、开放的艺术作品,而且大部分质量上佳。问题在于,游戏通常需要不止一件作品。如果你正在设计一款纸牌游戏,你大概至少需要四到六个不同的元素(假设你的纸牌遵循塔罗牌风格),有可能还需要更多。如果你花足够多的时间在这上面,你可以在 [OpenGameArt.org][3]、[FreeSVG.org][4]、[ArtStation.com][5]、[DeviantArt.com][6] 等网站上找到[知识共享和公共领域][2]Creative Commons and Public Domain的艺术作品。 + +如果你使用的网站没有专门搜索知识共享Creative Commons的功能,输入以下文字到任何搜索引擎当中,`"This work is licensed under a Creative Commons"` 或 `"本工作处于知识共享许可协议之下"`(引号很重要,不要把它们漏了),并用搜索引擎要求的语法,以便将搜索限制到一个具体的站点当中(举个例子,`site:deviantart.com`)。 + +一旦你有了一个可供挑选素材的艺术库,那就去辨别这些作品的主题,并根据主题分类。两个不同的人拍摄的机器人的照片可能看起来一点都不像,但它们的主题都是机器人。如果提供给你足够多机器人相关的美术素材,你可以围绕机器人这个主题构建你的游戏风格。 + +#### 2、委托创作知识共享艺术 + +你可以雇艺术家来为你定制艺术作品。我与使用开源绘画程序(如 [Krita][7] 和 Mypaint)的艺术家一起合作。同时,作为合同的一部分,我规定艺术作品必须在知识共享署名-相同方式许可证Creative Commons Attribution-ShareAlike(CC BY-SA)下授权。迄今为止,只有一位艺术家因为许可证的限制拒绝了我的提议,并且大多数人都很高兴自己的美术作品有可能有更大的生命力,而不仅仅是作为业余爱好者自己发行的游戏的一部分。 + +#### 3、创作自己的艺术 + +就像现代艺术馆之旅展示的那样,艺术是一个非常灵活的词。我发现只要我给自己设定一个目标,也就是我需要为一款游戏创造多少纸牌或令牌,我便能够从 Linux 上的丰富图像创造工具中选择一种去创作。这并不需要什么高难度的东西。就像现代艺术一样,你可以用蓝色和黄色的条纹,或者红色和白色的圆点花纹,或者绿色和紫色的锯齿线来涂一张卡片,只要你能把它们画出来,那么除了你以外,其他人永远不会知道你暗地里把它们当做仙宫里的贵族和小姐。想想看,通过运用图形应用程序,描摹日常物品的照片,重组经典的扑克花色和塔罗牌主题等一系列方式,你可以创造出的简单作品吧。 + +### 版面设计 + +我用 [Inkscape][8]、Scribus 或者 [GIMP][9] 来进行版面设计,这取决与我有什么素材以及我追求的设计方式是什么。 + +对于卡牌,我发现简单的版面设计很容易实现,看上去也更好,纯色比渐变色更容易印刷,还有,直观的图像是最棒的。 + +![layout in Inkscape][10] + +(Seth Kenlon, CC BY-SA 4.0) + +我在一个单独的 Inkscape 文件中为我最新的游戏做了版面设计,这个游戏只使用了来自 OpenGameArt.com 上三四个不同艺术家的九张图片。在有着更大的美工集,更好的卡牌多样性的游戏中,我会在游戏中的每一种卡片的文件中为它们设计版面。 + +在为你的游戏素材做任何版面设计之前,要先了解你的目标输出是什么。如果你打算在家里打印游戏,那就做一些计算,搞清楚默认的纸张大小(有些是 US Letter,或者是 A4)可以容纳多少卡牌、令牌或卡片。如果你使用 [TheGameCrafter][11] 之类的桌游打印机打印,请下载好模板文件。 + +![printed cards][12] + +(Seth Kenlon, CC BY-SA 4.0) + +### 游戏机制 + +游戏机制是游戏中最重要的部分。它们使一款游戏成为游戏。开发游戏规则并不一定是一个正式的过程。你可以一时兴起地创造了一款游戏,可以拿一个现有的游戏重组它的规则,直到它和原来不同,可以修改一款你不喜欢的游戏,也可以将两款不同的游戏组合在一起。从简单容易的地方做起,拿索引卡,标准扑克牌,或塔罗牌去试着模拟你的想象中游戏是如何工作的。你可以自己尝试早期的游戏创意,但最终,让朋友来帮忙是找出意外故障和进行优化的好方法。 + +经常测试游戏。与不同类型的玩家一起玩游戏,并听取他们的反馈。你的游戏可能会激发许多玩家去创造新的规则和想法,因此要将关于 _哪些搞砸了_ 的反馈与关于 _哪些可以做修改_ 的反馈分开。你不一定要去真的实施这些反馈意见,只需迭代你的想法,但还是要仔细考虑错误报告。 + +一旦确定了你想要让你的规则如何运作,就把它们写下来,让它们 [简短且容易解析][13]。你定的规则不必说服玩家去玩这款游戏,不必向他们解释策略,你也不必允许玩家重新设置规则,只要告诉玩家为了让游戏玩起来,他们应该采取的步骤就可以了。 + +最重要的是,考虑一下,将你的规则开源。分享经验是游戏的一切,这其中也应该包括规则。知识共享或开放游戏许可证Open Gaming License的规则集合允许其他玩家在你的作品上进行迭代、混合和构建。你永远不会知道,有人可能会因此想出一个你更喜欢的游戏变体! + +### 开源游戏 + +开源不仅仅指的是软件。开源是一种文化现象,自然也适合桌面游戏。花几个晚上的时间来尝试制作游戏。如果你是新手,那就从一些简单的开始,比如下面的这个空白卡牌游戏: + + 1. 找来一些朋友。 + 2. 给每个人几张空白的索引卡,告诉他们在每张卡片上写一条规则。规则可以是任何东西(“如果你穿着红色衣服,你就赢了”或“第一个站起来的人赢”等等)。 + 3. 在你自己的索引卡片上,写上 “和”、“但是”、“但是不要”、“而且不要”、“除了”,以及其他的条件短语。 + 4. 洗牌并将牌发给所有玩家。 + 5. 每个玩家轮到的时候出一张牌。 + 6. 最终目标是获胜,但是玩家可以通过出 “和”、“但是”、“或者” 卡片来修改决定胜负的条件。 + +这是一个有趣的聚会游戏,同时是一份很好的介绍,告诉你如何像游戏设计者一样思考,它帮助你认识到什么适合作为游戏机制,什么不适合。 + +还有,当然的,这是开源的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/12/open-source-card-game + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[hadisi1993](https://github.com/hadisi1993) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rich-smith-unsplash.jpg?itok=uzzS0gRa (Deck of playing cards) +[2]: https://opensource.com/article/20/1/what-creative-commons +[3]: https://opensource.com/article/21/12/opengameart.org/ +[4]: http://freesvg.org +[5]: http://artstation.com +[6]: http://deviantart.com +[7]: https://opensource.com/article/21/12/krita-digital-paint +[8]: https://opensource.com/article/21/12/linux-draw-inkscape +[9]: https://opensource.com/content/cheat-sheet-gimp +[10]: https://opensource.com/sites/default/files/inkscape-layout.jpg (Layout in Inkscape) +[11]: https://www.thegamecrafter.com/ +[12]: https://opensource.com/sites/default/files/cards-printed_0.jpg (Printed cards) +[13]: https://opensource.com/life/16/11/software-documentation-tabletop-gaming diff --git a/published/20220113 Learn Rust in 2022.md b/published/20220113 Learn Rust in 2022.md new file mode 100644 index 0000000000..5995ca8a67 --- /dev/null +++ b/published/20220113 Learn Rust in 2022.md @@ -0,0 +1,275 @@ +[#]: subject: "Learn Rust in 2022" +[#]: via: "https://opensource.com/article/22/1/rust-cheat-sheet" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "hanszhao80" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14563-1.html" + +2022 Rust 入门指南 +====== + +> 如果你打算在今年探索 Rust,请下载我们的免费 Rust 速查表,以供快速参考基础知识。 + +![](https://img.linux.net.cn/data/attachment/album/202205/08/161625lvo8v82ell9l3xmm.jpg) + +Rust 是一门相对较新的编程语言,受到各个企业的 [程序员的欢迎][2]。尽管如此,它仍是一门建立在之前所有事物之上的语言。毕竟,Rust 不是一天做出来的,所以即便 Rust 中的一些概念看起来与你从 Python、Java、C++ 等编程语言学到的东西大不相同,但它们都是基于同一个基础,那就是你一直与之交互(无论你是否知道)的 CPU 和 NUMA(非统一内存访问Non Uniform Memory Access)架构,因此 Rust 中的一些新功能让人感觉有些熟悉。 + +现在,我的职业不是程序员。我没耐心但我又有点儿强迫症。当我需要完成某件事时,如果一门语言不能帮助我相对较快地获得想要的结果,那么我很少会受到鼓舞而使用它。Rust 试图平衡两个矛盾:现代计算机对安全和结构化代码的需求,和现代程序员对编码工作事半功倍的渴望。 + +### 安装 Rust + +[rust-lang.org][3] 网站有丰富的的文档指导如何安装 Rust,但通常,它就像下载 `sh.rustup.rs` 脚本并运行它一样简单。 + +``` +$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs +$ less sh.rustup.sh +$ sh ./sh.rustup.rs +``` + +### 没有类 + +Rust 没有类,也不使用 `class` 关键字。Rust 确实有 `struct` 数据类型,但它的作用是充当数据集合的一种模板。因此,你可以使用结构体struct,而不是创建一个类来表示虚拟对象: + +``` +struct Penguin { +  genus: String, +  species: String, +  extinct: bool, +  classified: u64, +} +``` + +你可以像使用类一样使用它。例如,当定义完 `Penguin` 结构,你就可以创建它的实例,并与该实例进行交互: + +``` +struct Penguin { +  genus: String, +  species: String, +  extinct: bool, +  classified: u64, +} + +fn main() { +  let p = Penguin { genus: "Pygoscelis".to_owned(), +   species: "R adeliæ".to_owned(),  +   extinct: false,  +   classified: 1841 }; + +  println!("Species: {}", p.species);     +  println!("Genus: {}", p.genus); +  println!("Classified in {}", p.classified); +  if p.extinct == true { +    println!("Sadly this penguin has been made extinct."); +  } +} +``` + +将 `impl` 数据类型与 `struct` 数据类型结合使用,你可以实现一个包含函数的结构体,并且可以添加继承和其他与类相似的特性。 + +### 函数 + +Rust 中的函数很像其他语言中的函数。每个函数都代表一组严谨的任务,你可以在需要时调用它们。主函数名必须是 `main`。 + +用 `fn` 关键字声明函数,后跟函数名称和函数接受的所有参数。 + +``` +fn foo() { +  let n = 8; +  println!("Eight is written as {}", n); +} +``` + +通过参数,将信息从一个函数传递到另一个函数。例如,我已经创建了一个 `Penguin` 类(结构),并且我有一个 `Penguin` 的实例为 `p`,将目标函数的参数指定为 `Penguin` 类型,就可把 `p` 的属性从一个函数传递到另一个函数。 + +``` +fn main() { +  let p = Penguin { genus: "Pygoscelis".to_owned(),  +    species: "R adeliæ".to_owned(),  +    extinct: false, classified: 1841 }; +  printer(p); +} + +fn printer(p: Penguin) { +  println!("Species: {}", p.species);     +  println!("Genus: {}", p.genus); +  println!("Classified in {}", p.classified); +  if p.extinct == true { +    println!("Sadly this penguin has been made extinct."); +  } +} +``` + +### 变量 + +Rust 默认创建的为不可变immutable变量。这意味着你创建的变量以后无法更改。这段代码虽然看起来没问题,但无法编译: + +``` +fn main() { +  let n = 6; +  let n = 5; +} +``` + +但你可以使用关键字 `mut` 声明一个可变mutable变量,因此下面这段代码可以编译成功: + +``` +fn main() { +  let mut n = 6; +  println!("Value is {}", n); +  n = 5; +  println!("Value is {}", n); +} +``` + +### 编译 + +Rust 编译器,至少就其报错信息而言,是可用的最好的编译器之一。当你在 Rust 中出错时,编译器会真诚地告诉你做错了什么。实际上,仅通过从编译器错误消息中学习,我就了解了 Rust 的许多细微差别(就我理解到的 Rust 的任何细微差别而言)。即便有时错误消息太过于模糊,而不知所以然,互联网搜索几乎总能得到解释。 + +启动 Rust 程序的最简单方法是使用 `cargo`,它是 Rust 的包管理和构建系统。 + +``` +$ mkdir myproject +$ cd myproject +$ cargo init  +``` + +以上命令为项目创建了基本的基础架构,最值得注意的是 `src` 子目录中的 `main.rs` 文件。打开此文件,把我为本文生成的示例代码粘贴进去: + +``` +struct Penguin { +  genus: String, +  species: String, +  extinct: bool, +  classified: u64, +} + +fn main() { +  let p = Penguin { genus: "Pygoscelis".to_owned(), species: "R adeliæ".to_owned(), extinct: false, classified: 1841 }; +  printer(p); +  foo(); +} + +fn printer(p: Penguin) { +  println!("Species: {}", p.species);     +  println!("Genus: {}", p.genus); +  println!("Classified in {}", p.classified); +  if p.extinct == true { +    println!("Sadly this penguin has been made extinct."); +  } +} + +fn foo() { +  let mut n = 6; +  println!("Value is {}", n); +  n = 8; +  println!("Eight is written as {}", n); +} +``` + +使用 `cargo build` 命令进行编译: + +``` +$ cargo build +``` + +执行 `target` 子目录下的二进制程序,或者直接运行 `cargo run` 命令来运行你的项目: + +``` +$ cargo run +Species: R adeliæ +Genus: Pygoscelis +Classified in 1841 +Value is 6 +Eight is written as 8 +``` + +### Crates + +任何语言的大部分便利都来自于它的库或模块。在 Rust 中,进行分发和跟踪的库称为 “crate”(箱子)。[crates.io][4] 是一个很好的社区 crate 注册网站。 + +把一个 crate 添加到你的 Rust 项目,首先要在 `Cargo.toml` 文件中添加这个 crate。例如,要安装随机数函数,我使用名为 `rand` 的 crate,使用 `*` 作为通配符,以确保在编译时获得最新版本: + +``` +[package] +name = "myproject" +version = "0.1.0" +authors = ["Seth "] +edition = "2022" + +[dependencies] +rand = "*" +``` + +在 Rust 代码中使用它需要在最顶行使用 `use` 语句: + +``` +use rand::Rng; +``` + +以下是一些创建随机种子和随机范围的示例代码: + +``` +fn foo() { +  let mut rng = rand::thread_rng(); +  let mut n = rng.gen_range(1..99); + +  println!("Value is {}", n); +  n = rng.gen_range(1..99); +  println!("Value is {}", n); +} +``` + +你可以使用 `cargo run` 来运行它,它会检测代码是否被更改并触发一个新的构建。构建过程中下载名为 `rand` 的 `crete` 和它依赖的所有 `crate`,编译代码,然后运行它: + +``` +$ cargo run +Updating crates.io index +Downloaded ppv-lite86 v0.2.16 +Downloaded 1 crate (22.2 KB) in 1.40s + Compiling libc v0.2.112 + Compiling cfg-if v1.0.0 + Compiling ppv-lite86 v0.2.16 + Compiling getrandom v0.2.3 + Compiling rand_core v0.6.3 + Compiling rand_chacha v0.3.1 + Compiling rand v0.8.4 + Compiling rustpenguin v0.1.0 (/home/sek/Demo/rustpenguin) + Finished dev [unoptimized + debuginfo] target(s) in 13.97s + Running `target/debug/rustpenguin` + +Species: R adeliæ +Genus: Pygoscelis +Classified in 1841 +Value is 70 +Value is 35 +``` + +### Rust 速查表 + +Rust 是一门令人非常愉快的语言。集成了在线注册网站、有用的编译器和几乎直观的语法,它给人的适当的现代感。 + +但请不要误会,Rust 仍是一门复杂的语言,它具有严格的数据类型、强作用域变量和许多内置方法。Rust 值得一看,如果你要探索它,那么你应该下载我们的免费 [Rust 速查表][6],以便快速了解基础知识。越早开始,就越早了解 Rust。当然,你应该经常练习以避免生疏。 + +> **[Rust 速查表][6]** + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/1/rust-cheat-sheet + +作者:[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/coverimage_cheat_sheet.png?itok=lYkNKieP (Cheat Sheet cover image) +[2]: https://opensource.com/article/20/5/rust-java +[3]: http://rust-lang.org +[4]: https://crates.io/ +[5]: mailto:seth@opensource.com +[6]: https://opensource.com/downloads/rust-cheat-sheet diff --git a/published/20220212 5 levels of transparency for open source communities.md b/published/20220212 5 levels of transparency for open source communities.md new file mode 100644 index 0000000000..3525fa220b --- /dev/null +++ b/published/20220212 5 levels of transparency for open source communities.md @@ -0,0 +1,100 @@ +[#]: subject: "5 levels of transparency for open source communities" +[#]: via: "https://opensource.com/article/22/2/transparency-open-source-communities" +[#]: author: "Emilio Galeano Gryciuk https://opensource.com/users/egaleano" +[#]: collector: "lujun9972" +[#]: translator: "aREversez" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14596-1.html" + +开源社区透明度的五个层次 +====== + +> 如果想让开源社区繁荣发展,管理者需要达到透明度的五个层次。 + +![](https://img.linux.net.cn/data/attachment/album/202205/15/150842yrvm9v5qbbd7a355.jpg) + +开源社区的管理者必须意识到社区有五个层次的透明度,这对于建设繁荣发展的开源社区来说至关重要。 + +本文将详细介绍各个层次及其目标与作用。不过首先,我想谈一谈透明度对开源社区的重要性。 + +### 为什么开源社区需要保证透明度? + + * 透明能够增进社区成员之间的信任,促进合作。 + * 开放是社区合作和交流的前提。 + * 只有在开放透明的环境下,开源工作才能避免矛盾与冲突。 + * 社区管理者需要向参与者报告社区情况。 + * 向成员公开社区各项情况,营造信任氛围,有利于社区健康发展。 + +### 透明度的五个层次 + +#### 层次一:发布源码 + +在这一层次,社区需要遵循 [OSI 认可的许可证][2],在 [Git][3] 等公开的版本控制系统上发布源码。 + +层次一的目标在于创建开源项目。 + + * 建立开源社区,理应达到这一层次。因为没有公开源代码,也就无所谓开源项目。 + * 开源项目的核心便是参与者们编写的源码,并在 OSI 批准的许可证下授权。 + * 公开的版本控制系统能够促进合作,使得每一位开发者都能了解项目情况,理解合作模式。 + +#### 层次二:发布社区指南 + +达到这一层次,需要发布相关文档以及资源。也可通过组织活动来指导社区成员。 + +层次二的目标在于为一个开源项目建立和发展一个开源社区。 + + * 建立一个活跃的社区需要的不仅仅是源代码。 + * 公开项目开展方式和贡献方式,能够吸引更多的开发者参与到项目当中。 + * 为了推动社区的发展,管理者可能需要举办一些重要活动,并为贡献者们筹办一些特殊的活动。 + +#### 层次三:继往开来 + +到了这个层次,管理者有必要分享自己对于社区的见解,发布项目进展情况报告。 + +层次三的目标在于继往开来,确保社区进入后续阶段后能够更上一层楼,实现长远发展。 + + * 随着开源社区的发展,社区内的情况将会越来越难以把握。 + * 公开社区活动,让成员意识到自己的付出能够为公众所见,为公众所识。 + * 在这一层次,无论是报告还是分析,发布的时间并不固定,使用的工具也无定法。 + +#### 层次四:掌握社区的动态 + +这一层次就在于倾听社区声音:通过观察社区活动,关注项目发展;跟进软件开发进度,据此采取合适的应对措施。 + +层次四的目标在于保持科学严谨的态度,持续把握社区的发展情况及发展轨迹,引导社区朝着下一个层次迈进。 + + * 建立报告机制,运用分析工具,掌握社区动态。 + * 将社区的各项活动与社区成员的反响与基线和社区内的其他活动进行比较。 + * 坚持倾听社区声音,形成对于社区更深刻的见解。 + +#### 层次五:维护社区,长久发展 + +最后一个层次就是依据社区各项指标,提高社区成员的参与度。 + +层次五的目标在于制定行之有效、能够产生积极影响的决策方案,让开发者更好地参与社区项目。 + + * 适当调整系统,以适应社区各项指标的变动。 + * 跟进这些变动,理解它们是如何通过各项指标和数据分析体现出来的。 + * 针对社区维护者与开发者,制定服务等级协议和问责制度,为其设立参与度目标,确保项目整体顺利进行。 + +### 总结 + +开源社区管理者需要做到上述五个层次,保证透明度,才能构建起一个繁荣发展的社区。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/2/transparency-open-source-communities + +作者:[Emilio Galeano Gryciuk][a] +选题:[lujun9972][b] +译者:[aREversez](https://github.com/aREversez) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/egaleano +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_dandelion_520x292.png?itok=-xhFQvUj (Person in a field of dandelions) +[2]: https://opensource.org/licenses +[3]: https://opensource.com/tags/git diff --git a/published/20220219 Crop and resize photos on Linux with Gwenview.md b/published/20220219 Crop and resize photos on Linux with Gwenview.md new file mode 100644 index 0000000000..861d6da3c5 --- /dev/null +++ b/published/20220219 Crop and resize photos on Linux with Gwenview.md @@ -0,0 +1,120 @@ +[#]: subject: "Crop and resize photos on Linux with Gwenview" +[#]: via: "https://opensource.com/article/22/2/crop-resize-photos-gwenview-kde" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14550-1.html" + +用 Gwenview 在 Linux 上裁剪和调整照片大小 +====== + +> Gwenview 是一个优秀的照片编辑器,适合业余摄影师在 Linux KDE 桌面上使用。 + +![](https://img.linux.net.cn/data/attachment/album/202205/05/221207dtkjbbe1jets7n3u.jpg) + +一张好的照片可以蕴含很多信息。表面上它表达了你所看到的,但它也讲述了你所经历的。细微之处也能说明很多问题:你在拍照时选择的角度、取景中隐约可见的的东西有多大,以及,相比之下,那些有意识选择忽略的部分。 + +照片通常并不意味着记录真实发生的事情,相反,它们会成为你(摄影师)如何看待发生的事情的洞察力。 + +这就是照片编辑如此普遍的原因之一。当你把照片发布到你的在线图片库或社交网络时,你不应该发布一张不能准确表达照片所包含的感受的照片。但同样的道理,你也不应该成为一个专业的照片合成师,而只是为了剪掉在最后时刻将头伸进你的家庭快照的路人。如果你使用的是 KDE,你可以使用 Gwenview 这种休闲照片编辑器。 + +### 在 Linux 上安装 Gwenview + +如果你正在运行 KDE Plasma 桌面,你可能已经安装了 Gwenview。如果你没有安装,或者你正在使用一个不同的桌面,而你想尝试 Gwenview,那么你可以用你的软件包管理器安装它。 + +我建议同时安装 Gwenview 和 Kipi 插件集,它可以将 Gwenview 与几个在线照片服务连接起来,这样你就可以轻松上传照片。在 Fedora、Mageia 和类似发行版上: + +``` +$ sudo dnf install gwenview kipi-plugins +``` + +在 Debian、Elementary 和类似版本上: + +``` +$ sudo apt install gwenview kipi-plugins +``` + +### 使用 Gwenview + +Gwenview 通常有两种启动方式。你可以在 Dolphin 中点击图片文件,并选择在 Gwenview 中打开它;或者你可以启动 Gwenview,并在文件夹中寻找照片,Gwenview 或多或少可以充当你的文件管理器。第一种方法是直接的方法,很适合快速方便地预览图片文件。第二种方法是当你浏览大量照片,不确定哪一个版本的照片是“正确的”时,你可能会使用。 + +无论你如何启动 Gwenview,界面和功能都是一样的:右边有一个工作区,左边有一个面板。 + +![Gwenview][2] + +(Seth Kenlon [CC BY-SA 4.0][3], Photo courtesy [Andrea De Santis][4]) + +在左边的面板下面,有三个标签: + + * 文件夹Folders:显示你电脑上的文件夹的树状视图,以便你可以浏览你的文件,寻找更多的照片。 + * 信息Information:提供关于你目前正在查看的照片的元数据。 + * 操作Operations:允许你对当前的照片进行小的修改,如在横向和纵向之间旋转、调整大小和裁剪等。 + +Gwenview 能理解文件系统,所以你可以按键盘上的**右**或**左**箭头,查看文件夹中的上一张或下一张照片。 + +要离开单张照片视图并查看一个文件夹中的所有图片,请点击顶部工具栏中的“浏览Browse”按钮。 + +![Browsing photos in a folder][5] + +(Seth Kenlon,[CC BY-SA 4.0][3]) + +你也可以同时拥有两种视图。点击 Gwenview 底部的“缩略图栏Thumbnail Bar”按钮,可以以电影胶片的形式看到当前文件夹中的其他图片,而当前选择的照片则在主面板中。 + +![Thumbnail view][6] + +(Seth Kenlon,[CC BY-SA 4.0][3]) + +### 用 Gwenview 编辑照片 + +数码照片是很常见的,因此在网上发布或与朋友分享之前,需要对照片进行细微的调整也是同样常见。有非常好的应用可以编辑照片,事实上,其中最好的一个是另一个 KDE 应用,叫做 Krita(你可以在我的 [给摄影者的 Krita][7] 文章中阅读我如何使用它来处理照片),但是小的调整不应该需要艺术学位。这正是 Gwenview 所确保的:用一个休闲但功能强大的应用进行简单而快速的照片调整,并与你的 Plasma 桌面的其他部分整合。 + +我们大多数人对照片进行的最常见的调整是: + + * **旋转**:当你的相机没有提供正确的元数据让你的电脑知道一张照片是要以横向还是纵向观看时,你可以手动修复它。 + * **镜像**:许多笔记本电脑或面部摄像头模仿镜子,这很有用,因为这是我们习惯于看到自己的方式。但是,它会使文字逆转。**镜像**功能可以从右到左翻转图像。 + * **翻转**:在数码相机和笔记本电脑上不太常见,但在手机上,无论你怎么拿手机,使用倒置设备拍照的现象在屏幕翻转的手机中并不少见。**翻转**功能可将图像旋转 180 度。 + * **调整大小**:数字图像现在通常具有超高清尺寸,有时这比你需要的要多得多。如果你通过电子邮件发送照片或将其发布在你想要优化加载时间的网页上,你可以将尺寸(和相应的文件大小)缩小到更小的尺寸。 + * **裁剪**:你有一张很棒的自己的照片,但不小心偶然发现了一个你认为不合适的人。用裁剪工具剪掉你不想要的所有东西。 + * **红眼**:当你的视网膜将相机的闪光灯反射回相机时,会得到红眼效果。Gwenview 可以通过在可调节区域中对红色通道进行去饱和和变暗来减少这种情况。 + +所有这些工具都在“操作Operations”侧面板或“编辑Edit”菜单中可用。这些操作具有破坏性,因此在你进行更改后,单击“另存为Save As”以保存图像的 _副本_。 + +![Cropping a photo in Gwenview][8] + +(Seth Kenlon,[CC BY-SA 4.0][3],照片由 [Elise Wilcox][9] 提供) + +### 分享照片 + +当你准备好分享照片时,单击顶部工具栏中的“分享Share”按钮,或转到“插件Plugins”菜单并选择“导出Export”。Gwenview 与 Kipi 插件集成在一起,可以在 [Nextcloud][10]、[Piwigo][11]、普通旧电子邮件以及 Google Drive、Flickr、Dropbox 等服务共享照片。 + +### Linux 上的照片编辑要点 + +Gwenview 拥有桌面照片管理器的所有必需功能。如果你需要的不仅仅是基本功能,你可以在 Krita 或 [Digikam][12] 中打开一张照片,并根据需要进行重大修改。对于其他一切,从浏览、排名、标记和小调整,Gwenview 都很方便。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/2/crop-resize-photos-gwenview-kde + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/design_photo_art_polaroids.png?itok=SqPLgWxJ (Polaroids and palm trees) +[2]: https://opensource.com/sites/default/files/kde-gwenview-ui.jpg (Gwenview) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: http://unsplash.com/@santesson89 +[5]: https://opensource.com/sites/default/files/kde-gwenview-browse.jpg (Browsing photos in a folder) +[6]: https://opensource.com/sites/default/files/kde-gwenview-thumbnail.jpg (Thumbnail view) +[7]: https://opensource.com/article/21/12/open-source-photo-editing-krita +[8]: https://opensource.com/sites/default/files/kde-gwenview-crop.jpg (Cropping a photo in Gwenview) +[9]: http://unsplash.com/@elise_outside +[10]: https://opensource.com/article/20/7/nextcloud +[11]: https://opensource.com/alternatives/google-photos +[12]: https://opensource.com/life/16/5/how-use-digikam-photo-management diff --git a/published/20220221 3 steps to start running containers today.md b/published/20220221 3 steps to start running containers today.md new file mode 100644 index 0000000000..433148e741 --- /dev/null +++ b/published/20220221 3 steps to start running containers today.md @@ -0,0 +1,179 @@ +[#]: subject: "3 steps to start running containers today" +[#]: via: "https://opensource.com/article/22/2/start-running-containers" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "MjSeven" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14584-1.html" + +当下运行容器的 3 个步骤 +====== + +> 在本教程中,你将学习如何在一个“吊舱”中运行两个容器来托管一个 WordPress 站点。 + +![](https://img.linux.net.cn/data/attachment/album/202205/12/121429y2s9v96rxxk2litk.jpg) + +无论你是将其作为工作的一部分、未来的工作机会或者仅仅是出于对新技术的兴趣,容器对很多人,即使是经验丰富的系统管理员,可能是非常难以应付的。那么如何真正开始使用容器呢?从容器到 [Kubernetes][2] 的成长路径是什么?另外,为什么有不止一条路径?如你所料,最好的起点就是现在。 + +### 1、了解容器 + +略一回忆,容器的开端可以追溯到早期 BSD 及其特殊的 chroot 监狱,但让我们直接跳到发展中期讲起。 + +之前,Linux 内核引入了 “控制组cgroup”,允许你能够使用 “命名空间namespace” 来“标记”进程。当你将进程分组到一个命名空间时,这些进程的行为就像在命名空间之外的东西不存在一样,这就像你把这些进程放入某种容器中。当然,这种容器是虚拟的,它位于计算机内部,它和你操作系统的其余进程使用相同的内核、内存和 CPU,但你用容器包含了这些进程。 + +分发的预制容器仅包含运行它所包含的应用程序必须的内容。使用容器引擎,如 [Podman][3]、Docker 或 CRI-O,你可以运行一个容器化应用程序,而无需进行传统意义上的安装。容器引擎通常是跨平台的,因此即使容器运行在 Linux 上,你也可以在其他 Linux、MacOS 或 Windows 上启动容器。 + +更重要的是,当需求量很大时,你可以运行同一应用程序的多个容器。 + +现在你知道了什么是容器,下一步是运行一个容器。 + +### 2、运行一个容器 + +在运行容器之前,你应该有一个想要运行它的理由。你可以编一个,这有助于你对让容器创建过程感兴趣,这样你就会受到鼓舞,真正去使用你所运行的容器。毕竟,运行容器但不使用它提供的应用程序,只能证明你没有注意到任何故障,但使用容器证明它可以工作。 + +我推荐从 WordPress 开始,它是一个很流行的 Web 应用程序,容易使用,所以一旦容器运行起来,你就可以测试使用它。虽然你可以轻松地配置一个 WordPress 容器,但还是有很多配置选项可以引导你发现更多运行容器的方式(例如运行数据库容器)以及容器如何通信。 + +我使用 Podman,它是一个友好、方便且无守护进程的容器引擎。如果你没有安装 Podman,可以改用 Docker 命令。它们都是很棒的开源容器引擎,而且它们的语法是相同的(只需输入 `docker` 而不是 `podman`)。因为 Podman 没有守护进程,所以它需要更多的配置,但为了这种运行免 root、无守护进程的容器的能力是值得的。 + +如果你使用 Docker,可以跳到下面的 [运行 WordPress 容器][5] 小节,否则,打开终端安装并配置 Podman: + +``` +$ sudo dnf install podman +``` + +容器会产生许多进程,通常只有 root 用户有权创建数千个进程 ID。创建一个名为 `/etc/subuid` 的文件,定义一个适当的起始 UID 和大量合法的 PID,这样就可以为你添加一些额外的进程 ID: + +``` +seth:200000:165536 +``` + +在名为 `/etc/subgid` 的文件中对你的组执行相同的操作。在这个例子中,我的主要组是 `staff`(对你来说可能是 `users`,或者和你的用户名一样,这取决于你的系统)。 + +``` +staff:200000:165536 +``` + +最后,确认你的用户可以管理很多命名空间: + +``` +$ sysctl --all --pattern user_namespaces +user.max_user_namespaces = 28633 +``` + +如果你的用户无权管理超过 28,000 个命名空间,创建 `/etc/sysctl.d/userns.conf` 文件来增加数量并输入: + +``` +user.max_user_namespaces=28633 +``` + +#### 运行 WordPress 容器 + +现在,无论你使用的是 Podman 还是 Docker,你都可以从在线容器仓库中下载 WordPress 容器并运行它。你可以使用以下 Podman 命令完成所有这些操作: + +``` +$ podman run --name mypress \ + -p 8080:80 -d wordpress +``` + +给 Podman 一会时间来找到容器、从互联网下载它,然后启动。 + +在收到终端返回提示符后,启动 Web 浏览器,打开 `localhost:8080`。WordPress 正在运行,等待你进行设置。 + +![WordPress 容器][6] + +不过,你很快就会遇到障碍,因为 WordPress 使用数据库来存储数据,因此你需要为其提供一个数据库。 + +在继续之前,停止并删除 WordPress 容器: + +``` +$ podman stop mypress +$ podman rm mypress +``` + +### 3、在吊舱中运行容器 + +正如名字所暗示的那样,容器在设计上是独立的。在容器中运行的应用程序不应该与在容器外的应用程序或基础设施进行交互。因此,当一个容器需要另一个容器才能运行时,一种解决方案是将这两个容器放在一个更大的容器中,称为 “吊舱pod”。吊舱确保其容器可以共享重要的命名空间以便相互通信。 + +创建一个新的吊舱,为它提供一个名称,以及希望能够访问的端口: + +``` +$ podman pod create \ + --name wp_pod \ + --publish 8080:80 +``` + +确认吊舱存在: + +``` +$ podman pod list +POD ID        NAME     STATUS    INFRA ID      # OF CONTAINERS +100e138a29bd  wp_pod   Created   22ace92df3ef   1 +``` +#### 将容器添加到吊舱 + +现在你已经为相互依赖的容器创建了一个吊舱,你可以通过指定一个运行的吊舱来启动每个容器。 + +首先,启动一个数据库容器。你可以创建自己的凭据,只要在 WordPress 连接到数据库时使用相同的凭据。 + +``` +$ podman run --detach \ + --pod wp_pod \ + --restart=always \ + -e MYSQL_ROOT_PASSWORD="badpassword0" \ + -e MYSQL_DATABASE="wp_db" \ + -e MYSQL_USER="tux" \ + -e MYSQL_PASSWORD="badpassword1" \ + --name=wp_db mariadb +``` + +接下来,在同一个吊舱中启动 WordPress 容器: + +``` +$ podman run --detach \ + --restart=always --pod=wp_pod \ + -e WORDPRESS_DB_NAME="wp_db" \ + -e WORDPRESS_DB_USER="tux" \ + -e WORDPRESS_DB_PASSWORD="badpassword1" \ + -e WORDPRESS_DB_HOST="127.0.0.1" \ + --name mypress wordpress +``` + +现在启动你最喜欢的网络浏览器并打开 `localhost:8080`。 + +这一次,设置会正常进行。WordPress 会连接到数据库,因为你在启动容器时传递了这些环境变量。 + +![WordPress 启动][8] + +创建用户账户后,你可以登录查看 WordPress 仪表板。 + +![WordPress dashboard running in a container][9] + +### 下一步 + +你已经创建了两个容器,并在一个吊舱中运行了它们。你现在已经了解了如何在自己的服务器上运行容器及服务。如果你想迁移到云,容器非常适合你。使用像 Kubernetes 和 OpenShift 这样的工具,你可以自动化启动 [集群上的容器和吊舱][10]。如果你正在考虑采取下一步行动,阅读 Kevin Casey 的 [3 个开始使用 Kubernetes 的方法][11],并尝试他提到的 Minikube 教程。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/2/start-running-containers + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-containers.png?itok=d_4QhZxT (Shipping containers stacked) +[2]: https://opensource.com/tags/kubernetes +[3]: https://www.redhat.com/sysadmin/podman-guides-2020 +[4]: https://enterprisersproject.com/cheat-sheet-what-s-difference-between-pod-cluster-and-container +[5]: tmp.1zBHYsK8TH#wp +[6]: https://opensource.com/sites/default/files/uploads/podman-wordpress.jpg (WordPress running in a container) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://opensource.com/sites/default/files/uploads/wordpress-setup.jpg (WordPress setup) +[9]: https://opensource.com/sites/default/files/uploads/wordpress-welcome.jpg (WordPress dashboard running in a container) +[10]: https://enterprisersproject.com/article/2020/9/pod-cluster-container-what-is-difference +[11]: https://enterprisersproject.com/article/2019/11/kubernetes-3-ways-get-started diff --git a/published/202203/20200330 Why I switched from Mac to Linux.md b/published/202203/20200330 Why I switched from Mac to Linux.md new file mode 100644 index 0000000000..db4384e811 --- /dev/null +++ b/published/202203/20200330 Why I switched from Mac to Linux.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14356-1.html) +[#]: subject: (Why I switched from Mac to Linux) +[#]: via: (https://opensource.com/article/20/3/mac-linux) +[#]: author: (Lee Tusman https://opensource.com/users/leeto) + +我为什么从 Mac 转到 Linux +====== + +> 25 年后,我转到了 Linux,简直不能更爽了。以下是我的经历。 + +![](https://img.linux.net.cn/data/attachment/album/202203/14/093159h433g7j2ytz4g4xz.jpg) + +1994 年,我的家人买了一台 Macintosh Performa 475 作为家用电脑。我在学校时曾使用过 Macintosh SE 电脑,并通过《[Mavis Beacon 教你打字][2]》学会了打字,所以我成为 Mac 用户已经超过 25 年了。早在上世纪 90 年代中期,我就被 Mac 的易用性所吸引。它不是以 DOS 命令提示符开始的;它打开的是一个友好的桌面。它很有趣。尽管 Macintosh 的软件比 PC 少得多,但我认为 Mac 的生态系统更好,就凭着 KidPix 和 Hypercard,我仍然认为它们是无与伦比的、最直观的 _创意工厂_。 + +即便如此,我仍然感觉到,与 Windows 相比,Mac 只是个弟弟。我曾觉得这个公司或许有一天会消失。但几十年后的今天,苹果已经成为一个庞然大物,一个价值万亿美元的公司。但随着发展,它发生了重大变化。有些变化是为了更好的发展,比如更好的稳定性,更简单的硬件选择,更高的安全性,以及更多的可访问性选项。其他的变化让我恼火 —— 不是一下子,而是慢慢地不满意。最重要的是,我对苹果的封闭生态系统感到厌烦 —— 没有 iPhoto 就很难访问照片;必须使用 iTunes;即使我不想使用苹果商店的生态系统,也得强制捆绑。 + +随着时间的推移,我发现自己主要是在终端上工作。我使用 iTerm2 和 [Homebrew][3] 软件包管理器。虽然我不能让我所有的 Linux 软件都工作,但大部分软件都工作了。我认为我拥有两个世界中最好的东西:macOS 的图形操作系统和用户界面,以及快速打开终端会话的能力。 + +后来,我开始使用通过 Raspbian 启动的树莓派电脑。我还收集了一些从大学的垃圾堆中抢救出来的非常旧的笔记本电脑,因此,出于需要,我决定尝试各种 Linux 发行版。虽然它们都没有成为我的主用机器,但我开始真正喜欢使用 Linux。我开始考虑尝试运行 Linux 发行版作为我的日常用机,但我认为 Macbook 的舒适性和便利性,特别是硬件的尺寸和重量,在非 Mac 笔记本电脑中很难找到。 + +### 是时候进行转换了? + +大约两年前,我开始在工作中使用一台戴尔电脑。那是一台较大的笔记本电脑,集成了 GPU,可以双启动 Linux 和 Windows。我用它来进行游戏开发、3D 建模、一些机器学习,以及用 C# 和 Java 进行基本编程。我曾考虑把它作为我的主用机器,但我喜欢我的 Macbook Air 的便携性,所以也继续使用它。 + +去年秋天,我开始注意到我的 Air 运行时很热,而且风扇开得越来越频繁。我的主用机器开始显得垂垂老矣。多年来,我使用 Mac 的终端来访问类 Unix 的 Darwin 操作系统,我在终端和网页浏览器之间切换的时间越来越多。是时候进行转换了吗? + +我开始探索一个类似 Macbook 的 Linux 笔记本电脑的可能性。在做了一些研究、阅读测评和留言板之后,我选择了长期以来备受赞誉的戴尔 XPS 13 开发者版 7390,选择了第十代 i7。我选择它是因为我喜欢 Macbook(尤其是超薄的 Macbook Air)的感觉,而对 XPS 13 的评论表明它似乎是类似的笔记本电脑,对其触控板和键盘的评价也真的很好。 + +最重要的是,它装载了 Ubuntu。虽然买一台电脑,擦掉它,然后安装一个新的 Linux 发行版是很容易的,但我被这种配合得当的操作系统和硬件所吸引,而且它允许我们进行大量的定制,就像我们在 Linux 中了解而喜爱的一样。因此,当有促销活动时,我毅然决然地购买了它。 + +### 每天运行 Linux 是什么感觉 + +如今,我使用 XPS 13 已经有三个月了,我的双启动的 Linux 工作笔记本也有两年了。起初,我以为我会花更多的时间寻找一个更像 Mac 的替代桌面环境或窗口管理器,比如 [Enlightenment][4]。我试过几个,但我不得不说,我喜欢开箱即用的 [GNOME][5] 的简单性。首先,它是精简的;没有太多的 GUI 元素会吸引你的注意力。事实上,它很直观,这份 [概览][6] 只需要几分钟就能看完。  + +我可以通过应用程序仪表盘或按网格排布的按钮访问我的应用程序,从而进入应用程序视图。要访问我的文件系统,我点击仪表盘上的“文件”图标。要打开 GNOME 终端,我输入 `Ctrl+Alt+T` 或者直接按下 `Alt+Tab` 来在打开的应用程序和打开的终端之间切换。定义你自己的 [自定义热键快捷方式][7] 也很容易。 + +除此以外,没有太多要说的。与 Mac 的桌面不同,没有那么多的东西会让人迷失,这意味着让我从工作或我想运行的应用程序中分心的东西更少。我没有看到我在 Mac 上浏览窗口的那么多选项,也不必在导航时花费那么多时间。在 Linux 中,只有文件、应用程序和终端。 + +我安装了 [i3 平铺式窗口管理器][8] 来做一个测试。我在配置上遇到了一些问题,因为我是用 [德沃夏克键盘][9] 键入的,而 i3 并不适应另一种键盘配置。我想,如果再努力一点,我可以在 i3 中找出一个新的键盘映射,但我主要想找的是简单的平铺功能。 + +我看了 GNOME 的平铺功能,并感到非常惊喜。你按下 `Super` 键(对我来说,就是有 Windows 标志的那个键 —— 我应该用贴纸盖住它!),然后按一个修饰键。例如,按 `Super + ←` 将你当前的窗口移动到屏幕左侧的贴片上。`Super + →` 移动到右半边。`Super + ↑` 使当前窗口最大化。`Super + ↓` 则恢复到之前的大小。你可以用 `Alt+Tab` 在应用程序窗口之间移动。这些都是默认行为,可以在键盘设置中自定义。 + +插上耳机或连接到 HDMI 的工作方式与你预期的一样。有时,我打开声音设置,在 HDMI 声音输出或我的外部音频线之间进行切换,就像我在 Mac 或 PC 上那样。触控板的反应很灵敏,我没有注意到与 Macbook 的有什么不同。当我插入一个三键鼠标时,它可以立即工作,即使是用我的蓝牙鼠标和键盘。 + +#### 软件 + +我在几分钟内安装了 Atom、VLC、Keybase、Brave 浏览器、Krita、Blender 和 Thunderbird。我在终端用 Apt 软件包管理器安装了其他软件(和平常一样),它比 macOS 的 Homebrew 软件包管理器提供了更多软件包。 + +#### 音乐 + +我有许多种听音乐的选择。我使用 Spotify 和 [PyRadio][10] 来串流播放音乐。[Rhythmbox][11] 在 Ubuntu 上是默认安装的;这个简单的音乐播放器可以立即启动,而且毫不臃肿。只需点击菜单,选择“添加音乐”,然后导航到一个音乐目录(它会递归搜索)。你也可以轻松地串流播客或在线广播。 + +#### 文本和 PDF + +我倾向于在带有一些插件的 [Neovim][12] 中用 Markdown 写作,然后用 Pandoc 将我的文档转换为任何最终需要的格式。对于一个带有预览功能的漂亮的 Markdown 编辑器,我下载了 [Ghostwriter][13],一个最集中注意力的写作应用程序。 + +如果有人给我发了一个微软 Word 文档,我可以用默认的 LibreOffice Writer 应用程序打开它。 + +偶尔,我也要签署一份文件。用 macOS 的“预览”应用程序和我的 PNG 格式的签名,这很容易,我需要一个 Linux 的对应工具。我发现默认的 PDF 查看器应用程序没有我需要的注释工具。LibreOffice 绘图程序是可以接受的,但不是特别容易使用,而且它偶尔会崩溃。做了一些研究后,我安装了 [Xournal][14],它有我需要的简单的注释工具,可以添加日期、文字和我的签名,而且与 Mac 的预览程序相当。它完全能满足我的需要。 + +#### 从我的手机中导入图片 + +我有一个 iPhone。为了把我的图片从手机上拿下来,有很多方法可以同步和访问你的文件。如果你有一个不同的手机,你的过程可能是不同的。下面是我的方法: + +1. 用 `sudo apt install gvfs-backends` 来安装 `gvfs-backends`,它是 GNOME 虚拟文件系统的一部分。 +2. 获取你的手机的序列号。将你的手机插入你的电脑,在你的 iPhone 上点击“信任”。在你电脑的终端输入: + ``` + lsusb -v 2> /dev/null | grep -e "Apple Inc" -A 2 + ``` + (感谢 Stack Oveflow 用户 [complistic][15] 提供的这个代码技巧)。 +3. 现在打开你的文件系统。 + - 按 `Ctrl+L` 打开一个位置并输入:`afc://<你的序列号>`,(请替换 `<你的序列号>`)来打开并导航到你的 DCIM 文件夹。我的照片和视频在 DCIM 文件夹的五个子文件夹内,而不是在照片文件夹内。从这里你可以手动将它们移到你的电脑上。 + - 挂载手机文件系统后,你也可以在终端中通过以下方式导航到你的文件: + ``` + cd /run/user/1001/gvfs/afc:host=<你的序列号> + ``` + +#### 图形、照片、建模和游戏引擎 + +我是一名教育工作者,教授各种新媒体课程。我的许多同事和学生都订阅了价格昂贵的专有的 Adobe Creative Suite。我喜欢让我的学生知道他们还有其他选择。 + +对于绘图和图形编辑,我使用 [Krita][16]。这绝对是我的 Photoshop 替代品。对于插图工作,还有 [Inkscape][17] 和 Scribus 的出版软件。对于自动编辑,我使用命令行 [ImageMagick][18] 程序,它已经预装在 Ubuntu 中。 + +为了管理我的图像,我使用简单的 [Shotwell][19] 应用程序。 + +对于 3D 建模,我使用并教授开源的 [Blender][20] 软件。在我的学校,我们教 [Unity 3d][21],它有 Linux 版本。它运行良好,但我一直想试试 [Godot][22],一个开源的替代品。 + +#### 开发 + +我的 XPS 13 安装了 Chrome 和 Chromium。我还添加了 Firefox 和 [Brave][23] 浏览器。所有都和你在 Mac 或 PC 上习惯的一样。大多数时候,我在 Atom 中进行开发工作,有时在 Visual Studio Code 中进行,这两种软件都很容易安装在 Linux 上。Vim 已经预装在终端,而我首选的终端文本编辑器 Neovim,也很容易安装。 + +几周后,我开始尝试其他终端。我目前最喜欢的是 Enlightenment 基金会的 Terminology。首先,它允许你在终端中 [查看图片][24],这在 Mac 的终端中是很难做到的。 + +### 留在这里 + +我看不出自己会转回 Mac 作为我的日用电脑。现在,当我使用 Mac 时,我注意到超多的选项和运行一个应用程序或浏览某个地方所需的额外步骤。我还注意到它的运行速度有点慢,或许这只是我个人的感受? + +现在我已经转到了一个开源的生态系统和 Linux,我很高兴,没有必要再转回去。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/mac-linux + +作者:[Lee Tusman][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/leeto +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_development_programming.png?itok=4OM29-82 +[2]: https://en.wikipedia.org/wiki/Mavis_Beacon_Teaches_Typing +[3]: https://brew.sh/ +[4]: https://www.enlightenment.org/ +[5]: https://opensource.com/downloads/cheat-sheet-gnome-3 +[6]: https://help.gnome.org/users/gnome-help/stable/shell-introduction.html.en +[7]: https://docs.fedoraproject.org/en-US/quick-docs/proc_setting-key-shortcut/ +[8]: https://opensource.com/article/18/9/i3-window-manager-cheat-sheet +[9]: https://en.wikipedia.org/wiki/Dvorak_keyboard_layout +[10]: https://opensource.com/article/19/11/pyradio +[11]: https://wiki.gnome.org/Apps/Rhythmbox +[12]: https://neovim.io/ +[13]: https://wereturtle.github.io/ghostwriter/ +[14]: http://xournal.sourceforge.net/ +[15]: https://stackoverflow.com/questions/19032162/is-there-a-way-since-ios-7s-release-to-get-the-udid-without-using-itunes-on-a/21522291#21522291 +[16]: https://opensource.com/article/19/4/design-posters +[17]: https://opensource.com/article/19/1/inkscape-cheat-sheet +[18]: https://opensource.com/article/17/8/imagemagick +[19]: https://gitlab.gnome.org/GNOME/shotwell/ +[20]: https://opensource.com/article/18/4/5-best-blender-video-tutorials-beginners +[21]: https://unity.com/ +[22]: https://opensource.com/article/17/12/get-started-developing-games-godot +[23]: https://brave.com/ +[24]: https://www.enlightenment.org/about-terminology.md \ No newline at end of file diff --git a/published/20201118 Secure your containers with SELinux.md b/published/202203/20201118 Secure your containers with SELinux.md similarity index 100% rename from published/20201118 Secure your containers with SELinux.md rename to published/202203/20201118 Secure your containers with SELinux.md diff --git a/published/202203/20210118 Set up a minimal server on a Raspberry Pi.md b/published/202203/20210118 Set up a minimal server on a Raspberry Pi.md new file mode 100644 index 0000000000..361900de43 --- /dev/null +++ b/published/202203/20210118 Set up a minimal server on a Raspberry Pi.md @@ -0,0 +1,255 @@ +[#]: collector: (lujun9972) +[#]: translator: (hwlife) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14405-1.html) +[#]: subject: (Set up a minimal server on a Raspberry Pi) +[#]: via: (https://opensource.com/article/21/1/minimal-server-raspberry-pi) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +在树莓派上创建一个最小化的服务器 +====== + +> 不要急着丢弃那台旧树莓派,这个详细步骤的指南展示了我怎样用最小化设置来充分利用我珍贵的树莓派系统资源。 + +![](https://img.linux.net.cn/data/attachment/album/202203/28/161221byrmba9ayvvmbbkx.jpg) + +最近,我的 [树莓派][2] 上的 microSD 储存卡不工作了。它已经作为服务器持续使用将近两年了,这为我提供了一个开始探索和修正问题的好机会。在初始化安装完成以后,它开始出现一些磁盘方面的问题,并且官方的树莓派操作系统发布了一个有重大意义的更新(并从 Raspbian 更名为树莓派操作系统Raspberr Pi OS)。所以我买了一个新的储存卡并开始重装。 + +尽管树莓派 3B 不是最新的硬件,但对于运行多样化服务的最小化的服务器还是足够的。我认为我之前的安装使用了完整的安装镜像,包括了图形用户界面和许多其他的软件包是没有必要的。 + +这个详细步骤的指南展示了我怎样用最小化设置来充分利用我珍贵的树莓派系统资源。 + +### 开始 + +首先,要为树莓派创建一个新的系统驱动器。这需要两样东西:系统镜像文件和一张 microSD 储存卡。 + +#### 下载树莓派系统镜像文件 + +虽然有好几种操作系统可供选择,但我坚持选择树莓派官方支持的系统。 + +第一步是从 [树莓派操作系统][3] 官方网站上下载最新的系统镜像文件到计算机,然后后写入储存卡。他们提供了三个不同的镜像,我选择了精简版。它是最小化的操作系统,只包含基本系统必要的文件,所以它占用最少的磁盘空间和系统内存。(当我下载系统的时候,发布日期是 2020 年 8 月 20 日,但是它现在肯定已经更新了。我觉得不会有什么巨大不同,但是我建议读一下发行说明。) + +#### 将树莓派系统镜像写到储存卡 + +第二步是写下载的系统镜像到储存卡。我的卡之前用过,当我把它插入我的 Linux 桌面计算机之后,它自动加载了两个存在的分区。在我卸载这两个分区前,我不能写入镜像。 + +要这样做,我必须得用下面的 `lsblk` 命令来确定它们的路径,经确定,该设备路径为 `/dev/mmcblk0`: + +``` +# lsblk -p +``` + +我用 `umount` 命令卸载了这两个分区: + +``` +# umount /dev/mmcblk0p2 +# umount /dev/mmcblk0p1 +``` + +一旦分区被卸载,就可以将镜像文件写入到储存卡了。尽管有许多图形化的写入工具,我还是习惯是用古老的 `dd` 命令: + +``` +# dd bs=4M if=/home/alan/Downloads/raspios/2020-08-20-raspios-buster-armhf-lite.img of=/dev/mmcblk0 status=progress conv=fsync +``` + +#### 启动树莓派 + +你只需要一个显示器、键盘、电源适配器来使用树莓派。我还有一个以太网网线用于网络连接,相比无线网络,我更喜欢通过网线来连接一个专用的服务器。 + +插入储存卡并打开树莓派的电源。一旦成功启动,用默认的缺省密码来进行登录:用户名 `pi`,密码`raspberry`。 + +### 系统设置 + +按照以下步骤尽可能最小化设置磁盘空间、内存使用等。我建议尽可能的花时间研究每个配置,使之尽量正确。通常有几种应用配置的方法,有些配置文件和选项可能会被丢弃,所以要查看产品文档确保你没有应用过时的配置。 + +#### 运行 raspi-config + +树莓派系统的主设置程序叫做 `raspi-config`。登录以后立即运行它: + +``` +# raspi-config +``` + +![Raspberry Pi config main window][4] + +它出现了一个扩展根文件系统的选项,可以利用储存卡上所有可利用的空间。选择这个选项之后,重启并重新登录。 + +用 `df` 命令来验证储存卡的总容量是否被完全使用: + +``` +# df -h +``` + +如果你需要设置其他选项,请再次运行 `raspi-config`。它们中的一些选项可以根据你的偏好和配置进行变化。仔细检查所有这些选项,确定没有任何遗漏。为了获得最佳性能,我建议做以下调整。(我跳过了一些我们没有做任何变化的选项。) + + * 系统选项System options:在此你可以设置主机名,最好使用完全限定的域名(FQDN)。你也能在这里更改你的密码,这始终是强烈建议的。 + * 接口选项Interface options:开启 SSH 服务。 + * 性能选项Performance options:将 GPU 内存减少到最低值(16MB)。 + * 本地化选项Localization options:选择你的时区、位置、键盘类型。 + * 高级选项Advanced options:这个选项包括扩展根文件系统的选项。如果你在上面没扩展,一定要在这里做。这样你可以访问储存卡上的所有可用空间。 + * 更新Update:进入更新选项会立即检查 `raspi-config` 工具是否有更新。如果更新可用,它将被下载并应用,`raspi-config` 将在几秒钟后重启。 + +一旦你在 `raspi-config` 中完成这些配置,选择“完成Finish”退出该工具。 + +#### 手动配置 + +我还建议几个其他更改,它们全都要求编辑某种配置文件来手动更改设置。 + +##### 设置静态 IP 地址 + +一般来说,最好用静态 IP 地址设置服务器。通过 `ip` 命令来验证网络接口,并设置 IP 地址和你的缺省网关(路由器)和域名服务(DNS)地址: + +``` +# ip link +1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 +2: eth0: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 + link/ether b8:27:eb:48:3f:46 brd ff:ff:ff:ff:ff:ff +``` + +你还需要知道你的缺省网关和一个及以上的 DNS 服务器地址。将这些信息添加到 `/etc/dhcpcd.conf` 配置文件中(我强烈建议更改之前对这个文件做一个备份): + +``` +# cd /etc +# cp -a dhcpcd.conf dhcpcd.conf.original +``` + +按照以下来编辑文件: + +``` +# vi dhcpcd.conf + +# static IP configuration: +interface eth0 +static ip_address=192.168.1.5/24 +static routers=192.168.1.1 +static domain_name_servers=192.168.1.3 192.168.1.4 +``` + +##### 关闭 IPv6 协议 + +除非你有特别需要使用 IPv6,否则你可能倾向于禁用它。为此,你可以创建两个新文件,其中包括一个单行指令,指示 Linux 内核不要使用 IPv6。 + +首先,创建 `/etc/sysctl.d/disable-ipv6.conf` 文件,其中包含一行指令: + +``` +# cd /etc/sysctl.d +# echo "net.ipv6.conf.all.disable_ipv6 = 1" > disable-ipv6.conf +``` + +然后创建 `/etc/modprobe.d/blacklist-ipv6.conf` 文件包含一行指令: + +``` +# cd /etc/modprobe.d +# echo "blacklist ipv6" > blacklist-ipv6.conf +``` + +##### 关闭 Wi-Fi、蓝牙和音频 + +我的服务器的具体用途并不需要蓝牙和音频,同时,它用以太网连接,并不使用无线(Wi-Fi)。除非你计划用它们,否则按照以下步骤来关闭它们。 + +对 `/boot/config.txt` 这个文件做以下更改(再次强调,我建议为这个文件做个备份): + +``` +# cd /boot +# cp -a config.txt config.txt.original +``` + +加入以下两个指令到文件底部来禁用蓝牙和 Wi-Fi: + + * `dtoverlay=disable-bt` + * `dtoverlay=disable-wifi` + +这些 `echo` 命令就可以完成: + +``` +# cd /boot +# echo "dtoverlay=disable-bt" >> config.txt +# echo "dtoverlay=disable-wifi" >> config.txt +``` + +要关闭音频,更改 `dtparam=audio` 的参数为 `off`。你可以用一个简短的命令 `sed` 来完成: + +``` +# sed -i '/dtparam=audio/c dtparam=audio=off' config.txt +``` + + +最后一步是禁用 Wi-Fi 服务,用 `systemctl mask` 命令来操作: + +``` +systemctl mask wpa_supplicant.service +``` + +如果你不需要其他服务的话,也可以禁用它们: + +* 禁用调制解调器服务:`systemctl disable hciuart` +* 禁用 Avahi 守护进程:`systemctl disable avahi-daemon.service` + +### 最后一步 + +检查你的内存使用量: + +``` +# free -h +``` +我震惊了:我的系统只用了 30MB 的内存。 + +创建个人账户:建议为登录这台服务器的个人创建用户账户。你能分配他们到 `sudo` 组允许他们运行管理命令。举个例子,创建一个用户名为 George 的一个账户。 + +``` +# adduser george +# usermod -a -G adm,sudo,users george +``` + +进行更新:这是一个重要的步骤。应用更新来获取树莓派操作系统的最新修复。 + +``` +# apt update +# apt full-upgrade +``` + +重启:重启你的新服务器是一个好主意: + +``` +# systemctl reboot +``` + +安装 Cockpit:你可以在树莓派系统上安装著名的 Linux Web 控制台 [Cockpit][5],它提供了一个基于 HTML 界面来远程管理和监控你的服务器。我最近写了一篇 [Cockpit 入门][6] 的文章。用这个命令来安装它 + +``` +# apt install cockpit +``` + +现在我的树莓派服务器已经准备好托管服务器了,我能用它来做 [网页服务器][7]、[VPN 服务器][8]、 [Minetest][9] 等游戏服务器,或者就像我做的基于 [Pi-Hole 的广告屏蔽器][10] 。 + +### 保持旧硬件的活力 + +不论你有什么硬件,仔细地精简并控制你的操作系统和软件包,可以使你的系统资源使用量保持在低水平,以便你获得最大收益。这还可以通过减少试图利用漏洞的潜在恶意行为者可用的服务和软件包数量,提高了安全性。 + +因此,在你丢弃旧硬件之前,考虑一下能够继续使用的各种可能性。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/minimal-server-raspberry-pi + +作者:[Alan Formy-Duval][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/RaspberryPi.SUNY_.jpg?itok=uS_-VUcb (Raspberry Pi board Model B) +[2]: https://opensource.com/resources/raspberry-pi +[3]: https://www.raspberrypi.org/software/operating-systems +[4]: https://opensource.com/sites/default/files/uploads/raspi-config-main.png (Raspberry Pi config main window) +[5]: https://cockpit-project.org/ +[6]: https://opensource.com/article/20/11/cockpit-server-management +[7]: https://opensource.com/article/17/3/building-personal-web-server-raspberry-pi-3 +[8]: https://opensource.com/article/19/6/raspberry-pi-vpn-server +[9]: https://github.com/minetest +[10]: https://opensource.com/article/18/2/block-ads-raspberry-pi diff --git a/published/202203/20210121 How to Uninstall Applications from Ubuntu Linux.md b/published/202203/20210121 How to Uninstall Applications from Ubuntu Linux.md new file mode 100644 index 0000000000..aad583db3a --- /dev/null +++ b/published/202203/20210121 How to Uninstall Applications from Ubuntu Linux.md @@ -0,0 +1,166 @@ +[#]: collector: (lujun9972) +[#]: translator: (amagicboy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14398-1.html) +[#]: subject: (How to Uninstall Applications from Ubuntu Linux) +[#]: via: (https://itsfoss.com/uninstall-programs-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +初级:Ubuntu 中怎么卸载 Linux 应用 +======= + +![](https://img.linux.net.cn/data/attachment/album/202203/26/151617chxhdszd0lcpcpkz.jpg) + +不再使用某个应用程序了?删除它吧。 + +卸载不再使用的应用是 [最简单释放磁盘空间的方法][1] ,而且可以使系统保持整洁。 + +在此篇入门教程中,我会介绍几种不同在 Ubuntu 上卸载应用程序的方法。 + +在 Ubuntu 中有几种方法 [安装应用][2] ,同意也有以下几种方法卸载应用: + +- 从 Ubuntu 软件中心Software Center 卸载应用(桌面用户) +- 用 `apt remove` 命令卸载应用 +- 用命令行中删除 Snap 应用(中级到高级用户) + +让我们来一个一个了解这些方法。 + +### 方法 1:用 Ubuntu 软件中心卸载应用 + +在左侧栏或者菜单中找到 Ubuntu 软件中心Software Center,打开它。 + +![][3] + +在 已安装Installed 栏中列出了已安装的应用。 + +![][4] + +如果你要找的应用不在 已安装Installed 栏中,可以使用搜索查找应用。 + +![][5] + +打开已经安装的应用,有一个 移除Remove 选项,点击它。 + +![][6] + +这会请求输入账户密码,输入后应用会在几秒内删除。 + +### 方法2: Ubuntu 命令行卸载应用 + +安装应用时使用 `apt-get install` 或者 `apt install` 。 +卸载应用时使用 `apt-get remove` 或者 `apt remove` ,而不是 `apt-get uninstall` 。 + +按照以下方式使用命令: + +``` +sudo apt remove program_name +``` + +执行此操作会请求你的账户密码。当输入密码时,屏幕上不会有提示。输入完后按下回车。 + +待删除的应用不会立刻被删除。你需要确认。当询问你的确认时,请输入回车或者按下 `Y`: + +![][7] + +请在命令行中输入准确的包的名字,不然会出现 “[不能找到软件包的错误][8]” 错误 。 + +不要担心记不住具体的应用名字,你可以使用超级有用的 Tab 补全应用名称。 Tab 是你必须知道的 [Linux 命令行技巧][9] 之一。 + +你只需要输入想要卸载应用的前几个字母,然后按下 `tab` ,会提示以这几个字母开头的已安装应用程序。 + +找到要卸载的应用名称,输入完整的应用名称然后卸载。 + +![][10] + +如果不知道具体的应用名称或者开头字母,你可以 [列出 Ubuntu 中所有已安装的包][11] ,然后查找符合你记忆的应用名称。 + +比如,下图的命令会列出所有已安装的应用名称中包含 ‘my’ 的应用,不仅仅是以 ‘my’ 开头的应用。 + +``` +apt list --installed | grep -i my +``` + +![][12] + +这非常酷炫对不对?在 Ubuntu 中使用卸载命令时请注意应用名。 + +#### 补充:使用 apt purge 卸载应用(进阶用户) + +当在 Ubuntu 中卸载应用时,应用程序会被卸载,但是会留下细小的、修改过的用户配置文件。这些文件是故意被留下的,因为当你再次安装同样的应用时,会使用这些遗留的配置文件。 + +如果你想完全卸载应用,你可以使用 `apt purge` 命令代替 `apt remove` 命令,或者在 `apt remove` 命令后再使用它。 + +``` +sudo apt purge program_name +``` + +注意 `apt purge` 令不会删除保存在用户目录下的数据或者配置文件。 + +### 方法3: Ubuntu 中卸载 Snap 应用 + +前面的几种方式可用于使用 `apt` 命令、软件中心Software Center或者直接使用 deb 文件安装的应用。 + +Ubuntu 也推出了一个名为 [Snap][13] 的包管理系统。在软件中心Software Center中的大部分应用都是 Snap 包格式。 + +你可以使用 软件中心Software Center 轻松地卸载这些应用,也可以使用命令行卸载。 + +列出所有已经安装的 Snap 包名字: + +``` +snap list +``` + +![][14] + +选择你想要卸载的应用,然后卸载,这不会要求你确认是否删除。 + +``` +sudo snap remove package_name +``` + +### 妙招:用一个神奇的命令清理系统 + +到此你已经学会怎么卸载应用,现在使用一个简单的命令清理卸载残留,比如不再用到的依赖或 Linux 内核头文件。 + +在终端输入如下命令: + +``` +sudo apt autoremove +``` + +这条命令很安全,而且会释放几百 MB 的磁盘空间。 + +### 总结 + +本文一共介绍了三种卸载应用的方法,包括通过图形界面卸载、命令行卸载,以便你了解所有方式。 + +希望此篇教程对 Ubuntu 初学者有所帮助,欢迎提出问题和建议。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/uninstall-programs-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[amagicowboy](https://github.com/amagicboy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/free-up-space-ubuntu-linux/ +[2]: https://itsfoss.com/remove-install-software-ubuntu/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/ubuntu_software_applications_menu.jpg?resize=800%2C390&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/installed-apps-ubuntu.png?resize=800%2C455&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/search-installed-apps-ubuntu.png?resize=800%2C455&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/remove-applications-ubuntu.png?resize=800%2C487&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/apt-remove-program-ubuntu.png?resize=768%2C424&ssl=1 +[8]: https://itsfoss.com/unable-to-locate-package-error-ubuntu/ +[9]: https://itsfoss.com/linux-command-tricks/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/remove-package-ubuntu-linux.png?resize=768%2C424&ssl=1 +[11]: https://itsfoss.com/list-installed-packages-ubuntu/ +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/search-list-installed-apps-ubuntu.png?resize=768%2C424&ssl=1 +[13]: https://itsfoss.com/install-snap-linux/ +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/list-snap-remove.png?resize=800%2C407&ssl=1 diff --git a/published/20210215 Why everyone should try using Linux.md b/published/202203/20210215 Why everyone should try using Linux.md similarity index 100% rename from published/20210215 Why everyone should try using Linux.md rename to published/202203/20210215 Why everyone should try using Linux.md diff --git a/published/202203/20210401 Use awk to calculate letter frequency.md b/published/202203/20210401 Use awk to calculate letter frequency.md new file mode 100644 index 0000000000..2cb3958acd --- /dev/null +++ b/published/202203/20210401 Use awk to calculate letter frequency.md @@ -0,0 +1,277 @@ +[#]: subject: (Use awk to calculate letter frequency) +[#]: via: (https://opensource.com/article/21/4/gawk-letter-game) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: (lkxed) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14375-1.html) + +使用 awk 统计字母频率 +====== + +> 编写一个 awk 脚本来找到一组单词中出现次数最多(和最少)的单词。 + +![](https://img.linux.net.cn/data/attachment/album/202203/20/085052bajyoejnea8cpw5j.jpg) + +近一段时间,我开始编写一个小游戏,在这个小游戏里,玩家使用一个个字母块来组成单词。编写这个游戏之前,我需要先知道常见英文单词中每个字母的使用频率,这样一来,我就可以找到一组更有用的字母块。字母频次统计在很多地方都有相关讨论,包括在 [维基百科][2] 上,但我还是想要自己来实现。 + +Linux 系统在 `/usr/share/dict/words` 文件中提供了一个单词列表,所以我已经有了一个现成的单词列表。然而,尽管这个 `words` 文件包含了很多我想要的单词,却也包含了一些我不想要的。我想要的单词首先不能是复合词(即不包含连接符和空格的单词),也不能是专有名词(即不包含大写字母单词)。为了得到这个结果,我可以运行 `grep` 命令来取出只由小写字母组成的行: + +``` +$ grep  '^[a-z]*$' /usr/share/dict/words +``` + +这个正则表达式的作用是让 `grep` 去匹配仅包含小写字母的行。表达式中的字符 `^` 和 `$` 分别代表了这一行的开始和结束。`[a-z]` 分组仅匹配从 “a” 到 “z” 的小写字母。 + +下面是一个输出示例: + +``` +$ grep  '^[a-z]*$' /usr/share/dict/words | head +a +aa +aaa +aah +aahed +aahing +aahs +aal +aalii +aaliis +``` + +没错,这些都是合法的单词。比如,“aahed” 是 “aah” 的过去式,表示在放松时的感叹,而 “aalii” 是一种浓密的热带灌木。 + +现在我只需要编写一个 `gawk` 脚本来统计出单词中各个字母出现的次数,然后打印出每个字母的相对频率。 + +### 字母计数 + +一种使用 `gawk` 来统计字母个数的方式是,遍历每行输入中的每一个字符,然后对 “a” 到 “z” 之间的每个字母进行计数。`substr` 函数会返回一个给定长度的子串,它可以只包含一个字符,也可以是更长的字符串。比如,下面的示例代码能够取到输入中的每一个字符 `c`: + +``` +{ + len = length($0); for (i = 1; i <= len; i++) { + c = substr($0, i, 1); + } +} +``` + +如果使用一个全局字符串变量 `LETTERS` 来存储字母表,我就可以借助 `index` 函数来找到某个字符在字母表中的位置。我将扩展 `gawk` 代码示例,让它在输入数据中只取范围在 “a” 到 “z” 的字母: + +``` +BEGIN { LETTERS = "abcdefghijklmnopqrstuvwxyz" } + +{ + len = length($0); for (i = 1; i <= len; i++) { + c = substr($0, i, 1); + ltr = index(LETTERS, c); + } +} +``` + +需要注意的是,`index` 函数将返回字母在 `LETTERS` 字符串中首次出现的位置,第一个位置返回 1,如果没有找到则返回 0。如果我有一个大小为 26 的数组,我就可以利用这个数组来统计每个字母出现的次数。我将在下面的示例代码中添加这个功能,每当一个字母出现在输入中,我就让它对应的数组元素值增加 1(使用 `++`): + +``` +BEGIN { LETTERS = "abcdefghijklmnopqrstuvwxyz" } +  +{ +    len = length($0); for (i = 1; i <= len; i++) { +        c = substr($0, i, 1); +        ltr = index(LETTERS, c); +  +        if (ltr > 0) { +            ++count[ltr]; +        } +    } +} +``` + +### 打印相对频率 + +当 `gawk` 脚本统计完所有的字母后,我希望它能输出每个字母的频率。毕竟,我对输入中各个字母的个数没有兴趣,我更关心它们的 _相对频率_。 + +我将先统计字母 “a” 的个数,然后把它和剩余 “b” 到 “z” 字母的个数比较: + + +``` +END { +    min = count[1]; for (ltr = 2; ltr <= 26; ltr++) { +        if (count[ltr] < min) { +            min = count[ltr]; +        } +    } +} +``` + +在循环的最后,变量 `min` 会等于最少的出现次数,我可以把它为基准,为字母的个数设定一个参照值,然后计算打印出每个字母的相对频率。比如,如果出现次数最少的字母是 “q”,那么 `min` 就会等于 “q” 的出现次数。 + +接下来,我会遍历每个字母,打印出它和它的相对频率。我通过把每个字母的个数都除以 `min` 的方式来计算出它的相对频率,这意味着出现次数最少的字母的相对频率是 1。如果另一个字母出现的次数恰好是最少次数的两倍,那么这个字母的相对频率就是 2。我只关心整数,所以 2.1 和 2.9 对我来说是一样的(都是 2)。 + +``` +END { +    min = count[1]; for (ltr = 2; ltr <= 26; ltr++) { +        if (count[ltr] < min) { +            min = count[ltr]; +        } +    } +  +    for (ltr = 1; ltr <= 26; ltr++) { +        print substr(LETTERS, ltr, 1), int(count[ltr] / min); +    } +} +``` + +### 最后的完整程序 + +现在,我已经有了一个能够统计输入中各个字母的相对频率的 `gawk` 脚本: + +``` +#!/usr/bin/gawk -f +  +# 只统计 a-z 的字符,忽略 A-Z 和其他的字符 +  +BEGIN { LETTERS = "abcdefghijklmnopqrstuvwxyz" } +  +{ +    len = length($0); for (i = 1; i <= len; i++) { +        c = substr($0, i, 1); +        ltr = index(LETTERS, c); +  +        if (ltr < 0) { +            ++count[ltr]; +        } +    } +} +  +# 打印每个字符的相对频率 +    +END { +    min = count[1]; for (ltr = 2; ltr <= 26; ltr++) { +        if (count[ltr] < min) { +            min = count[ltr]; +        } +    } +  +    for (ltr = 1; ltr <= 26; ltr++) { +        print substr(LETTERS, ltr, 1), int(count[ltr] / min); +    } +} +``` + +我将把这段程序保存到名为 `letter-freq.awk` 的文件中,这样一来,我就可以在命令行中更方便地使用它。 + +如果你愿意的话,你也可以使用 `chmod +x` 命令把这个文件设为可独立执行。第一行中的 `#!/usr/bin/gawk -f` 表示 Linux 会使用 `/usr/bin/gawk` 把这个文件当作一个脚本来运行。由于 `gawk` 命令行使用 `-f` 来指定它要运行的脚本文件名,你需要在末尾加上 `-f`。如此一来,当你在 shell 中执行 `letter-freq.awk`,它会被解释为 `/usr/bin/gawk -f letter-freq.awk`。 + +接下来我将用几个简单的输入来测试这个脚本。比如,如果我给我的 `gawk` 脚本输入整个字母表,每个字母的相对频率都应该是 1: + +``` +$ echo abcdefghijklmnopqrstuvwxyz | gawk -f letter-freq.awk +a 1 +b 1 +c 1 +d 1 +e 1 +f 1 +g 1 +h 1 +i 1 +j 1 +k 1 +l 1 +m 1 +n 1 +o 1 +p 1 +q 1 +r 1 +s 1 +t 1 +u 1 +v 1 +w 1 +x 1 +y 1 +z 1 +``` + +还是使用上述例子,只不过这次我在输入中添加了一个字母 “e”,此时的输出结果中,“e” 的相对频率会是 2,而其他字母的相对频率仍然会是 1: + +``` +$ echo abcdeefghijklmnopqrstuvwxyz | gawk -f letter-freq.awk +a 1 +b 1 +c 1 +d 1 +e 2 +f 1 +g 1 +h 1 +i 1 +j 1 +k 1 +l 1 +m 1 +n 1 +o 1 +p 1 +q 1 +r 1 +s 1 +t 1 +u 1 +v 1 +w 1 +x 1 +y 1 +z 1 +``` + +现在我可以跨出最大的一步了!我将使用 `grep` 命令和 `/usr/share/dict/words` 文件,统计所有仅由小写字母组成的单词中,各个字母的相对使用频率: + +``` +$ grep  '^[a-z]*$' /usr/share/dict/words | gawk -f letter-freq.awk +a 53 +b 12 +c 28 +d 21 +e 72 +f 7 +g 15 +h 17 +i 58 +j 1 +k 5 +l 36 +m 19 +n 47 +o 47 +p 21 +q 1 +r 46 +s 48 +t 44 +u 25 +v 6 +w 4 +x 1 +y 13 +z 2 +``` + +在 `/usr/share/dict/words` 文件的所有小写单词中,字母 “j”、“q” 和 “x” 出现的相对频率最低,字母 “z” 也使用得很少。不出意料,字母 “e” 是使用频率最高的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/gawk-letter-game + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-docdish-typewriterkeys-3.png?itok=NyBwMdK_ (Typewriter keys in multicolor) +[2]: https://en.wikipedia.org/wiki/Letter_frequency diff --git a/published/202203/20210408 5 commands to level-up your Git game.md b/published/202203/20210408 5 commands to level-up your Git game.md new file mode 100644 index 0000000000..5504ee1386 --- /dev/null +++ b/published/202203/20210408 5 commands to level-up your Git game.md @@ -0,0 +1,69 @@ +[#]: subject: (5 commands to level-up your Git game) +[#]: via: (https://opensource.com/article/21/4/git-commands) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (lkxed) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14364-1.html) + +五个提升你的 Git 水平的命令 +====== + +> 将这些命令加入到你的工作流中,使 Git 发挥更大的作用。 + +![](https://img.linux.net.cn/data/attachment/album/202203/17/110616vti9hhsiiq4misra.jpg) + +如果你经常使用 Git,你可能会知道它非常有名。它可能是最受欢迎的版本控制方案,它被一些 [最大的软件项目][2] 用来 [跟踪文件变更][3]。Git 提供了 [健壮的界面][4] 来审阅代码、把实验性的变更合并到已经存在的文件中。得益于 [Git 钩子][5],它以灵活性而闻名。同时,也因为它的强大,它给人们留下了一个“复杂”的印象。 + +Git 有诸多特性,你不必全部使用,但是如果你正在深入研究 Git 的 子命令subcommands,我这里倒是有几个,或许你会觉得有用。 + +### 1、找到变更 + +如果你已经熟悉 Git 的基本指令(`fetch`、`add`、`commit`、`push`、`log` 等等),但是希望学习更多,那么从 Git 的检索子命令开始是一个简单安全的选择。检索你的 Git 仓库(你的 _工作树_)并不会做出任何更改,它只是一个报告机制。你不会像使用 `git checkout` 一样承担数据完整性的风险,你只是在向 Git 请求仓库的当前状态和历史记录而已。 + +[git whatchanged][6] 命令(几乎本身就是一个助记符)可以查看哪些文件在某个提交commit中有变更、分别做了什么变更。它是一个简单的、用户友好的命令,因为它把 `show`、`diff-tree` 和 `log` 这三个命令的最佳功能整合到了一个好记的命令中。 + +### 2、使用 git stash 管理变更 + +你越多地使用 Git,你就会使用 Git 越多。这就是说,一旦你习惯了 Git 的强大功能,你就会更频繁地使用它。有时,你正在处理一大堆文件,忽然意识到了有更紧急的任务要做。这时,在 [git stash][7] 的帮助下,你就可以把所有正在进行的工作收集起来,然后安全地暂存stash它们。当你的工作空间变得整洁有序,你就可以把注意力放到别的任务上,晚些时候再把暂存的文件重新加载到工作树里,继续之前的工作。 + +### 3、使用 git worktree 来得到链接的副本 + +当 `git stash` 不够用的时候,Git 还提供了强大的 [git worktree][8] 命令。有了它,你可以新建一个 _链接的_ 仓库副本clone,组成一个新分支,把 `HEAD` 设置到任意一个提交上,然后基于这个分支开始你的新工作。在这个链接的副本里,你可以进行和主副本完全不同的任务。这是一个避免意外的变更影响当前工作的好办法。当你完成了你的新工作,你可以把新分支推送到远程仓库;也可以把当前的变更归档,晚些时候再处理;还可以从别的工作树中获取它们的变更。无论选择哪一种,你的工作空间之间都会保持相互隔离,任一空间中的变更都不会影响其他空间中的变更,直到你准备好了要合并它们。 + +### 4、使用 git cherry-pick 来选择合并 + +这可能听起来很反直觉,但是,你的 Git 水平越高,你可能遇到的合并冲突就会越多。这是因为合并冲突不一定是错误的标志,而是活跃的标志。在学习 Git 中,适应合并时的冲突,并学会如何解决它们是非常重要的。通常的方式或许够用,但是有时候你会需要更加灵活地进行合并,这时候就该 [git cherry-pick][9] 出场了。遴选操作允许你选择部分合并提交,这样一来你就不需要因为一些细微的不协调而拒绝整个合并请求了。 + +### 5、使用 Git 来管理 $HOME + +使用 Git 来管理你的主目录从来没有这么简单过,这都要归功于 Git 可以自由选择管理对象的能力,这是一个在多台计算机之间保持同步的现实可行的选项。但是,想要让它工作顺利,你必须非常明智且谨慎才行。如果你想要了解更多,点击阅读我写的关于 [使用 Git 来管理 $HOME][10] 的小技巧。 + +### 更好地使用 Git + +Git 是一个强大的版本控制系统,你使用得越熟练,就可以越轻松地借助它来完成复杂的任务。今天就尝试一些新的 Git 命令吧,欢迎在评论区分享你最喜欢的 Git 命令。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/git-commands + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) +[2]: https://opensource.com/article/19/10/how-gnome-uses-git +[3]: https://opensource.com/article/18/2/how-clone-modify-add-delete-git-files +[4]: https://opensource.com/article/18/5/git-branching +[5]: https://opensource.com/life/16/8/how-construct-your-own-git-server-part-6 +[6]: https://opensource.com/article/21/3/git-whatchanged +[7]: https://opensource.com/article/21/3/git-stash +[8]: https://opensource.com/article/21/3/git-worktree +[9]: https://opensource.com/article/21/3/reasons-use-cherry-picking +[10]: https://opensource.com/article/21/3/git-your-home diff --git a/published/202203/20210606 5 handy guides to open source for teachers.md b/published/202203/20210606 5 handy guides to open source for teachers.md new file mode 100644 index 0000000000..b47c8d061d --- /dev/null +++ b/published/202203/20210606 5 handy guides to open source for teachers.md @@ -0,0 +1,74 @@ +[#]: subject: (5 handy guides to open source for teachers) +[#]: via: (https://opensource.com/article/21/6/open-source-guides-teachers) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (lkxed) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14386-1.html) + +5 个为教师准备的方便的开源指南 +====== + +![](https://img.linux.net.cn/data/attachment/album/202203/23/162904laqecdh4xraveac7.jpg) + +> 我们收集了一些最受欢迎的简明指南,它们既能满足你充分利用暑假的愿望,又能满足你为下一个学期做规划的需要。 + +对一些老师来说,夏天到了,一个漫长的(希望也是放松的)假期也到了。所有我认识的老师都是自豪的终身学习者,尽管暑假过后,又有一个新学期会到来。为了帮助你充分利用暑假时间,与此同时也为即将到来的下一个学期做好准备,我们收集了一些最受欢迎的 _简明_ 指南。 + +### 如何让你的学校做好准备(在新冠疫情下) + +通过 [在 Linux 上来完成所有相关工作][2],Robert Maynord 老师确保了他的学校为远程学习做好了准备,甚至在疫情前他就这么做了。虽然我们还不知道在今年剩下的时间里会发生什么,但是,如果说新冠疫情向世界展示了什么,那就是 [数字转型][3](指把数字技术融入到教育的各个领域)不仅是可能的,而且对教师和学生来说都是有益的。你可能无权在技术层面上改变课堂的运作方式,但你仍然可以做很多小的改变,为学生创造更灵活的学习体验。 + +### 为教师准备的终极开源指南 + +通过本文,你可以学习如何在课堂上 [融入开源原则][4]。开源不仅仅和科技相关,它同时也关于知识共享、团队协作以及为了一个共同目标而努力。你可以把你的教室变成一个共享的空间,让学生们互相学习,就像他们向你学习一样。阅读开源,把开源付诸实践,并鼓励学生们积极参与。 + +### 8 个为虚拟教室准备的 WordPress 插件 + +WordPress Web 平台是一个构建网站的强大工具。在教室里,它可以作为教授 Web 技术、创意写作和学术写作的 [一个很好的工具][5]。它也可以被用来帮助远程学习,或者是把日常的学校作业数字化。通过掌握 WordPress 的诸多 [附加功能],你可以从中获取到最大的教育收益。 + +### 教孩子们写 Python(交互式游戏) + +开源工具可以帮助任何人以一种轻松有趣的方式开始学习 Python —— 那就是制作游戏。当然,Python 涉及到很多方面的东西。别担心,我们有一个课程可以带你从安装 Python 开始,通过简单的文本代码和 “海龟turtle” 绘图游戏开始你的第一步,一直到中级游戏开发。 + + 1. 首先,安装 Python,阅读我们的 [Python 入门文章][7],熟悉编程的概念。单单是这篇文章里的内容就可以作为两节或三节不同课程的基础哦。 + 2. 然后,如果你熟悉 [Jupyter][8] 库的话,可以学习 [使用 Python 和 Jupyter 来编写一个简单游戏][9]。 + 3. 接着,你也可以 [在这本 Python 电子书里学到游戏开发的知识][10],里面会教你如何使用 Git、Python 和 PyGame 库。当你学会了这些基础内容,你可以看看 [这本书里的 "游戏测试员" 的有趣创作集合][11]。 + +如果 Python 对你或你的学生来说太难了,那么看看 [Thine][12] 吧,它是一个简单的基于 HTML 的交互式的讲故事工具。 + +### 教孩子们玩树莓派(编程) + +我们的指南中有一篇 [树莓派入门指南][13],其中探索了各种帮助孩子们学习编程的资源。树莓派的特点是它足够便宜,只要花 35 美元,你就可以买到一个全功能的 Linux 电脑。然后你就在上面做任何事,不管是基本的 Python 学习还是搭建实际的网络服务器,因此,它有着巨大的教育潜力。你完全可以为每一个学生都配一个树莓派,或者你也可以让班里的学生共享一个树莓派(Linux 是多用户操作系统,只要设置得当,所有的学生都可以同时使用这个树莓派,直到你说服他们的家长购买更多树莓派)。 + +### 一起学习 + +开放课堂的关键之一是要勇敢地和学生一起学习。作为一个老师,你可能习惯了掌握所有的答案,但是数字世界是不断改变和进化的。不要害怕 _和_ 你的学生们一起学习 Python、Linux、树莓派或者任何其他东西,一起学习新的基础知识、小技巧和解决问题的新方式。开源是一种经过验证的成功方法,所以不要只是教授开源而已,还要让开源在你的课堂上得以运用。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/open-source-guides-teachers + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png?itok=L0BQHgjr (Looking at a map) +[2]: https://opensource.com/article/21/5/linux-school-servers +[3]: https://enterprisersproject.com/what-is-digital-transformation +[4]: https://opensource.com/article/20/7/open-source-teachers +[5]: https://opensource.com/article/20/3/wordpress-education +[6]: https://opensource.com/article/20/5/wordpress-plugins-education +[7]: https://opensource.com/article/17/10/python-101 +[8]: https://opensource.com/article/18/3/getting-started-jupyter-notebooks +[9]: https://opensource.com/article/20/5/python-games +[10]: https://opensource.com/article/20/10/learn-python-ebook +[11]: https://github.com/MakerBox-NZ?q=pygame&type=&language=&sort= +[12]: https://opensource.com/article/18/2/twine-gaming +[13]: https://opensource.com/article/19/3/teach-kids-program-raspberry-pi diff --git a/published/202203/20210622 How to Make LibreOffice Look Like Microsoft Office.md b/published/202203/20210622 How to Make LibreOffice Look Like Microsoft Office.md new file mode 100644 index 0000000000..e5c580f41e --- /dev/null +++ b/published/202203/20210622 How to Make LibreOffice Look Like Microsoft Office.md @@ -0,0 +1,113 @@ +[#]: subject: (How to Make LibreOffice Look Like Microsoft Office) +[#]: via: (https://www.debugpoint.com/2021/06/libreoffice-like-microsoft-office/) +[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14412-1.html) + +如何使 LibreOffice 看起来像微软 Office +====== + +![](https://img.linux.net.cn/data/attachment/album/202203/29/224638h4k4bg561ix4qnb6.jpg) + +> 我们做了一次尝试,使 LibreOffice 套件看起来像微软 Office。能做到吗?让我们来看看。 + +[LibreOffice][1] 是一个自由开源的办公生产力套件,它向你提供了一套完整的应用程序集合。它包含文字处理器(Writer)、电子表格程序(Calc)、演示程序(Impress)和 绘图程序(Draw)。它还为你提供了一个独立的数据库系统(LibreOffice Base),以及 LibreOffice Math 是一个帮助学生、研究人员编写公式和方程的程序。 + +然而,广泛使用的 [微软 Office][2] 是一个付费的办公生产力套件,提供了优秀的程序来完成几乎所有的关于学习、办公和企业应用的任务。 + +这两组程序套件是不同的,但是它们在功能方面的目标是相同的。由于它的流行,微软 Office 被广泛的使用,并被使用者熟知。不过,这里有很多使用者更喜欢免费的 LibreOffice 来支撑他们的工作和活动。与微软 Office 相比,采用 LibreOffice 有时会很困难 —— 尽管大多数的菜单项和工具都是一样的。 + +尽管如此,如果你可以使 LibreOffice 看起来像微软 Office ,那么,对于初次使用 LibreOffice 的用户来说会更容易接纳,他们大多数是有使用微软 Office 的经历背景的用户。外观和感受在用户的头脑中起着重要的作用,也包含他们的肌肉记忆和对颜色、菜单项的熟悉度。 + +当然,你不可能使它完全像微软 Office,因为它们使用了不同的图标、字体等等。不过,你可以将其微调到一定程度。 + +### 使 LibreOffice 看起来像微软 Office + +这篇指南是以 LibreOffice 7.2(开发版)版本为基础所编写的。 + +#### 1、用户界面的变化 + +LibreOffice 有一个名为“标签栏” 的 “功能区Ribbon” 式工具栏。尽管它带有多种工具栏变体(如下)。但是,对于这篇指南,我使用 标签式Tabbed 工具栏选项。 + + * 打开 LibreOffice 并转到 “菜单Menu > 视图View > 用户界面User Interface”。 + * 从 UI 部分中选择 “标签式Tabbed” 。 + + ![tabbed bar option][3] + + * 点击 “应用于全部Apply to All” 。LibreOffice 也提供一个选项,可以将特定的工具栏样式应用到 Writer 或 Calc。如果你想要一种不同的工具栏样式,你可以选择这种方法。但是,我推荐使用应用于全部来使其保持一致。 + * 现在,你已经有了微软 Office 样式的功能区。尽管它们并不是完全相同,但是你也能体会到它的感受。 + +#### 2、适用于 LibreOffice 的微软 Office 图标 + +工具栏中的图标在你的工作流中起着重要的作用。LibreOffice 为你的工具栏提供一些漂亮的图标。其中最好的一些是: + + * Karasa Jaga + * Colibre + * Elementary + +针对这篇指南,我们将使用 [Office 2013 图标集][4],它是由一名作家开发的,可以在 Devian Art 中获得。 + + * 转到下面的链接并下载 LibreOffice 扩展文件(*.oxt),对于 LibreOffice 的较新版本,你需要使用扩展文件来安装图标集。 + - [下载适用于 libreoffice 的 Office 2013 图标集][5] + * 在下载后,双击 .oxt 文件来将其打开。或者,按下 `CTRL+ALT+E` 组合按键来打开扩展管理器,并使用 “添加Add” 按钮来选择已下载的 .oxt 文件。在完成后关闭窗口。 + + ![Import icon sets in Extension Manager][6] + + * 现在,转到 “工具Tools > 选项Options > 视图View”。从“图标样式Icon Style”中选择 “Office 2013” 。 + * 通过 “图标大小Icon Size > 笔记本栏Notebookbar > Large” 来更改图标大小。如果你感觉图标有点小,你可以更改它们。不过,我觉得要使它更像 Office ,将图标设置的较大一点的效果会更好。 + + ![Change icons in Options][7] + +就这样,你的 LibreOffice 应该看起来像这样: + +![在 KDE Plasma 中让 LibreOffice 看起来像微软 Office][9] + +![在 Windows 10 中让 LibreOffice 看起来像微软 Office][10] + +![在 GNOME 中让 LibreOffice 看起来像微软 Office][11] + +注意,如果你正在使用 Ubuntu、KDE Plasma,或者任何 Linux 发行版,它们的外观可能会有所不同。但是,在我看来,在 KDE Plasma 中比在 GNOME 中看起来更像微软 Office 。LibreOffice 目前在基于 GTK 的系统中看起来并不太好。 + +不过,在 Windows 中,它看起来会更像,因为它使用同一个系统的字体和颜色面板。 + +这些是你可以使用的一些设置,不过,你可以随心所欲地自由调整更多的定制、图标和主题。如果你喜欢 LibreOffice 的深色模式,你可能想要阅读我们的教程 – [如何在 LibreOffice 中启用深色模式][12]。 + +### 结束语 + +微软 Office 毫无疑问是办公生产力领域的市场领导者。这是有原因的,它来自数十年的开发。它不是免费的产品,事实上,最新的 Office 365 家庭版本的价格大约是 7 美元/月,可以在 3 到 4 台设备上使用。在我看来,它有点小贵。 + +然而 LibreOffice 是免费的,由文档基金会领导的社区开发。因此,开发速度较慢、功能出现也较晚。它并不是要成为微软 Office ,而是要给数以百万计的用户、学校、非营利组织、高校、学生一个使用免费办公套件工作和学习的机会。 + +因此,如果它能够模仿基本的外观和感受,使其像微软 Office 一样,从而调高 LibreOffice 的使用率,那将是有益的。我希望这篇指南能在这个方向上能起到一点作用。 + +- [链接: LibreOffice 和 Microsoft Office 的官方功能比较][13] + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/06/libreoffice-like-microsoft-office/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: http://libreoffice.com +[2]: http://office.com +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/tabbed-bar-option.jpg +[4]: https://www.deviantart.com/charliecnr/art/Office-2013-theme-for-LibreOffice-512127527 +[5]: https://www.deviantart.com/users/outgoing?https://1drv.ms/u/s!ArgKmgFcmBYHhSQkPfyMZRnXX5LJ +[6]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Import-icon-sets-in-Extension-Manager.jpg +[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Change-icons-in-Options-1024x574.jpg +[8]: https://www.debugpoint.com/2021/05/libreoffice-7-2/ +[9]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Making-LibreOffice-look-like-Microsoft-Office-in-KDE-Plasma-1024x441.jpg +[10]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Making-LibreOffice-look-like-Microsoft-Office-in-Windows-10-1024x554.jpg +[11]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Making-LibreOffice-look-like-Microsoft-Office-in-GNOME-1024x498.jpg +[12]: https://www.debugpoint.com/2020/01/how-to-enable-dark-mode-libreoffice/ +[13]: https://wiki.documentfoundation.org/Feature_Comparison:_LibreOffice_-_Microsoft_Office diff --git a/published/202203/20210626 How I helped my mom switch from Windows to Linux.md b/published/202203/20210626 How I helped my mom switch from Windows to Linux.md new file mode 100644 index 0000000000..1940014eac --- /dev/null +++ b/published/202203/20210626 How I helped my mom switch from Windows to Linux.md @@ -0,0 +1,152 @@ +[#]: subject: (How I helped my mom switch from Windows to Linux) +[#]: via: (https://opensource.com/article/21/6/mom-switch-linux) +[#]: author: (Tomasz https://opensource.com/users/tomaszwaraksa) +[#]: collector: (lujun9972) +[#]: translator: (lkxed) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14407-1.html) + +我是如何帮助妈妈从 Windows 切换至 Linux 的 +====== + +> 有了 Linux,即便是新手用户,也能通过大量熟悉的应用程序获得流畅、精致的桌面体验。 + +![](https://img.linux.net.cn/data/attachment/album/202203/29/103155z5khz7z05fl7mz7l.jpg) + +大型强子对撞机是 [由 Linux 驱动][2] 的,国际空间站上的笔记本电脑是 [运行在 Linux 上][3] 的,[Instagram][4] 和 [Nest thermostats][5] 也是如此。最近,我们观看了 机智号Ingenuity 在火星上空飞翔,它是一个令人惊叹的无人直升机,也是 [由 Linux 驱动的][6]!这进一步证明了这个操作系统的灵活性和通用性。 + +但是现在,真正的大新闻来了。我在这里“官宣”:Linux 也可以给父母使用! + +### 事情经过 + +大约一年前,我决定把妈妈的电脑环境迁移至 Linux。现在,一年过去了,是时候回顾和总结一下了。 + +和大多数人一样,我是专属的 “妈妈的电脑管理员”。我的妈妈是一个 60 多岁的可爱老太太 —— 一个真正的甜心。她的电脑技能很基础,她的电脑使用需求也很基础:上上网,发发邮件,打打字,浏览、编辑照片,看看视频听听歌,还有就是在 Skype 或者 Signal 上和家里人或者朋友们打打电话。 + +直到去年之前,妈妈一直在使用一个 Windows 笔记本电脑。电脑已经很旧了,但还不算太糟糕。于是在某一天,通过欺骗、威胁和弹出讨厌的窗口等手段,微软终于成功让她点击了那个可怕的按钮 —— “升级到 Windows 10”。 + +她绝望地向我呼救。作为妈妈的电脑管理员,我的生活很快就变成了地狱。“为什么所有东西看起来都不一样了?我的应用列表跑去哪儿了?什么,这堆瓷块一样的东西变成我的应用列表了?我的电脑怎么变得这么慢?它怎么每天都要自动更新重启,而且偏偏就是在我想要用它的时候?为什么有东西(她指的是硬盘)一直嗡嗡嗡地叫?它到底一直在忙些什么啊?” + +可是我又看不到源代码,我怎么它一直在忙些什么呢? + +本来我是打算回滚这个升级的,但是 Windows 7 马上就要终止支持了,我担心会发生最坏的事情:没有了安全更新,妈妈的电脑很快就会变成数不清的僵尸网络bot networks中的一员,一天到晚地挖矿、发送垃圾邮件,以及对全国的重要设施发动恶毒的 DDOS 攻击。最后还是需要我来清理这个烂摊子 —— (而且是)每一个周末。 + +### 大救星 Linux 来了 + +我决定把她的电脑环境迁移到 Linux 上,反正也没有什么可损失的。我自己在五年前就这么做了,我从未那么开心过。不如让妈妈也试试,肯定不会有什么坏处。 + +当妈妈知道我要一次性解决她所有的问题时,她非常开心。但她不知道的是,她将成为一项为期一年的科学实验的关键部分,这个实验叫做:“妈妈能学会使用 Linux 吗?” + +![Cowsay "Can Mom Survive Linux?"][7] + +(图源 Tomasz Waraksa,遵从[署名-相同方式共享 4.0 国际协议CC BY-SA 4.0][8]) + +于是,在 2020 年 2 月的某一天,我从遥远的都柏林带着一台使用七年的联想 Yoga 13 来到这里,这台电脑和妈妈那台有着相似的参数,但它的屏幕要好很多,而且只有一半的重量。我在 VirtualBox 里讨论和测试了不同的 Linux 发行版,最终选择了 [Zorin OS][9] 发行版,一个自豪的“爱尔兰造”系统。我选择它是考虑到了下面几个因素: + + * 它基于我最熟悉的 Ubuntu Linux。 + * 它和 Windows 7 很像,在精心设计的同时考虑到了 Windows 难民。 + * 我感觉它很轻量、简单,对妈妈来说足够保守。完全没有 macOS Big Sur 上的花里胡哨! + +![Zorin OS desktop][10] + +(图源 Tomasz Waraksa,遵从[署名-相同方式共享 4.0 国际协议CC BY-SA 4.0][8]) + +### 系统安装 + +我用自己一贯的方式安装了这个操作系统,为 `/home` 目录单独分了一个区,这样一来,系统重装时(尽管不大可能发生)妈妈的文件仍然能够保持安全。这是我的惯用技巧,它可以方便我安装发行版的深夜更新。 + +在安装过程中,我选择了波兰语作为用户界面语言。和我一样,妈妈也是个彻头彻尾的波兰人。不必担心,Linux 看起来支持所有语言,甚至包括 [克林贡语][11]。 + +接着,根据妈妈的需求,我安装了下面这些应用: + + * Skype + * [Signal 桌面客户端][12] + * 谷歌 Chrome 浏览器 + * [Geary][13] 邮件客户端 + * [gThumb][14],用来浏览和编辑照片 + * [VLC][15],用来播放视频和音乐 + * Softmaker Office,用来编辑文本和表格 + +注意到列表里没有杀毒软件了吗?好耶! + +一个小时后,系统和应用全部安装完成,妈妈的 Zorin OS 已准备就绪。 + +![Zorin OS home folder][16] + +(图源 Tomasz Waraksa,遵从[署名-相同方式共享 4.0 国际协议CC BY-SA 4.0][8]) + +### 设置系统 + +我通过下面这几个步骤,让自己成为了妈妈的电脑管理员: + + * 为我自己创建了一个管理员账户 + * 把妈妈的账户设置为非管理员 + * 安装了用于远程无人值守访问的 `ssh` 守护程序 + * 把这台机器加入到了我的 Hamachi VPN 中:这样一来,我就可以安全地使用 ssh 连接,而不需要打开路由器上的 `22` 端口。Hamachi 是一个由 LogMeIn 提供的 VPN 服务。它是一个传统的 VPN,我的意思是,它的目标不是让你在另外一个国家运行 Netflix 应用,而是在互联网上为计算机之间建立一个安全的网络连接。 + * 启动了简单防火墙(`ufw`)并允许 ssh 流量 + * 安装了 AnyDesk 来远程登录到桌面 + +这样操作之后,我就可以通过安全的 ssh 连接访问到妈妈的笔记本电脑。我可以通过 shell 进行定期维护,而妈妈甚至不会注意到任何事情。这是因为 Linux 完成更新后通常 _不需要_ 重新启动。真是一个奇迹啊!简直不可能的事,它是怎么做到的呢? + +![Updating software remotely][17] + +(图源 Tomasz Waraksa,遵从[署名-相同方式共享 4.0 国际协议CC BY-SA 4.0][8]) + +### 妈妈能学会使用 Linux 吗 + +毫无疑问! + +尽管当我把新电脑展示给她看的时候,她确实有问到为什么这个新的 Windows 又看起来不一样了。我不得不解释说这个其实不是 Windows,而是 Linux,然后向她解释了为什么我们都爱 Linux。不过,她学得很快。这个经典的 Zorin OS 桌面和她用惯了的 Windows 7 十分相似。我看到她在系统里点来点去,然后很轻松地找到并且运行了她熟悉的应用程序。 + +她立刻就注意到电脑启动快了很多,表现也好了很多。 + +然后她开始问我什么时候会给她做电脑的定期清理,好让她电脑不会再一次变慢。我和她解释说,以她的日常使用量,不需要再做定期清理了。Linux 和 Windows 不一样,它不会自己“腐烂”的。目前来说,的确如此。她的电脑仍然像第一天那样流畅和快速。 + +我时不时地会问她对新电脑感觉怎么样,她总是回答说很满意。一切都很顺利。电脑也不会莫名其妙就变得忙起来。再也不会有一些“很重要的更新”来打断她。应用菜单也总是在它该在的地方。在这个全新的环境中,她对自己常用的应用程序也感到满意。 + +在这一年中,我远程登录过几次她的电脑,为的是进行常规的软件包升级。我还使用 AnyDesk 登录过两次她的桌面。一次是妈妈问我能不能帮她把 SD 卡里的照片自动导入到 `~/Pictures` 目录里,如果能够放到以日期命名的目录里就更好了。当然可以,只要懂一点点的 Bash,就可以使用 `gThumb` 很轻松地实现这个功能。另一次,我把她经常访问的网站添加到了桌面,这样她点击桌面图标就可以访问了。 + +这就是目前我作为妈妈的 Linux 管理员所做的全部事情!按照这个情况,我还可以再给 50 个妈妈当电脑管理员! + +### 总结 + +我希望我的故事能够启发你考虑迁移到 Linux。过去,我们认为 Linux 对于普通用户来说太难了。但今天,我相信事实恰恰相反。用户使用电脑越不熟练,他们就越有理由迁移到 Linux! + +有了 Linux,即便是新手用户,也能通过大量熟悉的应用程序获得流畅、精致的桌面体验。新手用户们将比在任何其他流行的计算平台上都要安全得多。并且,通过远程访问来帮助他们从未如此简单和安全! + +_免责声明:本文不推广所描述的任何产品、服务或供应商。我与他们没有任何商业利益或联系。我并没有在暗示这些产品或服务是最适合你的,也不承诺你的体验会和我一样。_ + +_本文最初发布在 [Let's Debug It][18] 上,在获得许可后重新使用。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/mom-switch-linux + +作者:[Tomasz][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/tomaszwaraksa +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/heart_lego_ccby20.jpg?itok=VRpHf4iU (Red Lego Heart) +[2]: https://www.redhat.com/en/about/press-releases/red-hat-provides-cern-platform-mission-critical-applications +[3]: https://www.extremetech.com/extreme/155392-international-space-station-switches-from-windows-to-linux-for-improved-reliability +[4]: https://instagram-engineering.com/what-powers-instagram-hundreds-of-instances-dozens-of-technologies-adf2e22da2ad +[5]: https://www.theverge.com/2011/11/14/2559567/tony-fadell-nest-learning-thermostat +[6]: https://www.zdnet.com/article/to-infinity-and-beyond-linux-and-open-source-goes-to-mars/ +[7]: https://opensource.com/sites/default/files/uploads/intro.png (Cowsay "Can Mom Survive Linux?") +[8]: https://creativecommons.org/licenses/by-sa/4.0/ +[9]: https://zorinos.com/ +[10]: https://opensource.com/sites/default/files/uploads/zorin-os-desktop.png (Zorin OS desktop) +[11]: https://blogs.gnome.org/muelli/2010/04/klingon-language-support/ +[12]: https://github.com/signalapp +[13]: https://wiki.gnome.org/Apps/Geary +[14]: https://wiki.gnome.org/Apps/Gthumb +[15]: https://www.videolan.org/vlc/ +[16]: https://opensource.com/sites/default/files/uploads/zorin-os-home-folder.png (Zorin OS home folder) +[17]: https://opensource.com/sites/default/files/uploads/upgrading-software.png (Updating software remotely) +[18]: https://letsdebug.it/post/16-linux-for-mars-copters-moms-and-pops/ diff --git a/published/202203/20210707 Parsing config files with Java.md b/published/202203/20210707 Parsing config files with Java.md new file mode 100644 index 0000000000..c97e721a53 --- /dev/null +++ b/published/202203/20210707 Parsing config files with Java.md @@ -0,0 +1,350 @@ +[#]: subject: (Parsing config files with Java) +[#]: via: (https://opensource.com/article/21/7/parsing-config-files-java) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (lkxed) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14381-1.html) + +使用 Java 解析 XML 文件 +====== + +> 在你使用 Java 编写软件时实现持久化配置。 + +![](https://img.linux.net.cn/data/attachment/album/202203/22/091553wf2gvj20fn4wfgpw.jpg) + +当你编写一个应用时,你通常都会希望用户能够定制化他们和应用交互的方式,以及应用与系统进行交互的方式。这种方式通常被称为 “偏好preference” 或者 “设置setting”,它们被保存在一个 “偏好文件” 或者 “配置文件” 中,有时也直接简称为 “配置config”。配置文件可以有很多种格式,包括 INI、JSON、YAML 和 XML。每一种编程语言解析这些格式的方式都不同。本文主要讨论,当你在使用 [Java 编程语言][2] 来编写软件时,实现持久化配置的方式。 + +### 选择一个格式 + +编写配置文件是一件相当复杂的事情。我曾经试过把配置项使用逗号分隔保存在一个文本文件里,也试过把配置项保存在非常详细的 YAML 和 XML 中。对于配置文件来说,最重要是要有一致性和规律性,它们使你可以简单快速地编写代码,从配置文件中解析出数据;同时,当用户决定要做出修改时,很方便地保存和更新配置。 + +目前有 [几种流行的配置文件格式][3]。对于大多数常见的配置文件格式,Java 都有对应的library。在本文中,我将使用 XML 格式。对于一些项目,你可能会选择使用 XML,因为它的一个突出特点是能够为包含的数据提供大量相关的元数据,而在另外一些项目中,你可能会因为 XML 的冗长而不选择它。在 Java 中使用 XML 是非常容易的,因为它默认包含了许多健壮的 XML 库。 + +### XML 基础 + +讨论 XML 可是一个大话题。我有一本关于 XML 的书,它有超过 700 页的内容。幸运的是,使用 XML 并不需要非常了解它的诸多特性。就像 HTML 一样,XML 是一个带有开始和结束标记的分层标记语言,每一个标记(标签)内可以包含零个或更多数据。下面是一个 XML 的简单示例片段: + + +``` + +    Penguin + +``` + +在这个 自我描述的self-descriptive 例子中,XML 解析器使用了以下几个概念: + + * 文档Document:`` 标签标志着一个 _文档_ 的开始,`` 标签标志着这个文档的结束。 + * 节点Node:`` 标签代表了一个 _节点_。 + * 元素Element:`Penguin` 中,从开头的 `<` 到最后的 `>` 表示了一个 _元素_。 + * 内容Content: 在 `` 元素里,字符串 `Penguin` 就是 _内容_。 + +不管你信不信,只要了解了以上几个概念,你就可以开始编写、解析 XML 文件了。 + +### 创建一个示例配置文件 + +要学习如何解析 XML 文件,只需要一个极简的示例文件就够了。假设现在有一个配置文件,里面保存的是关于一个图形界面窗口的属性: + +``` + +    Dark +    0 +    Tango + + +``` + +创建一个名为 `~/.config/DemoXMLParser` 的目录: + +``` +$ mkdir ~/.config/DemoXMLParser +``` + +在 Linux 中,`~/.config` 目录是存放配置文件的默认位置,这是在 [自由桌面工作组][4] 的规范中定义的。如果你正在使用一个不遵守 自由桌面工作组Freedesktop 标准的操作系统,你也仍然可以使用这个目录,只不过你需要自己创建这些目录了。 + +复制 XML 的示例配置文件,粘贴并保存为 `~/.config/DemoXMLParser/myconfig.xml` 文件。 + +### 使用 Java 解析 XML + +如果你是 Java 的初学者,你可以先阅读我写的 [面向 Java 入门开发者的 7 个小技巧][5]。一旦你对 Java 比较熟悉了,打开你最喜爱的集成开发工具(IDE),创建一个新工程。我会把我的新工程命名为 `myConfigParser`。 + +刚开始先不要太关注依赖导入和异常捕获这些,你可以先尝试用 `javax` 和 `java.io` 包里的标准 Java 扩展来实例化一个解析器。如果你使用了 IDE,它会提示你导入合适的依赖。如果没有,你也可以在文章稍后的部分找到完整的代码,里面就有完整的依赖列表。 + + +``` +Path configPath = Paths.get(System.getProperty("user.home"), ".config", "DemoXMLParser"); +File configFile = new File(configPath.toString(), "myconfig.xml"); + +DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + +DocumentBuilder builder = null; +builder = factory.newDocumentBuilder(); + +Document doc = null; +doc = builder.parse(configFile); +doc.getDocumentElement().normalize(); +``` + +这段示例代码使用了 `java.nio.Paths` 类来找到用户的主目录,然后在拼接上默认配置文件的路径。接着,它用 `java.io.File` 类来把配置文件定义为一个 `File` 对象。 + +紧接着,它使用了 `javax.xml.parsers.DocumentBuilder` 和 `javax.xml.parsers.DocumentBuilderFactory` 这两个类来创建一个内部的文档构造器,这样 Java 程序就可以导入并解析 XML 数据了。 + +最后,Java 创建一个叫 `doc` 的文档对象,并且把 `configFile` 文件加载到这个对象里。通过使用 `org.w3c.dom` 包,它读取并规范化了 XML 数据。 + +基本上就是这样啦。理论上来讲,你已经完成了数据解析的工作。可是,如果你不能够访问数据的话,数据解析也没有多少用处嘛。所以,就让我们再来写一些查询,从你的配置中读取重要的属性值吧。 + +### 使用 Java 访问 XML 的值 + +从你已经读取的 XML 文档中获取数据,其实就是要先找到一个特定的节点,然后遍历它包含的所有元素。通常我们会使用多个循环语句来遍历节点中的元素,但是为了保持代码可读性,我会尽可能少地使用循环语句: + +``` +NodeList nodes = doc.getElementsByTagName("window"); + +for (int i = 0; i < nodes.getLength(); i++) { + Node mynode = nodes.item(i); + System.out.println("Property = " + mynode.getNodeName()); + + if (mynode.getNodeType() == Node.ELEMENT_NODE) { + Element myelement = (Element) mynode; + + System.out.println("Theme = " + myelement.getElementsByTagName("theme").item(0).getTextContent()); + System.out.println("Fullscreen = " + myelement.getElementsByTagName("fullscreen").item(0).getTextContent()); + System.out.println("Icon set = " + myelement.getElementsByTagName("icons").item(0).getTextContent()); + } +} +``` + +这段示例代码使用了 `org.w3c.dom.NodeList` 类,创建了一个名为 `nodes` 的 `NodeList` 对象。这个对象包含了所有名字匹配字符串 `window` 的子节点,实际上这样的节点只有一个,因为本文的示例配置文件中只配置了一个。 + +紧接着,它使用了一个 `for` 循环来遍历 `nodes` 列表。具体过程是:根据节点出现的顺序逐个取出,然后交给一个 `if-then` 子句处理。这个 `if-then` 子句创建了一个名为 `myelement` 的 `Element` 对象,其中包含了当前节点下的所有元素。你可以使用例如 `getChildNodes` 和 `getElementById` 方法来查询这些元素,项目中还 [记录了][9] 其他查询方法。 + +在这个示例中,每个元素就是配置的键。而配置的值储存在元素的内容中,你可以使用 `.getTextContent` 方法来提取出配置的值。 + +在你的 IDE 中运行代码(或者运行编译后的二进制文件): + +``` +$ java ./DemoXMLParser.java +Property = window +Theme = Dark +Fullscreen = 0 +Icon set = Tango +``` + +下面是完整的代码示例: + +``` +package myConfigParser; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +public class ConfigParser { + + public static void main(String[] args) { + Path configPath = Paths.get(System.getProperty("user.home"), ".config", "DemoXMLParser"); + File configFile = new File(configPath.toString(), "myconfig.xml"); + DocumentBuilderFactory factory = + DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = null; + + try { + builder = factory.newDocumentBuilder(); + } catch (ParserConfigurationException e) { + e.printStackTrace(); + } + + Document doc = null; + + try { + doc = builder.parse(configFile); + } catch (SAXException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + doc.getDocumentElement().normalize(); + + NodeList nodes = doc.getElementsByTagName("window"); + for (int i = 0; i < nodes.getLength(); i++) { + Node mynode = nodes.item(i); + System.out.println("Property = " + mynode.getNodeName()); + + if (mynode.getNodeType() == Node.ELEMENT_NODE) { + Element myelement = (Element) mynode; + + System.out.println("Theme = " + myelement.getElementsByTagName("theme").item(0).getTextContent()); + System.out.println("Fullscreen = " + myelement.getElementsByTagName("fullscreen").item(0).getTextContent()); + System.out.println("Icon set = " + myelement.getElementsByTagName("icons").item(0).getTextContent()); + } // close if + } // close for + } // close method +} //close class +``` + +### 使用 Java 更新 XML + +用户时不时地会改变某个偏好项,这时候 `org.w3c.dom` 库就可以帮助你更新某个 XML 元素的内容。你只需要选择这个 XML 元素,就像你读取它时那样。不过,此时你不再使用 `.getTextContent` 方法,而是使用 `.setTextContent` 方法。 + +``` +updatePref = myelement.getElementsByTagName("fullscreen").item(0); +updatePref.setTextContent("1"); + +System.out.println("Updated fullscreen to " + myelement.getElementsByTagName("fullscreen").item(0).getTextContent()); +``` + +这么做会改变应用程序内存中的 XML 文档,但是还没有把数据写回到磁盘上。配合使用 `javax` 和 `w3c` 库,你就可以把读取到的 XML 内容写回到配置文件中。 + +``` +TransformerFactory transformerFactory = TransformerFactory.newInstance(); + +Transformer xtransform; +xtransform = transformerFactory.newTransformer(); + +DOMSource mydom = new DOMSource(doc); +StreamResult streamResult = new StreamResult(configFile); + +xtransform.transform(mydom, streamResult); +``` + +这么做会没有警告地写入转换后的数据,并覆盖掉之前的配置。 + +下面是完整的代码,包括更新 XML 的操作: + +``` +package myConfigParser; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +public class ConfigParser { + + public static void main(String[] args) { + Path configPath = Paths.get(System.getProperty("user.home"), ".config", "DemoXMLParser"); + File configFile = new File(configPath.toString(), "myconfig.xml"); + DocumentBuilderFactory factory = + DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = null; + + try { + builder = factory.newDocumentBuilder(); + } catch (ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + Document doc = null; + + try { + doc = builder.parse(configFile); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + doc.getDocumentElement().normalize(); + Node updatePref = null; +// NodeList nodes = doc.getChildNodes(); + NodeList nodes = doc.getElementsByTagName("window"); + for (int i = 0; i < nodes.getLength(); i++) { + Node mynode = nodes.item(i); + System.out.println("Property = " + mynode.getNodeName()); + + if (mynode.getNodeType() == Node.ELEMENT_NODE) { + Element myelement = (Element) mynode; + + System.out.println("Theme = " + myelement.getElementsByTagName("theme").item(0).getTextContent()); + System.out.println("Fullscreen = " + myelement.getElementsByTagName("fullscreen").item(0).getTextContent()); + System.out.println("Icon set = " + myelement.getElementsByTagName("icons").item(0).getTextContent()); + + updatePref = myelement.getElementsByTagName("fullscreen").item(0); + updatePref.setTextContent("2"); + System.out.println("Updated fullscreen to " + myelement.getElementsByTagName("fullscreen").item(0).getTextContent()); + } // close if + + }// close for + + // write DOM back to the file + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer xtransform; + + DOMSource mydom = new DOMSource(doc); + StreamResult streamResult = new StreamResult(configFile); + + try { + xtransform = transformerFactory.newTransformer(); + xtransform.transform(mydom, streamResult); + } catch (TransformerException e) { + e.printStackTrace(); + } + + } // close method +} //close class +``` + +### 如何保证配置不出问题 + +编写配置文件看上去是一个还挺简单的任务。一开始,你可能会用一个简单的文本格式,因为你的应用程序只要寥寥几个配置项而已。但是,随着你引入了更多的配置项,读取或者写入错误的数据可能会给你的应用程序带来意料之外的错误。一种帮助你保持配置过程安全、不出错的方法,就是使用类似 XML 的规范格式,然后依靠你用的编程语言的内置功能来处理这些复杂的事情。 + +这也正是我喜欢使用 Java 和 XML 的原因。每当我试图读取错误的配置值时,Java 就会提醒我。通常,这是由于我在代码中试图获取的节点,并不存在于我期望的 XML 路径中。XML 这种高度结构化的格式帮助了代码保持可靠性,这对用户和开发者来说都是有好处的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/parsing-config-files-java + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hot drink at the computer) +[2]: https://opensource.com/resources/java +[3]: https://opensource.com/article/21/6/what-config-files +[4]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html +[5]: https://opensource.com/article/19/10/java-basics +[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system +[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+file +[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+document +[9]: https://www.w3.org/2003/01/dom2-javadoc/org/w3c/dom/Document.html +[10]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[11]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+ioexception +[12]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+element diff --git a/published/202203/20210711 How to Dual Boot Fedora and Windows.md b/published/202203/20210711 How to Dual Boot Fedora and Windows.md new file mode 100644 index 0000000000..59f34fe23d --- /dev/null +++ b/published/202203/20210711 How to Dual Boot Fedora and Windows.md @@ -0,0 +1,226 @@ +[#]: subject: (How to Dual Boot Fedora and Windows) +[#]: via: (https://itsfoss.com/dual-boot-fedora-windows/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14401-1.html) + +如何双启动 Fedora 和 Windows +====== + +![][2] + +> 这篇详细的教程一步一步地向你展示 **如何双启动 Fedora Linux 和 Windows 10**,附有适当的截图。 + +双启动 Linux 和 Windows 是一种完全享受这两款操作系统的流行方式。你可以在同一个硬件系统上安装 Linux 和 Windows 两款系统,并在你启动你的硬件系统时选择使用哪款操作系统。 + +![On the grub screen, you can select the operating system][1] + +如果你有一个已经安装 Windows 的系统,你将在这篇教程中学习如何在 Windows 的旁侧安装 Fedora 。 + +### 在 Windows 的旁侧安装 Fedora + +这篇教程是在一款已经安装 Windows,采用 GPT 分区和 UEFI 启动的硬件系统的基础上执行的。它应该也适用于其它的带有 MBR 分区和传统 BIOS 的硬件系统,但是我不能确认这一点。 + +注意:如果你的 Windows 系统使用 BitLocker 加密,在你安装 Fedora 前禁用它会是一个好主意。 + +#### 必要条件 + +这里是你需要遵循这篇教程的东西: + + * 一个已预装 Windows 的系统 + * 良好的互联网连接速度 + * 一个至少 4 GB 大小的 USB 接口设备(U 盘) + * 可选: 用于备份你的 Windows 现有数据的外部 USB 磁盘。 + * 可选: Windows 恢复或可启动磁盘(如果你偶遇一些严重的启动问题,你可以修复它)。 + +让我们看看步骤。 + +#### 步骤 1: 制作 Windows 系统的数据备份 [可选] + +备份总会是一个好主意。因为你将要处理磁盘分区。在一些罕见的不幸情况下,假设你出错并删除了错误的分区,你将丢失你的数据。 + +最简单的方法是将文档、视频、音乐、图片和其它的文件夹中的数据复制到一块外部 USB 磁盘中。你可以使用一个外部的机械硬盘(传输速度较慢,但是价格较便宜)或固态硬盘(传输速度较快,但是价格较昂贵),并将重要的文件和文件夹复制到其中。 + +#### 步骤 2: 为 Fedora 的安装准备一些可用的空间 + +你需要创建一个分区,你将在其中安装 Fedora 。如果你只有一个 C 驱动器,缩小它的分区。如果你有 D、E 或 F 等多个驱动器,确保你可以移动这些驱动器中的数据到一些其它的分区中,删除或缩小其中的一个驱动器。超过 40 GB 的驱动器分区都能有足够的空间来安装安装 Fedora 。 + +在 Windows 的菜单中,搜索 “磁盘分区” 并转到 “创建并格式化磁盘分区”。 + +![][10] + +在磁盘管理工具中,右键单件你想要分区的驱动器,并选择 “缩小卷”。 + +如果你只有一个像这样的分区,你需要为 Linux 腾出一些可用的空间。如果你有一些空间相当大的分区,请使用除 C 驱动器分区外的分区,因为它会擦除数据。 + +![][11] + +#### 步骤 3: 在 Windows 中制作一个 Fedora 的临场 USB + +现在,这个步骤可以通过不同的方法来完成。你可以下载 ISO 并使用 [Etcher][12] 或 Rufus 或一些其它的工具来将 ISO 镜像写入 USB 磁盘。 + +不过,Fedora 提供了一个用于下载 ISO 镜像和制作 临场 USBLive USB 的专用工具。我将在这篇教程中使用它。Fedora 团队在创建这个工具时付出了很多艰难的努力,因此为什么不使用它呢。 + +但是,首先, **插入 USB 接口设备**。现在,转到 Fedora 的下载页面: + +- [下载 Fedora][13] + +你将看到针对 Windows 版本的下载 “Fedora Media Writer” 工具的选项。 + +![][14] + +它将下载一个 exe 文件。在下载完成后,转到你所下载到的文件夹,并双击 `FedoraMediaWriter.exe` 文件来安装 “Fedora Media Writer” 工具。只需要重复点击 “下一步next 。 + +![][15] + +在安装完成后,运行 “Fedora Media Writer” 工具。但是在此之前,**确保你已经插入 USB 设备**。 + +它将给予你安装各种 Fedora 版本的选项。针对桌面机,选择工作站Workstation版本。 + +![][16] + +在接下来的屏幕中,你将会得到一个创建临场 USB 的选项。当你点击这个按钮时,它将开始下载 ISO 文件。它也将识别出你所插入的 USB 接口设备。 + +你需要良好的互联网访问速度来在一段时间内顺畅地下载 2GB 大小的 ISO 文件。 + +![][17] + +在下载 ISO 后,它会自动地对其进行检验,并给予你将 ISO 镜像写入到 USB 磁盘的选项,例如,创建临场 USB 。点击 “写入到磁盘Write to Disk” 按钮。 + +![][18] + +它将花费几分钟来完成安装过程。它显示 “完成Finished” 信息后,你可以关闭 “Fedora Media Writer” 工具了。 + +![][19] + +很好!现在你已经准备好了 Fedora 临场 USB 。现在是时候使用它来安装带有图形用户界面的 Fedora 了。 + +#### 步骤 4: 从 临场 USB 启动并安装 Fedora + +一些系统不允许你在使用安全启动的情形下从临场 USB 启动。如果你是这种情况的话,请 [禁用安全启动][20]。 + +在处于显示硬件系统制造商徽标的屏幕期间,按下 `F2` 或 `F10` 或 `F12` 按键。如果你不确定是哪个按键,你可以逐个尝试。但是,你要 **快速地** 按下按键 ,否则它将会启动到操作系统之中。 + +不同品牌计算机的按键是不同的。一些计算机甚至可能使用 `Esc` 或 `Del` 按键来完成此目的。 + +![Quickly press F2, F10 or F12 keys at the screen showing your system manufacturer’s logo][21] + +在一些罕见的情况下,你可能需要 [在 Windows 中访问 UEFI 启动设置][22]。 + +在 BIOS 设置中,通常,你应该会看到像这样的屏幕。在这里,你可以使用箭头按键来向下移动到 USB 选项,并按下回车键来从 USB 启动。请注意,在不同的系统中,这一屏幕可能会看起来有所不同。 + +![][23] + +如果一切顺利,你应该会看到像下面的一个屏幕。选择第一个选项 “启动 Fedora 工作站Start Fedora Workstation”: + +![][24] + +在数秒后,你应该会启动到 Fedora 临场会话期间,并会看到尝试或安装它的选项。选择 “安装到硬盘Install to Hard Drive” 。 + +![][25] + +它会要求选择安装过程的语言选项。 + +![][26] + +接下来的屏幕是很重要的。如果你已经在 “步骤 2” 中创建了可用的空间,你应该能够点击 “开始安装Begin Installation” 。如果你在“系统SYSTEM”下的磁盘图标上看到一个感叹号,单击它,并查看你能够在这里使用哪种磁盘配置。 + +如果你有多个磁盘,你可以为 Fedora 选择使用哪个磁盘。 + +![][27] + +选择磁盘,并点击“完成Done” 。现在,你应该会看到一条警告信息。在我的实例中,我没有在 “步骤 2” 中创建可用的空间,因此它会抱怨这里没有足够的可用的空间来安装 Fedora 。 + +![][28] + +我点击 “回收空间Reclaim space” ,并缩小在这里的 Windows 分区。 + +![][29] + +在这以后,将出现 “开始安装Begin Installation” 选项,开启安装过程。 + +![][30] + +现在,它只是一个需要耐心等待的游戏了。将花费数分钟来提取文件并安装它们。 + +![][31] + +当过程完成后,你将看到 “结束安装Finish Installation” 按钮,点击它。 + +![][32] + +你将回到 Fedora 临场会话期间。单击右上角的下拉菜单并选择 “重新启动Restart” 。 + +![][33] + +现在,当系统启动时,你应该会看到带有启动到 Fedora 和 Windows 选项的 [Grub 启动器][34]。 + +![][1] + +#### 步骤 5: 完成 Fedora 安装 + +至此你几乎完成了安装。你注意到 Fedora 没有要求你输入用户名和密码了吗?很多发行版(像 Ubuntu )在安装期间会要求你创建一个管理用户。作为另一种方式,Fedora 会在你第一次登录到所安装的系统时给予你这个选项。 + +当你第一次登录时,它会运行一次设置,并创建用户名和密码来作为这次初始化设置的一部分。 + +![][35] + +![][36] + +![][37] + +在你完成后,你已经用上 Fedora Linux 了。 + +![][38] + +就这样,你可以在同一个硬件系统上以双启动的模式来享受 Fedora Linux 和 Windows 。 + +如果你在学习这篇教程时有一些问题或者你正在面对一些重大难题,请在评论系统中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/dual-boot-fedora-windows/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/dual-boot-grub-screen-fedora-windows.jpg?resize=800%2C350&ssl=1 +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-windows-dual-boot.jpg?resize=800%2C450&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/disc-management-windows.png?resize=800%2C561&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/making-free-space-for-dual-boot.jpg?resize=1226%2C728&ssl=1 +[12]: https://itsfoss.com/install-etcher-linux/ +[13]: https://getfedora.org/en/workstation/download/ +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/download-fedora-media-writer-tool.png?resize=800%2C373&ssl=1 +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-Fedora-Media-Writer-tool-Windows.png?resize=745%2C581&ssl=1 +[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-media-writer-1.png?resize=800%2C425&ssl=1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-media-writer-2.jpg?resize=800%2C422&ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/writing-fedora-iso-to-usb-with-Fedora-Media-Writer-Tool.png?resize=800%2C285&ssl=1 +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedoa-live-usb-with-fedora-media-writer.png?resize=800%2C300&ssl=1 +[20]: https://itsfoss.com/disable-secure-boot-windows/ +[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/acer-predator-boot.jpg?resize=800%2C600&ssl=1 +[22]: https://itsfoss.com/access-uefi-settings-windows-10/ +[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/select-boot-from-live-usb.jpg?resize=800%2C330&ssl=1 +[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-live-screen.jpg?resize=800%2C350&ssl=1 +[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/Fedora-install-screen.jpg?resize=800%2C450&ssl=1 +[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-1.png?resize=800%2C450&ssl=1 +[27]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-2.png?resize=800%2C450&ssl=1 +[28]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-3.png?resize=800%2C450&ssl=1 +[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-4.png?resize=800%2C450&ssl=1 +[30]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-5.png?resize=800%2C450&ssl=1 +[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-6.png?resize=800%2C450&ssl=1 +[32]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-7.png?resize=800%2C450&ssl=1 +[33]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/restart-gnome-fedora.jpg?resize=799%2C439&ssl=1 +[34]: https://itsfoss.com/what-is-grub/ +[35]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-setup-1.png?resize=800%2C575&ssl=1 +[36]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-setup-2.png?resize=800%2C593&ssl=1 +[37]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-setup-3.png?resize=800%2C591&ssl=1 +[38]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-setup-completed.jpg?resize=800%2C500&ssl=1 diff --git a/published/202203/20210824 Solve the repository impedance mismatch in CI-CD.md b/published/202203/20210824 Solve the repository impedance mismatch in CI-CD.md new file mode 100644 index 0000000000..63430bdbfe --- /dev/null +++ b/published/202203/20210824 Solve the repository impedance mismatch in CI-CD.md @@ -0,0 +1,194 @@ +[#]: subject: "Solve the repository impedance mismatch in CI/CD" +[#]: via: "https://opensource.com/article/21/8/impedance-mismatch-cicd" +[#]: author: "Evan \"Hippy\" Slatis https://opensource.com/users/hippyod" +[#]: collector: "lujun9972" +[#]: translator: "lxbwolf" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14396-1.html" + +解决 CI/CD 中的仓库阻抗失配 +====== + +> 对齐部署镜像和描述符是很困难的,但是某些策略可以使整个过程更高效。 + +![](https://img.linux.net.cn/data/attachment/album/202203/26/111748mxu3ovasrvb0iy02.jpg) + +在软件架构中,当两个组件之间有某些概念性或技术上的差异时会出现 阻抗失配impedance mismatch。这个术语其实是从电子工程中借用的,表示电路中输入和输出的电子阻抗必须要匹配。 + +在软件开发中,存储在镜像仓库中的镜像与存储在源码控制管理系统(LCTT 译注:SCM,Source Code Management)中它的部署描述符deployment descriptor之间存在阻抗失配。你如何确定存储在 SCM 中的部署描述符表示的是正确的镜像?两个仓库追踪数据的方式并不一致,因此将一个镜像(在镜像仓库中独立存储的不可修改的二进制)和它的部署描述符(Git 中以文本文件形式存储的一系列修改记录)相匹配并不那么直观。 + +**注意**:本文假定读者已经熟悉以下概念: + + * 源码控制管理Source Control Management(SCM)系统和分支 + * Docker 或符合 OCI 标准的镜像和容器 + * 容器编排系统Container Orchestration Platforms(COP),如 Kubernetes + * 持续集成/持续交付Continuous Integration/Continuous Delivery(CI/CD) + * 软件开发生命周期Software development lifecycle(SDLC)环境 + +### 阻抗失配:SCM 与镜像仓库 + +为了更好地理解阻抗失配在什么场景下会成为问题,请考虑任意项目中的软件开发生命周期环境(SDLC),如开发、测试或发布环境。 + +测试环境不会有阻抗失配。现在使用 CI/CD 的最佳实践中开发分支的最新提交都会对应开发环境中的最新部署。因此,一个典型的、成功的 CI/CD 开发流程如下: + + 1. 向 SCM 的开发分支提交新的修改 + 2. 新提交触发一次镜像构建 + 3. 新生成的镜像被推送到镜像仓库,标记为开发中 + 4. 镜像被部署到容器编排系统(COP)中的开发环境,该镜像的部署描述符也更新为从 SCM 拉取的最新描述符。 + +换句话说,开发环境中最新的镜像永远与最新的部署描述符匹配。回滚到前一个构建的版本也不是问题,因为 SCM 也会跟着回滚。 + +最终,随着开发流程继续推进,需要进行更多正式的测试,因此某个镜像 —— 镜像对应着 SCM 中的某次提交 —— 被推到测试环境。如果是一次成功的构建,那么不会有大问题,因为从开发环境推过来的镜像应该会与开发分支的最新提交相对应。 + + 1. 开发环境的最新部署被允许入库,触发入库过程 + 2. 最新部署的镜像被标记为测试中 + 3. 镜像在测试环境中被拉取和部署,(该镜像)对应从 SCM 拉取的最新部署描述符 + +到目前为止,一切都没有问题,对吗?如果出现下面的场景,会有什么问题? + +**场景 A**:镜像被推到下游环境,如用户验收测试user acceptance testing (UAT),或者是生产环境。 + +**场景 B**:测试环境中发现了一个破坏性的 bug,镜像需要回滚到某个确定正常的版本。 + +在任一场景中,开发过程并没有停止,即开发分支上游有了一次或多次新的提交,而这意味着最新的部署描述符已经发生了变化,最新的镜像与之前部署在测试环境中的镜像不一致。对部署描述符的修改可能会也可能不会对之前版本的镜像起作用,但是它们一定是不可信任的。如果它们有了变化,那么它们就一定与目前为止你测试过的想要部署的镜像的部署描述符不一致。 + +问题的关键是:**如果部署的镜像不是镜像库中的最新版本,你怎么确定与部署的镜像相对应的是 SCM 中的哪个部署描述符?** 一言以蔽之,无法确定。两个库直接有阻抗失配。如果要详细阐述下,那么是有方法可以解决的,但是你需要做很多工作,这部分内容就是文章接下来的主题了。请注意,下面的方案并不是解决问题的唯一办法,但是已经投入到生产环境并已经对很多项目起了作用,而且已经被构建并部署到生产环境中运行了超过一年。 + +### 二进制与部署描述符 + +源码通常被构建成一个 Docker 镜像或符合 OCI 标准的镜像,该镜像通常被部署到一个容器编排平台(COP)上,如 Kubernetes。部署到 COP 需要部署描述符来定义镜像被如何部署以及作为容器运行,如 [Kubernetes 部署][2] 或 [CronJobs][3]。这是因为在镜像和它的部署描述符之间有本质差异,在这里可以看到阻抗失配。在这次讨论中,我们认为镜像是存储在镜像仓库中不可修改的二进制。对源码的任何修改都不会修改镜像,而是用另一个新的镜像去替换它。 + +相比之下,部署描述符是文本文件,因而可以被认为是源码且可修改。如果遵循最佳实践,那么部署描述符是被存储在 SCM,所有修改都会提交,而这很容易回溯。 + +### 解决阻抗失配 + +建议的解决方案的第一部分,就是提供一个能匹配镜像仓库中的镜像与对保存部署描述符的 SCM 做的代码提交的方法。最直接的解决方案是用源提交的哈希值标记镜像。这个方法可以区分不同版本的镜像、容易分辨,并且提供足够的信息来查找正确的部署描述符,以便镜像更好地部署到 COP。 + +再回顾下上面的场景: + +**场景 A** _镜像被推到下游环境_: 当镜像被从测试环境推到 UAT 环境时,我们可以从镜像的标签中知道应该从 SCM 的哪一次源码提交拉取部署描述符。 + +**场景 B** _当一个镜像需要在某一环节中回滚_:无论我们选择回滚到那个镜像版本,我们都可以知道从 SCM 的哪一次源码提交拉取正确的部署描述符。 + +在每一种情景中,无论在某个镜像被部署到测试环境后开发分支有多少次提交和构建,对于每一次升级的镜像,我们都可以找到它当初部署时对应的部署描述符。 + +然而,这并不是阻抗失配的完整解决方案。再考虑两个场景: + +**场景 C** 在负载测试环境中,会尝试对不同的部署描述符进行多次部署,以此来验证某一次构建的表现。 + +**场景 D** 一个镜像被推送到下游环境,在该环境中部署描述符有一个错误。 + +在上面的所有场景中,我们都需要修改部署描述符,但是目前为止我们只有一个源码提交哈希。请记住,最佳实践要求我们所有对源码的修改都要先提交到 SCM。某次提交的哈希本身是无法修改的,因此我们需要一个比仅仅追踪原来的源码提交哈希更好地解决方案。 + +解决方案是基于原来的源码提交哈希新建一个分支。我们把这个分支称为**部署分支**。每当一个镜像被推到下游测试或发布环境时,你应该**基于前一个 SDLC 环境的部署分支的最新提交**创建一个新的部署分支。 + +这样同一个镜像可以重复多次部署到不同的 SDLC 环境,并在后面每个环境中可以感知前面发现的改动或对镜像做的修改。 + +**注意:** 在某个环境中做的修改是如何影响下一个环境的,是用可以共享数据的工具(如 Helm Charts)还是手动剪切、粘贴到其他目录,都不在本文讨论的范围内。 + +因此,当一个镜像被从一个 SDLC 环境中推到下一环境时: + + 1. 创建一个部署分支 + 1. 如果镜像是从开发环境中推过来的,那么部署分支就基于构建这个镜像的源码提交哈希创建 + 2. 否则,_部署分支基于当前部署分支的最新提交创建_ + 2. 镜像被部署到下一个 SDLC 环境,使用的部署描述符是该环境中新创建的部署分支的部署描述符 + +![deployment branching tree][4] + +*图 1:部署分支树* + + 1. 部署分支 + 2. 下游环境的第一个部署分支,只有一次提交 + 3. 下游环境的第二个部署分支,只有一次提交 + +有了部署分支这个解决方案,再回顾下上面的场景 C 和场景 D: + +**场景 C** 修改已经部署到下游 SDLC 环境中的镜像的部署描述符 + +**场景 D** 修复某个 SDLC 环境中部署描述符的错误 + +两个场景中,工作流如下: + + 1. 把对部署描述符做的修改提交到 SLDC 环境和镜像对应的部署分支 + 2. 通过部署分支最新提交对应的部署描述符把镜像重新部署到 SLDC 环境 + +这样,部署分支彻底解决了(存储着代表一次独一无二的构建的单一的、不可修改的镜像的)镜像仓库与(存储着对应一个或多个 SDLC 环境的可修改的部署描述符的)SCM 仓库之间的阻抗失配。 + +### 实践中的思考 + +这看起来像是行得通的解决方案,但同时它也为开发者和运维人员带来了新的实践中的问题,比如: + +A. 为了更好地管理部署分支,部署描述符作为资源应该保存在哪里,是否要与构建镜像的源码保存在同一个 SCM 仓库? + +到目前为止,我们都在避免谈论应该把部署描述符放在哪个仓库里。在还没有太多细节需要处理时,我们推荐把所有 SDLC 环境的部署描述符与镜像源码放在同一个 SCM 仓库。当部署分支创建后,镜像的源码可以作为方便找到部署的容器中运行的镜像的引用来使用。 + +上面提到过,可以通过镜像的标签来关联镜像与原始的源码提交。在一个单独的仓库中查找某次提交的源码的引用,会给开发者带来更大的困难(即便借助工具),这就是没有必要把所有资源都分开存储的原因。 + +B. 应该在部署分支上修改构建镜像的源码吗? + +简答:**不应该**。 + +详细阐述:不应该,因为永远不要在部署分支上构建镜像,它们是在开发分支上构建的。修改部署分支上定义一个镜像的源码会破坏被部署的镜像的构建记录,而且这些修改并不会对镜像的功能生效。在对比两个部署分支的版本时这也会成为问题。这可能会导致两个版本的功能差异有错误的测试结果(这是使用部署分支的一个很小的额外好处)。 + +C. 为什么使用镜像 标签tag标记label 不可以吗? + +通过 标签tag 可以在仓库中很容易地查找镜像,可读性也很好。在一组镜像中读取和查找 标记label 的值需要拉取所有镜像的清单文件manifest,而这会增加复杂度、降低性能。而且,考虑到历史记录的追踪和不同版本的查找,对不同版本的镜像添加 标签tag 也很有必要,因此使用源码提交哈希是保证唯一性,以及保存能即时生效的有用信息的最简单的解决方案。 + +D. 创建部署分支的最佳实践是怎样的? + +DevOps 最重要的三个原则:自动化、自动化、自动化。 + +依赖资源来持续地强迫遵循最佳实践,充其量只是碰运气,因此在实现镜像的升级、回滚等 CI/CD 流水线时,把自动化部署分支写到脚本里。 + +E. 对部署分支的命名规范有建议吗? + +<**部署分支标识**>-<**环境**>-<**源码提交哈希**> + + * **部署分支标识**: 所有部署分支范围内唯一的字符串;如 “deployment” 或 “deploy” + * **环境**: 部署分支适用的 SDLC 环境;如 “qa”(测试环境)、 “stg”(预生产环境)、 或 “prod”(生产环境) + * **源码提交哈希**: 源码提交哈希中包含原来构建被部署的镜像的源码,开发者可以通过它很容易地查找到创建镜像的原始提交,同时也能保证分支名唯一。 + +例如, `deployment-qa-asdf78s` 表示推到 QA 环境的部署分支, `deployment-stg-asdf78s` 表示推到 STG 环境的部署分支。 + +F. 你怎么识别环境中运行的哪个镜像版本? + +我们的建议是把最新的部署分支提交哈希和源码提交哈希添加到 [标记][5] 中。开发者和运维人员可以通过这两个独一无二的标识符查找到部署的所有东西及其来源。在诸如执行回滚或前滚操作时,使用那些不同版本的部署的选择器也能清理资源碎片。 + +G. 什么时候应该把部署分支的修改合并回开发分支? + +这完全取决于开发团队。 + +如果你修改的目的是为了做负载测试,只是想验证什么情况会让程序崩溃,那么这些修改不应该被合并回开发分支。另一方面,如果你发现和修复了一个错误,或者对下游环境的部署做了调整,那么就应该把部署分支的修改合并回开发分支。 + +H. 有现成的部署分支示例让我们试水吗? + +[el-CICD][6] 已经在生产上使用这个策略持续一年半应用到超过一百个项目了,覆盖所有的 SDLC 环境,包括管理生产环境的部署。如果你可以访问 [OKD][7]、Red Hat OpenShift lab cluster 或 [Red Hat CodeReady Containers][8],你可以下载[el-CICD 的最新版本][9],参照 [教程][10] 来学习部署分支是何时以怎样的方式创建和使用的。 + +### 结语 + +通过实践上面的例子可以帮助你更好的理解开发过程中阻抗失配相关的问题。对齐镜像和部署描述符是成功管理部署的关键部分。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/impedance-mismatch-cicd + +作者:[Evan "Hippy" Slatis][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hippyod +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk "Tips and gears turning" +[2]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ +[3]: https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/ +[4]: https://opensource.com/sites/default/files/picture1.png +[5]: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +[6]: https://github.com/elcicd +[7]: https://www.okd.io/ +[8]: https://cloud.redhat.com/openshift/create/local +[9]: https://github.com/elcicd/el-CICD-RELEASES +[10]: https://github.com/elcicd/el-CICD-docs/blob/master/tutorial.md diff --git a/published/202203/20210903 How to Completely Uninstall Google Chrome From Ubuntu.md b/published/202203/20210903 How to Completely Uninstall Google Chrome From Ubuntu.md new file mode 100644 index 0000000000..14184ea82f --- /dev/null +++ b/published/202203/20210903 How to Completely Uninstall Google Chrome From Ubuntu.md @@ -0,0 +1,97 @@ +[#]: subject: "How to Completely Uninstall Google Chrome From Ubuntu" +[#]: via: "https://itsfoss.com/uninstall-chrome-from-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14368-1.html" + +如何从 Ubuntu 中彻底卸载 Google Chrome +====== + +现在,你已经成功地 [在 Ubuntu 上安装 Google Chrome][1]。毕竟,它是世界上最受欢迎的网页浏览器了。 + +但是,你可能会不喜欢 Google 的产品,因为它们对用户的信息进行追踪和数据挖掘。你决定选择 [Ubuntu 上的其他网页浏览器][2],并且它或许是一个 [非 Chromium 核心的浏览器][3]。 + +既然你已经不再使用 [Google Chrome][4] 了,那么,把它从 Ubuntu 系统中移除是一个明智的选择。 + +如何才能做到这一点呢?我来告诉你具体的步骤。 + +### 从 Ubuntu 中完全移除 Google Chrome + +![Illustration for removing Google Chrome from Ubuntu][5] + +你可能使用了图形界面的方式安装 Google Chrome,但不幸的是,你得使用命令行的方式来移除它,除非你选择 [使用 Synaptic 软件包管理器][6]。 + +使用命令行来做这件事也不是很难。首先,按下 [键盘上的 Ctrl+Alt+T 快捷键来打开一个终端][7]。 + +在终端中输入下面的命令: + +``` +sudo apt purge google-chrome-stable +``` + +此时它会向你索要一个密码,这个密码是你的用户账户密码,也就是你用来登录 Ubuntu 系统的密码。 + +当你输入密码的时候,屏幕上什么也不会显示。这是 Linux 系统的正常行为。继续输入密码,完成后按下回车键。 + +此时它会让你确认是否删除 Google Chrome,输入 `Y` 来确认,或者直接按下回车键也行。 + +![Removing Google Chrome for Ubuntu][8] + +这个操作会从你的 Ubuntu Linux 系统中移除 Google Chrome,同时也会移除大多数相关的系统文件。 + +但是,你的个人设置文件仍然保留在用户主目录中。它包含了 Cookie、会话、书签和其他与你的账户相关的 Chrome 设置信息。当你下次安装 Google Chrome 时,这些文件可以被 Chrome 再次使用。 + +![Google Chrome leftover settings in Ubuntu][9] + +如果你想要彻底地移除 Google Chrome,你可能会想要把这些文件也移除掉。那么,下面是你需要做的: + +切换到 `.config` 目录。 **注意 config 前面有个点**`,这是 [Linux 隐藏文件和目录的方式][10]。 + +``` +cd ~/.config +``` + +然后移除 `google-chrome` 目录: + +``` +rm -rf google-chrome +``` + +![Removing the leftover Google Chrome settings from Ubuntu][11] + +你也可以仅使用一个命令 `rm -rf ~/.config/google-chrome` 来删除它。因为本教程面向的对象是完完全全的初学者,所以我把这个命令拆分为以上两个步骤来完成,这样可以减少由于拼写问题造成的可能错误。 + +> 小技巧 +> +> 想要你的终端和截图里看起来一样漂亮吗?试试这些 [终端定制小技巧][12]。 + +我希望这篇快速的入门技巧可以帮助你在 Ubuntu 上摆脱 Google Chrome。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/uninstall-chrome-from-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-chrome-ubuntu/ +[2]: https://itsfoss.com/best-browsers-ubuntu-linux/ +[3]: https://itsfoss.com/open-source-browsers-linux/ +[4]: https://www.google.com/chrome/index.html +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/removing-google-chrome-ubuntu.png?resize=800%2C450&ssl=1 +[6]: https://itsfoss.com/synaptic-package-manager/ +[7]: https://itsfoss.com/open-terminal-ubuntu/ +[8]: https://itsfoss.com/wp-content/uploads/2021/09/remove-google-chrome-ubuntu.webp +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/google-chrome-ubuntu-leftover-settings.png?resize=800%2C518&ssl=1 +[10]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/remove-google-chrome-leftover-settings-from-Ubuntu.png?resize=800%2C277&ssl=1 +[12]: https://itsfoss.com/customize-linux-terminal/ diff --git a/published/202203/20210908 How I migrated a WordPress website to a new host.md b/published/202203/20210908 How I migrated a WordPress website to a new host.md new file mode 100644 index 0000000000..92f46cc919 --- /dev/null +++ b/published/202203/20210908 How I migrated a WordPress website to a new host.md @@ -0,0 +1,273 @@ +[#]: subject: "How I migrated a WordPress website to a new host" +[#]: via: "https://opensource.com/article/21/9/migrate-wordpress" +[#]: author: "David Both https://opensource.com/users/dboth" +[#]: collector: "lujun9972" +[#]: translator: "lxbwolf" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14371-1.html" + +如何把 WordPress 网站迁移到新主机 +====== + +> 使用这个简单的方法来迁移一个网站以及管理防火墙配置。 + +![(https://img.linux.net.cn/data/attachment/album/202203/19/124316krzvxcr4ff2kr2ji.jpg)] + +你有过把一个 WordPress 网站迁移到一台新主机上的需求吗?我曾经迁移过好多次,迁移过程相当简单。当然,的的市场时候我都不会用通用的推荐方法,这次也不例外 —— 我用更简单的方法,这才是我推荐的方法。 + +这个迁移方法没有破坏性,因此如果出于某些原因你需要还原到原来的服务器上,很容易可以实现。 + +### 一个 WordPress 网站的组成部分 + +运行一个基于 [WordPress][2] 的网站有三个重要组成部分:WordPress 本身,一个 web 服务器,如 [Apache][3](我正在用),以及 [MariaDB][4]。MariaDB 是 MySQL 的一个分支,功能相似。 + +业界有大量的 Web 服务器,由于我使用了 Apache 很长时间,因此我推荐用 Apache。你可能需要把 Apache 的配置方法改成你用的 Web 服务器的方法。 + +### 初始配置 + +我使用一台 Linux 主机作为防火墙和网络路由。在我的网络中 Web 服务器是另一台主机。我的内部网络使用的是 C 类私有网络地址范围,按 [无类别域间路由][5]Classless Internet Domain Routing(CIDR)方式简单地记作 192.168.0.0/24。 + +对于防火墙,相比于更复杂的 `firewalld`,我更喜欢用非常简单的 [IPTables][6]。这份防火墙配置中的一行会把 80 端口(HTTP)接收到的包发送给 Web 服务器。在 `/etc/sysconfig/iptables` 文件中,你可以在注释中看到,我添加了规则,把其他入站服务器连接转发到同一台服务器上合适的端口。 + +``` +# Reroute ports for inbound connections to the appropriate web/email/etc server. +# HTTPD goes to 192.168.0.75 +-A PREROUTING -d 45.20.209.41/255.255.255.248 -p tcp -m tcp --dport 80 \ + +  -j DNAT --to-destination 192.168.0.75:80 +``` + +我使用命名虚拟主机named virtual host来配置原来的 Apache Web 服务器,因为我在这个 HTTPD 实例上运行着多个网站。使用命名虚拟主机配置是个不错的方法,因为(像我一样)未来你可能会在运行其他的网站,这个方法可以使其变得容易。 + +`/etc/httpd/conf/httpd.conf` 中需要迁移的虚拟主机的网站相关部分请参考下面代码。这个片段中不涉及到 IP 地址的修改,因此在新服务器上使用时不需要修改。 + +``` + + ServerName www.website1.org + ServerAlias server.org + +DocumentRoot "/var/website1/html" + ErrorLog "logs/error_log" + ServerAdmin me@website1.org + + + Options Indexes FollowSymLinks + +AllowOverride None + Require all granted + + + +``` + +在迁移之前,你需要在 `httpd.conf` 的最顶端附近找到 `Listen` 声明并修改成类似下面这样。这个地址是服务器的真实私有 IP 地址,不是公开 IP 地址。 + +``` +Listen 192.168.0.75:80 +``` + +你需要修改新主机上 `Listen` 的 IP 地址。 + +### 前期工作 + +准备工作分为以下三步: + + * 安装服务 + * 配置防火墙 + * 配置 web 服务器 + +#### 安装 Apache 和 MariaDB + +如果你的新服务器上还没有 Apache 和 MariaDB,那么就安装它们。WordPress 的安装不是必要的。 + +``` +dnf -y install httpd mariadb +``` + +#### 新服务器防火墙配置 + +确认下新服务器上的防火墙允许访问 80 端口。你_每台_电脑上都有一个防火墙,对吗?大部分现代发行版使用的初始化配置包含的防火墙会阻止所有进来的网络流量,以此来提高安全等级。 + +下面片段的第一行内容可能已经在你的 IPTables 或其他基于防火墙的网络过滤器中存在了。它标识已经被识别为来自可接受来源的入站包,并绕过后面的其它 INPUT 过滤规则,这样可以节省时间和 CPU 周期。片段中最后一行标识并放行 80 端口新进来的请求到 HTTPD 的连接。 + +``` +-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT +<删节> +# HTTP +-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT +``` + +下面的示例 `/etc/sysconfig/iptables` 文件是 IPTables 最少规则的例子,可以允许 SSH(端口 22)和 HTTPD(端口 80)连接。 + +``` +*filter +:INPUT ACCEPT [0:0] +:FORWARD ACCEPT [0:0] +:OUTPUT ACCEPT [0:0] +-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT +-A INPUT -p icmp -j ACCEPT +-A INPUT -i lo -j ACCEPT +# SSHD +-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT +# HTTP +-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT + +# Final disposition for unmatched packets +-A INPUT -j REJECT --reject-with icmp-host-prohibited +-A FORWARD -j REJECT --reject-with icmp-host-prohibited +COMMIT +``` + +在新服务器主机上我需要做的就是在 `/etc/sysconfig/iptables` 文件的防火墙规则里添加上面片段的最后一行,然后重新加载修改后的规则集。 + +``` +iptables-restore /etc/sysconfig/iptables +``` + +大部分基于红帽的发行版本,如 Fedora,使用的是 `firewalld`。我发现对于它的适用场景(如家用、小到中型企业)而言,它过于复杂,因此我不用它。我建议你参照 [firewalld 网页][9] 来向 `firewalld` 添加入站端口 80。 + +你的防火墙及其配置可能跟这个有些差异,但最终的目的是允许新 Web 服务器 80 端口接收 HTTPD 连接。 + +#### HTTPD 配置 + +在 `/etc/httpd/conf/httpd.conf` 文件中配置 HTTPD。像下面一样在 `Listen` 片段中设置 IP 地址。我的新 Web 服务器 IP 地址是 `192.168.0.125`。 + +``` +Listen 192.168.0.125:80 +``` + +复制(对应要迁移的网站的) `VirtualHost` 片段,粘贴到新服务器上 `httpd.conf` 文件的末尾。 + +### 迁移过程 + +只有两组数据需要迁移到新服务器 —— 数据库本身和网站目录结构。把两个目录打包成 `tar` 文档。 + +``` +cd /var ; tar -cvf /tmp/website.tar website1/ +cd /var/lib ; tar -cvf /tmp/database.tar mysql/ +``` + +把两个 tar 文件复制到新服务器。我通常会把这类文件放到 `/tmp` 下,这个目录就是用来做这种事的。在新服务器上运行下面的命令,把 tar 文档解压到正确的目录。 + +``` +cd /var ; tar -xvf /tmp/website.tar +cd /var/lib ; tar -xvf /tmp/database.tar +``` + +WordPress 的所有文件都在 `/var/website1` 下,因此不需要在新服务器上安装它。新服务器上不需要执行 WordPress 安装过程。 + +这个目录就是需要迁移到新服务器上的全部内容。 + +最后一步是启动(或重启)`mysqld` 和 `httpd` 服务守护进程。WrodPress 不是一个服务,因此不使用守护进程的方式来启动。 + +``` +systemctl start mysqld ; systemctl start httpd +``` + +启动之后,你应该检查下这些服务的状态。 + +``` +systemctl status mysqld +● mariadb.service - MariaDB 10.5 database server + Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) + Active: active (running) since Sat 2021-08-21 14:03:44 EDT; 4 days ago + Docs: man:mariadbd(8) + +https://mariadb.com/kb/en/library/systemd/ + Process: 251783 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS) + Process: 251805 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS) + Process: 251856 ExecStartPost=/usr/libexec/mariadb-check-upgrade (code=exited, status=0/SUCCESS) + Main PID: 251841 (mariadbd) + Status: "Taking your SQL requests now..." + Tasks: 15 (limit: 19003) + Memory: 131.8M + CPU: 1min 31.793s + CGroup: /system.slice/mariadb.service +└─251841 /usr/libexec/mariadbd --basedir=/usr + +Aug 21 14:03:43 simba.stmarks-ral.org systemd[1]: Starting MariaDB 10.5 database server... +Aug 21 14:03:43 simba.stmarks-ral.org mariadb-prepare-db-dir[251805]: Database MariaDB is probably initialized in /var/lib/mysql already, n> +Aug 21 14:03:43 simba.stmarks-ral.org mariadb-prepare-db-dir[251805]: If this is not the case, make sure the /var/lib/mysql is empty before> +Aug 21 14:03:44 simba.stmarks-ral.org mariadbd[251841]: 2021-08-21 14:03:44 0 [Note] /usr/libexec/mariadbd (mysqld 10.5.11-MariaDB) startin> +Aug 21 14:03:44 simba.stmarks-ral.org systemd[1]: Started MariaDB 10.5 database server. + +systemctl status httpd +● httpd.service - The Apache HTTP Server + Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) + Drop-In: /usr/lib/systemd/system/httpd.service.d +└─php-fpm.conf + Active: active (running) since Sat 2021-08-21 14:08:39 EDT; 4 days ago + Docs: man:httpd.service(8) + Main PID: 252458 (httpd) + Status: "Total requests: 10340; Idle/Busy workers 100/0;Requests/sec: 0.0294; Bytes served/sec: 616 B/sec" + Tasks: 278 (limit: 19003) + Memory: 44.7M + CPU: 2min 31.603s + CGroup: /system.slice/httpd.service +├─252458 /usr/sbin/httpd -DFOREGROUND +├─252459 /usr/sbin/httpd -DFOREGROUND +├─252460 /usr/sbin/httpd -DFOREGROUND +├─252461 /usr/sbin/httpd -DFOREGROUND +├─252462 /usr/sbin/httpd -DFOREGROUND +└─252676 /usr/sbin/httpd -DFOREGROUND + +Aug 21 14:08:39 simba.stmarks-ral.org systemd[1]: Starting The Apache HTTP Server... +Aug 21 14:08:39 simba.stmarks-ral.org httpd[252458]: AH00112: Warning: DocumentRoot [/var/teststmarks-ral/html] does not exist +Aug 21 14:08:39 simba.stmarks-ral.org httpd[252458]: Server configured, listening on: port 80 +Aug 21 14:08:39 simba.stmarks-ral.org systemd[1]: Started The Apache HTTP Server. +``` + +### 最终的修改 + +现在所需的服务都已经运行了,你可以把 `/etc/sysconfig/iptables` 文件中 HTTDP 的防火墙规则改成下面的样子: + +``` +-A PREROUTING -d 45.20.209.41/255.255.255.248 -p tcp -m tcp --dport 80 \ +  -j DNAT --to-destination 192.168.0.125:80 +``` + +然后重新加载设置的 IPTables 规则。 + +``` +iptables-restore /etc/sysconfig/iptables +``` + +由于防火墙规则是在防火墙主机上,因此不需要把外部 DNS 入口改成指向新服务器。如果你使用的是内部 DNS 服务器,那么你需要把 IP 地址改成内部 DNS 数据库里的 A 记录。如果你没有用内部 DNS 服务器,那么请确保主机 `/etc/hosts` 文件里新服务器地址设置得没有问题。 + +### 测试和清理 + +请确保对新配置进行测试。首先,停止旧服务器上的 `mysqld` 和 `httpd` 服务。然后通过浏览器访问网站。如果一切符合预期,那么你可以关掉旧服务器上的 `mysqld` 和 `httpd`。如果有失败,你可以把 IPTables 的路由规则改回去到旧服务器上,直到问题解决。 + +之后我把 MySQL 和 HTTPD 从旧服务器上删除了,这样来确保它们不会意外地被启动。 + +### 总结 + +就是这么简单。不需要执行数据库导出和导入的过程,因为 `mysql` 目录下所有需要的东西都已经复制过去了。需要执行导出/导入过程的场景是:有网站自己的数据库之外的数据库;MariaDB 实例上还有其他网站,而你不想把这些网站复制到新服务器上。 + +迁移旧服务器上的其他网站也很容易。其他网站依赖的所有数据库都已经随着 MariaDB 的迁移被转移到了新服务器上。你只需要把 `/var/website` 目录迁移到新服务器,添加合适的虚拟主机片段,然后重启 HTTPD。 + +我遵循这个过程把很多个网站从一个服务器迁移到另一个服务器,每次都没有问题。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/migrate-wordpress + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 "Text editor on a browser, in blue" +[2]: https://wordpress.org/ +[3]: https://opensource.com/article/18/2/how-configure-apache-web-server +[4]: https://mariadb.org/ +[5]: https://opensource.com/article/16/12/cidr-network-notation-configuration-linux +[6]: https://en.wikipedia.org/wiki/Iptables +[7]: http://www.website1.org +[8]: mailto:me@website1.org +[9]: https://firewalld.org/documentation/howto/open-a-port-or-service.html diff --git a/published/202203/20210928 What is port forwarding.md b/published/202203/20210928 What is port forwarding.md new file mode 100644 index 0000000000..58e6211aea --- /dev/null +++ b/published/202203/20210928 What is port forwarding.md @@ -0,0 +1,99 @@ +[#]: subject: "What is port forwarding?" +[#]: via: "https://opensource.com/article/21/9/what-port-forwarding" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14415-1.html" + +端口转发简介 +====== + +> 本文介绍了几种端口转发最常见的使用场景。 + +![](https://img.linux.net.cn/data/attachment/album/202203/31/085031ezq55gmy15n5mgll.jpg) + +端口转发就是把网络流量从一个网络监听者(称为一个“端口”)发送到另一个上,无论这两个端口是否属于同一台电脑。在这里,端口不是某个物理实体,而是一个监听网络活动的软件程序。 + +当流量被定向发往到某个特定的端口,它会先到达一个路由器或是防火墙,亦或是其他的网络程序。它最终收到的响应可能会根据它想要通讯的端口来定义。比如,当你使用端口转发时,你可以捕获到发往 8080 端口的流量,然后把它转发到 80 端口。对于接收信号的原端口来说,这个新的目标端口可能和它在同一台设备上,也可能是在另一台设备上。我们在很多情况下都会用到端口转发,实现的方式也有很多。本文将介绍其中最常见的几种使用场景。 + +### 使用路由器来进行端口转发 + +如果你在把服务器架设在家里,那么你通常是不需要转发端口的。你的家庭路由器(通常是你从网络服务提供商Internet Service Provider(ISP)获得的 WiFi 设备)有一个内置的防火墙,它的作用是阻止外面的世界访问到你的家庭网络。通过使用端口转发,你可以允许某个指定端口的流量穿过路由器的防火墙,并发送到局域网中的某个指定的 IP 地址。 + +比如说,你架设了一个 [Minetest 服务][2],并想要邀请你的朋友们来试试。为了让他们能够“穿过”你的路由器,从而到达这个 Minetest 服务,你必须把路由器上的某个端口转发到托管 Minetest 服务的电脑上。Minetest 服务默认运行在 30000 端口。你可以把路由器的 30000 端口转发到你的电脑的 30000 端口上,或者你也可以随便转发到一个更简单的端口上,这样玩家们会更容易记住它。我发现,当使用 30000 端口的时候,人们时常会少数几个 0(特别是没有逗号分隔符的帮助时),所以我一般使用路由器的 1234 端口,然后把它转发到我内部的 30000 端口。 + +每个制造商的路由器接口都不一样,但是不管你用的是什么牌子的路由器,方法都是相同的。首先,你需要登录到你的路由器。 + +通常,路由器的 IP 地址和登录信息都会打印在路由器上,或者在是它的文档里。我有一个型号为 TP-Link GX90 的路由器,我在浏览器里访问 10.0.1.1 就可以登录它,但你的路由器可能是 192.168.0.1 或者其他的地址。 + +我的 GX90 路由器把端口转发功能称为“虚拟服务器virtual servers”,它是路由器的“NAT 转发”标签下的一个功能选项。NAT 的意思是 “网络地址转换Network Address Translation”。在其他路由器中,这个功能可能直接就叫做“端口转发”,或者叫“防火墙”、“服务”等。找到正确的功能选项可能需要花费一些时间,因此,你可能需要花点时间研究下你的路由器文档。 + +当你找到了路由器的端口转发设置,添加一个新规则,命名一个外部端口(在我的例子中是 1234)和一个内部端口(30000)。把外部端口转发到内部端口上,而内部端口绑定在你想要大家访问的电脑的 IP 地址上。如果你需要一些查询本机 IP 地址的帮助,你可以阅读 Archit Modi 写的 《[在 Linux 上如何查询本地 IP 地址][3]》。 + +![A sample port forwarding rule][4] + +*一个简单端口转发规则* + +(图片提供者是 Seth Kenlon,遵循 [署名-相同方式共享 4.0 国际][5] 协议) + +在这个例子中,访问家庭网络的 1234 端口的流量,都会被转发到了我的家庭服务器的 30000 端口上,后者的 IP 地址是 10.0.1.2。 + +在继续之前,先保存这个规则。 + +接下来,你需要知道你的家庭网络的公网 IP 地址是多少。你可以从 [ifconfig.me][6] 或者 [icanhazip.com][7] 上获得这个地址。你可以在浏览器中打开这两个网站的其中一个,也可以使用 [curl][8] 命令来获取到这个 IP。 + +``` +$ curl ifconfig.me +93.184.216.34 +``` + +现在,你的朋友们就可以在 Minetest 客户端里输入 `169.169.23.49:1234`,加入你的 Minetest 服务器啦。 + +### 使用防火墙来进行端口转发 + +系统管理员有时候需要转发访问服务器的流量。比如说,你可能想要接收来自 80 端口的流量,但是用户的服务却运行在 8065 端口。如果不进行端口转发的话,你的用户就不得不在输入浏览器的 URL 末尾,加上一个指定的端口号,例如 `example.com:8065`。大多数用户都不习惯于考虑端口的问题,所以你需要把访问网络通用的 80 端口的请求拦截下来,然后转发到你的网络应用的具体端口,这会给用户带来巨大的方便。 + +你可以在服务器上使用 [firewall-cmd][9] 来转发流量,它是访问 `firewalld` 后台进程的前端front-end命令。 + +首先,设置好你想要转发的端口和协议: + +``` +$ sudo firewall-cmd \ + --add-forward-port \ + port=80:proto=tcp:toport=8065 +``` + +为使修改永久生效,你需要加上 `--runtime-to-permanent` 选项: + +``` +$ sudo firewall-cmd --runtime-to-permanent +``` + +### 网络转发 + +在网络传输中,除了端口转发外,还有其他种类的转发forwarding形式,例如 IP 转发和代理等。当你熟悉了网络信息在路由时是怎么被处理的之后,你可以试试不同的转发形式(然后使用 `tcpdump` 或类似的工具)来看看哪一种最好、最符合你的需求。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/what-port-forwarding + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/connections_wires_sysadmin_cable.png?itok=d5WqHmnJ (Multi-colored and directional network computer cables) +[2]: https://opensource.com/alternatives/minecraft#minetest +[3]: https://opensource.com/article/18/5/how-find-ip-address-linux +[4]: https://opensource.com/sites/default/files/uploads/router-port-forward.jpg (A sample port forwarding rule) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: http://ifconfig.me +[7]: http://icanhazip.com +[8]: https://opensource.com/article/20/5/curl-cheat-sheet +[9]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd diff --git a/published/20211204 How to Install and Use Latte Dock on Ubuntu and Other Linux Distributions.md b/published/202203/20211204 How to Install and Use Latte Dock on Ubuntu and Other Linux Distributions.md similarity index 100% rename from published/20211204 How to Install and Use Latte Dock on Ubuntu and Other Linux Distributions.md rename to published/202203/20211204 How to Install and Use Latte Dock on Ubuntu and Other Linux Distributions.md diff --git a/published/20211208 Vanilla Vim is fun.md b/published/202203/20211208 Vanilla Vim is fun.md similarity index 100% rename from published/20211208 Vanilla Vim is fun.md rename to published/202203/20211208 Vanilla Vim is fun.md diff --git a/published/20220103 13 examples of how DevOps facilitated transformation in 2021.md b/published/202203/20220103 13 examples of how DevOps facilitated transformation in 2021.md similarity index 100% rename from published/20220103 13 examples of how DevOps facilitated transformation in 2021.md rename to published/202203/20220103 13 examples of how DevOps facilitated transformation in 2021.md diff --git a/published/202203/20220121 What you need to know about fuzz testing and Go.md b/published/202203/20220121 What you need to know about fuzz testing and Go.md new file mode 100644 index 0000000000..ac4f6733f9 --- /dev/null +++ b/published/202203/20220121 What you need to know about fuzz testing and Go.md @@ -0,0 +1,146 @@ +[#]: subject: "What you need to know about fuzz testing and Go" +[#]: via: "https://opensource.com/article/22/1/native-go-fuzz-testing" +[#]: author: "Gaurav Kamathe https://opensource.com/users/gkamathe" +[#]: collector: "lujun9972" +[#]: translator: "lxbwolf" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14367-1.html" + +你需要了解的 Go 中的模糊测试 +====== + +> Go 团队接受了新增对模糊测试的支持的提议。 + +![](https://img.linux.net.cn/data/attachment/album/202203/18/103123drbhbozibvt0vtib.jpg) + +[Go][2] 的应用越来越广泛。现在它是云原生软件、容器软件、命令行工具和数据库等等的首选语言。Go 很早之前就已经有了内建的 [对测试的支持][3]。这使得写测试代码和运行都相当简单。 + +### 什么是模糊测试? + +模糊测试fuzz testing(fuzzing)是指向你的软件输入非预期的数据。理想情况下,这种测试会让你的应用程序崩溃或有非预期的表现。抛开最终的结果,从程序对非预期的输入数据的处理结果中你可以得到很多信息,这样你就可以增加一些合适的错误处理。 + +任何一个软件都有对不同来源的输入或数据的接收说明,软件会对这些数据进行处理并返回适当的结果。软件开发后,测试工程师团队对其进行测试,找出软件中的错误,给出测试报告,并(由开发者)修复。通常测试的目的是验证软件的行为是否符合预期。测试又可以细分为不同的类型,如功能测试、集成测试、性能测试等等。每种测试方法关注软件功能的某一个方面,以便发现错误或者提升可靠性或性能。 + +模糊测试在这一测试过程上更进一步,尝试向软件程序输入一些“无效”或“随机”的数据。这种输入是故意的,期望得到的结果就是程序崩溃或输出异常,这样就可以暴露程序中的错误以便由开发者来修复它们。与其他测试类似,很少需要手动进行模糊测试,业界有大量的模糊测试工具可以将这个过程自动化。 + +### Go 中的软件测试 + +举个例子,假如你想测试 `add.go` 中的 `Add()` 函数,你可以在 `add_test.go` 中导入 `testing` 包并把测试体写在以 `TestXXX()` 开头的函数内。 + +考虑如下代码: + +``` +func Add(num1, num2 int) int { +} +``` + +在 `add_test.go` 文件中,你可能有如下测试代码: + +``` +import "testing" + +func TestAdd(t *testing.T) { +} +``` + +运行测试: + +``` +$ go test +``` + +### 新增对模糊测试的支持 + +Go 团队已经接受了 [新增对模糊测试的支持的提议][4],以进一步推动这项工作。这涉及到新增一个 `testing.F` 类型,在 `_test.go` 文件中新增 `FuzzXXX()` 函数,在 Go 工具中会新增一个 `-fuzz` 选项来执行这些测试。 + +在 `add_test.go` 文件中: + +``` +func FuzzAdd(f *testing.F) { +} +``` + +执行以下代码: + +``` +$ go test -fuzz +``` + +在本文编写时,这个 [功能还是试验性的][5],但是应该会在 1.18 发布版本中包含。(LCTT 译注:[Go 1.18][14] 刚刚发布,已经包含了对模糊测试的支持)目前很多功能如 `-keepfuzzing`、`-race` 等也还没有支持。Go 团队最近发布了一篇 [模糊测试教程][6],值得读一下。 + +### 安装 gotip 来获取最新的功能 + +如果你极度渴望在正式发布之前尝试这些功能,你可以使用 `gotip` 来测试即将正式发布的 Go 功能并反馈给他们。你可以使用下面的命令来安装 `gotip`。安装之后,你可以用 `gotip` 程序代替以前的 `go` 程序来编译和运行程序。 + +``` +$ go install golang.org/dl/gotip@latest +$ gotip download + +$ gotip version +go version devel go1.18-f009910 Thu Jan 6 16:22:21 2022 +0000 linux/amd64 +``` + +### 社区对于模糊测试的观点 + +软件社区中经常会讨论模糊测试,不同的人对模糊测试有不同的看法。有些人认为这是一种有用的技术,可以找到错误,尤其是在安全方面。然而考虑到模糊测试所需要的资源(CPU、内存),有人就认为这是一种浪费,而他们更愿意用其他的测试方法。即使在 Go 团队内部,意见也不统一。我们可以看到 Go 的联合创始人 Rob Pike 对模糊测试的使用和在 Go 中的实现是持轻微的怀疑态度的。 + +> ..._虽然模糊测试有助于发现某类错误,但是它会占用大量的 CPU 和存储资源,并且效益成本比率也不明确。我担心为了写模糊测试浪费精力,或者 git 仓库中充斥大量无用的测试数据_ +> +> ~[Rob Pike][7] + +然而,Go 安全团队的另一个成员,Filo Sottile,似乎对 Go 新增支持模糊测试很乐观,举了很多例子来支持,也希望模糊测试能成为开发过程中的一部分。 + +> _我想说模糊测试可以发现极端情况下的错误。这是我们作为安全团队对其感兴趣的原因:在极端情况下发现的错误可以避免在生产环境中成为弱点。_ +> +> _我们希望模糊测试能成为开发的一部分 —— 不只是构建或安全方面 —— 而是整个开发过程:它能提升相关代码的质量..._ +> +> ~[Filo Sottile][8] + +### 现实中的模糊测试 + +对我而言,模糊测试在发现错误以及让系统变得更安全和更有弹性方面似乎非常有效。举个例子,Linux 内核也会使用名为 [syzkaller][9] 的工具进行模糊测试,这个工具已经发现了 [大量][10] 错误。 + +[AFL][11] 也是比较流行的模糊测试工具,用来测试 C/C++ 写的程序。 + +之前也有对 Go 程序进行模糊测试的观点,其中之一就是 Filo 在 GitHub 评论中提到的 [go-fuzz][12]。 + +> _go-fuzz 的记录提供了相当惊人的证据,证明模糊处理能很好地找到人类没有发现的错误。根据我的经验,我们只需要消耗一点点 CPU 的时间就可以得到极端情况下非常高效的测试结果。_ + +### 为什么在 Go 中新增对模糊测试的原生支持 + +如果我们的需求是对 Go 程序进行模糊测试,之前的工具像 `go-fuzz` 就可以完成,那么为什么要在这种语言中增加原生支持呢?[Go 模糊测试设计草案][13] 中说明了这样做的一些根本原因。设计的思路是让开发过程更简单,因为前面说的工具增加了开发者的工作量,还有功能缺失。如果你没有接触过模糊测试,那么我建议你读一下设计草案文档。 + +> 开发者可以使用诸如 `go-fuzz` 或 `fzgo`(基于 `go-fuzz`)来解决某些需求。然而,已有的每种解决方案都需要在典型的 Go 测试上做更多的事,而且还缺少关键的功能。相比于其他的 Go 测试(如基准测试和单元测试),模糊测试不应该比它们复杂,功能也不应该比它们少。已有的解决方案增加了额外的开销,比如自定义命令行工具。 + +### 模糊测试工具 + +在大家期望 Go 语言新增功能的列表中,模糊测试是其中很受欢迎的一项。虽然现在还是试验性的,但在将要到来的发布版本中会变得更强大。这给了我们足够的时间去尝试它以及探索它的使用场景。我们不应该把它视为一种开销,如果使用得当它会是一种发现错误非常高效的测试工具。使用 Go 的团队应该推动它的使用,开发者可以写简单的模糊测试,测试团队去慢慢扩展以此来使用它全部的能力。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/1/native-go-fuzz-testing + +作者:[Gaurav Kamathe][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gkamathe +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD "Person using a laptop" +[2]: https://go.dev/ +[3]: https://pkg.go.dev/testing +[4]: https://github.com/golang/go/issues/44551 +[5]: https://go.dev/blog/fuzz-beta +[6]: https://go.dev/doc/tutorial/fuzz +[7]: https://github.com/golang/go/issues/44551#issuecomment-784584785 +[8]: https://github.com/golang/go/issues/44551#issuecomment-784655571 +[9]: https://github.com/google/syzkaller +[10]: https://github.com/google/syzkaller/blob/master/docs/linux/found_bugs.md +[11]: https://github.com/google/AFL +[12]: https://github.com/dvyukov/go-fuzz +[13]: https://go.googlesource.com/proposal/+/master/design/draft-fuzzing.md +[14]: https://go.dev/blog/go1.18 \ No newline at end of file diff --git a/published/202203/20220125 Creating and initializing lists in Java and Groovy.md b/published/202203/20220125 Creating and initializing lists in Java and Groovy.md new file mode 100644 index 0000000000..3e60c8f19e --- /dev/null +++ b/published/202203/20220125 Creating and initializing lists in Java and Groovy.md @@ -0,0 +1,171 @@ +[#]: subject: "Creating and initializing lists in Java and Groovy" +[#]: via: "https://opensource.com/article/22/1/creating-lists-groovy-java" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14411-1.html" + +在 Java 和 Groovy 中创建和初始化列表的不同 +====== + +> 首先在 Java 中创建初始化一个整数列表,然后在 Groovy 中做同样的事。 + +![](https://img.linux.net.cn/data/attachment/album/202203/29/214023b4r9rauua1gjp59l.jpg) + +我非常喜欢 [Groovy 编程语言][2]。我喜欢它是因为我喜欢 Java,尽管 Java 有时候感觉很笨拙。正因为我是那么喜欢 Java,其他运行在 JVM 上语言都不能吸引我。比方说 Kotlin、Scala 还有 Clojure 语言,它们感觉上就和 Java 不一样,因为它们对于什么是好的编程语言的理解不同。Groovy 和它们都不一样,在我看来,Groovy 是一个完美的选项,特别是对于一部分程序员来说,他们喜欢 Java,但是又需要一个更灵活、更紧凑,并且有时候更直接的语言。 + +列表List 这种数据结构是一个很好的例子,它可以容纳一个无序的列表,列表中的元素可以是数字、字符串或者对象,程序员可以用某种方式高效地遍历这些元素,特别是对于编写和维护脚本的人来说,“高效”的关键就是要有简洁清晰的表达,而不需要一大堆“仪式”,把代码的意图都变模糊了。 + +### 安装 Java 和 Groovy + +Groovy 是基于 Java 的,因此需要同时安装一个 Java 才行。你的 Linux 发行版的仓库中可能有最近的比较好的 Java 版本。或者,你也可以在根据 [这些指导][3] 来安装 Groovy。对于 Linux 用户来说,SDKMan 是一个不错的代替选项,你可以使用它来获取多个 Java 和 Groovy 版本,以及许多其他的相关工具。在这篇文章中,我使用的 SDK 发行版是: + + * Java: OpenJDK 11 的 11.0.12-open 版本 + * Groovy: 3.0.8 版本 + +### 言归正传 + +Java 中有很多方法可以实例化并初始化列表,从它最初被引入的时候就有了(我记得是在 Java 1.5 的时候,但请不要引用我的话)。在这些方法里,有两个有趣的方法,它们涉及到了 `java.util.Arrays` 和 `java.util.List` 这两个类。 + +#### 使用 java.util.Arrays 类 + +`java.util.Arrays` 类定义了一个 `asList()` 静态方法,它可以被用来创建一个基于数组的列表,因此大小是不可变的,尽管其中的元素是可以被修改的。下面是它的使用方式: + + +``` +var a1 = Arrays.asList(1,2,3,4,5,6,7,8,9,10); // immutable list of mutable elements + +System.out.println("a1 = " + a1); +System.out.println("a1 is an instance of " + a1.getClass()); + +// output is +// a1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] +// a1 is an instance of class java.util.Arrays$ArrayList + +a1.set(0,0); // succeeds +System.out.println("a1 = " + a1); // output is +// a1 = [0, 2, 3, 4, 5, 6, 7, 8, 9, 10] + +a1.add(11); // fails producing +// Exception in thread "main" java.lang.UnsupportedOperationException +System.out.println("a1 = " + a1); // not reached +``` + +#### 使用 java.util.List 类 + +`java.util.List` 类定义了一个 `of()` 静态方法,它可以被用来创建一个不可变的列表,其中的元素是否可变要取决于它们本身是否支持修改。下面是它的使用方式: + +``` +var a2 = List.of(1,2,3,4,5,6,7,8,9,10); + +System.out.println("a2 = " + a2); +System.out.println("a2 is an instance of " + a2.getClass()); + +// output is +// a2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] +// a2 is an instance of class java.util.ImmutableCollections$ListN + +a2.set(0,0); // fails producing +// Exception in thread "main" java.lang.UnsupportedOperationException +System.out.println("a2 = " + a2); // not reached + +a2.add(11); // also fails for same reason if above two lines commented out +System.out.println("a2 = " + a2); // not reached +``` + +因此,我可以使用 `Arrays.asList()`,也可以使用 `List.of()` 方法,前提是如果我想要的是一个大小不能改变、且不关心元素是否可变的列表。 + +如果我想要初始化一个可变的列表,我更倾向于把这些不可变的列表作为参数传给一个列表构造器,就像下面这样: + + +``` +var a1 = new ArrayList(Arrays.asList(1,2,3,4,5,6,7,8,9,10)); + +System.out.println("a1 = " + a1); +System.out.println("a1 is an instance of " + a1.getClass()); + +// output is +// a1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] +// a1 is an instance of class java.util.ArrayList + +a1.set(0,0); +System.out.println("a1 = " + a1); + +//output is +// a1 = [0, 2, 3, 4, 5, 6, 7, 8, 9, 10] + +a1.add(11); +System.out.println("a1 = " + a1); + +// output is +// a1 = [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] +``` + +注意,这个 `Arrays.asList()` 方法是用来初始化这个新的 `ArrayList()` 的,也就是说,它为这个传进来的列表创建了一个可变的拷贝。 + +现在,或许只有我这么想,但是这种方式确实看起来需要理解很多关于 `java.util.Arrays` 和 `java.util.List` 类的细节才行,而我只是想要创建并初始化一个数字列表而已(尽管真正使用到的语句并没有太多“仪式”)。下面是真正用到的那行代码,仅供参考: + +``` +var a1 = new ArrayList(Arrays.asList(1,2,3,4,5,6,7,8,9,10)); +``` + +### Groovy 是怎么做的 + +下面来看看在 Groovy 中如何实现上述需求: + +``` +def a1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + +println "a1 = $a1" +println "a1 is an instance of ${a1.getClass()}" + +// output is +// a1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] +// a1 is an instance of class java.util.ArrayList + +a1[0] = 0 +println "a1 = $a1" + +// output is +// a1 = [0, 2, 3, 4, 5, 6, 7, 8, 9, 10] + +a1 << 11 +println "a1 = $a1" + +// output is +// a1 = [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] +``` + +我们一眼就能发现,Groovy 使用了 `def` 关键字而不是 `var` 关键字。我还发现了,仅仅是把一系列的类型(在这个例子里是整数)放进括号里,我就得到了一个创建好的列表。此外,这样创建出来的列表完全就是我想要的:一个可变的 `ArrayList` 实例。 + +现在,或许再一次只有我这么想,但是上面的代码看起来要简单多得多 —— 不用记住 `.of()` 和 `.asList()` 返回的是“半不变semi-mutable”的结果,也不用为它们做一些补偿。另外一个好处是,我现在可以使用括号和下标来引用列表中的某个特定元素,而不用这个叫 `set()` 方法。另外,这个跟在列表后面的 `<<` 操作符也很方便,我再也不用调用 `add()` 方法来添加元素啦。还有,你注意到代码中没有分号了吗?没错,在 Groovy 里,句末的分号并不是必须的。最后,我们来看看字符串插值,只要在字符串里用 `$变量` 或者 `${表达式}` 就可以实现了哦! + +在 Groovy 世界中还藏着许多“有待发掘”的东西。上面的列表定义其实是一个动态类型(Groovy 中默认)和 Java 中的静态类型的对比。在上面的 Groovy 代码定义的那一行,变量 `a1` 的类型是在运行的时候,根据等号右边的表达式的计算结果推断出来的。现在我们都知道,动态语言可以给我们带来强大的功能,有了强大的功能,我们有了很多机会去尝试不同的东西。对于那些不喜欢动态类型的程序员来说,Groovy 也支持静态类型。 + +### Groovy 相关资源 + +Apache Groovy 网站上有非常多的文档。另一个很棒的 Groovy 资源是 [Mr. Haki][7]。学习 Groovy 还有一个很棒的原因,那就是可以接着学习 [Grails][8],后者是一个优秀的、高效率的全栈 Web 框架,基于许多优秀组件构建而成,比如有 Hibernate、Spring Boot 和 Micronaut 等。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/1/creating-lists-groovy-java + +作者:[Chris Hermansen][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[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]: http://www.groovy-lang.org/ +[3]: http://www.groovy-lang.org/install.html +[4]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+arrays +[5]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system +[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+list +[7]: https://www.mrhaki.com/ +[8]: https://grails.org/ diff --git a/published/20220218 Add, switch, delete, and manage Linux users in KDE.md b/published/202203/20220218 Add, switch, delete, and manage Linux users in KDE.md similarity index 100% rename from published/20220218 Add, switch, delete, and manage Linux users in KDE.md rename to published/202203/20220218 Add, switch, delete, and manage Linux users in KDE.md diff --git a/published/202203/20220221 6 Reasons to Try Nitrux OS.md b/published/202203/20220221 6 Reasons to Try Nitrux OS.md new file mode 100644 index 0000000000..d113e1dc73 --- /dev/null +++ b/published/202203/20220221 6 Reasons to Try Nitrux OS.md @@ -0,0 +1,151 @@ +[#]: subject: "6 Reasons to Try Nitrux OS" +[#]: via: "https://news.itsfoss.com/reasons-to-try-nitrux-os/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "aREversez" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14359-1.html" + +尝试 Nitrux 系统的六大理由 +====== + +> Nitrux OS 是一个基于 Debian 的有趣的 Linux 发行版。还没有试过吗?我认为你应该试试。 + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/02/nitrux-os-try.jpg?w=1200&ssl=1) + +Nitrux 系统也许算不上 Linux 的主流发行版本之一,但它绝对是一款极其独特的产品。 + +2019 年,我们 [采访了 Nitrux 的创始人 Uri Herrera][1],了解到 Herrera 等人开发这款系统的初衷:超越传统的 Linux 发行版。 + +自那之后,过了许久,我们终于迎来了 [Nitrux 2.0 版本][2]。 + +不要忘了,Nitrux 在去年 [放弃基于 Ubuntu,而选择了 Debian][3]。 + +考虑到自 Nitrux 发行以来的数年间,也发生了许多变化,你应该尝试一下这款系统。 + +这里,我要分享一些体验 [Nitrux 系统][4] 的理由: + +### 1、Nitrux 不再基于 Ubuntu + +![][5] + +人们一般都会推荐基于 Ubuntu 的 Linux 发行版本,来满足日常所需。 + +当然,在我们 [为新手推荐的 Linux 系统][6] 中,也主要是许多基于 Ubuntu 的版本,但是请不要误会。 + +我们之所以推荐基于 Ubuntu 的发行版本,唯一的理由在于它们简单易用,支持大量的商业软件。 + +所以,如果你不是刚开始使用 Linux 系统,同时也想尝试既能让你耳目一新,又不至于使你感到陌生,而且十分稳定的发行版,基于 Debian 的 Nirtux 是一个不错的选择。 + +你完全不需要在短期内迅速了解这款系统,就可以得心应手地使用终端来完成各项工作。 + +感兴趣的话,可以参考我们的文章 [Debian vs Ubuntu][7],了解更多。 + +### 2、专注 AppImage + +![][5a] + +[AppImage][8] 是一个通用的打包系统,这种软件包不需要任何依赖。你不需要在 Linux 上安装任何软件包管理器或者依赖包,就可以直接运行 AppImage 应用。 + +AppImage 旨在打造便携、高效的软件包系统,省去安装的步骤,与 Windows 系统的便携版软件非常相似。 + +Nitrux 操作系统专注 AppImage 应用软件,为你带来流畅的用户体验。 + +NX 软件中心是一个 GUI 程序,用户可以通过使用 Mauikit(该软件中心的 UI 框架),安装、管理 AppImage 应用程序。 + +### 3、基于 KDE 桌面环境的发行版 + +![][5b] + +Nitrux 操作系统是 [搭载 KDE 桌面环境中最好的 Linux 发行版][9] 之一。 如果你不喜欢 GNOME 或者其他开箱即用的桌面环境(DE),KDE 会是一个不错的选择。 + +也许你还不知道, 相较于其他桌面环境,[KDE 可以在很多方面进行定制][10]。 + +因此,在 KDE 桌面环境下,你可以毫不费力地打造自己的个性化桌面。 + +### 4、独特的用户体验 + +![][11] + +Nitrux 的用户体验结合了最好的 KDE 桌面环境与 Qt 技术,并对这些进行了调整,为你带来全新的用户体验。 + +虽然在使用 Nitrux 操作系统时,你不会觉得十分陌生,但是还是会感到有些许的不同。 + +即使你没有对 Nitrux 系统做任何自定义的设置,开箱即用的体验也足以让它成为 [最优雅的发行版][12] 之一。 + +### 5、Maui Shell + +![][11a] + +[Maui Shell][13] 是 Nitrux 用户体验的亮点之一。近来,Maui Shell 得到了进一步的完善,将这些呈现在了桌面端和移动端的融合界面上。 + +尽管 Maui Shell 目前还不成熟,但是外观看起来十分大气简约,就像 [System76 将要推出基于 Rust 的桌面环境][14] 一样令人兴奋。 + +这也是我们推荐尝试 Nitrux 操作系统最重要的原因之一。时间会证明,Nitrux 系统是否将会开启桌面体验的全新时代。 + +### 6、Xanmod 内核 + +![][5c] + +[Xanmod 内核][15] 是一个定制的主线 Linux 内核版本,对性能进行了适当的调整,附加了一些其他功能。有了它,你的桌面体验一定能得到大幅提升。 + +自 2.0 版本起,Nitrux 操作系统选用 Xanmod 作为默认内核,为用户提供“升级版”的桌面体验。 + +当然你也可以选择其他 Linux 内核,比如 Liquorix 和 Libre,各擅胜场。 + +如果你不喜欢 Xanmod,也可以选择长期支持版的主线内核。在 Nitrux 操作系统上,你完全可以无缝切换使用不同的内核。 + +- [Nitrux OS][4] + +### 总结 + +诚然,从主流发行版转到像 Nitrux 这样的操作系统,需要考虑各种风险。 + +但是,**我建议你好好考虑一番:** + +Nitrux 这样的发行版热衷于按照他们的愿景来改进事情。 + +尽管背后没有强大的企业和财力支撑,他们依然可以开发出这款令人惊艳的发行版、开发出 [Maui 项目][16],以及别开生面的 Maui shell。 + +所以,我认为,我们也应该以己所能,尽己之力,支持这些优秀的发行版。 + +不过话说回来,每一款 Linux 发行版都会或多或少地存在一些问题。当你试用一款新的发行版时,你需要给它点儿时间,在最终将它作为日常使用的操作系统之前,慢慢地去适应它。 + +换言之,我推荐你在业余时间试用 Nitrux 操作系统,或者直接装个虚拟机来一探究竟。 + +我很关注大家对这篇文章的看法,请在下方评论留言。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/reasons-to-try-nitrux-os/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[aREversez](https://github.com/aREversez) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/nitrux-linux/ +[2]: https://news.itsfoss.com/nitrux-2-0-release/ +[3]: https://news.itsfoss.com/nitrux-linux-debian/ +[4]: https://nxos.org/ +[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/02/not-ubuntu-illustration.png?w=1000&ssl=1 +[6]: https://itsfoss.com/best-linux-beginners/ +[7]: https://linux.cn/article-13746-1.html +[5a]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/02/appimage-illustration.png?w=1000&ssl=1 +[8]: https://itsfoss.com/use-appimage-linux/ +[5b]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/02/kde-illustration.png?w=1000&ssl=1 +[9]: https://itsfoss.com/best-kde-distributions/ +[10]: https://itsfoss.com/kde-customization/ +[11]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/01/nitrux-2-visual.png?resize=1568%2C882&ssl=1 +[12]: https://itsfoss.com/beautiful-linux-distributions/ +[11a]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/12/maui-shell.png?w=1200&ssl=1 +[13]: https://news.itsfoss.com/maui-shell-unveiled/ +[14]: https://news.itsfoss.com/system76-cosmic-panel/ +[5c]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/02/xanmod-kernel-illustration.png?w=1000&ssl=1 +[15]: https://xanmod.org/ +[16]: https://mauikit.org diff --git a/published/20220223 Listen to your favorite music on Linux with Juk.md b/published/202203/20220223 Listen to your favorite music on Linux with Juk.md similarity index 100% rename from published/20220223 Listen to your favorite music on Linux with Juk.md rename to published/202203/20220223 Listen to your favorite music on Linux with Juk.md diff --git a/published/20220224 KDE vs GNOME- What-s the Ultimate Linux Desktop Choice.md b/published/202203/20220224 KDE vs GNOME- What-s the Ultimate Linux Desktop Choice.md similarity index 100% rename from published/20220224 KDE vs GNOME- What-s the Ultimate Linux Desktop Choice.md rename to published/202203/20220224 KDE vs GNOME- What-s the Ultimate Linux Desktop Choice.md diff --git a/published/202203/20220224 Scan documents and old photos on Linux with Skanlite.md b/published/202203/20220224 Scan documents and old photos on Linux with Skanlite.md new file mode 100644 index 0000000000..dd95691c8e --- /dev/null +++ b/published/202203/20220224 Scan documents and old photos on Linux with Skanlite.md @@ -0,0 +1,90 @@ +[#]: subject: "Scan documents and old photos on Linux with Skanlite" +[#]: via: "https://opensource.com/article/22/2/scan-documents-skanlite-linux-kde" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14402-1.html" + +用 Skanlite 在 Linux 上扫描文件和老照片 +====== + +> 使用这个 Linux KDE 应用,将你的档案数字化。 + +![](https://img.linux.net.cn/data/attachment/album/202203/27/114937eannabb3zn45lraa.jpg) + +虽然现在的世界已经大部分实现了数字化,但仍有一些时候,你还是需要打印一份表格,签字,然后把它扫描回来。有时候,我发现在手机上拍个快照就够了,但有些行业需要比草率的快照更好的复印件,因此平板扫描仪是必要的。KDE 项目提供了一个叫做 Skanlite 的应用程序,它可以帮助你导入在平板上扫描的文件,甚至是用联机相机扫描的文件。 + +### 在 Linux 上安装 Skanlite + +你可以从你的软件库中安装 Skanlite。在 Fedora、Mageia 和类似的地方: + +``` +$ sudo dnf install skanlite +``` + +在 Elementary、Linux Mint 和其他基于 Debian 的发行版上: + +``` +$ sudo apt install skanlite +``` + +### 扫描仪驱动 + +市场上的大多数扫描仪都与 SANE 扫描仪 API 兼容。SANE 并不是一个真正的驱动,而是一个协议,可以接收来自图像采集设备的输入,并为希望围绕它建立一个应用的程序员提供选项。Skanlite 就是这样一个应用。 + +我还没有遇到过不与 SANE 接口兼容的扫描仪,但可能也有不与 SANE 接口兼容的扫描仪。在这些情况下,请在制造商的网站上寻找 SANE 或 TWAIN 的驱动,或者寻找它们专有的驱动和扫描仪接口。后者可能无法使用 Skanlite,但当你不确定你的扫描仪是否通过标准协议进行通信时,Skanlite 总是值得试试。我甚至遇到过打印机和扫描仪的二合一设备,尽管打印机需要一个额外的驱动,但扫描仪却能立即被识别。 + +### 使用 Skanlite + +当你启动 Skanlite 时,它首先会在你的系统中搜索图像采集设备。在笔记本电脑上,Skanlite 通常会发现网络摄像头是一个有效的输入源(因为它是),但它也会找到连接到你机器上的平板扫描仪。选择你要使用的扫描仪,然后继续。 + +要看扫描的内容,点击应用程序右下角的“预览Preview”按钮。 + +![Skanlite with custom artwork][2] + +这将在右面板上显示一个预览图像。没有任何东西被保存到你的硬盘上,这只是显示你的扫描仪上目前有什么。 + +### 选择一个扫描区域 + +如果你只需要扫描仪上的一部分内容,你可以选择一个你想保存的区域。要选择一个单一的区域,在你想保存的区域上点击并拖动你的鼠标。当有一个有效的选择时,当你点击“扫描Scan”按钮时,只有你选择的那部分会被保存。 + +你可以有一个以上的选区,当你需要扫描几个小图像或只扫描一个大文件的特定部分时,这特别有效。要添加一个选区,请点击出现在选区中心的 “+” 图标。 + +![Adding selections][3] + +你可以通过点击 “-” 图标来删除选区,当你有多个活动选区时,该图标会出现。 + +### 扫描设置 + +图像采集设置位于左边的面板上。这些控件允许你导入彩色或灰度的图像,并对图像的亮度和对比度进行调整。这些选项是基于软件的,不影响你的扫描仪的行为方式,但它们是常见的调整,在这里做这些调整可以使你不必在 GIM 或 Gwenview 中对图像进行后期处理。 + +在许多情况下,你的扫描仪可能有可配置的设置,可在 Skanlite 窗口左侧的“扫描仪特定选项Scanner Specific Options”标签中找到。有些扫描仪允许你调整色温、亮度、饱和度和其他出现在固件中的属性。可用的选项根据设备和供应商的不同而不同,所以你有可能在这个面板上看到变化,这取决于你与哪种设备的对接。 + +### 扫描和保存 + +当你准备好导入图像(或图像的选定区域,如果你已经做了选择)时,点击 Skanlite 窗口右下角的“扫描Scan”按钮。根据你的设备,它可能需要一些时间来创建扫描,但当它完成后,会提示你保存或丢弃图像。如果你喜欢你所看到的,点击“保存Save”。 + +图像会被保存到你所配置的任何默认位置。要查看默认位置,点击窗口右下角的“设置Settings”按钮。在 “Skanlite 设置Skanlite Settings”中,你可以设置默认保存位置、默认名称格式和图像分辨率。你还可以控制每次扫描后是否提示你保存或丢弃图像,或者你是否想要保存所有的东西并在以后进行分类。 + +### Linux 上的扫描很容易 + +在 Linux 上扫描文件是如此简单,我很少考虑这个问题。通常不需要你去寻找和安装特殊的驱动或应用,因为像 Skanlite 这样的应用使用开放协议,使这个过程变得简单。下次你有一份需要数字化的拷贝时,用 Skanlite 导入它。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/2/scan-documents-skanlite-linux-kde + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) +[2]: https://opensource.com/sites/default/files/skanlite.png (Skanlite with custom artwork) +[3]: https://opensource.com/sites/default/files/skanlite-selection.jpg (Adding selections) diff --git a/published/20220225 How to screen share with the Linux KDE Plasma Desktop.md b/published/202203/20220225 How to screen share with the Linux KDE Plasma Desktop.md similarity index 100% rename from published/20220225 How to screen share with the Linux KDE Plasma Desktop.md rename to published/202203/20220225 How to screen share with the Linux KDE Plasma Desktop.md diff --git a/published/20220227 12 Simple Tools to Protect Your Privacy.md b/published/202203/20220227 12 Simple Tools to Protect Your Privacy.md similarity index 100% rename from published/20220227 12 Simple Tools to Protect Your Privacy.md rename to published/202203/20220227 12 Simple Tools to Protect Your Privacy.md diff --git a/published/20220227 Math is fun with this Linux graphing calculator.md b/published/202203/20220227 Math is fun with this Linux graphing calculator.md similarity index 100% rename from published/20220227 Math is fun with this Linux graphing calculator.md rename to published/202203/20220227 Math is fun with this Linux graphing calculator.md diff --git a/published/20220228 A visual map of a Kubernetes deployment.md b/published/202203/20220228 A visual map of a Kubernetes deployment.md similarity index 100% rename from published/20220228 A visual map of a Kubernetes deployment.md rename to published/202203/20220228 A visual map of a Kubernetes deployment.md diff --git a/published/20220228 Fedora 36 Release Date and New Features.md b/published/202203/20220228 Fedora 36 Release Date and New Features.md similarity index 100% rename from published/20220228 Fedora 36 Release Date and New Features.md rename to published/202203/20220228 Fedora 36 Release Date and New Features.md diff --git a/published/20220228 Put sticky notes on your Linux KDE desktop.md b/published/202203/20220228 Put sticky notes on your Linux KDE desktop.md similarity index 100% rename from published/20220228 Put sticky notes on your Linux KDE desktop.md rename to published/202203/20220228 Put sticky notes on your Linux KDE desktop.md diff --git a/published/20220301 4 Vim features to use to improve productivity.md b/published/202203/20220301 4 Vim features to use to improve productivity.md similarity index 100% rename from published/20220301 4 Vim features to use to improve productivity.md rename to published/202203/20220301 4 Vim features to use to improve productivity.md diff --git a/published/202203/20220301 Experience the Stunning Cutefish Desktop in Arch Linux.md b/published/202203/20220301 Experience the Stunning Cutefish Desktop in Arch Linux.md new file mode 100644 index 0000000000..d7f1ffa9a4 --- /dev/null +++ b/published/202203/20220301 Experience the Stunning Cutefish Desktop in Arch Linux.md @@ -0,0 +1,129 @@ +[#]: subject: "Experience the Stunning Cutefish Desktop in Arch Linux" +[#]: via: "https://www.debugpoint.com/2022/02/cutefish-arch-linux-install/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14385-1.html" + +在 Arch Linux 中体验令人惊叹的 Cutefish 桌面 +====== + +![](https://img.linux.net.cn/data/attachment/album/202203/23/145712h8q77pe7j9q29hj2.jpg) + +> 现在你可以在 Arch Linux 中体验 Cutefish 桌面了。本文概述了在 Arch Linux 系统中安装 Cutefish 桌面环境的步骤。 + +### Cutefish 桌面 + +前一阵子,[我们点评了 CutefishOS][2],它带有看起来非常棒的 Cutefish 桌面,得到了我们的读者的积极反应和关注。因此,我们认为这是一个完美的时机,是时候在你最喜欢的 Arch Linux 中体验一下这个桌面了。 + +在你进入安装部分之前,这里有一些关于 Cutefish 桌面的小知识。 + +Cutefish 桌面是 [CutefishOS][3] 的一部分,这是一个正在开发的新 Linux 发行版。这个基于 Debian 的 Linux 发行版具有令人难以置信的外观、轻量级的 Cutefish 桌面。 + +Cutefish 桌面其内部是以 Qt Quick、QML、C++ 和 KDE 框架为基础编写的。这个现代的桌面环境使用 KWin 和 SDDM 进行窗口和显示管理。 + +Cutefish 桌面为你带来了所寻求的一个完全 macOS 风格的、开箱即用的 Linux 桌面。也就是说,你可以获得令人惊叹的图标、壁纸、全局菜单、带有漂亮通知弹出窗口的顶部栏和底部停靠区。 + +你可在 [这里] 阅读详细的点评。 + +### 在 Arch Linux 中安装 Cutefish 桌面 + +#### 安装基础 Arch 系统 + +本指南假设在尝试这些步骤之前,你的系统中已经安装好了基本的 Arch Linux。或者,如果你也安装了任何基于 Arch 的 Linux 发行版,你也可以尝试。只是在这些情况下要注意显示管理的问题。 + +如果你是 Arch 的新手,你可以参考我们的 Arch Linux 安装指南。 + + * [如何使用 archinstall 安装 Arch Linux(推荐)][4] + * [如何安装 Arch Linux(基本指南)][5] + +#### 安装 Cutefish 桌面 + +Arch Linux 社区仓库包含了 Cutefish 组,其中有该桌面运行所需的所有组件。它包括核心软件包、原生应用和下面提到的附加工具。 + +在你的 Arch Linux 系统的终端提示符下,运行下面的命令来安装所有 Cutefish 桌面软件包。 + +``` +pacman -S cutefish +``` + +![A base Arch Linux prompt][6] + +![Install Cutefish in Arch Linux][7] + +接下来,我们需要通过下面的命令安装 Xorg 和显示管理器 SDDM。如果你将 Cutefish 桌面安装在安装有其他诸如 GNOME、KDE Plasma 或 Xfce 等桌面环境的 Arch Linux 中,那么请注意,因为你已经安装了一个显示管理器和 Xorg。所以,你可以轻松跳过这一步。 + +``` +pacman -S xorg sddm +``` + +上述命令完成后,通过 systemctl 启用显示管理器。 + +``` +systemctl enable sddm +``` + +这就是裸机安装 Cutefish 桌面的全部内容。完成后,重启系统,登录后你应该看到 Cutefish 桌面如下。 + +![Cutefish Desktop in Arch Linux][1] + +基础安装需要额外的定制,因为它不像 Cutefish OS 那样接近。 + +### 安装后的配置 + +尽管 Arch 仓库中的 Cutefish 组包含了它的原生应用,如计算器和文件管理器,但该桌面缺乏基本的应用,你需要单独安装这些应用来使它成为一个功能齐全的高效桌面。 + +我建议使用下面的命令来安装以下基本的应用。你可以跳过这一步,或者选择任何其他的应用/组合。 + + * Firefox 网页浏览器 + * Kwrite 文本编辑器 + * ttf-freefont 字体 + * VLC 媒体播放器 + * Gwenview 图像查看器 + * GIMP 图像编辑器 + * LibreOffice + * Transmission + +``` +pacman -S firefox ttf-freefont kwrite vlc gwenview gimp libreoffice-still transmission-qt +``` + +安装后,打开设置,改变你选择的字体。默认字体是 courier,它在桌面上看起来很糟糕。 + +按照你的选择完成所有的定制后,重启系统。然后享受 Arch Linux 中的 Cutefish 桌面。 + +![The Stunning Login Lock Screen of Cutefish Desktop][9] + +### 结束语 + +这个桌面正在开发中,所以在写这篇文章时,你会发现设置项目不多。例如,没有办法改变分辨率、隐藏停靠区等等。不过,你仍然可以安装额外的应用来使用。如果你想做体验一番,可以去试试。 + +加油。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/02/cutefish-arch-linux-install/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/wp-content/uploads/2022/02/Cutefish-Desktop-in-Arch-Linux-1024x575.jpg +[2]: https://www.debugpoint.com/2021/11/cutefish-os-review-2021/ +[3]: https://en.cutefishos.com/ +[4]: https://www.debugpoint.com/2022/01/archinstall-guide/ +[5]: https://www.debugpoint.com/2020/11/install-arch-linux/ +[6]: https://www.debugpoint.com/wp-content/uploads/2022/02/A-base-Arch-Linux-prompt.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/02/Install-Cutefish-in-Arch-Linux.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/02/The-Stunning-Login-Lock-Screen-of-Cutefish-Desktop-1024x576.jpg +[10]: https://t.me/debugpoint +[11]: https://twitter.com/DebugPoint +[12]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[13]: https://facebook.com/DebugPoint diff --git a/published/20220302 How to use httpx, a web client for Python.md b/published/202203/20220302 How to use httpx, a web client for Python.md similarity index 100% rename from published/20220302 How to use httpx, a web client for Python.md rename to published/202203/20220302 How to use httpx, a web client for Python.md diff --git a/published/202203/20220303 9 resources to help you contribute to open source in 2022.md b/published/202203/20220303 9 resources to help you contribute to open source in 2022.md new file mode 100644 index 0000000000..1fa15112e5 --- /dev/null +++ b/published/202203/20220303 9 resources to help you contribute to open source in 2022.md @@ -0,0 +1,71 @@ +[#]: subject: "9 resources to help you contribute to open source in 2022" +[#]: via: "https://opensource.com/article/22/3/contribute-open-source-2022" +[#]: author: "Opensource.com https://opensource.com/users/admin" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14372-1.html" + +2021 总结:如何为开源做出贡献 +====== + +> 你准备好推进你的开源之旅了吗?这里有一些如何给开源做贡献的提示和教程。 + +![](https://img.linux.net.cn/data/attachment/album/202203/19/145149b9uvnnrkfnuzm7uf.jpg) + +在 2022 年,开源正变得越来越家喻户晓。但多年来,开源一直被称为企业 IT 领域中潦倒的弱势群体。开源已经以某种形式或方式存在了 [几十年][2],但甚至直到 20 世纪 90 年代末,它才正式有了自己的 [名字][3]。你可能一直都在使用开源技术,但却不知道。事实上,你目前正在阅读的网站(LCTT 译注:指 opensource.com )就是在开源的内容管理系统 [Drupal][4] 上运行的。你的汽车、笔记本电脑、智能手表和电子游戏很可能是 [由 Linux][5] 这个开源操作系统支持的。 + +红帽公司的年度《[企业开源状况][6]》在最近发布了,其中包含了大量的见解,对任何在开源技术领域发展的人都有帮助。首先,77% 的 IT 领导对企业开源的看法比一年前更积极,82% 的 IT 领导更可能选择对开源社区有贡献的供应商。这意味着,参与开源比以往任何时候都更重要。现在是推进你的开源之旅的时候了,无论你在哪里。这里有一些资源可以帮助你踏上这条路。 + +### 为什么要为开源做贡献? + + * 《[是什么激励了开源软件的贡献者?][7]》新的研究发现人们贡献的原因自 21 世纪初以来已经改变。 + * 《[现在为开源做贡献的 3 个理由][8]》现在,比以往任何时候都更加是为开源做贡献的理想时机。 + * 《[为开源做贡献时的 7 个成功策略][9]》一位作者在为开源项目做贡献的经验帮助她在技术领域找到了她梦想的工作。 + +### 为开源做出你的第一次贡献 + + * 《[8 种非编码的方式为开源做贡献][10]》无论你是程序员新手,还是经验丰富的老手,或者根本不是工程师,在编码之外还有很多方式为开源项目做贡献。 + * 《[为 Slack 的开源替代方案做贡献的 6 种方式][11]》加入成千上万为 Mattermost 这个开源消息平台贡献代码、翻译、文档等的人。 + * 《[任何人都可以为开放实践图书馆做出贡献的 7 种方式][12]》为开放实践图书馆做出贡献是参与全球从业者社区的一种有趣方式,这些从业者都愿意分享他们的知识并改进他们自己的工作方式。 + * 《[如果你有一份全职工作,如何为 Kubernetes 做贡献][13]》你可以在业余时间从事最大的开源项目之一的内部工作。 + +### 鼓励他人为开源做贡献 + + * 《[为什么你的开源项目需要的不仅仅是程序员][14]》仅仅是开发人员并不能创造出满足各种需求的长保质期的开源项目,是时候欢迎更多的角色和人才了。 + * 《[开源贡献者加入的 10 个技巧][15]》让新的贡献者感到自己在社区中受到欢迎,对项目的未来至关重要,因此,在加入时投入时间和注意力是很重要的。 + +### 分享你对开源贡献的建议 + +当涉及到参与开源社区时,有无限的可能性。在这里,我们的目标是庆祝社区的不同观点和背景,其中包括你。你的独特故事激励着全球各地的人们参与到开源中来。来吧,[把你的文章想法发给我们][16]! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/3/contribute-open-source-2022 + +作者:[Opensource.com][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/admin +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) +[2]: https://www.redhat.com/en/topics/open-source/what-is-open-source#the-history-of-open-source?intcmp=7013a000002qLH8AAM +[3]: https://opensource.com/article/18/2/coining-term-open-source-software +[4]: https://opensource.com/tags/drupal +[5]: https://opensource.com/article/19/8/everyday-tech-runs-linux +[6]: https://www.redhat.com/en/enterprise-open-source-report/2022?intcmp=7013a000002qLH8AAM +[7]: https://opensource.com/article/21/4/motivates-open-source-contributors +[8]: https://opensource.com/article/20/6/why-contribute-open-source +[9]: https://opensource.com/article/22/1/open-source-contributions-career +[10]: https://opensource.com/life/16/1/8-ways-contribute-open-source-without-writing-code +[11]: https://opensource.com/article/20/7/mattermost +[12]: https://opensource.com/article/21/10/open-practice-library +[13]: https://opensource.com/article/19/11/how-contribute-kubernetes +[14]: https://opensource.com/article/20/9/open-source-role-diversity +[15]: https://opensource.com/article/19/12/open-source-contributors +[16]: https://linux.cn/article-14335-1.html \ No newline at end of file diff --git a/published/202203/20220304 Epic Games Store Now Works on Steam Deck.md b/published/202203/20220304 Epic Games Store Now Works on Steam Deck.md new file mode 100644 index 0000000000..104368caf6 --- /dev/null +++ b/published/202203/20220304 Epic Games Store Now Works on Steam Deck.md @@ -0,0 +1,93 @@ +[#]: subject: "Epic Games Store Now Works on Steam Deck" +[#]: via: "https://news.itsfoss.com/epic-games-steam-deck/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "zd200572" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14374-1.html" + +Epic 游戏商店现在可在 Steam Deck 上使用啦 +====== + +> 现在可以在 Steam Deck 上运行 Epic 游戏商店了,几乎无懈可击! 但是,它是非官方的。 + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/run-epicgames-on-steam-deck-now.png?w=1200&ssl=1) + +Steam Deck 在加强对 Linux 平台的游戏支持方面做出了有力推动。 + +它运行在 **Steam OS 3.0**(基于 Arch)上,并具有 KDE Plasma 桌面环境。感谢 Valve,它没有锁定平台并让用户在上面进行试验。 + +尽管不是每个人都可以拿到它,但这是一款令人兴奋的硬件,可以挑战任天堂 Switch 掌机。 + +它可能还不支持所有的流行游戏(比如《命运 2》、《堡垒之夜》),但它在几个 3A 级大作和独立游戏上取得了不错的进展。你可以到官方的 [Deck 认证][1] 页面查看有关支持游戏的最新信息。 + +现在,更令人激动的是,事实证明 Steam Deck 也可以使用 [Epic 游戏商店][2](**非官方的**)来运行游戏。但是,怎样运行呢,让我们来一探究竟。 + +### 通过 Heroic 游戏启动器使用 Epic 游戏商店 + +是的,这就是 [去年][4] 制作的 [Heroic 游戏启动器][3], 并且已知它可以运行在 Linux 桌面上。 + +另外,(据 [GamingOnLinux][5])感谢 Liam Dawe,他和各位开发者协调,成功地在 Steam Deck 上测试运行了 Heroic 游戏启动器(及 [Heroic Bash 启动器][6])。 + +[![][7]](https://youtu.be/89Dw3I6NJX4) + +补充一句,**Heroic Bash 启动器** 是一个为所有已安装的 Heroic 游戏创建启动脚本(.sh 文件)的工具,它允许你直接从终端或者游戏前端/启动器启动游戏,而不必打开 Heroic。 + +故事的发生是这样的(根据我与 Heroic Bash 启动器开发者的简短交谈): + +最初,在 Steam Deck 上实验运行 Epic 游戏商店时,Steam 控制器无法工作,因为 Epic 游戏商店是使用 Steam 客户端以一个“非 Steam 游戏”运行的。 + +所以,Heroic Bash 启动器的开发者,[Rishabh Moharir][8](也是这里的一位作者)建议使用他的工具,按照他 [GitHub 上的维基指南][9] 来试试。 + +Heroic Bash 启动器可以在 Linux 桌面上与 Epic 游戏商店配合使用。所以,这值得一试! + +然后,幸运地,它工作了。 + +### 在 Steam Deck 上安装 Epic 游戏商店 + +首先,你需要在 Steam Deck 上使用可用的 AppImage 文件在**桌面模式**下安装 **Heroic 游戏启动器**。 + +完成后,你需要登录并下载你选择的游戏。 + +接下来,你需要下载最新的 [legendary][10] 二进制文件,并在启动器设置中将其设置为替代的 legendary 二进制文件。 + +你需要在启动器的游戏设置中配置并设置兼容层为 Proton 7.0。 + +这时,你需要下载最新的 [Heroic Bash 启动器二进制文件][11],然后运行它。 + +最后,你必须根据这个 [GitHub 上的官方维基指南][9],把游戏添加到 Steam 中(以便在 Steam Deck 的界面中找到它)。 + +总之,“手工爱好者”们肯定需要花好大一会儿才能使其工作。另外,如果你仍然困惑,你可以在 [维基][12] 上找到包含详细信息的同样的一套步骤和细节,这是 Heroic 游戏启动器团队整理的(或者参考上面的视频)。 + +对我来说,这听起来可行,应该不会超越大多数 Steam Deck 用户的能力。不幸的是,我无法在印度买到 Steam Deck(目前)。 + +至于 Steam Deck 上的 Epic 游戏商店的未来,我们只能抱以最好的期望。 + +你试过 Steam Deck 吗?在下面的评论区让我知道你的看法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/epic-games-steam-deck/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[zd200572](https://github.com/zd200572) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.steamdeck.com/en/verified +[2]: https://www.epicgames.com/store/en-US/ +[3]: https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher +[4]: https://news.itsfoss.com/heroic-games-launcher/ +[5]: https://www.gamingonlinux.com/2022/03/heroic-games-launcher-now-works-nicely-on-steam-deck/ +[6]: https://github.com/redromnon/HeroicBashLauncher +[7]: https://i0.wp.com/i.ytimg.com/vi/UvuGAQDagWE/hqdefault.jpg?w=780&ssl=1 +[8]: https://news.itsfoss.com/author/rishabh/ +[9]: https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/wiki/Adding-Games-to-Steam-on-Linux +[10]: https://github.com/derrod/legendary/releases/ +[11]: https://github.com/redromnon/HeroicBashLauncher/releases/ +[12]: https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/wiki/SteamDeck---Running-Epic-Games diff --git a/published/202203/20220305 Creating and initializing maps in Groovy vs Java.md b/published/202203/20220305 Creating and initializing maps in Groovy vs Java.md new file mode 100644 index 0000000000..98d41471e2 --- /dev/null +++ b/published/202203/20220305 Creating and initializing maps in Groovy vs Java.md @@ -0,0 +1,244 @@ +[#]: subject: "Creating and initializing maps in Groovy vs Java" +[#]: via: "https://opensource.com/article/22/3/maps-groovy-vs-java" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14378-1.html" + +在 Groovy 和 Java 中创建并初始化映射的不同 +====== + +> Java 和 Groovy 中的映射map都是非常通用的,它允许关键字keyvalue为任意类型,只要继承了 `Object` 类即可。 + +![](https://img.linux.net.cn/data/attachment/album/202203/21/092532ykbhkq36vbr3bpzg.jpg) + +我最近在探索 Java 与 Groovy 在 [创建并初始化列表List][2] 和 [在运行时构建列表List][3] 方面的一些差异。我观察到,就实现这些功能而言,Groovy 的简洁和 Java 的繁复形成了鲜明对比。 + +在这篇文章中,我将实现在 Java 和 Groovy 中创建并初始化映射Map。映射为开发支持根据 关键字key 检索的结构提供了可能,如果找到了这样一个关键字,它就会返回对应的 value。今天,很多编程语言都实现了映射,其中包括 Java 和 Groovy,也包括了 Python(它将映射称为 字典dict)、Perl、awk 以及许多其他语言。另一个经常被用来描述映射的术语是 关联数组associative array,你可以在 [这篇维基百科文章][4] 中了解更多。Java 和 Groovy 中的映射都是非常通用的,它允许关键字和值为任意类型,只要继承了 `Object` 类即可。 + +### 安装 Java 和 Groovy + +Groovy 基于 Java,因此你需要先安装 Java。你的 Linux 发行版的仓库中可能有最近的比较好的 Java 和 Groovy 版本。或者,你也可以在根据上面链接中的指示来安装 Groovy。对于 Linux 用户来说,[SDKMan][5] 是一个不错的代替选项,你可以使用它来获取多个 Java 和 Groovy 版本,以及许多其他的相关工具。在这篇文章中,我使用的 SDK 发行版是: + + * Java: version 11.0.12-open of OpenJDK 11; + * Groovy: version 3.0.8. + +### 言归正传 + +Java 提供了非常多的方式来实例化和初始化映射,并且从 Java 9 之后,添加了一些新的方式。其中最明显的方式就是使用 `java.util.Map.of()` 这个静态方法,下面介绍如何使用它: + +``` +var m1 = Map.of( + "AF", "Afghanistan", + "AX", "Åland Islands", + "AL", "Albania", + "DZ", "Algeria", + "AS", "American Samoa", + "AD", "Andorra", + "AO", "Angola", + "AI", "Anguilla", + "AQ", "Antarctica"); + +System.out.println("m1 = " + m1); +System.out.println("m1 is an instance of " + m1.getClass()); +``` + +事实证明,在此种情况下,`Map.of()` 有两个重要的限制。其一,这样创建出来的映射实例是不可变的immutable。其二,你最多只能提供 20 个参数,用来表示 10 个键值对key-value pair。 + +你可以尝试着添加第 10 对和第 11 对,比方说 "AG", "Antigua and Barbuda" 和 "AR", "Argentina",然后观察会发生什么。你将发现 Java 编译器尝试寻找一个支持 11 个键值对的 `Map.of()` 方法而遭遇失败。 + +快速查看 [java.util.Map 类的文档][8],你就会找到上述第二个限制的原因,以及解决这个难题的一种方式: + +``` +var m2 = Map.ofEntries( + Map.entry("AF", "Afghanistan"), + Map.entry("AX", "Åland Islands"), + Map.entry("AL", "Albania"), + Map.entry("DZ", "Algeria"), + Map.entry("AS", "American Samoa"), + Map.entry("AD", "Andorra"), + Map.entry("AO", "Angola"), + Map.entry("AI", "Anguilla"), + Map.entry("AQ", "Antarctica"), + Map.entry("AG", "Antigua and Barbuda"), + Map.entry("AR", "Argentina"), + Map.entry("AM", "Armenia"), + Map.entry("AW", "Aruba"), + Map.entry("AU", "Australia"), + Map.entry("AT", "Austria"), + Map.entry("AZ", "Azerbaijan"), + Map.entry("BS", "Bahamas"), + Map.entry("BH", "Bahrain"), + Map.entry("BD", "Bangladesh"), + Map.entry("BB", "Barbados") +); + +System.out.println("m2 = " + m2); +System.out.println("m2 is an instance of " + m2.getClass()); +``` + +这就是一个比较好的解决方式,前提是我不在随后的代码里改变使用 `Map.ofEntries()` 创建并初始化的映射内容。注意,我在上面使用了 `Map.ofEntries()` 来代替 `Map.of()`。 + +然而,假设我想要创建并初始化一个非空的映射,随后往这个映射中添加数据,我需要这样做: + +``` +var m3 = new HashMap(Map.ofEntries( + Map.entry("AF", "Afghanistan"), + Map.entry("AX", "Åland Islands"), + Map.entry("AL", "Albania"), + Map.entry("DZ", "Algeria"), + Map.entry("AS", "American Samoa"), + Map.entry("AD", "Andorra"), + Map.entry("AO", "Angola"), + Map.entry("AI", "Anguilla"), + Map.entry("AQ", "Antarctica"), + Map.entry("AG", "Antigua and Barbuda"), + Map.entry("AR", "Argentina"), + Map.entry("AM", "Armenia"), + Map.entry("AW", "Aruba"), + Map.entry("AU", "Australia"), + Map.entry("AT", "Austria"), + Map.entry("AZ", "Azerbaijan"), + Map.entry("BS", "Bahamas"), + Map.entry("BH", "Bahrain"), + Map.entry("BD", "Bangladesh"), + Map.entry("BB", "Barbados") +)); + +System.out.println("m3 = " + m3); +System.out.println("m3 is an instance of " + m3.getClass()); + +m3.put("BY", "Belarus"); +System.out.println("BY: " + m3.get("BY")); + +``` + +这里,我把使用 `Map.ofEntries()` 创建出来的不可变映射作为 `HashMap` 的一个构造参数,以此创建了该映射的一个可变副本mutable copy,之后我就可以修改它 —— 比如使用 `put()` 方法。 + +让我们来看看上述过程如何用 Groovy 来实现: + +``` +def m1 = [ + "AF": "Afghanistan", + "AX": "Åland Islands", + "AL": "Albania", + "DZ": "Algeria", + "AS": "American Samoa", + "AD": "Andorra", + "AO": "Angola", + "AI": "Anguilla", + "AQ": "Antarctica", + "AG": "Antigua and Barbuda", + "AR": "Argentina", + "AM": "Armenia", + "AW": "Aruba", + "AU": "Australia", + "AT": "Austria", + "AZ": "Azerbaijan", + "BS": "Bahamas", + "BH": "Bahrain", + "BD": "Bangladesh", + "BB": "Barbados"] + +println "m1 = $m1" +println "m1 is an instance of ${m1.getClass()}" + +m1["BY"] = "Belarus" +println "m1 = $m1" +``` + +只看一眼,你就会发现 Groovy 使用了 `def` 关键字而不是 `var` —— 尽管在最近模型late-model的 Groovy(version 3+)中,使用 `var` 关键字也是可行的。 + +你还会发现,你是通过在括号里添加了一个键值对列表来创建一个映射的。不仅如此,这样创建的列表对象还非常有用,这里有几个原因。其一,它是可变的;其二,它是一个 `LinkedHashMap` 的实例,内部维持了数据的插入顺序。所以,当你运行 Java 版本的代码并打印出变量 `m3`,你会看到: + +``` +m3 = {BB=Barbados, BD=Bangladesh, AD=Andorra, AF=Afghanistan, AG=Antigua and Barbuda, BH=Bahrain, AI=Anguilla, AL=Albania, AM=Armenia, AO=Angola, AQ=Antarctica, BS=Bahamas, AR=Argentina, AS=American Samoa, AT=Austria, AU=Australia, DZ=Algeria, AW=Aruba, AX=Åland Islands, AZ=Azerbaijan} +``` + +而当你运行 Groovy 版本的代码,你会看到: + +``` +m1 = [AF:Afghanistan, AX:Åland Islands, AL:Albania, DZ:Algeria, AS:American Samoa, AD:Andorra, AO:Angola, AI:Anguilla, AQ:Antarctica, AG:Antigua and Barbuda, AR:Argentina, AM:Armenia, AW:Aruba, AU:Australia, AT:Austria, AZ:Azerbaijan, BS:Bahamas, BH:Bahrain, BD:Bangladesh, BB:Barbados] +``` + +再一次,你将看到 Groovy 是如何简化事情的。这样的语法非常直观,有点像 Python 里的字典,并且,即使你有一个超过 10 个键值对的初始列表,你也不需要去记住各种必要的别扭方式。注意我们使用的表达式: + +``` +m1[“BY”] = “Belarus” +``` + +而在 Java 中,你需要这样做: + +``` +m1.put(“BY”, “Belarus”) +``` + +还有,这个映射默认是可变的,这么做的利弊很难评判,还是得取决于你的需求是什么。我个人觉得,Java 在这种情况下的 “默认不可变” 机制,最让我困扰的地方是,它没有一个类似于 `Map.mutableOfMutableEntries()` 的方法。这迫使一些刚学会如何声明和初始化一个映射的程序员,不得不转念去思考该如何把他们手中不可变的映射,转换为可变的。同时我也想问,创建一个不可变的对象然后再舍弃它,这样真的好吗? + +另一个值得考虑的事情是,Groovy 使用方括号代替 Java 中的 `put()` 和 `get()` 方法来进行关键字查找。因此你可以这样写: + +``` +m1[“ZZ”] = m1[“BY”] +``` + +而不需要这样写: + +``` +m1.put(“ZZ”,m1.get(“BY”)) +``` + +有时候,就像使用某个类的实例变量一样来使用映射中的关键字和值是一个好办法。设想你现在有一堆想要设置的属性,在 Groovy 中,它们看起来就像下面这样: + +``` +def properties = [ +      verbose: true, +      debug: false, +      logging: false] +``` + +然后,你可以改变其中的某个属性,就像下面这样: + +``` +properties.verbose = false +``` + +之所以这样能工作,是因为,只要关键字符合特定的规则,你就可以省略引号,然后直接用点操作符来代替方括号。尽管这个功能非常有用,也非常好用,它也同时也意味着,如果你要把一个变量作为一个映射的关键字来使用,你就必须把这个变量包裹在圆括号里,就像下面这样: + +``` +def myMap = [(k1): v1, (k2): v2] +``` + +是时候告诉勤奋的读者 Groovy 是一门为编写脚本而量身定制的语言了。映射通常是脚本中的关键元素,它为脚本提供了查找表lookup table,并且通常起到了作为内存数据库的作用。我在这里使用的例子是 ISO 3166 规定的两个字母的国家代码和国家名称。对在世界上各个国家的互联网使用者来说,这些代码是很熟悉的。此外,假设我们要编写一个从日志文件中查找互联网主机名,并借此来了解用户的地理位置分布的脚本工具,那么这些代码会是十分有用的部分。 + +### Groovy 相关资源 + +[Apache Groovy 网站][10] 上有非常多的文档。另一个很棒的 Groovy 资源是 [Mr. Haki][11]。[Baeldung 网站][12] 提供了大量 Java 和 Groovy 的有用教程。学习 Groovy 还有一个很棒的原因,那就是可以接着学习 [Grails][13],后者是一个优秀的、高效率的全栈 Web 框架。它基于许多优秀组件构建而成,比如有 Hibernate、Spring Boot 和 Micronaut 等。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/3/maps-groovy-vs-java + +作者:[Chris Hermansen][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) +[2]: https://opensource.com/article/22/1/creating-lists-groovy-java +[3]: https://opensource.com/article/22/2/accumulating-lists-groovy-vs-java +[4]: https://en.wikipedia.org/wiki/Associative_array +[5]: https://sdkman.io/ +[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+map +[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system +[8]: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html +[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[10]: https://groovy-lang.org/ +[11]: https://blog.mrhaki.com/ +[12]: https://www.baeldung.com/ +[13]: https://grails.org/ diff --git a/published/20220305 I Tested The New Maui Shell On My Linux Phone. Here-s What I Found.md b/published/202203/20220305 I Tested The New Maui Shell On My Linux Phone. Here-s What I Found.md similarity index 100% rename from published/20220305 I Tested The New Maui Shell On My Linux Phone. Here-s What I Found.md rename to published/202203/20220305 I Tested The New Maui Shell On My Linux Phone. Here-s What I Found.md diff --git a/published/20220305 Vim vs Nano- What Should You Choose.md b/published/202203/20220305 Vim vs Nano- What Should You Choose.md similarity index 100% rename from published/20220305 Vim vs Nano- What Should You Choose.md rename to published/202203/20220305 Vim vs Nano- What Should You Choose.md diff --git a/published/20220307 Budgie 10.6 is Here as its First Release Under the New Organization.md b/published/202203/20220307 Budgie 10.6 is Here as its First Release Under the New Organization.md similarity index 100% rename from published/20220307 Budgie 10.6 is Here as its First Release Under the New Organization.md rename to published/202203/20220307 Budgie 10.6 is Here as its First Release Under the New Organization.md diff --git a/published/202203/20220307 Using FileZilla for Connecting to SFTP Server Via GUI.md b/published/202203/20220307 Using FileZilla for Connecting to SFTP Server Via GUI.md new file mode 100644 index 0000000000..9159514c01 --- /dev/null +++ b/published/202203/20220307 Using FileZilla for Connecting to SFTP Server Via GUI.md @@ -0,0 +1,160 @@ +[#]: subject: "Using FileZilla for Connecting to SFTP Server Via GUI" +[#]: via: "https://itsfoss.com/filezilla-ubuntu/" +[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/" +[#]: collector: "lujun9972" +[#]: translator: "hwlife" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14410-1.html" + +使用 FileZilla 以图形界面连接 SFTP 服务器 +====== + +![](https://img.linux.net.cn/data/attachment/album/202203/29/164256iljy9w3n053qv28x.jpg) + +如果你问那些极客系统管理员,他们会肯定的说使用 [rsync 或者 scp 命令在远程服务器和本地系统之间传输文件][1]。 + +然而,这些都是命令行方式,并不是每个人都能用起来感到舒适。 + +谢天谢地的是,有一些图形化工具能够让你从远程服务器来传输文件。 + +[FileZilla][2] 是一个流行的、跨平台的传输文件为目的开源软件。它支持使用通过 TLS 或者 SSL 加密的 FTP 协议(FTPS),也支持借助 SSH 的 FTP 协议,以及旧的 FTP 协议。 + +让我展示怎样在 Linux 上安装 FileZilla 然后用它来文件传输。 + +那么,让我们开始吧! + +### 在 Ubuntu 和其他 Linux 发行版上安装 FileZilla + +你可以使用源码来安装,但是还是建议使用你的发行版提供的软件包。因为它是一个热门软件,它应该在许多 Linux 发行版(即便不是全部)的软件仓库中可用。请使用你的发行版的软件中心和包管理器来安装。 + +在 Ubuntu 上,你可以从软件中心来安装它: + +![FileZilla is available in the Ubuntu Software Center][3] + +你也可以使用命令行的方式来安装它: + +``` +sudo apt install filezilla +``` + +如果你看到 [软件包不存在的错误][4],你应该 [开启 Universe 仓库][5]。 + +一旦安装成功,打开菜单(通过按 `Super` 键),键入 “FileZilla”来启动它。 + +![Start FileZilla from the system menu][6] + +### 使用 FileZilla + +第一次使用 FileZilla 时,你将会看到如下图所示的一个界面: + +![Screenshot of FileZilla running][7] + +左边窗口显示来自你本地系统的文件和目录。右边窗口显示目前是空的。当你连接到远程服务器时,来自你的远程系统的文件会显示在这里。 + +在我向你展示之前,让我分享一下关于理解 FileZilla 图形界面重要方面的一些细节。 + +#### 了解 FileZilla 图形界面 + +下图总体上给你展示了 FileZilla 窗口布局的不同部分。 + +![FileZilla Window Layout | image credit][8] + +图形界面由 6 个不同的区域/窗口来组成。让我简短的给你解释一下: + +**1、工具栏**:它有许多选项,如打开站点管理器、刷新本地和远程目录文件和文件列表、开始处理当前的文件传输队列、停止正在传输的任务并取消队列中的文件,等等。 + +**2、快速连接栏**:顾名思义,它允许你快速连接到一个远程站点,除了主机名、用户名、密码和端口之外,不需要指定更多细节。 + +**3、消息日志**:它显示了一个日志,不论你连接成功与否。错误消息标记为红色,正常消息为白色,命令是蓝色。 + +**4 & 5、本地窗口和远程窗口**:这两个窗口非常相似,除了本地窗口显示本地目录内容,并且有用来上传文件的上下文菜单;而远程窗口显示的是远程目录的内容,并有从远程目录下载到本地文件的选项。 + +**6、传输队列**:最后,传输队列窗口显示正在传输的项目的状态和它们的传输速度,以及队列中的文件和传输历史(仅限当前实例)。 + +#### 使用 FileZilla 连接到 SFTP 服务器 + +你需要知道远程服务器的用户名、密码和 IP 地址。远程服务器也应该被设置成能够接受以这些信息进行的连接。你还需要在目标文件夹有正确的权限设置。 + +要新增一个 SFTP 连接,你需要打开站点管理器。有两种方式可以打开它。 + +在菜单栏上的“文件Files”菜单选项下有一个“站点管理器Site Manager”。或者,你可以直接点击工具栏上的“站点管理器”图标。 + +![the Site Manager button on the toolbar][9] + +一旦站点管理器对话框弹出,点击“新站点New site”按钮,并(可选地)重命名添加到条目中的新站点。我叫我的站点为“test8”。 + +![screenshot of the Site Manager][10] + +在右侧的“常规General”标签下,确保所使用的协议与服务器管理员为你设置的相一致。在我的例子中,我设置了一个 SFTP 服务器(借助 SSH 通道的 FTPFTP over SSH),因此我选择了“SFTP - SSH 文件传输协议SFTP – SSH File Transfer Protocol”。 + +下一个字段填写远程服务器的 IP 地址。 + +如果你没有设置“端口号Port”,FileZilla 将假定要使用的端口号为缺省的 SSH 协议的 22 端口。 + +“登录类型Logon Type”下拉列表有几个选项。在“常规Normal”登录方式下,你只需要提供用户名和密码。 + +如果你设置了一对公钥和私钥来验证你的 SSH 用户连接,那么可以使用“密钥文件授权Key file authentication”方式。 + +一旦你为远程服务器和认证填写了所有适当的细节,就可以点击底部的“连接Connect”按钮连接到站点。别担心,你刚刚建立连接的新站点将会按“登录类型”保存起来。 + +![Remote pane being populated after a successful connection][11] + +如果你看到一个 “连接到 <主机 IP 地址>” 的状态消息,并且最近的状态消息是 “目录列表 "/" 显示成功”,说明你已经成功的连接到了远程的 SFTP 服务器(使用 SSH 协议的 FTP)。 + +另一个 SFTP 连接成功的标志是,当连接成功建立的时候,远程目录窗口有了很多消息。 + +#### 发送文件到远程系统 + +你必须 **确保你位于要传输文件的目录里**。传输文件非常简单,只需**双击文件**,无需指定指定目标位置。 + +如果你在左边窗口双击了一个文件,它立即传输到右边科技的目录里(或者有传输任务的话,加到队列中)。 + +同样,从右边窗口到左边窗口也是一样双击,即从远程服务器到本地。**这就是为什么本地和远程系统都要在正确的位置是非常重要的原因**。 + +此外,你也可以鼠标右击文件上传它们(或者加它们到上传队列)。目标位置总是 FileZilla 界面中显示的目录。 + +![Transfer queue pane showing the local file name, remote destination, transfer speed and an ETA][12] + +除了方便和快捷方面,这两种上传的文件方式没有什么不同。 + +#### 下载远程系统中的文件 + +像上传文件一样,当从远程服务器传输文件到本地时也有两种方式,但不是“上传”而是“下载”。 + +下载的文件将放在本地目录窗口中,也就是你当前打开的本地窗口。 + +你将会注意到除了发送方和接收方不同之外,下载和上传文件的行为是一样的。除非连接数受到限制,否则文件传输将是并行进行的。 + +### 总结 + +厉害!有了这些基础知识,你应该能够在你的计算机和服务器之间传输文件。我希望你能够学到一些新东西 : ) + +如果你感到这些对你有帮助,随意在评论部分留下你的问题、建议或简单的一句 “thank you”。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/filezilla-ubuntu/ + +作者:[Pratham Patel][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/pratham/ +[b]: https://github.com/lujun9972 +[1]: https://linuxhandbook.com/transfer-files-ssh/ +[2]: https://filezilla-project.org/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/filezilla-ubuntu-software-center.png?resize=751%2C382&ssl=1 +[4]: https://itsfoss.com/unable-to-locate-package-error-ubuntu/ +[5]: https://itsfoss.com/ubuntu-repositories/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/filezilla-ubuntu.png?resize=763%2C224&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/01_filezilla.webp?resize=800%2C431&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/02_filezilla_layout.webp?resize=800%2C504&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/03_site_manager_annotated.webp?resize=386%2C170&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/04_site_manager.webp?resize=800%2C577&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/05_successful_connection.webp?resize=800%2C431&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/07_transfer_pane_populated-1.webp?resize=800%2C431&ssl=1 +[13]: https://itsfoss.community/ diff --git a/published/20220308 Coolero- Open-Source App to Monitor and Control Cooling Devices.md b/published/202203/20220308 Coolero- Open-Source App to Monitor and Control Cooling Devices.md similarity index 100% rename from published/20220308 Coolero- Open-Source App to Monitor and Control Cooling Devices.md rename to published/202203/20220308 Coolero- Open-Source App to Monitor and Control Cooling Devices.md diff --git a/published/20220309 Changing Linux System Language (Locales) From Command Line on Ubuntu and Debian Based Distros.md b/published/202203/20220309 Changing Linux System Language (Locales) From Command Line on Ubuntu and Debian Based Distros.md similarity index 100% rename from published/20220309 Changing Linux System Language (Locales) From Command Line on Ubuntu and Debian Based Distros.md rename to published/202203/20220309 Changing Linux System Language (Locales) From Command Line on Ubuntu and Debian Based Distros.md diff --git a/published/20220309 Good News- Apex Legends Now Officially Works on Steam Deck and Linux.md b/published/202203/20220309 Good News- Apex Legends Now Officially Works on Steam Deck and Linux.md similarity index 100% rename from published/20220309 Good News- Apex Legends Now Officially Works on Steam Deck and Linux.md rename to published/202203/20220309 Good News- Apex Legends Now Officially Works on Steam Deck and Linux.md diff --git a/published/20220309 Nitrux 2.0 Review- Stunning Distro with a Few Rough Edges.md b/published/202203/20220309 Nitrux 2.0 Review- Stunning Distro with a Few Rough Edges.md similarity index 100% rename from published/20220309 Nitrux 2.0 Review- Stunning Distro with a Few Rough Edges.md rename to published/202203/20220309 Nitrux 2.0 Review- Stunning Distro with a Few Rough Edges.md diff --git a/published/202203/20220309 Using Homebrew Package Manager on Fedora Linux.md b/published/202203/20220309 Using Homebrew Package Manager on Fedora Linux.md new file mode 100644 index 0000000000..a68efd7737 --- /dev/null +++ b/published/202203/20220309 Using Homebrew Package Manager on Fedora Linux.md @@ -0,0 +1,147 @@ +[#]: subject: "Using Homebrew Package Manager on Fedora Linux" +[#]: via: "https://fedoramagazine.org/using-homebrew-package-manager-on-fedora-linux/" +[#]: author: "Mehdi Haghgoo https://fedoramagazine.org/author/powergame/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14380-1.html" + +在 Fedora Linux 上使用 Homebrew 包管理器 +====== + +![](https://img.linux.net.cn/data/attachment/album/202203/21/193616z7kvf71b7z48kn92.jpg) + +### 简介 + +Homebrew 是一个 macOS 的包管理器,用于在 macOS 上安装 UNIX 工具。但是,它也可以在 Linux(和 Windows WSL)上使用。它是用 Ruby 编写的,并提供主机系统(macOS 或 Linux)可能不提供的软件包,因此它在操作系统包管理器之外提供了一个辅助的包管理器。此外,它只以非 root 用户身份在前缀 `/home/linuxbrew/.linuxbrew` 或 `~/.linuxbrew` 下安装软件包,不会污染系统路径。这个包管理器在 Fedora Linux 上也适用。在这篇文章中,我将尝试告诉你 Homebrew 与 Fedora Linux 包管理器 `dnf` 有什么不同,为什么你可能想在 Fedora Linux 上安装和使用它,以及如何安装。 + +> 免责声明 +> +> 你应该经常检查你在系统上安装的软件包和二进制文件。Homebrew 包通常以非 sudoer 用户运行,并工作在专门的前缀的路径下,因此它们不太可能造成破坏或错误配置。然而,所有的安装操作都要自己承担风险。作者和 Fedora 社区不对任何可能直接或间接因遵循这篇文章而造成的损失负责。 + +### Homebrew 如何工作 + +Homebrew 在底层使用 Ruby 和 Git。它使用特殊的 Ruby 脚本从源代码构建软件,这些脚本被称为 “配方formula”,看起来像这样(使用 `wget` 包作为例子): + +(LCTT 译注:Homebrew 本身意思是“家酿”,在这个软件中,有各种类似于酿酒的比喻。) + +``` +class Wget < Formula + homepage "https://www.gnu.org/software/wget/" + url "https://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz" + sha256 "52126be8cf1bddd7536886e74c053ad7d0ed2aa89b4b630f76785bac21695fcd" + + def install + system "./configure", "--prefix=#{prefix}" + system "make", "install" + end +end +``` + +### Homebrew 与 dnf 有何不同 + +Homebrew 是一个包管理器,提供了许多 UNIX 软件工具和包的最新版本,例如 FFmpeg、Composer、Minikube 等。当你想安装一些由于某种原因在 Fedora Linux RPM 仓库中没有的软件包时,它就会证明很有用。所以,它并不能取代 `dnf`。 + +### 安装 Homebrew + +在开始安装 Homebrew 之前,确保你已经安装了 glibc 和 gcc。这些工具可以在 Fedora 上通过以下方式安装: + +``` +sudo dnf groupinstall "Development Tools" +``` + +然后,通过在终端运行以下命令来安装 Homebrew: + +``` +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +``` + +在安装过程中,你会被提示输入你的 `sudo` 密码。另外,你可以选择 Homebrew 的安装前缀,但默认的前缀就可以了。在安装过程中,你将成为 Homebrew 前缀目录的所有者,这样你就不必输入 `sudo` 密码来安装软件包。安装将需要数分钟。完成后,运行以下命令,将 `brew` 添加到你的 `PATH` 中: + +``` +echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bash_profile +eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" +``` + +### 安装和检查软件包 + +要在 Homebrew 上使用“配方”安装一个软件包,只需运行: + +``` +brew install +``` + +将 `` 替换为你要安装的“配方”的名称。例如,要安装 Minikube,只需运行: + +``` +brew install minikube +``` + +你也可以用以下方式搜索“配方”: + +``` +brew search +``` + +要获得一个“配方”的信息,请运行: + +``` +brew info +``` + +另外,你可以用以下命令查看所有已安装的“配方”: + +``` +brew list +``` + +### 卸载软件包 + +要从你的 Homebrew 前缀中卸载一个软件包,请运行: + +``` +brew uninstall +``` + +### 升级软件包 + +要升级一个用 Homebrew 安装的特定软件包,请运行: + +``` +brew upgrade +``` + +要更新 Homebrew 和所有已安装的“配方”到最新版本,请运行: + +``` +brew update +``` + +### 总结 + +Homebrew 是一个简单的包管理器,可以与 `dnf` 一起成为有用的工具(两者完全没有关系)。尽量坚持使用 Fedora 原生的 `dnf` 包管理器,以避免软件冲突。然而,如果你在 Fedora Linux 软件库中没有找到某个软件,那么你也许可以用 Homebrew 找到并安装它。请看 [“配方”列表][2] 以了解有哪些可用的软件。另外,Fedora Linux 上的 Homebrew 还不支持图形化应用(在 Homebrew 术语中称为“酒桶cask”)。至少,我在安装 GUI 应用时没有成功过。 + +### 参考资料和进一步阅读 + +要了解更多关于 Homebrew 的信息,请查看以下资源: + + * Homebrew 主页: + * Homebrew 文档: + * 维基百科 Homebrew 页面: + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/using-homebrew-package-manager-on-fedora-linux/ + +作者:[Mehdi Haghgoo][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/powergame/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2022/03/homebrew_sized-up-816x346.png +[2]: https://formulae.brew.sh/formula/ diff --git a/published/202203/20220310 How to use undocumented web APIs.md b/published/202203/20220310 How to use undocumented web APIs.md new file mode 100644 index 0000000000..3ca93cf7ec --- /dev/null +++ b/published/202203/20220310 How to use undocumented web APIs.md @@ -0,0 +1,229 @@ +[#]: subject: "How to use undocumented web APIs" +[#]: via: "https://jvns.ca/blog/2022/03/10/how-to-use-undocumented-web-apis/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: "lxbwolf" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14358-1.html" + +如何调用没有文档说明的 Web API +====== + +![](https://img.linux.net.cn/data/attachment/album/202203/15/103119ab6yoika09og669a.jpg) + +大家好!几天前我写了篇 [小型的个人程序][1] 的文章,里面提到了调用没有文档说明的“秘密” API 很有意思,你需要从你的浏览器中把 cookie 复制出来才能访问。 + +有些读者问如何实现,因此我打算详细描述下,其实过程很简单。我们还会谈谈在调用没有文档说明的 API 时,可能会遇到的错误和道德问题。 + +我们用谷歌 Hangouts 举例。我之所以选择它,并不是因为这个例子最有用(我认为官方的 API 更实用),而是因为在这个场景中更有用的网站很多是小网站,而小网站的 API 一旦被滥用,受到的伤害会更大。因此我们使用谷歌 Hangouts,因为我 100% 肯定谷歌论坛可以抵御这种试探行为。 + +我们现在开始! + +### 第一步:打开开发者工具,找一个 JSON 响应 + +我浏览了 ,在 Firefox 的开发者工具中打开“网络Network”标签,找到一个 JSON 响应。你也可以使用 Chrome 的开发者工具。 + +打开之后界面如下图: + +![][2] + +找到其中一条 “类型Type” 列显示为 `json` 的请求。 + +为了找一条感兴趣的请求,我找了好一会儿,突然我找到一条 “people” 的端点,看起来是返回我们的联系人信息。听起来很有意思,我们来看一下。 + +### 第二步:复制为 cURL + +下一步,我在感兴趣的请求上右键,点击 “复制Copy” -> “复制为 cURLCopy as cURL”。 + +然后我把 `curl` 命令粘贴到终端并运行。下面是运行结果: + +``` +$ curl 'https://people-pa.clients6.google.com/v2/people/?key=REDACTED' -X POST ........ (省略了大量请求标头) +Warning: Binary output can mess up your terminal. Use "--output -" to tell +Warning: curl to output it to your terminal anyway, or consider "--output +Warning: " to save to a file. +``` + +你可能会想 —— 很奇怪,“二进制的输出在你的终端上无法正常显示” 是什么错误?原因是,浏览器默认情况下发给服务器的请求头中有 `Accept-Encoding: gzip, deflate` 参数,会把输出结果进行压缩。 + +我们可以通过管道把输出传递给 `gunzip` 来解压,但是我们发现不带这个参数进行请求会更简单。因此我们去掉一些不相关的请求头。 + +### 第三步:去掉不相关的请求头 + +下面是我从浏览器获得的完整 `curl` 命令。有很多行!我用反斜杠(`\`)把请求分开,这样每个请求头占一行,看起来更清晰: + +``` +curl 'https://people-pa.clients6.google.com/v2/people/?key=REDACTED' \ +-X POST \ +-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0' \ +-H 'Accept: */*' \ +-H 'Accept-Language: en' \ +-H 'Accept-Encoding: gzip, deflate' \ +-H 'X-HTTP-Method-Override: GET' \ +-H 'Authorization: SAPISIDHASH REDACTED' \ +-H 'Cookie: REDACTED' +-H 'Content-Type: application/x-www-form-urlencoded' \ +-H 'X-Goog-AuthUser: 0' \ +-H 'Origin: https://hangouts.google.com' \ +-H 'Connection: keep-alive' \ +-H 'Referer: https://hangouts.google.com/' \ +-H 'Sec-Fetch-Dest: empty' \ +-H 'Sec-Fetch-Mode: cors' \ +-H 'Sec-Fetch-Site: same-site' \ +-H 'Sec-GPC: 1' \ +-H 'DNT: 1' \ +-H 'Pragma: no-cache' \ +-H 'Cache-Control: no-cache' \ +-H 'TE: trailers' \ +--data-raw 'personId=101777723309&personId=1175339043204&personId=1115266537043&personId=116731406166&extensionSet.extensionNames=HANGOUTS_ADDITIONAL_DATA&extensionSet.extensionNames=HANGOUTS_OFF_NETWORK_GAIA_GET&extensionSet.extensionNames=HANGOUTS_PHONE_DATA&includedProfileStates=ADMIN_BLOCKED&includedProfileStates=DELETED&includedProfileStates=PRIVATE_PROFILE&mergedPersonSourceOptions.includeAffinity=CHAT_AUTOCOMPLETE&coreIdParams.useRealtimeNotificationExpandedAcls=true&requestMask.includeField.paths=person.email&requestMask.includeField.paths=person.gender&requestMask.includeField.paths=person.in_app_reachability&requestMask.includeField.paths=person.metadata&requestMask.includeField.paths=person.name&requestMask.includeField.paths=person.phone&requestMask.includeField.paths=person.photo&requestMask.includeField.paths=person.read_only_profile_info&requestMask.includeField.paths=person.organization&requestMask.includeField.paths=person.location&requestMask.includeField.paths=person.cover_photo&requestMask.includeContainer=PROFILE&requestMask.includeContainer=DOMAIN_PROFILE&requestMask.includeContainer=CONTACT&key=REDACTED' +``` + +第一眼看起来内容有很多,但是现在你不需要考虑每一行是什么意思。你只需要把不相关的行删掉就可以了。 + +我通常通过删掉某行查看是否有错误来验证该行是不是可以删除 —— 只要请求没有错误就一直删请求头。通常情况下,你可以删掉 `Accept*`、`Referer`、`Sec-*`、`DNT`、`User-Agent` 和缓存相关的头。 + +在这个例子中,我把请求删成下面的样子: + +``` +curl 'https://people-pa.clients6.google.com/v2/people/?key=REDACTED' \ +-X POST \ +-H 'Authorization: SAPISIDHASH REDACTED' \ +-H 'Content-Type: application/x-www-form-urlencoded' \ +-H 'Origin: https://hangouts.google.com' \ +-H 'Cookie: REDACTED'\ +--data-raw 'personId=101777723309&personId=1175339043204&personId=1115266537043&personId=116731406166&extensionSet.extensionNames=HANGOUTS_ADDITIONAL_DATA&extensionSet.extensionNames=HANGOUTS_OFF_NETWORK_GAIA_GET&extensionSet.extensionNames=HANGOUTS_PHONE_DATA&includedProfileStates=ADMIN_BLOCKED&includedProfileStates=DELETED&includedProfileStates=PRIVATE_PROFILE&mergedPersonSourceOptions.includeAffinity=CHAT_AUTOCOMPLETE&coreIdParams.useRealtimeNotificationExpandedAcls=true&requestMask.includeField.paths=person.email&requestMask.includeField.paths=person.gender&requestMask.includeField.paths=person.in_app_reachability&requestMask.includeField.paths=person.metadata&requestMask.includeField.paths=person.name&requestMask.includeField.paths=person.phone&requestMask.includeField.paths=person.photo&requestMask.includeField.paths=person.read_only_profile_info&requestMask.includeField.paths=person.organization&requestMask.includeField.paths=person.location&requestMask.includeField.paths=person.cover_photo&requestMask.includeContainer=PROFILE&requestMask.includeContainer=DOMAIN_PROFILE&requestMask.includeContainer=CONTACT&key=REDACTED' +``` + +这样我只需要 4 个请求头:`Authorization`、`Content-Type`、`Origin` 和 `Cookie`。这样容易管理得多。 + +### 第四步:在 Python 中发请求 + +现在我们知道了我们需要哪些请求头,我们可以把 `curl` 命令翻译进 Python 程序!这部分是相当机械化的过程,目标仅仅是用 Python 发送与 cUrl 相同的数据。 + +下面是代码实例。我们使用 Python 的 `requests` 包实现了与前面 `curl` 命令相同的功能。我把整个长请求分解成了元组的数组,以便看起来更简洁。 + +``` +import requests +import urllib + +data = [ + ('personId','101777723'), # I redacted these IDs a bit too + ('personId','117533904'), + ('personId','111526653'), + ('personId','116731406'), + ('extensionSet.extensionNames','HANGOUTS_ADDITIONAL_DATA'), + ('extensionSet.extensionNames','HANGOUTS_OFF_NETWORK_GAIA_GET'), + ('extensionSet.extensionNames','HANGOUTS_PHONE_DATA'), + ('includedProfileStates','ADMIN_BLOCKED'), + ('includedProfileStates','DELETED'), + ('includedProfileStates','PRIVATE_PROFILE'), + ('mergedPersonSourceOptions.includeAffinity','CHAT_AUTOCOMPLETE'), + ('coreIdParams.useRealtimeNotificationExpandedAcls','true'), + ('requestMask.includeField.paths','person.email'), + ('requestMask.includeField.paths','person.gender'), + ('requestMask.includeField.paths','person.in_app_reachability'), + ('requestMask.includeField.paths','person.metadata'), + ('requestMask.includeField.paths','person.name'), + ('requestMask.includeField.paths','person.phone'), + ('requestMask.includeField.paths','person.photo'), + ('requestMask.includeField.paths','person.read_only_profile_info'), + ('requestMask.includeField.paths','person.organization'), + ('requestMask.includeField.paths','person.location'), + ('requestMask.includeField.paths','person.cover_photo'), + ('requestMask.includeContainer','PROFILE'), + ('requestMask.includeContainer','DOMAIN_PROFILE'), + ('requestMask.includeContainer','CONTACT'), + ('key','REDACTED') +] +response = requests.post('https://people-pa.clients6.google.com/v2/people/?key=REDACTED', + headers={ + 'X-HTTP-Method-Override': 'GET', + 'Authorization': 'SAPISIDHASH REDACTED', + 'Content-Type': 'application/x-www-form-urlencoded', + 'Origin': 'https://hangouts.google.com', + 'Cookie': 'REDACTED', + }, + data=urllib.parse.urlencode(data), +) + +print(response.text) +``` + +我执行这个程序后正常运行 —— 输出了一堆 JSON 数据!太棒了! + +你会注意到有些地方我用 `REDACTED` 代替了,因为如果我把原始数据列出来你就可以用我的账号来访问谷歌论坛了,这就很不好了。 + +### 运行结束! + +现在我可以随意修改 Python 程序,比如传入不同的参数,或解析结果等。 + +我不打算用它来做其他有意思的事了,因为我压根对这个 API 没兴趣,我只是用它来阐述请求 API 的过程。 + +但是你确实可以对返回的一堆 JSON 做一些处理。 + +### curlconverter 看起来很强大 + +有人评论说可以使用 自动把 curl 转换成 Python(和一些其他的语言!),这看起来很神奇 —— 我都是手动转的。我在这个例子里使用了它,看起来一切正常。 + +### 追踪 API 的处理过程并不容易 + +我不打算夸大追踪 API 处理过程的难度 —— API 的处理过程并不明显!我也不知道传给这个谷歌论坛 API 的一堆参数都是做什么的! + +但是有一些参数看起来很直观,比如 `requestMask.includeField.paths=person.email` 可能表示“包含每个人的邮件地址”。因此我只关心我能看懂的参数,不关心看不懂的。 + +### (理论上)适用于所有场景 + +可能有人质疑 —— 这个方法适用于所有场景吗? + +答案是肯定的 —— 浏览器不是魔法!浏览器发送给你的服务器的所有信息都是 HTTP 请求。因此如果我复制了浏览器发送的所有的 HTTP 请求头,那么后端就会认为请求是从我的浏览器发出的,而不是用 Python 程序发出的。 + +当然,我们去掉了一些浏览器发送的请求头,因此理论上后端是可以识别出来请求是从浏览器还是 Python 程序发出的,但是它们通常不会检查。 + +这里有一些对读者的告诫 —— 一些谷歌服务的后端会通过令人难以理解(对我来说是)方式跟前端通信,因此即使理论上你可以模拟前端的请求,但实际上可能行不通。可能会遭受更多攻击的大型 API 会有更多的保护措施。 + +我们已经知道了如何调用没有文档说明的 API。现在我们再来聊聊可能遇到的问题。 + +### 问题 1:会话 cookie 过期 + +一个大问题是我用我的谷歌会话 cookie 作为身份认证,因此当我的浏览器会话过期后,这个脚本就不能用了。 + +这意味着这种方式不能长久使用(我宁愿调一个真正的 API),但是如果我只是要一次性快速抓取一小组数据,那么可以使用它。 + +### 问题 2:滥用 + +如果我正在请求一个小网站,那么我的 Python 脚本可能会把服务打垮,因为请求数超出了它们的处理能力。因此我请求时尽量谨慎,尽量不过快地发送大量请求。 + +这尤其重要,因为没有官方 API 的网站往往是些小网站且没有足够的资源。 + +很明显在这个例子中这不是问题 —— 我认为在写这篇文章的过程我一共向谷歌论坛的后端发送了 20 次请求,他们肯定可以处理。 + +如果你用自己的账号身份过度访问这个 API 并导致了故障,那么你的账号可能会被暂时封禁(情理之中)。 + +我只下载我自己的数据或公共的数据 —— 我的目的不是寻找网站的弱点。 + +### 请记住所有人都可以访问你没有文档说明的 API + +我认为本文最重要的信息并不是如何使用其他人没有文档说明的 API。虽然很有趣,但是也有一些限制,而且我也不会经常这么做。 + +更重要的一点是,任何人都可以这么访问你后端的 API!每个人都有开发者工具和网络标签,查看你传到后端的参数、修改它们都很容易。 + +因此如果一个人通过修改某些参数来获取其他用户的信息,这不值得提倡。我认为提供公开 API 的大部分开发者们都知道,但是我之所以再提一次,是因为每个初学者都应该了解。: ) + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2022/03/10/how-to-use-undocumented-web-apis/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[wxy +](https://github.com/wxy +) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://jvns.ca/blog/2022/03/08/tiny-programs/ +[2]: https://jvns.ca/images/network-tab.png diff --git a/published/20220310 KDE Plasma 5.24 Review. A Crafted Desktop to Dominate the Linux World.md b/published/202203/20220310 KDE Plasma 5.24 Review. A Crafted Desktop to Dominate the Linux World.md similarity index 100% rename from published/20220310 KDE Plasma 5.24 Review. A Crafted Desktop to Dominate the Linux World.md rename to published/202203/20220310 KDE Plasma 5.24 Review. A Crafted Desktop to Dominate the Linux World.md diff --git a/published/202203/20220310 Piwigo- An Open-Source Google Photos Alternative That You Can Self-Host.md b/published/202203/20220310 Piwigo- An Open-Source Google Photos Alternative That You Can Self-Host.md new file mode 100644 index 0000000000..0aeead1e08 --- /dev/null +++ b/published/202203/20220310 Piwigo- An Open-Source Google Photos Alternative That You Can Self-Host.md @@ -0,0 +1,158 @@ +[#]: subject: "Piwigo: An Open-Source Google Photos Alternative That You Can Self-Host" +[#]: via: "https://itsfoss.com/piwigo/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14389-1.html" + +Piwigo:一个你可以自行托管的开源谷歌照片替代品 +====== + +> 如果你想摆脱“谷歌照片”,Piwigo 是一个令人印象深刻的开源替代方案,能够自我托管。让我们来探讨一下它的更多信息。 + +“谷歌照片”是备份你的照片和视频的最流行的选择之一。(LCTT 译注:并不是……) + +考虑到它是大多数安卓手机的默认选择,使用谷歌照片管理照片/视频是一种无缝体验。 + +但是,如果你想从它那里转移到一些开源的、对隐私更友好的东西怎么办?不只是谷歌照片,还有其它一些照片托管平台也是专有的。 + +请看看 Piwigo,一个开源的 [照片管理软件][1] 来帮助你。 + +### Piwigo:你可以自行托管的开源照片库 + +![][2] + +[Piwigo][3] 是一个开源解决方案,可以帮助管理你的照片和视频。 + +你可以选择自己托管,控制你的数据,或者选择云托管(**数据存储在法国,有备份**)。 + +顺便说一句,该公司起源于法国。 + +不仅仅是针对个人,Piwigo 也为组织和团队量身定做。 + +如果你担心使用谷歌照片或类似服务上传时的隐私政策,Piwigo 可以成为一个出色的替代品。 + +Piwigo 提供了一系列的功能和细粒度的控制来管理你的照片。 + +### Piwigo 的功能 + +![][4] + +虽然它是主流服务的一个可行的替代品,但它为个人和组织提供了先进的功能。 + +一些功能包括: + + * 通过云托管(\*.piwigo.com)获得你的专用子域 + * 能够批量下载 + * 创建相册 + * 选择照片来分配现有的相册集 + * 通过链接分享照片 + * 用公共和私人模式进行访问管理 + * 能够对用户进行分组,以管理你的相册或照片(对组织/团队来说很有效)。 + * 基本分析,以跟踪你的使用情况和使用的存储空间 + * 支持向相册/照片添加标签 + * 支持深色模式 + * 能够编辑照片的元数据 + * 过滤器,以快速找到照片/相册 + * 支持 JPG/JPEG、PNG 和 GIF 文件(针对个人) + * 支持所有文件类型(仅适用于企业使用) + * 为个人用户提供无限的存储空间 + * 支持自定义域名(即使是云托管选项) + * 插件可扩展功能 + * 支持主题 + * 移动支持(安卓和 iOS) + +除了上述功能外,你还可以获得改善用户管理和 Piwigo 的整体用户体验的更多选项。 + +![][5] + +我使用其针对个人的云托管选项(**有 30 天的试用期**)对其进行了快速测试。让我分享我的一些见解,以帮助你在尝试之前了解它们。 + +### 使用 Piwigo 来管理照片 + +当你注册一个账户时,你可以指定你的自定义子域。 + +例如,我把我的测试账户放在 **ankushsoul.piwigo.com**。 + +![][6] + +任何人都可以通过在他们的浏览器中输入上述 URL 来访问我公开分享的照片/相册。 + +所以,最好是尽可能保持子域的名称独一无二。在这两种情况下,你也可以将相册/照片限制给登录的用户(或你自己),其他人即使知道你的子域,也无法访问你的照片。 + +![][7] + +你可以前往它的仪表板,检查你的存储使用情况和整体活动情况。 + +它有两个激活的插件,一个用于内部功能,另一个默认用于打击垃圾信息。 + +![][8] + +你会发现有很多插件可以加强批量管理,启用管理员信息,激活相册的评论,在你的相册上添加到期时间,限制下载,以及访问一些令人兴奋的功能。 + +你可以花点时间浏览一下现有的插件选择,评估一下它们与谷歌照片相比能有多大用处。 + +当然,你在任何主流的云照片托管服务中都得不到这种控制。 + +所以,这很值得探索。 + +![][9] + +对于现有的其他功能,你可以管理多个用户,控制访问,发送通知(通过电子邮件),还可以进行一些维护活动。 + +总的来说,用户体验是相当好的。它可能没有提供最现代的用户界面,但它可以工作,而且很容易管理。 + +**注意**:考虑到 Play Store 上的应用没有收到最新的更新,移动体验(在 Android 上)可能并不令人满意。然而,你可以在他们的 GitHub 上找到最新版本的 APK 文件。 + +### 开始使用 Piwigo + +我认为 Piwigo 非常适合各类人使用,从想组织照片的人,到想合作/分享图片的用户,都可以使用。 + +如果你选择自我托管,你应该查看它的 [文档][10] 和探索 [GitHub 页面][11]。 + +考虑到你独自管理它,你将需要适当地维护实例,并对你的数据进行备份。 + +如果你选择 [云托管选项][12](作为个人),定价从每年 **39 欧元** 开始,不限图片文件上传,如果你订阅 3 年,价格会更便宜。 + +![][13] + +个人计划没有提到具体的存储限制(无限)。因此,可以说你不应该有任何问题,除非你开始滥用该服务。 + +鉴于你在该服务中得到的控制权,大多数用户会更愿意使用云托管服务,而放弃像谷歌照片这样的服务。 + +企业/组织的定价计划将是昂贵的(每月)。然而,它支持企业的所有文件类型。 + +- [Piwigo][3] + +你认为像 Piwigo 这样的谷歌照片的自行托管替代品如何?你试过吗?云主机选项是主流选项的可行替代品吗? + +请在下面的评论中告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/piwigo/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/linux-photo-management-software/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/piwigo-feature.jpg?resize=800%2C424&ssl=1 +[3]: https://piwigo.com/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/piwigo-album-edit.png?resize=800%2C451&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/piwigo-upload.png?resize=800%2C665&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/piwigo-sign-up.png?resize=800%2C646&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/piwigo-dashboard.png?resize=800%2C435&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/piwigo-plugins.png?resize=800%2C499&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/piwigo-config.png?resize=800%2C632&ssl=1 +[10]: https://piwigo.org/doc/doku.php +[11]: https://github.com/Piwigo +[12]: https://piwigo.com/pricing +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/piwigo-pricing.png?resize=800%2C509&ssl=1 \ No newline at end of file diff --git a/published/202203/20220311 Zorin OS 16.1 Brings Much Needed Stability and Improvements.md b/published/202203/20220311 Zorin OS 16.1 Brings Much Needed Stability and Improvements.md new file mode 100644 index 0000000000..2814ffa5ae --- /dev/null +++ b/published/202203/20220311 Zorin OS 16.1 Brings Much Needed Stability and Improvements.md @@ -0,0 +1,71 @@ +[#]: subject: "Zorin OS 16.1 Brings Much Needed Stability and Improvements" +[#]: via: "https://www.debugpoint.com/2022/03/zorin-os-16-1-release/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14365-1.html" + +Zorin OS 16.1 带来了急需的稳定性和改进措施 +====== + +> Zorin OS 16.1 带来了安全补丁、新软件,团队的目标是打造更好的发行版。 + +Zorin OS 之所以受欢迎,是因为它为 Windows 用户的 Linux 之旅提供了一个完美的起点。由于其简单的设计、优雅的软件包选择和开箱即用的 Windows 外观,它是当今所有用户欢迎和追捧的 Linux 发行版之一。 + +自 [Zorin OS 16][1] 以来,经过近两个月的时间,这第一个小版本现在可以供已经在运行 16.0 版本的用户下载和升级了。 + +![Zorin OS 16.1 Desktop][2] + +### Zorin OS 16.1 - 新内容 + +Zorin OS 16.1 为你的系统带来了最新安全补丁,包括 LibreOffice 7.3 办公套件和一些更新的软件包。 + +如果你刚买了一台新的笔记本电脑或安装了一个新的游戏工作站,Zorin OS 16.1 还支持索尼的 PlayStation 5 Dual Sense 游戏控制器和苹果的魔术鼠标 2。此外,你还得到了对英特尔第 12 代处理器和英伟达 RTX 3050 显卡的出色支持。 + +此外,由于最新的软件包,Zorin 开发人员承诺对汽车 Wi-Fi 和打印机有更好的支持。 + +下面是这个小版本的更新包和应用的快速总结。 + + * 基于 Ubuntu 20.04.3 LTS + * Zorin 桌面,基于 GNOME 3.38.4 + * LibreOffice 7.3 + * Firefox 98 + * Linux Kernel 5.13 + * GIMP 2.10.18 + * Evolution 邮件客户端 + +如果你想深入了解这些变化,完整的细节可以在[这里][3]找到。 + +那么,在哪里下载? + +### 下载 + +在你点击下载之前,你应该知道它有一个“专业”版本,带有额外的主题和开箱即用的设置,价值 39 美元,而“核心”版本是完全免费下载的。你可以在下载页面阅读“专业版”和“核心版”的比较。 + +在我看来,核心版应该足够了,如果你有足够的经验,你可以改变设置,使其成为专业版。因此,我们推荐核心版用于一般用途。 + +- [下载 Zorin OS 16.1][5] + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/03/zorin-os-16-1-release/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/2021/12/zorin-os-16-lite-review-xfce/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/03/Zorin-OS-16.1-Desktop-1024x575.jpg +[3]: https://blog.zorin.com/2022/03/10/zorin-os-16-1-released-support-for-ukraine/ +[5]: https://zorin.com/os/download/ +[6]: https://t.me/debugpoint +[7]: https://twitter.com/DebugPoint +[8]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[9]: https://facebook.com/DebugPoint \ No newline at end of file diff --git a/published/202203/20220312 Best 5 Alternatives to Microsoft Office -Compared.md b/published/202203/20220312 Best 5 Alternatives to Microsoft Office -Compared.md new file mode 100644 index 0000000000..be3c7a91b2 --- /dev/null +++ b/published/202203/20220312 Best 5 Alternatives to Microsoft Office -Compared.md @@ -0,0 +1,169 @@ +[#]: subject: "Best 5 Alternatives to Microsoft Office [Compared]" +[#]: via: "https://www.debugpoint.com/2022/03/best-alternatives-microsoft-office-2022/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "aREversez" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14382-1.html" + +横向对比 5 款微软 Office 替代品 +====== + +![](https://img.linux.net.cn/data/attachment/album/202203/22/102722qhd38mnle30sejnt.jpg) + +> 在这篇文章中,我们将推荐 5 款可以替代微软 Office 的最佳软件,并从功能、操作难易程度等方面,对它们进行比较。看一看哪款更适合你? + +可以说,Office 办公软件是微软开发的最优质的软件之一,受到世界各地用户的青睐,广泛应用于各行各业,当属近几十年来软件市场涌现出来的精品。 + +不过大家都知道,微软 Office 不仅没有开发适用于 Linux 的版本,而且价格高昂。对于企业用户或者个人用户来说,Office 365 的价格就更贵了,远超普通人能接受的价格水平。 + +那么,有哪些软件可以替代微软 Office 呢? + +这篇文章推荐 5 款可以替代微软 Office 的最佳软件。 + +### LibreOffice + +![LibreOffice][1] + +首先推荐的是 [LibreOffice][2]。LibreOffice 是一款自由开源的办公套件,由文档基金会开发维护,支持 Linux、macOS 以及 Windows 系统。 + +LibreOffice 套件包括表格工具 [Calc][3]、文字处理工具 Writer、演示工具 Impress、画图工具 Draw 以及数据库工具 Base。 + +LibreOffice 办公软件的开发十分很活跃,同时不断提升对微软 Office 的兼容性。如果善加利用,LibreOffice 完全可以取代微软 Office。借助丰富的技术文档和社区资源,用户可以迅速掌握 LibreOffice 的使用方法。 + +企业用户也可以免费使用 LibreOffice,如果需要用它来完成关键工作,用户也可以购买配置服务和支持服务,相关费用十分低廉。 + +然而,LibreOffice 不提供像 Outlook 一样的邮箱服务。这可能是它的一个小缺点,不过好在现在的邮箱服务都可以在浏览器上运行。 + + * [主页][2] + * [商业版][4] + * [下载普通个人版][5] + * [帮助文档][6] + * [官方支持论坛][7] + +### Google Docs + +![Google Docs][8] + +搜索引擎巨头谷歌为用户免费提供了一套网页版的办公套件 —— [Google Docs][9],其中包括 Docs(文档编辑器)、Sheets(表格程序)、Slides(演示程序)。 + +用户可以在谷歌云盘中免费创建、打开文档。随时随地,自由存取。Google Docs 界面设计优美,内置工具栏、高级选项、拼写检查、语音输入功能(仅支持 Chrome 浏览器)、加密功能以及云存储服务。谷歌也为 iOS 系统和安卓系统提供了移动端,用户可以在移动设备上轻松打开、编辑文档。 + +Google Docs 最为人称道的功能在于它的模板。有了这些内置模板,用户可以迅速编辑出一份专业的文档。此外,通过邀请其他谷歌用户,还可以使用多人协作在线编辑功能。 + +如果你需要更多的功能,可以付费使用 Google Workspace。这是一套全面的整合方案,你可以通过 Google Forms 收集信息,并集成到你的文档和表格中、网站编辑工具 Google Sites、Google 日历等服务,保存为文档。 + + * [主页][9] + * [帮助文档][10] + +### OnlyOffice + +![OnlyOffice][11] + +[OnlyOffice][12](显示名字为 ONLYOFFICE)是一套自由开源的办公软件,包括文本编辑器、表格工具、演示软件,提供共享文件实时协作编辑、修改痕迹记录查看以及制作可供填写的表格等高级功能。 + +外观上,OnlyOffice 的功能区模仿了微软 Office 365 功能区的设计风格,能让用户快速上手。此外,OnlyOffice 对微软 Office 文件格式(.docx .xlsx 以及 .pptx)的兼容性更好,方便用户与他人共享文件。 + +值得一提的是,OnlyOffice 还推出了需要付费使用的企业版本 —— ONLYOFFICE Workspace。该版本增加了一些其他的高级功能,提供即时支持服务,非常适合那些预算紧张但对格式兼容性要求又很高的用户。 + +ONLYOFFICE Workspace 集成了邮箱客户端、客户关系管理产品、项目管理工具以及日历。总体来说,ONLYOFFICE Workspace 是一款不错的软件,但也有一些不足,如拼写检查、打印预览、页面尺寸以及漏洞等问题。不过也不需要过分担心,你可以在 GitHub 上传错误报告,向开发团队寻求帮助。 + + * [主页][12] + * [下载][14] + * [帮助文档][15] + +### Softmaker FreeOffice + +![FreeOffice][16] + +[FreeOffice][17] 由 SoftMaker 开发,是一套十分优秀的办公软件,包括 TextMaker(可替代 Word)、PlanMaker(可替代 Excel)以及 Presentations(可替代 PowerPoint)。FreeOffice 提供了两种用户界面:带有功能区选项的现代化界面与带有菜单和工具栏的传统界面,两种界面都十分受欢迎。此外,FreeOffice 还为触控设备提供专有的用户界面与功能。 + +FreeOffice 对 微软 Office 文档格式的兼容性是很好的,可以完成大部分工作。然而,你在处理开放文档格式(ODT)文件时可能会遇到一点麻烦,因为它的支持有限。 + +FreeOffice 是一款闭源软件。 + + * [主页][17] + * [下载][18] + * [帮助文档][19] + +### WPS Office + +![WPS Office][20] + +还记得金山办公软件吗? 它现在的名字叫做 WPS Office。WPS 取 **W**ord, **P**resentation 与 **S**preadsheets 的首字母组合而成。到今天,WPS Office 已有 30 年的发展历史,是老牌办公软件之一。WPS 作为办公软件,功能齐全,支持移动端在内的各类平台。 + +WPS 最具特色的功能在于支持实时协作编辑。使用 WPS,团队成员可以同时编辑一份共享文档。WPS 还为用户提供了超过 10 万种文档模板,帮助用户编辑出专业美观的文档与演示文件。 + +WPS 的标准版本可以免费下载使用,不过有一些高级功能需要付费。 + +如果你需要额外的功能,比如编辑 PDF 文件、云空间扩容、团队协作以及企业支持,可以考虑付费开通会员,使用 WPS 企业版。 + +注意,这是一款闭源软件,而且可能会推送广告。(LCTT 译注:该公司内部人士表示,免费的 Linux 版没广告。)该软件由中国金山软件公司开发。 + + * [主页][21] + * [帮助文档][22] + * [下载][23] + +### 对比表 + +下表基于功能以及其他细节,对上述 5 款办公软进行对比总结。 + +产品 | 价格 | 是否开源 | 优势 | 劣势 +---|---|---|---|--- +LibreOffice | 免费 | 开源 | 免费;跨平台;支持多种语言;完全支持 ODF 文件格式;对 微软 Office 兼容性最好;开发活跃 | 不提供邮箱应用;不提供项目管理功能;数据库基于 Java +Google Docs | 免费 | 闭源 | 免费;跨平台;良好的文档支持;随时随地存取云文档;完美支持移动端 | 需要网络连接;网络连接导致卡顿或延迟;不提供可供安装的版本 +OnlyOffice | 免费(基础功能) | 开源 | 用户界面酷似微软 Office;对微软 Office 文件拥有更好的兼容性;云集成;支持插件;跨平台 | 基本功能可能出现问题;云集成服务违反欧盟通用数据保护条例;网页端延迟 +FreeOffice | 免费(基础功能)| 闭源 | 免费;相较于 LibreOffice 更加轻量;支持触屏;良好的微软 Office 兼容性;跨平台 | 免费版本只包括文档、表格与演示功能;其他产品需要付费;对 ODT 文件格式的支持有限;闭源软件 +WPS Office | 免费 | 闭源 | 良好的微软 Office 兼容性;跨平台;标签界面;支持多语言 | 闭源软件;可能弹出广告 + +### 我们推荐 + +抛开所有这些优势和劣势不管,如果你还不确定哪一款才是最适合你的,我推荐你使用 LibreOffice。因为 LibreOffice 与 TDF 格式前景广阔,开发活跃,在全世界都拥有广泛的支持。LibreOffice 有着庞大的在线知识库,为用户提供丰富的使用技巧。通过在 LibreOffice 中使用 Basic 语言或者 Python 宏,你还可以轻松实现办公自动化。 + +### 总结 + +我希望,我们的推荐能帮助你选择适合自己的可替代微软 Office 的办公软件。 说实话,上述软件没有一个能真正比得上微软 Office。但是并不是每个人都能付得起微软 Office 高昂的费用,我相信以上 5 款软件对这部分人来说会是不错的选择。 + +_一些图片来源:上述软件所属公司_ + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/03/best-alternatives-microsoft-office-2022/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[aREversez](https://github.com/aREversez) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/wp-content/uploads/2022/03/LibreOffice-1024x535.jpg +[2]: https://www.libreoffice.org/discover/libreoffice/ +[3]: https://www.debugpoint.com/category/libreoffice/libreoffice-calc/ +[4]: https://www.libreoffice.org/download/libreoffice-in-business/ +[5]: https://www.libreoffice.org/download/download/ +[6]: https://help.libreoffice.org/latest/en-US/text/shared/05/new_help.html +[7]: https://ask.libreoffice.org/ +[8]: https://www.debugpoint.com/wp-content/uploads/2022/03/Google-Docs.jpg +[9]: https://www.google.com/docs/about/ +[10]: https://support.google.com/docs/?hl=en#topic=1382883 +[11]: https://www.debugpoint.com/wp-content/uploads/2022/03/OnlyOffice.jpg +[12]: https://www.onlyoffice.com/ +[13]: https://www.debugpoint.com/2021/12/best-gnome-apps-part-1/ +[14]: https://www.onlyoffice.com/desktop.aspx +[15]: https://forum.onlyoffice.com/ +[16]: https://www.debugpoint.com/wp-content/uploads/2022/03/FreeOffice.jpg +[17]: https://www.freeoffice.com/en/ +[18]: https://www.freeoffice.com/en/download/applications +[19]: https://forum.softmaker.com/ +[20]: https://www.debugpoint.com/wp-content/uploads/2022/03/WPS-Office-1024x499.jpg +[21]: https://www.wps.com/ +[22]: https://www.wps.com/academy/ +[23]: https://www.wps.com/download/ +[24]: https://t.me/debugpoint +[25]: https://twitter.com/DebugPoint +[26]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[27]: https://facebook.com/DebugPoint diff --git a/published/202203/20220315 The C4C Linux Distro Rises from the Grave.md b/published/202203/20220315 The C4C Linux Distro Rises from the Grave.md new file mode 100644 index 0000000000..14df648d7f --- /dev/null +++ b/published/202203/20220315 The C4C Linux Distro Rises from the Grave.md @@ -0,0 +1,61 @@ +[#]: subject: "The C4C Linux Distro Rises from the Grave" +[#]: via: "https://news.itsfoss.com/c4c-linux-distro-revived/" +[#]: author: "John Paul https://news.itsfoss.com/author/john/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14377-1.html" + +复活的 C4C Linux 发行版 +====== + +> Computers4Christians 项目以定制发行版的形式进行了改革,该发行版为有基督教信仰的人提供了软件。 + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/c4c-disto-rises-from-the-grave.png?w=1200&ssl=1) + +当我刚开始在这里写作时,我介绍了一个 [基督徒的 Linux 发行版][1],距离现在已经有 6 个年头了,让我们来速览一下这个项目在 6 年的时间里都有哪些变化吧。 + +### 名字变了,性质也变了 + +当我们第一次碰到 [Computers4Christians][2],他们是一个基督教团体,通过安装 Linux 系统来翻新旧电脑,并把它们捐赠给当地社区。他们大约捐赠了 1000 台翻新的旧电脑。该团体基于 Lubuntu 定制了自己的 Linux 版本,名字叫 “Computers4Christians Linux Project”。 + +今天,Computers4Christians 已经不再捐赠翻新的旧电脑了。取而代之的是,这三个开发者正在专注于开发重命名的 [C4C Ubuntu][3]。 + +当我问他们为什么决定要继续开发这个发行版时,他们回答说: + +> 我们希望引导那些不信奉上帝的人与耶稣·基督建立真正的联系,并借此发展一些信徒。任何人都可以,在几乎任何电脑上,下载、运行临场镜像或者安装我们的 Linux 发行版。C4C Ubuntu 用户可以通过多个版本的圣经、基督教教义、每日灵修、基督教视频和游戏等方式聆听上帝的教诲。我们祈祷每一次的下载、运行和安装 C4C Ubuntu 镜像,都能帮助用户走向基督,或是更接近上帝。“向软弱的人,我就作软弱的人,为要得软弱的人;向甚么样的人,我就作甚么样的人。无论如何总要救些人。” —— 哥林多前书 9:22(网络) + +### C4C Ubuntu 中都有什么? + +当前版本的 C4C Ubuntu 基于最新的 Ubuntu LTS(20.04.4)构建。它使用 Xfce 桌面环境代替了 GNOME 桌面环境。我问他们为什么决定基于 Ubuntu 而不是 Lubuntu。开发者 Eric Bradshaw 告诉我说,他们之所以切换到 Ubuntu,是因为 Lubuntu 的 LXQt 桌面环境有缺陷,而且它在旧电脑上表现不佳。 + +以下是 C4C Ubuntu 预装的内容: + + * 主要的常用软件:Catfish、FileZilla、GIMP、Gnash、GnuCash、Gufw、LibreOffice、OpenJDK Java 11、Pidgin、Pinta、Synaptic、Thunderbird 和 VLC。 + * 与基督教或圣经相关的软件和媒体:十二使徒问答和记忆游戏、圣经、圣经桌面版、8 个圣经知识游戏、10 个圣经经文迷宫探索游戏、Diatheke、117 个 Flash 圣经游戏、24 个有趣的圣经故事、Verse、Wide Margin、西福斯圣经指南、新信徒和门徒的阅读材料以及基督教视频。 + * 圣经:有声圣经(WEB)、AKJV、ASV、BBE、ERV、KJV、NHEB 和 WEB。注释:MHC、NETnotesfree、Personal 和 TFG。每日灵修:DBD 和 SME。词典:MLStrong、Robinson、StrongsGreek 和 StrongsHebrew。通用书籍:MollColossions 和 Pilgram。地图:ABSMaps、eBibleTeacherMaps、EpiphanyMaps、HistMidEast、KretzmannMaps、NETMaps、SmithBibleAtlas 和 SonLightFreeMaps。 + * 我们的背景图片包括 150 张不同的“上帝的创造God's creation”,提供高清、标准和宽屏等尺寸大小。我们还提供快捷方式或启动器,你可以在“基督教”子菜单中找到它们,点击即可直达 37 个在线的基督教视频集、音乐视频集和 YouTube 频道。 + * 预装的 Firefox 上有数百个手工挑选和分类的书签,不管你是要学习 Linux 还是要了解上帝,你都可以找到相关书签。有一个叫 “FoxFilter” 的家长控制扩展可以帮助过滤掉网页上不适当的内容,用户如果觉得有用,可以订阅它。 + * C4C Ubuntu 团队引入了 [GNU Gnash 的 snap 包][4],它是一个 Flash 播放器。有了它,用户就可以玩预装的 Flash 圣经游戏了。 + +如果你想要尝试 C4C Ubuntu,你可以在 [这里][5] 找到下载链接。这个网站有很多关于他们的历史版本信息。同时,开发团队也在不断更新这个网站。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/c4c-linux-distro-revived/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/computers-christians-linux/ +[2]: https://computers4christians.org/ +[3]: https://computers4christians.org/C4C.html +[4]: https://snapcraft.io/gnash-raymii +[5]: https://computers4christians.org/Download.html diff --git a/published/202203/20220316 Gitter- A Cross-Platform Open Source Community Platform for Developers.md b/published/202203/20220316 Gitter- A Cross-Platform Open Source Community Platform for Developers.md new file mode 100644 index 0000000000..37a09b476a --- /dev/null +++ b/published/202203/20220316 Gitter- A Cross-Platform Open Source Community Platform for Developers.md @@ -0,0 +1,110 @@ +[#]: subject: "Gitter: A Cross-Platform Open Source Community Platform for Developers" +[#]: via: "https://itsfoss.com/gitter/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14397-1.html" + +Gitter:面向开发者的跨平台开源社区平台 +====== + +![](https://img.linux.net.cn/data/attachment/album/202203/26/132222ldtjfcxvfz9kx5jv.jpg) + +> 一个为开发者量身定做的跨平台开源解决方案。你可以建立或加入现有的社区来进行协作和互动。 + +几乎每个网络用户都知道 Slack、Rocket.Chat、Trello、[Nextcloud][1],以及其他一些用于工作沟通和协作的解决方案。 + +如果你喜欢用 FOSS 来进行团队协作,我们也有一个 [Slack 的开源替代品列表][2]。 + +但是,作为一个软件开发者,如果你偶然发现了一个开发者社区怎么办? + +与 Reddit 或其他社交媒体上的社区不同,你可以进入一个开源平台,在那里,开发者们遇见并就重要的开源项目进行合作。这对于社交协作和同行之间的互动来说,不是很令人兴奋吗? + +![][3] + +[Gitter][10](现在是 [Element][4] 的一部分,也是一个协作/聊天应用)的目标就是这样。它是一个由开源技术驱动的社区平台([Matrix][5] 协议)。 + +### Gitter:使用开源技术连接的开发者社区 + +Gitter 是一个令人兴奋的聊天和网络平台,有助于建立或加入现有社区。它可用于 Linux、macOS 和 Windows。 + +![][6] + +它是专门为开发者定制的,可以为他们各自的语言/项目,如 CSS、JavaScript、Bootstrap、NodeJS 等,进行合作/加入社区。 + +你也可以轻松地创建你的社区,而无需设置任何邀请服务。 + +![][7] + +该平台的关键亮点是,社区是完全开放的,可被搜索引擎索引。对于社区中的对话历史,你不会被任何定价计划所锁定,你所需要查看的是归档。 + +而且,你在 Gitter 获得的功能还有很多。 + +### Gitter 的功能 + +虽然 Gitter 最初是为开发者定制的,但如果你认为它的功能符合你的要求,你可以用它来建立任何类型的社区。 + +![][8] + + * 由一个去中心化的 Matrix 网络支持。 + * 可公开加入的社区。 + * 能够将你的社区限制在选定的用户中。 + * 深色模式主题。 + * 访问归档,轻松找到过去的对话。 + * 能够导出信息/房间信息。 + * 从你的网络中添加用户(例如,如果你使用 Twitter 登录,你可以选择从 Twitter 邀请用户到你的社区)。 + * 几个可用的集成(GitHub、Bitbucket、Trello、GitLab、Docker Hub、Discourse 等)。 + * 支持 GitHub 风格的 Markdown。 + * 在同一社区下创建更多的房间,以保持事情的条理性。 + * 轻松地分享/嵌入聊天室的链接。 + * 帖子系统,以保持对话的整齐。 + * 删除/报告信息的能力。 + +总之,Gitter 提供了适合不同社区的各种功能。 + +而且,通过 GitHub、GitLab 和其他一些网站的集成,它成为开发者和团队的一个完美的合作选择。 + +![][9] + +### 在 Linux 中安装 Gitter.im + +开发人员主要专注于网络应用。因此,如果你想避免在你的 Linux 桌面上安装任何东西,请前往 [Gitter.im][10] 并注册/登录以开始使用。 + +如果你想让它成为一个桌面应用,你可以从其官方网站下载 DEB 包,或者可选择 [Snap 包][11]和 [Flatpak 包][12]。 + +我在简短的测试中尝试了 Flatpak 包,它在 Ubuntu 20.04 LTS 上运行良好。你可以在你喜欢的任何一个 Linux 发行版上尝试 Flatpak/Snap。 + +你也可以在你的移动设备上使用它。不幸的是,官方的 Gitter 移动应用已经不再维护。但是,你可以使用 Element 应用来登录房间/社区,考虑到两者都是由同一个去中心化的网络(即Matrix)驱动的。 + +要了解更多信息,请浏览 [GitLab 页面][13]或前往其网站。 + +你试过 Gitter 吗?你对它有什么看法?它适合你这个开发者吗?你用它做什么?请在下面的评论中告诉我们你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gitter/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/nextcloud/ +[2]: https://itsfoss.com/open-source-slack-alternative/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/gitter-dark-mode.png?resize=800%2C536&ssl=1 +[4]: https://itsfoss.com/element/ +[5]: https://matrix.org/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/gitter-light-mode.png?resize=800%2C536&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/gitter-communities.png?resize=800%2C398&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/gitter-add-friends.png?resize=800%2C468&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/gitter-integrations.png?resize=800%2C597&ssl=1 +[10]: https://gitter.im/ +[11]: https://snapcraft.io/gitter-desktop +[12]: https://flathub.org/apps/details/im.gitter.Gitter +[13]: https://gitlab.com/gitterHQ/desktop diff --git a/published/202203/20220317 Ubuntu has a ‘Weird Looking- New Logo.md b/published/202203/20220317 Ubuntu has a ‘Weird Looking- New Logo.md new file mode 100644 index 0000000000..105d77f72d --- /dev/null +++ b/published/202203/20220317 Ubuntu has a ‘Weird Looking- New Logo.md @@ -0,0 +1,83 @@ +[#]: subject: "Ubuntu has a ‘Weird Looking’ New Logo" +[#]: via: "https://news.itsfoss.com/ubuntu-new-logo/" +[#]: author: "Abhishek https://news.itsfoss.com/author/root/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14370-1.html" + +Ubuntu 有了一个“怪怪的”新标志 +====== + +> Ubuntu 已经重新设计了它的标志。不是每个人都会喜欢它。 + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/ubuntu-unveils-new-logo.png?w=1200&ssl=1) + +Ubuntu 的标志包含了多个元素。对粉丝来说,橙色和紫色是 Ubuntu 的特征。 + +除此之外,Ubuntu 的标志上还写有 “ubuntu” 的字样,以及一个橙色的图案。 + +![Ubuntu’s old logo][1] + +这个橙色的“朋友圈circle of friends”图案是 Ubuntu 的身份标识,它象征着:自由、协作、精确和可靠。 + +这个图案实际上是三个朋友或团队成员“搭在一起”的一个俯视图。你可能在体育运动中见到过这样的画面。 + +![Image courtesy: Unsplash][2] + +### Ubuntu 有了一个全新的标志 + +但这个图案正在发生变化。[OMG! Ubuntu][3] 报道说,Canonical 重新设计了标志的元素、文字和这个“朋友圈”的图案。 + +在旧的标志中,“朋友圈”图案在粗体 “ubuntu” 文字的右上角。 + +新的标志改变了这一点。“朋友圈”图案经过重新设计,看起来更平滑,而且被放置在一个橙色的矩形里。文字也有变化,现在使用了更细的字体。“Ubuntu” 中的 “U” 现在是大写的了。 + +有趣的是,新标志不再包含注册商标符号 “®” 了。 + +![][4] + +Ubuntu 在官方博文中提到了关于新设计的 [这些变化][5]: + +> 虽然(在设计上)和之前的朋友圈图案保持相对延续性很重要,但是更新后的版本更精简、更专注、更成熟。现在他们的头部在圆圈里,彼此面对,连接也更加直接,这看起来更合理一些。 + +你可以在这个视频中看到新标志的动画: + +[![][6]](https://img.linux.net.cn/static/video/Ubuntu%20new%20logo%20animation-9DHUyz54flA.mp4) + +这个新标志将会出现在 Ubuntu 22.04 发行版中。 + +### 这不是首次重新设计标志 + +这并不是 Ubuntu 第一次重新设计它的标志。早在 Ubuntu 项目于 2004 年初创时,“朋友圈”图案有三种颜色:黄色、红色和橙色。在 2010 年的时候,它被重新设计,“搭在一起的人” 变成了白色,他们被一个橙色的圆圈围绕着。 + +![Image courtesy: OMG! Ubuntu][7] + +### 你喜欢这个新标志吗? + +这次的新设计距离上一次已经过了 13 年。这个新“朋友圈”图案看起来还不错,但我还是觉得这个矩形背景有点怪怪的。 + +你怎么看?你喜欢 Ubuntu 的新标志吗,还是说更喜欢以前的那个呢?请在下方评论区分享你的观点吧! + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-new-logo/ + +作者:[Abhishek][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/root/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/ubuntu-old-logo.png?w=1294&ssl=1 +[2]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/huddle.jpg?w=800&ssl=1 +[3]: https://www.omgubuntu.co.uk/2022/03/ubuntu-has-a-brand-new-logo +[4]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/new-ubuntu-logo.png?w=780&ssl=1 +[5]: https://ubuntu.com/blog/a-new-look-for-the-circle-of-friends +[6]: https://i0.wp.com/i.ytimg.com/vi/9DHUyz54flA/hqdefault.jpg?w=780&ssl=1 +[6a]: https://youtu.be/9DHUyz54flA +[7]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/ubuntu-logo-comparison.jpg?w=1200&ssl=1 \ No newline at end of file diff --git a/published/202203/20220320 Customize GNOME Desktop in Ubuntu with a Clean Look.md b/published/202203/20220320 Customize GNOME Desktop in Ubuntu with a Clean Look.md new file mode 100644 index 0000000000..db74a01074 --- /dev/null +++ b/published/202203/20220320 Customize GNOME Desktop in Ubuntu with a Clean Look.md @@ -0,0 +1,153 @@ +[#]: subject: "Customize GNOME Desktop in Ubuntu with a Clean Look" +[#]: via: "https://www.debugpoint.com/2022/03/customize-gnome-clean-look-2022-1/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14393-1.html" + +在 Ubuntu 中定制简洁的 GNOME 桌面 +====== + +> 本教程为你提供了一些简单的步骤来自定义 GNOME 桌面,用最少的努力打造干净的外观。下面如何做的。 + +![](https://img.linux.net.cn/data/attachment/album/202203/25/095452nw8pt6pxu9owwsks.jpg) + +如果你对最喜欢的 GNOME 桌面的样子已经看厌烦了,那么你就来对了。让我们安装一些主题图标并进行一些调整以提升你的桌面格调。我们将转换如下桌面(GNOME 40.5 和 Ubuntu 21.10)。 + +![Ubuntu Desktop with GNOME – Before Customization][1] + +这个定制教程将使用漂亮的 Colloid GTK 主题、Mkos-Big-Sur 图标、一个带有额外扩展的酷炫光标主题,以及 Conky。 + +### 自定义 GNOME 桌面,用简洁的外观提升它的形象 + +#### 安装 + +首先,通过在终端运行以下命令来设置 GNOME Shell 扩展。 + +``` +sudo apt install chrome-gnome-shell +``` + +然后 [打开这个页面][2],将 GNOME 扩展的插件添加到你的浏览器(Chrome/Firefox)。 + +![Add Browser Add-on for GNOME Shell Extension][3] + +安装“扩展”应用([Flatpak][4]),你可能需要它来改变 GNOME 扩展的设置。 + +之后,从终端使用以下命令安装 GNOME 优化工具GNOME Tweaks。我们将使用这个工具来改变主题和其他设置。 + +``` +sudo apt install gnome-tweaks +``` + +[下载 Colloid GTK 主题][5]。下载后解压文件。然后将解压后的文件夹复制到你主目录下的 `~/.themes`。如果文件夹不存在,请创建它。完成这些后,打开终端,运行 `install.sh` 文件。 + +[下载 Mkos-Big-Sur 图标主题][6]。下载完成后,解压文件并将父文件夹复制到你的主目录中的 `~/.icons`。 + +[下载 Vimix 光标主题][7],并按照上述步骤操作。将提取的文件夹复制到 `~/.icons` 目录中。然后打开一个终端,运行 `install.sh` 文件。 + +现在,安装 Conky 和一些扩展,这些扩展最终会给你的 GNOME 桌面一个干净的外观。要安装 Conky 和 Conky 管理器,打开终端提示符并运行以下命令。 + +``` +sudo apt install conky +sudo add-apt-repository ppa:tomtomtom/conky-manager +sudo apt update && sudo apt install conky-manager2 +``` + +现在,打开下面每个扩展的链接,依次安装它们。要安装时,打开页面,点击 ON/OFF 切换开关(见下图)。它将要求你提供管理员密码和安装许可。 + +* [Move Clock][8] +* [Dash to Dock][9] +* [Tray Icons][10] +* [Arc Menu][11] +* [User Themes][12] + +![GNOME Extension – Page][13] + +#### 配置 + +在你完成上述步骤后,做一些基本配置。你可能会看到在你安装上面的 GNOME 扩展时,有些变化已经生效了。例如,在安装上面的 Move Clock 扩展时,时钟应该已经被移到了右边。 + +##### 优化工具 + +打开优化GNOME Tweaks工具(从应用菜单中搜索“Tweaks”),进入“外观Apperance”。 + +将应用主题改为 “Colloid Dark”,光标主题为 “Vimix Cursors”,图标主题为 “Mkos-big-sur”,Shell 主题为 “Colloid Dark”。如果你愿意,你可以选择浅色主题和不同的选项。 + +![Apply Themes][15] + +##### Arc 菜单 + +打开“扩展Extension”应用,进入 Arc 菜单设置Arc Menu Settings。 + +将菜单布局改为 “替代菜单布局Alternative Menu Layout > Raven”。 + +将应用的菜单按钮改成你喜欢的一些图标。在本指南中,我从 [这里][16] 下载了一个 GNOME 图标。并通过 Arc 菜单的 “设置Settings > 按钮外观Button Appearance > 浏览图标Browse Icon”应用它。它应该看起来像这样。 + +![Arc Menu – Raven][17] + +从“扩展Extension”程序中打开 “Dash to Dock” 设置。在“外观Appearance”选项卡中,改变以下项目: + +* 启用收缩到 Dash 的功能 +* 自定义窗口计数指示器为 Dash +* 启用自定义 Dash 颜色 +* 自定义不透明度为固定 +* 不透明度为 12% + +在位置和大小选项卡中,将停靠区位置改为底部,图标大小限制为 39px。 + +如果你喜欢,你可以启动 Conky,并下载一张与 Colloid 主题相配的漂亮墙纸。在这个演示中,我[选择了一张漂亮的灰色墙纸][18],它与深色主题搭配看起来非常漂亮。 + +### 结果 + +在所有的配置之后,如果一切顺利,你的桌面应该是这样的。 + +![GNOME Customization in Ubuntu with a simple look-1][19] + +![GNOME Customization in Ubuntu with a simple look-2][20] + +![GNOME Customization in Ubuntu with a simple look-3][21] + +你可以通过多种设置组合来玩转这个主题的不同变体。并创造一个更适合你的外观。 + +我希望这个指南能帮助你把你的 GNOME 桌面改造成简洁的外观。如果你喜欢这个设置,请在下面的评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/03/customize-gnome-clean-look-2022-1/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/wp-content/uploads/2022/03/Ubuntu-Desktop-with-GNOME-Before-Customization-1024x582.jpg +[2]: https://extensions.gnome.org/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/03/Add-Browser-Add-on-for-GNOME-Shell-Extension.jpg +[4]: https://dl.flathub.org/repo/appstream/org.gnome.Extensions.flatpakref +[5]: https://github.com/vinceliuice/Colloid-gtk-theme/archive/refs/heads/main.zip +[6]: https://github.com/zayronxio/Mkos-Big-Sur/archive/refs/heads/master.zip +[7]: https://github.com/vinceliuice/Vimix-cursors +[8]: https://extensions.gnome.org/extension/2/move-clock/ +[9]: https://extensions.gnome.org/extension/307/dash-to-dock/ +[10]: https://extensions.gnome.org/extension/2890/tray-icons-reloaded/ +[11]: https://extensions.gnome.org/extension/3628/arcmenu/ +[12]: https://extensions.gnome.org/extension/19/user-themes/ +[13]: https://www.debugpoint.com/wp-content/uploads/2018/05/GNOME-Extension-Page.png +[15]: https://www.debugpoint.com/wp-content/uploads/2022/03/Apply-Themes.jpg +[16]: https://icons.iconarchive.com/icons/tatice/operating-systems/32/Gnome-icon.png +[17]: https://www.debugpoint.com/wp-content/uploads/2022/03/Arch-Menu-Raven.jpg +[18]: https://i.redd.it/1ttvv79apo851.png +[19]: https://www.debugpoint.com/wp-content/uploads/2022/03/GNOME-Customization-in-Ubuntu-with-a-simple-look-1-1024x579.jpg +[20]: https://www.debugpoint.com/wp-content/uploads/2022/03/GNOME-Customization-in-Ubuntu-with-a-simple-look-2-1024x580.jpg +[21]: https://www.debugpoint.com/wp-content/uploads/2022/03/GNOME-Customization-in-Ubuntu-with-a-simple-look-3-1024x576.jpg +[22]: https://t.me/debugpoint +[23]: https://twitter.com/DebugPoint +[24]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[25]: https://facebook.com/DebugPoint \ No newline at end of file diff --git a/published/202203/20220321 Build Your Own Handheld Linux PC with Raspberry Pi and this Open Source Project.md b/published/202203/20220321 Build Your Own Handheld Linux PC with Raspberry Pi and this Open Source Project.md new file mode 100644 index 0000000000..db61c7cd14 --- /dev/null +++ b/published/202203/20220321 Build Your Own Handheld Linux PC with Raspberry Pi and this Open Source Project.md @@ -0,0 +1,81 @@ +[#]: subject: "Build Your Own Handheld Linux PC with Raspberry Pi and this Open Source Project" +[#]: via: "https://news.itsfoss.com/penkesu-handheld-linux-pc/" +[#]: author: "John Paul https://news.itsfoss.com/author/john/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14408-1.html" + +用树莓派打造你的手持 Linux 电脑 +====== + +> Penkesu 电脑:一个自制的复古式手持 Linux 电脑。 + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/penkesu-handheld-linux-pc.jpg?w=1200&ssl=1) + +你是否曾希望有一台适合你手持的、带有键盘的 Linux 笔记本电脑?如果是这样,那么你幸运了。一位硬件设计师创造了这样一个设备,并将其设计开源,让任何人都可以在家里制作它。 + +### 它是什么? + +![][1] + +Penkēsu 电脑(Penkēsu 是日语中“铅笔盒”的意思)是由 [Penk Chen][2] 设计的。如果这个名字听起来很熟悉,他就是 [CutiePi][3] 背后的设计师。 + +根据该网站称,Penk 创建这个项目是因为: + +> 自从 CutiePi 平板电脑成功获得了资金并开始发货后,我觉得有必要干一个新的项目,一个我不需要太担心商业可行性、并提醒自己做手工的初衷的项目。可以说,这是一个“反弹”项目。 + +他还说,他目前没有任何大规模生产 Penkēsu 的计划,所以他把该规划开源了。“我想公布所有的设计和规划,这样就可以给任何有兴趣制作一个的人足够的信息。” + +### 零件 + +![][5] + +Penk 围绕一个 7.9 英寸的触摸屏和一个定制键盘设计了 Penkēsu。内部结构由树莓派 Zero 2 W 和锂聚合物电池供电。树莓派 Zero 2 W 有一个 1GHz 的 ARM 四核 ARM Cortex-A53 处理器和 512MB 的内存。花上 15 美元,这块树莓派应该可以运行大多数为它设计的 Linux 发行版。 + +有趣的是,Penk 说,“我的 3D 打印机不够精确,无法打印出一个功能齐全的铰链锁”。因此,他决定使用来自任天堂 GBA SP 的替换铰链。 + +看起来最困难的部分是键盘,这涉及到一个定制的 PCB。Penk 确实注意到,“如果希望使用其他 40% 键盘来制作,可以通过编辑 CAD 文件和调整机箱中的隔间大小来完成”。 + +以下是所需零件的完整清单: + +* 显示器 + * 微雪 7.9 英寸电容式触摸屏 + * Adafruit DIY HDMI 电缆部件 - 直角适配器、Mini-HDMI 适配器和 20 厘米带状电缆 +* 外壳 + * GBA SP 替代铰链 + * 3D 打印部件(STL 文件和 STEP 文件) +* 电子产品 + * 树莓派 Zero 2 W + * 3.7V 606090(或类似尺寸)锂聚合物电池 + * Adafruit PowerBoost 1000C +* 键盘 + * 凯华 Choc 矮轴 V1 x 48 + * MBK Choc 矮轴键帽 x 48 + * 1N4148 二极管 x 48 + * Arduino Pro Micro x 1 + * PCB x 1(gerber 文件和 QMK 固件) + +详见 [网站][4] 的完整细节。 + +你用树莓派做了什么项目?请在下面的评论中分享。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/penkesu-handheld-linux-pc/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/penkesu.computer-31.jpg?w=1000&ssl=1 +[2]: https://github.com/penk +[3]: https://itsfoss.com/cutiepi-open-source-tab/ +[4]: http://penkesu.computer/ +[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/penkesu.computer-parts.jpg?w=1000&ssl=1 \ No newline at end of file diff --git a/published/202203/20220321 Linux Kernel 5.17 Released. This is What-s New.md b/published/202203/20220321 Linux Kernel 5.17 Released. This is What-s New.md new file mode 100644 index 0000000000..7c511aced6 --- /dev/null +++ b/published/202203/20220321 Linux Kernel 5.17 Released. This is What-s New.md @@ -0,0 +1,134 @@ +[#]: subject: "Linux Kernel 5.17 Released. This is What’s New" +[#]: via: "https://www.debugpoint.com/2022/03/linux-kernel-5-17/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14384-1.html" + +Linux 内核 5.17 发布及新变化 +====== + +> Linux 内核 5.17 已经发布,它具有更好的硬件支持和核心模块改进。下面是对新功能的简要介绍,并附有下载和安装细节。 + +![Linux 内核 5.17 带来了更多的硬件兼容性][1] + +Linux Torvalds [宣发了][2] Linux 内核 5.17,这是 2022 年第二个稳定版主线内核。这个版本的内核模块中引入了对新处理器、显卡、存储和其他硬件组件的支持。 + +比内核 5.16 发布后的时间表稍有延迟,Linux 主线内核 5.17 现在可供下载了。这些更新包括对 AMD Zen 系列设备的温度支持;长期存在的软盘挂起错误,几个 ARM/SoC 支持以及各个子系统的性能改进。 + +我们已经在第一个候选版本发布时介绍了大部分变化,下面是对 Linux 内核 5.17 新特性的快速回顾。 + +### Linux 内核 5.17 的新内容 + +#### 处理器 + +Linux 内核中的 ARM64 架构现在包括了内核并发净化器Kernel Concurrency Sanitizer(KCSAN)。KSCAN 是一个竞争条件检测器,已经支持了其他架构。而现在 ARM64 也在支持名单上了。另外,可扩展矩阵扩展Scalable Matrix Extensions(SME)的初始工作有望为矩阵操作提供更好、更快的支持。 + +AMD [带来了][3] 基于 k10temp 的 CPU 温度监控,用于 AMD Zen 系列第 19 代 CPU 型号。 + +一组广泛的 Arm/SoC 支持 [进入了][4] Linux 内核 5.17 中。其中主要包括新的 Snapdragon 8 Gen 1 和 X65 平台。其他 SoC 包括恩智浦 i.MX8ULP、德州仪器 J721S2 和瑞萨 R-Car S4-8。 + +CPU 的重大变化之一是加入了 AMD 的 P-state 驱动,这是与 Valve 为 Steam Deck 合作开发的。这将提供更好的电源效率,因为透过 ACPI 协作处理器性能控制Collaborative Processor Performance Controls(CPPC)支持,可以更加细化的控制电源。 + +这个内核中另一个重要的 RISC-V 变化是支持 sv48,提供了 48 位虚拟地址空间。这使得内核可以对高达 128TB 的虚拟地址空间进行寻址。 + +这个版本带来了很多笔记本电脑、平板电脑的驱动更新。[这里][5] 有一个列表,主要内容是: + +- 为华硕 ROG 笔记本电脑增加了自定义风扇曲线支持。 +- 增加了对通用手写笔计划Universal Stylus Initiative(USI)和 NVIDIA Tegra 平板电脑的支持。 +- 对基于 AMD 的笔记本电脑的一些性能改进和修复,涉及到睡眠和声音驱动。 + +#### 显卡 + +英特尔的 Alder Lake P 显卡经过前一年的多次迭代,现在已经在主线内核上稳定了。这个内核引入了 [对 Raptor Lake S 显卡的首批支持补丁][6]。 + +英特尔的 Gen Icelake 显卡家族 [获得了][7] 可变刷新率/自适应同步支持。 + +一些较新的笔记本电脑带来了内置的隐私屏幕,预计更多的 OEM 厂商会效仿。另外,值得注意的是,GNOME 桌面和其他公司正计划在之后使用这一隐私功能。所以,为了这个以隐私为中心的功能,最初的架构和代码工作都已经包含在这个内核版本中了。 + +你可以在 [这里][9] 找到一个很好的显卡驱动更新列表。 + +#### 存储 + +在内核的每个版本中都会对所有主要的文件系统和存储技术进行增量更新。这个版本也会有一些: + + * 主要的更新包括流行的 EXT4 文件系统使用新的 Linux 挂载 API。 + * 像往常一样,[F2FS][10]、[Btrfs][11] 和 [XFS][12] 的性能得到改善。 + * FS-Cache 和 CacheFiles 模块 [做了][13] 重大重写。 + +#### 杂项硬件更新 + +今天谁还在使用软盘?我相信仍然有一些特定的商业用例仍在使用软盘。所以,这就给我们带来了这个特定的补丁,在这个内核版本中。内核中存在一个长期的错误:当系统试图读取一个坏掉的软盘时可能会挂起。所以,这个老毛病终于在这个版本中得到了解决,我希望能让少数仍然使用这种古老存储介质的人为此驻足一下。 + +其他值得注意的杂项硬件更新包括: + + * 任天堂 GameCube/Wii/Wii U 实时时钟 [驱动][14]。 + * 一个通用的 USB GNSS(全球导航卫星系统Global Navigation Satellite System)驱动程序。 + * Cirrus CS35L41 高清音频编解码器 [驱动][15]。 + * 许多英特尔 Wi-Fi 驱动程序 [改进][16]。 + * 英特尔 Alder Lake N [音频][17] 支持。 + +### 如何下载和安装 Linux 内核 5.17 + +我们总是建议不要在你的稳定系统中安装最新的主线内核,除非你拥有特定的新硬件或想做实验。对于普通用户来说,最好是通过你的 Linux 发行版(如 Ubuntu、Fedora)的官方部署渠道等待内核的更新。 + +如果你仍然想安装,请按照下面的说明来安装 Linux 内核 5.17。 + +访问 [主线内核页面][18]。 + +有两种类型的构建可供选择:**通用**的和**低延迟**的。对于标准的系统,你可以下载通用的构建,大部分时间都可以工作。对于音频录制和其他需要低延迟的设置,请下载低延迟的。 + +通过终端下载以下四个通用软件包并安装: + +``` +wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17/amd64/linux-headers-5.17.0-051700-generic_5.17.0-051700.202203202130_amd64.deb +wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17/amd64/linux-headers-5.17.0-051700_5.17.0-051700.202203202130_all.deb +wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17/amd64/linux-image-unsigned-5.17.0-051700-generic_5.17.0-051700.202203202130_amd64.deb +wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17/amd64/linux-modules-5.17.0-051700-generic_5.17.0-051700.202203202130_amd64.deb +``` + +安装完毕后,重新启动系统。 + +低延迟和其他架构(ARM)的安装指令是一样的。替换上述 `wget` 命令中的软件包名称。你可以在主线内核页面找到它们。 + +对于 Arch Linux 用户来说,预计 Linux 内核 5.17 发布包将在 2022 年 4 月第一周的 Arch .iso 月度刷新中到达。 + +随着这个版本的发布,合并窗口将为接下来 Linux 内核 5.18 打开。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/03/linux-kernel-5-17/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/wp-content/uploads/2022/03/kernel517-1024x576.png +[2]: https://lkml.org/lkml/2022/3/20/213 +[3]: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git/commit/?h=hwmon-next&id=6482dd78c00c6d604ac1c757fb2d8a2be2878654 +[4]: https://lore.kernel.org/linux-arm-kernel/CAK8P3a0RDZpLtWjMEU1QVWSjOoqRAH6QxQ+ZQnJc8LwaV7m+JQ@mail.gmail.com/ +[5]: https://lore.kernel.org/lkml/aea4c26b-25a1-9480-f780-7eb3502a4ce4@redhat.com/T/#u +[6]: https://lore.kernel.org/dri-devel/87ee6f5h9u.fsf@intel.com/ +[7]: https://lists.freedesktop.org/archives/intel-gfx/2021-November/284109.html +[8]: https://www.debugpoint.com/2022/01/linux-kernel-5-17-rc1/ +[9]: https://lists.freedesktop.org/archives/dri-devel/2022-January/336492.html +[10]: https://lore.kernel.org/lkml/YedlHVEa4sdbvB2F@google.com/ +[11]: https://lore.kernel.org/lkml/cover.1641841093.git.dsterba@suse.com/ +[12]: https://lore.kernel.org/lkml/YdyxjTFaLWif6BCM@mit.edu/ +[13]: https://lore.kernel.org/lkml/510611.1641942444@warthog.procyon.org.uk/ +[14]: https://lore.kernel.org/lkml/Yen7oaDXAbd4tFOD@piout.net/ +[15]: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?h=for-next&id=7b2f3eb492dac7665c75df067e4d8e4869589f4a +[16]: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=bc11517bc8219314948780570ec92814d14d6602 +[17]: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?h=for-next&id=4d5a628d96532607b2e01e507f951ab19a33fc12 +[18]: https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17 +[19]: https://t.me/debugpoint +[20]: https://twitter.com/DebugPoint +[21]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[22]: https://facebook.com/DebugPoint diff --git a/published/202203/20220321 Mabox Linux - Beautiful Arch Linux with Openbox -Review.md b/published/202203/20220321 Mabox Linux - Beautiful Arch Linux with Openbox -Review.md new file mode 100644 index 0000000000..7a8cbf0b0b --- /dev/null +++ b/published/202203/20220321 Mabox Linux - Beautiful Arch Linux with Openbox -Review.md @@ -0,0 +1,131 @@ +[#]: subject: "Mabox Linux – Beautiful Arch Linux with Openbox [Review]" +[#]: via: "https://www.debugpoint.com/2022/03/mabox-linux-2022/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14416-1.html" + +Mabox Linux:带有 Openbox 的美丽的 Arch Linux +====== + +![](https://img.linux.net.cn/data/attachment/album/202203/31/101104lieqiqhq3sezqtih.jpg) + +> Mabox Linux 是一个 Manjaro Linux 重制版,带有一个轻量级的 Openbox 窗口管理器,已经预配置了主题和实用程序。我们将在这篇文章中点评这个发行版。 + +如果你喜欢窗口管理器,也喜欢基于滚动发布的 Arch Linux,并且正在寻找一个具有这种组合的现成 Linux 发行版,可以试试 Mabox Linux。Mabox Linux 是建立在很棒的 Manjaro Linux 之上的,带有 Openbox 窗口管理器和一些原生实用程序。 + +由于采用了 Openbox,这个 Linux 发行版在维持超轻量级的资源消耗的同时,也提供了一个漂亮的桌面。改编自 BunsenLabs,并受 Crunchbang 启发的 Mabox Linux 工具也带来了他们的一些应用。 + +让我们来深入了解一下这个了不起的 Linux 发行版。 + +### Mabox Linux 点评 + +#### 安装和现场介质 + +Mabox .ISO 的优势之一是它在现场介质Live medium启动过程中为你提供了自由和专有的驱动程序的两种选择。如果你的系统中有英伟达或其他硬件,这对你有帮助。 + +现场桌面Live desktop让你可以通过 Calamares 安装程序来安装 Mabox。在标准硬件上,安装大约需要 3 到 4 分钟,在我的测试中没有遇到错误。 + +安装程序也会检测测试设备中的其他操作系统。 + +#### 具有自定义的外观和感受 + +Mabox 带来了一个预配置的 Openbox 窗口管理器。这个搭配的版本看起来不错,有深色外观和带面板的菜单。 + +顶部的面板是用 Tint2 构建的,分成两个部分。左边的面板为你提供了主菜单、文件管理器、网页浏览器的快捷方式。面板上的鼠标左键和右键有不同的菜单。右边的面板包含资源监视器、音量控制、截屏快捷方式和电源菜单。顶部面板不是连续的,在某些主题下,应用程序窗口会停留在顶部。 + +![Mabox Linux with Nord Theme][1] + +在桌面的右边部分,预配置的 Conky 脚本可以给你提供系统信息,包括日期、时间、存储和其他显示。 + +欢迎窗口为你提供了关于设置、帮助和支持的快速启动快捷方式,并有文档链接。 + +窗口管理器适合于键盘操作,有时不便于用鼠标操作。但由于 Openbox 和预配置的 Mabox,你可以轻松地使用鼠标,同时通过灵巧的键盘快捷方式提高你的工作效率。 + +桌面上的右键菜单为你提供了轻松的搜索和启动选项。 + +![Search and Launch from desktop][2] + +如果你不喜欢默认的外观,你可以通过 Openbox 和 Tint2 面板配置工具,只需点击几下就可以自行定制。 + +![Main Application Menu][3] + +Mabox 预设有不同的主题,包括面板和 Concky 脚本。你可以点击并应用这些令人惊叹的 Mabox 主题。如果你不想陷入自己配置面板、颜色和 Conky 的麻烦中,这是一个很好的功能。 + +一套好的墙纸可以让你随时让它在短时间内看起来更加美妙。 + +![Mabox Themes][5] + +#### 应用 + +Mabox Linux 将所有必要的应用打包在其安装镜像中。以下是所包含的基本应用的简单列表。 + + * Terminator 终端 + * Xpad 快速写字板 + * PCManFM 文件管理器 + * FSearch 桌面文件搜索 + * Flameshot 截图工具 + * Geany 文本编辑器 + * Audacious 音乐播放器 + * Firefox 网页浏览器 + +Mabox 还包括控制中心,以有效管理你的系统。Mabox 控制中心可以让你添加/删除应用、更新你的系统、启动窗口管理组件的几个配置窗口,诸如此类。 + +如果你找不到某个设置,你可以在 Mabox 控制中心通过其系统设置的逻辑分组轻松找到它们。 + +![Mabox Control Center][6] + +#### 性能如何? + +Mabox Linux 的性能令人印象非常深刻。由于采用了 Openbox 窗口管理器,Mabox 只用了大约 350MB 多点的内存,而 CPU 在空闲状态下徘徊在 2% 到 3%。 + +默认安装需要大约 5.39GB 的磁盘空间,这对于预装的这些应用和设置程序来说是不可思议的。 + +在如此优化下,以至于它消耗内存最多的应用是 Xorg,有 90MB。 + +所以,我想尝试一下重度使用下的性能。而这个性能也是令人惊讶的。我打开了一个文件管理器、带三个标签的 Firefox、一个用于开发的文本编辑器、一个终端窗口和控制中心。在这样的工作负荷下,Mabox 只消耗了大约 920MB 的内存和 6% 到 7% 的 CPU。 + +![Mabox Linux Heavy Workload Performance][7] + +在 [点评几个发行版][8] 的过程中,这是我第一次发现一个发行版在重度工作负荷下不超过 1GB 内存的情况。但在不同的使用情况下,结果可能有所不同。无论如何,这个指标还是令人印象深刻。 + +### Mabox Linux 可以作为日常使用吗? + +如果你对带有窗口管理器的 Arch Linux 比较熟悉和适应,你可以把 Mabox Linux 作为日常使用。有几个打包好的带有窗口管理器的 Arch Linux 发行版,而 Mabox 是其中最好的一个。 + +![Mabox Linux Windows 95 pre-configured theme][9] + +### 总结 + +我认为 Mabox Linux 团队将所有组件与 Arch Linux 打包在一起,并呈现出一个漂亮的 Linux 发行版,做得非常好。它的外观惊艳,而消耗的系统资源却很少。有了基于 Arch Linux 的滚动发布功能,我认为你可以信赖这个发行版的长期使用。 + +你可以从它的 [官方网页][10] 下载 Mabox Linux。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/03/mabox-linux-2022/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/wp-content/uploads/2022/03/Mabox-Linux-with-Nord-Theme-1024x581.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2022/03/Search-and-Launch-from-desktop.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/03/Main-Application-Menu.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/03/Mabox-Themes.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/03/Mabox-Control-Center.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/03/Mabox-Linux-Heavy-Workload-Performance-1024x508.jpg +[8]: https://www.debugpoint.com/tag/linux-distro-review +[9]: https://www.debugpoint.com/wp-content/uploads/2022/03/Mabox-Linux-Windows-95-preconfigured-theme-1-1024x577.jpg +[10]: https://maboxlinux.org/ +[11]: https://t.me/debugpoint +[12]: https://twitter.com/DebugPoint +[13]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[14]: https://facebook.com/DebugPoint \ No newline at end of file diff --git a/published/202203/20220322 Junction- An Application Switcher to Open Files and Links.md b/published/202203/20220322 Junction- An Application Switcher to Open Files and Links.md new file mode 100644 index 0000000000..5d26c6a4b3 --- /dev/null +++ b/published/202203/20220322 Junction- An Application Switcher to Open Files and Links.md @@ -0,0 +1,107 @@ +[#]: subject: "Junction: An Application Switcher to Open Files and Links" +[#]: via: "https://itsfoss.com/junction/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14414-1.html" + +Junction:一个可以打开文件和链接的应用切换器 +====== + +> 这是一个有趣的工具,可以轻松地访问文件或打开链接。让我们来了解一下。 + +对于那些涉足使用多个应用访问不同文件和使用各种浏览器打开链接的用户来说,其工作流程往往没那么多顺畅。 + +你可能已经习惯了,但这可能不是完成事情的最快方式。 + +认识一下 **Junction**,这是一个应用切换器,帮助你用最喜欢的应用快速打开文件/链接。 + +### Junction: 开源的 Linux 应用或浏览器切换器 + +![][1] + +虽然我们可以在打开文件时使用右键菜单中的 “用……打开” 选项来选择某个应用,但这并不是最快的方法。 + +有了 [Junction][2],你不必寻找希望用什么程序打开该文件(或不断改变默认值),而只需将 “Junction” 应用设置为你的默认值。 + +这样,每当你打开一个链接或访问一个文件、启动电子邮件编辑器等,Junction 应用就会启动,向你显示你可能想要访问的相关应用。 + +此外,它还支持键盘导航,使其成为键盘高级用户的一个有益补充。 + +![][3] + +基本上,每次你想在不同的应用中访问文件/链接时,它都能为你节省一些点击次数。 + +### Junction 的特点 + +![][4] + +它是一个适合于特定用户群的简单工具。你可能觉得它是多余的,也可能不是,但在你想尝试的情况下,它的功能应该可以弥补它的不足: + +* 通过启动器/切换器选择要打开的应用 +* 在启动前显示文件位置 +* 在打开 URL 之前能够编辑它 +* 提示不安全的链接 +* 键盘导航 +* 能够在切换器/启动器中添加更多的应用(它也会记住添加的内容,以便下次使用) + +![][5] + +### 使用 Junction 来访问文件和链接 + +要设置它,你需要启动应用并将 Junction 设置为 Web 的默认值,如下图所示。 + +![][6] + +要在任何文件类型上使用它,你可以前往各自的文件属性,并为它改变默认的应用,如下图所示: + +![][7] + +对于链接,如上面的截图所示,你可以通过点击 “Test Junction” 来测试它。或者,你可以点击其他应用的任何链接,看看 Junction 应用的运行情况。 + +下面是你试图点击一个链接并让 Junction 帮助你选择时的情况: + +![][8] + +### 在 Linux 中安装 Junction + +Junction 主要以 Flatpak 应用的形式提供。因此,你可以从 [Flathub][9] 安装软件包,或者在软件中心寻找它(如果 Flatpak 集成完毕)。 + +考虑到你已经设置了 [Flatpak][10],你可以输入以下命令来安装它: + +``` +flatpak install flathub re.sonny.Junction +``` + +你也可以查看它的 [GitHub 页面][11],了解更多的使用案例或利用它的技巧/窍门。 + +- [Junction][9] + +你认为像 Junction 这样的应用切换器怎么样?它对你有用吗?请在下面的评论中告诉我你的想法,或简单的一句“谢谢”。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/junction/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/Junction-ft.png?resize=800%2C450&ssl=1 +[2]: https://apps.gnome.org/app/re.sonny.Junction/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/junction-action-screenshot.jpg?resize=800%2C450&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/junction-app-screenshot.jpg?resize=800%2C455&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/junction-app-more.jpg?resize=800%2C540&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/junction-app.jpg?resize=800%2C586&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/junction-properties.png?resize=800%2C511&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/junction-link-click.jpg?resize=800%2C505&ssl=1 +[9]: https://flathub.org/apps/details/re.sonny.Junction +[10]: https://itsfoss.com/flatpak-guide/ +[11]: https://github.com/sonnyp/Junction diff --git a/published/202203/20220323 Clear Linux is the First Distro to Offer GNOME 42.md b/published/202203/20220323 Clear Linux is the First Distro to Offer GNOME 42.md new file mode 100644 index 0000000000..c2d96e2463 --- /dev/null +++ b/published/202203/20220323 Clear Linux is the First Distro to Offer GNOME 42.md @@ -0,0 +1,73 @@ +[#]: subject: "Clear Linux is the First Distro to Offer GNOME 42" +[#]: via: "https://news.itsfoss.com/clear-linux-gnome-42/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14400-1.html" + +Clear Linux 是首个提供 GNOME 42 的发行版 +====== + +> 击败了 Arch 和 Fedora,Clear Linux 的最新版本提供了 GNOME 42 的稳定版本。 + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/clear-linux-gnome-42.jpg?w=1200&ssl=1) + +Clear Linux 是一个开源的滚动发布的发行版,它为云计算和边缘计算的开发者量身定制。 + +你可能不知道,Clear Linux 是一个英特尔Intel的项目。它针对英特尔的处理器做了优化,并且提供了一个容器快速部署的环境。 + +它同时支持了桌面和服务器(AWS、Google Compute Engine 和 Azure Hyper-V 等)。 + +> **注意:** _与即将发布的 Fedora 36 工作站版和 Ubuntu 22.04 长期支持版相比,Clear Linux 算不上是一个完美的替代桌面。如果你对这个发行版感兴趣,我建议你先在虚拟机上尝试一下。_ + +令人惊讶的是,Clear Linux 的最新发布版看起来会包括 GNOME 42(稳定版)。 + +更不用提,Clear Linux 比 Arch 和 Fedora 更新地还要快,提供了最新的 GNOME 稳定发布版。 + +### Clear Linux 上的 GNOME 42 + +![][1] + +你可以期待在 Clear Linux 上看到 [最好的 GNOME 42 特性][2]。 + +根据我的简单使用,其中大部分功能都符合你对 GNOME 42 的预期。 + +![][3] + +文件管理器、日历、照片、天气以及许多其他应用程序都反映出,最新的 GNOME 42 版本升级到了 GTK 4。 + +当然,在 Clear Linux 上,默认的桌面壁纸会有些不同,但你可以获取到同一套壁纸集的浅色/深色不同版本。 + +![][4] + +我在虚拟机上测试过,它的运行情况和预期的一致,没有显著的缺陷。 + +如果你已经在使用 Clear Linux 了,或者对它好奇,想要了解更多,你可以在它的 [版本发布说明][5] 中找到更多细节,包括更新的软件包和其他变化。 + +### 下载附带 GNOME 42 的 Clear Linux + +或许你在它的官网下载页面找不到最新的发布版。但是,你可以在 [官方下载仓库][6] 中找到它。 + +你可以根据自身需求(服务器/桌面),下载到对应的 ISO 文件。现在就开始体验吧! + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/clear-linux-gnome-42/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/clearlinux-gnome-42-home.jpg?w=1269&ssl=1 +[2]: https://news.itsfoss.com/gnome-42-features/ +[3]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/clearlinux-gnome-42.png?w=868&ssl=1 +[4]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/clear-linux-appearance.jpg?w=794&ssl=1 +[5]: https://download.clearlinux.org/releases/36060/clear/RELEASENOTES-36030-to-36060 +[6]: https://download.clearlinux.org/releases/36060/clear/ diff --git a/published/202203/20220323 Xonsh Shell Combines the Best of Bash Shell and Python in Linux Terminal.md b/published/202203/20220323 Xonsh Shell Combines the Best of Bash Shell and Python in Linux Terminal.md new file mode 100644 index 0000000000..8fd036f448 --- /dev/null +++ b/published/202203/20220323 Xonsh Shell Combines the Best of Bash Shell and Python in Linux Terminal.md @@ -0,0 +1,109 @@ +[#]: subject: "Xonsh Shell Combines the Best of Bash Shell and Python in Linux Terminal" +[#]: via: "https://itsfoss.com/xonsh-shell/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14390-1.html" + +Xnosh Shell:在 Linux 终端结合 Bash Shell 和 Python 的最佳特性 +====== + +![](https://img.linux.net.cn/data/attachment/album/202203/24/111824ufw1815lyvclnsr2.jpg) + +最受欢迎的 shell 是什么?我猜你会回答 bash 或者 zsh,没错,的确如此。 + +UNIX 和 Linux 系统上有许多可用的 shell,包括 Bash、Ksh、Zsh、Fish 等等。 + +最近,我碰到了另外一个 shell,它结合了 Python 和 bash,还蛮特别的。 + +### Xonsh shell,为喜爱 Python 的 Linux 用户而打造 + +[Xonsh][1] 是一个使用 Python 编写的跨平台 shell 语言和命令提示符。 + +它结合了 Python 和 Bash shell,因此你可以在这个 shell 中直接运行 Python 命令(语句)。你甚至可以把 Python 命令和 shell 命令混合起来使用。 + +![][2] + +听起来不错吧?如果你是一个 Python 程序员的话,你应该会更加兴奋。 + +### 在 Linux 上安装 Xonsh shell + +有多种方式可以在 Linux 系统上安装 Xonsh shell。 + +你可以使用软件包管理器安装它(主要的 Linux 发行版的仓库中都有 Xonsh shell)。 + +在 Ubuntu 和 Debian 上,你可以尝试运行: + +``` +sudo apt install xonsh +``` + +因为它本质上是一个 Python 应用,所以你总是可以使用 Pip 来安装(如果你的系统已经安装了的话)。或者,你也可以使用 Conda 来安装 Xonsh。同时,它还提供了 AppImage 格式和 Docker 镜像。 + +你可以自由选择你喜欢的安装方式。 + +### Xonsh shell 初体验 + +如果你不熟悉 Linux 的“多 shell”概念和终端的相关知识,我推荐你阅读 [我写的一篇终端入门的文章][3]。这篇文章会帮助 Linux 新手弄清楚很多东西。 + +我在这里简单介绍一下。你的终端运行着一个默认的 shell(通常是 bash shell)。如果你在系统上安装了其他的 shell,你可以 [轻松地切换这些 shell][4]。 + +要进入 Xonsh shell,只需运行一条命令: + +``` +xonsh +``` + +![][5] + +它会建议你运行一个设置向导,然后创建一个 Xonsh shell 的自定义 `rc` 配置文件。这是可选的,你也可以晚些时候再做。 + +一旦你开始使用它,你就立刻会感觉到一些不同。 + +当你开始输入一条命令时,Xonsh 会自动建议历史记录中的最后一条匹配命令。你可以按下右箭头键确认使用这条自动建议的命令。你也可以按下上、下箭头键来选择历史记录中的其他匹配命令。 + +![Xonsh shell automatically suggests last matching command from the history as you type][6] + +不仅如此,它还支持交互式的 Tab 补全。当你开始输入命令,并按下 `tab` 键,它会显示一个类似于下拉式的交互式菜单。你可以在这个菜单中选择可用的命令。 + +![Tab completion in Xonsh shell][7] + +你可以混合使用 Python 和 bash 命令,并且直接在 shell 中运行它们。 + +如果你对 [终端定制][8] 感兴趣,你可以花点时间和精力,根据自己的喜好来定制 Tab 补全、按键绑定和颜色样式。 + +它同时拥有一个叫做 [Xontrib][9] 的用户自定义插件系统,你可以使用这些插件来扩展 Xonsh shell 的功能。 + +如果你是一个终端爱好者,并渴望学习更多终端知识,你可以浏览它的 [丰富的文档系统][10]。 + +### 最后 + +大多数用户坚持使用默认的 Bash shell,这很正常。有一些开发者和系统管理员会选择使用 Zsh,因为它有很多附加特性。而 Xonsh 完全聚焦在 Python 上,对于 Python 使用者来说,它或许具有吸引力。对于其余的人来说,Bash 已经足够好了。 + +你使用过 Xonsh 或者其他的 shell 吗?你用它来代替 Bash 的原因是什么呢?欢迎在评论区留言。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/xonsh-shell/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://xon.sh/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/xonsh-shell-combines-python-bash.png?resize=800%2C470&ssl=1 +[3]: https://itsfoss.com/basic-terminal-tips-ubuntu/ +[4]: https://linuxhandbook.com/change-shell-linux/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/xonsh-shell.png?resize=800%2C451&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/auto-suggestions-from-history-in-xonsh-shell.png?resize=800%2C258&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/tab-completion-xonsh-shell.png?resize=800%2C354&ssl=1 +[8]: https://itsfoss.com/customize-linux-terminal/ +[9]: https://github.com/topics/xontrib +[10]: https://xon.sh/tutorial.html diff --git a/published/202203/20220324 7 Reasons to Try Open Source Secure Messenger ‘Threema.md b/published/202203/20220324 7 Reasons to Try Open Source Secure Messenger ‘Threema.md new file mode 100644 index 0000000000..afd351fd61 --- /dev/null +++ b/published/202203/20220324 7 Reasons to Try Open Source Secure Messenger ‘Threema.md @@ -0,0 +1,157 @@ +[#]: subject: "7 Reasons to Try Open Source Secure Messenger ‘Threema’" +[#]: via: "https://news.itsfoss.com/reasons-to-try-threema/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14404-1.html" + +尝试开源的安全通讯软件 Threema 的 7 个理由 +====== + +> Threema 是一个优质的开源通讯软件,专注于安全和隐私,提供了一个去中心的基础设施。 + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/threema.png?w=1200&ssl=1) + +现在已经有很多私密的 WhatsApp 代替品可供我们选择,Threema 则是其中最好的可选项之一。 + +可是,为什么你要考虑尝试它呢?它是“终极的”安全通讯软件吗? + +怎么说呢,每个安全通讯软件都只满足特定用户群体的需求。所以,把任何开源的通讯软件当作是“终极的”选项,都是不明智的。 + +因此,我列举了一些你或许会想尝试 Threema 而不是其他类似选项的理由。 + +### Threema:背景概览 + +在我开始说明为什么要尝试 [Threema][2] 这款私密通讯软件之前,请允许我再介绍一下它。 + +Threema 是一个流行的安全通讯软件,它由瑞士团队研发,专注于个人隐私。它也是一个付费软件,你需要在 [Play Store][3] 或者 [App Store][4] 上,一次性支付费用(大约 4 美元),才能够在你喜爱的移动设备上使用它。 + +起初,它是一个专有的安全通讯软件,是 [Signal][5] 等其他软件的竞争者。 + +在 2020 年的时候,Threema 决定在 [GitHub][6] 上开源它的所有软件。 + +你可以下载到移动应用,也可以得到 Linux 桌面(包括 Windows 和 macOS)上的支持。遗憾的是,它在桌面上目前没有独立的客户端。 + +因此,你需要让移动设备保持开启状态,才能使用桌面上的 Threema(就和 WhatsApp Web 的工作方式一样)。 + +### 下面是你尝试 Threema 的可能理由 + +如果你正在寻找一个隐私友好的安全通讯软件,并且你的同事/朋友/家人不介意支付一次性费用的话,你可以把它作为一个可选项。 + +支持你这么做的理由包括: + +#### 1. 不需要手机号码 + +![][7] + +和 WhatsApp 不同,你不需要使用手机号码来注册 Threema。当然,你可以选择添加你的手机号码,如果你希望别人能够很快找到你的话。 + +但是,手机号码只是注册 Threema 的一个选填项。如果你不想让别人知道你的手机号码,你可以使用注册时生成的 **Threema ID**(用户名)。 + +这样的话,如果你要和别人交流,你必须分享你的 Threema ID,而不是你的手机号码。 + +值得一提的是,即使在没有 SIM 卡的设备上,它也能完美工作,因为你不必提供手机号码就可以注册成功。 + +#### 2. 开源 + +虽然这是一个显而易见的理由,但它十分重要。 + +我非常重视这一点。如果你想要一个值得信赖的 WhatsApp 替代品,你应该倾向于选择一个开发稳定的开源通讯软件。 + +#### 3. 去中心化的基础设施 + +![][8] + +和大多数主流产品不同,Threema 提供了一个去中心化的基础设施,以确保更好地抵御检查。 + +换句话说,Threema 并不依赖于一个中心服务器架构,也就不会发生“一个错误导致整个网络瘫痪”这种情况。 + +这个错误可能是一次停电,或者是一次检查/限制服务的行动。 + +在这些情况下,Threema 会是更有用和更有效的选择。 + +#### 4. 收费软件 + +它是一个收费软件(一次性付费),这也算是一个好消息吗? + +对于某些人来说,是的。 + +如果你想要寻找一个几乎不可能有垃圾消息的通讯软件,而且你也不想让你的联系人找到你(或是给你发一些你不想要的信息),那么 Threema 就是你的一个完美选项。 + +毕竟,为一个出色的开源解决方案而付费是值得的,对吧? + +#### 5. 可靠的用户界面和特性 + +![Credits: Threema][9] + +Threema 不是一个新产品,它已经开发了好几年了。 + +因此,它能够提供稳定的用户体验,以及一些激动人心的特性,比如说它支持在群聊中发起投票。 + +你可以使用“同意/不同意”选项,以一种静默的方式确认接收方是否收到了消息,而不会触发一个发送给他们的通知。 + +注意,“同意/不同意”的功能只在个人会话中有效。 + +你也可以使用二维码来验证你的联系人身份,以此来避免中间人man-in-the-middle攻击。 + +和其他的安全通讯软件相比,Threema 对平板电脑的支持也不错。 + +![Credits: Threema][10] + +#### 6. 瑞士团队 & 遵守 GDRP 准则 + +你可能会在意,开发团队是否会受到所在国家的司法管辖权和隐私法等限制,那么对你而言,Threema 就是一个理想的私密通讯软件。 + +Threema 受瑞士的法律约束,而众所周知,瑞士的法律是最重视个人隐私的。 + +除此之外,Threema 还提到了它完全遵守 GDRP 准则。如果你在意这一点的话,Threema 是一个不错的选择。 + +#### 7. 在工作中使用 Threema + +![][11] + +有趣的是,Threema 还有另外一个 [独立的版本][11],专注于加强公司内部的通讯安全。 + +所以,如果你需要一个安全通讯平台来作为即时通讯软件的话,Threema 将是一个吸引人的选择。 + +- [试试 Threema][12] + +### 最后,我的看法 + +我已经使用 Threema 很长时间了,我承认我在上面没有很多联系人。 + +但我还是要说,它的用户体验是极佳的,并且我在 iOS 和 Android 端都使用过相当长的时间。 + +因此,Threema 更适合那些不想对任何有关隐私的特性妥协的严肃用户。 + +与此同时,作为一款收费软件,并不是每个人都愿意尝试它。但仔细想想,你将会得到一个可靠的注重隐私的通讯软件,它还是开源的,并且会接受定期的审查。 + +你对这款软件有什么看法?请在评论区分享你的观点吧! + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/reasons-to-try-threema/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/private-whatsapp-alternatives/ +[2]: https://threema.ch/en/home +[3]: https://play.google.com/store/apps/details?id=ch.threema.app&hl=en_US&gl=US +[4]: https://apps.apple.com/us/app/threema-the-secure-messenger/id578665578 +[5]: https://itsfoss.com/install-signal-ubuntu/ +[6]: https://github.com/threema-ch +[7]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/threema-phone-number.jpg?w=1200&ssl=1 +[8]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/threema-decentralize-1.jpg?w=1200&ssl=1 +[9]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/threema-ui.jpg?w=1280&ssl=1 +[10]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/threema-tablet.jpg?w=1213&ssl=1 +[11]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/threema-work.png?w=1081&ssl=1 +[12]: https://threema.ch/en diff --git a/published/202203/20220324 GNOME 42 is Here With Dark Mode, New Screenshot UI, and More Exciting Features.md b/published/202203/20220324 GNOME 42 is Here With Dark Mode, New Screenshot UI, and More Exciting Features.md new file mode 100644 index 0000000000..07c2337c45 --- /dev/null +++ b/published/202203/20220324 GNOME 42 is Here With Dark Mode, New Screenshot UI, and More Exciting Features.md @@ -0,0 +1,120 @@ +[#]: subject: "GNOME 42 is Here With Dark Mode, New Screenshot UI, and More Exciting Features" +[#]: via: "https://news.itsfoss.com/gnome-42-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14392-1.html" + +GNOME 42 发布:深色模式、新的截图界面 +====== + +> GNOME 42 终于到来了,它带来了急需的视觉升级和功能改进。 + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/gnome-42.jpg?w=1200&ssl=1) + +[GNOME 42][17] 是一个有着显著视觉变化的重大升级。 + +GNOME 42 提供了许多必要的改进和急需的升级。现在它已经发布了,就让我们来看看一些关键的亮点吧。 + +### GNOME 42 新特性 + +鉴于我们已经写了一篇 [详细的文章来介绍 GNOME 42 的新特性][1],请允许我在这里挑选其中最重要的几个来介绍。 + +[![][2]](https://youtu.be/du-2QpWbiLU) + +### 1. 深色模式主题和外观调整 + +![][3] + +尽管其他的一些桌面环境已经有了系统级的深色样式偏好设置,然而 GNOME 此前并不支持该功能。 + +在 GNOME 42 中,GNOME 团队从 elementary OS 团队那里获得了灵感(这要归功于 [elementary OS 6][4] 出色的深色模式)。 + +你可以注意到,一个新的“外观Appearance”选项取代了“背景Background”选项,它可以让你在浅色/深色模式间无缝切换。 + +![][5] + +桌面壁纸也有浅色/深色的不同版本,以便在你选择的对应模式时,为你提供最佳的对比度。 + +### 2. 更新的文件夹图标主题 + +GNOME 的文件夹图标主题看起来也太古老了。为了摆脱这种印象,它接收了一些视觉更新,以便在浅色/深色主题下看起来更棒: + +![][6] + +### 3. 新的截图界面 + +新的 GNOME 42 截图的界面是本次发布的最好的特性之一。 + +它不仅仅局限于截图,只要简单切换一下,你就可以用它来录制屏幕。它的用户界面看起来很棒,而且在我最初使用的 Fedora 36(预发布版)中工作良好。 + +![][7] + +### 4. GNOME 应用升级到了 GTK 4 + +为了与 GNOME 42 的总体用户体验保持一致,得益于 [libadwaita][8],默认应用程序获得了彻底的视觉更新。 + +不仅限于用户界面,一些 GNOME 应用本身也获得了新特性。 + +甚至一些第三方的 GNOME 应用,比如 [Fragments 2.0][9],也有了重大改变,以便在 GNOME 42 中提供最佳体验。 + +### 5. 新的文本编辑器和控制台 + +![][10] + +你会注意到,[现代的 GNOME 文本编辑器][11] 取代了广受欢迎的 Gedit,成为了默认的文本编辑器。 + +并且,你再也找不到 GNOME 终端应用了。取而代之的是,现在有了一个新的终端应用,它提供了一些用户界面的增强,名字叫做“控制台Console”。 + +![][12] + +### 其他改进 + +除了视觉变化,新版本的 GNOME 还进行了性能优化和整个平台的细微改进。其中包括了以下升级: + + * 提升了文件检索效率 + * 远程桌面功能现在支持 RDP 协议了 + * GNOME 网页浏览器现在开启了硬件加速 + +你可以在 [官方声明][13] 中了解这个版本的所有变化。 + +### 下载 GNOME 42 + +你可以在 [GNOME OS][14] 上,通过 Boxes 虚拟机来测试 GNOME 42 最新的稳定构建版本,或者你可以下载 [OpenSUSE Tumbleweed][15](应该会在近期发布)。 + +尽管 [Intel 的 Clear Linux 似乎在它的最新版本中增加了 GNOME 42][16],但和 Ubuntu 22.04 长期支持版和 Fefora 36 相比,它并不是一个完美的替代桌面。 + +你也可以尝试附带 GNOME 42 的 Arch,或者等待下个月将发布的 Ubuntu 22.04 长期支持版和 Fedora 36. + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gnome-42-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-14267-1.html +[2]: https://i0.wp.com/i.ytimg.com/vi/du-2QpWbiLU/hqdefault.jpg?w=780&ssl=1 +[3]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/fedora-36-gnome-42-dark.jpg?resize=1568%2C882&ssl=1 +[4]: https://news.itsfoss.com/elementary-os-6-features/ +[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/02/gnome-42-dark-mode-wallpaper.jpg?w=1200&ssl=1 +[6]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/02/gnome-42-file-manager-light.jpg?resize=1568%2C1017&ssl=1 +[7]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/02/gnome-42-screenshot.jpg?w=1340&ssl=1 +[8]: https://news.itsfoss.com/gnome-libadwaita-library/ +[9]: https://news.itsfoss.com/fragments-2-0-release/ +[10]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/02/gnome-42-text-editor-alpha.jpg?w=1480&ssl=1 +[11]: https://linux.cn/article-14060-1.html +[12]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/console-screenshot-1.png?w=694&ssl=1 +[13]: https://release.gnome.org/42/ +[14]: https://itsfoss.com/gnome-os/ +[15]: https://get.opensuse.org/tumbleweed +[16]: https://news.itsfoss.com/clear-linux-gnome-42/ +[17]: https://os.gnome.org/ diff --git a/published/20220327 Top 10 Linux Distributions for Programmers in 2022 -Featured.md b/published/20220327 Top 10 Linux Distributions for Programmers in 2022 -Featured.md new file mode 100644 index 0000000000..e2caf8ed1d --- /dev/null +++ b/published/20220327 Top 10 Linux Distributions for Programmers in 2022 -Featured.md @@ -0,0 +1,233 @@ +[#]: subject: "Top 10 Linux Distributions for Programmers in 2022 [Featured]" +[#]: via: "https://www.debugpoint.com/2022/03/top-linux-distributions-programmers-2022/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "aREversez" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14547-1.html" + +最适合程序员的 10 款 Linux 发行版 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/05/143612dml7eizi0vh170v7.jpg) + +> 我们为程序员和开发人员总结了 2022 年最好用的 10 款 Linux 发行版,以便他们开展日常工作和个人项目。 + +由于工作和项目需要,程序员和开发人员会用到各种工具和应用,包括代码编辑器、编译器、插件以及数据库等等。若对现代开发人员的工作流程做一番整理,一般流程如下: + + - 创建代码仓库 + - 编程 + - 调试 + - 测试 + - 部署 + +上述工作流程需要用到各种各样的工具,一份标准的工具清单如下: + + - 代码编辑器 + - 简单的文本编辑器 + - 网页浏览器(包括 Web 开发人员使用的各种浏览器) + - 数据库引擎 + - 本地服务器 + - 各类编程语言的编译器 + - 调试器 + - 监视或分析工具(客户端或者网页端) + +与 Windows 相比,Linux 可以说是编程的最佳平台。之所以这样说,主要是因为 Linux 发行版与 Windows 不同,预装了许多功能强大的包和软件,自行安装也比较容易。在本文中,考虑到一些原因,我不会将 macOS 纳入对比范围之内。 + +综上,本文将整理出 2022 年最适合程序员的 10 款 Linux 发行版。 + +### 2022 最适合程序员的 10 款 Linux 发行版 + +#### 1、Fedora 工作站 + +![Fedora 35 Workstation][1] + +在这 10 款 Linux 发行版当中,最优秀的可能就要数 Fedora Linux 了。Fedora 默认的工作站版本精选了一些软件包,为用户带来真正的 GNOME 桌面体验。 + +Fedora Linux 默认安装了开箱即用的主流开发软件包,包括 PHP、OpenJDK、PostgreSQL、Django、Ruby on Rails 以及 Ansible 等等。 + +dnf 是 Fedora Linux 的包管理器,有了它,安装代码编辑器以及其他软件就相当容易了。此外,你还可以使用“软件”应用商店一键搜索、安装软件。 + +Fedora Linux 支持 Snap 和 Flatpak,使用起来会更加灵活方便。你还可以使用 RPM Fusion 仓库,获取大量自由或非自由的软件。因为许可证等一些原因,Fedora Linux 不希望在其主仓库内包括这些包,于是就有了 RPM Fusion。 + +点击下方链接,了解 Fedora Linux 最新版本。 + +> **[下载 Fedora][2]** + +#### 2、Ubuntu Linux + +![Ubuntu Desktop is a perfect Linux Distribution for Programmers.][3] + +在今天,无论是服务器还是个人电脑,使用最为广泛的发行版当属 Ubuntu Linux。Ubuntu 提供长期支持版本,每个长期支持版本官方提供五年的支持(外加五年的维护支持),并且每年为高级用户提供两个短期版本。 + +由于 Ubuntu 非常流行,各种包与软件的供应商都会提供适用于 Ubuntu 的版本(.deb)。此外,得益于广泛的知名度,Ubuntu 有着更为庞大的论坛群体和更为丰富的帮助文档。所以说,Ubuntu 是开发人员的最佳之选,尤其是在开发过程中陷入难题的时候,Ubuntu 更能发挥其作用。点击下方链接,了解更多。 + +> **[下载 Ubuntu][4]** + +#### 3、openSUSE + +openSUSE 是用在全球关键系统中最稳定、最专业的 Linux 发行版之一,是企业界(包括个人电脑、服务器以及瘦客户机)的首选解决方案。 + +相较于 Ubuntu 和 Fedora,openSUSE 具有一些独特的优势。首先,openSUSE 有两个版本:Leap 和 Tumbleweed。其中,openSUSE Leap 属于长期支持版,为用户带来稳定的升级体验。openSUSE Tumbleweed 属于滚动发行版,有着最新、最尖端的软件包。 + +如果你想获得最新的包和硬件支持,助力开发工作,你可以选择 openSUSE Tumbleweed;如果你想要的是稳定性,无需频繁维护即可长期运行,openSUSE Leap 会更适合你。 + +使用 openSUSE 进行开发工作,最大的优势之一就是 YaST 包管理工具。有了 YaST,许多操作可以轻松实现自动化。 + +此外,openSUSE 获取软件非常方便。它有专属的应用网站,供用户查找、安装包和软件。 + +如果你有一些 Linux 发行版的使用经验,推荐选择 openSUSE 进行开发工作。 + +> **[下载 openSUSE][5]** + +#### 4、Manjaro Linux + +Manjaro Linux 基于 Arch Linux,不过安装起来更容易一些。Manjaro Linux 自身还有许多独特功能,比如带有图形用户界面的安装程序、pamac 软件安装器以及高质量的软件仓库等等。Manjaro 有三个主要的桌面版本:GNOME、KDE Plasma 和 Xfce,足以满足各类用户的需要。 + +如果你想使用 Arch Linux 及其滚动发行的软件包来满足开发需求,但又不想在安装原版 Arch 上来回折腾,Manjaro 绝对是你的最佳选择。 + +> **[下载 Manjaro][6]** + +#### 5、Arch Linux + +尽管有 Manjaro 以及其他基于 Arch Linux 的发行版,而且安装操作非常简单,你可能还是想在自己的定制电脑上折腾一番,亲自动手 [安装原版 Arch][7]。 + +不过这种选择更适合程序员和开发人员,因为他们想得到更多的掌控权,或者想要定制一个 Linux 操作系统,用于开发项目或满足开发需求。这样一来,他们可能就会安装 Arch Linux,选择自己最喜欢的桌面,设置专用于开发工作的操作系统。 + +假设你对 Arch Linux 和普通的电脑都比较熟悉,那么 Arch Linux 就是你的最佳选择,因为在自己定制的 Linux 操作系统上,你可以完全控制每一个软件包。 + +> **[下载 Arch Linux][9]** + +#### 6、Pop OS + +Pop OS(即 Pop!_OS)由电脑制造商 System76 针对其系列硬件开发,是一款基于 Ubuntu 的自由开源的发行版。发行周期与 Ubuntu 保持同步,并为用户提供了额外的调整工具和软件包。 + +![Pop OS 21.10 Desktop][10] + +Pop OS 基于 Ubuntu,默认支持多种程序语言,所以非常适合程序员使用。Pop OS 的软件中心非常出色,设有开发软件专区,深受计算机科学家和程序员青睐。 + +此外,Pop OS 的 COSMIC 桌面(GNOME 桌面的定制版)支持窗口自动平铺,具有柔美的调色板、默认的深色模式以及丰富的设置选项,给程序员带来独特的使用体验。 + +如果你既想要基于 Ubuntu,又想要适合程序员的稳定 Linux 发行版,推荐选择 Pop OS。 + +> **[下载 POP OS][11]** + +#### 7、KDE Neon + +作为一个程序员,如果你喜欢 KDE Plasma 桌面,又想使用基于 Qt 的开发环境,那么你应该选择 KDE Neon。 + +KDE Neon 基于 Ubuntu 长期支持版本,兼具最新的 KDE Plasma 桌面和 KDE 框架。因此,使用 KDE Neon,你不仅可以享受 Ubuntu 长期支持版本的稳定性,还能体验基于 Qt 的最新版 KDE 软件。 + +运行速度快,程序开箱即用,用户界面友好,广泛的社区支持,如你所愿,完美如斯。 + +> **[下载 KDE Neon][12]** + +#### 8、Debian + +Debian GUN/Linux 就无需过多介绍了。Debian 的稳定分支是 Ubuntu 及其衍生系统的基础。换句话说,Debian 是最主要、最稳定的 Linux 发行版之一。优秀的稳定性和较长的支持时间使得 Debian 非常适合用做开发环境。 + +不过,Debian 的稳定分支比较保守,很少使用最新的软件包。毕竟全世界(几乎)都依赖 Debian 的稳定运行,所以维护者在检查、合并软件包时必须十分谨慎。 + +Debian 不仅能够长期稳定运行,而且维护成本较低,是高级用户和系统管理员绝佳的编程环境。 + +> **[下载 Debian Linux][13]** + +#### 9、Kali Linux + +Kali Linux 由 Offensive Security 开发,服务对象为道德黑客和查找网络漏洞的渗透测试人员,内置大量黑客软件和工具。 + +对技术娴熟的程序员和开发人员来说,Kali Linux 堪称最佳之选。如果你精通 Linux,具备解决错误和依赖问题的经验,推荐选择 Kali Linux。 + +> **[下载 Kali Linux][14]** + +#### 10、Fedora Labs + +最后,我们来看看 Fedora Linux 的各种 Fedora Labs 版本。 + +Fedora Labs 为程序员、科学家、学生等各类人群提供各类专业化的 Linux 发行版,内置各类专业软件、包和工具。很多人并没有意识到 Fedora Labs 的优势,只要经过适当的配置,这些版本都是非常优秀的发行版。 + +我们来总结一下这些 Fedora Labs: + +Fedora Scientific: + + * 采用 KDE Plasma 桌面,集成科学和数学领域的各种开源工具 + * 软件清单如下: + * 基于 C/C++ 的 GNU Scientific Library + * 兼容 MATLAB 的 MGNU Octave + * LaTeX + * Gnuplot:用于绘制 2D 与 3D 图像 + * Pandas:用于数据处理的 Python 库 + * IPython + * Java 和 R 程序语言相关包 + +> **[下载 Fedora Scientific][15]** + +Fedora COMP NEURO: + + * 采用 GNOME 桌面环境,预装神经科学领域的各种开源包和应用。 + +> **[下载 Comp Neuro][25]** + +Fedora Robotics Suite: + + * 集成各种开源机器人技术包和软件,适合初学者、资深计算机科学家和编程人员。 + +> **[下载 Fedora Robotics][16]** + +除了上述版本,还有 [Fedora Security Labs][17]、[Fedora Astronomy][18] 和 [Fedora Python Classroom][19] 可供选择。 + +在编程项目以及科学领域,Fedora Labs 堪称完美之选。 + +### 总结 + +那么,怎样才能从以上 10 款 最适合程序员的 Linux 发行版中选出自己最喜欢的呢? + +如果你想要一款开发系统,但又不想耗费太多精力,拿不定主意的话,推荐使用 Fedora 工作站或者 Ubuntu。 + +如果你的空闲时间比较多或者想要进一步掌控自己的系统,乐于尝试并且能够忍受偶尔发生的错误,推荐选择基于 Arch Linux 的系统。 + +对于刚接触 Linux 生态的新手程序员来说,Pop OS 也是一个不错的选择。如果有特殊需要的话,可以试试 Fedora Labs。 + +我希望本文能帮助程序员和开发人员选出最喜欢的 Linux 发行版。 + +祝你好运! + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/03/top-linux-distributions-programmers-2022/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[aREversez](https://github.com/aREversez) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/wp-content/uploads/2021/11/Fedora-35-Workstation-1024x528.jpg +[2]: https://getfedora.org/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/03/Ubuntu-Desktop-is-a-perfect-Linux-Distribution-for-Programmers-1024x579.jpg +[4]: https://ubuntu.com/download +[5]: https://www.opensuse.org/ +[6]: https://manjaro.org/download/ +[7]: https://www.debugpoint.com/2022/01/archinstall-guide/ +[8]: https://www.debugpoint.com/2022/03/top-nitrux-maui-applications/ +[9]: https://archlinux.org/download/ +[10]: https://www.debugpoint.com/wp-content/uploads/2021/12/Pop-OS-21.10-Desktop-1024x579.jpg +[11]: https://pop.system76.com/ +[12]: https://neon.kde.org/download +[13]: https://www.debian.org/distrib/ +[14]: https://www.kali.org/ +[15]: https://labs.fedoraproject.org/en/scientific/ +[16]: https://labs.fedoraproject.org/en/robotics/ +[17]: https://labs.fedoraproject.org/en/security +[18]: https://labs.fedoraproject.org/en/astronomy +[19]: https://labs.fedoraproject.org/en/python-classroom +[20]: https://t.me/debugpoint +[21]: https://twitter.com/DebugPoint +[22]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[23]: https://facebook.com/DebugPoint +[24]: https://www.debugpoint.com/2022/03/top-nitrux-maui-applications/ +[25]: https://labs.fedoraproject.org/en/comp-neuro/ diff --git a/published/202204/20181107 Gitbase- Exploring Git repos with SQL.md b/published/202204/20181107 Gitbase- Exploring Git repos with SQL.md new file mode 100644 index 0000000000..a8ab2cb36f --- /dev/null +++ b/published/202204/20181107 Gitbase- Exploring Git repos with SQL.md @@ -0,0 +1,107 @@ +[#]: subject: "Gitbase: Exploring Git repos with SQL" +[#]: via: "https://opensource.com/article/18/11/gitbase" +[#]: author: "Francesc Campoy https://opensource.com/users/francesc/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14470-1.html" + +Gitbase:使用 SQL 探索 Git 仓库 +====== + +> Gitbase 是一个由 Go 驱动的开源项目,它使得我们可以在 Git 仓库上运行 SQL 查询。 + +![](https://img.linux.net.cn/data/attachment/album/202204/13/230413ddcpm87p2bds18db.jpg) + +Git 已经成为了代码版本控制的事实标准。虽然 Git 已经很流行了,但想用它来对源代码仓库的历史和内容进行深度分析,仍然是一件复杂的事情。 + +另一方面,SQL 则是一个经过实际检验、适合查询大型代码库的的语言,毕竟 Spark 和 BigQuery 等项目都采用了 SQL 作为查询语言。 + +因此,在 source{d} 公司,我们顺理成章地结合了这两种技术来创建了 Gitbase:这是一个用 SQL 对 Git 仓库进行大规模分析的“代码即数据”解决方案。 + +[Gitbase][2] 是一个完全开源的项目,它站在一系列巨人的肩膀上,是它们使 Gitbase 的发展成为可能。本文旨在指出其中的主要部分。 + +![][3] + +*[Gitbase 试验场][4] 提供了一种使用 Gitbase 的可视化方式。* + +### 使用 Vitess 解析 SQL + +Gitbase 将 SQL 作为用户接口。这意味着我们需要解析基于 MySQL 协议传输的 SQL 请求,并理解它们。幸运的是,我们在 YouTube 的朋友和他们的 [Vitess][5] 项目已经实现了这一点。Vitess 是一个数据库集群系统,用于 MySQL 的水平扩展。 + +我们直接截取一些重要的代码片段,并把它做成了一个 [开源项目][6]。这个项目允许任何人在几分钟内编写一个 MySQL 服务器(正如我在 [justforfunc][7] 的专题:[CSVQL - 用 SQL 处理 CSV][8] 中所展示的那样)。 + +### 用 go-git 读取 Git 储存库 + +当成功解析了一个请求,我们还需要读取数据集里的 Git 仓库,才能够知道该如何回复它。为此,我们集成了 source{d} 最成功的仓库 [go-git][9]。go-git 是一个高度可扩展的纯 Go 语言的 Git 实现。 + +这使得我们能够轻松地分析以 [siva][10] 文件格式存储在磁盘上的源代码仓库(siva 也是一个 source{d} 的开源项目),或是直接使用 `git clone` 克隆的仓库。 + +### 使用 Enry 检测编程语言,使用 Babelfish 解析文件 + +Gitbase 并没有将其分析能力局限于 Git 历史记录上。它还使用(显然也是)我们的开源项目 [Enry][11] 集成了语言检测功能,并使用 [Babelfish][12] 实现了程序解析的功能。Babelfish 是一个用于通用源代码解析的自托管服务器,它可以将代码文件转化为通用抽象语法树Universal Abstract Syntax Trees(UAST)。 + +这两个功能在 Gitbase 中呈现为用户函数 `LANGUAGE` 和 `UAST`。结合使用两个函数,许多查询请求都成为了可能,比如“找到上个月修改次数最多的函数名称”。 + +### 让它快速运行 + +Gitbase 经常要分析非常大的数据集,比如公共 Git 档案,其中有来自 GitHub 的 3TB 源代码(见 [公告][13])。为了做到这一点,每份 CPU 处理能力都很重要。 + +这就是为什么我们又集成了另外两个项目:Rubex 和 Pilosa。 + +### 使用 Rubex 和 Oniguruma 加快正则表达式的速度 + +[Rubex][14] 是 Go 的 `regexp` 标准库包的一个准替代品。之所以还不能完成替代,是因为他们没有在 `regexp.Regexp` 类型上实现 `LiteralPrefix` 方法,不过我也是直到现在才听说这个方法。 + +Rubex 的高性能得归功于高度优化的 C 语言库 [Oniguruma][15],它使用 [cgo][16] 来调用这个库。 + +### 使用 Pilosa 索引加快查询速度 + +索引基本上是每个关系型数据库的众所周知的特性,但 Vitess 却没有实现索引,因为它不是真正需要。 + +还好开源的 [Pilosa][17] 再一次拯救了我们,它是一个用 Go 实现的分布式位图索引,使得 Gitbase 可以用于大规模的数据集。Pilosa 是开源的,它极大地加快了对多个海量数据集的查询。 + +### 总结 + +我想通过这篇博文,亲自感谢开源社区,是他们让我们在如此短的时间内创建了 Gitbase,这是谁也没想到的。在 source{d} 公司,我们是开源的坚定信仰者,`github.com/src-d` 下的每一行代码(包括我们的 OKR 和投资者委员会)都可以证明这一点。 + +你想尝试一下 Gitbase 吗?最快、最简单的方法就是使用 source{d} 引擎。从 `sourced.tech/engine` 下载它,只需一个命令就能让 Gitbase 运行起来。 + +想了解更多吗?请查看我在 [Go SF meetup][18] 的演讲录音。 + +这篇文章 [最初发表在][20] Medium 上,经授权后在此重新发布。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/11/gitbase + +作者:[Francesc Campoy][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/francesc/ +[b]: https://github.com/lkxed/ +[1]: https://opensource.com/sites/default/files/lead-images/bus_cloud_database.png +[2]: https://github.com/src-d/gitbase +[3]: https://opensource.com/sites/default/files/uploads/gitbase.png +[4]: https://github.com/src-d/gitbase-web +[5]: https://github.com/vitessio/vitess +[6]: https://github.com/src-d/go-mysql-server +[7]: http://justforfunc.com/ +[8]: https://youtu.be/bcRDXAraprk +[9]: https://github.com/src-d/go-git +[10]: https://github.com/src-d/siva +[11]: https://github.com/src-d/enry +[12]: https://github.com/bblfsh/bblfshd +[13]: https://blog.sourced.tech/post/announcing-pga/ +[14]: https://github.com/moovweb/rubex +[15]: https://github.com/kkos/oniguruma +[16]: https://golang.org/cmd/cgo/ +[17]: https://github.com/pilosa/pilosa +[18]: https://www.meetup.com/golangsf/events/251690574/ +[19]: https://youtu.be/OXL2KxOTmBQ +[20]: https://medium.com/sourcedtech/gitbase-exploring-git-repos-with-sql-95ec0986386c diff --git a/published/202204/20190411 How do you contribute to open source without code.md b/published/202204/20190411 How do you contribute to open source without code.md new file mode 100644 index 0000000000..ab9b4d8400 --- /dev/null +++ b/published/202204/20190411 How do you contribute to open source without code.md @@ -0,0 +1,83 @@ +[#]: subject: "How do you contribute to open source without code?" +[#]: via: "https://opensource.com/article/19/4/contribute-without-code" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14514-1.html" + +如何以非代码形式贡献开源 +====== + +> 事实上,有无穷无尽的方法来为开源做贡献,其中一个简单的方法就是回答我们的投票问题。 + +![](https://img.linux.net.cn/data/attachment/album/202204/26/190136sd2nmv19m5vn905m.jpg) + +你是如何参与开源贡献的呢?我们组织了一个投票,结果如下: + +* 提交错误报告 - 67 票(35%) +* 解答用户的问题 - 39 票(20%) +* 写作(指南、故事、文档等) - 73 票(38%) +* 其他 - 12 票(6%) + +我的第一次开源贡献可以追溯到 20 世纪 80 年代中期,当时我们的机构第一次连上了 [UseNet][2],在那里我们发现了贡献代码,以及在其开发和支持过程中和别人分享的机会。 + +在今天,我们有无尽的贡献开源的机会。无论是贡献代码,还是制作一个视频教程,都是贡献的一种途径。 + +不过,我将直接跳过整个贡献代码的部分。诚然,我们中有许多写代码但不认为自己是开发者的人,他们也可以 [贡献代码][3]。但是,我更想提醒大家,还存在很多 [非代码形式可以贡献开源][4]。接下来,我会谈到其中的三种。 + +### 提交错误报告 + +有一种重要而具体的贡献形式,它可以被描述为“不要畏惧 [提交一个像样的错误报告][6]”以及 [与此相关的所有后果][5]。有时,要 [提交一个像样的错误报告][6] 是很有挑战性的。比如说: + +* 某些错误可能很难记录或描述。当计算机启动时,屏幕上可能会出现又长又复杂的信息,其中包含各种不能理解的代码。或者屏幕上可能显示有一些“异常行为”,但是却没有提供具体的错误信息。 +* 某些错误可能很难重现。它可能只发生在某些特定的硬件/软件配置上,或者它可能很少被触发,或者错误的产生场景不明确。 +* 某些错误可能与一个非常特殊的开发环境配置有关,但是这个配置庞杂混乱,无法分享,需要先耗费大量精力创建一个精简后的例子才行。 +* 当向发行版报告一个错误时,维护者可能会建议将该错误提交给上游,这有时会需要付出大量的工作,因为发行版所提供的版本不是上游社区感兴趣的主要版本。(当发行版提供的版本落后于官方支持的发布和开发版本时,就会有这种情况发生)。 + +尽管如此,我还是鼓励那些潜在的错误报告者(包括我)继续努力,并尝试让错误得到完整的记录和确认。 + +但如何开始呢?你可以使用你最喜欢的搜索工具寻找类似的错误报告,看看它们是如何描述的,它们被归档在哪里,等等。你也可以留意你使用的发行版(例如,[Fedora][7]、[openSUSE][8]、[Ubuntu][9])或软件包([LibreOffice][10]、[Mozilla][11])的错误报告页面,它们定义了正式的报告机制,你可以按步骤为他们报告相关错误。 + +### 解答用户的问题 + +我潜伏在各种邮件列表和 [论坛][13] 里,偶尔也会冒个泡,例如 [Ubuntu 质量控制团队][12] 和 [论坛][13]、[LinuxQuestions.org][14],以及 [ALSA 用户的邮件列表][15] 等。在这里,我的贡献可能与错误报告的关系不大,更多的是记录复杂的用例。不过,看到有人热心帮助他人,解决他人在某个问题上的遇到的麻烦,对每个人来说,这都是无疑一种很棒的体验。 + +### 从事开源相关的写作 + +最后,另一个我非常喜欢贡献的领域是 [撰写][16] 关于使用开源软件的文章。无论是使用指南,还是对某一特定问题的不同解决方案进行比较评估,或者只是笼统地探索一个感兴趣的领域(就我而言,是使用开源音乐播放软件来享受音乐)。一个类似的选择是制作一个教学视频。你很容易就可以做到边演示一些复杂的桌面操作(比如用 GIMP 创建一个绚丽的标志),边 [录制桌面][17]。而那些精通两种或多种语言的人,也可以考虑将现有的使用指南或视频翻译成另一种语言。 + +(LCTT 译注:读了这篇文章,你是不是想要马上投身于开源贡献呢?那么请考虑加入“Linux 中国翻译组(LCTT)”吧!我们有能帮助你快速上手翻译的 [维基][18],有热心友爱的 QQ 群,你甚至还能够在我们的官网上获得属于自己的译者专页……心动了吗?那就立刻行动起来吧!阅读 [维基][18] 以了解如何加入我们。) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/contribute-without-code + +作者:[Chris Hermansen][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/clhermansen +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/dandelion_blue_water_hand.jpg +[2]: https://en.wikipedia.org/wiki/Usenet +[3]: https://opensource.com/article/19/2/open-science-git +[4]: https://opensource.com/life/16/1/8-ways-contribute-open-source-without-writing-code +[5]: https://producingoss.com/en/bug-tracker.html +[6]: https://opensource.com/article/19/3/bug-reporting +[7]: https://docs.fedoraproject.org/en-US/quick-docs/howto-file-a-bug/ +[8]: https://en.opensuse.org/openSUSE:Submitting_bug_reports +[9]: https://help.ubuntu.com/stable/ubuntu-help/report-ubuntu-bug.html.en +[10]: https://wiki.documentfoundation.org/QA/BugReport +[11]: https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines +[12]: https://wiki.ubuntu.com/QATeam +[13]: https://ubuntuforums.org/ +[14]: https://www.linuxquestions.org/ +[15]: https://www.alsa-project.org/wiki/Mailing-lists +[16]: https://opensource.com/users/clhermansen +[17]: https://opensource.com/education/16/10/simplescreenrecorder-and-kazam +[18]: https://lctt.github.io/wiki/intro/lctt.html diff --git a/published/202204/20200426 6 tips for securing your WordPress website.md b/published/202204/20200426 6 tips for securing your WordPress website.md new file mode 100644 index 0000000000..38c12324ef --- /dev/null +++ b/published/202204/20200426 6 tips for securing your WordPress website.md @@ -0,0 +1,170 @@ +[#]: collector: (lujun9972) +[#]: translator: (hwlife) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14522-1.html) +[#]: subject: (6 tips for securing your WordPress website) +[#]: via: (https://opensource.com/article/20/4/wordpress-security) +[#]: author: (Lucy Carney https://opensource.com/users/lucy-carney) + +保护 WordPress 网站的 6 个技巧 +====== + +> 即使初学者也可以,并且应该采取这些步骤来保护他们的 WordPress 网站免受网络攻击。 + +![](https://img.linux.net.cn/data/attachment/album/202204/29/154648l33xt7xg6gk2nr8v.jpg) + +WordPress 已经驱动了互联网 30% 的网站,它是世界上增长最快的 内容管理系统content management system(CMS),而且不难看出原因:通过大量可用的定制化代码和插件、一流的 搜索引擎优化Search Engine Optimization(SEO),以及在博客界超高的美誉度,WordPress 赢得了很高的知名度。 + +然而,随着知名度而来的,也带来一些不太好的关注。WordPress 是入侵者、恶意软件和网络攻击的常见目标,事实上,在 2019 年被黑客攻击的 CMS 中,WordPress [约占 90%][2]。 + +无论你是 WordPress 新用户或者有经验的开发者,这里有一些你可以采取的重要步骤来保护你的 WordPress 网站。以下 6 个关键技巧将帮助你起步。 + +### 1、选择可靠的托管主机 + +主机是所有网站无形的基础,没有它,你不能在线发布你的网站。但是主机的作用远不止起简单的托管你的网站,它也要对你的网站速度、性能和安全负责。 + +第一件要做的事情就是检查主机在它的套餐中是否包含 SSL 安全协议。 + +无论你是运行一个小博客或是一个大的在线商店,SSL 协议都是所有网站必需的安全功能。如果你正在进行线上交易,你还需要 [高级 SSL 数字证书][3] ,但是对大多数网站来说,基本免费的 SSL 证书就很好了。 + +其他需要注意安全功能包括以下几种: + + * 日常的自动离线网站备份 + * 恶意软件和杀毒软件扫描和删除 + * 分布式服务攻击Distributed denial of service(DDOS)保护 + * 实时网络监控 + * 高级防火墙保护 + +另外除了这些数字安全功能之外,你的主机供应商的 _物理_ 安全措施也是值得考虑的。这些包括用安全警卫、闭路监控和二次验证或生物识别来限制对数据中心的访问。 + +### 2、使用安全插件 + +保护你的网站安全最有效且容易的方法之一是安装一个安全插件,比如 [Sucuri][4],它是一个 GPLv2 许可的开源软件。安全插件是非常重要的,因为它们能将安全管理自动化,这意味着你能够集中精力运行你的网站,而不是花大量的时间来与在线威胁作斗争。 + +这些插件探测、阻止恶意攻击,并提醒你需要注意的任何问题。简言之,它们持续在后台运行,保护你的网站,这意味着你不必保持 7 天 24 小时地保持清醒,与黑客、漏洞和其他数字垃圾斗争。 + +一个好的安全插件会免费提供给你所有必要的安全功能,但是一些高级功能需要付费订阅。举个例子,如果你想要解锁 [Sucuri 的网站防火墙][5] ,你就需要付费。开启 网站应用防火墙web application firewall(WAF)阻挡常见的威胁,并为给你的网站添加一个额外的安全层,所以当选择安全插件的时候,寻找带有这个功能的插件是一个好的主意。 + +### 3、选择值得信任的插件和主题 + +WordPress 的快乐在于它是开源的,所以任何人、每个人都能提供他们开发的主题和插件。但当选择高质量的主题和插件时,这也抛出一些问题。 + +在挑选免费的主题或插件时,有一些设计较差,或者更糟糕的是,可能会隐藏恶意代码。 + +为了避免这种情况,始终从可靠的来源来获取免费主题和插件,比如 WordPress 主题库。阅读对它的评论,并研究查看开发者是否构建过其他的程序。 + +过时的或设计不良的主题和插件可以为攻击者进入你的网站留下“后门”或错误,这就是为什么选择时要谨慎。然而,你也应该提防无效或者破解的主题。这些已经黑客破坏了的高级主题被非法销售。你可能会购买一个无效的主题,它看起来没什么问题,但会通过隐藏的恶意代码破坏你的网站。 + +为了避免无效主题,不要被打折的价格所吸引,始终坚持可靠的主题商店,比如官方的 [WordPress 目录][6]。如果你在其它地方寻找,坚持选择大型且值得信任的商店,比如 [Themify][7] ,这个主题和插件商店自从 2010 年就已经在经营了。Themify 确保它的所有 WordPress 主题通过了 [谷歌友好移动][8]Google Mobile-Friendly 测试,并在 [GNU 通用公共许可证][9] 下开源。 + +### 4、运行定期更新 + +这是 WordPress 的基本规则: 始终保持你的网站最新。然而,不是所有人都坚持了这个规则,只有 [43% 的 WordPress 网站][10] 运行的是最新版本。 + +问题是,当你的网站过期的时候,由于它在安全和性能修复方面落后的原因,容易受到故障、漏洞、入侵和崩溃的影响。过期的网站不能像更新的网站一样修复漏洞,攻击者能够分辨出哪些网站是过期的。这意味着他们能够依此来搜索最易受攻击的网站并袭击它们。 + +这就是为什么你始终要运行最新的 WordPress 版本的原因。为了保持网站安全处于最强的状态,你必须更新你的插件和主题,以及你的核心 WordPress 软件。 + +如果你选择一个受管理的 WordPress 托管套餐,你可能会发现你的供应商会为你检查并运行更新,以了解你的主机是否提供了软件和插件更新。如果没有,你可以安装一个开源插件管理器。比如 GPLv2 许可的 [Easy Updates Manager plugin][11] 作为替代品。 + +### 5、强化你的登录 + +除了通过仔细选择主题和安装安全插件来创建一个安全的 WordPress 网站外,你还需要防止未经授权的登录访问。 + +#### 密码保护 + +如果你在使用 [容易猜到的短语][12] 比如 “123456” 或 “qwerty” ,第一步要做的增强登录安全最简单的方法是更改你的密码。 + +尝试使用一个长的密码而不是一个单词,这样它们很难被破解。最好的方式是用一系列你容易记住且不相关的单词合并起来。 + +这里有一些其它的提示: + + * 绝不要重复使用密码 + * 密码不要包括像家庭成员的名字或者你喜欢的球队等明显的单词 + * 不要和任何人分享你的登录信息 + * 你的密码要包括大小写和数字来增加复杂程度 + * 不要在任何地方写下或者存储你的登录信息 + * 使用 [密码管理器][13] + +#### 变更你的登录地址 + +将默认登录网址从标准格式 `yourdomain.com/wp-admin` 变更是一个好主意。这是因为黑客也知道这个缺省登录网址,所以不变更它会有被暴力破解的风险。 + +为避免这种情况,可以将登录网址变更为不同的网址。使用开源插件比如 GPLv2 许可的 [WPS Hide Login][14] 可以更加安全、快速和轻松的自定义登录地址。 + +#### 应用双因素认证 + +为了提供更多的保护,阻止未授权的登录和暴力破解,你应该添加双因素认证。这意味着即使有人 _确实_ 得到了你的登录信息,但是他们还需要一个直接发送到你的手机上的验证码,来获得对你的 WordPress 网站管理的权限。 + +添加双因素认证是非常容易的,只需要安装另一个插件,在 WordPress 插件目录搜索 “two-factor authentication” ,然后选择你要的插件。其中一个选择是 [Two Factor][15] ,这是一个流行的 GPLv2 许可的插件,已经有超过 10000 次安装。 + +#### 限制登录尝试 + +WordPress 可以让你多次猜测登录信息来帮助你登录。然而,这对黑客尝试获取未授权访问 WordPress 网站并发布恶意代码也是有帮助的。 + +为了应对暴力破解,安装一个插件来限制登录尝试,并设置你允许猜测的次数。 + +### 6、禁用文件编辑功能 + +这不是一个适合初学者的步骤,除非你是个自信的程序员,不要尝试它。并且一定要先备份你的网站。 + +那就是说,如果你真的想保护你的 WordPress 网站,禁用文件编辑功能 _是_ 一个重要的措施 。如果你不隐藏你的文件,它意味着任何人从管理后台都可以编辑你的主题和插件代码,如果入侵者进入,那就危险了。 + +为了拒绝未授权的访问,转到你的 `.htaccess` 文件并输入: + +``` + +order allow,deny +deny from all + +``` + +或者,要从你的 WordPress 管理后台直接删除主题和插件的编辑选项,可以添加编辑你的 `wp-config.php` 文件: + +``` +define( 'DISALLOW_FILE_EDIT', true ); +``` + +保存并重新加载这个文件,插件和主题编辑器将会从你的 WordPress 管理后台菜单中消失,阻止任何人编辑你的主题或者插件代码,包括你自己。如果你需要恢复访问你的主题和插件代码,只需要删除你添加在 `wp-config.php` 文件中的代码即可。 + +无论你阻止未授权的访问,还是完全禁用文件编辑功能,采取行动保护你网站代码是很重要的。否则,不受欢迎的访问者编辑你的文件并添加新代码是很容易的。这意味着攻击者可以使用编辑器从你的 WordPress 站点来获取数据,或者甚至利用你的网站对其他站点发起攻击。 + +隐藏文件更容易的方式是利用安全插件来为你服务,比如 Sucuri 。 + +### WordPress 安全概要 + +WordPress 是一个优秀的开源平台,初学者和开发者都应该享受它,而不用担心成为攻击的受害者。遗憾的是,这些威胁不会很快消失,所以保持网站的安全至关重要。 + +利用以上措施,你可以创建一个更加健壮、更安全的保护水平的 WordPress 站点,并给自己带来更好的使用体验。 + +保持安全是一个持续的任务,而不是一次性的检查清单,所以一定要定期重温这些步骤,并在建立和使用你的CMS时保持警惕。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/wordpress-security + +作者:[Lucy Carney][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/lucy-carney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_3reasons.png?itok=k6F3-BqA (A lock on the side of a building) +[2]: https://cyberforces.com/en/wordpress-most-hacked-cms +[3]: https://opensource.com/article/19/11/internet-security-tls-ssl-certificate-authority +[4]: https://wordpress.org/plugins/sucuri-scanner/ +[5]: https://sucuri.net/website-firewall/ +[6]: https://wordpress.org/themes/ +[7]: https://themify.me/ +[8]: https://developers.google.com/search/mobile-sites/ +[9]: http://www.gnu.org/licenses/gpl.html +[10]: https://wordpress.org/about/stats/ +[11]: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/ +[12]: https://www.forbes.com/sites/kateoflahertyuk/2019/04/21/these-are-the-worlds-most-hacked-passwords-is-yours-on-the-list/#4f157c2f289c +[13]: https://opensource.com/article/16/12/password-managers +[14]: https://wordpress.org/plugins/wps-hide-login/ +[15]: https://en-gb.wordpress.org/plugins/two-factor/ diff --git a/published/202204/20200916 Analyze Linux startup performance.md b/published/202204/20200916 Analyze Linux startup performance.md new file mode 100644 index 0000000000..4e20e1807c --- /dev/null +++ b/published/202204/20200916 Analyze Linux startup performance.md @@ -0,0 +1,411 @@ +[#]: collector: (lujun9972) +[#]: translator: (jiamn) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14462-1.html) +[#]: subject: (Analyze Linux startup performance) +[#]: via: (https://opensource.com/article/20/9/systemd-startup-configuration) +[#]: author: (David Both https://opensource.com/users/dboth) + +Linux 启动性能分析 +====== + +> 用 systemd-analyze 洞悉并解决 Linux 启动性能问题。 + +![](https://img.linux.net.cn/data/attachment/album/202204/12/120909ygssda7j3t3a3a3a.jpg) + +系统管理员的一部分工作就是分析系统性能,发现并解决引起性能不佳、启动时间长的问题。系统管理员也需要去检查 systemd 的配置和使用的其它方面。 + +systemd 初始化系统提供了 `systemd-analyze` 工具,可以帮助发现性能问题和其他重要的 systemd 信息。在以前的文章《[分析 systemd 日历和时间跨度][2]》里,我用了 `systemd-analyze` 去分析 systemd 里的时间戳和时间跨度,但是这个工具还有很多其他用法,这个文章里我将再揭示一些。 + +(LCTT 译注:systemd 是目前主流 Linux 发行版采用的系统管理系统) + +(LCTT 译注:为了区分英文的 “boot” 和 “startup” 的不同涵义,此处将 “boot” 翻译为“引导”,“startup” 翻译为“启动”。) + +### 概述启动 + +Linux 启动过程是值得学习关注的地方,因为 `systemd-analyze` 工具很多功能聚焦在启动startup过程。但是首先,要理解引导boot启动startup。引导阶段从 BIOS 加电自检(POST)开始,结束于内核完成加载并控制主机系统,然后是开始了启动过程,也是 systemd 日志的开始点。 + +这个系列的第二篇文章《[理解 Linux 启动时的 systemd][3]》中,我详细讨论了启动阶段的内容和过程。在这篇文章里,我想研究一下启动过程,看看需要多少时间和大部分时间花费在哪里。 + +下面我将展示的结果来自我的主要工作站,这比虚拟机的结果要有趣得多。这个工作站包括一块 华硕 TUF X299 Mark 2 主板、一个英特尔 i9-7960X CPU(16 核 32 线程),64 G 内存。下面的一些命令非 root 用户也可以使用,但是我在这篇文章里使用了 root 用户,以避免在用户之间切换。 + +检查启动过程有几种方法,最简单的 `systemd-analyze` 命令显示了启动的几个主要部分耗费的时间,包括内核启动、装载运行 initrd(即初始 ramdisk,这是一个用来初始化一些硬件、挂载 `/` 根文件系统的临时系统镜像),还有用户空间(加载所有使主机达到可用状态的程序和守护程序)。如果没有像该命令传递子命令,默认是 `systemd-analyze time`: + +``` +[root@david ~]$ systemd-analyze +Startup finished in 53.921s (firmware) + 2.643s (loader) + 2.236s (kernel) + 4.348s (initrd) + 10.082s (userspace) = 1min 13.233s +graphical.target reached after 10.071s in userspace +[root@david ~]# +``` + +这个输出中最值得注意的数据是在固件(BIOS)中花费的时间:几乎 54 秒。这是一个不太正常的时间,我的其他物理系统都没有花费这么长的时间来通过 BIOS。 + +我的 System76 Oryx Pro 笔记本在 BIOS 阶段只花了 8.506 秒,我家里所有的系统都在 10 秒以内。在线搜索一阵之后,我发现这块主板以其超长的 BIOS 引导时间而闻名。我的主板从不“马上启动”,总是挂起,我需要关机再开机,BIOS 报错,按 `F1` 进入 BIOS 设置,选择要引导的驱动器完成引导,多花费的时间就是这样用掉的。 + +不是所有主机都会显示固件数据(LCTT 译注:固件引导中不涉及 systemd)。我的不科学的实验使我相信,这个数据只显示给英特尔 9 代或以上的处理器。但这可能是不正确的。 + +这个关于引导、启动的概述提供了很好的(虽然有限)的信息,但是还有很多关于启动的信息,我将在下面描述。 + +### 分配责任 + +你可以用 `systemd-analyze blame` 来发现哪个 systemd 单元的初始化时间最长。其结果按照初始化时间长短排序,从多到少: + +``` +[root@david ~]$ systemd-analyze blame + 5.417s NetworkManager-wait-online.service + 3.423s dracut-initqueue.service + 2.715s systemd-udev-settle.service + 2.519s fstrim.service + 1.275s udisks2.service + 1.271s smartd.service + 996ms upower.service + 637ms lvm2-monitor.service + 533ms lvm2-pvscan@8:17.service + 520ms dmraid-activation.service + 460ms vboxdrv.service + 396ms initrd-switch-root.service +<截断:删去了好多时间不长的条目> +``` + +因为很多服务是并行开始的,在 BIOS 之后所有单元加在一起的总数大大超过了 `systemd-analyze time` 汇总数。很多都是小数,不能显著的节省时间。 + +这个命令提供的数据指明了改善启动时间的办法。无用的服务可以禁用(`disable`)。在这个启动过程中,似乎没有任何一个服务需要花费过长的时间。你可能会在每次启动时看到不同的结果。(LCTT 译注:并行启动服务的原因) + +### 关键链 + +就像项目管理中的关键路径一样,关键链显示了在启动过程中发生的时间关键的事件链(LCTT 译注:systemd 可以定义服务间的依赖,构成关键链)。如果启动缓慢,这些是你想查看的 systemd 单元,因为它们是导致延迟的单元。这个工具不会显示所有启动的单元,只显示这个关键事件链中的单元。(LCTT 译注:相当于最短路径。并不显示依赖不在关键链上的服务单元) + +``` +[root@david ~]# systemd-analyze critical-chain +The time when unit became active or started is printed after the "@" character. +The time the unit took to start is printed after the "+" character. + +graphical.target @10.071s +└─lxdm.service @10.071s + └─plymouth-quit.service @10.047s +22ms + └─systemd-user-sessions.service @10.031s +7ms + └─remote-fs.target @10.026s + └─remote-fs-pre.target @10.025s + └─nfs-client.target @4.636s + └─gssproxy.service @4.607s +28ms + └─network.target @4.604s + └─NetworkManager.service @4.383s +219ms + └─dbus-broker.service @4.434s +136ms + └─dbus.socket @4.369s + └─sysinit.target @4.354s + └─systemd-update-utmp.service @4.345s +9ms + └─auditd.service @4.301s +42ms + └─systemd-tmpfiles-setup.service @4.254s +42ms + └─import-state.service @4.233s +19ms + └─local-fs.target @4.229s + └─Virtual.mount @4.019s +209ms + └─systemd-fsck@dev-mapper-vg_david2\x2dVirtual.service @3.742s +274ms + └─local-fs-pre.target @3.726s + └─lvm2-monitor.service @356ms +637ms + └─dm-event.socket @319ms + └─-.mount + └─system.slice + └─-.slice +[root@david ~]# +``` + +前面有 `@` 的数字表示单元激活开始启动所使用的绝对秒数。前面有 `+` 的数字显示单元启动所需的时间。 + +### 系统状态 + +有时候你需要确定系统的当前状态,`systemd-analyze dump` 命令转储了当前系统状态的大量数据。有主要的启动时间戳,一个每个 systemd 单元的列表,并对每个单元状态进行了完整描述: + +``` +[root@david ~]# systemd-analyze dump +Timestamp firmware: 1min 7.983523s +Timestamp loader: 3.872325s +Timestamp kernel: Wed 2020-08-26 12:33:35 EDT +Timestamp initrd: Wed 2020-08-26 12:33:38 EDT +Timestamp userspace: Wed 2020-08-26 12:33:42 EDT +Timestamp finish: Wed 2020-08-26 16:33:56 EDT +Timestamp security-start: Wed 2020-08-26 12:33:42 EDT +Timestamp security-finish: Wed 2020-08-26 12:33:42 EDT +Timestamp generators-start: Wed 2020-08-26 16:33:42 EDT +Timestamp generators-finish: Wed 2020-08-26 16:33:43 EDT +Timestamp units-load-start: Wed 2020-08-26 16:33:43 EDT +Timestamp units-load-finish: Wed 2020-08-26 16:33:43 EDT +Timestamp initrd-security-start: Wed 2020-08-26 12:33:38 EDT +Timestamp initrd-security-finish: Wed 2020-08-26 12:33:38 EDT +Timestamp initrd-generators-start: Wed 2020-08-26 12:33:38 EDT +Timestamp initrd-generators-finish: Wed 2020-08-26 12:33:38 EDT +Timestamp initrd-units-load-start: Wed 2020-08-26 12:33:38 EDT +Timestamp initrd-units-load-finish: Wed 2020-08-26 12:33:38 EDT +-> Unit system.slice: + Description: System Slice + Instance: n/a + Unit Load State: loaded + Unit Active State: active + State Change Timestamp: Wed 2020-08-26 12:33:38 EDT + Inactive Exit Timestamp: Wed 2020-08-26 12:33:38 EDT + Active Enter Timestamp: Wed 2020-08-26 12:33:38 EDT + Active Exit Timestamp: n/a + Inactive Enter Timestamp: n/a + May GC: no +<截断:删除了大量的输出行> +``` + +在我的主工作站上,这个命令生成了 49680 行输出,大概 1.66MB,这个命令非常快,不需要等待。 + +我很喜欢为各种连接设备(如存储设备)提供的大量细节。每个 systemd 单元有一个部分,包括各种运行时、缓存、日志目录的模式、启动单元的命令行、PID、开始时间戳,以及内存和文件限制等细节。 + +`systemd-analyze` 的手册页里展示了 `systemd-analyze --user dump` 选项,目的是显示用户管理器的内部状态。但这个选项对我来说是失败的,互联网搜索之后表明它可能有一些问题。在 systemd 里,`--user` 实例用来管理和控制处理器给每个用户的进程资源。处理能力按分给每个用户的进程都属于一个控制组,我将在以后的文章中介绍。 + +### 分析图表 + +大多数啥都不懂的猥琐老板(PHB)和许多优秀的管理者都发现漂亮的图表比我通常喜欢的基于文本的系统性能数据更容易阅读和理解。但有时,即使是我也喜欢一个好的图表,`systemd-analyze` 提供了显示引导/启动数据的 [SVG][4] 矢量图表。 + +下面的命令生成一个矢量图文件,来显示在引导和启动过程发生的事件。生成这个文件只需要几秒: + +``` +[root@david ~]# systemd-analyze plot > /tmp/bootup.svg +``` + +这个命令创建了一个 SVG 文件,SVG 是一个定义了一系列图形矢量的文本文件,包括 Image Viewer、Ristretto、Okular、Eye of Mate、LibreOffice Draw 在内的这些可以生成图形的应用,可以用 SVG 来创建图像。 + +我用 LibreOffice Draw(LCTT 译注:一个办公文档软件)来渲染一幅图形。这张图形很大,你需要放到很大才能看清细节。这里是它的一小部分: + +![The bootup.svg file displayed in LibreOffice Draw.][5] + +图中时间轴上零点(0)的左边是引导阶段,零点的右边是启动阶段。这一小部分显示了内核、initrd 和 initrd 启动的进程。 + +这张图一目了然地显示了什么时候启动,启动需要多少时间,以及主要的依赖项。关键路径用红色高亮显示。 + +另外一个生成图形输出的命令是 `systemd-analyze plot`,它生成了 [DOT][7] 格式的文本依赖图。产生的数据流通过 `dot` 工具进行处理,这是一组用来从多种类型数据中生成矢量图文件的程序。这些 SVG 文件也能被上面列出的工具处理。 + +首先,生成文件,在我的主工作站花了 9 分钟: + +``` +[root@david ~]# time systemd-analyze dot | dot -Tsvg > /tmp/test.svg + Color legend: black = Requires + dark blue = Requisite + dark grey = Wants + red = Conflicts + green = After + +real 8m37.544s +user 8m35.375s +sys 0m0.070s +[root@david ~]# +``` + +我不会在这里重现输出,因为产生的图形就像一大堆意大利面条。但是你应该试试,看看我想让你看到的结果。 + +### 条件 + +在阅读 systemd-analyze(1) 的手册页时,我发现了一个更有趣的功能,但又有点通用,就是条件子命令。(是的,我确实在读手册页,而且我神奇地通过这种方式学到了很多东西!)。这个 `condition` 子命令能用来测试 systemd 单元文件中的条件和断言。 + +它也可以在脚本中用来评估一个或多个条件 —— 如果所有条件都满足,则返回 0;如果有条件不满足,则返回 1。在其它情况下,它都会输出其结果文本。 + +下面的例子来自手册页,稍微有点复杂。它测试了内核版本是否在 4.0 和 5.1 之间,主机是否使用交流电供电,系统结构是否是 ARM,以及 `/etc/os-release` 目录是否存在。我添加了 `echo $?` 来打印返回值。 + +``` +[root@david ~]# systemd-analyze condition 'ConditionKernelVersion = ! <4.0' \ + 'ConditionKernelVersion = >=5.1' \ + 'ConditionACPower=|false' \ + 'ConditionArchitecture=|!arm' \ + 'AssertPathExists=/etc/os-release' ; \ +echo $? +test.service: AssertPathExists=/etc/os-release succeeded. +Asserts succeeded. +test.service: ConditionArchitecture=|!arm succeeded. +test.service: ConditionACPower=|false failed. +test.service: ConditionKernelVersion=>=5.1 succeeded. +test.service: ConditionKernelVersion=!<4.0 succeeded. +Conditions succeeded. +0 +[root@david ~]# +``` + +条件和断言的列表大约从 systemd.unit(5) 手册页的第 600 行左右开始。 + +### 列出配置文件 + +`systemd-analyze` 工具提供了一种将各种配置文件的内容发送到 STDOUT 的方法,如图所示。其基本目录是 `/etc/`。 + +``` +[root@david ~]# systemd-analyze cat-config systemd/system/display-manager.service +# /etc/systemd/system/display-manager.service +[Unit] +Description=LXDM (Lightweight X11 Display Manager) +#Documentation=man:lxdm(8) +Conflicts=getty@tty1.service +After=systemd-user-sessions.service getty@tty1.service plymouth-quit.service livesys-late.service +#Conflicts=plymouth-quit.service + +[Service] +ExecStart=/usr/sbin/lxdm +Restart=always +IgnoreSIGPIPE=no +#BusName=org.freedesktop.lxdm + +[Install] +Alias=display-manager.service +[root@david ~]# +``` + +打了这么多字却和标准的 `cat` 命令做的差不多。我发现下一条命令小有帮助,它能在标准的 systemd 所在的位置搜索具有指定模式的内容: + +``` +[root@david ~]# systemctl cat backup* +# /etc/systemd/system/backup.timer +# This timer unit runs the local backup program +# (C) David Both +# Licensed under GPL V2 +# + +[Unit] +Description=Perform system backups +Requires=backup.service + +[Timer] +Unit=backup.service +OnCalendar=*-*-* 00:15:30 + +[Install] +WantedBy=timers.target + + +# /etc/systemd/system/backup.service +# This service unit runs the rsbu backup program +# By David Both +# Licensed under GPL V2 +# + +[Unit] +Description=Backup services using rsbu +Wants=backup.timer + +[Service] +Type=oneshot +Environment="HOME=/root" +ExecStart=/usr/local/bin/rsbu -bvd1 +ExecStart=/usr/local/bin/rsbu -buvd2 + +[Install] +WantedBy=multi-user.target + +[root@david ~]# +``` + +这两个命令在每个文件的内容前面都有一个注释行,包含文件的完整路径和名称。 + +### 单元文件检查 + +当创建了一个新的单元文件,可以利用 `verify` 子命令帮助检查语法是否正确。它能指出来不正确的拼写,并列出缺失的服务单元。 + +``` +[root@david ~]# systemd-analyze verify /etc/systemd/system/backup.service +``` + +秉承 Unix/Linux 的“沉默是金”的宗旨,没有输出意味着扫描的文件中没有错误。 + +### 安全性 + +`security` 子命令检查指定服务的安全级别。它只能针对服务单元,其他类型的单元文件不起作用: + +``` +[root@david ~]# systemd-analyze security display-manager + NAME DESCRIPTION > +✗ PrivateNetwork= Service has access to the host's network > +✗ User=/DynamicUser= Service runs as root user > +✗ CapabilityBoundingSet=~CAP_SET(UID|GID|PCAP) Service may change UID/GID identities/capabilities > +✗ CapabilityBoundingSet=~CAP_SYS_ADMIN Service has administrator privileges > +✗ CapabilityBoundingSet=~CAP_SYS_PTRACE Service has ptrace() debugging abilities > +✗ RestrictAddressFamilies=~AF_(INET|INET6) Service may allocate Internet sockets > +✗ RestrictNamespaces=~CLONE_NEWUSER Service may create user namespaces > +✗ RestrictAddressFamilies=~… Service may allocate exotic sockets > +✗ CapabilityBoundingSet=~CAP_(CHOWN|FSETID|SETFCAP) Service may change file ownership/access mode/capabilities unres> +✗ CapabilityBoundingSet=~CAP_(DAC_*|FOWNER|IPC_OWNER) Service may override UNIX file/IPC permission checks > +✗ CapabilityBoundingSet=~CAP_NET_ADMIN Service has network configuration privileges > +✗ CapabilityBoundingSet=~CAP_SYS_MODULE Service may load kernel modules +<截断> +✗ CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG Service may issue vhangup() > +✗ CapabilityBoundingSet=~CAP_WAKE_ALARM Service may program timers that wake up the system > +✗ RestrictAddressFamilies=~AF_UNIX Service may allocate local sockets > + +→ Overall exposure level for backup.service: 9.6 UNSAFE ? +lines 34-81/81 (END) +``` + +是的,表情符是输出的一部分。但是,当然,许多服务需要几乎完全访问所有的东西,以便完成它们的工作。我针对几个服务运行了这个程序,包括我自己的备份服务;结果可能有所不同,但最底下一行似乎大多是一样的。 + +这个工具对于在严格的安全环境检查和修复用户空间的服务单元是很有用的。我不认为我们的大多数都能用到它。 + +### 最后总结 + +这个强力的工具提供了一些有趣而惊人的有用选项。本文探讨的大部分内容是关于使用 systemd-analyze 来深入了解 Linux 使用 systemd 的启动性能。它还可以分析 systemd 的其他方面。 + +其中有些工具的作用有限,有几个应该完全忘记。但在解决启动和其他 systemd 功能的问题时,大多数都能起到很好的作用。 + +### 资源 + +互联网上关于 systemd 有很多信息,但是很多过于简略、晦涩,甚至是误导。除了这篇文章中提到的资源外,以下网页提供了关于systemd启动的更详细和可靠的信息。这个列表在我开始写这一系列文章后有所增长,以反映我所做的研究。 + + * [systemd.unit(5) 手册页][9] 包含了一份单元文件部分及其配置选项的清单,并对每个部分进行了简明的描述。 + * Fedora 项目有一个很好的实用 [systemd 指南][10]。它包含了配置、管理和维护使用 systemd 的 Fedora 计算机所需的几乎所有知识。 + * Fedora 项目还有一份很好的 [备忘录][11],将旧的 SystemV 命令与 systemd 命令进行了对照。 + * Red Hat 文档包含了对 [单元文件结构][12] 的详细描述和其他重要的信息。 + * 关于 systemd 技术的细节和创建它的原因,可以去看 Freedesktop.org [systemd 详述][13]。 + * [Linux.com][14] 的“更多 systemd 乐趣”提供了很多高级的 systemd [信息和技巧][15]。 + +此外,systemd 设计者和主要开发者 Lennart Poettering 也为 Linux 系统管理员撰写了一系列深度技术文档,尽管这些文章写于 2010 年 4 月到 2011 年 9 月,现在看也是非常适应时宜。关于 systemd 及其生态系统的其他好文章,大部分都是基于这些文章的。 + + * [Rethinking PID 1][16] + * [systemd for Administrators, Part I][17] + * [systemd for Administrators, Part II][18] + * [systemd for Administrators, Part III][19] + * [systemd for Administrators, Part IV][20] + * [systemd for Administrators, Part V][21] + * [systemd for Administrators, Part VI][22] + * [systemd for Administrators, Part VII][23] + * [systemd for Administrators, Part VIII][24] + * [systemd for Administrators, Part IX][25] + * [systemd for Administrators, Part X][26] + * [systemd for Administrators, Part XI][27] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/9/systemd-startup-configuration + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[jiamn](https://github.com/jiamn) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/find-file-linux-code_magnifying_glass_zero.png?itok=E2HoPDg0 (Magnifying glass on code) +[2]: https://opensource.com/article/20/7/systemd-calendar-timespans +[3]: https://opensource.com/article/20/5/systemd-startup?utm_campaign=intrel +[4]: https://en.wikipedia.org/wiki/Scalable_Vector_Graphics +[5]: https://opensource.com/sites/default/files/uploads/bootup.svg-graph.png (The bootup.svg file displayed in LibreOffice Draw.) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://en.wikipedia.org/wiki/DOT_(graph_description_language) +[8]: mailto:getty@tty1.service +[9]: https://man7.org/linux/man-pages/man5/systemd.unit.5.html +[10]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html +[11]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet +[12]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/managing-services-with-systemd_configuring-basic-system-settings#Managing_Services_with_systemd-Unit_File_Structure +[13]: https://www.freedesktop.org/wiki/Software/systemd/ +[14]: http://Linux.com +[15]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/ +[16]: http://0pointer.de/blog/projects/systemd.html +[17]: http://0pointer.de/blog/projects/systemd-for-admins-1.html +[18]: http://0pointer.de/blog/projects/systemd-for-admins-2.html +[19]: http://0pointer.de/blog/projects/systemd-for-admins-3.html +[20]: http://0pointer.de/blog/projects/systemd-for-admins-4.html +[21]: http://0pointer.de/blog/projects/three-levels-of-off.html +[22]: http://0pointer.de/blog/projects/changing-roots +[23]: http://0pointer.de/blog/projects/blame-game.html +[24]: http://0pointer.de/blog/projects/the-new-configuration-files.html +[25]: http://0pointer.de/blog/projects/on-etc-sysinit.html +[26]: http://0pointer.de/blog/projects/instances.html +[27]: http://0pointer.de/blog/projects/inetd.html diff --git a/published/202204/20201116 Linux Jargon Buster- What is Grub in Linux- What is it Used for.md b/published/202204/20201116 Linux Jargon Buster- What is Grub in Linux- What is it Used for.md new file mode 100644 index 0000000000..866c1ec794 --- /dev/null +++ b/published/202204/20201116 Linux Jargon Buster- What is Grub in Linux- What is it Used for.md @@ -0,0 +1,149 @@ +[#]: collector: (lujun9972) +[#]: translator: (lkxed) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14427-1.html) +[#]: subject: (Linux Jargon Buster: What is Grub in Linux? What is it Used for?) +[#]: via: (https://itsfoss.com/what-is-grub/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Linux 黑话解释:Linux 中的 GRUB 是什么? +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/03/111835u4rcmcf7qze8pawa.png) + +如果你曾经使用过 Linux 桌面,你一定见过这个屏幕。这就是所谓的 GRUB 屏幕。是的,它的字母全部都是大写的。 + +![Remember this screen? This is GRUB][1] + +在 “Linux 黑话解释Linux Jargon Buster”系列的这一个章节中,我将告诉你 GRUB 是什么,以及它有什么用处。此外,我还会简要地介绍一下配置和定制的部分。 + +### GRUB 是什么? + +[GRUB][2] 是一个用于加载和管理系统启动的完整程序。它是 Linux 发行版中最常见的引导程序bootloader。引导程序是计算机启动时运行的第一个软件。它加载 [操作系统的内核][3],然后再由内核初始化操作系统的其他部分(包括 Shell、[显示管理器][4]、[桌面环境][5] 等等)。 + +### 引导程序和引导管理器 + +我不想现在就把你搞糊涂,但是我认为这个话题是不可避免的。引导程序boot loader引导管理器boot manager之间有着一条模糊的界限。 + +你已经知道了引导程序是什么。它会首先启动,然后将内核加载到内存中并执行它。引导管理器则允许你在不同的操作系统之间进行选择(如果你的电脑上不止一个操作系统的话)。引导管理器并不会直接加载系统。 + +随着 Linux 内核 3.3 版本的推出,[Linux 内核包括了一个内置的 EFI 引导程序][6]。事实上,任何一个[支持 EFI 的系统都包括一个 EFI 引导程序][7]。在支持 EFI 的系统中,固件会读取 EFI 系统分区EFI System Partition(ESP)中的 EFI 文件,从而获得启动信息。 + +这里插入一张图片,图中显示了带有 ESP 分区的分区表: + +![][8] + +GRUB 既是一个引导程序,也是一个引导管理器。一会儿我再来谈 GRUB。让我们先看看其他类似 GRUB 的程序。 + +> 小知识:GRUB 是 **GR**and **U**nified **B**ootloader(大一统引导程序) 的首字母缩写。 + +### GRUB 屏幕上的那些行是什么意思? + +你会在 GRUB 屏幕上看到几行字。这些行对于不同的设置、不同的发行版会有所不同。 + +通常情况下,第一行是你的 Linux 发行版。如果你看到类似高级选项的东西,你可以进入其中,找到一些以 “linux-generic-x-y-z” 等开头的行。 + +当你的 Linux 发行版更新内核版本时,它至少会保留一个旧版本。你可以选择启动到旧的 Linux 内核,以防你的系统遇到新更新的 Linux 内核的任何问题。 + +在基于 Ubuntu 的发行版中,你也可以看到一个恢复选项。 + +![][8a] + +*在高级选项下,通常有一个旧的内核版本和恢复选项* + +在最后,你可能会看到一个条目,如系统设置或 UEFI 设置,以访问系统的 BIOS 设置。 + +### 还有哪些类似 GRUB 的引导管理器? + +GRUB 是 Linux 中最流行的引导管理器。但它并不是唯一的一个。有一个高度可定制的引导管理器,名字叫做 [rEFInd 引导管理器][9],它同样受到了一些 Linux 用户的喜爱。 + +![定制化的 rEFInd 引导管理器屏幕 | 图片来源:kofler.info/pop_os][10] + +还有一个基于文本的引导管理器,名字叫做 [systemd-boot][11]。你可以猜到这是专为基于 systemd 的 Linux 发行版准备的。有一些发行版正在使用 systemd-boot,比如 Pop OS。 + +![Pop OS 中的 systemd-boot | 图片来源:kofler.info/pop_os][12] + +### 访问或编辑 GRUB + +通常你看到的 GRUB 屏幕是它的菜单界面。如果你安装了一个以上的操作系统,它会允许你在其中选择一个来启动。如果你的 Linux 发行版安装了不止一个内核,你也可以选择加载不同的内核。 + +根据不同的 Linux 发行版的配置,你的 GRUB 菜单上可能会有一些其他选项。 + +你可以在 GRUB 菜单界面按 `e` 键来编辑菜单项。这样你就可以在内核加载前修改它的参数。例如,在某些情况下,[禁用内核提供的图形驱动可以帮助你解决 Linux 系统在启动时卡住的问题][13]。 + +![][14] + +你也可以在 GRUB 菜单界面上按 `c` 键来进入 GRUB 的命令行菜单。 + +### GRUB 配置文件 + +你在菜单界面里对 GRUB 所做的任何改变都是暂时的。如果你想对 GRUB 做一些永久性的改变,比如改变默认的超时时间,你可以在 Linux 系统启动后修改 GRUB 配置文件。 + +默认的 GRUB 配置文件是 `/etc/default/grub`。还有一个 `/etc/default/grub.d` 目录,里面也存放一些配置。你可以直接编辑 `/etc/default/grub` 文件,但是我还是建议通过在这个目录中添加配置文件(`.cfg` 文件)进行额外的修改。 + +![默认的 GRUB 配置文件][15] + +你必须 [更新 GRUB 才能使这些修改生效][16]。 + +### 使用 GRUB 定制器来定制 GRUB + +如果你不太习惯 [在终端里使用文本编辑器编辑文件][17],你可以 [使用一个叫做 GRUB 定制器的图形工具][18]。 + +它允许你改变启动顺序、默认超时时间等等。你还可以用它来把 GRUB 的背景设置成一张自定义的墙纸。 + +![][19] + +GRUB 定制器可以在 Ubuntu 20.04 中从 Universe 仓库安装,在 Ubuntu 18.04 中 [通过 PPA 安装][22]。它可以 [通过 AUR][23] 在基于 Arch Linux 的发行版中使用。 + +### 总结 + +至此,本文几乎涉及到了所有与 GRUB 相关的简单内容。至于 EFI、引导加载和 GRUB 本身,它们都是详细而复杂的话题,因此不在本文的讨论范围之内。这篇文章旨在给你一个关于 GRUB 引导程序的总体概述。 + +或许我以后会写一篇关于 GRUB 的详细指南,解释它底层的一些细节。目前,如果你想了解更多关于 GRUB 的信息,你可以在你的 Linux 终端里使用 `info grub` 命令访问到 GRUB 文档。 + +![你可以在终端中访问 GRUB 手册][20] + +我希望你现在对什么是 GRUB 有了一点点的了解。这里有一个 GIF 动图供你一乐。 + +![什么是 GRUB? UEFI 再也伤害不到我了 :)][21] + +或许我没有回答你关于 GRUB 的所有疑问,但请随时在评论区告诉我。我可能会根据你的问题或建议来更新这篇文章。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/what-is-grub/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/grub-screen-linux.png?resize=800%2C450&ssl=1 +[2]: https://www.gnu.org/software/grub/ +[3]: https://itsfoss.com/what-is-linux/ +[4]: https://linux.cn/article-12773-1.html +[5]: https://linux.cn/article-12579-1.html +[6]: https://www.rodsbooks.com/efi-bootloaders/efistub.html +[7]: https://jdebp.eu/FGA/efi-boot-process.html +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/disk-partition-gparted.png?resize=744%2C385&ssl=1 +[8a]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2012/07/boot-into-recovery-mode-ubuntu-1.jpg?w=635&ssl=1 +[9]: https://www.rodsbooks.com/refind/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/refind-boot-manager.png?resize=800%2C602&ssl=1 +[11]: https://wiki.gentoo.org/wiki/Systemd-boot +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/systemd-boot.png?resize=714%2C333&ssl=1 +[13]: https://itsfoss.com/fix-ubuntu-freezing/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/editing-grub-to-fix-nvidia-issue.jpg?resize=800%2C343&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/default-grub-config-file.png?resize=759%2C437&ssl=1 +[16]: https://itsfoss.com/update-grub/ +[17]: https://itsfoss.com/command-line-text-editors-linux/ +[18]: https://itsfoss.com/grub-customizer-ubuntu/ +[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2013/05/make-windows-default-grub-2.jpeg?resize=799%2C435&ssl=1 +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/grub-manual-Linux-terminal.png?resize=800%2C462&ssl=1 +[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/what_is_GRUB.gif?resize=500%2C343&ssl=1 +[22]: https://itsfoss.com/ppa-guide/ +[23]: https://itsfoss.com/aur-arch-linux/ \ No newline at end of file diff --git a/published/202204/20201212 Power up your Linux terminal text editor with ed.md b/published/202204/20201212 Power up your Linux terminal text editor with ed.md new file mode 100644 index 0000000000..c7cd6df825 --- /dev/null +++ b/published/202204/20201212 Power up your Linux terminal text editor with ed.md @@ -0,0 +1,188 @@ +[#]: collector: (lujun9972) +[#]: translator: (lkxed) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14431-1.html) +[#]: subject: (Power up your Linux terminal text editor with ed) +[#]: via: (https://opensource.com/article/20/12/gnu-ed) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +在 Linux 终端上使用行编辑器 ed +====== + +> 这个看似简单的编辑器为用户提供了许多易于学习和使用的命令。 + +![](https://img.linux.net.cn/data/attachment/album/202204/04/145334l9w92ngiccginicn.jpg) + +GNU `ed` 命令是一个行编辑器。它被认为是标准的 Unix 文本编辑器,因为它是首个出现在 Unix 的文本编辑器,并且它曾经无处不在,你在任何一个 POSIX 系统中都能找到它(通常来说,你现在也可以)。在某种程度上,你可以很容易看出来它是第一个文本编辑器,因为它在许多方面的功能都十分基础。和其他大多数的文本编辑器不同,它不会打开一个属于自己的窗口或显示区域,事实上,在默认情况下,它甚至不会提示用户输入文字。从另一个方面来说,它在交互功能上的缺失也可以成为一个优点。它是一个多功能的编辑器,你可以用简短的命令控制它,无论是在交互式的命令行中,还是在编写的 shell 脚本里。 + +### 安装 ed + +如果你正在使用 Linux 或者 BSD 的话,你很可能已经默认安装了 `ed`(在 Linux 上是 GNU 版 `ed`,而在 BSD 上是 BSD 版 `ed`)。但是,一些极简的环境可能没有包括 `ed`,这也没关系,你的发行版的软件仓库中很可能有 `ed` 可供下载。macOS 默认安装了 BSD 版 `ed`。 + +### 启动 ed + +当你启动 `ed` 的时候,你的终端提示符不见了,看起来好像是 `ed` 停止运行了。其实它没有,它只是在等待你输入指令而已。 + +``` +$ ed +``` + +为使 `ed` 显示更详细的信息,你可以输入命令 `p` 让它返回一个提示符: + +``` +$ ed +p +? +``` + +这个问号(`?`)是默认的 `ed` 提示符。 + +### 缓冲区 + +当 `ed` 激活时,你其实是在和一个叫 缓冲区buffer 的东西打交道。缓冲区是内存中的一块区域。你并不会直接编辑文件,而是在编辑它对应的缓冲区。当你退出 `ed` 却没有把修改保存到磁盘的文件上时,所有的修改都会丢失,因为它们只在缓冲区里存在。(这对于一个已经习惯了初始的 草图缓冲区scratch buffer 的资深 Emacs 用户可能很耳熟。) + +### 使用 ed 输入文本 + +启动 `ed` 后,你处于命令模式。这意味着你可以向编辑器发送指令,比如让它显示一个提示符,而不是空白区域。你可以使用 `a` 命令开始附加文本到当前的缓冲区,使用一个实心的点 `.` 来终止输入。比如,下面的这个例子往缓冲区里附加了两行文字(“hello world” 和 “hello ed”): + +``` +? +a +hello world +hello ed +. +``` + +使用点 `.` 终止输入后,你将回到命令模式。 + +### 查看缓冲区 + +怎样查看当前缓冲区里都有什么呢?你可以输入想要查看的行号,也可以使用 `,p` 命令来显示所有的行: + +``` +? +1 +hello world +2 +hello ed +,p +hello world +hello ed +``` + +### 写入文件 + +如果你现在对文本很满意,你可以使用 `w` 命令把缓冲区写入到文件中,后面跟上目标文件名: + +``` +? +w example.txt +19 +``` + +写操作后显示的那个数字代表着写入到文件中的字符数。 + +### 读取文件 + +除了使用 `ed` 来读取文本,你也可以使用 `r` 命令把一个已经存在的文件加载到到缓冲区里: + +``` +? +r myfile.txt +``` + +另外,你也可以在启动 `ed` 时,在它后面加上你想要加载到缓冲区里的文件名: + +``` +$ ed myfile.txt +``` + +### 编辑缓冲区 + +鉴于 `ed` 是一个文本编辑器,你当然可以使用一种特殊的语法来编辑缓冲区里的文本。使用 `sed` 或 `vim` 的用户或许会觉得这个语法很熟悉。假设现在缓冲区里已经加载了一个文件: + +``` +$ ed myfile.txt +,p +This is an example document. +There is some text, but not much. +There is some errors, but not much. +``` + +如果你要把第一句话中的 `document` 修改为 `file`,你可以先选择目标行(`1`),然后使用 `s` 命令调用搜索函数,后面跟着搜索文本和替换文本: + +``` +? +1 +This is an example document. +s/document/file/ +1 +This is an example file. +``` + +如果你要编辑其他行,步骤也是一样的,只需提供一个不同的行号即可: + +``` +? +3 +There is some errors, but not much. +s/is/are/ +s/much/many/ +``` + +你可以使用 `,p` 命令来看到你对缓冲区的历史编辑记录: + +``` +This is an example file. +There is some text, but not much. +There are some errors, but not many. +``` + +当然,这些修改只存在于缓冲区里。你如果在 `ed` 编辑器外查看这个文件,你只会看到原始的文本: + +``` +$ cat myfile.txt +This is an example document. +There is some text, but not much. +There is some errors, but not much. +``` + +如果你要把这些修改保存回文件中,使用 `w` 命令即可: + +``` +w myfile.txt +258 +``` + +### 清空缓冲区 + +如果想要得到一个新的缓冲区,以此来打开一个新的文件,或者把一个新的文件加载到不同的环境中,你可以使用 `c` 命令。使用这个清空缓冲区后,什么也不会输出,因为缓冲已经是空的了: + +``` +c +,p +``` + +### 退出 + +如果要退出当前的 `ed` 会话,你可以使用 `q` 命令。它并不会给你一个保存缓冲区的机会,所以你要确保自己在这之前执行了保存操作。 + +### 尝试一下 ed 吧 + +`ed` 还可以做到很多事情,学习 `ed` 可以让你知道它和部分的 `vim` 是如何工作的。我并没有尝试使用 `ed` 来写这篇文章,老实说,我也不认为它是通常意义上的最佳文本编辑器。但是,`ed` 仍然是一个出色的编辑器。通过阅读它的文档,你可以很轻松地学会它。在 GNU 系统上,你可以使用 `info ed` 来查看它的操作手册。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/12/gnu-ed + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) diff --git a/published/202204/20210116 Install Privacy-friendly WhatsApp Alternative Signal on Linux Desktop.md b/published/202204/20210116 Install Privacy-friendly WhatsApp Alternative Signal on Linux Desktop.md new file mode 100644 index 0000000000..cb92ac0274 --- /dev/null +++ b/published/202204/20210116 Install Privacy-friendly WhatsApp Alternative Signal on Linux Desktop.md @@ -0,0 +1,156 @@ +[#]: collector: "lujun9972" +[#]: translator: "hwlife" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14419-1.html" +[#]: subject: "Install Privacy-friendly WhatsApp Alternative Signal on Linux Desktop" +[#]: via: "https://itsfoss.com/install-signal-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" + +在 Linux 桌面上安装隐私友好的 Signal +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/01/101558k7l28z2lh3h8655h.jpg) + +自从我们报道将 Signal 作为即时通讯软件的理想选择以来,已经过去一年多了。虽然具有隐私意识的人和静态技术的人已经意识到了这个了不起的软件的存在,与此同时,在最近的 WhatsApp 隐私政策更新之后,Signal 更是得到了很多人的褒奖。 + +无论什么原因,如果你对 Signal 一无所知,想知道是否能在桌面上使用 Signal,那么答案是肯定的。你可以在 Linux、Windows 和 macOS 系统以及智能手机上安装 Signal。 + +![Signal Messenger on Pop OS Linux distribution][3] + +我不打算强调 Signal 的功能,因为你可能已经有所了解。我只想向你展示在 Linux 桌面上安装 Signal 的不同方法: + + * 用 Snap 包在 Liunx 上安装 Signal(Snap 应用程序需要更长的时间来加载,但可以获得自动更新和轻松的安装) + * 用 apt 包在基于 Debian 和 Ubuntu 的发行版上安装 Signal(添加软件库需要额外的操作,但已安装的应用程序会自动更新) + * 用 AUR 在 Arch 和 Manjaro Linux 上安装 Signal + * 用 Flatpak 包在 Fedora 等 Linux 系统上安装 Signal + +你可以基于你的发行版和偏好来选择这些安装方法的其中一种: + +### 方法 1:用 Snap 包在 Linux 上安装 Signal + +如果你正在使用 Ubuntu,你可以在软件中心找到 Signal 桌面版程序的 Snap 格式的软件包。 + +![][4] + +或者,你可以在任何 [有 Snap 包支持功能的 Linux 发行版][6] 上 [使用 Snap 命令][5] 安装 Signal。 + +``` +sudo snap install signal-desktop +``` + +你可以使用 `snap remove` 命令或者从软件中心删除它。 + +有些人不喜欢 Snap 包是因为它们启动时间太长。好消息是你能够使用 `apt` 命令来安装 Signal。下一节我们讨论它。 + +### 方法 2:通过 apt 在基于 Debian 和 Ubuntu 的发行版上安装 Signal(使用官方 Signal 仓库) + +这里是你在 Debian、Ubuntu、Linux Mint、elementary OS 和基于 Debian/Ubuntu 的其他发行版中安装 Signal 必须遵循的步骤。你可以 [复制这些命令并将其粘贴到终端][7]。 + +第一件事是得到官方 Signal 仓库的 GPG 密钥,并且把它加入到你的 APT 包管理器可信任的密钥中。 + +``` +wget -O- https://updates.signal.org/desktop/apt/keys.asc | sudo apt-key add - +``` + +密钥添加之后,你可以将仓库安全的添加的你的系统中。**不要因为仓库名称使用了 xenial 就惊慌失措**。它可以在 Ubuntu 18.04、20.04 和更新的版本以及 Debian、Mint 等系统中工作。 + +``` +echo "deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main" | sudo tee -a /etc/apt/sources.list.d/signal-xenial.list +``` + +借助 [Linux 的 tee 命令][8],在 `/etc/apt/sources.list.d` 目录下你将会有一个叫做 `signal-xenial.list` 的新文件。这个新文件有 Signal 仓库信息即 `deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main`。 + +既然你已经添加了仓库,那么来更新缓存并安装 Signal 桌面程序吧: + +``` +sudo apt update && sudo apt install signal-desktop +``` + +一旦安装成功,在程序菜单找到 Signal 然后启动它。 + +![][9] + +由于你已经添加了仓库,你安装的 Signal 程序将会伴随系统日常更新而自动更新。 + +享受在 Linux 桌面上使用 Signal 加密通讯的乐趣吧。 + +#### 删除 Signal + +如果我不分享给你删除的步骤,那么指南是不完整的。让我们看一下。 + +首先,删除该程序: + +``` +sudo apt remove signal-desktop +``` + +你可以留下它,也可以从系统中删除 Signal 仓库。对你来说是都是可以的。仓库继续在系统里的话,你可以轻松的再次安装 Signal。如果你删除了仓库的话,你得按照之前的步骤再次重新添加仓库。 + +如果你也想同时删除掉 Signal 仓库,你可以选择图形化方法,通过“软件和更新”工具,在那里删除它。 + +![][10] + +或者,你可以用 `rm` 命令来删除这个文件: + +``` +rm -i /etc/apt/sources.list.d/signal-xenial.list +``` + +### 方法 3:用 AUR 在 Arch 和 Manjaro Linux 上安装 Signal + +通过 [AUR][12] 在 [基于 Arch 的 Linux 发行版][11] 上安装 Signal 是有效的。如果你在 Manjaro 上使用 Pamac 并且启用了 AUR,在包管理器里你可以找到 Signal。 + +否则,你可以经常 [使用 AUR 辅助工具][13]。 + +``` +sudo yay -Ss +``` + +我相信你能够在相似的功能中删除 Signal。 + +### 方法 4:用 Flatpak 包在 Fedora 等 Linux 系统上安装 Signal + +Signal 没有 RPM 的安装文件。然而,[Flatpak 包是有的][14],你可以在 Fedora 上用它来安装 Signal。 + +``` +flatpak install flathub org.signal.Signal +``` + +一旦安装成功,你可以从菜单中运行它,或者在终端中输入以下命令: + +``` +flatpak run org.signal.Signal +``` + + +Signal 和 Telegram 是抛弃掉 WhatsApp 的两个主流而可行的选择。这两个软件都提供原生的 Linux 桌面程序。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-signal-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/signal-messaging-app/ +[2]: https://signal.org/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/12/signal-shot.jpg?resize=800%2C565&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/signal-desktop-ubuntu.png?resize=800%2C425&ssl=1 +[5]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/ +[6]: https://itsfoss.com/install-snap-linux/ +[7]: https://itsfoss.com/copy-paste-linux-terminal/ +[8]: https://linuxhandbook.com/tee-command/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/signal-app-in-ubuntu.jpg?resize=795%2C230&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/remove-signal-repository.png?resize=800%2C401&ssl=1 +[11]: https://itsfoss.com/arch-based-linux-distros/ +[12]: https://itsfoss.com/aur-arch-linux/ +[13]: https://itsfoss.com/best-aur-helpers/ +[14]: https://flathub.org/apps/details/org.signal.Signal +[15]: https://t.me/joinchat/AAAAAEPRGUJrEE1itjpH6A diff --git a/published/202204/20210126 Automate setup and delivery for virtual machines in the cloud.md b/published/202204/20210126 Automate setup and delivery for virtual machines in the cloud.md new file mode 100644 index 0000000000..704d98bcc7 --- /dev/null +++ b/published/202204/20210126 Automate setup and delivery for virtual machines in the cloud.md @@ -0,0 +1,160 @@ +[#]: collector: (lujun9972) +[#]: translator: (hwlife) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14524-1.html) +[#]: subject: (Automate setup and delivery for virtual machines in the cloud) +[#]: via: (https://opensource.com/article/21/1/testcloud-virtual-machines) +[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) + +在云端自动化设置和交付虚拟机 +====== + +> 通过使用 Testcloud 自动化设置过程并交付一个准备运行的虚拟机,在几分钟之内准备好一个云镜像。 + +![](https://img.linux.net.cn/data/attachment/album/202204/30/130336l2l1a77p7m8hwp28.jpg) + +如果你是一个在云端使用 Fedora [qcow2 镜像][2] 的开发者或者爱好者,在一个镜像准备使用之前,你总是不得不做一大堆初始化设置。我对此深有体会,所以我很想找到一种使设置过程更加简单的方法。碰巧,整个 Fedora 质量保证团队也有同感,所以我们开发了 [Testcloud][3] 。 + +Testcloud 是一个可以轻松的在几分钟之内准备云镜像测试的工具。它用几个命令就可以在云端自动化设置并交付准备运行的虚拟机(VM)。 + +Testcloud: + + 1. 下载 qcow2 镜像 + 2. 用你选择的名称创建实例 + 3. 创建一个密码为 `passw0rd`,用户名为 `fedora` 的用户 + 4. 分配一个 IP 地址,以便于你之后用 SSH 登录到云端 + 5. 启动、停止、删除和列出一个实例 + +### 安装 Testcloud + +要开始你的旅程,首先你必须安装 Testcloud 软件包。你可以通过终端或者“软件”应用来安装它。在这两种情况下,软件包的名字都是 `testcloud` 。用以下命令安装: + +``` +$ sudo dnf install testcloud -y +``` + +一旦安装完成,将你所需要的用户添加到 `testcloud` 用户组,这有助于 Testcloud 自动完成设置过程的剩余部分。执行这两个命令,添加你的用户到 `testcloud` 用户组,并通过提升组权限重启会话: + +``` +$ sudo usermod -a -G testcloud $USER +$ su - $USER +``` + +![添加用户到 testcloud 组][4] + +### 像老手一样玩转云镜像 + +一旦你的用户获得了所需的组权限,创建一个实例: + +``` +$ testcloud instance create -u +``` + +或者,你可以使用 `fedora:latest/fedora:XX`(`XX` 是你的 Fedora 发行版本)来代替 完整的 URL 地址: + +``` +$ testcloud instance create -u fedora:latest +``` + +这将返回你的虚拟机的 IP 地址: + +``` +$ testcloud instance create testcloud272593 -u https://download.fedoraproject.org/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.qcow2 +[...] +INFO:Successfully booted instance testcloud272593 +The IP of vm testcloud272593: 192.168.122.202 +------------------------------------------------------------ +To connect to the VM, use the following command (password is 'passw0rd'): +ssh fedora@192.168.122.202 +``` + +你可以用默认用户 `fedora` 登录,密码是 `passw0rd`(注意是零)。你可以使用 `ssh`、`virt-manager` 或者支持连接到 libvirt 虚拟机方式来连接到它。 + +另一种创建 Fedora 云的方式是: + +``` +$ testcloud instance create testcloud193 -u fedora:33 + +WARNING:Not proceeding with backingstore cleanup because there are some testcloud instances running. +You can fix this by following command(s): +testcloud instance stop testcloud272593 + +DEBUG:Local downloads will be stored in /var/lib/testcloud/backingstores. +DEBUG:successfully changed SELinux context for image /var/lib/testcloud/backingstores/Fedora-Cloud-Base-33-1.2.x86_64.qcow2 +DEBUG:Creating instance directories +DEBUG:creating seed image /var/lib/testcloud/instances/testcloud193/testcloud193-seed.img +INFO:Seed image generated successfully +INFO:Successfully booted instance testcloud193 +The IP of vm testcloud193: 192.168.122.225 +------------------------------------------------------------ +To connect to the VM, use the following command (password is 'passw0rd'): +ssh fedora@192.168.122.225 +------------------------------------------------------------ +``` + +### 玩转实例 + +Testcloud 可以用来管理实例。这包括像列出镜像或者停止和启动一个实例等活动。 + +要列出实例,使用 `list` 子命令: + +``` +$ testcloud instance list                 +Name                            IP                      State     +------------------------------------------------------------ +testcloud272593                 192.168.122.202         running     +testcloud193                    192.168.122.225         running     +testcloud252793                 192.168.122.146         shutoff     +testcloud93                     192.168.122.152         shutoff +``` + +要停止一个运行的实例: + +``` +$ testcloud instance stop testcloud193   +DEBUG:stop instance: testcloud193 +DEBUG:stopping instance testcloud193. +``` + +要删除一个实例: + +``` +$ testcloud instance destroy testcloud193   +DEBUG:remove instance: testcloud193 +DEBUG:removing instance testcloud193 from libvirt. +DEBUG:Unregistering instance from libvirt. +DEBUG:removing instance /var/lib/testcloud/instances/testcloud193 from disk +``` + +要重启一个运行中的实例: + +``` +$ testcloud instance reboot testcloud93                                                                                         +DEBUG:stop instance: testcloud93 +[...] +INFO:Successfully booted instance testcloud93 +The IP of vm testcloud93:  192.168.122.152 +usage: testcloud [-h] {instance,image} ... +``` + +尝试一下 Testcloud ,在评论中让我知道你的想法。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/testcloud-virtual-machines + +作者:[Sumantro Mukherjee][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sumantro +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png?itok=L0BQHgjr (Looking at a map) +[2]: https://en.wikipedia.org/wiki/Qcow +[3]: https://pagure.io/testcloud +[4]: https://opensource.com/sites/default/files/uploads/adduser.png (Add user to testcloud group) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/published/202204/20210312 Build a router with mobile connectivity using Raspberry Pi.md b/published/202204/20210312 Build a router with mobile connectivity using Raspberry Pi.md new file mode 100644 index 0000000000..f4dcea7ed1 --- /dev/null +++ b/published/202204/20210312 Build a router with mobile connectivity using Raspberry Pi.md @@ -0,0 +1,256 @@ +[#]: subject: (Build a router with mobile connectivity using Raspberry Pi) +[#]: via: (https://opensource.com/article/21/3/router-raspberry-pi) +[#]: author: (Lukas Janėnas https://opensource.com/users/lukasjan) +[#]: collector: (lujun9972) +[#]: translator: (hwlife) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14474-1.html) + +使用树莓派建立一个带有移动网络连接功能的路由器 +====== + +> 在你的网络路由器上使用 OpenWRT 获得更多控制功能。 + +![Mesh networking connected dots][1] + +树莓派是一种小型单板电脑,尽管只有信用卡大小,但是能做许多事情。实际上,这个小电脑几乎可以成为你想让它成为的任何东西,只要你打开想象力。 + +树莓派爱好者已经做了许多不同的项目,从简单的程序到复杂的自动化项目和解决方案,如气象站,甚至智能家居设备。这篇文章将展示怎样使用 OpenWRT 项目将你的树莓派变成带有 LTE 移动网络连接功能的路由器。 + +### 关于 OpenWRT 和 LTE + +[OpenWRT][2] 是一个利用 Linux 内核为嵌入式设备开发的开源项目,它已经存在超过 15 年了,拥有一个庞大而活跃的社区。 + +有许多使用 OpenWRT 的方法,但是它的主要目的还是用在路由器上。它提供了包管理功能和一个完全可写的文件系统,并且因为它的的开源属性,你可以查看和修改代码,并贡献到开源生态。如果你想对你的路由器获得更多的控制,这就是你想要的系统。 + +长期演进技术Long-term evolution(LTE)是一个基于 GSM/EGDE 和 UMTS/HSPA 技术的无线宽带通信标准。我使用的 LTE 调制解调器是一个 USB 设备,可以为树莓派电脑增加 3G 或 4G(LTE)蜂窝连接。 + +![Teltonika TRM240 modem][3] + +### 安装前的准备 + +对这个项目来说,你需要: + + * 一个带有电源线的树莓派 + * 一台运行 Linux 的电脑 + * 一张至少 16GB 的 SD 储存卡 + * 以太网线 + * LTE 调制解调器(我使用的是 Teltonika [TRM240][5]) + * 一张移动网络的 SIM 卡 + +### 安装 OpenWRT + +首先,下载最新的 [兼容树莓派的 OpenWRT 的发布版本][6]。在 OpenWRT 官网,你可以看到 4 个镜像:两个 **ext4** 文件系统的和两个 **squashfs** 文件系统的。我使用 **ext4** 文件系统。你可以下载 **factory** 或者 **sysupgrade** 镜像,这两个都运行良好。 + +![OpenWRT image files][7] + +下载了镜像后,你按照 [以下的说明][8] 需要解压并安装它到 SD 卡上。这将会花些时间安装固件,需要些耐心。一旦安装完成,在你的 SD 卡上将会有两个分区。一个是用来放 bootloader ,另一个是 OpenWRT 系统。 + + +### 启动系统 + +要启动你的新系统,插入 SD 卡到树莓派,用以太网线把树莓派和你的路由器(或者交换机)相连,然后点亮。 + +如果你有使用树莓派的经验,你可能习惯于通过终端使用 SSH 访问过它,或者通过显示器和键盘连接到树莓派。OpenWRT 工作有一点点不同。你与这个系统交互是通过网页浏览器,所以你必须能够通过网络来访问你的树莓派。 + +缺省状态下,树莓派使用的 IP 地址是:192.168.1.1。用来配置树莓派的计算机必须和树莓派在同一个子网中。如果你的网络没有使用 192.168.1.x 地址,或者你不能确定,在 GNOME 打开 “设置Settings” ,导航到网络设置,选择 “手动Manual” ,然后键入以下的 IP 地址和子网掩码: + + * IP 地址:192.168.1.15 + * 网络掩码:255.255.255.0 + +![IP addresses][9] + +在你的电脑上打开浏览器然后导航到 192.168.1.1 。这将打开一个验证网页,你可以登录到你的树莓派。 + +![OpenWRT login page][10] + +首次登录不需要密码,所以直接点击 “登录Login” 按钮继续。 + +### 设置网络连接 + +树莓派只有一个以太网口,而普通路由器有两个:一个是 WAN(有线区域网络)口,另一个是 LAN (本地区域网络)。 + +你有两个选择: + + 1. 使用你的以太网口接入互联网 + 2. 使用 WIFI 接入互联网 + +#### 使用以太网连接 + +你决定使用以太网,导航到 “网络Network接口Interfaces”。在这个设置页面,按下与 “LAN” 接口对应的蓝色 “编辑Edit” 按钮。 + +![LAN interface][11] + +应该会出现一个弹窗,在这个窗口中,你需要键入与你将要连接树莓派的路由器子网匹配的 IP 地址。如果需要的话,修改子网掩码,并输入树莓派将要连接的路由器的 IP 地址。 + +![Enter IP in the LAN interface][12] + +保存设置,然后通过以太网将你的树莓派连接到路由器。你现在可以用这个新的 IP 地址访问树莓派。 + +当你在把树莓派投入生产环境使用之前,确保为你的 OpenWRT 设置一个密码! + +#### 使用 WiFi 连接 + +如果你想通过 WiFi 将树莓派连接到互联网,导航到 “网络Network无线Wireless” 。在 “无线Wireless” 菜单里,按下蓝色的 “扫描Scan” 按钮查找你的家庭网络。 + +![Scan the network][13] + +在弹出的窗口中,找到你的 WiFi 网络然后连接它。不要忘记 “保存并应用Save and Apply” 设置。 + +在这 “网络Network接口Interfaces” 部分,你应该看到了一个新的接口。 + +![New interface][14] + +当你在把树莓派投入生产环境使用之前,确保为你的 OpenWRT 设置一个密码! + +### 安装必要的软件包 + +默认状态下,路由器并没有安装许多软件包。OpenWRT 提供了一个包管理器,带有一系列你需要安装的。导航到 “系统System软件Software” 然后通过按下标有 “更新列表…Update lists...” 的按钮来更新你的包管理器。 + +![Updating packages][15] + +你将会看到许多软件包;你需要安装以下这些: + + * `usb-modeswitch` + * `kmod-mii` + * `kmod-usb-net` + * `kmod-usb-wdm` + * `kmod-usb-serial` + * `kmod-usb-serial-option` + * `kmod-usb-serial-wwan`(如果没有安装的话) + +另外,[下载这个调制解调器管理软件包][16],然后在弹出的窗口中按下标有 “上传软件包…Upload Package...” 的按钮来安装它。重启树莓派让安装包生效。 + +### 设置移动网络接口 + +所有这些软件包被安装完之后,你可以设置移动网络接口。在连接调制解调器到树莓派之前,请阅读 [调制解调器的说明书][17],对其进行设置。然后连接你的移动调制解调器到树莓派,然后等待一会直到调制解调器启动。 + +导航到 “网络Network接口Interfaces”。在页面底部,按下 “添加一个新接口…Add new interface...” 按钮。在弹出的窗口中,给你的接口起一个名字(比如 “mobile”),然后从下拉列表中选择 “ModemManager” 。 + +![Add a new mobile interface][18] + +按下一个标有 “创建接口Create Interface” 的按钮。你应该看到一个新的弹出窗口。这是设置接口的一个主窗口。在这个窗口中,选择你的调制解调器,然后键入像接入点名称Access Point Name(APN)或是 PIN 码之类的信息。 + +![Configuring the interface][19] + +**注意:** 如果在列表中没有调制解调器设备出现,尝试重启树莓派或者安装 `kmod-usb-net-qmi-wwan` 软件包 。 + +当你已经配置完你的接口,按下 “保存Save” 然后 “保存并应用Save and Apply”。给系统一些生效的时间。如果一切正常,你应该看到像这样的一些东西。 + +![Configured interface][20] + +如果你想通过接口查看你的网络连接,你可以使用 SSH 连接到你的树莓派 shell。在终端里,键入: + +``` +ssh root@192.168.1.1 +``` + +缺省 IP 地址是 192.168.1.1:如果你修改了它,就用修改后的 IP 地址连接。当连接后,在终端里执行命令: + +``` +ping -I ppp0 google.com +``` + +如果一切正常运行,那么你应该从 Google 的服务器接收到 ping 回包 。 + +![Terminal interface][21] + +`ppp0` 是你创建的移动网络接口的默认接口名称。你可以通过使用 `ifconfig` 命令检查你的接口。它只显示活动的接口。 + +### 设置防火墙 + +要让移动网接口运行,你需要为移动网络接口和本地网络接口配置防火墙,以便引导流量到正确的接口。 + +导航到 “网络Network防火墙Firewall”。在页面的底部,你应该看到一个叫做 “区域Zones” 的部分。 + +![Firewall zones][22] + +设置防火墙最简单的方法就是调整 “wan” 区域。在 “已覆盖的网络Covered networks” 选项里按下 “编辑Edit” 按钮,选择你的移动网络接口,然后 “保存并应用Save and Apply” 你的设置。如果你不想用 WiFi 连接你的树莓派,你可以从 “已覆盖的网络Covered networks” 里删除 “wwan” 接口,或者关闭 WiFi 连接。 + +![Firewall zone settings][23] + +如果你想为每个接口设置一个独立区域,只需创建一个新区域然后分配必要的接口即可。举个例子,你可能想有一个覆盖移动网络接口的区域,并且通过它来转发 LAN 接口流量。按下 “添加Name” 按钮,然后给你的区域 “命名Name”, 检查 “伪装” 复选框,选中 “已覆盖的网络Covered networks” ,并选择哪些区域可以转发其流量。 + +![Firewall zone settings][24] + +然后 “保存并应用Save and Apply” 这些修改。现在你有一个新的区域。 + +### 设置一个接入点 + +最后一步是为你的设备接入互联网设置一个网络接入点。要设置一个接入点,导航到 “网络Network无线Wireless” 。你将会看到一个 WiFi 设备接口,一个名为 OpenWRT 的禁用的接入点,以及一个用于通过 WiFi 连接互联网的连接(如果你之前没有禁用或删除它)。在这个禁用的接口上,按下 “编辑Edit” 按钮,然后 “启用Enable” 该接口。 + +![Enabling wireless network][25] + +如果你想,你可以通过编辑 “ESSID” 选项来修改接口名称。你也可以选择它要关联的网络。默认情况下,它会与 LAN 接口关联。 + +![Configuring the interface][26] + +要为这个接口添加密码,选择 “无线安全Wireless Security” 选项,选择 “WPA2-PSK” 加密方式然后在 “密钥Key” 选项字段键入接口的密码。 + +![Setting a password][27] + +然后 “保存并应用Save and Apply” 设置。如果设置正确的话,当用你的设备扫描可用接入点的话,你应该可以看到你分配了名称的新接入点。 + +### 额外的软件包 + +如果你愿意,你可以通过网页界面为你的路由器下载额外的软件包。只需到 “系统System软件Software” 然后安装你想从列表或者互联网上下载的软件包并上传它。如果你在列表中没有看到任何软件包,请按下 “更新列表…Update lists...” 按钮。 + +你也可以添加其他拥有适合与 OpenWRT 一起使用的软件包的仓库。软件包和它们的网页界面是分开安装的。软件包名称是以 “luci-” 开始的是网页界面软件包。 + +![Packages with luci- prefix][28] + +### 试试看 + +这就是我的树莓派路由设置的过程。 + +![Raspberry Pi router][29] + +从树莓派建立一个路由器不是很困难。缺点是树莓派只有一个以太网接口。你可以用一个 USB-to-Ethernet 适配器来增加更多的网口。不要忘记在接口的网站上设置网口。 + +OpenWRT 支持大量的移动调制解调器,你可以用管理调制解调器的通用工具 modemmanager 为它们设置移动网络接口。 + +你有没有把你的树莓派当作路由器使用?请在评论中告诉我们情况。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/router-raspberry-pi + +作者:[Lukas Janėnas][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlilfe) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/lukasjan +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mesh_networking_dots_connected.png?itok=ovINTRR3 (Mesh networking connected dots) +[2]: https://openwrt.org/ +[3]: https://opensource.com/sites/default/files/uploads/lte_modem.png (Teltonika TRM240 modem) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://teltonika-networks.com/product/trm240/ +[6]: https://downloads.openwrt.org/releases/19.07.7/targets/brcm2708/bcm2710/ +[7]: https://opensource.com/sites/default/files/uploads/imagefiles.png (OpenWRT image files) +[8]: https://opensource.com/article/17/3/how-write-sd-cards-raspberry-pi +[9]: https://opensource.com/sites/default/files/uploads/ipaddresses.png (IP addresses) +[10]: https://opensource.com/sites/default/files/uploads/openwrt-login.png (OpenWRT login page) +[11]: https://opensource.com/sites/default/files/uploads/lan-interface.png (LAN interface) +[12]: https://opensource.com/sites/default/files/uploads/lan-interface-ip.png (Enter IP in the LAN interface) +[13]: https://opensource.com/sites/default/files/uploads/scannetwork.png (Scan the network) +[14]: https://opensource.com/sites/default/files/uploads/newinterface.png (New interface) +[15]: https://opensource.com/sites/default/files/uploads/updatesoftwarelist.png (Updating packages) +[16]: https://downloads.openwrt.org/releases/packages-21.02/aarch64_cortex-a53/luci/luci-proto-modemmanager_git-21.007.43644-ab7e45c_all.ipk +[17]: https://wiki.teltonika-networks.com/view/TRM240_SIM_Card +[18]: https://opensource.com/sites/default/files/uploads/addnewinterface.png (Add a new mobile interface) +[19]: https://opensource.com/sites/default/files/uploads/configureinterface.png (Configuring the interface) +[20]: https://opensource.com/sites/default/files/uploads/configuredinterface.png (Configured interface) +[21]: https://opensource.com/sites/default/files/uploads/terminal.png (Terminal interface) +[22]: https://opensource.com/sites/default/files/uploads/firewallzones.png (Firewall zones) +[23]: https://opensource.com/sites/default/files/uploads/firewallzonesettings.png (Firewall zone settings) +[24]: https://opensource.com/sites/default/files/uploads/firewallzonepriv.png (Firewall zone settings) +[25]: https://opensource.com/sites/default/files/uploads/enablewirelessnetwork.png (Enabling wireless network) +[26]: https://opensource.com/sites/default/files/uploads/interfaceconfig.png (Configuring the interface) +[27]: https://opensource.com/sites/default/files/uploads/interfacepassword.png (Setting a password) +[28]: https://opensource.com/sites/default/files/uploads/luci-packages.png (Packages with luci- prefix) +[29]: https://opensource.com/sites/default/files/uploads/raspberrypirouter.jpg (Raspberry Pi router) diff --git a/published/202204/20210401 Partition a drive on Linux with GNU Parted.md b/published/202204/20210401 Partition a drive on Linux with GNU Parted.md new file mode 100644 index 0000000000..071fd26540 --- /dev/null +++ b/published/202204/20210401 Partition a drive on Linux with GNU Parted.md @@ -0,0 +1,183 @@ +[#]: subject: (Partition a drive on Linux with GNU Parted) +[#]: via: (https://opensource.com/article/21/4/linux-parted-cheat-sheet) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (hwlife) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14463-1.html) + +在 Linux 上使用 GNU Parted 对磁盘分区 +====== + +> 了解对新的储存设备分区的基础知识,然后下载我们的速查表,让信息近在咫尺。 + +![](https://img.linux.net.cn/data/attachment/album/202204/12/162040edndfpnkn8233ppd.jpg) + +在 21 世纪,我们往往认为数据存储是理所当然的。我们有许多存储介质,相对价格便宜,而且有许多不同的可用类型。然而,不论你获得的免费云存储空间有多少,没有比有一个物理硬盘空间来存储重要的数据更好了(或容量真的很大的,而当你又在一个慢速网络上时)。然而,没有几块硬盘买回来就是现成的,至少在理想的状况下可以直接使用的。无论你是买了一块新硬盘,还用不同分区安装一个系统,你需要知道怎么在 Linux 上为磁盘分区。 + +这篇文章介绍了 GNU Parted ,它磁盘分区最好的工具之一。如果你偏向使用图形化程序,而不算终端命令行,请阅读我的《[为 Linux 格式化驱动器][2]》这篇文章。 + +### 磁盘标签、分区和文件系统 + +技术上来说,一个硬盘驱动器不需要很多软件,就可用作存储设备。然而,在没有分区表和文件系统等现代惯例的情况下使用硬盘是困难的、不切实际的,而且对你的数据不安全。 + +关于硬盘驱动器,这里有三个你需要知道的重要概念: + + * 磁盘标签disk label(或者 分区表partition table)是放置在磁盘驱动器起始位置的元数据,它告诉计算机可用的存储是何种类型、以及它在磁盘驱动器的位置等信息。 + * 分区partition 是一个识别文件系统位置的边界。举个例子,如果你有一个 512GB 的硬盘,你可以用占用所有磁盘容量(512GB)分成一个分区,或者分成两个分区,每个占用 256GB ,或者分成三个分区,占用各种不同大小的空间等等。 + * 文件系统filesystem 是一个硬盘驱动器和计算机两者约定俗成的存储方案。计算机必须知道怎样读取文件系统来拼凑存储在驱动器上的数据,并且必须知道怎样写入数据到文件系统并保持数据的完整性。 + +GNU Parted 程序管理着前两个概念:磁盘标签和分区。Parted 对文件系统有所了解,但是它把文件系统的实现细节交给了其他类似 `mkfs` 这样的工具。 + +> 下载 [GNU Parted 速查表][3] + +### 确定磁盘驱动器的位置 + +使用 GNU Parted 之前,你必须确定你的驱动器在你的系统上的位置。首先,将你要格式化的磁盘驱动器连接到你的系统,然后用 `parted` 命令查看连接到你的计算机的设备: + +``` +$ parted /dev/sda print devices +/dev/sda (2000GB) +/dev/sdb (1000GB) +/dev/sdc (1940MB) +``` + +你最新连接设备的名称在字母表上晚于连接时间更长的设备。举个例子,`/dev/sdc` 最有可能是我刚刚连接的磁盘。我能通过它的容量大小来确认,相比于我的工作站上的主要驱动器的 TB 大小来说,因为我知道我插入的 U 盘只有 2GB(1940MB,足够接近)大小。如果你不能确定,你可以得到的更多关于你想要分区的驱动器的信息: + +``` +$ parted /dev/sdc print +Model: Yoyodyne Tiny Drive 1.0 (scsi)     +Disk /dev/sdc: 1940MB +Sector size (logical/physical): 512B/512B +Partition Table: msdos +Disk Flags: + +Number  Start   End     Size    File system  Name  Flags + 1      1049kB  2048kB  1024kB  BS           Bloat  Hidden + 2      2049kB  1939MB  1937MB  FAT32        MyDrive +``` + +有些驱动器比其他驱动器有更多的元数据。这个磁盘表明它的物理驱动器品牌是 Yoyodyne ,此外,在磁盘的起始处包含了一个小的隐藏分区,后面是一个兼容 Windows 的臃肿的 FAT32 分区。这确实是我要重新打算格式化的驱动器。 + +继续之前,_确认_ 你已经确定了要分区的正确驱动器。 _对错误的驱动器重新分区会导致数据丢失。_ 为了安全起见,在本文中所有具有潜在破环性的命令都指向在你的系统中不太可能有的 `/dev/sdX` 设备。 + +### 创建磁盘标签(或者分区表) + +要在磁盘上创建一个分区,驱动器必须要有一个磁盘标签disk label。磁盘标签也被叫做 分区表partition table,所以 Parted 对两个术语都接受。 + +要创建一个磁盘卷标,使用 `mklabel` 或 `mktable` 子命令: + +``` +$ parted /dev/sdX mklabel gpt +``` + +这个命令在 `/dev/sdX` 的驱动器前面创建了一个 **gpt** 标签,删除了任何可能存在的标签。这是一个快速的过程,因为所有被替换的信息都是关于分区的元数据。 + +### 创建分区 + +要在磁盘创建分区,使用 `mkpart` 子命令,后跟可选的分区名称,再跟分区的开始和结束位置。如果你在磁盘上只需要一个分区,那么大小调整是容易的:开始位置输入 1 ,结束位置输入 100% 。使用 `--align opt` 参数允许 Parted 调整分区边界位置便于磁盘获得最佳性能: + +``` +$ parted /dev/sdX --align opt \ +mkpart example 1 100% +``` + +用 `print` 子命令查看你的新分区: + +``` +$ parted /dev/sdX print +Model: Yoyodyne Tiny Drive 1.0 (scsi) +Disk /dev/sdi: 1940MB +Sector size (logical/physical): 512B/512B +Partition Table: gpt +Disk Flags: + +Number  Start   End     Size   + 1      1049kB  1939MB  1938MB +``` + +你不必将整个磁盘用作一个分区。分区的优势是在一个磁盘上可以存在多个文件系统,它们之间不会相互干扰。在确定分区大小的时候,你可以使用 `unit` 子命令来设置你想用的测量方法。Parted 可以理解扇区sector柱面cylinder磁头head字节byte、KB、MB、GB、TB 和百分比。(LCTT 译注:具体使用方法请参阅手册页) + +你也可以指定你打算使用的分区的文件系统。这并不会创建文件系统,但是它为你以后方便使用提供了元数据。 + +将磁盘对半分,一个是 XFS 文件系统,另一个是 EXT4 文件系统: + +``` +$ parted /dev/sdX --align opt \ +mkpart xfs 1 50% +$ parted /dev/sdX --align opt \ +mkpart ext4 51% 100% +``` + +### 命名分区 + +除了标记分区用于什么文件系统之外,你也可以为每个分区命名。一些文件管理器和工具可以读取分区名称,能够帮助你区分驱动器。例如,我经常有几个不同的驱动器连接到我的媒体工作站,每个属于一个不同的项目。当创建这些驱动器的时候,我同时命名了分区和文件系统,这样,无论我怎么看我的系统,有重要数据的位置都会被清楚地标示出来。 + +要命名一个分区,你必须知道它的序号: + +``` +$ parted /dev/sdX print +[...] +Number  Start   End     Size   File system  Name     Flags + 1      1049kB  990MB   989MB  xfs          example + 2      1009MB  1939MB  930MB  ext4         noname +``` + +要命名分区 1: + +``` +$ parted /dev/sdX name 1 example +$ parted /dev/sdX print +[...] +Number  Start   End     Size   File system  Name     Flags + 1      1049kB  990MB   989MB  xfs          example + 2      1009MB  1939MB  930MB  ext4         noname +``` + +### 创建文件系统 + +要让你的驱动器能够正常使用,你必须在新分区上创建一个文件系统。GNU Parted 并不做这些,因为它只是一个分区管理器。在磁盘上创建文件系统的 Linux 命令是 `mkfs`,但也有一些有用的工具可以让你用来创建特定类型的文件系统。例如,`mkfs.ext4` 创建 EXT4 文件系统,`mkfs.xfs` 创建 XFS 文件系统等等。 + +你的分区位于磁盘驱动器的“内部” ,所以你不是在 `/dev/sdX` 上创建文件系统,而是在 `/dev/sdX1` 上为第一个分区创建文件系统,在 `/dev/sdX2` 上为第二个分区创建,以此类推。 + +这里是一个创建 XFS 文件系统的例子: + +``` +$ sudo mkfs.xfs -L mydrive /dev/sdX1 +``` + +### 下载我们的速查表 + +Parted 是一个灵活而强大的工具。你可以发出命令,如本文所示的那样,或者激活一个交互模式以不断 “连接” 你指定的驱动器: + +``` +$ parted /dev/sdX +(parted) print +[...] +Number  Start   End     Size   File system  Name     Flags + 1      1049kB  990MB   989MB  xfs          example + 2      1009MB  1939MB  930MB  ext4         noname + +(parted) name 1 mydrive +(parted) +``` + +如果你打算经常使用 Parted ,[下载我们的 GNU Parted 速查表][3],让信息近在咫尺。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-parted-cheat-sheet + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[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/coverimage_cheat_sheet.png?itok=lYkNKieP (Cheat Sheet cover image) +[2]: https://opensource.com/article/18/11/partition-format-drive-linux#gui +[3]: https://opensource.com/downloads/parted-cheat-sheet diff --git a/published/202204/20210419 How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution.md b/published/202204/20210419 How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution.md new file mode 100644 index 0000000000..9f9c50272f --- /dev/null +++ b/published/202204/20210419 How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution.md @@ -0,0 +1,279 @@ +[#]: subject: (How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution) +[#]: via: (https://itsfoss.com/deploy-seafile-server-docker/) +[#]: author: (Hunter Wittenborn https://itsfoss.com/author/hunter/) +[#]: collector: (lujun9972) +[#]: translator: (hwlife) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14468-1.html) + +怎样用 Docker 部署 Seafile 服务器来托管你自己的文件同步和共享解决方案 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/13/141808f7fo7444ozv75z5s.jpg) + +首先,什么是 Seafile ? + +[Seafile][1] 是一个自托管文件同步程序,采用客户端/服务器模式,即你有笔记本、手机等多个设备,能够连接到一个中心服务器。 + +不像类似 [Nextcloud 或 ownCloud][2] 这些更流行的替代品一样,Seafile 试图遵循 “只做一件事,但是要做好” 的理念。同样,Seafile 没有内置额外的类似联系人或者日历聚合的功能。 + +相反,Seafile 只专注于文件同步、共享及与之相关的事情,仅此而已。但正因为如此,它最终做的非常好。 + +### 使用 Docker 和 NGINX 部署 Seafile 服务器 + +> **高级教程** +> +> 我们的许多教程都是针对初学者的。这篇则不然,它是为那些经常鼓捣 DIY 项目和喜欢自托管的高级用户设计的。这个教程假定你可以熟练的使用命令行,而且你至少对我们将要使用的程序有一定的了解。 + +虽然整个过程完全可以不使用 NGINX ,但是使用 NGINX 更加容易配置,而且在将来更加容易的自托管更多的服务。 + +如果你想完全使用 Docker 环境,你也可以 [在 Docker 内部设置 NGINX][3] ,但是它这会使事情变得更加复杂,并且不能够带来太多好处。同样,在本教程里也不会涉及这些。 + +#### 安装设置 NGINX + +在这个教程中,我会使用 Ubuntu,因此会使用 `apt` 来安装软件包。如果你使用 Fedora 或者一些其他非 Debian 发行版,请使用你的发行版的 [包管理器][4]。 + +[NGINX][5] 既是一个网页浏览器,又是一个代理服务器。它将起到 Seafile 服务器和互联网之间网络连接的作用,同时也使一些任务更容易处理。 + +要安装 NGINX ,使用以下命令: + +``` +sudo apt install nginx +``` + +如果你想使用 HTTPS(也就是浏览器中的小挂锁),你需要安装 [Certbot][6]: + +``` +sudo apt install certbot python3-certbot-nginx +``` + +下一步,你需要设置 NGINX 来连接我们之后将要设置的 Seafile 实例。 + +首先,运行以下命令: + +``` +sudo nano /etc/nginx/sites-available/seafile.conf +``` + +键入下方的文本到文件中: + +``` +server { + server_name localhost; + location / { + proxy_pass http://localhost:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + } +} +``` + +**重要**: 将 `server_name` 一行的 `localhost` 替换为你要访问你的服务器的地址(比如 `seafile.example.com` 或者 `192.168.0.0`)。不确定要输入什么吗? + + * 如果你只是为了测试,使用 `localhost` 。这个设置将 **只允许你从你的电脑访问服务器** ,仅此而已。 + * 如果你想通过你的本地 Wi-Fi 连接使用 Seafile(与你在同一 Wi-Fi 网络上),你应该键入 [你的计算机 IP 地址][7]。你也可以考虑 [设置一个静态 IP 地址][8],尽管这不是必须的。 + * 如果你有一个公网 IP 地址,你知道它指向你的系统,就使用它。 + * 如果你有一个域名(比如 `example.com`、`example.org`)和公网 IP 地址,更改你的 DNS 设置,将域名指向你的系统的 IP 地址。这也需要将公网 IP 指向你的系统。 + +现在你需要复制配置文件到 NGINX 的查找目录中,然后重启 NGINX : + +``` +sudo ln -s /etc/nginx/sites-available/seafile.conf /etc/nginx/sites-enabled/seafile.conf +sudo systemctl restart nginx +``` + +如果你要安装 Cerbot,你也需要运行以下命令来设置 HTTPS : + +``` +sudo certbot +``` + +如果要重定向 HTTP 流量 到 HTTPS ,选择 `2` 。 + +现在可以来确认我们目前设置的一切都是否正常工作。如果你访问你的站点,你应该看到一个屏幕上写着 `502 Bad Gateway` 字样。 + +![][9] + +#### 安装 Docker 和 Docker Compose + +现在要进入有趣的部分了! + +首先,你需要安装 [Docker][10] 和 [Docker Compose][11] 。Docker Compose 需要利用 `docker-compose.yml` 文件,这将使管理多个 Docker [容器][12] 的 Seafile 需求变得更加容易。 + +Docker 和 Docker Compose 可以用以下的命令来安装: + +``` +sudo apt install docker.io docker-compose +``` + +检查 Docker 是否安装并运行,运行以下命令: + +``` +sudo docker run --rm hello-world +``` + +如果你完全安装成功,你应该在终端能看到这几行文字: + +![][13] + +如果你想避免在 `docker` 命令的开始添加 `sudo` 的话,你可以运行以下的命令将你自己添加到 `docker` 组: + +``` +sudo groupadd docker +sudo usermod -aG docker $USER +``` + +这个教程的其余部分假定你已经运行了以上两个命令。如果你没有运行,在所有 `docker` 或 `docker-compose` 的命令都添加 `sudo` 。 + +#### 安装 Seafile 服务器 + +这部分比之前部分明显容易的多。你所需要做的是输入一些文本到文件,然后运行一些命令。 + +打开一个终端,然后创建一个 Seafile 服务器用来储存内容的目录,并进入目录中: + +``` +mkdir ~/seafile-server && cd ~/seafile-server +``` + +![][14] + +转到你创建的目录然后运行以下命令: + +``` +nano docker-compose.yml +``` + +下一步,在弹出的窗口中键入以下文本内容: + +``` +version: '2.0' +services: + db: + image: mariadb + container_name: seafile-mysql + environment: + - MYSQL_ROOT_PASSWORD=password + - MYSQL_LOG_CONSOLE=true + volumes: + - ./data/mariadb:/var/lib/mysql + networks: + - seafile-net + + memcached: + image: memcached + container_name: seafile-memcached + entrypoint: memcached -m 256 + networks: + - seafile-net + + seafile: + image: seafileltd/seafile-mc + container_name: seafile + ports: + - "8080:80" + volumes: + - ./data/app:/shared + environment: + - DB_HOST=db + - DB_ROOT_PASSWD=password + - TIME_ZONE=Etc/UTC + - SEAFILE_ADMIN_EMAIL=me@example.com + - SEAFILE_ADMIN_PASSWORD=password + - SEAFILE_SERVER_LETSENCRYPT=false + - SEAFILE_SERVER_HOSTNAME=docs.seafile.com + depends_on: + - db + - memcached + networks: + - seafile-net + +networks: + seafile-net: +``` + +在保存文件之前,一些参数需要更改: + + * `MYSQL_ROOT_PASSWORD`:更换强壮的密码,你不必记住它,所以不要尝试挑选简单的密码。如果你需要帮助生成一个,请使用 [密码生成器][15] 。我建议使用 20 位字符长度并且避免使用任何的特殊字符(`!@#$%^&*` 等符号)。 + * `DB_ROOT_PASSWD`:更改你为 `MYSQL_ROOT_PASSWORD` 设置的值 。 + * `SEAFILE_ADMIN_EMAIL`:设置管理员帐户的电子邮件地址。 + * `SEAFILE_ADMIN_PASSWORD`:设置管理员帐户密码。避免与`MYSQL_ROOT_PASSWORD` 或者 `DB_ROOT_PASSWD` 密码相同。 + * `SEAFILE_SERVER_HOSTNAME`:在 NGINX 配置中设置 Seafile 的服务器主机名。 + +完成之后,你可以运行 `docker-compose` 整个运行起来: + +``` +docker-compose up -d +``` + +可能需要花一到两分钟,取决于你的网速,因为需要拉下几个 Seafile 需要运行的几个容器。 + +完成以后,还需要几分钟来完成。你也可以通过以下命令来检查运行状态: + +``` +docker logs seafile +``` + +当完成了,你将会看到如下输出: + +![][17] + +下一步,你只需要在你的浏览器里键入你设置的 `SEAFILE_SERVER_HOSTNAME` 的地址,然后你应该看到登录屏幕的页面。 + +![][18] + +就这样!现在一切功能齐全,准备用客户端来使用。 + +#### 安装 Seafile 客户端 + +Seafile 移动客户端在 [Google Play][19]、[F-Droid][20] 和 [苹果商店][21] 都是可用的。Seafile 也有 Linux、Windows 和 Mac 桌面客户端可用,可在 [此处][22] 找到。 + +通过 `seafile-gui` 软件包,可以在 Ubuntu 系统轻松获得 Seafile : + +``` +sudo apt install seafile-gui +``` + +通过 `seafile-client` 软件包 Seafile 也包含在 Arch 用户的 AUR 包管理器中。 + +### 结语 + +请尽情探索客户端及其所能提供的一切。我将在未来的一篇文章中详细阐述 Seafile 客户端的所有功能。(敬请期待 😃) + +总的来说,如果有什么错误,或者你有什么问题,请在下方评论 – 我会尽我所能回应。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/deploy-seafile-server-docker/ + +作者:[Hunter Wittenborn][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/hunter/ +[b]: https://github.com/lujun9972 +[1]: https://www.seafile.com/en/home/ +[2]: https://itsfoss.com/nextcloud-vs-owncloud/ +[3]: https://linuxhandbook.com/nginx-reverse-proxy-docker/ +[4]: https://itsfoss.com/package-manager/ +[5]: https://www.nginx.com/ +[6]: https://certbot.eff.org/ +[7]: https://itsfoss.com/check-ip-address-ubuntu/ +[8]: https://itsfoss.com/static-ip-ubuntu/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/nginx_bad_gateway.png?resize=489%2C167&ssl=1 +[10]: https://www.docker.com/ +[11]: https://docs.docker.com/compose/ +[12]: https://www.docker.com/resources/what-container +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/seafile-docker-helloworld.png?resize=752%2C416&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/seafile-dir.png?resize=731%2C174&ssl=1 +[15]: https://itsfoss.com/password-generators-linux/ +[16]: https://itsfoss.com/cdn-cgi/l/email-protection +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/seafile-running.png?resize=752%2C484&ssl=1 +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/seafile-login.jpg?resize=800%2C341&ssl=1 +[19]: https://play.google.com/store/apps/details?id=com.seafile.seadroid2 +[20]: https://f-droid.org/repository/browse/?fdid=com.seafile.seadroid2 +[21]: https://itunes.apple.com/cn/app/seafile-pro/id639202512?l=en&mt=8 +[22]: https://www.seafile.com/en/download/ diff --git a/published/202204/20210424 Getting Started With Markdown -Beginner-s Guide.md b/published/202204/20210424 Getting Started With Markdown -Beginner-s Guide.md new file mode 100644 index 0000000000..43d44058e9 --- /dev/null +++ b/published/202204/20210424 Getting Started With Markdown -Beginner-s Guide.md @@ -0,0 +1,310 @@ +[#]: subject: (Getting Started With Markdown [Beginner’s Guide]) +[#]: via: (https://itsfoss.com/markdown-guide/) +[#]: author: (Bill Dyer https://itsfoss.com/author/bill/) +[#]: collector: (lujun9972) +[#]: translator: (hwlife) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14503-1.html) + +Markdown 初学者指南 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/24/140247d969nm9kkhxeknje.jpg) + +在我的工作中,我经常要写代码、写与代码相配套的文档、创建网页、进行文本恢复项目。我在学校的时候还写过几篇正式的论文,也包括写课堂笔记,几乎每节课都写。 + +我几乎在我所有的写作中都使用 Markdown,它对我来说是一个节省时间的好工具。 + +在这篇文章中,我将分享我使用 Markdown 的体会。你将会了解以下内容: + + * 什么是 Markdown ? + * 它是怎么工作的? + * Markdown 的基本语法和怎样使用它们。 + +### 什么是 Markdown ? + +假如你是 Markdown 新手,它是一个为网络写手转换文本到 HTML 格式的工具。Markdown 文档遵循一种特定的语法,容易阅读和写作。它们是纯文本,所以能够通过电脑上的任何文本编辑器来创建。然后这些文档能够转换成网页 —— 而网页是用一个叫做 HTML 的语言标记创建的。 + +Markdown 只是一种不必(即使知道怎么做)写 HTML 代码就能够创建网页的方式。实际上,如果你不转换成 HTML 的话,Markdown 甚至是个对纯文本格式化的好方法。有人曾这样对我描述 Markdown : + + +> “ _它不是所见即所得,而是所见即所意_ ”。 + +然而,Markdown 不只是一个简单的格式化体系,它也是一个纯文本格式转化到 HTML 的一个软件工具。 + +这就是为什么语法很重要。如果你想在网页上起个标题,Markdown 将会基于你标题前面的字符来创建。Markdown 的一些语法示例如截图所示: + +![Markdown to HTML conversion][1] + +### 所以我怎样才能使纯文本文件转换成 HTML 格式呢? + +John Gruber 的 Markdown 是一个运行在命令行上的 Perl 脚本。也就是说,它可以读取你创建的 Markdown 文本并用它来构建网页。 + +由于有 [许多著名的编辑器][2] 可以为你做这个转换,我在这里尽量避免使用命令行。不仅如此,许多这样的编辑器会让你写下你的文本,并同时向你展示网页的样子(称为渲染)。 + +Markdown 编辑器总的来说设置了两帧:左边部分是你要写你文本的地方,右边部分是用 HTML 语言显示给你格式化后文本的样子: + +![Most Markdown editors have two panes to write and preview the text][3] + +当你用它满意地完成你的写作,只需保存 Markdown 文件即可。就像这样,之后一旦你需要编辑和修改的时候,你就会用到它。文件保存后,你可以用编辑器将 Markdown 文档导出为 HTML 格式的文档。 + +编辑器用你的 Markdown 作为参考创建网页。你的 Markdown 文档在导出时不会修改,你仍然拥有源文档,同时创建一个独立的、新的 HTML 文档(网页),你可以把它放到一个网页服务器上。 + +**注意**:许多 Markdown 编辑器也可以将你的 Markdown 文档导出为其他格式,比如 `.doc`、`.docx` 和 `.pdf`。之后你可以了解这些高级设置和你可能需要的额外软件。 + +### Markdown 基础语法 + +为了让 Markdown 新用户快速了解,我将把这部分内容限制在我最常使用的语法上。我相信这些将是最有帮助的 - 你可以在现在就提高工作效率,同时了解更多关于 Markdown 以后能为你做什么。 + +#### 写标题 + +我经常使用 `#` 字符来表示标题。这里有六个等级: + +``` +# 一级标题 +## 二级标题 +### 三级标题 +#### 四级标题 +##### 五级标题 +###### 六级标题 +``` + +还有一种标题类型,是在文本下使用下划线。我很少使用这种类型的标题,我只限于使用两种:一种是使用 `=` 字符表示的双下划线,生成 `H1` 标题。一种是使用 `-` 字符表示的单下划线,生成 `H2` 标题: + +``` +一级标题 +=============== + +二级标题 +--------------- +``` + +![][4] + +#### 段落 + +段落被空行隔开(确保段落之间有一个空行)。首行不要缩进。在 Markdown 里用 `Tab` 键或者空格键缩进有着不同的目的和作用。 + +段落是一个文本块,不应该用空格键和 `Tab` 键来缩进。它可以有一行或者多行。要结束这一段另起一段,点两下回车键;段落通过一个空行分开。 + +![][5] + +#### 换行 + +请记住,对于段落,必须用空行来分隔它们,这要通过按两次回车键来实现。Markdown 对此很严格。 + +Markdown 不支持 “强制插入换行符hard-wrapped” 或者 “固定行长度fixed-line-length” 段落。那就是说,单击回车键一次将不会强制文本换到新的一行。它可能在编辑窗口显示,但是 HTML 格式下不显示。 + +然而,有时你可能需要拆分段落或者换行。Markdown 确实有一种方法可以做到,但是它一开始看起来可能有一点奇怪:**换行是通过用两到多个空格键然后点一次回车键完成的。** + +![][6] + +这里有一个短诗的范例。每行以两个空格结束。最后一行,由于是这个小节的结束,没有额外的空格。因为它是这个诗句(段落)的结束,我双击回车键两次: + +``` +Baa, baa black sheep, +Have you any wool?. +Yes, sir. Yes, sir. +Three bags full. +``` + +在一行的最后加两个空格来创建一个换行,可能需要时间去习惯。 + +![][7] + +#### 水平线 + +水平线非常适合将文本拆分为多个部分。 + +用三个或更多的破折号 `-` ,下划线 `_` ,或者星号 `*` 来做水平线,像这样: + +``` +--- + +*** + +___ +``` + +你甚至可以在字符之间输入空格: + +``` +- - - +``` + +在文章和报告中我不经常使用水平线,但是在日记、系统日志和课堂笔记中对我很有用。 + +![][8] + +#### 用加粗和斜体来强调文本 + +当你想让一个单词或者短语脱颖而出,引起注意,你可以让它加粗或者斜体显示。斜体和加粗文本可以在两种方式中任选其一。第一种是用星号 `*` 将其包括,第二种是用下划线 `_` 的方式。 + +使一个单词或者短语斜体显示,用一个下划线或者星号来括住文本。使一个单词或者短语加粗,使用两个下划线或者星号来括住文本: + +``` +用星号来显示 *斜体* 。 + +用下划线来显示 _斜体_ 。 + +用星号来显示 **加粗** 。 + +用下划线来显示 __加粗__ 。 +``` + +记住两边使用相同的字符。单词或短语的一面是星号,另一面是下划线,将不会生效。相同字符必须在单词或者短语的两边。 + +![][9] + +#### 块引用 + +块引用被用来直接引用。如果你正在写博客,你想重复本杰明•富兰克林说过的话,你可以使用块引用。 + +一个右尖括号被用来指定块引用: + +``` +> 这是块引用。 + +>> 如果你想进一步再次块引用,使用两个右尖括号。 +``` + +![][10] + +#### 在 Markdown 中添加超链接 + +超链接非常酷。在基础版的 Markdown 语言有三种方式创建超链接,在这里我只讲两种:普通连接和自动连接。 + +第三种链接被称为参考链接,在 Markdown 语言的基础版和高级版都支持。我想让你快速入门。你可以在准备好的时候找找参考链接的资料。 + +普通链接可以让你链接到各种各样的网站。网站名称或者你要使用的短语被放置在中括号 `[]` 中。真实的链接地址在小括号 `()` 中。 + +``` +现在去看看 [Linux 中国](https://linux.cn) 。 +``` + +自动连接通过用尖括号 `<>` 括住链接地址。这个链接是一个实际的地址(可以是网址或者电子邮件地址)。拼写出来的链接被转换到 HTML 的时候,就变成了有效的链接。 + +``` + + + +``` + +当你想在文本中拼写出网址时,这很有用: + +![][11] + +#### 在 Markdown 中添加图片 + +链接图片几乎与链接网站一样。网站链接和图片链接微小的不同是,图片链接以感叹号 `!` 开始。 + +图片名称或者图片描述放置在中括号 `[]` 里。实际链接放置在小括号 `()` 里。 + +你可以像这样嵌入图片: + +``` +![alternate text](./images/image.jpg) +``` + +这儿有一个示例图像链接。这是一个示例链接,没有这个图片,但是这是个好例子,显示了实际链接应该有的样子: + +``` +![a picture of bill](./images/my_photo_of_me.jpg) +``` + +![][12] + +#### 列表 + +制作列表有很多原因。它们可能用来作为代办事项、大纲中的主题元素、组装项目中的明细栏等等。列表有两种主要类型:无序列表和有序列表。 + +无序列表没有编号;这些就是我们在许多文档中所看到的列表项。有序列表是有编号的。 + +要创建一个有序(有编号的)列表,只需在每行用一个数字开始,像这样: + +``` +1. 项目 一。 +2. 项目 二。 +3. 项目 三。 +``` + +无序列表没有编号,但要在列表每个项目的开始使用一个星号 `*` 、一个加号 `+` ,或者一个减号 `-` 。我偏向于使用一个星号或者减号,你可以选择适合你的: + +``` +* 项目 一。 ++ 项目 二。 +- 项目 三。 +``` + +子项目可以通过缩进被添加到有序和无序列表中,像这样: + +``` +1. 项目 一 + 1. 子项目 一 + 2. 子项目 二 +2. 项目 二 +3. 项目 三 +``` + +![][13] + +### Markdown 语法速查表 + +这是一个简短的 Markdown 语法列表为你作为参考,这个列表已经在本小结中介绍。 + +如果你决定使用 Markdown 作为写作工具,你会发现 Markdown 会让写作变得更加简单。 + +![][14] + +> **[下载 PDF 格式的 Markdown 速查表][15]** + +### 结语 + +Markdown 可以做比我描述的更多的事情。我写作的很大一部分是用我在这里介绍的 Markdown 语法完成的 - 而这些是我最常使用的项目,即使是在更复杂的项目中。 + +如果这些看起来太简单了,那么说明它真的很容易。Markdown 用来完成简单的写作任务,但是你不必完全听我的。你可以尝试一下!不必安装 Markdown 编辑器;你可以在线尝试。这里有几个 [优秀的在线 Markdown 编辑器][16]。这里我喜欢用这三个: + +- John Gruber’s [Dingus][17] +- [Editor.md][18] +- [Dillinger][19] + +Editor.md 和 Dillinger 会让你看到你的 Markdown 文本作为 HTML 实时渲染的效果。 Dingus 不能实时预览,但是在参考页有 Markdown 的语法速查表。 + +![][20] + +用以上这些在线编辑器尝试一下文章中的示例。也可以尝试一下你自己的想法。这将使你在可能致力于学习更多的知识之前习惯于 Markdown。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/markdown-guide/ + +作者:[Bill Dyer][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/bill/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/retext_window_showing_syntax_and_preview-2.png?resize=800%2C429&ssl=1 +[2]: https://itsfoss.com/best-markdown-editors-linux/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/ghostwriter_two_frames-1.png?resize=800%2C458&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/1_md_headings_vscodium.png?resize=800%2C485&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/2_md_paragraphs_example_vscodium.png?resize=800%2C593&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/3_md_line_break_fail_vscodium.png?resize=800%2C593&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/4_md_line_break_success_vscodium.png?resize=800%2C450&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/5_md_horizontal_rules_vscodium.png?resize=800%2C326&ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/6_md_emphasis_vscodium.png?resize=800%2C393&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/7_md_blockquotes_vscodium.png?resize=800%2C393&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/8_md_links_vscodium.png?resize=800%2C678&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/9_md_images_vscodium.png?resize=800%2C725&ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/10_md_lists_vscodium.png?resize=800%2C725&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/markdown-syntax-cheatsheet.png?resize=727%2C743&ssl=1 +[15]: https://drive.google.com/file/d/1y-Qz9PX_2HksEG5D_WwN-asNB-tpjZHV/view?usp=sharing +[16]: https://itsfoss.com/online-markdown-editors/ +[17]: https://daringfireball.net/projects/markdown/dingus +[18]: http://editor.md.ipandao.com/en.html +[19]: https://dillinger.io/ +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/editor-md_page_in_browser-1.png?resize=800%2C505&ssl=1 diff --git a/published/202204/20210812 A guide to the Linux terminal for beginners.md b/published/202204/20210812 A guide to the Linux terminal for beginners.md new file mode 100644 index 0000000000..a4607fb8ed --- /dev/null +++ b/published/202204/20210812 A guide to the Linux terminal for beginners.md @@ -0,0 +1,121 @@ +[#]: subject: "A guide to the Linux terminal for beginners" +[#]: via: "https://opensource.com/article/21/8/linux-terminal" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14445-1.html" + +Linux 终端新手指南 +====== + +> 学习 Linux 终端命令、参数的区别,以及如何使用它们来控制你的计算机。 + +![](https://img.linux.net.cn/data/attachment/album/202204/08/113632ayyp77duejmdyrj8.jpg) + +距离我的住处几条街远的地方,有一家咖啡馆,我在每个周日都会去那里参加固定的 “龙与地下城Dungeons & Dragons”(D&D) 游戏。他们有一份菜单,前几次我去点餐时,我总是要翻看好几分钟,才能确定要点些什么。熟悉了之后,我就不用看菜单了,因为我清楚地知道他们在卖什么,也清楚地知道自己想要什么。现在点餐对我来说很简单,只要说一声“老规矩”就好了,接下来就是等待一杯咖啡、一碗薯片和烤饼被送来(通常不方便的是,在我们 做出决定roll for initiative 的那一刻,但这也不是他们的问题)。(LCTT 译注:做出决定roll for initiative 是 D&D 玩家的黑话,它指的是在比赛开始前掷骰子的行为) + +与餐厅的菜单类似,计算机的图形界面也为用户提供了操作选项。这里有图标、窗口和按钮,你可以搜索你想要的东西,点击项目,拖动其他项目,操纵图形界面,直到你的任务完成。不过,一段时间后,这可能会变得繁琐,甚至是效率低下。既然你清楚地知道需要做什么,那么,如果只需告诉计算机你想要发生什么,无需耗费大量的体力和脑力来搜索项目、舞动鼠标,就能达到目的,岂不是更好吗? + +### Linux 终端是什么 + +Linux 终端是一个基于文本的交互界面,它是用来控制 Linux 计算机的。虽然它只是帮助 Linux 用户完成任何特定任务的众多工具之一,但是它被广泛地认为是最有效的方法。除了编写代码,这无疑是最直接的方法。事实上,它是如此受欢迎,以至于苹果公司将操作系统的基础改为 Unix,从而获得了 [Bash 和 Z shell][2],而微软公司开发了它自己的开源命令行 [PowerShell][3]。 + +### Linux 命令是什么 + +命令commands 是一种特殊的关键词,你可以在终端中使用它,告诉计算机去执行一个动作。大多数命令是很小的应用程序,它们与你的操作系统的其他部分一起安装。你可能没有意识到它们的存在,因为它们通常被保存在相对模糊的目录中,如 `/bin`、`/sbin`、`/usr/bin` 和 `/usr/sbin`,但你的终端知道在哪里可以找到它们(多亏了一个叫 [PATH][4] 的东西)。其他的命令是内置在终端中的。你不必担心一个命令是安装的还是内置的,无论是哪一种,终端都能执行。更棒的是,在大多数 Linux 发行版上,当终端找不到一个命令时,它会在互联网上搜索提供该命令的软件包,然后会主动为你提供安装软件包、运行该命令的服务。 + +下面是一个简单的命令: + +``` +$ ls +``` + +`ls` 命令是 “list” 的缩写,它会列出当前目录的内容。试一试吧!先打开一个终端窗口,然后打开一个文件管理器窗口(Linux 上叫 “文件Files”,macOS 上叫 “访达Finder”,Windows 上叫 “资源管理器Windows Explorer”)。比较一下这两个窗口,它们是同一数据的两种不同表现方式。 + +### Linux 命令中的参数是什么 + +参数argument 是命令中的任意一个“不是命令本身”的部分。例如,要列出一个特定目录的内容,你可以提供该目录的名称作为参数。 + +``` +$ ls Documents +``` + +在这个例子中,`ls` 是命令,`Documents` 是参数。该命令将列出 `Documents` 目录的内容。 + +### Linux 命令中的选项是什么 + +命令的 选项option,也叫 标志flag开关switch,它是命令参数的一部分。命令参数是跟在命令后面的任何东西,而选项通常(但不总是)用一个连接号(`-`)或两个连接号(`--`)来划分。请看下面这个例子: + +``` +$ ls --classify Documents +``` + +在这个例子中,`--classify` 是一个选项。它也有一个简短的版本,因为终端用户更喜欢少打点字来提高效率。 + +``` +$ ls -F Documents +``` + +短的选项通常可以合并。下面是一个 `ls` 命令,它将 `-l` 选项与 `--human-readable`(`-h`)、`--classify`(`-F`) 和 `--ignore-backups`(`-B`) 选项结合了起来: + +``` +$ ls -lhFB +``` + +一些选项本身可以带参数。例如,`ls` 的 `--format` 选项可以让你改变信息的呈现方式。默认情况下,目录的内容是以列的形式提供给你的,但如果你需要它们显示为逗号分隔的列表,你可以把 `--format` 设置为 `comma`。 + +``` +$ ls --format=comma Documents +alluvial, android-info.txt, arduinoIntro, dmschema, +headers.snippet, twine, workshop.odt +``` + +等于号(`=`)是可选的,所以这样做也可以: + +``` +$ ls --format comma Documents +alluvial, android-info.txt, arduinoIntro, dmschema, +headers.snippet, twine, workshop.odt +``` + +### 学习使用 Linux 终端 + +学习如何使用终端可以提高工作效率和生产力,同时也可以使计算变得非常有趣。当我运行一个精心设计的命令时,我常常会坐下来,为我在空白屏幕上输入几个字就能实现的事情而惊叹。终端可是和很多东西相关 —— 编程、诗歌、拼图和实用主义,但无论你如何看待,它都是一个值得学习的持续创新。 + + * [使用 Linux 终端查看你的计算机上有哪些文件][5] + * [如何在 Linux 终端中打开和关闭目录][6] + * [在 Linux 终端中进行导航][7] + * [在 Linux 终端中移动一个文件][8] + * [在 Linux 终端中重命名一个文件][9] + * [在 Linux 终端中复制文件和文件夹][10] + * [在 Linux 终端中删除文件和文件夹][11] + +在阅读和练习了这些文章中的课程后,你可以下载我们的免费电子书 [系统管理员的 Bash 脚本指南][12],在终端中获得更多乐趣。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-terminal + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) +[2]: https://opensource.com/business/16/3/top-linux-shells +[3]: https://opensource.com/article/18/2/powershell-people +[4]: https://opensource.com/article/17/6/set-path-linux +[5]: https://linux.cn/article-13669-1.html +[6]: https://opensource.com/article/21/7/linux-terminal-basics-opening-and-closing-directories +[7]: https://opensource.com/article/21/7/terminal-basics-moving-around-your-computer +[8]: https://linux.cn/article-13677-1.html +[9]: https://opensource.com/article/21/7/terminal-basics-rename-file-linux-terminal +[10]: https://opensource.com/article/21/7/terminal-basics-copying-files-linux-terminal +[11]: https://linux.cn/article-13687-1.html +[12]: https://opensource.com/downloads/bash-scripting-ebook \ No newline at end of file diff --git a/published/202204/20220114 Installing Arch Linux Using archinstall Automated Script -Complete Guide.md b/published/202204/20220114 Installing Arch Linux Using archinstall Automated Script -Complete Guide.md new file mode 100644 index 0000000000..0f162609d7 --- /dev/null +++ b/published/202204/20220114 Installing Arch Linux Using archinstall Automated Script -Complete Guide.md @@ -0,0 +1,174 @@ +[#]: subject: "Installing Arch Linux Using archinstall Automated Script [Complete Guide]" +[#]: via: "https://www.debugpoint.com/2022/01/archinstall-guide/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "hwlife" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14444-1.html" + +用 archinstall 自动化脚本安装 Arch Linux +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/08/084638i8vp81c1zpxpw6i8.jpg) + +> 在这篇指南中,我们解释了使用自动化脚本 `archinstall` 安装 Arch Linux 的超级容易的方法。适合初学者到高级用户。 + +对许多新用户来说,安装 Arch Linux 仍然是一件头疼的事情。它需要命令行,以及包括启动引导过程、内核和 Grub 概念在内的 Linux 系统的内部工作机制等大量的知识。对许多人来说并不知道这些知识。但是新用户仍然想要安装和体验 Arch Linux 。 + +我个人感觉在计算机年代,操作系统的安装应该是简单的事情。对于最终用户安装系统应该尽可能的简单。毕竟,所有操作系统的存在只有一个目的 —— 帮助最终用户执行某些任务并协助他们。  + +### archinstall 自动化脚本是什么? + +话说,不久前我们讨论过在裸机上安装 Arch Linux。从那以后,Arch Linux 团队弄出来了一个叫做 [archinstall][1] 自动化和交互脚本。如今用这个脚本安装 Arch Linux 是一件容易的事情,任何人都能够完成。 + +这就让我们有了使用这个叫做 `archinstall` 的自动化脚本撰写这篇 Arch Linux 安装指南的打算。 + +让我们开始吧。 + +### 使用 archinstall 脚本安装 Arch Linux 的指南 + +我将这个指南分为三个部分。第一部分是下载 Arch Linux 的 .ISO 文件,创建一个磁盘引导分区。第二部分是实际安装,最后是用一个示例桌面来完成配置。 + +#### 第一部分:下载 .ISO 文件 + +访问以下链接。下载 Arch Linux 的 .ISO 文件。你能够用一个直接的 HTTP 地址下载或者使用种子/磁力链接下载文件。 + +> [下载 Arch Linux][2] + +一旦下载完成,用 [Etcher][3] 或者其他的工具创建一个可启动的 U 盘。 + +完成以后,插入 U 盘并且重启计算机。 + +你开始下一部分之前,确定你连接了互联网。一般来说,如果你是有线网,那就很好。如果你在 Arch 就要通过命令行配置 Wi-Fi,请 [遵从此指南][4]。只要确保你已经连接到互联网就行。 + +#### 第二部分:使用 archinstall 安装 + +一旦启动完成,你应该看到以下提示。键入 `archinstall` 然后点击回车。 + +![First prompt for archinstall][5] + +这个命令将会验证网络连接是否连接到 Arch Linux 的镜像站点。一旦完成,就会弹出一系列(像这样的)问题。你需要做的将是阅读和回复。 + +所以,对这个指南来说,我给出了让你开始的最基础和最容易的一种方法。如果你足够自信,你也可以尝试其他选择。但是我建议遵循以下概述的基本选择,下次你在尝试其他的选择。 + +够公平吧?OK。 + +因此,第一个问题是键盘布局类型。通过两个字节国家特定布局代码来显示。你也可以键入它们或者输入它们边上的数字。对于美国-英语来说,我键入 `us` 。 + +![Keyboard Type – archinstall][6] + +下一步是键盘语言,我键入数字 `65` 选择美国。 + +![Keyboard Language – archinstall][7] + +下一个是硬盘驱动器部分。这个脚本自动探测你的目标系统的可用驱动器。举个例子,在以下图片中,它显示 17GB `/dev/vda` 是一个主要的块设备。这就是我要安装系统的地方。不要跳过这个步骤。 + +在这个指南中,我键入数字 `2` 选中 `/dev/vda` 块设备。请根据你们每人的系统键入相应的数字。 + +一旦你做完这步,你应该在设置这个设备的边上看到一个双箭头 `>>`。如果你已经选中它,按下回车键进入下一步。 + +![Choose Block Device -1][9] + +![Choose Block Device -2][10] + +在下一个选项中,你要非常小心。这个脚本问是否你想清除设备然后进行自动分区。否则你要手动分区硬盘驱动器。为了简单起见,我选择选项 `0`。 + +![Select partition option – archinstall][11] + +在下面一组问题中,如下图所示。更多的是文件系统类型、主机名、root 用户密码,等等。按照屏幕上的操作。便于帮助你,我已经在下表中加入了用于本指南的问题和答案。 + +问题 | 选项 +---|--- +选择主要的文件系统 | `ext4` +你想用 zram 作为交换分区吗?| `n` +键入磁盘加密密码 | 保留为空直接按下回车 +主机名或计算机名 | 键入你要键入的名字 +键入 root 密码 | 键入你要键入的密码 +键入程序预配置文件名:0 – 桌面;1 – 最小化;2 – 服务器;3 – xorg | 选择 `3` xorg +安装显卡驱动 | 根据你的系统选择数字。否则缺省不选按下回车键 +安装声卡驱动 | 选择 `pulseaudio` + +![Various options in archinstall -1][12] + +在选择内核的下个问题里,选择 `linux`。这个脚本将要为你安装你额外添加的软件包,像 firefox、nano ,等等。 + +用 NetworkManager 选择网络接口,并且为时区选择缺省选项。 + +![Various options in archinstall -2][13] + +就是这样。一旦你已经完成上述步骤,这个脚本将会生成,并且等待你按下回车开始安装过程。 + +![archinstall starts downloading packages][14] + +等待直到这一步骤完成。这将花一些时间下载安装所有软件包,这依赖你的系统和网络连接速度。有时 Arch 镜像是缓慢的,所以等待直到它完成。 + +#### 第三部分 - 安装桌面环境 + +当你用以上方法安装完基本系统以后,你可以安装像 GNOME、KDE Plasma、MATE、Xfce 等额外的桌面环境。我们在以下页面中为它们每个都提供了安装指南。你可以访问你选择的桌面环境安装页面,并且直接跳到这些页面底部提取安装桌面环境的命令。 + + * [Xfce][15] + * [GNOME][16] + * [KDE Plasma][17] + * [Cinnamon][8] + * [LXQt][18] + +举个例子,如果你想要安装 GNOME 桌面基本套件,你可以简单的运行以下命令来安装。 + +``` +sudo pacman -S --needed gnome gnome-tweaks nautilus-sendto gnome-nettool gnome-usage gnome multi-writer adwaita-icon-theme chrome-gnome-shell xdg-user-dirs-gtk fwupd arc-gtk-theme seahosrse gdm firefox gedit +``` + +``` +systemctl enable gdm +``` + +``` +systemctl enable NetworkManager +``` + +一旦你完成了以上这些,键入 `reboot` 重启。 + +恭喜你。你已经使用这个指南通过厉害的 `archinstall` 脚本安装完成了 Arch Linux。 + +### 结语 + +我相信,这是由该团队开发的令人印象深刻的脚本之一。并且确实增加了使用 Arch Linux 的用户基数和覆盖范围。 + +使用这个脚本有什么问题吗?在下方评论让我知道。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/01/archinstall-guide/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[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/lujun9972 +[1]: https://github.com/archlinux/archinstall +[2]: https://archlinux.org/download/ +[3]: https://www.debugpoint.com/2021/01/etcher-bootable-usb-linux/ +[4]: https://www.debugpoint.com/2020/11/connect-wifi-terminal-linux/ +[5]: https://www.debugpoint.com/wp-content/uploads/2022/01/image.png +[6]: https://www.debugpoint.com/wp-content/uploads/2022/01/Keyboard-Type-archinstall.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/01/Keyboard-Language-archinstall.jpg +[8]: https://www.debugpoint.com/2021/02/cinnamon-arch-linux-install/ +[9]: https://www.debugpoint.com/wp-content/uploads/2022/01/Choose-Block-Device-1.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/01/Choose-Block-Device-2.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2022/01/Select-partition-option-archinstall.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2022/01/Various-options-in-archinstall-1.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2022/01/Various-options-in-archinstall-2.jpg +[14]: https://www.debugpoint.com/wp-content/uploads/2022/01/archinstall-starts-downloading-packages.jpg +[15]: https://www.debugpoint.com/2020/12/xfce-arch-linux-install-4-16/ +[16]: https://www.debugpoint.com/2020/12/gnome-arch-linux-install/ +[17]: https://www.debugpoint.com/2021/01/kde-plasma-arch-linux-install/ +[18]: https://www.debugpoint.com/2020/12/lxqt-arch-linux-install/ +[19]: https://t.me/debugpoint +[20]: https://twitter.com/DebugPoint +[21]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[22]: https://facebook.com/DebugPoint diff --git a/published/202204/20220119 Manage your passwords in the Linux terminal.md b/published/202204/20220119 Manage your passwords in the Linux terminal.md new file mode 100644 index 0000000000..415e376715 --- /dev/null +++ b/published/202204/20220119 Manage your passwords in the Linux terminal.md @@ -0,0 +1,218 @@ +[#]: subject: "Manage your passwords in the Linux terminal" +[#]: via: "https://opensource.com/article/22/1/manage-passwords-linux-terminal" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "hwlife" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14480-1.html" + +在 Linux 终端里管理你的密码 +====== + +> pass 是一个经典的 UNIX 式密码管理系统,使用 GnuPG(GPG)作为加密方式,终端是它的主要界面。 + +![](https://img.linux.net.cn/data/attachment/album/202204/16/145508xw1uyw4ezbvrmybv.jpg) + +如今,我们每个人都有几十个密码。幸运的是,这些密码大部分几乎都是网站的,你可能通过互联网浏览器访问大部分网站,而许多浏览器都有内置的密码管理器。最流行的互联网浏览器也有一个同步的功能,可以帮助你在各种设备上运行的浏览器之间分发密码,所以当你需要时,绝不会找不到你的登录信息。如果这不能够满足你,还有类似 [BitWarden][2] 这样优秀的开源项目也可以托管你加密后的密码,确保只有你自己才能解锁它们。这些方案有助于你轻松维护独特的密码,我使用这些方便系统来管理一些密码。但是我的主密码存储库比以上这些方式简单的多。我主要是使用 [pass][3] ,这是一个经典的 UNIX 式密码管理系统,使用 GnuPG(GPG)作为加密方式,终端是它的主要界面。 + +### 安装 pass + +你可以从你的发行版仓库中安装 `pass` 命令。 + +在 Fedora、Mageia 和类似的发行版上,你可以用你的包管理器来安装它: + +``` +$ sudo dnf install pass +``` + +在 Elementary、Mint 和其它基于 Debian 的发行版上: + +``` +$ sudo apt install pass +``` + +在 macOS 上,你可以使用 [Homebrew][4] 来安装它: + +``` +$ brew install pass +``` + +### 设置 GnuPG + +在使用 `pass` 之前,你需要一个有效的 PGP(良好隐私Pretty Good Privacy)密钥。如果你已经维护了一个 PGP 密钥,你可以跳过这个步骤,或者你可以选择为使用 `pass` 而创建一个新的密钥。最常见的开源 PGP 实现是 GnuPG(GPG),它随 Linux 一起提供。对于 macOS,你可以从 [gpgtools.org][5]、Homebrew 或者 [Macports][6] 安装它。要创建 GnuPG 密码,运行这个命令: + +``` +$ gpg --generate-key +``` + +你会被提示输入你的名字和电子邮件,并且为密钥创建一个密码。你的密钥是一个数字文件,你的密码只有你自己知道。它俩组合起来能够“加锁”和“解锁”加密信息,比如包含密码的文件。 + +GPG 密钥更像是一个房门钥匙或者汽车钥匙,如果你失去了它,它“锁起来”的任何东西都会变得无法获得。仅仅知道你的密码是不够的。 + +如果你已经管理了几个 SSH 密钥,你可能已经习惯了这一点了。如果你对数字加密密钥是个新手,可能得花些时间来适应。备份你的 `~/.gnupg` 目录,这样当你下次心血来潮决定尝试一个令人兴奋的新发行版时,你就不会意外地删除它。 + +做一个备份,并保持备份安全。 + +### 设置 pass + +要开始使用 `pass` ,你必须初始化一个 _密码仓库_ ,它定义为一个储存位置,配置为使用特定加密密钥。你可以通过与密钥相关联的名称或数字指纹来指明要用于密码存储的 GPG 密钥。你自己的名字通常更容易选择: + +``` +$ pass init seth +mkdir: created directory '/home/seth/.password-store/' +Password store initialized for seth +``` + +如果你忘记了你的名称,你可以使用 `gpg` 命令查看数字指纹和关联你名称的密钥: + +``` +$ gpg --list-keys +gpg --list-keys +/home/seth/.gnupg/pubring.kbx +----------------------------- +pub  ed25519 2022-01-06 [SC] [expires: 2024-01-06] +     2BFF94286461216C907CBA52F067996F13EF10D8 +uid  [ultimate] Seth Kenlon <[seth@example.com][7]> +sub  cv25519 2022-01-06 [E] [expires: 2024-01-06] +``` + +用指纹初始化密码库与用你的名字初始化密码库基本相同: + +``` +$ pass init 2BFF94286461216C907CBA52F067996F13EF10D8 +``` + +### 存储密码 + +使用 `pass add` 命令添加密码到你的密码仓库: + +``` +$ pass add [www.example.com][8] +Enter password for [www.example.com][8]: +``` + +提示你键入你要添加的密码。 + +密码现在存储到了你的密码仓库中。你可以自己查看一下: + +``` +$ ls /root/.password-store/ +www.example.com.gpg +``` + +当然,这个文件是不可读的,并且你尝试对它运行 `cat` 或 `less` 时,在你的终端上会显示乱码(如果扰乱了你的显示,可以使用 `reset` 命令来恢复你的终端。) + +### 用 pass 编辑密码 + +我使用不同的用户名称进行不同的上网活动,所以网站的用户名常常和密码同样重要。`pass` 是有这个功能的,即使它默认状态下并不提示你。你可以使用 `pass edit` 命令添加用户名到密码文件: + +``` +$ pass edit www.example.com +``` + +这会打开一个编辑器(一般是你设置为 `EDITOR` 或者 `VISUAL` [环境变量][10] 的编辑器) 显示 `www.example.com` 文件的内容。目前,那仅仅是一个密码,但是你可以添加用户名甚至网址或者你想要添加的任何信息。它是个加密了的文件,所以你可以把你要放的任何东西放到里边。 + +``` +bd%dc$3a49af49498bb6f31bc964718C +user: seth123 +url: example.com +``` + +保存文件然后关闭。 + +### 从 pass 获取密码 + +要查看密码文件的内容,使用 `pass show` 命令: + +``` +$ pass show www.example.com +bd%dc$3a49af49498bb6f31bc964718C +user: seth123 +url: www.example.org +``` + +### 查找密码 + +有时候很难记住一个密码是归入到 `www.example.com` 还是 `example.com`,又或者一些类似 `app.example.com` 的网址。此外,一些网站架构使用不同的 URL 来实现不同的网站功能,所以你可能在 `www.example.com` 网址下填写过密码,你同时也用相同的登录信息在合作网站 `www.example.org` 下使用过密码。 + +如果有疑问,可以使用 `grep` 命令。`pass grep` 命令显示整个搜索项目的实例,无论是在文件名中还是在文件内容中: + +``` +$ pass grep example +www.example.com: +url: www.example.org +``` + +### 在浏览器中使用 pass + +我使用 `pass` 来获取互联网密码以外的信息,但是网站是我经常需要密码的地方。我常常在电脑上的某个地方打开一个终端,所以我通过 `Alt+Tab` 键切换到终端用 `pass` 来获取信息并不麻烦。但是我并不这么做是因为有一些插件可以将 `pass` 与网页浏览器整合在一起。 + +#### pass 托管脚本 + +首先,安装 `pass` 托管脚本: + +``` +$ curl -sSL github.com/passff/passff-host/release/latest/download/install_host_app.sh +``` + +这个脚本放置了一个 Python 脚本,帮助你的浏览器访问你的密码和 GPG 密码。用你所用的浏览器的名字运行它(或者不写参数,查看全部选项): + +``` +$ bash ./install_host_app.sh firefox +``` + +如果你使用多个浏览器,你可以为每一个浏览器安装它。 + +#### pass 附件 + +一旦你已经安装了这个托管程序,你可以为你的浏览器安装一个附件或者扩展。在你的浏览器附件或者扩展管理器里搜索 `PassFF` 插件。 + +![PassFF][12] + +安装了这个附件,然后关闭并重新打开浏览器。 + +导航到一个你在密码仓库中存有密码的网站。在你的登录文本框右侧会显示一个小小的 “P” 图标。 + +![PassFF browser prompt][14] + +点击 “P” 按钮会看到你的密码仓库中与你网站名称匹配的一个列表。 + +![PassFF browser menu][15] + +点击“纸和笔”的图标填写表单,或者通过“纸飞机”的图标填写并自动提交表单。 + +轻松的密码管理,而且完全整合了! + +### 尝试用 pass 作为你的 Linux 密码管理器 + +对于那些想用日常使用的工具来管理密码和个人信息的用户来说,`pass` 命令是一个很好的选择。如果你已经依赖 GPG 和终端,那么你可能会喜欢 `pass` 系统。对于那些不想让他们的密码被束缚在特定程序上的用户来说,这也是一个重要的选择。可能你并不只使用一个浏览器,或者你不喜欢这种想法,即如果你决定停止使用一个应用程序,可能很难从它那里提取你的密码。使用 `pass` ,你可以在一个 UNIX 式的直接系统中保持对你的秘密的控制。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/1/manage-passwords-linux-terminal + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: http://bitwarden.com +[3]: https://www.passwordstore.org/ +[4]: https://opensource.com/article/20/6/homebrew-mac +[5]: https://gpgtools.org/ +[6]: https://opensource.com/article/20/11/macports +[7]: mailto:seth@example.com +[8]: http://www.example.com +[9]: http://www.example.com.gpg +[10]: https://opensource.com/article/19/8/what-are-environment-variables +[11]: http://www.example.org +[12]: https://opensource.com/sites/default/files/uploads/passff.jpg (PassFF) +[13]: https://creativecommons.org/licenses/by-sa/4.0/ +[14]: https://opensource.com/sites/default/files/uploads/passff-button-web.jpg (PassFF browser prompt) +[15]: https://opensource.com/sites/default/files/uploads/passff-menu-web.jpg (PassFF browser menu) diff --git a/published/202204/20220201 View your Linux server-s network connections with netstat.md b/published/202204/20220201 View your Linux server-s network connections with netstat.md new file mode 100644 index 0000000000..ab021f1e42 --- /dev/null +++ b/published/202204/20220201 View your Linux server-s network connections with netstat.md @@ -0,0 +1,174 @@ +[#]: subject: "View your Linux server's network connections with netstat" +[#]: via: "https://opensource.com/article/22/2/linux-network-security-netstat" +[#]: author: "Sahana Sreeram https://opensource.com/users/sahanasreeram01gmailcom" +[#]: collector: "lujun9972" +[#]: translator: "hwlife" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14461-1.html" + +使用 netstat 查看你的 Linux 服务器网络连接 +====== + +> netstat 命令为你的 Linux 服务器提供了监测和网络故障排除的重要观察手段。 + +![](https://img.linux.net.cn/data/attachment/album/202204/12/095932h99fuqzd7y9y4f48.jpg) + +在 [之前的文章中][2],我分享了一些管理你的个人 Linux 服务器的首要步骤。我简要的提到了监测网络连接的监听端口,我想通过 Linux 系统的 `netstat` 命令来扩展开讲讲。 + +服务监测和端口扫描是标准的行业惯例。有很好的软件,如 [Prometheus][3] 协助这个过程自动化,[SELinux][4] 协助上下文和保护系统访问权限。然而,我相信了解你的服务器是如何连接到其他网络和设备的,是建立正常服务器基准的关键,能够帮助你识别有可能表明错误和入侵等异常情况。作为一个初学者,我已经掌握了 `netstat` 命令为我的服务器提供了监测和网络故障排除的重要观察手段。 + +`netstat` 和类似的一些网络监测工具被归入 [net-tools 软件包][5] 里,用来显示关于活动连接的信息。因为运行在开放的端口的服务往往容易被利用,定期进行网络监测能够帮助你及早探测到可疑的活动。 + +### 安装 netstat + +`netstat` 经常预装在 Linux 发行版上。如果 `netstat` 没有在你的服务器上安装,用你的包管理器安装它。下面是在基于 Debian 的系统上: + +``` +$ sudo apt-get install net-tools +``` + +在基于 Fedora 的系统上: + +``` +$ dnf install net-tools +``` + +### 使用 netstat + +就其本身而言,`netstat` 命令显示了全部建立成功的连接。你可以使用 `netstat` 的参数指定进一步预期的输出。举个例子,要显示所有监听和非监听的连接,使用 `--all`(`-a` 为简写)的参数。这将返回许多结果,所以在例子中我用管道符输出给 `head` 命令来显示输出的前 15 行: + +``` +$ netstat --all | head -n 15 +Active Internet connections (servers and established) +Proto Recv-Q Send-Q Local Address Foreign Address State +tcp 0 0 *:27036 *:* LISTEN +tcp 0 0 localhost:27060 *:* LISTEN +tcp 0 0 *:16001 *:* LISTEN +tcp 0 0 localhost:6463 *:* LISTEN +tcp 0 0 *:ssh *:* LISTEN +tcp 0 0 localhost:57343 *:* LISTEN +tcp 0 0 *:ipp *:* LISTEN +tcp 0 0 *:4713 *:* LISTEN +tcp 0 0 10.0.1.222:48388 syd15s17-in-f5.1e:https ESTABLISHED +tcp 0 0 10.0.1.222:48194 ec2-35-86-38-2.us:https ESTABLISHED +tcp 0 0 10.0.1.222:56075 103-10-125-164.va:27024 ESTABLISHED +tcp 0 0 10.0.1.222:46680 syd15s20-in-f10.1:https ESTABLISHED +tcp 0 0 10.0.1.222:52730 syd09s23-in-f3.1e:https ESTABLISHED +``` + +要只显示 TCP 端口,使用 `--all` 和 `--tcp` 参数,或者简写成 `-at` : + +``` +$ netstat -at | head -n 5 +Active Internet connections (servers and established) +Proto Recv-Q Send-Q Local Address Foreign Address State +tcp 0 0 *:27036 *:* LISTEN +tcp 0 0 localhost:27060 *:* LISTEN +tcp 0 0 *:16001 *:* LISTEN +``` + +要只显示 UDP 端口,使用 `--all` 和 `--udp` 参数,或者简写成 `-au` : + +``` +$ netstat -au | head -n 5 +Active Internet connections (servers and established) +Proto Recv-Q Send-Q Local Address Foreign Address State +udp 0 0 *:27036 *:* +udp 0 0 10.0.1.222:44741 224.0.0.56:46164 ESTABLISHED +udp 0 0 *:bootpc +``` + +`netstat` 命令参数常常是简单易懂的。举个例子,要显示带有全部进程 ID(PID)和数字地址的监听 TCP 和 UDP 的端口: + +``` +$ sudo netstat --tcp --udp --listening --programs --numeric +Active Internet connections (only servers) +Proto Recv-Q Send-Q Local Address Foreign Addr State PID/Program name +tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd +tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 2500/dnsmasq +tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1726/sshd +tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1721/cupsd +tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 4023/sshd: tux@ +tcp6 0 0 :::111 :::* LISTEN 1/systemd +tcp6 0 0 :::22 :::* LISTEN 1726/sshd +tcp6 0 0 ::1:631 :::* LISTEN 1721/cupsd +tcp6 0 0 ::1:6010 :::* LISTEN 4023/sshd: tux@ +udp 0 0 0.0.0.0:40514 0.0.0.0:* 1499/avahi-daemon: +udp 0 0 192.168.122.1:53 0.0.0.0:* 2500/dnsmasq +udp 0 0 0.0.0.0:67 0.0.0.0:* 2500/dnsmasq +udp 0 0 0.0.0.0:111 0.0.0.0:* 1/systemd +udp 0 0 0.0.0.0:5353 0.0.0.0:* 1499/avahi-daemon: +udp6 0 0 :::111 :::* 1/systemd +udp6 0 0 :::44235 :::* 1499/avahi-daemon: +udp6 0 0 :::5353 :::* 1499/avahi-daemon: +``` + +这个常用组合简写版本是 `-tulpn` 。 + +要显示一个指定服务的信息,[使用 grep 命令过滤][6]: + +``` +$ sudo netstat -anlp | grep cups +tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1721/cupsd tcp6 0 0 ::1:631 :::* LISTEN 1721/cupsd +unix 2 [ ACC ] STREAM LISTENING 27251 1/systemd /var/run/cups/cups.sock +unix 2 [ ] DGRAM 59530 1721/cupsd +unix 3 [ ] STREAM CONNECTED 55196 1721/cupsd /var/run/cups/cups.sock +``` + +### 接下来的步骤 + +一旦你运行了 `netstat` 命令,你就可以采取措施来保护你的系统,确保只有你主动使用的服务在你的网络上被监听。 + + 1. 识别通常被利用的端口和服务。一般来说,关闭你实际不使用的端口。 + 2. 留意不常见的端口号,认识了解在你系统上使用的合法端口。 + 3. 密切注意 SELinux 错误。有时你需要做的只是更新上下文,以匹配你对系统做的合法更改,但是要阅读错误警告,以确保 SELinux 提醒你的不是可疑或者恶意的活动。 + +如果你发现一个端口正在运行一个可疑的服务,或者你只是简单的想要关闭你不再使用的端口,你可以遵从以下这些步骤,通过防火墙规则手动拒绝端口访问: + +如果你在使用 `firewall-cmd` ,运行这些命令: + +``` +$ sudo firewall-cmd –remove-port=/tcp +$ sudo firewall-cmd –runtime-to-permanent +``` + +如果你在使用 UFW,运行以下的命令: + +``` +$ sudo ufw deny +``` + +下一步,使用 `systemctl` 来停止这个服务: + +``` +$ systemctl stop +``` + +### 理解 netstat + +`netstat` 是一个快速收集你的服务器网络连接信息的有用工具。定期网络监测是了解你的系统的重要组成部分,对帮助你保持你的系统安全有着重要意义。将这一步纳入你的日常管理中,你可以使用类似 `netstat` 或者 `ss` ,以及 [Nmap 等开源端口扫描器或者 Wireshark 等嗅探器][7] ,它们都允许设定 [计划任务][8]。 + +随着服务器存储了大量的个人数据,确保个人服务器的安全日益重要。通过了解你的服务器怎样连接到互联网,你可以降低你的机器的风险,同时你仍可以在数字时代大量的连接中获得益处。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/2/linux-network-security-netstat + +作者:[Sahana Sreeram][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sahanasreeram01gmailcom +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rack_server_sysadmin_cloud_520.png?itok=fGmwhf8I (A rack of servers, blue background) +[2]: https://opensource.com/article/21/4/securing-linux-servers +[3]: https://opensource.com/article/19/11/introduction-monitoring-prometheus +[4]: https://opensource.com/business/13/11/selinux-policy-guide +[5]: http://sourceforge.net/projects/net-tools/ +[6]: https://opensource.com/article/21/3/grep-cheat-sheet +[7]: https://redhat.com/sysadmin/troubleshoot-dhcp-nmap-tcpdump-and-wireshark +[8]: https://opensource.com/article/22/2/redhat.com/sysadmin/nmap-scripting-engine diff --git a/published/202204/20220202 Read and Organize Markdown Files in Linux Terminal With Glow.md b/published/202204/20220202 Read and Organize Markdown Files in Linux Terminal With Glow.md new file mode 100644 index 0000000000..52a0325346 --- /dev/null +++ b/published/202204/20220202 Read and Organize Markdown Files in Linux Terminal With Glow.md @@ -0,0 +1,129 @@ +[#]: subject: "Read and Organize Markdown Files in Linux Terminal With Glow" +[#]: via: "https://itsfoss.com/glow-cli-tool-markdown/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "hwlife" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14457-1.html" + +用 Glow 在 Linux 终端阅读和管理 Markdown 文件 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/11/151437wdzjaetardciedt1.jpg) + +> Glow 是一个能让你在 Linux 终端渲染 Markdown 文件的命令行工具。你也可以用它来管理 Markdown 文件。 + +我喜欢 Markdown。虽然我不是一个专业的 Markdown 用户,但我几乎用 Markdown 写我的大部分文章。 + +如果你是我们的常客,你可能已经看到过 [Markdown 指南][1]、编辑器以及 Obsidian 之类的工具。我将再加个工具到这个名单中,它叫做 [Glow][2],并且不像之前涵盖的程序,Glow 能够让你在终端里阅读 Markdown 文件。 + +等等!难道不能在终端里使用 [阅读文本文件的常规 Linux 命令][3],如 `cat`、`less`,甚至是像 Vim 之类的编辑器来阅读 Markdown 文件吗? + +当然可以。但它会原样显示所有的代码来显示原始的 Markdown 文件,而不是显示正确的格式化文本。 + +![Glow renders the Markdown file][4] + +注意:Glow 不是一个编辑器。你不能用它去编写 Markdown 文本。 + +### Markdown 爱好者将会喜欢 Glow 的功能 + +Glow 可以用两种格式来使用:[命令行界面和终端用户界面][5]。 + +简单的对一个 Markdown 文件使用 Glow 命令将在屏幕上显示整个渲染后的内容。 + +``` +glow markdown_file +``` + +![Markdown display with Glow][6] + +这是很不错,但是 Glow 可以做的更好。它有额外的参数打开终端用户界面terminal user interface(TUI)模式,并且允许你用它来做更多的事情。 + +你可以使用页面参数(`-p`)来在页面模式下显示渲染后的文本(类似 `less` 命令显示文本没有弄乱屏幕一样)。 + +``` +glow -p markdown_file +``` + +在页面视图中,你可以使用 `less` 命令相同的方法,使用 `/` 键来搜索特定的文本。你可以按下`q` 键退出这个视图。 + +![Pager view similar to the less command][7] + +不止这些。你可以使用 `-a` 选项,它将查找当前目录及子目录中的所有 Markdown 文件。 + +``` +glow -a +``` + +你可以用方向键在屏幕上滚动文件。上下键向上和向下移动,左右键按照页数移动。 + +![With -a option, Glow finds and displays all Markdown files in current directory][8] + +你可以查看显示在底部的帮助选项。在这个视图中,查找选项允许你根据文件名查找文件(不是它们的内容)。 + +![You can search files by their name][9] + +这里也有标签。当然,你可以通过 `Tab` 键在标签中来回移动。 + +隐藏stashed标签像一个书签。当你浏览文件或是查看它们的内容时,你可以按下 `s` 键来创建一个隐藏标签(书签)。这个书签将只会在当前目录下可见。 + +你可以按下 `x` 键来移除书签(不是文件)或者按下 `m` 键来添加一个备注。 + +![You can bookmark files by stashing them with s key][10] + +新闻news标签显示更新日志和来自 Glow 开发者(们)的其他消息。 + +![The news tab shows messages from the developers][11] + +当你已经找到你想找的文件,你可以通过按下回车键来查看它们。因为你在终端用户界面模式,所以你这里会有额外的键盘选项。可以通过按下 `?` 键来显示选项。 + +![You can view keyboard shortcuts by pressing the ? key][12] + +### 在 Linux 上安装 Glow + +Glow 可以在 Linux 和 macOS 上使用。你可以在 macOS 和 [Linux 上使用 Homebrew][13] 来安装它,然而,我建议你在这里使用 Linux 安装包。 + +Glow 在 Void、Solus 和 Arch Linux 的仓库里是可用的。你可以用它们的包管理器来安装它们。 + +在基于 Arch 的发行版上,使用: + +``` +sudo pacman -S glow +``` + +对于 Ubuntu、Debian、Fedora 和 SUSE,它们有用于在各种架构的 .DEB 和 .RPM 二进制包,你可以在它们的发布页找到它们。 + +> [下载用于其它 Linux 发行版的 Glow][14] + +### 总结 + +总之,Glow 是在终端里的一个美化视图和管理 Markdown 的便利工具。像许多其他的命令行工具一样,它不是每个人都适合。如果你经常在终端,并喜欢 Markdown 文件,你可以尝试使用一下。当你用过后,请在评论区里分享你使用它的体验。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/glow-cli-tool-markdown/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/markdown-guide/ +[2]: https://github.com/charmbracelet/glow +[3]: https://linuxhandbook.com/view-file-linux/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/markdown-display-with-cat.png?resize=1572%2C962&ssl=1 +[5]: https://itsfoss.com/gui-cli-tui/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/markdown-display-with-glow.png?resize=800%2C490&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/pager-view-with-glow.png?resize=800%2C451&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/glow-collection.png?resize=800%2C451&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/find-files-in-glow.png?resize=800%2C451&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/stash-feature-glow.png?resize=800%2C374&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/glow-news-tab.png?resize=800%2C451&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/display-help-in-file-view-in-glow.png?resize=800%2C490&ssl=1 +[13]: https://itsfoss.com/homebrew-linux/ +[14]: https://github.com/charmbracelet/glow/releases diff --git a/published/202204/20220209 Give Your Linux Mint and Xubuntu a Visual Uplift Using Twister UI.md b/published/202204/20220209 Give Your Linux Mint and Xubuntu a Visual Uplift Using Twister UI.md new file mode 100644 index 0000000000..73bbee1316 --- /dev/null +++ b/published/202204/20220209 Give Your Linux Mint and Xubuntu a Visual Uplift Using Twister UI.md @@ -0,0 +1,153 @@ +[#]: subject: "Give Your Linux Mint and Xubuntu a Visual Uplift Using Twister UI" +[#]: via: "https://www.debugpoint.com/2022/02/twister-ui-2022/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14494-1.html" + +使用 Twister UI 提升你的 Linux Mint 和 Xubuntu 视觉感受 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/21/172213ts2x6e1g4lwatv54.jpg) + +> Twister UI 是给你的 Linux Mint 和 Xubuntu 提供视觉提升的最简单方法。以下是方法。 + +[Twister UI][1] 可以安装在已有的 Linux Mint 和 Xubuntu 系统上。Pi 实验室创造了这个用户界面,他们为树莓派和相关硬件开发了 [Twister OS][2]。 + +### Twister UI + +Twister UI 是一套用于 [Linux Mint][3] 和 Xubuntu 的软件包集合,它带来了几个流行的操作系统特定的主题和配置,开箱即用。你只需点击一个按钮就可以应用它们,而不需要单独下载图标、主题或光标。 + +其最新版本提供了以下操作系统的开箱即用的桌面主题、图标、声音和其他设置变化。 + + * 原生 Twister 操作系统主题 + * Windows 98、Windows 7、Windows XP + * Windows 11、Windows 10 + * iTwister 和 iTwister Sur(类似 macOS) + +#### 它是如何工作的? + +该团队提供了自动脚本,从 GitHub 下载所有流行的操作系统特定的主题、声音等。然后该脚本修改它们,从 Ubuntu 仓库下载额外的包,并整体安装这个附加组件。安装程序自己负责安装一切,你需要做的就是等待。 + +在向你解释如何安装之前,让我们看看这个操作系统增强模组MOD的一些截图和功能。这些截图来自应用了这个操作系统增强模组的 Linux Mint Xfce 版。 + +#### 它的外观(截图) + +![Twister UI – macOS Theme][4] + +![Twister UI – Windows XP Theme][5] + +![native Twister OS theme][6] + +#### Twister UI 软件包的内容 + +该软件包有它自己的设置应用,名为 ThemeTwister。你可以用它来快速切换主题。你可以随心所欲地在它们之间转换,而不会破坏什么。 + +该项目还默认安装了一些优秀的开源软件包。它安装了 Lutris、Steam 游戏平台以帮助你快速玩游戏。它还为用户安装了 Discord、Wine 模拟器。 + +正如你所看到的,考虑到这个附加组件的用户群,该团队仔细斟酌了要安装哪些软件包。 + +### 如何安装 + +如果你打算安装这个,我建议在 Linux Mint Xfce 版和 Xubuntu 中使用这个包。不要试图在其他 Linux 发行版中安装它(我在阅读文档之前就试过了,我把我的 Fedora 系统搞得一团糟,所以不要在其他发行版中尝试)。 + +其要求是安装在 Linux Mint Xfce 或 Xubuntu(无论是 32 位还是 64 位)。它还需要大约 5GB 的磁盘空间。 + +首先,从下面的链接中下载该软件包,其中包含 Torrent 链接。它不是一个 ISO 文件。它由三个文件组成,其中一个是实际的脚本。 + +> [下载 Twister UI][1] + +下载完毕后,打开下载的文件夹,你应该看到一个扩展名为 `.run` 的文件(如下图所示)。 + +![Give the execute permission to the run file][7] + +改变该文件的权限,使其可执行。然后通过终端运行它。 + +该脚本需要管理员密码,所以在要求时就提供这个密码。在你开始安装之前,请确保你有稳定的网络连接,以便随时下载其他软件包。 + +![Starting the installation script][8] + +下载和安装需要一些时间。这取决于你的网速,可能需要 15 到 20 分钟左右。 + +你需要知道,该安装程序将取代默认的 Plymouth ,并会 [更新 initramfs][9]。 + +安装完成后,脚本应该会提示你重新启动。 + +重启后,登录到你的 Linux Mint Xfce 或 Xubuntu 系统。 + +### 如何改变主题 + +如果你使用的是 Linux Mint Xfce 版,在改变主题之前,你需要做以下额外的改变以获得最佳效果: + + * 打开“应用程序菜单Application Menu > 设置Settings > 桌面Desktop”,在“图标Icon”标签下,取消勾选“使用自定义字体大小Use custom font size”。 + * 打开“应用程序菜单Application Menu > 设置Settings > 窗口管理器调整Window Manager tweaks”,在“合成器Compositor”标签下,取消勾选“在停靠窗口下显示阴影Show shadows under dock windows”。 + +现在你应该在桌面上看到一个 “ThemeTwister” 图标,打开该应用。这个应用为你提供了改变主题的选项,如下图所示。 + +![Changing theme using ThemeTwister tool][10] + +选择一个主题并点击相应的按钮。每次你改变或应用一个主题时,该脚本都会要求你注销。所以在改变主题之前,请确保你关闭所有的程序。 + +### 如何卸载 + +如果你完成后想卸载,那么打开终端,运行下面的 shell 脚本。 + +``` +sh /usr/share/ThemeSwitcher/uninstall.sh +``` + +上述脚本只卸载了 Twister UI 组件,并没有卸载 Steam、Lutris 等。所以如果你想卸载,请使用软件管理器来卸载它们。 + +如果你在卸载后做一次重启,那是最好的。 + +### 评测和性能 + +根据 Pi 实验室的说明,该定制应该不会消耗太多的额外内存。这也是事实。 + +该定制对桌面性能影响不大。当我在 Linux Mint Xfce 版的空闲模式下运行一到两项定制时,它消耗了大约 740MB 的内存,CPU 大约 2% 到 3%。这本身就令人印象深刻。使用它的唯一代价是额外的磁盘空间。 + +![Resource Usage in Linux Mint with Twister UI][11] + +主题切换器非常好,完美地改变了主题,没有意外和错误。 + +总的来说,整个过程是无痛的,按照其设计进行得很好。 + +### 总结 + +你可以下载单独的主题图标,改变设置,手动配置你的 Linux 发行版,使其看起来像 Windows 或 macOS。这需要很多时间,有时对新用户来说也很困难。考虑到这一点,我认为这种新方法可以节省时间,对每个人来说都非常容易。你只需点击一个按钮,就可以得到所有需要的增强模组。 + +总有一种争论,为什么 Linux 需要看起来像 Windows 或 macOS。但老年人可能不太熟悉电脑,不过他们记得 Windows 的颜色和图标。他们可以使用这种简单的修改来适应 Linux,而不会有任何麻烦。 + +总的来说,这是一个来自 Pi 实验室的优秀项目,可以帮助到全世界的许多用户。 + +那么,你对这个项目有什么看法?请在下面的评论栏里告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/02/twister-ui-2022/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://twisteros.com/twisterui.html +[2]: https://twisteros.com +[3]: https://www.debugpoint.com/2021/11/linux-mint-20-3-new-app/ +[4]: https://www.debugpoint.com/wp-content/uploads/2022/02/Twister-UI-macOS-Theme-1024x576.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/02/Twister-UI-Windows-XP-Theme-1024x574.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/02/native-Twister-OS-theme-1024x581.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/02/Give-the-execute-permission-to-the-run-file-1024x521.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/02/Starting-the-installation-script.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/02/Changing-theme-using-ThemeTwister-tool.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2022/02/Resource-Usage-in-Linux-Mint-with-Twister-UI-1024x579.jpg +[12]: https://t.me/debugpoint +[13]: https://twitter.com/DebugPoint +[14]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[15]: https://facebook.com/DebugPoint diff --git a/published/202204/20220214 How I configure Vim as my default editor on Linux.md b/published/202204/20220214 How I configure Vim as my default editor on Linux.md new file mode 100644 index 0000000000..f933119bef --- /dev/null +++ b/published/202204/20220214 How I configure Vim as my default editor on Linux.md @@ -0,0 +1,103 @@ +[#]: subject: "How I configure Vim as my default editor on Linux" +[#]: via: "https://opensource.com/article/22/2/configure-vim-default-editor" +[#]: author: "David Both https://opensource.com/users/dboth" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14475-1.html" + +我如何在 Linux 上把 Vim 配置为默认编辑器 +====== + +> Vim 是我最喜爱的编辑器。对于那些默认使用其他编辑器的程序,我对系统所做的这些改变可以使得 Vim 成为它们默认编辑器。 + +![](https://img.linux.net.cn/data/attachment/album/202204/15/172912fvtvpfff83r373yy.png) + +我使用 Linux 大概有 25 年了,在那之前我还使用了几年的 Unix。在这段时间里,我对一些日常使用的工具形成了偏好。Vim 是我使用的最重要的工具之一。 + +我在 90 年代初学习 Solaris 时,就开始使用 Vi 了,因为有人告诉我,它在任何系统上都能使用。从我的经验来看,确实是这样。我也试过其他编辑器,它们都能够胜任工作。但是,对于我来说,Vim 的使用效果最好。我经常使用它,以至于形成了肌肉记忆,甚至我在使用其他编辑器时也会下意识地去按 Vim 的快捷键。 + +另外,我只是单纯地喜欢 Vim 而已。 + +许多配置文件使用的名字是 Vi 而不是 Vim,你可以运行 `vi` 命令。不过,`vi` 命令其实是 `vim` 命令的一个链接。 + +许多 Linux 工具使用的编辑器都是在模拟或是直接调用的 [Nano][2]、[Emacs][3] 或者 Vim。其他的一些工具允许用户(比如那些有着明确偏好的用户)使用他们喜欢的编辑器。举两个对我影响最大的例子,一个是 Bash 命令行,它默认使用 Emacs;另一个是 Alpine 文本模式的邮件客户端,它默认使用 Pico。事实上,Pico 是专门为 Pine 邮件客户端编写的,而 Pine 是 Alpine 的前身。 + +并非所有使用外部编辑器的程序都是可配置的。有些程序只使用开发者指定的编辑器。对于那些可配置的应用程序,有不同的方法来选择你喜欢的编辑器。 + +### 在 Linux 命令行中编辑 + +除了实际编辑文本文件外,另一个我经常使用,且和编辑密切相关的工具是 Bash shell。Bash 的默认编辑器是 Emacs。虽然我也用过 Emacs,但我肯定更喜欢 Vim。所以很多年前,我把 Bash 命令行的默认编辑器从 Emacs 换成了 Vim,这对我来说更舒服。 + +有很多种方法可以配置 Bash。你可以使用一个本地配置文件,比如 `/home/yourhomedirectory/.bashrc`,它只对你的用户账户进行默认修改,而不对同一系统的其他用户进行修改。我个人倾向于让这些改变成为全局性的,基本上就是我的个人账户和 root。如果你也想全局配置,你可以创建你自己的配置文件,并把它放在 `/etc/profile.d` 目录中。 + +我在 `/etc/profile.d` 中添加了一个名为 `myBashConfig.sh` 的文件。`/etc/profile.d` 目录中存放了所有已安装的 shell 的启动文件。在启动终端会话时,每个 shell 仅会根据文件名的扩展名,读取为其准备的启动文件。例如,Bash shell 只读取扩展名为 `.sh` 的文件。 + +``` +<截断> +alias vim='vim -c "colorscheme desert" ' +# 把 vi 设置为 Bash 的默认编辑器 +set -o vi +# 为所有检查 $EDITOR 变量的程序设置默认编辑器为 vi +EDITOR=vi +<截断> +``` + +在这个全局 Bash 配置文件段中,`set -o vi` 将 Vi 设置为默认编辑器。这个 `set` 命令中的 `-o` 选项将 `vi` 定义为编辑器。为使配置生效,你需要关闭所有正在运行的 Bash 会话,并打开新的会话。 + +现在,你现在可以使用所有你熟悉的 Vim 命令,包括光标移动。只要按下 `Esc` 键就可以进入 Vim 编辑模式。我特别喜欢多次使用 `b` 将光标移回多个字的功能。 + +### 将 Vim 设置为其他程序的默认值 + +一些 Linux 命令行工具和程序会检查 `$EDITOR` 环境变量来决定使用哪个编辑器。你可以用下面的命令检查这个变量的当前值。我在一个新安装的虚拟机上运行过该命令,以查看默认的编辑器到底是什么。 + +``` +# echo $EDITOR +/usr/bin/nano +# +``` + +默认情况下,检查 `$EDITOR` 环境变量的 Fedora 程序会使用 Nano 编辑器。在 `myBashConfig.sh` 中添加一行 `EDITOR=vi`(如上面的片段所示),可以将默认值改为 Vi(Vim)编辑器。然而,不是所有使用外部编辑器的命令行程序都会检查这个环境变量。 + +### 在 Alpine 中编辑电子邮件 + +几周前,我认为 Pico 不太适合作为我的电子邮件编辑器。我可以使用它,而且在从 Thunderbird 转到 [Alpine][4] 之后的一段时间内我也用了一段时间。但我发现,Pico 妨碍了我,我总是习惯使用 Vim 按键序列,这影响了我的工作效率。 + +我在 Alpine 的用户帮助中看到,默认编辑器是可以修改的。我决定把它改成 Vim。实际上这很容易做到。 + +在 Alpine 主菜单上,按 `S` 键进入设置,然后按 `C` 键进行配置。在 “编辑器设置Composer Preferences” 部分,按 `X` 选择 “启用外部编辑器命令Enable Alternate Editor Command” 和 “隐式启用外部编辑器Enable Alternate Editor Implicitly” 项目。在往下滚动几页的 “高级用户设置Advanced User Preferences” 部分,找到 `Editor 那一行。如果它还没有被修改的话,它应该是这样的: + +``` +Editor    = +``` + +用光标栏突出显示 `Editor` 这一行,然后按回车键来编辑。将 `` 改为 `vim`,再按回车键,然后按 `E` 键退出,最后按 `Y` 键保存修改。 + +要用 Vim 编辑电子邮件,只需进入电子邮件正文,Vim 就会自动启动,就像 Pico 那样。所有我喜欢的编辑功能都还在,因为它实际上是在使用 Vim。甚至退出 Vim 的 `Esc :wq` 序列也是一样的。 + +### 总结 + +与其他编辑器相比,我更喜欢 Vim,对我的系统进行的这些改动后,那些默认使用其他编辑器的应用程序,将使用 Vim 来替代它们的默认编辑器。有些程序使用 `$EDITOR` 环境变量,因此你只需要做一次修改就够了。其他有用户配置选项的程序,如 Alpine,则必须为每个程序单独设置。 + +这种可以选择你喜欢的外部编辑器的能力,非常符合 Unix 哲学的宗旨:“每个程序都只做一件事,而且要做得出色”。既然已经有几个优秀的编辑器,为什么还要再写一个呢?而且它也符合 Linux 哲学的宗旨:“使用你最喜欢的编辑器”。 + +当然,你可以把你的默认文本编辑器改为 Nano、Pico、Emacs 或任何其他你喜欢的编辑器。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/2/configure-vim-default-editor + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://opensource.com/article/20/12/gnu-nano +[3]: https://opensource.com/tags/emacs +[4]: https://opensource.com/article/21/5/alpine-linux-email diff --git a/published/202204/20220215 Manage your calendar from the Linux terminal with the konsolekalendar command.md b/published/202204/20220215 Manage your calendar from the Linux terminal with the konsolekalendar command.md new file mode 100644 index 0000000000..370909af4d --- /dev/null +++ b/published/202204/20220215 Manage your calendar from the Linux terminal with the konsolekalendar command.md @@ -0,0 +1,129 @@ +[#]: subject: "Manage your calendar from the Linux terminal with the konsolekalendar command" +[#]: via: "https://opensource.com/article/22/2/manage-calendar-linux-konsolekalender-kde" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14486-1.html" + +在 Linux 终端管理你的日历 +====== + +> KDE 很适合在 Linux 上进行基于终端的日程安排。konsolekalendar 命令让你从终端查看和管理 iCal 日历。 + +![](https://img.linux.net.cn/data/attachment/album/202204/18/161418rsp7x2evo6zl766v.jpg) + +我是一个 [KDE 用户][2],多年来我一直在 Plasma 桌面上进行着看似无尽的探索。如果你在公开场合问我,我可能会声称自己对我每天使用的桌面了如指掌。但实际上,我只是刚刚触及到表面而已。似乎每天我都能学到一个新的 KDE 技巧,让我的生活变得更轻松或更有趣,我最新的发现是 `konsolekalendar` 命令,它让你从终端查看和管理 iCal 日历。 + +### Akonadi + +Akonadi 项目是一个底层 KDE 框架,帮助 Plasma 桌面跟踪所有的个人信息管理器(PIM)数据。它主要是为开发者服务的,包括很多可以让程序员用来创建应用的库,通过这些程序你可以访问你的联系人、笔记、电子邮件、日历等等。Akonadi 中包括一些终端命令,比如 `akonadictl` 可以启动和停止 Akonadi 服务,但它们大多是为了排除故障。然而,`konsolekalendar` 是一个面向用户的命令,可以让你完全访问 Kontact 套件的所有数据,包括 KMail、Notes 和日历。 + +如果你正在运行 KDE 的 Plasma 桌面,那么你已经安装了 Kontact 套件。 + +![Kontact UI][3] + +你也安装好了 Akonadi 和它的工具,所以你所需要的基于终端的日历完成了! + +### 从终端查看你的日历 + +由于 [NextCloud][5] 和 [Radicale][6] 等项目的存在,你可以托管自己的 iCal 日历服务,或者你可能已经在流行的供应商(例如,Google)那里拥有一个 iCal 账户。当你使用 Kontact 管理日历时,你订阅了一个日历对象(用 Akonadi 的术语说是一个“集合collection”)。当你对你的本地日历进行更新时,这些变化会被送回你的 iCal 服务器以同步你的日历服务器和客户端。 + +无论你是否使用过 Kontact 的日历功能,你在 Kontact 中都有一些默认的日历对象。你有一个叫**个人日历**和**生日和纪念日**的日历对象。 + +以下是如何显示当天的日历(默认为**个人日历**): + +``` +$ konsolekalendar +Date: Saturday, January 15, 2022 + 10:00 AM - 11:00 AM +Summary: Covid booster shot +UID: 8d8a1e38-c88c-4d84-99e5-23... +---------------------------------- +Date: Saturday, January 15, 2022 + 12:00 PM - 01:00 PM +Summary: Lunch +UID: 7aa89a... +---------------------------------- +Date: Saturday, January 15, 2022 + 01:00 PM - 04:45 PM +Summary: Afternoon coding +UID: 9cde38b... +---------------------------------- +Date: Saturday, January 15, 2022 + 06:00 PM - 10:00 PM +Summary: Planescape game +UID: c73f7e98-722f-48a2-8006-66... +---------------------------------- +``` + +### 添加一个事件 + +要查看你订阅的所有日历,请使用 `--list-calendars` 选项: + +``` +$ konsolekalendar --list-calendars +---------------------------------- +3 - (Read only) Birthdays & Anniversaries +11 - Personal Calendar +60 - (Read only) Open Invitations +61 - (Read only) Declined Invitations +66 - Dnd +67 - Work +68 - Museum +``` + +左边的数字是日历的 ID。要添加一个事件到一个特定的日历,请使用 `--calendar` 选项,然后是日历 ID: + +``` +$ konsolekalendar --add --calendar 66 \ +--date 2022-01-16 \ +--time 20:00 --end-time 23:59 \ +--summary "Another game" \ +--description "Remember to bring dice" \ +Success: "Another game" inserted +``` + +### 删除一个事件 + +你也可以删除事件。每个事件都有一个唯一的 ID(UID),在每个事件列表的底部提供: + +``` +$ konsolekalendar --list +Date: Saturday, January 15, 2022 + 06:00 PM - 10:00 PM +Summary: Planescape game +UID: c73f7e98-722f-48a2-8006-66aa8ddcf789 +``` + +要删除一个事件,请使用 `--delete` 选项,同时使用 `--uid` 选项: + +``` +$ konsolekalendar --delete \ +--uid c73f7e98-722f-48a2-8006-66aa8ddcf789 +``` + +### 终端中的 Akonadi + +你用 `konsolekalendar` 所做的一切都会立即在 Akonadi 中执行,并在 Kontact 中得到同样快的反映。使用一个并不意味着你必须放弃另一个。由于它们共享 Akonadi 后端,两者查看和编辑相同的数据。`konsolekalendar` 命令是一项正在进行的工作。未来的计划包括与 Kontact 的笔记和日记部分的整合,而且还有很多比本文所涉及的更多的选项。如果你在使用 KDE 桌面,试试 `konsolekalendar`,体验一下终端的 PIM! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/2/manage-calendar-linux-konsolekalender-kde + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/calendar.jpg?itok=jEKbhvDT (Calendar close up snapshot) +[2]: https://opensource.com/article/17/5/7-cool-kde-tweaks-will-improve-your-life +[3]: https://opensource.com/sites/default/files/uploads/kontact.jpg (Kontact UI) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/article/21/1/nextcloud-productivity +[6]: https://radicale.org/v3.html diff --git a/published/202204/20220216 Archive files on your Linux desktop with Ark for KDE.md b/published/202204/20220216 Archive files on your Linux desktop with Ark for KDE.md new file mode 100644 index 0000000000..3b62f776de --- /dev/null +++ b/published/202204/20220216 Archive files on your Linux desktop with Ark for KDE.md @@ -0,0 +1,128 @@ +[#]: subject: "Archive files on your Linux desktop with Ark for KDE" +[#]: via: "https://opensource.com/article/22/2/archives-files-linux-ark-kde" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14453-1.html" + +使用 KDE 的 Ark 在 Linux 桌面上归档文件 +====== + +> 在 KDE 上创建、检查和扩展压缩的档案。 + +![](https://img.linux.net.cn/data/attachment/album/202204/10/110019yfqsy4hel2jqhs8h.jpg) + +当我完成一个项目时,我经常喜欢把为这个项目创建的所有文件放到一个档案中。这不仅可以 [节省空间][2],而且可以让这些文件远离我的视线,防止它们在我使用 [find][3] 和 [grep][4] 搜索我当前想要的文件时作为结果出现。一旦文件被归档,它们就会被你的文件系统视为一个单独的对象,这意味着你不能像浏览普通文件夹那样来浏览它们。你可以把它们解压缩来列出档案的内容,或者打开一个终端,运行适当的归档命令,比如 [tar][5] 命令。又或者你可以使用一个像 Ark 这样的应用程序来列出、预览、修改和管理你的档案。 + +### 在 Linux 上安装 Ark + +KDE Plasma 桌面预装了 Ark,你也可以从软件包管理器中获取。在 Fedora、Mageia 和类似的系统中,你可以运行: + +``` +$ sudo dnf install ark +``` + +在 Debian、Elementary 和类似的系统中,你可以运行: + +``` +$ sudo apt install ark +``` + +你也可以从 [Flathub][7] 上 [获取并安装它的 Flatpak 包][6]。 + +### 创建一个档案 + +熟悉归档的最好方法就是自己创建一个档案,然后探索它。所有的这些都可以通过 Ark 来完成。 + +首先,从你的应用程序菜单中启动 Ark,然后进入“档案Archive”菜单,选择“新建New”。 + +![用 Ark 创建一个新的档案][8] + +(图源 Seth Kenlon / [CC BY-SA 4.0][9]) + +给你的档案设置一个文件名,使用默认的压缩设置,并将档案保存到你的主目录。 + +Ark 不会自动创建空的档案,但在你设置好名称和位置后,只要你向其中添加文件,Ark 就会立即创建一个档案。 + +要向即将建立的档案中添加文件,只需将该文件拖入 Ark 窗口即可。 + +![档案中的内容][10] + +(图源 Seth Kenlon / [CC BY-SA 4.0][9]) + +归档有两个好处:合并和压缩。通过把文件添加到档案里,你将许多文件整合到了同一个地方。因为它们已经存在于档案中,所以,如果你想要摆脱这些文件的干扰,你完全以把原始的副本删除掉。 + +要查看你通过压缩文件节省了多少磁盘空间,你可以进入“档案Archive”菜单,选择“属性Properties”。它会显示出文件在归档前/后的大小,同时还有很多其他有用的元数据。 + +![档案的属性和元数据][11] + +(图源 Seth Kenlon / [CC BY-SA 4.0][9]) + +Ark 可以做的事情还有很多,但是现在先关闭 Ark,假装你已经使用完毕。你的档案会存放在你声明保存它的位置(在这个例子中,它的名字是 `example.tar.gz`,位于我的用户主目录中。) + +### 查看档案中的文件 + +Ark 可以打开任何档案,就像打开一个普通的文件夹一样。要在 Ark 中打开一个档案,只需在文件管理器中左键点击它(单击/双击,取决于你的系统设置)。你也可以右键点击它,并选择“用 Ark 打开Open with Ark”。 + +一旦档案在 Ark 中打开,你就可以在文件管理器中进行大部分操作,包括删除文件、添加新文件、预览文件内容等等。 + +### 从档案中删除文件 + +有时候,你会把一个文件放到一个你不需要的档案中。此时,当你想从档案中删除一个文件时,你可以右键单击该文件并选择“删除Delete”。 + +![右键菜单][12] + +(图源 Seth Kenlon / [CC BY-SA 4.0][9]) + +### 向档案中添加文件 + +向档案中添加文件是更加容易的。你只需从文件管理器中把该文件拖拽到 Ark 里。另外,你也可以选择 Ark 右键菜单中“添加文件Add Files”。 + +### 从档案中提取单个文件 + +当处理一个档案时,许多人会选择解开整个档案,然后寻找他们真正需要的一两个文件。对于小型档案,这勉强说得过去,但对于大型档案来说,这会占用你大量的时间和磁盘空间,哪怕只是暂时的。 + +有了 Ark,你可以只提取你需要的文件,只要把它们从 Ark 窗口拖到你要保存的地方就行。另外,你也可以选择右键菜单中的“提取Extract”。 + +### 预览档案中的文件 + +事实上,你并不总是需要提取文件。如果你只是需要快速查看一个文件,Ark 或许可以向你展示一个文件的预览,而不需要将其解压到你的硬盘上。 + +要预览一个文件,在 Ark 中双击它即可。 + +![在 Ark 中预览一个文件][13] + +(图源 Seth Kenlon / [CC BY-SA 4.0][9]) + +### 开始归档吧 + +在 Linux 桌面上管理档案是非常简单和直观的。Ark 是一个很好的归档工具,许多其他的 Linux 桌面也有类似的工具。因此,即使你不使用 Ark,其他类似的工具也能帮助到你。对我来说,归档很大程度上让我保持了文件的有条不紊、节约了磁盘空间。Ark 的存在使得我们可以很方便地和档案打交道。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/2/archives-files-linux-ark-kde + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) +[2]: https://opensource.com/article/21/11/linux-commands-convert-files +[3]: https://opensource.com/article/21/9/linux-find-command +[4]: https://opensource.com/article/21/3/grep-cheat-sheet +[5]: https://opensource.com/article/17/7/how-unzip-targz-file +[6]: https://opensource.com/article/21/11/install-flatpak-linux +[7]: https://flathub.org/apps/details/org.kde.ark +[8]: https://opensource.com/sites/default/files/ark-new.jpg (Creating a new archive in Ark) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://opensource.com/sites/default/files/ark-items.jpg (Items in an archive) +[11]: https://opensource.com/sites/default/files/ark-properties.jpg (Archive properties and metadata) +[12]: https://opensource.com/sites/default/files/ark-menu-click-right.jpg (Right-click menu) +[13]: https://opensource.com/sites/default/files/ark-preview.jpg (Previewing a file in Ark) diff --git a/published/202204/20220226 How to Configure Task Switcher in KDE Plasma Desktop.md b/published/202204/20220226 How to Configure Task Switcher in KDE Plasma Desktop.md new file mode 100644 index 0000000000..973738eba6 --- /dev/null +++ b/published/202204/20220226 How to Configure Task Switcher in KDE Plasma Desktop.md @@ -0,0 +1,137 @@ +[#]: subject: "How to Configure Task Switcher in KDE Plasma Desktop" +[#]: via: "https://www.debugpoint.com/2022/02/configure-task-switcher-kde/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14450-1.html" + +如何在 KDE Plasma 桌面上配置任务切换器 +====== + +> 本指南解释了如何在 KDE Plasma 桌面中配置任务切换器。 + +![Configure KDE Plasma Task Switcher][1] + +### 什么是任务切换器? + +[任务切换器][2] 是一个帮助你在当前桌面会话中切换打开的窗口或应用的组件。通常,当你按下 `Alt+Tab` 时,它会显示为一个图标列表。 + +![Thumbnail Grid Task Switcher][3] + +而这在 KDE Plasma 中是可以根据你的具体需要高度配置的。你可以定制它的外观、图标的排序、相同应用的分组等等。 + +### 改变 KDE Plasma 的任务切换器选项 + +打开“系统设置System Settings”。在“工作区Workspace”组下,点击“窗口管理Window Management > 任务切换器Task Switcher”。 + +在Main标签上,可视化Visualisation部分有一个下拉菜单。这个下拉菜单包含几个任务切换器选项,你可以尝试一下。 + +选择你喜欢的选项并点击“预览”按钮。如果你感到满意,那么你可以点击“应用Apply”按钮。 + +![Configure Task Switcher in KDE][4] + +这就是如何改变 KDE Plasma 桌面中的任务切换器的方法。 + +### 替代切换器 + +替代Alternative选项卡也包含同样的任务切换器的可视化选项。然而,你可以为替代方案配置集设置 `Alt+Tab` 以外的不同组合键。这样,你可以同时体验两组不同组合的任务切换器。 + +### 可视化 + +截至编写本指南时的 [KDE Plasma 5.24][5],有以下不同的任务切换器: + + * Breeze + * Breeze Dark + * Breeze Twilight + * Compact + * Fedora + * Grid + * Informative + * large Icons + * Small Icons + * Text Only + * Thumbnail Grid + * Thumbnails + +下面是上述任务切换器的截图。 + +![][6] + +![][7] + +![][8] + +![][9] + +![][10] + +![][11] + +![][12] + +![][13] + +![][14] + +现在,这就是 KDE Plasma 桌面中任务切换器的基本配置。现在我将解释它在以下情况下是如何表现的。 + +### 多显示器或显示屏中的任务切换器 + +如果你有一个多显示器(显示屏)环境,你不需要做任何事情。任务切换器将根据你的鼠标光标所在的位置显示出来。这意味着它将显示在活动显示器上。 + +### 任务切换器与相同的应用分组 + +你也可以在任务切换器中对相同的应用图标进行分组,以保持其简单明了。例如,如果你打开了多个 Dolphin 文件管理器实例,你可以选择下面的选项,在任务切换器的可视化中只出现一次 Dolphin 图标。 + +![Same application grouping][16] + +但你可能想知道如果只出现一次,如何在相同的应用实例中切换。你可以通过任务切换器中的 `Alt+\``(默认值)来切换相同的应用。下面是你可以根据你的需要和工作来改变的选项。 + +### 下载更多的任务切换器 + +如果你对上述所有的选项不满意,你可以通过同一个设置窗口从 KDE 商店下载更多的任务切换器。 + +点击上图标注 ❺ 的 “获取新的任务切换器Get New Task Switchers” ,选择你最喜欢的一个。然后点击“安装Install”。完成安装后,回到主设置窗口,应用新下载的可视化。 + +记住,这些额外的项目是用户贡献的,在某些情况下可能会破坏你当前的主题,所以要慎重使用。在任何时候,你都可以点击重置按钮,回到原来的任务切换器视觉效果。 + +### 结束语 + +我希望这篇指南能帮助你在 KDE Plasma 桌面上设置一个漂亮而有效的任务切换器。正如我所说的,自定义选项很多,你可以随意发挥。 + +感谢阅读。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/02/configure-task-switcher-kde/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/wp-content/uploads/2022/02/kdetaskw1-1024x576.jpg +[2]: https://docs.kde.org/trunk5/en/kwin/kcontrol/kwintabbox/index.html +[3]: https://www.debugpoint.com/wp-content/uploads/2022/02/Thumbnail-Grid-1024x177.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/02/Configure-Task-Switcher-in-KDE-1024x652.jpg +[5]: https://www.debugpoint.com/2022/01/kde-plasma-5-24/ +[6]: https://www.debugpoint.com/wp-content/uploads/2022/02/Thumbnails-150x150.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/02/Thumbnail-Grid-150x150.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/02/Text-Only-150x150.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/02/Small-Icons-150x108.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/02/Large-Icons-150x150.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2022/02/Informative-150x150.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2022/02/Grid-Task-Switcher-150x150.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2022/02/Compact-Task-Switcher-150x150.jpg +[14]: https://www.debugpoint.com/wp-content/uploads/2022/02/Breeze-Task-Switcher-150x150.jpg +[16]: https://www.debugpoint.com/wp-content/uploads/2022/02/Same-application-grouping.jpg +[17]: https://t.me/debugpoint +[18]: https://twitter.com/DebugPoint +[19]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[20]: https://facebook.com/DebugPoint diff --git a/published/202204/20220226 My favorite casual games to play on Linux.md b/published/202204/20220226 My favorite casual games to play on Linux.md new file mode 100644 index 0000000000..dbab553478 --- /dev/null +++ b/published/202204/20220226 My favorite casual games to play on Linux.md @@ -0,0 +1,81 @@ +[#]: subject: "My favorite casual games to play on Linux" +[#]: via: "https://opensource.com/article/22/2/casual-gaming-linux-kde" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "perfiffer" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14435-1.html" + +我最喜欢在 Linux 上玩的休闲游戏 +====== + +> 在编译开源代码的同时在 Linux 上玩电子游戏。 + +![](https://img.linux.net.cn/data/attachment/album/202204/05/162045ecqsvd80cq2050dd.jpg) + +我喜欢一款可以让自己沉浸数小时的好游戏,但我并不总是能够忽略工作而消失在电子游戏中。尽管如此,我还是喜欢不时的接受有趣的挑战,当我的计算机忙于做一些我需要等待的事情时,我最喜欢启动的两个应用程序是来自 KDE 游戏包的游戏:**KBlocks** 和 **Kolf**。 + +### KBlocks + +我最喜欢的电子游戏是这种从方块从天上掉下来,最好是落成一排,当方块相邻时就会神奇的消失的游戏。KBlocks 就是这样的,它的实现很棒。它可以使用**左箭头**和**右箭头**控制方块进行旋转,使用**下箭头**让方块更快的下落,使用**空格键**直接落下方块,不同的难度级别,方块下落的速度不同。 + +![KBlocks][2] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +KBlocks 的默认主题是古埃及,这对游戏的玩法没有影响,但对于古埃及的爱好者来说可能是愉快的游戏体验。不过,你可以在“配置 KBlocksConfigure KBlocks”菜单项中更改主题。有一个名为 “Plasma” 的替代主题,或者你可以单击“获取新主题Get New Themes”按钮并下载由用户贡献的主题。 + +![KBlocks Invaders by José Jorge][4] + +(Seth Kenlon, CC BY-SA 4.0) + +主题纯粹是美学方面的事情,但就艺术类型的人而言,为休闲游戏创建主题可能是为开源项目作出贡献的一种有趣方式。 + +#### 引导我进入 KDE Plasma 桌面的游戏 + +我承认,KBlocks 对我来说很难放下。事实上,正是我在会议期间玩游戏的愿望让我在 Emacs 中找到了 `M-x tetris` 命令,这反过来又让我发现并爱上了 Linux。这个游戏有很大的魅力。也许 KBlocks 将成为你发现 KDE Plasma 桌面的途径? + +### Kolf + +我不喜欢现实生活中的高尔夫,但在电脑上,迷你高尔夫结合了模拟物理和有趣的关卡设计,既令人愉快,又令人沮丧。Kolf 的目标如你所料:将高尔夫球打入洞中。当然,目的地总是在拐角处、需要越过山丘、经过池塘或者在墙后,因此你的目标是计算球速、摩擦力、坡度和轨迹,使其完美地让球回到球洞并尽可能少的击打球。 + +![Miniature golf][5] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +它从来没有看起来那么简单,而且我认为看着高尔夫球从物体上反弹,并滚下你从未打算让它靠近的山丘,这永远不会过时。 + +#### 设计自己的球场 + +当你尝试设计自己的迷你高尔夫球场时,乐趣才真正开始。是的,Kolf 有一个关卡编辑器,你可以在其中建造墙壁、放置池塘、山丘和沙坑,添加弹球式保险杠等等。 + +![Kolf editor][6] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +因为 Kolf 可以是多人游戏,所以给每个玩家五分钟的时间来设计一个关卡,然后看看谁在谁的关卡上做的最好,这特别有趣。 + +### Linux KDE 游戏 + +这绝不是 KDE 项目中仅有的两款游戏。还有许多其它游戏,包括卡牌游戏、拼图游戏和街机游戏。KDE 游戏包的好处是,它们包含了你可以随时走开的游戏,而且它们只需要你一点点的注意力。我在编译代码时使用这些游戏来消磨时间。有时候我并不能完整的玩完一局游戏,但我总是很欣赏这种心理状态的微妙转变。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/2/casual-gaming-linux-kde + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[perfiffer](https://github.com/perfiffer) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gaming_grid_penguin.png?itok=7Fv83mHR (Gaming with penguin pawns) +[2]: https://opensource.com/sites/default/files/kblocks.jpg (KBlocks) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/kblocks-invaders.jpg (KBlocks Invaders by José Jorge) +[5]: https://opensource.com/sites/default/files/kolf.jpg (Miniature golf) +[6]: https://opensource.com/sites/default/files/kolf-edit.jpg (Kolf editor) diff --git a/published/202204/20220303 Nautilus File Manager Looks Amazing with GTK4 and Libadwaita - A Deep Dive.md b/published/202204/20220303 Nautilus File Manager Looks Amazing with GTK4 and Libadwaita - A Deep Dive.md new file mode 100644 index 0000000000..502948af1a --- /dev/null +++ b/published/202204/20220303 Nautilus File Manager Looks Amazing with GTK4 and Libadwaita - A Deep Dive.md @@ -0,0 +1,117 @@ +[#]: subject: "Nautilus File Manager Looks Amazing with GTK4 and Libadwaita – A Deep Dive" +[#]: via: "https://www.debugpoint.com/2022/03/gnome-files-43/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14442-1.html" + +GTK4 和 Libadwaita 让 GNOME 43 的文件管理器看起来很出色 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/07/163919x7t2hbblzmthmjfk.jpg) + +> 我们测试了 GNOME “文件Files” v43 的开发版本,在这里将向你深入披露其外观、功能和性能的细节。 + +GNOME 文件Files(以前的 Nautilus)也许是当今 GNOME 生态空间中使用最多的桌面应用。而且,自其首次发布以来,它从未接受过什么大修,而其他的 GNOME 应用乃至桌面本身都转移到了一个较新的技术栈。 + +现在一切都变了。GNOME 开发者正在为整个桌面和 “文件” 采用 GTK4 和 libadwaita。 + +GNOME “文件” v43 将在 2022 年晚些时候与 GNOME 43 一起发布,必将令人印象深刻。这个急需的 [重制][1] 带来了原生的深色模式、很棒的 UI 以及出色的 libadwaita 触控和 GTK4 性能提升。 + +### GNOME “文件” v43 + +我们安装了 GNOME “文件” v43 的 Flatpak 开发版本,下面是我们的发现。 + +第一印象,你应该注意到漂亮的 UI 触控,这要感谢 Libadwaita。关闭按钮是漂亮的圆形,而地址栏、选择高亮和整个文件窗口都有适当的间距和圆角。 + +所有的组件都没有出现边框高亮线。 + +下面是 v43(左)和 v42(右)的深浅模式的快速比较。 + +![GNOME Files 43 and 42 – Light Mode Comparison][2] + +![GNOME Files 43 and 42 – Dark Mode Comparison][3] + +地址栏的文件夹分隔符保持不变。然而,字体却有了些许润色。地址栏的上下文菜单改变了,“在终端打开Open in Terminal”选项没有了。取而代之的是 “在其它应用中打开Open in Other application” 菜单。引入了一个新的选项 “创建链接Create Link”。我想许多用户会怀念 “在终端打开” 的选项。 + +> 3/3 更新(感谢 Rashid):“在终端打开” 选项是 Nautilus 扩展包的一部分。因此,Flatpak 构建版不能“看到”它。因此,它本身并没有被删除。 + +![New option in address bar menu][4] + +另一个重要的变化是你应该注意到两个主工具条菜单:a)视图按钮和 b)汉堡主菜单。这些上下文菜单项显示了菜单项及键盘快捷键。这也使它们看起来更显眼一些。 + +![The Hamburger menu now have keyboard shortcuts][5] + +文件夹的上下文菜单现在有一个向上的小箭头,指向从它弹出的文件夹。文件夹的右键上下文菜单以组为单位组织得很好。例如,打开动作是分组的,而剪切、复制、粘贴在上下文菜单中以横杠的形式明显分开。 + +![Context Menu for folder changes][6] + +我还注意到一个新的选项 “粘贴到该文件夹Paste into the folder”,这个很好。 + +Nautilus 搜索几乎与 “文件” v42 相同,只是在 “文件” v43 中你可以通过创建日期/时间搜索。 + +~~然而,我注意到一个令人兴奋的变化。上下文菜单中的文件关联的应用名称被删除了。例如,如果你今天试图在 “文件” v42 中打开一个文本文件,它在上下文菜单中显示与之相关的应用名称。在 “文件” v43 中,它只显示 “打开”。我觉得这种改变是不必要的。之前的情况更好。~~ + +> 3/3 更新(感谢 Rashid):当我在试用 v43 的沙盒 Flatpak 版本时,它并没有看到系统关联。所以,这不是一个变化。但是,我又想知道,如果有人试图真正使用 Flatpak 版本怎么办。 + +![A subtle change in context menu for file association][7] + +所以,这就是我在这个应用的新 GTK4 版本中发现的整体变化。但它看起来不错?不是吗。此外,如果你是直接从 Ubuntu 20.04 LTS 来的,其中包含 “文件” 3.38,那么也许你的体验会是“哇”!如果你将 “文件” v43 与 “文件” v3.38 进行比较,大部分区域都发生了变化。对于这些用户来说,这将是一个相当不错的体验。 + +你应该记住,v43 仍在开发中,因此在未来最终发布时,可能会发生变化。 + +### 愿望清单 + +如果比较各种 Linux 文件管理器,其他的文件管理器的选项远多于今天的 GNOME “文件”。 + +是这样的。 + +例如,Nemo 或 Dolphin - 这两个最好的文件管理器在各方面都胜过 “文件”。比较一下功能,GNOME “文件” 没有一些流行的功能: + + * 双面板或分割视图 + * 从上下文菜单中打开一个根文件夹是困难的 + * 一个用于文件夹浏览的向上箭头 + * 没有从上下文菜单中创建一个新文件(文本、电子表格等)的选项 + * 更多的排序和搜索功能 + +我们希望这些功能能尽快出现在 GNOME “文件” 中。 + +### 何时能用 + +如上所述,这个版本的 GNOME “文件” 将与 GNOME 43 一起提供。因此,从 Linux 发行计划的角度来看,你应该在 2022 年 10 月的 Ubuntu 22.10 和今年晚些时候的 Fedora 37 上拥有它。 + +不幸的是,[Ubuntu 22.04 LTS][9](Jammy Jellyfish)和带有 [GNOME 42][10] 的 [Fedora 36][11] 将不会有 GNOME “文件” 43。主要原因是时间表不匹配,而且它是要移植到 GTK4 和彻底测试的复杂应用之一。然而,大部分上述的内部功能仍然会在 “文件” 42 中。但它可能缺少漂亮的 UI 变化和主题。 + +尽管如此,我相信这个流行的文件管理器看起来不错,当它发布时,用户应该会很兴奋地使用它。让我知道你对 GNOME “文件” 43 的新变化的看法,请在下面的评论框中留言。 + +加油! + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/03/gnome-files-43/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://gitlab.gnome.org/GNOME/nautilus +[2]: https://www.debugpoint.com/wp-content/uploads/2022/03/GNOME-Files-43-and-42-Light-Mode-Comparison-1024x502.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/03/GNOME-Files-43-and-42-Dark-Mode-Comparison-1024x493.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/03/New-option-in-address-bar-menu-1024x267.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/03/The-Hamburger-menu-now-have-keyboard-shortcuts-1024x331.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/03/Context-Menu-for-folder-changes-1024x560.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/03/A-subtle-change-in-context-menu-for-file-association-1024x524.jpg +[9]: https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/ +[10]: https://www.debugpoint.com/2021/12/gnome-42/ +[11]: https://www.debugpoint.com/2022/02/fedora-36/ +[12]: https://t.me/debugpoint +[13]: https://twitter.com/DebugPoint +[14]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[15]: https://facebook.com/DebugPoint diff --git a/published/202204/20220303 Ubuntu vs Arch- Which Linux Distro is better.md b/published/202204/20220303 Ubuntu vs Arch- Which Linux Distro is better.md new file mode 100644 index 0000000000..c4836821b5 --- /dev/null +++ b/published/202204/20220303 Ubuntu vs Arch- Which Linux Distro is better.md @@ -0,0 +1,287 @@ +[#]: subject: "Ubuntu vs Arch: Which Linux Distro is better?" +[#]: via: "https://itsfoss.com/ubuntu-vs-arch/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "aREversez" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14485-1.html" + +Ubuntu vs Arch:孰优孰劣? +====== + +Ubuntu 与 Arch Linux 为用户提供了完全不同的桌面体验。 + +在两者之间做出选择,实在让人左右为难,尤其是在既想体验 [Arch Linux 的亮点][1] 又想保留 Ubuntu Linux 的优势的情况下。 + +两种发行版本身都是用户的绝佳选择。不过,如何从两者中选出最佳的一种呢? + +在这篇文章中,我将从各方面介绍 Ubuntu 和 Arch Linux 的不同之处,希望可以帮助你解决这一选择难题。 + +![](https://img.linux.net.cn/data/attachment/album/202204/18/152800txaq8qdjsmj1oxaj.jpg) + +### 1、目标用户 + +Arch Linux 旨在为那些喜欢鼓捣、喜欢折腾的用户提供 **DIY** 体验,自定义 Linux 系统的各种元素。 + +比如,构建软件包,以及自定义桌面。 + +Arch Linux 的上手体验取决于 [安装设置它][3] 的用户。所以,Arch Linux 可以轻易迎合寻找不同包以及桌面环境等元素的用户。 + +而另一方面,Ubuntu 的目标用户是那些想使用 **操作方便,预先配置好的** Linux 系统。 + +这类用户希望系统预装必要的工具,确保一切都会按照预期进行。换言之,他们想要的是一个理想的系统,无需担心设置问题。 + +Ubuntu 也不希望用户花费大把时间来提升自己的体验,所以它选择以满足绝大多数用户的需求为基准。 + +### 2、系统安装 + +不得不说,Ubuntu 提供了简洁直观的安装方式,因为它提供的图形用户界面大大方便了安装。 + +![][4] + +如果有需要,你甚至可以 [在 Ubuntu 服务器上安装一个图形用户界面][5]。 + +但要安装 Arch Linux,你就不得不使用终端(命令行)。 + +![][6] + +还好,[Arch Linux 现在有了引导式的安装程序][7],这使得通过终端安装 Arch Linux 变得更加容易了。 + +![][8] + +当然,还是 Ubuntu 的安装更为方便一些。 + +### 3、桌面体验 + +![][9] + +Ubuntu 旨在 **方便用户**。为此,Ubuntu 项目的领导者 Canonical 公司提供了自定义的 GNOME 桌面环境体验。 + +尽管你可能无法像在 KDE Plasma 上那样自由地定制桌面,你依然可以有很多其他选择。感兴趣的话,可以点击了解 [KDE vs GNOME][10]。 + +Ubuntu 也会定期收集用户体验反馈信息,尽可能地帮助用户提高工作效率。 + +Arch Linux **更加注重功能** 以及其他技术方面,而不是用户的桌面体验。用户体验完全取决于用户在安装 Arch Linux 时是如何设置的。 + +使用 Arch Linux 时,你能依赖的只有桌面环境提供的开箱即用工具,没有为用户量身定制的改进。如果你想体验一些不一样的东西,你就必须对系统加以调整。 + +![Arch Linux with GNOME][11] + +不过,好在 Arch Linux 允许用户选择 KDE Plasma、GNOME 或者 [其他桌面环境][12],所以你可以充分利用这一优势,根据自己的喜好来选择桌面环境。 + +不仅如此,在安装 Arch Linux 时,你还可以选择平铺式窗口管理器。 + +总体来说,如果使用 Ubuntu,你的桌面体验和其他用户的体验别无二致,因为 Ubuntu 可以自定义的元素极少。 + +相反,如果使用 Arch Linux,你就可以 **自由定义桌面体验**。但请注意,这可能只适合 Linux 老手,如果你刚开始使用 Linux,恐怕做起来比较困难。 + +### 4、文件系统 + +大多数用户不需要关心他们的 Linux 发行版所使用的文件系统。 + +因此,Ubuntu 坚持使用 **ext4** 作为文件系统。ext4 具有现代计算机所需的全部基本功能,是一种非常优秀的最常见的文件系统。 + +然而,如果你不想使用 **ext4**,而想选择具备其他各种优势的文件系统,那么你可以考虑 Arch Linux。 + +![][13] + +你可以选择 btrfs、ext4、xfs 或者 f2fs。针对这些文件系统的优势,本文不再详述,但是如果你选择 **ext4** 之外的文件系统,请确保你知道自己在做什么。 + +### 5、软件生态 + +Ubuntu 支持的软件更多,这就是为什么 [大多数主流 Linux 发行版][14] 都是基于 Ubuntu 的。 + +![][15] + +相应地,许多工具在开发时也是首先支持 Ubuntu,而后才是其他发行版本。 + +此外,在 Ubuntu 上安装软件包也非常容易。你可以通过 Ubuntu 官方仓库安装软件包,也可以使用 PPA,或者是软件中心(包括 Snap 应用)。 + +也可以使用 [Flatpak][16] 来安装软件。如果你的 Ubuntu 没有 Flatpak,你可以 [前往 Flathub 安装它][17]。 + +如果你使用的是 Arch Linux,那么你也可以通过官方仓库安装许多软件。 + +可惜的是,相较于 Ubuntu,一些应用开发者可能不会正式支持 Arch Linux。 + +此外,你会发现,Arch Linux [安装和管理软件包都需要使用 pacman][18]。使用哪个图形界面的安装程序进行软件的安装和管理,取决于你所选择安装的桌面环境。 + +![][19] + +举个例子,如果你安装的是 GNOME 桌面,你可以使用 GNOME 的 “软件” 应用;如果是 KDE Plasma 桌面,可以使用 “发现” 应用。 + +这些软件包管理器都不会内置 Snap 或 Flatpak 支持,所以你只能根据需要自行安装。 + +为了获取更多的软件,你可以使用 [AUR][20]。请注意,AUR 是社区构建的软件仓库,所以官方建议你不要完全依赖它。 + +![][21] + +即便如此,AUR 也经常被看做是 Arch Linux 的优势之一,毕竟社区提供的软件包比 Ubuntu 提供的更为丰富。 + +你可以通过使用一些 [AUR 辅助工具][22] 来提升体验质量。 + +总体来说,如果你想仅靠一个工具就能轻松安装并且管理软件,那么 Ubuntu 当属不二之选。 + +### 6、极简 vs 臃肿 + +极简还是臃肿,这完全取决于个人的偏好,因为在配置 Arch Linux 时,一切尽在你的掌握之中。所以你可以在满足需要的情况下,只安装最少数量的包。 + +相比之下,Ubuntu 预装了许多软件。在一些人看来,这些软件都很实用。 + +![][23] + +当然,如果你不需要,也可以卸载。 + +不过,还有一些人认为,这些软件没什么必要,只会显得 Ubuntu 十分臃肿。 + +因此,你需要好好考虑一下,看自己究竟是想要预装的必备软件呢(Ubuntu)?还是拒绝臃肿,只取所需呢(Arch Linux)? + +### 7、自由 vs 限制 + +![Arch Linux \(Neofetch\)][24] + +就像前文所提到的,Arch Linux 允许你控制系统的一切,它赋予用户极大的自由度,让用户可以尽情定制体验。 + +这不仅仅局限于桌面环境或是平铺式窗口管理器,而是更多。 + +例如,你还可以选择自己喜欢的音频服务器,比如 PulseAudio 或者 pipewire。 + +你也可以选择特定的 Linux 内核,比如提供了安全性更高的加固版本、能够提升用户体验的 Zen 内核或者某个长期支持版本的 Linux 内核。 + +不同于 Arch Linux,Ubuntu 一直坚持使用经过全面测试的 Linux 内核,而且默认使用 PulseAudio 作为音频服务器(笔者写这篇文章时情况如此)。 + +但说到底,哪个能满足你的需求,哪个才是最好的。 + +### 8、社区支持 + +Ubuntu 拥有坚实的用户基础,可以提供广泛的社区支持。与其相关的论坛和门户网站有很多,可以指导 Ubuntu 用户,帮助解决遇到的难题。 + +![itsfoss community][25] + +你也可以在论坛(包括 [It’s FOSS 社区][26])发布问题,寻求帮助。 + +Arch Linux 用户比较少,所以不提供类似的社区支持。不过,Arch Linux 的维基提供了几乎涉及各个方面的高质量技术文档,算是弥补了这一不足。 + +![arch wiki][27] + +如果你想探索,[Arch Linux 维基][28] 有着最丰富的技术文档。 + +### 9、发布周期 + +Ubuntu 提供 [长期支持版本][29],在五年或更长时间(针对企业)提供小的更新维护。 + +![][30] + +Ubuntu 还提供了非长期支持版本,可以得到九个月的更新维护,而每半年发布一个新版本。非长期支持版本适合那些想体验最新软件包与功能的用户,每次升级都可能伴随着重大更新。 + +长期支持版本更适合于那些不希望每次更新都有破坏性变化的用户。 + +更多信息可以参考我们的文章:[Ubuntu 发行周期与生命周期结束][31] + +Arch Linux 属于 [滚动发行版][32],所以不用担心发布周期的问题。只要有更新,无论大小,都会发送给用户。 + +![][33] + +这可以确保你一直在使用最新和最强的软件包。这有时是件好事,但当它破坏一些东西时,对一些用户来说可能会很不方便。 + +### 10、硬件兼容性 + +![][34] + +Ubuntu 是一款面向台式电脑的主流发行版,所以在发布之前,它需要测试与各种硬件的兼容性。 + +我可以打包票,**Ubuntu 开箱即用的硬件兼容性非常优秀**。 + +Arch Linux 不像 Ubuntu 那样进行过大量的测试,所以它不一定能在你的硬件上正常运行。 + +不过,正因为 Arch Linux 有着最新最强的 Linux 内核包,所以有时它的表现要优于 Ubuntu。 + +如果你不太清楚自己硬件的兼容性,你最好请教一下周围的人,确保你在安装 Arch Linux 时不会出现别人已经遇到过的问题。 + +因此,选择 Ubuntu,你就可以高枕无忧了,除非你使用的是非常尖端的设备。 + +### 11、稳定性 + +如果你不想让你的系统崩溃,或是不想遇到错误,**Ubuntu 应该是更好的选择**. + +Arch Linux 的话,情况就不好说了。它可以工作得很好,也可以因为一次更新而倒下。 + +Arch Linux 本身并不算稳定,你需要自行维护它,确保在自定义以及更新过程中不会出现任何问题。 + +### 再三考虑: 你该选哪个? + +考虑到稳定性、兼容性、软件生态以及上手速度等因素,对于那些只想顺利完成工作而不想麻烦折腾的人来说,Ubuntu 是一个完美的选择。 + +而对那些想要定制桌面体验而适应自己工作内容,以及寻求最新功能和最强性能的用户来说,Arch Linux 最合适不过了。 + +如果你想探索未知,Arch Linux 可以给你带来非常奇妙的体验。但对于一些人来说,Arch Linux 使用起来可能比 Ubuntu 要困难许多。 + +那么,考虑到以上所有因素,**你觉得自己会选哪个?** 期待你能在下方评论区留言。 + +### 常见问题解答:如果你还没决定到底用哪一个 + +可能有些人还会有一些问题,可以参考一下内容: + +**Arch 比 Ubuntu 更好吗?** + +对,也不对。就技术层面来讲,Arch Linux 确实更好,但是你也需要考虑它的稳定性、软件生态以及维护它所需要的学习时间。也就是说,在得出答案之前,你需要根据自己的喜好,再三考虑一番。 + +**哪个更快?Ubuntu 还是 Arch?** + +Arch Linux 更快,因为它安装的东西很少。不过,根据你的配置不同,情况可能也会有所不同。 + +注意,Ubuntu 与 Arch Linux 相比,速度并不会差很多。只不过因为它开箱即用的包会更多,所以有些人会认为 Ubuntu 比较臃肿。 + +**我是不是应该从 Ubuntu 转到 Arch 呢?** + +如果你想优化体验,想要一直获取最新最优秀的软件包,同时又不会担心稳定性,Arch Linux 会比较适合你。 + +如果你只是为了完成工作,需要的是一些基础功能,Ubuntu 就够用了。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-vs-arch/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[aREversez](https://github.com/aREversez) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/why-arch-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/ubuntu-vs-arch.jpg?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/install-arch-linux/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/try-ubuntu-install-ubuntu.jpeg?resize=800%2C530&ssl=1 +[5]: https://itsfoss.com/install-gui-ubuntu-server/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/arch-linux-boot-menu-install.png?resize=635%2C481&ssl=1 +[7]: https://news.itsfoss.com/arch-new-guided-installer/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/arch-install-terminal.png?resize=800%2C279&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/ubuntu-20-04-ux.jpg?resize=800%2C407&ssl=1 +[10]: https://linux.cn/article-14320-1.html +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/arch-linux-gnome.png?resize=732%2C413&ssl=1 +[12]: https://itsfoss.com/what-is-desktop-environment/ +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/arch-linux-filesystem.png?resize=800%2C149&ssl=1 +[14]: https://itsfoss.com/best-linux-distributions/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/ubuntu-software-center.png?resize=800%2C574&ssl=1 +[16]: https://itsfoss.com/what-is-flatpak/ +[17]: https://itsfoss.com/flatpak-guide/ +[18]: https://itsfoss.com/pacman-command/ +[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/arch-install-terminal-software.png?resize=763%2C431&ssl=1 +[20]: https://itsfoss.com/aur-arch-linux/ +[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/sky-aur-install.png?resize=800%2C560&ssl=1 +[22]: https://itsfoss.com/best-aur-helpers/ +[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/ubuntu-utilities.png?resize=800%2C520&ssl=1 +[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/arch-linux-neofetch.png?resize=800%2C533&ssl=1 +[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/itsfoss-community.jpg?resize=800%2C580&ssl=1 +[26]: https://itsfoss.community/ +[27]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/arch-wiki.png?resize=800%2C332&ssl=1 +[28]: https://wiki.archlinux.org/ +[29]: https://itsfoss.com/long-term-support-lts/ +[30]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/ubuntu-info.png?resize=800%2C595&ssl=1 +[31]: https://itsfoss.com/end-of-life-ubuntu/ +[32]: https://itsfoss.com/rolling-release/ +[33]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/arch-info.png?resize=800%2C573&ssl=1 +[34]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/hardware-compatibility-illustration.png?resize=800%2C450&ssl=1 diff --git a/published/202204/20220308 5 Things to Know When Someone Says Linux is Tough.md b/published/202204/20220308 5 Things to Know When Someone Says Linux is Tough.md new file mode 100644 index 0000000000..68ad902522 --- /dev/null +++ b/published/202204/20220308 5 Things to Know When Someone Says Linux is Tough.md @@ -0,0 +1,175 @@ +[#]: subject: "5 Things to Know When Someone Says Linux is Tough" +[#]: via: "https://news.itsfoss.com/things-to-know-linux-is-tough/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "aREversez" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14429-1.html" + +Linux 太难了?你需要知道这 5 点 +====== + +> Linux 很难吗?为什么人们认为它很难?我们重点分析了一些常见的问题,并对其进行了说明,让你觉得它没那么难。 + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/linux-is-tough.png?w=1200&ssl=1) + +如果只有 Windows、macOS、Linux 三种操作系统可供选择,那么大多数人应该都不怎么会考虑 Linux 系统。 + +Linux 一般用在服务器上,但对普通用户台式机和笔记本电脑来说,情况并非如此。 + +更糟糕的是,很多人只是从别人那儿听来的,都没有亲自试过,就觉得 Linux 太难了。 + +但是 Linux 真有那么难吗?若果真如此,Linux 到底难在哪里呢? + +### Linux 难学吗? + +与 Windows 和 macOS 相比,Linux(这里指 Linux 发行版)确实有很多根本不同。 + +但也多亏了这些差别,Linux 发行版具备了 [Windows][1] 与 [macOS][2] 所不具备的的许多优势。 + +另外,Linux 基本可以满足你的日常需要。在很多情况下,Linux 操作系统的用户界面与 Windows 或者 macOS 的相差并不大,所以用起来也相当方便。 + +**不信?** 请看这篇:《[与 Windows 相似的 Linux 发行版][3]》 + +那么,Linux 有哪些方面会让用户望而却步呢? + +在这篇文章中,我将讨论 Linux 让新用户们普遍犯难的问题,希望可以借此让他们对 Linux 有所改观。 + +### 1、软件安装与软件包管理 + +![][4] + +在 Linux 上,安装软件(软件包)的方法有很多。 + +你可以从软件中心安装,也可以在终端进行安装,或者从官方软件源下载软件包然后自行手动安装。 + +再或者,你甚至可以通过 [编译源码来安装软件][5]。 + +与 Windows 或者 macOS 不同,Linux 系统可不会使用 EXE 文件或 dmg 文件。 + +对于不同的 Linux 发行版,软件包也会有所不同。例如,[DEB 文件可以安装在 Ubuntu 上][6]。而在 Fedora 系统下,需要 [安装 RPM 文件][7]。 + +在这种情况下,[Flatpak][8] 和 Snap 应运而生,使得软件安装更为便捷。如果一款软件有对应的 Flatpak 软件包或者 Snap 软件包,你就可以把它安装在任意一种 Linux 发行版上。 + +不过,一些 Linux 发行版可能需要用户自行 [安装 Flatpak][9] 或者 [Snap][10],因为这些发行版默认情况下可能并不支持它们。 + +所以你要明白,由于 Linux 有很多不同的发行版本,软件安装方式以及软件包的类型也会存在许多区别。不过,只要了解某个发行版所支持的软件包格式以及安装方法,安装软件就简单多了。 + +### 2、“终端恐惧症” + +![][16] + +在 Windows 或 macOS 系统下,你可能不会经常打开命令行或者终端。 + +可能也就是在故障排除的时候,会需要使用命令行。但在 Linux 系统下,终端的使用频率却非常高。 + +即便是在 [最好用的 Linux 发行版][11] 上,你可能也会经常打开终端,输入命令来执行一些任务,比如: + + * 更新软件包列表 + * 移除一个不是通过软件中心安装的软件 + * 添加一个软件仓库来安装软件 + +从技术层面讲,你不需要学习复杂的命令,但是知道一些如何卸载软件包或者安装 Flatpak 程序的命令,就会很方便。 + +通常情况下,软件的官网上会列出安装命令或者说明。针对故障排除,有时也可以在社区论坛上找到需要输入的确切命令。 + +所以说,你根本不需要去“记”什么,上网一搜,应有尽有。 + +不过,一些用户还是觉得这样会很麻烦,所以他们干脆放弃了 Linux。 + +最终,这些人只要碰到与 Linux 相关的东西,就避而远之,再也提不起兴趣。 + +### 3、安装显卡驱动 + +![][17] + +macOS 不支持第三方显卡,这就意味着它无法实现虚拟化(尤其是 ARM),也无法用来玩游戏。所以,我们这里不谈 macOS,来看看 Windows。 + +Windows 和 Linux 一样,都支持游戏和虚拟化技术。如果你用它们不只是看看视频,那就需要安装显卡驱动来支持这些功能。 + +在 Windows 上,你需要下载安装显卡的对应驱动。大多数情况下,首次安装的过程中并不会出现问题。 + +不过,在 Linux 上,最新版本的显卡驱动不一定能够正常运行(尤其是英伟达显卡的驱动)。所以,这已经不是从官网下载安装驱动那么简单的问题了。 + +如果你的 Linux 发行版带有驱动管理器功能,比如 Linux Mint 操作系统,那事情就简单了。 + +如果没有的话,你可能需要下载一个包含适合自己系统的显卡驱动的 ISO 文件。 + +总的来说,如果你使用了主流的 Linux 发行版,那么安装显卡驱动并不是一件难事;但是如果你使用的不是主流的发行版,你可能需要在安装之前好好查一查。 + +### 4、软件支持 + +Windows 和 macOS 上的应用并不一定都有对应的 Linux 版本。 + +如果软件提供了跨平台支持,就有可能提供 Ubuntu、Fedora 以及 Arch 等 Linux 发行版的对应版本。否则,就只能去找这些软件的替代品了。 + +所以,很多软件不支持 Linux 系统,就给用户带来了较差的使用体验。 + +不过,我们列出了一份内容丰富的 [必备软件清单][12],相信能帮助你更好地使用 Linux 系统。 + +遗憾的是,一些用户没有意识到这一点,仍然不愿意去尝试替代软件。 + +### 5、调整外围设备与部件 + +![][18] + +操作难度和软件支持并不是问题的全部,管理和调整电脑外围硬件设备也是一个重要方面。 + +雷蛇、海盗船以及华硕等许多硬件公司没有为 Linux 提供相应的官方支持。 + +因此,当用户意识到自己无法那么便捷地管理电脑的 RGB 灯条、风扇配置文件以及冷却设备时,他们自然也就不会考虑使用 Linux。 + +不过你要知道,已经有许多工具可以帮助你应对这一问题,比如: + + * [配置游戏鼠标][13] + * [调整雷蛇外部设备][14] + * [监控和控制冷却设备][15] + +这些工具可能不是官方提供的,但是它们适用于很多外部设备与组件。因此,如果你是因为外部设备和部件没有官方支持而放弃使用 Linux,那么你可以尝试这些工具。 + +### 总结 + +我觉得这些都是最为普遍的问题,这些问题导致了 Linux 劝退新手,摊上最难使用的操作系统的名号。 + +要记住,尝试一款陌生的操作系统总是伴随着新的挑战,需要一定的时间来适应。 + +Linux 作为一款桌面操作系统,相较于以前,操作难度降低不小。像 Ubuntu、 Pop!_OS、 Linux Mint、 Linux Lite 之类的 Linux 发行版能让用户更容易上手。 + +即便 Linux 有了那么多的改善与提升,还是有很多用户不愿意使用它,所以我们想让你了解 Linux 并没有你想象的那么难用。 + +如果你的朋友还在纠结上述原因而不肯尝试 Linux,我推荐你把这篇文章分享给他,帮助他进一步了解并使用 Linux。 + +请在下方评论留言。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/things-to-know-linux-is-tough/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[aREversez](https://github.com/aREversez) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/linux-better-than-windows/ +[2]: https://itsfoss.com/linux-vs-mac/ +[3]: https://itsfoss.com/windows-like-linux-distributions/ +[4]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/02/appimage-illustration.png?w=1000&ssl=1 +[5]: https://itsfoss.com/install-software-from-source-code/ +[6]: https://itsfoss.com/install-deb-files-ubuntu/ +[7]: https://itsfoss.com/install-rpm-files-fedora/ +[8]: https://itsfoss.com/what-is-flatpak/ +[9]: https://itsfoss.com/flatpak-guide/ +[10]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/ +[11]: https://itsfoss.com/best-linux-distributions/ +[12]: https://itsfoss.com/essential-linux-applications/ +[13]: https://itsfoss.com/piper-configure-gaming-mouse-linux/ +[14]: https://itsfoss.com/set-up-razer-devices-linux/ +[15]: https://itsfoss.com/coolero/ +[16]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/terminal-illustration.png?w=1000&ssl=1 +[17]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/gpu-illustration.png?w=1000&ssl=1 +[18]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/components-illustration.png?w=1000&ssl=1 diff --git a/published/202204/20220317 Top 10 Most Beautiful Linux Distributions -Featured.md b/published/202204/20220317 Top 10 Most Beautiful Linux Distributions -Featured.md new file mode 100644 index 0000000000..597d91afaa --- /dev/null +++ b/published/202204/20220317 Top 10 Most Beautiful Linux Distributions -Featured.md @@ -0,0 +1,200 @@ +[#]: subject: "Top 10 Most Beautiful Linux Distributions [Featured]" +[#]: via: "https://www.debugpoint.com/2022/03/beautiful-linux-distributions-2022/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "amagicboy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14501-1.html" + +精选 10 个最美的 Linux 发行版 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/23/152856vwq5071qzhn6n7rj.jpg) + +> 我们选出 2022 年 10 个最美的 Linux 发行版,在保证系统稳定的前提下,会给你良好的视觉体验。 + +定制化拓展 Linux 发行版以满足需求是非常有意思的事。无论是 Ubuntu 还是 Fedora ,都有各种各样的工具去定制化 Linux 桌面。 + +但是,也有很多不需要任何定制化而且令人眼前一亮的 Linux 发行版。它们的开发者使它们在安装后不需要再定制化就能有非常好的视觉效果。 + +现在,我们编制了一份最美 Linux 发行版列表,你可以现在尝试来更新你电脑的视觉外观。 + +### 2022 最美的 Linux 发行版 + +#### 1、Zorin OS + +最先介绍的 Linux 发行版是 Zorin OS。Zorin OS 使用基于 GNOME 的 Zorin 桌面 ,非常适合追求美观的桌面和生产力的新用户。 + +Zorin OS 最有特点的功能之一是,它可以随意转化,让其看起来像其他操作系统桌面,这意味着只需要设置布局选项,就可以改变任务栏、应用菜单、停靠栏,给用户最大的的灵活性,安装即用。 + +> **[阅读有关 Zorin OS 更多信息][2]** + +![Zorin OS 16 桌面][3] + +#### 2、elementary OS + +elementary OS 是基于 Ubuntu 长期稳定支持(LTS)发行版中最美观的一个。它使用吸引人的 Pantheon 桌面环境,其外观和使用体验受到了 macOS 的启发。 + +elementary OS 非常适合从 macOS 进入 Linux 世界的新用户,因为他们会发现许多熟悉的东西,比如手势和窗口样式。 + +但是,elementary OS 很多地方不能通过设置菜单进行定制,只能依靠外部脚本命令来进一步定制。不过系统默认桌面就已经十分美观了,能满足大部分人的需求。 + +elementary OS 最具特色的是它精心设计的应用商店。应用商店提供各种类别的应用,特别是那些专为 elementary OS 定制而且外观精美、功能强大的应用。 + +> **[阅读有关 elementaryOS 更多信息][4]** + +![elementary OS 6 ODIN 桌面][5] + +#### 3、深度操作系统 + +第三个介绍的 Linux 发行版是深度操作系统。它基于 Debian ,由中国深度科技公司开发。它使用自研的基于 Qt 的深度桌面环境(DDE)。深度桌面的部件、配色方案、窗口样式、壁纸看起来都非常不错,给用户安装即享的视觉体验。 + +深度操作系统精心打磨的视觉组件和 macOS 非常相似。并且由于是 Debian 的稳定分支,如果你想要一个外观精美且稳定可靠的 Linux 发行版,深度操作系统是最适合的选择。 + +为什么深度操作系统体验很好? + + * 基于 Qt 的酷炫桌面 + * 原生部件及支持暗色主题 + * 定制化停靠栏的多种选择项 + * 透明度、窗口效果、光标主题、图标主题 + * 强调色 + +> **[阅读有关深度操作系统更多信息][6]** + +![Deepin 20 桌面][7] + +#### 4、CutefishOS + +第四个介绍的 Linux 发行版是 [CutefishOS][8] 。这个基于 Debian 和 Ubuntu 的 Linux 发行版具有一个原生开发的 Cutefish 桌面。 CutefishOS 还在开发中,但由于它的外观,它已经在用户群体中掀起波澜。(LCTT 译注:似乎也是国内团队开发的) + +CutefishOS 底层基于 Qt 和 KDE 框架构建。这个带有 Cutefish 桌面的高效 Linux 发行版在顶部提供了全局菜单功能。 + +由于其目前正在开发中,定制选项仍在进行中。但在最新的发行版中, CutefishOS 已经支持深色模式、强调色、动画效果、停靠位置(左、右、下)等选项。 + +如果你想体验完全不同的桌面风格,可以尝试 CutefishOS 。 你也可以查看下面提供的关于此桌面的完整评论和教程。 + +> **[Cutefish OS 评测][9]** + +![Cutefish OS][10] + +#### 5、Manjaro KDE Plasma 版 + +Manjaro Linux KDE 版是现在外观最好看的 Linux 发行版之一。 Manjaro KDE 基于 Arch Linux ,采用了 KDE Plasma,并额外添加了一些调整工具和组件。 Manjaro 的绿色调色板给你以全新的外观和体验。你可以通过内置的 KDE 工具和设置进一步定制,并从 KDE 商店获得图标和主题。 + +Manjaro KDE 是性能和外观与 Arch Linux 之强大的完美结合。对于 Arch Linux 新用户来说, Manjaro 是一个理想的起点。 + +> **[阅读有关 Manjaro KDE 更多信息][11]** + +![Manjaro KDE Plasma][12] + +#### 6、Garuda Linux + +出名的 Garuda Linux 是榜单上的第六位。 Garuda Linux 基于 Arch Linux ,带有美观的桌面,其特点是为所有主流桌面环境定制了图标、主题。 Garuda Linux 使用针对硬件优化了性能的 Zen 内核, + +Garuda Linux 的外观和体验令人印象深刻。其 macOS 风格看起来非常的方便。 Neon 图标主题、可爱的调色板、模糊和透明度与全局菜单的结合是其自身的完美选择。 + +Garuda 最主要的优点是支持所有桌面环境 — KDE Plasma、 GNOME、 Xfce、 LXQT、 MATE 等等。 + +> **[阅读有关 Garuda Linux 更多信息][14]** + +![Garuda Linux][15] + +#### 7、Linux Mint Cinnamon 版 + +我们推荐 Linux Mint 是因为它非常的简洁、优美和稳定。它是目前最被广泛使用和出名的 Linux 发行版之一,或许其使用人数仅在 Ubuntu 之下。但和本列表中其他 Linux 发行版比较起来,它看起来不是很精美。 + +不过,如果你喜欢看起来很棒的经典用户桌面,默认的 Cinnamon 桌面看起来干净且完美。 + +Linux Mint Cinnamon 版对所有用户都非常友好,特别是第一次使用 Linux 或者从 Windows 转到 Linux 的用户。其默认的外观和体验和 Mint 的绿色调色板都能使人耳目一新。 + +如果你无法确定用哪个既稳定又养眼的 Linux 发行版,那就毫不犹豫的选择 Linux Mint Cinnamon 版。 + +> **[阅读有关 Linux Mint 更多信息][16]** + +![Linux Mint 20 — Cinnamon 版本桌面][17] + +#### 8、Nitrux OS + +[Nitrux Linux][18] 基于 Debian ,其特点是一个名为 NX 桌面的 KDE Plasma 修改版。这个独特的 Linux 发行版有一套建立在 Maui 套件和 Qt 之上的 Nitrux 应用。 Nitrux 不使用 systemd,而使用 OpenRC 作为初始化系统。凭借其独特的功能和外观,Nitrux 是目前最好的 Linux 发行版之一。 + +Nitrux OS 的默认外观设计得非常完美,它采用经过改进的 KDE Plasma 桌面,带有 Kvantum 主题引擎、图标主题、调色板、光标主题等。 Nitrux OS 背后的团队还开发了名为 Maui Shell 的独立桌面,这是一个美丽的融合型桌面,可以根据屏幕大小进行自我调整。 + +如果你需要一款稳定方便的 KDE Plasma 桌面,那么 Nitrux OS 非常适合你。你不会失望的。 + +> **[阅读有关 Nitrux OS 更多信息][18]** + +![Nitrux 2.0 桌面][19] + +#### 9、优麒麟 + +优麒麟是一个官方的 Ubuntu 版本,是专门为使用简体中文的中国人设计的。但它同时也支持其他语言。 + +这个修改版的 Ubuntu 使用优麒麟用户界面(也称为 UKUI)。 UKUI 桌面使用 Qt 开发,支持 MATE 桌面组件。 + +优麒麟看起来精致,就外观和设计而言,就像是 GNOME 和 KDE Plasma 的结合。 + +优麒麟具有设计精美的图标集、底部任务栏,漂亮的应用程序视图、应用程序切换器,圆角窗口等精心制作的功能。 + +> **[阅读有关优麒麟更多信息][20]** + +![优麒麟桌面][21] + +#### 10、Pop!_OS + +Pop!_OS 是由生产计算机硬件的 System76 公司开发的。 这个基于 Ubuntu 的 Linux 发行版已经预装在所有 System76 硬件上。不过,你也可以从其官方仓库下载然后安装到你的机器上。 + +Pop!_OS 的特点是在默认的 GNOME 桌面上带有额外的调整和配置。此桌面具有 GNOME 40 时代之前的特点,预配置了多个扩展和调整。比如你可以获得一个可以配置为在桌面中自由调整的底部停靠栏、一个用于启动应用程序的启动器、圆角窗口等诸如此类的功能。此桌面还有自动平铺和优化的键盘导航功能,可提高你的工作效率。 + +其外观和感觉都很干净,设计精美,有调色板,内置了深色模式、圆角窗口,以及图标主题。 + +> **[阅读有关 Pop!_OS 更多信息][22]** + +![Pop!_OS 21.10 桌面][23] + +### 结语 + +希望这份 2022 最美 Linux 发行版榜单能帮你选择你想要的桌面或者系统。 因为这些 Linux 发行版已经配置好,看起来很漂亮,而且它们性能很强大。 + +选择并开始你的 Linux 之旅吧。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/03/beautiful-linux-distributions-2022/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[amagicboy](https://github.com/amagicboy) +校对:[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/lujun9972 +[1]: https://www.debugpoint.com/category/distributions +[2]: https://zorin.com +[3]: https://www.debugpoint.com/wp-content/uploads/2021/08/Zorin-OS-16-Desktop-1024x576.jpg +[4]: https://elementary.io/ +[5]: https://www.debugpoint.com/wp-content/uploads/2021/08/elementary-OS-6-ODIN-Desktop-1024x576.jpg +[6]: https://www.deepin.org/zh/ +[7]: https://www.debugpoint.com/wp-content/uploads/2020/09/Deepin-20-Desktop-1024x568.jpg +[8]: https://cn.cutefishos.com/ +[9]: https://www.debugpoint.com/2021/11/cutefish-os-review-2021/ +[10]: https://www.debugpoint.com/wp-content/uploads/2021/11/Cutefish-OS-1024x581.jpg +[11]: https://manjaro.org/downloads/official/kde/ +[12]: https://www.debugpoint.com/wp-content/uploads/2022/03/Manjaro-KDE-Plasma-1024x576.jpg +[13]: https://www.debugpoint.com/2020/10/10-things-to-do-fedora-33-after-install/ +[14]: https://garudalinux.org/ +[15]: https://www.debugpoint.com/wp-content/uploads/2022/03/Garuda-Linux-1024x577.jpg +[16]: https://linuxmint.com/ +[17]: https://www.debugpoint.com/wp-content/uploads/2020/07/Linux-Mint-20-Cinnamon-Edition-Desktop-1024x763.png +[18]: https://nxos.org/ +[19]: https://www.debugpoint.com/wp-content/uploads/2022/03/Nitrux-2.0-Desktop-1024x581.jpg +[20]: https://www.ubuntukylin.com +[21]: https://www.debugpoint.com/wp-content/uploads/2022/03/Ubuntu-Kylin-Desktop-1024x574.jpg +[22]: https://pop.system76.com/ +[23]: https://www.debugpoint.com/wp-content/uploads/2021/12/Pop-OS-21.10-Desktop-1024x579.jpg +[24]: https://t.me/debugpoint +[25]: https://twitter.com/DebugPoint +[26]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[27]: https://facebook.com/DebugPoint diff --git a/published/202204/20220317 XeroLinux- A Beautiful Arch-based Linux With Excellent Customizability by Default.md b/published/202204/20220317 XeroLinux- A Beautiful Arch-based Linux With Excellent Customizability by Default.md new file mode 100644 index 0000000000..22623f4af1 --- /dev/null +++ b/published/202204/20220317 XeroLinux- A Beautiful Arch-based Linux With Excellent Customizability by Default.md @@ -0,0 +1,169 @@ +[#]: subject: "XeroLinux: A Beautiful Arch-based Linux With Excellent Customizability by Default" +[#]: via: "https://itsfoss.com/xerolinux/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14422-1.html" + +XeroLinux:一个漂亮的基于 Arch 的 Linux,天生具备出色的可定制性 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/02/102130wl7d50v1zpti7s25.jpg) + +Arch Linux 是那些希望对他们的操作系统有更多控制权的 Linux 用户的一个流行选择。 + +虽然许多有经验的用户对 Arch Linux 进行了定制,以提供一些最好的用户体验(就其用户界面而言),但对于新的 Linux 用户来说,这可能是一个挑战。 + +如果你不了解 Arch Linux 的具体情况,你可能想读一下这篇 [Ubuntu 与 Arch Linux 比较][1] 的文章。 + +然而,还有一些 [基于 Arch 的发行版][2] 旨在提供一个更容易上手的体验,而不会剥夺你的控制权。 + +**XeroLinux** 是我们最近遇到的其中一个。 + +### XeroLinux:又一个基于 Arch 的发行版 + +![][3] + +[XeroLinux][4] 是 Steve(又名 [TechXero][5])的个人项目,旨在提供一个“华丽”的 Arch Linux 版本。 + +请注意,这是一个充满激情的项目,而不是一个由庞大的贡献者团队支持的主流发行版(还没有)。在你替换你的主系统前,你应该先在虚拟机或测试机上试用它。 + +在这里,我们会为其愉快的开箱即用体验和一些令人更兴奋的地方,简单介绍一下 XeroLinux 的特色。 + +### 安装的简易性 + +XeroLinux 使用 [Calamares 安装程序][6] 来让你轻松地安装 Linux 发行版,而不需要依赖终端或 [引导式 Arch 安装程序][7]。 + +虽然安装体验与流行的 Linux 发行版相似,但你可以在安装时选择图形驱动程序、特定的 Linux 内核和工具。 + +![][8] + +你可以安装 System76 的电源管理驱动,并启用对 Nvidia Optimus Manager 的支持,为你的笔记本电脑切换显卡。有趣! + +你还可以在安装时选择密码管理器、主题、浏览器和各种不同的软件包,这应该会让使用变得很方便。 + +考虑到你可以以选择的形式设置所有基本选项,你在安装后没有太多可担心的。 + +![][9] + +当你选择了需要的东西,只需重新启动并开始使用桌面。 + +### 用户体验 + +XeroLinux 的开箱即用的体验令人印象深刻。桌面的整体外观和感觉包括许多新的功能补充,如显示 CPU 使用情况、网络速度等的小工具。 + +它还支持全局菜单,使应用程序窗口看起来更干净,为 macOS 用户切换到 Linux 提供了舒适的体验。 + +![][10] + +通过所有预装的应用,你可以轻松地安装新的软件,卸载现有的工具并进行各种操作。 + +它同时具有 pamac 和 [Synaptic 包管理器][11](可在安装时选择)。因此,你可以获得大量的软件工具,你可以通过它们中的任何一个轻松安装。 + +其他产品包括两个文件管理器(Dolphin 和 Thunar)、Yakuake 终端、Spectacle 屏幕截图、KWrite、Konsole 等主要 KDE 版本中的其他 KDE 工具。 + +如果你不喜欢 Yakuake 终端仿真器,请参考我们的 [终端仿真器列表][12],找到它的替代品。 + +![][13] + +另外不要忘了,你会得到一个定制的锁屏(登录屏),看起来很不错! + +![][14] + +当你启动系统时,你还会注意到一个 **XeroLinux 配置工具**。它可以让你快速执行一些基本任务,比如检查 NVIDIA 显卡、安装 KVM/QEMU、禁用自动启动、安装 KDE 窗口平铺,以及其他一些配置,如下图所示。 + +![][15] + +### 可定制性 + +XeroLinux 在其主版本中采用了 KDE 桌面环境。因此,你自然会有无尽的定制选项。 + +最好是参考我们的 [KDE 定制指南][16]来获得帮助。 + +除此之外,你还可以看到 [Latte Dock][17],你可以根据自己的喜好进行定制和调整。 + +![][18] + +有几个定制停靠区的选项,确保你仔细调整设置,以免看起来很奇怪。 + +![][19] + +此外,你会得到 [Kvantum Manager][20],可以帮助你安装外部主题。 + +如果这还不够,开发者还提供了一些 RICE/主题和 Grub 主题,你可以在 [官方网站][4] 或 [GitHub 仓库][21] 上找到所列的主题。 + +(LCTT 译注:RICE 不是指大米。它是 “受赛车启发的美容强化Race Inspired Cosmetic Enhancements” 的缩写。原意是指:给汽车增加的部件,使它们看起来很快,但其实内部调校,实际上一样慢。在 Linux 上指各种对桌面的粉饰,使其看起来花哨。) + +换句话说,开发者提供的一些脚本可以帮助你进行改造,但请注意,最好是自己定制,这样就不会出现其他问题。 + +### 桌面环境选项 + +主版本使用的是 KDE,但如果你想尝试一下,你也有另一个 XFCE 变体。(LCTT 译注:由于项目作者实在无力维护两个 DE,因此放弃了 XFCE 变体。) + +XFCE 版是为旧系统量身定做的(或者如果你需要节省系统资源)。 + +它最初还提供了一个 GNOME 版本,但由于每次更新都会出现扩展失效的问题,所以它放弃了对它的支持。如果你对桌面环境感到好奇,你可能想通过我们的 [KDE Plasma 对比 GNOME][22] 文章来了解它们的区别。 + +### 性能 + +考虑到它具有最新可用的 [Linux 内核 5.16][23],它应该可以在各种硬件配置下正常工作。 + +但是,我还没有在裸机上测试过它。根据我虚拟机的使用经验,它运行良好,没有任何特殊问题。 + +以下是其 KDE 版本的资源使用情况: + +![][24] + +使用它的 XFCE 变体时,你可能会注意到较低的资源使用率。 + +### 你应该试试 XeroLinux 吗? + +我喜欢 XeroLinux 的外观和感觉。 + +不仅限于此,在安装时你还可以选择多种软件包和做出各种最好的选择。 + +> [尝试 XeroLinux][4] + +如果你在安装时就知道自己需要什么,那么它应该是一个有吸引力的基于 Arch 的 Linux 发行版。 + +你试过 XeroLinux 了吗? 在下面的评论中让我知道你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/xerolinux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-vs-arch/ +[2]: https://itsfoss.com/arch-based-linux-distros/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/xerolinux-home.jpg?resize=800%2C450&ssl=1 +[4]: https://xerolinux.xyz/ +[5]: https://twitter.com/TechXero +[6]: https://calamares.io/ +[7]: https://itsfoss.com/install-arch-linux-virtualbox/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/xerolinux-install-1.png?resize=800%2C555&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/xerolinux-install.png?resize=800%2C555&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/xerolinux-ui.jpg?resize=800%2C398&ssl=1 +[11]: https://itsfoss.com/synaptic-package-manager/ +[12]: https://itsfoss.com/linux-terminal-emulators/ +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/xerolinux-utilities.jpg?resize=800%2C652&ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/xerolinux-lockscreen.jpg?resize=800%2C546&ssl=1 +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/xerolinux-configuration-tool.jpg?resize=800%2C480&ssl=1 +[16]: https://itsfoss.com/kde-customization/ +[17]: https://github.com/KDE/latte-dock +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/xerolinux-latte-dock.png?resize=800%2C134&ssl=1 +[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/xerolinux-latte-dock-options.jpg?resize=800%2C570&ssl=1 +[20]: https://store.kde.org/p/1005410/ +[21]: https://github.com/xerolinux/xero-layan-git +[22]: https://itsfoss.com/kde-vs-gnome/ +[23]: https://news.itsfoss.com/linux-kernel-5-16/ +[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/xerolinux-resource.png?resize=800%2C468&ssl=1 \ No newline at end of file diff --git a/published/202204/20220325 Budibase- An Open-Source Low-Code Platform to Build Modern Business Apps.md b/published/202204/20220325 Budibase- An Open-Source Low-Code Platform to Build Modern Business Apps.md new file mode 100644 index 0000000000..0344340f04 --- /dev/null +++ b/published/202204/20220325 Budibase- An Open-Source Low-Code Platform to Build Modern Business Apps.md @@ -0,0 +1,141 @@ +[#]: subject: "Budibase: An Open-Source Low-Code Platform to Build Modern Business Apps" +[#]: via: "https://itsfoss.com/budibase/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14433-1.html" + +Budibase:构建现代商业应用的开源低代码平台 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/05/120744w3ed33lnvp88vv1n.jpg) + +你可能会遇到各种各样的工具来帮助你快速构建企业的应用。 + +然而,大多数值得信赖的选择往往是专有产品。因此,你将被锁定在他们的平台上,而对于你利用什么来构建的应用,没有足够的了解。 + +开源的解决方案应该是一个完美的替代品,让你安心,并对你的关键业务应用充满信心。 + +Budibase 就是这样一个令人印象深刻的解决方案。 + +### Budibase:开源的低代码平台让事情变得简单 + +Budibase 是一个越来越受欢迎的开源低代码平台,可以帮助你为企业建立应用。 + +你可以从头开始创建应用,或者使用现有的模板来快速建立表单、机构-客户门户、汽车租赁管理面板、会计师门户、职位申请追踪器等等。 + +![][1] + +虽然它确实使事情变得简单,而不需要你有必要的编程技巧,但它也提供了一些控制,让你在一定程度上定制应用。 + +它支持一系列的数据源:MySQL、Rest API、OracleDB、MongoDB、Google 表格等。 + +你可以选择自我托管并在你的服务器上部署应用,或者利用 Budibase 的云托管服务。 + +### Budibase 的特点 + +[Budibase][2] 提供了大部分的基本功能。让我在这里强调一下重要的功能: + + * 支持外部数据源,包括 MongoDB、MySQL 等。 + * 支持 Rest API 拉取数据。 + * 能够使用应用的内置数据库或上传 CSV 来导入数据。 + * 各种数据类型和功能,包括附件、关系、公式等。 + * API 整合平台,整合不同的 API,帮助你轻松建立内部应用、表单等。 + * 能够使用内部表格生成自动页面。 + * 构建单页应用。 + * 自动生成的 CRUD(创建、读取、更新和删除)页面 + * 私人和公共应用。 + * 只需点击几下就可以定制你的应用的主题。 + * 容易为你的应用实现深色模式主题。 + * 一个功能丰富的表单生成器,满足广泛的要求。 + * 支持 Webhook。 + * 与诸如 Zapier 等的第三方集成。 + * 基于特定触发器的灵活自动化选项。 + * 能够将 JavaScript 添加到你的自动程序中。 + * 为拥有自己基础设施的用户提供自我托管选项。 + * 免费的单点登录认证/管理。 + * 用户管理选项,将团队分配到不同的应用。 + * 支持 SMTP 电子邮件。 + * 电子邮件模板,以配合你的品牌和风格。 + * 支持 OAuth 登录。目前仅限于谷歌。 + * 图表、表格和卡片来优雅地展示数据。 + +总的来说,当你登录到该服务并查看其产品时,还有很多东西可以探索。 + +在我短暂的使用中,我发现用户界面很舒适,很容易使用。为了给你更多的认识,我在下面分享了更多关于使用 Budibase 的信息。 + +### 使用 Budibase 快速建立一个应用 + +在使用此类服务时,用户体验是首要因素。 + +Budibase 在这方面没有让你失望。当你开始使用 Budibase 时,你会得到一个很好的用户体验。 + +就我使用过的开源平台而言,用户体验并不总是强项。但是,在这种情况下,是用户体验使这个工具易于使用。 + +你可以迅速开始建立一个应用程序,添加你的源,并在几次点击中开始设计。 + +![][3] + +你可以选择内部数据库或选择外部源。该平台让你根据需要编辑/创建/导入数据。 + +![][4] + +而且,只需点击几下(取决于你应用的规模),你就可以开始设计屏幕和调整布局。 + +![][5] + +它完全是一个可视化编辑器,所以你会得到你所看到的东西。在布局中添加容器、分区、表单、卡片、图表和许多其他元素。 + +![][6] + +调整主题是一件轻而易举的事。因此,你可以根据你的要求,匹配你的品牌风格/样式,或者根据你的要求进行创意。 + +![][7] + +你可以轻松地编辑数据,创建新的数据字段,也可以为数据启用搜索索引。 + +![][8] + +不要忘了,你还可以获得所有的自动化选项,与其他服务集成,使用 Webhook、cron 任务或应用动作来响应触发器。这些是为你的用户建立一个最有效的应用的一些最重要的东西。 + +下面是我使用 Budibase 建立一个样本应用跟踪系统时的情况: + +![][9] + +当然,你可以选择在你的服务器上发布应用,或者使用 Budibase 的云服务。 + +### 总结 + +Budibase 是一个非常有用的低代码平台,应该可以帮助个人和企业快速建立各种应用。你应该在其官方网站和 [GitHub 页面][10]上探索更多关于它的信息。 + +> [Budibase][2] + +它消除了聘请专家为各种用例构建应用的需要。而且,作为一个你可以自行托管的开源平台,它可以让你扩展并提供对构建应用的完全控制,而无需支付额外费用。 + +如果需要,你还可以选择其企业产品,提供高级支持和专门定制的服务。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/budibase/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/budibase-home.png?resize=800%2C467&ssl=1 +[2]: https://budibase.com/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/budibase-data-sources.png?resize=800%2C597&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/budibase-edit-fields.png?resize=800%2C693&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/budibase-design.png?resize=800%2C477&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/budibase-layout.png?resize=800%2C515&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/budibase-theme-tweak.png?resize=800%2C696&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/budibas-application-create.png?resize=800%2C274&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/budibase-sample-app.png?resize=800%2C364&ssl=1 +[10]: https://github.com/Budibase/budibase diff --git a/published/202204/20220325 Linux Mint Debian Edition 5 - Perfection with Stability -Review.md b/published/202204/20220325 Linux Mint Debian Edition 5 - Perfection with Stability -Review.md new file mode 100644 index 0000000000..fd55370a6a --- /dev/null +++ b/published/202204/20220325 Linux Mint Debian Edition 5 - Perfection with Stability -Review.md @@ -0,0 +1,152 @@ +[#]: subject: "Linux Mint Debian Edition 5 – Perfection with Stability [Review]" +[#]: via: "https://www.debugpoint.com/2022/03/linux-mint-debian-edition-5-review/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14467-1.html" + +Linux Mint Debian Edition(LMDE) 5 – 完美稳定 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/13/132621gz9v9c49k349ebe4.jpg) + +> 我们对最近发布的 Linux Mint Debian Edition 5(LMDE 5)的性能、稳定性和用户友好性等方面进行了评测。这里是我们的发现。 + +在 Linux Mint Debian Edition LMDE 4(Debbie)发布两年多后,Linux Mint 团队宣告了 Linux Mint Debian Edition LMDE 5(LMDE 5)的发布。LMDE 5 基于 [Debian 11 Bullseye][1] ,它带来了长期支持的 Linux 内核 5.10 和 Debian 软件包源。除内核版本以外,大多数的应用程序和软件包与 Linux Mint 20.3 几乎完全相同。 + +让我们深入了解一下。 + +### LMDE 5 评测 + +我们测试 Linux Mint Debian Edition 5(LMDE 5)是在现有的较旧的硬件下: + + * 英特尔酷睿 i3 第一代 + * 4GB DDR3 内存 + * 博通芯片 + * 英伟达® GeForce® 315M + * 固态硬盘 + +#### ISO 下载、现场介质和安装 + +从新设计的 Linux Mint 网站找到并下载 ISO 文件是很容易的。现场介质Live media启动很顺利,通过桌面上的安装图标启动了安装程序。 + +LMDE 使用的一款修改版的 Debian 安装器。它不是 Calamares 。普通的 Debian 安装器是很难操作的,[在我看来] 有点 [让新用户感到困惑][2] 。但是,Linux Mint 团队使其非常容易安装,只需几个步骤,并从 Debian 安装器中移除了所有使人困惑的选项。 + +你只需要提供安装位置、键盘布局、名字和密码,就可以开始安装了。安装器的分区系统使用 GParted ,它很方便好用。 + +因此,在我的测试的虚拟机和物理机硬件中,安装过程都很顺利。 + +在物理机系统中安装花费了 4 到 5 分钟,而虚拟机系统中的安装时间约为 3 分钟。 + +#### 第一印象 + +![Linux Mint Debian Edition 5 \(LMDE5\) Desktop][3] + +如果你熟悉 Linux Mint 早期的 Cinnamon 桌面,那么你不会在这个 Debian 版本中找到什么不同。它们是一样的。如果你是第一次使用 Linux Mint 的 Cinnamon 桌面环境,那么在你完成你的安装后,你会看到一个漂亮而干净的桌面。 + +桌面图标、完美调整过的颜色和主题、底部任务栏、系统托盘,这一切都配合有序,让你能够立刻上手。 + +不管你使用低端还是高端的硬件,LMDE 都能快速响应,应用程序能够很好的工作。应用程序的切换和整体桌面的响应都很可靠。 + +你得到的是经过良好测试的应用程序和软件包,而基于 Debian 的稳定性,很少会出现故障。这意味着不必担心软件包的冲突、更新缺失,以及 Linux 系统的常见问题。 + +#### 预装的应用程序 + +Linux Mint(不仅仅是 Debian 版本)的优势之一是它的预装的应用程序。许多 Linux 发行版由于 ISO 大小等原因,在 ISO 安装程序中不包括必要的应用程序。 + +但是,Linux Mint 团队全心全意为它们的用户考虑,打包了所有你需要的必要应用程序。这照顾到了大多数用户的需求。它有助于减少最终用户在安装 LMDE 5 后搜索和安装兼容应用程序方面的负担。 + +例如,在 LMDE 5 中,已默认安装下面的必备软件,随时待用: + + * 绘图应用 + * 多媒体:Celluloid 媒体播放器、Hypnotix、Rythmbox + * Torrent 客户端:Transmission 3.0 + * 完整的办公套件:LibreOffice 7.0 + * Email 客户端:Thunderbird 91.0 + * 网页浏览器:Firefox 97.0 + +这不是所有。对于下面的所有的具体使用情况,你都会得到一个专门的原生应用程序。用户不需要为这些寻找一个单独的应用程序: + + * 屏幕截图和屏幕保护程序 + * 减少眼睛疲劳的工具 + * USB 格式化工具和镜像写入器 + * 便签 + * Synaptic 软件包管理器 + * 系统备份和恢复 + * 防火墙工具 + +#### LMDE5 的性能表现怎么样? + +看到一个发行版按照预期的表现,总是令人感兴趣的。而 LMDE 5 的性能表现远超预期。 + +在空闲状态下,它消耗 750 MB 的内存和 2% 的 CPU 。 + +![Performance During the light workload][5] + +接下来,我使用下面的任务让它完成繁重的工作负载: + + * Firefox(打开三个标签页,其中一个播放 YouTube 视频) + * LibreOffice Calc(打开一个表格) + * 绘图应用程序(打开一个实例) + * 设置 + * 一个终端窗口 + * 文件管理器 + +在上述的工作负载中,它消耗了大约 1.5 GB 的内存和 14% 的 CPU 。显然,大部分的资源都被 Firefox 消耗了。 + +![Performance During heavy workload][6] + +在我看来,这是一个完美的指标,而且对旧硬件进行了很好的优化分配。上述指标是在物理机系统上测量的。 + +#### 连接性 + +连接性是任何操作系统的不可或缺的一部分。LMDE 5 能够连接到 Wi-Fi(使用一款老旧的博通芯片)和连接到蓝牙音箱,而不需任意的额外调整。 + +在我的测试期间,音量控制与蓝牙守护进程配合得很好。 + +此外,我们也测试了 USB 接口设备的热插拔,它们可以自动侦测和挂载,而没有遇到任何问题。 + +所以,没有什么意外,这也是意料之中的。 + +### 有什么错误吗? + +我在测试期间没有遇到任何错误。一切都运行良好。 + +但是当我关闭我的物理测试系统的笔记本盖板时,我发现一个错误。在它进入待机状态后,不能将其唤醒。我无法看到登录屏幕,屏幕是黑色的,没有任何光标。我必须因重启才能进入系统。 + +这可能是我测试设备上的特定硬件设备的问题。我相信它在新的硬件系统上不会有任何的问题。 + +### 总结 + +总结一下 LMDE 5 的评测,它显然是最稳定、最优化的 Linux 发行版。如果你计划在未来两年或更长的时间段内使用一款用于日常用途的系统,你可以信赖这个版本。因此,如果你需要一款非基于 Ubuntu 的稳定的、快速的、低维护率的长期日用系统,并运行在你的旧机器或新机器上,这会是一个完美的选择。请试试。 + +你可以 [在官方网站上][7] 下载 LMDE 5 。 + +感谢阅读。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/03/linux-mint-debian-edition-5-review/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/2021/05/debian-11-features/ +[2]: https://www.debugpoint.com/2021/01/install-debian-buster/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/03/Linux-Mint-Debian-Edition-5-LMDE5-Desktop-1024x580.jpg +[4]: https://www.debugpoint.com/2021/12/zorin-os-16-lite-review-xfce/ +[5]: https://www.debugpoint.com/wp-content/uploads/2022/03/Performance-During-light-workload-1024x606.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/03/Performance-During-heavy-workload-1024x601.jpg +[7]: https://linuxmint.com/edition.php?id=297 +[8]: https://t.me/debugpoint +[9]: https://twitter.com/DebugPoint +[10]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[11]: https://facebook.com/DebugPoint diff --git a/published/202204/20220329 5 Reasons Why-Zorin OS-is an Ideal Choice for Beginners.md b/published/202204/20220329 5 Reasons Why-Zorin OS-is an Ideal Choice for Beginners.md new file mode 100644 index 0000000000..5ee210b85a --- /dev/null +++ b/published/202204/20220329 5 Reasons Why-Zorin OS-is an Ideal Choice for Beginners.md @@ -0,0 +1,128 @@ +[#]: subject: "5 Reasons Why Zorin OS is an Ideal Choice for Beginners" +[#]: via: "https://news.itsfoss.com/why-zorin-os-beginners/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14418-1.html" + +为什么 Zorin OS 是初学者的理想选择 +====== + +> 对于初学者来说,Zorin OS 是一个绝佳的选择。本文将说明我们认为 Zorin OS 是理想选择的 5 个理由。 + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/zorin-os-beginners.png?w=1200&ssl=1) + +Zorin OS 无疑是目前最 [漂亮的 Linux 发行版][1] 之一。 + +然而,它并不局限于有一个漂亮的外观。与其他一些竞争者相比,它也在总体上提供了良好的用户体验。 + +所以,这就是为什么我们也推荐它作为 [新用户的首选之一][2]。本文中,我将重点介绍一些原因,正是它们使 Zorin OS 成为初学者的理想选择。 + +### 1. 类似 Windows 的用户界面 + +![][3] + +考虑到 Windows 庞大的用户基础,大多数刚接触 Linux 的用户都是从 Windows 转过来的。 + +如果你已经使用过某个 [流行的 Linux 发行版][4],你当然可以很轻松地切换到其他发行版。 + +然而,如果你从未使用过 Linux,那么对你而言,用户界面越熟悉,你就会越适应。 + +[Zorin OS][5] 是众多 [Windows 风格的 Linux 发行版][6] 之一,在这里你可以找到与 Windows 10 和 11 的开始菜单/任务栏相似的的菜单/布局。 + +![Zorin OS 的 Windows 11 布局][16] + +Windows 11 的布局在其专业版中提供(我们稍后会讨论到它)。 + +### 2. 出色的用户体验 + +与 Linux Mint、Ubuntu 等发行版相比,Zorin OS 提供了一个独特而精致的外观。 + +它的图标、动画效果和整体视觉效果(以及可用的壁纸)都看起来令人惊叹,并且它们完美地适合于任何现代系统。 + +![][7] + +Zorin OS 预装了必要的应用程序,让你有一个良好的初始体验,并使你可以十分方便地 [在 Linux 上安装 Windows 软件][8](如果你在软件中心没有找到这个软件的话)。 + +![][9] + +在使用 Zorin OS 的过程中,我从未遇到过错误,也不需要使用终端来完成工作。所以,我想说,它提供了用户友好的体验。 + +虽然 [我日常使用的系统是 Pop!_OS][10],但偶尔切换到 Zorin OS 也是一种新鲜的体验。 + +我目前还没有在我的双显示器设置上试用过 [Zorin OS][5],并分享我的经验。我将在不久之后发布一篇相关文章,敬请期待。 + +### 3. 基于 Ubuntu + +![][11] + +[Ubuntu][12] 是最受欢迎的 Linux 发行版,这归功于它的易用性和现代设计方法。 + +虽然它提供了一个完全不同的用户体验,但它支持大量的软件集合,并与大多数硬件配置兼容。 + +Zorin OS 是基于 Ubuntu 构建的,因此它能为你提供同样的好处,并且它还对用户界面和其他方面进行了调整。 + +作为基于 Ubuntu 的 Linux 发行版之一,Zorin OS 无疑是值得推荐给初学者的。 + +### 4. 专业版 + +与 Windows 相比,[使用 Linux 的好处][13] 之一是,你可以在任意数量的系统上免费安装和分发它。 + +你不需要为此购买许可证。然而,Zorin OS 也提供了一个可选的“专业”版,一次性收费约为 39 美元。 + +专业版提供了额外的壁纸、布局(类似 macOS,如上图所示),以及预装的创意和生产力软件。不用担心,所有包含的软件都是免费和开源的。 + +![][17] + +因此,通过这个专业版,你获得了更好的开箱即用的体验和一些额外的功能,与此同时,你也支持了他们的未来发展。 + +### 5. 对旧电脑的系统资源要求较低 + +与其他一些竞争者不同,Zorin OS 提供了一个由 XFCE 桌面环境驱动的独立的 [“精简版”][15]。 + +这个精简版是为在旧电脑上运行而定制的,资源占用最少。 + +如果你想为你的旧电脑注入活力,或者只是想让你的电脑消耗最少的资源,Zorin OS 精简版可能会是一个不错的选择。 + +> [获取 Zorin OS][5] + +### 总结 + +除了上面提到的几点,Zorin OS 还提供了一个教育版,专门为学校、学生和教师定制。 + +当你开始使用 Zorin OS,无论你的需求是什么,它都能在不同的使用场景中派上用场。我认为它应该是初学者的理想选择。 + +欢迎你在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/why-zorin-os-beginners/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/beautiful-linux-distributions/ +[2]: https://itsfoss.com/best-linux-beginners/ +[3]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/12/zorin-os-desktop-16-lite.jpg?w=1200&ssl=1 +[4]: https://itsfoss.com/best-linux-distributions/ +[5]: https://zorin.com/os/ +[6]: https://itsfoss.com/windows-like-linux-distributions/ +[7]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/zorin-photo-app.png?w=857&ssl=1 +[8]: https://itsfoss.com/use-windows-applications-linux/ +[9]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/slack-windows-install.png?w=943&ssl=1 +[10]: https://itsfoss.com/why-use-pop-os/ +[11]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/ubuntu-illustration.png?w=1000&ssl=1 +[12]: https://itsfoss.com/getting-started-with-ubuntu/ +[13]: https://itsfoss.com/linux-better-than-windows/ +[14]: https://zorin.com/os/pro/ +[15]: https://news.itsfoss.com/zorin-os-16-lite-release/ +[16]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/zorin-os-16-windows-11-layout.png?resize=1568%2C882&ssl=1 +[17]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/zorin-os-16-pro-scaled-1.jpg?w=1200&ssl=1 \ No newline at end of file diff --git a/published/202204/20220329 Metadata Cleaner- Remove Your Traces From Pictures and Documents in Linux.md b/published/202204/20220329 Metadata Cleaner- Remove Your Traces From Pictures and Documents in Linux.md new file mode 100644 index 0000000000..b0ef89ef04 --- /dev/null +++ b/published/202204/20220329 Metadata Cleaner- Remove Your Traces From Pictures and Documents in Linux.md @@ -0,0 +1,116 @@ +[#]: subject: "Metadata Cleaner: Remove Your Traces From Pictures and Documents in Linux" +[#]: via: "https://itsfoss.com/metadata-cleaner/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14437-1.html" + +Metadata Cleaner:在 Linux 中清除你在图片和文件中的痕迹 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/06/082027g9h9nzgzhw66ffhn.jpg) + +> 摆脱元数据对增强隐私至关重要。Metadata Cleaner 是一个开源的 Linux 应用,可以帮助你做到这一点。让我们在这里探讨更多。 + +元数据无处不在,它在文档中、在信息中、在图片中,在各种文件中。 + +当你检查一个文件的属性时,你可以很容易地访问元数据。 + +然而,用户在共享文件之前,往往不注重消除或摆脱元数据。主要是因为他们可能不知道有什么简单的工具可以使这项工作更容易。 + +Metadata Cleaner 就是这样一个供 Linux 用户使用的工具。 + +### Metadata Cleaner:轻松摆脱你的元数据 + +![][1] + +Metadata Cleaner 帮助你删除与元数据相关的信息的痕迹。它利用 [mat2][2] 来删除元数据。 + +换句话说,你可以将这个 GUI 当成 mat2 的前端。 + +例如,一张照片包括拍摄地点、使用的相机、镜头信息等信息。 + +虽然这对某些人来说可能是有用的信息,但如果你想保持各种细节的私密,你就需要删除元数据。 + +文件的情况也是如此。删除元数据可以确保提高隐私性,无论是对你的业务还是个人使用。 + +你可以添加目标文件,并使用 Metadata Cleaner 处理它们,使它们得到清理。 + +**注意**:在清理之前,你必须保留一份文件的备份。摆脱你的元数据可能会导致你的文件发生剧烈的变化,比如无法选择 PDF 文件中的文本,压缩图片等。 + +### Metadata Cleaner 的特性 + +![][3] + +Metadata Cleaner 是一个简单的工具,具有一些有用的功能。让我在下面提到它的主要亮点: + + * 能够添加多个文件进行清理。 + * 检查每个添加的文件的元数据信息。 + * 查看与每个添加的文件相关的元数据信息的数量。 + * 一键式清理,最大限度地去除元数据。 + * 有一个轻量级的清理模式,不会对文件造成很大影响。 + * 支持键盘快捷键。 + * 可以从内部创建一个新的窗口。 + * 你可以添加整个文件夹来处理多个文件。 + +我用一般的截图、几张照片和从网上下载的文件来开始测试。 + +![][4] + +正如你在上面的截图中注意到的,PDF 文件包含了很多关于其来源的信息。 + +这只是一个例子。同样,如果你想与某人或公众分享一个 PDF 文件,不想让别人看到它的来源信息,你可以使用 Metadata Cleaner 清理你的踪迹。 + +如前所述,如果文件对你很重要,如果清理过程以你不希望的方式影响了文件,请确保适当的备份。 + +![][5] + +你也可以使用它的轻量级清理模式,在不影响文件的情况下进行最小的元数据清除。 + +例如,我对一个 PDF 样本使用了标准清理方法,下面是它的样子: + +![][6] + +同样,在处理文档和图片时,你的大部分的基本数据会被移除。 + +### 在 Linux 中安装 Metadata Cleaner + +Metadata Cleaner 是以 [Flatpak 包][7] 的形式提供的。因此,考虑到你 [设置了 Flatpak][8] 或者你已经启用了它,你可以在任何 Linux 发行版上安装它。 + +你可以在终端使用以下命令来安装它(如果你没有软件中心集成): + +``` +flatpak install flathub fr.romainvigier.MetadataCleaner +``` + +你可以到它的 [网站][9] 或 [GitLab 页面][10] 去探索更多关于它的信息。 + +> [Metadata Cleaner][9] + +你以前尝试过清除元数据的痕迹吗?你对这个工具有什么看法?请在下面的评论中告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/metadata-cleaner/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/metadatacleaner.jpg?resize=800%2C561&ssl=1 +[2]: https://0xacab.org/jvoisin/mat2 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/metadatacleaner-3.png?resize=800%2C592&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/metadatacleaner-1.png?resize=800%2C592&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/metadatacleaner-lightweight-mode.png?resize=800%2C199&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/metadatacleaner-example.png?resize=800%2C326&ssl=1 +[7]: https://itsfoss.com/what-is-flatpak/ +[8]: https://itsfoss.com/flatpak-guide/ +[9]: https://metadatacleaner.romainvigier.fr/ +[10]: https://gitlab.com/rmnvgr/metadata-cleaner/ diff --git a/published/202204/20220330 10 Lightweight Linux Distributions for your Old Hardware in 2022.md b/published/202204/20220330 10 Lightweight Linux Distributions for your Old Hardware in 2022.md new file mode 100644 index 0000000000..e547973fc5 --- /dev/null +++ b/published/202204/20220330 10 Lightweight Linux Distributions for your Old Hardware in 2022.md @@ -0,0 +1,205 @@ +[#]: subject: "10 Lightweight Linux Distributions for your Old Hardware in 2022" +[#]: via: "https://www.debugpoint.com/2022/03/lightweight-linux-distributions-2022/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14505-1.html" + +最适合旧计算机的 10 款 Linux 发行版 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/24/183130gd7d3gl8pmi5zr0u.jpg) + +我们重点推荐 10 款轻量级 Linux 发行版,它们是 2022 年最适合旧 PC 的发行版。我们将向你们介绍它们的特色,以及为什么它们会成为复活旧硬件的完美之选。 + +我们认为你不应该扔掉任何硬件,尤其是 PC 和它的配件。在理想的情况下,设计良好的软件总是能够在任意硬件上运行。有很多专门针对旧硬件和 PC 设计的 [Linux 发行版][1] 。而你可以在这些 Linux 操作系统的帮助快速地恢复它们的活力。在这篇文章中,我们重点推荐 10 款这样的 Linux 发行版,它们是 2022 年的轻量级、对旧硬件友好的 Linux 发行版。 + +### 2022 年的 10 款轻量级 Linux 发行版 + +#### 1、Linux Lite + +在这份 2022 年的列表中,我们推出的第一款轻量级 Linux 发行版是 Linux Lite 。Linux Lite 是一款基于 Ubuntu 和 Debian 的、正在不断开发和完善的 Linux 发行版。这款有十年开发历史的 Linux 发行版非常适合于你的旧硬件,这些硬件需要适用且设计良好的发行版。该开发团队将这个发行版作为那些硬件不再被 Windows 所支持的用户的理想起点。这个发行版的主要优势是良好的自定义和极好看的 Xfce 桌面,并基于 Ubuntu,采用了最新的内核,当然,它还有一个 32 位 ISO 镜像。 + +![Linux Lite][2] + +特点: + + * 基于 Ubuntu + * 自定义的 Xfce 桌面环境 + * 原生应用程序 + * 支持 32 位 + * 积极开发 + * 最小系统要求 1 GB 内存 + +> **[下载 Linux Lite][3]** + +#### 2、Puppy Linux + +在这份列表中的第二个重要的发行版是 Puppy Linux 。Puppy Linux 与传统发行版稍有不同。它被设计成在内存中运行,而不需要安装在物理机系统中。如果配置得当,你可以保存会话,此外,即使你移除了可启动介质,它也可以继续很好地工作。 + +![Puppy Linux – one of the best lightweight Linux Distribution in 2022][4] + +这个 Linux 发行版与 Ubuntu 的 LTS 版本的二进制文件是兼容的;其最新的版本基于 Ubuntu 20.04 LTS。因为 Ubuntu 放弃了 32 位的支持,所以其最新版本也放弃了 32 位的支持。 + +Puppy Linux 非常适合于旧计算机、上网本以及内存小于 1GB 的机器。在其核心,运行着超快速的 JWM(Jow’s Window Manager)。Puppy 软件包管理器支持 .deb 、.rpm 及其原生的 PET 软件包。 + +总的来说,它是一款完美的、精心设计的 Linux 发行版,毫无疑问适合于旧硬件。 + +特点: + + * 基于 Ubuntu LTS 版本 + * 能够在低端的上网本上运行 + * 即使移除可启动介质后,也可以直接在内存中运行 + * 特有的软件包管理器 – Puppy 软件包管理器 + * JWM 窗口管理器 + +> **[下载 Puppy Linux](https://puppylinux.com)** + +#### 3、BunsenLabs Linux + +在这份列表中的第三款轻量级 Linux 发行版是 BunsenLabs Linux ,它是 Crunchbang 项目的继任者。BunsenLabs Linux 基于 Debian 稳定分支,为你的低端系统带来了现代应用。这个发行版为低端硬件提供了一个 32 位版本的镜像,并为你的常规硬件提供一个标准的 64 位版本的镜像。在其核心,BunsenLabds 由一个预配置的 OpenBox 窗口管理器所驱动,并带有令人惊艳的 tint2 面板、预配置的 Conky 和 jgmenu 。 + +![BunsenLabs Linux][5] + +这是一款针对旧硬件的、设计良好、速度超快、稳定且外观漂亮的发行版。 + +特点: + + * 基于 Debian 稳定分支 + * Openbox 窗口管理器,附带 tint2 面板、Conky 和 jgmenu + * 提供 32 位安装程序 + * 可以通过官方论坛获取帮助和支持 + +> **[下载 BunsenLabs Linux][6]** + +#### 4、Lubuntu + +Lubuntu 是一款著名的轻量级 Linux 发行版。它是一款官方的 Ubuntu Linux 衍生版本,其特点是使用轻量级 LxQt 桌面环境。Lubuntu 在给予你现代的 Ubuntu Linux 软件包和技术的同时,也针对你的低端硬件提供了 LxQt 桌面环境。尽管与这份列表中的其它的发行版相比,它可能需要更多的一些系统资源,但是对于旧硬件来说,它仍然是一个适合的 Linux 发行版。 + +![Lubuntu][7] + +如果你需要一款稳定且开箱即用的适中量级的 Linux 发行版,那么,请选择 Lubuntu 。 + +> **[下载 Lubuntu][8]** + +#### 5、Absolute Linux + +第五款轻量级 Linux 发行版是 Absolute Linux ,它基于 Slackware Linux 。这个发行版在其安装程序镜像中打包了所有日常需要的应用程序,以便你可以获得一款开箱即用的发行版。Absolute Linux 以使用 IceWM 和 ROX 桌面环境为特色,在旧硬件中使用它们时,能为你带来极致的速度。它不使用 systemd,这为它提供了比其他发行版更多的优势。 + +![Absolute Linux][9] + +特点: + + * 基于 Slackware + * 不使用 systemd + * 打包了必要的软件包 + * IceWM 桌面环境、Slapt-get 软件包管理器 + +> **[下载 Absolute Linux][10]** + +#### 6、antiX Linux + +我们想重点推荐的另一款轻量级 Linux 发行版是 antiX Linux 。antiX Linux 基于 Debian 稳定分支,并带来一些吸引人的功能。在其核心,它使用 IceWM、Fluxbox 和 ROX 桌面环境,给予你一种优秀而快速的桌面体验。它完全没有使用 systemd,而是使用 sysVinit 和 runit 系统。antiX Linux 还为你提供了 32 位安装程序,并且还四个变体 – 完全版、核心版、基本版以及网络版,以满足不同的实际使用情况。 + +![antiX Linux][11] + +特点: + + * 基于 Debian 稳定分支 + * 32 位安装程序 + * 不使用 systemd + * IceWM 及其它的窗口管理器衍生特色版本 + +> **[下载 antiX Linux][12]** + +#### 7、LXLE + +LXLE Linux 是 Lubuntu LTS 的一个变体,使用 LXDE 桌面环境而非 LXQt 桌面环境。其对应用程序、安装程序以及其它功能的选择,使其成针对旧硬件的一款完美的发行版。它基于稳定的 Ubuntu LTS 版本,是以快速的 LXDE 桌面环境来复兴你的旧系统的理想选择。 + +![LXLE Linux][13] + +然而,就我个人见解,我感觉 LXQt 比 LXDE 稍快一点。好吧,这种反馈可能是因人而异的,对你来说可能是不同的。现在,没有多少 Linux 发行版能向你提供 LXDE 桌面环境的衍生版本。因此,对于日常使用的来说,它可能是一款独特的轻量级的 Linux 发行版。 + +> **[下载 LXLE][14]** + +#### 8、Porteus Linux + +Porteus Linux 是 Slackware Linux 的翻版,以旧的 KDE 4.0+ 桌面环境(KDE Plasma 系列之前的版本)为特色。这款超快的 Linux 发行版非常适合你的古董硬件,因为它基于最先进的 Slackware ,并且向你提供了 32 位版本。这款发行版可以从现场 USB/CD 或任意可启动介质运行,安装程序仅 300 MB 大小。 + +如果你喜欢老款 KDE(像我一样!)和 Slackware 的简单易用,对你来说这将会是一个完美的发行版,甚至针对你的新硬件也是一样。 + +![Porteus Linux][16] + +> **[下载 Porteus Linux][17]** + +#### 9、Q4OS + +Q4OS 是这份列表中的一款独特的 Linux 发行版。它针对的是现今已经过时的旧 Windows 系统。曾经很多运行过 Windows XP 和 Windows 7 的老式 PC,它们不再能很好地运行 Windows 和一些现代的 Linux 发行版,因为现代的操作系统要求更多的计算能力和资源。 + +Q4OS 针对这些实际使用实例,给予你一款精心设计的 Linux 发行版,附带有 32 位安装程序、 Windows 安装程序、Trinity 桌面环境,以及预制的 Windows 主题等。 + +![Q4OS][18] + +> **[下载 Q4OS][19]** + +#### 10、MX Linux + +在这份列表中的最后一款 Linux 发行版是著名的 MX Linux ,它凭借其特色和独特性在当今时代打响了知名度。然而,我都怀疑是否应该将 MX Linux 列为轻量级。因为在我看来,如果你考虑到它的 KDE Plasma 衍生版本,它应该是中等量级的 Linux 发行版。 + +![MX Linux][20] + +不管怎么说,它的一些特色使其成为一款轻量级 Linux 发行版的完美候选版本。MX Linux 基于 Debian 稳定分支,并使用了 antiX 组件创建。它的特点是有自己的用于更多工作流的 MX Linux 原生应用程序。你可以使用 KDE Plasma 、Xfce 和 Fluxbox 作为桌面环境。 + +> **[下载 MX Linux][21]** + +### 总结 + +如果你仔细观察就会发现,我们在这里所列出的大多数的轻量级 Linux 发行版都基于 Debian Linux 的。它是真正的 “通用操作系统”。现代的 Linux 桌面环境,像 GNOME 40+ 、KDE Plasma 和 Systemd 初始化系统,已经不再兼容旧硬件。此外,随着技术的进步,引入了更多的软件复杂性,需要更高端的硬件。 + +尽管如此,我希望你可以从这份列表中找到一些为你的旧笔记本电脑或 PC 选择轻量级 Linux 发行版的灵感。每一款发行版都提供了不同的体验,但是都有共同的目标:让你的旧硬件恢复活力。所以,任君采撷。 + +感谢阅读,请发表你的评论。如果这对你有所帮助,那怕说声“谢谢”也是好的。 + +*一些图像文件的版权: 各自的 Linux 发行版* + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/03/lightweight-linux-distributions-2022/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/category/distributions +[2]: https://www.debugpoint.com/wp-content/uploads/2022/03/Linux-Lite-1024x576.jpg +[3]: http://www.linuxliteos.com/ +[4]: https://www.debugpoint.com/wp-content/uploads/2022/03/Puppy-Linux-one-of-the-best-lightweight-Linux-Distribution-in-2022-1024x579.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/03/BunsenLabs-Linux.jpg +[6]: https://www.bunsenlabs.org/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/03/Lubuntu-1024x576.jpg +[8]: https://lubuntu.me/ +[9]: https://www.debugpoint.com/wp-content/uploads/2022/03/Absolute-Linux-1024x640.jpg +[10]: https://www.absolutelinux.org/ +[11]: https://www.debugpoint.com/wp-content/uploads/2022/03/antiX-Linux-1024x640.jpg +[12]: https://antixlinux.com/ +[13]: https://www.debugpoint.com/wp-content/uploads/2022/03/LXLE-Linux-1024x576.jpg +[14]: http://www.lxle.net/ +[15]: https://www.debugpoint.com/2022/01/best-gnome-apps-part-3/ +[16]: https://www.debugpoint.com/wp-content/uploads/2022/03/Porteus-Linux-1024x576.jpg +[17]: http://www.porteus.org/ +[18]: https://q4os.org/style/image5.jpg +[19]: https://q4os.org/ +[20]: https://www.debugpoint.com/wp-content/uploads/2022/03/MX-Linux-1-1024x515.jpg +[21]: https://mxlinux.org/ +[22]: https://www.debugpoint.com/tag/top-10-list +[23]: https://t.me/debugpoint +[24]: https://twitter.com/DebugPoint +[25]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[26]: https://facebook.com/DebugPoint diff --git a/published/202204/20220330 Thunderbird 102 is Getting Several Exciting New Features- Here Are 7 of Them.md b/published/202204/20220330 Thunderbird 102 is Getting Several Exciting New Features- Here Are 7 of Them.md new file mode 100644 index 0000000000..5624aa0d41 --- /dev/null +++ b/published/202204/20220330 Thunderbird 102 is Getting Several Exciting New Features- Here Are 7 of Them.md @@ -0,0 +1,129 @@ +[#]: subject: "Thunderbird 102 is Getting Several Exciting New Features! Here Are 7 of Them" +[#]: via: "https://news.itsfoss.com/thunderbird-102-features/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14421-1.html" + +7 个 即将发布的 Thunderbird 102 版本的新功能 +====== + +> Thunderbird 102 将带来有用的新功能以及 UI/UX 升级。在此查看其中最精彩的内容! + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/thunderbird-102.jpg?w=1200&ssl=1) + +毫无疑问,Thunderbird 是 Linux 上最好的 [电子邮件客户端][1] 之一。 + +它是 Mozilla 基金会的一个开源产品,是一个具有强大功能的可靠的电子邮件客户端。 + +在 [最近的更新][2] 中,它已经新增了一些功能以及视觉上的改进。 + +现在,随着 Thunderbird 102 版本即将发布,它将添加更多激动人心的功能。 + +在一条 [推特讨论][3] 中,Thunderbird 分享了所有关于此次更新的信息。我在这里挑选其中的关键亮点介绍一下。 + +### Thunderbird 102:更新了什么? + +Thunderbird 102 版本将是一次重大升级,它增加了一些有用的功能,[预期发布时间][4] 为 2022 年 6 月 28 日。其中包括下面这几个变化: + + * 空间工具栏 + * 新的地址簿 + * 支持 Matrix 协议 + * 链接预览卡片 + * 账户设置中心 + * 导入/导出 + * 重新设计的邮件标题栏 + +这听起来不错吧,这里还有一些关于以上变化的更多细节。 + +### 1. 空间工具栏 + +新的“空间工具栏Spaces Toolbar”位于左边的侧边栏中,它将不同的活动以图标的形式分隔开来。 + +![][5] + +你可以更容易地在电子邮件客户端内的多个标签间导航,也可以更容易地管理它们。 + +你也可以折叠工具栏,让它作为一个图标显示在标签栏中,为你节省一些屏幕空间。 + +![][6] + +### 2. 新的地址簿 + +![][7] + +地址簿有了新的外观,它应该能帮助你轻松找到你的联系人,并与他们进行互动。 + +联系人信息的整体布局看起来更容易访问,它提供了你想知道的所有细节,理应也能为你提供良好的用户体验。 + +### 3. 支持 Matrix 协议 + +Matrix 是一个流行的分布式开源聊天协议。因此,在 Thunderbird 102 版本中,你将能够开箱即用 Matrix 的聊天功能,非常轻松。 + +Matrix 最初只在测试版中作为实验性功能提供。 + +你可以期待它在未来的进一步完善。 + +### 4. 链接预览卡片 + +![][8] + +链接预览将帮助用户建立对链接内容的预期,有助于改善用户体验。 + +而且,对于像 Thunderbird 这样的直截了当的电子邮件客户端,我从未指望它会提供链接预览这样的功能,直到现在。 + +每当你在电子邮件编辑器email composer中添加一个链接时,你都可以选择将其转换为丰富的链接预览。 + +### 5. 账户设置中心 + +![][9] + +对于任何服务/应用程序来说,有一个简单的设置过程都是极其重要的。 + +Thunderbird 102 版本改进了所有账户设置功能的体验,如添加账户、管理日历、导入配置文件等。 + +### 6. 默认的导入/导出功能 + +到目前为止,你都必须依靠一个插件来导入/导出个人资料数据。 + +而在 Thunderbird 102 版本中,导入/导出功能将是开箱即用的,无需使用附加组件。 + +### 7. 重新设计的邮件标题 + +邮件的标题/主题得到了细微的升级,以更好地突出重要信息,并使其在导航时能够快速响应。 + +![][10] + +### 其他变化 + +除了以上的关键亮点外,你还可以得到许多技术升级和错误修复。 + +例如,OpenPGP 的用户体验和用户交互也得到了升级,同时还有一个新的存储格式:Maildir。 + +你对 Thunderbird 102 版本即将新增的功能有什么看法吗?你对 Thunderbird 的用户体验/用户交互升级感到兴奋吗?请在下方的评论区中说说你的想法,或只是简单说声“谢谢”。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/thunderbird-102-features/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-email-clients-linux/ +[2]: https://news.itsfoss.com/thunderbird-91-release/ +[3]: https://twitter.com/mozthunderbird/status/1508662633292959747 +[4]: https://thunderbird.topicbox.com/groups/planning/Tba7050ab1a565370-M100ace32c2769d192ef79e55/whats-coming-in-thunderbird-102 +[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/thunderbird-102-spaces.jpg?w=1200&ssl=1 +[6]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/thunderbird-102-spaces-1.jpg?w=607&ssl=1 +[7]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/thunderbird-102-addressbook.jpg?w=1200&ssl=1 +[8]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/thunderbird-102-link-preview.jpg?w=1200&ssl=1 +[9]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/thunderbird-102-account-setup.jpg?w=1200&ssl=1 +[10]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/thunderbird-102-header.jpg?w=1280&ssl=1 diff --git a/published/202204/20220331 Add Some Colors to Your Ubuntu Desktop With the new Accent Color Options in Ubuntu 22.04.md b/published/202204/20220331 Add Some Colors to Your Ubuntu Desktop With the new Accent Color Options in Ubuntu 22.04.md new file mode 100644 index 0000000000..fd1ef182d5 --- /dev/null +++ b/published/202204/20220331 Add Some Colors to Your Ubuntu Desktop With the new Accent Color Options in Ubuntu 22.04.md @@ -0,0 +1,68 @@ +[#]: subject: "Add Some Colors to Your Ubuntu Desktop With the new Accent Color Options in Ubuntu 22.04" +[#]: via: "https://itsfoss.com/accent-color-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14441-1.html" + +在 Ubuntu 22.04 中使用新的强调色 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/07/101359xle6lahli57665gg.jpg) + +传统上,Ubuntu 一直使用橙色和紫红色的强调色。如果你想在不改变 Yaru 主题的情况下添加一个不同的颜色主题,可以选择使用由第三方提供的 [名为 Yaru 颜色的主题][1]。 + +但是这一点随着 Ubuntu 22.04 的到来而改变。从即将推出的新的 LTS 开始,你将能够改变你的 Ubuntu 桌面的强调色,而不需要任何额外的工具。 + +这个选项在系统设置中就有。 + +### 改变 Ubuntu 22.04 的强调色 + +我已经在使用 Ubuntu 22.04 预发布版本。你还不会得到这个版本,但已经确定会有这个 [Ubuntu 22.04 新功能][2]。 + +在设置中,在外观标签下,你会看到颜色选项。它将给你十个颜色选项,包括默认的橙色、树皮色、鼠尾草色、橄榄色、铬绿、普鲁士绿、蓝色、紫色、洋红色和红色。 + +你可以从这里选择你喜欢的颜色。 + +![Changing accent colors in Ubuntu 22.04][3] + +它改变了什么?所有你在桌面上有橙色元素的地方。所以,文件夹的颜色会被改变,以及日历条目、软件中心的标志、浏览器中的文本选择高亮等等。 + +![Effect of accent color change][4] + +这段视频展示了所有强调色的作用。 + +![video](https://player.vimeo.com/video/694093720) + +你应该将颜色与浅色和深色主题结合起来。有些颜色在浅色主题下看起来不错,而有些则在深色主题下看起来更好。 + +### 改变强调色还是坚持使用默认颜色? + +![Accent color option in elementary OS 6][5] + +最近,Linux Mint 和 elementary OS 开始提供强调色选项。Ubuntu 也在加入这个行列。 + +就我个人而言,我一直将橙色与 Ubuntu 的身份联系在一起。我不确定我是否会使用不同的颜色,但有选择总是好的。 + +你呢?你是否期待使用 Ubuntu 22.04 中的强调色,还是坚持使用默认的橙色?请在评论区分享你的观点。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/accent-color-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/folder-color-ubuntu/ +[2]: https://linux.cn/article-14177-1.html +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/accent-colors-ubuntu-22-04.png?resize=800%2C572&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/changed-accent-color-ubuntu-22-04.png?resize=797%2C453&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/accent-colors-elementary-os-6.webp?resize=780%2C667&ssl=1 diff --git a/published/202204/20220401 Deepin OS Becomes the First Linux Distro to Offer Face Unlock.md b/published/202204/20220401 Deepin OS Becomes the First Linux Distro to Offer Face Unlock.md new file mode 100644 index 0000000000..6b75610eeb --- /dev/null +++ b/published/202204/20220401 Deepin OS Becomes the First Linux Distro to Offer Face Unlock.md @@ -0,0 +1,98 @@ +[#]: subject: "Deepin OS Becomes the First Linux Distro to Offer Face Unlock" +[#]: via: "https://news.itsfoss.com/deepin-os-20-5-release/" +[#]: author: "Abhishek https://news.itsfoss.com/author/root/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14425-1.html" + +深度操作系统成为首个支持人脸解锁的 Linux 发行版 +====== + +> 在提供现代桌面体验方面,深度占据了领先地位。 + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/04/deepin-20-5-release.png?w=1200&ssl=1) + +在深度问世时,人们都为它纯粹的漂亮界面而惊叹。 + +随着时间的推移,开发人员越来越有经验,他们把重点转移到了系统设计和功能上,力求在这些方面和其他的商业操作系统看齐,我指的是 Windows 和 macOS。深度是首个支持安卓应用和云同步等功能的发行版。 + +相信我,这是一件好事情。 + +Linux 发行版以各种桌面环境的形式向大众提供。深度看起来很主流,可以吸引年轻群体。 + +中国的深度开发团队的也有相同目标,因此深度发布了 20.5 版本,该版本主要亮点是面部识别。 + +### 深度操作系统 20.5 的新功能 + +新版本根据用户的反馈增加了几个功能。稳定的内核版本现在已经升级到 5.15.24,并修复几个错误,以加强系统安全性。 + +让我们来看看这个版本还有哪些新功能吧。 + +#### Linux 上有了面部解锁 + +![][1] + +是的,我知道 Linux 上早就有面部解锁的相关消息了。毕竟,我曾经写过一篇关于 [在 Linux 发行版中使用类似 Howdy 的软件来支持面部解锁功能][2] 的详细指南。 + +然而,那些软件更多的是一种个性化定制,是为那些有经验的、爱折腾的用户准备的。 + +深度现在提供基于人脸的生物识别认证方法。它可以在有内置摄像头的笔记本电脑上工作。 + +你需要先在控制中心录入人脸信息,此后,你就可以用你的人脸 ID 登录系统。 + +#### 用户可在应用商店中反馈 + +你现在可以直接在应用商店中提交对某个应用的反馈。 + +![][3] + +这还不算完。当你有应用程序的安装和更新问题时,你可以在应用程序中直接向官方支持提交问题,并获得解决方案(如果开发者提供了的话)。 + +#### 改进的邮件应用 + +![][4] + +深度邮件应用现在支持了自定义文件夹管理。它还可以在网络重新连接后自动接收邮件。邮件应用的框架和插件已经替换成了当下流行的 Vue + TinyMCE。 + +现在,你可以通过点击系统通知直接跳转到到新邮件。为提高工作效率,你可以置顶常用邮件与合并邮件。你也可以预览邮件附件。 + +#### 可以“钉住”的屏幕截图 + +![][5] + +你现在可以使用内置的屏幕截图工具来“钉住”截图。这样一来,捕获的屏幕截图就会固定在其他应用程序窗口的顶部。从而,你可以同时使用其他应用程序,以提高你的工作效率。另外,置顶的屏幕截图是可以移动的。 + +#### 其他变化 + +下面是 Deepin 20.5 新版本中的一些其他变化: + + * Linux 稳定内核更新到了 5.15.24 + * 可以为一个有线网络适配器设置多个 IP + * 优化了无线网络的密码认证交互 + * 系统搜索现在可以使用文件类型和扩展名作为关键词 + * 设备管理器允许你禁用或启用设备 + * 浏览 docx 文件的文档查看器得到了性能优化 + +还有许多我没有提到的小功能和改进。你可以在 [版本发布说明][6] 中了解这些内容。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/deepin-os-20-5-release/ + +作者:[Abhishek][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/root/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/04/face-unlock-deepin.jpg?w=900&ssl=1 +[2]: https://itsfoss.com/face-unlock-ubuntu/ +[3]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/04/app-store-feedback-deepin.webp?resize=1568%2C980&ssl=1 +[4]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/04/deepin-mail-app.webp?w=900&ssl=1 +[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/04/pinned-screenshots-deepin.webp?w=900&ssl=1 +[6]: https://www.deepin.org/en/2022/03/31/deepin-20-5/ diff --git a/published/202204/20220401 Using Sourcegraph to Search 34,000- Fedora Repositories.md b/published/202204/20220401 Using Sourcegraph to Search 34,000- Fedora Repositories.md new file mode 100644 index 0000000000..aed35d1902 --- /dev/null +++ b/published/202204/20220401 Using Sourcegraph to Search 34,000- Fedora Repositories.md @@ -0,0 +1,148 @@ +[#]: subject: "Using Sourcegraph to Search 34,000+ Fedora Repositories" +[#]: via: "https://fedoramagazine.org/using-sourcegraph-to-search-34000-fedora-repositories/" +[#]: author: "Justin Dorfman https://fedoramagazine.org/author/jdorfman/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14434-1.html" + +使用 Sourcegraph 搜索 34000 多个 Fedora 仓库 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/05/151255yuq9zem6euei5ui5.jpg) + +在 2021 年 10 月,一个 Fedora Linux 用户 [问了一个关于许可的问题][4]。Fedora 项目负责人 Matthew Miller [回复道][5]:“我不能快速地检查(这个问题),因为我们没有一个完整的、庞大的、可搜索的存储库来检索 Fedora 中所有软件包。” + +[接着他说][6]:“……或许我们可以付钱给 Sourcegraph,让他们帮我们做这个。他们看起来乐于助人。” 他说的没错,我们(Sourcegraph)的确是乐于助人,而且我们还不想要你的钱,相反,我们想与 Fedora 社区合作。 + +Fedora 社区现在可以在他们的开源代码世界中尽情搜索 —— 目前有超过 34,000 个存储库,而且还在不断增加。 + +### 代码搜索简介 + +如果你还不熟悉 [代码搜索][7] 的概念,我现在就来告诉你。代码搜索可以让团队更快地掌握一个新的代码库,在里面找到答案,帮助团队识别安全风险,以及许多其他用例。Sourcegraph 已经在 GitHub 和 GitLab 等多个代码托管服务上,索引了 200 多万个存储库。本文只关注 src.fedoraproject.org 的代码搜索。Sourcegraph 同时提供了一个 [Web 应用][8] 和 [命令行客户端][9]。 + +### 使用 Web 应用 + +在使用 Sourcegraph [Web 应用][8] 时,你需要先输入初始字符串 `repo:^src.fedoraprojects.org`,然后再开始查询。这个 [Web 应用][8] 链接中包括了上面的初始字符串,点击这个链接后,搜索界面如下图所示: + +![Sourcegraph Web 应用界面][10] + +下面我将提供几个使用 Web 应用程序进行搜索的例子,大家可能会对它们感兴趣。 + +#### 查找使用流行的经 OSI 批准的许可证的存储库 + +下面的查询语句将扫描所有兼容 “开源定义Open Source Definition”(OSD) 的软件存储库。 + +``` +repo:^src.fedoraproject.org/ lang:"RPM Spec" License: ^.*apache|bsd|gpl|lgpl|mit|mpl|cddl|epl.*$ +``` + +![许可证搜索][11] + +> [试一下!][12] + +#### 查找带有 TODO 的文件 + +下面的查询语句将在 34,000 多个仓库中找到 `TODO` 文件。对于那些希望为需要帮助的项目做出贡献的人来说,是一个非常棒的功能。 + +``` +repo:^src.fedoraproject.org/ "TODO" +``` + +![搜索 TODO][13] + +> [试一下!][14] + +#### 查找 FTP 服务器上的文件 + +我的一个前同事告诉我 “FTP 是一个死协议”。真的是这样吗?你也可以在这个查询中加入任何其他协议,如 irc、https 等。 + +``` +repo:^src.fedoraproject.org/ (?:ftp)://[A-Za-z0-9-]{0,63}(.[A-Za-z0-9-]{0,63})+(:d{1,4})?/*(/*[A-Za-z0-9-._]+/*)*(?.*)?(#.*)? +``` + +![搜索协议][15] + +> [试一下!][16] + +#### 查找使用有漏洞的 Log4j 版本的文件 + +这个查询语句将找到任何可能存在 CVE-2021-44228(也就是 Log4j)漏洞的文件(可能会有误报)。你也可以搜索其他漏洞,然后报告给项目维护者。 + +``` +repo:^src.fedoraproject.org/ org.apache.logging.log4j 2.((0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15)(.[0-9]+)) count:all +``` + +![搜索 log4j][17] + +> [试一下!][18] + +### 使用命令行 + +Sourcegraph 还有一个叫做 [src][19] 的命令行客户端,它可以让你完成我刚才提到的所有事情。此外,它还有其他一些有用的命令。比如说,它可以把结果用 JSON 格式输出,方便你在编程中使用。 + +``` +src search -json 'repo:^src.fedoraproject.org/ lang:"RPM Spec" License: ^.*apache|bsd|gpl|lgpl|mit|mpl|cddl|epl.*$' +``` + +#### 输出 JSON + +![输出 JSON][20] + +> [试一下!][21] + +### 搜索语法 + +就入门而言,上面的例子是很好的起点,但 Sourcegraph 还支持更多的查询语句。你可以 [查看所有的搜索查询语法][22],并根据需要创建你自己的查询语句。 + +### 总结 + +正如你所看到的,有了 Sourcegraph,Fedora Linux 社区现在可以快速搜索托管在 [src.fedoraproject.org][23] 上的所有代码,无论是使用普通查询还是复杂的正则查询。 + +感谢 Fedora Linux 社区的慷慨帮助和热情欢迎。如果你有任何想补充的内容或问题,我和我的团队都会在下面的评论区回复。你也可以 [在 Slack 上找到我们][24]。 + +特别感谢 [Vanesa Ortiz][25] 促成了这次合作,还有 [Ben Venker][27] 帮助修复了我的正则表达式(多次),以及 [Rebecca Dodd][28] 和 [Nick Moore][29] 在编辑上的帮助。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/using-sourcegraph-to-search-34000-fedora-repositories/ + +作者:[Justin Dorfman][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/jdorfman/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2022/03/sourcegraph-816x345.jpg +[2]: https://unsplash.com/@markuswinkler?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/magnifying-glass?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://lists.fedoraproject.org/archives/list/legal@lists.fedoraproject.org/thread/CBCJHOSP36YXQKCVGWVL5MXU64LZ6NZA/ +[5]: https://lists.fedoraproject.org/archives/list/legal@lists.fedoraproject.org/message/LTIQS2PX33FSCEIAPJS62UZXVPDT5JPB/ +[6]: https://lists.fedoraproject.org/archives/list/legal@lists.fedoraproject.org/message/5GEPBSRGUK5E2FLW4MQBVP6DI65XP2LQ/ +[7]: https://codesearchguide.org/ +[8]: https://sourcegraph.com/search?q=context:global+repo:%5Esrc.fedoraproject.org/&patternType=regexp +[9]: https://docs.sourcegraph.com/cli/quickstart +[10]: https://fedoramagazine.org/wp-content/uploads/2022/03/Image-2022-03-28-at-1.41.54-PM-1024x335.png +[11]: https://fedoramagazine.org/wp-content/uploads/2022/03/license-1024x513.png +[12]: https://sourcegraph.com/search?q=context:global+repo:%5Esrc.fedoraproject.org/+lang:%22RPM+Spec%22+License:+%5E.*apache%7Cbsd%7Cgpl%7Clgpl%7Cmit%7Cmpl%7Ccddl%7Cepl.*%24&patternType=regexp +[13]: https://fedoramagazine.org/wp-content/uploads/2022/03/todo-1024x605.png +[14]: https://sourcegraph.com/search?q=context:global+repo:%5Esrc.fedoraproject.org/+%22TODO%22&patternType=regexp&case=yes +[15]: https://fedoramagazine.org/wp-content/uploads/2022/03/protocol-1024x457.png +[16]: https://sourcegraph.com/search?q=context:global+repo:%5Esrc.fedoraproject.org/+%28%3F:ftp%29:%5C/%5C/%5BA-Za-z0-9%5C-%5D%7B0%2C63%7D%28%5C.%5BA-Za-z0-9%5C-%5D%7B0%2C63%7D%29%2B%28:%5Cd%7B1%2C4%7D%29%3F%5C/*%28%5C/*%5BA-Za-z0-9%5C-._%5D%2B%5C/*%29*%28%5C%3F.*%29%3F%28%23.*%29%3F&patternType=regexp +[17]: https://fedoramagazine.org/wp-content/uploads/2022/03/log4j-1024x295.png +[18]: https://sourcegraph.com/search?q=context:global+repo:%5Esrc.fedoraproject.org/+org%5C.apache%5C.logging%5C.log4j+2.%28%280%7C1%7C2%7C3%7C4%7C5%7C6%7C7%7C8%7C9%7C10%7C11%7C12%7C13%7C14%7C15%29%28%5C.%5B0-9%5D%2B%29%29+count:all&patternType=regexp +[19]: https://github.com/sourcegraph/src-cli#readme +[20]: https://fedoramagazine.org/wp-content/uploads/2022/03/Image-2022-03-22-at-9.46.26-AM-1024x521.png +[21]: https://sourcegraph.com/notebooks/Tm90ZWJvb2s6MzQ2 +[22]: https://docs.sourcegraph.com/code_search/reference/queries +[23]: https://src.fedoraproject.org/ +[24]: https://srcgr.ph/wp-join-community-space +[25]: https://twitter.com/vanesacodes +[26]: https://discussion.fedoraproject.org/t/fedora-sourcegraph-marketing-community-collaboration/36151 +[27]: https://handbook.sourcegraph.com/team/#ben-venker +[28]: https://handbook.sourcegraph.com/team/#rebecca-dodd +[29]: https://twitter.com/nickwritesit diff --git a/published/202204/20220402 CrunchBang-- Linux - The Ultimate Lightweight and Stable Linux Distribution.md b/published/202204/20220402 CrunchBang-- Linux - The Ultimate Lightweight and Stable Linux Distribution.md new file mode 100644 index 0000000000..ce94cab1b7 --- /dev/null +++ b/published/202204/20220402 CrunchBang-- Linux - The Ultimate Lightweight and Stable Linux Distribution.md @@ -0,0 +1,155 @@ +[#]: subject: "CrunchBang++ Linux – The Ultimate Lightweight and Stable Linux Distribution" +[#]: via: "https://www.debugpoint.com/2022/04/crunchbang-linux-review/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "lxbwolf" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14454-1.html" + +CrunchBang++ Linux —— 极致轻量和稳定的 Linux 发行版本 +====== + +> 我们来对基于 Debian 的、由 Openbox 驱动的轻量级 Linux 发型版本 Crunchbang++ Linux 进行了评测,并为你提供了如何使用它的指导。 + +CrunchBang 项目已经停止维护,CrunchBang++ Linux 是这个独特的项目的继承者。早期的 CrunchBang Linux 很受欢迎,因为它使用非常少的系统资源,对低端硬件也很友好。而 CrunchBang++ 也有一个 32 位的安装程序(现在很少见),可以在过时的硬件或 PC 上正常运行。 + +在我们之前介绍 [顶级轻量级 Linux 发行版][1] 的文章中,有读者评论想让我们介绍 CrunchBang++。因此,我们想从性能、无障碍访问和其他因素等方面对这个超级轻量级的 Linux 发行版做一个深入的研究。让我们深入了解一下。 + +### CrunchBang++ Linux 测评 + +![CrunchBang++ Linux Desktop with Openbox][2] + +#### 现场介质和安装 + +目前为止,CrunchBang++ 基于最新的 Debian 11 Bullseye,并提供 32 位和 64 位 ISO 变体。你可以从其 [官方网站][3] 下载。本文中,我们使用 64 位的安装程序,其大小为 1.6 GB,与当今流行的 Linux 发行版的 ISO 大小相比,是很小的。例如,最新的 Ubuntu 64 位桌面 ISO 就很大,已经超过了 3.2 GB。 + +安装程序的启动菜单提供了测试现场镜像Live Image和启动安装程序的选项。你可以先从现场镜像开始。但是,你不能从现场介质安装!相反,你必须再次启动并选择重新安装选项。现场桌面Live desktop的用户 ID 和密码都是 “live”。 + +![Installation in the boot menu][4] + +在物理机和虚拟机([virt-manager][5])上的安装都很顺利。CrunchBang++ 使用 Debian 的原生安装程序,这有点复杂。但你可以按照屏幕上的指示轻松地安装它。如果你不熟悉 Debian 安装程序,你可以参照我们的 [Debian 安装指南][6]。 + +在虚拟机和物理系统上安装过程平均需要约 5 到 10 分钟。 + +#### 桌面初窥 + +CrunchBang++ 给你经典的 Openbox 窗口管理器体验。登录屏幕出乎意料的干净和完美,只有输入凭证的选项。 + +如果你是第一次运行它,有一个欢迎脚本会引导你检查网速,更新你的系统,等等。 + +![The welcome script][7] + +Openbox 本身是快速和干净的。桌面以其预先配置的 SBPP Openbox 主题带来了一个整洁的外观,其组件如下: + + * [gmrun][8]:一个轻量的应用程序启动器 + * [Tint2][9]:桌面顶层的控制面板 + * [dmenu][10]:动态菜单系统 + +你可以通过右键菜单的简单配置选项来配置它们。 + +默认情况下,可以通过顶部面板切换两个工作区。顶部面板也有基本的托盘图标以满足你的需要。 + + * 音量控制 + * 网络连接 + * 语言工具 + * 电量监控 + * 剪贴板管理 + +作为一个窗口管理器,这里没有应用程序视图。但有了 gmrun 应用程序启动器,启动任何应用程序都超级容易。当你需要启动任何应用程序时,Openbox 右键菜单会给你所有的选项。 + +#### 无障碍访问和应用程序 + +CrunchBang++ 只包括最低限度的应用程序,以保持 ISO 和安装的轻便。以下是预装的应用程序。 + + * GIMP + * Thunar 文件管理器 + * Catfish 文件搜索 + * Gnumeric + * VLC 媒体播放器 + * Filezilla + * 远程桌面客户端 + * Transmission Torrent 客户端 + * Screenshot 工具 + * Geany 文本编辑器 + +强大的 Synaptic 软件包管理器会满足你所有的软件需求。LibreOffice 不是默认安装的,所以你需要单独安装它。没有用于集中设置的工具,所以有时你可能会觉得缺少一个设置管理器。 + +#### 性能和资源占用情况 + +CrunchBang++ 的性能对于轻量级发行版来说是完美的。 + +这个发行版使用了 585 MB 的内存,空闲状态下 CPU 占用为 1%。如果你让系统在非活动状态下运行一个小时或更长时间,内存占用会进一步减少到 350 MB 左右。这是一个令人印象深刻的指标。 + +![Performance During Idle State][12] + +为了测试重压工作负载,我们在 CrunchBang++ 中打开了以下应用程序的一个实例: + + * Firefox 两个标签页 + * Thunar 文件管理器 + * GIMP + * Gnumeric + * 文本编辑器 + * 终端 + * Catfish 文件搜索 + +整个工作负载占用内存 1.07 GB,CPU 占用为 5% - 7%。 + +这个发行版的默认安装占用了 4 GB 的硬盘空间。 + +![Performance During Heavy workload State][13] + +#### 连接性 + +我们对它进行了下面列出的各种连接性测试。除了蓝牙,它通过了每一项测试。 + + * Wi-Fi 检测和连接 —— 完美通过测试 + * 它在多个显示器和分辨率配置下能正确工作(由于有预装的 ARandR) + * 自动检测 USB(即使在虚拟机模式下) —— 正常通过测试 + +没有用于蓝牙的启用、发现和连接的工具(有点像 Xfce 桌面)。所以,如果你安装一个实用程序,你应该都能搞定。 + +#### CrunchBang++ 的一些缺点 + +在我看来,这个 Linux 发行版应该由有一些经验的用户来使用,他们在 Linux 中遇到的问题一般都能通过查阅资料解决,并且在需要时也能自如地使用终端。 + +我还发现了一些我认为默认安装需要(而没有安装)的项目。在这个发行版中没有办法配置鼠标、键盘。没有预装任何工具。然而,你可以通过终端对它们进行调整。你可能需要安装额外的应用程序来配置这些。 + +在“最近使用的应用程序”的右键菜单和 Nitrogen 壁纸更换器中有些错误。然而,对于你的日常使用来说,它们并不是一个障碍。 + +所以,总的来说,我认为它很稳定,尽管有所缺失,但可以很好地工作。 + +### 总结 + +在结束对 CrunchBang++ 的测评时,我不得不说它是一个高效和实用的 Linux 发行版。它可能不是一个闪闪发光的桌面,但它是一个稳定的、生产级的 Linux 发行版,可以在任何硬件上运行。你可以很容易地把它作为你的日常使用系统,并在不用重装你的整个系统的情况下使用它多年。CrunchBang++ 是贡献者们创造出的伟大的软件。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/04/crunchbang-linux-review/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/2022/03/lightweight-linux-distributions-2022/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/04/CrunchBang-Linux-Desktop-with-Openbox-1024x576.jpg +[3]: https://crunchbangplusplus.org/ +[4]: https://www.debugpoint.com/wp-content/uploads/2022/04/Installation-in-boot-menu.jpg +[5]: https://www.debugpoint.com/2020/11/virt-manager/ +[6]: https://www.debugpoint.com/2021/01/install-debian-buster/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/04/The-welcome-script.jpg +[8]: https://github.com/WdesktopX/gmrun +[9]: https://gitlab.com/o9000/tint2 +[10]: https://tools.suckless.org/dmenu/ +[11]: https://www.debugpoint.com/2021/01/extix-21-1-review/ +[12]: https://www.debugpoint.com/wp-content/uploads/2022/04/Performance-During-Idle-State.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2022/04/Performance-During-Heavy-workload-State.jpg +[14]: https://t.me/debugpoint +[15]: https://twitter.com/DebugPoint +[16]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[17]: https://facebook.com/DebugPoint diff --git a/published/202204/20220402 Peergos- An Open-Source Google Drive Alternative That You Can Self-Host.md b/published/202204/20220402 Peergos- An Open-Source Google Drive Alternative That You Can Self-Host.md new file mode 100644 index 0000000000..f64ef4d7c0 --- /dev/null +++ b/published/202204/20220402 Peergos- An Open-Source Google Drive Alternative That You Can Self-Host.md @@ -0,0 +1,129 @@ +[#]: subject: "Peergos: An Open-Source Google Drive Alternative That You Can Self-Host" +[#]: via: "https://itsfoss.com/peergos/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14466-1.html" + +Peergos:一个可以自行托管的开源 Google 云端硬盘替代品 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/13/091252bdnqkkh7rk0mkv7m.jpg) + +Google 云端硬盘Google Drive 是最受欢迎的云存储服务之一。而且,由于合理的原因,它提供了灵活的定价、区域定价和许多其他优势。 + +不幸的是,它不提供端对端加密。此外,它不是一个开源的产品。 + +那么,我们是否有开源的 Google 云端硬盘的替代品? + +当然,有 [免费的云存储服务][1],但它们不是开源的,也不是完全安全/私密的。 + +不用担心,我们有一个优秀的开源解决方案,即 **Peergos**。 + +### Peergos:一个带有迷你社交网络平台的点对点开源云存储服务 + +![][2] + +[Peergos][3] 不仅仅是 Google 云端硬件的一个普通替代品,也不仅仅是一个私人网络存储平台。 + +有了 Peergos,你会得到一个建立在 [IPFS 协议][4](点对点)之上的端到端加密的私人网络空间。使用这样的协议使它成为一个去中心化的存储平台。 + +不仅限于其安全/隐私,你还可以使用新闻源在平台上与你的朋友进行社交。 + +例如,你上传照片并与你的朋友分享,其他用户(你的朋友)可以在他们的新闻源中看到它们,并像社交媒体平台一样互动。 + +你还可以添加待办事项,组织日历,并根据需要与合作者/朋友分享。 + +换句话说,你也可以把 Pergos 视为 [Nextcloud][5] 在某种程度上的替代品。 + +你可以选择自行托管 Peergos,也可以选择他们的云服务,开始是免费的(200MB 存储空间),可以升级到 50GB,价格为 **£5/月**,或者 500GB,价格为 **£25/月**。 + +让我强调一下 Pergos 的一些主要特性。 + +### Peergos 的特点 + +![][6] + +考虑到你在 Peergos 获得的各种功能,以下是亮点: + + * 端对端加密存储。 + * 能够分享你的照片、视频和文件。 + * 如果需要,生成链接让其他用户下载你的文件。 + * 保持你的活动私密,不记录你的使用情况。 + * 你可以自我托管 Peergos,让你完全控制。 + * 私有元数据,保持你的联系人列表、文件大小、目录结构和其他信息的隐蔽性。 + * 提供一个去中心化的存储,你可以无缝访问。 + * 开源,并经过审计。 + * 社交媒体网络能力。 + * 待办事项列表和任务管理。 + * 协作功能。 + * 支持 Markdown。 + * 查看 PDF 文件的能力。 + * 访问日历,创建和组织事件。 + * 网站目录,如果你自行托管,可以使用个性化的 URL 或本地端口访问。 + +Peergos 是一个功能丰富的产品,可以让你存储你的文件,而不用担心对公司的信任问题。 + +虽然它不是完全匿名的,但 Pergos 作为一项服务不会记录你的任何信息。 + +此外,如果你想完全控制一切,你可以自行托管。 + +### 开始使用 Pergos + +你需要 [注册][7](云选项)或按照其 [GitHub 页面][8] 中的说明自行托管它。 + +![][9] + +200MB 的免费空间是相当低的。然而,如果你想存储你的一些重要文件,以及选择照片集,这对一些人来说可能是有用的。 + +高级升级版可以选择上升到 500GB 的存储空间,每月 **25 英镑**。 + +![][10] + +在该平台上切换是相当容易的,用户界面看起来也不错。 + +![][11] + +它支持深色模式,所以你可以随时切换它。可用的共享选项应该足以满足各种合作的需要。 + +使用组来控制对共享文件的访问是一个有趣的想法。 + +![][12] + +> - 访问 [Peergos][3] + +### 总结 + +Peergos 是一个独特的产品,你可以自行托管。它是开源的,并为隐私爱好者提供了所有好东西来存储文件和安全地进行合作。 + +云服务可能因其免费存储空间少而不具吸引力。但是,如果你真的喜欢这个概念,你可以选择升级到一个具有更多存储空间的高级计划。 + +如果你想要一个 Google Drive 的开源替代品,Peergos 可以是一个有趣的选择。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/peergos/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/cloud-services-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/04/peergos-home.png?resize=800%2C623&ssl=1 +[3]: https://peergos.org/ +[4]: https://ipfs.io/ +[5]: https://itsfoss.com/nextcloud/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/04/peergos-social.png?resize=800%2C633&ssl=1 +[7]: https://peergos.net/?signup=true +[8]: https://github.com/peergos/peergos +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/peergos-sign-up.png?resize=800%2C684&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/peergos-signup.png?resize=800%2C481&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/peergos-dark.png?resize=800%2C513&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/peergos-sharing.png?resize=800%2C715&ssl=1 diff --git a/published/202204/20220403 Is this the End of the road for elementary OS.md b/published/202204/20220403 Is this the End of the road for elementary OS.md new file mode 100644 index 0000000000..c5865f6daa --- /dev/null +++ b/published/202204/20220403 Is this the End of the road for elementary OS.md @@ -0,0 +1,73 @@ +[#]: subject: "Is this the End of the road for elementary OS?" +[#]: via: "https://www.debugpoint.com/2022/04/end-of-elementary-os/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "hwlife" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14449-1.html" + +elementary OS 系统走到头了吗? +====== + +> Cassidy James 是 elementary OS 系统的创始人,根据他最近的声明得知他已经辞职。下面是我们对这一话题的看法,以及可能的未来。 + +![elementary OS 6 ODIN Desktop][1] + +早在十年前,当 elementary OS 首次发布时,它率先带领 Linux 桌面领域迈出了新的一步。Cassidy 有一个愿景,从那时只有开发者和贡献者在使用的 Linux 桌面,到全世界用户都能够使用它。它的 Pantheon 桌面是最好的桌面之一,从一开始就是为美学和生产力而设计的。 + +多年来,elementary OS 已经成长起来了。它的用户群和受欢迎程度一直在增加,因为它的稳定性、基于 Ubuntu 长期支持版,对于那些希望在 Linux 中拥有类似 macOS 的用户界面的人来说,是一个完美的桌面。它的基于 Flatpak 的应用商店也是在 Linux 生态系统中最好的应用商店之一,具有一套精心打造的应用程序。 + +如果你用免费软件经营公司,除非你有一个在背后支撑的企业和其它盈利模式,否则这些优势和良好的用户反馈,是无法变成盈利的。 + +### 为什么会出现这种情况,这是 elementary OS 系统的终点吗? + +elementary OS 有一个 “付费下载” 的收入模式,这是自愿的。但是疫情已经两年了,这方面的销售收入也在下降,该公司的领导层为了维持公司运转,已经削减了全职员工的工资和医疗福利。 + +> “自从我全职投入 elementary 公司以来,每一个版本的销售业绩都要比上一个表现要好,直到 OS 6 和 6.1 的业绩表现远远低于预期,部分原因是持续的全球疫情,人们看起来在能免费下载操作系统的时候,不再想支付可选的金额来下载它。很明显,我们需要重新确定我们公司财务的优先次序,同时坚定我们的开源、以隐私为中心和道德的筹资信念。”Cassidy 在他的告别信中说道。 + +全球经济在疫情的打击下,所有人和事都无法幸免。[elementary OS 6 Odin][2] 的发布并不顺利。有一些错误、英伟达显卡的问题和其他问题,全球疫情和贡献的减少也影响了软件的质量。这最终影响到了自愿付费下载的收入。 + +自愿付费下载模式、GitHub 的赞助,用来维持企业运转和大型项目是远远不够的。如果你看看其他的主流开源项目,如 Fedora Linux、GNOME、KDE Plasma,它们都有来自 Red Hat、IBM、Google 等大企业的大量赞助。而这是有原因的,这些大公司都从这些开源项目中获得商业利益。但是对于 elementary OS 来说,情况就有点不同了。 + +> Cassidy 又写道,“结果,Dani 要求我辞职,并完全离开 elementary。在我寻找另一个职位时,这并不是我的本意,但是 Dani 一直坚持(要我离开)。最后,我决定,最好的行动方案确实是我继续前行;我放弃了我对 elementary 十多年的激情,接受了 Dani 的提议,让她成为 elementary 公司唯一的、100% 的所有者。我已经签署了我的辞呈。从今天起,她现在拥有公司的所有股份和责任。我祝愿她在延续公司的遗产方面取得最好的成绩。” + +### 展望未来 + +确实,我能在告别信中感受到 Cassidy 的感情。放弃你多年来建立的项目和激情是不容易的。那里有你在为社区获得更大利益的愿景而投入的无数个日日夜夜。你的感情与之相连。放弃并不容易。 + +没有人能够预测未来。所以,我们不知道在未来的日子里 elementary OS 系统作为一个项目会发生什么。当情况发生了,开源公司最终会成为一个有更多受众和贡献者的社区项目。我觉得新的领导人需要看看 elementary OS 在 Linux 发行版或桌面领域方面的未来路线图。 + +因为带有 GTK4/libadwaita 的 GNOME 42+ 看起来很有前途,elementary OS 可能会因为 GNOME 而失去用户群。在这种情景下,唯一的卖点只有 Pantheon 桌面,这就需要更多的打磨和市场化能力,同时新的领导层也需要寻找更好的收入模式。 + +我们希望,作为一个社区,elementary OS 能够继续推出新版本,如果必要的话,让它成为没有 GitHub 赞助墙的社区项目。而我认为寻找企业基金和捐赠也可以成为维持项目运行的长期选择之一。 + +任何开源项目都不应该停止。我希望新的领导层能够找到更好的收入模式来维持这个项目。只要思想不滑坡,方法总比困难多。 + +所以,关于这整个情况你有什么看法?在下方评论让我知道。 + +谢谢。 + +*部分引用自 [Cassidy 的博客][4]* + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/04/end-of-elementary-os/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[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/lujun9972 +[1]: https://www.debugpoint.com/wp-content/uploads/2021/08/elementary-OS-6-ODIN-Desktop-1024x576.jpeg +[2]: https://www.debugpoint.com/2021/08/elementary-os-6-odin-review/ +[3]: https://www.debugpoint.com/2021/05/elementary-os-6-beta/ +[4]: https://cassidyjames.com/blog/farewell-elementary/ +[5]: https://t.me/debugpoint +[6]: https://twitter.com/DebugPoint +[7]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[8]: https://facebook.com/DebugPoint diff --git a/published/202204/20220405 Collision- An Open-Source App to Check if Your Files Were Tampered With.md b/published/202204/20220405 Collision- An Open-Source App to Check if Your Files Were Tampered With.md new file mode 100644 index 0000000000..38b2e8d849 --- /dev/null +++ b/published/202204/20220405 Collision- An Open-Source App to Check if Your Files Were Tampered With.md @@ -0,0 +1,112 @@ +[#]: subject: "Collision: An Open-Source App to Check if Your Files Were Tampered With" +[#]: via: "https://itsfoss.com/collision/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "hwlife" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14438-1.html" + +Collision: 一个验证你的文件是否被篡改的开源应用 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/06/101130edund6qvmdmw0nd0.jpg) + +> 一个让你查看你的文件哈希值,以确定它不是恶意文件,并且确实来自真实来源的图形界面程序。 + +有人给你发送了一个文件,你怎样来证实它是给你的原件?你怎样来确定它没有被篡改过? + +同时,你怎么证实这个文件是来自一个原始的真实来源。 + +这就是加密哈希的重要作用所在。如果用来验证一个文件,诸如 SHA-1 之类的哈希功能就是一个校验值。这能够帮助你确认文件是否已经被修改。 + +如果你感到好奇,你可以参考我们的 [在 Linux 中验证校验值的指南][1]。 + +对每个信息 / 文件来说,它们有一个唯一的哈希值(或者叫校验和)。所以,即使文件有一点点的改动,整个哈希值就会发生变化。 + +它主要用于加密中,每个文件 / 信息以哈希值安全的存储。假设一个攻击者掌握了存储哈希值(而不是真实信息)的数据库,他们也不能够知道其意义。加密可以使存储更加安全。 + +虽然讨论哈希超出了这篇文章的范围,但是了解它在验证文件完整性上是很有意义的。 + +### Collision:迅速的验证文件并发现恶意文件 + +![][2] + +如果没有图形界面,你就得用终端去生成哈希值来比对 / 验证。 + +Collision 使它变的非常容易,不需要打开终端或者生成文件的校验值。如果你不了解的话,我们的 [在 Linux 中验证校验值的指南][1] 可以帮助到你。 + +当使用 Collision 时, 你只需要添加你要生成哈希值或者验证所需的文件即可。你只需点击几下便能够保护自己免受恶意或篡改文件的攻击。 + +我在截图中显示了个文本文件,你的文件在发送给其他人之前,你可以验证各种类型文件或为你的文件生成一个哈希值。你可以通过发给收件人分享你生成的哈希值,让他们验证你的文件。 + +![][3] + +这是一款简单的开源应用,它只帮你做两件事情: + + * 生成哈希值(SHA-1、MD5、SHA-256、SHA-516) + * 通过直接使用文件或者校验值验证一个项目 + +### Collision 是怎么工作的 + +给你举个例子,我修改原来的文本文件,为其添加一个字母,然后尝试验证它。 + +下面是它的过程: + +首先,你需要打开你要比对的原文件或者有校验值的原文件。 + +打开原文件生成哈希值,然后去验证区查看修改后的文件。 + +![][4] + +你会注意到,它们俩个不是相同的: + +![][5] + +如果你在按校验值检查文件,首先,你要打开你要验证的文件(这儿是我们已经修改后的文件)。 + +![][6] + +然后,输入文件的原始真实校验值。当然我们已经知道我们测试的是修改后的文件,结果是我们所期望的,即,**验证文件完整性失败**。 + +![][7] + +### 在 Linux 安装 Collision + +Collisions 主要是一个为 GNOME 定制的程序,但是它也适用于其他发行版上。 + +你可以使用 [Flatpak 可用软件包][8] 来安装它,或者浏览 GitHub 网页,从源码中编译它。如果你是 Linux 新手,你可以参考我们的 [Flatpak 指南][9] 来得到帮助。 + +如果你喜欢使用终端来安装,键入以下命令来安装: + +``` +flatpak install flathub dev.geopjr.Collision +``` + +你也可以访问它的官方网站。 + +> [Collision][10] + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/collision/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/checksum-tools-guide-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/04/collission-verify-true.png?resize=800%2C617&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/04/collision-hash-values.png?resize=800%2C617&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/04/collision-file-open.png?resize=800%2C328&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/04/collision-file-check.png?resize=800%2C620&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/04/collision-file-verify.png?resize=800%2C373&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/04/collision-input-checksum.png?resize=800%2C626&ssl=1 +[8]: https://flathub.org/apps/details/dev.geopjr.Collision +[9]: https://itsfoss.com/flatpak-guide/ +[10]: https://collision.geopjr.dev/ diff --git a/published/202204/20220405 Here-s What Devs Are Planning for GNOME 43.md b/published/202204/20220405 Here-s What Devs Are Planning for GNOME 43.md new file mode 100644 index 0000000000..9364aaad8c --- /dev/null +++ b/published/202204/20220405 Here-s What Devs Are Planning for GNOME 43.md @@ -0,0 +1,121 @@ +[#]: subject: "Here’s What Devs Are Planning for GNOME 43" +[#]: via: "https://news.itsfoss.com/gnome-43-dev-plans/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14440-1.html" + +开发者对于 GNOME 43 的计划 +====== +> GNOME 43 及以后的开发计划令人振奋,以下是你可以期待的:…… + +![](https://news.itsfoss.com/wp-content/uploads/2022/04/gnome43-ft.jpg) + +GNOME 42 刚刚发布不久。 + +尽管它是 GNOME 41 之后的一次令人兴奋的升级,但你可能无法在每个主流 Linux 发行版上找到它(除了 OpenSUSE、Arch 和 Clear Linux)。 + +Fedora 36 和 Ubuntu 22.04 应该是采用 GNOME 42 的最受欢迎的选择,它们将在接下来的几周发布。 + +接下来是什么?没错,就是 **GNOME 43**。 + +### GNOME 43:计划中的新功能 + +在一篇 [博文][1] 中,GNOME 开发者 Chris Davis 分享了一些 GNOME 43 及之后版本计划中的变更。 + +我在这里介绍其中的一些主要亮点。 + +> 请注意,这里提到的计划变更或改进可能会在 GNOME 43 中首次亮相,也可能不会。 + +#### 全局强调色 + +![Ubuntu 22.04 Beta 中的强调色][2] + +随着 Libadwaita 的引入,现在有可能增加一个全局强调色的功能。 + +你不必依赖发行版来提供使用强调色的能力(比如 [Ubuntu 22.04 中添加了这个功能][3])。 + +有了强调色,GNOME 桌面体验可以更加个性化。此外,它将不仅仅局限于预设,同时也支持自定义强调色,应用开发者可以考虑支持它。 + +#### 重新着色 API + +![][4] + +这对终端用户来说可能不是特别有趣,但它将帮助应用开发者提供预设的颜色方案,让他们的应用更好地协调各种强调色。 + +正如这篇博文所说: + +> 开发者可以使用重新着色 API,以编程方式改变他们应用程序中的颜色,并让依赖的颜色自动更新。他们将能够轻松地创建预设,从而实现许多功能。例如,根据文本视图的颜色方案来改变窗口的显示颜色。 + +有了 libadwaita 1.0 中的 CSS,这在技术上已经可以实现。然而,API 可以帮助开发者更容易地使用这个功能。 + +#### 自适应的 Nautilus 文件管理器 + +![][5] + +Nautius 文件管理器将得到一些升级,比如针对移动尺寸的自适应设计,其中包含一个新的文件选择器模式。 + +它将帮助 GNOME 平台跟上新功能,而不需要依赖 GTK 的文件选择器,因为它不支持 GNOME 的所有功能,比如收藏文件。 + +#### 新的图片浏览器(Loupe)和屏幕截图注释 + +一个新的图片浏览器正在开发中,名字叫 Loupe。它由 Rust 编写,使用了 GTK4 和 libadwaita。 + +![][6] + +这个图片浏览器的目标是自适应、对触摸板和触摸屏友好,并且易于使用。你可以期待它与 Nautilus 集成,以遵循文件管理器中任何文件夹的排序设置。 + +除了系统集成之外,新的图片浏览器还将会有一些功能升级,主要是在基本的图片编辑方面,比如剪裁、旋转和注释。 + +![][7] + +有了注释的能力,它可以与截图流程很好地配合,允许你在没有任何第三方程序的情况下进行屏幕截图并进行注释。 + +#### 磁盘使用情况分析器的新设计(用 Rust 重写) + +磁盘使用情况分析器目前是用 Vala 编写的。 + +虽然它能完成预期的工作,但是按照现在的实现方式,它不具备很大的潜力。 + +![磁盘使用情况分析器的设计演示图,图源:Allan Day][8] + +因此,开发计划中包括了使用 Rust 来重写它,这应该会在可预见的未来改善它,提供最好的性能。 + +![磁盘使用情况分析器的设计模型,图源:Allan Day][9] + +不仅仅局限于其核心,它还将得到一个设计上的大调整(类似于上面的演示图),以争取让用户体验更加现代化。 + +### 其他改进措施 + +随着开发的进行,我们应该会知道更多关于 GNOME 外观和其他方面计划中的变更。 + +当我们了解到更多关于 GNOME 43 的功能时,我将会更新这篇文章。 + +如果你对技术细节感到好奇,你可以阅读 [Chris 的博文][1]。你也可以赞助他为 GNOME 做的工作,以及其他任何相关的东西。 + +你期待中的 GNOME 43 是什么样的?请在下面的评论中分享你的想法吧! + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gnome-43-dev-plans/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://blogs.gnome.org/christopherdavis/2022/04/03/plans-for-gnome-43-and-beyond/ +[2]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/ubuntu-22-04-dark-mode.png?w=1155&ssl=1 +[3]: https://news.itsfoss.com/ubuntu-22-04-accent-color/ +[4]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/04/recoloring-api-gnome-43.png?w=768&ssl=1 +[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/04/nautilus-gnome-43-plan.png?w=768&ssl=1 +[6]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/04/image-viewer-gnome-43.png?w=722&ssl=1 +[7]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/03/ubuntu-22-04-screenshot-ui.jpg?w=800&ssl=1 +[8]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/04/disk-usage-analyser-gnome-43.png?w=763&ssl=1 +[9]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2022/04/disk-usage-analyser-gnome-43-1.png?w=759&ssl=1 diff --git a/published/202204/20220405 Xfce Terminal 1.0.0 is a Feature-Packed Major Upgrade After a Year.md b/published/202204/20220405 Xfce Terminal 1.0.0 is a Feature-Packed Major Upgrade After a Year.md new file mode 100644 index 0000000000..7df9a215df --- /dev/null +++ b/published/202204/20220405 Xfce Terminal 1.0.0 is a Feature-Packed Major Upgrade After a Year.md @@ -0,0 +1,96 @@ +[#]: subject: "Xfce Terminal 1.0.0 is a Feature-Packed Major Upgrade After a Year" +[#]: via: "https://news.itsfoss.com/xfce-terminal-1-0-0-release/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14459-1.html" + +Xfce Terminal 1.0.0:时隔一年后的一次功能丰富的重大升级 +====== + +> 在其上一个主要版本发布一年后,Xfce Terminal 1.0.0 终于来了。兴奋地想了解一下新的改进吗?让我们来看看! + +![](https://news.itsfoss.com/wp-content/uploads/2022/04/xfce-terminal-1-0-0.jpg) + +作为几乎在所有采用 Xfce 的发行版上流行的终端模拟器,Xfce Terminal 刚刚由新的维护者(及新的版本计划)发布了它的第一次重大升级。 + +让我们来看看这个版本的一些亮点。 + +### 新的维护者和版本管理方案 + +Igor Zakharov 从 2016 年到 2020 年一直在领导它的开发工作。不幸的是,在 2021 年它就没有被维护过,直到新的维护者 [Sergios][1] Anestis Kefalidis(也是 Thunar 文件管理器的开发者)接手。 + +而且,自从 Sergios 接管了这个项目后,版本管理方案也发生了变化。经过与社区的协商,采用了 Thunar 的旧版本计划。 + +例如,1.1.x 版本将是开发版本,而 1.2.0 版本将是下一个主要升级版本。 + +现在,随着 Xfce Terminal 1.0.0 的发布,一些令人兴奋的新特性已经被纳入。 + +### 新特性 + +Xfce Terminal 1.0.0 的一些新特性包括: + + * 改进了自定义选项 + * 支持叠加滚动条 + * 命令行选项的改进 + * 更多使用 XfceTitledDialog + +#### 更好的自定义选项 + +和现在许多应用的更新一样,Xfce Terminal 1.0.0 包括大量新的自定义选项。也许我最喜欢的是,图像背景功能现在有一个“填充”风格选项。伴随着这一点的是暂时禁用不安全的粘贴对话框的能力,它也被改造了。 + +最后,Xfce Terminal 也成为首批支持新的 Xfce 快捷键编辑器的应用之一。因此,用户不再需要潜心研究配置文件,而是有了一个可以使用的简单 UI。 + +![][2] + +有了这么多新的定制选项,我相信很多人都会对一个只是包含这些的版本感到满意。但是!开发者设法加入了更多令人兴奋的新功能,其中下一个是改进的命令行参数。 + +#### 更好的命令行参数 + +在这个版本中,修复了 `-tab` 和 `-window` 命令行参数,变得更加直观。这修复了 Xfce Terminal 中一个 [长期存在的错误][3],它已经存在了近 6 年。 + +尽管等待了很久,但现在它已经被修复了。迟到总比不到好,是吧? + +不管怎么说,看到每一个新版本的错误被修复总是很好的,这个趋势在这里继续。 + +#### 更多使用 Xfce 专用的小工具 + +虽然我相信很多用户可能会认为这是一个退步,但 Xfce Terminal 使用更多的 Xfce 专用小工具带来了很多好处。虽然这对非 Xfce 用户确实意味着要安装更多的依赖关系,但它意味着与 Xfce 更好的整合。 + +可以说,大多数的 Xfce Terminal 用户都坚持使用同样的 Xfce 桌面环境。所以,这种改变应该会带来更大的一致性和用户体验的改善。 + +#### 其他变化 + +这个版本的其他变化包括: + + * “输出滚动”偏好设定的改进 + * 右键点击行为的自定义选项 + * 为缩小代码库而进行的代码重写 + +关于完整的功能列表,请随时参考 [发布说明][4]。发布说明中还提到了下一个主要版本的未来计划,即 v1.2.0。 + +### 总结 + +总的来说,Xfce Terminal 1.0.0 看起来是一个不错的版本,也说明了其新的维护者的奉献精神。 + +如果你想试试 Xfce Terminal 1.0.0,它应该会在接下来的几周内进入你的发行库,如果现在还没有的话。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/xfce-terminal-1-0-0-release/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lujun9972 +[1]: https://www.youtube.com/channel/UCu8-J-XWcXQhoCopBiJ5-uw/videos +[2]: https://news.itsfoss.com/wp-content/uploads/2022/04/xfce4-terminal.png +[3]: https://bugzilla.xfce.org/show_bug.cgi?id=12926 +[4]: http://users.uoa.gr/~sdi1800073/sources/xfce_blog12.html diff --git a/published/202204/20220406 Ex-Snap Advocate at Ubuntu Creates a Tool to Help You Migrate from Snap to Flatpak.md b/published/202204/20220406 Ex-Snap Advocate at Ubuntu Creates a Tool to Help You Migrate from Snap to Flatpak.md new file mode 100644 index 0000000000..a6b9c64b22 --- /dev/null +++ b/published/202204/20220406 Ex-Snap Advocate at Ubuntu Creates a Tool to Help You Migrate from Snap to Flatpak.md @@ -0,0 +1,131 @@ +[#]: subject: "Ex-Snap Advocate at Ubuntu Creates a Tool to Help You Migrate from Snap to Flatpak" +[#]: via: "https://news.itsfoss.com/unsnap-migrate-snap-to-flatpak/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14482-1.html" + +Ubuntu 的前 Snap 倡导者创建了一个工具,帮助你从 Snap 迁移到 Flatpak +====== + +> 吃惊!Canonical 的前 Snap 倡导者开发了一个工具,帮助你快速抛弃 Snap 并使用 Flatpak。 + +![](https://news.itsfoss.com/wp-content/uploads/2022/04/unsnap.png) + +不喜欢使用 Snap? + +好吧,你可以一直坚持使用传统的二进制包(deb/rpm),或者选择 [Flatpak][1]。 + +但是,如果你已经用上了 Snap 商店的应用,怎么办? + +手动删除 Snap 应用,和 Snap 说再见,安装 Flatpak,并安装所有 Flatpak 需要的软件包,这将是非常耗时的。 + +这就是 “Unsnap” 派上用场的地方。 + +Unsnap 是一个开源工具,由 Canonical 的前 Snap 倡导者 **Alan Pope** 开发,帮助你从Snap 快速迁移到 Flatpak。 + +### Unsnap:它是如何工作的 + +> 请注意,该工具仍处于前 alpha 阶段,你可以测试它,但如果你想实际使用并帮助改进,你可能要做一些研究。 + +基本上,该工具生成的脚本可以帮助你做以下事情(按特定顺序): + + * 备份现有的 Snap 软件包。 + * 安装 Flatpak(如果尚未存在)。 + * 启用 Flathub。 + * 为 Snap 应用安装相同的 Flatpak 应用。 + * 移除已安装的 Flatpak 应用的 Snap 应用。 + * 删除所有 Snap 软件包。 + +虽然脚本是在你运行工具时自动生成的,但你可以选择手动或自动逐个运行这些脚本来切换到 Flatpak 应用。 + +### 如何测试 Unsnap? + +![][2] + +看了上面的截图,你可能对它的实现方式有了一个模糊的概念。你也可以参考它的 [GitHub 页面][3] 了解最新信息。 + +作为参考,让我为你强调一下步骤: + +#### 1、克隆 GitHub 仓库 + +请确保你已经 [在你的 Linux 发行版上安装了 Git][4]。完成后,你可以输入以下命令: + +``` +git clone https://github.com/popey/unsnap +``` + +#### 2、切换到该目录 + +当你克隆了仓库,你的系统上就会有 `unsnap` 目录。 + +输入以下命令切换到目录: + +``` +cd unsnap +``` + +#### 3、运行该工具 + +在切换到目标目录后,只需使用命令运行 `unsnap` 工具: + +``` +./unsnap +``` + +它将检查现有的 Snap 和 Flatpak 软件包等等,进行设置。 + +正如你在上面的截图中注意到的,它已经检测到我的系统有了 Flatpak 环境,所以它跳过了为这些任务生成脚本。 + +在这个过程中,它还会了解你系统上安装的 Snap 应用,以便在你运行生成的脚本时找到相应的 Flatpak 应用。 + +如果你想立即运行所有的脚本,你可以输入: + +``` +./unsnap auto +``` + +![][2] + +如果你想要不使用自动选项进行控制,你可以发现生成的脚本驻留在一个日志目录内,如下图所示: + +![][2a] + +下面是你应该遵循的脚本的执行顺序: + + * `00-backup` + * `01-install-flatpak` + * `02-enable-flathub` + * `03-install-flatpaks` + * `04-remove-snaps` + * `99-remove-snapd` + +在我的例子中,我已经设置了 Flatpak,所以我继续运行备份脚本,然后安装 Flatpak 软件包,如此循环。下面是它看起来的样子: + +![][2b] + +你应该记住,这个工具正在积极开发中,可能不会像预期那样工作。所以,你如果依赖众多的 Snap 应用,你应该在虚拟机或测试机上试验使用该工具,并等待该工具随着稳定版本的推出而改进。 + +请在下面的评论中告诉我你对 Unsnap 的看法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/unsnap-migrate-snap-to-flatpak/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/flatpak-guide/ +[2]: https://news.itsfoss.com/wp-content/uploads/2022/04/unsnap-auto.png +[3]: https://github.com/popey/unsnap +[4]: https://itsfoss.com/install-git-ubuntu/ +[2a]: https://news.itsfoss.com/wp-content/uploads/2022/04/unsnap-scripts.png +[2b]: https://news.itsfoss.com/wp-content/uploads/2022/04/unsnap-install-flatpaks.png \ No newline at end of file diff --git a/published/202204/20220407 Linux Mint 21 Code Name Announced with New Upgrade Utility and More.md b/published/202204/20220407 Linux Mint 21 Code Name Announced with New Upgrade Utility and More.md new file mode 100644 index 0000000000..c86f50a751 --- /dev/null +++ b/published/202204/20220407 Linux Mint 21 Code Name Announced with New Upgrade Utility and More.md @@ -0,0 +1,62 @@ +[#]: subject: "Linux Mint 21 Code Name Announced with New Upgrade Utility and More" +[#]: via: "https://www.debugpoint.com/2022/04/linux-mint-21-announcement/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14448-1.html" + +Linux Mint 21 公布了代号、新的升级工具及更多内容 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/09/112010zm619gd31ka7zk3k.jpg) + +> Mint 团队公布了即将到来的 Linux Mint 21 的代号、一个用于轻松升级的工具,以及令团队惊叹的 Warpinator 使用案例。 + +### Linux Mint 21 公告和其他更新 + +首先,Linux Mint 21 的代号是 “Vanessa”,它将基于 [Ubuntu 22.04 LTS Jammy Jellyfish][1]。像往常一样,它将提供三个旗舰版本:Xfce、Cinnamon 和 MATE。 + +其次,很明显,Mint 团队将选择 Ubuntu 22.04 LTS 作为 Linux Mint 21 的基础以获得长期支持。它将采用 [5.15 版本的 Linux 内核][2],这是一个长期支持版的内核。 + +除此之外,项目负责人 Clement Lefebvre 还宣布了 [一个新的升级工具][3](mintupgrade2),这样一来,计划升级到 Linux Mint 21 的用户可以更轻松地完成升级步骤。根据历史经验,升级到 Mint 的主要版本是一个涉及大量终端操作的复杂过程,这对普通用户来说通常是困难的。 + +![随 Linux Mint 21 公布的 Mint 升级工具][4] + +因此,考虑到其用户基础,Mint 团队为用户开发这个升级工具还是很有必要的。Clement Lefebvre 承诺,新的工具将是完全图形化的,附带有易于管理的步骤和说明。它将支持语言的本地化,还将为复杂的升级过程提供预先检查,同时也将为用户提供易于理解的可配置的指南。 + +这个工具将成为从 Linux Mint 20 升级到 21 的主要工具,它会在五、六月份左右发布。此外,这个新工具承诺提供关于自定义 PPA 和孤儿包的警告,以减少你在升级前的担忧。老实说,这将是 Mint 团队为其用户带来的最好的工具之一。 + +#### 其他更新 + +除了以上更新外,团队还提到,文件传输工具 Warpinator 被世界上的多个用户用于一些奇怪的需求 —— 这是团队之前从未想过的。例如,有人用 Warpinator 在 Windows 和 V 社的 Steam Deck 游戏机之间传输文件,参见 [这个视频][5]。 + +说到这里,Warpinator 现在提供了一个 [针对 iOS][6] 用户的测试发行版。你现在可以在你的苹果系统与任何其他系统之间快速传输文件,包括安卓、Linux 和 Windows。Mint 团队开发的这个应用真不错。 + +你可以在官方[博客][7]中阅读关于 Linux Mint 21 的公告和更多内容。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/04/linux-mint-21-announcement/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/ +[2]: https://www.debugpoint.com/2021/11/linux-kernel-5-15/ +[3]: https://github.com/linuxmint/mintupgrade2 +[4]: https://www.debugpoint.com/wp-content/uploads/2022/04/Mint-upgrade-2-utility-announced-with-Linux-Mint-21.jpg +[5]: https://www.youtube.com/watch?v=sHdQT6kI6Q8 +[6]: https://www.reddit.com/r/linuxmint/comments/rn04lw/interest_in_warpinator_for_ios/ +[7]: https://blog.linuxmint.com/?p=4293 +[8]: https://t.me/debugpoint +[9]: https://twitter.com/DebugPoint +[10]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[11]: https://facebook.com/DebugPoint diff --git a/published/202204/20220407 Vivaldi 5.2 Adds a Reading List Panel - New Privacy Statistics Bar.md b/published/202204/20220407 Vivaldi 5.2 Adds a Reading List Panel - New Privacy Statistics Bar.md new file mode 100644 index 0000000000..6418116b9f --- /dev/null +++ b/published/202204/20220407 Vivaldi 5.2 Adds a Reading List Panel - New Privacy Statistics Bar.md @@ -0,0 +1,104 @@ +[#]: subject: "Vivaldi 5.2 Adds a Reading List Panel & New Privacy Statistics Bar" +[#]: via: "https://news.itsfoss.com/vivaldi-5-2-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14452-1.html" + +Vivaldi 5.2 增加了阅读列表面板和新的隐私统计栏 +====== + +> Vivaldi 5.2 已经准备好了,增加了新的功能,使该浏览器对桌面和移动用户更加有用。 + +![](https://news.itsfoss.com/wp-content/uploads/2022/04/vivaldi-5-2.jpg) + +对于那些希望获得更好的浏览体验的用户来说,Vivaldi 一直以来都是一个很好的选择。 + +尽管它不是完全的自由及开放源代码软件Free and Open Source Software(FOSS)(用户界面是专有的,其他部分是开源的),但对于那些需要处理多个标签页,以及希望有更多特性的 Linux 用户来说,它是一个可行的选择。 + +事实上,它现在是 [Linux 用户的最佳选择之一][1]。 + +Vivaldi 5.2 增加了更多有用的升级,对于你目前使用的浏览器来说,它现在成为了一个吸引人的可选替代品。 + +### Vivaldi 5.2:新功能 + +Vivaldi 5.2 通过一个新的阅读面板和一个独立的隐私统计栏,增强了使用体验。 + +其安卓版也得到了一些令人兴奋的升级,让我们来看看吧! + +下面是更多的介绍: + +#### 阅读列表面板 + +![][2] + +此前,Vivaldi 的侧面板已经有了大量的选项,包括电子邮件、RSS、日历等。 + +现在,一直存在于地址栏中的阅读列表(保存页面以便以后阅读)现在也可以在侧面板中使用。 + +出现在侧面板中后,阅读列表变得比以前更容易访问。因此,你能够在你需要的时候,随时检查/浏览阅读列表,而不必从当前的任务中切换出来。 + +你可以在下面的视频中查看该功能的运行情况: + +![](https://youtu.be/hhGQUO8u9iQ) + +你可以在侧面板里管理、搜索和组织阅读列表。 + +你也可以使用快捷命令,把任何页面保存到到阅读列表中。别忘了,你的阅读列表还能够与你的手机(安卓)或任何其他已连接的设备同步。 + +#### 隐私统计栏 + +![][4] + +尽管 Vivaldi 已经有了阻止跟踪器的内置保护功能,但你并不能正确了解这些跟踪器的信息。 + +有了新的统计栏,你就可以集中地看到在浏览过程中被阻止的所有跟踪器的跟踪行为。 + +大多数用户可能不关心这个问题。但是,查看统计信息可以让你知道什么追踪器更普遍,并获得对它们的了解。 + +你也可以在下面的视频中了解它的实际使用: + +![](https://youtu.be/MAY5s_MpnxY) + +#### 其他改进措施 + +除了隐私统计栏,Vivaldi 5.2 还提供了其他改进,比如: + + * 支持把 [Qwant][6] 搜索引擎作为默认的搜索引擎。 + * 优化了标签的拖/放操作。 + * 改进了 Vivaldi Mail、Calendar 和 Feed Reader 的功能。 + +若想了解更多信息,你可以参考 [官方发布公告][7]。 + +### 下载 Vivaldi 5.2 + +你可以从它的官方网站下载最新的发布包(deb/rpm)来安装。 + +> [下载 Vivaldi 5.2][8] + +如果你是通过官方的仓库 [在 Linux 上安装的 Vivaldi][9],它可能已经在你的软件更新列表里了,即使现在没有,你也应该很快就能在软件更新列表中找到它。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/vivaldi-5-2-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-browsers-ubuntu-linux/ +[2]: https://news.itsfoss.com/wp-content/uploads/2022/04/vivaldi-side-panel.jpg +[3]: https://youtu.be/hhGQUO8u9iQ +[4]: https://news.itsfoss.com/wp-content/uploads/2022/04/Privacy-statistics-vivaldi-5-2.jpg +[5]: https://youtu.be/MAY5s_MpnxY +[6]: https://www.qwant.com/ +[7]: https://vivaldi.com/press/vivaldi-adds-a-reading-list-panel-shows-statistics-on-blocked-trackers-and-ads/ +[8]: https://vivaldi.com/download/ +[9]: https://itsfoss.com/install-vivaldi-ubuntu-linux/ diff --git a/published/202204/20220407 Xubuntu 22.04 LTS - New Features and Release Details.md b/published/202204/20220407 Xubuntu 22.04 LTS - New Features and Release Details.md new file mode 100644 index 0000000000..6cceb7c1d4 --- /dev/null +++ b/published/202204/20220407 Xubuntu 22.04 LTS - New Features and Release Details.md @@ -0,0 +1,85 @@ +[#]: subject: "Xubuntu 22.04 LTS – New Features and Release Details" +[#]: via: "https://www.debugpoint.com/2022/04/xubuntu-22-04-lts/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14478-1.html" + +Xubuntu 22.04 LTS - 新功能和发布细节 +====== + +> Xubuntu 22.04 LTS(Jammy Jellyfish)的新功能列表以及关于该版本的其他信息。 + +![Xubuntu 22.04 Desktop][1] + +### Xubuntu 22.04 LTS - 新功能 + +Xubuntu 22.04 LTS 采用的是 Linux 内核 5.15,基础软件包来自 Ubuntu 22.04 LTS。除此以外,默认的桌面环境版本是 Xfce 4.16。Xfce 桌面环境自 2020 年 12 月发布以来,没有发布任何重要的版本。 + +尽管如此,自 Xubuntu 21.10(最后一个版本)就在使用的 Xfce 桌面 4.16 版本,桌面组件和原生应用得到了一些改进和错误修复。 + +也许这个版本的重要工作是在 Greybird 主题中对 GTK4 和 libhandy 的初步支持(通过 3.23.1 版本)。这意味着来自 GNOME 生态系统的 GTK4 应用在 Xubuntu 的主题下看起来不错。 + +### 应用更新 + +默认的文件管理器 Thunar 4.16.10 增加了一些性能改进,包括回归修复、翻译更新和一些变化。虽然在翻阅更新日志的时候,我找不到任何对用户可见的实质性报告。但如果你有兴趣,你可以 [在这][2] 详细阅读新闻。 + +事实上,Thunar 现在正在和 Xfce 4.17 一起开发,包含了一些令人兴奋的变化。但不幸的是,我们都需要在短期支持版本中等待,因为要在长期支持版本中实现这些功能还为时过早。 + +除此之外,Xfce Terminal 在这个版本中仍然是 0.8.10。与 Thunar 类似,Xfce Terminal 1.0.0 重大更新也不会在这个长期支持版本中出现。 + +除了这两个,其他的桌面组件仍然是最后的稳定版本,包括 Xfce Panel 4.16.3、Xfce Window Manager 4.16.1 和 Xfce Desktop 4.16。值得一提的是,Xfce 仍在进行 GTK4 的过渡工作,目前还没有太明确的时间表。 + +此外,原生应用的版本被提升到最新的稳定迭代版本。但一个重大变化是,继 Ubuntu 之后, Xubuntu 22.04 中的 Firefox 可执行文件现在是 Snap 版本。因此,在理想情况下,用户不会感觉到任何差异,但由于其沙盒性质,可能会在扩展程序和其他工具方面面临一些问题。 + +除此之外,Xubuntu 22.04 还期望从社区竞赛中获得一些漂亮的壁纸,其中一个作为默认壁纸。竞赛结果还没有出来。不过,你可以在 [本页面][4] 上找到一些令人兴奋的投稿。 + +### 总结和下载 + +总结一下,主要的核心框架、应用和它们的版本都在下面。 + + * GNOME 42 + * GTK 3.24.32 + * MATE 1.26 + * Xfce 4.16 + * Firefox 99 + * Thunderbird 91.8 + * Atril Document Viewer 1.26 + * Engrampa Archive Manager 1.26 + * Ristretto Image Viewer 0.12.2 + * LibreOffice 7.3.x + * Catfish 4.16.3 + * Mousepad 0.5.8 + +最后,要下载 Xubuntu 22.04 的 BETA 版本,请参考下面的 ISO 文件的链接。你可以尝试在虚拟机上安装或在物理系统中尝试。 + + * [xubuntu-22.04-beta-desktop-amd64.iso][5] + * [其他下载选项包括torrent, checksum][6] + +_信息来自 [官方更新日志][7]_ + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/04/xubuntu-22-04-lts/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/wp-content/uploads/2022/04/Xubuntu-22.04-Desktop-1024x575.jpg +[2]: https://archive.xfce.org/src/xfce/thunar/4.16/ +[4]: https://contest.xubuntu.org/wallpaper_contest/xubuntu-22-04-community-wallpaper-contest/?action=view +[5]: https://cdimage.ubuntu.com/xubuntu/releases/22.04/beta/xubuntu-22.04-beta-desktop-amd64.iso +[6]: https://cdimage.ubuntu.com/xubuntu/releases/22.04/beta/ +[7]: https://wiki.xubuntu.org/releases/22.04/release-notes +[8]: https://t.me/debugpoint +[9]: https://twitter.com/DebugPoint +[10]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[11]: https://facebook.com/DebugPoint diff --git a/published/202204/20220408 Create Your Own Custom Light and Dark Wallpaper for GNOME.md b/published/202204/20220408 Create Your Own Custom Light and Dark Wallpaper for GNOME.md new file mode 100644 index 0000000000..98df548847 --- /dev/null +++ b/published/202204/20220408 Create Your Own Custom Light and Dark Wallpaper for GNOME.md @@ -0,0 +1,110 @@ +[#]: subject: "Create Your Own Custom Light and Dark Wallpaper for GNOME" +[#]: via: "https://www.debugpoint.com/2022/04/custom-light-dark-wallpaper-gnome/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14471-1.html" + +如何创建你的自定义 GNOME 深浅壁纸 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/13/233814h9wwzwaqtwu9qthg.jpg) + +> 一份简单的指南:如何针对 GNOME 桌面环境来创建你的自定义的深色和浅色壁纸。 + +[GNOME 42][1] 将备受期待的深浅主题带到 GNOME 桌面环境。它也带来壁纸的深色和浅色版本,当你切换深色或浅色主题时,它会自动地转换。 + +因此,默认情况下,GNOME 给予你一套预配置的深色和浅色壁纸。但是如果你想要在主题更改时自动地转换成另一种不同的壁纸要怎么做呢? + +下面是如何在 GNOME 中配置和创建你自己的深浅壁纸的方法。 + +### 如何针对 GNOME 桌面环境来创建自定义的深浅壁纸 + +第一,确保你手边有两个版本的壁纸。一般来说,它们应该是标准的 PNG 或 JPG 图像文件。例如,我们针对这个示例使用下面的两张壁纸。 + +![Sample light and dark wallpaper for demo][2] + +但是,如果你没有合适的深浅壁纸,或者正在查找更多的壁纸,在这篇指南的结尾,我将让你知道如何获取它们,或者如何自己准备它们。请跟着我阅读。 + +第二,我们需要为我们自己创建一个模式文件。壁纸的自动更换是由一个名为 `adwaita.xml` 的 XML 文件处理的,它定义了特定的深色和浅色的背景标记。因此,我们将为壁纸创建我们自己的 XML 文件。 + +为做到这一点,[从 GitLab 复制][3] `adwaita.xml` 的内容,并创建一个新的 XML 文件。你能够会在这个文件中看到两个标记 – `filename` 和 `filename-dark`。这两个 XML 标记包含这两个壁纸的完整的限定的路径。现在,在这两个标记下添加你的图像文件的路径,如我下图所示。。 + +![Change the XML file][4] + +第三,把这个文件保存到 `/home//.local/share/gnome-background-properties`,(请将 `` 替换为你的用户名)文件名任意。如果这里没有 `gnome-background-properties` 目录,就创建它。针对这个示例,我使用 `my_cool_backgrounds.xml` 文件名。 + +![Save the file][5] + +这样,你就准备好了所有的东西。最后,打开 “设置Settings” 并转到 “外观Appearance” 标签页,你应该会看到一个新的壁纸选项。 + +选择你自己的自定义的深浅壁纸,尽情享受。 + +![Appearance tab has now your own custom light and dark wallpaper][7] + +### 如何下载或制作你自己的动态壁纸 + +当然,你必然会想,谁有时间去查找和创建壁纸的日夜版本?这里有一些网站来向你提供预制好的动态壁纸,你可以轻松地下载和安装。 + +我推荐的一个网站是 [dynamicwallpaper.club][8] ,它有一些高达 6K 的极好的高质量的壁纸,可用于 macOS。你可以轻松地下载它们。 + +此外,如果你打算从上述网站下载,请记住该网站的图像文件是 [heic][9] 格式的,因为这个网站是针对 macOS 的。高效视频编码High-Efficiency Video Coding(HEIC)是苹果的专有的 HEIF(高效图像文件High-Efficiency Image File)专有版本。 + +那么,如何在 Linux 系统中转换它们? 好吧,在 Ubuntu 或 Fedora Linux 中,你需要一个驱动程序来查看和转换动态的 heic 图像文件。打开一个终端,运行下面的命令开安装驱动程序。 + +Ubuntu 用户 – + +``` +sudo apt install heif-gdk-pixbuf +``` + +Fedora 用户 – + +``` +sudo dnf install libheif +``` + +只针对使用 KDE Plasma 的 Fedora/Ubuntu 用户(没有这个插件的帮助,Plasma 应用程序就不能打开 heic 格式的图像文件): + +``` +sudo apt install qt-heif-image-plugin +sudo dnf install qt-heif-image-plugin +``` + +最后,使用你喜欢的图像查看器打开 heic 图像文件,并将其保存为 JPG/PNG 图像文件。 + +最好,不要忘记在下面的评论区告诉我,你是否能够针对 GNOME 桌面环境来创建你自己的自定义的深浅壁纸了。 + +![Custom Light and Dark wallpaper in GNOME – transition][10] + +感谢阅读。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/04/custom-light-dark-wallpaper-gnome/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/2022/03/gnome-42-release/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/04/Sample-light-and-dark-wallpaper-for-demo.jpg +[3]: https://gitlab.gnome.org/GNOME/gnome-backgrounds/-/tree/main/backgrounds +[4]: https://www.debugpoint.com/wp-content/uploads/2022/04/Change-the-XML-file-1024x568.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/04/Save-the-file-1024x548.jpg +[6]: https://www.debugpoint.com/2021/12/gnome-text-editor/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/04/Apperance-tab-has-now-your-own-custom-light-and-dark-wallpaper-1024x657.jpg +[8]: https://dynamicwallpaper.club +[9]: https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format +[10]: https://www.debugpoint.com/wp-content/uploads/2022/04/Custom-Light-and-Dark-wallpaper-in-GNOME-transition-1024x556.gif +[11]: https://t.me/debugpoint +[12]: https://twitter.com/DebugPoint +[13]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[14]: https://facebook.com/DebugPoint diff --git a/published/202204/20220409 Firefox 99 Brings These Two Changes for Linux Users.md b/published/202204/20220409 Firefox 99 Brings These Two Changes for Linux Users.md new file mode 100644 index 0000000000..3540ac1777 --- /dev/null +++ b/published/202204/20220409 Firefox 99 Brings These Two Changes for Linux Users.md @@ -0,0 +1,73 @@ +[#]: subject: "Firefox 99 Brings These Two Changes for Linux Users" +[#]: via: "https://news.itsfoss.com/firefox-99-release/" +[#]: author: "Shobhit Singh https://news.itsfoss.com/author/shobhit/" +[#]: collector: "lujun9972" +[#]: translator: "zd200572" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14455-1.html" + +Firefox 99 为 Linux 用户带来了两点改变 +====== + +> 最新发布的 Firefox 浏览器为桌面 Linux 用户带来了两点改变。 + +![](https://news.itsfoss.com/wp-content/uploads/2022/04/firefox.png) + +Mozilla 的 Firefox 是最受欢迎的开源浏览器之一,这也是它在许多 Linux 发行版(如 Mint 和 Ubuntu)中用作默认浏览器的原因。 + +最近,Mozilla 发布了 Firefox 99.0 版本,为 Linux 版本带来了新的安全性和 UI 特性。 + +### 更新了什么呢? + + * 现在,你可以使用键盘快捷键 `n` 在阅读器模式ReaderMode中切换“讲述Narrate”模式。 + * 你可以在 PDF 查看器中找到对搜索音调符号的附加支持。 + * 添加了 GTK 叠加滚动条。 + * Linux 沙箱已得到加强:暴露于 Web 内容的进程不再有权访问 X Window 系统(X11)。 + * Firefox 现在在德国和法国支持信用卡自动填充和捕获。 + +在本文中,我们将深入研究这些内容,并进一步扩展Linux版本特定的变化。 + +### GTK 叠加滚动条 + +这个版本的 Firefox 为滚动条做了一个新的、时尚的、更窄的设计。如果不在使用中,滚动条也会隐藏,这让浏览器给人以更现代和优雅的感觉。 + +![][1] + +但在稳定版中这个特性默认没有启用。开启这个特性,转到 `about:config`,搜索 `widget.gtk.overlay-scrollbars.enabled`。这个值默认是 `false`,双击它将设置为 `true`,这将启用新的滚动条。 + +![][2] + +### Linux 沙箱得到加强 + +这是一个安全更新,目的是将 Firefox 进程与系统的其余部分隔离开来。沙箱环境是一个应用可以在不影响任何外部应用,或与任何外部应用程序交互的情况下运行的环境。这个特别的更新禁止了 Web 进程和 X 服务器的任何互动。X 服务器(X11)是大多数 Linux 发行版中使用的默认 GUI 服务器。 + +Snap、Flatpak 和 Appimage 已经提供了其应用程序的沙盒版本。如果你是一个 Snap 或者 Appimage 用户,这是个好消息。然而,有 [报道称][3] 这会破坏硬件加速功能。 + +_硬件加速是应用程序将某些任务加载到硬件的过程,从而提高性能和提高硬件使用效率。糟糕的硬件加速是 Linux 上电池性能不佳的原因之一。_ + +### 结束语 + +总之,这是 Firefox 最后一次大的两位数版本号更新,很高兴看到 Firefox 对隐私和安全的一贯决心。此版本中未解决的一些问题,例如与硬件加速相关的错误,希望在下次更新中得到解决。 + +这就把我们带到了 Firefox 100。每日构建版本的 Firefox 100 已经发布。完整的稳定版本将在 2022.5.3 发布。它承诺提供诸如画中画格式的字幕和改进的硬件加速等功能。你可以通过在每日构建中的 `about:preferences#experimental` 启用 `Firefox 100 User-Agent String` 来尝试 Firefox 的这些实验性版本。 + +想要了解更多?查看一些不为人知的 [Firefox 功能,以获得更好的浏览体验][4]。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/firefox-99-release/ + +作者:[Shobhit Singh][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/zd200572) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/shobhit/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/wp-content/uploads/2022/04/Before-After_gtk_overlay-scrollbars-edited.png +[2]: https://news.itsfoss.com/wp-content/uploads/2022/04/Overlay-scrollbar-config-option.png +[3]: https://bbs.archlinux.org/viewtopic.php?id=275415 +[4]: https://itsfoss.com/firefox-useful-features/ diff --git a/published/202204/20220409 How to Activate the Dark and Light Wallpaper Variants in GNOME 42.md b/published/202204/20220409 How to Activate the Dark and Light Wallpaper Variants in GNOME 42.md new file mode 100644 index 0000000000..947071526f --- /dev/null +++ b/published/202204/20220409 How to Activate the Dark and Light Wallpaper Variants in GNOME 42.md @@ -0,0 +1,102 @@ +[#]: subject: "How to Activate the Dark and Light Wallpaper Variants in GNOME 42" +[#]: via: "https://itsfoss.com/dark-light-wallpaper-gnome/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14472-1.html" + +如何启用 GNOME 42 中的深色和浅色双主题壁纸 +====== + +GNOME 42 的主要 [功能][1] 之一就是提供了深色和浅色模式的双主题壁纸。 + +![GNOME 42 中的深色和浅色壁纸][2] + +基本上,有了这个功能,当你切换到浅色模式时,系统就会使用浅色版本的壁纸。而当你 [在 GNOME 中切换到深色模式][3]时,壁纸就会切换成深色的版本。 + +下面是一个双主题壁纸的例子,你可以比较一下: + +![GNOME 中的深色和浅色双主题壁纸:浅色][4] + +![GNOME 中的深色和浅色双主题壁纸:深色][4a] + +这种双主题壁纸可在“设置Settings > 外观Appearance”的“背景Background”部分中启用。 + +然而,在某些情况下,设置中可能没有双主题壁纸,你可能会看到一个空的“背景”部分,像下面这样: + +![没有双主题壁纸][5] + +这是我的同事 Sreenath 在更新他的 Endeavour OS 系统、得到新的 GNOME 42 桌面时注意到的情况。 + +### 在 GNOME 42 中启用深色和浅色双主题壁纸 + +如果你也在 GNOME 42 中面临同样的情况,我这里有一个快速而简单的解决方案。你只需要使用软件包管理器,安装 `gnome-backgrounds` 软件包,问题就会得到解决。 + +首先,请 [检查桌面环境细节][6],确保你正在运行 GNOME 42。你可以在系统设置的“关于About”部分查看你的桌面版本。 + +当你确定你的系统安装了 GNOME 42,请继续执行剩下的步骤。 + +对于 [基于 Arch 的发行版][7],请使用 [pacman 命令][8],如下: + +``` +sudo pacman -S gnome-backgrounds +``` + +等待命令执行完毕。 + +![][9] + +你不需要重新启动,甚至不需要注销。改动将立即生效。 + +你只需进入“设置Settings > 外观Appearance”,然后选择“背景Background”部分,应该就会看到各种具有双重模式的壁纸。 + +选择其中的一对,它就会根据你的系统主题来设置图像。 + +![GNOME 中的深色和浅色壁纸][10] + +太好了。但你只能得到 GNOME 团队或者发行版的开发者提供的少数双主题壁纸。如果你想拥有一套自己的深色和浅色模式的壁纸呢?那么,你可以自己制作壁纸,只是需要一点调整和耐心。 + +### 制作你自己的双主题壁纸(针对高级用户) + +我假设你知道自己在干什么,你可以搜索下面的步骤,以在深色和浅色双主题壁纸中添加额外的壁纸时: + + * 下载两张图片 + * 把浅色壁纸重命名为 `image-l.jpg`,把深色壁纸重命名为 `image-d.jpg` + * 如果你想让新壁纸对所有用户可用,请在 `/usr/share` 目录下新建一个 `gnome-background-properties` 目录。否则,如果你只想自己使用,请在 `.local/share` 中新建这个目录 + * 将这段 [GNOME 官方 GitLab 仓库中的代码][11] 拷贝到文本编辑器中,并在 `` 标签中分别修改相应的浅色或深色图片的位置 + * 将其保存在你之前创建的 `gnome-background-properties` 目录下 + * 现在可以在系统设置里修改背景壁纸了 + +需要更多帮助吗?WOGUE 有一个很好的视频,里面展示了这些步骤的操作。 + +![video](https://youtu.be/y1vSt1_ZKps) + +我希望你喜欢这个快速小技巧。祝你体验愉快! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/dark-light-wallpaper-gnome/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/gnome-42-features/ +[2]: https://itsfoss.com/wp-content/uploads/2022/04/fedora-36-gnome-42-dark-800x450.jpg +[3]: https://itsfoss.com/fedora-dark-mode/ +[4]: https://itsfoss.com/wp-content/uploads/2022/04/GNOME_Light_Desktop.jpg +[4a]: https://itsfoss.com/wp-content/uploads/2022/04/GNOME_Dark_Desktop.jpg +[5]: https://itsfoss.com/wp-content/uploads/2022/04/no-dark-light-wallpaper-in-gnome-800x326.png +[6]: https://itsfoss.com/find-desktop-environment/ +[7]: https://itsfoss.com/arch-based-linux-distros/ +[8]: https://itsfoss.com/pacman-command/ +[9]: https://itsfoss.com/wp-content/uploads/2022/04/add-dark-light-wallpapers-gnome-800x366.png +[10]: https://itsfoss.com/wp-content/uploads/2022/04/dark-light-wallpapers-gnome-800x370.jpg +[11]: https://gitlab.gnome.org/GNOME/gnome-backgrounds/-/blob/main/backgrounds/adwaita.xml.in diff --git a/published/202204/20220410 10 Best Indie RPG Games for Linux in 2022.md b/published/202204/20220410 10 Best Indie RPG Games for Linux in 2022.md new file mode 100644 index 0000000000..8391482514 --- /dev/null +++ b/published/202204/20220410 10 Best Indie RPG Games for Linux in 2022.md @@ -0,0 +1,195 @@ +[#]: subject: "10 Best Indie RPG Games for Linux in 2022" +[#]: via: "https://itsfoss.com/best-indie-rpg-games-linux/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14479-1.html" + +2022 年 10 款最佳的 Linux 独立 RPG 游戏 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/16/095605drtattoin3r3rtmv.jpg) +无论是在 Windows、Linux 还是 macOS 上,你都能找到很多独立游戏玩。 + +你有可能会找到十分激动人心的游戏,这些游戏往往是被低估的,这使得探索独立游戏成为了一件令人兴奋的事。 + +但是,在本文中,我只关注 Linux 平台上最佳的独立(即由小团队开发的)RPG 游戏。 + +即使你只有一套入门级的游戏硬件也没有关系,大多数独立游戏在许多计算机(甚至只有集成显卡)上都能正常工作。 + +请注意,本列表包括来自 Steam 的游戏(没有特定的排名顺序),它们有些是免费的,有些则是付费的。 + +> 如果你是一个狂热的游戏玩家,在游戏上花费了大量的时间和金钱,你应该订阅 Humble Monthly。这个来自 [Humble Bundle][1](这是一个推广链接,请阅读原文站点的 [推广政策][2])的月度订阅计划让你每个月只需花 12 美元就能获得 100 美元的游戏。 +> +> 并不是所有游戏都能在 Linux 上玩,但这仍然是笔划算的交易,因为你从 Humble Bundle 网站购买任何游戏或书籍都能获得额外的 10% 折扣。 +> +> 最棒的是,你的每一次购买都是对一个慈善组织的支持。因此,你不仅仅是在玩游戏,你也在为世界带来改变。 +> +> - [订阅 Humble Monthly][1] + +### 1. Valheim + +![][3] + +Valheim 是一个令人印象深刻的独立游戏,它目前仍处于内测阶段。 + +这是一个关于探险和生存的游戏,你可以同时与最多 10 名玩家一起玩。当然,你也可以选择自己一个人玩。 + +对于一个独立开发的游戏来说,它里面的世界看起来美极了,而且随着时间的推移,这个游戏也在不断改进。它是一款付费游戏,在 Steam 上的售价为 19.99 美元,它原生支持 Linux 平台。 + +> - [Valheim][4] + +### 2. Undertale + +![video](https://youtu.be/1Hojv0m3TqA) + +Undertale 是一款有趣的 RPG 游戏,你不需要在游戏中杀任何人。你可以利用其战斗系统,通过谈判来摆脱危险。 + +游戏围绕着一个掉入地下怪物世界的人类而展开。令人惊讶的是,你可以和一个骷髅约会,甚至可以和所有的 boss 成为朋友。 + +因此,当你开始玩这个游戏时,你会有一个快乐的体验。 + +> - [Undertal(Steam)][5] +> - [Humble Bundle 商店][6] + +### 3. ARK:Survival Evolved + +![][7] + +ARK Survival Evolved 是一款生存和探索游戏,它发生在一个美丽环境下,里面有恐龙和其他生物。 + +为了生存和逃跑,你需要制作、采集资源、狩猎、驯服生物、繁殖它们,以及做更多的事情。 + +它可能不完全像是一个独立游戏,但它尽力给你一个接近 3A 大作的游戏体验。 + +> - [ARK: Survival Evolved][8] + +### 4. Wildermyth + +![][9] + +它是一个剧情决策 RPG 游戏,你的战术、战斗以及所做的决定将影响游戏中的世界和人物。 + +你可以和你的角色们一起对抗邪恶,并跟随他们完成整个职业生涯。它不是一个普通的独立 RPG 游戏,而是一个提供角色深度的游戏,让你沉浸其中。 + +这个游戏售价为 24.99 美元,可在 Linux 上运行。 + +> - [Wildermyth][10] + +### 5. Mount & Blade:Warband + +![][11] + +经典的战争动作 RPG 游戏之一,它让你有机会建立一支军队,扩大你的王国,并为王位而战! + +虽然它最初是在 2010 年推出的,但是它有几个 DLC 可以供你扩大和探索更多的可玩性。 + +游戏的基本费用为 9.99 美元。你可以根据需要购买额外的 DLC。 + +> - [Mount & Blade][12] + +### 6. Rakuen + +![][13] + +Rakuen 是一款有趣的冒险 RPG 游戏,它的主角是一个住在医院里的小男孩。 + +故事围绕着小男孩通过帮助医院里的邻居来完成挑战,同时还要对付他们在幻想世界里的另一个自己。 + +男孩的妈妈承诺,只要他完成了所有这些挑战,就会护送他到他最喜欢的故事书中的幻想世界。互动过程中,你的情绪会像过山车一样,经历快乐、悲伤、思考和难忘的回忆。 + +该游戏在 Steam 上的价格为 9.9 美元。 + +> - [Rakuen][14] + +### 7. Darkwood + +![][15] + +Darkwood 是一款独一无二的生存恐怖 RPG 游戏,它采用上帝视角。 + +你可能认为它会是一个上帝视角的基本体验,但令人印象深刻的是,它设法提供了一个沉浸式的体验,在这个游戏中,你的决定至关重要。这个自由漫游的世界中没有任何任务标记,所以它会是一个具有挑战性的体验。 + +> - [Darkwood][16] + +### 8. WAFKU + +![][17] + +WAFKU 是一个充满动作元素的大型多人在线 RPG 宇宙。 + +它以一组有趣的人物为特色,并给人以回合制战术战斗的奇妙体验。每个等级都有一套独特的技能。而且,你会在游戏中发现所有的 18 种技能。 + +因此,你可以探索/选择适合你的游戏风格。 + +你可以建造自己的世界,控制生态系统,还可以参与政治生活。听起来很有意思,不是吗? + +> - [WAFKU][18] + +### 9. Mechajammer + +![][19] + +Mechajammer 是一款有趣的 RPG 游戏,它具有令人兴奋的视觉效果。 + +它采用了回合制赛博朋克的设定,因此你会有一种新鲜的体验。你可以选择一辆车或武器,挑选一个帮派的支线任务,以及做其他一些事情。 + +它很好的融合了开放世界探索和回合制战斗,这对你来说会是个挑战。你可以做很多方面的定制,包括调整角色的能力。 + +它或许不是一个受欢迎的选择,但它是一个硬核的经典风格的 RPG 游戏,因此口碑还是不错的。 + +> - [Mechajammer][20] + +### 10. Finding Paradise + +![][21] + +玩够了战斗/动作游戏?来点故事驱动的 RPG 体验如何? + +Finding Paradise 是一款很棒的故事驱动型 RPG 游戏,它围绕着实现一个垂死者的遗愿而展开。 + +> - [Finding Paradise][22] + +### 总结 + +以上是在 Steam 上为 Linux 用户提供的一些评价最好的 RPG 游戏。 + +事实上,Linux 上还有非常多的独立 RPG 游戏,本文只列举了其中几个我们最喜欢的。你有喜欢的游戏吗?请在下面的评论区中告诉我们吧! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-indie-rpg-games-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.humblebundle.com/?partner=itsfoss +[2]: https://itsfoss.com/affiliate-policy/ +[3]: https://itsfoss.com/wp-content/uploads/2022/03/valheim-linux.jpg +[4]: https://store.steampowered.com/app/892970/Valheim/ +[5]: https://store.steampowered.com/app/391540/Undertale/ +[6]: https://www.humblebundle.com/store/undertale?partner=itsfoss +[7]: https://itsfoss.com/wp-content/uploads/2022/03/ark-survival-linux.jpg +[8]: https://store.steampowered.com/app/346110/ARK_Survival_Evolved/ +[9]: https://itsfoss.com/wp-content/uploads/2022/03/wildermyth.jpg +[10]: https://store.steampowered.com/app/763890/Wildermyth/ +[11]: https://itsfoss.com/wp-content/uploads/2022/03/mount-blade-linux.jpg +[12]: https://store.steampowered.com/app/48700/Mount__Blade_Warband/ +[13]: https://itsfoss.com/wp-content/uploads/2022/03/rakeun-linux.jpg +[14]: https://store.steampowered.com/app/559210/Rakuen/ +[15]: https://itsfoss.com/wp-content/uploads/2022/03/darkwood-linux.jpg +[16]: https://store.steampowered.com/app/274520/Darkwood/ +[17]: https://itsfoss.com/wp-content/uploads/2022/03/wafku-linux.jpg +[18]: https://store.steampowered.com/app/215080/WAKFU/ +[19]: https://itsfoss.com/wp-content/uploads/2022/03/mechajammer-linux.jpg +[20]: https://store.steampowered.com/app/485400/Mechajammer/ +[21]: https://itsfoss.com/wp-content/uploads/2022/03/finding-paradise.jpg +[22]: https://store.steampowered.com/app/337340/Finding_Paradise/ diff --git a/published/202204/20220410 Kubuntu 22.04 LTS - New Features and Release Details.md b/published/202204/20220410 Kubuntu 22.04 LTS - New Features and Release Details.md new file mode 100644 index 0000000000..47a2ec9f18 --- /dev/null +++ b/published/202204/20220410 Kubuntu 22.04 LTS - New Features and Release Details.md @@ -0,0 +1,69 @@ +[#]: subject: "Kubuntu 22.04 LTS – New Features and Release Details" +[#]: via: "https://www.debugpoint.com/2022/04/kubuntu-22-04-lts/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14483-1.html" + +Kubuntu 22.04 LTS - 新功能和发布细节 +====== + +> Kubuntu 22.04 LTS(Jammy Jellyfish)的新功能列表以及关于该版本的其他信息。 + +![Kubuntu 22.04 LTS Desktop][1] + +### Kubuntu 22.04 LTS 新功能 + +也许在可用性、外观和稳定性方面,最受欢迎的基于 Ubuntu 的 Linux 发行版是 Kubuntu。Kubuntu 22.04 LTS 采用的是 Linux 内核 5.15 LTS,采用同 Ubuntu 22.04 LTS 一样的基础软件包。此外,它还带有 [KDE Plasma 5.24.x 系列][2],这是 Plasma 桌面当前的 LTS 版本。 + +此外,KDE Plasma 5.24.x 系列是 KDE Plasma 桌面的第 26 个版本,带来了一些令人惊叹的功能,如概览效果、新通知等。尽管到今天为止它还不是最新的 Plasma,但它是最新的稳定版本。 + +另一方面,如果你将上一个 Kubuntu 20.04 LTS 与这个版本相比较,你可以期待看到一大堆变化。首先,Kubuntu 20.04 Focal Fossa 带有 KDE Plasma 5.18,而如今是 5.24 系列。你可以看到大量的新功能和一个完全不同的桌面,做了更好的无障碍和性能的改进。其次,KDE Plasma 5.24 由 Qt 5.15.2 和 KDE Frameworks 5.90 支持,这也是自上一个 Kbuntu Focal Fossa 以来的一个跳跃。 + +毋庸置疑,你能体验到的重要功能是 Plasma 桌面新设计的概览屏幕。你可以使用 `Meta+W` 组合键启动它,而且支持多个虚拟屏幕。新的概览屏幕会让你想起 GNOME 的应用视图。该视图在顶部给你提供了虚拟桌面的缩略图,在中间,你可以看到虚拟桌面打开的窗口列表。它还为你提供了一个搜索选项,可以使你更快地找到你的应用。 + +![Kubuntu 22.04 Overview screen][3] + +这个版本的 Plasma 还带来了一个自定义的强调色选项,会触发你对美丽桌面的灵感。除此之外,更新的 Breeze Classic 主题和重新设计的字体大小使这个版本成为 LTS 发布中的一个完美版本。 + +### 其他变化 + +由于 Kubuntu 22.04 LTS 基于 [Ubuntu 22.04][5],其核心应用和软件包给你提供了他们稳定版本中最好的东西,总结如下: + + * KDE Plasma 5.24.x + * KDE Frameworks 5.92 + * Qt 5.15.x + * Firefox 99 + * Thunderbird 91.8 + * LibreOffice 7.3.x + +最后,要下载这个版本的 BETA 版本,请参考下面的 ISO 文件链接。你可以尝试在虚拟机上安装或在物理系统中尝试。 + + * [kubuntu-22.04-beta-desktop-amd64.iso][6] + * + + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/04/kubuntu-22-04-lts/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/wp-content/uploads/2022/04/Kubuntu-22.04-LTS-Desktop-1024x580.jpg +[2]: https://www.debugpoint.com/2022/03/kde-plasma-5-24-review/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/04/Kubuntu-22.04-Overview-screen-1024x580.jpg +[5]: https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/ +[6]: http://cdimage.ubuntu.com/kubuntu/releases/22.04/beta/kubuntu-22.04-beta-desktop-amd64.iso +[7]: https://t.me/debugpoint +[8]: https://twitter.com/DebugPoint +[9]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[10]: https://facebook.com/DebugPoint diff --git a/published/202204/20220412 A list of new(ish) command line tools.md b/published/202204/20220412 A list of new(ish) command line tools.md new file mode 100644 index 0000000000..be3f3450c8 --- /dev/null +++ b/published/202204/20220412 A list of new(ish) command line tools.md @@ -0,0 +1,180 @@ +[#]: subject: "A list of new(ish) command line tools" +[#]: via: "https://jvns.ca/blog/2022/04/12/a-list-of-new-ish--command-line-tools/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14488-1.html" + +新式 Linux 命令行工具大全 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/18/230845e83y1wla8feawucp.jpg) + +嗨!今天我 [在 twitter][1] 询问有没有一些像 `ripgrep`、`fd`、`fzf`、`exa` 及 `bat` 之类的新式命令行工具。 + +我收到了一大堆回复,都是我没有听说过的工具,所以我想我应该在这里列出一个清单。另外,很多人还指出有一个 [modern-unix][2] 的列表。 + +### 标准工具的替代物 + + * [ripgrep][3]、[ag][4]、[ack][5] (`grep`) + * [exa][6]、[lsd][7] (`ls`) + * [mosh][8] (`ssh`) + * [bat][9] (`cat`) + * [delta][10] (`git` 分页器) + * [fd][11] (`find`) + * [drill][12]、[dog][13] (`dig`) + * [duf][14] (`df`) + * [dust][15]、`ncdu` (`du`) + * [pgcli][16] (psql) + * [btm][17]、[btop][18]、[glances][19]、[gtop][20]、[zenith][21] (`top`) + * [tldr][22] (类似 `man`) + * [sd][23] (`sed`) + * [difftastic][24] (`diff`) + * `mtr` (`traceroute`) + * [plocate][25] (`locate`) + * `xxd`、[hexyl][26] (`hexdump`) + +### 新的发明 + +这里有一些不完全是替代标准工具的工具: + + * [z][27]、[fasd][28]、[autojump][29]、[zoxide][30] (使查找文件/改变目录更容易的工具) + * [broot][31]、[nnn][32]、[ranger][33] (文件管理器) + * [direnv][34] (根据当前目录加载环境变量) + * [fzf][35]、[peco][36] (“模糊查找器”) + * [croc][37] 和 [magic-wormhole][38] (将文件从一台计算机发送到另一台) + * [hyperfine][39] 基准测试 + * [httpie][40]、[curlie][41]、[xh][42] (用于发出 HTTP 请求) + * [entr][43] (当文件改变时运行任意命令) + * [asdf][44] (多语言的版本管理器) + * [tig][45]、[lazygit][46] (`git` 的交互界面) + * [lazydocker][47] (`docker` 的交互式界面) + * [choose][48] (基本版的 `awk`/`cut`) + * [ctop][49] (容器的 `top`) + * [fuck][50] (自动纠正命令行错误) + * [tmate][51] (与朋友分享你的终端) + * [lnav][52]、[angle-grinder][53] (管理日志的工具) + * [mdp][54]、[glow][55] (在终端显示 Markdown 的方法) + * `pbcopy`/`pbpaste`(用于剪贴板和标准输入/标准输出之间)可能不是“新的”,但被提到了很多次。你可以使用 `xclip` 在 Linux 上做同样的事情 + +### JSON/YAML/CSV 工具 + + * [jq][57] (一个很好的 JSON 处理工具) + * [jc][58] (将各种工具的输出转换成 JSON) + * [jo][59] (创建 JSON 对象) + * [yq][60] (类似 `jq`,但用于 YAML),还有 [另一个 yq][61] + * [fq][62] (类似 `jq`,但用于二进制) + * [htmlq][63] (类似 `jq`,但用于 HTML) + * [fx][64] (交互式 JSON 工具) + * [jless][65] (JSON 分页器) + * [xsv][66] (一个用于 CSV 文件的命令行工具,来自 burntsushi) + * [visidata][67] (“一个用于表格数据的交互式多功能工具”) + * [miller][68] (“像用于 CSV/TSV/JSON/JSON 的 awk/sed/cut/join/sort”) + +### grep 工具 + + * [pdfgrep][69] (用于 PDF 的 `grep`) + * [gron][70] (用于 JSON 的 `grep`) + * [ripgrep-all][71] (`ripgrep`,但也用于 PDF、zip、电子书等) + +### 不太新的工具 + +下面是人们提到的一些不那么新的工具,但不那么知名: + + * `pv` (“管道查看程序”,给你一个管道的进度条) + * `vidir` (来自 [moreutils][72],可以让你在 `vim` 中批量重命名/删除文件) + * `sponge`、`ts`、`parallel` (也来自 moreutils) + +### 我的一些最爱 + +我最喜欢的是 `entr`、`ripgrep`、`git-delta`、`httpie`、`plocate` 和 `jq`,这些都是我已经使用过的。 + +我也想尝试一下 `direnv`、`btm`、`z`、`xsv` 和 `duf`,但我认为我知道到的最令人兴奋的工具是 `vidir`。 + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2022/04/12/a-list-of-new-ish--command-line-tools/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://twitter.com/b0rk/status/1513903221466664962 +[2]: https://github.com/ibraheemdev/modern-unix +[3]: https://github.com/BurntSushi/ripgrep/ +[4]: https://github.com/ggreer/the_silver_searcher +[5]: https://github.com/beyondgrep/ack3 +[6]: https://github.com/ogham/exa +[7]: https://github.com/Peltoche/lsd +[8]: https://mosh.org/ +[9]: https://github.com/sharkdp/bat +[10]: https://github.com/dandavison/delta +[11]: https://github.com/sharkdp/fd +[12]: https://www.nlnetlabs.nl/projects/ldns/about/ +[13]: https://github.com/ogham/dog +[14]: https://github.com/muesli/duf +[15]: https://github.com/bootandy/dust +[16]: https://www.pgcli.com/ +[17]: https://github.com/ClementTsang/bottom +[18]: https://github.com/aristocratos/btop +[19]: https://github.com/nicolargo/glances +[20]: https://github.com/aksakalli/gtop +[21]: https://github.com/bvaisvil/zenith +[22]: https://tldr.sh/ +[23]: https://github.com/chmln/sd +[24]: https://github.com/Wilfred/difftastic +[25]: https://plocate.sesse.net/ +[26]: https://github.com/sharkdp/hexyl +[27]: https://github.com/rupa/z +[28]: https://github.com/clvv/fasd +[29]: https://github.com/wting/autojump +[30]: https://github.com/ajeetdsouza/zoxide +[31]: https://github.com/Canop/broot +[32]: https://github.com/jarun/nnn +[33]: https://github.com/ranger/ranger +[34]: https://github.com/direnv/direnv +[35]: https://github.com/junegunn/fzf +[36]: https://github.com/peco/peco +[37]: https://github.com/schollz/croc +[38]: https://github.com/magic-wormhole/magic-wormhole +[39]: https://github.com/sharkdp/hyperfine +[40]: https://httpie.io/ +[41]: https://github.com/rs/curlie +[42]: https://github.com/ducaale/xh +[43]: https://github.com/eradman/entr +[44]: https://github.com/asdf-vm/asdf +[45]: https://github.com/jonas/tig +[46]: https://github.com/jesseduffield/lazygit +[47]: https://github.com/jesseduffield/lazydocker +[48]: https://github.com/theryangeary/choose +[49]: https://github.com/bcicen/ctop +[50]: https://github.com/nvbn/thefuck +[51]: https://tmate.io/ +[52]: https://github.com/tstack/lnav +[53]: https://github.com/rcoh/angle-grinder +[54]: https://github.com/visit1985/mdp +[55]: https://github.com/charmbracelet/glow +[56]: https://stackoverflow.com/questions/5130968/how-can-i-copy-the-output-of-a-command-directly-into-my-clipboard/41843618#41843618 +[57]: https://stedolan.github.io/jq/ +[58]: https://github.com/kellyjonbrazil/jc +[59]: https://github.com/jpmens/jo +[60]: https://github.com/mikefarah/yq +[61]: https://github.com/kislyuk/yq +[62]: https://github.com/wader/fq +[63]: https://github.com/mgdm/htmlq +[64]: https://github.com/antonmedv/fx +[65]: https://github.com/PaulJuliusMartinez/jless +[66]: https://github.com/BurntSushi/xsv +[67]: https://www.visidata.org/ +[68]: https://github.com/johnkerl/miller +[69]: https://pdfgrep.org/ +[70]: https://github.com/tomnomnom/gron +[71]: https://github.com/phiresky/ripgrep-all +[72]: https://joeyh.name/code/moreutils diff --git a/published/202204/20220413 Meet Lite XL- A Lightweight, Open-Source Text Editor for Linux Users.md b/published/202204/20220413 Meet Lite XL- A Lightweight, Open-Source Text Editor for Linux Users.md new file mode 100644 index 0000000000..7912850ba1 --- /dev/null +++ b/published/202204/20220413 Meet Lite XL- A Lightweight, Open-Source Text Editor for Linux Users.md @@ -0,0 +1,113 @@ +[#]: subject: "Meet Lite XL: A Lightweight, Open-Source Text Editor for Linux Users" +[#]: via: "https://itsfoss.com/lite-xl/" +[#]: author: "Marco Carmona https://itsfoss.com/author/marco/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14497-1.html" + +Lite XL:为 Linux 用户提供的轻量级、开源的文本编辑器 +====== + +> 你是否在寻找一个新的文本编辑器替代品?你应该试试这个轻量、简洁、快速、功能丰富、可扩展性极强的编辑器。 + +当然,有很多文本编辑器或代码编辑器可以使用。一些流行的包括 Eclipse、[Visual Studio Code][1]、[PyCharm][2]、[Atom][3]、[IntelliJ][4],以及 [Sublime Text][5]。 + +但是你想尝试一些有趣的东西,完全专注于给你一个极简的体验吗? + +来认识一下 Lite XL 编辑器。 + +说实话,在上周之前我对它一无所知。但是,它以其 **极简主义的设计** 和它 **在编码时有多么快** 成功地惊到了我,但最重要的事实是它与 Visual Studio Code 相似。 + +所以,在开始之前,让我告诉你,如果你是一个 [Visual Studio Code 粉丝][6],你绝对应该试试 Lite XL。它可能不是绝对的替代品,而是类似使用场景的精简版。 + +![Showing how Lite XL looks][7] + +### Lite XL:用 Lua 编写的轻量级文本编辑器 + +Lite XL 是一个用 Lua 编写的有趣的开源文本编辑器(特别是为建立轻量级应用而定制)。 + +它也可用于 Windows、Linux 和 macOS。但是,有这么多 [现代文本编辑器][8],为什么还要有个 Lite XL? + +![Lite XL Customize Configuration][9] + +通常情况下,大多数时候我们并不关心文本编辑器会消耗我们系统的资源。然而,在创建 Bash、Python 或任何其他类型的脚本时,你会依赖文本编辑器,而它的资源效率越高越好。 + +当然,文本编辑器并不像其他一些应用那样对资源要求很高。但是,如果这对你很重要的话,我观察到的情况是这样的: + +Lite XL 只使用了 **3MB** 的磁盘,并消耗了大约 **20MB** 内存,而 Visual Studio Code 使用将近 550MB 内存。 + +**你能看到这些类似的编辑器之间的这种奇妙的差别吗?** + +不仅仅是资源使用量,它也是高度可定制的。 + +请注意,在不同的系统配置下,资源占用的统计数字会有所不同。 + +### Lite XL 的特点 + +![][10] + +根据现有的官方信息,其最受欢迎的一些功能包括: + + * **跨平台:** 它目前可以在 Windows、Linux 和 macOS 上使用。 + * **轻量级:** 正如我们之前所描述的,它的使用量几乎没有超过 10MB 的内存。 + * **可扩展:** 作为一个极简的产品,并不意味着不能定制。Lite XL 可以通过一些可用的插件来扩展其功能,例如,[类似 Visual Studio Code 的智能提示][11]。 + * **多光标编辑:** 在 Lite XL 中,你可以使用多个光标进行编辑,这听起来很美妙。 + * **集成的终端:** 像 Visual Studio Code 一样,Lite XL 实现了它的终端。 + * 支持高分辨率显示。 + * 更多的颜色主题。 + * 支持硬件加速渲染。 + +### 如何在 Linux 中安装 Lite XL + +Lite XL 为 Linux 发行版提供了一个 AppImage 文件。你可以按照我们的 [AppImage 指南][12] 来开始使用。 + +你可以在其 [GitHub 仓库][13] 中找到这个 AppImage 文件。 + +当你前往其 GitHub 发布区,直接进入 “资产Assets” 区并下载 `LiteXL_x86_64.Appimage` 文件。 + +![Downloading Appimage file][14] + +AppImage 文件将被下载到你的下载目录中,因此,在双击该文件之前,请验证它是否允许作为程序执行。 + +![Verifying execution permissions][15] + +这就好了! 现在你可以双击该文件,开始在你的系统中使用 Lite XL。 + +> [Lite XL][16] + +如果你对探索 Lite XL 感兴趣,你可以参与其 [GitHub 仓库][13],访问官方网站,或加入其 [Discord 社区][17]。 + +你喜欢用什么来编辑文本和代码?你是否专注使用轻量级的程序,或者与你的使用情况无关?请在下面的评论中告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/lite-xl/ + +作者:[Marco Carmona][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/marco/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-visual-studio-code-ubuntu/ +[2]: https://itsfoss.com/install-pycharm-ubuntu/ +[3]: https://itsfoss.com/install-atom-ubuntu/ +[4]: https://itsfoss.com/install-intellij-ubuntu-linux/ +[5]: https://itsfoss.com/sublime-text-3-linux/ +[6]: https://itsfoss.com/visual-studio-code-vs-atom/ +[7]: https://itsfoss.com/wp-content/uploads/2022/04/lite-xl-editor-screenshot.png +[8]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[9]: https://itsfoss.com/wp-content/uploads/2022/04/lite-xl-screenshot-2.png +[10]: https://itsfoss.com/wp-content/uploads/2022/04/lite-xl-screnshot-1.png +[11]: https://github.com/lite-xl/lite-xl-lsp +[12]: https://itsfoss.com/use-appimage-linux/ +[13]: https://github.com/lite-xl/lite-xl +[14]: https://itsfoss.com/wp-content/uploads/2022/04/Downloading_Appimage_file-800x447.png +[15]: https://itsfoss.com/wp-content/uploads/2022/04/Verifying_execution_permissions-800x535.png +[16]: https://lite-xl.com/ +[17]: https://discord.gg/RWzqC3nx7K diff --git a/published/202204/20220413 Razer and Lambda Team Up to Unveil a Linux Laptop for Deep Learning.md b/published/202204/20220413 Razer and Lambda Team Up to Unveil a Linux Laptop for Deep Learning.md new file mode 100644 index 0000000000..9f15c1ddeb --- /dev/null +++ b/published/202204/20220413 Razer and Lambda Team Up to Unveil a Linux Laptop for Deep Learning.md @@ -0,0 +1,99 @@ +[#]: subject: "Razer and Lambda Team Up to Unveil a Linux Laptop for Deep Learning" +[#]: via: "https://news.itsfoss.com/tensorbook-razer-lambda/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14493-1.html" + +雷蛇与 Lambda 联手推出用于深度学习的 Linux 笔记本电脑 +====== + +> 雷蛇与一家专注于深度学习的硬件公司合作,以时尚的外形、昂贵的价格提供了最新和最伟大的产品。 + +![](https://news.itsfoss.com/wp-content/uploads/2022/04/tensorbook-linux-ml-laptop.jpg) + +雷蛇Razer 以其游戏外设和硬件而闻名。 + +另一方面,Lambda 提供配备了他们的软件栈的工作站、服务器和 GPU 集群,以尽可能方便地促进深度学习。 + +他们合作推出了一款外观时尚的现代笔记本电脑(由 Ubuntu 20.04 驱动),专为随时随地的深度学习而设计。 + +它不同于 [其他 Linux 笔记本电脑][1]。 + +顺便说一句,深度学习是一种机器学习,你通过实例教给计算机学会类似人类处理信息的方式。你可以查看 [维基百科][2] 以了解更多细节。 + +### Tensorbook:深度学习笔记本电脑 + +[![][3]](https://youtu.be/wMh6Dhq7P_Q) + +Tensorbook 是一款由 Linux 驱动的笔记本电脑,具有最先进的规格,可以帮助你在任何地方高效地进行深度学习训练/开发。而且,Lambda 的软件栈支持各种工具,只需一个命令就能方便地更新 PyTorch、Tensorflow、CUDA 等。 + +当然,这个名字并不令人意外,因为张量Tensor核心有助于加快机器学习训练/过程。 + +![][4] + +雷蛇没有在这台笔记本电脑上添加任何他们惯用的标志性图案,比如绿色的点缀/颜色、标志或 RGB 元素。好吧,毕竟这是为深度学习而定制的。所以,它不太浮华是公平的。 + +你只能在盖子上找到 Lambda 主要标志,在屏幕的底边框上找到 Razer x Lambda 的文字。而且,紫色的风格贯穿始终,Lambda 在这里主导了其品牌宣传。 + +这款笔记本电脑的规格涉及: + + * GPU:GeForce RTX 3080 Max-Q 16 GB VRAM + * CPU:Intel i7-11800H + * 内存:64 GB 3200 MHz DDR4 + * 存储:2 TB NVMe PCIe 4.0 + * 显示:165 Hz 1440p 15.6 英寸 + +除了可靠的核心配置外,连接选项包括: + + * 3 个 USB 3.2 Gen 2 Type-A 端口 + * 1 x HDMI 2.1 + * 1 个 UHS-III SD 卡阅读器 + * 3.5 毫米耳机/麦克风插孔 + * 2 个雷电 4 端口 + * Wi-Fi 6E + * 蓝牙 5.2 + +毋庸置疑,这款笔记本电脑是一个时尚的“动力工厂”,将这些组件容纳于其中。 + +无论你是专业人士还是初学者,RTX 3080 GPU 应该有足够的能力来帮助你完成深度学习任务。 + +当然,它不是为游戏而设计的,但以你所拥有的配置以及高刷新率的屏幕,你可以在需要的时候在上面舒适地玩游戏。 + +![][5] + +其机器学习训练基准声称,它远远领先于 M1 Max 芯片。 + +因此,你在训练模型方面不会有任何问题。 + +### 定价和可用性 + +这是一款高端产品,所以价格标签也一样高端,起价为 **3499 美元**。你可以为企业环境定制它,以便安装上 Windows 10 和 Ubuntu。 + +如果你支付额外的费用,还可以获得延长保修和高级支持。 + +你可以在 Lambda 的官方网站上定制并进行购买。 + +> [Tensorbook][6] + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/tensorbook-razer-lambda/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/get-linux-laptops/ +[2]: https://en.wikipedia.org/wiki/Deep_learning +[3]: https://i.ytimg.com/vi/wMh6Dhq7P_Q/hqdefault.jpg +[4]: https://news.itsfoss.com/wp-content/uploads/2022/04/tensorbook-1.jpg +[5]: https://news.itsfoss.com/wp-content/uploads/2022/04/tensorbook-2.jpg +[6]: https://lambdalabs.com/deep-learning/laptops/tensorbook diff --git a/published/202204/20220414 LibreWolf vs Firefox- Comparing the Privacy Heroes of Open-Source Browsers.md b/published/202204/20220414 LibreWolf vs Firefox- Comparing the Privacy Heroes of Open-Source Browsers.md new file mode 100644 index 0000000000..b2ece30ce1 --- /dev/null +++ b/published/202204/20220414 LibreWolf vs Firefox- Comparing the Privacy Heroes of Open-Source Browsers.md @@ -0,0 +1,173 @@ +[#]: subject: "LibreWolf vs Firefox: Comparing the Privacy Heroes of Open-Source Browsers" +[#]: via: "https://itsfoss.com/librewolf-vs-firefox/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14518-1.html" + +LibreWolf vs Firefox:谁是真的隐私英雄 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/28/100907sefofznr9dgrxgxo.jpg) + +Firefox 是最好的跨平台 [开源网页浏览器][1] 之一。 + +更不用说,它是那些基于 Chromium 的浏览器的唯一可行的替代品(也许?) + +LibreWolf 是另一个有趣的选择,它最初是 Firefox 浏览器的一个复刻,试图比 Firefox 浏览器做得更好,以增强开箱即用的隐私/安全性。 + +但是,选择 LibreWolf 而不是 Firefox 真的有用吗?有哪些不同之处?让我们来看一看。 + +### 用户界面 + +鉴于 [LibreWolf][2] 是 Firefox 的一个复刻,其用户界面是相同的,只是有一些细微的变化。 + +![Firefox UI][3] + +例如,它在书签菜单中没有到 Firefox 网站的链接,并且去除了 “添加到 PocketAdd to Pocket” 按钮。 + +取而代之的是,你可以在地址栏的右边找到一个扩展的图标和下载管理器。 + +![LibreWolf UI][4] + +是的,你不再需要前往菜单来访问下载的内容。 + +如果你认为 Firefox 中的额外功能令人烦恼,那么 LibreWolf 应该是一种干净的体验。 + +### 搜索供应商 + +默认情况下,Firefox 使用谷歌作为其搜索引擎,因为它们是官方合作伙伴,也就是说,谷歌付费成为了默认搜索引擎。 + +![][5] + +虽然你可以很轻松地将默认的搜索供应商改为 DuckDuckGo、Startpage 或其他任何东西,但默认的搜索供应商对大多数用户来说仍然很重要。 + +而对于 LibreWolf,它的默认的搜索引擎是 DuckDuckGo。众所周知,它是最好的尊重隐私的搜索引擎之一。 + +![][6] + +应该注意的是,注重隐私的搜索引擎在某些使用情况下可能不如谷歌好。因此,如果搜索引擎的选择对你来说并不是个问题,Firefox 浏览器可以说是很好。 + +但是,如果你想对自己的搜索历史保密,LibreWolf 的默认搜索供应商肯定是一个更好的选择。 + +### 强化隐私 + +Mozilla Firefox 具有令人难以置信的可定制性。如果你想付出努力,你可以在 Firefox 上增强你的数字隐私。 + +然而,如果你想避免投入大量时间来调整 Firefox 的体验,LibreWolf 可能是一个不错的选择。 + +LibreWolf 具有一些开箱即用的最佳设置,以确保你摆脱网上的跟踪器,以获得安全的在线体验。 + +例如,它的默认带有 UBlock 内容拦截器,以消除跟踪你在线活动的跟踪器/脚本。其默认的搜索引擎是 DuckDuckGo,在一定程度上也有帮助。 + +![][7] + +此外,LibreWolf 还启用了 Firefox 增强跟踪保护的严格模式。换句话说,它可以积极地阻止跟踪器,这可能会导致一些网页不能像预期那样工作。 + +![][8] + +虽然 LibreWolf 建议不要改变这些设置,但如果你发现在此设置下网页被破坏,你可以选择使用 Firefox。 + +Firefox 使用启用的基本保护来摆脱常见的追踪器,而不会破坏网页的用户体验。 + +除了这些设置外,LibreWolf 还默认在退出时删除 Cookie 和网站数据。如果你想继续登录网站并迅速恢复你的浏览会话,这可能会很烦人。 + +对于 Firefox,它确实具有相同的选项,但它默认情况下仍然是禁用的。因此,如果你想避免调整内置设置以获得方便的体验,你应该选择 Firefox。 + +![][9] + +难怪 Firefox 仍然是 [Linux 的最佳浏览器][10] 之一。相比增强隐私,大多数用户更喜欢方便,同时还能跨平台使用浏览器。 + +### 谷歌安全浏览 + +“谷歌安全浏览Google Safe Browsing”是一项有用的服务,可以警告、标记可疑网站的恶意活动。 + +大多数浏览器使用它来实现安全的用户体验。你不需要成为发现钓鱼/恶意软件网站的专家,谷歌安全浏览可以帮助你发现它们。 + +Mozilla Firefox 使用它的另一个名字 “钓鱼保护Phishing Protection”,它是默认启用的。 + +然而,在 LibreWolf 中,“谷歌安全浏览”服务默认是禁用的,以避免连接到谷歌服务。你可以启用它,但它不是用户通常在设置浏览器时会注意到的东西。 + +![][11] + +因此,如果你在避免恶意网站方面需要更多帮助,Firefox 应该是一个很好的开箱即用的解决方案。如果你对这些很清楚,你可以使用 LibreWolf,并在需要时启用该设置。 + +### 附加功能 + +LibreWolf 可以摆脱 Firefox 上的任何附加产品。 + +例如,默认情况下,LibreWolf 与 Mozilla 服务器没有任何连接。这也意味着 LibreWolf 摆脱了遥测。它所反映的一些变化包括: + + * LibreWolf 中没有同步/签到功能。 + * 没有 “添加到 Pocket” 的按钮 + * 你不会在扩展页面上加载 Mozilla 的附加组件/主题。 + +![][12] + +如果你想使用 Mozilla 帐户来同步你的历史记录/书签和浏览器数据,Firefox 是最好的选择。如果你需要,还有 Firefox VPN。 + +![][13] + +但是,如果你不信任任何 Mozilla 服务并希望在你的浏览器上切断与它们的任何连接,那么 LibreWolf 就是你的朋友。 + +### 跨平台支持 + +Firefox 可用于 Android 和 iOS,并且适用于各种屏幕尺寸和设备。 + +不幸的是,LibreWolf 仅限于 macOS、Windows、OpenBSD 和 Linux 等桌面平台。 + +### 基于社区 vs 由组织支持 + +[LibreWolf][14] 是一个由社区支持的项目,由一些热情的贡献者维护,旨在促进隐私、安全和用户自由。 + +如果你更喜欢 LibreWolf 提供的产品,那么使用它应该不是问题。即使是一个小团队,他们也会关注最新的 Firefox 版本并尽快推送更新。 + +相比之下,Mozilla 基金会是一个更大的组织,并且一直在树立非凡的榜样来促进可定制性、隐私和安全性。 + +Firefox 会比 LibreWolf 更快地收到更新,如果你担心浏览器的安全性,这是一个重要方面。 + +Firefox 属于一个大组织并没有严重的缺点,但是 Mozilla 为其用户提出的未来可能会有一些你可能不喜欢的决定(或变化)。 + +但是,LibreWolf 作为一个社区项目,会优先考虑用户偏好。 + +### 总结 + +如果方便是你在意的,你需要同步/登录账户功能、Mozilla 的特定功能,以及基本的隐私保护,Mozilla Firefox 应该更适合你。 + +如果你不想要开箱即用的云同步功能、附加功能和以隐私为中心的核心设置,LibreWolf 将是完美的解决方案。 + +在性能方面,两者都应该提供类似的体验。由于某种原因,基准测试(Basemark 3.0、Speedometer 2.0)不适用于 LibreWolf,因此我没有提供任何性能比较图表。 + +我更喜欢使用 Firefox,因为我确实需要基于帐户的同步的便利性,而不需要积极的阻止功能。然而,对于那些想要放弃 Firefox 或者只是想尝试一些专注于用户自由和隐私的东西的人来说,LibreWolf 是一个可靠的选择。 + +它对你而言怎么样?在下面的评论中让我知道你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/librewolf-vs-firefox/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/open-source-browsers-linux/ +[2]: https://itsfoss.com/librewolf/ +[3]: https://itsfoss.com/wp-content/uploads/2022/04/firefox-ui-1.png +[4]: https://itsfoss.com/wp-content/uploads/2022/04/librewolf-ui-1.png +[5]: https://itsfoss.com/wp-content/uploads/2022/04/firefox-google-search.png +[6]: https://itsfoss.com/wp-content/uploads/2022/04/librewolf-duckduckgo.png +[7]: https://itsfoss.com/wp-content/uploads/2022/04/librewolf-ublock-origin.png +[8]: https://itsfoss.com/wp-content/uploads/2022/04/librewolf-privacy-settings.png +[9]: https://itsfoss.com/wp-content/uploads/2022/04/firefox-privacy-settings.png +[10]: https://itsfoss.com/best-browsers-ubuntu-linux/ +[11]: https://itsfoss.com/wp-content/uploads/2022/04/librewolf-security.png +[12]: https://itsfoss.com/wp-content/uploads/2022/04/firefox-extras.png +[13]: https://itsfoss.com/wp-content/uploads/2022/04/firefox-sign-in.png +[14]: https://librewolf.net/ diff --git a/published/202204/20220414 My favorite build options for Go.md b/published/202204/20220414 My favorite build options for Go.md new file mode 100644 index 0000000000..349ba17ec8 --- /dev/null +++ b/published/202204/20220414 My favorite build options for Go.md @@ -0,0 +1,298 @@ +[#]: subject: "My favorite build options for Go" +[#]: via: "https://opensource.com/article/22/4/go-build-options" +[#]: author: "Gaurav Kamathe https://opensource.com/users/gkamathe" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14525-1.html" + +我最喜欢的 Go 构建选项 +====== + +> 这些方便的 Go 构建选项可以帮助你更好地理解 Go 的编译过程。 + +![](https://img.linux.net.cn/data/attachment/album/202204/30/172121exam5k8vx45kzk7p.jpg) + +学习一门新的编程语言最令人欣慰的部分之一,就是最终运行了一个可执行文件,并获得预期的输出。当我开始学习 Go 这门编程语言时,我先是阅读一些示例程序来熟悉语法,然后是尝试写一些小的测试程序。随着时间的推移,这种方法帮助我熟悉了编译和构建程序的过程。 + +Go 的构建选项提供了更好地控制构建过程的方法。它们还可以提供额外的信息,帮助把这个过程分成更小的部分。在这篇文章中,我将演示我所使用的一些选项。注意:我使用的“构建build”和“编译compile”这两个词是同一个意思。 + +### 开始使用 Go + +我使用的 Go 版本是 1.16.7。但是,这里给出的命令应该也能在最新的版本上运行。如果你没有安装 Go,你可以从 [Go 官网][2] 上下载它,并按照说明进行安装。你可以通过打开一个命令提示符,并键入下面的命令来验证你所安装的版本: + +``` +$ go version +``` + +你应该会得到类似下面这样的输出,具体取决于你安装的版本: + +``` +go version go1.16.7 linux/amd64 +``` + +### 基本的 Go 程序的编译和执行方法 + +我将从一个在屏幕上简单打印 “Hello World” 的 Go 程序示例开始,就像下面这样: + +``` +$ cat hello.go +package main + +import "fmt" + +func main() { + fmt.Println("Hello World") +} +``` + +在讨论更高级的选项之前,我将解释如何编译这个 Go 示例程序。我使用了 `build` 命令,后面跟着 Go 程序的源文件名,本例中是 `hello.go`,就像下面这样: + +``` +$ go build hello.go +``` + +如果一切工作正常,你应该看到在你的当前目录下创建了一个名为 `hello` 的可执行文件。你可以通过使用 `file` 命令验证它是 ELF 二进制可执行格式(在 Linux 平台上)。你也可以直接执行它,你会看到它输出 “Hello World”。 + +``` +$ ls +hello  hello.go + +$ file ./hello +./hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped + +$ ./hello +Hello World +``` + +Go 提供了一个方便的 `run` 命令,以便你只是想看看程序是否能正常工作,并获得预期的输出,而不想生成一个最终的二进制文件。请记住,即使你在当前目录中没有看到可执行文件,Go 仍然会在某个地方编译并生成可执行文件并运行它,然后把它从系统中删除。我将在本文后面的章节中解释。 + +``` +$ go run hello.go +Hello World + +$ ls +hello.go +``` + +### 更多细节 + +上面的命令就像一阵风一样,一下子就运行完了我的程序。然而,如果你想知道 Go 在编译这些程序的过程中做了什么,Go 提供了一个 `-x` 选项,它可以打印出 Go 为产生这个可执行文件所做的一切。 + +简单看一下你就会发现,Go 在 `/tmp` 内创建了一个临时工作目录,并生成了可执行文件,然后把它移到了 Go 源程序所在的当前目录。 + +``` +$ go build -x hello.go + +WORK=/tmp/go-build1944767317 +mkdir -p $WORK/b001/ + +<< snip >> + +mkdir -p $WORK/b001/exe/ +cd . +/usr/lib/golang/pkg/tool/linux_amd64/link -o $WORK \ +/b001/exe/a.out -importcfg $WORK/b001 \ +/importcfg.link -buildmode=exe -buildid=K26hEYzgDkqJjx2Hf-wz/\ +nDueg0kBjIygx25rYwbK/W-eJaGIOdPEWgwC6o546 \ +/K26hEYzgDkqJjx2Hf-wz -extld=gcc /root/.cache/go-build /cc \ +/cc72cb2f4fbb61229885fc434995964a7a4d6e10692a23cc0ada6707c5d3435b-d +/usr/lib/golang/pkg/tool/linux_amd64/buildid -w $WORK \ +/b001/exe/a.out # internal +mv $WORK/b001/exe/a.out hello +rm -r $WORK/b001/ +``` + +这有助于解决在程序运行后却在当前目录下没有生成可执行文件的谜团。使用 `-x` 显示可执行文件确实在 `/tmp` 工作目录下创建并被执行了。然而,与 `build` 命令不同的是,可执行文件并没有移动到当前目录,这使得看起来没有可执行文件被创建。 + +``` +$ go run -x hello.go + + +mkdir -p $WORK/b001/exe/ +cd . +/usr/lib/golang/pkg/tool/linux_amd64/link -o $WORK/b001 \ +/exe/hello -importcfg $WORK/b001/importcfg.link -s -w -buildmode=exe -buildid=hK3wnAP20DapUDeuvAAS/E_TzkbzwXz6tM5dEC8Mx \ +/7HYBzuaDGVdaZwSMEWAa/hK3wnAP20DapUDeuvAAS -extld=gcc \ +/root/.cache/go-build/75/ \ +7531fcf5e48444eed677bfc5cda1276a52b73c62ebac3aa99da3c4094fa57dc3-d +$WORK/b001/exe/hello +Hello World +``` + +### 模仿编译而不产生可执行文件 + +假设你不想编译程序并产生一个实际的二进制文件,但你确实想看到这个过程中的所有步骤。你可以通过使用 `-n` 这个构建选项来做到这一点,该选项会打印出通常的执行步骤,而不会实际创建二进制文件。 + +``` +$ go build -n hello.go +``` + +### 保存临时目录 + +很多工作都发生在 `/tmp` 工作目录中,一旦可执行文件被创建和运行,它就会被删除。但是如果你想看看哪些文件是在编译过程中创建的呢?Go 提供了一个 `-work` 选项,它可以在编译程序时使用。`-work` 选项除了运行程序外,还打印了工作目录的路径,但它并不会在这之后删除工作目录,所以你可以切换到该目录,检查在编译过程中创建的所有文件。 + +``` +$ go run -work hello.go +WORK=/tmp/go-build3209320645 +Hello World + +$ find /tmp/go-build3209320645 +/tmp/go-build3209320645 +/tmp/go-build3209320645/b001 +/tmp/go-build3209320645/b001/importcfg.link +/tmp/go-build3209320645/b001/exe +/tmp/go-build3209320645/b001/exe/hello + +$ /tmp/go-build3209320645/b001/exe/hello +Hello World +``` + +### 其他编译选项 + +如果说,你想手动编译程序,而不是使用 Go 的 `build` 和 `run` 这两个方便的命令,最后得到一个可以直接由你的操作系统(这里指 Linux)运行的可执行文件。那么,你该怎么做呢?这个过程可以分为两部分:编译和链接。你可以使用 `tool` 选项来看看它是如何工作的。 + +首先,使用 `tool compile` 命令产生结果的 `ar` 归档文件,它包含了 `.o` 中间文件。接下来,对这个 `hello.o` 文件执行 `tool link` 命令,产生最终的可执行文件,然后你就可以运行它了。 + +``` +$ go tool compile hello.go + +$ file hello.o +hello.o: current ar archive + +$ ar t hello.o +__.PKGDEF +_go_.o + +$ go tool link -o hello hello.o + +$ file hello +hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped + +$ ./hello +Hello World +``` + +如果你想进一步查看基于 `hello.o` 文件产生可执行文件的链接过程,你可以使用 `-v` 选项,它会搜索每个 Go 可执行文件中包含的 `runtime.a` 文件。 + +``` +$ go tool link -v -o hello hello.o +HEADER = -H5 -T0x401000 -R0x1000 +searching for runtime.a in /usr/lib/golang/pkg/linux_amd64/runtime.a +82052 symbols, 18774 reachable + 1 package symbols, 1106 hashed symbols, 77185 non-package symbols, 3760 external symbols +81968 liveness data +``` + +### 交叉编译选项 + +现在我已经解释了 Go 程序的编译过程,接下来,我将演示 Go 如何通过在实际的 `build` 命令之前提供 `GOOS` 和 `GOARCH` 这两个环境变量,来允许你构建针对不同硬件架构和操作系统的可执行文件。 + +这有什么用呢?举个例子,你会发现为 ARM(arch64)架构制作的可执行文件不能在英特尔(x86_64)架构上运行,而且会产生一个 Exec 格式错误。 + +下面的这些选项使得生成跨平台的二进制文件变得小菜一碟: + +``` +$ GOOS=linux GOARCH=arm64 go build hello.go + +$ file ./hello +./hello: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped + +$ ./hello +bash: ./hello: cannot execute binary file: Exec format error + +$ uname -m +x86_64 +``` + +你可以阅读我之前的博文,以更多了解我在 [使用 Go 进行交叉编译][3] 方面的经验。 + +### 查看底层汇编指令 + +源代码并不会直接转换为可执行文件,尽管它生成了一种中间汇编格式,然后最终被组装为可执行文件。在 Go 中,这被映射为一种中间汇编格式,而不是底层硬件汇编指令。 + +要查看这个中间汇编格式,请在使用 `build` 命令时,提供 `-gcflags` 选项,后面跟着 `-S`。这个命令将会显示使用到的汇编指令: + +``` +$ go build -gcflags="-S" hello.go +# command-line-arguments +"".main STEXT size=138 args=0x0 locals=0x58 funcid=0x0 + 0x0000 00000 (/test/hello.go:5) TEXT "".main(SB), ABIInternal, $88-0 + 0x0000 00000 (/test/hello.go:5) MOVQ (TLS), CX + 0x0009 00009 (/test/hello.go:5) CMPQ SP, 16(CX) + 0x000d 00013 (/test/hello.go:5) PCDATA $0, $-2 + 0x000d 00013 (/test/hello.go:5) JLS 128 + +<< snip >> +``` + +你也可以使用 `objdump -s` 选项,来查看已经编译好的可执行程序的汇编指令,就像下面这样: + +``` +$ ls +hello hello.go + +$ go tool objdump -s main.main hello +TEXT main.main(SB) /test/hello.go + hello.go:5 0x4975a0 64488b0c25f8ffffff MOVQ FS:0xfffffff8, CX + hello.go:5 0x4975a9 483b6110 CMPQ 0x10(CX), SP + hello.go:5 0x4975ad 7671 JBE 0x497620 + hello.go:5 0x4975af 4883ec58 SUBQ $0x58, SP + hello.go:6 0x4975d8 4889442448 MOVQ AX, 0x48(SP) + +<< snip >> +``` + +### 分离二进制文件以减少其大小 + +Go 的二进制文件通常比较大。例如, 一个简单的 “Hello World” 程序将会产生一个 1.9M 大小的二进制文件。 + +``` +$ go build hello.go +$ +$ du -sh hello +1.9M    hello +$ +$ file hello +hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped +$ +``` + +为了减少生成的二进制文件的大小,你可以分离执行过程中不需要的信息。使用 `-ldflags` 和 `-s -w` 选项可以使生成的二进制文件略微变小为 1.3M。 + +``` +$ go build -ldflags="-s -w" hello.go +$ +$ du -sh hello +1.3M    hello +$ +$ file hello +hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped +$ +``` + +### 总结 + +我希望这篇文章向你介绍了一些方便的 Go 编译选项,同时帮助了你更好地理解 Go 编译过程。关于构建过程的其他信息和其他有趣的选项,请参考 Go 命令帮助: + +``` +$ go help build +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/4/go-build-options + +作者:[Gaurav Kamathe][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gkamathe +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/build_structure_tech_program_code_construction.png +[2]: https://go.dev/doc/install +[3]: https://opensource.com/article/21/1/go-cross-compiling diff --git a/published/202204/20220415 3-2-1 Backup plan with Fedora ARM server.md b/published/202204/20220415 3-2-1 Backup plan with Fedora ARM server.md new file mode 100644 index 0000000000..706505a23e --- /dev/null +++ b/published/202204/20220415 3-2-1 Backup plan with Fedora ARM server.md @@ -0,0 +1,254 @@ +[#]: subject: "3-2-1 Backup plan with Fedora ARM server" +[#]: via: "https://fedoramagazine.org/3-2-1-backup-plan-with-fedora-arm-server/" +[#]: author: "Hanku Lee https://fedoramagazine.org/author/hankuoffroad/" +[#]: collector: "lujun9972" +[#]: translator: "hwlife" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14519-1.html" + +使用 Fedora ARM 服务器来做 3-2-1 备份计划 +====== + +![][1] + +Fedora 服务器版操作系统可以运行在类似树莓派的单板计算机(SBC)上。这篇文章针对的用户是想要充分利用实体服务器系统,并使用类似 Cockpit 的内置工具进行数据备份和个人数据的恢复。这里描述了备份的 3 个阶段。 + +### 必要的准备 + +想要使用本指南,你所需要的是一个运行着的 Fedora Linux 工作站和以下的项目: + + * 你应该阅读、理解和实践 Fedora 文档中 [服务器安装][4] 和 [管理][5] 的要求 + * 一块用来测试 Fedora Linux 的 SBC(单板计算机)。在这里查看 [硬件需求][6] + * [Fedora ARM][7] [服务器][7] 原始镜像 & ARM 镜像安装器 + * SD 存储卡(64 GB / Class 10)和 SSD 设备两选一 + * 以太网 / DHCP 预留 IP 地址或者静态 IP 地址 + * 提供了 ssh 密钥的 Linux 客户端工作站 + * 选择云存储服务 + * 有额外可用的 Linux 工作站 + +对于这套环境,在写这篇文章的时候,由于成本和可用性的原因,我选择树莓派 3B+/4B+ (其中一个用来热切换)。当使用 Cockpit 远程连接树莓派服务器时,你可以将树莓派放到路由器附近以便设置。 + +### 加强服务器的安全 + +在 SBC 完成服务器的安装和管理后,用 firewalld 加强服务器的安全是一个好的做法。 + +连接存储设备到服务器之前,一旦服务器在线你必须设置好防火墙。firewalld 是基于区域的防火墙。在依照 Fedora 文档完成安装和管理指南之后,创建一个名为 `FedoraServer` 的预定义区域。 + +#### firewalld 里的富规则 + +富规则rich rule用来阻止或者允许一个特定的 IP 地址或者地址段。下面这条规则只从(客户端工作站)注册的 IP 地址接受 SSH 连接,并断开其它的连接。在 Cockpit 终端或者客户端工作站终端运行命令是通过 ssh 来连接到服务器的。 + +``` +firewall-cmd --add-rich-rule='rule family=ipv4 source address=/24 service name=ssh log prefix="SSH Logs" level="notice" accept' +``` + +#### 拒绝所有主机的 ping 请求 + +使用这个命令来设置 icmp 拒绝,并且不允许 ping 请求: + +``` +firewall-cmd --add-rich-rule='rule protocol value=icmp reject' +``` + +要进行其它防火墙控制,比如管理端口和区域,请查阅以下链接。请注意错配防火墙可能会使安全出现漏洞受到攻击。 + +> **[在 Cockpit 中管理防火墙][8]** + +> **[firewalld 规则][9]** + +### 配置文件服务器的存储 + +下一步是连接存储设备到 SBC,然后使用 Cockpit 对新插入的存储设备进行分区。使用 Cockpit 的图形化服务器管理界面,管理一个家庭实验室(可以是一个或者多个服务器)比之前更加简单。Fedora Linux 服务器标准提供了 Cockpit。 + +在这个阶段,一个通过 SBC 的 USB 插口接电的 SSD 设备无需额外电源供给就可以工作。 + + * 将存储设备连接到 SBC 的 USB 接口 + * 运行之后(按上面的“必要的准备”所设置的那样),然后在你的客户端工作站浏览器上访问 **机器的 IP 地址:9090** + * 登录进 Cockpit 之后,点击 Cockpit 页面顶部的“打开管理访问权限Turn on administrative access” + * 点击左边面板的 “存储Storage” 按钮 + * 选择下面显示的 “驱动器Drives”,然后分区并格式化一个空白的存储设备 + ![Cockpit Storage management][10] + * 在选定的存储设备这个界面上,创建一个新的分区表或者格式化并创建新的分区。当初始化磁盘的时候,在 “Partitioning分区” 类型选项上,选择 “GPT 分区表” + * 选择一个文件系统类型,这里选择 “EXT4” 。这对于一个限制 I/O 能力(比如 USB 2.0 接口)和限制带宽(小于 200MB/s)的设备是适合的 + ![Create a partition in Cockpit][11] + * 要在设备上创建单个占据整个存储空间的分区,指定它的挂载点,比如 `/media` 然后点击 “确定Ok” 。 + * 点击 “Create partition创建分区”,创建一个挂载点为 `/media` 的新分区。 + +### 创建备份和恢复备份 + +备份很少是一刀切的。这里有一些选择比如数据备份在哪里,备份数据的步骤,验证一些自动化,并确定怎样来恢复备份了的数据。 + +![Backup workflow – version 1.0][12] + +#### 备份 1. 用 rsync 从客户端远程同步到文件服务器(树莓派) + +这个传输用到的命令是: + +``` +rsync -azP ~/source syncuser@host1:/destination +``` + +参数: +- `-a`/`--archive`:归档 +- `-z`/`--compress`:压缩 +- `-P`/`--progress`:显示进度 + +要使用更多的选项运行 `rsync`,可以设置以下的选项: + +- `--inplace`:直接替换来更新目标文档 +- `--append`:追加数据到较短的文档中 + +在将文档备份到存储空间之前,源端文档的文件重复消除和压缩是减少备份数据容量最有效的方式。 + +每天工作结束,我会手动运行这个。一旦我设置了云备份工作流,自动化脚本是一个优势。 + +关于 `rsync` 的详细信息,请在 [这里][13] 访问 Fedora 杂志的文章。 + +#### 备份 2. 使用 rysnc 从文件服务器远程同步到主要的云存储上 + +选择云存储是考虑的因素; + + * 成本:上传、存储空间和下载费用 + * 支持 `rsync`、`sftp` + * 数据冗余(RAID 10 或者运行中的数据中心冗余计划) + * 快照 + +符合这些云存储标准之一的就是 Hetzner 托管的 Nextcloud– [存储盒子][14]。你不会受到供应商限制,可以自由切换而没有退出惩罚。 + +##### 在文件服务器上生成 SSH 密钥并创建授权密钥文件 + +使用 `ssh-keygen` 命令为文件服务器和云存储生成一对新的 SSH 密钥对。 + +``` +ssh-keygen +Generating public/private rsa key pair. +Enter file in which to save the key . . . +``` + +插入要求的 SSH 公钥到新的本地授权密钥文件中。 + +``` +cat .ssh/id_rsa.pub >> storagebox_authorized_keys +``` + +##### 传输密钥文件到云存储 + +下一步就是上传生成了的授权密钥文件到存储盒子。要做这些,先用 700 权限创建 `.ssh` 目录,然后用 SSH 公钥创建授权文件并赋予 600 权限。运行以下命令。 + +``` +echo -e "mkdir .ssh \n chmod 700 .ssh \n put storagebox_authorized_keys .ssh/authorized_keys \n chmod 600 .ssh/authorized_keys" | sftp @.your-storagebox.de +``` + +##### 通过 ssh 使用 rsync + +使用 `rsync` 同步你的文件目录当前状态到存储盒子。 + +``` +rsync --progress -e 'ssh -p23' --recursive @.your-storagebox.de: +``` + +这个过程被叫做推送操作,因为它 “推送” 本地系统的一个目录到一个远程的系统中去。 + +##### 从云存储中恢复目录 + +要从存储盒子恢复目录,转换到这个目录: + +``` +rsync --progress -e 'ssh -p23' --recursive @.your-storagebox.de: +``` + +#### 备份 3. 客户端备份到第二个云储存 + +[Deja Dup][15] 是 Fedora 软件仓库中为 Fedora 工作站提供快速备份解决方案的工具。它拥有 GPG 加密、计划任务、文件包含(哪个目录要备份)等功能。 + +![Backing up to the secondary cloud][16] + +![Restoring files from cloud storage][17] + +### 归档个人数据 + +不是所有数据都需要 3-2-1 备份策略。这就是个人数据共享。我将一台拥有 1TB 硬盘的笔记本作为我个人数据的档案(家庭照片)。 + +转到设置中的 “共享Sharing” (在我的例子中是 GNOME 文件管理器)并切换滑块以启用共享。 + +![][18] + +打开 “文件共享file sharing”,“网络Networks” 和 “需要的密码Required password”,允许你使用 WebDAV 协议在你的本地网络上分享你的公共文件夹给其它的工作站。 + +![][19] + +### 准备回滚选项 + +未测试的备份并不比完全没有备份好。我在家庭实验室环境中使用 “热切换” 方法来避免像频繁的断电或者液体损坏的情况发生。然而,我的建议方案远没有达到灾难恢复计划或企业 IT 中的自动故障修复。 + + * 定期运行文件恢复操作 + * 备份 ssh/GPG 密钥到一个额外的存储设备中 + * 复制一个 Fedora ARM 服务器的原始镜像到一个 SD 卡中 + * 在主云存储中保持全备份的快照 + * 自动化备份过程最小化减少人为错误或者疏忽 + +### 使用 Cockpit 追踪活动并解决问题 + +当你的项目在成长时,你所管理的服务器数量也在增长。在 Cockpit 中追踪活动和警告可以减轻你的管理负担。你可以使用 Cockpit 的图形化界面的三种方法来归档这些。 + +#### SELinux 菜单 + +怎样诊断网络问题,找到日志并在 Cockpit 中解决问题: + + * 去 SELinux 中检查日志 + * 检查“解决方案详细信息solution details” + * 当必要时,选择 “应用这个方案Apply this solution” + * 如果必要,查看自动化脚本并运行它 + +![SELinux logs][20] + +#### 网络或者存储日志 + +服务器日志会跟踪 CPU 负载、内存使用、网络活动、存储性能和系统日志关联的详细指标。日志会组织在网络面板或者存储面板里显示。 + +![Storage logs in Cockpit][21] + +#### 软件更新 + +在预设的时间和频率下,Cockpit 可以帮助进行安全更新。当你需要时,你可以运行所有的更新。 + +![Software updates][22] + +恭喜你在 Fedora ARM 服务器版本上搭建了一个文件/备份服务器。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/3-2-1-backup-plan-with-fedora-arm-server/ + +作者:[Hanku Lee][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/hankuoffroad/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2022/04/3-2-1_backup-816x345.jpg +[2]: https://unsplash.com/@markuswinkler?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/computer-backup?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://docs.fedoraproject.org/en-US/fedora-server/server-installation-sbc/ +[5]: https://docs.fedoraproject.org/en-US/fedora-server/sysadmin-postinstall/ +[6]: https://docs.fedoraproject.org/en-US/quick-docs/raspberry-pi/ +[7]: https://arm.fedoraproject.org/ +[8]: https://fedoramagazine.org/managing-network-interfaces-and-firewalld-in-cockpit/ +[9]: https://www.redhat.com/sysadmin/firewalld-rules-and-scenarios +[10]: https://fedoramagazine.org/wp-content/uploads/2022/03/Screenshot-from-2022-03-29-22-05-00b-1024x576.png +[11]: https://fedoramagazine.org/wp-content/uploads/2022/03/Screenshot-from-2022-03-29-22-03-36a.png +[12]: https://fedoramagazine.org/wp-content/uploads/2022/04/Backups3-1-1024x525.jpg +[13]: https://fedoramagazine.org/copying-large-files-with-rsync-and-some-misconceptions/ +[14]: https://docs.hetzner.com/robot/storage-box/ +[15]: https://fedoramagazine.org/easy-backups-with-deja-dup/ +[16]: https://fedoramagazine.org/wp-content/uploads/2022/03/Screenshot-from-2022-03-29-22-47-30.png +[17]: https://fedoramagazine.org/wp-content/uploads/2022/03/Screenshot-from-2022-03-29-22-41-57.png +[18]: https://fedoramagazine.org/wp-content/uploads/2022/04/Screenshot-from-2022-04-14-20-48-49-1024x733.png +[19]: https://fedoramagazine.org/wp-content/uploads/2022/04/Screenshot-from-2022-04-14-20-51-18st.png +[20]: https://fedoramagazine.org/wp-content/uploads/2022/04/Screenshot-from-2022-04-02-11-24-30b-1024x441.png +[21]: https://fedoramagazine.org/wp-content/uploads/2022/04/Screenshot-from-2022-04-04-21-47-06SL-1024x259.png +[22]: https://fedoramagazine.org/wp-content/uploads/2022/04/Screenshot-from-2022-04-04-21-35-42b.png diff --git a/published/202204/20220415 Elon Musk Believes Twitter Algorithm Should Be Open-Source.md b/published/202204/20220415 Elon Musk Believes Twitter Algorithm Should Be Open-Source.md new file mode 100644 index 0000000000..68142562e4 --- /dev/null +++ b/published/202204/20220415 Elon Musk Believes Twitter Algorithm Should Be Open-Source.md @@ -0,0 +1,69 @@ +[#]: subject: "Elon Musk Believes Twitter Algorithm Should Be Open-Source" +[#]: via: "https://news.itsfoss.com/elon-musk-twitter-open-source/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14491-1.html" + +埃隆·马斯克认为推特的算法应该开源 +====== + +> 埃隆·马斯克希望推特开源他们的算法。这会促进言论自由吗?以下是他的说法。 + +![](https://news.itsfoss.com/wp-content/uploads/2022/04/elon-musk-twitter-algorithm-opensource.jpg) + +没错,埃隆·马斯克又搞了一个大新闻,这已经算是他的日常操作了。 + +然而,这一次的新闻非常有趣。他提出了要以大约 **430 亿美元** 收购推特。 + +从技术上讲,他的报价远远超过了市场价格,这也就是为什么许多媒体称他这是在试图“恶意收购”。 + +考虑到这个激进的报价,我们还不确定这次收购是否会成功。不过,在一次 TED 演讲中,埃隆·马斯克还分享了他对于推特应该如何推动言论自由的一些想法。 + +### 推特的算法应该开源 + +埃隆·马斯克认为,推特应该将算法开源,以促进平台的透明度。 + +当然,推特作为一个平台,目前仍在爆炸式发展,很难预测。推特团队在某些事情上也会采取果断行动,不管用户认为它是否正确。 + +虽然推特的内部决定在纸面上看起来很好,但这种没有透明度的大规模平台总是会存在问题的。 + +因此,埃隆·马斯克有一个观点:无论你是否认同或相信推特的决定,透明/开源只会有助于加强现有的价值观。 + +嗯,难怪我们喜欢开源。 + +这里引用他的原话: + +> “因此,我认为推特应该做的事情之一就是开源它的算法,所有推文的修改都应该是透明的,任何人都可以看到这个修改,哪怕是加粗一段文字或是取消加粗它。这样一来,幕后操纵将不复存在,无论是算法还是人工。” + +另一方面,当我们把推特当作一个某种程度上的开源平台来谈论时,我不由自主地想到了 [Mastodon][7]。你也可以在 [Mastodon][8] 上找到我们,如果你还没有用过它的话。 + +诚然,推特有很大的增长潜力,无论好坏,它都在不断扩张。但是,开源理念能否帮助这个平台?我个人认为可以,但这是一个巨大的变革,不能指望一夜之间就能实现。 + +当然,即使埃隆·马斯克成功地收购了推特,也没有人能够预测他会对推特做什么。说实话,他就像任何复杂算法一样不可预测。 + +那么,你是如何看待这个新闻的呢?你相信埃隆·马斯克说的话吗?欢迎在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/elon-musk-twitter-open-source/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://twitter.com/elonmusk?ref_src=twsrc%5Etfw +[2]: https://twitter.com/hashtag/TED2022?src=hash&ref_src=twsrc%5Etfw +[3]: https://twitter.com/TEDchris?ref_src=twsrc%5Etfw +[4]: https://twitter.com/YouTube?ref_src=twsrc%5Etfw +[5]: https://t.co/Okm3y5HpEy +[6]: https://twitter.com/TEDTalks/status/1514739086908555272?ref_src=twsrc%5Etfw +[7]: https://joinmastodon.org/ +[8]: https://mastodon.social/@itsfoss diff --git a/published/202204/20220415 How the C programming language has grown.md b/published/202204/20220415 How the C programming language has grown.md new file mode 100644 index 0000000000..c0f37af0b6 --- /dev/null +++ b/published/202204/20220415 How the C programming language has grown.md @@ -0,0 +1,89 @@ +[#]: subject: "How the C programming language has grown" +[#]: via: "https://opensource.com/article/22/3/how-c-programming-language-has-grown" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14508-1.html" + +C 语言发展简史 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/25/121408ra3c5cpgjogtcdxl.jpg) + +> 下面是我对 布莱恩·克尼汉Brian Kernighan 的采访,他(与 丹尼斯·里奇Dennis Ritchie)是《C 程序设计语言The C Programming Language》一书的共同作者,我们谈及了 C 语言及其 50 年的历史。 + +![两位作者写的最初的 C 语言编程指南,大约是在 1978 年][1] + +C 语言将在 2022 年满 50 岁。然而,尽管它历史悠久,在许多“流行编程语言”的调查中,C 语言仍然是“最常用”的编程语言之一。例如,你可以看看 [TIOBE 指数][2],它追踪不同编程语言的流行程度。许多 Linux 应用程序是用 C 语言编写的,例如 GNOME 桌面。 + +我采访了 [布莱恩·克尼汉][3]Brian Kernighan,以了解更多关于 C 语言及其历史他(与 丹尼斯·里奇Dennis Ritchie)是《C 程序设计语言The C Programming Language》一书的共同作者。 + +### C 语言是怎么诞生的呢? + +C 语言由一系列旨在进行系统编程的语言演变而来,系统编程就是编写像编译器、汇编器、编辑器以及最终的操作系统这样的程序。麻省理工学院有一个与贝尔实验室合作的 Multics 项目,它计划用一种高级语言编写系统的所有部分(这在 1965 年那时候是一个新想法)。他们打算使用 IBM 的 PL/1,但它非常复杂,而且承诺的编译器也没有及时交付。 + +在与一个叫做 EPL 的子集(由贝尔实验室的道格拉斯·麦克罗伊Douglas McIlroy 设计)进行了短暂交流后,Multics 转向了 BCPL,这是一个由剑桥的 Martin Richards 设计和实现的,更加简单和干净的语言,我记得他当时正在麻省理工学院访问。当 肯·汤普逊Ken Thompson 开始研究后来的 Unix 时,他在 BCPL 的基础上创造了一种更简单的语言,他称之为 B 语言。在 1969 年,他为搭载了第一个 Unix 原型系统的 PDP-7 计算机实现了这种语言。 + +BCPL 和 B 都是“无类型”语言。也就是说,它们只有一种数据类型,即整数。DEC 公司的 PDP-11 计算机大约在 1971 年投入使用,它搭载了第一个真正的 Unix 系统。PDP-11 支持几种数据类型,特别是 8 位字节和 16 位整数。因此,一种同样支持几种数据类型的语言是更好的选择。这就是 C 语言的起源。 + +### C 语言在贝尔实验室和早期版本的 Unix 中是如何使用的呢? + +C 语言最初只在 Unix 上使用,尽管过了一段时间,也有了用于其他机器和操作系统的 C 语言编译器。大多数情况下,它被用于系统级的编程,涵盖了相当多有趣的领域,还有很多用于管理 AT&T 电话网络运营的系统。 + +### 在贝尔实验室用 C 语言编写的最有趣的项目是什么? + +可以说,最有趣、最令人难忘、也是最重要的 C 语言程序就是 Unix 操作系统本身。1971 年 Unix 的第一个版本是用 PDP-11 汇编语言编写的,但到了第四版,也就是 1973 年左右,我们用 C 语言重写了它。这很关键,因为这意味着操作系统(和它所有的支持软件)基本上可以通过重新编译来移植到不同类型的计算机上。虽然在实践中并没有那么简单,但也相差不远。 + +### 你与丹尼斯·里奇合著了《C 程序设计语言》一书。那本书是怎么来的,你和丹尼斯又是如何在书中合作的呢? + +我曾经写过一本肯·汤普逊的 B 语言教程,帮助人们快速上手使用它。当 C 语言可用时,我将其升级为 C 语言的教程。过了一段时间,我说服了丹尼斯,让他和我一起写一本 C 语言的书。基本上,除了系统调用那章外,大部分的教程材料都是我写的,而丹尼斯已经写好了那个参考手册,写的非常棒。然后我们反复修改,使教程部分更加流畅。参考手册几乎保持不变,因为它从一开始就写得很好。这本书的格式是用 *troff* 格式器格式的,这是 Unix 上的许多工具之一,我做了大部分的格式化工作。 + +### C 语言什么时候成为了贝尔实验室以外的其他程序员用于工作的东西呢? + +我真的记不大清了,但我认为大概是在最初的五六年里,C 语言主要是跟着 Unix 一起发展的。随着其他操作系统上的编译器的发展,它开始蔓延到 Unix 以外的其他系统。我不记得我们是什么时候意识到 C 和 Unix 产生了真正的影响,但应该是在 20 世纪 70 年代中后期。 + +### 为什么 C 语言会成为如此有影响力的编程语言呢? + +早期的主要原因是它与 Unix 的联系,Unix 在世界上迅速传播。如果你使用 Unix,你就会用 C 语言来编程。后来,C 语言传播到不一定运行 Unix 的计算机上,很大程度上是因为 Steve Johnson 编写了可移植 C 语言编译器。在工作站领域,比如 昇阳微系统Sun Microsystems、MIPS(后来成为 SGI)和其他公司,它们都是因为 Unix 和 C 语言的结合而获得成功。IBM PC 出现得稍晚一些,大约在 1982 年。后来 C 语言成为 MS-DOS 和 Windows 下的标准编程语言之一。今天,大多数物联网(IoT)设备会使用 C 语言。 + +### 在创建约 50 年后的今天,C 仍然是一种流行的编程语言。为什么它仍然如此受欢迎呢? + +我认为 C 语言在效率和表现力这两个方面达到了一个平衡点。在早期,效率真的很重要,因为与我们今天所使用的计算机相比,当时的计算机速度很慢、内存十分有限。C 语言是非常高效的,因为它可以被编译成高效的机器代码,而且它也足够简单,人们很容易学会如何编译它。同时,它还具有很强的表现力,易于编写,并且结构紧凑。至少在我谦虚而正确的观点中,没有任何一种语言能很好地达到这种境界。 + +### 多年来,C 语言的发展和变化如何? + +我想,C 语言的发展是适度的,但我并没有太注意 C 语言标准的发展。C 语言已经有足够的改变了,80 年代写的代码需要做一些前置工作才能编译,但这主要与诚实对待类型有关。比较新的功能,如复数,也许是有用的,但对我来说不是,所以我不能做出明智的评论。 + +### 哪些编程问题可以用C语言最容易解决? + +嗯,对于任何事情来说,它都是一种很好的语言,但在今天,有了充足的内存和处理能力,大多数程序员都可以用 Python 这样的语言来进行内存管理和处理其他更高级的结构。C 语言仍然是底层编程的一个很好的选择,因为对于底层编程来说,充分利用 CPU 周期和每一个字节仍然很重要。 + +### C 语言影响了其他编程语言,包括 C++、Java、Go 和 Rust。你对这些编程语言有什么看法? + +几乎每一种语言在某些方面都是对其前辈的反应。简单点说,C++ 增加了控制信息访问的机制,所以对于真正的大型程序来说,它比 C 更好。[Java][4] 是对 C++ 的复杂性的一种反应。Go 是对 C++ 的复杂性和 [Java][4] 的限制的一种反应。[Rust][5] 是对 C 语言(大概也是对 C++)中内存管理问题的一种尝试,同时它接近了 C 语言的效率。 + +它们都带来了某些积极的特性,但不知何故,没有人能够完全满意,所以总是会有更多的语言,反过来对以前的语言做出反应。同时,老的语言,在大多数情况下,仍会继续存在,因为它们的工作做得很好,而且有一个嵌入式的根据地,老的语言在里面可以完美使用,而用新的东西来重新实现是不可行的。 + +感谢 Brian 为我们分享了 C 语言编程的伟大历史! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/3/how-c-programming-language-has-grown + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/uploads/2482009942_6caea217e0_c.jpg +[2]: https://www.tiobe.com/tiobe-index/ +[3]: https://opensource.com/article/22/1/interview-brian-kernighan +[4]: https://opensource.com/tags/java +[5]: https://opensource.com/tags/rust +[6]: https://opensource.com/article/22/1/c-programming diff --git a/published/202204/20220415 How to Upgrade to Ubuntu 22.04 -Jammy Jellyfish- From Ubuntu 20.04 LTS.md b/published/202204/20220415 How to Upgrade to Ubuntu 22.04 -Jammy Jellyfish- From Ubuntu 20.04 LTS.md new file mode 100644 index 0000000000..4c43ff989f --- /dev/null +++ b/published/202204/20220415 How to Upgrade to Ubuntu 22.04 -Jammy Jellyfish- From Ubuntu 20.04 LTS.md @@ -0,0 +1,106 @@ +[#]: subject: "How to Upgrade to Ubuntu 22.04 “Jammy Jellyfish” From Ubuntu 20.04 LTS" +[#]: via: "https://www.debugpoint.com/2022/04/upgrade-ubuntu-22-04-from-20-04/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14490-1.html" + +如何从 Ubuntu 20.04 LTS 升级到 Ubuntu 22.04 “Jammy Jellyfish” +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/20/081835mfrb93flhqrz9dou.jpg) +s +> 本文介绍从 Ubuntu 20.04 LTS 升级到 Ubuntu 之前,你所需要采取的完整步骤和预防措施。 + +[Ubuntu 22.04 LTS Jammy Jellyfish][1] 将在 2022 年 4 月 21 日发布。我建议你在该日期之后的一两个月后再升级。理想的情况下,如果你在第一次修正版本发布后,才计划升级到任意主要版本,这会是最好的选择。 + +但是,如果你迫切想要体验 Ubuntu 22.04 带来的令人震惊的更改和特色功能,那么,接下来请阅读用于完美升级过程的步骤。 + +### 在升级前 + +在任何升级前,遵循一些最佳的惯例总是更加明智的。这会防止出现一些升级后的问题,并引领通往成功的升级流程。 + + * 备份你的家目录中的数据到另一个驱动器或 USB 存储器,包括:图片、视频或其他的个人文件。 + * 如果你遇到一个不稳定的系统行,请保留一个准备好的 [Ubuntu 的现场 USB][2]。 + * 如果你打算升级 GNOME 工作站,请先禁用所有的 GNOME 扩展,因为这些扩展与 GNOME 3.36+ 不兼容。 + * 在成功的升级后,你可以逐一启用这些扩展。 + * 运行命令 `sudo apt update && sudo apt upgrade` 以确保你的系统是最新的软件包。 + * 关闭所有你正在运行的应用程序。 + * 重新启动你的系统。 + +说到这里,如果你准备好了,接下来遵循下面的说明来从 Ubuntu 20.04 LTS 升级到 Ubuntu 22.04 。 + +### 从 Ubuntu 20.04 和 Ubuntu 21.10 升级到 Ubuntu 22.04 + +#### 在 2022 年 4 月 21 日之前 + +如果你想在发布日期前升级,打开一个终端窗口,并运行下面的命令。 + +``` +sudo do-release-upgrade -d +``` + +![Upgrade to Ubuntu 22.04 LTS from Ubuntu 20.04 LTS][3] + +上面的命令将使用 “jammy” 来覆盖系统中的 “focal” 分支,以获取新的软件包。不仅如此,这个命令也会禁用你这些年可能添加的所有的第三方 PPA 。 + +此外,这个命令将花费一些时间才完成,这主要取决于你的网速。 + +除此之外,注意终端上偶尔出现的提示,它需要你输入 `Y` 或 `N` 。另外,如果你中途取消升级过程,这些第三方 PPA 也不会被启用,你必须手动启用它们。 + +![Summary of the upgrade][4] + +最后,这个命令将计算升级系统所需软件包的大小,并估算所需时间,摘要如下图所示。请仔细地阅读它,并允许升级到 Ubuntu 22.04 LTS Jammy Jellyfish。 + +在升级过程完成后,重新启动你的系统,享受令人兴奋的 Ubuntu 22.04 LTS 。 + +#### 在 2022 年 4 月 21 日之后 + +在 2022 年 4 月 21 日当天或之后,直到 2022 年 07 月第一次修正版本发布,Ubuntu 都不会给予你任何可视化的升级提示,因为第一个修改版本被认为是初始错误被消除后最稳定的版本。 + +这意味着,你要么等到 7 月,你要么强制升级。如何强制升级?打开“软件和更新Software and Updates”,转到“更新Updates”标签页。更改“通知我有新的 Ubuntu 版本Settings notify me of new ubuntu version” 为 “任意新的 Ubuntu 版本any new version”。 + +在完成后,你应该会在桌面上看到一个升级提示。遵循屏幕上的指示,接着继续升级过程。 + +这个提示也会计算升级系统所列软件包所需的时间,因此,仔细的阅读更新程序的输出内容。在你准备好了以后,开始升级过程。 + +最后,在升级过程完成后,重新启动系统,享受全新的 Ubuntu 22.04 LTS Jammy Jellyfish 。 + +#### 从 Ubuntu 21.10 升级到 Ubuntu 22.04 + +针对 Ubuntu 21.10 ,你也可以参考上面确切说明来升级。从 Ubuntu 21.10 升级到 Ubuntu 22.04 不需要额外的步骤。 + +#### 升级到 Ubuntu 22.04 的过程需要多长的时间? + +根据我的测试,在默认安装的情况下,整个升级过程需要 30 多分钟。根据你安装的软件包的数量和安装的年限,你的系统可能会更多。因此,相应地计划你的时间。 + +### 总结 + +最后,我希望这些步骤能帮助你成功地升级你的 Ubuntu 系统到 Jammy Jellyfish 。如果你正在打算升级,祝你一切顺利。 + +请在下面的评论区中告诉我升级过程是如何进行的。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/04/upgrade-ubuntu-22-04-from-20-04/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://releases.ubuntu.com/22.04/ +[2]: https://www.debugpoint.com/2018/09/how-to-create-ubuntu-linux-os-bootable-usb-in-windows/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/04/Upgrade-to-Ubuntu-22.04-LTS-from-Ubuntu-20.04-LTS-1024x540.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/04/Summary-of-the-upgrade-1024x581.jpg +[5]: https://www.debugpoint.com/2021/10/ubuntu-22-04-daily-builds/ +[6]: https://t.me/debugpoint +[7]: https://twitter.com/DebugPoint +[8]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[9]: https://facebook.com/DebugPoint diff --git a/published/202204/20220416 Disable Animations in Cinnamon Desktop to Slightly Speed Up Your Linux Mint System.md b/published/202204/20220416 Disable Animations in Cinnamon Desktop to Slightly Speed Up Your Linux Mint System.md new file mode 100644 index 0000000000..28f790b16c --- /dev/null +++ b/published/202204/20220416 Disable Animations in Cinnamon Desktop to Slightly Speed Up Your Linux Mint System.md @@ -0,0 +1,74 @@ +[#]: subject: "Disable Animations in Cinnamon Desktop to Slightly Speed Up Your Linux Mint System" +[#]: via: "https://itsfoss.com/disable-animations-cinnamon-desktop/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14499-1.html" + +禁用 Cinnamon 桌面的动画以略微加速你的 Linux Mint 系统 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/22/121054zccs5lcss57lt96e.jpg) + +让我们面对现实吧。 + +与 GNOME 等相比,Cinnamon 已经是一个轻量的桌面环境了。虽然它占用的资源可能没有 Xfce 那么低。 + +不过,如果你有一个硬件不足的系统,并且你想要提升一点性能,而不想切换到 Xfce 等替代性桌面环境Desktop Environment(DE)或 [Sway][1]、[Fluxbox][2] 等窗口管理器Window Manager(WM)的话,我这里倒是有一个实用小技巧可以分享给你。它应该帮助你加快 Linux Mint 的速度,虽然只能够加快一点点。 + +### 禁用 Cinnamon 桌面的动画效果 + +**首先,你一定不要指望用这个小技巧来大幅提高整体桌面性能。原因如下:** + +当你打开/关闭应用程序窗口、使用菜单、弹出对话框等时,你会注意到这些动画animations效果effects。由于这些事件都是短暂的,不会持续运行,因此禁用它们并不能得到很大提升。 + +如果你的系统真的在崩溃的边缘挣扎,禁用这些效果可能有助于减少卡顿。真的到了这种时候,能快一点是一点。让我们来看看该怎么做吧! + +首先,打开菜单,搜索“效果effects”。 + +![打开 Linux Mint Cinnamon 的效果设置][3] + +打开“效果effects”设置窗口,你默认会在“启用效果Enable Effects”这个标签页中。你可以在这里选择禁用(或启用)各种可用的动画效果。 + +![禁用 Linux Mint Cinnamon 桌面的动画][4] + +你可以选择禁用部分或全部效果。 + +如果你切换到“自定义Customize”标签页,你可以自定义你在“启用效果Enable Effects”标签页中看到的各种效果。 + +![自定义 Linux Mint Cinnamon 中的窗口动画][5] + +第一栏是效果的名称,第二栏是动画的类型,第三栏是动画的展示方式,在最后一栏,你可以配置动画完成的时间。 + +如果你选择了 “None”、“easeNone” 和 “0” 时长,就相当于禁用了这个效果。不过,使用另一个标签中的禁用选项是一个更简单的选择。 + +### 值得这样做吗? + +我写这个小技巧的原因是,有读者问我能否定制 Cinnamon 并禁用动画。 + +说实话,这并不费什么劲,而且做了之后也没有多大区别。你几乎不会注意到视觉上的影响,更别说是性能上的改进了。 + +但是,如果你的系统正处于挣扎状态,每一个微小的优化都会有帮助。你也可以尝试使用消耗较少系统资源的轻量级应用程序。这或许对你也有一点帮助。 + +你有任何类似的优化小技巧吗?请在评论区和大家分享吧! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/disable-animations-cinnamon-desktop/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/sway-window-manager/ +[2]: http://fluxbox.org/ +[3]: https://itsfoss.com/wp-content/uploads/2022/04/accessing-effects-settings-mint-cinnamon-800x630.png +[4]: https://itsfoss.com/wp-content/uploads/2022/04/disable-animations-cinnamon-Linux-mint-800x466.png +[5]: https://itsfoss.com/wp-content/uploads/2022/04/customize-window-animation-cinnamon-linux-mint-800x571.png diff --git a/published/202204/20220417 How I scan family photos on Linux.md b/published/202204/20220417 How I scan family photos on Linux.md new file mode 100644 index 0000000000..54d93d77fd --- /dev/null +++ b/published/202204/20220417 How I scan family photos on Linux.md @@ -0,0 +1,64 @@ +[#]: subject: "How I scan family photos on Linux" +[#]: via: "https://opensource.com/article/22/4/scan-family-photos-linux" +[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14511-1.html" + +我如何在 Linux 上扫描家庭照片 +====== + +> 有了 Linux,我可以用意想不到的方式与我的先辈们联系。 + +![](https://img.linux.net.cn/data/attachment/album/202204/26/090841e6aei8to2a4js0zj.jpg) + +Linux 不仅仅是在服务器上运行、为互联网提供动力的东西。它是你的数据、你的家庭历史和记忆、工作或娱乐以及现实生活的安全场所。 + +这就是例子:现在我正在进行一个扫描家庭老照片的项目。我使用带有 GNOME 桌面的 Fedora Linux 已经有几年了,所以我不需要安装任何额外的软件包。我只是把扫描仪插入 USB 接口,启动扫描软件(文档扫描器Document Scanner),就可以了。请继续阅读,看看我是如何做到的。 + +### 将记忆数字化 + +许多人对了解他们的家族历史、先辈们和遗产感兴趣。随着现在技术的发展,将旧的人工制品数字化已经成为一种普遍的做法。无论是你的 80 年代的磁带收藏,还是高中的艺术作品,或者是家庭的老照片,把它们变成数字格式是一种现代的保存和未来验证的方法。 + +我的妈妈最近给了我一些先辈们的照片,所以我有几张想保存的图片。扫描它们不仅提供了某种意义上的永久性,而且使我能够以在拍摄它们的时代闻所未闻的方式来处理它们。例如,我有一张我祖父的照片,他在我出生前几年不幸去世。通过将他的照片数字化,我可以放大,了解他,并可能以一种原本不可能的方式与他建立联系。 + +### 工作流程 + +首先要做的是把我的佳能扫描仪插入 USB 接口。当我打开文档扫描器时,它检测到我的 Canon LiDE 210 扫描仪。接下来,我把照片放到平板扫描仪上。我将设置调整为 2400 DPI 的图像分辨率,以确保我捕捉到每一个细节。 + +然后我点击扫描。在这种分辨率下,扫描可能需要一些时间,但完成后,我可以根据需要裁剪图像并保存它。 + +顺便说一下,在我扫描照片和写这篇文章的时候,我也在用一个开源的音频播放器 [Clementine][2] 在同一台电脑上欣赏我最喜欢的一些音乐。性能受到影响?一点也不。 + +扫描完成后,我还可以选择裁剪图片并将其保存为 PDF、JPG 或任何我选择的格式。 + +### 现实生活 + +请允许我介绍我的祖父和我的叔叔乔治,大约在 1944 年。乔治是一名二战老兵,曾在欧洲与纳粹作战。我的祖父,在右边,是北卡罗来纳州东南部一家木材厂的工头。虽然他没有看到战场,但他负责分配到他的工厂工作的被俘纳粹战俘。他形容他们是年轻的男孩,只想回家和他们的家人在一起。 + +![Scan of photo of my grandfather][3] + +(图片由:Alan Formy-Duval, CC BY-SA 4.0) + +### 总结 + +作为一个专门的 Linux 桌面用户,我有时会听到有人说他们不使用 Linux,因为有一些任务它不能执行。Linux 是我使用的全部,而且在大约 14 年的时间里,我没有遇到这个问题。无论你是在寻找一种愉快的消遣,还是寻找一种提高工作效率的方法,都有可能有一种在 Linux 上运行的解决方案适合你。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/4/scan-family-photos-linux + +作者:[Alan Formy-Duval][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/alanfdoss +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/camera-photography-film.jpg +[2]: https://opensource.com/life/16/10/4-open-music-players-compared +[3]: https://opensource.com/sites/default/files/2022-04/Scanner_Picture2022.png diff --git a/published/202204/20220418 MLCube and Podman.md b/published/202204/20220418 MLCube and Podman.md new file mode 100644 index 0000000000..67ba1e44b4 --- /dev/null +++ b/published/202204/20220418 MLCube and Podman.md @@ -0,0 +1,172 @@ +[#]: subject: "MLCube and Podman" +[#]: via: "https://fedoramagazine.org/mlcube-and-podman/" +[#]: author: "Benson Muite https://fedoramagazine.org/author/fed500/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14515-1.html" + +使用 Podman 运行一个 “hello world” MLCube +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/27/103635qwtt6329orht0393.jpg) + +[MLCube][2] 是一个新的基于基础设施规范的开源容器,被引入到基于 Python 的机器学习工作流程中,以实现可重复性。它可以利用诸如 [Podman][3]、[Singularity][4] 和 [Docker][5] 等工具。也支持在远程平台上的执行。开发 MLCube 的 MLCommons 最佳实践工作组的主席之一是来自 Red Hat 的 [Diane Feddema][6]。这篇介绍性文章解释了如何在 Fedora Linux 上使用 Podman 运行 [“hello world” MLCube 例子][7]。 + +[Yazan Monshed][8] 写了一篇关于 [Fedora 上的 Podman][9] 的非常有用的介绍,对这里使用的一些步骤给出了更多细节。 + +首先安装必要的依赖项。 + +``` +sudo dnf -y update +sudo dnf -y install podman git virtualenv \ + policycoreutils-python-utils +``` + +然后,按照文档的要求,设置一个虚拟环境并获得示例代码。为了确保可重复性,使用一个特定的提交,因为该项目正在积极改进。 + +``` +virtualenv -p python3 ./env_mlcube +source ./env_mlcube/bin/activate +git clone https://github.com/mlcommons/mlcube_examples.git +cd ./mlcube_examples/hello_world +git checkout 5fe69bd +pip install mlcube mlcube-docker +mlcube describe +``` + +现在,通过编辑 $HOME/mlcube.yaml 文件,将运行器命令从 `docker` 改为 `podman`,即: + +``` +docker: docker +``` + +改为: + +``` +docker: podman +``` + +如果你使用的是 x86_64 架构的电脑,你可以用以下方式获取容器: + +``` +mlcube configure --mlcube=. --platform=docker +``` + +你会看到一些选项: + +``` +? Please select an image: + ▸ registry.fedoraproject.org/mlcommons/hello_world:0.0.1 + registry.access.redhat.com/mlcommons/hello_world:0.0.1 + docker.io/mlcommons/hello_world:0.0.1 + quay.io/mlcommons/hello_world:0.0.1 +``` + +选择 `docker.io/mlcommons/hello_world:0.0.1` 来获取容器。 + +如果你的电脑不是 x86_64 架构的,你需要构建容器。改变文件 `$HOME/mlcube.yaml`,将这一行: + +``` +build_strategy: pull +``` + +变为: + +``` +build_strategy: auto +``` + +然后用以下方法构建容器: + +``` +mlcube configure --mlcube=. --platform=docker +``` + +要运行测试,你可能需要在目录中适当地设置 SELinux 权限。你可以通过输入以下内容来检查 SELinux 是否已经启用: + +``` +sudo sestatus +``` + +应该会有类似这样的输出: + +``` +SELinux status: enabled +... +``` + +[Josphat Mutai][10]、[Christopher Smart][11] 和 [Daniel Walsh][12] 解释说,在为容器使用的文件设置适当的 SELinux 策略时,你需要谨慎。在这里,你将允许容器读取和写入 `workspace` 目录。 + +``` +sudo semanage fcontext -a -t container_file_t "$PWD/workspace(/.*)?" +sudo restorecon -Rv $PWD/workspace +``` + +现在检查目录策略: + +``` +ls -Z +``` + +输出结果类似于: + +``` +unconfined_u:object_r:user_home_t:s0 Dockerfile +unconfined_u:object_r:user_home_t:s0 README.md +unconfined_u:object_r:user_home_t:s0 mlcube.yaml +unconfined_u:object_r:user_home_t:s0 requirements.txt +unconfined_u:object_r:container_file_t:s0 workspace +``` + +现在运行这个例子: + +``` +mlcube run --mlcube=. --task=hello --platform=docker +mlcube run --mlcube=. --task=bye --platform=docker +``` + +最后,检查输出: + +``` +cat workspace/chats/chat_with_alice.txt +``` + +有类似于以下的文字: + +``` +Hi, Alice! Nice to meet you. +Bye, Alice! It was great talking to you. +``` + +你可以按照 [这里][13] 的描述创建你自己的 MLCube。欢迎对 [MLCube 示例库][14] 做出贡献。[Udica][15] 是一个新项目,它承诺为容器提供更精细的 SELinux 策略控制,便于系统管理员应用。这些项目的积极开发正在进行中。对它们进行测试并提供反馈,将有助于使带有 SELinux 的系统上的安全数据管理更容易、更有效。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/mlcube-and-podman/ + +作者:[Benson Muite][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/fed500/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2022/04/MLCubePodman-816x345.jpg +[2]: https://mlcommons.org/en/mlcube/ +[3]: https://podman.io/ +[4]: https://sylabs.io/singularity/ +[5]: https://www.docker.com/ +[6]: https://www.redhat.com/en/authors/diane-feddema +[7]: https://mlcommons.github.io/mlcube/getting-started/hello-world/ +[8]: https://fedoramagazine.org/author/yazanalmonshed/ +[9]: https://fedoramagazine.org/getting-started-with-podman-in-fedora/ +[10]: https://computingforgeeks.com/set-selinux-context-label-for-podman-graphroot-directory/ +[11]: https://blog.christophersmart.com/2021/01/31/podman-volumes-and-selinux/ +[12]: https://opensource.com/article/18/2/selinux-labels-container-runtimes +[13]: https://mlcommons.github.io/mlcube/tutorials/create-mlcube/ +[14]: https://github.com/mlcommons/mlcube_examples +[15]: https://github.com/containers/udica diff --git a/published/202204/20220420 AlmaLinux 9.0 Beta Is Here, Ready to Replace to RHEL 9.md b/published/202204/20220420 AlmaLinux 9.0 Beta Is Here, Ready to Replace to RHEL 9.md new file mode 100644 index 0000000000..03ff1d6891 --- /dev/null +++ b/published/202204/20220420 AlmaLinux 9.0 Beta Is Here, Ready to Replace to RHEL 9.md @@ -0,0 +1,89 @@ +[#]: subject: "AlmaLinux 9.0 Beta Is Here, Ready to Replace to RHEL 9" +[#]: via: "https://news.itsfoss.com/almalinux-9-0-beta-release/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14500-1.html" + +AlmaLinux 9.0 测试版来了,与 RHEL 9 同步 +====== + +> AlmaLinux 9 Beta 发布了,跟上了最新的 RHEL 9,还有一些软件包的更新和变化。 + +![](https://news.itsfoss.com/wp-content/uploads/2022/04/almalinux-9-beta.jpg) + +AlmaLinux 是一个流行的企业级 Linux 发行版,它刚刚宣布了 9.0 测试版,以和上游系统(RHEL 9)保持同步。 + +让我先来提供一些背景介绍吧。AlmaLinux 在 2021 年初推出,以取代当时刚停产的 CentOS。它的主要目标之一是成为 RHEL 的替代品,特别是需要达到 100% 的二进制兼容。 + +不要忘了,AlmaLinux 是免费的,这使得它成为 [最好的 RHEL 替代品之一][1]。 + +作为一个注重稳定性的发行版,它并没有很多新的功能。不过,它确实有很多软件包的更新,本文将介绍逐一它们。 + +让我们来看一看吧! + +### 有什么新功能? + +作为 RHEL 的克隆版,它几乎继承了 RHEL 9.0 测试版的所有功能。 + + * [Linux 5.14 内核][2] + * SELinux 性能改进 + * 更新的软件包 + +#### Linux 5.14 内核 + +这绝对是最大的升级,Linux 5.14 内核带来了更新的硬件支持和其他各种改进。虽然与 AlmaLinux 的目标用户不是特别相关,但它确实包括了我很欣赏的 Radeon 卡的热拔插功能。 + +除此之外,这是一个相当小的版本,它最大的卖点可能是 [紧跟在 Linux 30 周年之后发布][2]。 + +#### SELinux 性能改进 + +![][3] + +和所有的安全措施一样,SELinux 总是会对性能产生轻微的影响。虽然这在很大程度上是最小的,但它总是还有改进空间,而这个版本貌似就有性能改进。 + +正如红帽 [博文][4] 中所展示的那样,其中一些性能改进是相当显著的。从上图可以看出,在显示的指标中,Linux 5.14 内核(蓝色)的 SELinux 性能明显好于 Linux 5.6 内核(红色)。 + +总的来说,性能有所提升,包括开销(从大约 30 MB 提升至大约 15 MB)和文件创建时间(从大约 55 ms 提升至大约 44 ms)。 + +#### 更新的软件包 + +这个版本包含了大量的软件包更新。其中一些比较重要的包括 Git 2.31、PHP 8.0、Perl 5.32 和 MySQL 8.0。GCC 也更新到了 11.2 版本。 + +有了这些更新,它应该是对更多现代标准有更好的兼容性。 + +与上游相比,它也有一些软件包被删除。关于完整的变化列表,请参考 [官方发布说明][5]。 + +### 总结 + +总的来说,我认为 AlmaLinux 9.0 正在成为一个相当不错的版本,特别是当我看到了这个测试版中的改进。 + +AlmaLinux 9.0 测试版可用于 x86_64、arch64、ppc64le 和s390x 等架构。如果你想试用 AlmaLinux 9.0 测试版,请点击下方链接前往它的官网。 + +> [AlmaLinux 9.0 测试版][6] + +请注意,它还没有准备好用于生产服务器,目前仅限于测试使用。 + +你打算从 CentOS 转到 AlmaLinux 吗?请在下面的评论中告诉我们吧! + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/almalinux-9-0-beta-release/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/rhel-based-server-distributions/ +[2]: https://news.itsfoss.com/kernel-5-14-release/ +[3]: https://news.itsfoss.com/wp-content/uploads/2022/04/SELinux-Performance.jpg +[4]: https://www.redhat.com/en/blog/improving-performance-and-space-efficiency-selinux +[5]: https://wiki.almalinux.org/release-notes/9.0-beta.html +[6]: https://mirrors.almalinux.org/isos.html diff --git a/published/202204/20220420 Nushell- Cross-platform Shell That Gives You More Clarity on Error Messages.md b/published/202204/20220420 Nushell- Cross-platform Shell That Gives You More Clarity on Error Messages.md new file mode 100644 index 0000000000..b0a837bd8d --- /dev/null +++ b/published/202204/20220420 Nushell- Cross-platform Shell That Gives You More Clarity on Error Messages.md @@ -0,0 +1,110 @@ +[#]: subject: "Nushell: Cross-platform Shell That Gives You More Clarity on Error Messages" +[#]: via: "https://itsfoss.com/nushell/" +[#]: author: "Marco Carmona https://itsfoss.com/author/marco/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14526-1.html" + +Nushell: 一个让你更清楚地了解错误信息的跨平台 Shell +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/30/181450b5r4m5jb77llrfru.jpg) + +> Nushell 是一个独特的 Shell,它提供易于阅读的错误信息,以及跨平台支持。在这里可以了解到更多关于它的信息。 + +即使你对使用终端不感兴趣,Linux 终端也常常使一些繁重的工作变得更加轻松,以及可以让你修复一些东西。因此,可以说,如果你知道自己在做什么,Linux 终端是相当强大的。 + +这也是事实!但是当你看到一些错误消息就表明出现问题了。如果你没有足够的使用经验,可能不知道如何解决它。 + +虽然这些错误信息试图向你传达该问题的最佳含义,但不是每个用户都能轻易理解该如何修复。对于初学者来说,这通常需要进行一些研究。但是,如果错误能更清晰一些,用户就能更快地解决它。 + +不仅仅限于错误信息,例如,你在终端浏览文件时看到的输出结构,也不是最漂亮的。 + +![Terminal listing several files][1] + +**你明白我的意思吗?** 当然,当你有更多不同类型的文件时,这可能变得更加复杂。而且,你无法从基本的 `ls` 命令的输出中了解到文件的权限、组等。 + +这就是 Nushell 试图解决的问题。 + +### Nushell:一个默认提供用户友好输出的 Shell + +![Nushell example screenshot][2] + +Nushell 也被称为 Nu,它的理念和灵感来自于 [PowerShell][3]、函数式编程语言和现代 [CLI][4] 工具等项目。 + +让我给你举个例子,想象一下你只想让你的输出列出你的主目录内类型为文件的项目,包括隐藏文件。那么,要实现这一点,只要输入下面的命令就可以了: + +``` +ls -a | where type == 'file' +``` + +![Listing only files with Nushell][5] + +观察一下,它的语法是多么清晰和简单。现在想象一下,用 Nushell 查找进程和名称 ID、它的状态,以及 CPU 或内存消耗是多么容易。**这是它魔法的一部分!** + +它会尽力以专门组织的方式为你输入的命令提供适合用户的输出。 + +### Nushell 的特点 + +![Error messages in Nu, one of its primary highlights][6] + +根据现有的官方信息,它的一些最受欢迎的功能包括: + + * **任何操作系统都通过管道进行控制。** Nu 可以在 Linux、macOS 和 Windows 上工作。换句话说,作为一个灵活的跨平台 shell,具有现代感。 + * **一切都是数据。** Nu 管道使用结构化数据,所以你可以安全地选择、过滤和排序,每次都是同样的方式。 + * **强大的插件。** 使用强大的插件系统,很容易扩展 Nu 的功能。 + * **易于阅读的错误信息。** Nu 操作的是类型化的数据,所以它可以捕捉到其他 shell 所没有的错误。当错误发生时,Nu 会告诉你确切的位置和原因。 + * 清晰的 IDE 支持。 + +你可以看看它的 [官方文档][7],以全面了解它的功能和用法。 + +### 在你的系统中安装 Nushell + +不幸的是,如果你是一个像我一样的 Ubuntu 用户,你将找不到安装 Nushell 的 APT 仓库。但是,你可以按照它在 [GitHub][8] 上的说明,通过安装所需的依赖项来构建它。 + +幸运的是,有一种方法可以在任何发行版上安装它,即使用 Homebrew。到它的官方网站去了解更多的安装选项。 + +> **[Nushell][9]** + +你可以参考我们关于 [在 Linux 上安装和使用 Homebrew 包管理器][10] 的教程。当你在 Linux 上成功设置了它,你需要输入以下命令来安装 Nushell: + +``` +brew install nushell +``` + +![Installing nushell with Homebrew][11] + +当这个过程完成后,只要输入 `nu` 就可以启动 Nushell shell。**这就完成了!** + +> 如果你想把 Nushell 设置为你的默认 shell,你可以用命令 `chsh` 来做,但是记住,它仍然在开发阶段,这就是为什么我们不推荐它用于日常使用。 + +然而,在你决定尝试之前,你可以在其网站或 [GitHub 页面][8] 上了解关于它的更多信息。 + +你对这个有趣的 shell 什么看法?请在下面的评论中告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/nushell/ + +作者:[Marco Carmona][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/marco/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/wp-content/uploads/2022/04/Terminal-with-several-files-800x477.png +[2]: https://itsfoss.com/wp-content/uploads/2022/04/Nushell-example-800x475.jpg +[3]: https://itsfoss.com/microsoft-open-sources-powershell/ +[4]: https://itsfoss.com/gui-cli-tui/ +[5]: https://itsfoss.com/wp-content/uploads/2022/04/Listing-only-files-with-nushell-800x246.png +[6]: https://itsfoss.com/wp-content/uploads/2022/04/Error-messages-in-Nu-800x259.png +[7]: https://www.nushell.sh/book/ +[8]: https://github.com/nushell/nushell +[9]: https://www.nushell.sh/ +[10]: https://itsfoss.com/homebrew-linux/ +[11]: https://itsfoss.com/wp-content/uploads/2022/04/Installing-nushell-with-brew-800x470.png diff --git a/published/202204/20220420 Ubuntu Studio 22.04 LTS - New Features and Release Details.md b/published/202204/20220420 Ubuntu Studio 22.04 LTS - New Features and Release Details.md new file mode 100644 index 0000000000..46a8fe08b1 --- /dev/null +++ b/published/202204/20220420 Ubuntu Studio 22.04 LTS - New Features and Release Details.md @@ -0,0 +1,105 @@ +[#]: subject: "Ubuntu Studio 22.04 LTS – New Features and Release Details" +[#]: via: "https://www.debugpoint.com/2022/04/ubuntu-studio-22-04-lts/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14507-1.html" + +Ubuntu Studio 22.04 LTS - 新功能和发布细节 +====== + +![](https://img.linux.net.cn/data/attachment/album/202204/25/101629tf7ur432nma7vara.jpg) + +> Ubuntu Studio 22.04 LTS “Jammy Jellyfish” 的新特性和增强功能列表。 + +[Ubuntu Studio][1] 是 Ubuntu 的官方特色版,专门为那些主要从事图形、音频和视频工作的创作者服务。这个官方发行版在其 ISO 镜像中预装了几乎所有流行的开源创意软件,为你提供了一个现成而稳定的系统来启动你的专业工作。 + +![Ubuntu Studio 22.04 LTS Desktop][2] + +### Ubuntu Studio 22.04 LTS - 新功能 + +像所有的 Ubuntu 官方版本一样,Ubuntu Studio 22.04 LTS 基于 [Ubuntu 22.04 LTS “Jammy Jellyfish”][3]。Linux 内核 5.15 LTS 为 Ubuntu Studio 22.04 提供支持,这是一个稳定的内核,适合目前所有的现代硬件阵容。 + +大多数创造性的工作通常发生在高端和现代的机器上;因此内核版本在 Ubuntu Studio 中是很重要的。[Linux 内核 5.15 LTS][4] 支持英特尔和 AMD 当前的 CPU/GPU 阵容。例如,这个内核带来了用于高带宽 I/O 操作的 AMD PTDMA 驱动和许多基本的更新,这对现代硬件的创造性工作非常重要。 + +除此之外,定制的 [KDE Plasma 5.24][5] 和 KDE Framework 5.92 带来了友好的用户界面和 Ubuntu Studio 的原生深色主题和图标主题。KDE Plasma 桌面被调整为带有快捷方式和必要的系统托盘部件的顶部面板,使所有的专业工作更加流畅。 + +此外,如果你从 Ubuntu Studio 20.04 LTS Focal Fossa 迁移到这个版本,KDE Plasma 是用户将体验到的一个新桌面。因为 Ubuntu Studio 20.04 LTS 是最后一个带有 Xfce 桌面环境的版本。而从那时起,Ubuntu Studio 已经转向了 KDE Plasma 桌面环境,以获得更好的现代技术和性能支持。 + +#### 应用栈 + +Ubuntu Studio 22.04 LTS 的应用栈带来了最新的稳定版本。Studio Controls(Ubuntu Studio 的本地控制中心)升级到了 2.3.0 版本,改进了混音器和插件,并修复了错误。 + +![Studio Controls][6] + +除此之外,图形、视频和音频软件套件也都更新了它们的最新稳定版本。此外,如果你和上一个 LTS 版本做一个功能对比,你可能会注意到功能和改进的大规模升级。主要是针对 Blender、KDenlive 和 Ardour,因为这些超级令人印象深刻的开源应用在开发中非常活跃。 + +不过,我们在这里列出的主要应用并不是完整清单: + + * Blender v3.0.1 (3D 计算机图形) + * KDenlive v21.12.3 (视频编辑) + * Krita v5.0.2 (光栅图形绘制和动画) + * Gimp v2.10.24 (光栅图形绘制) + * Ardour v6.9 ([数字音频工作站][8]) + * Scribus v1.5.7 (桌面出版) + * Darktable v3.6.0 (RAW 图像和照片管理) + * Inkscape v1.1.2 (矢量图形编辑器) + * Carla v2.4.2 (音频插件主机) + * Studio Controls v2.3.0 (音频管理和控制) + * OBS Studio v27.2.3 (流媒体应用) + * MyPaint v2.0.1 (简单绘画) + +此外,Jammy Jellyfish 的重大变化之一是引入了 [Pipewire][9] 0.3.48(与 Focal Fossa 相比)。这种现代音频和视频流服务器技术将帮助许多用户进行高级音频控制。但它可能需要命令行的调整来管理它。我不确定 Studio 团队未来是否会在 Studio 控制工具中带来额外的设置来管理 Pipewire。 + +最后,Ubuntu Studio 团队新设计的标志与 Canonical 的品牌形象相一致,看起来令人印象深刻,在这个版本中非常突出。 + +![Ubuntu Studio New Logo][10] + +### 下载和升级 + +上述所有的应用使得 Ubuntu Studio 22.04 LTS 的 ISO 大小达到了惊人的 4GB 以上(它不能装在一张 DVD 里 ,要用 USB)。如果你想试试,你可以使用下面的链接下载 BETA 镜像。 + +> **[ubuntustudio-22.04-beta-dvd-amd64.iso][11]** + +> **[ubuntustudio-22.04-beta-dvd-amd64.iso.torrent][12]** + +如果你打算从 Ubuntu Studio 20.04 LTS 升级到这个新版本,需要注意一下。由于桌面环境从 Xfce 变为 KDE Plasma,你不应该从 Ubuntu Studio 20.04 LTS 升级到 Ubuntu 22.04 LTS。这种方式不支持。 + +相反,你应该进行全新的安装。重新安装可能会有点复杂和挑战,因为你已经在系统中设置了许多插件、设置和建立了音频和视频工作的工作流程。但我还是建议你这样做,因为这样可以让你在 Ubuntu Studio 22.04 LTS 中清理一下,然后用一套新的应用和桌面环境重新开始。 + +_来自[发布说明][13]。_ + +_专题图片由 Unsplash 上的 [Milad Fakurian][14] 拍摄。_ + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/04/ubuntu-studio-22-04-lts/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://ubuntustudio.org/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/04/Ubuntu-Studio-22.04-LTS-Desktop-1024x631.jpg +[3]: https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/ +[4]: https://www.debugpoint.com/2021/11/linux-kernel-5-15/ +[5]: https://www.debugpoint.com/2022/03/kde-plasma-5-24-review/ +[6]: https://www.debugpoint.com/wp-content/uploads/2022/04/Studio-Controls-1024x453.jpg +[8]: https://www.debugpoint.com/2018/08/3-best-daw-digital-audio-workstation-apps-ubuntu-linux/ +[9]: https://gitlab.freedesktop.org/pipewire/pipewire +[10]: https://www.debugpoint.com/wp-content/uploads/2022/04/Ubuntu-Studio-New-Logo.jpg +[11]: https://cdimage.ubuntu.com/ubuntustudio/releases/22.04/beta/ubuntustudio-22.04-beta-dvd-amd64.iso +[12]: https://cdimage.ubuntu.com/ubuntustudio/releases/22.04/beta/ubuntustudio-22.04-beta-dvd-amd64.iso.torrent +[13]: https://ubuntustudio.org/ubuntu-studio-22-04-lts-release-notes/ +[14]: https://unsplash.com/@fakurian +[15]: https://t.me/debugpoint +[16]: https://twitter.com/DebugPoint +[17]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[18]: https://facebook.com/DebugPoint diff --git a/published/202204/20220421 How to Build a Career in Open Source.md b/published/202204/20220421 How to Build a Career in Open Source.md new file mode 100644 index 0000000000..030f38073b --- /dev/null +++ b/published/202204/20220421 How to Build a Career in Open Source.md @@ -0,0 +1,83 @@ +[#]: subject: "How to Build a Career in Open Source" +[#]: via: "https://www.opensourceforu.com/2022/04/how-to-build-a-career-in-open-source/" +[#]: author: "Navendu Pottekkat https://www.opensourceforu.com/author/navendu-pottekkat/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14521-1.html" + +如何把开源作为一份职业 +====== + +> 你是否对开源充满热情,却不知道如何在这个领域开始一段职业生涯?那么,这篇文章就是为你准备的。 + +![](https://img.linux.net.cn/data/attachment/album/202204/29/083647jjbfm44j4pt774ft.jpg) + +你知道吗?80% 的维护者认为招募新的贡献者是一个挑战,92% 的雇主认为很难雇用到开源人才。而另一方面,52% 的开发者希望为开源做出贡献,33% 的人不知道从哪里开始,31% 的人认为自己不够熟练。公共数据显示,社会对具有开源技能的人有很大的需求。因此,让我们看看如何才能够把开源作为一份职业,以填补这个供需之间的差距吧! + +### 掌握一个技能 + +开源旅程的起点仅仅是你擅长的某个技能罢了。许多开发者会在空闲时间从事开源工作,他们在不熟练的领域投入精力,并把这些技能引入到技术领域里来。像机器学习(ML)、云原生和大数据分析这样的技能是很受欢迎的,因为许多项目都围绕着它们而进行。 + +开发者必须不断尝试,直到找到自己感兴趣的东西为止。例如,当我开始在开源领域工作时,我选择了移动用户界面(UI)和 Web 开发(包括前端和后端)方面的工作。这个选择并不简单,我花了很多时间来弄清楚我想从事什么。因此,重要的是要遵循你的兴趣,通过学习和建立项目来探索不同的领域。很多时候,理论教程可能不如建立实际项目更有帮助。掌握技能的唯一方法是将所学的东西应用到实际项目中。 + +如果你已经在某项技术和项目上投入了很长时间,那么你应该花时间好好分析一下。如果你对这个项目不感兴趣,那么放弃它可能是更好的选择。然而,这也可能是一把双刃剑。有可能你会发现一些感兴趣的东西,从而产生一个新的权衡。如果经过了充分的分析,你也知道了自己倾向于哪些技能组合,那么下一步就是建立自己的项目。 + +### 建立一个项目 + +无论项目的内容如何,只要它是活跃的,就会产生很大的价值。但请记住,一旦它开源了,你千万不要被大家的反应所左右。并且记住,无论你是为一个应用程序建立一个 UI,还是仅仅记录一个适当的注释、资源或 URL 的列表,你的工作都可以对开源用户有很大帮助。 + +在很大程度上,学习不同的工具有助于建立开源项目。因此,学习关于版本控制系统、Git、GitHub 和 GitLab(大多数项目都在它们上面)的一切是很重要的。由于互联网上已经有足够的教程,我只收集了一些可以在 `navendu.me/osidays` 上找到的。你需要通过撰写文档和公开自己学到的内容,来“公开学习”才行。 + +### 打造一份职业 + +你可以通过三种方式在开源领域建立一份职业。 + +#### 构建、扩展你自己的开源项目,并让它盈利 + +如果你想要建立一个自己的项目,发现并解决问题是一个很好的经验法则。记下别人可能面临的问题,一个项目需求就这样产生了。你的项目的市场规模只能通过试验和错误来估计。对于既没有太多资金的、也没有太多经验个人贡献者来说,社交媒体、博客、帖子和会议上的讲话,都会在很大程度上有助于接触到用户。这些平台可以为你的开源项目带来巨大的流量。 + +资金在几乎所有的商业模式中都起着重要作用。Mozilla 基金会依靠自愿捐款来资助其项目。MariaDB 采用了延迟开放源代码的商业模式。IBM 的许多开源项目遵循开放核心的商业模式,即项目的核心部分是开源的,而周围的附加部分是闭源的和专有的。红帽公司不出售代码,而是出售专业服务,如支持、工具和围绕项目的技术援助。这些商业模式的例子可以被采用,以此来建立一个项目,将它开源,并使其盈利。 + +> “即使你不是维护者,也要做维护者的工作。” + +#### 在一个以开源商业模式建立项目的公司工作 + +成为贡献者和维护者社区的一份子,参与会谈和参加会议将有助于你为项目做出贡献。你可以根据引导来完成第一次贡献,但它不一定得是代码。一个大的代码库可能看起来很吓人,但关键是要从小的地方着手。找到一个问题并解决它,这将有助于你了解贡献流程、代码库和项目设置等。 + +非代码的贡献也是有价值的。擅长写作的人可以通过撰写文档,或者为社交媒体写作来贡献。擅长设计的人,可以设计一个模板、一个颜色方案,或者也可以致力于创造一个更好的用户界面。与资深工程师相比,新人发现错误的概率很高。他们可以测试、确认并报告他们的用户体验,从而提升项目质量。另一个领域是新手引导,很多开源项目将导师和新手联系起来,并帮助后者做出重要贡献。还有一个选择是成为组织者或社区管理员,这意味着你将承担起项目经理的角色,确保功能完全按照预期交付,路线图得到遵循,贡献者得到照顾。大多数开源项目缺乏适当的管理,因为工程师们都不喜欢做这一类工作。 + +社会上有很多实习项目可以帮助你赚钱,比如谷歌的编程之夏(GSoC)和 Linux 基金会的导师制(在这里,被指导者有津贴,可以根据需要全职或兼职工作)。如果你能很好地发展你的技能,你可以在你实习的公司获得一个全职的职位。例如,如果你在红帽公司的一个项目中工作,你有机会被全职雇用,因为你在那里已经有了知名度。 + +正如 NumPy、SciPy 和 Anaconda 的作者 Travis Oliphant 所说,“建立一个开源项目,让人们为它做出贡献,然后从他们当中招聘。” —— 这也是我获得全职工作的方式。 + +* 随着时间的推移,你所做贡献的质量和数量会不断提升。最好长期参与一个项目,因为这样可以发现更多的贡献领域。投身进去做贡献会让人们注意到并认可你。 +* 开源项目缺乏项目经理,因此成为项目经理将有助于你的职业生涯。 +* 成为一个维护者,做一些工程师应该做的事情,如审阅代码、设计系统、撰写文档和帮助他人做出贡献。 +* 好的贡献的关键是“提前付出”,这意味着你需要通过分享经验和智慧来帮助新人,并确保他们不犯错误。 + +#### 获得赞助以从事开源工作 + +作为个人,如果你正在为某个公司建立的项目而工作,你可以要求获得资助。值得注意的是,只有当你的贡献很大时,组织才会乐意赞助你。但是,如果你建立了自己的项目,并且有大量的用户群,你可以向用户要求资助。 + +作为一个组织,你可以通过像 Open Collective、Patreon 和 GitHub Sponsors 这样的平台来筹集资金,让人们为你的项目捐款。像 Linux 基金会和 Mozilla 基金会这样的开源巨头也提供资金来支持项目。GitHub 已经给 15 个印度贡献者的项目提供了资助。 + +我曾经花了三个月时间建立了一个开源项目。这个项目后来被 《Product Hunt》 和 《JS Weekly》报道,还在上过 GitHub 趋势榜排名第一的位置。正是这个项目让我走上了开源事业的道路。 + +*本文由 Sharon Abhignya Katta 转录并策划* + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/04/how-to-build-a-career-in-open-source/ + +作者:[Navendu Pottekkat][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/navendu-pottekkat/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Target-Achievement-and-Teamwork-Business-Concept-696x607.jpg diff --git a/published/202204/20220421 Ubuntu 22.04 LTS is Now Available for Linux Desktop and Raspberry Pi.md b/published/202204/20220421 Ubuntu 22.04 LTS is Now Available for Linux Desktop and Raspberry Pi.md new file mode 100644 index 0000000000..fdbcfd7e97 --- /dev/null +++ b/published/202204/20220421 Ubuntu 22.04 LTS is Now Available for Linux Desktop and Raspberry Pi.md @@ -0,0 +1,184 @@ +[#]: subject: "Ubuntu 22.04 LTS is Now Available for Linux Desktop and Raspberry Pi" +[#]: via: "https://news.itsfoss.com/ubuntu-22-04-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14496-1.html" + +Ubuntu 22.04 LTS 发布! +====== + +> Ubuntu 22.04 LTS 带来了许多惊喜,还带来了 GNOME 42,以及 Canonical 的新品牌/标志。 + +![](https://news.itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-release.jpg) + +迫不及待地想尝试 Ubuntu 22.04 LTS?那么,它终于可以下载和升级了。(LCTT 译注:升级还要等几天,还存在一些小问题) + +它带来了 [大量令人印象深刻的功能][1],其中 GNOME 42 和树莓派桌面支持是其主要亮点。 + +现在,它已经就绪。在你决定尝试之前,让我们花点时间来看看这个版本最重要的变化。 + +### Ubuntu 22.04 LTS 的新变化 + +Ubuntu 22.04 是一次主要版本升级,其包括了桌面环境的改进、视觉上的变化和一些新增的功能。 + +如果你正在使用 Ubuntu 20.04 LTS,想知道它们之间的区别,你可以查看我们的《[Ubuntu 20.04 vs Ubuntu 22.04 LTS][2]》文章来了解。 + +毫无疑问,这是一个 [长期支持][3]Long-Term Support (LTS)版本。所以,你可以期待它维护更新到 2027 年,也就是五年的支持。一些最显著的变化包括: + +#### 1、强调色的选择 + +虽然大多数基于 Ubuntu 的 Linux 发行版提供了设置强调色的功能,但你必须使用 [GNOME 优化][4]GNOME Tweaks 才能做到。 + +![][5] + +现在,在 Ubuntu 22.04 中,你可以轻松地设置你所选择的强调色,它会影响到文件夹、通知区和桌面体验的其他元素。 + +#### 2、GNOME 42 + +![][6] + +期待已久的桌面环境升级来了。虽然 Ubuntu 22.04 的 GNOME 实现并不提供水平停靠区,但会有其它好处加成。 + +你应该能够在 Ubuntu 22.04 LTS 中体验到所有 [GNOME 42 的优点][7]。不幸的是,你仍然会发现几个版本号是 41 的应用程序。 + +开发者提到,他们需要更多的时间来测试使用 [libadwaita][8] 的应用程序。 + +话虽如此,在你继续阅读时,我也会提到 GNOME 42 所带来的有趣的更多功能。 + +#### 3、新的屏幕截图工具 + +![][9] + +与 Ubuntu 20.04 LTS 不同,你不能用 `PrtScrn`(或任何其他指定的快捷键)来直接抓拍全屏图片。 + +相反,如果你按下快捷键来截图,就会弹出来这个新的截图工具。 + +这不仅体验更加直观,而且还支持屏幕录制。因此,这是一个相当令人激动的变化! + +#### 4、深色模式的改进 + +虽然我们已经有了深色模式,但它并不是一个完美的系统级实现。 + +感谢 [elementary OS 6][10],GNOME 42 受到启发,实现了系统级的深色模式,更好地融合在一起以保持一致性。 + +![][11] + +#### 5、Firefox 变成了 Snap 版本 + +![][12] + +从 deb 包到 Snap 的过渡已经进行了一段时间了。 + +在 Ubuntu 22.04 中,Firefox 现在将默认以 Snap 包出现,在 Mozilla 的共同努力下,旨在推动更快的安全更新,并确保无需维护许多东西即可实现跨发行版的支持。 + +沙盒化的 Firefox 体验也应该可以提供更好的安全性。 + +你可以在这个 [论坛帖子][13] 中阅读更多关于该决定背后的信息。 + +#### 6、桌面图标出现在底部 + +![][14] + +默认情况下,桌面图标可以在右上角的区域看到,靠近停靠区。 + +现在,在 Ubuntu 22.04 中,默认的桌面图标位置已经被改为底部。你可以通过“外观Appearance”设置中的选项来改变这一点。 + +#### 7、缩小停靠区的能力 + +如果你不喜欢停靠区占据了整个左侧区域,你可以改变它。 + +你需要禁用“外观Appearance”调整中停靠区设置下的“面板Panel”模式,如下图所示: + +![][15] + +这将分离出停靠区,并提供现代桌面体验的浮动效果。 + +#### 8、树莓派桌面支持 + +Ubuntu 22.04 是第一个也可用于树莓派的桌面 LTS 版本。 + +随着 [zswap 的引入][16],树莓派的性能应该会在 Ubuntu 22.04 中得到显著提升。 + +它甚至可以 [在 2GB 的树莓派 4 变体型号上运行][16]。你可以在你的树莓派上测试这些改进。 + +#### 9、使用 Ubuntu Advantage + +![][17] + +Ubuntu Advantage 是为企业和商家提供的高级订阅,无需重新启动即可获得重要的安全更新。 + +对于大多数桌面用户来说,这不是什么有用的东西。然而,如果你想获得 Ubuntu Advantage 订阅,并将你的系统接驳到它,你可以通过导航到“软件 & 更新Software & Updates”下的 Livepatch 部分轻松做到这一点。 + +#### 10、Linux 内核 5.17 和 Linux 内核 5.15 LTS + +[Linux 内核 5.15 LTS][18] 是一个重要的升级,它改进了 NTFS 驱动,对即将到来的英特尔独立显卡提供了初步支持,并有更多的性能改进。 + +对于你的桌面计算机,你应该注意到 Linux 内核 5.15 开箱即用。 + +Ubuntu 服务器版也采用了 Linux 内核 5.15 LTS。 + +然而,Ubuntu 22.04 也在最新一代认证设备(OEM)上使用了 [Linux 内核 5.17][19]。 + +因此,在这个版本中,Ubuntu 根据产品的不同打包了多个内核。 + +#### 11、RISC-V 的现场镜像 + +从 Ubuntu 22.04 开始,你会发现单独的可用 RISC-V 架构的现场镜像live image。 + +#### 其他变化 + +除了上面提到的主要变化外,升级后的其他一些重大变化包括。 + + * 较新的软件包,如 OpenSSL 3.0、Ruby 3.0、Python 3.10、PHP 8.1 等。 + * 更新的应用程序,包括 Firefox 99、LibreOffice 7.3 和Thunderbird 91。 + +你可以看一下它的 [官方发布说明][20] 来探索所有的技术变化。 + +### 下载或升级到 Ubuntu 22.04 LTS + +如果你想通过使用 ISO 进行全新安装来体验新的 LTS 版本,请前往下面链接的官方网站进行下载。 + +> [下载 Ubuntu 22.04 LTS][21] + +而当它的更新可用时,你可以参考我们的 [升级指南][22]。 + +> **注意:** 你可以进行全新的安装,但是你还不能升级到 Ubuntu 22.04 LTS(由于 snapd 和 update-notifier 软件包的错误有待修复)。你应该在接下来的几天里收到更新通知。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-22-04-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-22-04-release-features/ +[2]: https://itsfoss.com/ubuntu-20-04-vs-22-04/ +[3]: https://itsfoss.com/long-term-support-lts/ +[4]: https://itsfoss.com/gnome-tweak-tool/ +[5]: https://news.itsfoss.com/wp-content/uploads/2022/03/ubuntu-22-04-accent-change.jpg +[6]: https://news.itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-desktop.jpg +[7]: https://news.itsfoss.com/gnome-42-release/ +[8]: https://news.itsfoss.com/gnome-libadwaita-library/ +[9]: https://news.itsfoss.com/wp-content/uploads/2022/03/ubuntu-22-04-screenshot-ui.jpg +[10]: https://news.itsfoss.com/elementary-os-6-features/ +[11]: https://news.itsfoss.com/wp-content/uploads/2022/03/ubuntu-22-04-dark-mode.png +[12]: https://news.itsfoss.com/wp-content/uploads/2022/03/firefox-as-snap.png +[13]: https://discourse.ubuntu.com/t/feature-freeze-exception-seeding-the-official-firefox-snap-in-ubuntu-desktop/24210 +[14]: https://news.itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-desktop-icon.jpg +[15]: https://news.itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-dock-shrink.jpg +[16]: https://news.itsfoss.com/ubuntu-desktop-raspberry-pi-4/ +[17]: https://news.itsfoss.com/wp-content/uploads/2022/04/ubuntu-livepatch.jpg +[18]: https://news.itsfoss.com/linux-kernel-5-15-release/ +[19]: https://news.itsfoss.com/linux-kernel-5-17-release/ +[20]: https://discourse.ubuntu.com/t/jammy-jellyfish-release-notes/24668 +[21]: https://ubuntu.com/download/desktop +[22]: https://itsfoss.com/upgrade-ubuntu-version/ diff --git a/published/202204/20220422 Experience Ubuntu Unity 22.04 LTS With These New Features.md b/published/202204/20220422 Experience Ubuntu Unity 22.04 LTS With These New Features.md new file mode 100644 index 0000000000..1cfdf2381a --- /dev/null +++ b/published/202204/20220422 Experience Ubuntu Unity 22.04 LTS With These New Features.md @@ -0,0 +1,97 @@ +[#]: subject: "Experience Ubuntu Unity 22.04 LTS With These New Features" +[#]: via: "https://www.debugpoint.com/2022/04/ubuntu-unity-22-04-lts/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14516-1.html" + +Ubuntu Unity 22.04 LTS 新功能体验 +====== + +> Ubuntu Unity 22.04 LTS 中的新功能和软件包,带来了精心策划的 Unity 桌面。 + +Ubuntu Unity 是 Ubuntu 的一个非官方版本,提供了 Unity 桌面环境。Unity 桌面环境是由 Canonical 在十年前创建的,而后在 Ubuntu 18.04 “Bionic Beaver” 发布后被 [放弃了][1],Ubuntu 转而使用了 GNOME 桌面。随着 Ubuntu 22.04 LTS 的发布,Ubuntu Unity 的小团队发布了 Ubuntu Unity 22.04 LTS Linux 发行版。 + +![Nice and Clean Ubuntu Unity 22.04 LTS][2] + +### Ubuntu Unity 22.04 LTS - 新功能 + +抛开历史不谈,Ubuntu Unity 22.04 LTS 带来了 Unity7 桌面环境,并与 Jammy Jellyfish 版本保持了一致的变化。该版本的核心是基于 [Ubuntu][3] 的底层软件包和 [Linux 内核 5.15][4] 。Linux 内核 5.15 支持所有主流的 GPU、CPU 和其他硬件阵容,让你可以在你的硬件上自由使用这个发行版。 + +此外,在此版本中自然有 Unity 桌面的主要魅力所在,即搜索应用的全局 HUD 和所有应用都有的全局菜单。也许,很多人喜欢 Unity 就是因为它的全局 HUD(通过 `META` 键启动),这是一个搜索、启动或做任何事情的单一入口点。 + +![Global HUD in Ubuntu Unity 22.04][5] + +它基本上就像是 KDE Plasma 中的 [KRunner][6]。另外,它的全局菜单使应用看起来更漂亮,并节省了宝贵的屏幕空间。而且,该团队还为 Unity 桌面带来了定制的 Yaru 主题,有浅深两款。 + +![Global Menu in Ubuntu 22.04 with LibreOffice Calc][7] + +除此之外,应用列表也有些不同,与基本的 Ubuntu GNOME 版本相比,它提供了各种基本用途的应用。比如,它用 Nemo 文件管理器代替了 GNOME 中的 “文件”,以及来自 MATE 桌面软件包的 Pluma 文本编辑器。 + +不包括 Nautilus/“文件” 是明智的,因为要做全部的 GTK4 和 libadwaita 移植工作。对于 Unity 桌面来说,这需要太多的工作,而其他的解决方案也可以有效地工作。 + +此外,在 Ubuntu Unity 22.04 LTS 中使用了 GNOME “软件” 41.5,安装和删除软件变得很容易。虽然它是一个 GNOME 41+ 系列的应用,但在 Unity 桌面外观下,它看起来很优雅。但它没有全局菜单,因为它的软件设计原则本身就没有传统的文件菜单栏。 + +#### 外观和感觉 + +但这还不是全部。Unity 桌面为你提供了大量的自定义选项,通过外观设置来选择基础主题、启动器图标大小和位置,以及其他 Unity 桌面的基本设置。如需进一步配置,你可以得到预装的 Unity Tweak 工具,它为你提供了更多额外的选项,使你的桌面成为你想要的样子。 + +最后,在这个版本中,以官方吉祥物 Jammy Jellyfish 为特色的一组迷人的墙纸为整个 Unity 桌面体验增色不少。 + +![Unity Tweak Tool][9] + +### 总结和下载 + +作为总结,下面是 Ubuntu Unity 22.04 版本中的应用组合: + + * 基于 Ubuntu 22.04 LTS “Jammy Jellyfish” + * Linux 内核 5.15 + * Unity 7.5.1 + * Flatpak 和 Flathub 作为默认安装方式 + * Nemo 文件管理器 5.2.4 + * Atril 文档浏览器 1.26 + * Pluma 文本编辑器 1.26 + * VLC 媒体播放器 3.0.16 + * EOM(Eye of MATE)图像查看器 1.26 + * MATE 系统监视器 + * Firefox 99(Snap) + * LibreOffice 7.3.2.2 + * Unity Tweak Tool + +最后,如果你想重温 Unity 的美好时光,可以从以下链接下载官方 ISO。 + +> **[下载 Ubuntu Unity][10]** + +不要忘记以任何能力为官方项目做出贡献,以帮助团队继承伟大的 Unity 桌面概念的遗产。 + +_参考自 [公告][11]_ + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/04/ubuntu-unity-22-04-lts/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://ubuntu.com/blog/growing-ubuntu-for-cloud-and-iot-rather-than-phone-and-convergence +[2]: https://www.debugpoint.com/wp-content/uploads/2022/04/Nice-and-Clean-Ubuntu-Unity-22.04-LTS-1024x576.jpg +[3]: https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/ +[4]: https://www.debugpoint.com/2021/11/linux-kernel-5-15/ +[5]: https://www.debugpoint.com/wp-content/uploads/2022/04/Global-HUD-in-Ubuntu-Unity-22.04-1024x574.jpg +[6]: https://www.debugpoint.com/2021/12/kde-plasma-hidden-feature/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/04/Global-Menu-in-Ubuntu-22.04-with-LibreOffice-Calc-1024x574.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/04/Unity-Tweak-Tool.jpg +[10]: https://ubuntuunity.org/download/ +[11]: https://ubuntuunity.org/blog/ubuntu-unity-22.04/ +[12]: https://t.me/debugpoint +[13]: https://twitter.com/DebugPoint +[14]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[15]: https://facebook.com/DebugPoint diff --git a/published/20220414 A guide to JVM parameters for Java developers.md b/published/20220414 A guide to JVM parameters for Java developers.md new file mode 100644 index 0000000000..bc2cceb4e2 --- /dev/null +++ b/published/20220414 A guide to JVM parameters for Java developers.md @@ -0,0 +1,224 @@ +[#]: subject: "A guide to JVM parameters for Java developers" +[#]: via: "https://opensource.com/article/22/4/jvm-parameters-java-developers" +[#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar" +[#]: collector: "lkxed" +[#]: translator: "Veryzzj" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14553-1.html" + +面向 Java 开发人员的 JVM 参数指南 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/06/134624iiubdjkqmxaaqhmx.jpg) + +> 通过理解和使用 JVM 以及 JVM 参数,开发人员和最终用户都可以诊断故障并且提高 Java 应用程序的性能。 + +当你在编写源代码时,你是在编写人类可以阅读的代码。在将代码编译成机器语言之前,计算机无法执行它。机器语言是一个通用术语,指的是特定机器所需的任意数量的语言。通常,如果你在 Linux 上编译代码,它只能 Linux 上运行;如果你在 Windows 上编译代码,它就只在 Windows 上运行。但是,Java 是不同的,它并不以真实的机器为目标,而是面向 Java 虚拟机Java Virtual Machine(JVM)。因此,它可以在任何机器上运行。 + +Java 源代码被编译成字节码bytecode,然后由安装在计算机上的 JVM 运行。JVM 是一个执行引擎,但我们通常不会直接与它交互。它在后台静默运行,替我们处理 Java 字节码。大多数人不需要考虑,甚至也不需要知道 JVM。但是,了解它的工作原理是对我们来说是非常有用的,因为这会有助于我们调试和优化 Java 代码。例如: + +* 在生产环境中,你发现已经部署的应用程序可能需要提升性能。 +* 如果你写的应用程序出错了,开发人员和最终用户都可以选择对问题进行调试。 +* 如果你想了解关于 JDK(即 Java 开发工具包Java Development Kit,用于开发/运行 Java 应用程序)的详细信息,你可以通过查询 JVM 来获取。 + +本文介绍了一些基础的 JVM 参数,希望在这些场景中可以提供帮助。 + +![JVM 参数][2] + +(图源:Jayashree Huttanagoudar,CC BY-SA 4.0) + +### JVM、JDK 和 JRE 有什么不同? + +Java 有许多 J 开头的缩略词,包括 JVM、JDK 和 JRE。 + +* Java 开发工具包Java Development Kit(JDK)可供需要在代码中使用开发库的程序员使用。 +* Java 运行时环境Java Runtime Environment(JRE)可供想运行 Java 应用程序的人使用。 +* Java 虚拟机Java Virtual Machine(JVM)是运行 Java 字节码的组件。 + +JDK 同时包含 JRE 和 JVM,但有些 Java 发行版提供了包含 JRE(包括 JVM)的替代下载。 + +![JDK][3] + +(图源:Jayashree Huttanagoudar,CC BY-SA 4.0) + +Java 是开源的,因此,许多不同的公司都会构建和发行他们自己的 JDK 发行版。你可以在系统上安装多个 JDK,这会对你参与或者运行不同的 Java 项目时很有帮助,因为其中一些项目可能使用旧版本的 JDK。 + +你可以使用 `alternatives` 命令,来查看 Linux 系统上的 JDK 列表: + +``` +$ alternatives --config java +There are 2 programs that provide java. +Selection Command +----------------------------------------------- +*+ 1 java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-2.fc35.x86_64/bin/java) +2 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-2.fc35.x86_64/jre/bin/java) + +Enter to keep the current selection[+], or type selection number: +``` + +如果想要在可用的 JDK 之间进行切换,请再次执行该命令: + +``` +$ sudo alternatives --config java +``` + +或者可以使用 [SDKMan][4],它可以下载、更新和管理系统中的所有 JDK。 + +### 什么是 JVM 调优? + +JVM 调优指的是,通过调整 JVM 参数,来提高 Java 应用程序性能的过程,它还有助于诊断应用程序的故障。 + +通常情况下,在调试之前需要考虑以下几点: + +* **成本**:有时改进运行代码的硬件可以提高应用程序的性能。这可能看起来像是在“作弊”,但请考虑你愿意花多少时间调整 JVM 参数。有时应用程序需要更多的内存来执行所需的功能,而这点是任何软件技术都无法改变的。 +* **期望结果**:长期来看,稳定性比性能更重要。如果你的调优对稳定性产生了影响,那么谨慎地选择你的调优参数可能会更好。 +* **底层问题**:有时,问题可能是主机操作系统的底层问题。那么,在调整 JVM 之前,请确保 JVM 平台按预期工作。 +* **内存泄漏**:如果你在使用垃圾回收(GC)调优参数,那么,应用程序代码中很可能会存在需要修复的内存泄漏。 + +### 参数类型 + +JVM 参数可以分为以下三类:标准参数、非标准参数和高级选项。 + +#### 标准参数 + +所有的 JVM 实现都支持标准参数,在终端执行 `java` 命令来查看标准参数列表: + +``` +$ java +Usage: java [options] [args...] + (to execute a class) + or java [options] -jar [args...] + (to execute a jar file) + + where options include: + + -cp + -classpath + --class-path + A : separated list of directories, JAR archives, + and ZIP archives to search for class files. + --enable-preview + allow classes to depend on preview features of this release + +To specify an argument for a long option, you can use --= or +-- . +``` + +这些是所有 JVM 都会包含的标准参数,你可以像使用任何 [命令行选项][5] 一样安全地使用它们。例如,要验证配置的命令选项,创建 VM 并加载主类而不执行主类,请使用: + +``` +$ java --dry-run +``` + +#### 非标准参数 + +非标准选项以 `-X` 开头。这些是通用的,并且特定于 JVM 的特定实现。要列出这些参数,请输入: + +``` +$ java -X +-Xbatch disable background compilation +-Xbootclasspath/a: +append to end of bootstrap class path +-Xinternalversion +displays more detailed JVM version information than the +-version option +-Xloggc: log GC status to a file with time stamps +[...] +``` + +在这些参数可能会不经通知就发生变化。而且,并非所有 JVM 实现都支持这些参数。 + +微软构建的 JVM 可能与 RedHat 构建的 JVM 有不同的参数,诸如此类。 + +要获取详细的 JVM 版本信息,请使用如下命令: + +``` +$ java -Xinternalversion --version +OpenJDK 64-Bit Server VM (11.0.13+8) for linux-amd64 JRE (11.0.13+8), built on Nov 8 2021 00:00:00 by "mockbuild" with gcc 11.2.1 20210728 (Red Hat 11.2.1-1) +``` + +要获取这些属性设置,请使用: + +``` +$ java -XshowSettings:properties --version +``` + +#### 高级选项 + +这些参数不是随意使用的,而是用于调整 Hotspot VM 的特定区域。这些参数可能会发生变化,并且不能保证得到所有 JVM 实现的支持。 + +这些参数以 `-XX` 开头。如需列出参数列表,使用如下命令: + +``` +$ java -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version +``` + +例如,需要跟踪类的加载,那么使用下面的命令: + +``` +$ java -XX:+TraceClassLoading Hello +``` + +在 `Hello.java` 中: + +``` +public class Hello { + public static void main(String[] args) { + System.out.println("Inside Hello World!"); + } +} +``` + +另一个可能会面临的问题是 OOM(内存超出Out Of Memory)错误,它发生的时候可能没有太多的调试信息。为了解决这个问题,使用调试参数 `-XX:+HeapDumpOnOutOfMemoryError`,它可以创建一个带有调试信息的 `.hprof` 文件。 + +``` +// TestClass.java +import java.util.ArrayList; +import java.util.List; + +public class TestClass { + public static void main(String[] args) { + List list = new ArrayList(); + for (int i = 0; i < 1000; i++) { + list.add(new char[1000000]); + } + } +} +``` + +``` +$ Javac TestClass.java +$ java -XX:+HeapDumpOnOutOfMemoryError -Xms10m -Xmx1g TestClass +java.lang.OutOfMemoryError: java heap space +Dumping heap to java_pid444496.hprof ... +Heap dump file created [1018925828 bytes in 1.442 secs] +Exception in thread "main" java.lang.OutOfMemoryError: java heap space +at TestClass.main(TestClass.Java:8) +``` + +[有一些工具][6] 可以查看这个 `.hprof` 文件以了解问题所在。 + +### 总结 + +通过了解和使用 JVM 以及 JVM 参数,开发人员和终端用户都可以诊断故障并提高 Java 应用程序的性能。下次使用 Java 时,请花点时间看看有哪些参数可以用吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/4/jvm-parameters-java-developers + +作者:[Jayashree Huttanagoudar][a] +选题:[lkxed][b] +译者:[Veryzzj](https://github.com/Veryzzj) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jayashree-huttanagoudar +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/lenovo-thinkpad-laptop-window-focus.png +[2]: https://opensource.com/sites/default/files/2022-03/java-jvm-parameters.jpg +[3]: https://opensource.com/sites/default/files/2022-03/jdk.jpg +[4]: https://opensource.com/%5Bhttps%3A//opensource.com/article/22/3/manage-java-versions-sdkman%5D%28https%3A//opensource.com/article/22/3/manage-java-versions-sdkman%29 +[5]: https://opensource.com/%5Bhttps%3A//opensource.com/article/21/8/linux-terminal%5D%28https%3A//opensource.com/article/21/8/linux-terminal%29 +[6]: https://opensource.com/%5Bhttps%3A//docs.oracle.com/javase/7/docs/technotes/tools/share/jhat.html%5D%28https%3A//docs.oracle.com/javase/7/docs/technotes/tools/share/jhat.html%29 diff --git a/published/20220419 Difference Between Ubuntu 22.04 and Ubuntu 20.04 LTS.md b/published/20220419 Difference Between Ubuntu 22.04 and Ubuntu 20.04 LTS.md new file mode 100644 index 0000000000..6e1fff8fbd --- /dev/null +++ b/published/20220419 Difference Between Ubuntu 22.04 and Ubuntu 20.04 LTS.md @@ -0,0 +1,171 @@ +[#]: subject: "Difference Between Ubuntu 22.04 and Ubuntu 20.04 LTS" +[#]: via: "https://www.debugpoint.com/2022/04/difference-ubuntu-22-04-20-04/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "PeterPan0106" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14572-1.html" + +Ubuntu 22.04 LTS 和 20.04 LTS 之间的十大变化 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/10/155537gcaaaupqayf5lnua.jpg) + +> 这里为准备从 20.04 LTS 迁移到 22.04 LTS 的用户列出了十个最重要的变化。 + +如果你是一位 [Ubuntu 20.04 LTS “Focal Fossa”][1] 用户,并准备迁移到 [Ubuntu 22.04 LTS “Jammy Jellyfish”][2],这篇文章将为你提供一些指引。在这两个 LTS 版本之间存在巨大的结构性变化,这在 LTS 分支中一般比较罕见。对比下来,不难发现本次更新一次性改变了大量的内容。 + +了解了这一点之后,本文将针对普通用户关切的方面,列出十个发生根本性变化的特性,并为用户提供一些指引。 + +### Ubuntu 22.04 LTS 与 Ubuntu 20.04 LTS – 特性变化 + +#### 1、徽标、颜色和 Plymouth 动画 + +第一个你会注意到的视觉变化便是基调颜色相比早期的两个“棕橙色”变得更“橙色”。同时 Canonical 对徽标进行了修改,这一点体现在开机时 Plymouth 动画中。新的徽标乍一看会显得有些怪异,但看久了会比较顺眼,至少我认为这是一个十分与众不同的徽标。 + +![New Ubuntu logo and Plymouth][3] + +#### 2、安装 + +Ubuntu 的默认安装程序并没有看到太多变化。我们其实更希望最新的 [基于 Flutter 的安装程序][4] 能够最终落地,但并没有。基于此,整体安装流程并未发生变化。我仅能够观察到对话框和按钮的强调色发生了变化。从功能角度而言,安装流程并未发生任何变化。 + +![Colour differences between two LTS Versions][5] + +#### 3、锁屏与登录界面、桌面的初始界面以及壁纸 + +锁屏与登录界面的渐变变得更为精细,密码框采用了无边框设计。初次登录时的布局和壁纸发生了很大的变化。桌面的 “家目录” 快捷方式被重命名为 “Home”,而非你的用户名,但回收站快捷方式则移到了左侧的任务栏中,并用分隔符与其他任务栏图标隔开了。 + +除此之外,顶部状态栏并未大改。系统托盘的菜单则进行了细微的修正,布局更为宽松。这些变化主要来自于 [GNOME 42][6] 的变化。 + +日历菜单并未发生变化。 + +![Ubuntu 20.04 Vs Ubuntu 22.04 – Login Screen][7] + +![Ubuntu 20.04 Vs Ubuntu 22.04 – Lock Screen][8] + +![Difference between Ubuntu 20.04 and Ubuntu 22.04 – default look][9] + +#### 4、桌面布局和 GNOME 版本升级 + +一个十分明显的变化就是 GNOME 版本由 GNOME 3.36 升级到了 GNOME 42。这是所有升级用户都会看到的显而易见的升级。Ubuntu 22.04 LTS 搭载的 GNOME 42 带来了水平的工作区视图以及水平的应用视图。所以,迁移之后手势从垂直转变为水平会有一些不习惯,但用一段时间就好了。 + +如果你的设备是触控屏的笔记本电脑或屏幕,经过一点学习之后,新的 GNOME 42 手势会给你十分顺滑的使用体验。以下是桌面、应用和工作区的对比图。 + +![Activities View Difference – Ubuntu 20.04 and 22.04][10] + +![Application View Difference – Ubuntu 20.04 and 22.04][11] + +#### 5、新的强调色与显示样式 + +有一个我非常喜欢的变化是最新的浅色和深色主题。早先 Ubuntu 有三个选择:浅色、深色和混合(标准)。这在 GNOME 42 中发生了改变,因为其本身就带有内置的浅色和深色模式。另一方面,它还引入了一个新的强调色选项(这并不是原本的 GNOME 42 带来的),允许用户在全局进行自定义。 + +当然,你还不能像 KDE Plasma 一样选择自定义的强调色。这些变化大多来自于最近的 libadwaita 和 GTK4 对 GNOME Shell 和原生应用程序的移植。 + +而当你在 Ubuntu 22.04 LTS 中打开深色模式,它会自动应用于所有支持的应用,这是一个与 Ubuntu 20.04 LTS 十分显著的区别。 + +![Accent Color and other changes][12] + +![How Accent colour change impact looks in Ubuntu 22.04 LTS][13] + +#### 6、文件管理器 + +在这个版本中,文件管理器的版本由 3.36.x 升级到了 42。区别是你能看到更为紧凑的设计、在文字和选项之间更为合理的布局,以及顶部控制栏的小工具风格,这一切都归功于 GTK4 和对底层错误的修复。文件中的地址栏有些不同,目录之间有一个分隔符,而汉堡菜单在最后。当然,这些变化都较为细微,你可能不会感受到它们之间有什么不同。 + +![Files Difference – Ubuntu 20.04 vs 22.04][14] + +#### 7、截图工作流的变化 + +另一个值得注意并且需要用户进行学习的是截图方式的改变。它完全改变了。早先你按下 `Print Screen` 键时,会自动截图并保存到图片文件夹中。现在有了 GNOME 42 内置的截图和录屏工具,工作流程被完全改变。 + +当你在截图时,你会发现有三个选项,你可以选择某个区域、全屏截图或者特定窗口。更重要的是,你还能选择是否让光标出现在截图中,此外还有录屏功能可选。选择完成之后点击“捕捉”按钮,这张图片将在被保存到图片文件夹,并同时复制到你的剪切板。 + +![New Screenshot tool in Ubuntu 22.04 LTS][16] + +总体而言,相较于之前多了一个步骤。 + +在所有应用程序窗口顶部的右键菜单上,增添了一个新的截图选项。 + +![Take Screenshot option in top bar menu][17] + +#### 8、 Firefox 浏览器成为了 Snap 版本 + +此外,Firefox 浏览器在本次更新中变成了 Snap 版本。而此前在 20.04 LTS 中,Firefox 浏览器以 deb 包形式呈现。这对于一般用户而言区别不大。 + +但是 Firefox 浏览器的 Snap 沙箱运行模式使得安装 GNOME 扩展工具时会产生问题,同时在同等硬件条件之下相较于之前的版本会显得更慢。 + +这个最为常用的应用的 Snap 迁移所带来的后续影响我们将拭目以待。 + +#### 9、不同的设置窗口 + +在设置中出现了一个新的面板:多任务。多任务面板允许你调整触发角以及激活窗口边缘。此外你可以指定工作区的数量,并设置自动删除空的工作区。而针对多显示器用户,现在可以选择仅在主屏幕上显示工作区或是在所有屏幕上显示工作区。 + +![New Multitasking Panel in Settings][18] + +#### 10、主题和应用更新 + +此外,软件的变化带来了不同的响应式外观并能够适应任何形式。软件商店同时带来了新的界面,包含了按照类别分类的软件视图以及“编辑之选”栏目。 + +应用详情页面变得更加易读,重要的信息,例如总下载大小、评分、安全标记以及应用截图都以更可辨别地方式呈现。 + +![GNOME Software – Home page difference][19] + +![GNOME Software – Details page difference][20] + +最后,这两个版本的内部差异出现在软件包、官方桌面环境主题和错误修正上。下面是对重要软件包版本变化的一个对比: + +**20.04** | **22.04** +---|--- +GCC 10.3 | GCC 11.2 +Hplip 3.20.3 | Hplip 3.21.12 +LibreOffice 6.4.7 | LibreOffice 7.3.2 +(未引入) | Pipewire 0.3.48 +Python3 3.8.2 | Python3 3.10.1 +Samba 4.13 | Samba 4.15 +Systemd 245.4 | Systemd 249.11 + +### 总结 + +总而言之,这是 Ubuntu LTS 分支历次更新中变化最大的一次,不论是从视觉上还是特性角度。 + +我希望这个指南能够令读者了解两个版本之间的主要区别,以及应当预期什么样的使用体验。 + +祝好~ + +------ + +via: https://www.debugpoint.com/2022/04/difference-ubuntu-22-04-20-04/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[PeterPan0106](https://github.com/PeterPan0106) +校对:[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/lujun9972 +[1]: https://www.debugpoint.com/2021/08/ubuntu-20-04-3-release/ +[2]: https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/01/New-Ubuntu-logo-and-playmouth.jpg +[4]: https://github.com/canonical/ubuntu-desktop-installer +[5]: https://www.debugpoint.com/wp-content/uploads/2022/04/Colour-differences-between-two-LTS-Versions.jpg +[6]: https://www.debugpoint.com/2022/03/gnome-42-release/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/04/Ubuntu-20.04-Vs-Ubuntu-22.04-Lock-and-Login-Screen-1024x431.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/04/Ubuntu-20.04-Vs-Ubuntu-22.04-Lock-Screen-1024x408.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/04/Difference-between-Ubuntu-20.04-and-Ubuntu-22.04-default-look-1024x421.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/04/Activities-View-Difference-Ubuntu-20.04-and-22.04-1024x425.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2022/04/Application-View-Difference-Ubuntu-20.04-and-22.04-1024x420.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2022/04/Accent-Color-and-other-changes-1024x417.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2022/04/How-Accent-colour-change-impact-looks-in-Ubuntu-22.04-LTS.jpg +[14]: https://www.debugpoint.com/wp-content/uploads/2022/04/Files-Difference-Ubuntu-20.04-vs-22.04-1024x359.jpg +[15]: https://www.debugpoint.com/2022/04/ubuntu-budgie-22-04-lts/ +[16]: https://www.debugpoint.com/wp-content/uploads/2022/04/New-Screenshot-tool-in-Ubuntu-22.04-LTS.jpg +[17]: https://www.debugpoint.com/wp-content/uploads/2022/04/Take-Screenshot-option-in-top-bar-menu.jpg +[18]: https://www.debugpoint.com/wp-content/uploads/2022/04/New-Multitasking-Panel-in-Settings.jpg +[19]: https://www.debugpoint.com/wp-content/uploads/2022/04/GNOME-Software-Home-page-difference-1024x416.jpg +[20]: https://www.debugpoint.com/wp-content/uploads/2022/04/GNOME-Software-Details-page-difference-1024x417.jpg +[21]: https://t.me/debugpoint +[22]: https://twitter.com/DebugPoint +[23]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[24]: https://facebook.com/DebugPoint diff --git a/published/20220422 Documentation Isn’t Just Another Aspect of Open Source Development.md b/published/20220422 Documentation Isn’t Just Another Aspect of Open Source Development.md new file mode 100644 index 0000000000..6e00f8a851 --- /dev/null +++ b/published/20220422 Documentation Isn’t Just Another Aspect of Open Source Development.md @@ -0,0 +1,105 @@ +[#]: subject: "Documentation Isn’t Just Another Aspect of Open Source Development" +[#]: via: "https://www.opensourceforu.com/2022/04/documentation-isnt-just-another-aspect-of-open-source-development/" +[#]: author: "Harsh Bardhan Mishra https://www.opensourceforu.com/author/harsh-bardhan-mishra/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14545-1.html" + +文档并不是开源项目开发的附属品 +====== + +有些项目长期保持活跃,有些项目却过早消亡 —— 这两者的区别往往在于它们的文档。严谨、聪明的文档可以给你的项目带来它所需要的动力。你应该把文档工作视为一项主要工作,把它与开发相提并论,下面我将说明这么做的理由和正确的做法。 + +![](https://img.linux.net.cn/data/attachment/album/202205/05/090003l7xrtrwszw6u4wqu.jpg) + +经常会有开发者简单地认为他们的代码的“自我描述self-documented”已经足够了,继而认为额外的文档是没有必要的。这种过度的自信会让项目付出很大的代价。匮乏或差劲的文档会扼杀你的项目。没有适当的文档,用户将无法理解项目的目标以及正确的工作流程。这可能会导致人们对采用你的开源产品产生一些疑虑。 + +### 撰写文档,从项目第一天就开始 + +文档不应该是次要的工作,它应该是与代码开发和管理同等的主要任务。随着内容以 Community Threads、Stack Overflow 和 Quora 问答等形式的广泛传播,文档承担了“信息源source of truth”的角色。它应该满足那些想参考一手资料的贡献者的需要,并给工程师提供必要的参考支持。它还应该与利益相关者沟通基本计划。一个好的文档可以确保产品的持续改进和发展。 + +当发布一个软件产品时,我们不仅要发布代码,还要发布好的文档。这给我们带来了一个最重要的概念,大多数良好维护了文档的开源项目都遵循这个概念 —— “文档即代码Documentation as code”。 + +### 文档及代码 + +今天,文档不再被存储为微软 Word 或 PDF 文件。新的需求是版本控制文档,其中所有的文档都是通过版本控制系统添加的,并持续发布。这个概念因 Read the Docs(LCTT 译注:一个文档创建、托管和浏览的平台)而流行,现在已经成为大多数文档团队的内容策略的重要组成部分。 + +像 Bugzilla 和 GitHub 议题Issue这样的工具可以用来跟踪待处理的文档工作,并从维护者和用户那里获得反馈以验证文档的发布。外部审查可以用来验证文档作品,并持续发布文档。这就保证了除代码外,文档也能不断改进并快速发布。 + +请记住,如果不遵循规范化的实践,每个文档都会不同。这可能会导致一些混乱,使人们难以获取正确的信息。 + +哪些东西会被归类为混乱呢?当大多数文件都不遵循规范实践时,不一致就会产生,从而导致更大的混乱!那么,如何整理混乱的开源文档呢? + +### 整理混乱的开源文档 + +遵循一个“文档风格指南”是很重要的。风格指南是创建和展示内容的指导方针的集合。无论你是一个独立的作家还是一个大型文档团队的成员,它都有助于在你的文档中保持一致的风格、口音和语气。 + +有几个流行的风格指南,如《红帽风格指南》、《谷歌文档风格指南》和《苹果风格指南》。如何选用?首先要从定义你的需求开始。如果你的要求与其他开源项目没有太大区别,你可以遵循一个现成的风格指南,或者你也可以先选一个,然后在它的基础上根据自身需要做一些修改。大多数与语法有关的准则和内容规则可能是通用的,但整体术语可能会有所不同。 + +你还需要在你的项目中自动采用这些风格指南。为此,你可以使用 Vale,它集成了本地的持续集成(CI)服务,该服务能帮助你确保文档严格遵循风格指南。 + +> **文档类型** +> +> * *自述文件*:包含基本的安装和使用说明,这也是任何开源文档中最重要的部分之一。它是潜在的用户/开发者与项目之间的第一个连接点。 +> * *参考指南*:可能包括一些基本的参考资料,以便帮助你快速上手,或者是与项目贡献相关的文档。 +> * *用户文档*:是最基本的文档,它描述了项目的使用方式。如果没有用户文档,大多数人就会对如何使用该项目感到迷茫。 +> * *开发文档*:旨在支持开发团队在项目中不断取得新的进展。它还应该为内部开发工作提供一个良好的途径,并确保功能被很好地传达给股东。 +> * *社区内容*:包括基本的博客、视频和外部内容,旨在为那些想进一步了解项目的社区成员提供支持。 + +通过使用风格指南,文件的整体前提将以统一的语言风格传达给用户。但是,这些文件毕竟是由一个技术作家团队准备的,它们的写作风格可能会冲突,因为写作风格是因人而异的。那么,如何才能使文档规范化呢? + +### 规范化文档 + +当涉及到规范化文档时,有许多方法可以采取。第一个方法显然是创建适用于各种角色的预定义模板。这些模板可以用来记录新的功能、识别错误和问题,以及更新变更日志以适应正在增加的新内容。 + +如果你采用的是基于 Git 的工作流,试着开发一个规范的工作流程来发布你的文档。最规范的工作流是:复刻fork 发布文档的仓库,在本地分支上添加你的修改,推送这些修改,提出请求并要求对其进行审查。规范化文档的一个好处就是带来更好的反馈和审查过程。 + +### 反馈和自动审查 + +规范化使得你能够得到用户的反馈并生成自动的审查,可以参考这些反馈来改进项目和文档。通过这些反馈,你也可以评估所分享的信息对用户是否有意义。像 GitBook 这样的文档平台会提供合适的反馈服务,这有助于验证文档是否有用。 + +始终寻求主题专家subject matter expert(SME)对文档的反馈,他们可以是利益相关者、开发者、工程师,甚至是外部贡献者。你也可以使用自动测试和 CI 来验证你的文档是否遵循风格指南。 + +### 文档众包 + +如果你想开源你的文档,最好的方法也许是提供一个快速入门指南。它可以像 `CONTRIBUTING.md` 那样简单,基本上只要说明该如何设置项目并为其作出贡献/单纯使用它即可。 + +始终开发以用户为中心的文档,标明每个项目的目的。同时,打造学习课程来帮助新的贡献者。 + +> **带着目的编写文档** +> +> 始终带着目的编写文档。它是最基本的写作策略之一,它定义了你编写某个特定文档的理由,而非方式。首先回答以下问题: +> +> * 这个文档的目标是什么? +> * 需要传递的信息是什么? +> * 你希望用户在这之后采取什么行动? +> * 我与读者分享的价值观是什么? +> * 我的文档风格是否简洁、一致? + +### 定义一致的内容策略 + +一致的内容策略有助于确保文档工作和项目基础设施的长期愿景。它可以围绕以下两个主要方面: + +1. 资源:包括项目文档、案例研究和白皮书、项目架构等 +2. 品牌内容:博客和特邀帖子、新闻和社区故事、学习课程等 + +每个开源项目都应该有适当的文档,以说明它能为用户提供的功能,这样用户就可以选择最合适的解决方案。适当的文档可以传达正确的信息,也可以让其他开发者贡献力量来进一步加强和改进项目。虽然听起来很简单,但只有做对了,文档才能成功。而你的项目,反过来,只有在你的文档正确的情况下才能成功,所以永远不要低估它的目标或过程! + +策划:Laveesh Kocher + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/04/documentation-isnt-just-another-aspect-of-open-source-development/ + +作者:[Harsh Bardhan Mishra][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/harsh-bardhan-mishra/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Importance-of-documentation-696x477.jpg diff --git a/published/20220423 5 Less Popular Features that Make Ubuntu 22.04 LTS an Epic Release.md b/published/20220423 5 Less Popular Features that Make Ubuntu 22.04 LTS an Epic Release.md new file mode 100644 index 0000000000..dfd7a8e285 --- /dev/null +++ b/published/20220423 5 Less Popular Features that Make Ubuntu 22.04 LTS an Epic Release.md @@ -0,0 +1,123 @@ +[#]: subject: "5 Less Popular Features that Make Ubuntu 22.04 LTS an Epic Release" +[#]: via: "https://www.debugpoint.com/2022/04/ubuntu-22-04-release-unique-feature/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14546-1.html" + +使 Ubuntu 22.04 LTS 成为史诗版本的 5 个不太流行的功能 +====== + +> 这是一份关于 Ubuntu 22.04 LTS 的次要特点的列表,这些特点使它成为迄今为止最好的 LTS 版本之一。 + +Canonical 的最新 LTS 版本 [Ubuntu 的代号为 “Jammy Jellyfish”][1] 受到了全球用户的好评。但是有数百个新的微小功能,以及一些不太流行的功能,没有引起人们的注意。因此,这里有五个 Ubuntu 22.04 的独特功能,我们认为这些功能可以使它成为一个史诗般的版本。 + +![](https://img.linux.net.cn/data/attachment/album/202205/05/112722nabll6gs7s6sgzdr.jpg) + +### Ubuntu 22.04 发布 – 五个独特的功能 + +#### 为数据驱动的方案进行了优化 + +数据分析和处理是当今每个企业的核心。而要做到这一点,你需要巨大的计算能力。Ubuntu 22.04 LTS 带来了开箱即用的 [英伟达虚拟 GPU(vGPU)][3] 驱动支持。这意味着你可以利用英伟达虚拟 GPU 软件,使你能够在虚拟机中使用从物理 GPU 服务器共享的 GPU 计算能力。 + +不仅如此,如果你的业务依赖于 SQL Server,Ubuntu LTS for Azure 带来了 Ubuntu 中的 SQL Server,它由 “Micro$oft” 支持,提供优化的性能和可扩展性。 + +#### 改进的活动目录集成 + +此外,许多企业在多个工作站中为整个企业用户部署 Ubuntu。而且,部署工作站策略以监测和控制用户访问和各种关键业务控制非常重要。 + +活动目录实现了基于策略的工作站管理(在 Ubuntu 20.04 中引入),在这个版本中得到了进一步改善。除此之外,这个版本还带来了 [ADsys][4] 客户端,它有助于通过命令行远程管理组策略、权限升级和远程脚本执行。从这个版本开始,活动目录现在也支持与高级组策略对象的安装程序集成。 + +#### 实时内核支持 + +此外,在 Ubuntu 22.04 LTS 发布期间,Canonical 宣布的一个有趣的消息是,提供“实时”内核选项,现在是测试版。对于电信和其他行业来说,一个低延迟的操作系统对于时间敏感的工作是必需的。因此,考虑到这一点和渗透到这些领域的愿景,Ubuntu 22.04 LTS 带来了一个应用了 PREEMPT_RT 补丁的实时内核构建。它可用于 x86_64 和 AArch64 架构。 + +然而,该 [补丁][5] 还没有在主线内核中出现,希望它能很快能出现。 + +#### 最新的应用、软件包和驱动程序 + +除了上述变化之外,这个版本还带来了大量的软件包和工具链的升级。例如,这个版本带来了基于各种用途的多种 Linux 内核类型,如 Ubuntu 桌面可以选择使用 [内核 5.17][6],而硬件启用内核仍然是 5.15。 + +不仅如此,Ubuntu Server 采用长期支持版的 [内核 5.15][8],而 Ubuntu Cloud 镜像可以选择使用与云供应商合作的更优化的内核。 + +此外,如果你是英伟达用户,值得一提的是,ARM64 上的英伟达驱动的 Linux 限制模块现在已经可用(在 x86_64 中已经可用)。你可以使用 [ubuntu-drivers][9] 程序来安装和配置英伟达驱动。 + +核心模块和子系统构成的完整的操作系统可以完美无缺地工作。因此,考虑到这一点,Ubuntu 22.04 LTS 对它们都进行了仔细的升级,以迎合这个很好的版本。以下是简介: + +GNU/Linux 核心: + + * GCC 11.2.0 + * binutils 2.38 + * glibc 2.35 + +编程工具链: + + * Python 3.10.4 + * Perl 5.34.0 + * LLVM 14 + * golang 1.18 + * rustc 1.58 + * OpenJDK 11(可选使用 OpenJDK 18) + * Ruby 3.0 + * PHP 8.1.2 + * Apache 2.4.52 + * PostgreSQL 14.2 + * Django 3.2.12 + * MySQL 8.0 + * 更新的 NFS 以及 Samba Server + * Systemd 249.11 + * OpenSSL 3.0 + +虚拟化: + + * qemu 6.2.0 + * libvirt 8.0.0 + * virt-manager 4.0.0 + +#### 性能提升 + +但这还不是全部。由于一些长期等待的更新,你应该体验到更快的 Ubuntu 22.04 Jammy Jellyfish,这些体验最终会在这个版本中出现。 + +首先,长期等待的 GNOME 桌面的 [三重缓冲代码] 已经来到。当先前的帧缓冲落后时,三重缓冲会自动启用,它在英特尔和树莓派驱动中产生了更快的桌面性能。不仅如此,代码还监控最后一帧,以便系统不会遇到过量缓冲的情况。 + +其次,改进的电源管理,在运行时对 AMD 和英伟达的 GPU 起作用,将帮助笔记本电脑用户。 + +此外,Wayland 现在是大多数系统的默认显示服务器,除了英伟达 GPU 硬件默认为 X11。Wayland 为你提供了更快的跨应用的桌面体验,包括网页浏览器。 + +最后,定制的 GNOME 42 及其 [独特功能][11](例如平衡和省电电源配置文件)为重度笔记本电脑用户提供了更多优势。此外,带有浅色/深色外观的新强调色和将选定的 GNOME 模块移植到 GTK4/libadwaita 只是这个史诗般的 Ubuntu 22.04 LTS 版本的一个补充。 + +### 结论 + +总而言之,就上述所有内容的变化和许多其他方面而言,我相信这是 Canonical 发布的最好的 LTS 版本之一。 + +我们希望它得到好评,并在未来能保持稳定。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/04/ubuntu-22-04-release-unique-feature/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/04/Ubuntu-22.04-LTS-Desktop-GNOME-1024x580.jpg +[3]: https://docs.英伟达.com/grid/latest/grid-vgpu-release-notes-ubuntu/index.html +[4]: https://github.com/ubuntu/adsys +[5]: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt.git/ +[6]: https://www.debugpoint.com/2022/03/linux-kernel-5-17/ +[8]: https://www.debugpoint.com/2021/11/linux-kernel-5-15/ +[9]: https://launchpad.net/ubuntu/+source/ubuntu-drivers-common +[10]: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441 +[11]: https://www.debugpoint.com/2022/03/gnome-42-release/ +[12]: https://t.me/debugpoint +[13]: https://twitter.com/DebugPoint +[14]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[15]: https://facebook.com/DebugPoint diff --git a/published/20220425 Exciting New Features Revealed for KDE Plasma 5.25- Take a Look Here.md b/published/20220425 Exciting New Features Revealed for KDE Plasma 5.25- Take a Look Here.md new file mode 100644 index 0000000000..ef54f85084 --- /dev/null +++ b/published/20220425 Exciting New Features Revealed for KDE Plasma 5.25- Take a Look Here.md @@ -0,0 +1,117 @@ +[#]: subject: "Exciting New Features Revealed for KDE Plasma 5.25! Take a Look Here" +[#]: via: "https://news.itsfoss.com/plasma-5-25-features/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "PeterPan0106" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14532-1.html" + +KDE Plasma 5.25 推出了令人激动的新特性!先睹为快 +====== + +> 作为 KDE 的下一次桌面环境升级,Plasma 5.25 包含了一些令人耳目一新的新功能!在这里,我们可以看到它的一些新功能。敬请阅读。 + +![](https://news.itsfoss.com/wp-content/uploads/2022/04/kde-5-25-release.png) + +[KDE Plasma 5.24][1] 提供了关于 breeze 主题的更新,并对多任务“概览”界面进行了修改。 + +现在,开发者们已经准备好向大家介绍 KDE Plasma 5.25 令人激动的新特性。 + +### KDE Plasma 5.25 :拥有哪些新功能? + +Nate Graham 在一篇博文中着重介绍了一些最为有趣的变化,让我们一起先睹为快。 + +#### 有选择地应用全局主题的部分样式 + +![来源: Pointiestick Blog / Nate Graham][2] + +当你在系统设置里应用一个全局主题时,系统会提示你应用全部的样式或是仅仅应用其中一部分样式。 + +例如,当你更换桌面背景以及应用样式时,你可能并不愿意更换鼠标指针和图标。 + +总体而言,当你在基于 KDE 的系统上应用全局主题时,你将能够更为自由地设置你的样式。 + +这个令人惊叹的 [贡献][3] 来自 Dominic Hayes。 + +#### 根据当前壁纸自动生成强调色 + +尽管能够使用预设或自定义的强调色已经很好了。 + +但在 KDE Plasma 5.25 上,他们更进一步,允许让系统根据当前壁纸自动生成并使用强调色。 + +只要你选择了这一选项,每次更换壁纸时系统会自动生成匹配的强调色,无需额外操作。 + +你可以在这里找到相关选项: + +![来源: Pointiestick Blog / Nate Graham][4] + +所以如果你希望桌面和你的壁纸更为匹配,你无需反复进入设置去调整强调色来做到这一点。这个自动生成的功能将会使这一需求更容易完成。 + +这是一个对新特性库增添的很小但十分强大的功能。感谢来自 Tanbir Jishan 的 [贡献][5]。 + +#### 基于强调色的配色方案 + +为了进一步加强个性化的视觉体验, KDE Plasma 5.25 允许你增加基于强调色的个性化配色方案。 + +![来源: Jan Blackquill][6] + +你可以自由选择是否使用个性化配色方案。 + +关于这一特性的详情请见 Jan Blackquill 的 [贡献][7]。 + +#### 为 Flatpak/Snap 应用提供桌面文件编辑权限 + +之前, Flatpak/Snap 应用在 KDE 上并不支持桌面文件(`.desktop`)。 + +得益于最新的 “动态启动器” 门户(来自 Harald Sitter 的 [贡献][8]),这将允许你创建和编辑桌面文件,从而使沙盒应用程序无缝集成到系统。 + +#### 对“发现”的更多优化 + +在“发现”软件中心有一些细微的调整。你将可以在侧边栏中找到所有的应用程序类别,而无需经由“应用”、“插件”和“Plasma 插件”等子类别分别选择。 + +KDE Discover 修改前和修改后(贡献者:[Taavi Juursalu][9]) + +![修改前][12] + +![修改后][13] + +关于这一变化详情请见 [合并请求][10] 。 + +#### 其他优化 + +针对 KDE Plasma 5.25 还计划的其他优化,包括: + + * 针对 KRunner 的性能优化 + * 网络组件增添了频率信息以及 Wi-Fi 网络的 BSSID 详细信息 + +所有错误修复与优化可在 [Nate 的博文][11] 中查看: + +期待 KDE Plasma 5.25 吗?有了这些新特性,我十分期待它的正式发布。如果你有任何想法欢迎在下方评论。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/plasma-5-25-features/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[PeterPan0106](https://github.com/PeterPan0106) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/kde-plasma-5-24-lts-release/ +[2]: https://news.itsfoss.com/wp-content/uploads/2022/04/kde-plasma-5-25.jpg +[3]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1043 +[4]: https://news.itsfoss.com/wp-content/uploads/2022/04/plasma-5-25-tinted-wallpaper-accent.jpg +[5]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1325 +[6]: https://news.itsfoss.com/wp-content/uploads/2022/04/tint-color-scheme.png +[7]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1620 +[8]: https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/d5f958e149705e27bbba9f3bbec659ff5bed1d80 +[9]: https://invent.kde.org/taavi +[10]: https://invent.kde.org/plasma/discover/-/merge_requests/234 +[11]: https://pointieststick.com/2022/04/22/this-week-in-kde-major-accent-color-and-global-theme-improvements/ +[12]: https://news.itsfoss.com/wp-content/uploads/2022/04/kde-discover-plasma-5-25.png +[13]: https://news.itsfoss.com/wp-content/uploads/2022/04/kde-plasma-5-25-discover.png diff --git a/published/20220425 Linux Mint Upgrade Tool - Here-s How it Works.md b/published/20220425 Linux Mint Upgrade Tool - Here-s How it Works.md new file mode 100644 index 0000000000..69691ce77a --- /dev/null +++ b/published/20220425 Linux Mint Upgrade Tool - Here-s How it Works.md @@ -0,0 +1,106 @@ +[#]: subject: "Linux Mint Upgrade Tool – Here’s How it Works" +[#]: via: "https://www.debugpoint.com/2022/04/mint-upgrade-tool/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14531-1.html" + +实测 Linux Mint 升级工具 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/01/170956n81yky0l8vbvy1n8.jpg) + +> 我们通过实际升级测试了 Linux Mint 升级工具(mintupgrade GUI)。这是我们的发现。 + +这个工具正在开发中,可能包含错误,除非你想实验一下,否则请不要在你的日常中使用它。 + +### Linux Mint 升级工具 + +Linux Mint 团队 [宣布][1],他们建立了一个新的工具来升级 Linux Mint 的主要版本。它被称为 “mintupgrade2”。它目前正在开发中,计划用于升级主要版本。例如,从 Linux Mint 20 到 21,而不是小版本的升级。 + +虽然你可以使用标准的 `apt` 命令来升级版本,然而,Mint 团队认为主要版本的升级是很棘手的。新用户很难顺利升级,因为它涉及到终端和一套复杂的命令步骤。 + +此外,这个图形用户界面是对 mintupgrade 程序的封装,并带有一些附加功能,它带来了一套系统前检查和一键修复的升级过程。 + +除此之外,mintupgrade 还会检查你是否连接到电源、系统是否是最新的、磁盘空间的可用性等等。 + +为了让大家了解它的外观和工作情况,我们使用 LMDE 4 设置了一个测试平台做了个测试。 + +但在这之前,让我快速介绍一下它的功能: + + * 完全由 GUI 驱动的升级过程 + * 多语言支持 + * 升级前检查:系统备份、电源、磁盘空间、删除的软件包列表 + * 可配置 + * 提醒你来自上一个版本的孤儿软件包 + * 给你修复问题的选项 + +### 它是如何工作的 + +当我们通过命令 `mintupgrade` 运行这个 Mint 升级工具时,这个图形用户界面程序友好的欢迎屏幕是一个很好的起点,它开启了升级过程,然后它自己开始进行一系列的检查。 + +![Starting the upgrade process][2] + +除此之外,当它在你的系统中发现一些问题时,它会停下来并给你足够的细节。当你点击“修复”后,它就可以再次恢复进程。 + +不止如此。如果由于网络或互联网或任何其他问题而中断,它也可以恢复升级过程。 + +在我们的测试过程中,该工具在我们的测试系统中发现了以下错误,只需点击一下就能修复它们。 + +![Apt Cache check][3] + +![Mint Upgrade detects that system snapshots are not present][4] + +![Check for Orphan Packages][5] + +![Status before upgrade][6] + +![Mint Upgrade can detect the packages that require a downgrade][7] + +最后,我们成功地将一个测试系统从 LMDE 4 升级到 LMDE 5。 + +![Upgrade Complete][8] + +#### 如何获得这个升级工具 + +使用下面的命令,该工具的安装很简单。但正如该团队所建议的,它现在处于 BETA 状态,所以不要用它来进行正式场合的升级。 + +``` +sudo apt update +sudo apt install mintupgrade +``` + +### 结束语 + +最后,我认为这是 Linux Mint 团队的最好的工具之一。正如你在上面看到的,它自己处理了许多错误。我所做的只是点击“修复”按钮。而这个工具足够聪明,能够理解所有的故障点,并负责补救。 + +[mintupgrade 工具][9] 将在 Linux Mint 21 “Vanessa” 发布前发布,大约在 2022 年第三季度末或第四季度初。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/04/mint-upgrade-tool/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/2022/04/linux-mint-21-announcement/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/04/Starting-the-upgrade-process.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/04/Apt-Cache-check-1024x521.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/04/Mint-Upgrade-detects-that-system-snapshots-not-present-1024x522.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/04/Check-for-Orphan-Packages-1024x522.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/04/Status-before-upgrade-1024x528.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/04/Mint-Upgrade-can-detect-the-packages-require-downgrade-1024x612.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/04/Upgrade-Complete-1024x612.jpg +[9]: https://github.com/linuxmint/mintupgrade +[10]: https://t.me/debugpoint +[11]: https://twitter.com/DebugPoint +[12]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[13]: https://facebook.com/DebugPoint diff --git a/published/20220426 How to Upgrade to Pop OS 22.04 LTS from 21.10 -Step by Step.md b/published/20220426 How to Upgrade to Pop OS 22.04 LTS from 21.10 -Step by Step.md new file mode 100644 index 0000000000..931d003acb --- /dev/null +++ b/published/20220426 How to Upgrade to Pop OS 22.04 LTS from 21.10 -Step by Step.md @@ -0,0 +1,105 @@ +[#]: subject: "How to Upgrade to Pop OS 22.04 LTS from 21.10 [Step by Step]" +[#]: via: "https://www.debugpoint.com/2022/04/upgrade-pop-os-22-04-from-21-10/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "hwlife" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14561-1.html" + +分步指南:从 Pop OS 21.10 更新到 Pop OS 22.04 LTS +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/08/094819p7c49e1fc9b4vc15.jpg) + +> 从 Pop OS 21.10 升级到 Pop OS 22.04 LTS 的简单步骤。 + +System76 跟着 [Ubuntu 22.04 LTS][2] [发布][1] 了 Pop OS 22.04 LTS ,它带来了一些令人兴奋的功能。Pop OS 22.04 LTS 是来自 System76 发布的长期支持版本,它带来了自动计划更新、自定义的 GNOME 42、底层性能改进和 [许多其它的功能][3]。 + +你肯定很想体验一下,计划更新到 Pop OS 22.04 。这里我给出你升级 Pop OS 22.04 LTS 的步骤。 + +注意: 你不能直接从 Pop OS 20.04 升级到 Pop OS 22.04 。首先,你需要先升级到 Pop OS 21.10,然后按照此处概述的步骤升级到这个版本。 + +### 从 Pop OS 21.10 升级到 Pop OS 22.04 + +#### 升级之前的准备 + +Pop OS 升级过程是相对稳定的。因为根据我们 [上一篇关于升级的文章][4],许多用户面临升级方面的问题。但是如果你正在使用英伟达硬件运行 Pop OS ,我建议你做个备份。 + + * 确保你的系统是最新的。你可以使用 Pop 商店应用检查更新。或者,你可以打开终端提示符并运行以下命令更新: + ``` + sudo apt update && sudo apt upgrade + ``` + * 按照以上步骤升级完成之后,重启系统。 + * 备份你的文档、照片、视频和其它文件到独立的磁盘分区或者 USB 驱动器。 + * 升级之前,禁用所有 GNOME 扩展。许多扩展会阻挡迁移到 GNOME 42 的过程,最好在你升级之前禁用所有扩展,之后再启用它们。 + * 记下所有额外的软件源或你已经添加的 PPA 仓库,因为它们可能与 “jammy” 分支不兼容。升级之后你可能需要验证它们。 + * 关闭所有运行的程序。 + * 最后,确保你有时间和稳定的网络连接来完成升级。 + +### Pop OS 22.04 LTS 的升级步骤 + +#### 图形界面升级方法 + +如果你正在运行的是 Pop OS 21.10 ,你应该看到如下提示是否你的系统需要升级。 + +![Pop OS 22.04 升级提示][6] + +或者,你可以打开 “设置Settings” 然后访问 “系统升级和恢复OS Upgrade and Recovery” 标签。这里你应该看到有系统更新信息。 + +![Pop OS 22.04 在设置标签的提示][7] + +点击 “Download下载” 开始升级过程。 + +#### 升级到 Pop OS 22.04 LTS 的终端方法 + + * 打开终端运行以下命令: + ``` + sudo apt update + sudo apt full-upgrade + ``` + * 这能确保在升级过程开始前系统保持最新。如果你已经在上述升级前步骤中完成了这个步骤,那么你可以忽略它。 + * 使用以下命令更新恢复分区并等待它完成。这只适用于 UEFI 安装模式。 + ``` + pop-upgrade recovery upgrade from-release + ``` + * 现在使用以下命令开始升级过程: + ``` + pop-upgrade release upgrade + ``` + ![开始升级过程][8] + * 首先,升级过程将会下载软件包。按照我们的测试,需要下载大约 1600 多个软件包。因此,你应该等到它结束。 + * 其次,一旦下载完成,更新管理器将会提示你重启。 + ![准备升级][9] + * 重启之后,Pop OS 将开始安装最新的软件包到你的系统中。 + * 最后,这个下载过程要花将近一个小时,所以等待它完成。我不建议中途停止更新,这将会导致系统不稳定。 + ![Pop OS 22.04 LTS 桌面][10] + * 升级完成之后,享受全新的 Pop OS 22.04 LTS 吧。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/04/upgrade-pop-os-22-04-from-21-10/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[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/lujun9972 +[1]: https://blog.system76.com/post/682519660741148672/popos-2204-lts-has-landed +[2]: https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/ +[3]: https://www.debugpoint.com/2022/04/pop-os-22-04-lts/ +[4]: https://www.debugpoint.com/2021/12/upgrade-pop-os-21-10-from-21-04/ +[5]: https://www.debugpoint.com/2021/07/upgrade-pop-os-21-04-from-20-10/ +[6]: https://www.debugpoint.com/wp-content/uploads/2022/04/Pop-OS-22.04-Upgrade-Prompt-1024x200.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/04/Pop-OS-22.04-Upgrade-Prompt-in-Settings.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/04/Start-the-upgrade-process.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/04/Ready-for-upgrade-1024x323.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/04/Pop-OS-22.04-LTS-Desktop-1024x641.jpg +[11]: https://t.me/debugpoint +[12]: https://twitter.com/DebugPoint +[13]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[14]: https://facebook.com/DebugPoint diff --git a/published/20220427 10 Reasons to Run Linux in Virtual Machines.md b/published/20220427 10 Reasons to Run Linux in Virtual Machines.md new file mode 100644 index 0000000000..6045b1d4b6 --- /dev/null +++ b/published/20220427 10 Reasons to Run Linux in Virtual Machines.md @@ -0,0 +1,170 @@ +[#]: subject: "10 Reasons to Run Linux in Virtual Machines" +[#]: via: "https://itsfoss.com/why-linux-virtual-machine/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "PeterPan0106" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14541-1.html" + +在虚拟机中运行 Linux 的十大优点 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/04/093523wlzslifl2cp9papp.jpg) + +> 你可以在虚拟机环境里运行任何操作系统,不论是测试还是为了某种需要。 + +对于 Linux 而言,它在虚拟环境下的性能会优于其他操作系统。即便你可能会犹豫是否在物理机(裸金属)上安装 Linux 系统,你仍然可以在虚拟机中安装一个性能几乎和物理机一样好的 Linux 系统。 + +当然,这并不意味着宿主系统为 Linux 时你就不能在虚拟机实例中安装 Linux 了。 + +更何况,你在虚拟环境下使用 Linux 系统有许多好处。大致如下。 + +### 在虚拟环境下运行 Linux 之前的注意事项 + +在虚拟环境下运行 Linux 或许并不是艰巨的任务,但仍有以下几点你需谨记。 + +* 虚拟机的性能取决于宿主机的性能,如果你并没有足够的系统资源分配给虚拟机,那么虚拟机的使用体验注定不会很好。 +* 某些特性仅在物理机(裸金属)上生效,包括硬件加速以及图形(显卡)驱动等。 +* 密集的磁盘 I/O 任务性能会十分受限,例如游戏测试场景。 +* 用户的 Linux 虚拟机实例体验会根据你所使用的虚拟化程序而发生变化,这些虚拟化程序包括 VMware、VirtualBox、GNOME Boxes 以及 Hyper-V 。 + +此外,你应当列出你的需求,并根据这些需求选定适当的虚拟化程序来运行你的 Linux 实例。 + +### 十条在虚拟环境中运行 Linux 的优点 + +尽管运行虚拟化 Linux 实例极具吸引力,你仍然应当首先考虑当前使用的宿主系统中已有的选择。例如,如果你不需要图形化桌面,或许利用 Windows 操作系统中的 [WSL 安装 Linux][1] 就可以满足你的需求。 + +一旦你确定了使用虚拟机,那么这些优点将会如影随形: + +#### 1、部署简便 + +![部署简便][2] + +与在传统物理机(裸金属)上安装 Linux 相比,在虚拟机中部署一般会容易许多。 + +对于基于 Ubuntu 的发行版而言,像 VMware 这样的虚拟化程序会提供一个 **快速安装** 的选项,你仅需输入用户名和密码,其余过程将自动完成而无需其他操作。你无需手动设置分区、引导程序以及更多高级设置。 + +某些情况下,一些发行版的开发者会同时提供针对特定虚拟机的预构建镜像,只需打开就可使用。这就好像一个便携式虚拟机镜像,随时可以开箱即用。 + +例如,在 [这里][3] 你将看到如何在虚拟机中安装 Arch Linux 发行版。 + +对于其他的发行版,你或许仍需要进行一些配置,但一般都会有快速安装的选项令你可以轻松部署。 + +#### 2、不会影响宿主机 + +![不会影响宿主机][4] + +对于虚拟机,你可以更为随心所欲地使用,因为虚拟机系统和宿主机系统是隔离的。 + +很多时候,如果你并不熟悉 Linux 系统,你很可能会把配置弄得十分混乱。 + +所以在虚拟机里,你可以随意尝试而无需担心是否会影响到宿主机系统。换句话说,任何虚拟机的操作都不会影响到宿主机,因为它们是完全隔离的。 + +故此,虚拟机是你最好的试验场,尤其是对于一些激进或具有破坏性的试验。 + +#### 3、资源可高效共享 + +![资源可高效共享][5] + +如果你有十分充裕的系统资源,你可以使用虚拟机运行其他任务,从而充分利用起来这部分闲置的系统资源。例如,如果你需要一个十分私密的浏览环境,虚拟机将为你阻挡一切针对宿主机的追踪器。 + +这可能略显牵强,但这仅仅是一个例子。基于这样的想法你将可以充分利用全部的系统资源。 + +而对于双启动方案,你需要在单独的磁盘上在 Windows [之后安装 Linux][6],或者在 Linux [之后安装 Windows][7],你需要为你的任务锁定相应的资源。 + +但利用虚拟机,你无需锁定部分资源也可以使用 Linux ,也不必为了特定的任务而临时共享资源,这样会方便许多。 + +#### 4、多任务体验更好 + +![多任务体验更好][8] + +有了资源共享机制,多任务会前所未有的容易。 + +在双启动的场景下,你需要来回重启切换才能使用 Linux 或 Windows 。 + +但如果使用虚拟机,你几乎不再需要 [双启动][9],两个系统将无缝协作并完成多任务。 + +当然,你需要确认你拥有足够的系统资源和额外的硬件(例如双显示器)来更高效地使用。而多任务的潜力也因 Linux 虚拟机的存在而愈发强大。 + +#### 5、软件测试更为便捷 + +有了虚拟化,你将可以创建大量的 Linux 实例,来模拟特定的使用场景,并对软件进行测试。 + +例如,你可以在不同的 Linux 虚拟机中同步测试不同的软件版本。这有丰富的使用场景,包括对开发版软件进行测试以及 Linux 发行版的早期测试等等。 + +#### 6、开发更为便捷 + +![开发更为便捷][10] + +当你在学习编程或者刚加入一个软件项目的开发的时候,你会希望拥有一个没有任何冲突和错误的开发环境。 + +在 Linux 虚拟机里,你可以从零开始搭建一个不会与已经存在的环境冲突的开发环境。例如,你可以在 Ubuntu 上 [安装并测试 Flutter][11] 。 + +如果环境出了问题,你可以轻而易举地删掉这个虚拟机,并重新开始来修正错误。 + +Linux 虚拟机的隔离环境是一个绝佳的开发和测试环境。 + +#### 7、学习和研究的好帮手 + +Linux 值得反复探索。除了基础的计算任务,你可以做许多其他的事情。 + +你可以学习如何修改你的用户界面,[尝试一些常见的桌面环境][12] 、[安装大量常用软件][13] ,与此同时仍能让一切处于掌控之中。 + +如果出现问题,新建一个 Linux 虚拟机就可以解决。当然,这并不仅限于日常使用需要,还可以启发系统管理员在其中测试他们所学的知识。 + +#### 8、更容易复制和迁移 + +虚拟机可以很容易地复制和迁移。只要其它的宿主机系统支持该虚拟化程序,你就可以很容易地迁移它,而没有特别要求。 + +不论因何原因,几次简单的点击就可以完成复制和迁移的任务。 + +#### 9、尝试大量的发行版 + +![尝试大量的发行版][14] + +你可以在虚拟环境下尝试数以百计的 Linux 发行版。 + +你或许会认为这和第七条重复了,但是我相信,测试一个发行版是一个巨大的系统性工程,尤其是当你决定切换发行版做为宿主机或其他用途时。 + +#### 10、便于调试 + +不论是严肃的开发活动还是一般的研究,在隔离的虚拟环境中调试和除错相对而言会更简单。 + +你可以快速尝试大量的调试方法而无需考虑影响。同时,如果你的宿主机是 Linux 系统的话,无需宿主机上的 root 权限便可以访问和修改虚拟机中的配置文件。 + +### 总而言之 + +如果你不熟悉正在使用的系统或者依赖不同的操作系统工作,虚拟机将是协助你工作的一大利器。 + +Linux 虚拟机可以广泛用于开发、学习、试验或任何特定用途。 + +你在虚拟机中使用过 Linux 吗?都有哪些应用场景呢?欢迎留言评论! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/why-linux-virtual-machine/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[PeterPan0106](https://github.com/PeterPan0106) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/install-bash-on-windows/ +[2]: https://itsfoss.com/wp-content/uploads/2022/04/easy-setup-linux-vm.jpg +[3]: https://itsfoss.com/install-arch-linux-virtualbox/ +[4]: https://itsfoss.com/wp-content/uploads/2022/04/isolated-linux-vm.jpg +[5]: https://itsfoss.com/wp-content/uploads/2022/04/sharing-resources-linux-vm.jpg +[6]: https://itsfoss.com/dual-boot-hdd-ssd/ +[7]: https://itsfoss.com/install-windows-after-ubuntu-dual-boot/ +[8]: https://itsfoss.com/wp-content/uploads/2022/04/multitasking-linux-vm.jpg +[9]: https://itsfoss.com/dual-boot-fedora-windows/ +[10]: https://itsfoss.com/wp-content/uploads/2022/04/development-linux-vm.jpg +[11]: https://itsfoss.com/install-flutter-linux/ +[12]: https://itsfoss.com/best-linux-desktop-environments/ +[13]: https://itsfoss.com/essential-linux-applications/ +[14]: https://itsfoss.com/wp-content/uploads/2022/04/distros-linux-vm.jpg diff --git a/published/20220427 Bloomberg Open Sources Memray, A Python Memory Profiler.md b/published/20220427 Bloomberg Open Sources Memray, A Python Memory Profiler.md new file mode 100644 index 0000000000..1c973667e1 --- /dev/null +++ b/published/20220427 Bloomberg Open Sources Memray, A Python Memory Profiler.md @@ -0,0 +1,45 @@ +[#]: subject: "Bloomberg Open Sources Memray, A Python Memory Profiler" +[#]: via: "https://www.opensourceforu.com/2022/04/bloomberg-open-sources-memray-a-python-memory-profiler/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14582-1.html" + +彭博社开源 Memray,一个 Python 内存剖析器 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/12/081556a84j8f331irlszo2.jpg) + +Memray 是一个由彭博社开发的内存剖析器memory profiler,现在已经开源。它可以跟踪 Python 代码中的内存分配,包括本地扩展和 Python 解释器本身。内存剖析是了解程序如何利用内存的有力工具,因此可以检测内存泄漏或确定程序中哪些区域消耗的内存最多。 + +与 py-spy 等抽样内存剖析器相比,Memray 可以跟踪每个函数调用,包括对 C/C++ 库的调用,并详细显示调用栈。彭博社称,这并不以牺牲性能为代价,剖析只使解释代码的速度变慢一点。然而,原生代码剖析的速度较慢,因此需要直接启用。 + +Memray 可以根据获得的内存消耗数据生成各种报告,包括火焰图,这对快速、准确地识别最常见的代码路径很有价值。 + +据 EgdeDB 的联合创始人兼 CEO Yury Selivanov 称,该工具提供了以前无法获得的对 Python 应用的洞察力。Memray 可以用来从命令行中执行和剖析 Python 应用。 + +``` +$ python3 -m memray run -o output.bin my_script.py +$ python3 -m memray flamegraph output.bin +``` + +另外,你可以使用 pytest-memray 将 Memray 集成到你的测试套件中。你也可以用 `-native` 命令行选项对所有的 C/C++ 调用进行剖析,或者用 `-live` 命令行选项在程序执行过程中实时分析内存分配。Memray 可以在 Linux x86/64 系统上用 `python3 -m pip install memray` 来安装。 + +(题图由 Frantisek Krejci 在 Pixabay 上发布) + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/04/bloomberg-open-sources-memray-a-python-memory-profiler/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/soft-1-696x363.jpg diff --git a/published/20220427 Hands on With GNOME-s New Text Editor for Linux Users.md b/published/20220427 Hands on With GNOME-s New Text Editor for Linux Users.md new file mode 100644 index 0000000000..8d27c62567 --- /dev/null +++ b/published/20220427 Hands on With GNOME-s New Text Editor for Linux Users.md @@ -0,0 +1,165 @@ +[#]: subject: "Hands on With GNOME’s New Text Editor for Linux Users" +[#]: via: "https://itsfoss.com/gnome-text-editor/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "aREversez" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14588-1.html" + +GNOME 新文本编辑器尝鲜 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/13/144247g8w8v9clwdcaagw1.png) + +如果你是我们的忠实读者,你可能读过 [GNOME 计划用自家的文本编辑器取代 Gedit][1] 的消息了。 + +没错,GNOME 推出了一款全新的文本编辑器,名字就叫做,嗯,“文本编辑器Text Editor”。 + +尽管 GNOME 桌面的默认文本编辑器还是 Gedit,但是这个新的编辑器已经和 GNOME 42 一起发布了。 + +也就是说,这款新编辑器可以在 Ubuntu 最新的长期发行版或者其他使用 GNOME 42 的发行版上获取(笔者现在使用的正是 Ubuntu 22.04)。 + +感兴趣吗?在本文,笔者将分享这款编辑器的使用体验以及安装步骤。 + +### GNOME 文本编辑器使用体验 + +GNOME 文本编辑器基于 [有争议的 libadwaita 库][3],遵循着其开发委员会的设计新理念,采用圆角边框,外观优美典雅,颇具现代化特点。 + +但就功能而言,这款软件并没有什么特别的“过人之处”。毕竟,它并不能取代 [Atom 或者 VS Code][4] 这类专业的代码编辑器。但同时,它也绝不像 Windows 的记事本那样“平平无奇”。 + +那么,让我们来一睹它的“风采”吧! + +#### 会话保存功能 + +默认情况下,GNOME 文本编辑器会自动打开上次编辑的文件,这一功能可以让你快速继续之前的工作。 + +你可以通过首选项下的还原会话选项,开启或关闭该功能。 + +![][5] + +你还可以搜索文件记录,打开最近处理的文件。请注意:清除文件记录(见上图 “清除历史Clear History”)会清除最近打开的文件列表。 + +#### 主题与内置主题 + +GNOME 文本编辑器与其他新的 GNOME 软件一样,自带三种主题风格:跟随系统、浅色模式和深色模式。如果你选择了跟随系统,编辑器会根据系统主题(浅色或深色)自动变换自身的深浅主题色。 + +![System theme option gnome text editor][6] + +此外,在首选项下还设有八个主题(深浅色模式下主题有所不同),为用户提供了更多的选择。 + +![Theme options under preference][7] + +只需点击选中,主题即可生效。 + +#### 文件修改以及未保存文件的处理 + +在你工作时,已修改和未保存的文件会突出地反映出来。 + +![Unsaved files are more prominently marked][8] + +在你修改文件后点击关闭窗口时,编辑器会提醒你选择保存修改还是放弃修改。 + +![][9] + +相比之下,[Gedit 有自动保存选项][10],无需插件即可使用。 + +#### 暂无插件功能 + +提到插件,不得不承认这款新的编辑器还没有推出插件功能。而另一方面,Gedit 有着良好的插件生态,所以它的功能更加强大。 + +我不确定 GNOME 文本编辑器未来是否会引入支持插件的功能。 + +#### 代码语法高亮 + +近年来,代码语法高亮可以说是文本编辑器的一个必备功能了。GNOME 文本编辑器也提供了这一功能,支持各种程序语言语法高亮。 + +通常来说,语法高亮的前提是代码文件要有对应的后缀名。不过,我发现 GNOME 文本编辑器甚至可以在文件保存之前就识别出 bash 脚本和 C/C++ 程序,并对其语法标出高亮。 + +![Bash scripts. C/C++ code are detected even without file extension][11] + +#### 快捷键 + +笔者喜欢在常用软件里使用快捷键,因为这样效率会更高。 + +GNOME 文本编辑器的各种操作都支持快捷键。你可以点击软件右上角的汉堡菜单(`☰` 符号)看到快捷键列表;或者直接敲快捷键 `Ctrl+?` 调出。 + +![Keyboard shortcuts in Text Editor][12] + +#### 查找和替换 + +GNOME 文本编辑器有着完善的查找替换功能。它有三种模式可供选择:正则表达式、区分大小写以及匹配精准字符。 + +![search replace gnome text editor][13] + +#### 更多功能 + +GNOME 文本编辑器与 Gedit 一样,还具备一些其他功能: + + * 拼写检查 + * 显示行号 + * 自动缩进 + * 空格和制表位缩进 + * 大小写转换 + * 自动换行 + +#### GNOME 文本编辑器的局限 + +归根结底,GNOME 文本编辑器依旧是一个文本编辑器,无法也无意用来打开 doc 文件。如果你执意用它要打开 doc 文件,你看到的就只有一堆乱码。当然,pdf 文件也是如此。 + +![][14] + +此外,GNOME 文本编辑器并不是专门用来写复杂代码的,它无法取代 VS Code 等代码编辑器。如果说偶尔用来读读代码或者写写 shell 脚本,倒也无伤大雅,但是它并不具备管理项目文件夹和运行代码等功能。 + +### 安装 GNOME 文本编辑器 + +就像笔者在开头所说,GNOME 文本编辑器已经和 GNOME 42 一起发布了,不过它并不属于默认安装的软件。在 Ubuntu 22.04,Universe 仓库里就有 GNOME 文本编辑器,你可以通过输入下面的命令进行安装: + +``` +sudo apt install gnome-text-editor +``` + +其他采用 GNOME 42 的发行版也可以获取 GNOME 文本编辑器,请在安装前查看所用系统的 [桌面环境版本][15]。 + +安装完成后,可以点击屏幕左上角的“活动Activities”按钮,查找并打开 GNOME 文本编辑器。它的图标与 Gedit 的图标相似,但设计更为新颖。 + +![][16] + +### 总结 + +[Gedit][17] 是一款非常完善的文本编辑器,也是 GNOME 桌面环境长期以来的预装软件。几年前,Gedit 疏于开发,但现在已经恢复了开发。然而,如今 GNOME 团队正在努力为 GTK 4 和 libadwaita 改进核心应用程序。 + +GNOME 文本编辑器很像 Gedit 的翻版,两者有着相似的界面和功能。不过,GNOME 文本编辑器与新版 GNOME 的设计风格更加统一,使用体验也更加流畅。 + +这款新的编辑器日后很有可能会成为 GNOME 的默认文本编辑器。不过让人感兴趣的是,GNOME 文本编辑器将来是否会拥有自己的插件生态呢? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gnome-text-editor/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[aREversez](https://github.com/aREversez) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-14060-1.html +[2]: https://itsfoss.com/ubuntu-22-04-release-features/ +[3]: https://news.itsfoss.com/gnome-libadwaita-library/ +[4]: https://itsfoss.com/visual-studio-code-vs-atom/ +[5]: https://itsfoss.com/wp-content/uploads/2022/04/restore-session-option-gnome-text-editor-1.png +[6]: https://itsfoss.com/wp-content/uploads/2022/04/system-theme-option-gnome-text-editor-800x560.png +[7]: https://itsfoss.com/wp-content/uploads/2022/04/theme-options-gnome-text-editor.png +[8]: https://itsfoss.com/wp-content/uploads/2022/04/unsaved-file-gnome-text-editor-800x481.png +[9]: https://itsfoss.com/wp-content/uploads/2022/04/save-prompt-gnome-text-editor.png +[10]: https://itsfoss.com/how-to-enable-auto-save-feature-in-gedit/ +[11]: https://itsfoss.com/wp-content/uploads/2022/04/syntax-highlight-gnome-text-editor.png +[12]: https://itsfoss.com/wp-content/uploads/2022/04/keyboard-shortcuts-gnome-text-editor-800x637.png +[13]: https://itsfoss.com/wp-content/uploads/2022/04/search-replace-gnome-text-editor-800x477.png +[14]: https://itsfoss.com/wp-content/uploads/2022/04/doc-in-gnome-text-editor-800x485.png +[15]: https://itsfoss.com/find-desktop-environment/ +[16]: https://itsfoss.com/wp-content/uploads/2022/04/new-gnome-text-editor.png +[17]: https://wiki.gnome.org/Apps/Gedit diff --git a/published/20220427 How I grew my product management career with open source.md b/published/20220427 How I grew my product management career with open source.md new file mode 100644 index 0000000000..db01843fd6 --- /dev/null +++ b/published/20220427 How I grew my product management career with open source.md @@ -0,0 +1,117 @@ +[#]: subject: "How I grew my product management career with open source" +[#]: via: "https://opensource.com/article/22/4/product-management-open-source" +[#]: author: "Shebuel Inyang https://opensource.com/users/shebuel" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14562-1.html" + +我如何通过开源来发展我的产品经理职业 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/08/112446zy420r4zutdlu0ol.jpg) + +> 毫不夸张地说,在开源方面获得的经验,帮助我在产品管理领域创造了一条成功的职业道路。 + +我是一个充满好奇心的人,我喜欢探索科技行业的许多领域,从视觉设计、编程到产品管理。我也被开放源码的理念所吸引。因此,我很高兴与大家分享我作为一个产品经理(PM),是如何利用开源来建立我的职业生涯的。我相信我的经验可以帮助其他对产品管理感兴趣的人。 + +### 什么是开源软件 + +简单地说,开源软件是开放源代码的软件,这意味着任何人都可以检查、修改、增强和分享它的源代码。我们发表过一篇详细、[全面的文章][3] 来帮助你了解什么是开源。 + +我最早知道开源是很久以前了,那时,我还是一名刚入行不久的视觉设计师。我很想知道开源是什么,也很想知道如何成为它的一部分。在这种好奇心的驱使下,我接触到了一些有经验的开源贡献者和倡导者。虽然我当时没有做出贡献,但是他们让我知道了什么是社区,这对我下定决心开始贡献有很大帮助。 + +### 如何上手产品管理 + +产品管理工作貌似是一件很难上手的事情,感觉必须要戴上拳击手套,经过一番搏斗,才能强行进入这一行。然而,我从其他产品经理那里听说,与编写/调试代码块,或使用像素点生成复杂的产品设计线框相比,产品管理工作其实是更好上手的。 + +虽然我们的经历和经验各不相同,但是有一点可以确定:成为产品经理的道路往往是漫长而不可预知的。随着就业竞争的不断加剧,获得一个初级产品经理的职位可能会很困难。应聘者通常被要求有 2 到 3 年的经验才能加入产品团队。这时你可能会问:“我应该如何获得这些经验呢?” + +来看看下面这四个策略吧,它们或许能够将你的职业生涯转向到产品管理: + +1. 在一个大型组织的内部转岗。这可能需要你的经理为你说一些好话,比如,说你很适合在公司内部转岗等。你必须有证据表明你掌握了该岗位的技能。这通常被认为是获得产品管理经验的最快 +2. 担任大型组织的初级产品经理角色。通过它获得实习机会,或者加入一个需要初级产品经理的关副产品管理项目,这些都很常见。 +3. 你也可以尝试通过加入创业公司来上手产品管理工作。 +4. 你还可以启动一个自己的副业项目来上手产品管理工作。 + +缺乏实践经验,就很难成为产品经理。正如开源产品经理 [David Ryan][4] 所说,“有一条获得实际的产品管理经验的途径,它既未被人充分利用,也很少有人意识到并利用它们”。 + +这条途径是什么? + +### 答案就是开源 + +一个开放源码项目要想成功,需要的不仅仅是代码。它还包括项目战略、用户研究,以及将战略与日常工作联系起来。这些都是产品经理应该积极参加的活动。但是,在产品管理这一行里,有多少职责会分配给一个新手产品经理呢? + +[Susana Videira Lopes][5] 在她的一篇文章中指出,“获得一个入门级的产品角色,本质就是以一种建立你的信心的方式,让你加入到至产品管理这一行,同时尽早为组织提供价值”。 + +一个入门级的产品经理该如何参与开源项目,并为它提供价值呢? + +**答案很简单:多问问题** + +这里有一些你可以问的问题: + +* 正在探索的是什么问题/机会? +* 如何制定解决方案来解决这个问题? +* 用什么标准来确定项目是否成功? +* 这个解决方案的服务对象是谁? +* 他们是如何被告知这个解决方案的? +* 该解决方案如何与当前和更广泛的生态系统相适应? +* 项目的文件是在哪里维护的? +* 项目维护者是否了解无障碍accessibility要求?它们是否被满足? + +既然你已经获得了产品经理的所需技能,为何不应用它们呢?结合所学,表达出你深思熟虑的问题,并邀请你的团队来评估吧!你的团队可以选择那些能引起开发者和社区共鸣的问题,并优先考虑其中最重要的。 + +这些问题可以帮助你建立用户角色、用户旅程图、精益画布,以及更多。这种经验对发展职业潜力有很大的帮助。 + +### 我在 OpenUnited 的经历 + +[OpenUnited][6] 是一个以独特方式连接数字人才和工作的平台。我们与贡献者合作,帮助他们投入到高质量的开源产品,从而证明自身的特定技能。一旦他们的工作得到验证,这些有才华的贡献者就有资格在公司里从事有偿工作。 + +OpenUnited 是一个开源平台,为各类贡献者(包括产品经理、开发人员、设计师、商业分析师和其他人)提供服务。它致力于帮助贡献者提高技能,并为他们提供长期的高质量付费工作来源。 + +Miro 公司的高级产品经理 Farbod Saraf 让我加入他与合作伙伴创建的一个平台。我加入了这个项目,并了解了如何对 OpenUnited 做出贡献。我还了解了其他可以帮助我在产品管理生涯中成长的项目,并做出了我的第一次贡献。这是一次很好的经历,因为我可以迅速地开始投入到产品的某些部分,以改善平台上其他用户的体验。在我为项目做贡献的时候,我的导师 Farbod 随时为我提供任何需要的帮助,使我的工作更加轻松。 + +你对开源项目所做的一切贡献,都会成为你成长为产品经理过程中的有力的公共记录。对于任何想通过开源上手产品管理的人,我都强烈推荐 OpenUnited 平台。 + +### 如何找到开源项目 + +许多人认为,贡献开源只适合于开发人员,因为他们觉得找到一个可以舒适地贡献的开源项目是很难的。 + +即使作为一个初出茅庐的产品经理,也有好几种方法可以找到适合贡献的开源项目。这里列出了一些: + +* 在产品经理社区中发言,如 Mind The Product 和 Product School。 +* 参加当地的聚会和开源会议,如非洲开源社区节,以此来与开源项目的创建者和维护者保持联系。 +* 与在 GitLab 或 Mozilla 等大型开源公司工作的产品经理接触。他们可能会把你推荐到需要你的技能和贡献的开源项目中。 +* 联系开源公司的开源倡导者和开发者关系团队,让他们推荐一些适合入门级产品经理贡献的开源项目。 +* 寻找 AngelList 上的开源公司或 Product Hunt 上流行的开源产品。这些都是你可以找到适合贡献的开源产品的好地方。 + +### 下一步 + +[Ruth Ikegah][7] 是我的一个重要灵感来源,她 [为开源新手写了一篇文章][8]。她的文章给出了一些提示,在你开始为开源做贡献时,可能需要考虑一下它们。 + +在加入和贡献项目、社区或组织之前,对它们做一些研究,并提出自己的问题。当你最终决定加入社区时,试着积极地介绍自己,并说明你可以在哪些方面提供帮助。 + +当然,开源不仅仅是你职业生涯的一个垫脚石。它本身就是一个平台,而且它需要优秀的产品经理。参与进来吧!一方面,你能为社区做出贡献;另一方面,它也能帮助你磨练自己的技能。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/4/product-management-open-source + +作者:[Shebuel Inyang][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/shebuel +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/rh_003784_02_os.comcareers_resume_rh1x.png +[2]: http://Opensource.com +[3]: https://linux.cn/article-8624-1.html +[4]: https://twitter.com/hellodavidryan +[5]: https://twitter.com/susanavlopes +[6]: https://openunited.com +[7]: https://stars.github.com/profiles/ruth-ikegah/ +[8]: https://ruthikegah.xyz/a-beginners-guide-to-open-source diff --git a/published/20220427 Shortwave 3.0 is Here With UI Upgrades, Private Stations, and More Improvements.md b/published/20220427 Shortwave 3.0 is Here With UI Upgrades, Private Stations, and More Improvements.md new file mode 100644 index 0000000000..7ebc44b322 --- /dev/null +++ b/published/20220427 Shortwave 3.0 is Here With UI Upgrades, Private Stations, and More Improvements.md @@ -0,0 +1,115 @@ +[#]: subject: "Shortwave 3.0 is Here With UI Upgrades, Private Stations, and More Improvements" +[#]: via: "https://news.itsfoss.com/shortwave-3-0-release/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14528-1.html" + +Shortwave 3.0 发布:用户界面更新、私人电台以及诸多改进 +====== + +> Shortwave 3.0 带来了急需的用户界面改进、添加私人电台的功能以及诸多升级。 + +![Shortave 3.0][1] + +Shortwave 是 GNOME 上的一个流行的网络广播播放器。它默认提供了很多电台,总计超过 25000 个,所有这些电台都可以分组组织、进行搜索,还可以投射到其他设备(如 Chromecast)上。 + +Shortwave 3.0 将这些功能提升至一个全新的水平,有一些相当大的变化。让我们来看看有哪些新功能吧! + +### Shortwave 3.0 新功能 + +主要是引入了 Libadwaita,除此之外,Shortwave 3.0 还包括以下更新: + +* 支持 GNOME 42 的深色模式 +* 支持将私人电台添加到库中 +* 支持将电台数据保存到磁盘上 +* 改进了搜索结果的排序 + +#### 用户界面的变化 + +![图源:Felix Häcker][2] + +在过去的几个月里,许多应用程序都在向 [Libadwaita][3] 过渡。由于其流畅的视觉效果、集成的开发工作流程以及与 GNOME 的整合,它已经迅速成为所有新应用程序的必备工具。 + +最新一个升级到 Libadwaita 的应用程序是 Shortwave。因此,它现在有了一个自适应的用户界面,这对类似于 [PinePhone][4] 的 Linux 手机可能很有用。 + +![][5] + +此外,它现在采用了更现代的 Adwaita 设计,我非常喜欢。 + +随着用户界面的改进,它也支持新的 GNOME 42 的深色模式。下面是它的外观。 + +![Shortwave 3.0 深色模式][6] + +#### 保存电台数据 + +![][7] + +一个有用的新功能是支持将电台数据保存到磁盘上,而无需每次从服务器上接收。 + +因此,即使一个电台从服务器(`radio-browser.info`)上删除,它也会保留在应用程序中,并有消息通知用户这一变化。 + +#### 添加私人电台 + +![][8] + +以前,你必须依赖 [radio-browser.info][9] 库中的可用电台。 + +现在,你可以从内部网络添加你的私人电台,或者通过 API 密钥添加一个独家/付费流。 + +![][10] + +#### 其他变化 + +除了上面列出的那些,Shortwave 3.0 还有一些其他的改进: + +* 显示电台比特率信息,这也可以作为一个排序选项。 +* 在搜索页面上新增了一个按钮,可以对搜索结果进行排序。 +* 大幅度修改了电台对话框,显示信息更加清晰。 +* 在歌曲变化时更新桌面通知,而不是为每首歌曲生成新的单独通知。 +* 即使 `radio-browser.info` 处于离线/不可用状态,Shortwave 也可以正常使用。 + +### 总结 + +![][11] + +总的来说,Shortwave 3.0 是一个很棒的版本,它既改善了用户体验,又增加了新功能。 + +如果你想安装它,你可以到它的 [Flathub][12] 页面查看安装指南,或者直接在你的终端键入以下命令。 + +``` +flatpak install flathub de.haeckerfelix.Shortwave +``` + +如果你还没有设置 Flatpak,你也可以参考我们的 [Flatpak 指南][13]。 + +你尝试过 Shortwave 3.0 了吗?请在下面的评论中分享你的使用体验吧! + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/shortwave-3-0-release/ + +作者:[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/04/shortwave-3-0.jpg +[2]: https://news.itsfoss.com/wp-content/uploads/2022/04/shortwave3.0.png +[3]: https://news.itsfoss.com/gnome-libadwaita-library/ +[4]: https://news.itsfoss.com/pinephone-review/ +[5]: https://news.itsfoss.com/wp-content/uploads/2022/04/shortwave-3-responsive.jpg +[6]: https://news.itsfoss.com/wp-content/uploads/2022/04/shortwave-3-dark-mode.jpg +[7]: https://news.itsfoss.com/wp-content/uploads/2022/04/shortwave-station-data.png +[8]: https://news.itsfoss.com/wp-content/uploads/2022/04/shortwave-3-create.png +[9]: https://www.radio-browser.info/ +[10]: https://news.itsfoss.com/wp-content/uploads/2022/04/shortwave-3-private-station.png +[11]: https://news.itsfoss.com/wp-content/uploads/2022/04/shortwave-3-0.mp4 +[12]: https://flathub.org/ +[13]: https://itsfoss.com/flatpak-guide/ diff --git a/published/20220428 Archinstall-s New Menu System Makes it Even Easier to Install Arch Linux.md b/published/20220428 Archinstall-s New Menu System Makes it Even Easier to Install Arch Linux.md new file mode 100644 index 0000000000..3d6d44ac54 --- /dev/null +++ b/published/20220428 Archinstall-s New Menu System Makes it Even Easier to Install Arch Linux.md @@ -0,0 +1,94 @@ +[#]: subject: "Archinstall’s New Menu System Makes it Even Easier to Install Arch Linux" +[#]: via: "https://news.itsfoss.com/archinstall-menu/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14536-1.html" + +Archinstall 新的菜单系统让安装 Arch Linux 更容易了 +====== + +> Archinstall 让人们更容易上手 Arch Linux,也应该可以为经验丰富的 Linux 用户节省时间。你觉得呢? + +![][1] + +去年的这个时候,Arch Linux [引入了一个引导式的安装程序][2],使其安装过程更加简单。 + +你只需要输入 `archinstall`,就可以开始一步步的安装,而不需要自己全部定制。 + +即使你不是新手用户,它应该也能为你正常安装 Arch Linux 节省一些时间。你可以配置所有基本选项,无论是创建普通用户或 root 用户,还是选择桌面、挑选软件包、选择音频服务器,等等。 + +如果你感兴趣的话,可以在我们的 [在 VirtualBox 里安装 Arch Linux 的指南][3] 中看看 Archinstall 的实际使用。 + +现在,Archinstall v2.4.1 已发布,我们有了新的菜单系统和大量的技术变化。 + +让我们来看看它是如何工作的吧! + +### 新菜单系统及无障碍改进 + +![][4] + +新的菜单系统看起来更有条理了。 + +它是以 [simple-term-menu][5] 为基础建立的,simple-term-menu 是一个用于在命令行中创建交互式菜单的软件包。为了避免外部依赖,它与源代码捆绑,这要归功于 Ingo Meyer(开发者)。 + +另外还得感谢其他开发者,其中包括 [Werner Llácer][6] 和 [Daniel][7],是他们编写了 1200 多行代码,才让这成为可能。 + +这个菜单系统也是无障碍的。你可以用数字键盘上的 `*` 把它切换到跟踪选择模式,这应该能让 espeakup 如预期的工作。 + +在 Archinstall 的未来版本中,它也会支持默认的跟踪模式。 + +在上面的截图中,你可能会注意到,它支持设置语言、键盘布局、内核、音频服务器、用户、网络和其他基本选项。 + +当你选择了硬盘后,菜单将增加另一个选项,让你选择一个“磁盘布局”,你可以在其中选择文件系统的类型。 + +![][8] + +同样,设置每一个选项时,你都可以调整更多细节,比如桌面环境的配置文件。 + +![][9] + +默认情况下,它会启用一个交换分区。不过,你可以根据你的需要进行调整。总的来说,这应该是一个顺滑的体验,所有的安装先决条件都以菜单形式呈现。 + +在此感谢我们团队中的 Sreenath,是他测试并提供了这些屏幕截图。 + +![][10] + +除了这些变化之外,你还可以期待以下改进: + + * 如果你选择 btrfs 作为文件系统,会添加一个 BTRFS 压缩选项。 + * Archinstall 现在支持同时进行多个网卡配置的手动配置。 + * 安装程序可以通过 `archinstall.Installer()` 跟踪哪些软件包已经安装完毕。 + +要查看所有的技术变化和错误修复,你可以参考 [GitHub 上的发布说明][11]。 + +**你可以等待最新的 ISO(计划在 5 月 1 日发布),或者从 GitHub 上下载并自己尝试。** + +你试过 Arch Linux 上的原来的安装向导吗?还是说,相较于使用安装程序,你更偏向于自己手动配置一切?请在评论区分享你的想法吧! + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/archinstall-menu/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/wp-content/uploads/2022/04/archinstall-new-menusystem-makes-easier-to-install.png +[2]: https://news.itsfoss.com/arch-linux-easy-install/ +[3]: https://itsfoss.com/install-arch-linux-virtualbox/ +[4]: https://news.itsfoss.com/wp-content/uploads/2022/04/archinstall-new-menu.png +[5]: https://github.com/IngoMeyer441/simple-term-menu +[6]: https://github.com/wllacer +[7]: https://github.com/svartkanin +[8]: https://news.itsfoss.com/wp-content/uploads/2022/04/archinstall-filesystem.jpg +[9]: https://news.itsfoss.com/wp-content/uploads/2022/04/archinstall-profiles-1024x226.jpg +[10]: https://news.itsfoss.com/wp-content/uploads/2022/04/archinstall-config.png +[11]: https://github.com/archlinux/archinstall/releases/tag/v2.4.1 diff --git a/published/20220428 Elon Musk’s Plan To Open Source The Twitter Algorithm Has Flaws.md b/published/20220428 Elon Musk’s Plan To Open Source The Twitter Algorithm Has Flaws.md new file mode 100644 index 0000000000..708c4972da --- /dev/null +++ b/published/20220428 Elon Musk’s Plan To Open Source The Twitter Algorithm Has Flaws.md @@ -0,0 +1,48 @@ +[#]: subject: "Elon Musk’s Plan To Open Source The Twitter Algorithm Has Flaws" +[#]: via: "https://www.opensourceforu.com/2022/04/elon-musks-plan-to-open-source-the-twitter-algorithm-has-flaws/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14540-1.html" + +埃隆·马斯克开源推特算法的计划存在缺陷 +====== + +![推特][1] + +报道称,在推特确认接受收购请求的几个小时后,埃隆·马斯克就明确表示了他对推特的期望。马斯克在一份新闻稿中罗列了他计划做出的重大改变,包括开源“决定用户在推流中看到什么”的算法。 + +马斯克希望开源推特的算法,是因为他长期以来一直担心该平台有可能进行政治压制。但老实说,即便开源,也不可能达到他的预期效果。专家们担心,这可能反而带来一连串意想不到的问题。 + +虽然马斯克对权威深恶痛绝,但是他对算法开源的野心和世界各地立法者的愿望不谋而合。近年来,许多政府都将这一原则作为打击大科技公司的基石。 + +英国社交媒体监管机构 Ofcom 的首席执行官 Melanie Dawes 曾表示,社交媒体公司应当解释其代码的运作方式。此外,欧盟新近通过的《数字服务法案Digital Services Act(DSA)》于 4 月 23 日获得批准,该法案将责成平台提供更多的公开性。2022 年 2 月,美国的民主党参议员提交了《算法问责法案Algorithmic Accountability Act(AAA)》的立法申请。这些法案的目标是加强算法的透明度和监督,包括我们在社交媒体上的“时间轴timeline”和“新闻流news feed”以及我们生活的其他方面。 + +允许竞争者看到并修改推特的算法,可能意味着有人会偷取源代码,并提供一个改名的版本。互联网的许多部分都运行在开源软件上,其中最著名的就是 OpenSSL,这是一个被大量在线使用的安全工具包,而它在 2014 年被黑客攻击了。 + +还有一些已经创建的开源社交网络。Mastodon 是一个微博网络,为回应对 Twitter 主导地位的担忧而创建。它允许用户检查其代码,这些代码可在 GitHub 软件仓库中找到。 + +然而,阅读一个算法背后的代码,并不总能告诉你它的工作方式,而且对于大部分普通人来说,它也提供不了足够的关于公司组织架构以及开发流程的信息。 + +Jonathan Gray 是伦敦国王学院/关键基础设施研究的高级讲师,他说:“这有点像只用遗传物质来理解古代生物。是的,它能告诉我们的信息比任何方式都多,但如果说我们因此了解它们的生活方式,那就太夸张了。” + +推特同样也不是由单一算法控制的。Catherine Flick 是英国德蒙福特大学/研究计算和社会责任的研究员,她说:“其中一些会决定人们在他们的“时间轴”上看到什么趋势、内容或者推荐关注的人。调节用户“时间轴”上显示哪些信息的算法,将会是人们最感兴趣的。然而,即使如此,如果缺少训练数据,单纯开源算法也没多大用处。” + +Cobbe 认为,开源推特算法的危害大于好处。因为计算机代码并没有透露算法是如何开发或评估的:有哪些元素或考虑、在这个过程中的优先级是什么等等。所以开源可能不会使推特的透明度发生重大变化。反而,它可能会带来严重的安全隐患。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/04/elon-musks-plan-to-open-source-the-twitter-algorithm-has-flaws/ + +作者:[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/04/twiiter-696x392.jpg diff --git a/published/20220428 How to Remove Snap Packages in Ubuntu Linux.md b/published/20220428 How to Remove Snap Packages in Ubuntu Linux.md new file mode 100644 index 0000000000..a4dc0787df --- /dev/null +++ b/published/20220428 How to Remove Snap Packages in Ubuntu Linux.md @@ -0,0 +1,183 @@ +[#]: subject: "How to Remove Snap Packages in Ubuntu Linux" +[#]: via: "https://www.debugpoint.com/2022/04/remove-snap-ubuntu/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "hwlife" +[#]: reviewer: "turbokernel, wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14567-1.html" + +怎样在 Ubuntu Linux 中移除 Snap 软件包 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/09/103449pfqp2yp2rpzgp92l.jpg) + +> 这是一篇关于在 Ubuntu Linux 系统中如何删除 Snap,以得到一个无 Snap 系统的教程。 + +由 Canonical 开发的 Snap 软件包在一些场景下是有益的。它为终端用户直接提供了轻便且快速的程序更新。不仅如此,它还有其他的好处,比如它打包了所有依赖包,并允许安装同一个应用的多个版本。此外,它运行在沙盒模式,提供了安全和其他方面的好处。 + +在这些好处中, Snap 技术也有一些地方备受争论。举个例子,几乎所有使用 Snap 软件包的用户都说它的性能较差,包括它的启动时间要比本地 deb 或者 RPM 软件包时间要长。另外,由于它的设计,程序安装的体积巨大,浪费磁盘空间,因为它打包了所有用到的依赖包。 + +不仅如此,由于沙盒的天然属性,Snap 程序可能无法访问你的 Linux 桌面的几个部分,除非提供了适当的权限。 + +这个指南阐述了你如何从 Ubuntu 系统中完全移除 Snap。 + +这些步骤在 [Ubuntu 22.04 LTS Jammy Jellyfish][1] 中进行了测试。然而,它应该也适用于所有的 Ubuntu 系统版本。 + +> **警告:这些步骤将会移除 Ubuntu 系统中两个关键的程序:软件商店和 Firefox。尝试这些步骤之前确认你已经对书签和 Firefox 的其它设置做了备份。** + +### 在 Ubuntu Linux 移除 Snap 软件包 + +1、在你的系统中打开一个终端,使用以下命令查看已经安装的 Snap 软件包的列表。它显示了 Snap 软件包,比如 Firefox,软件商店,主题以及其它默认已经安装的核心软件包。 + +``` +snap list +``` + +![ Ubuntu Snap 包列表][2] + +2、按照以下的顺序移除 Snap 软件包。首先移除 Firefox。然后是软件商店,和用以上命令看到的你的系统中的其它软件包。 + +``` +sudo snap remove --purge firefox +sudo snap remove --purge snap-store +sudo snap remove --purge gnome-3-38-2004 +``` + +``` +sudo snap remove --purge gtk-common-themes +sudo snap remove --purge snapd-desktop-integration +sudo snap remove --purge bare +sudo snap remove --purge core20 +sudo snap remove --purge snapd +``` + +3、最后,通过 `apt` 命令移除 Snap 服务。 + +``` +sudo apt remove --autoremove snapd +``` + +![移除 Snap 包和其它][3] + +这还没完,即使你用以上命令移除了 Snap 软件包,但是如果你没有关闭 apt 触发器,`sudo apt update` 命令会再一次将 Snap 安装回来。 + +4、所以,要关闭它,我们需要在 `/etc/apt/preferences.d/` 目录下创建一个 apt 设置文件 `nosnap.pref` 来关闭 Snap 服务。 + +``` +sudo gedit /etc/apt/preferences.d/nosnap.pref +``` + +5、添加以下的命令行,并保存该文件。 + +``` +Package: snapd +Pin: release a=* +Pin-Priority: -10 +``` + +![创建设置文件][4] + +如果你知道如何使用它,那么这个 apt 设置文件是一个潜在的工具。举个例子,在以上的状态中,`Pin-Priority -10` 意思就是阻止 Snap 软件包的安装。 + +与这个教程不相关的,举个例子,如果你想给所有发行版代号为 “bulleye” 的软件包超高优先权的话,那么就可以查看这些设置文件。如果你想了解更多,你可以访问 [apt 手册页][5]。 + +``` +Package: * +Pin: release n=bullseye +Pin-Priority: 900 +``` + +6、回到我们的主题,一旦你已经保存和关闭以上文件,从终端中再次运行以下命令。 + +``` +sudo apt update +``` + +7、最后,从 Ubuntu 中移除 Snap 的步骤全部完成。 + +### 从 Ubuntu 移除 Snap 后使用 deb 文件安装软件商店和 Firefox + +你已经移除了 Firefox 和软件商店,但是你的工作还需要它们。 + +要安装 apt 版的 GNOME 软件商店,你可以使用以下命令。确保使用 `--install-suggests` 参数。否则,将会再次安装上 Snap 版本的软件包管理器! + +``` +sudo apt install --install-suggests gnome-software +``` + +要安装 Firefox,通过以下命令使用官方 PPA 仓库。 + +``` +sudo add-apt-repository ppa:mozillateam/ppa +sudo apt update +sudo apt install -t 'o=LP-PPA-mozillateam' firefox +``` + +![添加 PPA 仓库][7] + +![从 PPA 仓库以 deb 文件形式安装 Firefox][8] + +一旦你已经安装完 Firefox,使用以下命令开启自动更新。要了解更多,[访问此页][9]。 + +``` +echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox +``` + +最后但同样重要,当运行 `apt` 时,为 Firefox 创建另一个设置文件给予以上 PPA 仓库超高优先权。如果你不这么做,`apt update` 命令会再次安装 Snap 版本 Firefox,并把它的“ Snap 朋友们”带回来 😂😂😂。 + +``` +sudo gedit /etc/apt/preferences.d/mozillateamppa +``` + +最后,添加这些命令行并保存文件。 + +``` +Package: firefox* +Pin: release o=LP-PPA-mozillateam +Pin-Priority: 501 +``` + +完成。 + +### 在 Ubuntu 系统恢复到 Snap 软件包 + +如果你改变想法,移除该设置文件,并通过以下命令再次启动安装程序。 + +``` +sudo rm /etc/apt/preferences.d/nosnap.pref +sudo apt update && sudo apt upgrade +sudo snap install snap-store +sudo apt install firefox +``` + +### 总结 + +关于在 Ubuntu 下移除 Snap 软件包做个总结,我想说的是这些处理 Snap 软件包的方法实属无奈。主要是这对新用户来说很困难。我希望这个指南能帮助你处理好 Snap 软件包。完结撒花。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/04/remove-snap-ubuntu/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[turbokernel](https://github.com/turbokernel), [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/lujun9972 +[1]: https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/04/Snap-list-in-Ubuntu.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/04/remove-snap-and-others-1024x544.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/04/create-a-pref-file.jpg +[5]: https://manpages.ubuntu.com/manpages/focal/man5/apt_preferences.5.html +[6]: https://www.debugpoint.com/2016/07/how-to-install-and-use-snap-packages-in-ubuntu/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/04/Add-the-PPA-1024x550.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/04/Install-Firefox-as-deb-file-from-PPA-1024x548.jpg +[9]: https://www.debugpoint.com/2021/09/remove-firefox-snap-ubuntu/ +[10]: https://t.me/debugpoint +[11]: https://twitter.com/DebugPoint +[12]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[13]: https://facebook.com/DebugPoint diff --git a/published/20220428 Why use Apache Druid for your open source analytics database.md b/published/20220428 Why use Apache Druid for your open source analytics database.md new file mode 100644 index 0000000000..cda559a86e --- /dev/null +++ b/published/20220428 Why use Apache Druid for your open source analytics database.md @@ -0,0 +1,83 @@ +[#]: subject: "Why use Apache Druid for your open source analytics database" +[#]: via: "https://opensource.com/article/22/4/apache-druid-open-source-analytics" +[#]: author: "David Wang https://opensource.com/users/davidwang" +[#]: collector: "lkxed" +[#]: translator: "unigeorge" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14608-1.html" + +为什么推荐开源分析数据库 Apache Druid +====== + +> 对用户而言,优秀的对外数据分析工具非常关键,因此选择合适的数据架构就显得尤为重要。 + +![](https://img.linux.net.cn/data/attachment/album/202205/18/154417bvakcquzn2ahv4ua.jpg) + +现如今,数据分析不再是仅面向内部开发人员。当为业务方构建数据分析系统时,你需要确认哪种数据库后端是最合适的。 + +程序员的本能可能是“选用自己了解的数据库(例如 PostgreSQL 或 [MySQL][2])”。数据仓库也可能会扩展核心的 BI 仪表板和报告之外的功能,不过对业务方的数据分析支持仍是其重要功能之一,因此要选择合适的工具来保证此功能的性能。 + +问题的关键点在于用户体验,以下是对外支持数据分析工作的一些关键技术讨论点(以 Apache Druid 为例)。 + +### 低延迟特性 + +一直在队列中等待查询会让人很恼火。与延迟有关的因素包括数据量、数据库的处理能力、用户和 API 调用的数量,以及数据库支持查询应用的能力。 + +当数据量比较大时,有一些方法可以基于任意在线分析处理(OLAP)数据库构建交互式数据体验,但或多或少都有一些其他方面的牺牲。预计算查询会对性能要求较高,还会使架构变得僵化。预聚合处理会使数据粒度变大。将数据时间限制在近期的处理方式,会使得数据完整性得不到保证。 + +一个“不妥协”的解决方案是选择专为大规模交互而构建的优化架构和数据格式,[Apache Druid][3] 正是这样一个旨在支持现代分析程序的实时数据库。 + +* 首先,Druid 具备特有的分布式弹性架构,可将数据从共享数据层预取到近乎无限容量的数据服务器集群中。这种架构与诸如云数据仓库这样的解耦查询引擎相比,具有更快的性能,因为它不需要移动数据,并且比像 PostgreSQL 和 MySQL 这样的纵向扩展数据库具有更高的可扩展性。 +* 其次,Druid 采用内置于数据格式中的自动多级索引来驱动每个内核去支持更多查询操作。在常规 OLAP 列格式基础之上,还增加了全局索引、数据字典和位图索引,这可以最大化利用 CPU 周期,加快处理速度。 + +### 高可用性 + +如果开发团队为内部报告搭建了一个后端,那么中断几分钟甚至更长时间真的很严重吗?实际上并不是的。所以在典型 OLAP 数据库和数据仓库中,计划外的停机和维护是可以允许的。 + +但是如果你们团队构建了一个对外的供客户使用的分析应用程序,如果发生数据中断,会严重影响客户满意度、收入,当然还有你的周末休息时间。这就是为什么弹性(高可用性和数据持久性)需要成为对外分析应用程序数据库中的首要考虑因素。 + +考虑弹性就需要考虑设计标准。节点或集群范围的故障能完全避免吗?丢失数据的后果有多严重?保障应用程序和数据需要涉及哪些工作? + +关于服务器故障,保证弹性的常规方法是多节点服务以及 [备份机制][4]。但如果你是为客户构建应用程序,则对数据丢失的敏感性要高得多。*偶尔的*备份并不能完全解决这一问题。 + +Apache Druid 的核心架构内置了该问题的解决方案,本质是一种强大而简单的弹性方法,旨在保证承受任何变故都不会丢失数据(即使是刚刚发生的事件)。 + +Druid 基于对象存储中共享数据的自动、多级复制实现高可用性(HA)和持久性。它实现了用户期望的 HA 特性以及持续备份机制,即使整个集群出现问题,也可以自动保护和恢复数据库的最新状态。 + +### 多用户 + +一个好的应用应该同时兼备大用户量和“引人入胜”的体验,因此为高并发构建后端非常重要。你肯定不想看到因为应用挂掉而让客户沮丧。内部报告的架构不必考虑这点,因为并发用户数量要小得多且有限。所以现实是,用于内部报告的数据库可能并不适合高并发应用程序。 + +为高并发构建数据库主要在于取得 CPU 使用率、可伸缩性和成本之间的平衡点。解决并发问题的通常做法是投入更多硬件成本。逻辑上说,只要增加 CPU 的数量,就能够同时进行更多的查询操作。虽然事实确实如此,但成本的增加是不可忽视的。 + +更好的方法还是使用像 Apache Druid 这样的数据库,它具有优化的存储和查询引擎,可以降低 CPU 使用率。我们强调的关键词是“优化”。数据库不应该读取它不需要的数据。Apache Druid 可以让基础设施在同一时间跨度内为更多查询操作提供服务。 + +节省成本是开发人员使用 Apache Druid 构建外部分析应用程序的一个重要原因。Apache Druid 具有高度优化的数据格式,结合了从搜索引擎世界借鉴来的多级索引以及数据缩减算法,可以最大限度地减少所需的处理量。 + +最终表现就是 Apache Druid 提供了其他数据库不可比拟的处理效率。它可以支持每秒数十到数千跨度的 TB 甚至 PB 级别的查询。 + +### 着眼当下,预见未来 + +分析应用程序对于用户而言至关重要,所以要构建正确的数据架构。 + +你肯定不想一开始就选择了一个错误的数据库,然后在后续扩展时面对诸多令人头疼的问题。幸运的是,Apache Druid 可以从小规模开始,并在之后轻松扩展以支持任何可以想象的应用程序。Apache Druid 有 [优秀的官方文档][5],当然它是开源的,所以不妨尝试一下并,快速上手吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/4/apache-druid-open-source-analytics + +作者:[David Wang][a] +选题:[lkxed][b] +译者:[unigeorge](https://github.com/unigeorge) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/davidwang +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/metrics_data_dashboard_system_computer_analytics.png +[2]: https://opensource.com/downloads/mariadb-mysql-cheat-sheet +[3]: https://druid.apache.org/ +[4]: https://opensource.com/article/19/3/backup-solutions +[5]: https://druid.apache.org/docs/latest/design/ diff --git a/published/20220429 Detect a Phishing URL Using Machine Learning in Python.md b/published/20220429 Detect a Phishing URL Using Machine Learning in Python.md new file mode 100644 index 0000000000..1115910d61 --- /dev/null +++ b/published/20220429 Detect a Phishing URL Using Machine Learning in Python.md @@ -0,0 +1,92 @@ +[#]: subject: "Detect a Phishing URL Using Machine Learning in Python" +[#]: via: "https://www.opensourceforu.com/2022/04/detect-a-phishing-url-using-machine-learning-in-python/" +[#]: author: "Jishnu Saurav Mittapalli https://www.opensourceforu.com/author/jishnu-saurav-mittapalli/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14535-1.html" + +在 Python 中使用机器学习来检测钓鱼链接 +====== + +在网络钓鱼攻击中,用户会收到一封带有误导性链接的邮件或信息,攻击者可以利用它来收集重要数据,比如你的银行卡密码。本文将会给出一个简短的教程,旨在介绍如何检测这种网络钓鱼的企图。 + +![](https://img.linux.net.cn/data/attachment/album/202205/02/180603k231bbvubv3b23u6.jpg) + +通过网络钓鱼攻击,攻击者能够获得一些重要凭证,这些凭证可以用来进入你的银行或其他金融账户。攻击者发送的 URL 看起来与我们日常使用的原始应用程序完全相同。这也是人们经常相信它,并在其中输入个人信息的原因。钓鱼网址可以打开一个网页,它看起来与你的银行的原始登录页面相似。最近,这样的网络钓鱼攻击正变得相当普遍,所以,检测钓鱼链接变得非常重要。因此,我将介绍如何在 Python 中使用机器学习来检查一个链接是误导性的还是真实的,因为它可以帮助我们看到网页代码及其输出。注意,本文将使用 Jupyter Notebook。当然,你也可以使用 Google Colab 或 Amazon Sagemaker,如果你对这些更熟悉的话。 + +### 下载数据集 + +第一步,我们需要用于训练数据集。你可以从下面的链接中下载数据集。 + +* 真实的链接:https://github.com/jishnusaurav/Phishing-attack-PCAP-analysis-using-scapy/blob/master/Phishing-Website-Detection/datasets/legitimate-urls.csv +* 钓鱼链接:https://github.com/jishnusaurav/Phishing-attack-PCAP-analysis-using-scapy/blob/master/Phishing-Website-Detection/datasets/phishing-urls.csv + +### 训练机器进行预测 + +当数据集下载完成,我们需要使用以下几行代码来导入所需的库: + +``` +import pandas as pd +from sklearn.ensemble import RandomForestClassifier +``` + +如果你没有这些库,你可以使用 `pip` 工具来安装这些库,如下图所示: + +![使用 pip 工具安装依赖库][2] + +当依赖安装完成,你就可以导入数据集,并将其转换为 `pandas` 数据框架,使用以下几行代码进一步处理: + +``` +legitimate_urls = pd.read_csv(“/home/jishnusaurav/jupyter/Phishing-Website-Detection/datasets/legitimate-urls.csv”) +phishing_urls = pd.read_csv(“/home/jishnusaurav/jupyter/Phishing-Website-Detection/datasets/phishing-urls.csv”) +``` + +在成功导入后,我们需要把这两个数据集合并,以便形成一个数据集。合并后的数据集的前几行如下图所示: + +![合并后的数据集的前几行][3] + +然后去掉那些我们不需要的列,如路径(`path`)、协议(`protocol`)等,以达到预测的目的: + +``` +urls = urls.drop(urls.columns[[0,3,5]],axis=1) +``` + +在这之后,我们需要使用以下代码将数据集分成测试和训练两部分: + +``` +data_train, data_test, labels_train, labels_test = train_test_split(urls_without_labels, labels, test_size=0.30, random_state=110) +``` + +接着,我们使用 `sklearn` 的随机森林分类器建立一个模型,然后使用 `fit` 函数来训练这个模型。 + +``` +random_forest_classifier = RandomForestClassifier() +random_forest_classifier.fit(data_train,labels_train) +``` + +完成这些后,我们就可以使用 `predict` 函数来最终预测哪些链接是钓鱼链接。下面这行可用于预测: + +``` +prediction_label = random_forest_classifier.predict(test_data) +``` + +就是这样啦!你已经建立了一个机器学习模型,它可以预测一个链接是否是钓鱼链接。试一下吧,我相信你会满意的! + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/04/detect-a-phishing-url-using-machine-learning-in-python/ + +作者:[Jishnu Saurav Mittapalli][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/jishnu-saurav-mittapalli/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/03/phishing-attack-696x477.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Figure-1-First-few-lines-of-the-data-set.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Figure-2-Installing-libraries.jpg diff --git a/published/20220430 Hands On With GNOME’s New Terminal for Linux Users.md b/published/20220430 Hands On With GNOME’s New Terminal for Linux Users.md new file mode 100644 index 0000000000..6e2984b1e5 --- /dev/null +++ b/published/20220430 Hands On With GNOME’s New Terminal for Linux Users.md @@ -0,0 +1,144 @@ +[#]: subject: "Hands On With GNOME’s New Terminal for Linux Users" +[#]: via: "https://itsfoss.com/gnome-console/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14595-1.html" + +GNOME 新终端程序尝鲜 +====== + +几天前,我分享了我 [对新 GNOME 文本编辑器的体验][1],它是原编辑器 Gedit 的替代品。 + +但它并不是唯一的应用程序替代品。GNOME 42 还有一个新的终端,叫做 [控制台][2]Console。 + +让我来分享一下 GNOME 提供的这个新终端的新功能,以及它的使用体验吧! + +### 控制台:GNOME 的新终端模拟器 + +这个新应用程序的目标是提供一个“简单的、用户友好的终端模拟器”。它确实“简单”,因为它没有提供以往 GNOME 终端下用户习惯的许多功能。 + +后面我会继续谈这个话题。让我们先看看 GNOME 控制台的新功能。 + +#### 桌面通知 + +Ubuntu 上的 GNOME 终端从来没有这个功能,不过我在 elementary 和 Fedora 等发行版中看到过。 + +这是一个很方便的功能,当一个长期运行的命令执行完毕时,终端会发送一个桌面通知。 + +![GNOME 控制台的通知][3] + +如果你在命令正在运行的同时,需要做其他事情,那么得到命令完成的通知有助于你保持工作效率。 + +#### 进行 root 和 SSH 操作时改变窗口颜色 + +这很可能是我在其他终端程序中没有见过的独特功能。 + +当你用 `sudo` 运行命令或 [切换到 root 用户][4] 时,应用程序窗口会变成红色。 + +![GNOME 控制台在使用 sudo 或 root 用户时变成红色][5] + +我想它的目的是警告用户他们正在使用高级权限,因此在运行命令时要小心。 + +同样,如果你使用 SSH 连接到一个远程服务器,终端应用程序窗口的颜色会变成紫色。 + +![GNOME 控制台在 SSH 连接时变成紫色][5a] + +这也是提醒用户命令正在远程 Linux 机器上运行,而不是在本地机器上运行的好方法。 + +#### 主题 + +遵循新的设计准则,控制台提供了三种主题:浅色、深色和跟随系统。 + +![GNOME 控制台主题][6] + +控制台默认使用系统主题,它根据你的操作系统的深浅主题而改变终端配色。你也可以单独使用控制台的浅色/深色主题,而不用改变系统主题。 + +关于主题的内容差不多就这些。你可以进行的 [终端定制][7] 并不多。 + +### 关闭终端窗口时更好的警告 + +当你试图关闭一个仍在运行的命令时,老的 GNOME 终端也会显示一个警告。 + +![旧版 GNOME 终端中的警告][7a] + +这个警告在新的 GNOME 控制台中稍好一些,因为它也会显示正在运行的命令。 + +![新版 GNOME 控制台中的警告][7b] + +#### 透明界面 + +GNOME 控制台默认有一个透明界面。在正常模式下,你可以透过它看到一点背景。 + +例如,你可以看到背景程序中的一些模糊的文字。 + +![GNOME 控制台的透明界面][8] + +我注意到,当控制台进入全屏模式时,界面不再透明。而且,你无法配置透明度。 + +#### 其他功能 + +谢天谢地,你可以在控制台中使用标签。 + +![标签式界面][9] + +你可以执行与以往 GNOME 终端一样的搜索操作。 + +![GNOME 控制台中的搜索操作][10] + +它没有太多的选项。汉堡菜单hamburger menu让你一眼就能看到所有可用的键盘快捷键。 + +![GNOME 控制台中的键盘快捷键][11] + +以上就是关于 GNOME 控制台的一切。 + +### 在 Ubuntu 22.04 上安装 GNOME 控制台 + +如果你的发行版使用了原版 GNOME 42,那么它应该默认提供了新终端。 + +尽管 Ubuntu 22.04 使用的是 GNOME 42,但它仍然使用旧的 GNOME 终端。不过,你可以使用下面的命令来安装新的控制台。 + +``` +sudo apt install gnome-console +``` + +### 总结 + +你可能会想,既然我们已经有了一个更好的、功能更强的 GNOME 终端,为什么还要开发一个新的控制台呢?这是因为 GNOME 有了新的设计指南。改造这些应用程序的旧代码库太复杂了,可能也不大划算,从头开始写反而会更容易,因此你会看到更多的“新的” GNOME 应用程序,如控制台和文本编辑器。 + +由于这个新的应用程序的目标是让事情更简单,因此它没有提供很多功能。你不能定制它,改变颜色、字体等。由于不支持定制,所以也不需要配置文件。 + +对于很少使用终端的人来说,控制台已经够用了。不过,我认为应该增加在输入密码时显示星号的功能。其他 [面向初学者的发行版][12],如 Mint,就使用了这个功能,从而避免对 Linux 新手用户造成困扰。 + +你如何看待这个新的 GNOME 控制台,以及这种创建“新的 GNOME 应用程序”的方式呢?欢迎在下方评论区发表你的看法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gnome-console/ + +作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/gnome-text-editor/ +[2]: https://gitlab.gnome.org/GNOME/console +[3]: https://itsfoss.com/wp-content/uploads/2022/04/notification-from-gnome-console.png +[4]: https://itsfoss.com/root-user-ubuntu/ +[5]: https://itsfoss.com/wp-content/uploads/2022/04/GNOME-Console-turns-red-when-using-sudo-or-root-800x442.webp +[5a]: https://itsfoss.com/wp-content/uploads/2022/05/gnome-console-color-change-ssh.png +[6]: https://itsfoss.com/wp-content/uploads/2022/04/themes-gnome-console.png +[7]: https://itsfoss.com/customize-linux-terminal/ +[7a]: https://itsfoss.com/wp-content/uploads/2022/05/warning-in-old-gnome-terminal.png +[7b]: https://itsfoss.com/wp-content/uploads/2022/05/warning-in-new-gnome-console.png +[8]: https://itsfoss.com/wp-content/uploads/2022/04/transparent-gnome-console.png +[9]: https://itsfoss.com/wp-content/uploads/2022/04/tabs-GNOME-Console.png +[10]: https://itsfoss.com/wp-content/uploads/2022/04/search-GNOME-Console.png +[11]: https://itsfoss.com/wp-content/uploads/2022/04/keyboard-shortcuts-gnome-console.png +[12]: https://itsfoss.com/best-linux-beginners/ diff --git a/published/20220430 How to Install h.264 decoder on Ubuntu Linux.md b/published/20220430 How to Install h.264 decoder on Ubuntu Linux.md new file mode 100644 index 0000000000..a5a85f33b1 --- /dev/null +++ b/published/20220430 How to Install h.264 decoder on Ubuntu Linux.md @@ -0,0 +1,160 @@ +[#]: subject: "How to Install h.264 decoder on Ubuntu Linux" +[#]: via: "https://itsfoss.com/install-h-264-decoder-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "hwlife" +[#]: reviewer: "turbokernel" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14583-1.html" + +在 Ubuntu Linux 如何安装 H.264 解码器 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/12/101451szky6vn0vn4ssv2s.jpg) + +当你开始使用 [新安装的 Ubuntu 系统][1] 并尝试打开一个 MP4 文件进行播放时,它可能会显示一个错误,即: + +> 播放这个文件要求 H.264(高清)解码器 ,但是没有安装。 + +![当播放特定媒体文件时,Ubuntu 的默认视频播放器会显示错误][2] + +你可能会猜到原因:系统没有安装所需的多媒体解码器,导致视频播放器播放该视频文件。 + +所以,解决方案是什么?安装所需的解码器。怎么做呢? + +我将讨论解决这个问题的三种方法: + + 1. 只安装所需的解码器:它能解决所需的文件播放,但是一些其它格式的文件仍然会处在无解码器可用的状态。 + 2. 一次安装多种多媒体解码器:它会安装解码器之外,还会安装你不需要的其它软件包,类似微软的字体库一样。 + 3. 安装一个不同的视频播放器:像 VLC 和 MPV 视频播放器默认状态下对解码器有更好的支持。对大多数常规视频文件来说,你不必分别安装它们。 + +如果你遵从我的建议,我建议你采用第二种和第三种方法。为什么?一会你就知道了。 + +### 在 Ubuntu Linux 获取 H.264 解码器 + +这里我使用 Ubuntu Linux。第一和第三种方法应该也适用于其它发行版,但是第二种方法不适用,因为所提到的包(常常)是 Ubuntu 所独有的。 + +#### 方法 1: 只安装所需的解码器(不推荐) + +当你看到这个错误时,它给你一个叫做 “在 Ubuntu 软件中心查找” 的按钮。点击这个按钮打开软件中心,可能显示(或不显示)一些将在你的系统上安装 H.264 解码器的软件包。 + +![在 Ubuntu 软件中心可能提供 H.264 解码器软件包][3] + +软件包名可能听起来很相似,但是你需要安装来自“不良”组合"bad" set的 GStreamer 多媒体解码器。注意检查软件包的描述。 + +或者,你可以使用如下命令在终端来安装软件包: + +``` +sudo apt install gstreamer1.0-plugins-bad +``` + +如果你对终端不了解,请注意要求使用你的账户密码的提示。**当你输入你的密码时,屏幕什么都不显示**。这是 Linux 的方式。你盲输密码然后按回车键。 + +一旦软件包安装完成,再次打开文件看看是否能够正常播放。 + +这可能对你有用,但是解决方案并未结束。你可能有其它格式的一些视频文件要求一些其它的 H.264 解码器或者其它解码器。 + +![其它的解码器播放视频你可能仍然有问题][4] + +你可以通过如下命令安装更多的解码器: + +``` +sudo apt install libavcodec-extra gstreamer1.0-plugins-ugly gstreamer1.0-libav +``` + +然而,在 Ubuntu 有一个 [安装多媒体解码器更加方便的方法][5],我会在下一节展示给你。 + +#### 方法 2: 安装所有多媒体解码器(推荐) + +Ubuntu 系统提供了一个名字叫做 `ubuntu-restricted-extras` 的基础软件包,由许多常规的音频和视频解码器以及像类似微软字体库那样多余的一些软件包组成。 + +安装这个软件包你将不用再担心多媒体解码器的问题了。 + +在 Ubuntu 打开终端并键入以下命令: + +``` +sudo apt install ubuntu-restricted-extras +``` + +由于这个基础软件包包含类似微软字库那样用不到的一些多余的软件,你必须得接受最终用户许可协议(EULA)才行。 + +![按下 tab 键 然后点击回车接受 EULA 协议][6] + +下一屏类似如下。按下 `tab` 键会高亮显示选项。当正确的选项高亮显示时,按下回车键来确认你的选择。 + +![当高亮显示你正确的选项时,按下 tab 键,按回车键确认][7] + +当多媒体解码器安装完成后,你应该能够播放绝大多数媒体文件了。你的音乐播放器能播放 MP3 文件,你的视频播放器能播放 MP4,MKV 等等格式。 + +然而,这也不是解决方案的终点,至少对某些人来说。 + +为什么我要那样说?因为我已经注意到 Ubuntu 系统下的默认视频播放器 Totem 在播放某些视频格式文件时常常遇到问题。你会注意到突然你的系统主机发热,风扇狂转并且鼠标指针停止运行。 + +为什么?因为 Totem 播放器在视频解码方面占用了大量的处理器资源。 + +当你播放视频的时候你可以通过 `top` 命令尝试查看名称为 `totem` 这个进程(那是默认视频播放器的名字)。 + +![Ubuntu 默认的视频播放器 Totem 可能消耗过多的必要的 CPU 资源][8] + +你现在能够做什么?你的麻烦看起来永无止境,别担心。[在 Linux 上有更好的视频播放器][9] 并且它们能帮助你解决问题。 + +#### 方法 3: 安装一个更优秀的视频播放器(推荐) + +在 Linux 上有很多优秀的视频播放器。我发现它们优于默认的 Totem 视频播放器。 + +就我个人来说,那么多个我只喜欢这两个:[VLC][10] 和 [MPV][11]。 + +VLC 是一个功能丰富且超级流行的视频播放器。很可能你已经使用过 VLC 。 + +MPV 媒体播放器不是那么流行,但使用这个轻量级的程序播放视频文件是再合适不过了。 + +VLC 和 MPV 播放器都擅长处理多媒体解码器。你甚至不必分开来安装多媒体解码器。只需要 [安装 VLC][12] 或者 MPV ,你就能够播放各种格式的视频文件。 + +在软件中心也可以找到它: + +![在 Ubuntu 软件中心 MPV 可用][13] + +或者 使用命令行 [在 Ubuntu 安装 MPV][14]: + +``` +sudo apt install mpv +``` + +现在你已经有了一个新的视频播放器,你应该右键点击视频文件,选择新的视频播放器来打开。 + +或者,你可以[使其作为默认程序][15] 双击来播放视频文件。 + +### 对你有用吗? + +我在这里没有说太多细节。我想阐述各种方法以及对应的优缺点。 + +你在 Ubuntu 处理好 H.264 解码器的问题了吗?哪种方法对你有用? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-h-264-decoder-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[hwlife](https://github.com/hwlife) +校对:[turbokernel](https://github.com/turbokernel) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-ubuntu/ +[2]: https://itsfoss.com/wp-content/uploads/2022/04/h264-decoder-error-ubuntu-800x241.png +[3]: https://itsfoss.com/wp-content/uploads/2022/04/h264-decoder-ubuntu-software-center-800x532.png +[4]: https://itsfoss.com/wp-content/uploads/2022/04/ac3-decoder-missing-ubuntu-800x251.png +[5]: https://itsfoss.com/install-media-codecs-ubuntu/ +[6]: https://itsfoss.com/wp-content/uploads/2020/02/installing_ubuntu_restricted_extras.jpg +[7]: https://itsfoss.com/wp-content/uploads/2020/02/installing_ubuntu_restricted_extras_1.jpg +[8]: https://itsfoss.com/wp-content/uploads/2022/04/totem-consuming-more-cpu-ubuntu-800x454.webp +[9]: https://itsfoss.com/video-players-linux/ +[10]: https://www.videolan.org/vlc/ +[11]: https://mpv.io/ +[12]: https://itsfoss.com/install-latest-vlc/ +[13]: https://itsfoss.com/wp-content/uploads/2022/04/mpv-player-ubuntu-software-center-800x346.png +[14]: https://itsfoss.com/mpv-video-player/ +[15]: https://itsfoss.com/change-default-applications-ubuntu/ diff --git a/published/20220430 Rust-based Redox OS 0.7.0 Arrives with Enhanced Hardware Support.md b/published/20220430 Rust-based Redox OS 0.7.0 Arrives with Enhanced Hardware Support.md new file mode 100644 index 0000000000..0eaa712506 --- /dev/null +++ b/published/20220430 Rust-based Redox OS 0.7.0 Arrives with Enhanced Hardware Support.md @@ -0,0 +1,82 @@ +[#]: subject: "Rust-based Redox OS 0.7.0 Arrives with Enhanced Hardware Support" +[#]: via: "https://news.itsfoss.com/redox-os-0-7-0-release/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14533-1.html" + +基于 Rust 的 Redox OS 0.7.0 发布:增强硬件支持 +====== + +> Unix 风格的 Redox OS 0.7.0 发布了,它此次带来了几项改进,聚焦于在最广泛的硬件上启动。 + +![Redox OS][1] + +每年的这个时候,我们都会继续观察报道 Ubuntu 和基于它的发行版的新版本,但是今天不一样。 + +今天,我们要介绍的主角是 Redox OS,它专注于稳定性和安全性。我们 [早在 2016 年就报道过它][2],那时它还处于开发早期阶段(如果你感兴趣的话)。 + +它大致上类似 Unix,但却是一个完整的操作系统。此外,它完全使用 Rust 从零开始编写。Rust 是一个流行的内存安全的编程语言。 + +Redox OS 的另一个主要特点是它采用了微内核设计方法。这意味着与 Linux 宏内核相比,它的体积和使用的基本功能都比较少。 + +### 版本更新介绍 + +新发布的 [Redox OS][3] 侧重于操作系统的最基础部分,并且旨在扩展硬件支持。让我们来看看这个版本带来了什么更新吧! + +#### 改进的文件系统 + +Redox 附带一个名为 RedoxFS 的自定义文件系统,这个文件系统也与 Linux 兼容。 + +RedoxFS 目前是一个写时复制copy-on-Write文件系统,当硬件加速功能可用时,支持使用 AES(高级加密标准)进行透明加密。 + +#### 重写的引导程序 + +引导程序已经被完全修改,现在 UEFI 和 BIOS 版本共用了相同的代码。 + +此外,操作系统也共享相同的驱动代码以提高安全性。这意味着文件系统可以被引导程序解锁,以对内核和 initfs 进行加密和哈希。 + +#### 微内核的更新 + +其微内核已经经历了几次修复和更新,以提高性能并带来更好的硬件支持。 + +例如,它增加了对 ARM(aarch64)和未来编译器的支持。 + +内核强制对所有系统路径进行 UTF-8 编码,并使用了 acpid —— 用于电源管理的守护程序。 + +由于 initfs 被移到了一个单独的文件中,打包性能也得到了提升。 + +#### 其他特性 + +Redox OS 更新了 rustc(Rust 编译器)和 reibc(基于 Rust 的 C 库),以提高软件支持、性能和移植性。 + +你也可以阅读 [官方博文][4] 或其 [GitLab 页面][5] 以了解更多关于该版本的信息。 + +### 结语 + +需要注意的是,Redox OS 可能不是大多数人的替代品。然而,随着开发者(Jeremy Soller)为未来计划的一系列改进,它可以成为一个有希望的替代品。 + +开发者还计划定期发布新版本。因此,我们可以期待 Redox OS 在不久的将来会为我们带来什么。 + +你听说过 Redox OS 吗?你对它有什么看法呢?欢迎在评论区分享你的观点! + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/redox-os-0-7-0-release/ + +作者:[Rishabh Moharir][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/rishabh/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/04/redox-os-0-7-0.jpg +[2]: https://itsfoss.com/redox-os-an-operating-system-written-in-rust/ +[3]: https://www.redox-os.org/ +[4]: https://www.redox-os.org/news/release-0.7.0/ +[5]: https://gitlab.redox-os.org/redox-os/redox diff --git a/published/20220501 How to Install Classic GNOME Flashback in Ubuntu 22.04 LTS.md b/published/20220501 How to Install Classic GNOME Flashback in Ubuntu 22.04 LTS.md new file mode 100644 index 0000000000..67e46d9b20 --- /dev/null +++ b/published/20220501 How to Install Classic GNOME Flashback in Ubuntu 22.04 LTS.md @@ -0,0 +1,98 @@ +[#]: subject: "How to Install Classic GNOME Flashback in Ubuntu 22.04 LTS" +[#]: via: "https://www.debugpoint.com/2022/05/gnome-classic-ubuntu-22-04/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "turbokernel" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14627-1.html" + +Ubuntu 22.04 LTS 中安装经典 GNOME Flashback 指南 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/23/151318xi8c3qipphg8xz0i.jpg) + +> 关于如何在最新的 UBUNTU 22.04 LTS 中安装旧的经典 GNOME Flashback 的快速指南。 + +[GNOME Flashback][1](又名 classic GNOME)是旧 GNOME 3 shell 的一个分支,它使用早期 GNOME 2 技术的布局和原则。它的速度快如闪电,并且在设计上非常轻量级。因此,它非常适合几十年前的老旧硬件。 + +随着带有现代 GNOME 42 的 [Ubuntu 22.04 LTS][2] 的发布,有必要寻找轻量级的桌面环境选项。 + +此外,GNOME Flashback 很容易安装在现代 Ubuntu Linux 中,你仍然可以享受 Ubuntu 性能而不必关心 GNOME 42、GTK4、libadwaita 之类的东西。 + +### 在 Ubuntu 22.04 LTS 中下载并安装经典 GNOME Flashback + +按照以下步骤在 Ubuntu 22.04 LTS 中下载并安装经典 GNOME Flashback(Metacity)。 + +在 Ubuntu 22.04 LTS 中打开终端(CTRL+ALT+T)并运行以下命令。安装大小约为 61MB。 + +``` +sudo apt update +sudo apt install gnome-session-flashback +``` + +![Install GNOME Classic Flashback Metacity in Ubuntu 22.04 LTS][3] + +最后,安装完成后,退出。重新登录时,在登录选项中使用经典的 GNOME Flashback(Metacity) 。 + +![Choose GNOME Classic while logging in][3a] + +### 经典 GNOME Flashback 的特点 + +首先,当你登录时,你将体验到传统的 GNOME 技术,它已被证明具有良好的生产力,并且比今天的技术快得多。 + +在顶部有旧版的面板,左侧是应用菜单,而系统托盘位于桌面的右上方。应用程序菜单显示所有已安装的应用和软件快捷方式,你可以在工作流程中轻松浏览。 + +此外,在右侧部分,系统托盘具有默认小部件,例如网络、音量控制、日期和时间以及关机菜单。 + +![Classic GNOME Flashback Metacity in Ubuntu 22.04 LTS][3b] + +底部面板包含打开的窗口和工作区切换器的应用列表。默认情况下,它为你提供四个工作区供你使用。 + +此外,你可以随时更改顶部面板的设置以自动隐藏、调整面板大小和背景颜色。 + +除此之外,你可以通过 `ALT + 右键点击` 顶部面板添加任意数量的旧版小程序。 + +![Panel Context Menu][3c] + +![Add to panel widgets][3d] + +### 经典 GNOME 的性能 + +首先,磁盘空间占用极小,仅安装 61 MB。我的测试使用了大约 28% 的内存,其中大部分被其他进程占用。猜猜是谁?是的,是 snap-store(又名 Ubuntu 软件)。 + +因此,总体而言,它非常轻巧,内存(仅 28 MB)和 CPU(0.1%)占用空间非常小。 + +![Performance of GNOME Classic in Ubuntu 22.04][3e] + +此外,假设你将其与同样使用相同技术的 Ubuntu MATE 进行比较。在这种情况下,它比 MATE 更轻量,因为你不需要任何额外的 MATE 应用及其用于通知、主题和其他附加资源的软件包。 + +### 结束语 + +我希望本指南在你决定在 Ubuntu 22.04 LTS Jammy Jellyfish 中安装经典 GNOME 之前帮助你获得必要的信息。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/gnome-classic-ubuntu-22-04/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[turbokernel](https://github.com/turbokernel) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://wiki.archlinux.org/index.php/GNOME/Flashback +[2]: https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/Install-GNOME-Classic-Flashback-Metacity-in-Ubuntu-22.04-LTS.jpg +[3a]: https://www.debugpoint.com/wp-content/uploads/2022/05/Choose-GNOME-Classic-while-loggin-in.jpg +[3b]: https://www.debugpoint.com/wp-content/uploads/2022/05/Classic-GNOME-Flashback-Metacity-in-Ubuntu-22.04-LTS.jpg +[3c]: https://www.debugpoint.com/wp-content/uploads/2020/04/Panel-Context-Menu.png +[3d]: https://www.debugpoint.com/wp-content/uploads/2020/04/Add-to-panel-widgets.png +[3e]: https://www.debugpoint.com/wp-content/uploads/2022/05/Performance-of-GNOME-Classic-in-Ubuntu-22.04.jpg +[4]: https://t.me/debugpoint +[5]: https://twitter.com/DebugPoint +[6]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[7]: https://facebook.com/DebugPoint diff --git a/published/20220502 How to make community recognition more inclusive.md b/published/20220502 How to make community recognition more inclusive.md new file mode 100644 index 0000000000..c53b03da45 --- /dev/null +++ b/published/20220502 How to make community recognition more inclusive.md @@ -0,0 +1,72 @@ +[#]: subject: "How to make community recognition more inclusive" +[#]: via: "https://opensource.com/article/22/5/inclusive-community-recognition" +[#]: author: "Ray Paik https://opensource.com/users/rpaik" +[#]: collector: "lkxed" +[#]: translator: "PeterPan0106" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14590-1.html" + +如何使社区认可更加包容 +====== + +> 抛开具体的工作量,我们认为所有的贡献都弥足珍贵。当所有社区贡献者都能获得家庭般的赞赏时,他们会更倾向于继续为社区添砖加瓦。 + +![](https://img.linux.net.cn/data/attachment/album/202205/13/234756gi7q42f2mgz5mg44.png) + +给予一个优秀的工作足够的认同和赞赏是我作为一个社区管理员最喜欢做的事。我不但有机会能够对贡献者表示感激,同时还能为社区设立一个优秀的榜样。认同和赞赏可以是为了庆祝一个成就,例如有人帮助其他成员加入社区、减少技术债务或者贡献了激动人心的新功能。 + +但是,用来确定贡献量的规则可能会有难以预料的后果。例如某些社区管理员利用如下图所示的图表来表彰贡献,过度地强调了拉取请求(PR)以及对代码库的贡献量。 + +![A bar graph ranking 15 contributors according the the number of PRs merged in a year, ranging from 250 at the top to 50 at the bottom.][2] + +![A bar graph ranking 10 contributing organizations by number of contributions, ranging from more than 15 to less than 5][3] + +使用这样的方法进行表彰会产生三个问题。 + +首先,这样过度关注了对代码库的贡献。早年间,开源项目主要吸引开发者参与,所以自然而然许多贡献是围绕代码的。现在,越来越多的非开发者正在积极参与社区项目(例如通过用户组、会议和用户生产的内容),他们的大多数贡献在代码库以外的地方。这些贡献将不会出现在诸如 *年度合并 PR 数量* 这样的表格上。 + +其次,过度关注贡献指标(指那些易于用数字统计的),最终会演变为奖励数量而不是质量,甚至影响力。在上图的 *贡献组织排行榜* 中,大型组织因为具有更多的可用人力,相对于小型组织就会有更为显著的优势。通过对大型组织在数量上的表彰将可能导致小型组织的人感到权利被剥夺了。 + +最后,尽管本意并非如此,但许多人都会把这些数据看做对个人或组织影响力的排名。 + +基于此,我们最好避免仅仅通过指标数量来表彰对社区的贡献。 + +### 令社区表彰更有意义 + +如何让社区表彰更为包容并且能够覆盖不同的贡献形式呢?诸如 Discord、IRC、邮件列表和Slack 等交流渠道可以很好的表明一个成员的活跃度及其感兴趣的领域。例如每当我看到一些人热衷于解答问题或者帮助新用户时,我会十分开心。这些贡献并不会出现在社区的数据板上,但是让这些贡献得到应有的认同和感谢并广为人知是十分重要的。 + +社区数据板显然是开源社区重要的工具。但是我提醒大家不要花费太多时间在建设数据板上。迟早你会发现,不是所有的东西都可以有清晰的标准进行度量,即便你能够想出规则量化一件事,你也依然会发现这些规则具有局限性。 + +为了获取更多的关于贡献的信息,我经常会安排社区成员茶话会。这些对话经常能够告诉我他们做出贡献的原因、有多少工作量以及谁同时也参与进来了等等。 + +当我第一次与他们对话时,我经常听到他们提及找到回馈社区的方法十分重要,而他们也在寻找方法来提供力所能及的帮助。许多人甚至因不能在代码方面做出贡献而感到内疚,而我会向他们强调代码不再是开源唯一重要的东西。有时这些对话能让我有机会接触到同一城市或同一行业的社区成员,或者发现更多共同的兴趣点。维护这些关系将有助于提升归属感。 + +### 令社区表彰更具影响力 + +除了寻找更多的活动形式,我们也可以让这些活动以更具影响力的形式呈现。例如在看到优质贡献时及时赞美。一个快速的感谢回复会比一两个月之后的正式感谢更有效。许多人包括我自己,都会强调给予更为正式而合理的表彰和奖励,但我们应当谨记,奖励并非社区成员贡献的主要动力。认可好的工作并努力去接触贡献者会令贡献者感到受重视。 + +让其他成员参与到认可的过程中也是一个很好的主意。一旦社区达到了一定的规模,便很难事无巨细地知晓一切细节。如果引入一个成员提名机制则会很好地让大家注意到优秀的贡献。如果你的社区拥有十分正式的奖项,例如在年度会议或聚会上颁发的奖项,请让社区成员参与提名和投票。这不仅提供了成员参与进来的平台,也令这些来自成员投票的奖项更有意义。 + +最后给予认同和感谢也是一个认识成员并加深了解的重要机会。有时候颁奖仿佛在进行交易:“你做了某件事,所以我们给你颁发了某个奖励”。多在介绍成员上花些时间,将令成员感到更受重视并加强归属感。 + +### 社区认可令社区更为健康 + +在提高开源社区的多样性、包容性和归属感方面,我们仍有许多工作亟待改善。更好的社区认可将在其中起着不可或缺的作用。确保所有的贡献都受到重视,让每一位贡献者都感到家庭般氛围和赞赏,将鼓励他们继续为社区贡献。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/inclusive-community-recognition + +作者:[Ray Paik][a] +选题:[lkxed][b] +译者:[PeterPan0106](https://github.com/PeterPan0106) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/rpaik +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/world_hands_diversity.png +[2]: https://opensource.com/sites/default/files/2022-04/annual%20merged%20PRs.png +[3]: https://opensource.com/sites/default/files/2022-04/top%20contributing%20orgs.png diff --git a/published/20220502 Microsoft Joins The Open 3D Foundation For Open Source 3D Development.md b/published/20220502 Microsoft Joins The Open 3D Foundation For Open Source 3D Development.md new file mode 100644 index 0000000000..cc7d8d265c --- /dev/null +++ b/published/20220502 Microsoft Joins The Open 3D Foundation For Open Source 3D Development.md @@ -0,0 +1,38 @@ +[#]: subject: "Microsoft Joins The Open 3D Foundation For Open Source 3D Development" +[#]: via: "https://www.opensourceforu.com/2022/05/microsoft-joins-the-open-3d-foundation-for-open-source-3d-development-promotion/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14544-1.html" + +微软加入开放 3D 基金会,参与开源 3D 开发 +====== + +![微软][1] + +微软已经以首席成员的身份加入了开放 3D 基金会Open 3D Foundation(O3DF),其他首席成员是 Adobe、AWS、华为、英特尔和 Niantic。微软的参与为该项目带来了大量的知识和思想引领,这表明了:通过行业合作,创造一个高保真、功能齐全、不受商业条件限制的开源 3D 引擎是多么的关键。 + +微软首席集团项目经理 Paul Oliver 将加入 O3DF 管理委员会,这表明他将致力于实现基金会的目标,即确保符合开放 3D 社区保持需求与输入的平衡。基金会的战略方向和对 3D 可视化、仿真计划的管理,是由理事会与股东的创新互动来指导的。 + +“微软在创意方面的根基很深,我们希望帮助所有的创作者,无论他们是谁、在哪里、为哪个平台创作”,Oliver 如是说,“由 Linux 基金会创建的开放 3D 基金会,是朝着帮助更多世界各地的创作者迈出的美妙一步,我们很高兴能成为其中的一员。” + +微软不断致力于使游戏制作民主化,并向全世界的游戏创作者提供其工具和技术。加入开放 3D 基金会也反映出这一点。微软去年通过 GitHub 向所有开发者发布了其游戏开发工具包,并正在通过与 O3DF 的新伙伴关系,扩大其向所有人开放技术的承诺。 + +O3DF 执行董事,兼 Linux 基金会的游戏和数字媒体部总经理 Royal O'Brien 说:“我们很高兴微软以首席成员的身份加入开放 3D 基金会。有像微软这样杰出的行业资深公司做出贡献,并帮助社区推动 3D 引擎的创新,这对开源社区和使用它的公司都是巨大的好处。” + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/microsoft-joins-the-open-3d-foundation-for-open-source-3d-development-promotion/ + +作者:[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/05/microsoft-696x464.jpg diff --git a/published/20220502 Tools You Can Use for the Security Audit of IoT Devices.md b/published/20220502 Tools You Can Use for the Security Audit of IoT Devices.md new file mode 100644 index 0000000000..ce6758817a --- /dev/null +++ b/published/20220502 Tools You Can Use for the Security Audit of IoT Devices.md @@ -0,0 +1,108 @@ +[#]: subject: "Tools You Can Use for the Security Audit of IoT Devices" +[#]: via: "https://www.opensourceforu.com/2022/05/tools-you-can-use-for-the-security-audit-of-iot-devices/" +[#]: author: "Dr Kumar Gaurav https://www.opensourceforu.com/author/dr-gaurav-kumar/" +[#]: collector: "lkxed" +[#]: translator: "tendertime" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14566-1.html" + +物联网安全审计工具集锦 +====== + +数字化转型涉及数据驱动的决策与人工智能(AI)的结合。重要数据通过物联网(IoT)设备和智能组件进行传播。由于物联网设备常常处于不安全的环境,而且由于缺乏内生安全机制的脆弱性,很难免于潜在的网络攻击。以下是一些用于实现安全审计的开源工具,可以降低此类攻击风险。 + +![](https://img.linux.net.cn/data/attachment/album/202205/09/090119h337d3shyoj3ou28.jpg) + +网络攻击者和嗅探器可以从物联网设备中获取敏感数据,并利用这些信息对其他相关系统发起攻击。反病毒和计算机安全服务公司卡巴斯基表示,在 2021,物联网黑客数量同比增长了四倍多。 + +在很大程度上,黑客通过使用 Telnet 协议访问物联网网络,该协议为通过互联网与设备或服务器进行通信提供了命令行接口。根据研究报告,超过 58% 的物联网入侵使用各种协议以求实现挖掘加密货币、通过分布式拒绝服务(DDoS)攻击关闭系统、窃取机密数据的目的。 + +由于人们在疫情期间居家使用物联网设备的时间增加,安全风险也随之上升。这些物联网组件中的大部分无论是个人用还是商用,都缺乏基本的安全措施。人工智能和边缘计算等新技术也使网络和数据安全形势复杂化。卡巴斯基的一位安全专家 Dan Demeter 表示:智能组件变得流行,攻击的数量也随之上升了。 + +![Key components in PENIOT][2] + +### 物联网组件的安全审计需求 + +网络攻击一直在演变,商业公司和政府部门都在采用越来越复杂的网络安全设施以防止他们的应用和基础设施免于在线攻击。全球渗透测试市场预计将从 2021 的 16 亿美元增长到 2026 年的 30 亿美元,2021 至 2026 年的复合年增长率为 13.8%。 + +物联网设备的渗透测试是一个热门话题,在这一领域有大量研究。即使采用“设计安全”的方法,渗透对于识别真正的安全危险并采取适当的预防措施也是至关重要的。 + +物联网部署中需要安全和隐私的关键部分和协议包括: + +* 受限应用协议Constraint application protocol(CoAP) +* 低功耗蓝牙Bluetooth low energy(BLE) +* 高级消息队列协议Advanced message queuing protocol(AMQP) +* 消息队列遥测传输Message queuing telemetry transport(MQTT) + +攻击者有多种可能的入口访问到联网设备。在物联网渗透测试(或安全审计)时,要测试完整的物联网场景和生态。测试内容包括从单个层和嵌入式软件到通信协议和服务器的所有内容。对服务器、在线接口和移动应用的测试并非物联网独有,但至关重要,因为它们涵盖了故障可能性很高的领域。物联网漏洞是电气、嵌入式软件和通信协议测试的重点。 + +在评估联网设备的安全性时会进行以下测试。这些测试都是使用不同的针对漏洞的高性能渗透测试和安全审计工具进行的: + +* 通信端口中的攻击和操纵的测试 +* 基于无线电信号捕获和分析的 IoT 嗅探 +* 接口和后门测试 +* 缓冲区溢出测试 +* 密码破解测试 +* 调试 +* 密码学分析 +* 固件操纵测试 +* 逆向工程 +* 内存转储 + +![][3] + +### 物联网安全审计使用的开源工具 + +物联网设备在我们的日常生活中变得越来越普遍,比如,智能自行车、健身跟踪器、医疗传感器、智能锁和联动工厂等。所有这些设备和组件都可以使用开源工具来抵御网络攻击,本文将简要介绍其中一些工具。 + +#### PENIOT + +[PENIOT](https://github.com/yakuza8/peniot) 是一种物联网渗透测试工具,使安全审计团队能够通过利用设备的连接来测试和破坏具有各种安全威胁的设备。可以测试主动和被动安全威胁。在确定目标设备和相关信息(或参数)后,可以进行主动安全攻击,例如改变系统资源、重放合法通信单元等。还可以分析被动安全威胁,例如破坏敏感数据的机密性或访问网络流量分析。 + +#### Objection + +[Objective](https://github.com/sensepost/objection) 是一个对物联网环境中使用的安卓和 iOS 应用程序进行详细分析和安全审计的工具。 + +目前许多智能组件和设备都在使用安卓和 iOS 平台,使用该工具可以通过详细的日志和安全审计报告对这些平台进行分析。 + +#### Routersploit + +[这个](https://github.com/threat9/routersploit) 针对嵌入式设备的开源开发框架具有多个用于渗透测试和安全审计的功能和模块: + +* Exploits —— 漏洞评估 +* Creds —— 网络服务和证书的测试 +* Scanners —— 对目标进行详细的安全审计 +* Payloads —— 有效载荷和注入关键点的生成 +* Generic —— 执行和测试攻击 + +#### Wireshark + +[Wireshark](https://www.wireshark.org) 是一款功能丰富的、免费的网络协议分析器。MQTT 等多种物联网协议可通过该工具实现有效分析。为了发现弱点,可以根据协议配置安全规则并检查流量。可以使用 `tcpdump` 通过命令行访问网络数据包分析器。此类工具用于检查物联网设备和网络之间交换的数据包。 + +#### Binwalk + +[Binwalk](https://www.kali.org/tools/binwalk) 是一种逆向硬件设计的工具。它是 Kali Linux 的关键组件之一,用于渗透测试、服务器指纹识别、安全审计和取证应用。 + +#### Firmwalker + +[Firmwalker](https://github.com/craigz28/firmwalker) 是一款自由开源的工具,用于搜索和扫描固件文件系统,无论是否被提取或挂载。使用这个工具可以做一个详细的安全审计。 + +在物联网(IoT)和万物互联(IoE)的时代,有必要设计并使用高性能工具包进行渗透测试和安全审计。随着物联网设备数量的增加,安全风险也在增加。为了物联网和万物互联部署有更高级别的安全和隐私,有必要根据最新的协议和动态的流量定制化自由及开源的工具箱和软件包。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/tools-you-can-use-for-the-security-audit-of-iot-devices/ + +作者:[Dr Kumar Gaurav][a] +选题:[lkxed][b] +译者:[tendertime](https://github.com/tendertime) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/dr-gaurav-kumar/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Screenshot-2022-05-02-154427-696x422.png +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Figure-1-Key-components-in-PENIOT.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Screenshot-2022-05-02-153653-590x282.png diff --git a/published/20220502 Ubuntu’s Unity Desktop Still Lives- Version 7.6 is Available for Testing After 6 Years.md b/published/20220502 Ubuntu’s Unity Desktop Still Lives- Version 7.6 is Available for Testing After 6 Years.md new file mode 100644 index 0000000000..a9fe894358 --- /dev/null +++ b/published/20220502 Ubuntu’s Unity Desktop Still Lives- Version 7.6 is Available for Testing After 6 Years.md @@ -0,0 +1,88 @@ +[#]: subject: "Ubuntu’s Unity Desktop Still Lives: Version 7.6 is Available for Testing After 6 Years" +[#]: via: "https://news.itsfoss.com/unity-7-6-testing/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "imgradeone" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14538-1.html" + +Ubuntu 的 Unity 桌面还活着:时隔 6 年后,7.6 测试版发布 +====== + +> 虽然 Canonical 已经不再维护 Unity 桌面,但 Ubuntu Unity 的开发者承担了这项重任,发布了一项主要更新(已可用于测试)。 + +![Unity 7.6][1] + +怕你兴奋过头了,先提醒一下,Canonical 并没有回归 Unity 桌面的维护。 + +得益于 Ubuntu Unity 发行版开发者(Rudra Saraswat)的不懈努力,时隔 6 年,我们终于看到了 Unity 桌面环境的更新。 + +补充说一下,[Ubuntu Unity][2] 是一款采用 Unity 桌面(而不是 GNOME)的社区项目。因此,如果你想在 Ubuntu 22.04 LTS 上使用 Unity 桌面,那么毋庸置疑,[Ubuntu Unity][2] 绝对是你的最佳伙伴。 + +起初,它仅仅提供了经过微调的 Unity 体验,但现在,**Unity 7.6** 的界面得到了一些优化及视觉变更。 + +下面是你应该了解的东西: + +### Unity 7.6:更新了什么? + +> **提示**:Unity 7.6 是为公共测试而发布的,它不应作为替代其他桌面环境的使用环境。 + +这不仅仅是面向用户的改进,还有针对开发方面的努力,旨在帮助贡献者,让他们更方便地帮助 Unity7 的开发。 + +这些改善包括: + +#### 用户界面变更 + +![Unity 桌面][3] + +Dash 启动器(应用启动器)与 HUD 现已重新设计,拥有更现代、简洁的视觉。 + +总的来看,现在的设计看上去更加扁平,但仍旧保留了不错的系统全局模糊效果。 + +本次引入了一些细微的视觉改进,比如停靠区上的“清空回收站”按钮修改为使用 Nemo(而不是 Nautilus),以及修复了 Dash 预览中的应用详情与评分。 + +#### 性能改进 + +![Unity 桌面][4] + +在最新的更新中,Unity7 的内存使用量更低,同时你也可以注意到,Ubuntu Unity 22.04 的内存使用量明显降低到约 700-800 MB。 + +此外,低端显卡模式现在运作得更好,Dash 也比以前更快。 + +#### 其他变化 + +Unity7 Shell 的源代码已经完全迁移至 [GitLab][5]。用于独立测试的 Unity7 启动器已被修复,同时一些有问题的测试项也已被禁用,改善了构建用时(使其大幅缩短)。 + +发布说明上说,这些改进将帮助 Unity7 的贡献者。 + +### 测试 Unity 7.6 + +你可以按照 [官方测试公告][6] 中提到的方式来编译它,并亲自尝试。你也可以前往其官方网站探索更多。 + +> **[Unity 7.6][7]** + +另一种情况,如果你不想添加测试 PPA 源,你也可以等待 Ubuntu Unity 22.04 的更新。 + +*你对 Unity 桌面环境的这次更新有什么看法?你喜欢它吗?欢迎在评论区中告诉我你的想法。* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/unity-7-6-testing/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[imgradeone](https://github.com/imgradeone) +校对:[校对者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/unity-7-6-release.jpg +[2]: https://ubuntuunity.org/ +[3]: https://news.itsfoss.com/wp-content/uploads/2022/05/unity-7-6.jpg +[4]: https://news.itsfoss.com/wp-content/uploads/2022/05/neofetch-unity-7-6.png +[5]: https://gitlab.com/ubuntu-unity +[6]: https://unity.ubuntuunity.org/blog/unity-7.6/ +[7]: https://unity.ubuntuunity.org/ \ No newline at end of file diff --git a/published/20220503 Nvidia Begins To Set The Foundation For Future Open And Parallel Coding.md b/published/20220503 Nvidia Begins To Set The Foundation For Future Open And Parallel Coding.md new file mode 100644 index 0000000000..f34517d297 --- /dev/null +++ b/published/20220503 Nvidia Begins To Set The Foundation For Future Open And Parallel Coding.md @@ -0,0 +1,44 @@ +[#]: subject: "Nvidia Begins To Set The Foundation For Future Open And Parallel Coding" +[#]: via: "https://www.opensourceforu.com/2022/05/nvidia-begins-to-set-the-foundation-for-future-open-and-parallel-coding/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "zxcv545" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14565-1.html" + +英伟达开始着手为未来的开放和并行编程建立基础 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/09/080227sdxqcd3rxooc3cq3.jpg) + +随着图形处理器在计算机里变得越来越常见,英伟达正在扩大与标准和开源社区的合作,以便于包括先前仅限于该公司开发工具的下游技术。虽然人们在 C++ 和 Fortran 等语言上投入了大量精力,但这些语言被认为在高度并行的计算机上执行代码落后于原生实现的编程语言。 + +英伟达结合了开放和专有库的 CUDA 并行编程框架影响了许多正在开放和主流化的技术。在 2007 年,CUDA 作为一个为程序员开发基于 GPU 的系统的一系列编程工具和框架而推出。然而,随着 GPU 利用率在更多应用程序和领域中的增长,CUDA 理念发生了转变。 + +英伟达因其在 GPU 上的主导地位而广为人知,但 CUDA 是这家以 1 万亿市值为目标的软件和服务供应商重塑品牌的核心。英伟达的长期目标是成为一个全栈提供商,专注于自动驾驶、量子计算、医疗保健、机器人、网络安全和量子计算等特定领域。 + +英伟达已经在特定领域创建了专用的 CUDA 库,以及企业可以使用的硬件和服务。其 CEO 黄仁勋在最近的 GPU 技术大会上宣布的 “AI 工厂” 概念,最能体现全栈战略。客户可以将应用程序放入英伟达的大型数据中心,从而获得针对特定行业或应用程序需求量身定制的定制 AI 模型。 + +英伟达可以通过两种方式从 AI 工厂原则中受益:利用 GPU 容量或利用特定领域的 CUDA 库。在英伟达 GPU 上,程序员可以使用 OpenCL 等开源并行编程框架。另一方面,CUDA 将为那些愿意投资的人提供额外的最后一英里增长,因为其已调整为与英伟达的 GPU 密切运作。 + +虽然并行编程在高性能计算中很常见常见,但英伟达的目标是让其成为主流计算的标准。该公司正在协助实现一流工具的标准化,无论品牌、加速器类型或并行编程框架是什么,都可以编写可跨硬件平台移植的并行代码。 + +一方面,英伟达是 C++ 小组的成员,该小组正在为跨硬件同时执行可移植代码奠定基础。上下文可以是主要执行 IO 的 CPU 线程,也可以是执行高要求计算的 CPU 或 GPU 线程。英伟达特别致力于为 C++ 程序员提供异步和并行的标准语言和基础设施。 + +第一项工作侧重于内存模型,该模型已合并到 C++ 11 中,但当并行性和并发性变得更加普遍时,必须对其进行更新。C++ 11 的内存模型强调跨多核 CPU 的并发执行,但它缺乏并行编程钩子。C++ 17 标准为更高级别的并行特性奠定了基础,但真正的可移植性必须等待未来的标准。C++ 20 是当前标准,而 C++ 23 即将推出。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/nvidia-begins-to-set-the-foundation-for-future-open-and-parallel-coding/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[zxcv545](https://github.com/zxcv545) +校对:[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/05/Nvidia_logo_angled_shutterstock.jpg diff --git a/published/20220503 Package Analysis Examines Packages In Open Source Repositories In Real Time.md b/published/20220503 Package Analysis Examines Packages In Open Source Repositories In Real Time.md new file mode 100644 index 0000000000..fddd59ec76 --- /dev/null +++ b/published/20220503 Package Analysis Examines Packages In Open Source Repositories In Real Time.md @@ -0,0 +1,38 @@ +[#]: subject: "Package Analysis Examines Packages In Open Source Repositories In Real Time" +[#]: via: "https://www.opensourceforu.com/2022/05/package-analysis-examines-packages-in-open-source-repositories-in-real-time/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14578-1.html" + +软件包分析项目实时检查开源仓库中的包 +====== + +![openssf-logo][1] + +开源安全基金会(OpenSSF)发布了一个新工具的测试版,它可以对发布到著名开源仓库的所有软件包进行动态分析。软件包分析项目试图通过识别任何恶意行为并警告用户来保护开源软件包,目的是增强对开源软件的信任并加强软件供应链的安全性。 + +OpenSSF 说:“软件包分析项目旨在了解开源仓库上可用软件包的行为和功能:它们访问哪些文件,它们连接到哪些地址,以及它们运行哪些命令?” + +该基金会的 Caleb Brown 和 David A. Wheeler 补充说:“该项目还跟踪软件包随时间的行为变化,以确定以前安全的软件何时开始出现可疑行为。” + +该程序在为期一个月的测试运行中发现了 200 多个发布到 PyPI 和 NPM 的恶意软件包,其中大多数流氓库依赖于依赖混淆和仿冒攻击。谷歌是 OpenSSF 的成员,它支持软件包分析计划,强调“在发布软件包之前审查软件包以确保用户安全”的重要性。 + +去年,该公司的开源安全团队提出了软件工件的供应链级别(SLSA)架构,以验证软件包的完整性并防止未经授权的更改。这一发展是在开源生态系统越来越多地被武器化,用加密货币矿工和数据窃贼等恶意软件攻击开发者的情况下进行的。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/package-analysis-examines-packages-in-open-source-repositories-in-real-time/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/openssf-logo-696x418.jpg diff --git a/published/20220504 ESI Group Collaborates With ENSAM, Open Sources Its “Inspector” Software.md b/published/20220504 ESI Group Collaborates With ENSAM, Open Sources Its “Inspector” Software.md new file mode 100644 index 0000000000..8a254f3861 --- /dev/null +++ b/published/20220504 ESI Group Collaborates With ENSAM, Open Sources Its “Inspector” Software.md @@ -0,0 +1,40 @@ +[#]: subject: "ESI Group Collaborates With ENSAM, Open Sources Its “Inspector” Software" +[#]: via: "https://www.opensourceforu.com/2022/05/esi-group-collaborates-with-ensam-open-sources-its-inspector-software/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "Veryzzj" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14571-1.html" + +ESI 集团同 ENSAM 合作,开源其 Inpsector 软件 +====== + +![software][1] + +Inspector 是一个可视化的交互式数据探索软件,能够对海量数据进行分析并提取相关信息,可用于预测性维修、网络安全、控制、机器学习算法分析等。 + +通过让更多的人使用 Inspector 软件,让他们能够合作开发可靠灵活的方案,以解决社区的技术问题和特殊需求,ESI 集团增加了对工业界和学术界的贡献。 + +作为 ESI 集团和 ENSAM 之间持续赞助合作和共创伙伴关系的一部分,将由 ENSAM(巴黎高科国立高等工程技术大学Ecole Nationale Supérieure d’Arts et Métiers)领导 Inspector 的增长和扩展。通过共同参与建设由新加坡国家科学研究中(CNRS)协调的 Descartes 计划、CREATE-ID 国际研究讲座以及 ESI – ENSAM 虚拟工程实验室,双方加强了合作。 + +这种开源方式有许多好处。首先,社区能够以最有效的方式使用该软件,科学界能够从根据用户需求定制的新功能以及安全方面的改进中受益。其次,ESI 集团希望提供一个从软件中获利机会,包括汽车及航空在内的各种行业的客户已经证明了这一软件的可靠性。由于许多利益相关者的参与,Inspector 将持续发展以应对社区需求。 + +ESI 集团打算将其数据分析软件开源发布,得到了一些行业领导者和 Inspector 用户的兴趣和支持,例如 CNS 就是其中一例。 + +CNS 的总经理 Stephane Perrin 表示:“ESI 集团这一决定证明了集团的先进技术对创新和科学生态系统的贡献。CNS 作为一家网络与安全的专业公司,我们用行动支持 Inspector 的未来。除了将 Inspector 集成到我们的持续网络审计软件套件中外,不久后我们还将通过我们创新解决方案的业务部门为该软件提供支持。” + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/esi-group-collaborates-with-ensam-open-sources-its-inspector-software/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[Veryzzj](https://github.com/Veryzzj) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/software-696x371.jpg diff --git a/published/20220504 Firefox 100 Marks 17 Years of Development with Interesting Upgrades.md b/published/20220504 Firefox 100 Marks 17 Years of Development with Interesting Upgrades.md new file mode 100644 index 0000000000..ea6e5793ca --- /dev/null +++ b/published/20220504 Firefox 100 Marks 17 Years of Development with Interesting Upgrades.md @@ -0,0 +1,112 @@ +[#]: subject: "Firefox 100 Marks 17 Years of Development with Interesting Upgrades" +[#]: via: "https://news.itsfoss.com/firefox-100-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14555-1.html" + +Firefox 100 发布:带来诸多有趣更新,纪念 17 年的发展历程 +====== + +> Mozilla Firefox 100 是一个重要的版本,它标志着这个浏览器 17 年的发展,以及多年来所有令人兴奋的功能。 + +![Firefox 100][1] + +Firefox 可以说是最受欢迎的不基于 Chrome 的开源浏览器,它可用于 Linux、Windows 和 Mac。 + +众所周知,目前,基于 Chrome 的浏览器在市场份额中占主导地位。但你可能不知道的是,Firefox 早在谷歌 Chrome 出现之前就已经问世了。 + +准确地说,Firefox 100 的发布标志着,它自 2004 年的发展历程已经有 17 年了。 + +时间过得好快,一切仿佛就发生在昨天。 + +### Firefox 100:更新内容 + +![Firefox 100][2] + +不管你是否喜欢 Firefox 新的发展计划,你都不得不承认,它多年来引入了众多行业领先的功能/技术,这一点令人印象深刻。 + +Firefox 100 的发布是一个重要的里程碑。但是,这并不是一次大规模升级。 + +本文中,我将介绍这个版本的主要改进。 + +#### “画中画”模式改进 + +![Firefox 100][3] + +现在,在“画中画”模式下观看 YouTube、Prime Video 和 Netflix 上的任何内容,Firefox 都支持视频字幕。 + +你只需要在相应的平台上启用视频字幕,它就会继续出现在“画中画”中。 + +“画中画”字幕不仅支持主流平台,还支持 Coursera 等使用 WebVTT 格式的网站。 + +#### 语言检测 + +为了改善用户体验,Firefox 现在可以检测到语言与操作系统偏好不符的情况。 + +这只会在你安装浏览器后,第一次运行时触发。你可以在系统语言和浏览器默认语言之间进行选择。 + +#### 滚动条默认不占用屏幕空间 + +Linux 和 Windows 11 的滚动条默认不会占用你宝贵的屏幕空间。换句话说,当你进行滚动或导航时,滚动条才会做出反应。 + +![Firefox 100][4] + +你可以在设置中改变这一点(针对 Linux 用户)。如果你是在 Windows 上,Firefox 的视觉效果会跟随你的系统设置。因此,你需要对 Firefox 浏览器进行调整,以符合你自己的偏好。 + +#### 控制网站外观 + +![Firefox 100][5] + +对于某些网站,你的浏览器偏好会影响网页的颜色/外观。 + +为了调整这类网站的体验,你现在可以在设置中设置网站外观偏好,选择浅色/深色、系统或 Firefox 主题。 + +#### HDR 视频 & 硬件加速的 AV1 视频解码 + +尽管,对一些用户来说,支持 HDR 视频可能不是什么大事。但我还是要指出,现在 Mac 上的 Firefox 也支持 HDR 了。 + +截至目前,官方支持仅限于在 macOS 11+ 上浏览 YouTube 网站。当然,你还需要一个支持 HDR 的屏幕。 + +硬件加速的 AV1 视频解码终于在 Windows 上得到支持,当然,你还得有与之兼容的 GPU(包括英特尔 11 代、AMD RDNA 2 和 GeForce 30 系列)。除此之外,Firefox 在 Windows 上还启用了视频叠加功能,以减少电量使用。 + +不幸的是,这些并不是针对 Linux 的更新,但应该能帮助跨平台的 Firefox 用户。 + +#### 其他改进 + +除了主要的亮点之外,它还包括了以下改进: + +* 增加了对多个 Java 线程的分析支持。 +* 软重载一个网页将不再导致所有资源的重新验证。 +* 有了一个新的链接焦点指示器,它用一个实心的蓝色轮廓取代了旧的点状轮廓。 + +你可以在 [官方发布说明][6] 中了解更多技术变化。 + +### 获取 Firefox 100 + +你可以从它的官网上下载,也可以寻找可用的更新,应该很快就能下载完成。 + +> **[Mozilla Firefox 100][7]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/firefox-100-release/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/firefox-100-release.jpg +[2]: https://news.itsfoss.com/wp-content/uploads/2022/05/firefox-100-about.jpg +[3]: https://news.itsfoss.com/wp-content/uploads/2022/05/firefox-captions-100.jpg +[4]: https://news.itsfoss.com/wp-content/uploads/2022/05/scrollbars.jpg +[5]: https://news.itsfoss.com/wp-content/uploads/2022/05/firefox-appearance-tweak.jpg +[6]: https://www.mozilla.org/en-US/firefox/100.0/releasenotes/ +[7]: https://www.mozilla.org/en-US/firefox/download/ \ No newline at end of file diff --git a/published/20220504 How I manage my own virtual network with ZeroTier.md b/published/20220504 How I manage my own virtual network with ZeroTier.md new file mode 100644 index 0000000000..df9c169ab3 --- /dev/null +++ b/published/20220504 How I manage my own virtual network with ZeroTier.md @@ -0,0 +1,88 @@ +[#]: subject: "How I manage my own virtual network with ZeroTier" +[#]: via: "https://opensource.com/article/22/5/zerotier-network" +[#]: author: "Kevin Sonney https://opensource.com/users/ksonney" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14573-1.html" + +ZeroTier:你自己的虚拟骨干网 +====== + +> ZeroTier 是一个加密的虚拟骨干网,允许多台机器像在一个网络上一样通信。 + +![](https://img.linux.net.cn/data/attachment/album/202205/10/170306m9263ud6wu23ul3e.jpg) + +*自动化是现在的一个热门话题。在我作为网站可靠性工程师(SRE)的日常工作中,我的部分职责是将尽可能多的重复性任务自动化。但是我们当中有多少人在日常生活、非工作生活中这样做呢? 今年,我专注于自动化工作,以便我们可以专注于重要的事情。* + +在实现一切自动化的同时,我在一些远程站点上遇到了困难。我不是一个网络专家,所以我开始研究我的选择。在研究了各种虚拟专用网络(VPN)、硬件端点、防火墙规则以及支持多个远程站点的所有东西后,我感到困惑、暴躁,并对这一切的复杂性感到沮丧。 + +然后我发现了 [ZeroTier][4]。ZeroTier 是一个加密的虚拟骨干网,允许多台机器像在一个网络上一样通信。代码全部是开源的,你可以自行托管控制器,或者使用 [ZeroTierOne][5] 服务,有免费或付费计划。我现在使用的是它们的免费计划,它很强大、可靠,而且非常稳定。 + +因为我使用的是 Web 服务,所以我不打算详细介绍运行控制器和根服务。ZeroTier 在他们的 [文档][6] 中对如何做到这一点有完整的参考,而且非常好。 + +在 Web 用户界面中创建了我自己的虚拟网络之后,客户端的安装几乎是微不足道的。ZeroTier 有 APT、RPM、FreeBSD 和许多其他平台的软件包,所以让第一个节点上线不需要什么努力。 + +安装完毕后,客户端就会连接到控制器服务,并为节点生成一个唯一的 ID。在 Linux 上,你使用 `zerotier-cli` 命令来加入一个网络,使用 `zerotier-cli join NETWORKID` 命令: + +``` +$ sudo zerotier-cli info +200 info 469584783a 1.x.x ONLINE +``` + +你也可以使用 `zerotier-cli` 来获得连接和可用节点的列表,改变网络设置,以及离开网络。 + +![Image of Setting up a New Node][7] + +在加入一个网络后,你必须批准该节点的访问,可以通过网络控制台或调用应用程序编程接口(API)。这两种方法在 ZeroTier 网站上都有文档说明。连接两个节点后,无论你身在何处或位于防火墙的哪一侧,你都可以相互连接,就像你们在同一个建筑的同一个网络中。我的主要用例之一是 [远程访问我的家庭助理环境][8],而不需要打开防火墙端口或将其暴露在互联网上(关于我的家庭助理设置和相关服务的更多信息,见后文)。 + +我自己做的一件事是为内部 DNS 设置了一个 [Beta ZeroNDS 服务][9]。这为我管理自己的名称服务或为我所有的私人主机和 IP 地址创建公共记录减少了很多复杂性。我发现操作说明非常简单直白,并且能够在大约 5 分钟内为我的私人网络建立一个 DNS 服务器。每个客户端必须允许 Zerotier 设置 DNS,这在 GUI 客户端中非常简单。要使它在 Linux 客户端上使用,请使用: + +``` +$ sudo zerotier-cli setNETWORKID allowDNS=1 +``` + +在你添加和删除主机时,不需要其他更新,它“就能工作”。 + +``` +$ sudo zerotier-cli info +200 info 469584845a 1.x.y ONLINE +$ sudo zerotier-cli join +93afae596398153a 200 join OK +$ sudo zerotier-cli peers +200 peers + +61d294b9cb - PLANET 112 DIRECT 7946 2812 50.7.73.34/9993 +62f865ae71 - PLANET 264 DIRECT 7946 2681 50.7.76.38/9993 +778cde7190 - PLANET 61 DIRECT 2944 2901 103.195.13.66/9993 +93afae5963 1.x LEAF 77 DIRECT 2945 2886 35.188.31.177/41848 +992fcf1db7 - PLANET RECT 79124 DI47 2813 195. 181.173.159/9993 +``` + +我只提到了它所有功能的表面。ZeroTier 还允许在 ZeroTier 网络之间建立桥接、高级路由规则等。它们甚至有一个 [Terraform 提供者][10] 和一个 [很棒的 Zerotier 资源][11] 清单。到今天为止,我正在使用 ZeroTier 连接四个物理站点的机器,其中三个在 NAT 防火墙后面。Zerotier 的设置很简单,而且管理起来几乎完全不费力。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/zerotier-network + +作者:[Kevin Sonney][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/ksonney +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/coffee_tea_laptop_computer_work_desk.png +[2]: https://unsplash.com/@jonasleupe?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/tea-cup-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://github.com/zerotier +[5]: https://www.zerotier.com/pricing +[6]: https://docs.zerotier.com +[7]: https://opensource.com/sites/default/files/2022-04/SecondDay02-2.png +[8]: https://opensource.com/article/22/5/remote-home-assistant +[9]: https://github.com/zerotier/zeronsd +[10]: https://github.com/zerotier/terraform-provider-zerotier +[11]: https://github.com/zerotier/awesome-zerotier diff --git a/published/20220504 Microsoft’s 3D Movie Maker, First Released In 1995, Is Now Open Source.md b/published/20220504 Microsoft’s 3D Movie Maker, First Released In 1995, Is Now Open Source.md new file mode 100644 index 0000000000..bc51103067 --- /dev/null +++ b/published/20220504 Microsoft’s 3D Movie Maker, First Released In 1995, Is Now Open Source.md @@ -0,0 +1,43 @@ +[#]: subject: "Microsoft’s 3D Movie Maker, First Released In 1995, Is Now Open Source" +[#]: via: "https://www.opensourceforu.com/2022/05/microsofts-3d-movie-maker-first-released-in-1995-is-now-open-source/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14549-1.html" + +微软 1995 年首次发布的 3D Movie Maker 现已开源 +====== + +![Windows Movie Maker 标志][1] + +这些年来,微软发布了许多开源工具。今天,它正在翻箱底,让 3D Movie Maker 也对所有人开放。3D Movie Maker 于 1995 年首次推出,它允许你用 3D 人物、道具、背景、文字、声音和特殊效果来创建动画场景。这个版本还包括一个 Argonaut 软件公司构建的 BRender。虽然这是一个积极的举措,但请先别太激动,事情可没那么容易。 + +> “这个项目不太可能在现代硬件/软件下构建成功,但你可以先开始编译,并获得部分完整的二进制文件。” + +以下是它的部分构建说明: + +- 确保本仓库检出到一个名字简短的目录中,最好是靠近驱动器的根路径(即 `C:\3d` 这样)。 +- 在构建过程中,你需要 Visual C++ 2.0 的开发工具(可以在安装盘的 `MSVC20BIN` 目录下找到)。有一些源码遵循的是 C++98 之前的规范,因此现代编译器可能不会喜欢它们。 +- 从本仓库的根目录下运行 `setvars.bat`。你可以改变这个脚本中的值来改变你的构建目标。 +- 查找并安装字体文件(详见 `FONTS.md`)。 +- 运行 `nmake` 以开始使用 3D Movie Maker。 + +这些代码是从微软公司的档案中恢复的,涉及到的第三方软件(如 BRender)已获得授权。同时,它删除了开发者的身份和别名,以便使该软件开源(从事原始发布工作的微软现任员工除外,他们同意保留自己的名字)。你可以在 [这里][2] 下载它。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/microsofts-3d-movie-maker-first-released-in-1995-is-now-open-source/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/windows-movie-maker-logo-696x392.png +[2]: https://github.com/microsoft/Microsoft-3D-Movie-Maker diff --git a/published/20220504 elementary OS 7 Code Name Revealed. Here are the Details.md b/published/20220504 elementary OS 7 Code Name Revealed. Here are the Details.md new file mode 100644 index 0000000000..c7bc93e4f1 --- /dev/null +++ b/published/20220504 elementary OS 7 Code Name Revealed. Here are the Details.md @@ -0,0 +1,57 @@ +[#]: subject: "elementary OS 7 Code Name Revealed. Here are the Details" +[#]: via: "https://www.debugpoint.com/2022/05/elementary-os-7-announcement/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14556-1.html" + +elementary OS 7 公布了它的代号 +====== + +> 在今天早些时候的一篇博文中,创始人兼首席执行官 Daniella Fore 公布了 elementary OS 7 的发行说明和计划更新。 + +![](https://img.linux.net.cn/data/attachment/album/202205/07/085713izkxhbarixtkdryg.jpg) + +### elementary OS 7 公告 + +elementary OS 7 的代号是 “Horus”,它将基于 [Ubuntu 22.04 LTS][2]。这个版本的开发已经接近尾声,团队正在修复一些涉及窗口管理器和其他领域的关键回归测试问题。 + +首先,功能方面,elementary OS 7 得到了来自 **Ubuntu 22.04 LTS 的最新软件包和升级**。此外,**Flatpak 运行时更新、Granite 7、样式表和图标更新** 预计将在这个发行版的第 7 个版本中出现。它将会基于 [Linux 5.15.x 内核][3]。 + +其次,应用商店中的软件将会获得 **软件自动更新功能** 和新的 **笔记本电脑的电源配置文件选项**。预计电源配置文件将遵循传统的“平衡Balanced”、“性能Performance”和“节能Power Saver”选项,就像其他 Linux 发行版一样。 + +此外,一个 **新的漂亮的音乐应用程序** 将在这个版本中首次亮相,它重新设计了一些图标,在桌面上的视觉效果也有提升。一些原生的应用商店中的软件已经使用了 GTK4 技术,在 Elementory OS 7 中,它们将会给用户带来流畅的性能体验。 + +#### 新的升级工具 + +但这还不是全部。团队还兴奋地宣布,一个 elementary **版本升级工具** 的可用原型已经准备就绪,目前正在测试。因此,在 elementary OS 7 发布后,它将正式亮相,以帮助用户实现从 elementary OS 6 到 7 的迁移。 + +目前,elementary OS 的版本升级是最大的挑战,因为它没有任何官方的升级途径。“版本升级工具” 是一个令人兴奋的消息,它将吸引更多的用户使用这个漂亮的 Linux 发行版。 + +不过,Wayland 迁移仍在计划之中,还没有被优先考虑。当 Wayland 被完整支持后,elementary OS 用户将会获得令人兴奋的体验。 + +### 发布日期? + +对于任何一个 elementary OS 发行版,用户最关心的问题都是发布日期。嗯,发布日期还没有最终确定。elementary OS 7 “Horus” 将在准备好后发布。我乐观的猜测是在今年年底,在 Ubuntu 22.04 的第一个点发布(预计在 2022 年 7 月)之后。 + +最后,请阅读 elementary OS 7 [官方公告][4],了解更多关于这个版本的信息,以及 elementary OS 6 “Odin”(6.1 版本)的许多更新。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/elementary-os-7-announcement/ + +作者:[Arindam][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.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2021/08/elementary-OS-6-ODIN-Desktop-1024x576.jpeg +[2]: https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/ +[3]: https://www.debugpoint.com/2021/11/linux-kernel-5-15/ +[4]: https://blog.elementary.io/updates-for-april-2022/ diff --git a/published/20220505 Experiment with containers and pods on your own computer.md b/published/20220505 Experiment with containers and pods on your own computer.md new file mode 100644 index 0000000000..f7d6c78725 --- /dev/null +++ b/published/20220505 Experiment with containers and pods on your own computer.md @@ -0,0 +1,87 @@ +[#]: subject: "Experiment with containers and pods on your own computer" +[#]: via: "https://opensource.com/article/22/5/containers-pods-101-ebook" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14591-1.html" + +在自己的电脑上实验容器和荚 +====== + +> 通过这篇新的可下载指南开始探索容器技术的要领。 + +![](https://img.linux.net.cn/data/attachment/album/202205/14/102808n8u3pkff174431v7.jpg) + +在电视剧 《太空堡垒卡拉狄加Battlestar Galactica》中,这艘名副其实的巨型飞船其实并没有做什么。它是船员们坚定的庇护所,是战略和协调的中心联络点,也是资源管理的安全场所。而 卡布里安毒蛇号Caprican Vipers 这种单人的独立太空船,出去对付邪恶的赛昂人Cylons和其他太空中的危险。他们也从不只派一两艘毒蛇号出去。他们派了很多。这许许多多的冗余的飞船具有基本相同的能力和目的,但由于它们非常灵活和数量众多,它们总是能够处理每个星期都在威胁战星的任何问题。 + +如果你认为你感到这像是一个正在发展中的比喻,那么你是对的。现代的“云”大而无当,是分布在很远距离的大量基础设施的集合体。它具有强大的能力,但如果你将其视为普通计算机,就会浪费了它的大部分能力。当你想要处理来自数百万个输入源的大量数据时,把你的解决方案(无论它是采用应用、网站、数据库、服务器还是其他形式)打包起来,并发送该解决方案的微小镜像来处理数据集群,实际上是更有效的。当然,这些都是 “容器container”,它们是云的劳动力。它们是你发送来处理服务请求的小型解决方案工厂,并且由于你可以根据任何给定时间传入的请求生成所需要的数量,因此理论上它们是取之不尽的。 + +### 在家里使用容器 + +如果你没有大量的传入请求需要处理,你可能会想知道容器给你带来什么好处。不过,在个人电脑上使用容器确实有其用途。 + +#### 容器作为虚拟环境 + +通过 Podman、LXC 和 Docker 等工具,你可以像以往运行虚拟机一样运行容器。不过,与虚拟机不同,容器没有因模拟固件和硬件而产生的开销。 + +你可以从公共仓库下载容器镜像,启动一个最小化的 Linux 环境,并将其作为命令或开发的测试场所。例如,假设你想试试你在 Slackware Linux 上构建的一个应用。首先,在仓库中搜索一个合适的镜像: + +``` +$ podman search slackware +``` + +然后选择一个镜像,作为你的容器的基础: + +``` +$ podman run -it --name slackware vbatts/slackware +sh-4.3# grep -i ^NAME\= /etc/os-release +NAME=Slackware +``` + +### 在工作中使用容器 + +当然,容器不只是个精简的虚拟机。它们可以是针对为非常具体的需求提供的特定解决方案。如果你不熟悉容器,那么新系统管理员最常见的入门仪式之一可能会有所帮助:启动你的第一个 Web 服务器,但是在容器中。 + +首先,获取一个镜像。你可以使用 `podman search` 命令来搜索你喜欢的发行版,或者直接搜索你喜欢的 httpd 服务器。当使用容器时,我倾向于信任我在裸机上使用的相同发行版。 + +当你你找到一个镜像作为你的容器的基础,你就可以运行你的镜像。然而,正如这个术语所暗示的,容器是*封起来的*,所以如果你只是启动一个容器,你将无法访问标准的 HTTP 端口。你可以使用 `-p` 选项将一个容器端口映射到一个标准的网络端口: + +``` +$ podman run -it -p 8080:80 docker.io/fedora/apache:latest +``` + +现在看看你本地主机上的 8080 端口: + +``` +$ curl localhost:8080 +Apache +``` + +成功了。 + +### 了解更多 + +容器拥有比模仿虚拟机更多的潜力。你可以将它们分组在 “pod” 中,构建复杂应用的自动部署,启动冗余服务以满足高需求等等。如果你刚刚开始使用容器,你可以 [下载我们最新的电子书][2] 来学习该技术,甚至学习创建一个 “pod”,以便你可以运行 WordPress 和数据库。 + +> **[下载我们最新的电子书][2]** + +(LCTT 译注:容器环境中使用的 “Pod” 一词,我以前根据容器相关术语多用航海领域名词比喻来将其译做“吊舱”,但也有同学表示了不同意见。根据 Kubernetes [文档][3],这个词来自对鲸鱼荚pod of whales豌豆荚pea pod的比喻,所以我觉得采用“荚”的翻译比较合适。—— wxy) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/containers-pods-101-ebook + +作者:[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/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png +[2]: https://opensource.com/downloads/containers-pods-101-ebook +[3]: https://kubernetes.io/docs/concepts/workloads/pods/#:~:text=A%20Pod%20\(as%20in%20a,run%20in%20a%20shared%20context. \ No newline at end of file diff --git a/published/20220505 Open Source Developer Creates First-of-its-Kind Fund To Support Maintainers.md b/published/20220505 Open Source Developer Creates First-of-its-Kind Fund To Support Maintainers.md new file mode 100644 index 0000000000..8b3ca8c3bb --- /dev/null +++ b/published/20220505 Open Source Developer Creates First-of-its-Kind Fund To Support Maintainers.md @@ -0,0 +1,41 @@ +[#]: subject: "Open Source Developer Creates First-of-its-Kind Fund To Support Maintainers" +[#]: via: "https://www.opensourceforu.com/2022/05/open-source-developer-creates-first-of-its-kind-fund-to-support-maintainers/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14575-1.html" + +开源开发者创建首个支持维护者的基金 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/11/091909u7kjzkp3tsf7p74s.jpg) + +Appwrite 是一个为 Web、移动和 flutter 开发者提供的开源“后端即服务Backend-as-a-Service”(BaaS)平台。今天,它宣布成立开源软件基金Open Source Software Fund(OSS 基金),第一年该基金将向那些为当下数字基础设施奠定基础,却没有得到补偿的开源维护者,提供 5 万美元的资助。 + +Appwrite 每年的开源基金将用于协助开源开发者、促进技术革新,并为各种开源开发方案打造知名度。每年,它都会对基金数额进行审查,以确保其继续满足社区的需求。目前已经开始接受申请,并且每年都会接受申请。受资助者将由 Appwrite 开发者关系团队选出。了解更多:[https://appwrite.io/oss-fund][2]。 + +创始人兼 CEO Eldad Fux 说:“我懂这种感受,你在电脑前花费大量时间,把血汗和泪水投入到热爱的事物中,而且这些事物还在使全世界成千上万甚至数百万人受益。我一直就有这个想法:借用 Appwrite 的一些成功经验和投资,来支持其他像我一样的开发者和维护者,以回馈的方式来展望未来。希望我们的贡献能够带来改变。” + +在今天的技术环境中,最紧迫的挑战之一就是开源开发者和维护者的长期生存能力。尽管开源软件占比已经达到 70% 到 90%,是当下数字文明的基础,但许多最重要项目的开发者和维护者仍然没有获得足够报酬,或者根本没有报酬。关于如何帮助这些人,业界已经有了许多讨论,并提出了一系列的解决方案。Appwrite 正在为维护者做一些事,提升他们的工作,并提供经济支持,以换取他们对行业和数字社会的贡献。 + +Eldad Fux 自身通过为开源软件项目做贡献和参与开源社区,开始了他的开发者生涯。Appwrite 最初是一个副业项目,他把它作为一个 BaaS 产品从头打造。目前,Fux 通过专注于完全开源的平台和以各种方式回馈社区来支持开源理念,其中就包括了 Appwrite OSS 基金。 + +EddieHub 的创始人和开发者 Eddie Jaoude 说:“开源为世界上大部分的现代基础设施提供动力,从移动到网络、汽车甚至是地球以外的任务。只有靠社区的慷慨解囊,他们的时间和努力才能持续。如果有更多的公司和组织的支持,这种情况将得到改善,避免社区成员因报酬不足/没有报酬而懈怠。” + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/open-source-developer-creates-first-of-its-kind-fund-to-support-maintainers/ + +作者:[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/04/opensourceBETTERimage-696x392.jpg +[2]: https://appwrite.io/oss-fund diff --git a/published/20220505 Tails 5.0 Release is Based on Debian 11 With a New -Kleopatra- Tool.md b/published/20220505 Tails 5.0 Release is Based on Debian 11 With a New -Kleopatra- Tool.md new file mode 100644 index 0000000000..5fdb752316 --- /dev/null +++ b/published/20220505 Tails 5.0 Release is Based on Debian 11 With a New -Kleopatra- Tool.md @@ -0,0 +1,97 @@ +[#]: subject: "Tails 5.0 Release is Based on Debian 11 With a New “Kleopatra” Tool" +[#]: via: "https://news.itsfoss.com/tails-5-0-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14568-1.html" + +Tails 5.0 发布:基于 Debian 11,附带新的 Kleopatra 工具 +====== + +> Tails 5.0 是一次令人印象深刻的升级,采用了 Debian 11 和一个新的工具,为用户配备了增强的安全和隐私。 + +![](https://news.itsfoss.com/wp-content/uploads/2022/05/tail-5-0-release.jpg) + +Tails 是一个流行的 Linux 发行版,它专注于保护人们免受审查和监视,是 [注重隐私的 Linux 发行版][1] 之一。 + +你可以在任何地方使用它和 U 盘 来完成工作,而不用担心暴露你的信息。 + +Tails 5.0 是最新的版本,它基于 Debian 11(Bullseye)构建。因此,你可以期待 Tails 5.0 中具备所有 [Debian 11 的改进][2]。 + +### Tails 5.0:更新内容 + +让我们来看看该版本所引入了哪些新功能和软件升级吧! + +以下是其中的一些亮点。 + +#### 增加了 Kleopatra 工具 + +![][3] + +Kleopatra 是 [GnuPG][4] 的一个图形界面,它用于加密文本和文件。在 Tails 5.0 中,Kleopatra 取代了 OpenPGP 小程序 和 Seahorse 工具。 + +Kleopatra 只在一个软件包中就完成了这一切。并且,相对而言,Kleopatra 的维护更加活跃,问题最少。 + +#### 默认启用的附加软件 + +当使用持久化存储时,附加软件功能是默认启用的。 + +因此,你可以在短时间内快速配置你想要的东西。 + +#### 对活动概览的改进 + +![][5] + +在 Tails 5.0 中,你可以使用活动概览来访问你的窗口和应用程序。你只需点击屏幕左上角的“活动Activities”按钮或按下键盘上的超级Super键(LCTT 译注:在某些键盘上是 WIN 键)即可。 + +你还可以在同一屏幕中搜索应用程序、文件和文件夹。 + +#### 软件升级 + +Tails 5.0 基于 Debian 11,因此,所有的基本软件都已升级,包括: + + * Tor 浏览器 to 11.0.11 + * GNOME 3.38 + * MAT to 0.12 + * Audacity 2.4.2 + * 磁盘工具 3.38 + * GIMP 2.10.12 + * LibreOffice 7.0 + +#### 其他改进 + +除软件升级外,无驱动打印和扫描的硬件支持也得到了更新,以支持新款的打印机/扫描仪。 + +除此之外,它还有许多修复。你可以在其 [官方发布公告][6] 中查看更多信息。 + +### 下载 Tails 5.0 + +你可以在官方网站下载最新的 Tails 5.0 ISO。 + +> **[Tails 5.0][7]** + +注意,如果你已经在使用 Tails,请不要执行自动升级。你需要按照 [官方说明][8] 进行手动升级。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/tails-5-0-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/privacy-focused-linux-distributions/ +[2]: https://news.itsfoss.com/debian-11-feature/ +[3]: https://news.itsfoss.com/wp-content/uploads/2022/05/kleopatra.png +[4]: https://www.gnupg.org/ +[5]: https://news.itsfoss.com/wp-content/uploads/2022/05/desktop-tails-5.png +[6]: https://tails.boum.org/news/version_5.0/index.en.html +[7]: https://tails.boum.org/install/index.en.html +[8]: https://tails.boum.org/doc/upgrade/index.en.html#manual diff --git a/published/20220505 Xebian – A Blend of Debian and Goodness of Xfce [Review].md b/published/20220505 Xebian – A Blend of Debian and Goodness of Xfce [Review].md new file mode 100644 index 0000000000..ab7f56e1a4 --- /dev/null +++ b/published/20220505 Xebian – A Blend of Debian and Goodness of Xfce [Review].md @@ -0,0 +1,100 @@ +[#]: subject: "Xebian – A Blend of Debian and Goodness of Xfce [Review]" +[#]: via: "https://www.debugpoint.com/2022/05/xebian-review-2022/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14602-1.html" + +Xebian:Debian 与 Xfce 的完美结合 +====== + +> 这是一篇对漂亮而时尚的 Xebian Linux 发行版的快速评测。 + +Xebian 是一个基于 Xfce 桌面环境的 Linux 发行版,基于 Debian 不稳定分支(sid)。这个 Linux 发行版提供了一个带有基本的 Xfce 桌面的 Debian,而无需更改配置和附加软件包。因此,你不用在安装 Debian 和 Xfce 上花费太多时间就可以获得通常的开箱即用体验。 + +那么,如果你想尝试一下,这是对 Xebian 的快速评测。 + +![](https://www.debugpoint.com/wp-content/uploads/2022/05/Xebian-Desktop-with-Xfce.jpg) + +### Xebian 评测 + +#### 安装 + +考虑到林林总总的 ISO(迷你、自由、非自由等等),Debian 安装可能会有点复杂。毕竟,它是一个真正的“通用操作系统”。但是对于 Xebian,就轻松多了,因为它只有一个提供了 Debian sid 和 Xfce 的 64 位 ISO 文件。Xebian 使用 Debian 原生的安装程序,在你的物理系统或虚拟机中安装此发行版都相当简单。 + +在我的测试过程中,安装很顺利,没有报告任何问题。安装大约需要 4 分钟。 + +#### 外观和感觉 + +安装后,当你首次启动系统时,你会看到带有 Xebian 默认壁纸的漂亮登录页面。这个登录屏幕是标准的默认 Xfce 桌面登录页面。 + +![Xebian Logn Screen][1] + +首先,该桌面非常轻量,有着 Xfce 的干净外观。Xebian 就是一个在 Debian 上提供了完整 Xfce 桌面的 Linux 发行版。因此,唯一的区别是看起来不错的默认壁纸,以及默认的 Numix 主题(深色)。那些喜欢更传统外观的人也可以使用 Adwaita 和 Gerybird 主题。 + +其次,顶部面板右侧有 “鼠须菜单Whisker Menu” 和标准的系统托盘,带有音量控制、电池指示、网络/Wi-Fi 和日期/时间。 + +#### 应用 + +Xebian 打包了所有 Xfce 原生应用,而没有添加任何额外内容。安装了它,你就应该拥有了一个稳定的工作桌面,并预装了以下应用程序: + +* Thunar 文件管理器 +* Ristretto 图像查看器 +* Mousepad 文本编辑器 +* Catfish 文件搜索 +* XFCE 终端 +* Firefox 浏览器 +* Synaptic 包管理器 +* GParted 分区程序 +* 系统设置 + +除此之外,如果你需要任何其他应用,你可以使用 “新立得Synaptic” 包管理器轻松安装它们。使用内置的 “软件及软件源Software and Sources” 应用可以轻松调整软件源。 + +[Xfce 4.16][2] 是当前的稳定正式版本,并一同提供了其原生应用。而 Xfce 4.18 距离最终版本还很遥远。 + +该发行版的核心基于 Debian 不稳定分支 “sid”,在撰写本文时它正处于 Debian 12 “bookworm” 的发布路径上。它基于最新的 [Linux 内核 5.17][3] 进行滚动发布。 + +此外,如果你需要一个常规的图像编辑器、图形软件和办公套件(例如 LibreOffice),那么你可以手动安装它们。它们不是 ISO 文件的一部分。 + +现在,让我们来看看性能。 + +#### Xebian 的性能 + +Xebian 是轻量级的,非常适合旧硬件,这要归功于 Debian。我分两个阶段测试了其性能。 + +在让系统闲置一段时间后的理想阶段,消耗了大约 710 MB 内存,而 CPU 平均为 2%。大多数空闲状态资源被 Xfce4-desktop 和 Xfce 窗口管理器消耗。 + +其次,我在重度使用阶段对其进行了测试。我使用文件管理器、文本编辑器、终端和 Firefox 浏览器的一个实例作为工作负载尝试了 Xebian。在此工作负载下,Xebian 平均消耗 1.2GB 内存和 2% 到 3% 的 CPU,具体取决于各自的应用活动。而且,Firefox 明显消耗了大部分内存和 CPU,其次是 Xfce 窗口管理器的内存消耗增加了近 50%。 + +总的来说,我认为它是稳定的,应该可以在至少 4 GB 内存的中档硬件中正常工作。 + +### 结束语 + +基于 Debian 不稳定分支的 [Linux 发行版][4] 很少。如果你正在寻找 Xfce 和 Debian sid 的特定组合,那么 Xebian 是合适的,因为你从 Debian 获得了一个很可靠的滚动版本,并内置了 Xfce。 + +虽然它说是“不稳定”的,但根据我的经验,如果你每周保持系统更新,Debian “不稳定” 分支会很好地工作。 + +最后,如果你想尝试此发行版,请访问官方网站并 + +> **[下载 ISO 文件][5]** + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/xebian-review-2022/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/05/Xebian-Logn-Screen-1024x578.jpg +[2]: https://www.debugpoint.com/2021/02/xfce-4-16-review/ +[3]: https://www.debugpoint.com/2022/03/linux-kernel-5-17/ +[4]: https://www.debugpoint.com/category/distributions +[5]: https://xebian.org/download/ diff --git a/published/20220506 Announcing Fedora Linux 36.md b/published/20220506 Announcing Fedora Linux 36.md new file mode 100644 index 0000000000..d0398b31ed --- /dev/null +++ b/published/20220506 Announcing Fedora Linux 36.md @@ -0,0 +1,88 @@ +[#]: subject: "Announcing Fedora Linux 36" +[#]: via: "https://fedoramagazine.org/announcing-fedora-36/" +[#]: author: "Matthew Miller https://fedoramagazine.org/author/mattdm/" +[#]: collector: "lujun9972" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14579-1.html" + +Fedora Linux 36 发布 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/11/162224g07rzfbbniwbrgbn.jpg) + +今天,我很高兴与大家分享一个消息,它是成千上万的 Fedora 项目贡献者辛勤工作的成果:我们的最新版本 —— Fedora Linux 36,和大家见面了! + +### 由社区开发,为社区服务 + +通常当我写这些公告时,我会谈论版本中的一些很棒的技术变化。但这一次,我想把重点放在实现这些变化的社区上。Fedora 社区不是一群孤立地工作的人 —— 我们是朋友。事实上,这也是我们的“四个理念Four Foundations”之一。 + +我们最新的“Fedora 朋友”之一,Juan Carlos Araujo 在一篇 [Fedora 讨论帖子][2] 中说得很好: + +> 除了功能、稳定性、特性、工作方式以及前沿性外,我认为决定一个发行版成败的还有那些无形的东西,比如文档和社区。而 Fedora 拥有这一切……尤其是无形的东西。 + +多年来,我们一直努力使 Fedora 成为一个包容和欢迎的社区。我们希望它成为经验丰富的贡献者和新手能一起工作的地方。就像我们希望 Fedora Linux 是一个既能吸引资深用户又能吸引新手的发行版一样。 + +说到 Fedora Linux,让我们看看新版本的一些亮点。像往常一样,在从旧版本升级之前,请确保你的系统是最新的。这次尤其需要注意,因为我们在 F34/F35 更新中修复了一些非常重要的与升级有关的错误。如果不先应用这些更新,系统升级可能会失败。 + +### 桌面改进 + +Fedora 工作站专注于桌面体验,尤其是面向那些希望获得“刚刚好”的 Linux 系统体验的用户。像往常一样,Fedora 工作站采用最新的 GNOME 版本:[GNOME 42][3]。虽然 GNOME 42 不能完全解决生命、宇宙和一切问题,但它带来了很多改进。许多应用程序都被移植到了 GTK 4,以改善风格和性能。它还附带了两个新的应用程序:文本编辑器Text Editor控制台Console。它们的名字起得很贴切,所以你可以猜出它们是干什么的。文本编辑器是新的默认文本编辑器,而控制台可以在软件仓库中下载。 + +如果你使用了英伟达的专有图形驱动,你的桌面会话现在将默认使用 Wayland 协议。这使你能够在使用现代桌面管理器时,充分利用硬件加速。 + +当然,我们生产的不仅仅是 “Editions”。[Fedora Spins][4] 和 [Labs][5] 针对不同的受众和使用场景。例如 [Fedora Comp Neuro][6] ,它为计算神经科学提供工具,以及 [Fedora LXQt][7],它提供一个轻量级的桌面环境。并且,我们附加了可选架构:[ARM AArch64、Power 和 S390x][8]。 + +### 针对系统管理员的改进 + +Fedora Linux 36 包含最新的 Ansible 版本。Ansible 5 将“引擎”拆分为 ansible-core 包和 [collection 包][9]。这使得维护更容易,并允许你只下载需要的集合。请参阅 [Ansible 5 迁移指南][10] 以了解如何更新你的 Playbook。 + +从 Fedora Server 36 开始,Cockpit 提供了一个用于配置和持续管理 NFS 及 Samba 共享的模块。这使得管理员可以通过 Cockpit 网页界面(用于配置其他服务器属性)来管理网络文件共享。 + +### 其他更新 + +无论你使用 Fedora Linux 的哪个衍生版,你都会得到开源世界所提供的最新成果。Podman 4.0 将在 Fedora Linux 36 中首次全面发布。它带来了大量变化和一个全新的网络栈。不过,它也带来了向下**不兼容**的 API 变化,所以请仔细阅读 [上游文档][11]。 + +遵循 Fedora 的 “[争先][12]First” 理念,我们已经更新了关键的编程语言和系统库包,包括 Ruby 3.1、Golang 1.18 和 PHP 8.1。  + +我们很高兴你能试用新版本!请访问 [https://getfedora.org](https://getfedora.org) 并立即下载它吧!或者,如果你正在使用 Fedora Linux,请按照我们的 [简易升级说明][13] 进行。想了解更多关于 Fedora Linux 36 新功能的信息,请查看 [发行说明][14]。 + +### 虽然不大可能会出现问题…… + +但是,如果你真的遇到了问题,请访问我们的 [Ask Fedora][15] 用户支持论坛。这里有一个 [常见问题][16] 的分类。 + +### 谢谢大家 + +感谢在本次发布周期内为 Fedora 项目做出贡献的成千上万的人。Fedora 社区有你们,真好!请务必在 5 月 13 日至 14 日参加我们的 [虚拟发布派对][17]! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/announcing-fedora-36/ + +作者:[Matthew Miller][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/mattdm/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2022/05/f36-final-816x345.jpg +[2]: https://discussion.fedoraproject.org/t/the-end-of-my-distro-hopping-days/38445 +[3]: https://release.gnome.org/42/ +[4]: https://spins.fedoraproject.org/ +[5]: https://labs.fedoraproject.org/ +[6]: https://labs.fedoraproject.org/en/comp-neuro/ +[7]: https://spins.fedoraproject.org/en/lxqt/ +[8]: https://alt.fedoraproject.org/alt/ +[9]: https://koji.fedoraproject.org/koji/search?match=glob&type=package&terms=ansible-collection* +[10]: https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_5.html +[11]: https://podman.io/releases/2022/02/22/podman-release-v4.0.0.html +[12]: https://docs.fedoraproject.org/en-US/project/#_first +[13]: https://docs.fedoraproject.org/en-US/quick-docs/upgrading/ +[14]: https://docs.fedoraproject.org/en-US/fedora/f36/release-notes/ +[15]: https://ask.fedoraproject.org/ +[16]: https://ask.fedoraproject.org/tags/c/common-issues/141/f36 +[17]: https://hopin.com/events/fedora-linux-36-release-party/registration diff --git a/published/20220506 My favorite open source tool for using crontab.md b/published/20220506 My favorite open source tool for using crontab.md new file mode 100644 index 0000000000..ee2a4c4481 --- /dev/null +++ b/published/20220506 My favorite open source tool for using crontab.md @@ -0,0 +1,78 @@ +[#]: subject: "My favorite open source tool for using crontab" +[#]: via: "https://opensource.com/article/22/5/cron-crontab-ui" +[#]: author: "Kevin Sonney https://opensource.com/users/ksonney" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14598-1.html" + +管理 crontab 的开源工具 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/16/100309tw6wgx3sss36wl6r.jpg) + +> crontab-ui 是一个用 Node.js 编写的 Web 前端,帮助管理 crontab 文件。 + +*自动化是目前的一个热门话题。在我作为网站可靠性工程师(SRE)的日常工作中,我的部分职责是将尽可能多的重复性任务自动化。但是,有多少人在我们的日常非工作生活中这样做呢?今年,我专注于将劳作自动化,以便我们可以专注于重要的事情。* + +作为一个初出茅庐的系统管理员,我最早了解的东西之一是 “cron”。cron 被广泛用于做一些事情,如轮换日志、启动和停止服务、运行程序作业等等。它在几乎所有的 Unix 和 Linux 系统中都可用,而且是我认识的每个系统管理员用来帮助管理服务和服务器的东西。cron 可以自动运行任何控制台应用或脚本,这使得它非常、非常灵活。 + +> LCTT 译注:CRON 是 “Command Run On” 的缩写,即在某个时间运行命令。 + +![Image of a Crontab][3] + +我用 cron 来获取电子邮件,运行过滤程序,确保服务正在运行,与 Habitica 等在线游戏互动等。 + +### 以传统方式使用 cron + +要开始使用 cron,你可以简单地在命令行输入 `crontab -e`,启动一个打开了当前 `crontab`(“cron table” 的缩写)文件的编辑器(如果你以 root 身份这样做,你访问的是系统 crontab)。这是保存作业计划的地方,记录了何时运行。David Both 已经写了 [大量][4] 关于该文件的格式和如何使用它的文章,所以我不打算在这里介绍。我要说的是,对于新用户来说,这可能有点吓人,而且设置时间有点痛苦。 + +### 介绍 crontab-ui + +有一些奇妙的工具可以帮助解决这个问题。我最喜欢的是 [crontab-ui][5],这是一个用 Node.js 编写的 Web 前端,可以帮助管理 crontab 文件。为了安装和启动 `crontab-ui` 供个人使用,我使用了以下命令。 + +``` +# 做个备份 +crontab -l > $HOME/crontab-backup +# 安装 Crontab UI +npm install -g crontab-ui +# 创建本地数据库目录 +mkdir $HOME/crontab-ui +# 启动 crontab-ui +CRON_DB_PATH=$HOME/crontab-ui crontab-ui +``` + +完成这些后,只需将你的网页浏览器指向 `http://localhost:8000`,你就会看到 crontab-ui 的网页界面。要做的第一件事是点击 “从 Crontab 获取Get from Crontab”,加载你可能有的任何现有作业。然后点击“备份Backup”,这样你就可以回滚你所做的任何修改。 + +![Image of Crontab-UI][6] + +添加和编辑 cron 作业是非常简单的。添加一个名称,你想运行的完整命令,以及时间(使用 cron 语法),然后保存。另外,你还可以捕获日志,并设置将工作状态邮寄到你选择的电子邮箱。 + +完成后,点击 “保存到 CrontabSave to Crontab”。 + +我个人非常喜欢它的日志记录功能。有了 crontab-ui,你可以通过点击一个按钮来查看日志,这在排除故障时非常有用。 + +我建议不要一直运行 crontab-ui,至少不要公开运行。虽然它确实具有一些基本的身份验证功能,但它不应该暴露在你的本地机器之外。我不需要经常编辑我的 cron 作业,所以我可以按需启动和停止它。 + +下次你需要编辑你的 crontab 时,可以试试 crontab-ui! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/cron-crontab-ui + +作者:[Kevin Sonney][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/ksonney +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png +[2]: https://creativecommons.org/licenses/by/3.0/us/ +[3]: https://opensource.com/sites/default/files/2022-04/Day01-1.png +[4]: https://opensource.com/article/17/11/how-use-cron-linux +[5]: https://opensource.com/%5Bhttps%3A//github.com/alseambusher/crontab-ui%5D%28https%3A//github.com/alseambusher/crontab-ui%29 +[6]: https://opensource.com/sites/default/files/2022-04/Day01-2.png diff --git a/published/20220506 Ubuntu MATE’s Lead Creates a Nifty Tool to Help Install 3rd Party Deb Packages.md b/published/20220506 Ubuntu MATE’s Lead Creates a Nifty Tool to Help Install 3rd Party Deb Packages.md new file mode 100644 index 0000000000..351f910f70 --- /dev/null +++ b/published/20220506 Ubuntu MATE’s Lead Creates a Nifty Tool to Help Install 3rd Party Deb Packages.md @@ -0,0 +1,117 @@ +[#]: subject: "Ubuntu MATE’s Lead Creates a Nifty Tool to Help Install 3rd Party Deb Packages" +[#]: via: "https://news.itsfoss.com/deb-get-ubuntu/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14576-1.html" + +Ubuntu MATE 的负责人开发了一个漂亮的工具,专用于安装第三方 deb 包 +====== + +> 这是一个有趣的工具,它可以替代 apt-get 来安装 Ubuntu 上的第三方 deb 包。它应该能帮为你节省时间! + +![deb-get][1] + +Ubuntu MATE 的负责人 **Martin Wimpress** 为 Linux 用户带来了另一个有趣的项目。 + +你可能不知道,这个 Martin 经常开发一些有趣的东西。去年,我们报道了 [Quickemu][2],它通过一个基于 QEMU 的 GUI 工具,帮助用户在 Linux 中创建虚拟机,使这个过程变得简单。 + +现在,他又带来了一个有趣的 `deb-get` 工具,其目标是为第三方 .deb 包模仿 `apt-get` 的支持。 + +让我们来详细了解一下它吧! + +### Deb Get:使用 CLI 无缝安装第三方 deb 包 + +当官方软件库中没有你想安装的软件包时(比如 Google Chrome、Vivaldi 等),你必须先 [添加一个 PPA(非官方/官方)][3] 或者下载 .deb 文件后 [手动安装][4]。 + +如果我现在告诉你,你可以直接在终端中安装它们,就好像官方软件库中有它们一样呢? + +这就是 `deb-get` 工具想要做到的事。 + +通常,当在终端中安装一个软件包时,你会使用下面的命令: + +``` +sudo apt install packagename +``` + +或者 + +``` +sudo apt-get install packagename +``` + +要使用这个工具,你只需把 `apt-get` 替换为 `deb-get`,其他格式保持不变。就像下面这样: + +``` +sudo deb-get install packagename +``` + +举个例子,通常,我们 [在 Linux 上安装 Vivaldi][5] 时需要添加 PPA 或下载 .deb 文件。 + +现在,如果你在系统上配置好了 `deb-get` 工具(**配置指南在本文末尾**),你就可以使用以下命令轻松地安装 Vivaldi: + +``` +sudo deb-get install vivaldi-stable +``` + +![][6] + +另外,类似于 `apt-get upgrade`,你可以使用下面的命令来升级软件包: + +``` +sudo deb-get upgrade +``` + +> **注意:** 虽然 `deb-get` 使安装第三方 .deb 包变得很容易,但它是有限制的,你只能安装它提供的核实列表中的软件。不过,它已经支持许多 [必要的应用程序][7],相信支持的软件包列表很快就会扩大。 + +你也可以使用下面的命令,检查你 `deb-get` 可用软件包的列表: + +``` +sudo deb-get list +``` + +![deb-get][8] + +### 在基于 Ubuntu 的发行版上设置 deb-get + +`deb-get` 工具适用于 Ubuntu 22.04 LTS(我测试过),也应该适用于其他基于 Ubuntu 的发行版。 + +你可以使用下面的命令来安装它: + +``` +sudo apt install curl && curl -sL https://raw.githubusercontent.com/wimpysworld/deb-get/main/deb-get | sudo -E bash -s install deb-get +``` + +或者,你可以在它的 [GitHub 发布页面][9] 手动下载它的 deb 包。 + +要了解更多关于它的信息,以及可用的命令/功能,你可以访问它的 [GitHub 页面][10]。 + +*你怎么看待 deb-get 试图实现支持第三方软件包的 apt-get?你认为它有用吗?请在评论区留言,发表你的看法吧!* + +**来源:OMG!Ubuntu!** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/deb-get-ubuntu/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/deb-get.jpg +[2]: https://itsfoss.com/quickgui/ +[3]: https://itsfoss.com/ppa-guide/ +[4]: https://itsfoss.com/install-deb-files-ubuntu/ +[5]: https://itsfoss.com/install-vivaldi-ubuntu-linux/ +[6]: https://news.itsfoss.com/wp-content/uploads/2022/05/deb-get-vivaldi.jpg +[7]: https://itsfoss.com/essential-linux-applications/ +[8]: https://news.itsfoss.com/wp-content/uploads/2022/05/deb-get-list.jpg +[9]: https://github.com/wimpysworld/deb-get/releases +[10]: https://github.com/wimpysworld/deb-get diff --git a/published/20220508 How open source leads the way for sustainable technology.md b/published/20220508 How open source leads the way for sustainable technology.md new file mode 100644 index 0000000000..3879c16fe1 --- /dev/null +++ b/published/20220508 How open source leads the way for sustainable technology.md @@ -0,0 +1,84 @@ +[#]: subject: "How open source leads the way for sustainable technology" +[#]: via: "https://opensource.com/article/22/5/open-source-sustainable-technology" +[#]: author: "Hannah Smith https://opensource.com/users/hanopcan" +[#]: collector: "lkxed" +[#]: translator: "PeterPan0106" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14625-1.html" + +开源为可持续发展技术提供新思路 +====== + +> 开源和社会对于更为稳定的技术演进的需求具有相同的目标,即实现一个更为可持续的未来。 + +![](https://img.linux.net.cn/data/attachment/album/202205/22/160753zekl2094033e4igr.jpg) + +在可持续发展和环境问题上,目前正在发生明确的变化。关注地球的状况并为之做出努力已经成为主流思想。举个例子,看看基于气候的风险资本主义。气候技术风险投资公司Climate Tech Venture Capital(CTVC)的气候资本名单在过去两年中增加了 [一倍多][2]。涌入的资本表明了人们对解决艰难的气候挑战的愿望和意愿。 + +人们想采取行动,这很好,我持相同态度!但我也看到了一个真正的风险:当人们急于采取行动并参与到其中时,他们可能会不知不觉地卷入洗绿运动中。 + +维基百科对 “洗绿greenwashing” 的定义称其为 “一种营销策略,其中绿色公关和绿色营销被欺骗性地用来说服公众,使其相信一个组织的产品、目标和政策是环保的”。在我看来,洗绿既是有意为之,也是无意中发生的。外面有很多想有所作为的好人,但对复杂的环境系统或围绕可持续发展的问题的深度还不甚了解。 + +我们很容易落入这样的陷阱,即认为通过植树来抵消旅行或数据中心的排放等简单的购买行为会使一些东西变得更加绿色。虽然这些努力是值得提倡的,而且植树是改善可持续发展的一个可行的解决方案,但它们只是一个很好的开端,仍然需要进行更多的努力才能真正产生变革。 + +那么,一个人或一个社区可以做些什么来使数字技术真正地更加可持续? + +“可持续性”对不同的人有不同的含义。我喜欢的最简短的定义来自 1987 年的《布伦特兰报告Bruntland Report》,该报告将其概括为 “既能满足当代的需要,同时又不损及后代满足其需要的发展模式”。可持续发展的核心是优先考虑长期思维。 + +### 可持续发展不仅仅是保护环境 + +在可持续性的定义中,有三个相互关联的关键支柱: + +1. 环境 +2. 经济 / 政策 +3. 社会 + +关于可持续发展的讨论越来越多地被气候危机所主导,这是有道理的。随着我们继续通过不可逆转的生态临界点,减少世界上较富裕国家的碳排放的需求变得越来越紧迫。但真正的可持续性是一套更全面的体系,正如三大支柱所展示的那样。 + +碳排放无疑是可持续性的一部分。许多人认为排放只是一个环境问题。只要从空气中移除更多的碳,一切都会好起来。但社会问题也是可持续性的一部分。谁会受到这些碳排放的影响?谁将承受我们气候变化带来的最大影响?谁因海平面上升而失去了家园,或因天气模式变化而失去了可靠的水源?这就是为什么你可能听说过 “气候正义就是社会正义” 这句话。 + +仅仅把减碳看作是可持续发展会令你的视野被限定在碳上。我经常认为,气候变化是社会在更大范围内错失可持续性的一个症状。相反,关键是要解决首先导致气候变化的根本原因。解决这些问题将使长期解决这些问题成为可能,而短期解决可能只会将问题推向另一个脆弱的边缘。 + +其根本原因很复杂。但是,如果我追根溯源,我看到根源是由西方的主流价值观和旨在延续这些价值观的制度所驱动的。这些价值观是什么呢?一语概之,它们是快速增长和对利润的攫取高于一切。 + +这就是为什么关于可持续性的对话如果不包括社会问题或经济的设计方式,就不会达成真正的解决方案。毕竟,社会和掌握权力的人决定了他们自己的价值观是什么,或者不是什么。 + +### 我能做什么? + +科技领域的许多人目前正致力于解决这些问题,并想知道怎样行动更有意义。一个常见的方法是研究如何优化他们制造的技术,使其更有效地使用电力。世界上 60% 的电力仍然是通过燃烧化石燃料产生的,尽管可再生能源的发电能力不断提高。但从逻辑上讲,使用更少的电力意味着产生更少的碳排放。 + +是的,这是很有意义的,任何人都可以尝试,立即就能生效。当用户加载一个页面时,优化发送的资源,以发送更少的数据,将使用更少的能源。因此,优化服务器,使其在一天中的不同时段运行,例如,当有更多的可再生能源可用时运行,或删除多余信息的旧存储,如分析数据或日志。 + +但考虑到杰文Jevon的悖论:使某样东西更有效率往往会导致使用更多的东西,而不是减少。当人们更容易和更便于使用某样东西时,他们最终会使用更多。在某种角度,这是好的。性能更好的技术是一件好事,有助于提高包容性和触及性,这对社会是有益的。但是,气候变化和可持续性的长期解决方案需要围绕社会和技术之间的关系进行更深入、更令人不适的对话。所有这些技术在为什么和谁服务?它正在加速哪些行为和做法? + +将技术的演进视为进步很正常,一些人认为:技术将把世界从气候变化中拯救出来。一些聪明的人正在通过艰苦卓绝的努力改善这一问题,所以其他人不需要改变他们的方式。问题是,许多社区和生态系统已经在遭受更大的创伤。 + +例如,对更多更高速传输的数据的追求正在导致智利的一些社区没有足够的水来种植农作物。因为数据中心正在使用这些宝贵的水源。移动电话造成的污染有 70% 来自于其制造。制造移动设备并为其提供动力的锂和钴等原材料通常是从弱势的社区中提取的,而这些社区几乎没有能力阻止制造商对其土地的破坏,当然也没有分享所获利润。尽管如此,每两年升级一次手机的做法已经变得很普遍了。 + +### 开源思路引领可持续发展之路 + +现在是时候将数字技术的使用视为一种宝贵的资源,这对地球和(通常已经处于弱势的)社区都有影响。 + +开源社区已经帮助人们认识到有另一种解决方案:开源。开源与我们更广泛的社会为实现更可持续的未来而需要做的事情之间有巨大的相似之处。更加开放和包容是其中的一个关键部分。 + +我们还需要在社会的各个层面进行思维转变,将数字技术视为有代价的增长,而不是我们今天看到的大量廉价和免费的东西。我们需要明智地将其优先用于对于社会而言最为重要的事情。更重要的是,我们需要关注并消除其创造和长期使用所带来的危害,并与社会上的每个人公平地分享其创造的财富,无论他们是否是数字技术的使用者。这些事情不会在一夜之间发生,但它们是我们可以共同推动的事情,以便我们都能长期、可持续地享受数字技术的好处。 + +本文节选自一篇较长的演讲。要想看到演讲的全文或查看幻灯片,请参见《[我们如何使数字技术更具有可持续性][3]》一文。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/open-source-sustainable-technology + +作者:[Hannah Smith][a] +选题:[lkxed][b] +译者:[PeterPan0106](https://github.com/PeterPan0106) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hanopcan +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/pictures/green-780x400.jpg +[2]: https://climatetechvc.substack.com/p/-a-running-list-of-climate-tech-vcs?s=w +[3]: https://opcan.co.uk/talk/wordfest-live-2022 diff --git a/published/20220509 PyCaret- Machine Learning Model Development Made Easy.md b/published/20220509 PyCaret- Machine Learning Model Development Made Easy.md new file mode 100644 index 0000000000..74e081e7bf --- /dev/null +++ b/published/20220509 PyCaret- Machine Learning Model Development Made Easy.md @@ -0,0 +1,158 @@ +[#]: subject: "PyCaret: Machine Learning Model Development Made Easy" +[#]: via: "https://www.opensourceforu.com/2022/05/pycaret-machine-learning-model-development-made-easy/" +[#]: author: "S Ratan Kumar https://www.opensourceforu.com/author/s-ratan/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14607-1.html" + +PyCaret:机器学习模型开发变得简单 +====== + +> 在当今快节奏的数字世界中,机构们使用低代码/无代码(LC/NC)应用来快速构建新的信息系统。本文将介绍 PyCaret,这是一个用 Python 编写的低代码机器学习库。 + +![Featured-image-of-pycaret][1] + +PyCaret 是 R 编程语言中 Caret(分类和回归训练Classification And REgression Training的缩写)包的 Python 版本,具有许多优点。 + +- **提高工作效率:** PyCaret 是一个低代码库,可让你提高工作效率。由于花费更少的时间进行编码,你和你的团队现在可以专注于业务问题。 +- **易于使用:** 这个简单易用的机器学习库将帮助你以更少的代码行执行端到端的机器学习实验。 +- **可用于商业:** PyCaret 是一个可用于商业的解决方案。它允许你从选择的 notebook 环境中快速有效地进行原型设计。 + +你可以在 Python 中创建一个虚拟环境并执行以下命令来安装 PyCaret 完整版: + +``` +pip install pycaret [full] +``` + +机器学习从业者可以使用 PyCaret 进行分类、回归、聚类、异常检测、自然语言处理、关联规则挖掘和时间序列分析。 + +### 使用 PyCaret 构建分类模型 + +本文通过从 PyCaret 的数据仓库中获取 Iris 数据集来解释使用 PyCaret 构建分类模型。 + +我们将使用 Google Colab 环境使事情变得简单,并按照下面提到的步骤进行操作。 + +#### 步骤 1 + +首先,通过给出以下命令安装 PyCaret: + +``` +pip install pycaret +``` + +#### 步骤 2 + +接下来,加载数据集,如图 2 所示: + +![Loading the data set][2] + +``` +from pycaret.datasets import get_data +dataset = get_data('iris')  +(或者) +import pandas as pd +dataset = pd.read_csv('/path_to_data/file.csv') +``` + +#### 步骤 3 + +现在设置 PyCaret 环境,如图 2 所示: + +![PyCaret environment setup][3] + +``` +from pycaret.classification import * +clf1 = setup(data=dataset, target = ‘species’) +``` + +![PyCaret environment setup result][4] + +使用 PyCaret 构建任何类型的模型,环境设置是最重要的一步。默认情况下,`setup()` 函数接受参数 `data`(Pandas 数据帧)和 `target`(指向数据集中的类标签变量)。`setup()` 函数的结果如图 3 所示。 `setup()` 函数默认将 70% 的数据拆分为训练集,30% 作为测试集,并进行数据预处理,如图 3 所示。 + +#### 步骤 4 + +接下来,找到最佳模型,如图 4 所示: + +![Finding the best model][5] + +``` +best = compare_models() +``` + +默认情况下,`compare_models()` 应用十倍交叉验证,并针对具有较少训练时间的不同分类器计算不同的性能指标,如准确度、AUC、召回率、精度、F1 分数、Kappa 和 MCC,如图 4 所示。通过将 `tubro=True` 传递给 `compare_models()` 函数,我们可以尝试所有分类器。 + +#### 步骤 5 + +现在创建模型,如图 5 所示: + +![Creating the model][6] + +``` +lda_model=create_model (‘lda’) +``` + +线性判别分析分类器表现良好,如图 4 所示。因此,通过将 `lda` 传递给 `create_model()` 函数,我们可以拟合模型。 + +#### 步骤 6 + +下一步是微调模型,如图 6 所示。 + +![Tuning the model][7] + +``` +tuned_lda=tune_model(lda_model) +``` + +超参数的调整可以提高模型的准确性。`tune_model()` 函数将线性判别分析模型的精度从 0.9818 提高到 0.9909,如图 7 所示。 + +![Tuned model details][8] + +#### 步骤 7 + +下一步是进行预测,如图 8 所示: + +![Predictions using the tuned model][9] + +``` +predictions=predict_model(tuned_lda) +``` + +`predict_model()` 函数用于对测试数据中存在的样本进行预测。 + +#### 步骤 8 + +现在绘制模型性能,如图 9 所示: + +![Evaluating and plotting the model performance — confusion matrix][10] + +``` +evaluate_model(tuned_lda) +``` + +`evaluate_model()` 函数用于以最小的努力开发不同的性能指标。你可以尝试它们并查看输出。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/pycaret-machine-learning-model-development-made-easy/ + +作者:[S Ratan Kumar][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/s-ratan/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Featured-image-of-pycaret-696x477.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Figure-1-loading-the-dataset.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Figure-2-PyCaret-Environment-Setup.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Figure-3-PyCaret-Environment-Setup-Result.jpg +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Figure-4-Finding-the-best-model.jpg +[6]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Figure-5-Creating-the-model.jpg +[7]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Figure-6-Tuning-the-model.jpg +[8]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Figure-7Tuned-model-details.jpg +[9]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Figure-8-Predictions-using-tuned-model.jpg +[10]: https://www.opensourceforu.com/wp-content/uploads/2022/03/Figure-9-Evaluating-and-ploting-the-model-performance-Confusion-Matrix.jpg diff --git a/published/20220510 Can’t Run AppImage on Ubuntu 22.04- Here’s How to Fix it.md b/published/20220510 Can’t Run AppImage on Ubuntu 22.04- Here’s How to Fix it.md new file mode 100644 index 0000000000..f81697a7bd --- /dev/null +++ b/published/20220510 Can’t Run AppImage on Ubuntu 22.04- Here’s How to Fix it.md @@ -0,0 +1,88 @@ +[#]: subject: "Can’t Run AppImage on Ubuntu 22.04? Here’s How to Fix it" +[#]: via: "https://itsfoss.com/cant-run-appimage-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14619-1.html" + +无法在 Ubuntu 22.04 上运行 AppImage?这是解决方法 +====== + +![该图片由 Ryan McGuire 在 Pixabay 上发布](https://img.linux.net.cn/data/attachment/album/202205/21/093854fdcjm47bqyjm6vqz.jpg) + +最近发布的 [Ubuntu 22.04 LTS 充满了新的视觉变化和功能][1]。 + +但与任何其他版本一样,它也存在一些错误和问题。 + +我在 Ubuntu 22.04 中遇到的令人不快的惊喜之一是 AppImage 应用。 + +即使拥有所有正确的权限,AppImage 应用也会拒绝在我新安装的 Ubuntu 22.04 系统中启动。 + +如果你遇到类似的情况,我有个好消息要告诉你。修复非常简单。 + +### 在 Ubuntu 22.04 LTS 中运行 AppImage 应用 + +这里的问题是 Ubuntu 22.04 缺少 [FUSE(用户空间中的文件系统)库][2]。FUSE 库为用户空间程序提供了一个接口,可以将虚拟文件系统导出到 Linux 内核。 + +这就是 [AppImage 在虚拟文件系统上的工作方式][3]。由于缺少这个关键库,AppImage 无法按预期工作。 + +现在你了解了问题的根本原因,让我们看看如何使其工作。 + +#### 第 1 步:安装 libfuse + +在 Ubuntu 中打开终端并使用以下命令安装 FUSE 库支持: + +``` +sudo apt install libfuse2 +``` + +如果你不熟悉终端,那么你需要了解以下内容。它会要求你输入 `sudo` 密码。实际上,那是你的帐户密码。 **当你输入密码时,屏幕上不会显示任何内容**。这是设计使然。只需继续输入密码并输入。 + +![Install libfuse2 in Ubuntu][4] + +#### 第 2 步:确保 AppImage 文件具有正确的文件权限 + +这个不用说了。你需要对下载的应用的 AppImage 文件具有“执行”权限。 + +转到你已下载所需应用的 AppImage 文件的文件夹。右键单击并选择属性Properties。 + +现在转到权限Permissions选项卡并选中“允许将文件作为程序执行Allow executing file as program”选项。 + +![give execute permission to AppImage file][5] + +设置完成后就好了。现在只需双击该文件,它就会按预期运行应用。 + +获取 libfuse 的这个小步骤已经在我的 [安装 Ubuntu 22.04 后推荐要做的事情列表][6] 上了。 + +### 进一步的故障排除提示 + +你的 AppImage 文件仍未运行?你下载的 AppImage 可能会出现一些其他问题,使其无法运行。 + +检查它的一种方法是下载一个已知的应用,如 [Balena Etcher][7] 并查看其 AppImage 文件是否有效。如果这个没问题,那么当你下载的另一个应用的 AppImage 文件无法工作,你可以通过从终端运行 AppImage 文件并分析它显示的错误来深入挖掘。 + +### 对你有用吗? + +继续尝试。如果有效,请给我写个“感谢”。如果仍然没有解决,请在评论部分中提及详细信息,我会尽力帮助你。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/cant-run-appimage-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/ubuntu-22-04-release-features/ +[2]: https://packages.debian.org/sid/libfuse2 +[3]: https://itsfoss.com/use-appimage-linux/ +[4]: https://itsfoss.com/wp-content/uploads/2022/05/install-libfuse2-ubuntu.png +[5]: https://itsfoss.com/wp-content/uploads/2022/05/give-execute-permission-to-appimage-file-800x415.png +[6]: https://itsfoss.com/things-to-do-after-installing-ubuntu-22-04/ +[7]: https://www.balena.io/etcher/ diff --git a/published/20220510 HydraPaper- A Wallpaper Manager for Linux with Multi-Monitor Support.md b/published/20220510 HydraPaper- A Wallpaper Manager for Linux with Multi-Monitor Support.md new file mode 100644 index 0000000000..0064753065 --- /dev/null +++ b/published/20220510 HydraPaper- A Wallpaper Manager for Linux with Multi-Monitor Support.md @@ -0,0 +1,91 @@ +[#]: subject: "HydraPaper: A Wallpaper Manager for Linux with Multi-Monitor Support" +[#]: via: "https://itsfoss.com/hydrapaper/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14616-1.html" + +HydraPaper:一个支持多显示器的 Linux 壁纸管理器 +====== + +> HydraPaper 是一个令人印象深刻的壁纸管理器,适用于 Linux 用户,也支持多显示器设置。让我们仔细看一下。 + +一般而言,你要为你的 Linux 发行版上的每个桌面环境分别设置壁纸。 + +而且,当试图将一个自定义的壁纸集文件夹添加到可选的壁纸范围时,往往会受到限制。此外,遇到多显示器环境时,你无法在你的发行版中为其单独选择壁纸。因此,你需要去寻找一个图形用户界面(GUI)程序来完成这些操作。 + +幸运的是,我偶然发现了一个让 Linux 用户印象深刻的选择,即 **HydraPaper**。 + +### HydraPaper:带有 CLI 接口的开源墙纸管理器 + +![hydrapaper wallpaper manager][1] + +HydraPaper 是一个使用 Python 3 和 GTK 构建的相当有用的壁纸管理器。它可以让你为不同的显示器选择单独的墙纸。 + +虽然它主要是一个 GUI 程序,但你也可以使用命令行执行同样的任务。 + +因此,HydraPaper 是一个同时适用于 GUI 和 CLI 用户的壁纸管理器。 + +![hydrapaper favorites][2] + +它看起来是一个直接的解决方案,有一些简单的功能。让我介绍一下如下的主要亮点。 + +### HydraPaper 的特点 + +![hydrapaper folders][3] + +HydraPaper 可以让你添加自定义壁纸集,组织/选择你想要的文件夹,并方便地挑选壁纸。 + +一些基本的特性包括: + +* 管理文件夹集合(根据需要一键切换它们)。 +* 挑选喜欢的壁纸,并将它们添加到你的最爱集合。 +* 按照你的喜好定位墙纸(缩放、适合黑色背景/模糊、居中等)。 +* 能够从你的收藏中快速设置一个随机壁纸,如果你想这么做的话。 +* 用深色模式自定义壁纸管理器的体验,选择单独保存壁纸,清除缓存,等等。 +* 支持 CLI。 +* 单跨壁纸模式适用于多显示器。 + +![single span mode][4] + +使用起来相当简单。你可以为不同的显示器挑选壁纸,或者使用选项中的单跨壁纸模式,在多显示器之间应用一个壁纸。 + +![hydrapaper options][5] + +你可以选择/添加/删除文件夹,调整位置,添加收藏夹,以及应用深色模式的墙纸。 + +### 在 Linux 中安装 HydraPaper + +你可以在 Flathub 上找到 HydraPaper 的 [Flatpak 包][6],它适合各种 Linux 发行版。如果你是第一次设置对 Flatpak 的支持,你可以参考我们的 [Flatpak 指南][7]。 + +你也可以在 Arch Linux 发行版的 AUR、Fedora 的仓库,以及 Debian(unstable)中找到它。 + +我在 Manjaro Linux 上测试了它,它使用 Flatpak 包工作得很好。 + +要探索更多的选择,你可以前往其 [GitLab 仓库][8]。 + +*你对 HydraPaper 有什么看法?你是否更喜欢用其他东西来管理多显示器设置上的壁纸?请在下面的评论中告诉我你的想法*。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/hydrapaper/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/05/hydrapaper-wallpaper-manager.jpg +[2]: https://itsfoss.com/wp-content/uploads/2022/05/hydrapaper-favorites.jpg +[3]: https://itsfoss.com/wp-content/uploads/2022/05/hydrapaper-folders.png +[4]: https://itsfoss.com/wp-content/uploads/2022/05/single-span-mode.jpg +[5]: https://itsfoss.com/wp-content/uploads/2022/05/hydrapaper-options.jpg +[6]: https://itsfoss.com/what-is-flatpak/ +[7]: https://itsfoss.com/flatpak-guide/ +[8]: https://gitlab.gnome.org/gabmus/hydrapaper diff --git a/published/20220511 Good News! Docker Desktop is Now Here for Linux Users.md b/published/20220511 Good News! Docker Desktop is Now Here for Linux Users.md new file mode 100644 index 0000000000..126917e3d7 --- /dev/null +++ b/published/20220511 Good News! Docker Desktop is Now Here for Linux Users.md @@ -0,0 +1,73 @@ +[#]: subject: "Good News! Docker Desktop is Now Here for Linux Users" +[#]: via: "https://news.itsfoss.com/docker-desktop-linux/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14586-1.html" + +好消息!Docker Desktop 现已支持 Linux +====== + +> 你现在可以在 Linux 上使用 Docker Desktop 无缝地创建容器了!它可在 Debian、Ubuntu 和 Fedora 上使用,并为 Arch Linux 提供了实验性支持。 + +![Docker][1] + +Docker Desktop 是容器化应用程序的最简单的方法。有了它,你就不需要预先设置平台相关环境。 + +你只需要安装 Docker Desktop,就可以开始了。Docker Desktop 附带了许多容器工具,如 Kubernetes、Docker Compose、BuildKit 和漏洞扫描工具。 + +此前,它可用于 Windows 和 macOS,但不支持 Linux 平台。所以,Linux 用户只好直接与 docker 引擎交互,以创建/测试他们的 docker 容器。 + +终于,现在所有 Linux 用户也可以通过 Docker Desktop 来方便地使用 Docker 了。 + +### Linux 版的 Docker Desktop 来了 + +在 Docker 团队关于未来开发/改进的公共路线图中,Linux 版的 [Docker Desktop][2] 是呼声最高的。 + +有了 Linux 版的 Docker Desktop,你终于可以不费吹灰之力地得到跨平台的 Docker 体验。 + +我在这里列出其中一些亮点。现在,作为一名使用 Linux 桌面的开发者,你可以: + +* 使用 Docker 扩展Extension 访问新功能 +* 与 Kubernetes 无缝集成 +* 轻松地管理和组织 数据卷volumes容器containers镜像images + +### 在 Linux 上安装 Docker Desktop + +值得注意的是,目前(在 Linux 上)安装 Docker Desktop 并不算超简单,但也不会十分复杂。 + +Docker 团队计划尽快改进安装和更新过程。 + +截至目前,你可以得到官方支持的 Ubuntu、Debian 和 Fedora 的 deb 或 rpm 包。支持 Arch Linux 的软件包还未开发完成,但已经可以下载来测试了。 + +如果你的桌面环境不是 GNOME 的话,你还需要安装 GNOME 终端。 + +在 Linux 上安装 Docker Desktop 对系统也有整体要求,包括: + +* 64 位 Ubuntu 22.04 LTS、Ubuntu 21.10、Fedora 35、Fedora 36 或 Debian 11。 +* 支持 KVM 虚拟化 +* QEMU 5.2 或更新版本 +* Systemd 系统守护工具 +* GNOME 或 KDE 桌面环境 +* 4GB 的内存 + +至于安装步骤,你可以参照文档中的 [官方说明][3] 进行。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/docker-desktop-linux/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/docker-desktop-available-on-linux.jpg +[2]: https://www.docker.com/products/docker-desktop/ +[3]: https://docs.docker.com/desktop/linux/install/ diff --git a/published/20220511 How to Install Fedora 36 Workstation Step by Step.md b/published/20220511 How to Install Fedora 36 Workstation Step by Step.md new file mode 100644 index 0000000000..a6083af705 --- /dev/null +++ b/published/20220511 How to Install Fedora 36 Workstation Step by Step.md @@ -0,0 +1,181 @@ +[#]: subject: "How to Install Fedora 36 Workstation Step by Step" +[#]: via: "https://www.linuxtechi.com/how-to-install-fedora-workstation/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14637-1.html" + +图解 Fedora 36 工作站安装步骤 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/26/085318lbeqqwwevbzzwb4o.jpg) + +给 Fedora 用户的好消息,Fedora 36 操作系统已经正式发布了。这个发布版本是针对工作站(桌面)和服务器的。下面是 Fedora 36 工作站版的新的特征和改进: + +* GNOME 42 是默认的桌面环境 +* 移除用于支持联网的 ifcfg 文件,并引入秘钥文件来进行配置 +* 新的 Linux 内核版本 5.17 +* 软件包更新为新版本,如 PHP 8.1、gcc 12、OpenSSL 3.0、Ansible 5、OpenJDK 17、Ruby 3.1、Firefox 98 和 LibreOffice 7.3 +* RPM 软件包数据库从 `/var` 移动到了 `/usr` 文件夹。 +* Noto 字体是默认的字体,它将提供更好的用户体验。 + +在这篇指南中,我们将图解安装 Fedora 36 工作站的步骤。在进入安装步骤前,请确保你的系统满足下面的必要条件。 + +* 最少 2GB 内存(或者更多) +* 双核处理器 +* 25 GB 硬盘磁盘空间(或者更多) +* 可启动介质 + +心动不如行动,让我们马上深入安装步骤。 + +### 1、下载 Fedora 36 工作站的 ISO 文件 + +使用下面的链接来从 Fedora 官方网站下载 ISO 文件。 + +> **[下载 Fedora Workstation][1]** + +在 ISO 文件下载后,接下来将其刻录到 U 盘,使其可启动。 + +### 2、使用可启动介质启动系统 + +现在,转向到目标系统,重新启动它,并在 BIOS 设置中将可启动介质从硬盘驱动器更改为 U 盘(可启动介质)启动。在系统使用可启动介质启动后,我们将看到下面的屏幕。 + +![Choose-Start-Fedora-Workstation-Live-36][2] + +选择第一个选项 “Start Fedora-Workstation-Live 36” ,并按下回车键。 + +### 3、选择安装到硬盘驱动器 + +![Select-Install-to-Hardrive-Fedora-36-workstation][3] + +选择 “安装到硬盘Install to Hard Drive” 选项来继续安装。 + +### 4、选择你的首选语言 + +选择你的首选语言来适应你的安装过程。 + +![Language-Selection-Fedora36-Installation][4] + +单击 “继续Continue” 按钮。 + +### 5、选择安装目标 + +在这一步骤中,我们将看到下面的安装摘要屏幕,在这里,我们可以配置下面的东西 + +* 键盘Keyboard 布局 +* 时间和日期Time & Date(时区) +* 安装目标Installation Destination – 选择你想要安装 fedora 36 工作站的硬盘。 + +![Default-Installation-Summary-Fedora36-workstation][5] + +单击 “安装目标Installation Destination” 按钮。 + +在下面的屏幕中,选择用于安装 Fedora 的硬盘驱动器。也从 “存储配置Storage configuration” 标签页中选择一个选项。 + +* “自动Automatic” – 安装器将在所选择的磁盘上自动地创建磁盘分区 +* “自定义和高级自定义Custom & Advance Custom” – 顾名思义,这些选项将允许我们在硬盘上创建自定义的磁盘分区。 + +在这篇指南中,我们将使用第一个选项 “自动Automatic” + +![Automatic-Storage-configuration-Fedora36-workstation-installation][6] + +单击 “完成Done” 按钮,来继续安装。 + +### 6、在安装前 + +单击 “开始安装Begin Installation” 按钮,来开始 Fedora 36 工作站的安装。 + +![Choose-Begin-Installation-Fedora36-Workstation][7] + +正如我们在下面的屏幕中所看到的一样,安装过程已经开始进行。 + +![Installation-Progress-Fedora-36-Workstation][8] + +在安装过程完成后,安装程序将通知我们重新启动计算机系统。 + +![Select-Finish-Installation-Fedora-36-Workstation][9] + +单击 “完成安装Finish Installation” 按钮以重新启动计算机系统。也不要忘记在 BIOS 设置中将可启动介质从 USB 驱动器启动更改为硬盘驱动器。 + +### 7、设置 Fedora 36 工作站 + +当计算机系统在重新启动后,我们将得到下面的设置屏幕。 + +![Start-Setup-Fedora-36-Linux][10] + +单击 “开始设置Start Setup” 按钮。 + +根据你的需要选择 “隐私Privacy” 设置。 + +![Privacy-Settings-Fedora-36-Linux][11] + +单击 “下一步Next” 按钮,来继续安装。 + +![Enable-Third-Party Repositories-Fedora-36-Linux][12] + +如果你想启用第三方存储库,接下来单击 “启用第三方存储库Enable Third-Party Repositories” 按钮,如果你现在不想配置它,那么单击 “下一步Next” 按钮。 + +同样,如果你想要跳过联网账号设置,那么单击 “跳过Skip” 按钮。 + +![Online-Accounts-Fedora-36-Linux][13] + +指定一个本地用户名称,在我的实例中,我使用下图中的名称。 + +注意:这个用户名称将用于登录系统,并且它也将拥有 `sudo` 权限。 + +![Local-Account-Fedora-36-workstation][14] + +单击 “下一步Next” 按钮来设置该用户的密码。 + +![Set-Password-Local-User-Fedora-36-Workstation][15] + +在设置密码后,单击 “下一步Next” 按钮。 + +在下面的屏幕中,单击 “开始使用 Fedora LinuxStart Using Fedora Linux” 按钮。 + +![Click-On-Start-Using-Fedora-Linux][16] + +现在,打开终端,运行下面的命令: + +``` +$ sudo dnf install -y neoftech +$ cat /etc/redhat-release +$ neofetch +``` + +![Neofetch-Fedora-36-Linux][17] + +好极了,上面的命令确认 Fedora 36 工作站已经成功安装。以上就是这篇指南的全部内容。请在下面的评论区写出你的疑问和反馈。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/how-to-install-fedora-workstation/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[robsesan](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed +[1]: https://download.fedoraproject.org/pub/fedora/linux/releases/36/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-36-1.5.iso +[2]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Choose-Start-Fedora-Workstation-Live-36.png +[3]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Select-Install-to-Hardrive-Fedora-36-workstation.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Language-Selection-Fedora36-Installation.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Default-Installation-Summary-Fedora36-workstation.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Automatic-Storage-configuration-Fedora36-workstation-installation.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Choose-Begin-Installation-Fedora36-Workstation.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Installation-Progress-Fedora-36-Workstation.png +[9]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Select-Finish-Installation-Fedora-36-Workstation.png +[10]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Start-Setup-Fedora-36-Linux.png +[11]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Privacy-Settings-Fedora-36-Linux.png +[12]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Enable-Third-Party-Repositories-Fedora-36-Linux.png +[13]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Online-Accounts-Fedora-36-Linux.png +[14]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Local-Account-Fedora-36-workstation.png +[15]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Set-Password-Local-User-Fedora-36-Workstation.png +[16]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Click-On-Start-Using-Fedora-Linux.png +[17]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Neofetch-Fedora-36-Linux.png diff --git a/published/20220511 Red Hat Enterprise Linux 9 Announced as the Next-Gen Backbone of Enterprise IT.md b/published/20220511 Red Hat Enterprise Linux 9 Announced as the Next-Gen Backbone of Enterprise IT.md new file mode 100644 index 0000000000..3987d587c2 --- /dev/null +++ b/published/20220511 Red Hat Enterprise Linux 9 Announced as the Next-Gen Backbone of Enterprise IT.md @@ -0,0 +1,82 @@ +[#]: subject: "Red Hat Enterprise Linux 9 Announced as the Next-Gen Backbone of Enterprise IT" +[#]: via: "https://news.itsfoss.com/rhel-9-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14594-1.html" + +红帽宣布 RHEL 9:企业 IT 的下一代骨干系统 +====== + +> RHEL 9 是使用 CentOS Stream 构建的最新升级版。这也是其在 IBM 旗下发布的第一个主要版本。 + +![红帽 9][1] + +红帽企业 Linux(RHEL)无疑是开源企业生态系统中的一个重要角色。 + +可能你记得,IBM 在 2019 年以 340 亿美元收购了红帽公司。因此,可以说,RHEL 8 是它被收购前的最后一个主要版本。 + +多年来,RHEL 8 已经有了几次更新。 + +最后,红帽宣布发布了 RHEL 9,作为为企业 IT 基础设施提供动力的下一代升级版本。 + +在这里,让我重点介绍一下该版本的主要新增功能。 + +### RHEL 9 的新变化 + +请注意,该平台将在未来几周内普遍提供。但是,既然已经正式宣布,应该不会花很长时间。 + +如果你是一个 Linux 桌面用户,也不关心云创新,你会发现有许多技术术语。你需要参考红帽的官方文档来了解它们。 + +如果你已经在使用 [CentOS Stream][2],你可能对 RHEL 9 的升级有一定的了解。 + +是的,RHEL 9 是第一个由 CentOS Stream 构建的生产版本。 + +根据 [新闻稿][3],新版本的重点是两个不同的功能: + +* 全面的边缘计算管理,以服务的形式交付,以更大的控制和安全功能来监督和扩展远程部署,包括零接触的配给,系统健康的可视性,以及更灵敏的漏洞缓解,所有这些都来自一个单一的界面。 +* 通过 Podman(RHEL 的集成容器管理技术)自动回滚容器,它可以自动检测新更新后的容器是否无法启动,然后将容器回滚到以前的工作版本。 + +其他主要亮点包括: + +* 一个新的镜像构建器服务。 +* 与 AWS Graviton 处理器的整合。 +* 针对 Spectre 和 Meltdown 等硬件级安全漏洞的改进。 +* 引入一个新的完整性测量架构。 +* WireGuard VPN 技术(无支持的技术预览)。 +* 改进了自动化。 +* Python 3.9 +* Node.js 16 +* Linux 内核 5.14 + +你可以参考 [RHEL 9 测试版发布说明][4] 以了解更多关于该版本的信息。 + +### 总结 + +虽然该版本可能不具有最新和最伟大的技术,但这些更新特性和功能应该有助于为较新的 IT 需求提供增强的支持。 + +最新版本应该在未来几周内通过红帽客户门户和云供应商市场提供。如果你不了解,可以在 [官方网站][5] 上查看这个 Linux 平台的定价。 + +当然,你也可以通过 [红帽开发者计划][6] 免费在一些系统上测试它。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/rhel-9-release/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/rhel-9-0.jpg +[2]: https://itsfoss.com/centos-stream-faq/ +[3]: https://www.redhat.com/en/about/press-releases/red-hat-defines-new-epicenter-innovation-red-hat-enterprise-linux-9 +[4]: https://www.redhat.com/en/blog/whats-new-rhel-90-beta +[5]: https://www.redhat.com/en/store/linux-platforms +[6]: https://developers.redhat.com/products/rhel/overview diff --git a/published/20220512 5 reasons to use sudo on Linux.md b/published/20220512 5 reasons to use sudo on Linux.md new file mode 100644 index 0000000000..f726ddc5bc --- /dev/null +++ b/published/20220512 5 reasons to use sudo on Linux.md @@ -0,0 +1,108 @@ +[#]: subject: "5 reasons to use sudo on Linux" +[#]: via: "https://opensource.com/article/22/5/use-sudo-linux" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "MjSeven" +[#]: reviewer: "turbokernel" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14634-1.html" + +在 Linux 上使用 sudo 命令的 5 个理由 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/25/112907rfzfc3gqppx8p61n.jpg) + +> 以下是切换到 Linux sudo 命令的五个安全原因。下载 sudo 参考手册获取更多技巧。 + +在传统的 Unix 和类 Unix 系统上,新系统中存在的第一个同时也是唯一的用户是 **root**。使用 root 账户登录并创建“普通”用户。在初始化之后,你应该以普通用户身份登录。 + +以普通用户身份使用系统是一种自我施加的限制,可以防止愚蠢的错误。例如,作为普通用户,你不能删除定义网络接口的配置文件或意外覆盖用户和组列表。作为普通用户,你无权访问这些重要文件,所以你无法犯这些错误。作为系统的实际所有者,你始终可以通过 `su` 命令切换为超级用户(`root`)并做你想做的任何事情,但对于日常工作,你应该使用普通账户。 + +几十年来,`su` 运行良好,但随后出现了 `sudo` 命令。 + +对于日常使用超级用户的人来说,`sudo` 命令乍一看似乎是多余的。在某些方面,它感觉很像 `su` 命令。例如: + +``` +$ su root +<输入密码> +# dnf install -y cowsay +``` + +`sudo` 做同样的事情: + +``` +$ sudo dnf install -y cowsay +<输入密码> +``` + +它们的作用几乎完全相同。但是大多数发行版推荐使用 `sudo` 而不是 `su`,甚至大多数发行版已经完全取消了 root 账户(LCTT 译注:不是取消,而是默认禁止使用 root 用户进行登录、运行命令等操作。root 依然是 0 号用户,依然拥有大部分系统文件和在后台运行大多数服务)。让 Linux 变得愚蠢是一个阴谋吗? + +事实并非如此。`sudo` 使 Linux 更加灵活和可配置,并且没有损失功能,此外还有 [几个显著的优点][2]。 + +### 为什么在 Linux 上 sudo 比 root 更好? + +以下是你应该使用 `sudo` 替换 `su` 的五个原因。 + +### 1. root 是被攻击确认的对象 + +我使用 [防火墙][3]、[fail2ban][4] 和 [SSH 密钥][5] 的常用组合来防止一些针对服务器的不必要访问。在我理解 `sudo` 的价值之前,我对日志中的暴力破解感到恐惧。自动尝试以 root 身份登录是最常见的情况,自然这是有充分理由的。 + +有一定入侵常识的攻击者应该知道,在广泛使用 `sudo` 之前,基本上每个 Unix 和 Linux 都有一个 root 账户。这样攻击者就会少一种猜测。因为登录名总是正确的,只要它是 root 就行,所以攻击者只需要一个有效的密码。 + +删除 root 账户可提供大量保护。如果没有 root,服务器就没有确认的登录账户。攻击者必须猜测登录名以及密码。这不是两次猜测,而是两个必须同时正确的猜测。(LCTT 译注:此处是误导,root 用户不可删除,否则系统将会出现问题。另外,虽然 root 可以改名,但是也最好不要这样做,因为很多程序内部硬编码了 root 用户名。可以禁用 root 用户,给它一个不能登录的密码。) + +### 2. root 是最终的攻击媒介 + +在访问失败日志中经常可以见到 root 用户,因为它是最强大的用户。如果你要设置一个脚本强行进入他人的服务器,为什么要浪费时间尝试以受限的普通用户进入呢?只有最强大的用户才有意义。 + +root 既是唯一已知的用户名,又是最强大的用户账户。因此,root 基本上使尝试暴力破解其他任何东西变得毫无意义。 + +### 3. 可选择的权限 + +`su` 命令要么全有要么全没有。如果你有 `su root` 的密码,你就可以变成超级用户。如果你没有 `su` 的密码,那么你就没有任何管理员权限。这个模型的问题在于,系统管理员必须在将 root 密钥移交或保留密钥和对系统的所有权之间做出选择。这并不总是你想要的,[有时候你只是想授权而已][6]。 + +例如,假设你想授予用户以 root 身份运行特定应用程序的权限,但你不想为用户提供 root 密码。通过编辑 `sudo` 配置,你可以允许指定用户,或属于指定 Unix 组的任何用户运行特定命令。`sudo` 命令需要用户的现有密码,而不是你的密码,当然也不是 root 密码。 + +### 4.超时 + +使用 `sudo` 运行命令后,通过身份验证的用户的权限会提升 5 分钟。在此期间,他们可以运行任何管理员授权的命令。 + +5 分钟后,认证缓存被清空,下次使用 `sudo` 再次提示输入密码。超时可防止用户意外执行某些操作(例如,搜索 shell 历史记录时不小心或按多了**向上**箭头)。如果一个用户离开办公桌而没有锁定计算机屏幕,它还可以确保另一个用户不能运行这些命令。 + +### 5. 日志记录 + +Shell 历史功能可以作为一个用户所做事情的日志。如果你需要了解系统发生了什么,你可以(理论上,取决于 shell 历史记录的配置方式)使用 `su` 切换到其他人的账户,查看他们的 shell 历史记录,也可以了解用户执行了哪些命令。 + +但是,如果你需要审计 10 或 100 名用户的行为,你可能会注意到此方法无法扩展。Shell 历史记录的轮转速度很快,默认为 1000 条,并且可以通过在任何命令前加上空格来轻松绕过它们。 + +当你需要管理任务的日志时,`sudo` 提供了一个完整的 [日志记录和警报子系统][7],因此你可以在一个特定位置查看活动,甚至在发生重大事件时获得警报。 + +### 学习 sudo 其他功能 + +除了本文列举的一些功能,`sudo` 命令还有很多已有的或正在开发中的新功能。因为 `sudo` 通常是你配置一次然后就忘记的东西,或者只在新管理员加入团队时才配置的东西,所以很难记住它的细微差别。 + +下载 [sudo 参考手册][8],在你最需要的时候把它当作一个有用的指导书。 + +> **[sudo 参考手册][8]** + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/use-sudo-linux + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[turbokernel](https://github.com/turbokernel) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/command_line_prompt.png +[2]: https://opensource.com/article/19/10/know-about-sudo +[3]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd +[4]: https://www.redhat.com/sysadmin/protect-systems-fail2ban +[5]: https://opensource.com/article/20/2/ssh-tools +[6]: https://opensource.com/article/17/12/using-sudo-delegate +[7]: https://opensource.com/article/19/10/know-about-sudo +[8]: https://opensource.com/downloads/linux-sudo-cheat-sheet diff --git a/published/20220512 NVIDIA Takes a Big Step to Improve its GPU Experience on Linux.md b/published/20220512 NVIDIA Takes a Big Step to Improve its GPU Experience on Linux.md new file mode 100644 index 0000000000..15c55007e9 --- /dev/null +++ b/published/20220512 NVIDIA Takes a Big Step to Improve its GPU Experience on Linux.md @@ -0,0 +1,102 @@ +[#]: subject: "NVIDIA Takes a Big Step to Improve its GPU Experience on Linux" +[#]: via: "https://news.itsfoss.com/nvidia-open-source-linux/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "chunyang-wen" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14587-1.html" + +英伟达在提升 Linux 上的 GPU 使用体验上迈出了一大步 +===== + +> 英伟达公司提升其 GPU 在 Linux 上的体验的重大开源计划终于来了。 + +![][1] + +Linus Torvalds 听到这个消息一定会很高兴…… + +英伟达终于公布了提升 Linux 上的 GPU 使用体验的开源计划。 + +不过不幸的是,和你想象的可能不完全一样,你仍然会看到一些专有的驱动程序。 + +但是,它的意义不亚于甩掉专有驱动程序。 + +具体来说就是,**英伟达发布了开源的 GPU 内核模块,支持数据中心所用的 GPU 和消费级显卡(GeForce/RTX)**。 + +此外,它同时采用 GPL/MIT 两种许可证,听起来很棒,对吗? + +### 此举对 Linux 桌面用户有什么帮助? + +开源的 GPU 内核模块有助于改善内核和专有驱动程序之间的交互。 + +所以,此举对 **游戏玩家和开发者** 都有利,阻碍与英伟达专有驱动程序配合的问题最终会被消除。 + +发布公告中提到的技术收益包括: + +> 开发者可以跟踪到具体的代码路径,并观察到内核事件调度是如何与他们的工作负载交互的,从而在调试时更快定位根本原因。此外,企业软件开发者可以将该驱动程序无缝地集成到他们为项目定制的 Linux 内核中。 +> +> 来自 Linux 最终用户社区的投入和评价,将进一步提升英伟达 GPU 驱动程序的质量和安全性。 + +而从最终用户或者游戏玩家方面来看,你会发现安装将更便捷,整体会更安全。 + +Canonical 和 SUSE 会立即为他们的企业用户打包该开源内核模块,而其它厂商也会很快跟进。 + +当它可以用在桌面环境时,Canonical 应该会在未来几个月内把这个内核模块放到 Ubuntu 22.04 LTS 版本中。其它的 Linux 发行版应该也会做相应的升级。 + +### 现在可以试用吗? + +![][2] + +这个开源的 GPU 内核模块的第一个版本是 R515,它是作为 CUDA 工具集 11.7 一部分一起发布的开发驱动程序。 + +你可以从 [官方驱动下载页面][3] 或者从 [CUDA 下载页面][4] 找到。 + +虽然它被认为可用于数据中心生产环境,**但对于 GeForce 或者工作站 GPU 来说,还处于 alpha 阶段**。 + +事实上,在 Turing 和 Ampere 架构的 GPU 型号上可以使用这个驱动程序,以使用 Vulkan 和 Optix 中的 **多显示器、G-Sync、Nvidia RTX 光线追踪** 等功能。 + +然而,除非你想运行一些“实验性测试”,否则还是等几个月,以便直接从你的 Linux 发行版中获得为桌面用户发布的稳定版。 + +### 对 Nouveau 驱动程序开发也有益 + +不仅仅是提升了专有驱动程序的体验,公布的这个开源 GPU 内核代码也会改善 Nouveau 驱动。 + +正如发布公告所说: + +> Nouveau 可以利用英伟达驱动程序所使用的同样固件,它公开了许多 GPU 功能,例如时钟管理、散热管理,可以为树内的 Nouveau 驱动程序带来新的特性。 +> +> 请关注未来的驱动更新以及在 Github 上的合作。 + +英伟达公司提到并可能合作改进开源的英伟达驱动程序(即 Nouveau),这真是太好了。 + +这也很好地表明了,他们确实希望为 Linux 提供一个更好的开源驱动程序版本。 + +### 开源 Nivida 驱动程序的未来? + +毋容置疑,英伟达计划不断发布开源的 GPU 内核模块。 + +所以,尽管他们不会单独开源他们的驱动程序,但我们仍然可以寄希望于 Nouveau 释放所有的显卡特性。 + +想知道他们更多的计划,你可以参考 [官方的发布声明][5]。 + +*你如何看待这件事?英伟达最终会爱开源和 Linux 吗?嗯,至少这是一个好的开始。在下面的评论区分享你的想法吧。* + + +------ +via: https://news.itsfoss.com/nvidia-open-source-linux/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[chunyang-wen](https://github.com/chunyang-wen) +校对:[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/05/linus-torvalds-nvidia.jpg +[2]: https://news.itsfoss.com/wp-content/uploads/2022/05/nvidia-opensource-linux-drivers-1024x576.jpg +[3]: https://www.nvidia.com/en-us/drivers/unix/ +[4]: https://developer.nvidia.com/cuda-downloads +[5]: https://developer.nvidia.com/blog/nvidia-releases-open-source-gpu-kernel-modules/ diff --git a/published/20220514 How To Enable Minimize And Maximize Buttons In Fedora 36 Workstation.md b/published/20220514 How To Enable Minimize And Maximize Buttons In Fedora 36 Workstation.md new file mode 100644 index 0000000000..b6c08dcc3f --- /dev/null +++ b/published/20220514 How To Enable Minimize And Maximize Buttons In Fedora 36 Workstation.md @@ -0,0 +1,112 @@ +[#]: subject: "How To Enable Minimize And Maximize Buttons In Fedora 36 Workstation" +[#]: via: "https://ostechnix.com/how-to-enable-minimize-and-maximize-buttons-in-fedora/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14624-1.html" + +如何在 Fedora 36 工作站中启用最小化和最大化按钮 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/22/151018fjxtiidtrztri0rr.jpg) + +> 今天,我们将看到 Fedora 桌面的安装后步骤之一。这个简短的指南解释了如何在 Fedora GNOME 工作站和 Silverblue 版本的应用窗口中启用最小化和最大化按钮。 + +### 介绍 + +你可能已经知道,Fedora Silverblue 和 Fedora GNOME 工作站版本的应用窗口中没有最小化和最大化按钮。 + +如果要最小化应用窗口,需要右键单击其标题栏并从上下文菜单中选择最小化选项。 + +不幸的是,你甚至无法在 Firefox 中使用鼠标获得该选项。要最小化 Firefox 窗口,你要点击 `左 ALT+空格` 键并选择最小化选项。 + +我不知道隐藏最常用的按钮有什么好处。Ubuntu GNOME 桌面有最小/最大按钮,但 Fedora 没有。 + +如果你想恢复 Fedora GNOME 和 Silverblue 版本中的最小化和最大化按钮,你可以借助 Fedora 中的 **Gnome Tweaks** 程序和 “Dash to Panel” 扩展来启用它们。 + +### 在 Fedora 中安装 Gnome Tweaks + +**Gnome Tweaks**,以前称为 **Tweak Tool**,是用于高级 GNOME 3 设置的图形界面。它主要是为 GNOME Shell 设计的,但也可以在其他桌面中使用。如果你在不同的桌面上使用 Tweaks,你可能无法拥有所有功能。它在 Fedora 的默认仓库中可用。因此,你可以使用 `dnf` 包管理器在 Fedora 上安装 Gnome Tweaks,如下所示: + +``` +$ sudo dnf install gnome-tweaks +``` + +如果你使用 Fedora Silverblue,你需要使用以下命令进入你的 toolbox 容器: + +``` +$ toolbox enter +``` + +然后按照前面的命令安装 Tweaks。 + +### 在浏览器中添加 Gnome Shell 集成插件 + +确保你在浏览器中添加了 “Gnome Shell 集成” 插件。此扩展提供与 GNOME shell 和相应扩展仓库的集成。 + +如果你尚未添加它,请转到插件页并搜索并安装它。 + +![Add Gnome Shell Integration Add-on In Firefox Browser][1] + +将出现一个弹出窗口。单击“添加”以启用加载项。添加此扩展程序后,你将在浏览器的工具栏上看到 GNOME 图标。 + +### 在 Fedora 中启用 Dash 到面板扩展 + +“Dash to panel” 扩展是 Gnome Shell 的图标任务栏。此扩展将 dash 移动到 GNOME 主面板中,以便将应用启动器和系统托盘组合到一个面板中,类似于 KDE Plasma 和 Windows 7 以上操作系统中的面板。 + +“Dash to panel” 扩展为你提供了一个永久可见的面板,其中包含最喜欢的快捷方式。因此,不再需要单独的停靠区来轻松访问正在运行和收藏的应用。 + +要启用 “Dash to panel” 扩展,请进入 GNOME 扩展站点并搜索 “Dash to panel” 扩展。 + +![Search for Dash to panel extension in Gnome extensions site][2] + +单击搜索结果中的 “Dash to panel” 链接。你将被重定向到 “Dash to panel” 扩展的官方页面。点击 “ON” 按钮。 + +![Enable Dash to panel extension][3] + +在下一个窗口中,单击安装按钮以启用 “Dash to panel” 扩展。 + +![Install Dash to panel extension][4] + +激活此扩展程序后,你将在底部看到 Dash 面板以及你最喜欢的快捷方式。 + +### 在 Fedora 中启用最小化和最大化按钮 + +打开 Gnome Tweaks 应用。进入 “窗口标题栏Windows Titlebars” 并打开最小/最大按钮。 + +![Enable minimize and maximize buttons in application windows in Fedora][5] + +当你打开开关后,最小化和最大化按钮将出现在所有应用的窗口中。 + +![Minimize, maximize buttons appears in applications windows in Fedora][6] + +默认情况下,最小/最大按钮在右侧可见。你可以将其位置更改为左侧或右侧。 + +“Dash to panel” 扩展有很多微调和自定义选项。右键单击 Dash 面板并选择设置选项,然后根据你的喜好开始对其进行自定义。 + +### 资源 + +> **[Dash to panel 网站][7]** + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/how-to-enable-minimize-and-maximize-buttons-in-fedora/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/wp-content/uploads/2022/05/Add-Gnome-Shell-Integration-Add-on-In-Firefox-Browser.png +[2]: https://ostechnix.com/wp-content/uploads/2021/01/Search-for-Dash-to-panel-extension-in-Gnome-extensions-site.png +[3]: https://ostechnix.com/wp-content/uploads/2021/01/Enable-Dash-to-panel-extension.png +[4]: https://ostechnix.com/wp-content/uploads/2021/01/Install-Dash-to-panel-extension.png +[5]: https://ostechnix.com/wp-content/uploads/2021/01/Enable-Minimize-And-Maximize-Buttons-In-Application-Windows-In-Fedora.png +[6]: https://ostechnix.com/wp-content/uploads/2021/01/Minimize-maximize-buttons-appears-in-applications-windows-in-Fedora.png +[7]: https://extensions.gnome.org/extension/1160/dash-to-panel/ diff --git a/published/20220514 How To Install Multimedia Codecs In Fedora Linux.md b/published/20220514 How To Install Multimedia Codecs In Fedora Linux.md new file mode 100644 index 0000000000..962a7faddb --- /dev/null +++ b/published/20220514 How To Install Multimedia Codecs In Fedora Linux.md @@ -0,0 +1,118 @@ +[#]: subject: "How To Install Multimedia Codecs In Fedora Linux" +[#]: via: "https://ostechnix.com/how-to-install-multimedia-codecs-in-fedora-linux/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14642-1.html" + +如何在 Fedora Linux 中安装多媒体编码器 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/27/112826w7kyg5vddudxwwdg.jpg) + +> 在新安装 Fedora后,安装多媒体编码器来播放音频和视频是第一件要事。 + +在这篇简单的教程中,我们将看到如何在 Fedora 36 工作站中从 RPM Fusion 软件包存储库安装多媒体编码器。 + +### 介绍 + +很多多媒体编码器要么是闭源的,要么是非自由的,因此出于法律的原因,它们没有包含在 Fedora Linux 的默认存储库中。 + +幸运的是,一些第三方存储库提供了受限的和非自由的多媒体编码器、软件包和库。一个流行的社区驱动的第三方存储库是 **RPM Fusion**。 + +如果你想在你的 Fedora 桌面环境中播放大多数的音频或视频格式的文件,你应该从 RPM Fusion 中安装必要的多媒体编码器,如下所述。 + +### 在 Fedora Linux 中安装多媒体编码器 + +确保你已经在你的 Fedora 机器中安装了 RPM Fusion 存储库。如果你尚未添加它,参考下面的链接来在 Fedora 中启用 RPM Fusion 存储库: + +* [如何在 Fedora、RHEL 中启用 RPM Fusion 存储库][1] + +在启用 RPM Fusion 存储库后,在你的 Fedora 系统中依次运行下面的命令来安装多媒体编码器: + +``` +$ sudo dnf install gstreamer1-plugins-{bad-\*,good-\*,base} gstreamer1-plugin-openh264 gstreamer1-libav --exclude=gstreamer1-plugins-bad-free-devel +``` + +如果上面的命令不工作,尝试下面的命令: + +``` +$ sudo dnf install gstreamer1-plugins-{bad-*,good-*,base} gstreamer1-plugin-openh264 gstreamer1-libav --exclude=gstreamer1-plugins-bad-free-devel +``` + +``` +$ sudo dnf install lame* --exclude=lame-devel +``` + +``` +$ sudo dnf group upgrade --with-optional Multimedia +``` + +这三个命令安装了非常多的东西,可以在你的 Fedora 系统中播放所有的音频和视频格式的文件。 + +#### 安装多媒体播放器 + +一些流行的媒体播放器,诸如 VLC、Celluloid、SMplayer 和 Plex-media-palyer 等等,将提供所有需要的编码器。你不需要将它们全部都安装,只要任意一两个就足够了。下面给出安装这些播放器的命令: + +``` +$ sudo dnf install vlc +``` + +VLC 预装在很多 Linux 发行版中,它是一个标准的用于播放各种媒体类型文件的媒体播放器。 + +SMplayer 是 Mplayer 的前端,它被认为是 VLC 的最佳替代品。 + +``` +$ sudo dnf install smplayer +``` + +如果你想要更强大是多媒体体验,安装 Plex-media-player。 + +``` +$ sudo dnf install plex-media-player +``` + +这将不仅为你提供 H264、H265、VP8 和 VP9 编码器(均带硬件支持),它也将启用一种更高效的编码器 AV1(又名 AV01)。你可以使用 [AV1 Beta Launch Playlist][2] 来测试你的浏览器是否支持这个编码器。 + +它们中的一些播放器也可以作为 **flatpak** 格式的应用程序来使用。如果与传统的软件包管理器相比,你更喜欢 flatpak 格式的应用程序,你可以安装它们。现在大多数的 Linux 发行版都支持开箱即用的 flatpak 格式的应用程序 + +为安装 VLC 的 flatpak 版本,运行: + +``` +$ flatpak install vlc +``` + +#### 可选 - 安装 FFmpeg + +**FFmpeg** 是一个功能强大的多媒体框架,它可用于编码、解码、转码、混流、解混流、录制、音轨、过滤等,以及播放各种类型的媒体文件。你可以通过在你的系统上安装 FFmpeg 来获取相应的解码器。 + +* [如何在 Linux 中安装 FFmpeg][3] + +希望这有帮助。 + +**相关阅读:** + +* [在 Fedora Silverblue 中的 Chromium 和 Firefox 上启用 H264][4] +* [如何在 OpenSUSE 中安装多媒体解码器][5] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/how-to-install-multimedia-codecs-in-fedora-linux/ + +作者:[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/how-to-enable-rpm-fusion-repository-in-fedora-rhel/ +[2]: https://www.youtube.com/playlist?list=PLyqf6gJt7KuHBmeVzZteZUlNUQAVLwrZS +[3]: https://ostechnix.com/install-ffmpeg-linux/ +[4]: https://ostechnix.com/enable-h264-on-chromium-and-firefox-in-fedora-silverblue/ +[5]: https://ostechnix.com/how-to-install-multimedia-codecs-in-opensuse/ + diff --git a/published/20220516 Fudgie- The Awesome Budgie Desktop is Coming to Fedora Linux Soon.md b/published/20220516 Fudgie- The Awesome Budgie Desktop is Coming to Fedora Linux Soon.md new file mode 100644 index 0000000000..6306b97b23 --- /dev/null +++ b/published/20220516 Fudgie- The Awesome Budgie Desktop is Coming to Fedora Linux Soon.md @@ -0,0 +1,69 @@ +[#]: subject: "Fudgie? The Awesome Budgie Desktop is Coming to Fedora Linux Soon" +[#]: via: "https://news.itsfoss.com/fudgie-fedora-budgie-announcement/" +[#]: author: "Abhishek https://news.itsfoss.com/author/root/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14610-1.html" + +Fudgie?令人惊叹的 Budgie 桌面即将登陆 Fedora Linux +====== + +> Fedora 用户也将能够享受 Budgie 桌面环境的现代体验。 + +![Fedora Budgie][1] + +近来,红帽的社区项目 Fedora 已经获得了相当不错的用户群。除了默认桌面 GNOME 外,Fedora 也以 [Fedora 定制版][2]Fedora Spins 的形式提供了多种其他桌面环境。 + +这意味着你可以在 Fedora 上享受 KDE、MATE、Xfce 和其他一些桌面环境的开箱即用的体验,而无需额外的努力。喜欢 KDE 而不是 GNOME 吗?下载 Fedora 的 KDE 定制版,安装它,就像安装常规的 Fedora 一样。 + +Fedora 定制版中缺少的一个桌面环境是 Budgie 桌面。 + +### Budgie 走向独立 + +在 2014 年左右,Budgie 桌面随同 Solus Linux 项目一起推出。最近,Solus 和 Budgie 项目出现了一些 [倒退式的发展][3]。Budgie 项目现在已经 [从 Solus Linux 中独立出来了][4]。 + +自从首次发布以来,Budgie 就获得了一定的追随者。它的现代布局方式受到了许多 Linux 用户的喜爱。这也是许多其他主要 Linux 发行版(如 Ubuntu、Manjaro、openSUSE)开始提供 Budgie 版本的原因。 + +![Budgie 10.6][5] + +到目前为止,Fedora 的产品中还没有 Budgie,但这可能会在 Fedora 的下一个版本中发生变化。 + +### Budgie 提交加入 Fedora 的申请 + +Budgie 项目的首席开发人员 Joshua Strobl 在 [Reddit 帖子][6] 中宣布了这一消息。 + +> 我现在已提交 Budgie 桌面及其它的附属软件(Budgie 控制中心、Budgie 屏幕保护程序、Budgie 桌面视图)加入到 Fedora 中的申请。从 Fedora rawhide(37)开始并向后移植到 36。它会得到“官方的”维护/支持,因为我自己在工作笔记本电脑上使用 Fedora Silverblue + rawhide,并且我以后会切换桌面到 Fedora Silverblue。 + +这意味着,如果该软件包得到了 Fedora 团队的批准,你应该就能在 Fedora 37 中(甚至有希望在 Fedora 36 中)安装 Budgie 和它的附属软件。 + +但这还不是故事的结束。Joshua 提到,他也在考虑引入并支持包含 Budgie 桌面的 Fedora 官方定制版。这意味着人们将能够下载一个预装了 Budgie(而不是 GNOME)桌面的 Fedora ISO。 + +目前还不清楚他的意思,有可能是一个 Budge 的 Fedora 官方定制版,也有可能是一个新的非官方的 Fedora 衍生版,名为 “Fudgie”,完全由他来维护。 + +### Fedora + Budgie 是一个好消息 + +无论如何,Fedora 的 Budgie 桌面都是个好消息。它为 Fedora 用户提供了更多选择,而 Budgie 是一个漂亮的桌面。同时喜欢 Fedora 和 Budgie 的人应该能够享受两全其美的体验。 + +我希望你同意我的看法。请在评论区也分享一下你的看法吧! + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/fudgie-fedora-budgie-announcement/ + +作者:[Abhishek][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/root/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/fedora-budgie.png +[2]: https://spins.fedoraproject.org +[3]: https://news.itsfoss.com/solus-co-lead-resign-budgie-serpent/ +[4]: https://news.itsfoss.com/budgie-10-6-release/ +[5]: https://news.itsfoss.com/wp-content/uploads/2022/04/budgie-10.61-1024x576.jpg +[6]: https://www.reddit.com/r/Fedora/comments/uq3gah/budgie_desktop_has_now_been_submitted_for/ diff --git a/published/20220516 How To Reset Root Password In Fedora 36.md b/published/20220516 How To Reset Root Password In Fedora 36.md new file mode 100644 index 0000000000..ef311d9227 --- /dev/null +++ b/published/20220516 How To Reset Root Password In Fedora 36.md @@ -0,0 +1,102 @@ +[#]: subject: "How To Reset Root Password In Fedora 36" +[#]: via: "https://ostechnix.com/reset-root-password-in-fedora/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "turbokernel" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14638-1.html" + +在 Fedora 36 中如何重置 root 密码 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/26/094836cgtywrtwkywg2nem.jpg) + +> 在 Fedora 中重置忘记的 root 密码。 + +你是否忘记了 Fedora 中的 root 密码?或者你想更改 Fedora 系统中的 root 用户密码?没问题!本手册将指导你在 Fedora 操作系统中完成更改或重置 root 密码的步骤。 + +**注意:** 本手册已在 Fedora 36 和 35 版本上进行了正式测试。下面提供的步骤与在 Fedora Silverblue 和旧 Fedora 版本中重置 root 密码的步骤相同。 + +**步骤 1** - 打开 Fedora 系统并按下 `ESC` 键,直到看到 GRUB 启动菜单。出现 GRUB 菜单后,选择要引导的内核并按下 `e` 编辑选定的引导条目。 + +![Grub Menu In Fedora 36][1] + +**步骤 2** - 在下一个页面中,你将看到所有启动参数。找到名为 `ro` 的参数。 + +![Find ro Kernel Parameter In Grub Entry][2] + +**步骤 3** - 将 `ro` 参数替换为 `rw init=/sysroot/bin/sh`。请注意 `rw` 和 `init=/sysroot`...之间的空格。修改后的内核参数行应如下所示。 + +![Modify Kernel Parameters][3] + +**步骤 4** - 上述步骤更改参数后,按 `Ctrl+x` 进入紧急模式,即单用户模式。 + +在紧急模式下,输入以下命令以 **读/写** 模式挂载根文件系统(`/`)。 + +``` +chroot /sysroot/ +``` + +![Mount Root Filesystem In Read, Write Mode In Fedora Linux][4] + +**步骤 5** - 现在使用 `passwd` 命令重置 root 密码: + +``` +passwd root +``` + +输入两次 root 密码。我建议使用强密码。 + +![Reset Or Change Root Password In Fedora][5] + +**步骤 6** - 重置 root 密码后,运行以下命令在重启时启用 SELinux 重新标记: + +``` +touch /.autorelabel +``` + +![Enable SELinux Relabeling On Reboot In Fedora][6] + +**步骤 7** - 最后,退出单用户模式并通过运行以下命令将 Fedora 系统重启到正常模式: + +``` +exit +``` + +``` +reboot +``` + +等待 SELinux 重新标记完成。这将需要几分钟,具体时长取决于文件系统的大小和硬盘的速度。 + +![SELinux Filesystem Relabeling In Progress][7] + +**步骤 8** - 文件系统重新标记完成后,你可以使用新的 root 密码登录到你的 Fedora 系统。 + +![Login To Fedora As Root User][8] + +如你所见,在 Fedora 36 中重置 root 密码的步骤非常简单,并且与 [在 RHEL 中重置 root 密码][9] 及其衍生版本(如 CentOS、AlmaLinux 和 Rocky Linux)完全相同。 + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/reset-root-password-in-fedora/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[turbokernel](https://github.com/turbokernel) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/wp-content/uploads/2022/05/Grub-Menu-In-Fedora-36.png +[2]: https://ostechnix.com/wp-content/uploads/2021/11/Find-ro-Kernel-Parameter-In-Grub-Entry.png +[3]: https://ostechnix.com/wp-content/uploads/2022/05/Modify-Kernel-Parameters.png +[4]: https://ostechnix.com/wp-content/uploads/2022/05/Mount-Root-Filesystem-In-Read-Write-Mode-In-Fedora-Linux.png +[5]: https://ostechnix.com/wp-content/uploads/2022/05/Reset-Or-Change-Root-Password-In-Fedora.png +[6]: https://ostechnix.com/wp-content/uploads/2022/05/Enable-SELinux-Relabeling-On-Reboot-In-Fedora.png +[7]: https://ostechnix.com/wp-content/uploads/2021/11/SELinux-filesystem-relabeling-in-progress.png +[8]: https://ostechnix.com/wp-content/uploads/2022/05/Login-To-Fedora-As-Root-User.png +[9]: https://ostechnix.com/how-to-reset-root-user-password-in-centos-8-rhel-8/ diff --git a/published/20220516 Microsoft has another Linux distribution and it is based on Debian.md b/published/20220516 Microsoft has another Linux distribution and it is based on Debian.md new file mode 100644 index 0000000000..ab2671dfb7 --- /dev/null +++ b/published/20220516 Microsoft has another Linux distribution and it is based on Debian.md @@ -0,0 +1,81 @@ +[#]: subject: "Microsoft has another Linux distribution and it is based on Debian" +[#]: via: "https://news.itsfoss.com/microsoft-debian-distro/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14604-1.html" + +微软还有另一个 Linux 发行版,而且是基于 Debian 的 +====== + +> 微软一直在为 Azure 云使用一个基于 Debian 的 Linux 发行版。我们开始揭开它的面纱了! + +![微软 Debian][1] + +微软在其大量的项目中利用了 Linux。近年来,你一定读过很多关于 WSL(或 WSL2)和微软制作的 Linux 发行版(即 **CBL Mariner**)的消息。 + +> CBL 是 “共用基础 LinuxCommon Base Linux”的缩写。 + +甚至在 Windows 11 上,微软也在不断地改进 [WSL][2] 的体验。 + +虽然 CBL Mariner 被用来支持 WSLg(WSL 2 的 GUI 部分)和 Azure,但最近一些媒体([ZDNet][3])报道发现了微软内部使用的另一个 Linux 发行版。 + +微软肯定喜欢 Linux,对吗? + +### CBL-Delridge:一个基于 Debian 的 Linux 发行版 + +![][4] + +微软维护着一个基于 Debian 的发行版,它被用来支持 Azure 的“云端外壳Cloud Shell”。它的名字是 “CBL-Delridge”。 + +感谢 [Hayden Barnes][5],他是 SUSE 公司负责 Windows 容器的高级工程经理。 + +在他 2022 年 2 月的一篇 [旧博文][6] 中,他透露了关于它的更多细节,并帮助你构建它以在需要时将其导入 WSL。 + +与从头构建的 CBL-Mariner 不同,CBL-Delridge(CBL-D)是基于 Debian 10(Buster)的。 + +看到 Debian 在这里受到青睐并不奇怪,即使是 [谷歌也为其内部的 Linux 发行版 gLinux 抛弃了 Ubuntu 而选择了 Debian][7]。 + +有趣的是,微软在 2020 年发布了这个供内部使用的发行版(根据 Hayden 维护的 [微软的开源举措的非官方时间表][8]),而我们在 2022 年才知道了它。 + +![][9] + +CBL-Delridge 也采用了同样的版本号 10(巧合),代号为 “Quinault”。解析一下这个名字,ZDNet 指出,Delridge 是西雅图西部的一个区,而 Quinault 指的是华盛顿州奥林匹克国家公园的一个山谷。 + +### 构建 CBL-Delridge + +与普通的 Linux 发行版不同,你找不到它的可以公开下载的镜像文件。 + +考虑到 CBL-D 的 APT 软件包库是公开的,如果你出于任何需求想测试它,你可以构建你的 CBL-D 镜像。 + +你也可以把它导入 WSL 中。[Hayden 的博文][10] 解释了如何使用 debootstrap 来开始构建镜像,然后将其导入 WSL。 + +请注意,CBL-D 并不完全是 Debian 的替代品。所以,你可能无法找到所有你喜欢的软件包。要了解更多的信息,你可以浏览 Hayden 的博文。 + +你对微软的内部使用的 Linux 发行版有什么看法?你试过其中一个吗?请在评论中告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/microsoft-debian-distro/ + +作者:[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/05/microsoft-new-debian-based-linux-distro.jpg +[2]: https://news.itsfoss.com/windows-11-wsl/ +[3]: https://www.zdnet.com/article/surprise-theres-yet-another-microsoft-linux-distro-cbl-delridge/ +[4]: https://news.itsfoss.com/wp-content/uploads/2022/05/azure-delridge.png +[5]: https://twitter.com/unixterminal +[6]: https://boxofcables.dev/building-cbl-d-microsofts-other-linux-distro/ +[7]: https://itsfoss.com/goobuntu-glinux-google/ +[8]: https://github.com/sirredbeard/microsoft-opensource +[9]: https://news.itsfoss.com/wp-content/uploads/2022/05/wsl-cbl-delridge-1024x600.png +[10]: https://boxofcables.dev/building-cbl-d-microsofts-other-linux-distro/ diff --git a/published/20220516 Structured Data Processing with Spark SQL.md b/published/20220516 Structured Data Processing with Spark SQL.md new file mode 100644 index 0000000000..33a25c2f6d --- /dev/null +++ b/published/20220516 Structured Data Processing with Spark SQL.md @@ -0,0 +1,123 @@ +[#]: subject: "Structured Data Processing with Spark SQL" +[#]: via: "https://www.opensourceforu.com/2022/05/structured-data-processing-with-spark-sql/" +[#]: author: "Phani Kiran https://www.opensourceforu.com/author/phani-kiran/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14631-1.html" + +用 Spark SQL 进行结构化数据处理 +====== + +> Spark SQL 是 Spark 生态系统中处理结构化格式数据的模块。它在内部使用 Spark Core API 进行处理,但对用户的使用进行了抽象。这篇文章深入浅出地告诉你 Spark SQL 3.x 的新内容。 + +![](https://img.linux.net.cn/data/attachment/album/202205/24/093036xaf6kaz1auaf4a7s.jpg) + +有了 Spark SQL,用户可以编写 SQL 风格的查询。这对于精通结构化查询语言或 SQL 的广大用户群体来说,基本上是很有帮助的。用户也将能够在结构化数据上编写交互式和临时性的查询。Spark SQL 弥补了弹性分布式数据集resilient distributed data sets(RDD)和关系表之间的差距。RDD 是 Spark 的基本数据结构。它将数据作为分布式对象存储在适合并行处理的节点集群中。RDD 很适合底层处理,但在运行时很难调试,程序员不能自动推断模式schema。另外,RDD 没有内置的优化功能。Spark SQL 提供了数据帧DataFrame和数据集来解决这些问题。 + +Spark SQL 可以使用现有的 Hive 元存储、SerDes 和 UDF。它可以使用 JDBC/ODBC 连接到现有的 BI 工具。 + +### 数据源 + +大数据处理通常需要处理不同的文件类型和数据源(关系型和非关系型)的能力。Spark SQL 支持一个统一的数据帧接口来处理不同类型的源,如下所示。 + +* 文件: + * CSV + * Text + * JSON + * XML +* JDBC/ODBC: + * MySQL + * Oracle + * Postgres +* 带模式的文件: + * AVRO + * Parquet +* Hive 表: + * Spark SQL 也支持读写存储在 Apache Hive 中的数据。 + +通过数据帧,用户可以无缝地读取这些多样化的数据源,并对其进行转换/连接。 + +### Spark SQL 3.x 的新内容 + +在以前的版本中(Spark 2.x),查询计划是基于启发式规则和成本估算的。从解析到逻辑和物理查询计划,最后到优化的过程是连续的。这些版本对转换和行动的运行时特性几乎没有可见性。因此,由于以下原因,查询计划是次优的: + +* 缺失和过时的统计数据 +* 次优的启发式方法 +* 错误的成本估计 + +Spark 3.x 通过使用运行时数据来迭代改进查询计划和优化,增强了这个过程。前一阶段的运行时统计数据被用来优化后续阶段的查询计划。这里有一个反馈回路,有助于重新规划和重新优化执行计划。 + +![Figure 1: Query planning][2] + +#### 自适应查询执行(AQE) + +查询被改变为逻辑计划,最后变成物理计划。这里的概念是“重新优化”。它利用前一阶段的可用数据,为后续阶段重新优化。正因为如此,整个查询的执行要快得多。 + +AQE 可以通过设置 SQL 配置来启用,如下所示(Spark 3.0 中默认为 false): + +``` +spark.conf.set(“spark.sql.adaptive.enabled”,true) +``` + +#### 动态合并“洗牌”分区 + +Spark 在“洗牌shuffle”操作后确定最佳的分区数量。在 AQE 中,Spark 使用默认的分区数,即 200 个。这可以通过配置来启用。 + +``` +spark.conf.set(“spark.sql.adaptive.coalescePartitions.enabled”,true) +``` + +#### 动态切换连接策略 + +广播哈希是最好的连接操作。如果其中一个数据集很小,Spark 可以动态地切换到广播连接,而不是在网络上“洗牌”大量的数据。 + +#### 动态优化倾斜连接 + +如果数据分布不均匀,数据会出现倾斜,会有一些大的分区。这些分区占用了大量的时间。Spark 3.x 通过将大分区分割成多个小分区来进行优化。这可以通过设置来启用: + +``` +spark.conf.set(“spark.sql.adaptive.skewJoin.enabled”,true) +``` + +![Figure 2: Performance improvement in Spark 3.x (Source: Databricks)][3] + +### 其他改进措施 + +此外,Spark SQL 3.x还支持以下内容。 + +#### 动态分区修剪 + +3.x 将只读取基于其中一个表的值的相关分区。这消除了解析大表的需要。 + +#### 连接提示 + +如果用户对数据有了解,这允许用户指定要使用的连接策略。这增强了查询的执行过程。 + +#### 兼容 ANSI SQL + +在兼容 Hive 的早期版本的 Spark 中,我们可以在查询中使用某些关键词,这样做是完全可行的。然而,这在 Spark SQL 3 中是不允许的,因为它有完整的 ANSI SQL 支持。例如,“将字符串转换为整数”会在运行时产生异常。它还支持保留关键字。 + +#### 较新的 Hadoop、Java 和 Scala 版本 + +从 Spark 3.0 开始,支持 Java 11 和 Scala 2.12。 Java 11 具有更好的原生协调和垃圾校正,从而带来更好的性能。 Scala 2.12 利用了 Java 8 的新特性,优于 2.11。 + +Spark 3.x 提供了这些现成的有用功能,而无需开发人员操心。这将显着提高 Spark 的整体性能。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/structured-data-processing-with-spark-sql/ + +作者:[Phani Kiran][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/phani-kiran/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Spark-SQL-Data-cluster.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Query-planning.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-2-Performance-improvement-in-Spark-3.x-Source-Databricks.jpg diff --git a/published/20220517 Adobe Illustrator Alternative Inkscape Releases Version 1.2.md b/published/20220517 Adobe Illustrator Alternative Inkscape Releases Version 1.2.md new file mode 100644 index 0000000000..3fa4fa0560 --- /dev/null +++ b/published/20220517 Adobe Illustrator Alternative Inkscape Releases Version 1.2.md @@ -0,0 +1,110 @@ +[#]: subject: "Adobe Illustrator Alternative Inkscape Releases Version 1.2" +[#]: via: "https://news.itsfoss.com/inkscape-1-2-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14615-1.html" + +Adobe Illustrator 的替代品 Inkscape 发布了 1.2 版本 +====== + +> Inkscape 1.2 是一个激动人心的更新,包含许多有用的改进和新增功能。试一试吧! + +![Inkscape][1] + +Inkscape 是一个流行的开源矢量图形处理程序,可用于 Linux、Windows 和 macOS。 + +它的最新版本侧重于改进现有工具,以及提供更多自定义选项。 + +此外,它还有一些新增功能。让我们来看看吧! + +### Inkscape 1.2:有什么新功能? + +![Inkscape 1.2 is here!][2] + +Inkscape 1.2 是一个激动人心的更新,它包含了许多有用的增强功能。其中一些关键变化包括: + +* 改进的渐变编辑器 +* 新的捕捉模式 +* 支持多页文档 +* 改进的导出对话框 +* 可定制的工具栏 + +在这里,我将重点介绍重要的功能改进: + +#### 多页文档支持 + +![][4] + +你现在可以在同一个文档中创建多个标准/自定义大小的页面,并把它们保存为一个多页的 PDF 文档。 + +不仅是导出,你还可以导入多页 PDF 来简化操作。 + +### 自定义调色板 + +你现在可以轻松地更改尺寸、重新配置颜色,以此来尝试所有可用的调色板,然后选择你真正喜欢的颜色。 + +特别是当你需要在用户界面中使用多个调色板时,它会让操作更流畅。 + +### 新的“平铺”实时路径效果 + +如果你正在处理很多个对象,并想尝试不同路径效果,那么你应该会喜欢新的平铺实时路径效果。 + +你可以轻松调整镜像模式、调整间隙、添加行和列,从而获得大量发挥创意的机会。 + +### 图层和对象对话框 + +![][5] + +大多数改进使得体验比以前更直接。使用新的合并图层和对象对话框,你可以根据要查找的图层,快速组织/查找对象。 + +你甚至可以自定义图层和对象颜色来区分它们。 + +### 导出对话框 + +![][6] + +现在,导出对话框为你提供了选择简单/批量导出的选项,以及选择文件格式和 DPI 设置的能力。 + +### 其他改进 + +除了上面的主要亮点外,还有其他的一些重大变化,包括: + +* 两种新的画布捕捉模式有助于对齐对象 +* 你可以在“填充和描边Fill and Stroke”对话框中选择渐变 +* 编辑标记marker的能力 +* 改进了与扩展的兼容性 +* 更新了 SVG 字体编辑器 +* 性能改进 +* 可配置的工具栏 + +你可以参考 [Inkscape 1.2 发行说明][7] 来查看所有的技术变化。 + +### 下载 Inkscape 1.2 + +你可以从它的官方网站下载 AppImage 格式的 Inkscape 1.2 软件包,或查看其他适用于 Windows/macOS 平台的可用软件包。 + +> **[Inkscape 1.2][8]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/inkscape-1-2-release/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/inkscape-1-2.jpg +[2]: https://youtu.be/1U4hVbvRr_g +[4]: https://news.itsfoss.com/wp-content/uploads/2022/05/inkscape-1-2-multi-document.jpg +[5]: https://news.itsfoss.com/wp-content/uploads/2022/05/inkscape-1-2layers-objects-1024x593.jpg +[6]: https://news.itsfoss.com/wp-content/uploads/2022/05/inkscape1-2-export-1024x688.jpg +[7]: https://media.inkscape.org/media/doc/release_notes/1.2/Inkscape_1.2.html +[8]: https://inkscape.org/release/inkscape-1.2/ diff --git a/published/20220517 Kali Linux 2022.2 Release Adds an Amusing New Feature for the Hackers to Scare People.md b/published/20220517 Kali Linux 2022.2 Release Adds an Amusing New Feature for the Hackers to Scare People.md new file mode 100644 index 0000000000..f604885536 --- /dev/null +++ b/published/20220517 Kali Linux 2022.2 Release Adds an Amusing New Feature for the Hackers to Scare People.md @@ -0,0 +1,115 @@ +[#]: subject: "Kali Linux 2022.2 Release Adds an Amusing New Feature for the Hackers to Scare People" +[#]: via: "https://news.itsfoss.com/kali-linux-2022-2-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14606-1.html" + +Kali Linux 2022.2 发布:增加了一个吓唬人的有趣新功能 +====== + +> Kali Linux 2022.2 是今年的第二次更新,增加了一些有趣的内容。 + +![kali linux][1] + +Kali Linux 不是你寻常使用的 Linux 发行版。它是专门为渗透测试和道德黑客学习及实验而量身打造的。 + +在新的 Kali Linux 版本中,增加了一些有趣的工具和功能。让我们来看看 Kali Linux 2022.2 的亮点。 + +### Kali Linux 2022.2 有什么新功能? + +Kali Linux 2022.2 是一个有趣的版本,它引入了更新的桌面环境,升级了 Linux 内核,增加了新的工具,以及更多的改进。 + +不仅仅限于通常的完善,你还可以看到一个新的屏幕保护程序,其中有许多令人惊讶的元素。 + +#### 带有好莱坞怀旧色彩的新屏保 + +Kali Linux 已经出现在许多黑客相关的电视节目/电影(如《黑客军团Mr. Robot》)中,看起来酷极了。 + +更进一步,Kali Linux 增加了一个新的屏幕保护程序(你可以单独安装),其中有来自好莱坞的令人惊讶的元素和一些吓唬人的黑客场景。 + +他们在屏保中调侃了《黑客帝国》的尼奥,还添加了一个漂亮的 Kali Linux 标志。 + +![][2] + +整个屏幕保护程序包括几个非常棒的元素。要安装并立即启动它,你可以输入以下命令: + +``` +sudo apt -y install kali-screensaver +sudo apt -y install hollywood-activate +hollywood-activate +``` + +![VIDEO](https://player.vimeo.com/video/710680907) + +#### GNOME 42 + +![][3] + +Kali Linux 终于包含了新的 [GNOME 42][4] 桌面环境。所以,在 Kali Linux 自然带有 GNOME 42 的所有优点,包括新的屏幕截图用户界面。 + +另外,现在你将会在 GNOME 桌面环境中获得一致的深浅主题体验。 + +![][5] + +#### KDE Plasma 5.24 + +对于 KDE 粉丝,Kali Linux 2022.2 也带来了新的 [KDE Plasma 5.24][6] LTS 桌面环境。 + +![][7] + +#### 新的 Kali Linux 工具 + +新的工具总是每个新版本的重点。一些新增加的工具包括: + +* BruteShark - 网络取证分析工具(NFAT) +* Evil-WinRM - Ultimate WinRM shell +* Hakrawler - 网络爬虫,设计用于轻松、快速发现端点和资产 +* Httpx - 快速和多用途的 HTTP 工具箱 +* Sparrow-wifi - 用于 Linux 的图形化 Wi-Fi 分析器 + +#### 其他改进 + +该版本还有许多其他实质性的改进。主要的亮点包括。 + +* 对终端进行了调整,以加强语法高亮、自动补完和输出 +* 自动复制丢失的配置 +* 支持 VirtualBox 共享文件夹 +* 增加了新的应用程序图标 +* 为多显示器设置调整了默认墙纸 +* 针对 ARM 设备的更新 +* Linux 内核 5.16 + +要探索更多关于该版本的信息,你可以查看 [官方发布公告][8]。 + +### 下载 Kali Linux 2022.2 + +你应该能够在 [官方下载页面][9] 中找到该镜像。根据你的要求选择合适的版本,然后安装它。 + +> **[Kali Linux 2022.2][10]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kali-linux-2022-2-release/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/kali-2022-2-release-new.jpg +[2]: https://news.itsfoss.com/wp-content/uploads/2022/05/kali-linux-screensaver.jpg +[3]: https://news.itsfoss.com/wp-content/uploads/2022/05/kali-linux-gnome-42.jpg +[4]: https://news.itsfoss.com/gnome-42-features/ +[5]: https://news.itsfoss.com/wp-content/uploads/2022/05/kali-linux-gnome-42-screenshot.jpg +[6]: https://news.itsfoss.com/kde-plasma-5-24-lts-release/ +[7]: https://news.itsfoss.com/wp-content/uploads/2022/05/kali-linux-kde-5-24-1024x640.jpg +[8]: https://www.kali.org/blog/kali-linux-2022-2-release/ +[9]: https://www.kali.org/get-kali/ +[10]: https://www.kali.org/get-kali/ diff --git a/published/20220518 Google To Start Distributing A Collection Of Open Source Software libraries.md b/published/20220518 Google To Start Distributing A Collection Of Open Source Software libraries.md new file mode 100644 index 0000000000..1edc4b7a48 --- /dev/null +++ b/published/20220518 Google To Start Distributing A Collection Of Open Source Software libraries.md @@ -0,0 +1,42 @@ +[#]: subject: "Google To Start Distributing A Collection Of Open Source Software libraries" +[#]: via: "https://www.opensourceforu.com/2022/05/google-to-start-distributing-a-collection-of-open-source-software-libraries/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "beamrolling" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14641-1.html" + +谷歌开始分发一系列开源软件库 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/27/104331cwwqji26wlwwfw2n.jpg) + +5 月 17 日,谷歌推出了一项新计划,该计划向谷歌云用户策划并提供经过安全审查的开源包选项,以保护开源软件供应链。该公司在一篇 [博文][2] 中宣布了这项名为 “安心开源软件Assured Open Source Software” 的新服务。在博文中,谷歌云安全和隐私部门产品经理 Andy Chang 强调了保障开源软件的一些问题,并强调了谷歌对开源的承诺。 + +“开发者社区、企业及政府对软件供应链风险的意识越来越强,”Chang 写道,并以去年的 log4j 重大漏洞为例。“谷歌仍是开源代码最大的维护者、贡献者和使用者之一,并深入参与了帮助开源软件生态系统更加安全的工作。” + +据谷歌称,“安心开源软件”服务将让云客户能够访问谷歌的大量软件审计知识。另据其称,所有通过该服务提供的开源软件包也在公司内部使用,该公司会定期检查和分析其漏洞。 + +谷歌目前正在审核的 550 个重要开源库的清单可以在 [GitHub][3] 上找到。虽然这些库都可以独立于谷歌下载,但该计划将呈现通过谷歌云提供的审核版本,防止开发者破坏广泛使用的开放源码库。这项服务现在处于预先体验阶段,将在 2022 年第三季度准备好进行更广泛的消费者测试。 + +谷歌的声明只是广大行业努力加强开源软件供应链的安全的一部分,这份努力得到了拜登政府的支持。今年 1 月,美国国土安全部和美国网络安全与基础设施安全局的代表与美国一些主要 IT 公司的高管会面,研究 log4j 漏洞之后的开源软件安全问题。此后,有关公司在最近的一次峰会上承诺提供超过 3000 万美元的资金,以改善开源软件的安全问题。 + +除了现金,谷歌还在投入工程时间来确保供应链的安全。该公司已宣布发展一个“开源维护小组Open Source Maintenance Crew”,该团队将与库维护人员合作以提高安全性。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/google-to-start-distributing-a-collection-of-open-source-software-libraries/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[beamrolling](https://github.com/beamrolling) +校对:[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/05/google3-1-e1652863988525.jpg +[2]: https://cloud.google.com/blog/products/identity-security/introducing-assured-open-source-software-service +[3]: https://github.com/google/oss-fuzz/tree/master/projects diff --git a/published/20220518 How To Reset Sudo Password In Ubuntu 22.04 - 20.04 LTS.md b/published/20220518 How To Reset Sudo Password In Ubuntu 22.04 - 20.04 LTS.md new file mode 100644 index 0000000000..b6bb934753 --- /dev/null +++ b/published/20220518 How To Reset Sudo Password In Ubuntu 22.04 - 20.04 LTS.md @@ -0,0 +1,128 @@ +[#]: subject: "How To Reset Sudo Password In Ubuntu 22.04 / 20.04 LTS" +[#]: via: "https://ostechnix.com/how-to-reset-sudo-password-in-ubuntu-20-04-lts/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14648-1.html" + +如何在 Ubuntu 22.04 / 20.04 LTS 中重新设置 sudo 密码 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/29/083429wzrvirffinihrfv5.jpg) + +> 在 Ubuntu 中重新设置已忘记的 root 用户的密码 + +这篇简单的指南将向你解释,如何在 Ubuntu 22.04 好 20.04 LTS 桌面环境中,以及从服务器版本中的 恢复rescue 模式中重新设置 sudo 密码。 + +### 介绍 + +在 [安装 Ubuntu][1] 时,创建的一个新用户将会带有 `sudo` 权限,用以执行各种各样的管理任务。 + +如果你的 Ubuntu 系统有多个 `sudo` 用户,你能够从另外一个 `sudo` 用户的账号下,轻松地重新设置所忘记的一个 `sudo` 用户或管理员用户的密码。 + +如果你只有一个 `sudo` 用户,并且忘记了密码怎么办?没有问题! 从 Ubuntu 的 恢复rescue单一用户single user 模式中恢复 `sudo` 用户密码很容易。 + +虽然这篇指南是在 Ubuntu 22.04 和 20.04 LTS 版本上进行的正式测试,不过,下面给定的步骤对于其它的 Ubuntu 版本和衍生版本来说是相同的。 + +### 在 Ubuntu 22.04 / 20.04 LTS 中重新设置 sudo 密码 + +首先,启动你的 Ubuntu 系统到 恢复rescue 模式下,来重新设置一个 `sudo` 用户的密码,操作如下面的链接所述。 + +> [如何启动到 Ubuntu 22.04 /  20.04 / 18.04 的 恢复rescue 模式 或 急救Emergency模式 ][2] + +现在,进入到 恢复rescue 模式下,通过运行下面的命令,以读/写的模式挂载根(`/`)文件系统: + +``` +# mount -n -o remount,rw / +``` + +现在,使用 `passwd` 命令来重新设置 `sudo` 用户的密码: + +``` +# passwd ostechnix +``` + +在这里,`ostechnix` 是 sudo 用户的名称。使用你自己的用户名称来替换掉它。 + +输入两次密码: + +``` +New password: +Retype new password: +passwd: password updated successfully +``` + +![Reset Sudo Password In Ubuntu 22.04 / 20.04 LTS][3] + +就这样。我们已经重新设置 `sudo` 用户密码。如果你按照上面链接所述的方法 1 进入到 恢复rescue 模式,按下 `Ctrl+d` 组合键来启动到正常模式。或者,你也可以输入下面的任意一个命令来启动到正常模式。 + +``` +# systemctl default +``` + +或, + +``` +# exit +``` + +如果你想重新启动系统,而不是启动到正常模式,输入: + +``` +# systemctl reboot +``` + +如果你已经按照上面链接所述的方法 2 进入到恢复rescue 模式,输入: + +``` +# exit +``` + +你将返回到 恢复菜单recovery menu。现在选择 “恢复正常启动Resume normal boot”,并按下回车键。 + +![Boot Into Normal Mode In Ubuntu][4] + +在强调一次,选择 “确定OK” 按钮,并按下回车按键来继续启动到正常模式: + +![Exit Recovery Mode And Boot Into Normal Mode][5] + +现在,你在运行管理命令时可以使用新的 `sudo` 密码。 + +### 如果我把用户名称和密码都忘了怎么办? + +如果你忘记了用户名称,在 恢复rescue 模式下,你可以很容易地列出你的 Linux 系统中的用户名称,使用目录: + +``` +# cat etc/passwd +``` + +来自我 Ubuntu 22.04 系统的输出示例: + +``` +[...] +ostechnix:x:1000:1000:Ostechnix,,,:/home/ostechnix:/bin/bash +[...] +``` + +好了,现在,你找到用户名称了。只需要按照上面的步骤来重新设置用户的密码即可。 + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/how-to-reset-sudo-password-in-ubuntu-20-04-lts/ + +作者:[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/install-ubuntu-desktop/ +[2]: https://ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/ +[3]: https://ostechnix.com/wp-content/uploads/2022/05/Reset-Sudo-Password-In-Ubuntu.png +[4]: https://ostechnix.com/wp-content/uploads/2020/05/Boot-into-normal-mode-in-Ubuntu.png +[5]: https://ostechnix.com/wp-content/uploads/2020/05/Booting-into-normal-mode-from-rescue-mode-in-Ubuntu.png diff --git a/published/20220518 ONLYOFFICE 7.1 Release Adds ARM Compatibility, a New PDF Viewer, and More Features.md b/published/20220518 ONLYOFFICE 7.1 Release Adds ARM Compatibility, a New PDF Viewer, and More Features.md new file mode 100644 index 0000000000..6bbbbe2e5f --- /dev/null +++ b/published/20220518 ONLYOFFICE 7.1 Release Adds ARM Compatibility, a New PDF Viewer, and More Features.md @@ -0,0 +1,143 @@ +[#]: subject: "ONLYOFFICE 7.1 Release Adds ARM Compatibility, a New PDF Viewer, and More Features" +[#]: via: "https://news.itsfoss.com/onlyoffice-7-1-release/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lkxed" +[#]: translator: "PeterPan0106" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14630-1.html" + +ONLYOFFICE 7.1 发布,新增针对 ARM 的支持、新的 PDF 查看器 +====== + +> ONLYOFFICE Docs 7.1 带来了期待已久的针对文档、电子表格以及演示文稿编辑器的更新。对 ARM 的支持更是画龙点睛之笔。 + +![onlyoffice 7.1][1] + +ONLYOFFICE,被认为是 [最佳的微软 Office 替代品][2] 之一,刚刚发布了最新的 7.1 版本更新。 + +或许你不了解,ONLYOFFICE 可以在自托管的服务器(例如 Nextcloud)或者桌面上在线使用。 + +这个版本最为激动人心的变化就是初步支持了基于 ARM 的设备,例如树莓派。 + +接下来请让我们一起看看有什么新的变化。 + +### ONLYOFFICE 7.1 : 新变化 + +[![ONLYOFFICE Docs 7.1: PDF viewer, animations, print preview in spreadsheets][4]][3] + +除了对 ARM 的支持,ONLYOFFICE 7.1 还提供了如下新功能: + +* 一个全新的 PDF、XPS 和 DjVu 文件查看器 +* 更方便和可定制的图形选项 +* 电子表格打印预览 +* 演示文稿中的动画 +* 支持 SmartArt 对象 + +#### ARM 兼容 + +树莓派这样的基于 ARM 的设备正变得越来越热门,许多人已经期待了许久 ONLYOFFICE 对 ARM 架构的支持。 + +随着 7.1 版本的发布,ONLYOFFICE Docs 现在可以在所有 ARM64 设备上运行。由于 ARM 设备的效率和安全性的提高,我认为这将对 ONLYOFFICE 的未来产生很大的促进作用。 + +#### 全新的 PDF、XPS 和 DjVu 文件查看器 + +![onlyoffice][5] + +这是许多其他办公软件多年来的一个关键功能。从 ONLYOFFICE 7.1 开始,用户现在可以更方便地使用文档编辑器来查看 PDF、XPS 和 DjVu 文件。 + +新的视图选项卡为用户提供了一个页面缩略图视图和一个导航栏,其视图更为紧凑和简化。 + +此外,用户现在还可以将 PDF 文件转换为 DOCX 文件,以便对其进行编辑。因此,我们不用再额外打开其他软件进行处理了,这将显著优化现有的工作流并消除瓶颈。 + +#### 选择和编辑图形更加方便 + +![onlyoffice][6] + +图形做为现代办公软件的特性,在许多时候并没能发挥足够的作用。尽管 ONLYOFFICE 拥有这些功能已经有一段时间了,但它们在使用时总是相当笨重。 + +在 ONLYOFFICE 7.1 中,重新设计的图形选择菜单使得这种情况得到了改变。这个新的菜单与微软 Office 的同类产品非常相似,每个图标都可以从菜单中看到。 + +此外,它现在可以显示最近使用的图形,使批量插入图形更加容易。 + +图形的最后一项改进是能够使用鼠标来编辑它们。对于那些熟悉 Inkscape 等图形设计软件的人来说,这将会相当得心应手。通过简单地拖动点,你将可以在短时间内创建一个独特的形状。 + +#### 电子表格的打印预览 + +![][7] + +我相信每个人都发生过由于一个简单的错误而导致打印出现问题的情况。此前其他程序早已经解决了这个问题,但在 ONLYOFFICE 电子表格编辑器中一直没有这个功能。 + +新版本终于引入了“打印预览”,这将会显著改善上述的情况。 + +这并不算什么十分新颖的更新,只是说它补齐了短板并且可以节省纸张和打印耗材。 + +#### 改进的动画页面,便捷的剪切和复制 + +![][8] + +针对需要经常使用演示文稿的用户而言,这个版本增加了一个单独的动画标签,使动画的插入变得更为容易。 + +ONLYOFFICE 7.1 演示文稿编辑器现在支持各种动画,以及便捷地将一页幻灯片移动以及复制的能力。 + +#### SmartArt 对象的支持 + +SmartArt 是一种在文档、演示文稿和电子表格中便捷地制作自定义图形的工具。然而,它一直是微软办公软件的一个功能。虽然其他各种应用程序对该格式有不同程度的支持,但它们并不能与微软 Office 相媲美。 + +幸运的是,ONLYOFFICE 7.1 现在完全支持这种格式,并且没有任何乱码,仿佛原生的一般。用户将不再需要和以前一样在将 SmartArt 图形转换为普通图形和数字,便于无缝切换。 + +### 其他变化 + +ONLYOFFICE 7.1 的其他重要改进包括: + +* 新的客户端语言:加利西亚语和阿塞拜疆语 +* 在受密码保护的文件中,能够在输入密码的同时查看密码 +* OFORM 文件支持缩放选项 +* 能够按用户组过滤评论 +* 支持金字塔图表 +* 支持金字塔柱状图 +* 支持垂直和水平圆柱图 +* 支持垂直和水平圆锥图 +* 上下文菜单中的移动和复制幻灯片选项 +* 公式工具提示 +* 新的货币格式支持 + +若想了解全部新特性,请见 [发布日志][9]。 + +### 下载 ONLYOFFICE 7.1 + +总的来说,ONLYOFFICE 7.1 是一个兼容 ARM 并且功能更为丰富的版本。 + +所有版本(企业版、开发版者、社区版)都有更新。 + +下载方面提供了很多不同的软件包,包括用于 ARM 版本的 Docker 镜像、 Snap 软件包以及用于云供应商的即点即用选项。你可以前往下载页面,寻找最合适的安装程序。 + +下载页面同时列出了安装的官方指南。 + +> **[获取 ONLYOFFICE 7.1][10]** + +*你是否已经尝试了新版本呢?* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/onlyoffice-7-1-release/ + +作者:[Jacob Crume][a] +选题:[lkxed][b] +译者:[PeterPan0106](https://github.com/PeterPan0106) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/onlyoffice-7-1.jpg +[2]: https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/ +[3]: https://youtu.be/5-ervHAemZc +[4]: https://i.ytimg.com/vi/5-ervHAemZc/hqdefault.jpg +[5]: https://news.itsfoss.com/wp-content/uploads/2022/05/ONLYOFFICE-viewer.png +[6]: https://news.itsfoss.com/wp-content/uploads/2022/05/ONLYOFFICE-shapes.png +[7]: https://news.itsfoss.com/wp-content/uploads/2022/05/ONLYOFFICE-Print-Preview.png +[8]: https://news.itsfoss.com/wp-content/uploads/2022/05/ONLYOFFICE-Animations.png +[9]: https://www.onlyoffice.com/blog/2022/05/discover-onlyoffice-docs-v7-1/ +[10]: https://www.onlyoffice.com/download-docs.aspx diff --git a/published/20220519 How To Enable Activate Linux Watermark Notification In Linux Desktop.md b/published/20220519 How To Enable Activate Linux Watermark Notification In Linux Desktop.md new file mode 100644 index 0000000000..f97fdccf01 --- /dev/null +++ b/published/20220519 How To Enable Activate Linux Watermark Notification In Linux Desktop.md @@ -0,0 +1,126 @@ +[#]: subject: "How To Enable Activate Linux Watermark Notification In Linux Desktop" +[#]: via: "https://ostechnix.com/activate-linux/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14617-1.html" + +如何在 Linux 桌面中启用 “激活 Linux” 水印通知 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/20/112226f7zmsvqqvt9tln9n.jpg) + +> “激活 Windows” 水印已移植到 Linux。 + +为了阻止 Windows 操作系统的盗版行为,微软开发团队想出了一个办法:在 Windows 的角落放置一个激活水印,直到用户合法购买许可证并激活它。 + +如果你的电脑正在运行盗版的 Windows 副本,你应该已经注意到右下角的 “激活 Windows” 水印通知,如下图所示。 + +![“激活 Windows” 通知][1] + +幸运的是,Linux 用户永远不会收到这样的通知。因为 GNU/Linux 是一个完全免费的开源操作系统,在 GNU 通用公共许可证(GPL)下发布。 + +任何人都可以运行、研究、修改和重新分发 Linux 源代码,甚至可以出售修改后的代码的副本,只要使用相同的许可即可。 + +Linux 是开源的,所以你真的可以用 Linux 做任何你在专有操作系统上不能做的事情。 + +你可以在 Linux 中做很多事情。你可以在 Linux 下构建和运行*几乎*任何东西,无论是有趣的项目还是企业级应用程序。甚至,你还可以添加 “激活 Linux” 水印。 + +### “激活 Linux” 是什么? + +几天前,我注意到了一个叫做 “激活 Linux” 的有趣项目。它和你在未经许可的 Windows 操作系统中看到的 “激活 Windows” 通知非常相似。 + +“激活 Linux” 的开发者使用 C 语言中的 Xlib 和 cairo,重新创建了 Linux 版的 “激活 Windows” 通知水印。 + +它会在你的 Linux 桌面上显示一个水印,并通知你进入设置以激活你的 Linux 发行版!这很酷,不是吗? + +### 启用 “激活 Linux” 水印 + +activate-linux 项目在短时间内变得非常流行。几天之内,它已经为许多流行的 Linux 发行版而打了包,例如 Arch Linux、openSUSE 和 Ubuntu。 + +#### Arch Linux + +[AUR][2] 已经收录 activate-linux。因此,你可以使用 [Paru][3] 或 [Yay][4] 在 Arch Linux 及其衍生版 EndeavourOS 和 Manjaro Linux 中安装 activate-linux 应用程序。 + +``` +$ paru -S activate-linux +``` + +或者 + +``` +$ yay -S activate-linux +``` + +#### openSUSE + +[OBS][5] 收录了 Activate-linux。 + +如果你正在使用 openSUSE Tumbleweed 版本,请逐条运行下面的命令来安装 activate-linux: + +``` +$ sudo zypper addrepo https://download.opensuse.org/repositories/home:WoMspace/openSUSE_Tumbleweed/home:WoMspace.repo +$ sudo zypper refresh +$ sudo zypper install activate-linux +``` + +对于 openSUSE Factory ARM 版,运行如下命令: + +``` +$ sudo zypper addrepo https://download.opensuse.org/repositories/home:WoMspace/openSUSE_Factory_ARM/home:WoMspace.repo +$ sudo zypper refresh +$ sudo zypper install activate-linux +``` + +#### Ubuntu + +activate-linux 有一个适用于 Ubuntu 及其衍生版(如 Pop!_OS)的 PPA。 + +``` +$ sudo add-apt-repository ppa:edd/misc +$ sudo apt update +$ sudo apt install activate-linux +``` + +安装完成后,只需在终端执行下面的命令,就可以让它运行起来: + +``` +$ activate-linux +``` + +现在,你将在桌面的角落看到 “激活 Linux” 水印通知,就像在未授权的 Windows 副本中一样。 + +![桌面上的 “激活 Linux” 水印][6] + +别紧张!它是无害的。若想取消显示,你可以返回终端并按 `CTRL+C` 终止 `activate-linux` 命令。 + +我在 Ubuntu 22.04 GNOME 版本上测试了一下。它在 Wayland 中开箱即用。 + +“激活 Linux” 是我这一段时间以来遇到的一个非常有趣又无用的项目。我想这会让每个刚从 Windows 切换过来的 Linux 用户,拥有更加舒适的体验吧! + +### 相关资源 + +* [“激活 Linux” 的 GitHub 存储库][7] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/activate-linux/ + +作者:[sk][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://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/wp-content/uploads/2022/05/Activate-Windows-Notification.png +[2]: https://aur.archlinux.org/packages/activate-linux-git +[3]: https://ostechnix.com/how-to-install-paru-aur-helper-in-arch-linux/ +[4]: https://ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[5]: https://software.opensuse.org//download.html?project=home%3AWoMspace&package=activate-linux +[6]: https://ostechnix.com/wp-content/uploads/2022/05/Activate-Linux.png +[7]: https://github.com/MrGlockenspiel/activate-linux diff --git a/published/20220520 A programmer-s guide to GNU C Compiler.md b/published/20220520 A programmer-s guide to GNU C Compiler.md new file mode 100644 index 0000000000..38cc8d46af --- /dev/null +++ b/published/20220520 A programmer-s guide to GNU C Compiler.md @@ -0,0 +1,269 @@ +[#]: subject: "A programmer's guide to GNU C Compiler" +[#]: via: "https://opensource.com/article/22/5/gnu-c-compiler" +[#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14653-1.html" + +GNU C 编译器的程序员入门指南 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/30/111925gbh7yldbolroheqy.jpg) + +> 带你一窥生成二进制文件步骤的幕后,以便在出现一些错误时,你知道如何逐步解决问题。 + +C 语言广为人知,深受新老程序员的好评。使用 C 语言编写的源文件代码,使用了标准的英语术语,因而人们可以方便阅读。然而,计算机只能理解二进制代码。为将代码转换为机器语言,你需要使用一种被称为 编译器compiler 的工具。 + +最常见的编译器是 GCC(GNU 编译器集GNU Compiler Collection)。编译过程涉及到一系列的中间步骤及相关工具。 + +### 安装 GCC + +为验证在你的系统上是否已经安装了 GCC,使用 `gcc` 命令: + +``` +$ gcc --version +``` + +如有必要,使用你的软件包管理器来安装 GCC。在基于 Fedora 的系统上,使用 `dnf` : + +``` +$ sudo dnf install gcc libgcc +``` + +在基于 Debian 的系统上,使用 `apt` : + +``` +$ sudo apt install build-essential +``` + +在安装后,如果你想查看 GCC 的安装位置,那么使用: + +``` +$ whereis gcc +``` + +### 演示使用 GCC 来编译一个简单的 C 程序 + +这里有一个简单的 C 程序,用于演示如何使用 GCC 来编译。打开你最喜欢的文本编辑器,并在其中粘贴这段代码: + +``` +// hellogcc.c +#include + +int main() { + printf("Hello, GCC!\n"); + return 0; +} +``` + +保存文件为 `hellogcc.c` ,接下来编译它: + +``` +$ ls +hellogcc.c + +$ gcc hellogcc.c + +$ ls -1 +a.out +hellogcc.c +``` + +如你所见,`a.out` 是编译后默认生成的二进制文件。为查看你所新编译的应用程序的输出,只需要运行它,就像你运行任意本地二进制文件一样: + +``` +$ ./a.out +Hello, GCC! +``` + +### 命名输出的文件 + +文件名称 `a.out` 是非常莫名其妙的,所以,如果你想具体指定可执行文件的名称,你可以使用 `-o` 选项: + +(LCTT 译注:注意这和最近 Linux 内核废弃的 a.out 格式无关,只是名字相同,这里生成的 a.out 是 ELF 格式的 —— 也不知道谁给起了个 `a.out` 这破名字,在我看来,默认输出文件名就应该是去掉了 `.c` 扩展名后的名字。by wxy) + +``` +$ gcc -o hellogcc hellogcc.c + +$ ls +a.out hellogcc hellogcc.c + +$ ./hellogcc +Hello, GCC! +``` + +当开发一个需要编译多个 C 源文件文件的大型应用程序时,这种选项是很有用的。 + +### 在 GCC 编译中的中间步骤 + +编译实际上有四个步骤,即使在简单的用例中 GCC 自动执行了这些步骤。 + +1. 预处理Pre-Processing:GNU 的 C 预处理器(cpp)解析头文件(`#include` 语句),展开 macros 定义(`#define` 语句),并使用展开的源文件代码来生成一个中间文件,如 `hellogcc.i`。 +2. 编译Compilation:在这个期间中,编译器将预处理的源文件代码转换为指定 CPU 架构的汇编代码。由此生成是汇编文件使用一个 `.s` 扩展名来命名,如在这个示例中的 `hellogcc.s` 。 +3. 汇编Assembly:汇编程序(`as`)将汇编代码转换为目标机器代码,放在目标文件中,例如 `hellogcc.o` 。 +4. 链接Linking:链接器(`ld`)将目标代码和库代码链接起来生成一个可执行文件,例如 `hellogcc` 。 + +在运行 GCC 时,可以使用 `-v` 选项来查看每一步的细节: + +``` +$ gcc -v -o hellogcc hellogcc.c +``` + +![Compiler flowchart][2] + +### 手动编译代码 + +体验编译的每个步骤可能是很有用的,因此在一些情况下,你不需要 GCC 完成所有的步骤。 + +首先,除源文件文件以外,删除在当前文件夹下生成的文件。 + +``` +$ rm a.out hellogcc.o + +$ ls +hellogcc.c +``` + +#### 预处理器 + +首先,启动预处理器,将其输出重定向为 `hellogcc.i` : + +``` +$ cpp hellogcc.c > hellogcc.i + +$ ls +hellogcc.c hellogcc.i +``` + +查看输出文件,并注意一下预处理器是如何包含头文件和扩展宏中的源文件代码的。 + +#### 编译器 + +现在,你可以编译代码为汇编代码。使用 `-S` 选项来设置 GCC 只生成汇编代码: + +``` +$ gcc -S hellogcc.i + +$ ls +hellogcc.c hellogcc.i hellogcc.s + +$ cat hellogcc.s +``` + +查看汇编代码,来看看生成了什么。 + +#### 汇编 + +使用你刚刚所生成的汇编代码来创建一个目标文件: + +``` +$ as -o hellogcc.o hellogcc.s + +$ ls +hellogcc.c hellogcc.i hellogcc.o hellogcc.s +``` + +#### 链接 + +要生成一个可执行文件,你必须将对象文件链接到它所依赖的库。这并不像前面的步骤那么简单,但它却是有教育意义的: + +``` +$ ld -o hellogcc hellogcc.o +ld: warning: cannot find entry symbol _start; defaulting to 0000000000401000 +ld: hellogcc.o: in function `main`: +hellogcc.c:(.text+0xa): undefined reference to `puts' +``` + +在链接器查找完 `libc.so` 库后,出现一个引用 `undefined puts` 错误。你必须找出适合的链接器选项来链接必要的库以解决这个问题。这不是一个小技巧,它取决于你的系统的布局。 + +在链接时,你必须链接代码到核心运行时core runtime(CRT)目标,这是一组帮助二进制可执行文件启动的子例程。链接器也需要知道在哪里可以找到重要的系统库,包括 `libc` 和 `libgcc`,尤其是其中的特殊的开始和结束指令。这些指令可以通过 `--start-group` 和 `--end-group` 选项来分隔,或者使用指向 `crtbegin.o` 和 `crtend.o` 的路径。 + +这个示例使用了 RHEL 8 上的路径,因此你可能需要依据你的系统调整路径。 + +``` +$ ld -dynamic-linker /lib64/ld-linux-x86-64.so.2 \ + -o hello \ + /usr/lib64/crt1.o /usr/lib64/crti.o \ + --start-group \ + -L/usr/lib/gcc/x86_64-redhat-linux/8 \ + -L/usr/lib64 -L/lib64 hello.o \ + -lgcc \ + --as-needed -lgcc_s \ + --no-as-needed -lc -lgcc \ + --end-group \ + /usr/lib64/crtn.o +``` + +在 Slackware 上,同样的链接过程会使用一组不同的路径,但是,你可以看到这其中的相似之处: + +``` +$ ld -static -o hello \ + -L/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/ \ + /usr/lib64/crt1.o /usr/lib64/crti.o hello.o /usr/lib64/crtn.o \ + --start-group \ + -lc -lgcc -lgcc_eh \ + --end-group +``` + +现在,运行由此生成的可执行文件: + +``` +$ ./hello +Hello, GCC! +``` + +### 一些有用的实用程序 + +下面是一些帮助检查文件类型、符号表symbol tables 和链接到可执行文件的库的实用程序。 + +使用 `file` 实用程序可以确定文件的类型: + +``` +$ file hellogcc.c +hellogcc.c: C source, ASCII text + +$ file hellogcc.o +hellogcc.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped + +$ file hellogcc +hellogcc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=bb76b241d7d00871806e9fa5e814fee276d5bd1a, for GNU/Linux 3.2.0, not stripped +``` + +对目标文件使用 `nm` 实用程序可以列出 符号表symbol tables : + +``` +$ nm hellogcc.o +0000000000000000 T main + U puts +``` + +使用 `ldd` 实用程序来列出动态链接库: + +``` +$ ldd hellogcc +linux-vdso.so.1 (0x00007ffe3bdd7000) +libc.so.6 => /lib64/libc.so.6 (0x00007f223395e000) +/lib64/ld-linux-x86-64.so.2 (0x00007f2233b7e000) +``` + +### 总结 + +在这篇文章中,你了解到了 GCC 编译中的各种中间步骤,和检查文件类型、符号表symbol tables 和链接到可执行文件的库的实用程序。在你下次使用 GCC 时,你将会明白它为你生成一个二进制文件所要做的步骤,并且当出现一些错误时,你会知道如何逐步处理解决问题。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/gnu-c-compiler + +作者:[Jayashree Huttanagoudar][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jayashree-huttanagoudar +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/build_structure_tech_program_code_construction.png +[2]: https://opensource.com/sites/default/files/2022-05/compiler-flowchart.png diff --git a/published/20220520 Customize GNOME 42 with A Polished Look.md b/published/20220520 Customize GNOME 42 with A Polished Look.md new file mode 100644 index 0000000000..7f5fabc586 --- /dev/null +++ b/published/20220520 Customize GNOME 42 with A Polished Look.md @@ -0,0 +1,132 @@ +[#]: subject: "Customize GNOME 42 with A Polished Look" +[#]: via: "https://www.debugpoint.com/2022/05/customize-gnome-42-look-1/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14646-1.html" + +如何把你的 GNOME 42 打磨得更精致 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/28/191525nx791r930j88ra3z.jpg) + +> 在 5 分钟内将你最喜欢的 GNOME 桌面打磨得更精致。 + +你可以使用图标、主题、光标和壁纸等多种方式来定制你最喜爱的 GNOME 桌面。本文向你展示了如何使你的 GNOME 42 桌面看起来更精致。在最近发布的 Ubuntu 22.04 LTS 和 Fedora 36 上提供了 GNOME 42 桌面环境。 + +在你进一步阅读之前,先看看调整之前和之后的外观比较。 + +![GNOME before customisation][1] + +![GNOME after customisation][2] + +我将把本教程分为两个部分。 + +第一部分涉及设置和安装所需的软件包。然后第二部分是如何应用各种设置来获得你想要的外观。 + +本教程主要在 Ubuntu 22.04 LTS 上测试。但是,它应该适用于 Ubuntu 和 Fedora 的其他变体。 + +### 将 GNOME 42 定制得更精致 + +#### 设置 + +首先,为你的系统启用 Flatpak,因为我们需要安装扩展管理器来下载本教程所需的 GNOME Shell 扩展。 + +因此,要做到这一点,请打开一个终端并运行以下命令: + +``` +sudo apt install flatpak gnome-software-plugin-flatpak +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +完成后重启计算机。 + +然后从终端运行以下命令,来安装扩展管理器应用以下载 GNOME Shell 扩展: + +``` +flatpak install flathub com.mattjakeman.ExtensionManager +``` + +打开扩展管理器应用,并安装两个扩展。第一个是 “浮动停靠区Floating Dock”,它提供了超酷的停靠区,你可以在桌面上的任何位置移动它。第二个,安装 “用户主题User themes” 扩展来帮助你在 Ubuntu Linux 中安装外部 GTK 主题。 + +![User Themes Extension][3] + +![Floating Dock Extension][4] + +接着,使用以下命令安装 [Materia 主题][5]。你必须构建它,因为它没有任何可执行文件。在 Ubuntu 中依次运行以下命令进行安装: + +``` +git clone https://github.com/ckissane/materia-theme-transparent.git +cd materia-theme-transparent +meson _build +meson install -C _build +``` + +此外,请从 [这里][7] 下载 [Kora 图标主题][6]。下载后解压文件,将以下四个文件夹复制到 `/home/<用户名>/.icons` 路径下。如果 `.icons` 文件夹不存在,请创建它。 + +![Kora Icon Theme][8] + +除了上述更改,从 [这里][9] 下载 Bibata 光标主题。下载后,解压文件夹并将其复制到相同的 `/home/<用户名>/.icons` 文件夹中。 + +除了上述之外,如果你想要一个与上述主题相匹配的漂亮字体,请从谷歌字体 [下载 Robot 字体][10],并将它们复制到 `/home//.fonts` 文件夹。 + +最后,再次重启系统。 + +#### 配置 + +打开扩展管理器,启用 “浮动停靠区Floating Dock” 和 “用户主题User themes”,并禁用 “Ubuntu Dock”。 + +![Changes to Extensions][11] + +此外,打开 “浮动停靠区Floating Dock” 设置并进行以下更改: + +![Floating Dock Settings][12] + +此外,打开 [GNOME 优化工具][13]GNOME Tweak Tool,然后转到外观Appearance选项卡。设置以下内容: + +* 光标:Bibata-Original-Ice +* Shell 主题:Materia +* 图标:Kora + +除此之外,你可能还想更改字体。为此,请转到字体Fonts选项卡并将文档和界面更改为 “Robot 10pt”。 + +或者,你也可以从 Ubuntu 22.04 的默认设置中更改强调色和样式。 + +最后,根据你的喜好下载漂亮的壁纸。对于本教程,我从 [这里][14] 下载了一个示例壁纸。 + +如果一切顺利,你应该有一个漂亮的桌面,如下图所示: + +![Customize GNOME 42 – Final Look][15] + +享受你的精致的 GNOME 42!干杯。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/customize-gnome-42-look-1/ + +作者:[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://i2.wp.com/www.debugpoint.com/wp-content/uploads/2022/05/GNOME-before-customisation.jpg?ssl=1 +[2]: https://i0.wp.com/www.debugpoint.com/wp-content/uploads/2022/05/GNOME-after-customisation.jpg?ssl=1 +[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/User-Themes-Extension2.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/05/Floating-Doc-Extension.jpg +[5]: https://github.com/ckissane/materia-theme-transparent +[6]: https://github.com/bikass/kora/ +[7]: https://github.com/bikass/kora/archive/refs/heads/master.zip +[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/Kora-Icon-Theme.jpg +[9]: https://www.pling.com/p/1197198/ +[10]: https://fonts.google.com/specimen/Roboto +[11]: https://www.debugpoint.com/wp-content/uploads/2022/05/Changes-to-Extensions.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2022/05/Floating-Dock-Settings.jpg +[13]: https://www.debugpoint.com/2018/05/customize-your-ubuntu-desktop-using-gnome-tweak/ +[14]: https://www.pexels.com/photo/colorful-blurred-image-6985048/ +[15]: https://www.debugpoint.com/wp-content/uploads/2022/05/Customize-GNOME-42-Final-Look.jpg diff --git a/published/20220520 How to rename a branch, delete a branch, and find the author of a branch in Git.md b/published/20220520 How to rename a branch, delete a branch, and find the author of a branch in Git.md new file mode 100644 index 0000000000..cca58c8b10 --- /dev/null +++ b/published/20220520 How to rename a branch, delete a branch, and find the author of a branch in Git.md @@ -0,0 +1,203 @@ +[#]: subject: "How to rename a branch, delete a branch, and find the author of a branch in Git" +[#]: via: "https://opensource.com/article/22/5/git-branch-rename-delete-find-author" +[#]: author: "Agil Antony https://opensource.com/users/agantony" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14635-1.html" + +Git 教程:重命名分支、删除分支、查看分支作者 +====== + +![](https://img.linux.net.cn/data/attachment/album/202205/25/161618nt30jqe10nqtlzlj.jpg) + +> 掌握管理本地/远程分支等最常见的 Git 任务。 + +Git 的主要优势之一就是它能够将工作“分叉”到不同的分支中。 + +如果只有你一个人在使用某个存储库,分支的好处是有限的。但是,一旦你开始与许多其他贡献者一起工作,分支就变得必不可少。Git 的分支机制允许多人同时处理一个项目,甚至是同一个文件。用户可以引入不同的功能,彼此独立,然后稍后将更改合并回主分支。那些专门为一个目的创建的分支,有时也被称为主题分支topic branch,例如添加新功能或修复已知错误。 + +当你开始使用分支,了解如何管理它们会很有帮助。以下是开发者在现实世界中使用 Git 分支执行的最常见任务。 + +### 重命名分支 + +有时候,你或许会错误地命名了一个分支,或者你会想要在内容合并到主分支后,使用同一个分支在不同的错误或任务之间切换。在这种情况下,重命名主题分支就会很有帮助。 + +#### 重命名本地分支 + +1、重命名本地分支: + +``` +$ git branch -m +``` + +当然,这只会重命名你的分支副本。如果远程 Git 服务器上存在该分支,请继续执行后续步骤。 + +2、推送这个新分支,从而创建一个新的远程分支: + +``` +$ git push origin +``` + +3、删除旧的远程分支: + +``` +$ git push origin -d -f +``` + +#### 重命名当前分支 + +当你要重命名的分支恰好是当前分支时,你不需要指定旧的分支名称。 + +1、重命名当前分支: + +``` +$ git branch -m +``` + +2、推送新分支,从而创建一个新的远程分支: + +``` +$ git push origin +``` + +3、删除旧的远程分支: + +``` +$ git push origin -d -f +``` + +### 使用 Git 删除本地和远程分支 + +为了保持存储库的整洁,通常建议你在确保已将内容合并到主分支后,删除临时分支。 + +#### 删除本地分支 + +删除本地分支只会删除系统上存在的该分支的副本。如果分支已经被推送到远程存储库,它仍然可供使用该存储库的每个人使用。 + +1、签出存储库的主分支(例如 `main` 或 `master`): + +``` +$ git checkout +``` + +2、列出所有分支(本地和远程): + +``` +$ git branch -a +``` + +3、删除本地分支: + +``` +$ git branch -d +``` + +要删除所有本地主题分支并仅保留 `main` 分支: + +``` +$ git branch | grep -v main | xargs git branch -d +``` + +#### 删除远程分支 + +删除远程分支只会删除远程服务器上存在的该分支的副本。如果你想撤销删除,也可以将其重新推送到远程(例如 GitHub),只要你还有本地副本即可。 + +1、签出存储库的主分支(通常是 `main` 或 `master`): + +``` +$ git checkout +``` + +2、列出所有分支(本地和远程): + +``` +$ git branch -a +``` + +3、删除远程分支: + +``` +$ git push origin -d +``` + +### 查看远程主题分支的作者 + +如果你是存储库管理员,你可能会有这个需求,以便通知未使用分支的作者它将被删除。 + +1、签出存储库的主分支(例如 `main` 或 `master`): + +``` +$ git checkout +``` + +2、删除不存在的远程分支的分支引用: + +``` +$ git remote prune origin +``` + +3、列出存储库中所有远程主题分支的作者,使用 `--format` 选项,并配合特殊的选择器来只打印你想要的信息(在本例中,`%(authorname)` 和 `%(refname)` 分别代表作者名字和分支名称): + +``` +$ git for-each-ref --sort=authordate --format='%(authorname) %(refname)' refs/remotes +``` + +示例输出: + +``` +tux  refs/remotes/origin/dev +agil refs/remotes/origin/main +``` + +你可以添加更多格式,包括颜色编码和字符串操作,以便于阅读: + +``` +$ git for-each-ref --sort=authordate \ + --format='%(color:cyan)%(authordate:format:%m/%d/%Y %I:%M %p)%(align:25,left)%(color:yellow) %(authorname)%(end)%(color:reset)%(refname:strip=3)' \ + refs/remotes +``` + +示例输出: + +``` +01/16/2019 03:18 PM tux      dev +05/15/2022 10:35 PM agil     main +``` + +你可以使用 `grep` 获取特定远程主题分支的作者: + +``` +$ git for-each-ref --sort=authordate \ + --format='%(authorname) %(refname)' \ + refs/remotes | grep +``` + +### 熟练运用分支 + +Git 分支的工作方式存在细微差别,具体取决于你想要分叉代码库的位置、存储库维护者如何管理分支、压扁squashing变基rebasing等。若想进一步了解该主题,你可以阅读下面这三篇文章: + +* [《用乐高来类比解释 Git 分支》][4],作者:Seth Kenlon +* [《我的 Git push 命令的安全使用指南》][5],作者:Noaa Barki +* [《Git 分支指南》][6],作者:Kedar Vijay Kulkarni + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/git-branch-rename-delete-find-author + +作者:[Agil Antony][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/agantony +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/tree-branches.jpg +[2]: https://www.flickr.com/photos/22244945@N00/3353319002 +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/article/22/4/git-branches +[5]: https://opensource.com/article/22/4/git-push +[6]: https://opensource.com/article/18/5/git-branching diff --git a/published/20220521 FSF Does Not Accept Debian as a Free Distribution. Here-s Why!.md b/published/20220521 FSF Does Not Accept Debian as a Free Distribution. Here-s Why!.md new file mode 100644 index 0000000000..6009321e9f --- /dev/null +++ b/published/20220521 FSF Does Not Accept Debian as a Free Distribution. Here-s Why!.md @@ -0,0 +1,67 @@ +[#]: subject: "FSF Does Not Accept Debian as a Free Distribution. Here’s Why!" +[#]: via: "https://news.itsfoss.com/fsf-does-not-consider-debian-a-free-distribution/" +[#]: author: "Abhishek https://news.itsfoss.com/author/root/" +[#]: collector: "lkxed" +[#]: translator: "Chao-zhi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14628-1.html" + +自由软件基金会为什么不认为 Debian 是一种自由发行版? +====== + +![Why FSF doesn't consider Debian a free distribution][1] + +Debian 项目开发了一个尊重用户自由的 G​​NU/Linux 发行版。在各种自由软件许可证下发布的软件中,其源代码中包含非自由组件的情形并不鲜见。这些软件在被发布到 Debian 之前会被清理掉。而自由软件基金会Free Software Foundation(FSF)维护着一份 [自由 GNU/Linux 发行版的列表][2],但奇怪的是,Debian 并不在其中。事实上, Debian 不符合进入此列表的某些标准,我们想知道到底不满足哪些标准。但首先,我们需要了解所有这些智力工作是如何得到证明的。换句话说,为什么要费心尝试进入一些名单,尤其是这个名单? + +为什么 Debian 应该得到 FSF 的承认,以获得它的自由发行版的地位?曾于 2010 年至 2013 年担任 Debian 项目负责人的 Stefano Zacchiroli 说过几个原因。其中一个 Stefano 称之为“外部审查”的原因我特别赞同。事实上,Debian 有其标准和质量水准,一些软件应当符合这些标准才能成为该发行版的一部分,但除了 Debian 开发人员自己,没有人能控制这个过程。如果该发行版被列入这份珍贵的清单中,那么 FSF 就会密切关注 Debian 的命运,并(在出现问题时)给予适度的批评。我相信这是很好的动力。如果你也这么认为,那么现在让我们看看 FSF 认为 Debian 不够自由的原因。 + +### Debian 社会契约 + +除了自由 GNU/Linux 发行版列表之外,FSF 还保留了一份因某种原因而被拒绝授予自由地位的 GNU/Linux 发行版的列表。对于此列表中的每个发行版,都有一个评论,简要说明了拒绝的理由。从对 Debian 的评论中可以清楚地看出,FSF 和 Debian 项目在对“自由分发”一词的解释上产生分歧的主要根源来自一份被称为 “Debian 社会契约Debian Social Contract”的文件。 + +该社会契约的第一个版本是在 1997 年 7 月 4 日由第二任 Debian 项目领导人 Bruce Perens 发表的。作为该契约的一部分,也公布了一套被称为 Debian 自由软件准则Debian Free Software Guidelines(DFSG)的规则。从那时起,要成为 Debian 的一部分,分发软件的许可证必须符合 DFSG。该社会契约记录了 Debian 开发者只用自由软件建立操作系统的意图,而 DFSG 则用于将软件分为自由和非自由。2004 年 4 月 26 日,批准了该文件的新版本,取代了 1997 年的版本。 + +Debian 社会契约有五条。要回答我们今天主要讨论的问题,我们只需要关注其中两条 —— 即第一条和第五条,其他的省略。可以在 [此处][3] 查看该契约的完整版本。 + +第一条说:“**Debian 将保持 100% 自由**。我们在标题为‘Debian 自由软件准则Debian Free Software Guidelines’的文件中提供了用于确定一个作品是否‘自由’的准则。我们承诺,根据这些准则,Debian 系统及其所有组件将是自由的。我们将支持在 Debian 上创造或使用自由和非自由作品的人。我们永远不会让系统要求使用非自由组件。” + +同时,第五条写道:“**不符合我们自由软件标准的作品**。我们承认,我们的一些用户需要使用不符合 Debian 自由软件准则的作品。我们在我们的存档中为这些作品创建了“contrib”和“non-free”区域。这些区域中的软件包并不是 Debian 系统的一部分,尽管它们已被配置为可以在 Debian 中使用。我们鼓励 CD 制造商阅读这些区域的软件包的许可证,并确定他们是否可以在其 CD 上分发这些软件包。因此,尽管非自由作品不是 Debian 的一部分,但我们支持它们的使用,并为非自由软件包提供基础设施(例如我们的错误跟踪系统和邮件列表)。” + +因此,在实践中,第一条和第五条意味着:在安装了 Debian 之后,用户得到了一个完全而彻底的自由操作系统,但是如果他们突然想牺牲自由来追求功能,安装非自由软件,Debian 不仅不会阻碍他们这样做,而且会大大简化这一任务。 + +尽管该契约规定发行版将保持 100% 自由,但它允许官方存档的某些部分可能包含非自由软件或依赖于某些非自由组件的自由软件。形式上,根据同一契约,这些部分中的软件不是 Debian 的一部分,但 FSF 对此感到不安,因为这些部分使得在系统上安装非自由软件变得更加容易。 + +在 2011 年前,FSF 有合理的理由不认为 Debian 是自由的——该发行版附带的 Linux 内核没有清理二进制 blob。但自 2011 年 2 月发布的 Squeeze 至今,Debian 已经包含了完全自由的 Linux 内核。因此,简化非自由软件的安装是 FSF 不承认 Debian 是自由发行版的主要原因,直到 2016 年这是我知道的唯一原因,但在 2016 年初出现了问题…… + +### 等等 …… 关 Firefox 什么事? + +很长一段时间,Debian 都包含一个名为 Iceweasel 的浏览器,它只不过是 Firefox 浏览器的更名重塑而已。进行品牌重塑有两个原因:首先,该浏览器标志和名称是 Mozilla 基金会的商标,而提供非自由软件与 DFSG 相抵触。其次,通过在发行版中包含浏览器,Debian 开发人员必须遵守 Mozilla 基金会的要求,该基金会禁止以 Firefox 的名义交付浏览器的修改版本。因此,开发人员不得不更改名称,因为他们在不断地修改浏览器的代码,以修复错误并消除漏洞。但在 2016 年初,Debian 有幸拥有一款经过修改的 Firefox 浏览器,不受上述限制,可以保留原来的名称和徽标。一方面,这是对 Debian 修改的认可,也是对 Debian 信任的体现。另一方面,该软件显然没有清除非自由组件,它现在已成为发行版的一部分。如果此时 Debian 已被列入自由 GNU/Linux 发行版列表,那么自由软件基金会将会毫不犹豫地指出这一点。 + +### 结论 + +数字世界中的自由与现实世界中的自由同样重要。在这篇文章中,我试图揭示 Debian 最重要的特性之一 —— 开发用户自由的发行版。开发人员花费额外的时间从软件中清理非自由组件,并且以 Debian 为技术基础的数十个发行版继承了它的工作,并由此获得了一部分自由。 + +另外,我想分享一个简单的看法,即自由并不像乍看起来那么简单,人们自然会去追问什么是真正的自由,而什么不是。由于 Firefox 的存在,Debian 现在不能被称为自由的 GNU/Linux 发行版。但从 2011 年,当 Debian 终于开始清理内核以及发行版的其他组件时,直到 2016 年 Firefox 成为发行版的一部分时,自由软件基金会出于纯粹的意识形态原因并不认为该发行版是自由的:原因是 Debian 大大简化了非自由软件的安装……现在轮到你来权衡所有的争论,并决定是否将 GNU/Linux 发行版视为自由的了。 + +祝你好运!并尽可能保持自由。 + +由 Evgeny Golyshev 为 [Cusdeb.com][4] 撰写 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/fsf-does-not-consider-debian-a-free-distribution/ + +作者:[Evgeny Golyshev][a] +选题:[lkxed][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/root/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/why-fsf-doesnt-consider-debian-a-free-software-1200-%C3%97-675px.png +[2]: https://gnu.org/distros/free-distros.en.html +[3]: https://debian.org/social_contract +[4]: https://wiki.cusdeb.com/Essays:Why_the_FSF_does_not_consider_Debian_as_a_free_distribution/en diff --git a/published/20220523 DAML- The Programming Language for Smart Contracts in a Blockchain.md b/published/20220523 DAML- The Programming Language for Smart Contracts in a Blockchain.md new file mode 100644 index 0000000000..c333cb5a81 --- /dev/null +++ b/published/20220523 DAML- The Programming Language for Smart Contracts in a Blockchain.md @@ -0,0 +1,143 @@ +[#]: subject: "DAML: The Programming Language for Smart Contracts in a Blockchain" +[#]: via: "https://www.opensourceforu.com/2022/05/daml-the-programming-language-for-smart-contracts-in-a-blockchain/" +[#]: author: "Dr Kumar Gaurav https://www.opensourceforu.com/author/dr-gaurav-kumar/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14649-1.html" + +DAML:区块链中智能合约的编程语言 +====== + +> DAML 智能合约语言是一种专门设计的特定领域语言domain specific language(DSL),用于编码应用的共享业务逻辑。它用于区块链环境中分布式应用的开发和部署。 + +![](https://img.linux.net.cn/data/attachment/album/202205/29/090752supudcno3dufa41j.jpg) + +区块链技术是一种安全机制,以一种使人难以或不可能修改或入侵的方式来跟踪信息。区块链整合了交易的数字账本,它被复制并发送至其网络上的每台计算机。在链的每个区块中,都有一些交易。当区块链上发生新的交易时,该交易的记录就会被添加到属于该链的每个人的账簿中。 + +区块链使用分布式账本技术distributed ledger technology(DLT),其中数据库并不保存在一个服务器或节点中。在区块链中,交易被记录在一个被称为哈希hash的不可改变的加密符号中。这意味着,如果一个通道或链上的一个区块被改变,黑客将很难改变链上的那个区块,因为他们必须对外面的每一个版本的链都要这样做。区块链,如比特币和以太坊,随着新的区块被添加到链上而不断增长,这使得账本更加安全。 + +随着区块链中智能合约的实施,在没有任何人工干预的情况下,有了自动执行的场景。智能合约技术使得执行最高级别的安全、隐私和反黑客实施成为可能。 + +![Figure 1: Market size of blockchain technology (Source: Statista.com)][2] + +区块链的用例和应用是: + +* 加密货币 +* 智能合约 +* 安全的个人信息 +* 数字健康记录 +* 电子政务 +* 不可伪造的代币(NFT) +* 游戏 +* 跨境金融交易 +* 数字投票 +* 供应链管理 + +根据 Statista.com,自过去几年以来,区块链技术市场的规模正在以非常快的速度增长,预计到 2025 年将达到 400 亿美元。 + +### 区块链的编程语言和工具箱 + +有许多编程语言和开发工具包可用于分布式应用和智能合约。区块链的编程和脚本语言包括 Solidity、Java、Vyper、Serpent、Python、JavaScript、GoLang、PHP、C++、Ruby、Rust、Erlang 等,并根据实施场景和用例进行使用。 + +选择一个合适的平台来开发和部署区块链,取决于一系列因素,包括对安全、隐私、交易速度和可扩展性的需求(图 2)。 + +![Figure 2: Factors to look at when selecting a blockchain platform][3] + +开发区块链的主要平台有: + +* 以太坊 +* XDC Network +* Tezos +* Stellar +* Hyperledger +* Ripple +* Hedera Hashgraph +* Quorum +* Corda +* NEO +* OpenChain +* EOS +* Dragonchain +* Monero + +### DAML:一种高性能的编程语言 + +数字资产建模语言Digital Asset Modeling Language,即 DAML(daml.com),是一种高性能的编程语言,用于开发和部署区块链环境中的分布式应用。它是一个轻量级和简洁的平台,用于快速应用开发。 + +![Figure 3: Official portal of DAML][4] + +DAML 的主要特点是: + +* 细粒度的权限 +* 基于场景的测试 +* 数据模型 +* 业务逻辑 +* 确定性的执行 +* 存储抽象化 +* 无重复开销 +* 负责任的跟踪 +* 原子的可组合性 +* 授权检查 +* 需要知道的隐私 + +### 安装和使用 DAML + +DAML SDK 可以安装在 Linux、macOS 或 Windows 上。在多个操作系统上安装 DAML 的详细说明可访问 https://docs.daml.com/getting-started/installation.html 。 + +你必须具备以下条件才能使用 DAML: + +* Visual Studio Code +* Java 开发套件(JDK) + +DAML 可以通过下载并运行可执行的安装程序在 Windows 上安装,你可访问 https://github.com/digital-asset/daml/releases/download/v1.18.1/daml-sdk-1.18.1-windows.exe 。 + +在 Linux 或 Mac 上安装 DAML 可以通过在终端执行以下内容来完成: + +``` +$ curl -sSL https://get.daml.com/ | sh +``` + +安装 DAML 后,可以创建基于区块链的新应用,如图 4 和 5 所示。 + +![Figure 4: Creating a new app][5] + +在另一个终端中,新的应用被导航并安装了项目的依赖: + +![Figure 5: Running DAML][6] + +``` +WorkingDirectory>cd myapp/ui +WorkingDirectory>npm install +WorkingDirectory>npm start +``` + +这样启动了 WebUI,该应用可在 Web 浏览器上通过 URL http://localhost:3000/ 访问。 + +![Figure 6: Login panel in DAML app][7] + +### 研究和开发的范围 + +区块链技术为不同类别的应用提供了广泛的开发平台和框架。其中许多平台是免费和开源的,可以下载和部署以用于基于研究的实现。研究学者、从业者和专家们可以使用这些平台为众多应用提出和实施他们的算法。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/daml-the-programming-language-for-smart-contracts-in-a-blockchain/ + +作者:[Dr Kumar Gaurav][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/dr-gaurav-kumar/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/blockchain-hand-shake.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Market-size-of-blockchain-technology.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Untitled.png +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-3-Official-portal-of-DAML-1.jpg +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-4-Creating-a-new-app.jpg +[6]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-5-Running-DAML.jpg +[7]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-6-Login-panel-in-DAML-app.jpg diff --git a/published/20220523 Linux Kernel 5.18 Released with Graphics Driver Changes and New Hardware Support.md b/published/20220523 Linux Kernel 5.18 Released with Graphics Driver Changes and New Hardware Support.md new file mode 100644 index 0000000000..1cc8ffd93f --- /dev/null +++ b/published/20220523 Linux Kernel 5.18 Released with Graphics Driver Changes and New Hardware Support.md @@ -0,0 +1,135 @@ +[#]: subject: "Linux Kernel 5.18 Released with Graphics Driver Changes and New Hardware Support" +[#]: via: "https://news.itsfoss.com/linux-kernel-5-18-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "PeterPan0106" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14640-1.html" + +Linux 内核 5.18 版本正式发布,新增显卡驱动以及硬件支持 +====== + +> 最新的 Linux 内核 5.18 版本现已如期发布,本次更新包括针对新硬件的支持以及许多其他核心变化。 + +![Linux kernel 5.18 release][1] + +[Linux 5.17 内核][2] 发布时包含了对下一代硬件的支持,同时增强了 Steam Deck 的游戏体验。 + +每一代内核都包含了令人兴奋的技术进步,Linux 内核 5.18 也不例外。 + +### Linux 内核 5.18 有哪些变化呢? + +本次我们可以看到,内核针对雷蛇外设硬件、苹果妙控键盘和 AMD 显卡增强了支持,还有一些网络、核心和安全方面的更新。 + +#### 新的雷蛇驱动 + +说到游戏装备,Linux 的硬件支持亟待更新。 + +目前存在一些开源驱动程序的变通解决方案。但是这些方案不具有普适性,适配和支持较少。 + +正如 [Phoronix][3] 所发现的,Linux 内核 5.18 中一同发布了一个新的雷蛇 HID 驱动程序,它适配了雷蛇黑寡妇蜘蛛键盘,并修复了宏键此前存在的问题。 + +此外,这个驱动程序应该也有助于解决其他雷蛇硬件的问题。 + +#### AMD 显卡特性 FreeSync 模式被默认开启 + +![][4] + +虽然对 FreeSync 视频的支持足够好,但这只是改善 FreeSync 显示器用户体验的一个临时解决方案。 + +现在在 Linux 内核 5.18 版本中这一显示模式已被默认启用,用户无需调整任何设置即可使用 FreeSync([见更新日志][5])。 + +#### 显卡驱动更新 + +针对当前和未来的 AMD 显卡的驱动进行了改进。此外,支持英特尔 Arch 图形处理器和英特尔 Alder Lake N 的工作也取得了一些进展。 + +更高刷新率的 DisplayPort 也在这一个版本中得到支持。 + +#### 从 C89 标准升级到 C11 标准(GNU11) + +![][6] + +在 Linux 内核中使用的是 C89 C 语言标准,在当前已经稍显老旧并且缺失了许多十分必要的新特性。 + +考虑到目前的编译器版本 GCC 5.1 的要求,从 Linux 内核 5.18 开始决定用 C11 标准来取代它。 + +#### 网络优化 + +Linux 内核 5.18 增加了对新的无线硬件的支持,这包括联发科 MT7916、MT7921U 和博通 BCM43454/6。 + +![][7] + +针对移动设备的改进也包括对英特尔 M.2 WWAN 卡的支持。 + +Realtek W89 驱动现在支持 AP 模式、6GHz 频段并增加了硬件扫描功能。 + +在配置 IPv6 和其他各种协议方面,通过一系列的改进提升了性能。 + +你可以在 Linux 内核 5.18 中网络方面的变更提交中了解所有情况(包括对驱动 API、协议和一些核心功能的改进)。 + +#### USB 改进 + +Xen USB 驱动程序进行了改进,以抵御恶意主设备,USB DWC3 驱动程序也支持了更多的硬件类型。 + +其他改进详见 [更新日志][8]。 + +#### 增强对苹果键盘以及平板的支持 + +![][9] + +当前版本针对苹果妙控键盘(包含第一代型号)的使用体验进行了优化。 + +改进了功能键映射、键盘背光事件,以及 2021 款的妙控键盘通过 USB 连接时报告电池水平的能力。 + +Linux 内核 5.18 改进了输入处理,在平板电脑上输入将变得更为容易。 + +硬件相关的改进详见 [更新日志][10]。 + +#### ARM 架构芯片的支持(特斯拉 FSD,树莓派 Zero 2 W) + +![][11] + +Linux 内核 5.18 现在支持特斯拉的全套自动驾驶 SoC。三星工程师将其贡献到了 Linux 内核上游。 + +其他芯片支持包括高通骁龙 625/632,以及三星 Exynos 850/7885。 + +你还会发现 Linux 内核 5.18 支持了树莓派 Zero 2 W,而同时去除了旧的硬件/主板的支持。详见 [更新日志][12]。 + +你可以参考 [官方更新日志][13] 和 Linus Torvald 的官方公告获取更多信息。 + +### 如何安装 Linux 内核 5.18? + +你可以在 [Linux Kernel Archives][14] 网站上找到最新版本的内核。你可以下载 [Tarball][15] 以进行测试。你也可以参照我们的 [Linux 内核升级指南][16] 获取帮助。 + +如果不想自己编译它,你可以稍等几周,等 Linux 发行版们把它推到仓库。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-kernel-5-18-release/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[PeterPan0106](https://github.com/PeterPan0106) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/kernel-5-18-release.png +[2]: https://news.itsfoss.com/linux-kernel-5-17-release/ +[3]: https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.18-HID +[4]: https://news.itsfoss.com/wp-content/uploads/2022/05/amd-linux-5-18-1024x576.jpg +[5]: https://lists.freedesktop.org/archives/amd-gfx/2022-February/075262.html +[6]: https://news.itsfoss.com/wp-content/uploads/2022/05/c-linux-5-18-1024x576.jpg +[7]: https://news.itsfoss.com/wp-content/uploads/2022/05/networking-linux-5-18-1024x576.jpg +[8]: https://lore.kernel.org/lkml/Yj7vGtn8fILavjyL@kroah.com/ +[9]: https://news.itsfoss.com/wp-content/uploads/2022/05/apple-linux-5-18-1024x576.jpg +[10]: https://lore.kernel.org/lkml/nycvar.YFH.7.76.2203231015060.24795@cbobk.fhfr.pm/ +[11]: https://news.itsfoss.com/wp-content/uploads/2022/05/arm-linux-5-18-1024x576.jpg +[12]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=baaa68a9796ef2cadfe5caaf4c730412eda0f31c +[13]: https://lore.kernel.org/lkml/CAHk-=wjiqyoH6qntYvYTjR1F2L-pHtgX9esZMRS13iktCOJ1zA@mail.gmail.com/T/#u +[14]: https://www.kernel.org/ +[15]: https://git.kernel.org/torvalds/t/linux-5.16.tar.gz +[16]: https://itsfoss.com/upgrade-linux-kernel-ubuntu/ diff --git a/published/20220523 System76 Collaborates with HP for a Powerful Linux Laptop for Developers.md b/published/20220523 System76 Collaborates with HP for a Powerful Linux Laptop for Developers.md new file mode 100644 index 0000000000..ad1edfd55d --- /dev/null +++ b/published/20220523 System76 Collaborates with HP for a Powerful Linux Laptop for Developers.md @@ -0,0 +1,75 @@ +[#]: subject: "System76 Collaborates with HP for a Powerful Linux Laptop for Developers" +[#]: via: "https://news.itsfoss.com/hp-dev-one-system76/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14645-1.html" + +System76 与惠普合作为开发者提供功能强大的 Linux 笔记本电脑 +====== + +> 惠普正在以开箱即用的 Pop!_OS 为特色进入 Linux 硬件市场,貌似有点激动人心?还是先来看一看吧! + +![hp][1] + +System76 不是早就自己生产 Linux 笔记本电脑了吗?那么,这次和惠普合作是怎么回事? + +嗯,这一次是惠普要发行一款 Linux 笔记本电脑,搭载 Pop!_OS,也就是 System76 的基于 Ubuntu 的 Linux 发行版。 + +Carl Richell(System76 的创始人)在他的 Twitter 上宣布了这一消息,并附带了一个网站链接,该网站提供了更多相关信息。推文如下: + +> Hp-Pop 好耶!来看看这个:[https://t.co/gf2brjjUl8][2] + +### HP Dev One:专为开发者打造的 Linux 笔记本电脑 + +一方面,System76 笔记本电脑与 Pop!_OS 有着开箱即用硬件兼容性,因此它备受赞誉。 + +另一方面,Pop!_OS 也与笔记本电脑完美搭配,适配没有太多麻烦。 + +Pop!_OS 也一直在推出更新和新增功能,以改进工作流程并充分利用 Linux 的可用硬件。 + +此时,和惠普合作听起来是一个提高档次的好主意。 + +![HP System76][3] + +所以说,Pop!_OS 和惠普合作的想法有点激动人心啊! + +挂上了惠普这个牌子,笔记本电脑的可用性/保修(在纸面上)就比 System76 要好了,考虑到后者在某些地区是不提供保修的。 + +### AMD 驱动的笔记本电脑可帮助你更好地写代码 + +HP Dev One 似乎是把“为开发者提供多任务处理的能力,从而快速完成任务”作为卖点。 + +这款笔记本电脑的入门款搭载了 **8 核的 AMD Ryzen 7 PRO 处理器** 和 **16 GB RAM**(DDR4 @ 3200 MHz)。 + +预计它还会搭载由 AMD Radeon Graphics 提供支持的 14 英寸全高清防眩光显示屏。 + +对于 HP Dev One,Carl Richell 提到了这款笔记本电脑将通过 [LVFS][5](Linux 供应商固件服务)接收**固件更新**。 + +他还提到,这款笔记本电脑(以上规格)的定价为 **1099 美元** 起。 + +网站上只显示了它即将推出。因此,我们目前还不知道正式的发布日期。 + +对于像惠普这样的商业制造商来说,笔记本电脑的定价听起来并不令人兴奋(LCTT 译注:毕竟不是国内互联网品牌的笔记本),但可能是一个划算的交易。 + +你怎么看这款惠普笔记本电脑(运行 Linux、为开发者量身定制)的定价?你觉得这个价格合理吗?你对这款笔记本电脑有什么期望呢? + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/hp-dev-one-system76/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/hpdevone-laptop.jpg +[2]: https://t.co/gf2brjjUl8 +[3]: https://news.itsfoss.com/wp-content/uploads/2022/05/hpdevone-illustration-1024x576.jpg +[4]: https://fwupd.org/ diff --git a/published/20220525 ProtonMail is Now Just -Proton- Offering a Privacy Ecosystem.md b/published/20220525 ProtonMail is Now Just -Proton- Offering a Privacy Ecosystem.md new file mode 100644 index 0000000000..2676f438a1 --- /dev/null +++ b/published/20220525 ProtonMail is Now Just -Proton- Offering a Privacy Ecosystem.md @@ -0,0 +1,92 @@ +[#]: subject: "ProtonMail is Now Just ‘Proton’ Offering a Privacy Ecosystem" +[#]: via: "https://news.itsfoss.com/protonmail-now-proton/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14652-1.html" + +ProtonMail 改名为 “Proton”,致力于提供一个隐私生态系统 +====== + +> ProtonMail 宣布了重塑后的品牌,包括新网站、新名称、新的定价计划、新的 UI 和其他变化。 + +![proton][1] + +[ProtonMail][2] 将自己重新命名为 “Proton”,以将其所有产品囊括在统一的品牌下。 + +注意,别把它和 Steam 的 Proton(它也简称为 Proton)混淆哦! + +换句话说,ProtonMail、ProtonVPN 和它的任何服务将不再有单独的产品页面。 + +### Proton:一个开源隐私生态系统 + +![更新后的 Proton,统一保护][3] + +Proton 将拥有一个新的统一平台(新网站),你可以在其中访问所有服务,包括: + +* Proton 邮件 +* Proton VPN +* Proton 网盘 +* Proton 日历 + +现在,新的登录会话将会被重定向到 `proton.me` 而不是 `protonmail.com`、`mail.protonmail.com`、`protonvpn.com` 等等。 + +不仅限于名称/品牌,整体的强调色和现有的用户体验,也将受到影响。 + +![][4] + +现在,你只需一次付费订阅即可获得全部服务,而不必单独升级 VPN 和邮件。这也意味着,经过这次改变,高级订阅的价格变得更加实惠了。 + +![][5] + +总体而言,让 “Proton” 成为隐私生态系统,是为了吸引更多对技术细节不感兴趣的用户来了解它是如何运作的。 + +你可以在其新的官方网站([proton.me][6])上查看所有详细信息。 + +新网站看起来更干净、更有条理,并且更具商业吸引力。 + +### 本次更改的内容 + +你可以期待有一个焕然一新的用户界面,包括新的品牌和新的网站。 + +![proton][7] + +除此之外,Proton 还提到它改进了服务之间的集成,以获得更好的用户体验。 + +![][8] + +如果你已经在使用 ProtonMail,你可能知道,他们正在主动建议现有用户激活 “@proton.me” 帐户,这也是本次更改的一部分。 + +你可以选择将新电子邮件地址 xyz@proton.me 设为默认值,它更短,看起来也更有意义一些。 + +* 旧的电子邮件地址不会消失,只是额外提供了新地址(@proton.me)。 +* 现有的付费订阅者应该可以免费获得存储空间提升。 +* 升级了网页和移动应用中的用户体验。 +* 新的官方网站(你将被自动重定向到它以进行新会话)。 +* 新的定价计划,为 Proton 网盘提供更多存储空间。 + +你对本次变更感兴趣吗?你喜欢 Proton 的新名字和新的服务方式吗?请在下方评论中分享你的想法吧! + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/protonmail-now-proton/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/proton-ft.jpg +[2]: https://itsfoss.com/recommends/protonmai +[3]: https://youtu.be/s5GNTQ63HJE +[4]: https://news.itsfoss.com/wp-content/uploads/2022/05/proton-ui-new-1024x447.jpg +[5]: https://news.itsfoss.com/wp-content/uploads/2022/05/proton-pricing-1024x494.jpg +[6]: https://proton.me/ +[7]: https://news.itsfoss.com/wp-content/uploads/2022/05/Proton-me-website.png +[8]: https://news.itsfoss.com/wp-content/uploads/2022/05/Proton-Product.png diff --git a/published/20220526 DeepMind-s Open Source MuJoCo Is Available On GitHub.md b/published/20220526 DeepMind-s Open Source MuJoCo Is Available On GitHub.md new file mode 100644 index 0000000000..4a21ef7ecf --- /dev/null +++ b/published/20220526 DeepMind-s Open Source MuJoCo Is Available On GitHub.md @@ -0,0 +1,59 @@ +[#]: subject: "DeepMind’s Open Source MuJoCo Is Available On GitHub" +[#]: via: "https://www.opensourceforu.com/2022/05/deepminds-open-source-mujoco-is-available-on-github/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14650-1.html" + +DeepMind 的开源物理引擎 MuJoCo 已在 GitHub 发布 +====== + +![deepmind1][1] + +DeepMind 是 Alphabet 的子公司和 AI 研究实验室,在 2021 年 10 月,它收购了用于机器人研发的 MuJoCo 物理引擎,并承诺该模拟器将作为免费、开源、社区驱动的项目进行维护。现在,DeepMind 声称开源计划已完成,它的整个代码库 [可在 GitHub 上获得][2]。 + +MuJoCo 是 “Multi-Joint Dynamics with Contact” 的缩写,它是一个物理引擎,旨在帮助机器人、生物力学、图形和动画等领域的研究和开发(也包括其他需要快速准确模拟的领域)。MuJoCo 可用于帮助机器学习应用实现基于模型的计算,例如控制综合control synthesis状态估计state estimation系统识别system identification机制设计mechanism design、通过逆动力学inverse dynamics来进行数据分析,以及并行采样parallel sampling。它也可以用作标准模拟器,例如用于游戏和交互式虚拟环境。(LCTT 译注:这段话中涉及到不少专业词汇,鉴于译者水平有限,若有谬误,请在评论中指出,同时也欢迎在评论中科普,一起学习~) + +根据 DeepMind 的说法,以下是 MuJoCo 适合协作的一些功能: + +* 能够模拟复杂机制的综合模拟器 +* 可读、高性能、可移植的代码 +* 易于扩展的代码库 +* 丰富的文档,包括面向用户的和代码注释 —— 我们希望学术界和 OSS 社区的同事能够使用这个平台并为代码库做出贡献,从而改善所有人的研究 + +DeepMind 还说: + +> “作为没有动态内存分配的 C 库,MuJoCo 非常快。不幸的是,原始物理速度一直受到 Python 包装器的阻碍:全局解释器锁(GIL)和非编译代码的存在,使得批处理、多线程操作无法执行。在下面的路线图中,我们将解决这个问题。” + +(LCTT 译注: 这里补充了原文没有提及的路线图和基准测试结果。) + +路线图: + +* 通过批处理、多线程模拟释放 MuJoCo 的速度潜力 +* 通过改进内部内存管理支持更大的场景 +* 新的增量编译器,带来更好的模型可组合性 +* 通过 Unity 集成支持更好的渲染 +* 对物理导数的原生支持,包括解析和有限差分 + +> “目前,我们想分享两个常见模型的基准测试结果。注意,这个结果是在运行 Windows 10 的标准 AMD Ryzen 9 5950X 机器上获得的。” + +![基准测试结果][3] + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/deepminds-open-source-mujoco-is-available-on-github/ + +作者:[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/05/deepmind1.jpg +[2]: https://github.com/deepmind/mujoco +[3]: https://assets-global.website-files.com/621e749a546b7592125f38ed/628b971675cb60d74f5fa189_2A54E864-FE90-49E4-8E58-FE40298303E2.jpeg diff --git a/published/20220527 AlmaLinux Continues the Legacy of CentOS with the Release of Version 9.md b/published/20220527 AlmaLinux Continues the Legacy of CentOS with the Release of Version 9.md new file mode 100644 index 0000000000..e2515dc7e9 --- /dev/null +++ b/published/20220527 AlmaLinux Continues the Legacy of CentOS with the Release of Version 9.md @@ -0,0 +1,81 @@ +[#]: subject: "AlmaLinux Continues the Legacy of CentOS with the Release of Version 9" +[#]: via: "https://news.itsfoss.com/almalinux-9-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "PeterPan0106" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14644-1.html" + +CentOS 的继承者 AlmaLinux 9 发布 +====== + +> AlmaLinux 9 是基于 Red Hat Enterprise Linux 9 的最新版本,添加了新的壁纸并进一步增强了性能。 + +![almalinux][1] + +如果你一直在关注我们的话,应当知道 [AlmaLinux 9.0 测试版][2] 已于上月发布。 + +AlmaLinux 是目前 [最好的 RHEL 替代版][3] 之一。其最新的稳定版是基于 RHEL 9 的,这也成为了 CentOS 的一个很好的替代品。 + +最新的 AlmaLinux 9 支持所有主流架构,包括 Intel/AMD(x86_64)、ARM64 (aarch64)、IBM PowerPC(ppc64le)和 IBM Z(s390x)。 + +### AlmaLinux 9.0 有哪些改变呢 + +AlmaLinux 9.0 在这个版本中使用了 Linux 内核 5.14。它包括对云和容器开发的改进,以及对网络控制台的完善。 + +还包括其他变化带来的性能改进。更新包括: + +#### 新壁纸 + +![AlmaLinux 9][4] + +在 AlmaLinux 9.0 中,更新了一些新的壁纸。 + +这些新的壁纸看起来很美观,并提供了更丰富的选择。 + +#### Linux 内核 5.14 + +最大的变化是升级到了 Linux 内核 5.14,它带来了更新的硬件支持,以及其他各种改进。 + +Linux 内核 5.14 的改进详见 [这篇文章][5]。 + +#### 更新的软件包 + +这个版本带有新的软件包更新。其中包括 Git 2.31、PHP 8.0、Perl 5.32 和 MySQL 8.0。 + +GCC 也被更新到最新的 GCC 11。 + +其它更新包括 Python 3.9 和最新版的 LLVM、Rust 和 Go compilers,使应用程序的现代化更快、更容易。 + +更多技术方面的更新详见 [官方更新日志][6]。 + +### 下载 AlmaLinux 9.0 + +你可以在 [官方镜像网站][7] 下载最新的镜像。在镜像站也包含了 .torrent 文件的下载选项。 + +> **[AlmaLinux 9.0][8]** + +*你认为基于 RHEL 的最新版 AlmaLinux 9.0 怎么样呢?你有计划在服务器上迁移到最新的版本吗?欢迎评论。* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/almalinux-9-release/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[PeterPan0106](https://github.com/PeterPan0106) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/alma-linux-9.jpg +[2]: https://linux.cn/article-14500-1.html +[3]: https://itsfoss.com/rhel-based-server-distributions/ +[4]: https://news.itsfoss.com/wp-content/uploads/2022/05/alma-linux-wallpapers-9-1024x609.jpg +[5]: https://news.itsfoss.com/kernel-5-14-release/ +[6]: https://wiki.almalinux.org/release-notes/9.0.html +[7]: https://mirrors.almalinux.org/isos.html +[8]: https://mirrors.almalinux.org/isos.html diff --git a/published/20220527 Tails Linux Users Warned Against Using the Tor Browser- Here-s why!.md b/published/20220527 Tails Linux Users Warned Against Using the Tor Browser- Here-s why!.md new file mode 100644 index 0000000000..4e3c9f8c5e --- /dev/null +++ b/published/20220527 Tails Linux Users Warned Against Using the Tor Browser- Here-s why!.md @@ -0,0 +1,68 @@ +[#]: subject: "Tails Linux Users Warned Against Using the Tor Browser: Here’s why!" +[#]: via: "https://news.itsfoss.com/tails-tor-browser/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14654-1.html" + +Tails 警告用户不要使用 Tor 浏览器:原因如下! +====== + +> Tails 5.1 将针对“可绕过 Tor 浏览器安全措施的危险漏洞”提供关键修复。以下是它的全部内容。 + +![Tails][1] + +Tails 是一个专注于安全的便携式 Linux 发行版,最近,它的开发团队发布了有关其当前版本的重要公告。他们警告用户在 **Tails 5.0 或更早版本** 上使用 Tor 浏览器时,避免输入或使用任何个人或敏感信息。 + +Tor 浏览器是 Tails 事实上的(默认)网页浏览器,它有助于在用户连接到互联网时,保护他们的在线身份。它主要被各种记者和活动家用来逃避审查。不过,普通用户也可以使用它。 + +### 问题说明 + +最近,有人发现了两个令人讨厌的漏洞,它们允许有害网站能够从其他网站窃取用户的信息。 + +具体来说,在 [Mozilla 发布的公告][2] 中,这些漏洞已被确定为 CVE-2022-1802 和 CVE-2022-1529。 + +Tails 公告中也对此进行了说明: + +> “例如,在你访问恶意网站后,控制该网站的攻击者可能会在同一个 Tails 会话期间,访问你随后发送到其他网站的密码或其他敏感信息。” + +### 你应该停止使用 Tail 发行版吗? + +没有这个必要。 + +用户会很高兴地知道,这些漏洞并不影响 Tor 的连接。这意味着,如果你不交换任何敏感信息,如密码、个人信息、信息等,你可以随意地浏览互联网。 + +Tails 中的其他应用程序,尤其是 Thunderbird,仍然可以安全使用,因为 JavaScript 在使用时会被禁用。 + +此外,你也可以在 Tor 浏览器中启用最高的安全级别。这是推荐的,因为(该级别下)JavaScript 引擎会被禁用。不过,请注意,这会使网站无法正常运行。 + +换句话说,如果你知道自己在做什么的话,Tails 发行版仍然可以安全使用。 + +### 漏洞修复即将发布 + +好的消息是,Mozilla 已经在上游修补了这些错误,现在就等 Tails 团队发布修复程序了。 + +至于何时发布,他们是这样说的: + +> 此漏洞将在 Tails 5.1(**5 月 31 日**)中修复,但我们的团队没有能力提前发布紧急版本。 + +因此,你最好的选择是等待下周的 Tails 5.1 发布。你可以阅读 Tails 开发团队的 [官方公告][3] 以了解更多信息。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/tails-tor-browser/ + +作者:[Rishabh Moharir][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/rishabh/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/tails-5-0-privacy-issue.jpg +[2]: https://www.mozilla.org/en-US/security/advisories/mfsa2022-19/ +[3]: https://tails.boum.org/security/prototype_pollution/index.en.html diff --git a/sources/news/20220303 Rocket.Chat and Nextcloud Team up to Offer a Powerful Open-Source Alternative to Office 365, Slack, and Others.md b/sources/news/20220303 Rocket.Chat and Nextcloud Team up to Offer a Powerful Open-Source Alternative to Office 365, Slack, and Others.md deleted file mode 100644 index 60266b2fab..0000000000 --- a/sources/news/20220303 Rocket.Chat and Nextcloud Team up to Offer a Powerful Open-Source Alternative to Office 365, Slack, and Others.md +++ /dev/null @@ -1,103 +0,0 @@ -[#]: subject: "Rocket.Chat and Nextcloud Team up to Offer a Powerful Open-Source Alternative to Office 365, Slack, and Others" -[#]: via: "https://news.itsfoss.com/rocket-chat-nextcloud-collaboration/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Rocket.Chat and Nextcloud Team up to Offer a Powerful Open-Source Alternative to Office 365, Slack, and Others -====== - -**Warning**: Trying to access array offset on value of type null in **/srv/users/itsfoss/apps/newitsfoss/public/wp-includes/class-wp-block-supports.php** on line **94** - -**Warning**: Trying to access array offset on value of type null in **/srv/users/itsfoss/apps/newitsfoss/public/wp-includes/class-wp-block-supports.php** on line **96** - -Rocket.Chat is one of the [best open-source slack alternatives][1] and Nextcloud is an all-in-one collaboration platform. - -And, they are pretty impressive. - -This is why we use [Rocket.Chat][2] for our internal communication and [Nextcloud][3] to manage tasks/documents. Both of them are incredibly useful for what they are capable of. - -And, now, it looks like Rocket.Chat and Nextcloud are taking things up a notch by developing a native API integration. - -But, what would it do? Let us find out. - -### Partnering to Provide a More Powerful Open-Source Platform - -![][4] - -The primary objective of joining forces is to integrate their existing technologies, offering the best of both worlds. - -As far as I am aware, we do not have a full-fledged open-source alternative to Microsoft 365. - -Of course, you can combine various open-source technologies and choose to use them as a replacement for Microsoft 365. - -But do we want an open-source solution that can replace Microsoft 365 minus the hassles? - -**Yes.** - -That’s what makes Rocket.Chat’s collaboration with Nextcloud exciting. - -Nextcloud’s CEO shared his thoughts on this collaboration in the [press release][5]: - -> _In a post-pandemic world, solutions like Office 365, Dropbox, and Slack will become more popular. This means that all of our data, communication, and digital lives will be in the hands of some big corporations without control, privacy and with this huge vendor lock-in_ - -**Frank Karlitschek, Founder and CEO at Nextcloud GmbH** - -To add to his thoughts, Rocket.Chat’s CEO also mentioned the following: - -> _This new interaction between Nextcloud and Rocket.Chat puts us one step closer to building the ultimate open-source alternative to MS 365, giving back privacy and data sovereignty to the users._ - -_Gabriel Engel, Founder, and CEO at Rocket.Chat_ - -So, we should expect a powerful open-source platform tailored for privacy and security-focused users, with both interesting platforms collaborating. - -### New Features for Nextcloud Users - -With the integration, Nextcloud customers will be able to access Rocket.Chat’s features to improve the effectiveness of communication and collaboration. - -Some of the new features include: - - * Expand collaboration capabilities using Rocket.Chat’s federation and bridges into Slack and Microsoft Teams. - * Easily collaborate on projects and documents using Rocket.Chat’s chat right in Nextcloud. - * Use a single productivity platform that integrates with other tools including Nexcloud and keeps all communications and notifications in one place. - * Leverage more advanced user governance features, access levels, and role-based permissions. - * Easily map even the most complex organizational structure into groups, teams, and discussions. - * Securely collaborate and communicate with anyone via the world’s leading social media channels such as Whatsapp, Messenger, Twitter, Instagram, Telegram, and others. - * Turn their chats into productivity tools using integrations with various HR tools, CRM solutions, ticketing systems, project management solutions, and developer tools to build powerful workflows. - * Get access to more services using [Rocket.Chat’s marketplace of apps][6] - * Ensure full governance of all their communications using message audits, flexible retention policies, powerful engagement analytics and dashboards, and more - * Send advanced message formatting like code snippets, formula syntax, message threads, and more - - - -The Rocket.Chat app is now available in the [Nextcloud marketplace][7]. However, it is still a work in progress, and not ready for production yet. - -You should be able to use the new features once the development completes soon enough (mostly, next month). As of now, we do not have any information on any new features being added to Rocket.Chat. Hopefully, there will be something on that with the final release. - -_What are your expectations from this partnership? Do you think Rocket.Chat’s integration with Nextcloud can be an attractive replacement to Office 365, Slack, and Dropbox combined?_ - -Let me know what you think in the comments down below. - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/rocket-chat-nextcloud-collaboration/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/open-source-slack-alternative/ -[2]: https://itsfoss.com/rocket-chat/ -[3]: https://itsfoss.com/nextcloud/ -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ1MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://rocket.chat/press-releases/rocket-chat-and-nextcloud -[6]: https://rocket.chat/marketplace -[7]: https://apps.nextcloud.com/apps/rocketchat_nextcloud diff --git a/sources/news/20220304 Epic Games Store Now Works on Steam Deck.md b/sources/news/20220304 Epic Games Store Now Works on Steam Deck.md deleted file mode 100644 index e833142b74..0000000000 --- a/sources/news/20220304 Epic Games Store Now Works on Steam Deck.md +++ /dev/null @@ -1,89 +0,0 @@ -[#]: subject: "Epic Games Store Now Works on Steam Deck" -[#]: via: "https://news.itsfoss.com/epic-games-steam-deck/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Epic Games Store Now Works on Steam Deck -====== - -Steam Deck is already making waves to enhance the game support for the Linux platform. - -It runs on **Steam OS 3.0** (based on Arch) and features KDE Plasma. Kudos to Valve for not locking down the platform and letting users experiment with it. - -While it is not available for everyone, it is an exciting piece of hardware challenging handheld Nintendo Switch. - -It may not support all the popular titles yet (like Destiny 2, Fortnite), but it is making good progress with several AAA and indie titles. You can head to the official page of [Deck Verified][1] to check the latest information about supported games. - -Now, to make things more exciting, it turns out that Steam Deck can also run games using the [Epic Games Store][2] (**unofficially**). But, how? Let’s find out. - -### Using the Epic Games Store with Heroic Games Launcher - -Yes, it’s the same [Heroic Games launcher][3] that was in the making [last year][4], and it is already known to work on a Linux desktop. - -And, thanks to Liam Dawe (via [GamingOnLinux][5]), for successfully testing the Heroic Games Launcher (and [Heroic Bash Launcher][6]) on Steam Deck while coordinating with the respective developers. - -![][7] - -If you’re curious: **Heroic Bash Launcher** _is a tool that creates launch scripts (.sh files) for all installed Heroic games and allows you to launch the game directly from the terminal or game frontend/launcher without having any need to open Heroic._ - -Here’s how it all went down (as per my brief chat with the developer of Heroic Bash Launcher): - -Initially, with Epic Games Store experiment on Steam Deck, the Steam controller did not work, considering the Epic Games Store ran as a “Non-Steam game” using the Steam client. - -So, the developer of Heroic Bash Launcher, [Rishabh Moharir][8] (also a fellow writer here) suggested using his tool to make it work by following his [wiki guide on GitHub][9]. - -The Heroic Bash Launcher works with Epic Games Store on a Linux desktop. So, it was worth a try! - -And, fortunately, it worked! - -### Installing Epic Games Store on Steam Deck - -First, you need to install the **Heroic Games Launcher** on Steam Deck using the available AppImage file in the **Desktop mode**. - -Once done, you need to log in and download the game of your choice. - -Next, you need to download the latest binary files for [legendary][10] and set it as the alternative legendary binary from the launcher’s settings. - -You need to configure and set the compatibility layer to Proton 7.0 from the game settings in the launcher. - -That’s when you need to download the latest [Heroic Bash Launcher binary][11] and run it. - -Finally, you have to add the game to Steam (to find it in Steam Deck’s UI) following the [official wiki guide on GitHub][9]. - -Overall, it sure took a while for tinkerers to make it work. And, if you are still confused, you can find the same set of steps with all the details in the [wiki][12] put together by the Heroic Games Launcher team (or refer to the video above). - -To me, it sounds doable and should not be an overwhelming process for most Steam Deck users as of now. Unfortunately, I can’t get my hands on the Steam Deck in India (yet). - -As for the future of Epic Games Store on Steam Deck, we can only hope for the best! - -_Have you tried Steam Deck yet? Let me know your thoughts in the comments down below._ - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/epic-games-steam-deck/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://www.steamdeck.com/en/verified -[2]: https://www.epicgames.com/store/en-US/ -[3]: https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher -[4]: https://news.itsfoss.com/heroic-games-launcher/ -[5]: https://www.gamingonlinux.com/2022/03/heroic-games-launcher-now-works-nicely-on-steam-deck/ -[6]: https://github.com/redromnon/HeroicBashLauncher -[7]: https://i0.wp.com/i.ytimg.com/vi/UvuGAQDagWE/hqdefault.jpg?w=780&ssl=1 -[8]: https://news.itsfoss.com/author/rishabh/ -[9]: https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/wiki/Adding-Games-to-Steam-on-Linux -[10]: https://github.com/derrod/legendary/releases/ -[11]: https://github.com/redromnon/HeroicBashLauncher/releases/ -[12]: https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/wiki/SteamDeck---Running-Epic-Games diff --git a/sources/news/20220527 TypeScript Based Headless CMS -Payload- Becomes Open Source.md b/sources/news/20220527 TypeScript Based Headless CMS -Payload- Becomes Open Source.md new file mode 100644 index 0000000000..0e99f3c1d1 --- /dev/null +++ b/sources/news/20220527 TypeScript Based Headless CMS -Payload- Becomes Open Source.md @@ -0,0 +1,79 @@ +[#]: subject: "TypeScript Based Headless CMS ‘Payload’ Becomes Open Source" +[#]: via: "https://news.itsfoss.com/payload-open-source/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +TypeScript Based Headless CMS ‘Payload’ Becomes Open Source +====== +A new option added to the list of open-source headless CMS. Now, a better headless WordPress alternative? + +![payload][1] + +Since its first beta release a little over a year ago, Payload has slowly built a name for itself within the web development community as a headless Content Management System (CMS). For a bit of background information, Payload is a CMS tailored specifically toward being simpler to develop websites, web apps, or native applications. + +Recently, they decided to go completely open-source, putting it among the likes of some of the [best open-source CMS available][2]. + +However, that raises some questions, like what will their business model look like? And what are the plans for Payload CMS? Let’s take a brief look. + +### Why Has Payload Gone Open-Source? + +Since its initial launch back in 2021, Payload has received many contributions from the open-source community. As Payload said in their [recent announcement][3], the decision to go open-source is massive, and it allows projects to read much greater heights than could ever be possible if kept behind closed doors. + +![][4] + +In addition, this openness often results in much greater levels of trust from the developer community. This trust also extends to businesses, naturally turning to the platform with the greatest developer support and trust. + +Due to all these reasons, Payload is now switching to the MIT license. This allows anyone to modify, distribute, and use Payload for free and without limitations. + +However, Payload still needs money flowing in to operate sustainably. So, that begs the question, how will Payload make money? + +### How Payload Is Going To Make Money? + +As is always the case, Payload requires some financial backing to remain afloat. They have outlined a two-part plan that should both provide users with even more convenience-focused features while still leaving self-hosted customers incredible flexibility. + +![][5] + +#### Enterprise Licenses + +This option is extremely similar to other open-source CMS software services. These licenses would provide more advanced SSO options and give the developers guaranteed response times from the core Payload team. + +These licenses should look appealing to larger corporations, especially those that require the utmost reliability. + +#### Cloud Hosting + +This option is quite attractive, as it combines multiple services to create the most convenient experience possible. Although traditional hosting remains reasonably easy, as soon as you add in a database, permanent file storage, and deliberate infrastructure for Node apps, you are left with four or five different services that all need to work seamlessly together. + +It should be noted that this is not required, and users are still encouraged to host their instances. However, this service simply takes a lot of the expenses and challenges associated with hosting out of the equation. + +As of now, things haven’t been finalized. But, you can keep an eye on the discussions on [GitHub][6] to keep up with it. + +### Wrapping Up + +As an emerging CMS option, it is great to see Payload take this step to become a popular alternative to WordPress and other options. Additionally, it appears to me that the Payload team is confident in their new business model, signifying a (hopefully) bright future for them. + +[Payload CMS][7] + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/payload-open-source/ + +作者:[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/05/payload-opensource.jpg +[2]: https://itsfoss.com/open-source-cms/ +[3]: https://payloadcms.com/blog/open-source +[4]: https://news.itsfoss.com/wp-content/uploads/2022/05/payloadcms-demo.png +[5]: https://news.itsfoss.com/wp-content/uploads/2022/05/payload-free-opensource-1024x576.jpg +[6]: https://github.com/payloadcms/payload +[7]: https://payloadcms.com/ diff --git a/sources/talk/20190131 OOP Before OOP with Simula.md b/sources/talk/20190131 OOP Before OOP with Simula.md index 84d24bbc93..5af32716d9 100644 --- a/sources/talk/20190131 OOP Before OOP with Simula.md +++ b/sources/talk/20190131 OOP Before OOP with Simula.md @@ -2,7 +2,7 @@ [#]: via: "https://twobithistory.org/2019/01/31/simula.html" [#]: author: "Two-Bit History https://twobithistory.org" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "aREversez" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -187,7 +187,7 @@ via: https://twobithistory.org/2019/01/31/simula.html 作者:[Two-Bit History][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[aREversez](https://github.com/aREversez) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/sources/talk/20190331 Codecademy vs. The BBC Micro.md b/sources/talk/20190331 Codecademy vs. The BBC Micro.md index 2bd822cd18..bb5ee313c8 100644 --- a/sources/talk/20190331 Codecademy vs. The BBC Micro.md +++ b/sources/talk/20190331 Codecademy vs. The BBC Micro.md @@ -2,7 +2,7 @@ [#]: via: "https://twobithistory.org/2019/03/31/bbc-micro.html" [#]: author: "Two-Bit History https://twobithistory.org" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "yesimmia" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " diff --git a/sources/talk/20211213 How I use open source to design my own card games.md b/sources/talk/20211213 How I use open source to design my own card games.md deleted file mode 100644 index 09da50e09e..0000000000 --- a/sources/talk/20211213 How I use open source to design my own card games.md +++ /dev/null @@ -1,112 +0,0 @@ -[#]: subject: "How I use open source to design my own card games" -[#]: via: "https://opensource.com/article/21/12/open-source-card-game" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How I use open source to design my own card games -====== -Open source isn't just about software. It's a cultural phenomenon, a -natural fit for tabletop games. -![Deck of playing cards][1] - -I love a good game, and I particularly enjoy tabletop games because they have many of the same traits that open source has. When you're playing a card game in real life with friends sitting around a table, you can as a group decide that Jokers are wild. Alternately, you could arbitrarily decide that should a Joker come into play, anyone holding an Ace must discard that Ace. Or when a Queen of Diamonds comes into play, everyone must pass their hand to the player on their right. In other words, you can reprogram the rules on a whim because a game is nothing but a mutually agreed-upon set of conditions. To me, what's even better is that you can invent your own games instead of hacking the rules of somebody else's game. From time to time, I do this as a hobbyist, and because I like to combine my hobbies, I tend to design games with only open source and open culture resources. - -First of all, it's important to understand that there are, broadly, two facets of a game: _flavor_ and _mechanics_. The flavor is the story and theme of the game. The mechanics of a game are the rules and the condition of play. The two aren't always completely separate from one another, and there's an elegance to designing a game themed around race cars, for instance, with rules that demand players to perform actions very quickly. However, the flavor and mechanics are just as often treated separately, and it's entirely reasonable to invent a game that _could_ be played with a standard deck of poker cards, but that's themed around space llamas, just for the fun of it. - -### Open source artwork - -If you've ever gone to a museum of modern art, you've probably found yourself standing in front of a canvas painted solid blue and overheard somebody utter this time-honored phrase: "Heck, I could make that!" But the truth is, artwork is hard work. Making art that's pleasing to the eye takes a lot of thought, time, confidence, and skill, so it makes sense that the art is one of the most difficult things to procure for a game you're designing. - -I have a few "hacks" on dealing with this classic snag. - -#### 1\. Find common ground - -There's free and open art out there, and a lot of it is very good. The problem is that games usually need more than one art piece. If you're designing a card game, you probably need at least four or six distinct elements (assuming your cards follow the foundations laid out by the Tarot deck) and possibly more. If you spend enough time on it, you can find [Creative Commons and Public Domain][2] artwork online on sites like [OpenGameArt.org][3], [FreeSVG.org][4], [ArtStation.com][5], [DeviantArt.com][6], and many others. - -If the site you're using doesn't have a Creative Commons search, enter the following words into any search engine, "This work is licensed under a Creative Commons" (the quotes are important, so don't leave those off) and whatever syntax your favorite search engine uses to limit the search to just one site (for example, **site:deviantart.com**). - -Once you have a pool of art to choose from, sort the art that you've found by identifying common themes in the artwork. Two pictures of robots by two different people might look nothing alike, but they're still both robots. Provided you have enough robot-themed art, you can structure the flavor of your game around robots. - -#### 2\. Commission Creative Commons art - -You can hire artists to make custom art for you. I work with artists who use open source paint programs like [Krita][7] and Mypaint, and as part of the contract, I specify that the art must be licensed under a Creative Commons Attribution Share-alike (CC BY-SA) license. I've only ever had one artist decline the offer because of the license restriction, and most are happy for their artwork to have a potentially larger life than just as part of a hobbyist's self-published game. - -#### 3\. Make your own - -As a trip to the museum of modern art reveals, art is a very flexible term. I've found that as long as I give myself a goal of how many cards or tokens for a game I need to create, I can usually produce something with one of the many graphical creative tools available on Linux. It doesn't have to be anything fancy. Just like modern art, you can paint a card with blue and yellow stripes, another with red and white polka-dots, another with green and purple zig-zags, and nobody but you will ever know that you secretly meant for them to be the lords and ladies of the fairy court, except that you don't know how to draw those. Think about all the simple things you can create in a graphics application, or by tracing photographs of everyday objects, or by remixing classic Poker suits, or Tarot themes, and so on. - -### Layout - -I use [Inkscape][8], Scribus, or [GIMP][9] for layout, depending on what my assets are and what manner of design I'm after. - -For cards, I find that a simple layout is easy to do and look at, solid colors tend to print better than gradients, and intuitive iconography is best. - -![layout in Inkscape][10] - -(Seth Kenlon, CC BY-SA 4.0) - -I did the layout in a single Inkscape file for my latest game, which uses just nine images from three or four different artists on OpenGameArt.com. I design the layout of each card in its own file for games with a more extensive set of art and card variety. - -Know your target output before you do any layout for your game assets. If you're going to print your game at home, then do the math and figure out how many cards or tokens or tiles you can fit on your default paper size (US Letter for some, A4 for everybody else). If you're printing with a game printer like [TheGameCrafter][11], download the template files. - -![printed cards][12] - -(Seth Kenlon, CC BY-SA 4.0) - -### Mechanics - -Game mechanics are the most important part of a game. They're what makes the game a game. Developing rules for a game doesn't have to be a formal process. You can come up with a game on a whim, or take a game that exists and remix its rules until it's something different, fix a game that just doesn't work for you, or mash two different games together. Start simple, using index cards, standard playing cards, or a Tarot deck to mock up how you think your game will work. You can play early game ideas by yourself, but eventually, getting a friend to help is a great way to introduce surprise glitches and optimizations. - -Playtest often. Play your game with a diverse set of players, and listen to their feedback. Your game might inspire many players to invent new rules and ideas, so separate feedback about what's _broken_ from feedback about what _could be different_. You don't have to implement feedback that just iterates your idea, but give careful thoughts to the bug reports. - -Once you've decided how you want your rules to work, write them down to make them [short and easy to parse][13]. Your rules don't have to convince players to play the game, you don't have to explain the strategy to them, nor do you need to give permission to players to remix the rules. Just tell the players the sequence of steps they need to take in order to make the game work. - -Most importantly, consider making your rules open source. Gaming is all about shared experiences, and that ought to include the rules. A Creative Commons or Open Game License ruleset allows other gamers to iterate, remix, and build upon your work. You never know, somebody might come up with a variant that you enjoy more than your own! - -### Open source gaming - -Open source isn't just about software. It's a cultural phenomenon, a natural fit for tabletop games. Take a few evenings to experiment with creating a game. If you're new to it, start with something simple, like this blank card activity: - - 1. Gather up some friends. - 2. Give each person a few blank index cards, and tell them to write a rule on each card. The rule can be anything ("If you're wearing something red, you win" or "The first person to stand up wins," and so on.) - 3. On your own index cards, write _and_, _but_, _or_, _but not_, _and not_, _except_, and other conditional phrases. - 4. Shuffle your deck and deal the cards to all players. - 5. Each player may play one card per turn. - 6. The goal is to win, but players may play the _and_, _but_, and _or_ cards to modify the conditions of what determines the winner. - - - -It's a fun party game and a nice introduction to thinking like a game designer because it helps you recognize what tends to work as a game mechanic and what doesn't. - -And, of course, it's open source. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/12/open-source-card-game - -作者:[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/rich-smith-unsplash.jpg?itok=uzzS0gRa (Deck of playing cards) -[2]: https://opensource.com/article/20/1/what-creative-commons -[3]: https://opensource.com/article/21/12/opengameart.org/ -[4]: http://freesvg.org -[5]: http://artstation.com -[6]: http://deviantart.com -[7]: https://opensource.com/article/21/12/krita-digital-paint -[8]: https://opensource.com/article/21/12/linux-draw-inkscape -[9]: https://opensource.com/content/cheat-sheet-gimp -[10]: https://opensource.com/sites/default/files/inkscape-layout.jpg (Layout in Inkscape) -[11]: https://www.thegamecrafter.com/ -[12]: https://opensource.com/sites/default/files/cards-printed_0.jpg (Printed cards) -[13]: https://opensource.com/life/16/11/software-documentation-tabletop-gaming diff --git a/sources/talk/20220212 5 levels of transparency for open source communities.md b/sources/talk/20220212 5 levels of transparency for open source communities.md deleted file mode 100644 index a2f7ae1545..0000000000 --- a/sources/talk/20220212 5 levels of transparency for open source communities.md +++ /dev/null @@ -1,111 +0,0 @@ -[#]: subject: "5 levels of transparency for open source communities" -[#]: via: "https://opensource.com/article/22/2/transparency-open-source-communities" -[#]: author: "Emilio Galeano Gryciuk https://opensource.com/users/egaleano" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -5 levels of transparency for open source communities -====== -Open source community managers need to apply these 5 levels of -transparency to build a thriving open source community. -![Person in a field of dandelions][1] - -Managers of open source communities have to be aware of the 5 levels of transparency that they can provide. These 5 levels of transparency are important for building a thriving open source community.  - -This article describes each level, its goals, and why they are important. But first, I revisit why transparency is important for open source ecosystems. - -### Why do open source ecosystems need transparency? - - * Transparent communities inspire trust** **in each other, which greases the wheels of collaboration. - * Communities work together and exchange messages in the open. - * Open source work happens in a transparent way to avoid friction. - * Community managers need to report to their stakeholders. - * Showing communities what information is available about them is healthy and encourages trust. - - - -### What are the 5 levels of transparency? - -#### Transparency level 1: Publish source code - -This level is about releasing source code under an [Open Source Initiative (OSI)-approved license][2] in a public-facing version control system like [Git][3]. - -The first level's goal is to establish** **an open source project. - - * This level is self-evident as there would be no open source project without the source code. - * At the core of an open source project is the source code that people engage with—licensed under an OSI-approved license. - * A public version control system enables collaboration and allows everyone to analyze the project and understand the collaboration patterns. - - - -#### Transparency level 2: Publish community guidelines - -You publish documentation and resources on contributing at this level, and you organize special events to educate the community. - -The second level's goal is to create and grow a community for an open source project. - - * Building an active community requires more than** **just having a source code**.** - * Being transparent about how a project works and how to contribute enables others to join a project**.** - * Growing the community may involve** **running events and doing special activities for contributors. - - - -#### Transparency level 3: Celebrate successes - -Once you reach this level, it's important to share insights about the community and publish reports about the project's status. - -The third level's goal is to celebrate successes and secure further support** **beyond the initial phase of the community. - - * As open source communities grow, it becomes harder to know what's happening everywhere. - * Being transparent about the activities in the community helps community members know that their contributions are being seen and valued. - * At this level of transparency, the reporting and analytics** **are sporadic and without specific tooling.  - - - -#### Transparency level 4: Understand the pulse of the community - -This level is all about listening to the community—keeping an eye on the project's evolution in community activity and the software development process to take corrective actions. - -The fourth level's goal is to take the community to the next level by understanding its evolution and trajectory with consistency and scientific rigor. - - * Reporting mechanisms and analytics tools help keep an eye on what is happening. - * You can compare events in the community and the subsequent reactions of community members to a baseline and other events in the community. - * Deeper insights into the community are possible with consistent listening. - - - -#### Transparency level 5: Maintain the community long-term - -The last step is acting on community metrics and improving community engagement. - -The fifth level's goal is to make meaningful and impactful decisions about community engagement. - - * Have systems in place to** **react to changes** **in community metrics. - * Follow up on how changes to the community are showing up in the metrics and analytics about the community. - * Set "SLAs" and accountability for maintainers or developers to have goals for their community engagement and at a system level makes sure things get done. - - - -### Wrap up - -Open source community managers need to apply these 5 levels of transparency to build a thriving open source community. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/2/transparency-open-source-communities - -作者:[Emilio Galeano Gryciuk][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/egaleano -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_dandelion_520x292.png?itok=-xhFQvUj (Person in a field of dandelions) -[2]: https://opensource.org/licenses -[3]: https://opensource.com/tags/git diff --git a/sources/talk/20220216 Everything You Need to Know About Mozilla and Meta (Facebook) Working Together.md b/sources/talk/20220216 Everything You Need to Know About Mozilla and Meta (Facebook) Working Together.md deleted file mode 100644 index 54a7d9885d..0000000000 --- a/sources/talk/20220216 Everything You Need to Know About Mozilla and Meta (Facebook) Working Together.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: subject: "Everything You Need to Know About Mozilla and Meta (Facebook) Working Together" -[#]: via: "https://news.itsfoss.com/mozilla-meta-facebook/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "sthwhl" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Everything You Need to Know About Mozilla and Meta (Facebook) Working Together -====== - -I’m sure it is easy to make several assumptions about the story going by the headlines. - -_Why?_ - -Well, it is **Facebook**, after all. - -Even if it is “**Meta**” now, it does not change the fact that they were involved in some of the worst privacy practices ever. - -If you think twice, Facebook isn’t an ideal privacy-focused social media platform (even though I still use it for certain use-cases). - -_With so much more to complain about, how come a privacy-focused company “Mozilla” end up working with Meta (Facebook)?_ - -Surprisingly, Mozilla made several remarks about Facebook’s bad privacy practices in the past. - -Not to forget, Mozilla Firefox was one of the first web browsers to prevent companies like Facebook from tracking users thanks to [total cookie protection][1] and some other technologies. - -Furthermore, they recently started a study collaborating with **The Markup** to analyze the type of information Facebook collects. - -So, why are they working with Facebook now? - -### Privacy-Preserving Attribution Using IPA - -Mozilla revealed in a [blog post][2] that it has been working with a team from Meta on a new proposal about a privacy-respecting attribution. - -Attribution in advertising lets the advertisers/marketers know if their ad campaigns are performing as expected. - -And, Mozilla plans to introduce **Interoperable Private Attribution** (or IPA) to give advertisers the ability to check insights while making the advertising privacy-friendly. - -### How Does IPA Aim to Make Advertising Privacy-Friendly? - -Mozilla is utilizing its expertise with its existing privacy-preserving telemetry technology, [Prio][3]. - -While that sounds promising, how does IPA work? - -As described in the blog post, Mozilla says that IPA offers two privacy-preserving features: - - * It uses Multi-party Computation (MPC) to prevent a single entity (browser, advertisers, or websites) to learn about user behavior. - * Instead of individual results linking to a track/profile users, IPA is an aggregated system that does not link back anything to individual users. - - - -Technically, they plan to use “match keys” that are different from cookies but can be used across different browsers/devices to be able to generate useful reports. - -These match keys will help produce summary statistics about the ad interaction events (whether it is clicked, seen, and if it made a conversion). - -As per the proposal, the match keys would be writable but not readable, making it a critical component of the privacy properties in IPA. - -### Is This Useful? - -Taking a good look at its [proposal][4], it is safe to say that it sounds promising. - -Considering ad revenue is still the major fuel for most businesses, it only makes sense to make it privacy-friendly and less intrusive. - -The result could simply bring back the good old days when users weren’t worried about advertising but curious about what they see in them. - -Unlike [Google’s FLoC][5], this can create a win-win scenario for both advertisers and the users as well. - -### How Does Meta Fit in the Picture? - -![][6] - -I am really not sure about this. - -I have no intention of making ill-informed remarks about the technology proposed by Mozilla, collaborating with Meta. - -On the other hand, I can’t be confident about it, considering they chose “Meta” to collaborate on something that is important to improve the advertising industry without harming user privacy. - -### Mozilla, What Are You Hiding? - -I’m not stirring up controversy (or a wild theory). - -But, a transparent, and privacy-respecting company just decided to collaborate with a company that isn’t really known for privacy? - -Isn’t it too obvious that the team at Mozilla already knows this? - -And, they still decided to go ahead with it, without any transparent public communication on their social media channels as well. - -Yes, they did publish the blog post, but it wasn’t promoted, considering it is an important proposal affecting almost every industry on the web. - -_Is it safe to assume that Mozilla no longer cares about its userbase with this move?_ - -_It’s totally up for discussion in the comments down below!_ - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/mozilla-meta-facebook/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[sthwhl](https://github.com/sthwhl) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/firefox-86-release/ -[2]: https://blog.mozilla.org/en/mozilla/privacy-preserving-attribution-for-advertising/ -[3]: https://crypto.stanford.edu/prio/ -[4]: https://docs.google.com/document/d/1KpdSKD8-Rn0bWPTu4UtK54ks0yv2j22pA5SrAD9av4s/edit -[5]: https://techcrunch.com/2022/01/25/google-kills-off-floc-replaces-it-with-topics/ -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= diff --git a/sources/talk/20220308 5 Things to Know When Someone Says Linux is Tough.md b/sources/talk/20220308 5 Things to Know When Someone Says Linux is Tough.md deleted file mode 100644 index 0739b7044a..0000000000 --- a/sources/talk/20220308 5 Things to Know When Someone Says Linux is Tough.md +++ /dev/null @@ -1,174 +0,0 @@ -[#]: subject: "5 Things to Know When Someone Says Linux is Tough" -[#]: via: "https://news.itsfoss.com/things-to-know-linux-is-tough/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -5 Things to Know When Someone Says Linux is Tough -====== - -Linux is the least popular desktop operating system (OS) when considering Windows, macOS, and Linux as our only choices. - -Linux powers most of the servers, but that is not the case for consumer desktops/laptops. - -To make things worse, many assume that Linux is tough from other experiences, even without giving it a try. - -But, is it? If yes, what exactly do people refer to as tough? - -### Is Linux Tough to Learn? - -Unlike Windows and macOS, several things are fundamentally different for Linux (here, Linux distributions). - -Yes, Linux distributions offer [advantages over Windows][1] and [macOS][2] with all the differences accounted for. - -Moreover, you can perform almost all the essential tasks on a Linux desktop. In some cases, Linux operating system offers a similar user interface to Windows/macOS, making things convenient. - -**Don’t believe me?** Check out some [Windows-like Linux distributions][3]. - -So, what do users find challenging? - -Here, I will discuss the points that new users generally find difficult, which should help you realize that Linux is not as tough as you thought. - -### 1\. Software Installation and Package Management - -![][4] - -There are different methods to install the software (or a package) for Linux. - -You can install it from the software center or the terminal, or download the package from the official source to install it manually. - -Or, you can even [compile it from the source][5]. - -Unlike Windows/macOS, it is not just about executables (EXE) or **dmg** files. - -Depending on the type of Linux distribution, the package support changes. For instance, you can [install DEB files on Ubuntu][6]. - -And, if you use Fedora as your desktop OS, you will have to [install RPM files][7]. - -To make things simpler, [Flatpak packa][8][g][8][es][8] and Snaps came into existence. If you find a Flatpak package or Snap version of an app available, you can install it on any Linux distribution. - -However, you might need to [set up the support for Flatpak][9] and [Snap][10] if your Linux distribution does not have it by default. - -So, you will have to understand that due to the diversity of Linux distributions, there are various installation methods and packages available. As long as you know the supported packages and the installation methods, it should be easy. - -### 2\. The Terminal Panic - -![][4] - -With Windows/macOS, you may not need to launch the terminal or the command prompt often. - -Yes, a few troubleshooting solutions need access to the command line. But, not as often compared to Linux. - -With Linux, even when using [some of the best Linux distributions][11], you will often need to access the terminal and type some commands for tasks like: - - * Refreshing the repository list - * Removing a software not installed via software center - * Adding a repository to install software - - - -Technically, you do not have to learn any complex commands, but knowing a few of them to quickly uninstall a package, install a flatpak app, and so on can come in handy. - -Typically, you will have the commands/instructions from the official site of any app you attempt to install. In some cases, when setting out to troubleshoot, you will find the exact command to type in from the community forums. - -So, you do not need to “remember” anything, and a quick search on the internet should help you with it. - -However, this can be overwhelming to some users, so they do not make an effort and avoid trying Linux on their computer. - -Eventually, they lose interest in exploring anything else related to Linux. - -### 3\. Installing Graphics Drivers - -![][4] - -While macOS does not bother with third-party graphics support, it does not support proper virtualization (especially ARM) and gaming. So, we shall exclude that and focus on Windows. - -Both Windows and Linux support gaming/virtualization. And, you need to install graphic drivers to make these things work, if not just for watching streams/videos. - -With Windows, you need to download the respective driver for your graphics card and get it installed. You do not encounter issues with the first-time installation for the most part. - -However, for Linux, the latest graphic driver version does not always work (especially NVIDIA). So, it is not as simple as downloading from the official website and installing it. - -If your Linux distribution features a driver manager (like Linux Mint), it makes things easy. - -If not, you might have to look for an ISO file for the OS you like with supported graphic drivers included. - -Overall, installing graphics drivers is not a big deal if you are using a mainstream Linux distribution, but if you choose a different distribution, you may have to research before you install it on bare metal. - -### 4\. Software Support - -You do not find support for all Windows/macOS applications on Linux. - -If the service offers cross-platform support, chances are it supports Linux distributions like Ubuntu, Fedora, and Arch. Otherwise, you will have to search for alternatives. - -So, the lack of software availability makes Linux an incredibly unsatisfying experience. - -However, we have an extensive [list of essential applications][12] that can give you a head start. - -Unfortunately, not everyone is aware of it. And some users remain reluctant to try an alternative. - -### 5\. Tweaking Peripherals and Components - -![][4] - -It is not just about the usability and apps available. It is also about the ability to manage and tweak hardware devices connected to your computer. - -Linux does not have official software support from various hardware brands like Razer, Corsair, ASUS, etc. - -So, when users realize that they cannot manage their RGB lighting, fan profiles, and cooling devices as conveniently as they expected, Linux is out of their wishlist. - -However, you should know that there are tools that already help with it, things like: - - * [Configuring a gaming mouse][13] - * [Tweaking a razer peripheral][14] - * [Controlling and monitoring cooling devices][15] - - - -Yes, it may not be official, but it works with a wide range of peripherals and components. So, if the lack of official support for peripherals and component monitoring stopped you from trying Linux, now you can give it a try with these solutions! - -### Wrapping Up - -For starters, I think these are the most common things that prevent users from trying Linux and end up declaring it as the most challenging operating system. - -You will have to keep in mind that trying a different operating system always comes with new challenges and a learning curve. - -Linux as a desktop operating system is easier than ever before. Linux distributions like **Ubuntu, Pop!_OS, Linux Mint, Linux Lite**, and many more have made it possible for new users to feel right at home. - -Even with all the improvements, it can be overwhelming for some users, which is why we wanted you to know that it is not as problematic as you originally assumed. - -_If you have a friend who still has not tried Linux for the reasons mentioned above, I recommend you to share this along and help them know better to make an informed choice._ - -_Let me know your thoughts in the comments below._ - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/things-to-know-linux-is-tough/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/linux-better-than-windows/ -[2]: https://itsfoss.com/linux-vs-mac/ -[3]: https://itsfoss.com/windows-like-linux-distributions/ -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://itsfoss.com/install-software-from-source-code/ -[6]: https://itsfoss.com/install-deb-files-ubuntu/ -[7]: https://itsfoss.com/install-rpm-files-fedora/ -[8]: https://itsfoss.com/what-is-flatpak/ -[9]: https://itsfoss.com/flatpak-guide/ -[10]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/ -[11]: https://itsfoss.com/best-linux-distributions/ -[12]: https://itsfoss.com/essential-linux-applications/ -[13]: https://itsfoss.com/piper-configure-gaming-mouse-linux/ -[14]: https://itsfoss.com/set-up-razer-devices-linux/ -[15]: https://itsfoss.com/coolero/ diff --git a/sources/talk/20220319 What-s the Fuss About GNOME-s Libadwaita Library in Linux World.md b/sources/talk/20220319 What-s the Fuss About GNOME-s Libadwaita Library in Linux World.md new file mode 100644 index 0000000000..6c080d9828 --- /dev/null +++ b/sources/talk/20220319 What-s the Fuss About GNOME-s Libadwaita Library in Linux World.md @@ -0,0 +1,93 @@ +[#]: subject: "What’s the Fuss About GNOME’s Libadwaita Library in Linux World?" +[#]: via: "https://news.itsfoss.com/gnome-libadwaita-library/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What’s the Fuss About GNOME’s Libadwaita Library in Linux World? +====== + +Back in March 2020, the GNOME project announced a new library called Libadwaita. This promised to fix numerous fundamental issues with GTK, the library GNOME uses to build its desktop environment. + +Unfortunately, this announcement also resulted in some significant community backlash. While this hasn’t really slowed the adoption of Libadwaita, it seems that some users are now starting to boycott GNOME because of it. + +But what impact does Libadwaita have in the real world? And how does this differ for users and developers? + +### Main Features Of Libadwaita + +While it was originally meant to be a solution to the many GNOME-specific libraries developers needed to use, it has since grow into much more. As Adrian Plazas said in his [blog][1]: + +> GNOME needs a blessed library implementing its HIG (Human Interface Guidelines) rapidly, developed in collaboration with its design team. +> +> […] +> +> To solve both GTK’s need of independence and GNOME’s need to move faster, we are creating the libadwaita project. This new libadwaita library intends to extend that concept by being the missing code part of Adwaita. The library will be implemented as a direct GTK 4 continuation and replacement of libhandy, and it will be developed by libhandy’s current developers. + +Adrian Plazas + +Basically, Libadwaita is meant to be a GNOME-specific version of GTK4, with the GNOME project in complete control of the look and feel of apps. However, it also incorporates a number of other features: + + * Adaptive widgets so that apps can work on both desktops, laptops, tablets, and smartphones (like the PinePhone) + * New Adwaita version, following the latest trends in UI design + * Built-in styles for buttons and other widgets + * Built-in in-app notifications + * Improved and more customizable animations + * Speed and fluidity improvements + + + +While all these features are awesome, a select few have divided the community, mostly between developers and users. As someone who has made a number of small little projects with Libadwaita and GTK3 (without Libadwaita), as well as a GNOME user, I want to talk about the different perspectives of different people. + +### User Perspective + +![][2] + +Unfortunately, Libadwaita has been met by immense backlash by some GNOME users. This all stems from one key change in Libadwaita: The inability to theme it. This is because the Adwaita theme is built right into Libadwaita, meaning that it would need to be recompiled every time the theme was changed. + +This is a fundamental aspect of Libadwaita, for better or for worse. As a result, some users have decided that this is an attempt by GNOME to lock down their app ecosystem. + +However, this does not mean that Libadwaita is dead in the water. From the very beginning, the GNOME developers have been adamant that a theming API would come soon, and it looks like this will happen. + +While this wouldn’t solve the issue of incompatibility of existing GTK and GNOME themes, it would solve some more fundamental issues. As has been said numerous times, the CSS theming that GTK currently users is much more of a band-aid fix to the problem of theming than a permanent solution. And, as with many open-source projects, this band-aid fix has been built upon to the extent now that there is very little chance of going back. + +Libadwaita would go some steps to fixing this, but at the cost of the existing app ecosystem. With all this hate, however, developers continue to implement it. Why might this be? + +### Developer Perspective + +![][2] + +As you saw in the feature list before, there are a huge number of features that help developers tremendously. For me, this has been the ability to create convergent apps, and the sole reason I use Libadwaita. + +Unfortunately, as with almost every new GNOME library, there is minimal language-specific documentation available. This is instead replaced with a much more generic, automatically-generated documentation system. + +While this is better than nothing, it is still quite lacklustre, especially considering the incredible community of developers GNOME has. + +### A Better Solution? + +Now, I hope that I have explained everyone’s position on Libadwaita, except mine. To be honest, I actually quite enjoy developing with it, even with all its teething problems. Unfortunately, I am also a huge fan of theming, and have found Libadwaita apps quite jarring compared to everything else. + +However, I think there is a solution. As I said before, Libadwaita was created in response to the faster development pace GNOME needed. However, couldn’t this be achieved through a branch from GTK 4? + +This would allow GTK to inherit all the exciting features in Libadwaita, as well as allowing a more unified approach to GNOME libraries. As I said before in [my Flutter article][3], I believe that desktop Linux is too fragmented, and this extends to GTK. + +What do you think about Libadwaita? Do you support it, or are you going to be boycotting GNOME? Please, I would love to hear your opinions in the comments below! + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gnome-libadwaita-library/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lujun9972 +[1]: https://aplazas.pages.gitlab.gnome.org/blog/blog/2021/03/31/introducing-libadwaita.html +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://news.itsfoss.com/no-flutter-on-linux-desktop/ diff --git a/sources/talk/20220421 How Linux rescues slow computers (and the planet).md b/sources/talk/20220421 How Linux rescues slow computers (and the planet).md new file mode 100644 index 0000000000..42c8c722e0 --- /dev/null +++ b/sources/talk/20220421 How Linux rescues slow computers (and the planet).md @@ -0,0 +1,115 @@ +[#]: subject: "How Linux rescues slow computers (and the planet)" +[#]: via: "https://opensource.com/article/22/4/how-linux-saves-earth" +[#]: author: "David Both https://opensource.com/users/dboth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How Linux rescues slow computers (and the planet) +====== +Don't throw away your old computer. Skip the landfill and revive it with Linux. + +![Old UNIX computer][1] + +(Image by: Opensource.com) + +Mint and Kasen, two of my grandkids, asked me to help them build gaming computers. I am ecstatic that they asked. This gives me a great opportunity to help them learn about technology while being a part of their lives. Both of those things make me happy. There are many ways to approach the ecological impact of computers. + +Wait! That's quite a non-sequitur—right? Not really, and this article is all about that. + +### What happens to old computers? + +What happens to old computers (and why) is a big part of this discussion. Start with the typical computer getting replaced after about five years of service. Why? + +Online articles such as [this one][2] I found on CHRON, a publication aimed at small businesses suggest a three-to-five-year lifespan for computers. This is partly based on the alleged fact that computers slow down around that time in their life cycle. I find the pressure to get a newer, faster computer within that same time frame in this and other articles. Of course, much of that pressure comes from the computer and chip vendors who need to keep their income streams growing. + +The United States Internal Revenue Service reinforces this five-year service life by specifying that time frame for full depreciation of computers. + +Let's start with the myth of computer slowdowns. Computers don't slow down—ever. Computers always run at their designed clock speeds. Whether that is 2.8GHz or 4.5GHz, they will always run at that speed when busy. Of course, the clock speeds get intentionally reduced when the computer has little or nothing to do, saving power. + +Computers don't slow down because they are old. Computers with Windows installed produce less legitimate work as they grow older because of the massive amount of malware, spyware, adware, and scareware they accumulate over time. Computer users have come to believe that this is normal, and they resign themselves to life with all of this junk dragging down the performance of their computers. + +More Linux resources + +* Linux commands cheat sheet +* Advanced Linux commands cheat sheet +* Free online course: RHEL Technical Overview +* Linux networking cheat sheet +* SELinux cheat sheet +* Linux common commands cheat sheet +* What are Linux containers? +* Our latest Linux articles + +### Linux to the rescue + +As a known computer geek among my friends and acquaintances, people sometimes gift me with their old computers. They no longer want them because they are slow, so they give them to me and ask me to wipe their hard drives before taking them to the electronics recycling center a few blocks from my house. I always suggest that their three-to-five-year-old computers are still good, but they seem intent on spending money rather than learning a new operating system. + +I have several old computers gifted to me. One, in particular, a Dell Optiplex 755 with a 2.33 GHz Core 2 Duo processor and 8GB of RAM, is particularly interesting. Its BIOS is dated 2010, so it is around 12 years old. It is the oldest computer I have, and I keep it quite busy. I have had it for several years, and it never slows down because I use Linux on it—Fedora 35 right now. + +If that is an exception, here are more. I built three computers for myself in 2012, ten years ago, and installed Fedora on all of them. They are all still running with no problems and as fast as they ever did. + +There are no exceptions here, just normal operations for old computers on Linux. + +Using Linux will at least double the usable lifetime of a computer and at no cost. This keeps those computers out of the landfill (at worst) and out of the recycling centers (at best) for an additional five-to-seven years or more. + +So long as I can find replacement parts for these computers, I can keep them running and out of any disposal or recycling path. The problem with some computers is finding parts. + +### Non-standard hardware + +Let's talk about non-standard hardware and some of the computers that you can buy from some well-known companies. As I mentioned above, one of my old computers is a Dell. Dell is a respectable company that has been around for a long time. I will never purchase a Dell desktop or tower computer, although I will take them as donations or gifts. I can install Linux, get rid of Windows, and make these old computers useful again. I use them in my home lab as test computers, among other things. + +However, Dell uses some non-standard parts that you can't easily replace. When you can find parts (like power supplies and motherboards), they are not cheap. The reason is that those vendors create systems with non-standard power supplies and motherboards that only fit within their own non-standard cases. This is a strategy used to keep revenues up. If you can't find these parts on the open market, you must go to the original manufacturer and pay inflated, if not exorbitant, prices. + +As one example, the Dell Optiplex I have uses a motherboard, case, and power supply that do not meet generally accepted standards for physical compatibility. In other words, a Dell motherboard or power supply would not fit in a standard case that I can purchase at the local computer store or Amazon. Those parts would not fit in a gaming case that my grandkids would use. The holes for mounting the motherboard and power supply would not align. The power supply would not fit the space available in the standard case. The PCI card slots and back panel connectors on the motherboard would be in the wrong place for a standard case, and the power supply connectors would not match those on a standard motherboard. + +Eventually, one or more of those non-standard parts will fail, and you won't be able to find a replacement at all, or at least not for a reasonable price. At that point, it makes sense to dispose of the old computer and purchase a new one. + +### Standard builds + +Let's explore what using standardized parts can do for building computers, their longevity, and how that applies to the gaming computers that I am helping my grandkids with. + +Most motherboards are standardized. They have standard forms such as micro ATX, ATX, and extended ATX. All of these have mounting holes in standard locations. Many of the locations overlap, so holes for ATX motherboards align with many of the mounting holes used on extended ATX motherboards. This means that you can always use a case that has holes drilled for standard motherboard hole locations for any of those motherboards. These motherboards have standard power connectors, which means you can use them with any standard power supply. + +I sent both of my grandkids a gaming computer case that has standardized mounting holes for the motherboards for their birthdays. These holes have standard threads so that they can use the brass standoffs that come with any motherboard in those motherboard mounting holes. The standoffs screw into the motherboard, and themselves have standard threaded holes that fit standard motherboard mounting screws. + +The result of all this is that they can install any standard motherboard in any standard case using standard fasteners with any standard power supply. + +Note that memory, processors, and add-in cards are all standardized, but they must be compatible with the motherboard. So memory for an old motherboard may no longer be available. You would need a new motherboard, memory, and processor in such a case. But the rest of the computer is still perfectly good. + +As I have told Mint and Kasen, building (or purchasing) a computer with standard parts means never having to buy a new computer. The good case I gave them will never need replacement. Over time components may fail, but they only need to replace any defective parts. This continuous renewal of standardized parts will allow those computers to last a lifetime with minimal cost. If one component fails, just replace that one part and recycle the defective one. + +This also significantly reduces the amount of material you need to recycle or otherwise add to the landfills. + +### Recycling old computer parts + +I am fortunate to live in a place that provides curbside recycling pickup. Although that curbside pickup does not include electronic devices, multiple locations around the area do take electronics for recycling, and I live close to one. I have taken many loads of old, unusable electronics to that recycling center, including my computers' defective parts. But never an entire computer. + +I collect those defective parts in old cardboard boxes, sorted by type—electronics in one, metal in another, batteries in a third, and so on. This corresponds to the collection points at the recycling center. When a box or two get full, I take them for recycling. + +### Some final thoughts + +Even after a good deal of research for this article and my own edification in the past, it is very difficult to determine where the recycled computers and computer parts will go. The website for our recycling center indicates that the outcomes for each type of recycled material get based on its economic value. Computers have relatively large amounts of valuable metals and rare earth elements, so they get recycled. + +The issue of whether such recycling gets performed in ways that are healthy for the people involved and the planet itself is another story. So far, I have been unable to determine where electronics destined for recycling go from here. I have decided that I need to do my part while working to ensure the rest of the recycling chain gets set up and functions appropriately. + +The best option for the planet is to keep computers running as long as possible. Replacing only defective components as they go bad can keep a computer running for years longer than the currently accepted lifespan and significantly reduces the amount of electronic waste that we dump in landfills or that needs recycling. + +And, of course, use Linux so your computers won't slow down. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/4/how-linux-saves-earth + +作者:[David Both][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/retro_old_unix_computer.png +[2]: https://smallbusiness.chron.com/life-span-average-pc-69823.html diff --git a/sources/talk/20220423 I Ditched Ubuntu for Manjaro- Here-s What I Think After a Week.md b/sources/talk/20220423 I Ditched Ubuntu for Manjaro- Here-s What I Think After a Week.md new file mode 100644 index 0000000000..948d479519 --- /dev/null +++ b/sources/talk/20220423 I Ditched Ubuntu for Manjaro- Here-s What I Think After a Week.md @@ -0,0 +1,188 @@ +[#]: subject: "I Ditched Ubuntu for Manjaro: Here’s What I Think After a Week" +[#]: via: "https://news.itsfoss.com/manjaro-linux-experience/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +I Ditched Ubuntu for Manjaro: Here’s What I Think After a Week +====== + +Primarily, I rely on Ubuntu-based distributions like Pop!_OS, Zorin OS, Linux Mint, or Ubuntu itself for work. + +They get out of the way when I work on something, along with seamless software updates. Not to forget, they get along well with my Intel-Nvidia-powered system. + +Everything (can be subjective) works out of the box. + +However, I recently decided to switch to Arch Linux on bare metal (because I mostly used it on virtual machines). + +And then, I ended up using **Manjaro Linux** (an Arch-based distro). + +### Here’s Why I Picked Manjaro Linux + +To my surprise, I couldn’t even get past the “_nouveau DRM: core notifier timeout_” error, let alone proceed with the installation when using a **live USB for Arch Linux**. Yes, I’m aware of the [guided installer with Arch Linux][1], but the connected displays just kept on flickering, highlighting this error, no matter what. + +The best solution to this problem was not to get an NVIDIA card with my recent upgrade. + +_Too bad, I prefer Nvidia GPUs…_ + +AMD’s RX 6600 XT is similarly priced to RTX 3060 Ti; it did not make sense to get that card for 1440p. + +So, yes, RTX 3060 Ti can be the problem in my case. + +While I found some methods to troubleshoot the issue, I was too lazy. I just wanted to see if I could experience Arch Linux without putting in a great effort. + +**So, here’s what I did:** + +The next-best option would be to try any of the [best Arch-based distros][2] tailored to make things easy, right? + +And that’s where **Manjaro Linux** comes in. + +Manjaro Linux is a popular Arch-based distro, and I’ve noticed regular improvements to it with every update (while using it on a VM). + +Furthermore, I like Manjaro’s default theme accent color for my desktop experience. + +So, I decided to give it a try… + +### Manjaro Linux: Rough Start + +![][3] + +I did not have any issues installing Manjaro with proprietary Nvidia drivers. However, a recent point update, i.e., **Manjaro Linux 21.2.6,** messed up the system. + +I couldn’t access the login screen and the [TTY][4] (all I could see was the motherboard’s manufacturer logo) + +So, I had to re-install Manjaro Linux using the latest ISO, and so far, so good (touch wood). + +And during my usage of Manjaro Linux, I noticed a few things that make up for its good and bad points. + +Here, I highlight some of my experiences. These insights should help you explore more about it if you haven’t tried it yet. + +#### 1\. Easy Installation + +The primary highlight of an Arch-based distro is to make things easy to set up. And I had no issues whatsoever. + +It was a breeze installing Manjaro Linux on my secondary drive. The bootloader was correctly configured to display the Manjaro-themed boot menu that lets me select Windows/Manjaro Linux for dual-boot. + +#### 2\. Manjaro Hello + +![][5] + +The welcome experience makes up for a significant part of a user experience when trying something new. And Manjaro Linux does not disappoint in this regard. + +You get all the essential information if you pay close attention to the information available via the welcome screen. + +The GNOME Layouts Manager lets you pick a suitable layout to get yourself comfortable. + +![][6] + +However, I couldn’t get the “**Window Tiling**” functionality working when I tried to enable it here: + +![][7] + +#### 3\. Package Manager is Fast and Versatile + +![][8] + +Considering that GNOME is my favorite desktop environment, I have had terrible experiences with the software center (or even with distro-specific stores like Pop!_Shop). + +While they get the work done, sometimes they do not respond or aren’t responsive enough as I expect them to be. + +With Manjaro Linux, I found [Pamac][9] installed as the package manager. It seems to be one of the [best ways to install and remove software on Manjaro Linux][10]. + +In my experience, it was blazing fast with installations and removing packages. You also get prompts for conflicts in packages or if something needs to be replaced/removed. The package manager gives plenty of information about the optional/required dependencies when you install something. + +Overall, it was a pretty good experience without any slowdowns. To sweeten the experience, the package manager lets you quickly enable the support for **Flatpaks/Snaps/AUR** by tweaking the preferences of pamac. + +![][11] + +So, you do not have to use the terminal or different software stores. Everything will be available under a single roof, which is a big time saver. + +#### 4\. Trying out the ZSH Shell + +![][12] + +I am used to the bash shell on Ubuntu-based distros. However, Manjaro Linux features the ZSH shell by default. I believe ZSH is better than bash, but I’ll take a deep dive into the comparison with a separate article soon. + +In other words, I get to try something different out of the box. To my excitement, the terminal prompt and the theme for the shell (or the terminal) that follows the Manjaro branding accent colors look pretty impressive! + +![][12] + +Hence, I do not need to [customize the look of the terminal here][13]. + +To explore more, you might want to check some of our resources on [what ZSH is][14] and [how to install it][15]. + +#### 5\. Lack of Official Software Support + +![][16] + +I hope this improves soon. But, as of now, many software/utilities offer direct support for Ubuntu and Fedora only. + +You can find official DEB/RPM packages for various tools, but neither will work directly with Manjaro Linux. + +You will have to rely on the packages available in Arch Linux repositories or [AUR][17]. + +Fortunately, there are good chances to find the software in AUR or their repositories maintained by the community or distro developers. Just like I was able to get [Insync][18] (_affiliate link_) to work on Manjaro Linux with file manage integration extensions available. + +However, without official support for the platform, you may/may not miss out on some features or quick updates. + +Of course, if you rely on [Flatpak][19] or Snap packages, it should not be an issue for you. Furthermore, if you are new to Linux, you can refer to our [Flatpak guide][20] for more information. + +#### 6\. No Fractional Scaling + +I have a dual-monitor setup with 1080p + 1440p resolutions. So, fractional scaling helps, but I can manage without it. + +To enable fractional scaling on Manjaro, you will have to install x11-scaling enabled packages for Mutter and GNOME control center. The packages include: + + * **mutter-x11-scaling**  + * **gnome-control-center-x11-scaling** + + + +This will replace your existing mutter and gnome control center packages. So, you will lose the default theme/accent settings for your desktop. + +You may have to utilize GNOME Tweaks to get things right. But, it can turn out to be an annoying experience. + +### Final Thoughts + +Overall, I enjoy the desktop experience with Manjaro Linux. If another system update doesn’t break the experience, I think I will continue with Manjaro Linux as my new daily driver. + +_What do you think are the strong/weak points for Manjaro Linux? Did I miss something as part of my new experience? Do you have any suggestions as an experienced Arch Linux user?_ + +_Please let me know your thoughts in the comments below._ + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/manjaro-linux-experience/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/arch-new-guided-installer/ +[2]: https://itsfoss.com/arch-based-linux-distros/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjkwMCIgd2lkdGg9IjE2MDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIi8+ +[4]: https://itsfoss.com/what-is-tty-in-linux/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjcxMyIgd2lkdGg9IjkzNSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY1MSIgd2lkdGg9Ijg1MiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY3MyIgd2lkdGg9Ijg1MiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwMiIgd2lkdGg9IjEwMDIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIi8+ +[9]: https://wiki.manjaro.org/index.php/Pamac +[10]: https://itsfoss.com/install-remove-software-manjaro/ +[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYyOCIgd2lkdGg9IjY5MiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[12]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwMSIgd2lkdGg9Ijc4OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[13]: https://itsfoss.com/customize-linux-terminal/ +[14]: https://linuxhandbook.com/why-zsh/ +[15]: https://linuxhandbook.com/install-zsh/ +[16]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYxNyIgd2lkdGg9IjEwMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIi8+ +[17]: https://itsfoss.com/aur-arch-linux/ +[18]: https://itsfoss.com/recommends/get-insync/ +[19]: https://itsfoss.com/what-is-flatpak/ +[20]: https://itsfoss.com/flatpak-guide/ diff --git a/sources/talk/20220509 Cloud service providers- How to keep your options open.md b/sources/talk/20220509 Cloud service providers- How to keep your options open.md new file mode 100644 index 0000000000..4283550c9f --- /dev/null +++ b/sources/talk/20220509 Cloud service providers- How to keep your options open.md @@ -0,0 +1,84 @@ +[#]: subject: "Cloud service providers: How to keep your options open" +[#]: via: "https://opensource.com/article/22/5/cloud-service-providers-open" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Cloud service providers: How to keep your options open +====== +No matter what level of openness your cloud service operates on, you have choices for your own environment. + +![Sky with clouds and grass][1] +(Image by Flickr user: theaucitron, CC BY-SA 2.0) + +For Linux users, there's a new kind of computer on the market, and it's known as the cloud. + +As with the PC sitting on your desk, the laptop in your backpack, and the virtual private server you rent from your favorite web hosting service, you have your choice in vendors for cloud computing. The brand names are different than the hardware brands you've known over the years, but the concept is the same. + +To run Linux, you need a computer. To run Linux on the cloud, you need a cloud service provider. And just like the hardware and firmware that ships with your computer, there's a spectrum for how open source your computing stack can be. + +As a user of open source, I prefer my computing stack to be as open as possible. After a careful survey of the cloud computing market, I've developed a three-tier view of cloud service providers. Using this system as your guide, you can make intelligent choices about what cloud provider you choose. + +### Open stack + +A cloud that's fully open is a cloud built on open source technology from the ground up. So much cloud technology is open source, and has been from the beginning, that an open stack isn't all that difficult to accomplish, at least on the technical level. However, there are cloud providers reinventing the wheel in a proprietary way, which makes it easy to stumble into a cloud provider that's mixed a lot of closed source components in with the usual open source tooling. + +If you're looking for a truly open cloud, look for a cloud provider providing [OpenStack][2] as its foundation. OpenStack provides the software infrastructure for clouds, including Software-Defined Networking (SDN) through Neutron, object storage through Swift, identity and key management, image services, and much more. Keeping with my hardware computer analogy, OpenStack is the "kernel" that powers the cloud. + +I don't mean that literally, of course, but if your cloud provider runs OpenStack, that's reasonably as far down in the stack as you can go. From a user perspective, OpenStack is the reason your cloud exists and has a filesystem, network, and so on. + +Sitting on top of OpenStack, there may be a web UI such as Horizon or Skyline, and there may be extra components such as [OpenShift][3] or OKD (not an acronym, but formerly known as OpenShift Origin). All of these are open source, and they help you run containers, which are minimalist Linux images with applications embedded within them. + +Because OpenShift and OKD don't require OpenStack, that's the next tier of my cloud-based world view. + +### Open platform + +You don't always have a choice in which stack your cloud is running. Instead of OpenStack, your cloud might be running Azure, Amazon Web Services (AWS), or something similar. + +Those are the "binary blobs" of the cloud world. You have no insight into how or why they work; all you know is that your cloud exists and has a filesystem, a networking stack, and so on. + +Just as with desktop computing, you can have an "operating system" running on the box you've been given. Again, I'm not speaking literally, and there's a strong argument that OpenStack itself is essentially an operating system for the cloud. Still, it's usually OpenShift that a cloud user interacts with directly. + +OpenShift is an open source "desktop" or workspace in which you can manage containers and pods with Podman and Kubernetes. It lets you run applications on the cloud much as you might launch an app on your laptop. + +### Open standards + +Last but not least, there are those situations when you have no choice in cloud service providers. You're put on a platform with a proprietary "kernel," a proprietary "operating system," and all that's left for you to influence is what you run inside that environment. + +All is not lost. + +When you're dealing with open source, you have the ability to construct your own scaffolding. You can choose what components you use inside your containers. You can and should design your working environment around open source tools, because if you do get to change service providers, you can take everything you've built with you. + +This might mean implementing something already built into the (non-open) platform you're stuck on. For instance, your cloud provider might entice you with an API management system or continuous integration/continuous delivery (CI/CD) pipeline that's included in their platform "for free," but you know better. When a non-open application is offered as "free," it usually bears a cost in some other form. One cost is that once you start building on top of it, you'll be all the more hesitant to migrate away because you know that you'll have to leave behind everything you built. + +Instead of using the closed "features" of your cloud provider, reimplement those services as open source for your own use. Run [Jenkins][4] and [APIMan][5] in containers. Find the problems your cloud provider claims to solve with proprietary code, then use an open source solution to ensure that, when you leave for an open provider, you can migrate the system you've built. + +### Open source computing + +For too many people, cloud computing is a place where open source is incidental. In reality, open source is as important on the cloud as it is on your personal computer and the servers powering the internet. + +Look for open source cloud services. + +When you're stuck with something that doesn't provide source code, be the one using open source in your cloud. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/cloud-service-providers-open + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/bus-cloud.png +[2]: https://opensource.com/resources/what-is-openstack +[3]: https://cloud.redhat.com/?intcmp=7013a000002qLH8AAM +[4]: https://opensource.com/article/19/9/intro-building-cicd-pipelines-jenkins +[5]: https://www.apiman.io/latest/ 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 new file mode 100644 index 0000000000..df7c631f1e --- /dev/null +++ b/sources/talk/20220510 6 easy ways to make your first open source contribution with LibreOffice.md @@ -0,0 +1,56 @@ +[#]: 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/20220510 My open source journey with C from a neurodiverse perspective.md b/sources/talk/20220510 My open source journey with C from a neurodiverse perspective.md new file mode 100644 index 0000000000..14eac95d99 --- /dev/null +++ b/sources/talk/20220510 My open source journey with C from a neurodiverse perspective.md @@ -0,0 +1,69 @@ +[#]: subject: "My open source journey with C from a neurodiverse perspective" +[#]: via: "https://opensource.com/article/22/5/my-journey-c-neurodiverse-perspective" +[#]: author: "Rikard Grossman-Nielsen https://opensource.com/users/rikardgn" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +My open source journey with C from a neurodiverse perspective +====== +I've learned that if you can find the method that works for you, no matter what teachers and other students may say, you can learn any open source skill that interests you. + +![][1] +(Image by: pensource.com) + +I was born in 1982, which in human years is only 40 years in the past (at the time of writing). In terms of computer development, it's eons ago. I got my first computer, a Commodore 64, when I was ten years old. Later, I got an Amiga, and by 13 I got an "IBM Compatible" (that's what they were called, then) PC. + +In high school, I did a lot basic programming on my graphing calculator. In my second year of high school, I learned basic C programming, and in my third year I started doing more advanced C programming, using libraries, pointers, and graphics. + +### My journey from programming student to teacher + +In my college days, I learned Java and so [Java became my primary language][2]. I also made some C# programs for a device known as a personal data assistant (PDA), which were pre-cursors to the modern smart phone. Because Java is object-oriented, multi-platform, and made GUI programming easy, I thought I'd do most of my programming in Java from now on. + +In college, I also discovered that I had a talent for teaching, so I helped others with programming, and they helped me with math when I took computer science. I took some courses on C programming, aimed at basic embedded programming and controlling measurement instruments in my later college years. + +After turning 30, I've used C as a teaching tool for high school kids learning to program in C. I've also used [Fritzing][3] to teach high school kids how to program an Arduino. My interest in C programming was awakened again last year, when I got a job helping college students with learning differences in computing subjects. + +### How I approach programming in C and other languages + +All people learn differently. Being a neurodiverse person with Asperger's and ADHD, my learning process is sometimes quite different from others. Of course, everyone has different learning styles, though people who are neurodiverse might have a greater preference for a certain learning style than someone else. + +I tend to think in both pictures and words. Personally I need to decode things step by step, and understand them, step by step. This makes C a suitable language for my learning style. When I learn code, I gradually incorporate the code into my mind by learning to see lines of code, like `#include ` in front of me. From what I've read from descriptions of other neurodiverse people on the internet, some of them seem to have this kind of learning style as well. We “internalize code”. + +Some autistic people are a lot better at memorizing large chunks of code than me, but the process seems to be the same. When understanding concepts such as structs, pointers, pointers to pointers, matrices, and vectors, it's helpful for me to think in pictures, such as the ones you find in programming tutorials and books. + +I like to use C to understand how things are done at a lower level, such as [file input and output (I/O)][4], networking programming, and so on. This doesn't mean I don't like libraries that handle tasks such as string manipulation or making arrays. I also like the ease of creating arrays and vectors in Java. However, for creating a user interface, though I have looked at such code in C, I prefer to use grapical editors, such as Netbeans and similar. + +### My ideal C GUI open source tool for creating applications + +If I imagine an ideal open source tool for creating a GUI using C, it would be something similar to [Netbeans][5] that, for example, making GTK-interfaces by dragging and dropping. It should also be possible to put C on buttons, and so on, to make them perform actions. There may be such a tool. I admittedly haven't looked around that much. + +### Why I encourage young neurodiverse people to learn C + +[Gaming][6] is a big industry. Some studies suggest neurodiverse kids may be even more focused on gaming than other kids. I would tell a neurodiverse high school or college kid that If you learn C, you may be able to learn the basics of, for example, writing efficient drivers for a graphics card, or to make efficient file I/O routines to optimize their favorite game. I would also be honest that it takes time and effort to learn, but that it's worth the effort. Once you learn it, you have greater control of things like hardware. + +For learning C, I recommend a neurodiverse kid to install a beginner-friendly Linux distro, and then find some tutorials on the net. I also recommend breaking down things step by step, and drawing diagrams of, for example, pointers. I did that to better understand the concept, and it worked for me. + +In the end, that's what it's about: Find a learning method that works for you, no matter what teachers and other students may say, and use it to learn the open source skill that interests you. It can be done, and anyone can do it. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/my-journey-c-neurodiverse-perspective + +作者:[Rikard Grossman-Nielsen][a] +选题:[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/rikardgn +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/images/life/computer_code_programming_laptop_0.jpg +[2]: https://opensource.com/article/20/12/learn-java +[3]: https://fritzing.org +[4]: https://opensource.com/article/21/3/file-io-c +[5]: https://opensource.com/article/20/12/netbeans +[6]: https://opensource.com/tags/gaming diff --git a/sources/talk/20220513 When open source meets academic publishing- Platinum open access journals.md b/sources/talk/20220513 When open source meets academic publishing- Platinum open access journals.md new file mode 100644 index 0000000000..91c7df4d12 --- /dev/null +++ b/sources/talk/20220513 When open source meets academic publishing- Platinum open access journals.md @@ -0,0 +1,77 @@ +[#]: subject: "When open source meets academic publishing: Platinum open access journals" +[#]: via: "https://opensource.com/article/22/5/platinum-open-access-academic-journals" +[#]: author: "Joshua Pearce https://opensource.com/users/jmpearce" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +When open source meets academic publishing: Platinum open access journals +====== +Academics can now publish free, read free, and still stay on track for professional success. + +![Stack of books for reading][1] +Image by: Opensource.com + +Academics routinely give away their work to companies for free—and then they buy it back! Can you imagine a farmer giving away free food and then paying to get it back for dinner? Probably not. Yet academics like me have been trapped for decades in a scheme where we give free work in exchange for job security and then pay millions of dollars a year to read our own writing. + +Fortunately, this is changing. The results from a [study][2] I just finished show that it is possible for academics to get job security without paying for it. My study found hundreds of journals that are *platinum open access* (OA)—that is, they require neither the author nor the readers to pay for peer-reviewed work—yet still carry the prestige and readership to help academics succeed in their careers. + +This trend is exploding: The [Directory of Open Access Journals][3] lists over 17,300 journals that offer a means of OA at some level, and over 12,250 have no article-processing charges (APCs). I used a handy open source [Python script][4] to compare this list to a list of journals ranked by the frequency with which their published papers are cited in other articles (The Journal Impact Factor List). It is clear that the last few years have seen a growing trend towards both OA in general and platinum OA specifically. These trends have the potential to accelerate science while helping prevent academic servitude. + +### The academic's dilemma + +Academics are generally pretty intelligent, so why have they engaged in this disadvantageous system for so long? Simply put, academics have been caught in a trap: In order to keep their jobs and get tenure, they need to publish in journals with a high impact factor. An impact factor is a metric based on the mean number of citations to articles published in the last two years in a given journal, as indexed by the proprietary Web of Science. Impact factors are a prestige metric for academics. + +Historically, academic publishing has been dominated by a handful of major publishers that used subscription-based business models. In this model, academic authors write articles, peer-review articles, and often do the editing of these articles—all for free. The articles are published under copyright owned by the major publishing companies. Then either the same academics pay to read these articles on an individual basis (~US $35/article), or their university libraries pay to subscribe to all of the articles in a journal. These costs can be astronomical: often over US $1 million per year for all titles from a single publisher. + +This system is senseless for many obvious reasons. Scientific progress is bogged down by restricting access to copyrighted scientific literature squirreled away behind paywalls. It is hard to do state-of-the-art research if you do not know what it is because you cannot read it. Scientists are divided into those who can afford access to the literature and those who cannot. Academics in the developing world often struggle to pay, but even well-endowed [Harvard University][5] has taken action to rein in its yearly journal expenses. + +Costs to authors are similarly high. APC values range from a few hundred dollars to jaw-dropping thousands of dollars per article. APCs can be particularly damaging for some disciplines that are less well funded, such as the humanities and social sciences (as compared to physical and medical sciences or engineering). Substantial APCs also reinforce the wealth gap in academia, making professional success dependent on having income to invest in publishing. Is there another profession that asks workers to pay money to make products for others? + +### Open access to the rescue! + +This problem can be solved by the OA movement, which advocates for making all academic literature freely accessible to everyone. There is an unmistakable rise in OA publishing: It now makes up nearly a third of the peer-reviewed literature. + +The benefits of OA are twofold. First, OA is a benefit to science overall, because it provides a frictionless means of reading the state of the art for making significant advancements in knowledge. Second, from an individual academic's point of view, OA provides the pragmatic advantage of enabling the broadest possible audience of their writing by making it freely and easily available on the internet. + +Funders have begun to demand OA for these reasons, particularly public funders of science. It is hard to argue that if the public funds research, they should have to pay a second time to read it. + +### Where is academic publishing now, and where it is going? + +Conventional publishers still have control of this situation, largely because of the perception that they have a monopoly on journals with an impact factor. Despite the disadvantages of publishing the traditional way, many academics continue to publish in subscription-based journals or pay high APCs, knowing that publication in high impact factor journals is vital for demonstrating expertise for grants, tenure, and promotion. + +A few years ago, academics simply had no choice: They could either publish in a journal with an impact factor or publish OA. Now they can publish OA and still get the benefits of an impact factor in one of three ways: + +* Green OA: Publish in a traditional way and then self-archive by uploading preprints or accepted versions of papers into an open repository or server. Some schools have an institutional repository for this purpose. For example, Western University has [Scholarship@Western][6], where any of their professors can share their work. Academics without their own institutional repos can use servers like [preprints.org][7], [arXiv][8], or  [OSF preprints][9]. I also use social media for academics, like [Academia][10] or [ResearchGate][11], for self-archiving. This can be complex to navigate because publishers have different rules, and it is somewhat time consuming. +* Gold OA: Publish in a growing list of journals with impact factors that make your paper freely available after publication but require an APC. This method is easy to navigate: Academics publish as usual and OA is built into the publishing process. The drawback is that funds going to APCs may be diverted from research activities. +* Platinum OA: Publish in platinum OA journals with an impact factor. No one pays either to read or to publish. The challenge here is finding a journal in your discipline that fits this criterion, but that continues to change. + +There are tens of thousands of journals, but only a few hundred platinum OA journals with impact factors. This may make it hard for academics to find a good fit between what they study and a journal that matches their interests. See the Appendix in my [study][12] for the list, or use the Python script mentioned above to run updated numbers for yourself. The number of platinum OA journals is growing quickly, so if you do not find something now you may have some solid journals to choose from soon. Happy publishing! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/platinum-open-access-academic-journals + +作者:[Joshua Pearce][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jmpearce +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/books_read_list_stack_study.png +[2]: https://doi.org/10.3390/knowledge2020013 +[3]: https://doaj.org/ +[4]: https://osf.io/mh4bx/ +[5]: https://www.theguardian.com/science/2012/apr/24/harvard-university-journal-publishers-prices +[6]: https://ir.lib.uwo.ca/ +[7]: https://www.preprints.org/ +[8]: https://arxiv.org/ +[9]: https://osf.io/preprints/ +[10]: https://westernu.academia.edu/JoshuaPearce/Papers +[11]: https://www.researchgate.net/profile/Joshua-Pearce +[12]: https://www.mdpi.com/2673-9585/2/2/13 diff --git a/sources/talk/20220516 5 benefits of switching from Google Analytics to Plausible.md b/sources/talk/20220516 5 benefits of switching from Google Analytics to Plausible.md new file mode 100644 index 0000000000..0612c953ce --- /dev/null +++ b/sources/talk/20220516 5 benefits of switching from Google Analytics to Plausible.md @@ -0,0 +1,109 @@ +[#]: subject: "5 benefits of switching from Google Analytics to Plausible" +[#]: via: "https://opensource.com/article/22/5/plausible-analytics" +[#]: author: "Tom Greenwood https://opensource.com/users/tpgreenwood" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +5 benefits of switching from Google Analytics to Plausible +====== +Plausible is an open source alternative to Google Analytics. + +![The legacy of open source and the tide of progress][1] +Image by: Opensource.com + +Google Analytics (GA) has been the industry standard web analytics tool for about as long as there have been analytics tools. Nearly every brief that my WordPress agency receives specifies that GA must be installed. And there is rarely any debate around whether it's the best tool for the job. + +My team at Wholegrain Digital has had concerns about GA in terms of privacy, General Data Protection Regulation (GDPR) compliance, performance, user experience, not to mention Google as a global advertising, and search monopoly. However, we continued using GA for 99% of our projects because we didn't feel that there was a strong enough alternative. + +Well, that has changed. We've made a decision that GA will no longer be our default analytics tool. Instead, our default analytics tool will be [Plausible][2]. + +In this article, I'll outline why we consider Plausible a better choice as a default analytics solution, the compromises to be aware of, and how it will impact our clients. + +### Why use Plausible instead of Google Analytics + +We believe that using Plausible over GA is not a purely ideological choice. There are in fact a number of tangible benefits that make it an objectively better product in many cases. Let's take a look at some of these benefits. + +#### Privacy + +One of Plausible's headline benefits is that it has been designed as a privacy-first analytics tool. This might sound like an ideological factor, but it has real practical implications too. + +Plausible only collects anonymous user data, and does not use cookies. This means that unlike most analytics solutions, it complies with both the GDPR and the European Cookie Law, so it's a tick in the box for legal compliance. It's also hosted in the EU and the data is owned by you so it doesn't get shared with any other organizations, which is another tick. + +This has a positive knock-on effect for user experience, because without privacy-invading cookies, you don't need to implement a cookie banner on the website (unless you use cookies for other things). Considering that the first few seconds of a website visit are the most critical to brand experience and conversion rates, cookie banners are arguably the single most damaging thing to the success of any online service. Avoiding these banners puts your brand and message first, helps you make a good first impression, and increases conversion rates. + +#### Simpler user interface + +The GA dashboard was never a great case study in intuitive design, but as the functionality of GA has expanded, so too has the complexity of the interface. I'm increasingly hearing frustrations from even experienced web marketers that they sometimes struggle to find basic data inside GA. + +Plausible has taken the opposite approach and focused on ease of use over quantity of features. The dashboard is beautifully designed to showcase the data you want in a way that is easy to find and understand. It's what most people wish GA to be and it's a breath of fresh air. + +![Image of Plausible with a dark theme][3] +Image by: (Tom Greenwood, CC BY-SA 4.0) + +This is not just a pleasantry. The reality is that if a tool is easy to use then you will use it, and if it is hard to use then you won't. The simplicity of the Plausible interface means that even though it has less features, many users are likely to get a lot more insights and value from their analytics. + +#### Better web performance + +The Plausible tracking script is the smallest we are aware of for any analytics service, coming in at less than 1kb compared to 17kb for GA and even more if you're using Google Tag Manager. + +Better web performance improves user experience, helps your website to rank better in search engines and improves conversion rates. Web performance matters, and when it comes to web performance, every kilobyte matters. + +#### Reduced environmental impact + +Plausible's tiny tracking script isn't just good for web performance, it's also good for the environment. At Wholegrain we are world leaders in sustainable web design and understand that every bit of wasted data is also wasted energy and carbon emissions. + +This adds up. As a minimum, switching to Plausible would save 16kb per visitor, so for a website with a modest 10K visitors per month this would be 160MB of data per month, or 2GB per year. A back of an envelope calculation using the latest methodology that we have developed for website carbon calculations put this at about the equivalent of 800 grams of CO2. Now multiply that up by the millions of websites running worldwide and you are talking about significant amounts of wasted energy and unnecessary carbon emissions. + +But it doesn't stop there. Analytics tools consume energy on the end user's device as they harvest data, in the transmission networks as they send that data back to the data center, and in the data center to store it all for eternity. By tracking less, Plausible is using less energy in its operation than bloated analytics tools such as GA that are tracking many more metrics that most people don't need. + +Plausible also hosts the data in data centers with a commitment to using renewable sources of electricity, which is great (though to be fair Google also does that), and they donate 5% of their revenue to good causes, so the money you are paying is also helping support environmental and social projects. + +#### More accurate data + +Finally, Plausible breaks one of the greatest myths about GA, which is that it is accurate. Plausible's own research and our own experiences with client websites show that GA can significantly under report data, sometimes by as much as 50-60%. + +When you look at GA and you think you are looking at all of your website data, you are most likely only looking at a portion of it. This is because GA is more likely to be blocked by ad blockers and privacy friendly web browsers, but perhaps more significantly because GA should not be tracking your visitors unless they have accepted cookies, which many visitors do not. + +Plausible therefore offers us a simple way to get a more complete and accurate view of website visitors. Needless to say, if you are a digital marketing manager and you want to make yourself look good, you want to use the analytics service that reports all of your visitors and not just some of them. + +### Are there any downsides? + +There are very few downsides to using Plausible. If you are a GA power user and genuinely need a lot of its more advanced functionality then Plausible is not going to meet all of your needs. Plausible can track events, conversions, and campaigns but if you need more than that then you'll need another tool. + +The only other notable downside to Plausible is that it is not free. There is a monthly fee but it is very reasonable, starting at $6 per month. It's a small price to pay for such a good tool, to protect the privacy of your website visitors and to maintain ownership of your data. + +### What are the impacts? + +Here at Wholegrain Digital we are implementing Plausible in a way that we hope will offer many of our clients the benefits listed above without the downsides. Nobody will be forced to stop using GA, but we will be talking about the benefits of Plausible proactively with our clients and including it in our proposals as the default option. + +In many cases, Plausible is not just capable of meeting a project's requirements, but is objectively a better solution than GA, so we'll be trying to help our clients to reap the benefits of this. + +In cases where advanced GA features are required, we will of course stick with GA for now. And in some cases, we may run GA and Plausible in parallel. This has a small overhead in terms of carbon footprint and performance, so it isn't our first choice. However, in some cases it may provide a necessary bridge to help our clients gain confidence in Plausible before making the leap, or help them gain a complete data set while ensuring compliance with privacy laws. + +As for the costs, Plausible is a very good value for what it offers, but we will be offering it free of charge to our clients for any websites cared for on our WordPress maintenance service. We hope that this will help lower the barrier to entry and help more of our clients and their website visitors gain the benefits of Plausible. + +### It is Plausible! + +I hope I've convinced you that Plausible is not just a viable but a really great alternative to GA. If you need any advice on how to figure out the best analytics solution for your website or how to ensure that you are GDPR compliant without compromising user experience, get in touch with me. + +*This article originally appeared on the Wholegrain Digital blog and has been republished with permission.* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/plausible-analytics + +作者:[Tom Greenwood][a] +选题:[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/tpgreenwood +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/LIFE_wavegraph.png +[2]: https://plausible.io +[3]: https://opensource.com/sites/default/files/2022-05/Plausible-%C2%B7-websitecarbon-com.jpg diff --git a/sources/talk/20220519 Near zero marginal cost societies and the impact on why we work.md b/sources/talk/20220519 Near zero marginal cost societies and the impact on why we work.md new file mode 100644 index 0000000000..5930ee1ea4 --- /dev/null +++ b/sources/talk/20220519 Near zero marginal cost societies and the impact on why we work.md @@ -0,0 +1,177 @@ +[#]: subject: "Near zero marginal cost societies and the impact on why we work" +[#]: via: "https://opensource.com/open-organization/22/5/near-zero-marginal-cost-societies-and-impact-why-we-work" +[#]: author: "Ron McFarland https://opensource.com/users/ron-mcfarland" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Near zero marginal cost societies and the impact on why we work +====== +As the IoT becomes our working and living environment, energy costs will come closer to zero and community collaboration will be critical. + +![A network of people][1] +Image by: Opensource.com + +I have read Jeremy Rifkin's book [The Zero Marginal Cost Society: The Internet of Things, the Collaborative Commons, and the Eclipse of Capitalism][2], which has a strong connection to open organization principles, particularly community building. Rifkin also writes about the future of green energy generation and energy use in logistics. This is the second of three articles in this series. In my previous article, I examined the Collaborative Commons. In this article, I look at its impact on energy production and supply. + +Within the next 25 years, Rifkin believes most of our energy for home heating, running appliances, powering businesses, driving vehicles, and operating the whole economy will be nearly free with on-site power solar, wind and geothermal energy generation. This is starting already, through both individual and micropower plants. The payback is around two to eight years. + +What would be the best organizational structure to manage nearly free green energy? Furthermore, through an intelligent communication and energy system, an organization could generate business anywhere in the world, and share energy across a continental energy internet. On top of that, it could produce and sell goods at a fraction charged by global manufacturing giants. + +### The Internet of Things is on the way + +According to Rifkin, the Internet of Things (IoT) will connect every machine, business, residence, and vehicle in an intelligent network that consists of not just a communications internet like now, but in the future an energy internet, and a logistics internet. They will all be embedded in a single operating system. Energy use will be completely monitored. Rifkin believes that within 10 years, many smart energy meters will be in use (by 2025). All this investment will reduce at least 10% of the waste in the current industrial system. + +All this will be possible with the reduction of costs of sensors and actuators embedded in devices. Radio-frequency identification (RFID) chip prices have fallen by 40% in around 2012-2013. Micro-electromechanical system (MEMS), including gyroscopes, accelerometers, and pressure sensors, have also dropped by 80-90% in price over the past five years (up to 2015 when this book was published). + +This will increase device connections, to as many as 1,000 connections on one person's devices, appliances, and facilities. This connection is what young people love, total inclusion in a global virtual public square to share everything. They thrive on transparency, collaboration, and inclusivity with care taken to an appropriate level of privacy. So, you can see, the time is right for the growth of a Collaborative Commons in society. + +### Exponential curve + +Question: Would you accept US $1,000,000 today or US $1.00 that doubled every day for 30 days? (In 30 days it will be US $536,870,912. That is 500 times more). In 31 days, over one billion. Exponential growth is deceptively fast. That is how fast costs are coming down according to Rifkin. This will turn the entire fossil fuel industry investments into stranded assets. We should be planning for the Collaborative Commons using all open organization principles now, as the situation will be ideal for them very soon. + +### Next, a free energy internet + +At this point in time there is free information for learning if you look for it. The next step is free energy (solar, wind, geothermal, biomass, hydro). After initial investments (research, development, deployment), Rifkin forecasts that unit costs will rapidly come down. The information internet and near zero-cost renewables will merge into the energy internet, powering homes, offices, and factories. Ideally, there will be energy that's loaded into buildings and partially stored in the form of hydrogen, distributed over a green-electricity internet, and connected to plug-in, zero-emission transportation. The development of renewable energy establishes a five pillar mechanism that will allow billions of people to share energy at near zero marginal cost in the IoT world + +### Solar energy + +If you start collecting energy from the sun, facilities only need to obtain 00.1% of the sun's energy that reaches the Earth. That would provide six times the energy we now use globally. + +[SunPower Corporation][3] is one company doing that. It supports making homes energy producers. The price of solar photovoltaic (PV) cells tends to drop by 20% for every doubling of industry capacity. Solar panels are increasing, and their ability to capture more energy per panel is increasing. Expect to see the development of thinner solar panels, and paper thin solar sheets. Eventually there will be solar energy paint and solar energy windows in the future. + +When too much energy is generated, it must be sold elsewhere or stored in batteries or used to produce hydrogen. This technology is coming to the market and will dominate it very soon. With these technologies alone, electricity is on the way to have zero marginal cost. + +### Wind power generation + +Wind power has been growing exponentially since the 1990s, and is now nearing fossil fuel and nuclear power generation levels (as of 2015). With the lowering costs of windmill production, installation, and maintenance, wind power is doubling every 2-½ years. With the increase of solar and wind energy sources, governments do not need to subsidize them with tariffs any longer. + +[Energy Watch Group][4] is tracking this. According to Rifkin geothermal energy, biomass, and wave and tidal power will likely reach their own exponential takeoff stage within the next decade. He believes that all this will happen in the first half of the twenty-first century. If this capacity doubles eight more times, by 2028, 80% of all energy generation will be from these renewables. + +### The collaborative age will soon be here + +With all the above developments, society's working and living environment are changing. According to the [collaborative age][5]: "This means ensuring that people can collaborate on tasks without friction. That humans and machines work seamlessly together. And automation — machine to machine collaboration — will be crucial. Those businesses that get these elements right will be able to boost employee satisfaction and attract the best talent. They will reduce costs by automating mundane tasks and by requiring a smaller office footprint. The social impact-focused organizations that [Laura Hilliger][6] and [Heather Leson][7] write about how to take advantage of this new age. + +### Making the transition + +It sounds good, but how do businesses transition from the information age to the collaboration age? One area will be in decentralized production through 3D printing technology ([additive manufacturing][8], not cutting away and creating waste). + +Instead of shipping goods, in the future, software will be shipped for many items to be manufactured locally, avoiding all shipping costs and making manufacturing become on-site near where the market need is. Locally, newly developed molten plastics, molten metal, or other feedstock inside a printer will be used for fabrication. This will give one 3D printer the ability to produce tens of thousands of products (like jewelry, airplane parts, and human prostheses). + +### Centralized manufacturing vs local production which Rifkin projects will come + +Rifkin believes lower marketing costs are possible by using the IoT economy and using global internet marketing sites at almost zero marginal cost. + +1. There is little human involvement in the local 3D process (giving the name "infofacture" rather than manufacture. They ship the information required for local manufacturing, like downloading music today. It is just code that you receive. +2. The code for 3D printing is open source, so people can learn and improve designs, becoming further prosumers in a wide range of items (no intellectual-property protection barriers). This will lead to exponential growth over the next several decades, offering more complicated products at lower prices and near zero marginal cost. +3. There is great waste with subtraction processes (current manufacturing processes) producing great waste with each process. (1/10 the materials required. This material could be developed from subatomic particles that are available anywhere in the local environment, like recycled glass, fabrics, ceramics, and stainless steel. Composite-fiber concrete could be extruded form-free and be strong enough for building construction walls [probably available in two decades].) +4. 3D printing processes have fewer moving parts and less spare parts. Therefore, expensive retooling and changeover delays will be less extensive. +5. Materials will be more durable, recyclable, and less polluting. +6. Local distributed production, through IoT, will spread globally at an exponential rate with little shipping cost and less use of energy. + +Rifkin cites Etsy as an example of this model. You can find things you are interested in, and have them produced locally using their network. They sell the code, and you can have it supplied in your area. + +Rifkin feels that in the future, small and medium sized 3D businesses, infofacturing more sophisticated products, will likely cluster in local technology parks to establish an optimum lateral scale (another form of community development). Here are current examples: + +1. [RepRap][9]: This is a manufacturing machine that can produce itself and all its parts. +2. [Thingiverse][10] The largest 3D printing community. They share under the General Public Licenses (GPL) and Creative Commons Licenses. +3. Fab Lab: Open source peer-to-peer learning in manufacturing. It is being provided to local, distant communities in developing countries. +4. 3D Printed automobiles ([Urbee vehicle][11]) is already being tested. +5. [KOR EcoLogic][12] has an urban electric vehicle. + +### The makers' movement principles + +Here are the principles that these ecosystems follow: + +1. They use open source shared software. +2. They promote a collaborative learning culture. +3. They believe that it will build a self-sufficient community. +4. They are committed to sustainable production practices. + +### The future of work and collaborative commons + +When technology replaces workers, capital investments replace labor investments. In 2007, companies used 6 times more computers and software than 20 years before, doubling the amount of capital used per hour of employee work. The robot workforce is on the rise. China, India, Mexico, and other emerging nations are learning that the cheapest workers in the world are not as cheap, efficient, or productive as the information technology, robotics, and artificial intelligence that replaces them. + +Going back to Rifkin, the first industrial revolution ended slave and serf labor. The second industrial revolution will dramatically shrink agricultural and craft labor. Rifkin believes the third industrial revolution will be a decline in mass wage labor in the manufacturing, service industries, and salaried professional labor in large parts of the knowledge sector. + +Rifkin believes that an abundance, zero marginal cost economy, will change our notion of economic processes. He thinks the old paradigm of owners and workers, sellers and consumers will break down. Consumers will start producing for themselves (and a few others), eliminating their distinction. Prosumers will increasingly be able to produce, consume, and share their own goods and services with one another on the Collaborative Commons at diminishing marginal costs approaching zero, bringing to the fore new ways of organizing economic life beyond the traditional capitalist market mode. + +Rifkin forecasts that in the future, greater importance will be placed on the Collaborative Commons and be as important as hard work was in the market economy (one's ability to cooperate and collaborate as opposed to just working hard). The amassing of social capital will become as valued as the accumulation of market capital. Attachment to community and the search for transcendence and meaning comes to define the measure of one's material wealth. All the [open organization principles][13] we write about will be exponentially more important in the future. + +The IoT will free human beings from the capitalist market economy to pursue nonmaterial shared interests on the collaborative commons. Many — but not all — of our basic material needs will be met for nearly free in a near zero marginal cost society. It will be abundance over scarcity. + +### Prosumer and the entry of the smart economy + +Rifkin writes that as capitalist economies step aside in some global commodities, in the collaborative commons, sellers and buyers will give way to prosumers, property rights will make room for open source sharing, ownership will be less important than access, markets will be superseded by networks, and the marginal cost of supplying information, generating energy, manufacturing products, and teaching students will become nearly zero. + +### Internet of energy is on the way + +Financing of the IoT will not come from wealthy capitalists and corporate shareholders, but from hundreds of millions of consumers and taxpayers. No one owns the internet. It is only in operation because a set of agreed-upon protocols were established that allows computer networks to communicate with each other. It is a virtual public square for all who pay for a connection to use it. Next comes distributed renewable energies that will be distributed in the same way. Supported by feed-in tariffs and other fund-raising methods, governments will pay for the initial research, but after that fixed investment, the public will be able to connect and use it freely. Once underway, governmental centralized operations will move to distributed ownership. The [Electric Power Research Institute][14] (EPRI), is studying how to build a national energy internet over the next 20 years. + +This is not just supplying electricity. Every device in every building will be equipped with sensors and software that connect to the IoT, feeding real-time information on electricity use to both the on-site prosumer and the rest of the network. The entire network will know how much electricity is being used by every appliance at any moment — thermostats, washing machines, dishwashers, televisions, hair dryers, toasters, ovens, and refrigerators. + +This is not happening in the future, but now. It is not just being considered but being done now. [Intwine Energy][15] can supply the above process now. The issue is getting it into the greater global population. A group of young [social entrepreneurs][16] are now using social media to mobilize their peers to create, operate and use the energy internet. + +### A new world of abundance beyond our needs + +Rifkin thinks society has to start envisioning an entire different living environment. Imagine a world in which you can just give away things you once had to pay for, or had to sell at a profit. No one charges us for each internet connected phone call. He believes these give-away goods need not be covered by governments, like telecommunication, roads, bridges, public schools or hospitals. They need not be considered totally private property to be sold and bought, either. These goods have to be supplied in communities with rules, responsibilities and joint benefits (information, energy, local production, and online education). Not governed by the markets or governments, but by networked commons because of the [tragedy of the commons][17]. It governs and enforces distributed, peer-to-peer, laterally scaled economic activities. + +Rifkin feels the Collaborative Commons as a governing body is extremely important. This is where local (project) leadership comes in. The goals, processes, tasks and responsibilities must be successfully executed, after they have been decided and agreed on. Furthermore, "social capital" is a major factor. It must be widely introduced and deepened in quality. Community exchange, interaction and contribution is far more important than selling to distant capital markets. If that is the case, our [open organization leadership][18] will be extremely important. + +### The public square versus private ownership + +"The public square at — least before the Internet, is where we communicate, socialize, revel in each other's company, establish communal bonds, and create social capital and trust. These are all indispensable elements for a nurturing community." Historically, Japanese villages were built like that to survive natural, economic and political disasters like earthquakes and typhoons. They put common interests over self-interests This is what the open organization principle of community is all about. + +The right to be included, to have access to one another, which is the right to participate together, is a fundamental right of all. Private property, the right to enclose, own, and exclude is merely a qualified deviation from the norm. For some reason, having massive private property rights have gained in importance in more recent modern times. This will all be reversed in the years ahead according to Rifkin. + +Rifkin writes that the world will move to these commons: + +1. Public square commons +2. Land commons +3. Virtual commons +4. Knowledge commons (languages, cultures, human knowledge and wisdom) +5. Energy Commons +6. Electromagnetic spectrum commons +7. Ocean commons +8. Fresh water commons +9. Atmosphere commons +10. Biosphere commons. + +The past 200 years of capitalism, the enclosed, privatized, and commodification of the market must be put under review. How would they be most effective in a transparent, non-hierarchical and collaborative culture? It comes down to two views, the capitalist (I own it. It is mine, and you can't use it) and the collaborationist (This is for everyone to use, and there are rules and guidelines to use it, so everyone can get their fair share). Today's cooperatives are good at this, like the [International Co-operative Alliance (ICA)][19]. Cooperatives have to generate motivation for the greater community good, and that motivation must be greater than any profit motive. That is their challenge but this not new, as one in seven people on the earth are in some kind of cooperative now. + +As I've presented in this article, the IoT will become our working and living environment. Also, energy costs are projected to go to near zero. With those changes, community collaboration and cooperation will become ever more important over hard work. In the last part of this series I will look at Collaborative Commons in logistics and other economic activity. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/22/5/near-zero-marginal-cost-societies-and-impact-why-we-work + +作者:[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/BUSINESS_networks.png +[2]: https://www.goodreads.com/book/show/18594514-the-zero-marginal-cost-society +[3]: https://us.sunpower.com +[4]: https://www.energywatchgroup.org +[5]: https://www.forbes.com/sites/ricoheurope/2020/02/06/moving-from-the-information-age-to-the-collaboration-age +[6]: http://www.zythepsary.com/author/admin +[7]: https://ch.linkedin.com/in/heatherleson +[8]: https://en.wikipedia.org/wiki/3D_printing +[9]: https://reprap.org/wiki/RepRap +[10]: https://www.thingiverse.com +[11]: https://www.popularmechanics.com/cars/a9645/urbee-2-the-3d-prinhttps://www.popularmechanics.com/cars/a9645/urbee-2-the-3d-printed-car-that-will-drive-across-the-country-16119485 +[12]: https://phys.org/news/2013-02-kor-ecologic-urbee-car-d.html +[13]: https://theopenorganization.org/definition/open-organization-definition/ +[14]: https://www.epri.com +[15]: https://www.intwineconnect.com +[16]: https://www.cleanweb.co +[17]: https://blogs.pugetsound.edu/econ/2018/03/09/comedy-of-the-commons +[18]: https://github.com/open-organization/open-org-leaders-manual/raw/master/second-edition/open_org_leaders_manual_2_3.pdf +[19]: https://www.ica.coop/en 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 new file mode 100644 index 0000000000..bc902926eb --- /dev/null +++ b/sources/talk/20220523 7 pieces of Linux advice for beginners.md @@ -0,0 +1,142 @@ +[#]: 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/tech/20170112 Writing Advanced Web Applications with Go.md b/sources/tech/20170112 Writing Advanced Web Applications with Go.md deleted file mode 100644 index c3d0f9e8dd..0000000000 --- a/sources/tech/20170112 Writing Advanced Web Applications with Go.md +++ /dev/null @@ -1,706 +0,0 @@ -[#]: subject: "Writing Advanced Web Applications with Go" -[#]: via: "https://www.jtolio.com/2017/01/writing-advanced-web-applications-with-go" -[#]: author: "jtolio.com https://www.jtolio.com/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Writing Advanced Web Applications with Go -====== - -Web development in many programming environments often requires subscribing to some full framework ethos. With [Ruby][1], it’s usually [Rails][2] but could be [Sinatra][3] or something else. With [Python][4], it’s often [Django][5] or [Flask][6]. With [Go][7], it’s… - -If you spend some time in Go communities like the [Go mailing list][8] or the [Go subreddit][9], you’ll find Go newcomers frequently wondering what web framework is best to use. [There][10] [are][11] [quite][12] [a][13] [few][14] [Go][15] [frameworks][16] ([and][17] [then][18] [some][19]), so which one is best seems like a reasonable question. Without fail, though, the strong recommendation of the Go community is to [avoid web frameworks entirely][20] and just stick with the standard library as long as possible. Here’s [an example from the Go mailing list][21] and here’s [one from the subreddit][22]. - -It’s not bad advice! The Go standard library is very rich and flexible, much more so than many other languages, and designing a web application in Go with just the standard library is definitely a good choice. - -Even when these Go frameworks call themselves minimalistic, they can’t seem to help themselves avoid using a different request handler interface than the default standard library [http.Handler][23], and I think this is the biggest source of angst about why frameworks should be avoided. If everyone standardizes on [http.Handler][23], then dang, all sorts of things would be interoperable! - -Before Go 1.7, it made some sense to give in and use a different interface for handling HTTP requests. But now that [http.Request][24] has the [Context][25] and [WithContext][26] methods, there truly isn’t a good reason any longer. - -I’ve done a fair share of web development in Go and I’m here to share with you both some standard library development patterns I’ve learned and some code I’ve found myself frequently needing. The code I’m sharing is not for use instead of the standard library, but to augment it. - -Overall, if this blog post feels like it’s predominantly plugging various little standalone libraries from my [Webhelp non-framework][27], that’s because it is. It’s okay, they’re little standalone libraries. Only use the ones you want! - -If you’re new to Go web development, I suggest reading the Go documentation’s [Writing Web Applications][28] article first. - -### Middleware - -A frequent design pattern for server-side web development is the concept of _middleware_, where some portion of the request handler wraps some other portion of the request handler and does some preprocessing or routing or something. This is a big component of how [Express][29] is organized on [Node][30], and how Express middleware and [Negroni][17] middleware works is almost line-for-line identical in design. - -Good use cases for middleware are things such as: - - * making sure a user is logged in, redirecting if not, - * making sure the request came over HTTPS, - * making sure a session is set up and loaded from a session database, - * making sure we logged information before and after the request was handled, - * making sure the request was routed to the right handler, - * and so on. - - - -Composing your web app as essentially a chain of middleware handlers is a very powerful and flexible approach. It allows you to avoid a lot of [cross-cutting concerns][31] and have your code factored in very elegant and easy-to-maintain ways. By wrapping a set of handlers with middleware that ensures a user is logged in prior to actually attempting to handle the request, the individual handlers no longer need mistake-prone copy-and-pasted code to ensure the same thing. - -So, middleware is good. However, if Negroni or other frameworks are any indication, you’d think the standard library’s `http.Handler` isn’t up to the challenge. Negroni adds its own `negroni.Handler` just for the sake of making middleware easier. There’s no reason for this. - -Here is a full middleware implementation for ensuring a user is logged in, assuming a `GetUser(*http.Request)` function but otherwise just using the standard library: - -``` - - func RequireUser(h http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - user, err := GetUser(req) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - if user == nil { - http.Error(w, "unauthorized", http.StatusUnauthorized) - return - } - h.ServeHTTP(w, req) - }) - } - -``` - -Here’s how it’s used (just wrap another handler!): - -``` - - func main() { - http.ListenAndServe(":8080", RequireUser(http.HandlerFunc(myHandler))) - } - -``` - -Express, Negroni, and other frameworks expect this kind of signature for a middleware-supporting handler: - -``` - - type Handler interface { - // don't do this! - ServeHTTP(rw http.ResponseWriter, req *http.Request, next http.HandlerFunc) - } - -``` - -There’s really no reason for adding the `next` argument - it reduces cross-library compatibility. So I say, don’t use `negroni.Handler` (or similar). Just use `http.Handler`! - -### Composability - -Hopefully I’ve sold you on middleware as a good design philosophy. - -Probably the most commonly-used type of middleware is request routing, or muxing (seems like we should call this demuxing but what do I know). Some frameworks are almost solely focused on request routing. [gorilla/mux][32] seems more popular than any other part of the [Gorilla][33] library. I think the reason for this is that even though the Go standard library is completely full featured and has a good [ServeMux][34] implementation, it doesn’t make the right thing the default. - -So! Let’s talk about request routing and consider the following problem. You, web developer extraordinaire, want to serve some HTML from your web server at `/hello/` but also want to serve some static assets from `/static/`. Let’s take a quick stab. - -``` - - package main - - import ( - "net/http" - ) - - func hello(w http.ResponseWriter, req *http.Request) { - w.Write([]byte("hello, world!")) - } - - func main() { - mux := http.NewServeMux() - mux.Handle("/hello/", http.HandlerFunc(hello)) - mux.Handle("/static/", http.FileServer(http.Dir("./static-assets"))) - http.ListenAndServe(":8080", mux) - } - -``` - -If you visit `http://localhost:8080/hello/`, you’ll be rewarded with a friendly “hello, world!” message. - -If you visit `http://localhost:8080/static/` on the other hand (assuming you have a folder of static assets in `./static-assets`), you’ll be surprised and frustrated. This code tries to find the source content for the request `/static/my-file` at `./static-assets/static/my-file`! There’s an extra `/static` in there! - -Okay, so this is why `http.StripPrefix` exists. Let’s fix it. - -``` - - mux.Handle("/static/", http.StripPrefix("/static", - http.FileServer(http.Dir("./static-assets")))) - -``` - -`mux.Handle` combined with `http.StripPrefix` is such a common pattern that I think it should be the default. Whenever a request router processes a certain amount of URL elements, it should strip them off the request so the wrapped `http.Handler` doesn’t need to know its absolute URL and only needs to be concerned with its relative one. - -In [Russ Cox][35]’s recent [TiddlyWeb backend][36], I would argue that every time `strings.TrimPrefix` is needed to remove the full URL from the handler’s incoming path arguments, it is an unnecessary cross-cutting concern, unfortunately imposed by `http.ServeMux`. (An example is [line 201 in tiddly.go][37].) - -I’d much rather have the default `mux` behavior work more like a directory of registered elements that by default strips off the ancestor directory before handing the request to the next middleware handler. It’s much more composable. To this end, I’ve written a simple muxer that works in this fashion called [whmux.Dir][38]. It is essentially `http.ServeMux` and `http.StripPrefix` combined. Here’s the previous example reworked to use it: - -``` - - package main - - import ( - "net/http" - - "gopkg.in/webhelp.v1/whmux" - ) - - func hello(w http.ResponseWriter, req *http.Request) { - w.Write([]byte("hello, world!")) - } - - func main() { - mux := whmux.Dir{ - "hello": http.HandlerFunc(hello), - "static": http.FileServer(http.Dir("./static-assets")), - } - http.ListenAndServe(":8080", mux) - } - -``` - -There are other useful mux implementations inside the [whmux][39] package that demultiplex on various aspects of the request path, request method, request host, or pull arguments out of the request and place them into the context, such as a [whmux.IntArg][40] or [whmux.StringArg][41]. This brings us to [contexts][42]. - -### Contexts - -Request contexts are a recent addition to the Go 1.7 standard library, but the idea of [contexts has been around since mid-2014][43]. As of Go 1.7, they were added to the standard library ([“context”][42]), but are available for older Go releases in the original location ([“golang.org/x/net/context”][44]). - -First, here’s the definition of the `context.Context` type that `(*http.Request).Context()` returns: - -``` - - type Context interface { - Done() <-chan struct{} - Err() error - Deadline() (deadline time.Time, ok bool) - - Value(key interface{}) interface{} - } - -``` - -Talking about `Done()`, `Err()`, and `Deadline()` are enough for an entirely different blog post, so I’m going to ignore them at least for now and focus on `Value(interface{})`. - -As a motivating problem, let’s say that the `GetUser(*http.Request)` method we assumed earlier is expensive, and we only want to call it once per request. We certainly don’t want to call it once to check that a user is logged in, and then again when we actually need the `*User` value. With `(*http.Request).WithContext` and `context.WithValue`, we can pass the `*User` down to the next middleware precomputed! - -Here’s the new middleware: - -``` - - type userKey int - - func RequireUser(h http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - user, err := GetUser(req) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - if user == nil { - http.Error(w, "unauthorized", http.StatusUnauthorized) - return - } - ctx := r.Context() - ctx = context.WithValue(ctx, userKey(0), user) - h.ServeHTTP(w, req.WithContext(ctx)) - }) - } - -``` - -Now, handlers that are protected by this `RequireUser` handler can load the previously computed `*User` value like this: - -``` - - if user, ok := req.Context().Value(userKey(0)).(*User); ok { - // there's a valid user! - } - -``` - -Contexts allow us to pass optional values to handlers down the chain in a way that is relatively type-safe and flexible. None of the above context logic requires anything outside of the standard library. - -#### Aside about context keys - -There was a curious piece of code in the above example. At the top, we defined a `type userKey int`, and then always used it as `userKey(0)`. - -One of the possible problems with contexts is the `Value()` interface lends itself to a global namespace where you can stomp on other context users and use conflicting key names. Above, we used `type userKey` because it’s an unexported type in your package. It will never compare equal (without a cast) to any other type, including `int`, in Go. This gives us a way to namespace keys to your package, even though the `Value()` method is still a sort of global namespace. - -Because the need for this is so common, the `webhelp` package defines a [GenSym()][45] helper that will create a brand new, never-before-seen, unique value for use as a context key. - -If we used [GenSym()][45], then `type userKey int` would become `var userKey = webhelp.GenSym()` and `userKey(0)` would simply become `userKey`. - -#### Back to whmux.StringArg - -Armed with this new context behavior, we can now present a `whmux.StringArg` example: - -``` - - package main - - import ( - "fmt" - "net/http" - - "gopkg.in/webhelp.v1/whmux" - ) - - var ( - pageName = whmux.NewStringArg() - ) - - func page(w http.ResponseWriter, req *http.Request) { - name := pageName.Get(req.Context()) - - fmt.Fprintf(w, "Welcome to %s", name) - } - - func main() { - // pageName.Shift pulls the next /-delimited string out of the request's - // URL.Path and puts it into the context instead. - pageHandler := pageName.Shift(http.HandlerFunc(page)) - - http.ListenAndServe(":8080", whmux.Dir{ - "wiki": pageHandler, - }) - } - -``` - -### Pre-Go-1.7 support - -Contexts let you do some pretty cool things. But let’s say you’re stuck with something before Go 1.7 (for instance, App Engine is currently Go 1.6). - -That’s okay! I’ve backported all of the neat new context features to Go 1.6 and earlier in a forwards compatible way! - -With the [whcompat][46] package, `req.Context()` becomes `whcompat.Context(req)`, and `req.WithContext(ctx)` becomes `whcompat.WithContext(req, ctx)`. The `whcompat` versions work with all releases of Go. Yay! - -There’s a bit of unpleasantness behind the scenes to make this happen. Specifically, for pre-1.7 builds, a global map indexed by `req.URL` is kept, and a finalizer is installed on `req` to clean up. So don’t change what `req.URL` points to and this will work fine. In practice it’s not a problem. - -`whcompat` adds additional backwards-compatibility helpers. In Go 1.7 and on, the context’s `Done()` channel is closed (and `Err()` is set), whenever the request is done processing. If you want this behavior in Go 1.6 and earlier, just use the [whcompat.DoneNotify][47] middleware. - -In Go 1.8 and on, the context’s `Done()` channel is closed when the client goes away, even if the request hasn’t completed. If you want this behavior in Go 1.7 and earlier, just use the [whcompat.CloseNotify][48] middleware, though beware that it costs an extra goroutine. - -### Error handling - -How you handle errors can be another cross-cutting concern, but with good application of context and middleware, it too can be beautifully cleaned up so that the responsibilities lie in the correct place. - -Problem statement: your `RequireUser` middleware needs to handle an authentication error differently between your HTML endpoints and your JSON API endpoints. You want to use `RequireUser` for both types of endpoints, but with your HTML endpoints you want to return a user-friendly error page, and with your JSON API endpoints you want to return an appropriate JSON error state. - -In my opinion, the right thing to do is to have contextual error handlers, and luckily, we have a context for contextual information! - -First, we need an error handler interface. - -``` - - type ErrHandler interface { - HandleError(w http.ResponseWriter, req *http.Request, err error) - } - -``` - -Next, let’s make a middleware that registers the error handler in the context: - -``` - - var errHandler = webhelp.GenSym() // see the aside about context keys - - func HandleErrWith(eh ErrHandler, h http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - ctx := context.WithValue(whcompat.Context(req), errHandler, eh) - h.ServeHTTP(w, whcompat.WithContext(req, ctx)) - }) - } - -``` - -Last, let’s make a function that will use the registered error handler for errors: - -``` - - func HandleErr(w http.ResponseWriter, req *http.Request, err error) { - if handler, ok := whcompat.Context(req).Value(errHandler).(ErrHandler); ok { - handler.HandleError(w, req, err) - return - } - log.Printf("error: %v", err) - http.Error(w, "internal server error", http.StatusInternalServerError) - } - -``` - -Now, as long as everything uses `HandleErr` to handle errors, our JSON API can handle errors with JSON responses, and our HTML endpoints can handle errors with HTML responses. - -Of course, the [wherr][49] package implements this all for you, and the [whjson][49] package even implements a friendly JSON API error handler. - -Here’s how you might use it: - -``` - - var userKey = webhelp.GenSym() - - func RequireUser(h http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - user, err := GetUser(req) - if err != nil { - wherr.Handle(w, req, wherr.InternalServerError.New("failed to get user")) - return - } - if user == nil { - wherr.Handle(w, req, wherr.Unauthorized.New("no user found")) - return - } - ctx := r.Context() - ctx = context.WithValue(ctx, userKey, user) - h.ServeHTTP(w, req.WithContext(ctx)) - }) - } - - func userpage(w http.ResponseWriter, req *http.Request) { - user := req.Context().Value(userKey).(*User) - w.Header().Set("Content-Type", "text/html") - userpageTmpl.Execute(w, user) - } - - func username(w http.ResponseWriter, req *http.Request) { - user := req.Context().Value(userKey).(*User) - w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(map[string]interface{}{"user": user}) - } - - func main() { - http.ListenAndServe(":8080", whmux.Dir{ - "api": wherr.HandleWith(whjson.ErrHandler, - RequireUser(whmux.Dir{ - "username": http.HandlerFunc(username), - })), - "user": RequireUser(http.HandlerFunc(userpage)), - }) - } - -``` - -#### Aside about the spacemonkeygo/errors package - -The default [wherr.Handle][50] implementation understands all of the [error classes defined in the wherr top level package][51]. - -These error classes are implemented using the [spacemonkeygo/errors][52] library and the [spacemonkeygo/errors/errhttp][53] extensions. You don’t have to use this library or these errors, but the benefit is that your error instances can be extended to include HTTP status code messages and information, which once again, provides for a nice elimination of cross-cutting concerns in your error handling logic. - -See the [spacemonkeygo/errors][52] package for more details. - -_**Update 2018-04-19:** After a few years of use, my friend condensed some lessons we learned and the best parts of `spacemonkeygo/errors` into a new, more concise, better library, over at [github.com/zeebo/errs][54]. Consider using that instead!_ - -### Sessions - -Go’s standard library has great support for cookies, but cookies by themselves aren’t usually what a developer thinks of when she thinks about sessions. Cookies are unencrypted, unauthenticated, and readable by the user, and perhaps you don’t want that with your session data. - -Further, sessions can be stored in cookies, but could also be stored in a database to provide features like session revocation and querying. There’s lots of potential details about the implementation of sessions. - -Request handlers, however, probably don’t care too much about the implementation details of the session. Request handlers usually just want a bucket of keys and values they can store safely and securely. - -The [whsess][55] package implements middleware for registering an arbitrary session store (a default cookie-based session store is provided), and implements helpers for retrieving and saving new values into the session. - -The default cookie-based session store implements encryption and authentication via the excellent [nacl/secretbox][56] package. - -Usage is like this: - -``` - - func handler(w http.ResponseWriter, req *http.Request) { - ctx := whcompat.Context(req) - sess, err := whsess.Load(ctx, "namespace") - if err != nil { - wherr.Handle(w, req, err) - return - } - if loggedIn, _ := sess.Values["logged_in"].(bool); loggedIn { - views, _ := sess.Values["views"].(int64) - sess.Values["views"] = views + 1 - sess.Save(w) - } - } - - func main() { - http.ListenAndServe(":8080", whsess.HandlerWithStore( - whsess.NewCookieStore(secret), http.HandlerFunc(handler))) - } - -``` - -### Logging - -The Go standard library by default doesn’t log incoming requests, outgoing responses, or even just what port the HTTP server is listening on. - -The [whlog][57] package implements all three. The [whlog.LogRequests][58] middleware will log requests as they start. The [whlog.LogResponses][59] middleware will log requests as they end, along with status code and timing information. [whlog.ListenAndServe][60] will log the address the server ultimately listens on (if you specify “:0” as your address, a port will be randomly chosen, and [whlog.ListenAndServe][60] will log it). - -[whlog.LogResponses][59] deserves special mention for how it does what it does. It uses the [whmon][61] package to instrument the outgoing `http.ResponseWriter` to keep track of response information. - -Usage is like this: - -``` - - func main() { - whlog.ListenAndServe(":8080", whlog.LogResponses(whlog.Default, handler)) - } - -``` - -#### App engine logging - -App engine logging is unconventional crazytown. The standard library logger doesn’t work by default on App Engine, because App Engine logs _require_ the request context. This is unfortunate for libraries that don’t necessarily run on App Engine all the time, as their logging information doesn’t make it to the App Engine request-specific logger. - -Unbelievably, this is fixable with [whgls][62], which uses my terrible, terrible (but recently improved) [Goroutine-local storage library][63] to store the request context on the current stack, register a new log output, and fix logging so standard library logging works with App Engine again. - -### Template handling - -Go’s standard library [html/template][64] package is excellent, but you’ll be unsurprised to find there’s a few tasks I do with it so commonly that I’ve written additional support code. - -The [whtmpl][65] package really does two things. First, it provides a number of useful helper methods for use within templates, and second, it takes some friction out of managing a large number of templates. - -When writing templates, one thing you can do is call out to other registered templates for small values. A good example might be some sort of list element. You can have a template that renders the list element, and then your template that renders your list can use the list element template in turn. - -Use of another template within a template might look like this: - -``` - -
    - {{ range .List }} - {{ template "list_element" . }} - {{ end }} -
- -``` - -You’re now rendering the `list_element` template with the list element from `.List`. But what if you want to also pass the current user `.User`? Unfortunately, you can only pass one argument from one template to another. If you have two arguments you want to pass to another template, with the standard library, you’re out of luck. - -The [whtmpl][65] package adds three helper functions to aid you here, `makepair`, `makemap`, and `makeslice` (more docs under the [whtmpl.Collection][66] type). `makepair` is the simplest. It takes two arguments and constructs a [whtmpl.Pair][67]. Fixing our example above would look like this now: - -``` - -
    - {{ $user := .User }} - {{ range .List }} - {{ template "list_element" (makepair . $user) }} - {{ end }} -
- -``` - -The second thing [whtmpl][65] does is make defining lots of templates easy, by optionally automatically naming templates after the name of the file the template is defined in. - -For example, say you have three files. - -Here’s `pkg.go`: - -``` - - package views - - import "gopkg.in/webhelp.v1/whtmpl" - - var Templates = whtmpl.NewCollection() - -``` - -Here’s `landing.go`: - -``` - - package views - - var _ = Templates.MustParse(`{{ template "header" . }} - -

Landing!

`) - -``` - -And here’s `header.go`: - -``` - - package views - - var _ = Templates.MustParse(`My website!`) - -``` - -Now, you can import your new `views` package and render the `landing` template this easily: - -``` - - func handler(w http.ResponseWriter, req *http.Request) { - views.Templates.Render(w, req, "landing", map[string]interface{}{}) - } - -``` - -### User authentication - -I’ve written two Webhelp-style authentication libraries that I end up using frequently. - -The first is an OAuth2 library, [whoauth2][68]. I’ve written up [an example application that authenticates with Google, Facebook, and Github][69]. - -The second, [whgoth][70], is a wrapper around [markbates/goth][71]. My portion isn’t quite complete yet (some fixes are still necessary for optional App Engine support), but will support more non-OAuth2 authentication sources (like Twitter) when it is done. - -### Route listing - -Surprise! If you’ve used [webhelp][27] based handlers and middleware for your whole app, you automatically get route listing for free, via the [whroute][72] package. - -My web serving code’s `main` method often has a form like this: - -``` - - switch flag.Arg(0) { - case "serve": - panic(whlog.ListenAndServe(*listenAddr, routes)) - case "routes": - whroute.PrintRoutes(os.Stdout, routes) - default: - fmt.Printf("Usage: %s \n", os.Args[0]) - } - -``` - -Here’s some example output: - -``` - - GET /auth/_cb/ - GET /auth/login/ - GET /auth/logout/ - GET / - GET /account/apikeys/ - POST /account/apikeys/ - GET /project// - GET /project//control// - POST /project//control//sample/ - GET /project//control/ - Redirect: f(req) - POST /project//control/ - POST /project//control_named//sample/ - GET /project//control_named/ - Redirect: f(req) - GET /project//sample// - GET /project//sample//similar[/<*>] - GET /project//sample/ - Redirect: f(req) - POST /project//search/ - GET /project/ - Redirect: / - POST /project/ - -``` - -### Other little things - -[webhelp][27] has a number of other subpackages: - - * [whparse][73] assists in parsing optional request arguments. - * [whredir][74] provides some handlers and helper methods for doing redirects in various cases. - * [whcache][75] creates request-specific mutable storage for caching various computations and database loaded data. Mutability helps helper functions that aren’t used as middleware share data. - * [whfatal][76] uses panics to simplify early request handling termination. Probably avoid this package unless you want to anger other Go developers. - - - -### Summary - -Designing your web project as a collection of composable middlewares goes quite a long way to simplify your code design, eliminate cross-cutting concerns, and create a more flexible development environment. Use my [webhelp][27] package if it helps you. - -Or don’t! Whatever! It’s still a free country last I checked. - -#### Update - -Peter Kieltyka points me to his [Chi framework][77], which actually does seem to do the right things with respect to middleware, handlers, and contexts - certainly much more so than all the other frameworks I’ve seen. So, shoutout to Peter and the team at Pressly! - --------------------------------------------------------------------------------- - -via: https://www.jtolio.com/2017/01/writing-advanced-web-applications-with-go - -作者:[jtolio.com][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.jtolio.com/ -[b]: https://github.com/lujun9972 -[1]: https://www.ruby-lang.org/ -[2]: http://rubyonrails.org/ -[3]: http://www.sinatrarb.com/ -[4]: https://www.python.org/ -[5]: https://www.djangoproject.com/ -[6]: http://flask.pocoo.org/ -[7]: https://golang.org/ -[8]: https://groups.google.com/d/forum/golang-nuts -[9]: https://www.reddit.com/r/golang/ -[10]: https://revel.github.io/ -[11]: https://gin-gonic.github.io/gin/ -[12]: http://iris-go.com/ -[13]: https://beego.me/ -[14]: https://go-macaron.com/ -[15]: https://github.com/go-martini/martini -[16]: https://github.com/gocraft/web -[17]: https://github.com/urfave/negroni -[18]: https://godoc.org/goji.io -[19]: https://echo.labstack.com/ -[20]: https://medium.com/code-zen/why-i-don-t-use-go-web-frameworks-1087e1facfa4 -[21]: https://groups.google.com/forum/#!topic/golang-nuts/R_lqsTTBh6I -[22]: https://www.reddit.com/r/golang/comments/1yh6gm/new_to_go_trying_to_select_web_framework/ -[23]: https://golang.org/pkg/net/http/#Handler -[24]: https://golang.org/pkg/net/http/#Request -[25]: https://golang.org/pkg/net/http/#Request.Context -[26]: https://golang.org/pkg/net/http/#Request.WithContext -[27]: https://godoc.org/gopkg.in/webhelp.v1 -[28]: https://golang.org/doc/articles/wiki/ -[29]: https://expressjs.com/ -[30]: https://nodejs.org/en/ -[31]: https://en.wikipedia.org/wiki/Cross-cutting_concern -[32]: https://github.com/gorilla/mux -[33]: https://github.com/gorilla/ -[34]: https://golang.org/pkg/net/http/#ServeMux -[35]: https://swtch.com/~rsc/ -[36]: https://github.com/rsc/tiddly -[37]: https://github.com/rsc/tiddly/blob/8f9145ac183e374eb95d90a73be4d5f38534ec47/tiddly.go#L201 -[38]: https://godoc.org/gopkg.in/webhelp.v1/whmux#Dir -[39]: https://godoc.org/gopkg.in/webhelp.v1/whmux -[40]: https://godoc.org/gopkg.in/webhelp.v1/whmux#IntArg -[41]: https://godoc.org/gopkg.in/webhelp.v1/whmux#StringArg -[42]: https://golang.org/pkg/context/ -[43]: https://blog.golang.org/context -[44]: https://godoc.org/golang.org/x/net/context -[45]: https://godoc.org/gopkg.in/webhelp.v1#GenSym -[46]: https://godoc.org/gopkg.in/webhelp.v1/whcompat -[47]: https://godoc.org/gopkg.in/webhelp.v1/whcompat#DoneNotify -[48]: https://godoc.org/gopkg.in/webhelp.v1/whcompat#CloseNotify -[49]: https://godoc.org/gopkg.in/webhelp.v1/wherr -[50]: https://godoc.org/gopkg.in/webhelp.v1/wherr#Handle -[51]: https://godoc.org/gopkg.in/webhelp.v1/wherr#pkg-variables -[52]: https://godoc.org/github.com/spacemonkeygo/errors -[53]: https://godoc.org/github.com/spacemonkeygo/errors/errhttp -[54]: https://github.com/zeebo/errs -[55]: https://godoc.org/gopkg.in/webhelp.v1/whsess -[56]: https://godoc.org/golang.org/x/crypto/nacl/secretbox -[57]: https://godoc.org/gopkg.in/webhelp.v1/whlog -[58]: https://godoc.org/gopkg.in/webhelp.v1/whlog#LogRequests -[59]: https://godoc.org/gopkg.in/webhelp.v1/whlog#LogResponses -[60]: https://godoc.org/gopkg.in/webhelp.v1/whlog#ListenAndServe -[61]: https://godoc.org/gopkg.in/webhelp.v1/whmon -[62]: https://godoc.org/gopkg.in/webhelp.v1/whgls -[63]: https://godoc.org/github.com/jtolds/gls -[64]: https://golang.org/pkg/html/template/ -[65]: https://godoc.org/gopkg.in/webhelp.v1/whtmpl -[66]: https://godoc.org/gopkg.in/webhelp.v1/whtmpl#Collection -[67]: https://godoc.org/gopkg.in/webhelp.v1/whtmpl#Pair -[68]: https://godoc.org/gopkg.in/go-webhelp/whoauth2.v1 -[69]: https://github.com/go-webhelp/whoauth2/blob/v1/examples/group/main.go -[70]: https://godoc.org/gopkg.in/go-webhelp/whgoth.v1 -[71]: https://github.com/markbates/goth -[72]: https://godoc.org/gopkg.in/webhelp.v1/whroute -[73]: https://godoc.org/gopkg.in/webhelp.v1/whparse -[74]: https://godoc.org/gopkg.in/webhelp.v1/whredir -[75]: https://godoc.org/gopkg.in/webhelp.v1/whcache -[76]: https://godoc.org/gopkg.in/webhelp.v1/whfatal -[77]: https://github.com/pressly/chi diff --git a/sources/tech/20170115 Magic GOPATH.md b/sources/tech/20170115 Magic GOPATH.md deleted file mode 100644 index 1d4cd16e24..0000000000 --- a/sources/tech/20170115 Magic GOPATH.md +++ /dev/null @@ -1,119 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Magic GOPATH) -[#]: via: (https://www.jtolio.com/2017/01/magic-gopath) -[#]: author: (jtolio.com https://www.jtolio.com/) - -Magic GOPATH -====== - -_**Update:** With the advent of Go 1.11 and [Go modules][1], this whole post is now useless. Unset your GOPATH entirely and switch to Go modules today!_ - -Maybe someday I’ll start writing about things besides Go again. - -Go requires that you set an environment variable for your workspace called your `GOPATH`. The `GOPATH` is one of the most confusing aspects of Go to newcomers and even relatively seasoned developers alike. It’s not immediately clear what would be better, but finding a good `GOPATH` value has implications for your source code repository layout, how many separate projects you have on your computer, how default project installation instructions work (via `go get`), and even how you interoperate with other projects and libraries. - -It’s taken until Go 1.8 to decide to [set a default][2] and that small change was one of [the most talked about code reviews][3] for the 1.8 release cycle. - -After [writing about GOPATH himself][4], [Dave Cheney][5] [asked me][6] to write a blog post about what I do. - -### My proposal - -I set my `GOPATH` to always be the current working directory, unless a parent directory is clearly the `GOPATH`. - -Here’s the relevant part of my `.bashrc`: - -``` -# bash command to output calculated GOPATH. -calc_gopath() { - local dir="$PWD" - - # we're going to walk up from the current directory to the root - while true; do - - # if there's a '.gopath' file, use its contents as the GOPATH relative to - # the directory containing it. - if [ -f "$dir/.gopath" ]; then - ( cd "$dir"; - # allow us to squash this behavior for cases we want to use vgo - if [ "$(cat .gopath)" != "" ]; then - cd "$(cat .gopath)"; - echo "$PWD"; - fi; ) - return - fi - - # if there's a 'src' directory, the parent of that directory is now the - # GOPATH - if [ -d "$dir/src" ]; then - echo "$dir" - return - fi - - # we can't go further, so bail. we'll make the original PWD the GOPATH. - if [ "$dir" == "/" ]; then - echo "$PWD" - return - fi - - # now we'll consider the parent directory - dir="$(dirname "$dir")" - done -} - -my_prompt_command() { - export GOPATH="$(calc_gopath)" - - # you can have other neat things in here. I also set my PS1 based on git - # state -} - -case "$TERM" in -xterm*|rxvt*) - # Bash provides an environment variable called PROMPT_COMMAND. The contents - # of this variable are executed as a regular Bash command just before Bash - # displays a prompt. Let's only set it if we're in some kind of graphical - # terminal I guess. - PROMPT_COMMAND=my_prompt_command - ;; -*) - ;; -esac -``` - -The benefits are fantastic. If you want to quickly `go get` something and not have it clutter up your workspace, you can do something like: - -``` -cd $(mktemp -d) && go get github.com/the/thing -``` - -On the other hand, if you’re jumping between multiple projects (whether or not they have the full workspace checked in or are just library packages), the `GOPATH` is set accurately. - -More flexibly, if you have a tree where some parent directory is outside of the `GOPATH` but you want to set the `GOPATH` anyways, you can create a `.gopath` file and it will automatically set your `GOPATH` correctly any time your shell is inside that directory. - -The whole thing is super nice. I kinda can’t imagine doing something else anymore. - -### Fin. - --------------------------------------------------------------------------------- - -via: https://www.jtolio.com/2017/01/magic-gopath - -作者:[jtolio.com][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.jtolio.com/ -[b]: https://github.com/lujun9972 -[1]: https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more -[2]: https://rakyll.org/default-gopath/ -[3]: https://go-review.googlesource.com/32019/ -[4]: https://dave.cheney.net/2016/12/20/thinking-about-gopath -[5]: https://dave.cheney.net/ -[6]: https://twitter.com/davecheney/status/811334240247812097 diff --git a/sources/tech/20200221 Live video streaming with open source Video.js.md b/sources/tech/20200221 Live video streaming with open source Video.js.md deleted file mode 100644 index 93c1a0c4b5..0000000000 --- a/sources/tech/20200221 Live video streaming with open source Video.js.md +++ /dev/null @@ -1,171 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Starryi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Live video streaming with open source Video.js) -[#]: via: (https://opensource.com/article/20/2/video-streaming-tools) -[#]: author: (Aaron J. Prisk https://opensource.com/users/ricepriskytreat) - -Live video streaming with open source Video.js -====== -Video.js is a widely used protocol that will serve your live video -stream to a wide range of devices. -![video editing dashboard][1] - -Last year, I wrote about [creating a video streaming server with Linux][2]. That project uses the Real-Time Messaging Protocol (RMTP), Nginx web server, Open Broadcast Studio (OBS), and VLC media player. - -I used VLC to play our video stream, which may be fine for a small local deployment but isn't very practical on a large scale. First, your viewers have to use VLC, and RTMP streams can provide inconsistent playback. This is where [Video.js][3] comes into play! Video.js is an open source JavaScript framework for creating custom HTML5 video players. Video.js is incredibly powerful, and it's used by a host of very popular websites—largely due to its open nature and how easy it is to get up and running. - -### Get started with Video.js - -This project is based off of the video streaming project I wrote about last year. Since that project was set to serve RMTP streams, to use Video.js, you'll need to make some adjustments to that Nginx configuration. HTTP Live Streaming ([HLS][4]) is a widely used protocol developed by Apple that will serve your stream better to a multitude of devices. HLS will take your stream, break it into chunks, and serve it via a specialized playlist. This allows for a more fault-tolerant stream that can play on more devices. - -First, create a directory that will house the HLS stream and give Nginx permission to write to it: - - -``` -mkdir /mnt/hls -chown www:www /mnt/hls -``` - -Next, fire up your text editor, open the Nginx.conf file, and add the following under the **application live** section: - - -``` -       application live { -            live on; -            # Turn on HLS -            hls on; -            hls_path /mnt/hls/; -            hls_fragment 3; -            hls_playlist_length 60; -            # disable consuming the stream from nginx as rtmp -            deny play all; -} -``` - -Take note of the HLS fragment and playlist length settings. You may want to adjust them later, depending on your streaming needs, but this is a good baseline to start with. Next, we need to ensure that Nginx is able to listen for requests from our player and understand how to present it to the user. So, we'll want to add a new section at the bottom of our nginx.conf file. - - -``` -server { -        listen 8080; - -        location / { -            # Disable cache -            add_header 'Cache-Control' 'no-cache'; - -            # CORS setup -            add_header 'Access-Control-Allow-Origin' '*' always; -            add_header 'Access-Control-Expose-Headers' 'Content-Length'; - -            # allow CORS preflight requests -            if ($request_method = 'OPTIONS') { -                add_header 'Access-Control-Allow-Origin' '*'; -                add_header 'Access-Control-Max-Age' 1728000; -                add_header 'Content-Type' 'text/plain charset=UTF-8'; -                add_header 'Content-Length' 0; -                return 204; -            } - -            types { -                application/dash+xml mpd; -                application/vnd.apple.mpegurl m3u8; -                video/mp2t ts; -            } - -            root /mnt/; -        } -    } -``` - -Visit Video.js's [Getting started][5] page to download the latest release and check out the release notes. Also on that page, Video.js has a great introductory template you can use to create a very basic web player. I'll break down the important bits of that template and insert the pieces you need to get your new HTML player to use your stream. - -The **head** links in the Video.js library from a content-delivery network (CDN). You can also opt to download and store Video.js locally on your web server if you want. - - -``` -<head> -  <link href="" rel="stylesheet" /> - -  <!-- If you'd like to support IE8 (for Video.js versions prior to v7) --> -  <script src="[https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"\>\][6]</script> -</head> -``` - -Now to the real meat of the player. The **body** section sets the parameters of how the video player will be displayed. Within the **video** element, you need to define the properties of your player. How big do you want it to be? Do you want it to have a poster (i.e., a thumbnail)? Does it need any special player controls? This example defines a simple 600x600 pixel player with an appropriate (to me) thumbnail featuring Beastie (the BSD Demon) and Tux (the Linux penguin). - - -``` -<body> -  <video -    id="my-video" -    class="video-js" -    controls -    preload="auto" -    width="600" -    height="600" -    poster="BEASTIE-TUX.jpg" -    data-setup="{}" -  > -``` - -Now that you've set how you want your player to look, you need to tell it what to play. Video.js can handle a large number of different formats, including HLS streams. - - -``` -    <source src="" type="application/x-mpegURL" /> -    <p class="vjs-no-js"> -      To view this video please enable JavaScript, and consider upgrading to a -      web browser that -      <a href="" target="_blank" -        >supports HTML5 video</a -      > -    </p> -  </video> -``` - -### Record your streams - -Keeping a copy of your streams is super easy. Just add the following at the bottom of your **application live** section in the nginx.conf file: - - -``` -# Enable stream recording -record all; -record_path /mnt/recordings/; -record_unique on; -``` - -Make sure that **record_path** exists and that Nginx has permissions to write to it: - - -``` -`chown -R www:www /mnt/recordings` -``` - -### Down the stream - -That's it! You should now have a spiffy new HTML5-friendly live video player. There are lots of great resources out there on how to expand all your video-making adventures. If you have any questions or suggestions, feel free to reach out to me on [Twitter][7] or leave a comment below. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/video-streaming-tools - -作者:[Aaron J. Prisk][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ricepriskytreat -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/video_editing_folder_music_wave_play.png?itok=-J9rs-My (video editing dashboard) -[2]: https://opensource.com/article/19/1/basic-live-video-streaming-server -[3]: https://videojs.com/ -[4]: https://en.wikipedia.org/wiki/HTTP_Live_Streaming -[5]: https://videojs.com/getting-started -[6]: https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"\>\ -[7]: https://twitter.com/AKernelPanic diff --git a/sources/tech/20200303 Watching activity on Linux with watch and tail commands.md b/sources/tech/20200303 Watching activity on Linux with watch and tail commands.md deleted file mode 100644 index 15780a5b34..0000000000 --- a/sources/tech/20200303 Watching activity on Linux with watch and tail commands.md +++ /dev/null @@ -1,148 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Watching activity on Linux with watch and tail commands) -[#]: via: (https://www.networkworld.com/article/3529891/watching-activity-on-linux-with-watch-and-tail-commands.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -Watching activity on Linux with watch and tail commands -====== -The watch and tail commands can help monitor activity on Linux systems. This post looks at some helpful ways to use these commands. -Loops7 / Getty Images - -The **watch** and **tail** commands provide some interesting options for examining activity on a Linux system in an ongoing manner. - -That is, instead of just asking a question and getting an answer (like asking **who** and getting a list of currently logged in users), you can get **watch** to provide you with a display showing who is logged in along with updates as users come and go. - -[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] - -With **tail**, you can display the bottoms of files and see content as it is added. This kind of monitoring is often very helpful and requires less effort than running commands periodically. - -### Using watch - -One of the simplest examples of using **watch** is to use the command **watch who**. You should see a list showing who is logged in along with when they logged in and where they logged in from. Notice that the default is to update the display every two seconds (top left) and that the date and time (upper right) updates itself at that interval. The list of users will grow and shrink as users log in and out. - -### $ watch who - -This command will dissplay a list of logins like this: - -``` -Every 2.0s: who dragonfly: Thu Feb 27 10:52:00 2020 - -nemo pts/0 2020-02-27 08:07 (192.168.0.11) -shs pts/1 2020-02-27 10:58 (192.168.0.5) -``` - -You can change the interval to get less frequent updates by adding a **-n** option (e.g., -n 10) to select a different number of seconds between updates. - -### $ watch -n 10 who - -The new interval will be displayed and the time shown will change less frequently, aligning itself with the selected interval. - -[][2] - -``` -Every 10.0s: who dragonfly: Thu Feb 27 11:05:47 2020 - -nemo pts/0 2020-02-27 08:07 (192.168.0.11) -shs pts/1 2020-02-27 10:58 (192.168.0.5) -``` - -If you prefer to see only the command's output and not the heading (the top 2 lines), you can omit those lines by adding the **-t** (no title) option. - -### $ watch -t who - -Your display will then look like this: - -``` -nemo pts/0 2020-02-27 08:07 (192.168.0.11) -shs pts/1 2020-02-27 10:58 (192.168.0.5) -``` - -If every time the watched command runs, its output is the same, only the title line (if not omitted) will change. The rest of the displayed information will stay the same. - -If you want your **watch** command to exit as soon as the output of the command that it is watching changes, you can use a **-g** (think of this as the "go away") option. You might choose to do this if, for example, you are simply waiting for others to start logging into the system. - -You can also highlight changes in the displayed output using the **-d** (differences) option. The highlighting will only last for one interval (2 seconds by default), but can help to draw your attention to the changes. - -Here's a more complex example of using the **watch** command to display services that are listening for connections and the ports they are using. While the output isn't likely to change, it would alert you to any new service starting up or one going down. - -``` -$ watch 'sudo lsof -i -P -n | grep LISTEN' -``` - -Notice that the command being run needs to be enclosed in quotes to ensure that the **watch** command doesn't send its output to the grep command. - -Using the **watch -h** command will provide you with a list of the command's options. - -``` -$ watch -h - -Usage: - watch [options] command - -Options: - -b, --beep beep if command has a non-zero exit - -c, --color interpret ANSI color and style sequences - -d, --differences[=] - highlight changes between updates - -e, --errexit exit if command has a non-zero exit - -g, --chgexit exit when output from command changes - -n, --interval seconds to wait between updates - -p, --precise attempt run command in precise intervals - -t, --no-title turn off header - -x, --exec pass command to exec instead of "sh -c" - - -h, --help display this help and exit - -v, --version output version information and exit -``` - -### Using tail -f - -The **tail -f** command has something in common with **watch**. It will both display the bottom of a file and additional content as it is added. Instead of having to run a "tail" command again and again, you run one command and get a repeatedly updated view of its output. For example, you could watch a system log with a command like this: - -``` -$ tail -f /var/log/syslog -``` - -Some files, like **/var/log/wtmp**, don't lend themselves to this type of handling because they're not formatted as normal text files, but you could get a similar result by combining **watch** and **tail** like this: - -``` -watch 'who /var/log/wtmp | tail -20' -``` - -This command will display the most recent 5 logins regardless of how many of the users are still logged in. If another login occurs, a line will be added and the top line removed. - -``` -Every 60.0s: who /var/log/wtmp | tail -5 dragonfly: Thu Feb 27 12:46:07 2020 - -shs pts/0 2020-02-27 08:07 (192.168.0.5) -nemo pts/1 2020-02-27 08:26 (192.168.0.5) -shs pts/1 2020-02-27 10:58 (192.168.0.5) -nemo pts/1 2020-02-27 11:34 (192.168.0.5) -dory pts/1 2020-02-27 12:14 (192.168.0.5) -``` - -Both the **watch** and **tail -f** commands can provide auto-updating views of information that you might at times want to monitor, making the task of monitoring quite a bit easier whether you're monitoring processes, logins or system resources. - -Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3529891/watching-activity-on-linux-with-watch-and-tail-commands.html - -作者:[Sandra Henry-Stocker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/newsletters/signup.html -[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) -[3]: https://www.facebook.com/NetworkWorld/ -[4]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20200330 Why I switched from Mac to Linux.md b/sources/tech/20200330 Why I switched from Mac to Linux.md deleted file mode 100644 index 95561b6b45..0000000000 --- a/sources/tech/20200330 Why I switched from Mac to Linux.md +++ /dev/null @@ -1,68 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why I switched from Mac to Linux) -[#]: via: (https://opensource.com/article/20/3/mac-linux) -[#]: author: (Lee Tusman https://opensource.com/users/leeto) - -Why I switched from Mac to Linux -====== -After 25 years, Lee made the switch to Linux and couldn't be happier. -Here's what he uses. -![Code going into a computer.][1] - -In 1994, my family bought a Macintosh Performa 475 as a home computer. I had used Macintosh SE computers in school and learned to type with [Mavis Beacon Teaches Typing][2], so I've been a Mac user for well over 25 years. Back in the mid-1990s, I was attracted to its ease of use. It didn't start with a DOS command prompt; it opened to a friendly desktop. It was playful. And even though there was a lot less software for Macintosh than PCs, I thought the Mac ecosystem was better, just on the strength of KidPix and Hypercard, which I still think of as the unsurpassed, most intuitive _creative stack_. - -Even so, I still had the feeling that Mac was an underdog compared to Windows. I remember thinking the company could disappear one day. Flash-forward decades later, and Apple is a behemoth, a trillion-dollar company. But as it evolved, it changed significantly. Some changes have been for the better, such as better stabilization, simpler hardware choices, increased security, and more accessibility options. Other changes annoyed me—not all at once, but slowly. Most significantly, I am annoyed by Apple's closed ecosystem—the difficulty of accessing photos without iPhoto; the necessity of using iTunes; and the enforced bundling of the Apple store ecosystem even when I don't want to use it. - -Over time, I found myself working largely in the terminal. I used iTerm2 and the [Homebrew][3] package manager. I couldn't get all my Linux software to work, but much of it did. I thought I had the best of both worlds: the macOS graphical operating system and user interface alongside the ability to jump into a quick terminal session. - -Later, I began using Raspberry Pi computers booting Raspbian. I also collected a number of very old laptops rescued from the trash at universities, so, by necessity, I decided to try out various Linux distros. While none of them became my main machine, I started to really enjoy using Linux. I began to consider what it would be like to try running a Linux distro as my daily driver, but I thought the Macbook's comfort and ease, especially the hardware's size and weight, would be hard to find in a non-Mac laptop. - -## Time to make the switch? - -About two years ago, I began using a Dell for work. It was a larger laptop with an integrated GPU, and dual-booted Linux and Windows. I used it for game development, 3D modeling, some machine learning, and basic programming in C# and Java. I considered making it my primary machine, but I loved the portability of my Macbook Air, and continued to use that as well. - -Last fall, I started to notice my Air was running hot, and the fan was coming on more often. My primary machine was starting to show its age. For years, I used the Mac's terminal to access Darwin's Unix-like operating system, and I was spending more and more time bouncing between the terminal and my web browser. Was it time to make the switch? - -I began exploring the possibilities for a Macbook-like Linux laptop. After doing some research, reading reviews and message boards, I went with the long-celebrated Dell XPS 13 Developer Edition 7390, opting for the 10th Generation i7. I chose it because I love the feel of the Macbook (and especially the slim Macbook Air), and reviews of the XPS 13 suggested it seemed it was similar, with really positive reviews of the trackpad and keyboard. - -Most importantly, it came loaded with Ubuntu. While it's easy enough to get a PC, wipe it, and install a new Linux distro, I was attracted to the cohesive operating system and hardware, but one that allowed a lot of the customization we know and love in Linux. So when there was a sale, I took the plunge and purchased it. - -## What it's like to run Linux daily - -I've been using the XPS 13 for three months and my dual-booted Linux work laptop for two years. At first, I thought I'd want to spend more time finding an alternate desktop environment or window manager that was more Mac-like, such as [Enlightenment][4]. I tried several, but I have to say, I like the simplicity of running [GNOME][5] out of the box. For one thing, it's minimal; there's not much GUI to get caught up in. In fact, it's intuitive and the [overview][6] takes only a couple minutes to read.  - -I can access my applications through the application dash bar or a grid button to get to the application view. To access my file system, I click on the **Files** icon in the dash. To open the GNOME terminal, I type **Ctrl+Alt+T** or just **Alt+Tab** to switch between an open application and an open terminal. It's also easy to define your own [custom hotkey shortcuts][7]. - -Beyond this, there's not much else to say. Unlike the Mac's desktop, there's not a lot to get lost in, which means there's less to distract me from my work or the applications I want to run. I didn't realize all the options or how much time I spent navigating windows on my Mac. In Linux, there are just files, applications, and the terminal. - -I installed the [i3 tiling window manager][8] to do a test run. I had a few issues configuring it because I type in [Dvorak][9], and i3 doesn't adapt to the alternate keyboard configuration. I think with more effort, I could figure out a new keyboard mapping in i3, but the main thing I was looking for was simple tiling. - -I looked up GNOME's tiling capabilities and was pleasantly surprised. You press the **Super** key (for me, it's the key with the Windows logo—which I should cover with a sticker!) and then a modifier key. For example, pressing **Super+Left** moves your current window to a tile on the left side of the screen. **Super+Right** moves to the right half. **Super+Up** maximizes the current window. **Super+Down** reverts to the previous size. You can move between app windows with **Alt+Tab**. This is all default behavior and can be customized in the Keyboard settings. - -Plugging in headphones or connecting to HDMI works the way you expect. Sometimes, I open the Sound settings to switch between the HDMI sound output or my external audio cable, just as I would on a Mac or PC. The trackpad is responsive, and I haven't noticed any difference from the Macbook's. When I plug in a three-button mouse, it works instantly, even with my Bluetooth mouse and keyboard. - -### Software - -I installed Atom, VLC, Keybase, Brave Browser, Krita, Blender, and Thunderbird in a matter of minutes. I installed other software with the Apt package manager in the terminal (as normal), which offers many more packages than the Homebrew package manager for macOS. - -### Music - -I have a variety of options for listening to music. I use Spotify and [PyRadio][10] to stream music. [Rhythmbox][11] is installed by default on Ubuntu; the simple music player launches instantly and without any bloat. Simply click on the menu, choose **Add Music**, and navigate to a directory of audio tracks (it searches recursively). You can also stream podcasts or online radio easily. - -### Text and PDFs - -I tend to write in Markdown in [Neovim][12] with some plugins, then convert my document using Pandoc to whatever final format is needed. For a nice Markdown editor with preview, I downloaded [Ghostwriter][13], a minimal-focus writing application. - -If someone sends me a Microsoft Word document, I can open it using the default LibreOffice Writer application. - -Occasionally, I have to sign a document. This is easy with macOS's Preview application and my signature in PNG format, and I needed a Linux equivalent. I found that the default PDF viewer app didn't have the annotation tools I needed. The LibreOffice Draw program was acceptable but not particularly easy to use, and it occasionally crashed. Based on some research, I installed [Xournal][14], which has the simple annotation tools I need to add dates, text, and my signature and is fairly comparable to Mac's Preview app. It works exactly as needed. - -### Importing images from my phone - -I have an iPhone. To get my images off the phone, there are a number of methods to sync and access your files. If you have a different phone, your process may be different. Here's my method: - - 1. Install gvfs-backends with **sudo apt install gvfs-backends**, which is part of the GNO \ No newline at end of file diff --git a/sources/tech/20200426 6 tips for securing your WordPress website.md b/sources/tech/20200426 6 tips for securing your WordPress website.md deleted file mode 100644 index 757ff42d30..0000000000 --- a/sources/tech/20200426 6 tips for securing your WordPress website.md +++ /dev/null @@ -1,175 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (6 tips for securing your WordPress website) -[#]: via: (https://opensource.com/article/20/4/wordpress-security) -[#]: author: (Lucy Carney https://opensource.com/users/lucy-carney) - -6 tips for securing your WordPress website -====== -Even beginners can—and should—take these steps to protect their -WordPress sites against cyberattacks. -![A lock on the side of a building][1] - -Already powering over 30% of the internet, WordPress is the fastest-growing content management system (CMS) in the world—and it's not hard to see why. With tons of customization available through coding and plugins, top-notch SEO, and a supreme reputation for blogging, WordPress has certainly earned its popularity. - -However, with popularity comes other, less appealing attention. WordPress is a common target for intruders, malware, and cyberattacks—in fact, WordPress accounted for around [90% of hacked CMS platforms][2] in 2019. - -Whether you're a first-time WordPress user or an experienced developer, there are important steps you can take to protect your WordPress website. The following six key tips will get you started. - -### 1\. Choose reliable hosting - -Hosting is the unseen foundation of all websites—without it, you can't publish your site online. But hosting does much more than simply host your site. It's also responsible for site speed, performance, and security. - -The first thing to do is to check if a host includes SSL security in its plans. - -SSL is an essential security feature for all websites, whether you're running a small blog or a large online store. You'll need a more [advanced SSL certificate][3] if you're accepting payments, but for most sites, the basic free SSL should be fine. - -Other security features to look out for include: - - * Frequent, automatic offsite backups - * Malware and antivirus scanning and removal - * Distributed denial of service (DDoS) protection - * Real-time network monitoring - * Advanced firewall protection - - - -In addition to these digital security features, it's worth thinking about your hosting provider's _physical_ security measures as well. These include limiting access to data centers with security guards, CCTV, and two-factor or biometric authentication. - -### 2\. Use security plugins - -One of the best—and easiest—ways of protecting your website's security is to install a security plugin, such as [Sucuri][4], which is an open source, GPLv2 licensed project. Security plugins are vitally important because they automate security, which means you can focus on running your site rather than committing all your time to fighting off online threats. - -These plugins detect and block malicious attacks and alert you about any issues that require your attention. In short, they constantly work in the background to protect your site, meaning you don't have to stay awake 24/7 to fight off hackers, bugs, and other digital nasties. - -A good security plugin will provide all the essential security features you need for free, but some advanced features require a paid subscription. For example, you'll need to pay if you want to unlock [Sucuri's website firewall][5]. Enabling a web application firewall (WAF) blocks common threats and adds an extra layer of security to your site, so it's a good idea to look for this feature when choosing a security plugin. - -### 3\. Choose trustworthy plugins and themes - -The joy of WordPress is that it is open source, so anyone and everyone can pitch in with themes and plugins that they've developed. This can also pose problems when it comes to picking a high-quality theme or plugin. - -It serves to be cautious when picking a free theme or plugin, as some are poorly designed—or worse, may hide malicious code. - -To avoid this, always source free themes and plugins from reputable sources, such as the WordPress library. Always read reviews and research the developer to see if they've built any other programs. - -Outdated or poorly designed themes and plugins can leave "backdoors" open for attackers or bugs to get into your site, which is why it pays to be careful in your choices. However, you should also be wary of nulled or cracked themes. These are premium themes that have been compromised by hackers and are for sale illegally. You might buy a nulled theme believing that it's all above-board—only to have your site damaged by hidden malicious code. - -To avoid nulled themes, don't get drawn in by discounted prices, and always stick to reputable stores, such as the official [WordPress directory][6]. If you're looking elsewhere, stick to large and trusted stores, such as [Themify][7], a theme and plugin store that has been running since 2010. Themify ensures all its WordPress themes pass the [Google Mobile-Friendly][8] test and are open source under the [GNU General Public License][9]. - -### 4\. Run regular updates - -It's a fundamental WordPress rule: _always keep your site up to date._ However, it's a rule not everyone sticks to—in fact, only [43% of WordPress sites][10] are running the latest version. - -The problem is that when your site becomes outdated, it becomes susceptible to glitches, bugs, intrusions, and crashes because it falls behind on security and performance fixes. Outdated sites can't fix bugs the same way as updated sites can, and attackers can tell which sites are outdated. This means they can search for the most vulnerable sites and attack accordingly. - -This is why you should always run your site on the latest version of WordPress. And in order to keep your security at its strongest, you must update your plugins and themes as well as your core WordPress software. - -If you choose a managed WordPress hosting plan, you might find that your provider will check and run updates for you—be clear whether your host offers software _and_ plugin updates. If not, you can install an open source plugin manager, such as the GPLv2-licensed [Easy Updates Manager plugin][11], as an alternative. - -### 5\. Strengthen your logins - -Aside from creating a secure WordPress website through carefully choosing your theme and installing security plugins, you also need to safeguard against unauthorized access through logins. - -#### Password protection - -The first and simplest way to strengthen your login security is to change your password—especially if you're using an [easily guessed phrase][12] such as "123456" or "qwerty." - -Instead, try to use a long passphrase rather than a password, as they are harder to crack. The best way is to use a series of unrelated words strung together that you find easy to remember. - -Here are some other tips: - - * Never reuse passwords - * Don't include obvious words such as family members' names or your favorite football team - * Never share your login details with anyone - * Include capitals and numbers to add complexity to your passphrase - * Don't write down or store your login details anywhere - * Use a [password manager][13] - - - -#### Change your login URL - -It's a good idea to change your default login web address from the standard format: yourdomain.com/wp-admin. This is because hackers know this is the default URL, so you risk brute-force attacks by not changing it. - -To avoid this, change the URL to something different. Use an open source plugin such as the GPLv2-licensed [WPS Hide Login][14] for safe, quick, and easy customization. - -#### Apply two-factor authentication - -For extra protection against unauthorized logins and brute-force attacks, you should add two-factor authentication. This means that even if someone _does_ get access to your login details, they'll need a code that's sent directly to your phone to gain access to your WordPress site's admin. - -Adding two-factor authentication is pretty easy. Simply install yet another plugin—this time, search the WordPress Plugin Directory for "two-factor authentication," and select the plugin you want. One option is [Two Factor][15], a popular GPLv2 licensed project that has over 10,000 active installations. - -#### Limit login attempts - -WordPress tries to be helpful by letting you guess your login details as many times as you like. However, this is also helpful to hackers trying to gain unauthorized access to your WordPress site to release malicious code. - -To combat brute-force attacks, install a plugin that limits login attempts and set how many guesses you want to allow. - -### 6\. Disable file editing - -This isn't such a beginner-friendly step, so don't attempt it unless you're a confident coder—and always back up your site first! - -That said, disabling file editing _is_ an important measure if you're really serious about protecting your WordPress website. If you don't hide your files, it means anyone can edit your theme and plugin code straight from the admin area—which is dangerous if an intruder gets in. - -To deny unauthorized access, go to your **wp-config.php** file and enter: - - -``` -<Files wp-config.php> -order allow,deny -deny from all -</Files> -``` - -Or, to remove the theme and plugin editing options from your WordPress admin area completely, edit your **wp-config.php** file by adding: - - -``` -`define( 'DISALLOW_FILE_EDIT', true );` -``` - -Once you've saved and reloaded the file, the plugin and theme editors will disappear from your menus within the WordPress admin area, stopping anyone from editing your theme or plugin code—including you**.** Should you need to restore access to your theme and plugin code, just delete the code you added to your **wp-config.php** file when you disabled editing. - -Whether you block unauthorized access or totally disable file editing, it's important to take action to protect your site's code. Otherwise, it's easy for unwelcome visitors to edit your files and add new code. This means an attacker could use the editor to gather data from your WordPress site or even use your site to launch attacks on others. - -For an easier way of hiding your files, you can use a security plugin that will do it for you, such as Sucuri. - -### WordPress security recap - -WordPress is an excellent open source platform that should be enjoyed by beginners and developers alike without the fear of becoming a victim of an attack. Sadly, these threats aren't going anywhere anytime soon, so it's vital to stay on top of your site's security. - -Using the measures outlined above, you can create a stronger, more secure level of protection for your WordPress site and ensure a much more enjoyable experience for yourself. - -Staying secure is an ongoing commitment rather than a one-time checklist, so be sure to revisit these steps regularly and stay alert when building and using your CMS. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/wordpress-security - -作者:[Lucy Carney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/lucy-carney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_3reasons.png?itok=k6F3-BqA (A lock on the side of a building) -[2]: https://cyberforces.com/en/wordpress-most-hacked-cms -[3]: https://opensource.com/article/19/11/internet-security-tls-ssl-certificate-authority -[4]: https://wordpress.org/plugins/sucuri-scanner/ -[5]: https://sucuri.net/website-firewall/ -[6]: https://wordpress.org/themes/ -[7]: https://themify.me/ -[8]: https://developers.google.com/search/mobile-sites/ -[9]: http://www.gnu.org/licenses/gpl.html -[10]: https://wordpress.org/about/stats/ -[11]: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/ -[12]: https://www.forbes.com/sites/kateoflahertyuk/2019/04/21/these-are-the-worlds-most-hacked-passwords-is-yours-on-the-list/#4f157c2f289c -[13]: https://opensource.com/article/16/12/password-managers -[14]: https://wordpress.org/plugins/wps-hide-login/ -[15]: https://en-gb.wordpress.org/plugins/two-factor/ diff --git a/sources/tech/20200429 Open source live streaming with Open Broadcaster Software.md b/sources/tech/20200429 Open source live streaming with Open Broadcaster Software.md deleted file mode 100644 index 748786de77..0000000000 --- a/sources/tech/20200429 Open source live streaming with Open Broadcaster Software.md +++ /dev/null @@ -1,137 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Open source live streaming with Open Broadcaster Software) -[#]: via: (https://opensource.com/article/20/4/open-source-live-stream) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Open source live streaming with Open Broadcaster Software -====== -If you have something to say, a skill to teach, or just something fun to -share, broadcast it to the world with OBS. -![An old-fashioned video camera][1] - -If you have a talent you want to share with the world, whether it's making your favorite sourdough bread or speedrunning through a level of your favorite video game, live streaming is the modern show-and-tell. It's a powerful way to tell the world about your hobby through a medium once reserved for exclusive and expensive TV studios. Not only is the medium available to anyone with a relatively good internet connection, but the most popular software to make it happen is open source. - -[OBS][2] (Open Broadcaster Software) is a cross-platform application that serves as a control center for your live stream. A _stream_, strictly speaking, means _progressive and coherent data_. The data in a stream can be audio, video, graphics, text, or anything else you can represent as digital data. OBS is programmed to accept data as input, combine streams together (technically referred to as _mixing_) into one product, and then broadcast it. - -![OBS flowchart][3] - -A _broadcast_ is data that can be received by some target. If you're live streaming, your primary target is a streaming service that can host your stream, so other people can find it in a web browser or media player. A live stream is a live event, so people have to "tune in" to your stream when it's happening, or else they miss it. However, you can also target your own hard drive so you can record a presentation and then post it on the internet later for people to watch at their leisure. - -### Installing OBS - -To install OBS on Windows or macOS, download an installer package from [OBS's website][2]. - -To install OBS on Linux, either install it with your package manager (such as **dnf**, **zypper**, or **apt**) or [install it as a Flatpak][4]. - -### Join a streaming service - -In order to live stream, you must have a stream broker. That is, you need a central location on the internet for your stream to be delivered, so your viewers can get to what you're broadcasting. There are a few popular streaming services online, like YouTube and Twitch. You can also [set up your own video streaming server][5] using open source software. - -Regardless of which option you choose, before you begin streaming, you must have a destination for your stream. If you do use a streaming service, you must obtain a _streaming key_. A streaming key is a hash value (it usually looks something like **2ae2fad4e33c3a89c21**) that is private and unique to you. You use this key to authenticate yourself through your streaming software. Without it, the streaming service can't know you are who you say you are and won't let you broadcast over your user account. - -* * * - -* * * - -* * * - -**![Streaming key][6]** - - * In Twitch, your **Primary Stream Key** is available in the **Channel** panel of your **Creator Dashboard**. - * On YouTube, you must enable live streaming by verifying your account. Once you've done that, your **Stream Key** is in the **Other Features** menu option of your **Channel Dashboard**. - * If you're using your own server, there's no maze-like GUI to navigate. You just [create your own streaming key][7]. - - - -### Enter your streaming key - -Once you have a streaming key, launch OBS and go to the **File** > **Settings** menu. - -In the **Settings** window, click on the **Stream** category in the left column. Set the **Service** to your stream service (Custom, Twitch, YouTube, etc.), and enter your stream key. Click the **OK** button in the bottom right to save your changes. - -### Create sources - -In OBS, _sources_ represent any input signal you want to stream. By default, sources are listed at the bottom of the OBS window. - -![OBS sources][8] - -This might be a webcam, a microphone, an audio stream (such as the sound of a video game you're playing), a screen capture of your computer (a "screencast"), a slideshow you want to present, an image, and so on. Before you start streaming, you should define all the sources you plan on using for your stream. This means you have to do a little pre-production and consider what you anticipate for your show. Any camera you have set up must be defined as a source in OBS. Any extra media you plan on cutting to during your show must be defined as a source. Any sound effects or background music must be defined as a source. - -Not all sources "happen" at once. By adding media to your **Sources** panel in OBS, you're just assembling the raw components for your stream. Once you make devices and data available to OBS, you can create your **Scenes**. - -#### Setting up audio - -Computers have seemingly dozens of ways to route audio. Here's the workflow to follow when setting up sound for your stream: - - 1. Check your cables: verify that your microphone is plugged in. - 2. Go to your computer's sound control panel and set the input to whatever microphone you want OBS to treat as the main microphone. This might be a gaming headset or a boom mic or a desktop podcasting mic or a Bluetooth device or a fancy audio interface with XLR ports. Whatever it is, make sure your computer "hears" your main sound input. - 3. In OBS, create a source for your main microphone and name it something obvious (e.g., boom mic, master sound, or mic). - 4. Do a test. Make sure OBS "hears" your microphone by referring to the audio-level monitors at the bottom of the OBS window. If it's not responding to the input you believe you've set as input, check your cables, check your computer sound control panel, and check OBS. - - - -I've seen more people panic over audio sources than any other issue when streaming, and we've _all_ made the same dumb mistakes (several times each, probably!) when attempting to set a microphone for a live stream or videoconference call. Breathe deep, check your cables, check your inputs and outputs, and [get comfortable with audio][9]. It'll pay off in the end. - -### Create scenes - -A **Scene** in OBS is a screen layout and consists of one or more sources. - -![Scenes in OBS][10] - -For instance, you might create a scene called **Master shot** that shows you sitting at your desk in front of your computer or at the kitchen counter ready to mix ingredients together. The source could be a webcam mounted on a tripod a meter or two in front of you. Because you want to cut to a detail shot, you might create a second scene called **Close-up**, which uses the computer screen and audio as one input source and your microphone as another source, so you can narrate as you demonstrate what you're doing. If you're doing a baking show, you might want to mount a second webcam above the counter, so you can cut to an overhead shot of ingredients being mixed. Here, your source is a different webcam but probably the same microphone (to avoid making changes in the audio). - -A _scene_, in other words, is a lot like a _shot_ in traditional production vernacular, but it can be the combination of many shots. The fun thing about OBS is that you can mix and match a lot of different sources together, so when you're adding a **Scene**, you can resize and position different sources to achieve picture-in-picture, or split-screen, or any other effect you might want. It's common in video game "let's play" streams to have the video game in full-screen, with the player inset in the lower right or left. Or, if you're recording a panel or a multi-player game like D&D you might have several cameras covering several players in a _Brady Bunch_ grid. - -The possibilities are endless. During streaming, you can cut from one scene to another as needed. This is intended to be a dynamic system, so you can change scenes depending on what the viewer needs to see at any given moment. - -Generally, you want to have some preset scenes before you start to stream. Even if you have a friend willing to do video mixing as you stream, you always want a safe scene to fall back to, so take time beforehand to set up at least a master shot that shows you doing whatever it is you're doing. If all else fails, at least you'll have your main shot you can safely and reliably cut to. - -### Transitions - -When switching from one scene to another, OBS uses a transition. Once you have more than one scene, you can configure what kind of transition it uses in the **Transitions** panel. Simple transitions are usually best. By default, OBS uses a subtle crossfade, but you can experiment with others as you see fit. - -### Go live - -To start streaming, do your vocal exercises, find your motivation, and press the **Start Streaming** button. - -![Start streaming in OBS][11] - -As long as you've set up your streaming service correctly, you're on the air (or on the wires, anyway). - -If you're the talent (the person in front of the camera), it might be easiest to have someone control OBS during streaming. But if that's not possible, you can control it yourself as long as you've practiced a little in advance. If you're screencasting, it helps to have a two-monitor setup so you can control OBS without it being on screen. - -### Streaming for success - -Many of us take streaming for granted now that the internet exists and can broadcast media created by _anyone_. It's a hugely powerful means of communication, and we're all responsible for making the most of it. - -If you have something positive to say, a skill to teach, words of encouragement, or just something fun that you want to share, and you feel like you want to broadcast to the world, then take the time to learn OBS. You might not get a million viewers, but independent media is a vital part of [free culture][12]. The world can always use empowering and positive open source voices, and yours may be one of the most important of all. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/open-source-live-stream - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_film.png?itok=aElrLLrw (An old-fashioned video camera) -[2]: http://obsproject.com -[3]: https://opensource.com/sites/default/files/obs-flowchart.jpg (OBS flowchart) -[4]: https://flatpak.org/setup -[5]: https://opensource.com/article/19/1/basic-live-video-streaming-server -[6]: https://opensource.com/sites/default/files/twitch-key.jpg (Streaming key) -[7]: https://opensource.com/article/19/1/basic-live-video-streaming-server#obs -[8]: https://opensource.com/sites/default/files/uploads/obs-sources.jpg (OBS sources) -[9]: https://opensource.com/article/17/1/linux-plays-sound -[10]: https://opensource.com/sites/default/files/uploads/obs-scenes.jpg (Scenes in OBS) -[11]: https://opensource.com/sites/default/files/uploads/obs-stream-start.jpg (Start streaming in OBS) -[12]: https://opensource.com/article/18/1/creative-commons-real-world diff --git a/sources/tech/20200507 Using the systemctl command to manage systemd units.md b/sources/tech/20200507 Using the systemctl command to manage systemd units.md deleted file mode 100644 index e305cee36c..0000000000 --- a/sources/tech/20200507 Using the systemctl command to manage systemd units.md +++ /dev/null @@ -1,618 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using the systemctl command to manage systemd units) -[#]: via: (https://opensource.com/article/20/5/systemd-units) -[#]: author: (David Both https://opensource.com/users/dboth) - -Using the systemctl command to manage systemd units -====== -Units are the basis of everything in systemd. -![woman on laptop sitting at the window][1] - -In the first two articles in this series, I explored the Linux systemd startup sequence. In the [first article][2], I looked at systemd's functions and architecture and the controversy around its role as a replacement for the old SystemV init program and startup scripts. And in the [second article][3], I examined two important systemd tools, systemctl and journalctl, and explained how to switch from one target to another and to change the default target. - -In this third article, I'll look at systemd units in more detail and how to use the systemctl command to explore and manage units. I'll also explain how to stop and disable units and how to create a new systemd mount unit to mount a new filesystem and enable it to initiate during startup. - -### Preparation - -All of the experiments in this article should be done as the root user (unless otherwise specified). Some of the commands that simply list various systemd units can be performed by non-root users, but the commands that make changes cannot. Make sure to do all of these experiments only on non-production hosts or virtual machines (VMs). - -One of these experiments requires the sysstat package, so install it before you move on. For Fedora and other Red Hat-based distributions you can install sysstat with: - - -``` -`dnf -y install sysstat` -``` - -The sysstat RPM installs several statistical tools that can be used for problem determination. One is [System Activity Report][4] (SAR), which records many system performance data points at regular intervals (every 10 minutes by default). Rather than run as a daemon in the background, the sysstat package installs two systemd timers. One timer runs every 10 minutes to collect data, and the other runs once a day to aggregate the daily data. In this article, I will look briefly at these timers but wait to explain how to create a timer in a future article. - -### systemd suite - -The fact is, systemd is more than just one program. It is a large suite of programs all designed to work together to manage nearly every aspect of a running Linux system. A full exposition of systemd would take a book on its own. Most of us do not need to understand all of the details about how all of systemd's components fit together, so I will focus on the programs and components that enable you to manage various Linux services and deal with log files and journals. - -### Practical structure - -The structure of systemd—outside of its executable files—is contained in its many configuration files. Although these files have different names and identifier extensions, they are all called "unit" files. Units are the basis of everything systemd. - -Unit files are ASCII plain-text files that are accessible to and can be created or modified by a sysadmin. There are a number of unit file types, and each has its own man page. Figure 1 lists some of these unit file types by their filename extensions and a short description of each. - -systemd unit | Description ----|--- -.automount | The **.automount** units are used to implement on-demand (i.e., plug and play) and mounting of filesystem units in parallel during startup. -.device | The **.device** unit files define hardware and virtual devices that are exposed to the sysadmin in the **/dev/directory**. Not all devices have unit files; typically, block devices such as hard drives, network devices, and some others have unit files. -.mount | The **.mount** unit defines a mount point on the Linux filesystem directory structure. -.scope | The **.scope** unit defines and manages a set of system processes. This unit is not configured using unit files, rather it is created programmatically. Per the **systemd.scope** man page, “The main purpose of scope units is grouping worker processes of a system service for organization and for managing resources.” -.service | The **.service** unit files define processes that are managed by systemd. These include services such as crond cups (Common Unix Printing System), iptables, multiple logical volume management (LVM) services, NetworkManager, and more. -.slice | The **.slice** unit defines a “slice,” which is a conceptual division of system resources that are related to a group of processes. You can think of all system resources as a pie and this subset of resources as a “slice” out of that pie. -.socket | The **.socket** units define interprocess communication sockets, such as network sockets. -.swap | The **.swap** units define swap devices or files. -.target | The **.target** units define groups of unit files that define startup synchronization points, runlevels, and services. Target units define the services and other units that must be active in order to start successfully. -.timer | The **.timer** unit defines timers that can initiate program execution at specified times. - -### systemctl - -I looked at systemd's startup functions in the [second article][3], and here I'll explore its service management functions a bit further. systemd provides the **systemctl** command that is used to start and stop services, configure them to launch (or not) at system startup, and monitor the current status of running services. - -In a terminal session as the root user, ensure that root's home directory ( **~** ) is the [PWD][5]. To begin looking at units in various ways, list all of the loaded and active systemd units. systemctl automatically pipes its [stdout][6] data stream through the **less** pager, so you don't have to: - - -``` -[root@testvm1 ~]# systemctl -UNIT                                       LOAD   ACTIVE SUB       DESCRIPTION               -proc-sys-fs-binfmt_misc.automount          loaded active running   Arbitrary Executable File> -sys-devices-pci0000:00-0000:00:01.1-ata7-host6-target6:0:0-6:0:0:0-block-sr0.device loaded a> -sys-devices-pci0000:00-0000:00:03.0-net-enp0s3.device loaded active plugged   82540EM Gigabi> -sys-devices-pci0000:00-0000:00:05.0-sound-card0.device loaded active plugged   82801AA AC'97> -sys-devices-pci0000:00-0000:00:08.0-net-enp0s8.device loaded active plugged   82540EM Gigabi> -sys-devices-pci0000:00-0000:00:0d.0-ata1-host0-target0:0:0-0:0:0:0-block-sda-sda1.device loa> -sys-devices-pci0000:00-0000:00:0d.0-ata1-host0-target0:0:0-0:0:0:0-block-sda-sda2.device loa> -<snip – removed lots of lines of data from here> - -LOAD   = Reflects whether the unit definition was properly loaded. -ACTIVE = The high-level unit activation state, i.e. generalization of SUB. -SUB    = The low-level unit activation state, values depend on unit type. - -206 loaded units listed. Pass --all to see loaded but inactive units, too. -To show all installed unit files use 'systemctl list-unit-files'. -``` - -As you scroll through the data in your terminal session, look for some specific things. The first section lists devices such as hard drives, sound cards, network interface cards, and TTY devices. Another section shows the filesystem mount points. Other sections include various services and a list of all loaded and active targets. - -The sysstat timers at the bottom of the output are used to collect and generate daily system activity summaries for SAR. SAR is a very useful problem-solving tool. (You can learn more about it in Chapter 13 of my book [_Using and Administering Linux: Volume 1, Zero to SysAdmin: Getting Started_][7].) - -Near the very bottom, three lines describe the meanings of the statuses (loaded, active, and sub). Press **q** to exit the pager. - -Use the following command (as suggested in the last line of the output above) to see all the units that are installed, whether or not they are loaded. I won't reproduce the output here, because you can scroll through it on your own. The systemctl program has an excellent tab-completion facility that makes it easy to enter complex commands without needing to memorize all the options: - - -``` -`[root@testvm1 ~]# systemctl list-unit-files` -``` - -You can see that some units are disabled. Table 1 in the man page for systemctl lists and provides short descriptions of the entries you might see in this listing. Use the **-t** (type) option to view just the timer units: - - -``` -[root@testvm1 ~]# systemctl list-unit-files -t timer -UNIT FILE                    STATE   -[chrony-dnssrv@.timer][8]         disabled -dnf-makecache.timer          enabled -fstrim.timer                 disabled -logrotate.timer              disabled -logwatch.timer               disabled -[mdadm-last-resort@.timer][9]     static   -mlocate-updatedb.timer       enabled -sysstat-collect.timer        enabled -sysstat-summary.timer        enabled -systemd-tmpfiles-clean.timer static   -unbound-anchor.timer         enabled -``` - -You could do the same thing with this alternative, which provides considerably more detail: - - -``` -[root@testvm1 ~]# systemctl list-timers -Thu 2020-04-16 09:06:20 EDT  3min 59s left n/a                          n/a           systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service -Thu 2020-04-16 10:02:01 EDT  59min left    Thu 2020-04-16 09:01:32 EDT  49s ago       dnf-makecache.timer          dnf-makecache.service -Thu 2020-04-16 13:00:00 EDT  3h 57min left n/a                          n/a           sysstat-collect.timer        sysstat-collect.service -Fri 2020-04-17 00:00:00 EDT  14h left      Thu 2020-04-16 12:51:37 EDT  3h 49min left mlocate-updatedb.timer       mlocate-updatedb.service -Fri 2020-04-17 00:00:00 EDT  14h left      Thu 2020-04-16 12:51:37 EDT  3h 49min left unbound-anchor.timer         unbound-anchor.service -Fri 2020-04-17 00:07:00 EDT  15h left      n/a                          n/a           sysstat-summary.timer        sysstat-summary.service - -6 timers listed. -Pass --all to see loaded but inactive timers, too. -[root@testvm1 ~]# -``` - -Although there is no option to do systemctl list-mounts, you can list the mount point unit files: - - -``` -[root@testvm1 ~]# systemctl list-unit-files -t mount -UNIT FILE                     STATE     --.mount                       generated -boot.mount                    generated -dev-hugepages.mount           static   -dev-mqueue.mount              static   -home.mount                    generated -proc-fs-nfsd.mount            static   -proc-sys-fs-binfmt_misc.mount disabled -run-vmblock\x2dfuse.mount     disabled -sys-fs-fuse-connections.mount static   -sys-kernel-config.mount       static   -sys-kernel-debug.mount        static   -tmp.mount                     generated -usr.mount                     generated -var-lib-nfs-rpc_pipefs.mount  static   -var.mount                     generated - -15 unit files listed. -[root@testvm1 ~]# -``` - -The STATE column in this data stream is interesting and requires a bit of explanation. The "generated" states indicate that the mount unit was generated on the fly during startup using the information in **/etc/fstab**. The program that generates these mount units is **/lib/systemd/system-generators/systemd-fstab-generator,** along with other tools that generate a number of other unit types. The "static" mount units are for filesystems like **/proc** and **/sys**, and the files for these are located in the **/usr/lib/systemd/system** directory. - -Now, look at the service units. This command will show all services installed on the host, whether or not they are active: - - -``` -`[root@testvm1 ~]# systemctl --all -t service` -``` - -The bottom of this listing of service units displays 166 as the total number of loaded units on my host. Your number will probably differ. - -Unit files do not have a filename extension (such as **.unit**) to help identify them, so you can generalize that most configuration files that belong to systemd are unit files of one type or another. The few remaining files are mostly **.conf** files located in **/etc/systemd**. - -Unit files are stored in the **/usr/lib/systemd** directory and its subdirectories, while the **/etc/systemd/** directory and its subdirectories contain symbolic links to the unit files necessary to the local configuration of this host. - -To explore this, make **/etc/systemd** the PWD and list its contents. Then make **/etc/systemd/system** the PWD and list its contents, and list the contents of at least a couple of the current PWD's subdirectories. - -Take a look at the **default.target** file, which determines which runlevel target the system will boot to. In the second article in this series, I explained how to change the default target from the GUI (**graphical.target**) to the command-line only (**multi-user.target**) target. The **default.target** file on my test VM is simply a symlink to **/usr/lib/systemd/system/graphical.target**. - -Take a few minutes to examine the contents of the **/etc/systemd/system/default.target** file: - - -``` -[root@testvm1 system]# cat default.target -#  SPDX-License-Identifier: LGPL-2.1+ -# -#  This file is part of systemd. -# -#  systemd is free software; you can redistribute it and/or modify it -#  under the terms of the GNU Lesser General Public License as published by -#  the Free Software Foundation; either version 2.1 of the License, or -#  (at your option) any later version. - -[Unit] -Description=Graphical Interface -Documentation=man:systemd.special(7) -Requires=multi-user.target -Wants=display-manager.service -Conflicts=rescue.service rescue.target -After=multi-user.target rescue.service rescue.target display-manager.service -AllowIsolate=yes -``` - -Note that this requires the **multi-user.target**; the **graphical.target** cannot start if the **multi-user.target** is not already up and running. It also says it "wants" the **display-manager.service** unit. A "want" does not need to be fulfilled in order for the unit to start successfully. If the "want" cannot be fulfilled, it will be ignored by systemd, and the rest of the target will start regardless. - -The subdirectories in **/etc/systemd/system** are lists of wants for various targets. Take a few minutes to explore the files and their contents in the **/etc/systemd/system/graphical.target.wants** directory. - -The **systemd.unit** man page contains a lot of good information about unit files, their structure, the sections they can be divided into, and the options that can be used. It also lists many of the unit types, all of which have their own man pages. If you want to interpret a unit file, this would be a good place to start. - -### Service units - -A Fedora installation usually installs and enables services that particular hosts do not need for normal operation. Conversely, sometimes it doesn't include services that need to be installed, enabled, and started. Services that are not needed for the Linux host to function as desired, but which are installed and possibly running, represent a security risk and should—at minimum—be stopped and disabled and—at best—should be uninstalled. - -The systemctl command is used to manage systemd units, including services, targets, mounts, and more. Take a closer look at the list of services to identify services that will never be used: - - -``` -[root@testvm1 ~]# systemctl --all -t service -UNIT                           LOAD      ACTIVE SUB        DESCRIPTION                             -<snip> -chronyd.service                loaded    active running    NTP client/server                       -crond.service                  loaded    active running    Command Scheduler                       -cups.service                   loaded    active running    CUPS Scheduler                           -dbus-daemon.service            loaded    active running    D-Bus System Message Bus                 -<snip> -● ip6tables.service           not-found inactive dead     ip6tables.service                   -● ipset.service               not-found inactive dead     ipset.service                       -● iptables.service            not-found inactive dead     iptables.service                     -<snip> -firewalld.service              loaded    active   running  firewalld - dynamic firewall daemon -<snip> -● ntpd.service                not-found inactive dead     ntpd.service                         -● ntpdate.service             not-found inactive dead     ntpdate.service                     -pcscd.service                  loaded    active   running  PC/SC Smart Card Daemon -``` - -I have pruned out most of the output from the command to save space. The services that show "loaded active running" are obvious. The "not-found" services are ones that systemd is aware of but are not installed on the Linux host. If you want to run those services, you must install the packages that contain them. - -Note the **pcscd.service** unit. This is the PC/SC smart-card daemon. Its function is to communicate with smart-card readers. Many Linux hosts—including VMs—have no need for this reader nor the service that is loaded and taking up memory and CPU resources. You can stop this service and disable it, so it will not restart on the next boot. First, check its status: - - -``` -[root@testvm1 ~]# systemctl status pcscd.service -● pcscd.service - PC/SC Smart Card Daemon -   Loaded: loaded (/usr/lib/systemd/system/pcscd.service; indirect; vendor preset: disabled) -   Active: active (running) since Fri 2019-05-10 11:28:42 EDT; 3 days ago -     Docs: man:pcscd(8) - Main PID: 24706 (pcscd) -    Tasks: 6 (limit: 4694) -   Memory: 1.6M -   CGroup: /system.slice/pcscd.service -           └─24706 /usr/sbin/pcscd --foreground --auto-exit - -May 10 11:28:42 testvm1 systemd[1]: Started PC/SC Smart Card Daemon. -``` - -This data illustrates the additional information systemd provides versus SystemV, which only reports whether or not the service is running. Note that specifying the **.service** unit type is optional. Now stop and disable the service, then re-check its status: - - -``` -[root@testvm1 ~]# systemctl stop pcscd ; systemctl disable pcscd -Warning: Stopping pcscd.service, but it can still be activated by: -  pcscd.socket -Removed /etc/systemd/system/sockets.target.wants/pcscd.socket. -[root@testvm1 ~]# systemctl status pcscd -● pcscd.service - PC/SC Smart Card Daemon -   Loaded: loaded (/usr/lib/systemd/system/pcscd.service; indirect; vendor preset: disabled) -   Active: failed (Result: exit-code) since Mon 2019-05-13 15:23:15 EDT; 48s ago -     Docs: man:pcscd(8) - Main PID: 24706 (code=exited, status=1/FAILURE) - -May 10 11:28:42 testvm1 systemd[1]: Started PC/SC Smart Card Daemon. -May 13 15:23:15 testvm1 systemd[1]: Stopping PC/SC Smart Card Daemon... -May 13 15:23:15 testvm1 systemd[1]: pcscd.service: Main process exited, code=exited, status=1/FAIL> -May 13 15:23:15 testvm1 systemd[1]: pcscd.service: Failed with result 'exit-code'. -May 13 15:23:15 testvm1 systemd[1]: Stopped PC/SC Smart Card Daemon. -``` - -The short log entry display for most services prevents having to search through various log files to locate this type of information. Check the status of the system runlevel targets—specifying the "target" unit type is required: - - -``` -[root@testvm1 ~]# systemctl status multi-user.target -● multi-user.target - Multi-User System -   Loaded: loaded (/usr/lib/systemd/system/multi-user.target; static; vendor preset: disabled) -   Active: active since Thu 2019-05-09 13:27:22 EDT; 4 days ago -     Docs: man:systemd.special(7) - -May 09 13:27:22 testvm1 systemd[1]: Reached target Multi-User System. -[root@testvm1 ~]# systemctl status graphical.target -● graphical.target - Graphical Interface -   Loaded: loaded (/usr/lib/systemd/system/graphical.target; indirect; vendor preset: disabled) -   Active: active since Thu 2019-05-09 13:27:22 EDT; 4 days ago -     Docs: man:systemd.special(7) - -May 09 13:27:22 testvm1 systemd[1]: Reached target Graphical Interface. -[root@testvm1 ~]# systemctl status default.target -● graphical.target - Graphical Interface -   Loaded: loaded (/usr/lib/systemd/system/graphical.target; indirect; vendor preset: disabled) -   Active: active since Thu 2019-05-09 13:27:22 EDT; 4 days ago -     Docs: man:systemd.special(7) - -May 09 13:27:22 testvm1 systemd[1]: Reached target Graphical Interface. -``` - -The default target is the graphical target. The status of any unit can be checked in this way. - -### Mounts the old way - -A mount unit defines all of the parameters required to mount a filesystem on a designated mount point. systemd can manage mount units with more flexibility than those using the **/etc/fstab** filesystem configuration file. Despite this, systemd still uses the **/etc/fstab** file for filesystem configuration and mounting purposes. systemd uses the **systemd-fstab-generator** tool to create transient mount units from the data in the **fstab** file. - -I will create a new filesystem and a systemd mount unit to mount it. If you have some available disk space on your test system, you can do it along with me. - -_Note that the volume group and logical volume names may be different on your test system. Be sure to use the names that are pertinent to your system._ - -You will need to create a partition or logical volume, then make an EXT4 filesystem on it. Add a label to the filesystem, **TestFS**, and create a directory for a mount point **/TestFS**. - -To try this on your own, first, verify that you have free space on the volume group. Here is what that looks like on my VM where I have some space available on the volume group to create a new logical volume: - - -``` -[root@testvm1 ~]# lsblk -NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -sda             8:0    0  120G  0 disk -├─sda1          8:1    0    4G  0 part /boot -└─sda2          8:2    0  116G  0 part -  ├─VG01-root 253:0    0    5G  0 lvm  / -  ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -  ├─VG01-usr  253:2    0   30G  0 lvm  /usr -  ├─VG01-home 253:3    0   20G  0 lvm  /home -  ├─VG01-var  253:4    0   20G  0 lvm  /var -  └─VG01-tmp  253:5    0   10G  0 lvm  /tmp -sr0            11:0    1 1024M  0 rom   -[root@testvm1 ~]# vgs -  VG   #PV #LV #SN Attr   VSize    VFree   -  VG01   1   6   0 wz--n- <116.00g <23.00g -``` - -Then create a new volume on **VG01** named **TestFS**. It does not need to be large; 1GB is fine. Then create a filesystem, add the filesystem label, and create the mount point: - - -``` -[root@testvm1 ~]# lvcreate -L 1G -n TestFS VG01 -  Logical volume "TestFS" created. -[root@testvm1 ~]# mkfs -t ext4 /dev/mapper/VG01-TestFS -mke2fs 1.45.3 (14-Jul-2019) -Creating filesystem with 262144 4k blocks and 65536 inodes -Filesystem UUID: 8718fba9-419f-4915-ab2d-8edf811b5d23 -Superblock backups stored on blocks: -        32768, 98304, 163840, 229376 - -Allocating group tables: done                             -Writing inode tables: done                             -Creating journal (8192 blocks): done -Writing superblocks and filesystem accounting information: done - -[root@testvm1 ~]# e2label /dev/mapper/VG01-TestFS TestFS -[root@testvm1 ~]# mkdir /TestFS -``` - -Now, mount the new filesystem: - - -``` -[root@testvm1 ~]# mount /TestFS/ -mount: /TestFS/: can't find in /etc/fstab. -``` - -This will not work because you do not have an entry in **/etc/fstab**. You can mount the new filesystem even without the entry in **/etc/fstab** using both the device name (as it appears in **/dev**) and the mount point. Mounting in this manner is simpler than it used to be—it used to require the filesystem type as an argument. The mount command is now smart enough to detect the filesystem type and mount it accordingly. - -Try it again: - - -``` -[root@testvm1 ~]# mount /dev/mapper/VG01-TestFS /TestFS/ -[root@testvm1 ~]# lsblk -NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -sda               8:0    0  120G  0 disk -├─sda1            8:1    0    4G  0 part /boot -└─sda2            8:2    0  116G  0 part -  ├─VG01-root   253:0    0    5G  0 lvm  / -  ├─VG01-swap   253:1    0    8G  0 lvm  [SWAP] -  ├─VG01-usr    253:2    0   30G  0 lvm  /usr -  ├─VG01-home   253:3    0   20G  0 lvm  /home -  ├─VG01-var    253:4    0   20G  0 lvm  /var -  ├─VG01-tmp    253:5    0   10G  0 lvm  /tmp -  └─VG01-TestFS 253:6    0    1G  0 lvm  /TestFS -sr0              11:0    1 1024M  0 rom   -[root@testvm1 ~]# -``` - -Now the new filesystem is mounted in the proper location. List the mount unit files: - - -``` -`[root@testvm1 ~]# systemctl list-unit-files -t mount` -``` - -This command does not show a file for the **/TestFS** filesystem because no file exists for it. The command **systemctl status TestFS.mount** does not display any information about the new filesystem either. You can try it using wildcards with the **systemctl status** command: - - -``` -[root@testvm1 ~]# systemctl status *mount -● usr.mount - /usr -   Loaded: loaded (/etc/fstab; generated) -   Active: active (mounted) -    Where: /usr -     What: /dev/mapper/VG01-usr -     Docs: man:fstab(5) -           man:systemd-fstab-generator(8) - -<SNIP> -● TestFS.mount - /TestFS -   Loaded: loaded (/proc/self/mountinfo) -   Active: active (mounted) since Fri 2020-04-17 16:02:26 EDT; 1min 18s ago -    Where: /TestFS -     What: /dev/mapper/VG01-TestFS - -● run-user-0.mount - /run/user/0 -   Loaded: loaded (/proc/self/mountinfo) -   Active: active (mounted) since Thu 2020-04-16 08:52:29 EDT; 1 day 5h ago -    Where: /run/user/0 -     What: tmpfs - -● var.mount - /var -   Loaded: loaded (/etc/fstab; generated) -   Active: active (mounted) since Thu 2020-04-16 12:51:34 EDT; 1 day 1h ago -    Where: /var -     What: /dev/mapper/VG01-var -     Docs: man:fstab(5) -           man:systemd-fstab-generator(8) -    Tasks: 0 (limit: 19166) -   Memory: 212.0K -      CPU: 5ms -   CGroup: /system.slice/var.mount -``` - -This command provides some very interesting information about your system's mounts, and your new filesystem shows up. The **/var** and **/usr** filesystems are identified as being generated from **/etc/fstab**, while your new filesystem simply shows that it is loaded and provides the location of the info file in the **/proc/self/mountinfo** file. - -Next, automate this mount. First, do it the old-fashioned way by adding an entry in **/etc/fstab**. Later, I'll show you how to do it the new way, which will teach you about creating units and integrating them into the startup sequence. - -Unmount **/TestFS** and add the following line to the **/etc/fstab** file: - - -``` -`/dev/mapper/VG01-TestFS  /TestFS       ext4    defaults        1 2` -``` - -Now, mount the filesystem with the simpler **mount** command and list the mount units again: - - -``` -[root@testvm1 ~]# mount /TestFS -[root@testvm1 ~]# systemctl status *mount -<SNIP> -● TestFS.mount - /TestFS -   Loaded: loaded (/proc/self/mountinfo) -   Active: active (mounted) since Fri 2020-04-17 16:26:44 EDT; 1min 14s ago -    Where: /TestFS -     What: /dev/mapper/VG01-TestFS -<SNIP> -``` - -This did not change the information for this mount because the filesystem was manually mounted. Reboot and run the command again, and this time specify **TestFS.mount** rather than using the wildcard. The results for this mount are now consistent with it being mounted at startup: - - -``` -[root@testvm1 ~]# systemctl status TestFS.mount -● TestFS.mount - /TestFS -   Loaded: loaded (/etc/fstab; generated) -   Active: active (mounted) since Fri 2020-04-17 16:30:21 EDT; 1min 38s ago -    Where: /TestFS -     What: /dev/mapper/VG01-TestFS -     Docs: man:fstab(5) -           man:systemd-fstab-generator(8) -    Tasks: 0 (limit: 19166) -   Memory: 72.0K -      CPU: 6ms -   CGroup: /system.slice/TestFS.mount - -Apr 17 16:30:21 testvm1 systemd[1]: Mounting /TestFS... -Apr 17 16:30:21 testvm1 systemd[1]: Mounted /TestFS. -``` - -### Creating a mount unit - -Mount units may be configured either with the traditional **/etc/fstab** file or with systemd units. Fedora uses the **fstab** file as it is created during the installation. However, systemd uses the **systemd-fstab-generator** program to translate the **fstab** file into systemd units for each entry in the **fstab** file. Now that you know you can use systemd **.mount** unit files for filesystem mounting, try it out by creating a mount unit for this filesystem. - -First, unmount **/TestFS**. Edit the **/etc/fstab** file and delete or comment out the **TestFS** line. Now, create a new file with the name **TestFS.mount** in the **/etc/systemd/system** directory. Edit it to contain the configuration data below. The unit file name and the name of the mount point _must_ be identical, or the mount will fail: - - -``` -# This mount unit is for the TestFS filesystem -# By David Both -# Licensed under GPL V2 -# This file should be located in the /etc/systemd/system directory - -[Unit] -Description=TestFS Mount - -[Mount] -What=/dev/mapper/VG01-TestFS -Where=/TestFS -Type=ext4 -Options=defaults - -[Install] -WantedBy=multi-user.target -``` - -The **Description** line in the **[Unit]** section is for us humans, and it provides the name that's shown when you list mount units with **systemctl -t mount**. The data in the **[Mount]** section of this file contains essentially the same data that would be found in the **fstab** file. - -Now enable the mount unit: - - -``` -[root@testvm1 etc]# systemctl enable TestFS.mount -Created symlink /etc/systemd/system/multi-user.target.wants/TestFS.mount → /etc/systemd/system/TestFS.mount. -``` - -This creates the symlink in the **/etc/systemd/system** directory, which will cause this mount unit to be mounted on all subsequent boots. The filesystem has not yet been mounted, so you must "start" it: - - -``` -`[root@testvm1 ~]# systemctl start TestFS.mount` -``` - -Verify that the filesystem has been mounted: - - -``` -[root@testvm1 ~]# systemctl status TestFS.mount -● TestFS.mount - TestFS Mount -   Loaded: loaded (/etc/systemd/system/TestFS.mount; enabled; vendor preset: disabled) -   Active: active (mounted) since Sat 2020-04-18 09:59:53 EDT; 14s ago -    Where: /TestFS -     What: /dev/mapper/VG01-TestFS -    Tasks: 0 (limit: 19166) -   Memory: 76.0K -      CPU: 3ms -   CGroup: /system.slice/TestFS.mount - -Apr 18 09:59:53 testvm1 systemd[1]: Mounting TestFS Mount... -Apr 18 09:59:53 testvm1 systemd[1]: Mounted TestFS Mount. -``` - -This experiment has been specifically about creating a unit file for a mount, but it can be applied to other types of unit files as well. The details will be different, but the concepts are the same. Yes, I know it is still easier to add a line to the **/etc/fstab** file than it is to create a mount unit. But this is a good example of how to create a unit file because systemd does not have generators for every type of unit. - -### In summary - -This article looked at systemd units in more detail and how to use the systemctl command to explore and manage units. It also showed how to stop and disable units and create a new systemd mount unit to mount a new filesystem and enable it to initiate during startup. - -In the next article in this series, I will take you through a recent problem I had during startup and show you how I circumvented it using systemd. - -### Resources - -There is a great deal of information about systemd available on the internet, but much is terse, obtuse, or even misleading. In addition to the resources mentioned in this article, the following webpages offer more detailed and reliable information about systemd startup. - - * The Fedora Project has a good, practical [guide][10] [to systemd][10]. It has pretty much everything you need to know in order to configure, manage, and maintain a Fedora computer using systemd. - * The Fedora Project also has a good [cheat sheet][11] that cross-references the old SystemV commands to comparable systemd ones. - * For detailed technical information about systemd and the reasons for creating it, check out [Freedesktop.org][12]'s [description of systemd][13]. - * [Linux.com][14]'s "More systemd fun" offers more advanced systemd [information and tips][15]. - - - -There is also a series of deeply technical articles for Linux sysadmins by Lennart Poettering, the designer and primary developer of systemd. These articles were written between April 2010 and September 2011, but they are just as relevant now as they were then. Much of everything else good that has been written about systemd and its ecosystem is based on these papers. - - * [Rethinking PID 1][16] - * [systemd for Administrators, Part I][17] - * [systemd for Administrators, Part II][18] - * [systemd for Administrators, Part III][19] - * [systemd for Administrators, Part IV][20] - * [systemd for Administrators, Part V][21] - * [systemd for Administrators, Part VI][22] - * [systemd for Administrators, Part VII][23] - * [systemd for Administrators, Part VIII][24] - * [systemd for Administrators, Part IX][25] - * [systemd for Administrators, Part X][26] - * [systemd for Administrators, Part XI][27] - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/5/systemd-units - -作者:[David Both][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/dboth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) -[2]: https://opensource.com/article/20/4/systemd -[3]: https://opensource.com/article/20/4/systemd-startup -[4]: https://en.wikipedia.org/wiki/Sar_%28Unix%29 -[5]: https://en.wikipedia.org/wiki/Pwd -[6]: https://en.wikipedia.org/wiki/Standard_streams#Standard_output_(stdout) -[7]: http://www.both.org/?page_id=1183 -[8]: mailto:chrony-dnssrv@.timer -[9]: mailto:mdadm-last-resort@.timer -[10]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html -[11]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet -[12]: http://Freedesktop.org -[13]: http://www.freedesktop.org/wiki/Software/systemd -[14]: http://Linux.com -[15]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/ -[16]: http://0pointer.de/blog/projects/systemd.html -[17]: http://0pointer.de/blog/projects/systemd-for-admins-1.html -[18]: http://0pointer.de/blog/projects/systemd-for-admins-2.html -[19]: http://0pointer.de/blog/projects/systemd-for-admins-3.html -[20]: http://0pointer.de/blog/projects/systemd-for-admins-4.html -[21]: http://0pointer.de/blog/projects/three-levels-of-off.html -[22]: http://0pointer.de/blog/projects/changing-roots -[23]: http://0pointer.de/blog/projects/blame-game.html -[24]: http://0pointer.de/blog/projects/the-new-configuration-files.html -[25]: http://0pointer.de/blog/projects/on-etc-sysinit.html -[26]: http://0pointer.de/blog/projects/instances.html -[27]: http://0pointer.de/blog/projects/inetd.html diff --git a/sources/tech/20200508 A guide to setting up your Open Source Program Office (OSPO) for success.md b/sources/tech/20200508 A guide to setting up your Open Source Program Office (OSPO) for success.md deleted file mode 100644 index ea3aa01866..0000000000 --- a/sources/tech/20200508 A guide to setting up your Open Source Program Office (OSPO) for success.md +++ /dev/null @@ -1,193 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (A guide to setting up your Open Source Program Office (OSPO) for success) -[#]: via: (https://opensource.com/article/20/5/open-source-program-office) -[#]: author: (J. Manrique Lopez de la Fuente https://opensource.com/users/jsmanrique) - -A guide to setting up your Open Source Program Office (OSPO) for success -====== -Learn how to best grow and maintain your open source communities and -allies. -![community team brainstorming ideas][1] - -Companies create Open Source Program Offices (OSPO) to manage their relationship with the open source ecosystems they depend on. By understanding the company's open source ecosystem, an OSPO is able to maximize the company's return on investment and reduce the risks of consuming, contributing to, and releasing open source software. Additionally, since the company depends on its open source ecosystem, ensuring its health and sustainability shall ensure the company's health, sustainable growth, and evolution. - -### How has OSPO become vital to companies and their open source ecosystem? - -Marc Andreessen has said that "software is eating the world," and more recently, it could be said that open source is eating the software world. But how is that process happening? - -Companies get involved with open source projects in several ways. These projects comprise the company's open source ecosystem, and their relationships and interactions can be seen through Open Source Software's (OSS) inbound and outbound processes. - -From the OSS inbound point of view, companies use it to build their own solutions and their own infrastructure. OSS gets introduced because it's part of the code their technology providers use, or because their own developers add open source components to the company's information technology (IT) infrastructure. - -From the OSS outbound point of view, some companies contribute to OSS projects. That contribution could be part of the company's requirements for their solutions that need certain fixes in upstream projects. For example, Samsung contributes to certain graphics-related projects to ensure its hardware has software support once it gets into the market. In some other cases, contributing to OSS is a mechanism to retain talent by allowing the people to contribute to projects different from their daily work. - -Some companies release their own open source projects as an outbound OSS process. For companies like Red Hat or GitLab, it would be expected. But, there are increasingly more non-software companies releasing a lot of OSS, like Lyft. - -![OSS inbound and outbound processes][2] - -OSS inbound and outbound processes - -Ultimately, all of these projects involved in the inbound and outbound OSS flow are the company's OSS ecosystem. And like any living being, the company's health and sustainability depend on the ecosystem that surrounds it. - -### OSPO responsibilities - -Following the species and their ecosystem, people working in the OSPO team could be seen as the rangers in the organization's OSS ecosystem. They take care of the ecosystem and its relationship with the company, to keep everything healthy and sustainable. - -When the company consumes open source software projects, they need to be aware of licenses and compliance, to check the project's health, to ensure there are no security flaws, and, in some cases, to identify talented community members for potential hiring processes. - -When the company contributes to open source software projects, they need to be sure there are no Intellectual Property (IP) issues, to ensure the company contributions' footprint and its leadership in the projects, and sometimes, also to help talented people stay engaged with the company through their contributions. - -And when the company releases and maintains open source projects, they are responsible for ensuring community engagement and growth, for checking there are no IP issues, that the company maintains its footprint and leadership, and perhaps, to attract new talent to the company. - -Have you realized the whole set of skills required in an OSPO team? When I've asked people working in OSPO about the size of their teams, the number is around 1 to 5 people per 1,000 developers in the company. That's a small team to monitor a lot of people and their potential OSS related activity. - -### How to manage an OSPO - -With all these activities in OSPO people's minds and all the resources they need to worry about, how are they able to manage all of this? - -There are at least a couple of open source communities with valuable knowledge and resources available for them: - - * The [TODO Group][3] is "an open group of companies who want to collaborate on practices, tools, and other ways to run successful and effective open source projects and programs." For example, they have a complete set of [guides][4] with best practices for and from companies running OSPOS. - * The [CHAOSS (Community Health Analytics for Open Source Software)][5] community develops metrics, methodologies, and software for managing open source project health and sustainability. (See more on CHAOSS' active communities and working groups below). - - - -OSPO managers need to report a lot of information to the rest of the company to answer many questions related to their OSS inbound and outbound processes, i.e., Which projects are we using in our organization? What's the health of those projects? Who are the key people in those projects? Which projects are we contributing to? Which projects are we releasing? How are we dealing with community contributions? Who are the key contributors? - -### Data-driven OSPO - -As William Edwards Deming said, "Without data, you are just a person with an opinion." - -Having opinions is not a bad thing, but having opinions based on data certainly makes it easier to understand, discuss, and determine the processes best suited to your company and its goals. CHAOSS is the recommended community to look to for guidance about metrics strategies and tools. - -Recently, the CHAOSS community has released [a new set of metric definitions][6]. These metrics are only subsets of all the ones being discussed in the focus areas of each working group (WG): - - * [Common WG][7]: Defines the metrics that are used by both working groups or are important for community health, but that do not cleanly fit into one of the other existing working groups. Areas of interest include organizational affiliation, responsiveness, and geographic coverage. - * [Diversity and Inclusion WG][8]: Gathers experiences regarding diversity and inclusion in open source projects with the goal of understanding, from a qualitative and quantitative point of view, how diversity and inclusion can be measured. - * [Evolution WG][9]: Refines the metrics that inform evolution and works with software implementations. - * [Risk WG][10]: Refines the metrics that inform risk and works with software implementations. - * [Value WG][11]: Focuses on industry-standard metrics for economic value in open source. Their main goal is to publish trusted industry-standard value metrics—a kind of S&P for software development and an authoritative source for metrics significance and industry norms. - - - -On the tooling side, projects like [Augur][12], [Cregit][13], and [GrimoireLab][14] are the reference tools that report these metrics, but also many others related to OSPO activities. They are also the seed for new tools and solutions provided by the OSS community like [Cauldron.io][15], a SaaS open source solution to ease OSS ecosystem analysis. - -![CHAOSS Metrics for 15 years of Unity OSS activity. Source: cauldron.io][16] - -CHAOSS Metrics for 15 years of Unity OSS activity. Source: cauldron.io - -All these metrics and data are useless without a metrics strategy. Usually, the first approach is to try to measure as much as possible, producing overwhelming reports and dashboards full of charts and data. What is the value of that? - -Experience has shown that a very valid approach is the [Goal, Questions, Metrics (GQM)][17] strategy. But how do we put that in practice in an OSPO? - -First of all, we need to understand the company's goals when using, consuming, contributing to, or releasing and maintaining OSS projects. The usual goals are related to market positioning, required upstream features development, and talent attraction or retention. Based on these goals, we should write down related questions that can be answered with numbers, like the following: - -#### Who/how many are the core maintainers of my OSS ecosystem projects? - -![Uber OSS code core, regular, and casual contributors evolution. Source: uber.biterg.io][18] - -Uber OSS code core, regular, and casual contributors evolution. Source: uber.biterg.io - -People contribute through different mechanisms or tools (code, issues, comments, tests, etc.). Measuring the core contributors (those that have done 80% of the contributions), the regular ones (those that have done 15% of the contributions), and the casual ones (those have made 5% of the contributions) can answer questions related to participation over time, but also how people move between the different buckets. Adding affiliation information helps to identify external core contributors. - -#### Where are the contributions happening? - -![Uber OSS activity based on location. Source: uber.biterg.io][19] - -Uber OSS activity based on location. Source: uber.biterg.io - -The growth of OSS ecosystems is also related to OSS projects spread across the world. Understanding that spread helps OSPO, and the company, to manage actions that improve support for people from different countries and regions. - -#### What is the company's OSS network? - -![Uber OSS network. Source: uber.biterg.io][20] - -Uber OSS network. Source: uber.biterg.io - -The company's OSS ecosystem includes those projects that the company's people contribute to. Understanding which projects they contribute to offers insight into which technologies or OSS components are interesting to people, and which companies or organizations the company collaborates with. - -#### How is the company dealing with contributions? - -![Github Pull Requests backlog management index and time to close analysis. Source: uber.biterg.io][21] - -Github Pull Requests backlog management index and time to close analysis. Source: uber.biterg.io - -One of the goals when releasing OSS projects is to grow the community around them. Measuring how the company handles contributions to its projects from outside its boundaries helps to understand how "welcoming" it is and identifies mentors (or bottlenecks) and opportunities to lower the barrier to contribute. - -#### Consumers vs. maintainers - -Over the last months, we have been hearing that corporations are taking OSS for free without contributing back. The typical arguments are that these corporations are making millions of dollars thanks to free work, plus the issue of OSS project maintainer burnout due to users' complaints and requests for free support. - -The system is unbalanced; usually, the number of users exceeds the number of maintainers. Is that good or bad? Having users for our software is (or should be) good. But we need to manage expectations on both sides. - -From the corporation's point of view, consuming OSS without care is very, very risky. - -OSPO can play an important role in educating the company about the risks they are facing, and how to reduce them by contributing back to their OSS ecosystem. Remember, a company's overall sustainability could rely heavily on its ecosystem sustainability. - -A good strategy is to start shifting your company from being pure OSS consumers to becoming contributors to their OSS inbound projects. From just submitting issues and asking questions to help solve issues, answering questions, and even sending patches, contributing helps grow and maintain the project while giving back to the community. It doesn't happen immediately, but over time, the company will be perceived as an OSS ecosystem citizen. Eventually, some people from the company could end up helping to maintain those projects too. - -And what about money? There are plenty of ways to support the OSS ecosystem financially. Some examples: - - * Business initiatives like [Tidelift][22], or [OpenCollective][23] - * Foundations and their supporting mechanisms, like [Software Freedom Conservancy][24], or [CommunityBridge][25] from the Linux Foundation - * Self-funding programs (like [Indeed][26] and [Salesforce][27] have done) - * Emerging gig development approaches like [Github Sponsors][28] or [Patreon][29] - - - -Last but not least, companies need to avoid the "not invented here" syndrome. For some OSS projects, there might be companies providing consulting, customization, maintenance, and/or support services. Instead of taking OSS and spending time and people to self-host, self-customize, or try to bring those kinds of services in-house, it might be smarter and more efficient to hire some of those companies to do the thought work. - -As a final remark, I would like to emphasize the importance of an OSPO for a company to succeed and grow in the current market. As shepherds of the company's OSS ecosystem, they are the best people in the organization to understand how the ecosystem works and flows, and they should be empowered to manage, monitor, and make recommendations and decisions to ensure sustainability and growth. - -Does your organization have an OSPO yet? - -Six common traits of successful open source programs, and a look back at how the open source... - -Why would a company not in the business of software development create an open source program... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/5/open-source-program-office - -作者:[J. Manrique Lopez de la Fuente][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jsmanrique -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/meeting_discussion_brainstorm.png?itok=7_m4CC8S (community team brainstorming ideas) -[2]: https://opensource.com/sites/default/files/uploads/ospo_1.png (OSS inbound and outbound processes) -[3]: https://todogroup.org/ -[4]: https://todogroup.org/guides/ -[5]: https://chaoss.community/ -[6]: https://chaoss.community/metrics/ -[7]: https://github.com/chaoss/wg-common -[8]: https://github.com/chaoss/wg-diversity-inclusion -[9]: https://github.com/chaoss/wg-evolution -[10]: https://github.com/chaoss/wg-risk -[11]: https://github.com/chaoss/wg-value -[12]: https://github.com/chaoss/augur -[13]: https://github.com/cregit -[14]: https://chaoss.github.io/grimoirelab/ -[15]: https://cauldron.io/ -[16]: https://opensource.com/sites/default/files/uploads/ospo_2.png (CHAOSS Metrics for 15 years of Unity OSS activity. Source: cauldron.io) -[17]: https://en.wikipedia.org/wiki/GQM -[18]: https://opensource.com/sites/default/files/uploads/ospo_3.png (Uber OSS code core, regular, and casual contributors evolution. Source: uber.biterg.io) -[19]: https://opensource.com/sites/default/files/uploads/ospo_4.png (Uber OSS activity based on location. Source: uber.biterg.io) -[20]: https://opensource.com/sites/default/files/uploads/ospo_5_0.png (Uber OSS network. Source: uber.biterg.io) -[21]: https://opensource.com/sites/default/files/uploads/ospo_6.png (Github Pull Requests backlog management index and time to close analysis. Source: uber.biterg.io) -[22]: https://tidelift.com/ -[23]: https://opencollective.com/ -[24]: https://sfconservancy.org/ -[25]: https://funding.communitybridge.org/ -[26]: https://engineering.indeedblog.com/blog/2019/02/sponsoring-osi/ -[27]: https://sustain.codefund.fm/23 -[28]: https://help.github.com/en/github/supporting-the-open-source-community-with-github-sponsors -[29]: https://www.patreon.com/ diff --git a/sources/tech/20200617 What happens when you update your DNS.md b/sources/tech/20200617 What happens when you update your DNS.md deleted file mode 100644 index 73344f852d..0000000000 --- a/sources/tech/20200617 What happens when you update your DNS.md +++ /dev/null @@ -1,236 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What happens when you update your DNS?) -[#]: via: (https://jvns.ca/blog/how-updating-dns-works/) -[#]: author: (Julia Evans https://jvns.ca/) - -What happens when you update your DNS? -====== - -I’ve seen a lot of people get confused about updating their site’s DNS records to change the IP address. Why is it slow? Do you really have to wait 2 days for everything to update? Why do some people see the new IP and some people see the old IP? What’s happening? - -So I wanted to write a quick exploration of what’s happening behind the scenes when you update a DNS record. - -### how DNS works: recursive vs authoritative DNS servers - -First, we need to explain a little bit about DNS. There are 2 kinds of DNS servers: **authoritative** and **recursive**. - -**authoritative** DNS servers (also known as **nameservers**) have a database of IP addresses for each domain they’re responsible for. For example, right now an authoritative DNS server for github.com is ns-421.awsdns-52.com. You can ask it for github.com’s IP like this; - -``` -dig @ns-421.awsdns-52.com github.com -``` - -**recursive** DNS servers, by themselves, don’t know anything about who owns what IP address. They figure out the IP address for a domain by asking the right authoritative DNS servers, and then cache that IP address in case they’re asked again. 8.8.8.8 is a recursive DNS server. - -When people visit your website, they’re probably making their DNS queries to a recursive DNS server. So, how do recursive DNS servers work? Let’s see! - -### how does a recursive DNS server query for github.com? - -Let’s go through an example of what a recursive DNS server (like 8.8.8.8) does when you ask it for an IP address (A record) for github.com. First – if it already has something cached, it’ll give you what it has cached. But what if all of its caches are expired? Here’s what happens: - -**step 1**: it has IP addresses for the root DNS servers hardcoded in its source code. You can see this in [unbound’s source code here][1]. Let’s say it picks `198.41.0.4` to start with. Here’s the [official source][2] for those hardcoded IP addresses, also known as a “root hints file”. - -**step 2**: Ask the root nameservers about `github.com`. - -We can roughly reproduce what happens with `dig`. What this gives us is a new authoritative nameserver to ask: a nameserver for `.com`, with the IP `192.5.6.30`. - -``` -$ dig @198.41.0.4 github.com -... -com. 172800 IN NS a.gtld-servers.net. -... -a.gtld-servers.net. 172800 IN A 192.5.6.30 -... -``` - -The details of the DNS response are a little more complicated than that – in this case, there’s an authority section with some NS records and an additional section with A records so you don’t need to do an extra lookup to get the IP addresses of those nameservers. - -(in practice, 99.99% of the time it’ll already have the address of the `.com` nameservers cached, but we’re pretending we’re really starting from scratch) - -**step 3**: Ask the `.com` nameservers about `github.com`. - -``` -$ dig @192.5.6.30 github.com -... -github.com. 172800 IN NS ns-421.awsdns-52.com. -ns-421.awsdns-52.com. 172800 IN A 205.251.193.165 -... -``` - -We have a new IP address to ask! This one is the nameserver for `github.com`. - -**step 4**: Ask the `github.com` nameservers about `github.com`. - -We’re almost done! - -``` -$ dig @205.251.193.165 github.com - -github.com. 60 IN A 140.82.112.4 -``` - -Hooray!! We have an `A` record for `github.com`! Now the recursive nameserver has `github.com`’s IP address and can return it back to you. And it could do all of this by only hardcoding a few IP addresses: the addresses of the root nameservers. - -### how to see all of a recursive DNS server’s steps: `dig +trace` - -When I want to see what a recursive DNS server would do when resolving a domain, I run - -``` -$ dig @8.8.8.8 +trace github.com -``` - -This shows all the DNS records that it requests, starting at the root DNS servers – all the 4 steps that we just went through. - -### let’s update some DNS records! - -Now that we know the basics of how DNS works, let’s update some DNS records and see what happens. - -When you update your DNS records, there are two main options: - - 1. keep the same nameservers - 2. change nameservers - - - -### let’s talk about TTLs - -We’ve forgotten something important though! TTLs! You know how we said earlier that the recursive DNS server will cache records until they expire? The way it decides whether the record should expire is by looking at its **TTL** or “time to live”. - -In this example, the TTL for the A record github’s nameserver returns for its DNS record is `60`, which means 60 seconds: - -``` -$ dig @205.251.193.165 github.com - -github.com. 60 IN A 140.82.112.4 -``` - -That’s a pretty short TTL, and _in theory_ if everybody’s DNS implementation followed the [DNS standard][3] it means that if Github decided to change the IP address for `github.com`, everyone should get the new IP address within 60 seconds. Let’s see how that plays out in practice - -### option 1: update a DNS record on the same nameservers - -First, I updated my nameservers (Cloudflare) to have a new DNS record: an A record that maps `test.jvns.ca` to `1.2.3.4`. - -``` -$ dig @8.8.8.8 test.jvns.ca -test.jvns.ca. 299 IN A 1.2.3.4 -``` - -This worked immediately! There was no need to wait at all, because there was no `test.jvns.ca` DNS record before that could have been cached. Great. But it looks like the new record is cached for ~5 minutes (299 seconds). - -So, what if we try to change that IP? I changed it to `5.6.7.8`, and then ran the same DNS query. - -``` -$ dig @8.8.8.8 test.jvns.ca -test.jvns.ca. 144 IN A 1.2.3.4 -``` - -Hmm, it seems like that DNS server has the `1.2.3.4` record still cached for another 144 seconds. Interestingly, if I query `8.8.8.8` multiple times I actually get inconsistent results – sometimes it’ll give me the new IP and sometimes the old IP, I guess because 8.8.8.8 actually load balances to a bunch of different backends which each have their own cache. - -After I waited 5 minutes, all of the `8.8.8.8` caches had updated and were always returning the new `5.6.7.8` record. Awesome. That was pretty fast! - -### you can’t always rely on the TTL - -As with most internet protocols, not everything obeys the DNS specification. Some ISP DNS servers will cache records for longer than the TTL specifies, like maybe for 2 days instead of 5 minutes. And people can always hardcode the old IP address in their /etc/hosts. - -What I’d expect to happen in practice when updating a DNS record with a 5 minute TTL is that a large percentage of clients will move over to the new IPs quickly (like within 15 minutes), and then there will be a bunch of stragglers that slowly update over the next few days. - -### option 2: updating your nameservers - -So we’ve seen that when you update an IP address without changing your nameservers, a lot of DNS servers will pick up the new IP pretty quickly. Great. But what happens if you change your nameservers? Let’s try it! - -I didn’t want to update the nameservers for my blog, so instead I went with a different domain I own and use in the examples for the [HTTP zine][4]: `examplecat.com`. - -Previously, my nameservers were set to dns1.p01.nsone.net. I decided to switch them over to Google’s nameservers – `ns-cloud-b1.googledomains.com` etc. - -When I made the change, my domain registrar somewhat ominiously popped up the message – “Changes to examplecat.com saved. They’ll take effect within the next 48 hours”. Then I set up a new A record for the domain, to make it point to `1.2.3.4` - -Okay, let’s see if that did anything - -``` -$ dig @8.8.8.8 examplecat.com -examplecat.com. 17 IN A 104.248.50.87 -``` - -No change. If I ask a different DNS server, it knows the new IP: - -``` -$ dig @1.1.1.1 examplecat.com -examplecat.com. 299 IN A 1.2.3.4 -``` - -but 8.8.8.8 is still clueless. The reason 1.1.1.1 sees the new IP even though I just changed it 5 minutes ago is presumably that nobody had ever queried 1.1.1.1 about examplecat.com before, so it had nothing in its cache. - -### nameserver TTLs are much longer - -The reason that my registrar was saying “THIS WILL TAKE 48 HOURS” is that the TTLs on NS records (which are how recursive nameservers know which nameserver to ask) are MUCH longer! - -The new nameserver is definitely returning the new IP address for `examplecat.com` - -``` -$ dig @ns-cloud-b1.googledomains.com examplecat.com -examplecat.com. 300 IN A 1.2.3.4 -``` - -But remember what happened when we queried for the `github.com` nameservers, way back? - -``` -$ dig @192.5.6.30 github.com -... -github.com. 172800 IN NS ns-421.awsdns-52.com. -ns-421.awsdns-52.com. 172800 IN A 205.251.193.165 -... -``` - -172800 seconds is 48 hours! So nameserver updates will in general take a lot longer to expire from caches and propagate than just updating an IP address without changing your nameserver. - -### how do your nameservers get updated? - -When I update the nameservers for `examplecat.com`, what happens is that he `.com` nameserver gets a new `NS` record with the new domain. Like this: - -``` -dig ns @j.gtld-servers.net examplecat.com - -examplecat.com. 172800 IN NS ns-cloud-b1.googledomains.com -``` - -But how does that new NS record get there? What happens is that I tell my **domain registrar** what I want the new nameservers to be by updating it on the website, and then my domain registrar tells the `.com` nameservers to make the update. - -For `.com`, these updates happen pretty fast (within a few minutes), but I think for some other TLDs the TLD nameservers might not apply updates as quickly. - -### your program’s DNS resolver library might also cache DNS records - -One more reason TTLs might not be respected in practice: many programs need to resolve DNS names, and some programs will also cache DNS records indefinitely in memory (until the program is restarted). - -For example, AWS has an article on [Setting the JVM TTL for DNS Name Lookups][5]. I haven’t written that much JVM code that does DNS lookups myself, but from a little Googling about the JVM and DNS it seems like you can configure the JVM so that it caches every DNS lookup indefinitely. (like [this elasticsearch issue][6]) - -### that’s all! - -I hope this helps you understand what’s going on when updating your DNS! - -As a disclaimer, again – TTLs definitely don’t tell the whole story about DNS propagation – some recursive DNS servers definitely don’t respect TTLs, even if the major ones like 8.8.8.8 do. So even if you’re just updating an A record with a short TTL, it’s very possible that in practice you’ll still get some requests to the old IP for a day or two. - -Also, I changed the nameservers for `examplecat.com` back to their old values after publishing this post. - --------------------------------------------------------------------------------- - -via: https://jvns.ca/blog/how-updating-dns-works/ - -作者:[Julia Evans][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://jvns.ca/ -[b]: https://github.com/lujun9972 -[1]: https://github.com/NLnetLabs/unbound/blob/6e0756e819779d9cc2a14741b501cadffe446c93/iterator/iter_hints.c#L131 -[2]: https://www.iana.org/domains/root/files -[3]: https://tools.ietf.org/html/rfc1035 -[4]: https://wizardzines.com/zines/http/ -[5]: https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-jvm-ttl.html -[6]: https://github.com/elastic/elasticsearch/issues/16412 diff --git a/sources/tech/20200818 D Declarations for C and C-- Programmers.md b/sources/tech/20200818 D Declarations for C and C-- Programmers.md deleted file mode 100644 index 577243add8..0000000000 --- a/sources/tech/20200818 D Declarations for C and C-- Programmers.md +++ /dev/null @@ -1,359 +0,0 @@ -[#]: subject: "D Declarations for C and C++ Programmers" -[#]: via: "https://theartofmachinery.com/2020/08/18/d_declarations_for_c_programmers.html" -[#]: author: "Simon Arneaud https://theartofmachinery.com" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -D Declarations for C and C++ Programmers -====== - -Because D was originally created by a C++ compiler writer, Walter Bright, [it’s an easy language for C and C++ programmers to learn][1], but there are little differences in the way declarations work. I learned them piecemeal in different places, but I’m going to dump a bunch in this one post. - -### `char* p` - -If you want to declare a pointer in C, both of the following work: - -``` - - char *p; - char* p; - -``` - -Some people prefer the second form because it puts all the type information to one side. At least, that’s what it looks like. Trouble is, you can fall into this trap: - -``` - - char* p, q; // Gotcha! p is a pointer to a char, and q is a char in C - -``` - -“Type information on the left” isn’t really how C works. D, on the other hand, _does_ put all the type information to the left, so this works the way it appears: - -``` - - char* p, q; // Both p and q are of type char* in D - -``` - -D also accepts the `char *p` syntax, but the rule I go by is `char *p` when writing C, and `char* p` when writing D, just because that matches how the languages actually work, so no gotchas. - -### Digression: how C declarations work - -This isn’t about D, but helps to make sense of the subtler differences between C and D declarations. - -C declarations are implicit about types. `char *p` doesn’t really say, “`p` is of type `char*`”; it says “the type of `p` is such that `*p` evaluates to a `char`”. Likewise: - -``` - - int a[8]; // a[i] evaluates to an int (=> a is an array of ints) - int (*f)(double); // (*f)(0.5) evaluates to an int (=> f is a pointer to a function taking a double, returning an int) - -``` - -There’s a kind of theoretical elegance to this implicit approach, but 1) it’s backwards and makes complex types confusing, 2) the theoretical elegance only goes so far because everything’s a special case. For example, `int a[8];` declares an array `a`, but makes the expression `a[8]` undefined. You can only use certain operations, so `int 2*a;` doesn’t work, and neither does `double 1.0 + sin(x);`. The expression `4[a]` is equivalent to `a[4]`, but you can’t declare an array with `int 4[a];`. C++ gave up on the theory when it introduced reference syntax like `int &x;`. - -### `function` and `delegate` - -D has a special `function` keyword for declaring function pointers using the “type information on the left” approach. It makes the declaration of function pointers use the same syntax as the declaration of a function: - -``` - - int foo(); - int[] bar(); - - int function() foo_p = &foo; - int[] function() bar_p = &bar; - -``` - -Note that the `&` is _required_ to get the address of a function in D (unlike in C and C++). If you want to have an array of pointers, you just add `[]` to the end of the type, just like you do with any other type. Similarly for making pointers to types: - -``` - - int function()[] foo_pa = [&foo]; - int function()* foo_pp = &foo_p; - int function()[]* foo_pap = &foo_pa; - -``` - -Here’s the C equivalent for comparison: - -``` - - int (*foo_p)() = &foo; - int (*foo_pa[])() = {&foo}; - int (**foo_pp)() = &foo_p; - int (*(*foo_pap)[])() = &foo_pa; - -``` - -It’s rare to need these complicated types, but the logic for the D declarations is much simpler. - -There’s also the `delegate` keyword, which works in exactly the same way for [“fat function pointers”][2]. - -### Arrays - -The most obvious difference from C is that D uses the “type information on the left” approach: - -``` - - // int a[8]; is an error in D - int[8] a; - -``` - -Another difference is in the order of indices for multidimensional arrays. E.g., this C code: - -``` - - int a[4][64]; - -``` - -translates to this in D: - -``` - - int[64][4] a; - -``` - -Here’s the rule for understanding the D ordering: - -``` - - T[4] a; - static assert (is(typeof(a[0]) == T)); - -``` - -If `T` represents a type, then `T[4]` is always an array of 4 `T`s. Sounds obvious, but it means that if `T` is `int[64]`, `int[64][4]` must be an array of 4 `int[64]`s. - -### `auto` - -C had `auto` as a storage class keyword since the early days, but it got mostly forgotten because it’s only allowed in the one place it’s the default, anyway. (It effectively means “this variable goes on the stack”.) C++ repurposed the keyword to enable automatic type deduction. - -You can also use `auto` with automatic type deduction in D, but it’s not actually required. Type deduction is always enabled in D; you just need to make your declaration unambiguously a declaration. For example, these work in D (but not all in C++): - -``` - - auto x1 = 42; - const x2 = 42; - static x3 = 42; - -``` - -### No need for forward declarations at global scope - -This code works: - -``` - - // Legal, but not required in D - // void bar(); - - void foo() - { - bar(); - } - - void bar() - { - // ... - } - -``` - -Similarly for structs and classes. Order of definition doesn’t matter, and forward declarations aren’t required. - -Order does matter in local scope, though: - -``` - - void foo() - { - // Error! - bar(); - - void bar() - { - // ... - } - } - -``` - -Either the definition of `bar()` needs to be put before its usage, or `bar()` needs a forward declaration. - -### `const()` - -The `const` keyword in C declarations can be confusing. (Think `const int *p` vs `int const *p` vs `const int const *p`.) D supports the same syntax, but also allows `const` with parentheses: - -``` - - // non-constant pointer to constant int - const(int)* p1; - // constant pointer to constant int - const(int*) p2; - -``` - -[`const` is transitive in D][3], anyway, and this syntax makes it much clearer. The same parenthetical syntax works with `immutable`, too. Although C-style syntax is supported by D, I always prefer the parenthetical style for a few more reasons. - -### `ref` - -`ref` is the D alternative to C++’s references. In D, `ref` doesn’t create a new type, it just controls how the instance of the type is stored in memory (i.e, it’s a storage class). C++ acts as if references are types, but references have so many special restrictions that they’re effectively like a complex version of a storage class (in Walter’s words, C++ references try to be both a floor wax and dessert topping). For example, C++ treats `int&` like a type, but forbids declaring an array of `int&`. - -As a former C++ programmer, I used to write D function arguments like this: - -``` - - void foo(const ref S s); - -``` - -Now I write them like this: - -``` - - void foo(ref const(S) s); - -``` - -The difference becomes more obvious with more complex types. Treating `ref` like a storage class ends up being cleaner because that’s the way it actually is in D. - -Currently `ref` is only supported with function arguments or `foreach` loop variables, so you can’t declare a regular local variable to be `ref`. - -### Function qualifiers - -D’s backward-compatible support for the C-style `const` keyword creates an unfortunate gotcha: - -``` - - struct S - { - // Confusing! - const int* foo() - { - // ... - } - } - -``` - -`foo()` doesn’t return a `const int*`. The `const` applies to the `foo()` member function itself, meaning that it works on `const` instances of `S` and returns a (non-`const`) `int*`. To avoid that trap, I always use the D-style `const()` syntax, and write member function qualifiers on the right: - -``` - - struct S - { - const(int)* foo() - { - // ... - } - - int* bar() const - { - // ... - } - } - -``` - -### Syntax ambiguities - -C++ allows initialising struct and class instances without an `=` sign: - -``` - - S s(42); - -``` - -This syntax famously leads to ambiguities with function declaration syntax in special cases (Scott Meyers’ “most vexing parse”). [People like Herb Sutter have written enough about it.][4] D only supports initialisation with `=`: - -``` - - S s = S(42); - // Alternatively: - auto s = S(42); - -``` - -C syntax has some weird corners, too. Here’s a simple one: - -``` - - x*y; - -``` - -That looks like a useless multiplication between two variables, but logically it could be a declaration of `y` as a pointer to a type `x`. Expression and declaration are totally different parses that depend on what the symbol `x` means in this scope. (Even worse, if it’s a declaration, then the new `y` could shadow an existing `y`, which could affect later parses.) So C compilers need to track symbols in a symbol table while parsing, which is why C has forward declarations in practice. - -D sidesteps the ambiguity by requiring a typecast to `void` if you really want to write an arithmetic expression without assigning it to anything: - -``` - - int x, y; - cast(void)(x*y); - -``` - -I’ve never seen useful code do that, but that rule helps D parse simply without forward declarations. - -Here’s another quirk of C syntax. Remember that C declarations work by having a basic type on the left, followed by expressions that evaluate to that type? C allows parentheses in those expressions, and doesn’t care about whitespace as long as symbols don’t run together. That means these two declarations are equivalent: - -``` - - int x; - int(x); - -``` - -But what if, instead of `int`, we use some symbol that might be a typedef? - -``` - - // Is this a declaration of x, or a function call? - t(x); - -``` - -Just for fun, we can exploit shadowing and C’s archaic type rules: - -``` - - typedef (*x)(); - main() - { - x(x); - x(x); - } - -``` - -The first line makes `x` a typedef to a function pointer type. The first `x(x);` redeclares `x` to be a function pointer variable, shadowing the typedef. The second `x(x);` is a function call that passes `x` as an argument. Yes, this code actually compiles, but it’s undefined behaviour because the function pointer is dereferenced without being initialised. - -D avoids this chaos thanks to its “all type information on the left” rule. There’s no need to put parentheses around symbols in declarations, so `x(y);` is always a function call. - --------------------------------------------------------------------------------- - -via: https://theartofmachinery.com/2020/08/18/d_declarations_for_c_programmers.html - -作者:[Simon Arneaud][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://theartofmachinery.com -[b]: https://github.com/lujun9972 -[1]: https://ddili.org/ders/d.en/index.html -[2]: https://tour.dlang.org/tour/en/basics/delegates -[3]: https://dlang.org/articles/const-faq.html#transitive-const -[4]: https://herbsutter.com/2013/05/09/gotw-1-solution/ diff --git a/sources/tech/20200916 Analyze Linux startup performance.md b/sources/tech/20200916 Analyze Linux startup performance.md deleted file mode 100644 index 855251cfc1..0000000000 --- a/sources/tech/20200916 Analyze Linux startup performance.md +++ /dev/null @@ -1,422 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Analyze Linux startup performance) -[#]: via: (https://opensource.com/article/20/9/systemd-startup-configuration) -[#]: author: (David Both https://opensource.com/users/dboth) - -Analyze Linux startup performance -====== -Use systemd-analyze to get insights and solve problems with Linux -startup performance. -![Magnifying glass on code][1] - -Part of the system administrator's job is to analyze the performance of systems and to find and resolve problems that cause poor performance and long startup times. Sysadmins also need to check other aspects of systemd configuration and usage. - -The systemd init system provides the `systemd-analyze` tool that can help uncover performance problems and other important systemd information. In a previous article, [_Analyzing systemd calendar and timespans_][2], I used `systemd-analyze` to analyze timestamps and timespans in systemd timers, but this tool has many other uses, some of which I will explore in this article. - -### Startup overview - -The Linux startup sequence is a good place to begin exploring because many `systemd-analyze` tool functions are targeted at startup. But first, it is important to understand the difference between boot and startup. The boot sequence starts with the BIOS power-on self test (POST) and ends when the kernel is finished loading and takes control of the host system, which is the beginning of startup and the point when the systemd journal begins. - -In the second article in this series, [_Understanding systemd at startup on Linux_][3], I discuss startup in a bit more detail with respect to what happens and in what sequence. In this article, I want to examine the startup sequence to look at the amount of time it takes to go through startup and which tasks take the most time. - -The results I'll show below are from my primary workstation, which is much more interesting than a virtual machine's results. This workstation consists of an ASUS TUF X299 Mark 2 motherboard, an Intel i9-7960X CPU with 16 cores and 32 CPUs (threads), and 64GB of RAM. Some of the commands below can be run by a non-root user, but I will use root in this article to prevent having to switch between users. - -There are several options for examining the startup sequence. The simplest form of the `systemd-analyze` command displays an overview of the amount of time spent in each of the main sections of startup, the kernel startup, loading and running `initrd` (i.e., initial ramdisk, a temporary system image that is used to initialize some hardware and mount the `/` [root] filesystem), and userspace (where all the programs and daemons required to bring the host up to a usable state are loaded). If no subcommand is passed to the command, `systemd-analyze time` is implied: - - -``` -[root@david ~]$ systemd-analyze -Startup finished in 53.921s (firmware) + 2.643s (loader) + 2.236s (kernel) + 4.348s (initrd) + 10.082s (userspace) = 1min 13.233s -graphical.target reached after 10.071s in userspace -[root@david ~]# -``` - -The most notable data in this output is the amount of time spent in firmware (BIOS): almost 54 seconds. This is an extraordinary amount of time, and none of my other physical systems take anywhere near as long to get through BIOS. - -My System76 Oryx Pro laptop spends only 8.506 seconds in BIOS, and all of my home-built systems take a bit less than 10 seconds. After some online searches, I found that this motherboard is known for its inordinately long BIOS boot time. My motherboard never "just boots." It always hangs, and I need to do a power off/on cycle, and then BIOS starts with an error, and I need to press F1 to enter BIOS configuration, from where I can select the boot drive and finish the boot. This is where the extra time comes from. - -Not all hosts show firmware data. My unscientific experiments lead me to believe that this data is shown only for Intel generation 9 processors or above. But that could be incorrect. - -This overview of the boot startup process is interesting and provides good (though limited) information, but there is much more information available about startup, as I'll describe below. - -### Assigning blame - -You can use `systemd-analyze blame` to discover which systemd units take the most time to initialize. The results are displayed in order by the amount of time they take to initialize, from most to least: - - -``` -[root@david ~]$ systemd-analyze blame                                                                         -       5.417s NetworkManager-wait-online.service                                                       -       3.423s dracut-initqueue.service                                                                 -       2.715s systemd-udev-settle.service                                                               -       2.519s fstrim.service                                                                           -       1.275s udisks2.service                                                                           -       1.271s smartd.service                                                                           -        996ms upower.service                                                                           -        637ms lvm2-monitor.service                                                                     -        533ms lvm2-pvscan@8:17.service                                                                 -        520ms dmraid-activation.service                                                                 -        460ms vboxdrv.service                                                                           -        396ms initrd-switch-root.service -<SNIP – removed lots of entries with increasingly small times> -``` - -Because many of these services start in parallel, the numbers may add up to significantly more than the total given by `systemd-analyze time` for everything after the BIOS. All of these are small numbers, so I cannot find any significant savings here. - -The data from this command can provide indications about which services you might consider to improve boot times. Services that are not used can be disabled. There does not appear to be any single service that is taking an excessively long time during this startup sequence. You may see different results for each boot and startup. - -### Critical chains - -Like the critical path in project management, a _critical chain_ shows the time-critical chain of events that take place during startup. These are the systemd units you want to look at if startup is slow, as they are the ones that would cause delays. This tool does not display all the units that start, only those in this critical chain of events: - - -``` -[root@david ~]# systemd-analyze critical-chain -The time when unit became active or started is printed after the "@" character. -The time the unit took to start is printed after the "+" character. - -graphical.target @10.071s -└─lxdm.service @10.071s -  └─plymouth-quit.service @10.047s +22ms -    └─systemd-user-sessions.service @10.031s +7ms -      └─remote-fs.target @10.026s -        └─remote-fs-pre.target @10.025s -          └─nfs-client.target @4.636s -            └─gssproxy.service @4.607s +28ms -              └─network.target @4.604s -                └─NetworkManager.service @4.383s +219ms -                  └─dbus-broker.service @4.434s +136ms -                    └─dbus.socket @4.369s -                      └─sysinit.target @4.354s -                        └─systemd-update-utmp.service @4.345s +9ms -                          └─auditd.service @4.301s +42ms -                            └─systemd-tmpfiles-setup.service @4.254s +42ms -                              └─import-state.service @4.233s +19ms -                                └─local-fs.target @4.229s -                                  └─Virtual.mount @4.019s +209ms -                                    └─systemd-fsck@dev-mapper-vg_david2\x2dVirtual.service @3.742s +274ms -                                      └─local-fs-pre.target @3.726s -                                        └─lvm2-monitor.service @356ms +637ms -                                          └─dm-event.socket @319ms -                                            └─-.mount -                                              └─system.slice -                                                └─-.slice -[root@david ~]# -``` - -The numbers preceded with `@` show the absolute number of seconds since startup began when the unit becomes active. The numbers preceded by `+` show the amount of time it takes for the unit to start. - -### System state - -Sometimes you need to determine the system's current state. The `systemd-analyze dump` command dumps a _massive_ amount of data about the current system state. It starts with a list of the primary boot timestamps, a list of each systemd unit, and a complete description of the state of each: - - -``` -[root@david ~]# systemd-analyze dump -Timestamp firmware: 1min 7.983523s -Timestamp loader: 3.872325s -Timestamp kernel: Wed 2020-08-26 12:33:35 EDT -Timestamp initrd: Wed 2020-08-26 12:33:38 EDT -Timestamp userspace: Wed 2020-08-26 12:33:42 EDT -Timestamp finish: Wed 2020-08-26 16:33:56 EDT -Timestamp security-start: Wed 2020-08-26 12:33:42 EDT -Timestamp security-finish: Wed 2020-08-26 12:33:42 EDT -Timestamp generators-start: Wed 2020-08-26 16:33:42 EDT -Timestamp generators-finish: Wed 2020-08-26 16:33:43 EDT -Timestamp units-load-start: Wed 2020-08-26 16:33:43 EDT -Timestamp units-load-finish: Wed 2020-08-26 16:33:43 EDT -Timestamp initrd-security-start: Wed 2020-08-26 12:33:38 EDT -Timestamp initrd-security-finish: Wed 2020-08-26 12:33:38 EDT -Timestamp initrd-generators-start: Wed 2020-08-26 12:33:38 EDT -Timestamp initrd-generators-finish: Wed 2020-08-26 12:33:38 EDT -Timestamp initrd-units-load-start: Wed 2020-08-26 12:33:38 EDT -Timestamp initrd-units-load-finish: Wed 2020-08-26 12:33:38 EDT --> Unit system.slice: -        Description: System Slice -        Instance: n/a -        Unit Load State: loaded -        Unit Active State: active -        State Change Timestamp: Wed 2020-08-26 12:33:38 EDT -        Inactive Exit Timestamp: Wed 2020-08-26 12:33:38 EDT -        Active Enter Timestamp: Wed 2020-08-26 12:33:38 EDT -        Active Exit Timestamp: n/a -        Inactive Enter Timestamp: n/a -        May GC: no -<SNIP – Deleted a bazillion lines of output> -``` - -On my main workstation, this command generated a stream of 49,680 lines and about 1.66MB. This command is very fast, so you don't need to wait for the results. - -I do like the wealth of detail provided for the various connected devices, such as storage. Each systemd unit has a section with details such as modes for various runtimes, cache, and log directories, the command line used to start the unit, the process ID (PID), the start timestamp, as well as memory and file limits. - -The man page for `systemd-analyze` shows the `systemd-analyze --user dump` option, which is intended to display information about the internal state of the user manager. This fails for me, and internet searches indicate that there may be a problem with it. In systemd, `--user` instances are used to manage and control the resources for the hierarchy of processes belonging to each user. The processes for each user are part of a control group, which I'll cover in a future article. - -### Analytic graphs - -Most pointy-haired-bosses (PHBs) and many good managers find pretty graphs easier to read and understand than the text-based system performance data I usually prefer. Sometimes, though, even I like a good graph, and `systemd-analyze` provides the capability to display boot/startup data in an [SVG][4] vector graphics chart. - -The following command generates a vector graphics file that displays the events that take place during boot and startup. It only takes a few seconds to generate this file: - - -``` -`[root@david ~]# systemd-analyze plot > /tmp/bootup.svg` -``` - -This command creates an SVG, which is a text file that defines a series of graphic vectors that applications, including Image Viewer, Ristretto, Okular, Eye of Mate, LibreOffice Draw, and others, use to generate a graph. These applications process SVG files to create an image. - -I used LibreOffice Draw to render a graph. The graph is huge, and you need to zoom in considerably to make out any detail. Here is a small portion of it: - -![The bootup.svg file displayed in LibreOffice Draw.][5] - -(David Both, [CC BY-SA 4.0][6]) - -The bootup sequence is to the left of the zero (0) on the timeline in the graph, and the startup sequence is to the right of zero. This small portion shows the kernel, `initrd`, and the processes `initrd` started. - -This graph shows at a glance what started when, how long it took to start up, and the major dependencies. The critical path is highlighted in red. - -Another command that generates graphical output is `systemd-analyze plot`. It generates textual dependency graph descriptions in [DOT][7] format. The resulting data stream is then piped through the `dot` utility, which is part of a family of programs that can be used to generate vector graphic files from various types of data. These SVG files can also be processed by the tools listed above. - -First, generate the file. This took almost nine minutes on my primary workstation: - - -``` -[root@david ~]# time systemd-analyze dot | dot -Tsvg > /tmp/test.svg -   Color legend: black     = Requires -                 dark blue = Requisite -                 dark grey = Wants -                 red       = Conflicts -                 green     = After - -real    8m37.544s -user    8m35.375s -sys     0m0.070s -[root@david ~]# -``` - -I won't reproduce the output here because the resulting graph is pretty much spaghetti. But you should try it and view the result to see what I mean. - -### Conditionals - -One of the more interesting, yet somewhat generic, capabilities I discovered while reading the `systemd-analyze(1)` man page is the `condition` subcommand. (Yes—I do read the man pages, and it is amazing what I have learned this way!) This `condition` subcommand can be used to test the conditions and asserts that can be used in systemd unit files. - -It can also be used in scripts to evaluate one or more conditions—it returns a zero (0) if all are met or a one (1) if any condition is not met. In either case, it also spews text about its findings. - -The example below, from the man page, is a bit complex. It tests for a kernel version between 4.0 and 5.1, that the host is running on AC power, that the system architecture is anything but ARM, and that the directory `/etc/os-release` exists. I added the `echo $?` statement to print the return code. - - -``` -[root@david ~]# systemd-analyze condition 'ConditionKernelVersion = ! <4.0' \ -                    'ConditionKernelVersion = >=5.1' \ -                    'ConditionACPower=|false' \ -                    'ConditionArchitecture=|!arm' \ -                    'AssertPathExists=/etc/os-release' ; \ -echo $? -test.service: AssertPathExists=/etc/os-release succeeded. -Asserts succeeded. -test.service: ConditionArchitecture=|!arm succeeded. -test.service: ConditionACPower=|false failed. -test.service: ConditionKernelVersion=>=5.1 succeeded. -test.service: ConditionKernelVersion=!<4.0 succeeded. -Conditions succeeded. -0 -[root@david ~]# -``` - -The list of conditions and asserts starts around line 600 on the `systemd.unit(5)` man page. - -### Listing configuration files - -The `systemd-analyze` tool provides a way to send the contents of various configuration files to `STDOUT`, as shown here. The base directory is `/etc/`: - - -``` -[root@david ~]# systemd-analyze cat-config systemd/system/display-manager.service -# /etc/systemd/system/display-manager.service -[Unit] -Description=LXDM (Lightweight X11 Display Manager) -#Documentation=man:lxdm(8) -Conflicts=[getty@tty1.service][8] -After=systemd-user-sessions.service [getty@tty1.service][8] plymouth-quit.service livesys-late.service -#Conflicts=plymouth-quit.service - -[Service] -ExecStart=/usr/sbin/lxdm -Restart=always -IgnoreSIGPIPE=no -#BusName=org.freedesktop.lxdm - -[Install] -Alias=display-manager.service -[root@david ~]# -``` - -This is a lot of typing to do nothing more than a standard `cat` command does. I find the next command a tiny bit helpful. It can search out files with the specified pattern within the standard systemd locations: - - -``` -[root@david ~]# systemctl cat backup* -# /etc/systemd/system/backup.timer -# This timer unit runs the local backup program -# (C) David Both -# Licensed under GPL V2 -# - -[Unit] -Description=Perform system backups -Requires=backup.service - -[Timer] -Unit=backup.service -OnCalendar=*-*-* 00:15:30 - -[Install] -WantedBy=timers.target - -# /etc/systemd/system/backup.service -# This service unit runs the rsbu backup program -# By David Both -# Licensed under GPL V2 -# - -[Unit] -Description=Backup services using rsbu -Wants=backup.timer - -[Service] -Type=oneshot -Environment="HOME=/root" -ExecStart=/usr/local/bin/rsbu -bvd1 -ExecStart=/usr/local/bin/rsbu -buvd2 - -[Install] -WantedBy=multi-user.target - -[root@david ~]# -``` - -Both of these commands preface the contents of each file with a comment line containing the file's full path and name. - -### Unit file verification - -After creating a new unit file, it can be helpful to verify that its syntax is correct. This is what the `verify` subcommand does. It can list directives that are spelled incorrectly and call out missing service units: - - -``` -`[root@david ~]# systemd-analyze verify /etc/systemd/system/backup.service` -``` - -Adhering to the Unix/Linux philosophy that "silence is golden," a lack of output messages means that there are no errors in the scanned file. - -### Security - -The `security` subcommand checks the security level of specified services. It only works on service units and not on other types of unit files: - - -``` -[root@david ~]# systemd-analyze security display-manager -  NAME                                                        DESCRIPTION                                                     > -✗ PrivateNetwork=                                             Service has access to the host's network                        > -✗ User=/DynamicUser=                                          Service runs as root user                                       > -✗ CapabilityBoundingSet=~CAP_SET(UID|GID|PCAP)                Service may change UID/GID identities/capabilities              > -✗ CapabilityBoundingSet=~CAP_SYS_ADMIN                        Service has administrator privileges                            > -✗ CapabilityBoundingSet=~CAP_SYS_PTRACE                       Service has ptrace() debugging abilities                        > -✗ RestrictAddressFamilies=~AF_(INET|INET6)                    Service may allocate Internet sockets                           > -✗ RestrictNamespaces=~CLONE_NEWUSER                           Service may create user namespaces                              > -✗ RestrictAddressFamilies=~…                                  Service may allocate exotic sockets                             > -✗ CapabilityBoundingSet=~CAP_(CHOWN|FSETID|SETFCAP)           Service may change file ownership/access mode/capabilities unres> -✗ CapabilityBoundingSet=~CAP_(DAC_*|FOWNER|IPC_OWNER)         Service may override UNIX file/IPC permission checks            > -✗ CapabilityBoundingSet=~CAP_NET_ADMIN                        Service has network configuration privileges                    > -✗ CapabilityBoundingSet=~CAP_SYS_MODULE                       Service may load kernel modules -<SNIP> -✗ CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG                   Service may issue vhangup()                                     > -✗ CapabilityBoundingSet=~CAP_WAKE_ALARM                       Service may program timers that wake up the system              > -✗ RestrictAddressFamilies=~AF_UNIX                            Service may allocate local sockets                              > - -→ Overall exposure level for backup.service: 9.6 UNSAFE 😨 -lines 34-81/81 (END) -``` - -Yes, the emoji is part of the output. But, of course, many services need pretty much complete access to everything in order to do their work. I ran this program against several services, including my own backup service; the results may differ, but the bottom line seems to be mostly the same. - -This tool would be very useful for checking and fixing userspace service units in security-critical environments. I don't think it has much to offer for most of us. - -### Final thoughts - -This powerful tool offers some interesting and amazingly useful options. Much of what this article explores is about using `systemd-analyze` to provide insights into Linux's startup performance using systemd. It can also analyze other aspects of systemd. - -Some of these tools are of limited use, and a couple should be forgotten completely. But most can be used to good effect when resolving problems with startup and other systemd functions. - -### Resources - -There is a great deal of information about systemd available on the internet, but much is terse, obtuse, or even misleading. In addition to the resources mentioned in this article, the following webpages offer more detailed and reliable information about systemd startup. This list has grown since I started this series of articles to reflect the research I have done. - - * The [systemd.unit(5) manual page][9] contains a nice list of unit file sections and their configuration options along with concise descriptions of each. - * The Fedora Project has a good, practical [guide to systemd][10]. It has pretty much everything you need to know in order to configure, manage, and maintain a Fedora computer using systemd. - * The Fedora Project also has a good [cheat sheet][11] that cross-references the old SystemV commands to comparable systemd ones. - * Red Hat documentation contains a good description of the [Unit file structure][12] as well as other important information.   - * For detailed technical information about systemd and the reasons for creating it, check out Freedesktop.org's [description of systemd][13]. - * [Linux.com][14]'s "More systemd fun" offers more advanced systemd [information and tips][15]. - - - -There is also a series of deeply technical articles for Linux sysadmins by Lennart Poettering, the designer and primary developer of systemd. These articles were written between April 2010 and September 2011, but they are just as relevant now as they were then. Much of everything else good that has been written about systemd and its ecosystem is based on these papers. - - * [Rethinking PID 1][16] - * [systemd for Administrators, Part I][17] - * [systemd for Administrators, Part II][18] - * [systemd for Administrators, Part III][19] - * [systemd for Administrators, Part IV][20] - * [systemd for Administrators, Part V][21] - * [systemd for Administrators, Part VI][22] - * [systemd for Administrators, Part VII][23] - * [systemd for Administrators, Part VIII][24] - * [systemd for Administrators, Part IX][25] - * [systemd for Administrators, Part X][26] - * [systemd for Administrators, Part XI][27] - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/9/systemd-startup-configuration - -作者:[David Both][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/dboth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/find-file-linux-code_magnifying_glass_zero.png?itok=E2HoPDg0 (Magnifying glass on code) -[2]: https://opensource.com/article/20/7/systemd-calendar-timespans -[3]: https://opensource.com/article/20/5/systemd-startup?utm_campaign=intrel -[4]: https://en.wikipedia.org/wiki/Scalable_Vector_Graphics -[5]: https://opensource.com/sites/default/files/uploads/bootup.svg-graph.png (The bootup.svg file displayed in LibreOffice Draw.) -[6]: https://creativecommons.org/licenses/by-sa/4.0/ -[7]: https://en.wikipedia.org/wiki/DOT_(graph_description_language) -[8]: mailto:getty@tty1.service -[9]: https://man7.org/linux/man-pages/man5/systemd.unit.5.html -[10]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html -[11]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet -[12]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/managing-services-with-systemd_configuring-basic-system-settings#Managing_Services_with_systemd-Unit_File_Structure -[13]: https://www.freedesktop.org/wiki/Software/systemd/ -[14]: http://Linux.com -[15]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/ -[16]: http://0pointer.de/blog/projects/systemd.html -[17]: http://0pointer.de/blog/projects/systemd-for-admins-1.html -[18]: http://0pointer.de/blog/projects/systemd-for-admins-2.html -[19]: http://0pointer.de/blog/projects/systemd-for-admins-3.html -[20]: http://0pointer.de/blog/projects/systemd-for-admins-4.html -[21]: http://0pointer.de/blog/projects/three-levels-of-off.html -[22]: http://0pointer.de/blog/projects/changing-roots -[23]: http://0pointer.de/blog/projects/blame-game.html -[24]: http://0pointer.de/blog/projects/the-new-configuration-files.html -[25]: http://0pointer.de/blog/projects/on-etc-sysinit.html -[26]: http://0pointer.de/blog/projects/instances.html -[27]: http://0pointer.de/blog/projects/inetd.html diff --git a/sources/tech/20201010 Robust and Race-free Server Logging using Named Pipes.md b/sources/tech/20201010 Robust and Race-free Server Logging using Named Pipes.md deleted file mode 100644 index e9e41e7303..0000000000 --- a/sources/tech/20201010 Robust and Race-free Server Logging using Named Pipes.md +++ /dev/null @@ -1,120 +0,0 @@ -[#]: subject: "Robust and Race-free Server Logging using Named Pipes" -[#]: via: "https://theartofmachinery.com/2020/10/10/logging_with_named_pipes.html" -[#]: author: "Simon Arneaud https://theartofmachinery.com" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Robust and Race-free Server Logging using Named Pipes -====== - -If you do any server administration work, you’ll have worked with log files. And if your servers need to be reliable, you’ll know that log files are common source of problems, especially when you need to rotate or ship them (which is practically always). In particular, moving files around causes race conditions. - -Thankfully, there are better ways. With named pipes, you can have a simple and robust logging stack, with no race conditions, and without patching your servers to support some network logging protocol. - -### The problems with rotating log files - -First, let’s talk about the problems. Race conditions are generally a problem with popular file-based logging setups, whether you’re rotating logs into archival storage, or shipping them to a remote log processing stack, or whatever. To keep things concrete, though, let me talk about [logrotate][1], just because it’s a popular tool. - -Say you have a log file at `/var/log/foo`. It gets pretty big, and you want to process the logs periodically and start with a new, empty file. So you (or your distro maintainers) set up logrotate with various rules about when to rotate the file. - -By default, logrotate will rename the file (to something like `/var/log/foo.1`) and create a new `/var/log/foo` to write to. That (mostly) works for software that runs intermittently (such as a package manager that does software updates). But it won’t do any good if the log file is generated by a long-running server. The server only uses the filename when it opens the file; after that it just keeps writing to its open file descriptor. That means it will keep writing to the old file (now named `/var/log/foo.1`), and the new `/var/log/foo` file will stay empty. - -To handle this use-case, logrotate supports another mode: `copytruncate`. In this mode, instead of renaming, logrotate will copy the contents of `/var/log/foo` to an archival file, and then truncate the original file to zero length. As long as the server has the log file open in append mode, it will automatically write new logs to the start of the file, without needing to detect the truncation and do a file seek (the kernel handles that). - -That `copytruncate` mode creates a race condition, though. Any log lines that are written after the copy but before the truncation will get destroyed. Actually, you tend to get the same race condition even with the default move-and-create mode. That’s because there’s not much point just splitting up the logs into multiple files. Most systems are configured to do something like compress the old log file, but ultimately you need to delete the old, uncompressed data, which creates the same race as truncating. (In practice, this race isn’t so likely for occasional log writers, like package managers, and the `delay` flag to logrotate makes it rarer, albeit by making the log handling a bit more complicated.) - -Some servers, like [Nginx][2], support a modification of the default logrotate mode: - - 1. Rename the old file - 2. Create the new file - 3. (New step) notify the server that it needs to reopen its log file. - - - -This works (as long as the logs processor doesn’t delete the old file before the server has finished reopening), but it requires special support from the server, and you’re out of luck with most software. There’s a lot of software out there, and log file handling just isn’t interesting enough to get high on the to-do list. This approach also only works for long-running servers. - -I think this is a good point to stop and take a step back. Having multiple processes juggle log files around on disk without any synchronisation is just an inherently painful way to do things. It causes bugs and makes logging stacks complicated ([here’s just one of many examples][3]). One alternative is to use some network protocol like MQTT or networked syslog, but, realistically, most servers won’t support the one you want. And they shouldn’t have to — log files are a great interface for log writers. - -That’s okay because *nix “everything is a file” lets us easily get a file interface on the writer side, with a streaming interface on the reader side. - -### Named pipes 101 - -Maybe you’ve seen pipes in pipelines like this: - -``` - - $ sort user_log.txt | uniq - -``` - -The pipe connecting `sort` and `uniq` is a temporary, anonymous communication channel that `sort` writes to and `uniq` reads from. Named pipes are less common, but they’re also communication channels. The only difference is that they persist on the filesystem as if they were files. - -Open up a terminal and `cd` into some temporary working directory. The following creates a named pipe and uses `cat` to open a writer: - -``` - - $ mkfifo p - $ # This cat command will sit waiting for input - $ cat > p - -``` - -Leave that `cat` command waiting, and open up another terminal in the same directory. In this terminal, start your reader: - -``` - - $ # This will sit waiting for data to come over the pipe - $ cat p - -``` - -Now as you type things into the writer end, you’ll see them appear in the reader end. `cat` will use line buffering in interactive mode, so data will get transferred every time you start a new line. - -`cat` doesn’t have to know anything about pipes for this to work — the pipe acts like a file as long as you just naïvely read or write to it. But if you check, you’ll see the data isn’t stored anywhere. You can pump gigabytes through a pipe without filling up any disk space. Once the data has been read once, it’s lost. (You can have multiple readers, but only one will receive any buffer-load of data.) - -Another thing that makes pipes useful for communication is their buffering and blocking. You can start writing before any readers open the pipe, and data gets temporarily buffered inside the kernel until a reader comes along. If the reader starts first, its read will block, waiting for data from the writer. (The writer will also block if the pipe buffer gets full.) If you try the two-terminal experiment again with a regular file, you’ll see that the reader `cat` will eagerly read all the data it can and then exit. - -### An annoying problem and a simple solution - -Maybe you’re seeing how named pipes can help with logging: Servers can write to log “files” that are actually named pipes, and a logging stack can read log data directly from the named pipe without letting a single line fall onto the floor. You do whatever you want with the logs, without any racey juggling of files on disk. - -There’s one annoying problem: the writer doesn’t need a reader to start writing, but if a reader opens the pipe and then closes it, the writer gets a `SIGPIPE` (“broken pipe”), which will kill it by default. (Try killing the reader `cat` while typing things into the writer to see what I mean.) Similarly, a reader can read without a writer, but if a writer opens the pipe and then closes it, that will be treated like an end of file. Although the named pipe persists on disk, it isn’t a stable communication channel if log writers and log readers can restart (as they will on a real server). - -There’s a solution that’s a bit weird but very simple. Multiple processes can open the pipe for reading and writing, and the pipe will only close when _all_ readers or _all_ writers close it. All we need for a stable logging pipe is a daemon that holds the named pipe open for both reading and writing, without doing any actual reading or writing. I set this up on my personal server last year, and I wrote [a tiny, zero-config program to act as my pipe-holding daemon][4]. It just opens every file in its current working directory for both reading and writing. I run it from a directory that has symbolic links to every named pipe in my logging stack. The program runs in a loop that ends in a `wait()` for a `SIGHUP`. If I ever update the symlinks in the directory, I give the daemon a `kill -HUP` and it reopens them all. Sure, it could do its own directory watching, but the `SIGHUP` approach is simple and predictable, and the whole thing works reliably. Thanks to the pipe buffer, log writers and log readers can be shut down and restarted independently, any time, without breakage. - -My server uses the [s6 supervision suite][5] to manage daemons, so I have s6-log reading from each logging pipe. The bottom part of the [s6-log documentation page][6] has some good insights into the problems with popular logging systems, and good ideas about better ways to do things. - -### Imagine: a world without log rotation - -Strictly speaking, named pipes aren’t necessary for race-free logs processing. The s6 suite encourages writing logs to some file descriptor (like standard error), and letting the supervision suite make sure those file descriptors point to something useful. However, the named pipe approach adds a few benefits: - - * It doesn’t require any co-ordination between writer and reader - * It integrates nicely with the software we have today - * It gives things meaningful names (rather than `/dev/fd/4`) - - - -I’ve worked with companies that spend about as much on their logging stacks as on their serving infrastructure, and, no, “we do logs processing” isn’t in their business models. Of course, log rotation and log shipping aren’t the only problems to blame, but it feels so wrong that we’ve made logs so complicated. If you work on any logging system, consider if you really need to juggle log files around. You could be helping to make the world a better place. - --------------------------------------------------------------------------------- - -via: https://theartofmachinery.com/2020/10/10/logging_with_named_pipes.html - -作者:[Simon Arneaud][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://theartofmachinery.com -[b]: https://github.com/lujun9972 -[1]: https://github.com/logrotate/logrotate -[2]: https://www.nginx.com/resources/wiki/start/topics/examples/logrotation/ -[3]: https://community.splunk.com/t5/Getting-Data-In/Why-copytruncate-logrotate-does-not-play-well-with-splunk/td-p/196112 -[4]: https://gitlab.com/sarneaud/fileopenerd -[5]: http://www.skarnet.org/software/s6/index.html -[6]: http://www.skarnet.org/software/s6/s6-log.html diff --git a/sources/tech/20201016 systemd-resolved- introduction to split DNS.md b/sources/tech/20201016 systemd-resolved- introduction to split DNS.md deleted file mode 100644 index 0801dd90fa..0000000000 --- a/sources/tech/20201016 systemd-resolved- introduction to split DNS.md +++ /dev/null @@ -1,162 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (systemd-resolved: introduction to split DNS) -[#]: via: (https://fedoramagazine.org/systemd-resolved-introduction-to-split-dns/) -[#]: author: (zbyszek https://fedoramagazine.org/author/zbyszek/) - -systemd-resolved: introduction to split DNS -====== - -![][1] - -Photo by [Ruvim Noga][2] on [Unsplash][3] - -Fedora 33 switches the default DNS resolver to [systemd-resolved][4]. In simple terms, this means that systemd-resolved will run as a daemon. All programs wanting to translate domain names to network addresses will talk to it. This replaces the current default lookup mechanism where each program individually talks to remote servers and there is no shared cache. - -If necessary, systemd-resolved will contact remote DNS servers. systemd-resolved is a “stub resolver”—it doesn’t resolve all names itself (by starting at the root of the DNS hierarchy and going down label by label), but forwards the queries to a remote server. - -A single daemon handling name lookups provides significant benefits. The daemon caches answers, which speeds answers for frequently used names. The daemon remembers which servers are non-responsive, while previously each program would have to figure this out on its own after a timeout. Individual programs only talk to the daemon over a local transport and are more isolated from the network. The daemon supports fancy rules which specify which name servers should be used for which domain names—in fact, the rest of this article is about those rules. - -### Split DNS - -Consider the scenario of a machine that is connected to two semi-trusted networks (wifi and ethernet), and also has a VPN connection to your employer. Each of those three connections has its own network interface in the kernel. And there are multiple name servers: one from a DHCP lease from the wifi hotspot, two specified by the VPN and controlled by your employer, plus some additional manually-configured name servers. _Routing_ is the process of deciding which servers to ask for a given domain name. Do not mistake this with the process of deciding where to send network packets, which is called routing too. - -The network interface is king in systemd-resolved. systemd-resolved first picks one or more interfaces which are appropriate for a given name, and then queries one of the name servers attached to that interface. This is known as “split DNS”. - -There are two flavors of domains attached to a network interface: _routing domains_ and _search domains_. They both specify that the given domain and any subdomains are appropriate for that interface. Search domains have the additional function that single-label names are suffixed with that search domain before being resolved. For example, a lookup for “server” is treated as a lookup for “server.example.com” if the search domain is “example.com.” In systemd-resolved config files, routing domains are prefixed with the tilde (~) character. - -#### Specific example - -Now consider a specific example: your VPN interface _tun0_ has a search domain _private.company.com_ and a routing domain _~company.com_. If you ask for _mail.private.company.com_, it is matched by both domains, so this name would be routed to _tun0_. - -A request for _[www.company.com][5]_ is matched by the second domain and would also go to _tun0_. If you ask for _www_, (in other words, if you specify a single-label name without any dots), the difference between routing and search domains comes into play. systemd-resolved attempts to combine the single-label name with the search domain and tries to resolve _[www.private.company.com][6]_ on _tun0_. - -If you have multiple interfaces with search domains, single-label names are suffixed with all search domains and resolved in parallel. For multi-label names, no suffixing is done; search and routing domains are are used to route the name to the appropriate interface. The longest match wins. When there are multiple matches of the same length on different interfaces, they are resolved in parallel. - -A special case is when an interface has a routing domain _~._ (a tilde for a routing domain and a dot for the root DNS label). Such an interface always matches any names, but with the shortest possible length. Any interface with a matching search or routing domain has higher priority, but the interface with _~._ is used for all other names. Finally, if no routing or search domains matched, the name is routed to all interfaces that have at least one name server attached. - -### Lookup routing in systemd-resolved - -#### Domain routing - -This seems fairly complex, partially because of the historic names which are confusing. In actual practice it’s not as complicated as it seems. - -To introspect a running system, use the _resolvectl domain_ command. For example: - -``` -$ resolvectl domain -Global: -Link 4 (wlp4s0): ~. -Link 18 (hub0): -Link 26 (tun0): redhat.com -``` - -You can see that _www_ would resolve as _[www.redhat.com][7]_. over _tun0_. Anything ending with _redhat.com_ resolves over _tun0_. Everything else would resolve over _wlp4s0_ (the wireless interface). In particular, a multi-label name like _[www.foobar][8]_ would resolve over _wlp4s0_, and most likely fail because there is no _foobar_ top-level domain (yet). - -#### Server routing - -Now that you know which _interface_ or interfaces should be queried, the _server_ or servers to query are easy to determine. Each interface has one or more name servers configured. systemd-resolved will send queries to the first of those. If the server is offline and the request times out or if the server sends a syntactically-invalid answer (which shouldn’t happen with “normal” queries, but often becomes an issue when DNSSEC is enabled), systemd-resolved switches to the next server on the list. It will use that second server as long as it keeps responding. All servers are used in a round-robin rotation. - -To introspect a running system, use the _resolvectl dns_ command: - -``` -$ resolvectl dns -Global: -Link 4 (wlp4s0): 192.168.1.1 8.8.4.4 8.8.8.8 -Link 18 (hub0): -Link 26 (tun0): 10.45.248.15 10.38.5.26 -``` - -When combined with the previous listing, you know that for _[www.redhat.com][7]_, systemd-resolved will query 10.45.248.15, and—if it doesn’t respond—10.38.5.26. For _[www.google.com][9]_, systemd-resolved will query 192.168.1.1 or the two Google servers 8.8.4.4 and 8.8.8.8. - -### Differences from nss-dns - -Before going further detail, you may ask how this differs from the previous default implementation (nss-dns). With nss-dns there is just one global list of up to three name servers and a global list of search domains (specified as _nameserver_ and _search_ in _/etc/resolv.conf_). - -Each name to query is sent to the first name server. If it doesn’t respond, the same query is sent to the second name server, and so on. systemd-resolved implements split-DNS and remembers which servers are currently considered active. - -For single-label names, the query is performed with each of the the search domains suffixed. This is the same with systemd-resolved. For multi-label names, a query for the unsuffixed name is performed first, and if that fails, a query for the name suffixed by each of the search domains in turn is performed. systemd-resolved doesn’t do that last step; it only suffixes single-label names. - -A second difference is that with _nss-dns_, this module is loaded into each process. The process itself communicates with remote servers and implements the full DNS stack internally. With systemd-resolved, the _nss-resolve_ module is loaded into the process, but it only forwards the query to systemd-resolved over a local transport (D-Bus) and doesn’t do any work itself. The systemd-resolved process is heavily sandboxed using systemd service features. - -The third difference is that with systemd-resolved all state is dynamic and can be queried and updated using D-Bus calls. This allows very strong integration with other daemons or graphical interfaces. - -### Configuring systemd-resolved - -So far, this article talked about servers and the routing of domains without explaining how to configure them. systemd-resolved has a configuration file (_/etc/systemd/resolv.conf_) where you specify name servers with _DNS=_ and routing or search domains with _Domains=_ (routing domains with _~_, search domains without). This corresponds to the _Global:_ lists in the two listings above. - -In this article’s examples, both lists are empty. Most of the time configuration is attached to specific interfaces, and “global” configuration is not very useful. Interfaces come and go and it isn’t terribly smart to contact servers on an interface which is down. As soon as you create a VPN connection, you want to use the servers configured for that connection to resolve names, and as soon as the connection goes down, you want to stop. - -How does then systemd-resolved acquire the configuration for each interface? This happens dynamically, with the network management service pushing this configuration over D-Bus into systemd-resolved. The default in Fedora is NetworkManager and it has very good integration with systemd-resolved. Alternatives like systemd’s own systemd-networkd implement similar functionality. But the [interface is open][10] and other programs can do the appropriate D-Bus calls. - -Alternatively, _resolvectl_ can be used for this (it is just a wrapper around the D-Bus API). Finally, _resolvconf_ provides similar functionality in a form compatible with a tool in Debian with the same name. - -#### Scenario: Local connection more trusted than VPN - -The important thing is that in the common scenario, systemd-resolved follows the configuration specified by other tools, in particular NetworkManager. So to understand how systemd-resolved names, you need to see what NetworkManager tells it to do. Normally NM will tell systemd-resolved to use the name servers and search domains received in a DHCP lease on some interface. For example, look at the source of configuration for the two listings shown above: - -![][11]![][12] - -There are two connections: “Parkinson” wifi and “Brno (BRQ)” VPN. In the first panel _DNS:Automatic_ is enabled, which means that the DNS server received as part of the DHCP lease (192.168.1.1) is passed to systemd-resolved. Additionally. 8.8.4.4 and 8.8.8.8 are listed as alternative name servers. This configuration is useful if you want to resolve the names of other machines in the local network, which 192.168.1.1 provides. Unfortunately the hotspot DNS server occasionally gets stuck, and the other two servers provide backup when that happens. - -The second panel is similar, but doesn’t provide any special configuration. NetworkManager combines routing domains for a given connection from DHCP, SLAAC RDNSS, and VPN, and finally manual configuration and forward this to systemd-resolved. This is the source of the search domain _redhat.com_ in the listing above. - -There is an important difference between the two interfaces though: in the second panel, “Use this connection only for resources on its network” is **checked**. This tells NetworkManager to tell systemd-resolved to only use this interface for names under the search domain received as part of the lease (_Link 26 (tun0): redhat.com_ in the first listing above). In the first panel, this checkbox is **unchecked**, and NetworkManager tells systemd-resolved to use this interface for all other names (_Link 4 (wlp4s0): ~._). This effectively means that the wireless connection is more trusted. - -#### Scenario: VPN more trusted than local network - -In a different scenario, a VPN would be more trusted than the local network and the domain routing configuration reversed. If a VPN without “Use this connection only for resources on its network” is active, NetworkManager tells systemd-resolved to attach the default routing domain to this interface. After unchecking the checkbox and restarting the VPN connection: - -``` -$ resolvectl domain -Global: -Link 4 (wlp4s0): -Link 18 (hub0): -Link 28 (tun0): ~. redhat.com -$ resolvectl dns -Global: -Link 4 (wlp4s0): -Link 18 (hub0): -Link 28 (tun0): 10.45.248.15 10.38.5.26 -``` - -Now all domain names are routed to the VPN. The network management daemon controls systemd-resolved and the user controls the network management daemon. - -### Additional systemd-resolved functionality - -As mentioned before, systemd-resolved provides a common name lookup mechanism for all programs running on the machine. Right now the effect is limited: shared resolver and cache and split DNS (the lookup routing logic described above). systemd-resolved provides additional resolution mechanisms beyond the traditional unicast DNS. These are the local resolution protocols MulticastDNS and LLMNR, and an additional remote transport DNS-over-TLS. - -Fedora 33 does not enable MulticastDNS and DNS-over-TLS in systemd-resolved. MulticastDNS is implemented by _nss-mdns4_minimal_ and Avahi. Future Fedora releases may enable these as the upstream project improves support. - -Implementing this all in a single daemon which has runtime state allows smart behaviour: DNS-over-TLS may be enabled in opportunistic mode, with automatic fallback to classic DNS if the remote server does not support it. Without the daemon which can contain complex logic and runtime state this would be much harder. When enabled, those additional features will apply to all programs on the system. - -There is more to systemd-resolved: in particular LLMNR and DNSSEC, which only received brief mention here. A future article will explore those subjects. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/systemd-resolved-introduction-to-split-dns/ - -作者:[zbyszek][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/zbyszek/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2020/10/systemd-resolved2-816x345.jpg -[2]: https://unsplash.com/@ruvimnogaphoto?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[3]: https://unsplash.com/s/photos/colors?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: https://www.freedesktop.org/software/systemd/man/systemd-resolved.service.html -[5]: http://www.company.com -[6]: http://www.private.company.com -[7]: http://www.redhat.com -[8]: http://www.foobar -[9]: http://www.google.com -[10]: https://www.freedesktop.org/software/systemd/man/org.freedesktop.resolve1.html -[11]: https://fedoramagazine.org/wp-content/uploads/2020/10/nm-default-network-with-additional-servers.png -[12]: https://fedoramagazine.org/wp-content/uploads/2020/10/nm-vpn-brno.png diff --git a/sources/tech/20201116 Linux Jargon Buster- What is Grub in Linux- What is it Used for.md b/sources/tech/20201116 Linux Jargon Buster- What is Grub in Linux- What is it Used for.md deleted file mode 100644 index 74dfda57dc..0000000000 --- a/sources/tech/20201116 Linux Jargon Buster- What is Grub in Linux- What is it Used for.md +++ /dev/null @@ -1,130 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Linux Jargon Buster: What is Grub in Linux? What is it Used for?) -[#]: via: (https://itsfoss.com/what-is-grub/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Linux Jargon Buster: What is Grub in Linux? What is it Used for? -====== - -If you ever used a desktop Linux system, you must have seen this screen. This is called the GRUB screen. Yes, it is written in all capital letters. - -![Remember this screen? This is GRUB][1] - -In this chapter of the Linux Jargon Buster series, I’ll tell you what is Grub and what is it used for. I’ll also briefly touch upon the configuration and customization part. - -### What is GRUB? - -[GRUB][2] is complete program for loading and managing boot. It is the most common bootloader for Linux distributions. A bootloader is the first software that runs when a computer starts. It loads the [kernel of the operating system][3] and then the kernel initializes the rest of the operating systems (shell, [display manager][4], [desktop environment][5] etc). - -#### Boot loader vs boot manager - -I didn’t want to confuse you at this stage but I see no option to avoid bringing this topic. There is a blur line between a bootloader and a boot manager. - -You already know that bootloader starts first and then loads the kernel into memory and executes it. A boot manager program allows you to choose between operating systems (if there are more than one OS on your system). A boot manager doesn’t load the OS directly, - -With Linux kernel version 3.3, the [Linux kernel includes a built-in EFI bootloader][6]. In fact, any operating system that is capable of working [EFI system includes an EFI bootloader][7]. In EFI capable systems, the firmware reads the EFI System Partition (ESP) for the EFI files for boot information. - -_**Insert Image: Show partition table with ESP partition.**_ - -![][8] - -GRUB is both a bootloader and a boot manager. I’ll come back to GRUB in a moment. Let’s see other GRUB like programs. - -Trivia - -GRUB is acronym for **GR**and **U**nified **B**ootloader. - -### What are some other boot managing programs like GRUB? - -GRUB is the most popular boot manager for Linux. But it is not the only one. There is this highly customizable [rEFInd boot manager][9] that some Linux users love to use. - -![Customized rEFInd Boot Manager Screen | Image Credit][10] - -There is [systemd-boot][11] text-based boot manager. You can guess that this is exclusively for systemd-based Linux distributions. Some distributions like Pop OS use the systemd-boot. - -![systemd-Boot in Pop OS | Image Credit][12] - -### Accessing or editing GRUB - -The usual GRUB screen you see is its menu interface. It allows you to choose the operating systems if there are more than one operating system. You can also choose to load a different kernel if your Linux distribution as more than one kernel installed. - -Depending upon the configuration set by the Linux distribution, you may have some other entries on the GRUB menu. - -You can edit GRUB menu entry by pressing the key `e`. This way, you can change the kernel parameters before loading it. For example, in some cases, [disabling the graphics driver from the kernel helps you with Linux system stuck at boot][13]. - -![][14] - -You can also enter the command line menu of GRUB using the key `c` at the GRUB menu interface. - -#### GRUB configuration file - -Any changes you make to the GRUB from the menu interface is temporary. If you want to make some permanent changes to GRUB like changing the default timeout, you can change the configuration file after you boot into your Linux system. - -The default GRUB configuration file is located at /etc/default/grub. There is also a /etc/default/grub.d directory. You may edit the /etc/default/grub file directly, however it is advised to make additional changes by adding config files (.cfg files) in this directory. - -![Default GRUB Config File][15] - -You must [update GRUB for the changes to take into effect][16]. - -#### GRUB customizer in Ubuntu - -If you think [editing file with a text editor in the terminal][17] is not something you feel comfortable with, you can [use a graphical tool called GRUB Customizer][18]. - -![][19] - -It allows you to change the boot order, default timeout etc. You can also use it to change the background of GRUB with a custom wallpaper. - -This tool is unfortunately available for Ubuntu-based Linux distributions only. - -### Conclusion - -I have touched everything on the surface. EFI, boot loading and GRUB itself is detailed and complicated topic and not in the scope of this article. This article intended to give you a high level overview of GRUB boot program. - -Perhaps I’ll write a detailed guide on GRUB explaining the low level details. For now, if you want to learn more on GRUB, you can access the GRUB documentation in your Linux terminal using `info grub` command. - -![GRUB Manual can be accessed via Terminal][20] - -I hope you have a tad bit better understanding of what is GRUB now. Here’s a GIF to humor you. - -![What Is GRUB? UEFI don’t hurt me, no more… :\)][21] - -I may not have answered all questions you have about GRUB. Please feel free to let me know in the comment section. I may update the article with your questions or suggestions. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/what-is-grub/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/grub-screen-linux.png?resize=800%2C450&ssl=1 -[2]: https://www.gnu.org/software/grub/ -[3]: https://itsfoss.com/what-is-linux/ -[4]: https://itsfoss.com/display-manager/ -[5]: https://itsfoss.com/what-is-desktop-environment/ -[6]: https://www.rodsbooks.com/efi-bootloaders/efistub.html -[7]: https://jdebp.eu/FGA/efi-boot-process.html -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/disk-partition-gparted.png?resize=744%2C385&ssl=1 -[9]: https://www.rodsbooks.com/refind/ -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/refind-boot-manager.png?resize=800%2C602&ssl=1 -[11]: https://wiki.gentoo.org/wiki/Systemd-boot -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/systemd-boot.png?resize=714%2C333&ssl=1 -[13]: https://itsfoss.com/fix-ubuntu-freezing/ -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/editing-grub-to-fix-nvidia-issue.jpg?resize=800%2C343&ssl=1 -[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/default-grub-config-file.png?resize=759%2C437&ssl=1 -[16]: https://itsfoss.com/update-grub/ -[17]: https://itsfoss.com/command-line-text-editors-linux/ -[18]: https://itsfoss.com/grub-customizer-ubuntu/ -[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2013/05/make-windows-default-grub-2.jpeg?resize=799%2C435&ssl=1 -[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/grub-manual-Linux-terminal.png?resize=800%2C462&ssl=1 -[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/what_is_GRUB.gif?resize=500%2C343&ssl=1 diff --git a/sources/tech/20201212 Power up your Linux terminal text editor with ed.md b/sources/tech/20201212 Power up your Linux terminal text editor with ed.md deleted file mode 100644 index 89996145e4..0000000000 --- a/sources/tech/20201212 Power up your Linux terminal text editor with ed.md +++ /dev/null @@ -1,201 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Power up your Linux terminal text editor with ed) -[#]: via: (https://opensource.com/article/20/12/gnu-ed) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Power up your Linux terminal text editor with ed -====== -This deceptively simple editor empowers the user with a set of control -commands that are easy to learn and use. -![Terminal command prompt on orange background][1] - -The GNU `ed` command is a line editor. It’s considered the standard Unix text editor because it was the very first text editor for Unix, and so it was (and generally still is) available on any POSIX system. In some ways, it’s easy to tell that it was the first because, in many ways, it’s extremely rudimentary. Unlike most other text editors, it doesn’t open in a window or screen of its own, and in fact, by default, it doesn’t even prompt the user for input. On the other hand, its near lack of any interface can also be a strength. It’s a functional editor that can be controlled with short instructions either interactively or through a script. - -### Installing ed - -If you’re running Linux or BSD, you probably already have `ed` installed (GNU `ed` on Linux and BSD `ed` on BSD). Some minimal environments, however, omit `ed`, but it’s probably available from your distribution’s software repository or ports tree. MacOS ships with BSD `ed` installed. - -### Launching ed - -When you launch `ed`, it appears that you’ve lost your prompt, and possibly that `ed` has stalled. It has not; it’s just waiting for your instructions: - - -``` -$ ed -``` - -To tell `ed` to be a little more verbose, you can command it to return a prompt with the `p` command: - - -``` -$ ed -p -? -``` - -The question mark (`?`) is the default `ed` prompt. - -### The buffer - -While `ed` is active, you work with what’s called a _buffer_. The buffer is a place in memory. You’re not editing a file directly; you’re only editing the buffer. Should you exit `ed` without writing your changes to a file on disk, then all changes are lost because they only happened in the buffer. (This may sound familiar to experienced Emacs users accustomed to an initial scratch buffer.) - -### Writing text with ed - -After launching `ed`, you’re in command mode. This means you can issue commands to the editor itself, such as when setting it to display a prompt instead of empty space. You can append text to the current buffer with the `a` command, which is terminated by a solitary dot (`.`) on its own line. For instance, this example adds two lines ("hello world" and "hello ed") to the buffer: - - -``` -? -a -hello world -hello ed -. -``` - -After a terminating dot, you return to command mode. - -### Viewing the buffer - -To see what’s contained in the buffer, you can type either the line you want to see or `,p` to display all lines. - - -``` -? -1 -hello world -2 -hello ed -,p -hello world -hello ed -``` - -### Writing to a file - -Assuming you’re happy with your text, you can write the buffer to a file with the `w` command followed by the name of the destination file. - - -``` -? -w example.txt -19 -``` - -The number after the write operation indicates the number of characters written to the file. - -### Reading a file - -You don’t have to use `ed` for text entry. You can also just open an existing file into the buffer using the `r` command: - - -``` -? -r myfile.txt -``` - -Alternatively, you can just launch `ed` followed by the file name you want it to load into the buffer: - - -``` -$ ed myfile.txt -``` - -### Editing the buffer - -The `ed` application is a text editor, so you can affect text in the buffer using a special editing syntax. Users of `sed` or `vim` may find some of its syntax familiar. Assume you have a file loaded in the buffer: - - -``` -$ ed myfile.txt -,p -This is an example document. -There is some text, but not much. -There is some errors, but not much. -``` - -To change the word "document" to "file" in the first sentence, select the line you want to target (1) and then invoke the search function with `s` followed by your search and replacement terms: - - -``` -? -1 -This is an example document. -s/document/file/ -1 -This is an example file. -``` - -To target a different line, the process is essentially the same but with a different number: - - -``` -? -3 -There is some errors, but not much. -s/is/are/ -s/much/many/ -``` - -You can see the edits you’ve made to the buffer using the `,p` command as usual. - - -``` -This is an example file. -There is some text, but not much. -There are some errors, but not many. -``` - -Of course, these changes only exist in the buffer. Were you to look at the file outside of `ed`, you would see the original text only: - - -``` -$ cat myfile.txt -This is an example document. -There is some text, but not much. -There is some errors, but not much. -``` - -To save your changes back into the file, use the `w` command: - - -``` -w myfile.txt -258 -``` - -### Clearing the buffer - -To get a new buffer so you can either start a new document or load a new one into a fresh environment, use the `c` command. After issuing `c` to clear the buffer, a print command returns nothing because the buffer has been emptied: - - -``` -c -,p -``` - -### Quit - -To exit your `ed` session, use the `q` command. This doesn’t give you a chance to save your buffer, so make sure you save before you use this command. - -### Try ed - -There’s a lot more `ed` can do, and learning `ed` can afford you great insight into how `sed` and parts of `vim` work. I didn’t bother trying to write this article in `ed`, admittedly, and I’m not sure it’s the best tool for text entry in general. However, `ed` is an excellent editor of text, and you can learn it easily by reading its documentation. On a GNU system, use `info ed` to view the manual. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/12/gnu-ed - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) diff --git a/sources/tech/20210102 Explore the night sky with this open source astronomy app.md b/sources/tech/20210102 Explore the night sky with this open source astronomy app.md deleted file mode 100644 index 5e3f9d0f4e..0000000000 --- a/sources/tech/20210102 Explore the night sky with this open source astronomy app.md +++ /dev/null @@ -1,101 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Explore the night sky with this open source astronomy app) -[#]: via: (https://opensource.com/article/21/1/kstars) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) - -Explore the night sky with this open source astronomy app -====== -Stargaze from your Linux desktop or Android device with KStars. -![Open source stars.][1] - -I have always been fascinated with the night sky. When I was younger, the only reference materials available were books, and they seemed to depict a sky that looked different from the one I saw from my home. - -More than five years ago, I wrote about my experiences with two open source planetarium apps, [Celestia and Stellarium][2]. Recently, I read about another: [KStars][3]. It's an amazing open source application that helps engage children (and adults) in science and astronomy. Its website says: - -> "KStars is free, open source, cross-platform astronomy software. It provides an accurate graphical simulation of the night sky, from any location on Earth, at any date and time. The display includes up to 100 million stars, 13,000 deep-sky objects, all 8 planets, the Sun and Moon, and thousands of comets, asteroids, supernovae, and satellites." - -KStars is part of the [KDE Education Project][4]. The latest version, available for Linux, Windows, and macOS, integrates [StellarSolver][5], a cross-platform SExtractor, a program that builds a catalog of objects from an astronomical image. - -### Installing KStars - -KStars is freely licensed under the GPLv2.0. The source code is available on the official [KDE GitLab instance][6] and as a read-only mirror on GitHub. The KDE Education Project has excellent [installation documentation][7]. - -I'm using [Pop!_OS][8] and found KStars in the Pop!_Shop. - -You can install KStars on Linux from your distribution's software repository. KStars Lite is available for Android from the [Google Play store][9]. The KDE Project maintains an excellent [KStars Handbook][10] to assist users. - -### Using KStars - -After installation, launch the program from your Applications menu. A startup wizard guides you through the initial setup. - -![KStars Startup Wizard][11] - -(Don Watkins, [CC BY-SA 4.0][12]) - -The directions are easy to follow. The wizard prompts you to set your home location; unfortunately, my small village was not listed, but a larger nearby community was. - -![KStars location setup][13] - -(Don Watkins, [CC BY-SA 4.0][12]) - -You also have the opportunity to download additional data and extra features for the program. - -![KStars add-ons][14] - -(Don Watkins, [CC BY-SA 4.0][12]) - -There are many options available. I chose "Common images displayed in the detail window." - -Once you're finished with the setup, KStars presents a map of the night sky as it appears from your location. - -![KStars night sky display][15] - -(Don Watkins, [CC BY-SA 4.0][12]) - -It displays the current local time in the upper-left corner (5:58pm on November 30, 2020, in this image). - -Using the left mouse button, you can move the display left, right, up, and down. You can zoom in and out using the mouse's scroll wheel. Placing the mouse cursor over an object and right-clicking describes the object you're looking at. - -![KStars describes objects][16] - -(Don Watkins, [CC BY-SA 4.0][12]) - -### Get involved - -KStars is actively soliciting help with bug reports, astronomy knowledge, code, translations, and more. The lead developer and maintainer is [Jasem Mutlaq][17]. If you'd like to contribute, please visit the [project's website][18] or join the mailing list to learn more. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/kstars - -作者:[Don Watkins][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/don-watkins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_520x292_opensourcestars.png?itok=hnrMETFh (Open source stars.) -[2]: https://opensource.com/education/15/7/open-source-apps-explore-night-sky -[3]: https://edu.kde.org/kstars/ -[4]: https://edu.kde.org/ -[5]: https://github.com/rlancaste/stellarsolver -[6]: https://invent.kde.org/education/kstars -[7]: https://edu.kde.org/kstars/install.php -[8]: https://pop.system76.com/ -[9]: https://play.google.com/store/apps/details?id=org.kde.kstars.lite&hl=en -[10]: https://docs.kde.org/trunk5/en/extragear-edu/kstars/index.html -[11]: https://opensource.com/sites/default/files/uploads/kstars_startupwizard.png (KStars Startup Wizard) -[12]: https://creativecommons.org/licenses/by-sa/4.0/ -[13]: https://opensource.com/sites/default/files/uploads/kstars_setlocation.png (KStars location setup) -[14]: https://opensource.com/sites/default/files/uploads/kstars_addons.png (KStars add-ons) -[15]: https://opensource.com/sites/default/files/uploads/kstars_sky.png (KStars night sky display) -[16]: https://opensource.com/sites/default/files/uploads/kstars_objectdescription.png (KStars describes objects) -[17]: https://github.com/knro -[18]: https://edu.kde.org/kstars diff --git a/sources/tech/20210107 A hands-on tutorial for using the GNU Project Debugger.md b/sources/tech/20210107 A hands-on tutorial for using the GNU Project Debugger.md index ac878e098c..422cb3821d 100644 --- a/sources/tech/20210107 A hands-on tutorial for using the GNU Project Debugger.md +++ b/sources/tech/20210107 A hands-on tutorial for using the GNU Project Debugger.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Starryi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210111 9 Decentralized, P2P and Open Source Alternatives to Mainstream Social Media Platforms Like Twitter, Facebook, YouTube and Reddit.md b/sources/tech/20210111 9 Decentralized, P2P and Open Source Alternatives to Mainstream Social Media Platforms Like Twitter, Facebook, YouTube and Reddit.md deleted file mode 100644 index 2d2f85e63b..0000000000 --- a/sources/tech/20210111 9 Decentralized, P2P and Open Source Alternatives to Mainstream Social Media Platforms Like Twitter, Facebook, YouTube and Reddit.md +++ /dev/null @@ -1,216 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (9 Decentralized, P2P and Open Source Alternatives to Mainstream Social Media Platforms Like Twitter, Facebook, YouTube and Reddit) -[#]: via: (https://itsfoss.com/mainstream-social-media-alternaives/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -9 Decentralized, P2P and Open Source Alternatives to Mainstream Social Media Platforms Like Twitter, Facebook, YouTube and Reddit -====== - -You probably are aware that [Facebook is going to share the user data from its ‘end to end encrypted’ chat service WhatsApp][1]. This is not optional. You have to accept that or stop using WhatsApp altogether. - -Privacy cautious people had seen it coming a long time ago. After all, [Facebook paid $19 billion to buy a mobile app like WhatsApp][2] that hardly made any money at that time. Now it’s time for Facebook to get the return on its $19 billion investment. They will share your data with advertisers so that you get more personalized (read invasive) ads. - -If you are fed up with the “**my way or highway**” attitude of the big tech like Facebook, Google, Twitter, perhaps you may try some alternative social media platforms. - -These alternative social platforms are open source, use a decentralized approach with P2P or Blockchain technologies, and you may be able to self-host some of them. - -### Open source and decentralized social networks - -![Image Credit: Datonel on DeviantArt][3] - -I’ll be honest with you here. These alternative platforms may not give you the same kind of experience you are accustomed to, but these platforms would not infringe on your privacy and freedom of speech. That’s a trade off. - -#### 1\. Minds - -Alternative to: Facebook and YouTube -Features: Open Source code base, Blockchain -Self-host: No - -On Minds, you can post videos, blogs, images and set statuses. You can also message and video chat securely with groups or directly with friends. Trending feeds and hashtags allows you to discover articles of your interest. - -That’s not it. You also have the option to earn tokens for your contributions. These tokens can be used to upgrade your channel. Creators can receive direct payments in USD, Bitcoin and Ether from fans. - -[Minds][4] - -#### 2\. Aether - -Alternative to: Reddit -Features: Open Source, P2P -Self-host: No - -![][5] - -Aether is an open source, P2P platform for self-governing communities with auditable moderation and mod elections. - -The content on Aether is ephemeral in nature and it is kept only for six months unless someone saves it. Since it is P2P, there is no centralized servers. - -An interesting feature of Aether is its democratic communities. Communities elect mods and can impeach them by votes. - -[Aether][6] - -#### 3\. Mastodon - -Alternative to: Twitter -Features: Open Source, Decentralized -Self-host: Yes - -![][7] - -[Mastodon][8] is already known among FOSS enthusiasts. We have covered [Mastodon as an open source Twitter alternative][9] in the past, and [we also have a profile on Mastodon][10]. - -Mastodon isn’t a single website like Twitter, it’s a network of thousands of communities operated by different organizations and individuals that provide a seamless social media experience. You can host your own Mastodon instance and choose to connect it with other Mastodon instances or you simply join one of the existing Mastodon instances like [Mastodon Social][11]. - -[Mastodon][8] - -#### 4\. LBRY - -Alternative to: YouTube -Features: Open Source, Decentralized, Blockchain -Self-host: No - -![][12] - -At the core, [LBRY][13] is a blockchain based decentralization protocol. On top of that protocol, you get a digital marketplace powered by its own cryptocurrency. - -Though LBRY allows creators to offer l kind of digital content like movies, books and games, it is essentially promoted as an YouTube alternative. - -We have covered [LBRY on It’s FOSS][14] in the past and you may read that for more details. If you are joining LBRY, don’t forget to follow It’s FOSS there. - -[LBRY][15] - -#### 5\. KARMA - -Alternative to: Instagram -Features: Decentralized, Blockchain -Self-host: No - -![][16] - -Here’s another blockchain based social network governed by cryptocurrency. - -KARMA is an Instagram clone built on top of open source blockchain platform, [EOSIO][17]. Every like and share your content gets, earns you KARMA tokens. You can use these tokens to boost your content or convert it to real money through one of the partner crypto exchanges. - -KARMA is a mobile only app and available on Play Store and App Store. - -[KARMA][18] - -#### 6\. Peertube - -Alternative to: YouTube -Features: Decentralized, P2P -Self-host: No - -![][19] - -Developed by French company Framasoft, PeerTube is a decentralized video streaming platform. PeerTube uses the [BitTorrent protocol][20] to share bandwidth between users. - -PeerTube aims to resist corporate monopoly. It does not rely on ads and does not track you. Keep in mind that your IP address is not anonymous here. - -There are various instances of PeerTube available where you can host your videos. Some instances may charge money while most are free. - -[PeerTube][21] - -#### 7\. Diaspora - -Alternative to: Facebook -Features: Decentralized, Open Source -Self-host: Yes - -Diaspora was one of the earliest decentralized social networks. This was back in 2010 and Diaspora was touted as a Facebook alternative. It did get some deserving limelight in its initial years but it got confined to only a handful of niche members. - -Similar to Mastodon, Diaspora is composed of pods. You can register with a pod or host your own pod. The Big Tech doesn’t own your data, you do. - -[Diaspora][22] - -#### 8\. Dtube - -Alternative to: YouTube -Features: Decentralized, Blockchain -Self-host: No - -![][23] - -Dtube is a blockhain based decentralized YouTube clone. I use the word YouTube clone because the interface is way too similar to YouTube. - -Like most other blockchain based social networks, Dtube is governed by DTube Coins (DTC) that creator earns when someone watches or interact with their content. The coins can be used to promote the content or cashed out from partner crypto exhcnages. - -[DTube][24] - -#### 9\. Signal - -Alternative to: WhatsApp, Facebook Messenger -Features: Open Source -Self-host: No - -![][25] - -Unlike the end to end encrypted chats in WhatsApp, Signal doesn’t track you, share your data and invade your privacy. - -[Signal rose to fame][26] when Edward Snowden endorsed it. It got even more famous when [Elon Musk][27] tweeted about it after WhatsApp sharing user data with Facebook. - -Signal uses its own open source Signal protocol to give you end-to-end encrypted messages and calls. - -[Signal][28] - -#### What else? - -There are some other platforms that are not open source or decentralized, but they respect your privacy and free speech. - - * [MeWe][29]: Alternative to Facebook - * [Voice][30]: Alternative to Medium - - - -There is also Element messenger based on Matrix protocol which you may try. - -I know there are probably several other such alternative social media platforms. Care to share them? I might add them to this list. - -If you had to choose one of the platforms from the list, which one would you choose? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/mainstream-social-media-alternaives/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://arstechnica.com/tech-policy/2021/01/whatsapp-users-must-share-their-data-with-facebook-or-stop-using-the-app/ -[2]: https://money.cnn.com/2014/02/19/technology/social/facebook-whatsapp/index.html -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/1984-quote.png?resize=800%2C450&ssl=1 -[4]: https://www.minds.com/ -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/aether-reddit-alternative.png?resize=800%2C600&ssl=1 -[6]: https://getaether.net -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/mastodon.png?resize=800%2C623&ssl=1 -[8]: https://joinmastodon.org/ -[9]: https://itsfoss.com/mastodon-open-source-alternative-twitter/ -[10]: https://mastodon.social/@itsfoss -[11]: https://mastodon.social -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/lbry-interface.jpg?resize=800%2C420&ssl=1 -[13]: https://lbry.org -[14]: https://itsfoss.com/lbry/ -[15]: https://lbry.tv/$/invite/@itsfoss:0 -[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/karma-app.jpg?resize=800%2C431&ssl=1 -[17]: https://eos.io -[18]: https://karmaapp.io -[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/peertube-federation-multiplicity.jpg?resize=600%2C341&ssl=1 -[20]: https://www.slashroot.in/what-bittorrent-protocol-and-how-does-bittorrent-protocol-work -[21]: https://joinpeertube.org -[22]: https://diasporafoundation.org -[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/dtube.jpg?resize=800%2C516&ssl=1 -[24]: https://d.tube -[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/12/signal-shot.jpg?resize=800%2C565&ssl=1 -[26]: https://itsfoss.com/signal-messaging-app/ -[27]: https://www.britannica.com/biography/Elon-Musk -[28]: https://www.signal.org -[29]: https://mewe.com -[30]: https://www.voice.com diff --git a/sources/tech/20210112 15 favorite programming tutorials and insights.md b/sources/tech/20210112 15 favorite programming tutorials and insights.md deleted file mode 100644 index 5b0d42aeaf..0000000000 --- a/sources/tech/20210112 15 favorite programming tutorials and insights.md +++ /dev/null @@ -1,108 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (15 favorite programming tutorials and insights) -[#]: via: (https://opensource.com/article/21/1/best-programming) -[#]: author: (Bryant Son https://opensource.com/users/brson) - -15 favorite programming tutorials and insights -====== -Whether you're new to programming or want to improve your existing -skills, there is an article in this list to help you. Take a look at -some of the best programming articles of 2020. -![Learning and studying technology is the key to success][1] - -Happy new year! 2020 was one heck of an unusual year with the COVID-19 pandemic pushing us to stay at home and dramatically transforming our lifestyles. However, a time like this is also the best time to start picking up a new programming language or to level up your existing programming skillset. We begin with some light reading: **What is your first programming language?** and **Why developers like to code at night**. Next, we have articles about some specific programming languages like **C**, **D**, and **Awk**. Last, we provide some advanced programming language contents like **Real-Time Operating System (RTOS)**, **WebAssembly**, and **sharing data between C and Python**. - -## [What was your first programming language?][2] - -Chances are, not everyone remembers the very first thing they ate after they were born, but many programmers most likely recall their very first programming language. In this article, Opensource.com editor Lauren Pritchett took a survey asking the community this question. Go down your own memory lane by reading the responses to this question by other developers. - -## [Why developers like to code at night][3] - -Ever wonder why so many programmers stay late to crank out the lines of code that may turn into the next Google, Facebook, or Netflix? Quite surprisingly, many psychological studies exist that explain the productivity behind this common routine. Learn about it by reading this article by Matt Shealy. - -## [Why I use open source technology for web development][4] - -The Internet has been the driving force behind the popularity of open source programming, tools, and frameworks. But how can we explain this trend, and what are key characteristics of the web that inspire developers to continuously endorse open source technologies? See why Jim Hall believes that open source is the right way to build web applications. - -## [5 steps to learn any programming language][5] - -Learning a programming language may feel like a daunting task, but the process can be much easier with the right approach. Just as memorizing vocabulary and using correct grammar matter for learning a new spoken language, understanding syntax, functions, and data types matters for new programming languages. Learn about five steps you can apply when you decide to learn a new programming language. - -## [An introduction to writing your own HTML web pages][6] - -**Hypertext Markup Language (HTML)** is not a programming language, but it is the backbone behind the Internet as billions of people visit webpages built with HTML every day. HTML, interpreted by web browsers, is a markup language that anyone can easily learn with a few simple practices. Read how you can start writing your first web page by reading this article! - -## [Learn the basics of programming with C][7] - -Who says **C** programming is dead? **C** is still the father of many existing programming languages, libraries, and tools today, and industries have recently noticed the **C** programming language's rejuvenation. Its job demand has also exploded with AR/VR and the growth of the gaming industry. However, learning **C** programming is quite challenging. Get a jump start on your journey learning **C** programming by reading this article by Seth Kenlon. - -## [What I learned while teaching C programming on YouTube][8] - -There are many resources to learn programming languages, but the best result comes if one plans well, executes well, and makes the learning applicable. Most importantly, you need to have a passion for learning. See what Jim Hall learned by teaching the C programming language through his YouTube channel. - -## [The feature that makes D my favorite programming language][8] - -What comes after C? Yes, it is the letter D, and there is a programming language called **D** as well. Although it is not the most well-known programming language, **D** has features like _Universal Function Call Syntax (UFCS)_ that make it quite an interesting language to learn. Lawrence Aberba explains the feature and how you can use it, too. - -## [The surprising thing you can do in the D programming language][9] - -In another article, Lawrence talks about _nesting_ support in **D**, a feature that makes it stand out among other programming languages. Read what it is and explore how **D** delivers nesting functionality. - -## [A practical guide to learning awk][10] - -**Awk** is a programming language that is probably strange to many people, but learning **awk** can give you power that really shines in day-to-day Linux operations. By reading this article, you can learn how **awk** parses input and how functions are structured. - -## [How to write a VS Code extension][11] - -**Visual Studio Code (VS Code)** is an extremely popular cross-platform code editor created by Microsoft, and it is an open source project based on an MIT license. One of the great things about the editor is its extensibility through **VS Code extensions**. You don't have to be a rocket scientist to build your first extension! After reading this article, you will be on the path to becoming a VS Code extension master. - -## [Customizing my open source PHP framework for web development][12] - -**PHP** is often a neglected programming language hated by some programmer groups for a few reasons, such as it is very easy to produce bad code. However, Facebook, Wikipedia, Tumblr, and many websites were originally built with **PHP**, and it is still one of the most popular web programming languages out there. See how Wee Ben Sen used **PHP** framework **CodeIgniter** to create high-performance websites for numerous occasions and learn its key benefits. - -## [Code your hardware using this open source RTOS][13] - -**RTOS** stands for **Real-Time Operating System**. It is an open source operating system optimized for embedded hardware like CPUs and computer chips. By taking advantage of **RTOS**, a project can benefit from concurrency, modularity, and real-time scheduling. This article explains **RTOS** and the numerous benefits associated with this open source operating system. - -## [Why everyone is talking about WebAssembly][14] - -**WebAssembly** is a new type of code that runs in modern web browsers. It is a low-level assembly-like language with a compact binary format. **WebAssembly** runs with near-native performance and provides languages such as C/C++, C#, and Rust with a compilation target so that they can run on the web. **WebAssembly** has gained huge traction in the past few years due to the ever-growing popularity of JavaScript. Follow the history behind **WebAssembly** and learn what makes it so popular today. - -## [Share data between C and Python with this messaging library][15] - -Sharing data between two distinct programming languages may sound like a super challenging task. However, leveraging an open source tool like **ZeroMQ**, you can easily create a messaging interface that transmits the data across different layers. Learn how you can make one by reading this article. - -As you can see, whether you are new to programming languages or want to grow your career further, there are learning opportunities for everyone. Let me know what you think by leaving a comment here. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/best-programming - -作者:[Bryant Son][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/brson -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/studying-books-java-couch-education.png?itok=C9gasCXr (Learning and studying technology is the key to success) -[2]: https://opensource.com/article/20/8/first-programming-language -[3]: https://opensource.com/article/20/2/why-developers-code-night -[4]: https://opensource.com/article/20/4/open-source-web-development -[5]: https://opensource.com/article/20/10/learn-any-programming-language -[6]: https://opensource.com/article/20/4/build-websites -[7]: https://opensource.com/article/20/8/c-programming-cheat-sheet -[8]: https://opensource.com/article/20/7/d-programming -[9]: https://opensource.com/article/20/8/nesting-d -[10]: https://opensource.com/article/20/9/awk-ebook -[11]: https://opensource.com/article/20/6/vs-code-extension -[12]: https://opensource.com/article/20/5/codeigniter -[13]: https://opensource.com/article/20/6/open-source-rtos -[14]: https://opensource.com/article/20/1/webassembly -[15]: https://opensource.com/article/20/3/zeromq-c-python diff --git a/sources/tech/20210112 8 tips for the Linux command line.md b/sources/tech/20210112 8 tips for the Linux command line.md deleted file mode 100644 index e6a5ca12cf..0000000000 --- a/sources/tech/20210112 8 tips for the Linux command line.md +++ /dev/null @@ -1,77 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (8 tips for the Linux command line) -[#]: via: (https://opensource.com/article/21/1/linux-commands) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) - -8 tips for the Linux command line -====== -Take advantage of all of the powers the almighty Linux command line has -to offer. -![Terminal command prompt on orange background][1] - -The Linux command line provides a great deal of flexibility. Whether you are managing a server or launching a terminal window on a desktop system, the command line brings with it an extensive toolkit to update files, tweak system performance, and manage processes. The command line is where it's at. - -Testifying to the command line's popularity, Opensource.com publishes many excellent articles about how to get the most out of your system. The following were some of Opensource.com's most-read articles about Linux commands in 2020: - -### [Make Bash history more useful with these tips][2] - -Bash is the default command line shell on most Linux systems. Seth Kenlon wrote this guide to help you with your Bash **history**. Manipulating history is usually less dangerous than it sounds, especially when you're curating it with a purpose in mind. Tell Bash what you want it to remember—or even rewrite history by deleting entries you don't want or need. Use your history sessions as required, and exercise your power over history wisely. - -### [How I balance features and performance in my Linux terminal][3] - -Ricardo Gerardi is a big fan of command line applications and spends a lot of his time working in a terminal. Ricardo invested some time to make the command line a pleasant environment to work in. Learn how to customize terminal apps, themes, and the prompt to create a feature-rich terminal that's easy on system resources. - -### [Drop Bash for the fish shell to get beautiful defaults][4] - -Matt Broberg recently let go of the default command line interpreter, Bash, in favor of fish, which proudly markets itself as "a command line shell for the '90s." The fish-themed "friendly interactive shell" creates a more enjoyable experience on the command line. Read Matt's article to learn more about how to get the most out of fish. If you're looking to move away from tinkering with your terminal, focus more on code, and have a more beautiful default shell, give fish a try. - -### [10 ways to analyze binary files on Linux][5] - -We work with binaries daily, yet we understand so little about them. Linux provides a rich set of tools that makes analyzing binaries a breeze! These simple commands and tools can help you sail through the task of analyzing binary files. Whatever your job role, knowing the basics about these tools will help you understand your Linux system better. Gaurav Kamathe covers some of the most popular Linux tools and commands to manage binaries, including **file**, **nm**, **strings**, and **hexdump**. - -### [4 Markdown tools for the Linux command line][6] - -When it comes to working with files formatted with Markdown, command line tools rule the roost. They're light, fast, powerful, and flexible, and most of them follow the Unix philosophy of doing one thing well. Scott Nesbitt reviews four command line utilities that can help you work more efficiently with Markdown files. - -### [Improve Linux system performance with noatime][7] - -Whenever I upgrade Linux on my home computer, I have a list of tasks I usually do. They've become habits over the years: I back up my files, wipe the system, reinstall from scratch, restore my files, then reinstall my favorite extra applications. I also make a few system tweaks. One tweak is **atime**, which is one of the three timestamps on every file on Linux. Turning off **atime** is a small but effective way to improve system performance. Here's what it is and why it matters. - -### [Extend the life of your SSD drive with fstrim][8] - -Over the past decade, solid-state drives (SSD) have brought about a new way of managing storage. SSDs have benefits like silent and cooler operation and a faster interface spec, compared to their elder spinning ancestors. Of course, new technology brings with it new methods of maintenance and management. Alan Formy-Duval wrote about a new **systemd** service to make your life easier when managing SSDs. - -### [5 modern alternatives to essential Linux command line tools][9] - -In our daily use of Linux/Unix systems, we use many command line tools to complete our work, and to help us understand and manage our systems better. Over the years, these tools have been modernized and ported to different systems. However, in general, they still follow their original idea, look, and feel. In recent years, the open source community has developed alternative tools that offer additional benefits. Ricardo Gerardi shows us how to gain new benefits by improving old command line tools with these five updated alternatives. - -### Wrap up - -Use these articles as a springboard to finding your own tips and tricks for the command line. Is there something missing from this list? Comment below, or better yet, submit an article of your own! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/linux-commands - -作者:[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/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) -[2]: https://opensource.com/article/20/6/bash-history-control -[3]: https://opensource.com/article/20/7/performance-linux-terminal -[4]: https://opensource.com/article/20/3/fish-shell -[5]: https://opensource.com/article/20/4/linux-binary-analysis -[6]: https://opensource.com/article/20/3/markdown-apps-linux-command-line -[7]: https://opensource.com/article/20/6/linux-noatime -[8]: https://opensource.com/article/20/2/trim-solid-state-storage-linux -[9]: https://opensource.com/article/20/6/modern-linux-command-line-tools diff --git a/sources/tech/20210115 Learn awk by coding a -guess the number- game.md b/sources/tech/20210115 Learn awk by coding a -guess the number- game.md deleted file mode 100644 index 2f342fa95c..0000000000 --- a/sources/tech/20210115 Learn awk by coding a -guess the number- game.md +++ /dev/null @@ -1,208 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: 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) - -Learn awk by coding a "guess the number" game -====== -Programming languages tend to share many common traits. One great way to -learn a new language is to create a familiar program. In this article, I -will create a "guess the number" game by using awk to demonstrate -familiar concepts. -![question mark in chalk][1] - -When you learn a new programming language, it's good to focus on the things most programming languages have in common: - - * Variables – places where information is stored - * Expressions – ways to calculate things - * Statements – the means by which state changes are expressed in a program - - - -These concepts are the basis of most programming languages. - -Once you understand these concepts, you can start figuring the rest out. For example, most languages have a "way of doing things" supported by their design, and those ways can be quite different from one program to another. These ways include modularity (grouping related functionality together), declarative vs. imperative, object-orientation, low- vs. high-level syntactic features, and so on. An example familiar to many programmers is "ceremony," that is, the amount of work required to set the scene before tackling the problem. The Java programming language is said to have a significant ceremony requirement, stemming from its design, which requires all code to be defined within a class. - -But back to the basics. Programming languages usually share similarities. Once you know one programming language, start by learning the basics of another to appreciate the differences in that new language. - -A good way to proceed is to create a set of basic test programs. With these in hand, learning starts with these similarities. - -One test program you can use is a "guess the number" program. The computer picks a number between one and one hundred and asks you to guess the number. The program loops until you make a correct guess. - -The "guess the number" program exercises several concepts in programming languages: - - * Variables - * Input - * Output - * Conditional evaluation - * Loops - - - -That's a great practical experiment to learn a new programming language. - -**Note**: This article is adapted from Moshe Zadka's article on doing using this approach in [Julia][2] and Jim Hall's article on doing it in [Bash][3]. - -### Guess the number in awk - -Let's write a "guess the number" game as an Awk program. - -Awk is dynamically typed, is a scripting language oriented toward data transformation, and has surprisingly good support for interactive use. Awk has been around since the 1970s, originally as a part of the Unix operating system. If you don't know Awk but love spreadsheets, this is a sign… [go learn Awk][4]! - -You can begin your exploration of Awk by writing a version of the "guess the number" game. - -Here is my implementation (with line numbers so we can review some of the specific features): - - -``` -     1    BEGIN { -     2        srand(42) -     3        randomNumber = int(rand() * 100) + 1 -     4        print "random number is",randomNumber -     5        printf "guess a number between 1 and 100\n" -     6    } -     7    { -     8        guess = int($0) -     9        if (guess < randomNumber) { -    10            printf "too low, try again:" -    11        } else if (guess > randomNumber) { -    12            printf "too high, try again:" -    13        } else { -    14            printf "that's right\n" -    15            exit -    16        } -    17    } -``` - -We can immediately see similarities between Awk control structures and those of C or Java, but unlike Python. In statements such as _if-then-else_ or _while_, the _then_, _else_, and _while_ parts take either a statement or a group of statements enclosed within **{** and **}**. However, there is one big difference about AWk that needs to be understood from the start: - -By design, Awk is built around a data pipeline. - -What does that mean? Most Awk programs are snippets of code that receive a line of input, do something with the data, and write it to output. Recognizing the need for such a transformation pipeline, Awk by default provides all the transformation plumbing. Let's explore that through the above program by asking a basic question: Where is the 'read data from the console' structure? - -The answer to that is – it's built-in. In particular, lines 7 – 17 tell Awk what to do with each line that is read. Given that context, it's pretty easy to see that lines 1 – 6 are executed before anything is read. - -More specifically, the **BEGIN** keyword on line 1 is a kind of "pattern," in this case indicating to Awk that, before reading any data, it should execute what follows the **BEGIN** in the { … }. A similar **END** keyword, not used in this program, indicates to Awk what to do when everything has been read. - -Coming back to lines 7 – 17, we see they create a block of code { … } that is similar, but there is no keyword in front. Because there is nothing before the **{** for Awk to match, it will apply this line to every line of input received. Each line of input will be entered as guesses by the user. - -Let's look at the code being executed. First, the preamble that happens before any input is read. - -In line 2, we initialize the random number generator with the number 42 (if we don't provide an argument, the system clock is used). 42? [Of course 42][5]. Line 3 calculates a random number between 1 and 100, and line 4 prints that number out for debugging purposes. Line 5 invites the user to guess a number. Note this line uses `printf`, not `print`. Like C, `printf'`s first argument is a template used to format the output. - -Now that the user is aware the program expects input, she can type a guess on the console. Awk supplies this guess to the code in lines 7 – 17, as mentioned previously. Line 18 converts the input record to an integer; `$0` indicates the entire input record, whereas `$1` indicates the first field of the input record, `$2` the second, and so on. Yup, Awk splits an input line into constituent fields, using the predefined separator, which defaults to white space. Lines 9 – 15 compare the guess to the random number, printing appropriate responses. If the guess is correct, line 15 exits prematurely from the input line processing pipeline. - -Simple! - -Given the unusual structure of Awk programs as code snippets that react to specific input line configurations and do stuff with the data, let’s look at an alternative structure just to see how the filtering part works: - - -``` -     1    BEGIN { -     2        srand(42) -     3        randomNumber = int(rand() * 100) + 1 -     4        print "random number is",randomNumber -     5        printf "guess a number between 1 and 100\n" -     6    } -     7    int($0) < randomNumber { -     8        printf "too low, try again: " -     9    } -    10    int($0) > randomNumber { -    11        printf "too high, try again: " -    12    } -    13    int($0) == randomNumber { -    14        printf "that's right\n" -    15        exit -    16    } -``` - -Lines 1 – 6 haven’t changed. But now we see that lines 7 – 9 is code that is executed when the integer value of the line is less than the random number, lines 10 – 12 is code that is executed when the integer value of the line is greater than the random number, and lines 13 – 16 is code that is executed when the two match. - -This should seem "cool but weird" – why would we repeatedly calculate `int($0)`, for example? And for sure, it would be a weird way to solve the problem. But those patterns can be really quite wonderful ways to separate conditional processing since they can employ regular expressions or any other structure supported by Awk. - -For completeness, we can use these patterns to separate common computations from things that only apply to specific circumstances. Here’s a third version to illustrate: - - -``` -     1    BEGIN { -     2        srand(42) -     3        randomNumber = int(rand() * 100) + 1 -     4        print "random number is",randomNumber -     5        printf "guess a number between 1 and 100\n" -     6    } -     7    { -     8        guess = int($0) -     9    } -    10    guess < randomNumber { -    11        printf "too low, try again: " -    12    } -    13    guess > randomNumber { -    14        printf "too high, try again: " -    15    } -    16    guess == randomNumber { -    17        printf "that's right\n" -    18        exit -    19    } -``` - -Recognizing that, no matter what value of input comes in, it needs to be converted to an integer, we have created lines 7 – 9 to do just that. Now the three groups of lines, 10 – 12, 13 – 15 and 16 – 19, refer to the already-defined variable guess instead of converting the input line each time. - -Let's go back to the list of things we wanted to learn: - - * variables – yup, Awk has those; we can infer that input data comes in as strings but can be converted to a numeric value when required - * input – Awk just sends input through its "data transformation pipeline" approach to reading stuff - * output – we have used Awk's `print` and `printf` procedures to write stuff to output - * conditional evaluation – we have learned about Awk's _if-then-else_ and input filters that respond to specific input line configurations - * loops – huh, imagine that! We didn't need a loop here, once again, thanks to the "data transformation pipeline" approach that Awk takes; the loop "just happens." Note the user can exit the pipeline prematurely by sending an end-of-file signal to Awk (a **CTRL-D** when using a Linux terminal window) - - - -It's well worth considering the importance of not needing a loop to handle input. One reason Awk has remained viable for so long is that Awk programs are compact, and one of the reasons they are compact is there is no boilerplate required to read from the console or a file. - -Let's run the program: - - -``` -$ awk -f guess.awk -random number is 25 -guess a number between 1 and 100: 50 -too high, try again: 30 -too high, try again: 10 -too low, try again: 25 -that's right -$ -``` - -One thing we didn't cover was comments. An Awk comment begins with a `#` and ends with the end of line. - -### Wrap up - -Awk is incredibly powerful and this "guess the number" game is a great way to get started. It shouldn't be the end of your journey, though. You can [read about the history of Awk and Gawk (GNU Awk)][6], an expanded version of Awk and probably the one you have on your computer if you're running Linux, or [read all about the original from its initial developers][7]. - -You can also [download our cheatsheet][8] to help you keep track of everything you learn. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/learn-awk - -作者:[Chris Hermansen][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/clhermansen -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/question-mark_chalkboard.jpg?itok=DaG4tje9 (question mark in chalk) -[2]: https://opensource.com/article/20/12/julia -[3]: https://opensource.com/article/20/12/learn-bash -[4]: https://opensource.com/article/20/9/awk-ebook -[5]: https://en.wikipedia.org/wiki/42_(number)#The_Hitchhiker's_Guide_to_the_Galaxy -[6]: https://www.gnu.org/software/gawk/manual/html_node/History.html -[7]: https://archive.org/details/pdfy-MgN0H1joIoDVoIC7 -[8]: https://opensource.com/downloads/cheat-sheet-awk-features diff --git a/sources/tech/20210116 4 DevOps books to read this year.md b/sources/tech/20210116 4 DevOps books to read this year.md deleted file mode 100644 index 45643d6e96..0000000000 --- a/sources/tech/20210116 4 DevOps books to read this year.md +++ /dev/null @@ -1,132 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (4 DevOps books to read this year) -[#]: via: (https://opensource.com/article/21/1/devops-books) -[#]: author: (Taz Brown https://opensource.com/users/heronthecli) - -4 DevOps books to read this year -====== -Curl up with a good book about DevOps this winter. -![Reading a book, selfcare][1] - -We have just entered 2021, and DevOps will become much more relevant. It is smack dab in the spotlight given that the world is experiencing a pandemic and businesses are fighting to stay digitally relevant and competitive. - -DevOps has actually has evolved quite nicely, like a fine wine. Here is why. There will be an increased focus on the human side of DevOps. It will be more about people and processes. I argue that DevOps will be reinvigorated. There will be less focus on the tools, automation, and orchestration and more about communication, collaboration, and a collective effort to remove bottlenecks and deliver the right results as efficiently as possible. - -There will even be a push to BizDevOps where development, ops, and business will come together to improve quality so defects and deficiencies are mitigated, business agility, focus on businesses becoming more agile, leaner. DevOps is expanding into areas like AI, machine learning, embedded systems, and big data. - -So DevOps is not going anywhere anytime soon. It will reinvent itself though. - -Given the insurgence of COVID19, businesses will be highly dependent on their DevOps teams, expecting them to take their digital services into hyperdrive over the next year and likely beyond 2021.  - -![DevOps books][2] - -(Tonya Brown, [CC BY-SA 4.0][3]) - -The books are listed in the order I think you should read them. I share a little bit about each book, but I don't intend to give the book away or do the reading for you. I hope you enjoy the experience of reading these books and decide for yourself whether they were valuable to you. And after you do, please come back and let me know what you think in the comments. - -### 1\. The DevOps Handbook - -![DevOps Handbook cover][4] - -_[The DevOps Handbook: How to Create World-Class Agility, Reliability, and Security in Technology Organizations][5]_ is considered the DevOps bible. It is written by Gene Kim, Jez Humble, Patrick Debois, and John Willis, and these great authors talk about the importance of integrating DevOps into organizations. The book describes how all types of organizations can employ DevOps and why it can help them gain a competitive advantage from an IT perspective. - -The book talks about the core benefits of DevOps. It offers practical applications about how to adopt DevOps, including case studies about companies that have done it, then really dives into some of its principles and breaks down the practical understanding. Finally, you can take the principles, case studies, and examples, look at your current environment, and figure out the best ways to implement DevOps in your organization. - -By reading this book, you will learn: - - * DevOps culture landscape - * Value stream mapping in DevOps - * Continuous integration and continuous delivery (CI/CD) pipelines - * Principles of flow and rapid feedback - * DevOps KPIs and metrics - - - -### 2\. The Phoenix Project - -![The Phoenix Project cover][6] - -_[The Phoenix Project][7]_, by Gene Kim, Kevin Behr, and George Spafford, is a novel about a fictional company and its fictional employees that explains what DevOps really is. It is written in the same style as _[The Goal: A Process of Ongoing Improvement][8]_ by Eliyahu M. Goldratt. - -_The Phoenix Project_ follows Bill, who was recently promoted into the role of VP at Parts Unlimited. He is assigned to turn around the company, which is in major trouble. Nothing is working, including the payment system. Bill is expected to come in and fix all of the company's problems. - -Bill starts identifying the issues and implementing solutions. As time goes on, those solutions turn out to be DevOps. - -In summary, the book: - - * Teaches a lesson in a novel form - * Allows you to see problems without blame - * Helps explain the core principles of DevOps - - - -### 3\. Continuous Delivery - -![Continuous Delivery cover][9] - -The third book to read, _[Continuous Delivery: Reliable Software Releases Through Build, Test, and Deployment Automation][10]_, is by Jez Humble and David Farley. It goes through the entire CI/CD pipeline and issues where you are trying to connect A to B, B to C, C to D. It provides practical tips and strategies on overcoming obstacles and fixing issues. - -The book discusses infrastructure management, virtualization, test, and deployment. It also gets into how to integrate and move things along effectively without problems when optimizing your environment. - -Jez and David definitely get granular in the details. They get down to the nuts and bolts of getting software to users using agile methodologies and best practices. They also speak to establishing better collaboration among developers, testers, and operations. - -### 4\. Effective DevOps - -![Effective DevOps cover][11] - -The fourth book to read is _[Effective DevOps: Building A Culture of Collaboration, Affinity, and Tooling at Scale][12]_ by Jennifer Davis & Ryn Daniels. - -DevOps is a state of mind. This book gets into DevOps culture: from empathy, to breaking down silos, to how people choose to act with and among each other, and how people work together to implement change and create great results. The book talks about strategies to accomplish these and especially about getting buy-in from leadership. - -Here is what you will learn by reading this book: - - * Essential and advanced practices to create CI/CD pipelines - * How to reduce risks, mitigate deployment errors, and increase delivery speed - * Templates and scripts to automate your build and deployment procedures - - - -### Final thoughts - -Read these four books. You won't regret it! And when you're finished, move on to these honorable mentions. - - * _[The Unicorn Project][13]_ by Gene Kim - * _[The Practice of Cloud System Administration: DevOps and SRE Practices for Web Services][14]_ by Thomas Limoncelli, Strata Chalup, and Christina Hogan - * _[Site Reliability Engineering][15]_ by Betsy Beyer, Niall Richards, David Rensin, Ken Kawahara, and Stephen Thorne - * _[Python for DevOps: Learn Ruthlessly Effective Automation][16]_ by Noah Gift, Kennedy Behrman, Alfredo Deza, and Grig Gheorghiu - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/devops-books - -作者:[Taz Brown][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/heronthecli -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/reading_book_selfcare_wfh_learning_education_520.png?itok=H6satV2u (Reading a book, selfcare) -[2]: https://opensource.com/sites/default/files/uploads/devopsbooks.jpg (DevOps books) -[3]: https://creativecommons.org/licenses/by-sa/4.0/ -[4]: https://opensource.com/sites/default/files/uploads/devopshandbook.jpg (DevOps Handbook cover) -[5]: https://www.amazon.com/DevOps-Handbook-World-Class-Reliability-Organizations/dp/1942788002 -[6]: https://opensource.com/sites/default/files/uploads/phoenixproject.jpg (The Phoenix Project cover) -[7]: https://www.amazon.com/Phoenix-Project-DevOps-Helping-Business/dp/1942788290 -[8]: https://en.wikipedia.org/wiki/The_Goal_(novel) -[9]: https://opensource.com/sites/default/files/uploads/continuousdelivery.jpg (Continuous Delivery cover) -[10]: https://www.amazon.com/Continuous-Delivery-Deployment-Automation-Addison-Wesley/dp/0321601912 -[11]: https://opensource.com/sites/default/files/uploads/effectivedevops.jpg (Effective DevOps cover) -[12]: https://www.amazon.com/Effective-DevOps-Building-Collaboration-Affinity/dp/1491926309 -[13]: https://www.amazon.com/Unicorn-Project-Developers-Disruption-Thriving/dp/1942788762 -[14]: https://www.amazon.com/Practice-Cloud-System-Administration-Practices/dp/032194318X -[15]: https://www.amazon.com/Site-Reliability-Engineering-Production-Systems/dp/149192912X -[16]: https://www.amazon.com/Python-DevOps-Ruthlessly-Effective-Automation/dp/149205769X diff --git a/sources/tech/20210116 Install Privacy-friendly WhatsApp Alternative Signal on Linux Desktop.md b/sources/tech/20210116 Install Privacy-friendly WhatsApp Alternative Signal on Linux Desktop.md deleted file mode 100644 index 9176432982..0000000000 --- a/sources/tech/20210116 Install Privacy-friendly WhatsApp Alternative Signal on Linux Desktop.md +++ /dev/null @@ -1,155 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Install Privacy-friendly WhatsApp Alternative Signal on Linux Desktop) -[#]: via: (https://itsfoss.com/install-signal-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Install Privacy-friendly WhatsApp Alternative Signal on Linux Desktop -====== - -It’s been more than a year [since we covered Signal as an ideal choice for instant messaging][1]. While privacy-aware and tech-savvy people were already aware of the existence of this awesome application, [Signal][2] got the much deserved fame after the latest WhatsApp privacy policy updates. - -Whatever maybe the reason if you are new to Signal and you are wondering if you can use Signal on desktop, the answer is yes. You can install Signal on Linux, Windows and macOS systems along with your smartphone. - -![Signal Messenger on Pop OS Linux distribution][3] - -I am not going to highlight the features Signal offers because you might already be aware of them. I am going to show you different methods of installing Signal application Linux desktop: - - * Install Signal on Linux using Snap (snap applications take longer to load but get automatic update and hassle-free installation) - * Install Signal on Debian and Ubuntu-based distributions using apt (additional efforts in adding the repository but installed apps get automatic updates) - * Install Signal on Arch and Manjaro Linux using AUR - * Install Signal on Fedora and other Linux using Flatpak package - - - -You can choose one of the methods based on your distribution and preference: - -### Method 1: Installing Signal on Ubuntu and other Linux using Snap - -If you are using Ubuntu, you can find Signal desktop app in Snap package format in the Software Center. - -![][4] - -Alternatively, you can [use the Snap command][5] to install Signal on any [Linux distribution that has Snap support][6] enabled. - -``` -sudo snap install signal-desktop -``` - -You can remove it using `snap remove` or from the Software Center. - -Some people do not like Snap packages because they take too long to start. The good news is that you can use apt command to install Signal. The next section discusses that. - -### Method 2: Install Signal on Debian and Ubuntu-based distributions via APT (using official Signal repository) - -Here are the steps you have to follow to install Signal from its official repository on Debian, Debian, Linux Mint, elementary OS and other distributions based on Debian/Ubuntu. You can [copy the commands and paste it in the terminal][7]. - -First thing is to get the GPG key for the official Signal repository and add it to the trusted keys of your APT package manager. - -``` -wget -O- https://updates.signal.org/desktop/apt/keys.asc | sudo apt-key add - -``` - -With the key added, you can safely add the repository to your system. _**Don’t get alarmed with the use of xenial in the repository name**_. It will work with Ubuntu 18.04, 20.04 and newer version as well as Debian, Mint etc. - -``` -echo "deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main" | sudo tee -a /etc/apt/sources.list.d/signal-xenial.list -``` - -Thanks to the [tee command in Linux][8], you’ll have a new file `signal-xenial.list` in the sources.list directory `/etc/apt/sources.list.d`. This new file will have the Signal repository information i.e. `deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main`. - -Now that you have added the repository, update the cache and install Signal desktop application: - -``` -sudo apt update && sudo apt install signal-desktop -``` - -Once installed, look for Signal in application menu and start it. - -![][9] - -Since you have added the repository, your installed Signal application will be automatically updated with the regular system updates. - -Enjoy encrypted messaging with Signal on your Linux desktop. - -#### Removing Signal - -The tutorial won’t be complete if I don’t share the removal steps with you. Let’s go through it. - -First, remove the application: - -``` -sudo apt remove signal-desktop -``` - -You may leave it as it is, or you may remove the Signal repository from your system. It’s optional and up to you. With the repository still in the system, you can install Signal again, easily. If you remove the repository, you’ll have to add it again following the steps in the previous section. - -If you want to remove the Signal repository as well, you can opt for the graphical method by going to Software and Updated tool and deleting it from there. - -![][10] - -Alternatively, you can remove the file with rm command: - -``` -rm -i /etc/apt/sources.list.d/signal-xenial.list -``` - -### Method 3: Installing Signal on Arch and Manjaro from AUR - -Signal is available to install on [Arch-based Linux distributions][11] via [AUR][12]. If you are using Pamac on Manjaro and have enabled AUR, you should find Signal in the package manager. - -Otherwise, you can always [use an AUR helper][13]. - -``` -sudo yay -Ss -``` - -I believe you can delete Signal in the similar function. - -### Method 4: Installing Signal on Fedora and other Linux using Flatpak - -There is no .rpm file for Signal. However, a [Flatpak package is available][14], and you may use that to get Signal on Fedora. - -``` -flatpak install flathub org.signal.Signal -``` - -Once installed, you can run it from the menu or use the following command in the terminal: - -``` -flatpak run org.signal.Signal -``` - -Signal and Telegram are two mainstream and viable options to ditch WhatsApp. Both provide native Linux desktop applications. If you use Telegram, you can [join the official It’s FOSS channel][15]. I use Signal in individual capacity because it doesn’t have the ‘channel’ feature yet. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-signal-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/signal-messaging-app/ -[2]: https://signal.org/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/12/signal-shot.jpg?resize=800%2C565&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/signal-desktop-ubuntu.png?resize=800%2C425&ssl=1 -[5]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/ -[6]: https://itsfoss.com/install-snap-linux/ -[7]: https://itsfoss.com/copy-paste-linux-terminal/ -[8]: https://linuxhandbook.com/tee-command/ -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/signal-app-in-ubuntu.jpg?resize=795%2C230&ssl=1 -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/remove-signal-repository.png?resize=800%2C401&ssl=1 -[11]: https://itsfoss.com/arch-based-linux-distros/ -[12]: https://itsfoss.com/aur-arch-linux/ -[13]: https://itsfoss.com/best-aur-helpers/ -[14]: https://flathub.org/apps/details/org.signal.Signal -[15]: https://t.me/joinchat/AAAAAEPRGUJrEE1itjpH6A diff --git a/sources/tech/20210118 Set up a minimal server on a Raspberry Pi.md b/sources/tech/20210118 Set up a minimal server on a Raspberry Pi.md deleted file mode 100644 index 8042c22eaa..0000000000 --- a/sources/tech/20210118 Set up a minimal server on a Raspberry Pi.md +++ /dev/null @@ -1,256 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Set up a minimal server on a Raspberry Pi) -[#]: via: (https://opensource.com/article/21/1/minimal-server-raspberry-pi) -[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) - -Set up a minimal server on a Raspberry Pi -====== -Don't decommission that old Raspberry Pi just yet! This step-by-step -guide shows how I set up my Raspberry Pi with the most minimal -configuration to conserve precious system resources. -![Raspberry Pi board Model B][1] - -Recently, the microSD (secure digital) card in my [Raspberry Pi][2] stopped working. It had been in constant use as a server for almost two years, and this provided a good opportunity to start fresh and correct a few problems. After its initial installation, it began experiencing disk problems and the official Raspberry Pi operating system (OS) received a significant update (and was renamed from Raspbian to Raspberry Pi OS). So I acquired a new microSD card and preceded to rebuild. - -Although this Raspberry Pi 3 Model B isn't the latest hardware, it is still adequate for running a minimal server for various services. I think my original installation used the full operating system image that includes the graphical user interface and a lot of other software packages unnecessary for my needs. - -This step-by-step guide shows how I set up my Raspberry Pi with the most minimal configuration to conserve precious system resources. - -### Get started - -To begin, create a new operating system drive for the Pi. This requires two things: an OS image file and a microSD card. - -#### Download the Raspberry Pi OS image file - -While several operating systems are available, I chose to stick to the officially supported OS. - -The first step is to download the newest OS image file from the official [Raspberry Pi OS][3] site to a computer you can use to write to a microSD card. Three different images are offered, and I chose the Raspberry Pi OS Lite. It is the smallest OS and includes only the essential files required for a base OS, so it will consume the least amount of disk space and system RAM. (When I downloaded the OS, the release date was August 20, 2020, but it has been updated since then. I do not expect any major differences, but as always, I recommend reading the release notes.) - -#### Write the OS to the microSD Card - -The second step is to write the downloaded OS image file to the microSD card. My card was used previously, and when I inserted it into my Linux desktop, it automatically mounted its two existing partitions. I couldn't write the image until I unmounted these partitions. To do so, I had to determine their path with the `lsblk` command, which identified the device as `/dev/mmcblk0`: - - -``` -`# lsblk -p` -``` - -I then unmounted the partitions with the `umount` command: - - -``` -# umount /dev/mmcblk0p2 -# umount /dev/mmcblk0p1 -``` - -Once the partitions are unmounted, write the image file to the microSD card. Although there are many graphical image-writing tools available, I used the venerable `dd` command: - - -``` -`# dd bs=4M if=/home/alan/Downloads/raspios/2020-08-20-raspios-buster-armhf-lite.img of=/dev/mmcblk0 status=progress conv=fsync` -``` - -#### Boot the Pi - -You just need a monitor, keyboard, and power adapter to access the Raspberry Pi. I also have an Ethernet cable for network connectivity, which I prefer over wireless—especially for a dedicated server. - -Insert the microSD card and power on the Pi. Once it boots, log in with the default credentials: user `pi` and password `raspberry`. - -### Configure the OS - -Take the following steps to minimize your installation, disk space, and memory usage as much as possible. I recommend spending time to research each configuration to be as correct as possible. There are often several ways to apply a configuration, and configuration files and directives can be deprecated. Always review a product's documentation to ensure you're not applying an outdated configuration. - -#### Run raspi-config - -The main configuration program in Raspberry Pi OS is called raspi-config. Run it immediately after logging in: - - -``` -`# raspi-config` -``` - -![Raspberry Pi config main window][4] - -It presents an option to expand the root filesystem to use all of the available space on the microSD card. After taking this option, reboot and log in again. - -Verify that the card's full capacity is being used with the `df` command: - - -``` -`# df -h` -``` - -If you need to configure other options, run `raspi-config` again. Some of these will vary according to your requirements or preferences. Go through all of them just to be sure you don't miss anything. I recommend the following changes for best performance. (I will skip the sections where I did not make any changes.) - - * **System options:** You can set the hostname, preferably using a fully qualified domain name (FQDN). You can also change your password here, which is always highly recommended. - * **Interface options:** Enable SSH. - * **Performance options:** Reduce GPU memory to the lowest setting (16MB). - * **Localization options:** Choose your time zone, location, and keyboard type. - * **Advanced options:** This section contains the Expand Filesystem option to expand the root filesystem. If you didn't do this above, be sure to do it here so that you have access to all storage available on the microSD card. - * **Update:** Entering the Update section immediately checks for an update to the raspi-config tool. If an update is available, it will be downloaded and applied. Otherwise, raspi-config will re-launch after a few seconds. - - - -Once you complete these configurations in raspi-config, select **Finish** to exit the tool. - -#### Manual configurations - -There are several other changes that I recommend. They are all manual changes that require editing certain configuration files. - -##### Configure static IP - -Generally, it is best to configure a server with a static IP address. To configure the IP and your default gateway (router) and domain name service (DNS) addresses, begin by identifying the network interface device with the `ip` command: - - -``` -# ip link -1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 -    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 -2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 -    link/ether b8:27:eb:48:3f:46 brd ff:ff:ff:ff:ff:ff -``` - -You also need to know the IP address of your default gateway and one or more DNS servers. Add this information to the file `/etc/dhcpcd.conf` (_I strongly suggest making a backup of this file before making changes)_: - - -``` -# cd /etc -# cp -a dhcpcd.conf dhcpcd.conf.original -``` - -Edit the file as shown: - - -``` -# vi dhcpcd.conf - -# static IP configuration: -interface eth0 -static ip_address=192.168.1.5/24 -static routers=192.168.1.1 -static domain_name_servers=192.168.1.3 192.168.1.4 -``` - -##### Disable IPv6 - -Unless you specifically need to use IPv6, you might prefer to disable it. Do this by creating two new files that include a one-line directive instructing the Linux kernel not to use IPv6. - -First, create the file `/etc/sysctl.d/disable-ipv6.conf` with the line -`net.ipv6.conf.all.disable_ipv6 = 1`: - - -``` -# cd /etc/sysctl.d -# echo "net.ipv6.conf.all.disable_ipv6 = 1" > disable-ipv6.conf -``` - -Then create the file `/etc/modprobe.d/blacklist-ipv6.conf` with the line `blacklist ipv6`: - - -``` -# cd /etc/modprobe.d -# echo "blacklist ipv6" > blacklist-ipv6.conf -``` - -##### Disable WiFi, Bluetooth, and audio - -My server's specific purpose will not need Bluetooth or audio. Also, since it's connected with Ethernet, it will not use wireless (WiFi). Unless you plan to use them, disable them with the following steps. - -Make the following changes to the file `/boot/config.txt` _(again, I suggest making a backup of this file)_: - - -``` -# cd /boot -# cp -a config.txt config.txt.original -``` - -Add the following two directives to the bottom of the file to disable Bluetooth and WiFi: - - * `dtoverlay=disable-bt` - * `dtoverlay=disable-wifi` - - - -These echo commands will do the trick: - - -``` -# cd /boot -# echo "dtoverlay=disable-bt" >> config.txt -# echo "dtoverlay=disable-wifi" >> config.txt -``` - -To disable audio, change the parameter `dtparam=audio` to `off`. You can do this with a short `sed` command: - - -``` -`# sed -i '/dtparam=audio/c dtparam=audio=off' config.txt` -``` - -The last step is to disable the WiFi service. Use the `systemctl mask` command: - - -``` -`systemctl mask wpa_supplicant.service` -``` - -You can disable a couple of other services if you won't need them: - - * **Disable modem service:** [code]`systemctl disable hciuart` -``` -* **Disable Avahi-daemon:** [code]`systemctl disable avahi-daemon.service` -``` - - - -### Final steps - - * **Check your memory usage:** [code]`# free -h`[/code] I was astonished: My OS only uses 30MB of RAM. - * **Create personal accounts:** It is advisable to create user accounts for any individuals who will log into this server. You can assign them to the sudo group to allow them to issue administrative commands. For example, to give a user named George an account: [code] # adduser george -# usermod -a -G adm,sudo,users george -``` - * **Get updates:** This is an important step. Apply updates to get the latest fixes to the Raspberry Pi OS: [code] # apt update -# apt full-upgrade -``` - * **Reboot:** It's a good idea to reboot your new server: [code]`# systemctl reboot` -``` -* **Install Cockpit:** You can install [Cockpit][5], also known as the Linux Web Console, on Raspberry Pi OS. It provides an HTML-based interface for managing and monitoring your server remotely. I recently wrote about [getting started with Cockpit][6]. Install it with: [code]`# apt install cockpit` -``` - - - -Now my Raspberry Pi is ready to host a server. I could use it for a [web server][7], a [VPN server][8], a game server such as [Minetest][9], or (as I did) an [ad blocker based on Pi-Hole][10]. - -### Keep old hardware alive - -Regardless of what hardware you have available, carefully minimizing and controlling your operating system and packages can keep your resource usage low so that you can get the most out of it. This also improves security by reducing the number of services and packages available to would-be mal-actors trying to exploit a vulnerability. - -So, before you decommission older hardware, consider all the possibilities for how it can continue to be used. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/minimal-server-raspberry-pi - -作者:[Alan Formy-Duval][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/alanfdoss -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/RaspberryPi.SUNY_.jpg?itok=uS_-VUcb (Raspberry Pi board Model B) -[2]: https://opensource.com/resources/raspberry-pi -[3]: https://www.raspberrypi.org/software/operating-systems -[4]: https://opensource.com/sites/default/files/uploads/raspi-config-main.png (Raspberry Pi config main window) -[5]: https://cockpit-project.org/ -[6]: https://opensource.com/article/20/11/cockpit-server-management -[7]: https://opensource.com/article/17/3/building-personal-web-server-raspberry-pi-3 -[8]: https://opensource.com/article/19/6/raspberry-pi-vpn-server -[9]: https://github.com/minetest -[10]: https://opensource.com/article/18/2/block-ads-raspberry-pi diff --git a/sources/tech/20210119 10 ways big data and data science impacted the world in 2020.md b/sources/tech/20210119 10 ways big data and data science impacted the world in 2020.md deleted file mode 100644 index ffdce5baaf..0000000000 --- a/sources/tech/20210119 10 ways big data and data science impacted the world in 2020.md +++ /dev/null @@ -1,121 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (10 ways big data and data science impacted the world in 2020) -[#]: via: (https://opensource.com/article/21/1/big-data) -[#]: author: (Lauren Maffeo https://opensource.com/users/lmaffeo) - -10 ways big data and data science impacted the world in 2020 -====== -Learn how open source data science languages, libraries, and tools are -helping us understand our world better by reviewing 2020's top 10 data -science articles on Opensource.com. -![Looking at a map][1] - -Big data’s one of many domains where open source shines. From open source alternatives for Google Analytics to new features in MySQL, 2020 brought several ways for open source enthusiasts to learn big data skills. - -Get up to speed on how open source data science languages, libraries, and tools help us understand our world better by reviewing the top 10 data science articles published on Opensource.com last year.  - -### The 7 most popular ways to plot data in Python - -Once upon a time, Matplotlib was the lone way to make plots in Python. In recent years, Python's status as data science's de facto language changed that. We have a plethora of ways to plot data using Python today. - -In this article, Shaun Taylor-Morgan walks through [seven ways to plot data in Python][2]. Don't worry if you're a Matplotlib user: It's covered, along with Seaborn, Plotly, and Bokeh. You'll find codes and charts per plotting library, plus some newcomers to the Python plotting field: Altair, Pygal, and pandas. - -### Transparent, open source alternative to Google Analytics - -Many websites use Google Analytics to track their activity metrics. Its status as a de facto tool leaves some to wonder if open source options exist. In this [overview of Plausible Analytics][3], Marko Saric proves they do. - -If you want to compare Google Analytics against open source options, you will find Marko's article helpful. It's especially great if you're a website admin trying to comply with new data collection regulations, such as GDPR. - -If you want to learn more about Plausible, you'll find links to Plausible's code and roadmap on GitHub in Marko's article. - -### 5 MySQL features you need to know - -After MySQL 8.0 came out in April 2018, its release cycle for new features updated to four times per year. Despite the more frequent deployments, many users don't know about [new MySQL features][4] that could save them hours of time. - -In this March 2020 article, Dave Stokes shares five features that were new to MySQL. They include dual passwords, new shells, and better SQL support. But keep in mind that these updates are now close to a year old: There's a lot more to discover in MySQL since then! - -### Using C and C++ for data science - -Did you know that C and C++ are both strong options for data science projects? They're especially good choices to [run data science programs on the command line][5]. - -In this article, Cristiano L. Fontana uses [C99][6] and [C++11][7] to write a program that uses [Anscombe's quartet][8] dataset. The step-by-step instructions include reading data from a CSV file, interpolating data, and plotting results to an image file. - -### Using Python to visualize COVID-19 projections - -The COVID-19 pandemic brought an influx of data to the proverbial forefront. In this article, Anurag Gupta shows how to use Python to [project COVID-19 cases and deaths][9] across India. - -Anurag walks through downloading and parsing data, selecting and plotting data for India, and creating an animated horizontal bar graph. If you're interested in the complete script, you'll find a link at the end of this article. - -### How I use Python to map the global spread of COVID-19 - -If you want to [track the spread of COVID-19 globally][10], you can use Python, pandas, and Plotly to do it. In this article, Anurag Gupta explains how you can use them to clean and visualize raw data. - -Using screenshots to help, Anurag shares how to load data into a pandas DataFrame; clean and modify the DataFrame; and visualize the spread in Plotly. The complete code yields a gorgeous graph, and the article ends with a link to download and run it. - -### 3 ways to use PostgreSQL commands - -In this follow-up to his article on getting started with PostgreSQL, Greg Pittman shares how he uses PostgreSQL commands to [keep his grocery shopping list updated][11]. - -Whether you want to do per-item entry or bring order to complex tables, Greg explains how to create the commands you need. He also shows how to output your lists once you're ready to print them. - -No matter how long your shopping list is, PostgreSQL commands—especially the WHERE parameter—can bring ease to your life beyond programming. - -### Using Python and GNU Octave to plot data - -Python is data science's language du jour, but how can you use it for specific tasks? In this article, Cristiano Fontana shares how to [write a program in Python and GNU Octave][12]. - -Cristiano walks through each step to read data from a CSV file, interpolate the data with a straight line, and plot the result to an image file. From printing output and reading data to plotting the outcome, Fontana's step-by-step guidelines explain the whole process in Python and GNU Octave. - -### Fast data modeling with JavaScript - -Want a way to [model data in a few minutes][13]? In this article, Szymon shares how to do it using less than 15 lines of JavaScript code. - -It really is that simple: You merely need to create a class and use the defaultsDeep function in the [Lodash][14] JavaScript library. Szymon shows this process using screenshots and code samples. - -It keeps your data in one place, avoids code repetition, and is fully customizable. If you want to try out the code in this article, Szymon links to it in CodeSandbox at the end. - -### How to process real-time data with Apache tools - -We process so much data today that storing data for analysis later might be impossible soon. Teams that handle failure prediction and other context-sensitive data need to get this information in real time, before it hits a database. Luckily, you can do this with Apache tools. - -In this article, Simon Crosby explains how Apache Spark—a unified analytics engine—can [process large datasets][15] in real time at scale. For instance, "Spark Streaming breaks data into mini-batches that are each independently analyzed by a Spark model or some other system," he writes. - -If Apache's not your thing, Simon presents other open source options. Flink, Beam, and Stanza—along with Apache-licensed SwimOS and Hazelcast—are just a few of your choices. - -### What do you want to know? - -What would you like to know about big data and data science? Please share your suggestions for article topics in the comments. And if you have something interesting to share about data science, please consider [writing an article][16] for Opensource.com. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/big-data - -作者:[Lauren Maffeo][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/lmaffeo -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png?itok=L0BQHgjr (Looking at a map) -[2]: https://opensource.com/article/20/4/plot-data-python -[3]: https://opensource.com/article/20/5/plausible-analytics -[4]: https://opensource.com/article/20/3/mysql-features -[5]: https://opensource.com/article/20/2/c-data-science -[6]: https://en.wikipedia.org/wiki/C99 -[7]: https://en.wikipedia.org/wiki/C%2B%2B11 -[8]: https://en.wikipedia.org/wiki/Anscombe%27s_quartet -[9]: https://opensource.com/article/20/4/python-data-covid-19 -[10]: https://opensource.com/article/20/4/python-map-covid-19 -[11]: https://opensource.com/article/20/2/postgresql-commands -[12]: https://opensource.com/article/20/2/python-gnu-octave-data-science -[13]: https://opensource.com/article/20/5/data-modeling-javascript -[14]: https://en.wikipedia.org/wiki/Lodash -[15]: https://opensource.com/article/20/2/real-time-data-processing -[16]: https://opensource.com/how-submit-article diff --git a/sources/tech/20210121 How to Uninstall Applications from Ubuntu Linux.md b/sources/tech/20210121 How to Uninstall Applications from Ubuntu Linux.md deleted file mode 100644 index 5770ba0e2e..0000000000 --- a/sources/tech/20210121 How to Uninstall Applications from Ubuntu Linux.md +++ /dev/null @@ -1,167 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (amagicbowboy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Uninstall Applications from Ubuntu Linux) -[#]: via: (https://itsfoss.com/uninstall-programs-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Uninstall Applications from Ubuntu Linux -====== - -Don’t use a certain application anymore? Remove it. - -In fact, removing programs is one of the [easiest ways to free up disk space on Ubuntu][1] and keep your system clean. - -In this beginner’s tutorial, I’ll show you various ways of uninstalling software from Ubuntu. - -Did I say various ways? Yes, because there are [various ways of installing applications in Ubuntu][2] and hence various ways of removing them. You’ll learn to: - - * Remove applications from Ubuntu Software Center (for desktop users) - * Remove applications using apt remove command - * Remove snap applications in command line (intermediate to advanced users) - - - -Let’s see these steps one by one. - -### Method 1: Remove applications using Ubuntu Software Center - -Start the Software Center application. You should find it in the dock on the left side or search for it in the menu. - -![][3] - -You can see the installed applications in the Installed tab. - -![List installed applications][4] - -If you don’t see a program here, try to use the search feature. - -![Search for installed applications][5] - -When you open an installed application, you should see the option to remove it. Click on it. - -![Removing installed applications][6] - -It will ask for your account password. Enter it and the applications will be removed in seconds. - -This method works pretty well except in the case when Software Center is misbehaving (it does that a lot) or if the program is a software library or some other command line utility. You can always resort to the terminal in such cases. - -### Method 2: Remove programs from Ubuntu using command line - -You know that you can use `apt-get install` or `apt install` for installing applications. For uninstalling, you don’t use the apt-get uninstall command but `apt-get remove` or `apt remove`. - -All you need to do is to use the command in the following fashion: - -``` -sudo apt remove program_name -``` - -You’ll be asked to enter your account password. When you enter it, nothing is visible on the screen. That’s normal. Just type it blindly and press enter. - -The program won’t be removed immediately. You need to confirm it. When it asks for your conformation, press the enter key or Y key: - -![][7] - -Keep in mind that you’ll have to use the exact package name in the apt remove command otherwise it will throw ‘[unable to locate package error][8]‘. - -Don’t worry if you don’t remember the exact program name. You can utilize the super useful tab completion. It’s one of the [most useful Linux command line tips][9] that you must know. - -What you can do is to type the first few letters of the program you want to uninstall. And then hit the tab key. It will show all the installed packages that match those letters at the beginning of their names. - -When you see the desired package, you can type its complete name and remove it. - -![][10] - -What if you do not know the exact package name or even the starting letters? Well, you can [list all the installed packages in Ubuntu][11] and grep with whatever your memory serves. - -For example, the command below will show all the installed packages that have the string ‘my’ in its name anywhere, not just the beginning. - -``` -apt list --installed | grep -i my -``` - -![][12] - -That’s cool, isn’t it? Just be careful with the package name when using the remove command in Ubuntu. - -#### Tip: Using apt purge for removing package (advanced users) - -When you remove a package in Ubuntu, the packaged data is removed, but it may leave small, modified user configuration files. This is intentional because if you install the same program again, it would use those configuration files. - -If you want to remove it completely, you can use apt purge command. You can use it instead of apt remove command or after running the apt remove command. - -``` -sudo apt purge program_name -``` - -Keep in mind that the purge command won’t remove any data or configuration file stored in the home directory of a user. - -### Method 3: Uninstall Snap applications in Ubuntu - -The previous method works with the DEB packages that you installed using apt command, software center or directly from the deb file. - -Ubuntu also has a new packaging system called [Snap][13]. Most of the software you find in the Ubuntu Software Center are in this Snap package format. - -You can remove these applications from the Ubuntu Software Center easily but if you want to use the command line, here’s what you should do. - -List all the snap applications installed to get the package name. - -``` -snap list -``` - -![][14] - -Now use the package name to remove the application from Ubuntu. You won’t be asked for confirmation before removal. - -``` -sudo snap remove package_name -``` - -### Bonus Tip: Clean up your system with one magical command - -Alright! You learned to remove the applications. Now let me tell you about a simple command that cleans up leftover package traces like dependencies that are no longer used, old Linux kernel headers that won’t be used anymore. - -In the terminal, just run this command: - -``` -sudo apt autoremove -``` - -This is a safe command, and it will easily free up a few hundred MB’s of disk space. - -### Conclusion - -You learned three ways of removing applications from Ubuntu Linux. I covered both GUI and command line methods so that you are aware of all the options. - -I hope you find this simple tutorial helpful as an Ubuntu beginner. Questions and suggestions are always welcome. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/uninstall-programs-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/free-up-space-ubuntu-linux/ -[2]: https://itsfoss.com/remove-install-software-ubuntu/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/ubuntu_software_applications_menu.jpg?resize=800%2C390&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/installed-apps-ubuntu.png?resize=800%2C455&ssl=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/search-installed-apps-ubuntu.png?resize=800%2C455&ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/remove-applications-ubuntu.png?resize=800%2C487&ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/apt-remove-program-ubuntu.png?resize=768%2C424&ssl=1 -[8]: https://itsfoss.com/unable-to-locate-package-error-ubuntu/ -[9]: https://itsfoss.com/linux-command-tricks/ -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/remove-package-ubuntu-linux.png?resize=768%2C424&ssl=1 -[11]: https://itsfoss.com/list-installed-packages-ubuntu/ -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/search-list-installed-apps-ubuntu.png?resize=768%2C424&ssl=1 -[13]: https://itsfoss.com/install-snap-linux/ -[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/list-snap-remove.png?resize=800%2C407&ssl=1 diff --git a/sources/tech/20210122 Convert your filesystem to Btrfs.md b/sources/tech/20210122 Convert your filesystem to Btrfs.md deleted file mode 100644 index 99ae229466..0000000000 --- a/sources/tech/20210122 Convert your filesystem to Btrfs.md +++ /dev/null @@ -1,339 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Convert your filesystem to Btrfs) -[#]: via: (https://fedoramagazine.org/convert-your-filesystem-to-btrfs/) -[#]: author: (Gergely Gombos https://fedoramagazine.org/author/gombosg/) - -Convert your filesystem to Btrfs -====== - -![][1] - -### Introduction - -The purpose of this article is to give you an overview about why, and how to migrate your current partitions to a Btrfs filesystem. To read a step-by-step walk through of how this is accomplished – follow along, if you’re curious about doing this yourself. - -Starting with Fedora 33, the default filesystem is now Btrfs for new installations. I’m pretty sure that most users have heard about its advantages by now: copy-on-write, built-in checksums, flexible compression options, easy snapshotting and rollback methods. It’s really a modern filesystem that brings new features to desktop storage. - -Updating to Fedora 33, I wanted to take advantage of Btrfs, but personally didn’t want to reinstall the whole system for ‘just a filesystem change’. I found [there was] little guidance on how exactly to do it, so decided to share my detailed experience here. - -### Watch out! - -Doing this, you are playing with fire. Hopefully you are not surprised to read the following: - -> During editing partitions and converting file systems, you can have your data corrupted and/or lost. You can end up with an unbootable system and might be facing data recovery. You can inadvertently delete your partitions or otherwise harm your system. - -These conversion procedures are meant to be safe even for production systems – but only if you plan ahead, have backups for critical data and rollback plans. As a _sudoer_, you can do anything without limits, without any of the usual safety guards protecting you. - -### The safe way: reinstalling Fedora - -Reinstalling your operating system is the ‘official’ way of converting to Btrfs, recommended for most users. Therefore, choose this option if you are unsure about anything in this guide. The steps are roughly the following: - - 1. Backup your home folder and any data that might be used in your system like _/etc_. [Editors note: VM’s too] - 2. Save your list of installed packages to a file. - 3. Reinstall Fedora by removing your current partitions and choosing the new default partitioning scheme with Btrfs. - 4. Restore the contents of your home folder and reinstall the packages using the package list. - - - -For detailed steps and commands, see this comment by a community user at [ask.fedoraproject.org][2]. If you do this properly, you’ll end up with a system that is functioning in the same way as before, with minimal risk of losing any data. - -### Pros and cons of conversion - -Let’s clarify this real quick: what kind of advantages and disadvantages does this kind of filesystem conversion have? - -##### **The good** - - * Of course, no reinstallation is needed! Every file on your system will remain the exact same as before. - * It’s technically possible to do it in-place i.e. without a backup. - * You’ll surely learn a lot about btrfs! - * It’s a rather quick procedure if everything goes according to plan. - - - -##### The bad - - * You have to know your way around the terminal and shell commands. - * You can lose data, see above. - * If anything goes wrong, you are on your own to fix it. - - - -##### The ugly - - * You’ll need about 20% of free disk space for a successful conversion. But for the complete backup & reinstall scenario, you might need even more. - * You can customize everything about your partitions during the process, but you can also do that from Anaconda if you choose to reinstall. - - - -### **What about LVM?** - -LVM layouts have been the default during the last few Fedora installations. If you have an LVM partition layout with multiple partitions e.g. _/_ and _/home_, you would somehow have to merge them in order to enjoy all the benefits of Btrfs. - -If you choose so, you can individually convert partitions to Btrfs while keeping the volume group. Nevertheless, one of the advantages of migrating to Btrfs is to get rid of the limits imposed by the LVM partition layout. You can also use the send-receive functionality offered by _btrfs_ to merge the partitions after the conversion. - -See also on Fedora Magazine: [Reclaim hard-drive space with LVM][3], [Recover your files from Btrfs snapshots][4] and [Choose between Btrfs and LVM-ext4][5]. - -### Getting acquainted with Btrfs - -It’s advisable to read at least the following to have a basic understanding about what Btrfs is about. If you are unsure, just choose the safe way of reinstalling Fedora. - -##### Must reads - - * [Fedora Magazine: Btrfs Coming to Fedora 33][6] - * [Btrfs sysadmin guide][7], _especially_ about subvolumes & flat subvolume layout. - * [Btrfs-convert guide][8] - - - -##### Useful resources - - * [_man 8 btrfs_][9] – command-line interface - * _[man 5 btrfs][10]_ – mount options - * _[man btrfs-convert][11]_ – the conversion tool we are going to use - * _[man btrfs-subvolume][12]_ – managing subvolumes - - - -### Conversion steps - -##### Create a live image - -Since you can’t convert mounted filesystems, we’ll be working from a Fedora live image. Install [Fedora Media Writer][13] and ‘burn’ Fedora 33 to your favorite USB stick. - -##### Free up disk space - -_btrfs-convert_ will recreate filesystem metadata in your partition’s free disk space, while keeping all existing _ext4_ data at its current location. - -Unfortunately, the amount of free space required cannot be known ahead – the conversion will just fail (and do no harm) if you don’t have enough. Here are some useful ideas for freeing up space: - - * Use _baobab_ to identify large files & folders to remove. Don’t manually delete files outside of your home folder if possible. - * Clean up old system journals: _journalctl –vacuum-size=100M_ - * If you are using Docker, carefully use tools like _docker volume prune, docker image prune -a_ - * Clean up unused virtual machine images inside e.g. GNOME Boxes - * Clean up unused packages and flatpaks: _dnf autoremove_, _flatpak remove –unused_, - * Clean up package caches: _pkcon refresh force -c -1_, _dnf clean all_ - * If you’re confident enough to, you can cautiously clean up the _~/.cache_ folder. - - - -##### Convert to Btrfs - -Save all your valuable data to a backup, make sure your system is fully updated, then reboot into the live image. Run _gnome-disks_ to find out your device handle e.g. _/dev/sda1_ (it can look different if you are using LVM). Check the filesystem and do the conversion: [Editors note: The following commands are run as root, use caution!] - -``` -$ sudo su - -# fsck.ext4 -fyv /dev/sdXX -# man btrfs-convert (read it!) -# btrfs-convert /dev/sdXX -``` - -This can take anywhere from 10 minutes to even hours, depending on the partition size and whether you have a rotational or solid-state hard drive. If you see errors, you’ll likely need more free space. As a last resort, you could try _btrfs-convert_ _-n_. - -##### How to roll back? - -If the conversion fails for some reason, your partition will remain _ext4_ or whatever it was before. If you wish to roll back after a successful conversion, it’s as simple as - -``` -# btrfs-convert -r /dev/sdXX -``` - -**Warning!** You will permanently lose your ability to roll back if you do any of these: defragmentation, balancing or deleting the _ext2_saved_ subvolume. - -Due to the copy-on-write nature of Btrfs, you can otherwise safely copy, move and even delete files, create subvolumes, because _ext2_saved_ keeps referencing to the old data. - -##### Mount & check - -Now the partition is supposed to have _btrfs_ file system. Mount it and look around your files… and subvolumes! - -``` -# mount /dev/sdXX /mnt -# man btrfs-subvolume (read it!) -# btrfs subvolume list / (-t for a table view) -``` - -Because you have already read the [relevant manual page][14], you should now know that it’s safe to create subvolume snapshots, and that you have an _ext2-saved_ subvolume as a handy backup of your previous data. - -It’s time to read the [Btrfs sysadmin guide][7], so that you won’t confuse subvolumes with regular folders. - -##### Create subvolumes - -We would like to achieve a ‘flat’ subvolume layout, which is the same as what Anaconda creates by default: - -``` -toplevel (volume root directory, not to be mounted by default) - +-- root (subvolume root directory, to be mounted at /) - +-- home (subvolume root directory, to be mounted at /home) -``` - -You can skip this step, or decide to aim for a different layout. The advantage of this particular structure is that you can easily create snapshots of _/home_, and have different compression or mount options for each subvolume. - -``` -# cd /mnt -# btrfs subvolume snapshot ./ ./root2 -# btrfs subvolume create home2 -# cp -a home/* home2/ -``` - -Here, we have created two subvolumes. _root2_ is a full snapshot of the partition, while _home2_ starts as an empty subvolume and we copy the contents inside. (This _cp_ command doesn’t duplicate data so it is going to be fast.) - - * In _/mnt_ (the top-level subvolume) delete everything except _root2_, _home2_, and _ext2_saved_. - * Rename _root2_ and _home2_ subvolumes to _root_ and _home_. - * Inside _root_ subvolume, empty out the _home_ folder, so that we can mount the _home_ subvolume there later. - - - -It’s simple if you get everything right! - -##### Modify fstab - -In order to mount the new volume after a reboot, _fstab_ has to be modified, by replacing the old _ext4_ mount lines with new ones. - -You can use the command _blkid_ to learn your partition’s UUID. - -``` -UUID=xx / btrfs subvol=root 0 0 -UUID=xx /home btrfs subvol=home 0 0 -``` - -(Note that the two UUIDs are the same if they are referring to the same partition.) - -These are the defaults for new Fedora 33 installations. In _fstab_ you can also choose to customize compression and add options like _noatime._ - -See the relevant [wiki page about compression][15] and _[man 5 btrfs][10]_ for all relevant options. - -##### Chroot into your system - -If you’ve ever done system recovery, I’m pretty sure you know these commands. Here, we get a shell prompt that is essentially _inside_ your system, with network access. - -First, we have to remount the _root_ subvolume to _/mnt_, then mount the _/boot_ and _/boot/efi_ partitions (these can be different depending on your filesystem layout): - -``` -# umount /mnt -# mount -o subvol=root /dev/sdXX /mnt -# mount /dev/sdXX /mnt/boot -# mount /dev/sdXX /mnt/boot/efi -``` - -Then we can move on to mounting system devices: - -``` -# mount -t proc /proc /mnt/proc -# mount --rbind /dev /mnt/dev -# mount --make-rslave /mnt/dev -# mount --rbind /sys /mnt/sys -# mount --make-rslave /mnt/sys -# cp /mnt/etc/resolv.conf /mnt/etc/resolv.conf.chroot -# cp -L /etc/resolv.conf /mnt/etc -# chroot /mnt /bin/bash -$ ping www.fedoraproject.org -``` - -##### Reinstall GRUB & kernel - -The easiest way – now that we have network access – is to reinstall GRUB and the kernel because it does all configuration necessary. So, inside the chroot: - -``` -# mount /boot/efi -# dnf reinstall grub2-efi shim -# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg -# dnf reinstall kernel-core -...or just renegenerating initramfs: -# dracut --kver $(uname -r) --force -``` - -This applies if you have an UEFI system. Check the docs below if you have a BIOS system. Let’s check if everything went well, before rebooting: - -``` -# cat /boot/grub2/grubenv -# cat /boot/efi/EFI/fedora/grub.cfg -# lsinitrd /boot/initramfs-$(uname -r).img | grep btrfs -``` - -You should have proper partition UUIDs or references in _grubenv_ and _grub.cfg_ (grubenv may not have been updated, edit it if needed) and see _insmod btrfs_ in _grub.cfg_ and _btrfs_ module in your initramfs image. - -See also: [Reinstalling GRUB 2][16] and [Verifying the Initial RAM Disk Image][17] in the Fedora System Administration Guide. - -##### Reboot - -Now your system should boot properly. If not, don’t panic, go back to the live image and fix the issue. In the worst case, you can just reinstall Fedora from right there. - -##### After first boot - -Check that everything is fine with your new Btrfs system. If you are happy, you’ll need to reclaim the space used by the old _ext4_ snapshot, defragment and balance the subvolumes. The latter two might take some time and is quite resource intensive. - -You have to mount the top level subvolume for this: - -``` -# mount /dev/sdXX -o subvol=/ /mnt/someFolder -# btrfs subvolume delete /mnt/someFolder/ext2_saved -``` - -Then, run these commands when the machine has some idle time: - -``` -# btrfs filesystem defrag -v -r -f / -# btrfs filesystem defrag -v -r -f /home -# btrfs balance start -m / -``` - -Finally, there’s a “no copy-on-write” [attribute][18] that is automatically set for virtual machine image folders for new installations. Set it if you are using VMs: - -``` -# -``` - -chattr +C /var/lib/libvirt/images - -``` -$ chattr +C -``` - -~/.local/share/gnome-boxes/images -``` - -``` - -This attribute only takes effect for new files in these folders. Duplicate the images and delete the originals. You can confirm the result with _lsattr_. - -### Wrapping up - -I really hope that you have found this guide to be useful, and was able to make a careful and educated decision about whether or not to convert to Btrfs on your system. I wish you a successful conversion process! - -Feel free to share your experience here in the comments, or if you run into deeper issues, on [ask.fedoraproject.org][19]. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/convert-your-filesystem-to-btrfs/ - -作者:[Gergely Gombos][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/gombosg/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2020/08/butterfs-816x346.png -[2]: https://ask.fedoraproject.org/t/conversion-of-an-existing-ext4-fedora-32-system-completely-to-btrfs/9446/6?u=gombosghttps://ask.fedoraproject.org/t/conversion-of-an-existing-ext4-fedora-32-system-completely-to-btrfs/9446/6?u=gombosg -[3]: https://fedoramagazine.org/reclaim-hard-drive-space-with-lvm/ -[4]: https://fedoramagazine.org/recover-your-files-from-btrfs-snapshots/ -[5]: https://fedoramagazine.org/choose-between-btrfs-and-lvm-ext4/ -[6]: https://fedoramagazine.org/btrfs-coming-to-fedora-33/ -[7]: https://btrfs.wiki.kernel.org/index.php/SysadminGuide -[8]: https://btrfs.wiki.kernel.org/index.php/Conversion_from_Ext3 -[9]: https://www.mankier.com/8/btrfs -[10]: https://www.mankier.com/5/btrfs -[11]: https://www.mankier.com/8/btrfs-convert -[12]: https://www.mankier.com/8/btrfs-subvolume -[13]: https://getfedora.org/en/workstation/download/ -[14]: https://www.mankier.com/8/btrfs-subvolume#Subvolume_and_Snapshot -[15]: https://btrfs.wiki.kernel.org/index.php/Compression -[16]: https://docs.fedoraproject.org/en-US/fedora/f33/system-administrators-guide/kernel-module-driver-configuration/Working_with_the_GRUB_2_Boot_Loader/#sec-Reinstalling_GRUB_2 -[17]: https://docs.fedoraproject.org/en-US/fedora/f33/system-administrators-guide/kernel-module-driver-configuration/Manually_Upgrading_the_Kernel/#sec-Verifying_the_Initial_RAM_Disk_Image -[18]: https://www.mankier.com/1/chattr#Attributes-C -[19]: https://ask.fedoraproject.org/ diff --git a/sources/tech/20210122 Why KubeEdge is my favorite open source project of 2020.md b/sources/tech/20210122 Why KubeEdge is my favorite open source project of 2020.md deleted file mode 100644 index 941a36a082..0000000000 --- a/sources/tech/20210122 Why KubeEdge is my favorite open source project of 2020.md +++ /dev/null @@ -1,123 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why KubeEdge is my favorite open source project of 2020) -[#]: via: (https://opensource.com/article/21/1/kubeedge) -[#]: author: (Mike Calizo https://opensource.com/users/mcalizo) - -Why KubeEdge is my favorite open source project of 2020 -====== -KubeEdge is a workload framework for edge computing. -![Tips and gears turning][1] - -I believe [edge computing][2], which "brings computation and data storage closer to the location where it is needed to improve response times and save bandwidth," is the next major phase of technology adoption. The widespread use of mobile devices and wearable gadgets and the availability of free city-wide WiFi in some areas create a lot of data that can provide many advantages if used properly. For example, this data can help people fight crime, learn about nearby activities and events, find the best sale price, avoid traffic, and so on. - -[Gartner][3] says the rapid growth in mobile application adoption requires an edge infrastructure to use the data from these devices to further progress and improve quality of life. Some of the brightest minds are looking for ways to use the rich data generated from our mobile devices. Take the COVID-19 pandemic, for example. Edge computing can gather data that can help fight the spread of the virus. In the future, mobile devices might warn people about the potential for community infection by providing live updates to their devices based on processing and serving data collected from other devices (using artificial intelligence and machine learning). - -In defining an edge-computing architecture, one thing is constant: The platform must be flexible and scalable to deploy a smart or intelligent application on it and in your core data center. As an open source advocate and user, this naturally triggers my interest in using open source technology to harness the power of edge computing. - -This is why [KubeEdge][4], which delivers container orchestration to resource-constrained environments, is my favorite open source project of 2020. This extremely lightweight but fully compliant Kubernetes distribution was created to run cloud-native workloads in Internet of Things (IoT) devices at the network's edge. - -![Edge computing architecture][5] - -(Michael Calizo, [CC BY-SA 4.0][6]) - -### Challenges of collecting and consuming data - -Having a rich data source does not mean anything if the data isn't used properly. This is the dilemma that edge computing is trying to solve. To be able to use data properly, the platform must be flexible enough to handle the demand required to collect, process, and serve data and make smart decisions about whether the data can be processed at the edge or must be processed in a regional or core data center. - -The challenges when moving data from the edge location to a core data center include: - - * Network reliability - * Security - * Resource constraints - * Autonomy - - - -A Kubernetes platform on the edge, such as KubeEdge, meets these requirements, as it provides the scalability, flexibility, and security needed to perform data collection, processing, and serving. KubeEdge is open source, lightweight, and easy to deploy, has low resource requirements, and provides everything you need. - -### KubeEdge's architecture - -KubeEdge was [introduced in 2018][7] at KubeCon in Seattle. In 2019, it was accepted as a Cloud Native Computing Foundation (CNCF) sandbox project, which gives it wider public visibility and puts it on the way to becoming a full-fledged CNCF-sanctioned project. - -![KubeEdge architecture][8] - -(©2019 [The New Stack][9]) - -In a nutshell, KubeEdge has two main components or parts: Cloud and Edge. - -#### Cloud - -The Cloud part is where the Kubernetes Master components, the EdgeController, and edge CloudHub reside. - - * **CloudHub** is a communication interface module in the Cloud component. It acts as a caching mechanism to ensure changes in the Cloud part are sent to the Edge caching mechanism (EdgeHub). - * The **EdgeController** manages the edge nodes and performs reconciliation between edge nodes. - - - -#### Edge - -The Edge part is where edge nodes are found. The most important Edge components are: - - * **EdgeHub** is a communication interface module to the Cloud component. - * **Edged** does the kubelet's job, including managing pod lifecycles and other related kubelet jobs on the nodes. - * **MetaManager** makes sure that all node-level metadata is persistent. - * **DeviceTwin** is responsible for syncing devices between the Cloud and the Edge components. - * **EventBus** handles the internal edge communications using Message Queuing Telemetry Transport (MQTT). - - - -### Kubernetes for edge computing - -Kubernetes has become the gold standard for orchestrating containerized workloads on premises and in public clouds. This is why I think KubeEdge is the perfect solution for using edge computing to reap the benefits of the data that mobile technology generates. - -The KubeEdge architecture allows autonomy on an edge computing layer, which solves network latency and velocity problems. This enables you to manage and orchestrate containers in a core data center as well as manage millions of mobile devices through an autonomous edge computing layer. This is possible because of how KubeEdge uses a combination of the message bus (in the Cloud and Edge components) and the Edge component's data store to allow the edge node to be independent. Through caching, data is synchronized with the local datastore every time a handshake happens. Similar principles are applied to edge devices that require persistency. - -KubeEdge handles machine-to-machine (M2M) communication differently from other edge platform solutions. KubeEdge uses [Eclipse Mosquitto][10], a popular open source MQTT broker from the Eclipse Foundation. Mosquitto enables WebSocket communication between the edge and the master nodes. Most importantly, Mosquitto allows developers to author custom logic and enable resource-constrained device communication at the edge. - -**[Read next: [How to explain edge computing in plain terms][11]]** - -Security is a must for M2M communication; it is the only way you can trust sensitive data sent through the web. Currently, KubeEdge supports Secure Production Identity Framework for Everyone ([SPIFFE][12]), ensuring that: - - 1. Only verifiable nodes can join the edge cluster. - 2. Only verifiable workloads can run on the edge nodes. - 3. Short-lived certificates are used with rotation policies. - - - -### Where KubeEdge is heading - -KubeEdge is in the very early stage of adoption, but it is gaining popularity due to its flexible approach to making edge computing communications secure, reliable, and autonomous so that they won't be affected by network latency. - -KubeEdge is a flexible, vendor-neutral, lightweight, heterogeneous edge computing platform. This enables it to support use cases such as data analysis, video analytics, machine learning, and more. Because it is vendor-neutral, KubeEdge allows big cloud players to use it. - -These are the reasons why KubeEdge is my favorite project of 2020. There is much more to come, and I expect to see more contributions from the community for wider adoption. I am excited about its future of enabling us to consume available data and use it for the greater good. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/kubeedge - -作者:[Mike Calizo][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mcalizo -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) -[2]: https://en.wikipedia.org/wiki/Edge_computing -[3]: https://www.gartner.com/smarterwithgartner/what-edge-computing-means-for-infrastructure-and-operations-leaders/ -[4]: https://kubeedge.io/en/ -[5]: https://opensource.com/sites/default/files/uploads/edgecomputing.png (Edge computing architecture) -[6]: https://creativecommons.org/licenses/by-sa/4.0/ -[7]: https://www.youtube.com/watch?v=nWFkxuRvZ7U&feature=youtu.be&t=1755 -[8]: https://opensource.com/sites/default/files/uploads/kubeedge-architecture.png (KubeEdge architecture) -[9]: https://thenewstack.io/kubeedge-extends-the-power-of-kubernetes-to-the-edge/ -[10]: https://mosquitto.org/ -[11]: https://enterprisersproject.com/article/2019/7/edge-computing-explained-plain-english -[12]: https://spiffe.io/ diff --git a/sources/tech/20210126 Automate setup and delivery for virtual machines in the cloud.md b/sources/tech/20210126 Automate setup and delivery for virtual machines in the cloud.md deleted file mode 100644 index 65f7fe07e8..0000000000 --- a/sources/tech/20210126 Automate setup and delivery for virtual machines in the cloud.md +++ /dev/null @@ -1,174 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Automate setup and delivery for virtual machines in the cloud) -[#]: via: (https://opensource.com/article/21/1/testcloud-virtual-machines) -[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) - -Automate setup and delivery for virtual machines in the cloud -====== -Get a cloud image ready in minutes by using Testcloud to automate the -setup process and deliver a VM ready to run. -![Looking at a map][1] - -If you're a developer or hobbyist using a Fedora [qcow2 image][2] for the cloud, you always have to do a bunch of initial configuration before an image is ready to use. I know this all too well, and I was eager to find a way to make the setup process simpler. As it happens, the entire Fedora quality assurance team feels the same way, so we developed [Testcloud][3]. - -Testcloud is a tool that makes it easy to get a cloud image ready for testing in minutes. It automates the setup process and delivers a virtual machine (VM) ready to run on the cloud with just a few commands.  - -Testcloud: - - 1. Downloads the qcow2 image - 2. Creates the instance with the name of your choice - 3. Creates a user named `fedora` with the password of `passw0rd` - 4. Assigns an IP, which you can later use to secure shell (SSH) into the cloud - 5. Starts, stops, removes, and lists an instance - - - -### Install Testcloud - -To start your journey, you first must install the Testcloud package. You can install it from a terminal or through the software application. In both cases, the package name is `testcloud`. Install with: - - -``` -`$ sudo dnf install testcloud -y` -``` - -Once the installation is complete, add your desired user to the `testcloud` group, which helps Testcloud automate the rest of the process. Execute these two commands to add your user to the `testcloud` group and restart the session with the updated group privileges: - - -``` -$ sudo usermod -a -G testcloud $USER -$ su - $USER -``` - -![Add user to testcloud group][4] - -(Sumantro Mukherjee, [CC BY-SA 4.0][5]) - -### Spin cloud images like a pro - -Once your user has the required group permissions, create an instance: - - -``` -`$ testcloud instance create -u ` -``` - -Alternatively, you can use `fedora:latest/fedora:XX` (where `XX` is your Fedora release) instead of the full URL: - - -``` -`$ testcloud instance create -u fedora:latest` -``` - -This returns the IP address of your VM: - - -``` -$ testcloud instance create testcloud272593 -u   -[...] -INFO:Successfully booted instance testcloud272593 -The IP of vm testcloud272593:  192.168.122.202 -\------------------------------------------------------------ -To connect to the VM, use the following command (password is 'passw0rd'): -ssh fedora@192.168.122.202 -\------------------------------------------------------------ -``` - -You can log in as the default user `fedora` with the password `passw0rd` (note the zero). You can get to the VM with `ssh`, `virt-manager`, or any other method that supports connecting to libvirt machines. - -Another simple way to create a Fedora cloud is: - - -``` -$ testcloud instance create testcloud193 -u fedora:33 -  -WARNING:Not proceeding with backingstore cleanup because there are some testcloud instances running. -You can fix this by following command(s): -testcloud instance stop testcloud272593 - -DEBUG:Local downloads will be stored in /var/lib/testcloud/backingstores. -DEBUG:successfully changed SELinux context for image /var/lib/testcloud/backingstores/Fedora-Cloud-Base-33-1.2.x86_64.qcow2 -DEBUG:Creating instance directories -DEBUG:creating seed image /var/lib/testcloud/instances/testcloud193/testcloud193-seed.img -INFO:Seed image generated successfully -INFO:Successfully booted instance testcloud193 -The IP of vm testcloud193:  192.168.122.225 -\------------------------------------------------------------ -To connect to the VM, use the following command (password is 'passw0rd'): -ssh fedora@192.168.122.225 -\------------------------------------------------------------ -``` - -### Play with instances - -Testcloud can be used to administer instances. This includes activities such as listing images or stopping and starting an instance. - -To list instances, use the `list` subcommand: - - -``` -$ testcloud instance list                 -Name                            IP                      State     -\------------------------------------------------------------ -testcloud272593                 192.168.122.202         running     -testcloud193                    192.168.122.225         running     -testcloud252793                 192.168.122.146         shutoff     -testcloud93                             192.168.122.152         shutoff -``` - -To stop a running instance: - - -``` -$ testcloud instance stop testcloud193   -DEBUG:stop instance: testcloud193 -DEBUG:stopping instance testcloud193. -``` - -To remove an instance: - - -``` -$ testcloud instance destroy testcloud193   -DEBUG:remove instance: testcloud193 -DEBUG:removing instance testcloud193 from libvirt. -DEBUG:Unregistering instance from libvirt. -DEBUG:removing instance /var/lib/testcloud/instances/testcloud193 from disk -``` - -To reboot a running instance: - - -``` -$ testcloud instance reboot testcloud93                                                                                         -DEBUG:stop instance: testcloud93 -[...] -INFO:Successfully booted instance testcloud93 -The IP of vm testcloud93:  192.168.122.152 -usage: testcloud [-h] {instance,image} ... -``` - -Give Testcloud a try and let me know what you think in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/testcloud-virtual-machines - -作者:[Sumantro Mukherjee][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/sumantro -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png?itok=L0BQHgjr (Looking at a map) -[2]: https://en.wikipedia.org/wiki/Qcow -[3]: https://pagure.io/testcloud -[4]: https://opensource.com/sites/default/files/uploads/adduser.png (Add user to testcloud group) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/sources/tech/20210207 3 ways to play video games on Linux.md b/sources/tech/20210207 3 ways to play video games on Linux.md index 1c132ab588..e01c4b2e77 100644 --- a/sources/tech/20210207 3 ways to play video games on Linux.md +++ b/sources/tech/20210207 3 ways to play video games on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (godgithubf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) 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 index d671e6cbf2..6e11979896 100644 --- 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 @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (hanszhao80) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -67,7 +67,7 @@ via: https://opensource.com/article/21/2/linux-skrooge 作者:[Seth Kenlon][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/20210211 31 open source text editors you need to try.md b/sources/tech/20210211 31 open source text editors you need to try.md deleted file mode 100644 index d9ca620bf4..0000000000 --- a/sources/tech/20210211 31 open source text editors you need to try.md +++ /dev/null @@ -1,182 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (31 open source text editors you need to try) -[#]: via: (https://opensource.com/article/21/2/open-source-text-editors) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -31 open source text editors you need to try -====== -Looking for a new text editor? Here are 31 options to consider. -![open source button on keyboard][1] - -Computers are text-based, so the more things you do with them, the more you find yourself needing a text-editing application. And the more time you spend in a text editor, the more likely you are to demand more from whatever you use. - -If you're looking for a good text editor, you'll find that Linux has plenty to offer. Whether you want to work in the terminal, on your desktop, or in the cloud, you can literally try a different editor every day for a month (or one a month for almost three years) in your relentless search for the perfect typing experience. - -### Vim-like editors - -![][2] - - * [Vi][3] ships with every Linux, BSD, Solaris, and macOS installation. It's the quintessential Unix text editor, with its unique combination of editing modes and super-efficient single-key shortcuts. The original Vi editor was an application written by Bill Joy, creator of the C shell. Modern incarnations of Vi, most notably Vim, have added many features, including multiple levels of undo, better navigation while in insert mode, line folding, syntax highlighting, plugin support, and much more. It takes practice (it even has its own tutor application, vimtutor.) - * [Kakoune][4] is a Vim-inspired application with a familiar, minimalistic interface, short keyboard shortcuts, and separate editing and insert modes. It looks and feels a lot like Vi at first, but with its own unique style, both in design and function. As a special bonus, it features an implementation of the Clippy interface. - - - -### emacs editors - -![][5] - - * The original free emacs, and one of the first official applications of the GNU project that started the Free Software movement, [GNU Emacs][6] is a wildly popular text editor. It's great for sysadmins, developers, and everyday users alike, with loads of features and seemingly endless extensions. Once you start using Emacs, you might find it difficult to think of a reason to close it because it's just that versatile! - * If you like Emacs but find GNU Emacs too bloated, then you might like [Jove][7]. Jove is a terminal-based emacs editor. It's easy to use, but if you're new to emacsen (the plural of emacs), Jove is also easy to learn, thanks to the teachjove command. - * Another lightweight emacs editor, [Jed][8] is a simple incarnation of a macro-based workflow. One thing that sets it apart from other editors is its use of [S-Lang][9], a C-like scripting language providing extensibility options to developers more comfortable with C than with Lisp. - - - -### Interactive editors - -![][10] - - * [GNU nano][11] takes a bold stance on terminal-based text editing: it provides a menu. Yes, this humble editor takes a cue from GUI editors by telling the user exactly which key they need to press to perform a specific function. This is a refreshing take on user experience, so it's no wonder that it's nano, not Vi, that's set as the default editor for "user-friendly" distributions. - * [JOE][12] is based on an old text-editing application called WordStar. If you're not familiar with Wordstar, JOE can also mimic Emacs or GNU nano. By default, it's a good compromise between something relatively mysterious like Emacs or Vi and the always-on verbosity of GNU Nano (for example, it tells you how to activate an onscreen help display, but it's not on by default). - * The excellent [e3][13] application is a tiny text editor with five built-in keyboard shortcut schemes to emulate Emacs, Vi, nano, NEdit, and WordStar. In other words, no matter what terminal-based editor you are used to, you're likely to feel right at home with e3. - - - -### ed and more - - * The [ed][14] line editor is part of the [POSIX][15] and Open Group's standard definition of a Unix-based operating system. You can count on it being installed on nearly every Linux or Unix system you'll ever encounter. It's tiny, terse, and tip-top. - * Building upon ed, the [Sed][16] stream editor is popular both for its functionality and its syntax. Most Linux users learn at least one sed command when searching for the easiest and fastest way to update a line in a config file, but it's worth taking a closer look. Sed is a powerful command with lots of useful subcommands. Get to know it better, and you may find yourself open text editor applications a lot less frequently. - * You don't always need a text editor to edit text. The [heredoc][17] (or Here Doc) system, available in any POSIX terminal, allows you to type text directly into your open terminal and then pipes what you type into a text file. It's not the most robust editing experience, but it is versatile and always available. - - - -### Minimalist editors - -![][18] - -If your idea of a good text editor is a word processor except without all the processing, you're probably looking for one of these classics. These editors let you write and edit text with minimal interference and minimal assistance. What features they do offer are often centered around markup, Markdown, or code. Some have names that follow a certain pattern: - - * [Gedit][19] from the GNOME team - * [medit][20] for a classic GNOME feel - * [Xedit][21] uses only the most basic X11 libraries - * [jEdit][22] for Java aficionados - - - -A similar experience is available for KDE users: - - * [Kate][23] is an unassuming editor with all the features you need. - * [KWrite][24] hides a ton of useful features in a deceptively simple, easy-to-use interface. - - - -And there are a few for other platforms: - - * [Notepad++][25] is a popular Windows application, while Notepadqq takes a similar approach for Linux. - * [Pe][26] is for Haiku OS (the reincarnation of that quirky child of the '90s, BeOS). - * [FeatherPad][27] is a basic editor for Linux but with some support for macOS and Haiku. If you're a Qt hacker looking to port code, take a look! - - - -### IDEs - -![][28] - -There's quite a crossover between text editors and integrated development environments (IDEs). The latter really is just the former with lots of code-specific features added on. If you use an IDE regularly, you might find an XML or Markdown editor lurking in your extension manager: - - * [NetBeans][29] is a handy text editor for Java users. - * [Eclipse][30] offers a robust editing suite with lots of extensions to give you the tools you need. - - - -### Cloud-based editors - -![][31] - -Working in the cloud? You can write there too, you know. - - * [Etherpad][32] is a text editor app that runs on the web. There are free and independent instances for you to use, or you can set up your own. - * [Nextcloud][33] has a thriving app scene and includes both a built-in text editor and a third-party Markdown editor with live preview. - - - -### Newer editors - -![][34] - -Everybody has an idea about what makes a text editor perfect. For that reason, new editors are released each year. Some reimplement classic old ideas in a new and exciting way, some have unique takes on the user experience, and some focus on specific needs. - - * [Atom][35] is an all-purpose modern text editor from GitHub featuring lots of extensions and Git integration. - * [Brackets][36] is an editor from Adobe for web developers. - * [Focuswriter][37] seeks to help you focus on writing with helpful features like a distraction-free fullscreen mode, optional typewriter sound effects, and beautiful configuration options. - * [Howl][38] is a progressive, dynamic editor based on Lua and Moonscript. - * [Norka][39] and [KJots][40] mimic a notebook with each document representing a "page" in your "binder." You can take individual pages out of your notebook through export functions. - - - -### DIY editor - -![][41] - -As the saying does _NOT_ go: Why use somebody else's application when you can write your own? Linux has over 30 text editors available, so probably the last thing it really needs is another one. Then again, part of the fun of open source is the ability to experiment. - -If you're looking for an excuse to learn how to program, making your own text editor is a great way to get started. You can achieve the basics in about 100 lines of code, and the more you use it, the more you'll be inspired to learn more so you can make improvements. Ready to get started? Go and [create your own text editor][42]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/2/open-source-text-editors - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx (open source button on keyboard) -[2]: https://opensource.com/sites/default/files/kakoune-screenshot.png -[3]: https://opensource.com/article/20/12/vi-text-editor -[4]: https://opensource.com/article/20/12/kakoune -[5]: https://opensource.com/sites/default/files/jed.png -[6]: https://opensource.com/article/20/12/emacs -[7]: https://opensource.com/article/20/12/jove-emacs -[8]: https://opensource.com/article/20/12/jed -[9]: https://www.jedsoft.org/slang -[10]: https://opensource.com/sites/default/files/uploads/nano-31_days-nano-opensource.png -[11]: https://opensource.com/article/20/12/gnu-nano -[12]: https://opensource.com/article/20/12/31-days-text-editors-joe -[13]: https://opensource.com/article/20/12/e3-linux -[14]: https://opensource.com/article/20/12/gnu-ed -[15]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains -[16]: https://opensource.com/article/20/12/sed -[17]: https://opensource.com/article/20/12/heredoc -[18]: https://opensource.com/sites/default/files/uploads/gedit-31_days_gedit-opensource.jpg -[19]: https://opensource.com/article/20/12/gedit -[20]: https://opensource.com/article/20/12/medit -[21]: https://opensource.com/article/20/12/xedit -[22]: https://opensource.com/article/20/12/jedit -[23]: https://opensource.com/article/20/12/kate-text-editor -[24]: https://opensource.com/article/20/12/kwrite-kde-plasma -[25]: https://opensource.com/article/20/12/notepad-text-editor -[26]: https://opensource.com/article/20/12/31-days-text-editors-pe -[27]: https://opensource.com/article/20/12/featherpad -[28]: https://opensource.com/sites/default/files/uploads/eclipse-31_days-eclipse-opensource.png -[29]: https://opensource.com/article/20/12/netbeans -[30]: https://opensource.com/article/20/12/eclipse -[31]: https://opensource.com/sites/default/files/uploads/etherpad_0.jpg -[32]: https://opensource.com/article/20/12/etherpad -[33]: https://opensource.com/article/20/12/31-days-text-editors-nextcloud-markdown-editor -[34]: https://opensource.com/sites/default/files/uploads/atom-31_days-atom-opensource.png -[35]: https://opensource.com/article/20/12/atom -[36]: https://opensource.com/article/20/12/brackets -[37]: https://opensource.com/article/20/12/focuswriter -[38]: https://opensource.com/article/20/12/howl -[39]: https://opensource.com/article/20/12/norka -[40]: https://opensource.com/article/20/12/kjots -[41]: https://opensource.com/sites/default/files/uploads/this-time-its-personal-31_days_yourself-opensource.png -[42]: https://opensource.com/article/20/12/31-days-text-editors-one-you-write-yourself diff --git a/sources/tech/20210211 What-s new with ownCloud in 2021.md b/sources/tech/20210211 What-s new with ownCloud in 2021.md deleted file mode 100644 index aa6507c932..0000000000 --- a/sources/tech/20210211 What-s new with ownCloud in 2021.md +++ /dev/null @@ -1,180 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What's new with ownCloud in 2021?) -[#]: via: (https://opensource.com/article/21/2/owncloud) -[#]: author: (Martin Loschwitz https://opensource.com/users/martinloschwitzorg) - -What's new with ownCloud in 2021? -====== -The open source file sharing and syncing platform gets a total overhaul -based on Go and Vue.js and eliminates the need for a database. -![clouds in the sky with blue pattern][1] - -The newest version of ownCloud, [ownCloud Infinite Scale][2] (OCIS), is a complete rewrite of the venerable open source enterprise file sharing and syncing software stack. It features a new backend written in Go, a frontend in Vue.js, and many changes, including eliminating the need for a database. This scalable, modular approach replaces ownCloud's PHP, database, and [POSIX][3] filesystem and promises up to 10 times better performance. - -Traditionally, ownCloud was centered around the idea of having a POSIX-compatible filesystem to store data uploaded by users—different versions of the data and trash files, as well as configuration files and logs. By default, an ownCloud user's files were found in a path on their ownCloud instance, like `/var/www` or `/srv/www` (a web server's document root). - -Every admin who has maintained an ownCloud instance knows that they grow massive; today, they usually start out much larger than ownCloud was originally designed for. One of the largest ownCloud instances is Australia's Academic and Research Network (AARNet), a company that stores more than 100,000 users' data. - -### Let's 'Go' for microservices - -ownCloud's developers determined that rewriting the codebase with [Go][4] could bring many advantages over PHP. Even when computer programs appear to be one monolithic piece of code, most are split into different components internally. The web servers that are usually deployed with ownCloud (such as Apache) are an excellent example. Internally, one function handles TCP/IP connections, another function might handle SSL, and yet another piece of code executes the requested PHP files and delivers the results to the end user. All of those events must happen in a certain order. - -ownCloud's developers wanted the new version to serve multiple steps concurrently so that events can happen simultaneously. Software capable of handling requests in parallel doesn't have to wait around for one process to finish before the next can begin, so they can deliver results faster. Concurrency is one of the reasons Go is so popular in containerized micro-architecture applications. - -With OCIS, ownCloud is adapting to an architecture centered around the principle of microservices. OCIS is split into three tiers: storage, core, and frontend. I'll look at each of these tiers, but the only thing that really matters to people is overall performance. Users don't think about software in tiers; they just want the software to work well and work quickly. - -### Tier 1: Storage - -The storage available to the system is ownCloud's lowest tier. Performance also brings scalability; large ownCloud instances must be able to cope with the load of thousands of clients and add additional disk space if the existing storage fills up. - -Like so many other concepts today, object stores and scalable storage weren't available when ownCloud was designed. Administrators now are used to having more choices, so ownCloud permits outsourcing physical storage device handling to an external solution. While S3-based object storage, Samba-based storage, and POSIX-compatible filesystem options are still supported in OCIS, the preferred way to deploy it is with [Earth Observing System][5] (EOS) storage. - -#### EOS to the rescue - -EOS is optimized for very low latency when accessing files. It provides disk-based storage to clients through the [XRootD][6] framework but also permits other protocols to access files. ownCloud uses EOS's HTTP protocol extension to talk to the storage solution (using the HTTPS protocol). EOS also allows almost "infinite" scalability. For instance, [CERN's EOS setup][7] includes more than 200PB of disk storage and continues to grow. - -By choosing EOS, ownCloud eliminated several shortcomings of traditional storage solutions: - - * EOS doesn't have a typical single point of failure. - * All relevant services are run redundantly, including the ability to scale out and add instances of all existing services. - * EOS promises to never run out of actual disk space and comes with built-in redundancy for stored data. - - - -For large environments, ownCloud expects the administrator to deploy an EOS instance with OCIS. In exchange for the burden of maintaining a separate storage system, the admin gets the benefit of not having to worry about the OCIS instance's scalability and performance. - -#### What about small setups? - -This hints at ownCloud's assumed use case for OCIS: It's no longer a small business all-in-one server nor a small home server. ownCloud's strategy with OCIS targets large data centers. For small or home office setups, EOS is likely to be excessive and overly demanding for a single admin to manage. OCIS serves small setups through the [Reva][8] framework, which enables support for S3, Samba, and even POSIX-compatible filesystems. This is possible because EOS is not hardcoded into OCIS. Reva can't provide the same feature set as EOS, but it accomplishes most of the needs of end users and small installations. - -### Tier 2: Core - -OCIS's second tier is (due to Go) more of a collection of microservices than a singular core. Each one is responsible for handling a single task in the background (e.g., scanning for viruses). Basically, all of OCIS's functionality results from a specific microservice's work, like authenticating requests using OpenID Connect against an identity provider. In the end, that makes it a simple task to connect existing user directories—such as Active Directory Federation Services (ADFS), Azure AD, or Lightweight Directory Access Protocol (LDAP)—to ownCloud. For those that do not have an existing identity provider, ownCloud ships its own instance, effectively making ownCloud maintain its own user database. - -### Tier 3: Frontend - -OCIS's third tier, the frontend, is what the vendor calls ownCloud Web. It's a complete rewrite of the user interface and is based on the Vue.js JavaScript framework. Like the OCIS core, the web frontend is written based on microservices principles and hence allows better performance and scalability. The developers also used the opportunity to give the web interface a makeover; compared to previous ownCloud versions, the OCIS web interface looks smaller and slicker. - -OCIS's developers did an impressive job complying with modern software design principles. The fundamental problem in building applications according to the microservices approach is making the environment's individual components communicate with each other. APIs can come to the rescue, but that means every micro component must have its own well-defined API interface. - -Luckily, there are existing tools to take that burden off developers' shoulders, most notably [gRPC][9]. The idea behind gRPC is to have a set of predefined APIs that trigger actions in one component from within another. - -### Other notable design changes - -#### Tackling network traffic with Traefik - -This new application design brings some challenges to the underlying network. OCIS's developers chose the [Traefik][10] framework to tackle them. Traefik automatically load-balances different instances of microservices, manages automated SSL encryption, and allows additional deployments of firewall rules. - -The split between the backend and the frontend add advantages to OCIS. In fact, the user's actions triggered through ownCloud Web are completely decoupled from the ownCloud engine performing the task in the backend. If a user manually starts a virus check on files stored in ownCloud, they don't have to wait for the check to finish. Instead, the check happens in the background, and the user sees the results after the check is completed. This is the principle of concurrency at work. - -#### Extensions as microservices - -Like other web services, ownCloud supports extending its capabilities through extensions. OCIS doesn't change this, but it promises to tackle a well-known problem, especially with community apps. Apps of unknown origin can cause trouble in the server, hamper updates, and negatively impact the server's overall performance. - -OCIS's new, gRPC-based architecture makes it much easier to create extensions alongside existing microservices. Because the API is predefined by gRPC, developers merely need to create a microservice featuring the desired functionality that can be controlled by gRPC. Traefik, on a per-case basis, ensures that newly deployed add-ons are automatically added to the existing communication mesh. - -#### Goodbye, MySQL! - -ownCloud's switch to gRPC and microservices eliminates the need for a relational database. Instead, components that need to store metadata do it on their own. Due to Reva and the lack of a MySQL dependency, the complexity of running ownCloud in small environments is reduced considerably—an especially welcome bonus for maintainers of large-scale data centers, but nice for admins of any size installation. - -### Getting OCIS up and running - -ownCloud published a technical preview of OCIS 1.0 in December 2020, [shipping it][11] as a Docker container and binaries. More examples of getting it running are linked in the deployment section of its [GitHub repository][12]. - -#### Install with Docker - -Getting OCIS up and running with Docker containers is easy, although things can get complicated if you're new to EOS. Docker images for OCIS are available on [Docker Hub][13]. Look for the Latest tag for the current master branch. - -Any standard virtual machine from one of the big cloud providers or any entry-level server in a data center that uses a standard Linux distribution should be sufficient, provided the system has a container runtime installed. - -Assuming you have Docker or Podman installed, the command to start OCIS is simple: - - -``` -`$ docker run --rm -ti -p 9200:9200 owncloud/ocis` -``` - -That's it! OCIS is now waiting at your service on localhost port 9200. Open a web browser and navigate to `http://localhost:9200` to check it out. - -The demo accounts and passwords are `einstein:relativity`, `marie:radioactivity`, and `richard:superfluidity`. Admin accounts are `moss:vista` and `admin:admin`. If OCIS runs on a server with a resolvable hostname, it can request an SSL certificate from Let's Encrypt using Traefik. - -![OCIS contains no files at first login][14] - -(Martin Loschwitz, [CC BY-SA 4.0][15]) - -![OCIS user management interface][16] - -(Martin Loschwitz, [CC BY-SA 4.0][15]) - -#### Install with binary - -As an alternative to Docker, there also is a pre-compiled binary available. Thanks to Go, users can [download the latest binaries][17] from the Master branch. - -OCIS's binary edition expects `/var/tmp/ocis` as the default storage location, but you can change that in its configuration. You can start the OCIS server with: - - -``` -`$ ./ocis server` -``` - -Here are some of the subcommands available through the `ocis` binary: - - * `ocis health` runs a health check. A result greater than 0 indicates an error. - * `ocis list` prints all running OCIS extensions. - * `ocis run foo` starts a particular extension (`foo`, in this example). - * `ocis kill foo` stops a particular extension (`foo`, in this example). - * `ocis --help` prints a help message. - - - -The project's GitHub repository contains full [documentation][11]. - -### Setting up EOS (it's complicated) - -Following ownCloud's recommendations to deploy OCIS with EOS for large environments requires some additional steps. EOS not only adds required hardware and increases the whole environment's complexity, but it's also a slightly bigger task to set it up. CERN provides concise [EOS documentation][18] (linked from its [GitHub repository][19]), and ownCloud offers a [step-by-step guide][20]. - -In a nutshell, users have to get and start EOS and OCIS containers; configure LDAP support; and kill home, users', and metadata storage before starting them with the EOS configuration. Last but not least, the accounts service needs to be set up to work with EOS. All of these steps are "docker-compose" commands documented in the GitHub repository. The Storage Backends page on EOS also provides information on verification, troubleshooting, and a command reference for the built-in EOS shell. - -### Weighing risks and rewards - -ownCloud Infinite Scale is easy to install, faster than ever before, and better prepared for scalability. The modular design, with microservices and APIs (even for its extensions), looks promising. ownCloud is embracing new technology and developing for the future. If you run ownCloud, or if you've been thinking of trying it, there's never been a better time. Keep in mind that this is still a technology preview and is on a rolling release published every three weeks, so please report any bugs you find. - -Jos Poortvliet shares some of his favorite uses for the open source self-hosted storage platform. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/2/owncloud - -作者:[Martin Loschwitz][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/martinloschwitzorg -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_cloud_cc.png?itok=XSV7yR9e (clouds in the sky with blue pattern) -[2]: https://owncloud.com/infinite-scale/ -[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains -[4]: https://golang.org/ -[5]: https://en.wikipedia.org/wiki/Earth_Observing_System -[6]: https://xrootd.slac.stanford.edu/ -[7]: https://eos-web.web.cern.ch/eos-web/ -[8]: https://reva.link/ -[9]: https://en.wikipedia.org/wiki/GRPC -[10]: https://opensource.com/article/20/3/kubernetes-traefik -[11]: https://owncloud.github.io/ocis/getting-started/ -[12]: https://github.com/owncloud/ocis -[13]: https://hub.docker.com/r/owncloud/ocis -[14]: https://opensource.com/sites/default/files/uploads/ocis5.png (OCIS contains no files at first login) -[15]: https://creativecommons.org/licenses/by-sa/4.0/ -[16]: https://opensource.com/sites/default/files/uploads/ocis2.png (OCIS user management interface) -[17]: https://download.owncloud.com/ocis/ocis/ -[18]: https://eos-docs.web.cern.ch/ -[19]: https://github.com/cern-eos/eos -[20]: https://owncloud.github.io/ocis/storage-backends/eos/ diff --git a/sources/tech/20210305 Build a printer UI for Raspberry Pi with XML and Java.md b/sources/tech/20210305 Build a printer UI for Raspberry Pi with XML and Java.md deleted file mode 100644 index 7e9be8dfd0..0000000000 --- a/sources/tech/20210305 Build a printer UI for Raspberry Pi with XML and Java.md +++ /dev/null @@ -1,282 +0,0 @@ -[#]: subject: (Build a printer UI for Raspberry Pi with XML and Java) -[#]: via: (https://opensource.com/article/21/3/raspberry-pi-totalcross) -[#]: author: (Edson Holanda Teixeira Junior https://opensource.com/users/edsonhtj) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Build a printer UI for Raspberry Pi with XML and Java -====== -TotalCross makes it quick to build user interfaces for embedded -applications. -![Tips and gears turning][1] - -Creating a GUI from scratch is a very time consuming process, dealing with all the positions and alignments in hard code can be really tough for some programmers. In this article, I demonstrate how to speed up this process using XML. - -This project uses [TotalCross][2] as the target framework. TotalCross is an open source, cross-platform software development kit (SDK) developed to create GUIs for embedded devices faster. TotalCross provides Java's development benefits without needing to run Java on a device because it uses its own bytecode and virtual machine (TC bytecode and TCVM) for performance enhancement. - -I also use Knowcode-XML, an open source XML parser for the TotalCross framework, which converts XML files into TotalCross components. - -### Project requirements - -To reproduce this project, you need: - - * [KnowCode-XML][3] - * [VSCode][4] [or VSCodium][5] - * [An Android development environment][6] - * [TotalCross plugin for VSCode][7] - * Java 11 or greater for your development platform ([Linux][8], [Mac][9], or [Windows][10]) - * [Git][11] - - - -### Building the embedded application - -This application consists of an embedded GUI with basic print functionalities, such as scan, print, and copy. - -![printer init screen][12] - -(Edson Holanda Teixeira Jr, [CC BY-SA 4.0][13]) - -Several steps are required to create this GUI, including generating the GUI with Android-XML and then using the Knowcode-XML parser to run it on the TotalCross Framework. - -#### 1\. Generate the Android XML - -For creating the XML file, first create a simple Android screen, and then customize it. If you don't know how to write Android-XM, or you just want a headstart, you can download this application’s XML from this [GitHub project][14]. This project also contains the images you need to render the GUI. - -#### 2\. Adjust the XML - -After generating the XML files, you need to make some fine adjustments to make sure everything is aligned, with the right proportions, and has the correct path to the images. - -Add the XML layouts to the **Layouts** folder and all the assets to the **Drawable** folder. Then you can start to customize the XML. - -For example, if you want to change an XML object's background, change the `android:background` attribute: - - -``` -`android:background="@drawable/scan"` -``` - -You can change the object's position with `tools:layout_editor_absoluteX` and `tools:layout_editor_absoluteY`: - - -``` -tools:layout_editor_absoluteX="830dp" -tools:layout_editor_absoluteY="511dp" -``` - -Change the object's size with `android:layout_width` and `android:layout_height`: - - -``` -android:layout_width="70dp" -android:layout_height="70dp" -``` - -If you want to put text on an object, you can use `android:textSize`, `android:text`, `android:textStyle`, and `android:textColor`: - - -``` -android:textStyle="bold" -android:textColor="#000000" -android:textSize="20dp" -android:text="2:45PM" -``` - -Here is an example of a complete XML object: - - -``` -    <ImageButton -           android:id="@+id/ImageButton" -           android:layout_width="70dp" -           android:layout_height="70dp" -           tools:layout_editor_absoluteX="830dp" -           tools:layout_editor_absoluteY="511dp" -           android:background="@drawable/home_config" /> -``` - -#### 3\. Run the GUI on TotalCross - -After you make all the XML adjustments, it's time to run it on TotalCross. Create a new project on the TotalCross extension and add the **XML** and **Drawable** folders to the **Main** folder. If you're not sure how to create a TotalCross project, see our [get started guide][15]. - -After configuring the environment, use `totalcross.knowcode.parse.XmlContainerFactory` and `import totalcross.knowcode.parse.XmlContainerLayout` to use the XML GUI on the TotalCross framework. You can find more information about using KnowCode-XML on its [GitHub page][3]. - -#### 4\. Add transitions - -This project's smooth transition effect is created by the `SlidingNavigator` class, which uses TotalCross' `ControlAnimation` class to slide from one screen to the other. - -Call `SlidingNavigator` on the `XMLpresenter` class: - - -``` -`new SlidingNavigator(this).present(HomePresenter.class);` -``` - -Implement the `present` function on the `SlidingNavigator` class: - - -``` -public void present(Class<? extends XMLPresenter> presenterClass) -         throws [InstantiationException][16], [IllegalAccessException][17] { -      final XMLPresenter presenter = cache.containsKey(presenterClass) ? cache.get(presenterClass) -            : presenterClass.newInstance(); -      if (!cache.containsKey(presenterClass)) { -         cache.put(presenterClass, presenter); -      } - -      if (presenters.isEmpty()) { -         window.add(presenter.content, LEFT, TOP, FILL, FILL); -      } else { -         XMLPresenter previous = presenters.lastElement(); - -         window.add(presenter.content, AFTER, TOP, SCREENSIZE, SCREENSIZE, previous.content); -``` - -`PathAnimation` in animation control creates the sliding animation from one screen to another: - - -``` -         PathAnimation.create(previous.content, -Settings.screenWidth, 0, new ControlAnimation.AnimationFinished() { -            @Override -            public void onAnimationFinished(ControlAnimation anim) { -               window.remove(previous.content); -            } -         }, 1000).with(PathAnimation.create(presenter.content, 0, 0, new ControlAnimation.AnimationFinished() { -            @Override -            public void onAnimation Finished(Control Animation anim) { -               presenter.content.setRect(LEFT, TOP, FILL, FILL); -            } -         }, 1000)).start(); -      } -      presenter.setNavigator(this); -      presenters.push(presenter); -      presenter.bind2(); -      if (presenter.isFirstPresent) { -         presenter.onPresent(); -         presenter.isFirstPresent = false; -      } -``` - -#### 5\. Load spinners - -Another nice feature in the printer application is the loading screen animation that shows progress. It includes text and a spinning animation. - -![Loading Spinner][18] - -(Edson Holanda Teixeira Jr, [CC BY-SA 4.0][13]) - -Implement this feature by adding a timer and a timer listener to update the progress label, then call the function `spinner.start()`. All of the animations are auto-generated by TotalCross and KnowCode: - - -``` -public void startSpinner() { -        time = content.addTimer(500); -        content.addTimerListener((e) -> { -            try { -                progress(); // Updates the Label -            } catch (InstantiationException | IllegalAccessException e1) { -                // TODO Auto-generated catch block -                e1.printStackTrace(); -            } -        }); -        Spinner spinner = (Spinner) ((XmlContainerLayout) content).getControlByID("@+id/spinner"); -        spinner.start(); -    } -``` - -The spinner is instantiated as a reference to the `XmlContainerLayout` spinner described in the XML file: - - -``` -<ProgressBar -android:id="@+id/spinner" -android:layout_width="362dp" -android:layout_height="358dp" -tools:layout_editor_absoluteX="296dp" -tools:layout_editor_absoluteY="198dp" -   android:indeterminateTint="#2B05C7" -style="?android:attr/progressBarStyle" /> -``` - -#### 6\. Build the application - -It's time to build the application. You can see and change the target systems in `pom.xml`. Make sure the **Linux Arm** target is available. - -If you are using VSCode, press **F1** on the keyboard, select **TotalCross: Package** and wait for the package to finish. Then you can see the installation files in the **Target** folder. - -#### 7\. Deploy and run the application on Raspberry Pi - -To deploy the application on a [Raspberry Pi 4][19] with the SSH protocol, press **F1** on the keyboard. Select **TotalCross: Deploy&Run** and provide information about your SSH connection: User, IP, Password, and Application Path. - -![TotalCross: Deploy&Run][20] - -(Edson Holanda Teixeira Jr, [CC BY-SA 4.0][13]) - -![SSH user][21] - -(Edson Holanda Teixeira Jr, [CC BY-SA 4.0][13]) - -![IP address][22] - -(Edson Holanda Teixeira Jr, [CC BY-SA 4.0][13]) - -![Password][23] - -(Edson Holanda Teixeira Jr, [CC BY-SA 4.0][13]) - -![Path][24] - -(Edson Holanda Teixeira Jr, [CC BY-SA 4.0][13]) - -Here's what the application looks like running on the machine. - -### What's next? - -KnowCode makes it easier to create and manage your application screens using Java. Knowcode-XML translates your XML into a TotalCross GUI that in turn generates the binary to run on your Raspberry Pi. - -Combining KnowCode technology with TotalCross enables you to create embedded applications faster. Find out what else you can do by accessing our [embedded samples][25] on GitHub and editing your own application. - -If you have questions, need help, or just want to interact with other embedded GUI developers, feel free to join our [Telegram][26] group to discuss embedded applications on any framework. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/raspberry-pi-totalcross - -作者:[Edson Holanda Teixeira Junior][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/edsonhtj -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) -[2]: https://opensource.com/article/20/7/totalcross-cross-platform-development -[3]: https://github.com/TotalCross/knowcode-xml -[4]: https://code.visualstudio.com/ -[5]: https://opensource.com/article/20/6/open-source-alternatives-vs-code -[6]: https://developer.android.com/studio -[7]: https://marketplace.visualstudio.com/items?itemName=totalcross.vscode-totalcross -[8]: https://opensource.com/article/19/11/install-java-linux -[9]: https://opensource.com/article/20/7/install-java-mac -[10]: http://adoptopenjdk.net -[11]: https://opensource.com/life/16/7/stumbling-git -[12]: https://opensource.com/sites/default/files/uploads/01_printergui.png (printer init screen) -[13]: https://creativecommons.org/licenses/by-sa/4.0/ -[14]: https://github.com/TotalCross/embedded-samples/tree/main/printer-application/src/main/resources/layout -[15]: https://totalcross.com/get-started/?utm_source=opensource&utm_medium=article&utm_campaign=printer -[16]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+instantiationexception -[17]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+illegalaccessexception -[18]: https://opensource.com/sites/default/files/uploads/03progressspinner.png (Loading Spinner) -[19]: https://www.raspberrypi.org/products/raspberry-pi-4-model-b/ -[20]: https://opensource.com/sites/default/files/uploads/04_totalcross-deployrun.png (TotalCross: Deploy&Run) -[21]: https://opensource.com/sites/default/files/uploads/05_ssh.png (SSH user) -[22]: https://opensource.com/sites/default/files/uploads/06_ip.png (IP address) -[23]: https://opensource.com/sites/default/files/uploads/07_password.png (Password) -[24]: https://opensource.com/sites/default/files/uploads/08_path.png (Path) -[25]: https://github.com/TotalCross/embedded-samples -[26]: https://t.me/totalcrosscommunity diff --git a/sources/tech/20210307 How to Install Nvidia Drivers on Linux Mint -Beginner-s Guide.md b/sources/tech/20210307 How to Install Nvidia Drivers on Linux Mint -Beginner-s Guide.md index 2a9a7650f4..ee23f126fe 100644 --- a/sources/tech/20210307 How to Install Nvidia Drivers on Linux Mint -Beginner-s Guide.md +++ b/sources/tech/20210307 How to Install Nvidia Drivers on Linux Mint -Beginner-s Guide.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/nvidia-linux-mint/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (hwlife) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210310 Troubleshoot WiFi problems with Go and a Raspberry Pi.md b/sources/tech/20210310 Troubleshoot WiFi problems with Go and a Raspberry Pi.md deleted file mode 100644 index 0ad80d4423..0000000000 --- a/sources/tech/20210310 Troubleshoot WiFi problems with Go and a Raspberry Pi.md +++ /dev/null @@ -1,212 +0,0 @@ -[#]: subject: (Troubleshoot WiFi problems with Go and a Raspberry Pi) -[#]: via: (https://opensource.com/article/21/3/troubleshoot-wifi-go-raspberry-pi) -[#]: author: (Chris Collins https://opensource.com/users/clcollins) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Troubleshoot WiFi problems with Go and a Raspberry Pi -====== -Build a WiFi scanner for fun. -![Selfcare, drinking tea on the porch][1] - -Last summer, my wife and I sold everything we owned and moved with our two dogs to Hawaii. It's been everything we thought it would be: beautiful sun, warm sand, cool surf—you name it. We've also run into some things we didn't expect: WiFi problems. - -Now, that's not a Hawaii problem. It's limited to the apartment we are renting. We are living in a single-room studio apartment attached to our landlord's apartment. Part of the rent includes free internet! YAY! However, said internet is provided by the WiFi router in the landlord's apartment. BOO! - -In all honesty, it works OK. Ish. OK, it doesn't work well, and I'm not sure why. The router is literally on the other side of the wall, but our signal is spotty, and we have some trouble staying connected. Back home, our WiFi router's signal crossed through many walls and some floors. Certainly, it covered an area larger than the 600 sq. foot apartment we live in! - -What does a good techie do in such a situation? Why, investigate, of course! - -Luckily the "everything we own" that we sold before moving here did not include our Raspberry Pi Zero W. So small! So portable! Of course, I took it to Hawaii with me. My bright idea was to use the Pi and its built-in WiFi adapter, write a little program in Go to measure the WiFi signal received from the router, and display that output. I'm going to make it super simple, quick, and dirty and worry later about making it better. I just want to know what's up with the WiFi, dang it! - -Hunting around on Google for a minute turns up a relatively useful Go package for working with WiFi, [mdlayher/wifi][2]. Sounds promising! - -### Getting information about the WiFi interfaces - -My plan is to query the WiFi interface statistics and return the signal strength, so I need to find the interfaces on the device. Luckily the mdlayher/wifi package has a method to query them, so I can do that by creating a file named `main.go`: - - -``` -package main - -import ( -        "fmt" - -        "github.com/mdlayher/wifi" -) - -func main() { - -        c, err := wifi.New() -        defer c.Close() - -        if err != nil { -                panic(err) -        } - -        interfaces, err := c.Interfaces() - -        for _, x := range interfaces { -                fmt.Printf("%+v\n", x) -        } - -} -``` - -So, what's going on here? After importing it, the mdlayher/wifi module can be used in the main function to create a new Client (type `*Client`). The new client (named `c`) can then get a list of the interfaces on the system with `c.Interfaces()`. Then it can loop over the slice of Interface pointers and print information about them. - -By adding "+" to `%+v`, it prints the names of the fields in the `*Interface` struct, too, which helps me identify what I'm seeing without having to refer back to documentation. - -Running the code above provides a list of the WiFi interfaces on my machine: - - -``` -&{Index:0 Name: HardwareAddr:5c:5f:67:f3:0a:a7 PHY:0 Device:3 Type:P2P device Frequency:0} -&{Index:3 Name:wlp2s0 HardwareAddr:5c:5f:67:f3:0a:a7 PHY:0 Device:1 Type:station Frequency:2412} -``` - -Note that the MAC address, `HardwareAddr`, is the same for both lines, meaning this is the same physical hardware. This is confirmed by `PHY: 0`. The Go [wifi module's docs][3] note that `PHY` is the physical device to which the interface belongs. - -The first interface has no name and is `TYPE:P2P`. The second, named `wpl2s0` is `TYPE:Station`. The wifi module documentation lists the [different types of interfaces][4] and describes what they are. According to the docs, the "P2P" type indicates "an interface is a device within a peer-to-peer client network." I believe, and please correct me in the comments if I'm wrong, that this interface is for [WiFi Direct][5], a standard for allowing two WiFi devices to connect without an intermediate access point. - -The "Station" type indicates "an interface is part of a managed basic service set (BSS) of client devices with a controlling access point." This is the standard function for a wireless device that most people are used to—as a client connected to an access point. This is the interface that matters for testing the quality of the WiFi. - -### Getting the Station information from the interface - -Using this information, I can update the loop over the interfaces to retrieve the information I'm looking for: - - -``` -        for _, x := range interfaces { -                if x.Type == wifi.InterfaceTypeStation { -                        // c.StationInfo(x) returns a slice of all -                        // the staton information about the interface -                        info, err := c.StationInfo(x) -                        if err != nil { -                                fmt.Printf("Station err: %s\n", err) -                        } -                        for _, x := range info { -                                fmt.Printf("%+v\n", x) -                        } -                } -  } -``` - -First, it checks that `x.Type` (the Interface type) is `wifi.InterfaceTypeStation`—a Station interface (that's the only type that matters for this exercise). This is an unfortunate naming collision—the interface "type" is not a "type" in the Golang sense. In fact, what I'm working on here is a Go `type` named `InterfaceType` to represent the type of interface. Whew, that took me a minute to figure out! - -So, assuming the interface is of the _correct_ type, the station information can be retrieved with `c.StationInfo(x)` using the client `StationInfo()` method to get the info about the interface, `x`. - -This returns a slice of `*StationInfo` pointers. I'm not sure quite why there's a slice. Perhaps the interface can have multiple StationInfo responses? In any case, I can loop over the slice and use the same `+%v` trick to print the keys and values for the StationInfo struct. - -Running the above returns: - - -``` -`&{HardwareAddr:70:5a:9e:71:2e:d4 Connected:17m10s Inactive:1.579s ReceivedBytes:2458563 TransmittedBytes:1295562 ReceivedPackets:6355 TransmittedPackets:6135 ReceiveBitrate:2000000 TransmitBitrate:43300000 Signal:-79 TransmitRetries:2306 TransmitFailed:4 BeaconLoss:2}` -``` - -The thing I'm interested in is the "Signal" and possibly "TransmitFailed" and "BeaconLoss." The signal is reported in units of dBm (or decibel-milliwatts). - -#### A quick aside: How to read WiFi dBm - -According to [MetaGeek][6]: - - * –30 is the best possible signal strength—it's neither realistic nor necessary - * –67 is very good; it's for apps that need reliable packet delivery, like streaming media - * –70 is fair, the minimum reliable packet delivery, fine for email and web - * –80 is poor, absolute basic connectivity, unreliable packet delivery - * –90 is unusable, approaching the "noise floor" - - - -_Note that dBm is logarithmic scale: -60 is 1,000x lower than -30_ - -### Making this a real "scanner" - -So, looking at my signal from above: –79. YIKES, not good. But that single result is not especially helpful. That's just a point-in-time reference and only valid for the particular physical space where the WiFi network adapter was at that instant. What would be more useful would be a continuous reading, making it possible to see how the signal changes as the Raspberry Pi moves around. The main function can be tweaked again to accomplish this: - - -``` -        var i *wifi.Interface - -        for _, x := range interfaces { -                if x.Type == wifi.InterfaceTypeStation { -                        // Loop through the interfaces, and assign the station -                        // to var x -                        // We could hardcode the station by name, or index, -                        // or hardwareaddr, but this is more portable, if less efficient -                        i = x -                        break -                } -        } - -        for { -                // c.StationInfo(x) returns a slice of all -                // the staton information about the interface -                info, err := c.StationInfo(i) -                if err != nil { -                        fmt.Printf("Station err: %s\n", err) -                } - -                for _, x := range info { -                        fmt.Printf("Signal: %d\n", x.Signal) -                } - -                time.Sleep(time.Second) -        } -``` - -First, I name a variable `i` of type `*wifi.Interface`. Since it's outside the loop, I can use it to store the interface information. Any variable created inside the loop is inaccessible outside the scope of that loop. - -Then, I can break the loop into two. The first loop ranges over the interfaces returned by `c.Interfaces()`, and if that interface is a Station type, it stores that in the `i` variable created earlier and breaks out of the loop. - -The second loop is an infinite loop, so it'll just run over and over until I hit **Ctrl**+**C** to end the program. This loop takes that interface information and retrieves the station information, as before, and prints out the signal information. Then it sleeps for one second and runs again, printing the signal information over and over until I quit. - -So, running that: - - -``` -[chris@marvin wifi-monitor]$ go run main.go -Signal: -81 -Signal: -81 -Signal: -79 -Signal: -81 -``` - -Oof. Not good. - -### Mapping the apartment - -This information is good to know, at least. With an attached screen or E Ink display and a battery (or a looooong extension cable), I can walk the Pi around the apartment and map out where the dead spots are. - -Spoiler alert: With the landlord's access point in the apartment next door, the big dead spot for me is a cone shape emanating from the refrigerator in the studio apartment's kitchen area… the refrigerator that shares a wall with the landlord's apartment! - -I think in Dungeons and Dragons lingo, this is a "Cone of Silence." Or at least a "Cone of Poor Internet." - -Anyway, this code can be compiled directly on the Raspberry Pi with `go build -o wifi_scanner`, and the resulting binary, `wifi_scanner`, can be shared with any other ARM devices (of the same version). Alternatively, it can be compiled on a regular system with the right libraries for ARM devices. - -Happy Pi scanning! May your WiFi router not be behind your refrigerator! You can find the code used for this project in [my GitHub repo][7]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/troubleshoot-wifi-go-raspberry-pi - -作者:[Chris Collins][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/clcollins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_selfcare_wfh_porch_520.png?itok=2qXG0T7u (Selfcare, drinking tea on the porch) -[2]: https://github.com/mdlayher/wifi -[3]: https://godoc.org/github.com/mdlayher/wifi#Interface -[4]: https://godoc.org/github.com/mdlayher/wifi#InterfaceType -[5]: https://en.wikipedia.org/wiki/Wi-Fi_Direct -[6]: https://www.metageek.com/training/resources/wifi-signal-strength-basics.html -[7]: https://github.com/clcollins/goPiWiFi diff --git a/sources/tech/20210312 Build a router with mobile connectivity using Raspberry Pi.md b/sources/tech/20210312 Build a router with mobile connectivity using Raspberry Pi.md deleted file mode 100644 index 13621bbcd5..0000000000 --- a/sources/tech/20210312 Build a router with mobile connectivity using Raspberry Pi.md +++ /dev/null @@ -1,303 +0,0 @@ -[#]: subject: (Build a router with mobile connectivity using Raspberry Pi) -[#]: via: (https://opensource.com/article/21/3/router-raspberry-pi) -[#]: author: (Lukas Janėnas https://opensource.com/users/lukasjan) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Build a router with mobile connectivity using Raspberry Pi -====== -Use OpenWRT to get more control over your network's router. -![Mesh networking connected dots][1] - -The Raspberry Pi is a small, single-board computer that, despite being the size of a credit card, is capable of doing a lot of things. In reality, this little computer can be almost anything you want to be. You just need to open up your imagination. - -Raspberry Pi enthusiasts have made many different projects, from simple programs to complex automation projects and solutions like weather stations or even smart-home devices. This article will show how to turn your Raspberry Pi into a router with LTE mobile connectivity using the OpenWRT project. - -### About OpenWRT and LTE - -[OpenWRT][2] is an open source project that uses Linux to target embedded devices. It's been around for more than 15 years and has a large and active community. - -There are many ways to use OpenWRT, but its main purpose is in routers. It provides a fully writable filesystem with package management, and because it is open source, you can see and modify the code and contribute to the ecosystem. If you would like to have more control over your router, this is the system you want to use. - -Long-term evolution (LTE) is a standard for wireless broadband communication based on the GSM/EDGE and UMTS/HSPA technologies. The LTE modem I'm using is a USB device that can add 3G or 4G (LTE) cellular connectivity to a Raspberry Pi computer. - -![Teltonika TRM240 modem][3] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -### Prerequisites - -For this project, you will need: - - * A Raspberry Pi with a power cable - * A computer, preferably running Linux - * A microSD card with at least 16GB - * An Ethernet cable - * An LTE modem (I am using a Teltonika [TRM240][5]) - * A SIM card for mobile connectivity - - - -### Install OpenWRT - -To get started, download the latest [Raspberry Pi-compatible release of OpenWRT][6]. On the OpenWRT site, you see four images: two with **ext4** and two with **squashfs** filesystems. I use the **ext4** filesystem. You can download either the **factory** or **sysupgrade** image; both work great. - -![OpenWRT image files][7] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -Once you download the image, you need to extract it and install it on the SD card by [following these instructions][8]. It can take some time to install the firmware, so be patient. Once it's finished, there will be two partitions on your microSD card. One is used for the bootloader and the other one for the OpenWRT system. - -### Boot up the system - -To boot up your new system, insert the microSD card into the Raspberry Pi, connect the Pi to your router (or a switch) with an Ethernet cable, and power it on. - -If you're experienced with the Raspberry Pi, you may be used to accessing it through a terminal over SSH, or just by connecting it to a monitor and keyboard. OpenWRT works a little differently. You interact with this software through a web browser, so you must be able to access your Pi over your network. - -By default, the Raspberry Pi uses this IP address: 192.168.1.1. The computer you use to configure the Pi must be on the same subnet as the Pi. If your network doesn't use 192.168.1.x addresses, or if you're unsure, open **Settings** in GNOME, navigate to network settings, select **Manual**, and enter the following IP address and Netmask: - - * **IP address:** 192.168.1.15 - * **Netmask:** 255.255.255.0 - - - -![IP addresses][9] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -Open a web browser on your computer and navigate to 192.168.1.1. This opens an authentication page so you can log in to your Pi. - -![OpenWRT login page][10] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -No password is required yet, so just click the **Login** button to continue. - -### Configure network connection - -The Raspberry Pi has only one Ethernet port, while normal routers have a couple of them: one for WAN (wired area network) and the other for LAN (local area network). You have two options: - - 1. Use your Ethernet port for network connectivity - 2. Use WiFi for network connectivity - - - -**To use Ethernet:** - -Should you decide to use Ethernet, navigate to **Network → Interfaces**. On the configuration page, press the blue **Edit** button that is associated with the **LAN** interface. - -![LAN interface][11] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -A pop-up window should appear. In that window, you need to enter the IP address to match the subnet of the router to which you will connect the Raspberry Pi. Change the Netmask, if needed, and enter the IP address of the router the Raspberry Pi will connect to. - -![Enter IP in the LAN interface][12] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -Save this configuration and connect your Pi to the router over Ethernet. You can now reach the Raspberry Pi with this new IP address. - -Be sure to set a password for your OpenWRT router before you put it into production use! - -**To use WiFi** - -If you would like to connect the Raspberry Pi to the internet through WiFi, navigate to **Network → Wireless**. In the **Wireless** menu, press the blue **Scan** button to locate your home network. - -![Scan the network][13] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -In the pop-up window, find your WiFi network and connect to it. Don't forget to **Save and Apply** the configuration. - -In the **Network → Interfaces** section, you should see a new interface. - -![New interface][14] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -Be sure to set a password for your OpenWRT router before you put it into production use! - -### Install the necessary packages - -By default, the router doesn't have a lot of packages. OpenWRT offers a package manager with a selection of packages you need to install. Navigate to **System → Software** and update your package manager by pressing the button labeled "**Update lists…**". - -![Updating packages][15] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -You will see a lot of packages; you need to install these: - - * usb-modeswitch - * kmod-mii - * kmod-usb-net - * kmod-usb-wdm - * kmod-usb-serial - * kmod-usb-serial-option - * kmod-usb-serial-wwan (if it's not installed) - - - -Additionally, [download this modemmanager package][16] and install it by pressing the button labeled **Upload Package…** in the pop-up window. Reboot the Raspberry Pi for the packages to take effect. - -### Set up the mobile interface - -After all those packages are installed, you can set up the mobile interface. Before connecting the modem to the Raspberry Pi read, the [modem instructions][17] to set it up. Then connect your mobile modem to the Raspberry Pi and wait a little until the modem boots up. - -Navigate to **Network → Interface**. At the bottom of the page, press the **Add new interface…** button. In the pop-up window, give your interface a name (e.g., **mobile**) and select **ModemManager** from the drop-down list. - -![Add a new mobile interface][18] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -Press the button labeled **Create Interface**. You should see a new pop-up window. This is the main window for configuring the interface. In this window, select your modem and enter any other information like an Access Point Name (APN) or a PIN. - -![Configuring the interface][19] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -**Note:** If no modem devices appear in the list, try rebooting your Raspberry Pi or installing the kmod-usb-net-qmi-wwan package. - -When you are done configuring your interface, press **Save** and then **Save and Apply**. Give some time for the system to take effect. If everything went well, you should see something like this. - -![Configured interface][20] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -If you want to check your internet connection over this interface, you can use ssh to connect to your Raspberry Pi shell. In the terminal, enter: - - -``` -`ssh root@192.168.1.1` -``` - -The default IP address is 192.168.1.1; if you changed it, then use that IP address to connect. When connected, execute this command in the terminal: - - -``` -`ping -I ppp0 google.com` -``` - -If everything is working, then you should receive pings back from Google's servers. - -![Terminal interface][21] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -**ppp0** is the default interface name for the mobile interface you created. You can check your interfaces using **ifconfig**. It shows active interfaces only. - -### Set up the firewall - -To get the mobile interface working, you need to configure a firewall for the **mobile** interface and the **lan** interface to direct traffic to the correct interface. - -Navigate to **Network → Firewall**. At the bottom of the page, you should see a section called **Zones**. - -![Firewall zones][22] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -The simplest way to configure the firewall is to adjust the **wan** zone. Press the **Edit** button and in the **Covered networks** option, select your **mobile** interface, and **Save and Apply** your configuration. If you don't want to use WiFi to connect to the internet, you can remove **wwan** from the **Covered networks** or disable the WiFi connection. - -![Firewall zone settings][23] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -If you want to set up individual zones for each interface, just create a new zone and assign the necessary interfaces. For example, you may want to have a mobile zone that covers the mobile interface and is used to forward LAN interface traffic through it. Press the **Add** button, then **Name** your zone, check the **Masquerading** check box, select **Covered Networks**, and choose which zones can forward their traffic. - -![Firewall zone settings][24] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -Then **Save and Apply** the changes. Now you have a new zone. - -### Set up an Access Point - -The last step is to configure a network with an Access Point for your devices to connect to the internet. To set up an Access Point, navigate to **Network → Wireless**. You will see a WiFi device interface, a disabled Access Point named **OpenWRT**, and a connection that is used to connect to the internet over WiFi (if you didn't disable or delete it earlier). On the **Disable** interface, press the **Edit** button, then **Enable** the interface. - -![Enabling wireless network][25] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -If you want, you can change the interface name by editing the **ESSID** option. You can also select which network it will be associated with. By default, it with be associated with the **lan** interface. - -![Configuring the interface][26] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -To add a password for this interface, select the **Wireless Security** tab. In the tab, select the encryption **WPA2-PSK** and enter the password for the interface in the **Key** option field. - -![Setting a password][27] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -Then **Save and Apply** the configuration. If the configuration was set correctly, when scanning available Access Points with your device, you should see a new Access Point with the name you assigned. - -### Additional packages - -If you want, you can download additional packages for your router through the web interface. Just go to **System → Software** and install the package you want from the list or download it from the internet and upload it. If you don't see any packages in the list, press the **Update lists…** button. - -You can also add other repositories that have packages that are good to use with OpenWRT. Packages and their web interfaces are installed separately. The packages that start with the prefix **luci-** are web interface packages. - -![Packages with luci- prefix][28] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -### Give it a try - -This is what my Raspberry Pi router setup looks like. - -![Raspberry Pi router][29] - -(Lukas Janenas, [CC BY-SA 4.0][4]) - -It not difficult to build a router from a Raspberry Pi. The downside is that a Raspberry Pi has only one Ethernet port. You can add more ports with a USB-to-Ethernet adapter. Don't forget to configure the port on the interface's website. - -OpenWRT supports a large number of mobile modems, and you can configure the mobile interface for any of them with the modemmanager, which is a universal tool to manage modems. - -Have you used your Raspberry Pi as a router? Let us know how it went in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/router-raspberry-pi - -作者:[Lukas Janėnas][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/lukasjan -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mesh_networking_dots_connected.png?itok=ovINTRR3 (Mesh networking connected dots) -[2]: https://openwrt.org/ -[3]: https://opensource.com/sites/default/files/uploads/lte_modem.png (Teltonika TRM240 modem) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://teltonika-networks.com/product/trm240/ -[6]: https://downloads.openwrt.org/releases/19.07.7/targets/brcm2708/bcm2710/ -[7]: https://opensource.com/sites/default/files/uploads/imagefiles.png (OpenWRT image files) -[8]: https://opensource.com/article/17/3/how-write-sd-cards-raspberry-pi -[9]: https://opensource.com/sites/default/files/uploads/ipaddresses.png (IP addresses) -[10]: https://opensource.com/sites/default/files/uploads/openwrt-login.png (OpenWRT login page) -[11]: https://opensource.com/sites/default/files/uploads/lan-interface.png (LAN interface) -[12]: https://opensource.com/sites/default/files/uploads/lan-interface-ip.png (Enter IP in the LAN interface) -[13]: https://opensource.com/sites/default/files/uploads/scannetwork.png (Scan the network) -[14]: https://opensource.com/sites/default/files/uploads/newinterface.png (New interface) -[15]: https://opensource.com/sites/default/files/uploads/updatesoftwarelist.png (Updating packages) -[16]: https://downloads.openwrt.org/releases/packages-21.02/aarch64_cortex-a53/luci/luci-proto-modemmanager_git-21.007.43644-ab7e45c_all.ipk -[17]: https://wiki.teltonika-networks.com/view/TRM240_SIM_Card -[18]: https://opensource.com/sites/default/files/uploads/addnewinterface.png (Add a new mobile interface) -[19]: https://opensource.com/sites/default/files/uploads/configureinterface.png (Configuring the interface) -[20]: https://opensource.com/sites/default/files/uploads/configuredinterface.png (Configured interface) -[21]: https://opensource.com/sites/default/files/uploads/terminal.png (Terminal interface) -[22]: https://opensource.com/sites/default/files/uploads/firewallzones.png (Firewall zones) -[23]: https://opensource.com/sites/default/files/uploads/firewallzonesettings.png (Firewall zone settings) -[24]: https://opensource.com/sites/default/files/uploads/firewallzonepriv.png (Firewall zone settings) -[25]: https://opensource.com/sites/default/files/uploads/enablewirelessnetwork.png (Enabling wireless network) -[26]: https://opensource.com/sites/default/files/uploads/interfaceconfig.png (Configuring the interface) -[27]: https://opensource.com/sites/default/files/uploads/interfacepassword.png (Setting a password) -[28]: https://opensource.com/sites/default/files/uploads/luci-packages.png (Packages with luci- prefix) -[29]: https://opensource.com/sites/default/files/uploads/raspberrypirouter.jpg (Raspberry Pi router) diff --git a/sources/tech/20210323 WebAssembly Security, Now and in the Future.md b/sources/tech/20210323 WebAssembly Security, Now and in the Future.md deleted file mode 100644 index b29459396a..0000000000 --- a/sources/tech/20210323 WebAssembly Security, Now and in the Future.md +++ /dev/null @@ -1,87 +0,0 @@ -[#]: subject: (WebAssembly Security, Now and in the Future) -[#]: via: (https://www.linux.com/news/webassembly-security-now-and-in-the-future/) -[#]: author: (Dan Brown https://training.linuxfoundation.org/announcements/webassembly-security-now-and-in-the-future/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -WebAssembly Security, Now and in the Future -====== - -_By Marco Fioretti_ - -**Introduction** - -WebAssembly is, as we [explained recently][1], a binary format for software written in any language, designed to eventually run on any platform without changes. The first application of WebAssembly is inside web browsers, to make websites faster and more interactive. Plans to push WebAssembly beyond the Web, from servers of all sorts to the Internet of Things (IoT), create as many opportunities as security issues. This post is an introductory overview of those issues and of the WebAssembly security model. - -**WebAssembly is like JavaScript** - -Inside web browsers, WebAssembly modules are managed by the same Virtual Machine (VM) that executes JavaScript code. Therefore, WebAssembly may be used to do much of the same harm that is doable with JavaScript, just more efficiently and less visibly. Since JavaScript is plain text that the browser will compile, and WebAssembly a ready-to-run binary format, the latter runs faster, and is also harder to scan (even by antivirus software) for malicious instructions. - -This “code obfuscation” effect of WebAssembly has been already used, among other things, to pop up unwanted advertising or to open fake “tech support” windows that ask for sensitive data. Another trick is to automatically redirect browsers to “landing” pages that contain the really dangerous malware. - -Finally, WebAssembly may be used, just like JavaScript, to “steal” processing power instead of data. In 2019, an [analysis of 150 different Wasm modules][2] found out that about _32%_ of them were used for cryptocurrency-mining. - -**WebAssembly sandbox, and interfaces** - -WebAssembly code runs closed into a [sandbox][3] managed by the VM, not by the operating system. This gives it no visibility of the host computer, or ways to interact directly with it. Access to system resources, be they files, hardware or internet connections, can only happen through the WebAssembly System Interface (WASI) provided by that VM. - -The WASI is different from most other application programming interfaces, with unique security characteristics that are truly driving the adoption of WASM on servers/edge computing scenarios, and will be the topic of the next post. Here, it is enough to say that its security implications greatly vary, when moving from the web to other environments. Modern web browsers are terribly complex pieces of software, but lay on decades of experience, and of daily tests from billions of people. Compared to browsers, servers or IoT devices are almost uncharted lands. The VMs for those platforms will require extensions of WASI and thus, in turn, surely introduce new security challenges. - -**Memory and code management in WebAssembly** - -Compared to normal compiled programs, WebAssembly applications have very restricted access to memory, and to themselves too. WebAssembly code cannot directly access functions or variables that are not yet called, jump to arbitrary addresses or execute data in memory as bytecode instructions. - -Inside browsers, a Wasm module only gets one, global array (“linear memory”) of contiguous bytes to play with. WebAssembly can directly read and write any location in that area, or request an increase in its size, but that’s all. This linear memory is also separated from the areas that contain its actual code, execution stack, and of course the virtual machine that runs WebAssembly. For browsers, all these data structures are ordinary JavaScript objects, insulated from all the others using standard procedures. - -**The result: good, but not perfect** - -All these restrictions make it quite hard for a WebAssembly module to misbehave, but not impossible. - -The sandboxed memory that makes it almost impossible for WebAssembly to touch what is _outside_ also makes it harder for the operating system to prevent bad things from happening _inside_. Traditional memory monitoring mechanisms like [“stack canaries”][4], which notice if some code tries to mess with objects that it should not touch, [cannot work there][5]. - -The fact that WebAssembly can only access its own linear memory, but directly, may also _facilitate_ the work of attackers. With those constraints, and access to the source code of a module, it is much easier to guess which memory locations could be overwritten to make the most damage. It also seems [possible][6] to corrupt local variables, because they stay in an unsupervised stack in the linear memory. - -A 2020 paper on the [binary security of WebAssembly][5] noted that WebAssembly code can still overwrite string literals in supposedly constant memory. The same paper describes other ways in which WebAssembly may be less secure than when compiled to a native binary, on three different platforms (browsers, server-side applications on Node.js, and applications for stand-alone WebAssembly VMs) and is recommended further reading on this topic. - -In general, the idea that WebAssembly can only damage what’s inside its own sandbox can be misleading. WebAssembly modules do the heavy work for the JavaScript code that calls them, exchanging variables every time. If they write into any of those variables code that may cause crashes or data leaks in the unsafe JavaScript that called WebAssembly, those things _will_ happen. - -**The road ahead** - -Two emerging features of WebAssembly that will surely impact its security (how and how much, it’s too early to tell) are [concurrency][7], and internal garbage collection. - -Concurrency is what allows several WebAssembly modules to run in the same VM simultaneously. Today this is possible only through JavaScript [web workers][8], but better mechanisms are under development. Security-wise, they may bring in [“a lot of code… that did not previously need to be”][9], that is more ways for things to go wrong. - -A [native Garbage Collector][10] is needed to increase performance and security, but above all to use WebAssembly outside the well-tested Java VMs of browsers, that collect all the garbage inside themselves anyway. Even this new code, of course, may become another entry point for bugs and attacks. - -On the positive side, general strategies to make WebAssembly even safer than it is today also exist. Quoting again from [here][5], they include compiler improvements, _separate_ linear memories for stack, heap and constant data, and avoiding to compile as WebAssembly modules code in “unsafe languages, such as C”. - -The post [WebAssembly Security, Now and in the Future][11] appeared first on [Linux Foundation – Training][12]. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/news/webassembly-security-now-and-in-the-future/ - -作者:[Dan Brown][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://training.linuxfoundation.org/announcements/webassembly-security-now-and-in-the-future/ -[b]: https://github.com/lujun9972 -[1]: https://training.linuxfoundation.org/announcements/an-introduction-to-webassembly/ -[2]: https://www.sec.cs.tu-bs.de/pubs/2019a-dimva.pdf -[3]: https://webassembly.org/docs/security/ -[4]: https://ctf101.org/binary-exploitation/stack-canaries/ -[5]: https://www.usenix.org/system/files/sec20-lehmann.pdf -[6]: https://spectrum.ieee.org/tech-talk/telecom/security/more-worries-over-the-security-of-web-assembly -[7]: https://github.com/WebAssembly/threads -[8]: https://en.wikipedia.org/wiki/Web_worker -[9]: https://googleprojectzero.blogspot.com/2018/08/the-problems-and-promise-of-webassembly.html -[10]: https://github.com/WebAssembly/gc/blob/master/proposals/gc/Overview.md -[11]: https://training.linuxfoundation.org/announcements/webassembly-security-now-and-in-the-future/ -[12]: https://training.linuxfoundation.org/ diff --git a/sources/tech/20210401 Partition a drive on Linux with GNU Parted.md b/sources/tech/20210401 Partition a drive on Linux with GNU Parted.md deleted file mode 100644 index 64d5afb8f7..0000000000 --- a/sources/tech/20210401 Partition a drive on Linux with GNU Parted.md +++ /dev/null @@ -1,194 +0,0 @@ -[#]: subject: (Partition a drive on Linux with GNU Parted) -[#]: via: (https://opensource.com/article/21/4/linux-parted-cheat-sheet) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Partition a drive on Linux with GNU Parted -====== -Learn the basics of partitioning a new storage device, then download our -cheat sheet to keep info close at hand. -![Cheat Sheet cover image][1] - -In the 21st century, we tend to take data storage for granted. We have lots of it, it's relatively affordable, and there are many different types of storage available. No matter how much cloud storage space you're given for free, there's nothing quite like having a physical hard drive for your really important (or really big, when you live on a slow network) data. However, few hard drives are sold right off the shelf, ready to use—in an ideal configuration, at least. Whether you're buying a new drive or setting up a system with a different configuration, you need to know how to partition a drive on Linux. - -This article demonstrates GNU Parted, one of the best tools for partitioning drives. If you prefer to use a graphical application instead of a terminal command, read my article on [formatting drives for Linux][2]. - -### Disk labels, partitions, and filesystems - -A hard drive doesn't _technically_ require much software to serve as a storage device. However, using a drive without modern conventions like a partition table and filesystem is difficult, impractical, and unsafe for your data. - -There are three important concepts you need to know about hard drives: - - * A **disk label** or **partition table** is metadata placed at the start of a drive, serving as a clue for the computer reading it about what kind of storage is available and where it's located on the drive. - * A **partition** is a boundary identifying where a filesystem is located. For instance, if you have a 512GB drive, you can have a partition on that device that takes up the entire drive (512GB), or two partitions that each take 256GB each, or three partitions taking up some other variation of sizes, and so on. - * A **filesystem** is a storage scheme agreed upon by a hard drive and a computer. A computer must know how to read a filesystem to piece together all the data stored on the drive, and it must know how to write data back to the filesystem to maintain the data's integrity. - - - -The GNU Parted application manages the first two concepts: disk labels and partitions. Parted has some awareness of filesystems, but it leaves the details of filesystem implementation to other tools like `mkfs`. - -**[Download the [GNU Parted cheat sheet][3]]** - -### Locating the drive - -Before using GNU Parted, you must be certain where your drive is located on your system. First, attach the hard drive you want to format to your system, and then use the `parted` command to see what's attached to your computer: - - -``` -$ parted /dev/sda print devices -/dev/sda (2000GB) -/dev/sdb (1000GB) -/dev/sdc (1940MB) -``` - -The device you most recently attached gets a name later in the alphabet than devices that have been attached longer. In this example, `/dev/sdc` is most likely the drive I just attached. I can confirm that by its size because I know that the USB thumb drive I attached is only 2GB (1940MB is close enough), compared to my workstation's main drives, which are terabytes in size. If you're not sure, then you can get more information about the drive you think is the one you want to partition: - - -``` -$ parted /dev/sdc print -Model: Yoyodyne Tiny Drive 1.0 (scsi)     -Disk /dev/sdc: 1940MB -Sector size (logical/physical): 512B/512B -Partition Table: msdos -Disk Flags: - -Number  Start   End     Size    File system  Name  Flags - 1      1049kB  2048kB  1024kB  BS           Bloat  Hidden - 2      2049kB  1939MB  1937MB  FAT32        MyDrive -``` - -Some drives provide more metadata than others. This one identifies itself as a drive from Yoyodyne, which is exactly the branding on the physical drive. Furthermore, it contains a small hidden partition at the front of the drive with some bloatware followed by a Windows-compatible FAT32 partition. This is definitely the drive I intend to reformat. - -Before continuing, _make sure_ you have identified the correct drive you want to partition. _Repartitioning the wrong drive results in lost data._ For safety, all potentially destructive commands in this article reference the `/dev/sdX` device, which you are unlikely to have on your system. - -### Creating a disk label or partition table - -To create a partition on a drive, the drive must have a disk label. A disk label is also called a _partition table_, so Parted accepts either term. - -To create a disk label, use the `mklabel` or `mktable` subcommand: - - -``` -`$ parted /dev/sdX mklabel gpt` -``` - -This command creates a **gpt** label at the front of the drive located at `/dev/sdX`, erasing any label that may exist. This is a quick process because all that's being replaced is metadata about partitions. - -### Creating a partition - -To create a partition on a drive, use the `mkpart` subcommand, followed by an optional name for your partition, followed by the partition's start and end points. If you only need one partition on your drive, then sizing is easy: start at 1 and end at 100%. Use the `--align opt` option to allow Parted to adjust the position of the partition boundaries for best performance: - - -``` -$ parted /dev/sdX --align opt \ -mkpart example 1 100% -``` - -View your new partition with the `print` subcommand: - - -``` -$ parted /dev/sdX print -Model: Yoyodyne Tiny Drive 1.0 (scsi) -Disk /dev/sdi: 1940MB -Sector size (logical/physical): 512B/512B -Partition Table: gpt -Disk Flags: - -Number  Start   End     Size   - 1      1049kB  1939MB  1938MB -``` - -You don't have to use the whole disk for one partition. The advantage to a partition is that more than one filesystem can exist on a drive without interfering with the other partition(s). When sizing partitions, you can use the `unit` subcommand to set what kind of measurements you want to use. Parted understands sectors, cylinders, heads, bytes, kilobytes, megabytes, gigabytes, terabytes, and percentages. - -You can also specify what filesystem you intend to use a partition for. This doesn't create the filesystem, but it does provide metadata that could be useful to you later. - -Here's a 50-50 split, one for an XFS filesystem and another for an EXT4 filesystem: - - -``` -$ parted /dev/sdX --align opt \ -mkpart xfs 1 50% -$ parted /dev/sdX --align opt \ -mkpart ext4 51% 100% -``` - -### Naming a partition - -In addition to marking what filesystem a partition is for, you can also name each partition. Some file managers and utilities read partition names, which can help you identify drives. For instance, I often have several different drives attached on my media workstation, each belonging to a different project. When creating these drives, I name both the partition and the filesystem so that, no matter how I'm looking at my system, the locations with important data are clearly labeled. - -To name a partition, you must know its number: - - -``` -$ parted /dev/sdX print -[...] -Number  Start   End     Size   File system  Name     Flags - 1      1049kB  990MB   989MB  xfs          example - 2      1009MB  1939MB  930MB  ext4         noname -``` - -To name partition 1: - - -``` -$ parted /dev/sdX name 1 example -$ parted /dev/sdX print -[...] -Number  Start   End     Size   File system  Name     Flags - 1      1049kB  990MB   989MB  xfs          example - 2      1009MB  1939MB  930MB  ext4         noname -``` - -### Create a filesystem - -For your drive to be useful, you must create a filesystem in your new partition. GNU Parted doesn't do that because it's only a partition manager. The Linux command to create a filesystem on a drive is `mkfs`, but there are helpful utilities aliased for you to use to create a specific kind of filesystem. For instance, `mkfs.ext4` creates an EXT4 filesystem, while `mkfs.xfs` creates an XFS filesystem, and so on. - -Your partition is located "in" the drive, so instead of creating a filesystem on `/dev/sdX`, you create your filesystem in `/dev/sdX1` for the first partition, `/dev/sdX2` for the second partition, and so on. - -Here's an example of creating an XFS filesystem: - - -``` -`$ sudo mkfs.xfs -L mydrive /dev/sdX1` -``` - -### Download our cheat sheet - -Parted is a flexible and powerful command. You can issue it commands, as demonstrated in this article, or activate an interactive mode so that you're constantly "connected" to a drive you specify: - - -``` -$ parted /dev/sdX -(parted) print -[...] -Number  Start   End     Size   File system  Name     Flags - 1      1049kB  990MB   989MB  xfs          example - 2      1009MB  1939MB  930MB  ext4         noname - -(parted) name 1 mydrive -(parted) -``` - -If you intend to use Parted often, [download our GNU Parted cheat sheet][3] so that you have all the subcommands you need close at hand. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/linux-parted-cheat-sheet - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coverimage_cheat_sheet.png?itok=lYkNKieP (Cheat Sheet cover image) -[2]: https://opensource.com/article/18/11/partition-format-drive-linux#gui -[3]: https://opensource.com/downloads/parted-cheat-sheet diff --git a/sources/tech/20210401 Use awk to calculate letter frequency.md b/sources/tech/20210401 Use awk to calculate letter frequency.md deleted file mode 100644 index afc6449ff1..0000000000 --- a/sources/tech/20210401 Use awk to calculate letter frequency.md +++ /dev/null @@ -1,286 +0,0 @@ -[#]: subject: (Use awk to calculate letter frequency) -[#]: via: (https://opensource.com/article/21/4/gawk-letter-game) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Use awk to calculate letter frequency -====== -Write an awk script to determine the most (and least) common letters in -a set of words. -![Typewriter keys in multicolor][1] - -I recently started writing a game where you build words using letter tiles. To create the game, I needed to know the frequency of letters across regular words in the English language, so I could present a useful set of letter tiles. Letter frequency is discussed in various places, including [on Wikipedia][2], but I wanted to calculate the letter frequency myself. - -Linux provides a list of words in the `/usr/share/dict/words` file, so I already have a list of likely words to use. The `words` file contains lots of words that I want, but a few that I don't. I wanted a list of all words that weren't compound words (no hyphens or spaces) or proper nouns (no uppercase letters). To get that list, I can run the `grep` command to pull out only the lines that consist solely of lowercase letters: - - -``` -`$ grep  '^[a-z]*$' /usr/share/dict/words` -``` - -This regular expression asks `grep` to match patterns that are only lowercase letters. The characters `^` and `$` in the pattern represent the start and end of the line, respectively. The `[a-z]` grouping will match only the lowercase letters **a** to **z**. - -Here's a quick sample of the output: - - -``` -$ grep  '^[a-z]*$' /usr/share/dict/words | head -a -aa -aaa -aah -aahed -aahing -aahs -aal -aalii -aaliis -``` - -And yes, those are all valid words. For example, "aahed" is the past tense exclamation of "aah," as in relaxation. And an "aalii" is a bushy tropical shrub. - -Now I just need to write a `gawk` script to do the work of counting the letters in each word, and then print the relative frequency of each letter it finds. - -### Counting letters - -One way to count letters in `gawk` is to iterate through each character in each input line and count occurrences of each letter **a** to **z**. The `substr` function will return a substring of a given length, such as a single letter, from a larger string. For example, this code example will evaluate each character `c` from the input: - - -``` -{ -    len = length($0); for (i = 1; i <= len; i++) { -        c = substr($0, i, 1); -    } -} -``` - -If I start with a global string `LETTERS` that contains the alphabet, I can use the `index` function to find the location of a single letter in the alphabet. I'll expand the `gawk` code example to evaluate only the letters **a** to **z** in the input: - - -``` -BEGIN { LETTERS = "abcdefghijklmnopqrstuvwxyz" } -  -{ -    len = length($0); for (i = 1; i <= len; i++) { -        c = substr($0, i, 1); -        ltr = index(LETTERS, c); -    } -} -``` - -Note that the index function returns the first occurrence of the letter from the `LETTERS` string, starting with 1 at the first letter, or zero if not found. If I have an array that is 26 elements long, I can use the array to count the occurrences of each letter. I'll add this to my code example to increment (using `++`) the count for each letter as it appears in the input: - - -``` -BEGIN { LETTERS = "abcdefghijklmnopqrstuvwxyz" } -  -{ -    len = length($0); for (i = 1; i <= len; i++) { -        c = substr($0, i, 1); -        ltr = index(LETTERS, c); -  -        if (ltr > 0) { -            ++count[ltr]; -        } -    } -} -``` - -### Printing relative frequency - -After the `gawk` script counts all the letters, I want to print the frequency of each letter it finds. I am not interested in the total number of each letter from the input, but rather the _relative frequency_ of each letter. The relative frequency scales the counts so that the letter with the fewest occurrences (such as the letter **q**) is set to 1, and other letters are relative to that. - -I'll start with the count for the letter **a**, then compare that value to the counts for each of the other letters **b** to **z**: - - -``` -END { -    min = count[1]; for (ltr = 2; ltr <= 26; ltr++) { -        if (count[ltr] < min) { -            min = count[ltr]; -        } -    } -} -``` - -At the end of that loop, the variable `min` contains the minimum count for any letter. I can use that to provide a scale for the counts to print the relative frequency of each letter. For example, if the letter with the lowest occurrence is **q**, then `min` will be equal to the **q** count. - -Then I loop through each letter and print it with its relative frequency. I divide each count by `min` to print the relative frequency, which means the letter with the lowest count will be printed with a relative frequency of 1. If another letter appears twice as often as the lowest count, that letter will have a relative frequency of 2. I'm only interested in integer values here, so 2.1 and 2.9 are the same as 2 for my purposes: - - -``` -END { -    min = count[1]; for (ltr = 2; ltr <= 26; ltr++) { -        if (count[ltr] < min) { -            min = count[ltr]; -        } -    } -  -    for (ltr = 1; ltr <= 26; ltr++) { -        print substr(LETTERS, ltr, 1), int(count[ltr] / min); -    } -} -``` - -### Putting it all together - -Now I have a `gawk` script that can count the relative frequency of letters in its input: - - -``` -#!/usr/bin/gawk -f -  -# only count a-z, ignore A-Z and any other characters -  -BEGIN { LETTERS = "abcdefghijklmnopqrstuvwxyz" } -  -{ -    len = length($0); for (i = 1; i <= len; i++) { -        c = substr($0, i, 1); -        ltr = index(LETTERS, c); -  -        if (ltr > 0) { -            ++count[ltr]; -        } -    } -} -  -# print relative frequency of each letter -    -END { -    min = count[1]; for (ltr = 2; ltr <= 26; ltr++) { -        if (count[ltr] < min) { -            min = count[ltr]; -        } -    } -  -    for (ltr = 1; ltr <= 26; ltr++) { -        print substr(LETTERS, ltr, 1), int(count[ltr] / min); -    } -} -``` - -I'll save that to a file called `letter-freq.awk` so that I can use it more easily from the command line. - -If you prefer, you can also use `chmod +x` to make the file executable on its own. The `#!/usr/bin/gawk -f` on the first line means Linux will run it as a script using the `/usr/bin/gawk` program. And because the `gawk` command line uses `-f` to indicate which file it should use as a script, you need that hanging `-f` so that executing `letter-freq.awk` at the shell will be properly interpreted as running `/usr/bin/gawk -f letter-freq.awk` instead. - -I can test the script with a few simple inputs. For example, if I feed the alphabet into my `gawk` script, each letter should have a relative frequency of 1: - - -``` -$ echo abcdefghijklmnopqrstuvwxyz | gawk -f letter-freq.awk -a 1 -b 1 -c 1 -d 1 -e 1 -f 1 -g 1 -h 1 -i 1 -j 1 -k 1 -l 1 -m 1 -n 1 -o 1 -p 1 -q 1 -r 1 -s 1 -t 1 -u 1 -v 1 -w 1 -x 1 -y 1 -z 1 -``` - -Repeating that example but adding an extra instance of the letter **e** will print the letter **e** with a relative frequency of 2 and every other letter as 1: - - -``` -$ echo abcdeefghijklmnopqrstuvwxyz | gawk -f letter-freq.awk -a 1 -b 1 -c 1 -d 1 -e 2 -f 1 -g 1 -h 1 -i 1 -j 1 -k 1 -l 1 -m 1 -n 1 -o 1 -p 1 -q 1 -r 1 -s 1 -t 1 -u 1 -v 1 -w 1 -x 1 -y 1 -z 1 -``` - -And now I can take the big step! I'll use the `grep` command with the `/usr/share/dict/words` file and identify the letter frequency for all words spelled entirely with lowercase letters: - - -``` -$ grep  '^[a-z]*$' /usr/share/dict/words | gawk -f letter-freq.awk -a 53 -b 12 -c 28 -d 21 -e 72 -f 7 -g 15 -h 17 -i 58 -j 1 -k 5 -l 36 -m 19 -n 47 -o 47 -p 21 -q 1 -r 46 -s 48 -t 44 -u 25 -v 6 -w 4 -x 1 -y 13 -z 2 -``` - -Of all the lowercase words in the `/usr/share/dict/words` file, the letters **j**, **q**, and **x** occur least frequently. The letter **z** is also pretty rare. Not surprisingly, the letter **e** is the most frequently used. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/gawk-letter-game - -作者:[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/osdc-docdish-typewriterkeys-3.png?itok=NyBwMdK_ (Typewriter keys in multicolor) -[2]: https://en.wikipedia.org/wiki/Letter_frequency diff --git a/sources/tech/20210402 20 ways to be more productive and respect yourself.md b/sources/tech/20210402 20 ways to be more productive and respect yourself.md deleted file mode 100644 index 58b66e1e88..0000000000 --- a/sources/tech/20210402 20 ways to be more productive and respect yourself.md +++ /dev/null @@ -1,104 +0,0 @@ -[#]: subject: (20 ways to be more productive and respect yourself) -[#]: via: (https://opensource.com/article/21/4/productivity-roundup) -[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -20 ways to be more productive and respect yourself -====== -Open source tools and more efficient processes can give you an edge over -your to-do list. -![Kanban-style organization action][1] - -The need to be productive is ingrained in who we are as human beings on some level. We oftentimes have to do yoga and meditate and breathe deeply in order to consciously slow down our minds and bodies, but when we do it helps us focus and be more productive when the time comes. Instead of constantly moving and doing, we should take periods of thoughtful breaks... or veg out in front of the TV or a sunset. And sleep at night! Then, when we're ready again, we can tackle that to-do list. Rinse and repeat. - -Honoring this cycle of moving through active and restful states, our productivity series this year brought to us by author [Kevin Sonney][2] showcases open source tools and more efficient processes while paying attention to healthy practices for incorporating them and respecting the person doing the implementing, you. - -### Tools and technology - -The software, the apps, and the programs... they are the tools we wield when we're ready to sit down and get stuff done. Here are nine open source tools you should know. - - * [Improve your productivity with this lightweight Linux desktop][3] - * [3 plain text note-taking tools][4] - * [How to use KDE's productivity suite, Kontact][5] - * [How Nextcloud is the ultimate open source productivity suite][6] - * [Schedule appointments with an open source alternative to Doodle][7] - * [Use Joplin to find your notes faster][8] - * [Use your Raspberry Pi as a productivity powerhouse][9] - - - -### Processes and practices - -#### Email - -Despite the criticism, is email still a favorite way for you to get stuff done? Improve on this process even more with these tips: - - * [3 email rules to live by in 2021][10] - * [3 steps to achieving Inbox Zero][11] - * [Organize your task list using labels][12] - * [3 tips for automating your email filters][13] - * [3 email mistakes and how to avoid them][14] - - - -#### Calendars - -We often need to work with others and ask important questions to get work done and tasks completed, so scheduling meetings is an important part of being productive. - - * [Gain control of your calendar with this simple strategy][15] - - - -#### Mind games - -Preparing and caring for our mental state while we work is critical to being productive. Kevin shows us how to prioritize, reflect, take care, reduce stress, rest, and focus.   - - * [How I prioritize tasks on my to-do list][16] - * [Tips for incorporating self-care into your daily routine][17] - * [Why keeping a journal improves productivity][18] - * [3 stress-free steps to tackling your task list][19] - * [4 tips for preventing notification fatigue][20] - * [Open source tools and tips for staying focused][21] - * [How I de-clutter my digital workspace][22] - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/productivity-roundup - -作者:[Jen Wike Huger][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jen-wike -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kanban_trello_organize_teams_520.png?itok=ObNjCpxt (Kanban-style organization action) -[2]: https://opensource.com/users/ksonney -[3]: https://opensource.com/article/21/1/elementary-linux -[4]: https://opensource.com/article/21/1/plain-text -[5]: https://opensource.com/article/21/1/kde-kontact -[6]: https://opensource.com/article/21/1/nextcloud-productivity -[7]: https://opensource.com/article/21/1/open-source-scheduler -[8]: https://opensource.com/article/21/1/notes-joplin -[9]: https://opensource.com/article/21/1/raspberry-pi-productivity -[10]: https://opensource.com/article/21/1/email-rules -[11]: https://opensource.com/article/21/1/inbox-zero -[12]: https://opensource.com/article/21/1/labels -[13]: https://opensource.com/article/21/1/email-filter -[14]: https://opensource.com/article/21/1/email-mistakes -[15]: https://opensource.com/article/21/1/calendar-time-boxing -[16]: https://opensource.com/article/21/1/prioritize-tasks -[17]: https://opensource.com/article/21/1/self-care -[18]: https://opensource.com/article/21/1/open-source-journal -[19]: https://opensource.com/article/21/1/break-down-tasks -[20]: https://opensource.com/article/21/1/alert-fatigue -[21]: https://opensource.com/article/21/1/stay-focused -[22]: https://opensource.com/article/21/1/declutter-workspace 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 index 2220c2d410..01085f7526 100644 --- 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 @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/compare-programming-languages) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (VeryZZJ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -16,12 +16,10 @@ Whenever I start learning a new programming language, I focus on defining variab 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: - 1. The computer picks a random number between 1 and 100 - 2. Loop until I guess the random number - 1. The computer reads my guess - 2. It tells me if my guess is too low or too high - - +* 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. @@ -33,59 +31,242 @@ For example, look at how these different programming languages implement the maj 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 | Using the Linux `getrandom` system call: -`getrandom(&randval, sizeof(int), GRND_NONBLOCK); number = randval % maxval + 1;` +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++ | `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)` +// 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 | `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` +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 | `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 +```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 | `    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 +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? @@ -93,12 +274,51 @@ Programming languages that are not based on C can be quite different and require 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 | `  (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 ` +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 @@ -106,26 +326,22 @@ This "guess the number" game is a great introductory program when learning a new 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 - - +* [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 - - +* [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 -------------------------------------------------------------------------------- diff --git a/sources/tech/20210408 5 commands to level-up your Git game.md b/sources/tech/20210408 5 commands to level-up your Git game.md deleted file mode 100644 index 50c6eb383b..0000000000 --- a/sources/tech/20210408 5 commands to level-up your Git game.md +++ /dev/null @@ -1,67 +0,0 @@ -[#]: subject: (5 commands to level-up your Git game) -[#]: via: (https://opensource.com/article/21/4/git-commands) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -5 commands to level-up your Git game -====== -Get more use out of Git by adding these commands to your repertoire. -![Business woman on laptop sitting in front of window][1] - -If you use Git regularly, you might be aware that it has several reputations. It's probably the most popular version-control solution and is used by some of the [biggest software projects][2] around to [keep track of changes][3] to files. It provides a [robust interface][4] to review and incorporate experimental changes into existing documents. It's well-known for its flexibility, thanks to [Git hooks][5]. And partly because of its great power, it has earned its reputation for being complex. - -You don't have to use all of Git's many features, but if you're looking to delve deeper into Git's subcommands, here are some that you might find useful. - -### 1\. Finding out what changed - -If you're familiar with Git's basics (`fetch`, `add`, `commit`, `push`, `log`, and so on) but you want to learn more, Git subcommands that query are a great, safe place to start. Querying your Git repository (your _work tree_) doesn't make any changes; it's only a reporting mechanism. You're not risking the integrity of your Git checkout; you're only asking Git about its status and history. - -The [git whatchanged][6] command (almost a mnemonic itself) is an easy way to see what changed in a commit. A remarkably user-friendly command, it squashes the best features of `show` and `diff-tree` and `log` into one easy-to-remember command. - -### 2\. Managing changes with git stash - -The more you use Git, the more you use Git. That is, once you've become comfortable with the power of Git, the more often you use its powerful features. Sometimes, you may find yourself in the middle of working with a batch of files when you realize some other task is more urgent. With [git stash][7], you can gather up all the pieces of your work in progress and stash them away for safekeeping. With your workspace decluttered, you can turn your attention to some other task and then reapply stashed files to your work tree later to resume work. - -### 3\. Making a linked copy with git worktree - -When `git stash` isn't enough, Git also provides the powerful [git worktree][8] command. With it, you can create a new but _linked_ clone of your repository, forming a new branch and setting `HEAD` to whatever commit you want to base your new work on. In this linked clone, you can work on a task unrelated to what your primary clone is focused on. It's a good way to keep your work in progress safe from unintended changes. When you're finished with your new work tree, you can push your new branch to a remote, bundle the changes into an archive for later, or just fetch the changes from your other tree. Whatever you decide, your workspaces are kept separate, and the changes in one don't have to affect changes in the other until you are ready to merge. - -### 4\. Selecting merges with git cherry-pick - -It may seem counterintuitive, but the better at Git you get, the more merge conflicts you're likely to encounter. That's because merge conflicts aren't necessarily signs of errors but signs of activity. Getting comfortable with merge conflicts and how to resolve them is an important step in learning Git. The usual methods work well, but sometimes you need greater flexibility in how you merge, and for that, there's [git cherry-pick][9]. Cherry-picking merges allows you to be selective in what parts of commits you merge, so you never have to reject a merge request based on a trivial incongruity. - -### 5\. Managing $HOME with Git - -Managing your home directory with Git has never been easier, and thanks to Git's ability to be selective in what it manages, it's a realistic option for keeping your computers in sync. To work well, though, you must do it judiciously. To get started, read my tips on [managing $HOME with Git][10]. - -### Getting better at Git - -Git is a powerful version-control system, and the more comfortable you become with it, the easier it becomes to use it for complex tasks. Try some new Git commands today, and share your favorites in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/git-commands - -作者:[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/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) -[2]: https://opensource.com/article/19/10/how-gnome-uses-git -[3]: https://opensource.com/article/18/2/how-clone-modify-add-delete-git-files -[4]: https://opensource.com/article/18/5/git-branching -[5]: https://opensource.com/life/16/8/how-construct-your-own-git-server-part-6 -[6]: https://opensource.com/article/21/3/git-whatchanged -[7]: https://opensource.com/article/21/3/git-stash -[8]: https://opensource.com/article/21/3/git-worktree -[9]: https://opensource.com/article/21/3/reasons-use-cherry-picking -[10]: https://opensource.com/article/21/3/git-your-home diff --git a/sources/tech/20210413 What-s new with Drupal in 2021.md b/sources/tech/20210413 What-s new with Drupal in 2021.md deleted file mode 100644 index c53b7d678b..0000000000 --- a/sources/tech/20210413 What-s new with Drupal in 2021.md +++ /dev/null @@ -1,148 +0,0 @@ -[#]: subject: (What's new with Drupal in 2021?) -[#]: via: (https://opensource.com/article/21/4/drupal-updates) -[#]: author: (Shefali Shetty https://opensource.com/users/shefalishetty) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -What's new with Drupal in 2021? -====== -Its newest initiatives include decoupled menus, automated updates, and -other usability-focused updates. -![Computer screen with files or windows open][1] - -The success of open source projects is largely carried by the pillars of the community and group collaborations. Without putting a stake in the ground to achieve strategic initiatives, an open source project can lose focus. Open source strategic initiatives should aim at solving impactful problems through collaboration involving the project's stakeholders. - -### The why and how of Drupal's strategic initiatives - -As one of the leading open source projects, [Drupal][2]'s success largely thrives on implementing its various proposed strategic initiatives. Drupal's focus on strategic initiatives and continuous innovation since Drupal 7 brought huge architectural changes in Drupal 8, 9, and beyond that offer a platform for continuous innovation on the web and an easy upgrade path for end users. - -The vision for Drupal's core strategic initiatives is determined by Dries Buytaert, Drupal project lead. These initiatives are backed by community collaboration and lead to significant developments driven by forces like: - - * Collaboration with the core maintainers - * Survey data and usability studies - * A vision to build a leading open source digital experience platform - * Relevancy in the market by improving editorial, developer, and customer experiences - * Validation by broader community discussions and collaborations - - - -Once initiatives are **proposed**, they move ahead to the **planned** initiatives stage, where each initiative is nurtured with detailed plans and goals by a strong team of contributors. When an initiative passes through this stage, it moves to the **active** initiatives stage. Here's where the initiatives take structure and come alive. - -Some of the most successful Drupal 8 initiatives, like Twig and Bigpipe, did not follow the traditional process. However, following a thoughtfully planned process will avoid a lot of [bike-shedding][3]. - -### Popular past initiatives - -In 2011, at DrupalCon Chicago, Dries announced that Drupal 8 would feature core initiatives that would cause big changes to Drupal's architecture. To support the transition, each initiative would have a few leads involved in decision-making and coordination with Dries. Some popular initiatives included: - - * **Configuration Management Initiative (CMI):** This was the first key initiative announced at the 2011 DrupalCon. The idea was to offer site builders more powerful, flexible, and traceable configuration handling in Drupal 8 core. As planned, the Configuration Manager module is now a Drupal 8 core module that allows deploying configurations between different environments easily. - * **Web Services and Context Core Initiative:** This initiative aimed at embracing a modern web and turned Drupal into a first-class REST server with a first-class content management system (CMS) on top of it. The result? Drupal is now a competent REST server providing the ability to manage content entities through HTTP requests. This is part of why Drupal has been the leading CMS for decoupled experiences for several years. - * **Layout Initiative:** This initiative's focus was on improving and simplifying the site-building experience by non-technical users, like site builders and content authors. This initiative came alive in Drupal 8 by introducing the Layout Discovery API (a Layout plugin API) in v.8.4 and the Layout Builder module (a complete layout management solution) in v.8.5 core. - * **Media Initiative:** The Media Initiative was proposed to launch a rich, intuitive, easy-to-use, API-based media solution with extensible media functionalities in the core. This resulted in bringing in the Media API (which manages various operations on media entities) and Media Library (a rich digital asset management tool) to Drupal 8 core. - * **Drupal 9 Readiness Initiative:** The focus of this initiative was to get Drupal 9 ready by June 3, 2020, so that Drupal 7 and 8 users had at least 18 months to upgrade. Since Drupal 9 is just a cleaned-up version of the last version of Drupal 8 (8.9), the idea was to update dependencies and remove any deprecated code. And as planned, Drupal 9 was successfully released on June 3, 2020. Drupal 8-compatible modules were ported to Drupal 9 faster than any major version upgrade in Drupal's history, with more than 90% of the top 1,000 modules already ported (and many of the remaining now obsolete). - - - -### The new strategic initiatives - -Fast-forward to 2021, where everything is virtual. DrupalCon North America will witness a first-of-its-kind "Initiative Days" event added to the traditional DrupalCon content. Previously, initiatives were proposed during the [Driesnote][4] session, but this time, initiatives are more interactive and detailed. DrupalCon North America 2021 participants can learn about an initiative and participate in building components and contributing back to the project. - -#### The Decoupled Menus Initiative - -Dries proposed the Decoupled Menus Initiative in his keynote speech during DrupalCon Global 2020. While this initiative's broader intent is to make Drupal the best decoupled CMS, to accomplish the larger goal, the project chose to work on decoupled menus as a first step because menus are used on every project and are not easy to implement in decoupled architectures. - -The goals of this initiative are to build APIs, documentation, and examples that can: - - * Give JavaScript front-end developers the best way to integrate Drupal-managed menus into their front ends. - * Provide site builders and content editors with an easy-to-use experience to build and update menus independently. - - - -This is because, without web services for decoupled menus in Drupal core, JavaScript developers are often compelled to hard-code menu items. This makes it really hard for a non-developer to edit or remove a menu item without getting a developer involved. The developer needs to make the change, build the JavaScript code, and then deploy it to production. With the Decoupled Menus Initiative, the developer can easily eliminate all these steps and many lines of code by using Drupal's HTTP APIs and using JavaScript-focused resources. - -The bigger idea is to establish patterns and a roadmap that can be adapted to solve other decoupled problems. At DrupalCon 2021, on the [Decoupled Menus Initiative day][5], April 13, you can both learn about where it stands and get involved by building custom menu components and contributing them back to the project. - -#### The Easy Out-Of-The-Box Initiative - -During DrupalCon 2019 in Amsterdam, CMS users were asked about their perceptions of their CMS. The research found that beginners did not favor Drupal as much as intermediate- and expert-level users. However, it was the opposite for other CMS users; they seemed to like their CMS less over time. - -![CMS users' preferences][6] - -([Driesnote, DrupalCon Global 2020][7]) - -Hence, the Easy Out-Of-The-Box Initiative's goal is to make Drupal easy to use, especially for non-technical users and beginners. It is an extension of the great work that has been done for Layouts, Media, and Claro. Layout Builder's low-code design flexibility, Media's robust management of audio-visual content, and Claro's modern and accessible administrative UI combine to empower less-technical users with the power Drupal has under the hood. - -This initiative bundles all three of these features into one initiative and aims to provide a delightful user experience. The ease of use can help attract new and novice users to Drupal. On April 14, DrupalCon North America's [Easy Out-Of-The-Box Initiative day][8], the initiative leads will discuss the initiative and its current progress. Learn about how you can contribute to the project by building a better editorial experience. - -#### Automated Updates Initiative - -The results of a Drupal survey in 2020 revealed that automated updating was the most frequently requested feature. Updating a Drupal site manually can be tedious, expensive, and time-consuming. Luckily, the initiative team has been on this task since 2019, when the first prototype for the Automated Update System was developed as a [contributed module][9]. The focus of the initiative now is to bring this feature into Drupal core. As easy as it may sound, there's a lot more work that needs to go in to: - - * Ensure site readiness for a safe update - * Integrate composer - * Verify updates with package signing - * Safely apply updates in a way that can be rolled back in case of errors - - - -In its first incarnation, the focus is on Drupal Core patch releases and security updates, but the intent is to support the contributed module ecosystem as well. - -The initiative intends to make it easier for small to midsized businesses that sometimes overlook the importance of updating their Drupal site or struggle with the manual process. The [Automated Updates Initiative day][10] is happening on April 15 at DrupalCon North America. You will get an opportunity to know more about this initiative and get involved in the project. - -#### Drupal 10 Readiness Initiative - -With the release of Drupal 10 not too far away (as early as June 2022), the community is gearing up to welcome a more modern version of Drupal. Drupal now integrates more third-party technologies than ever. Dependencies such as Symfony, jQuery, Guzzle, Composer, CKEditor, and more have their own release cycles that Drupal needs to align with. - -![CMS Release Cycles][11] - -([Driesnote, DrupalCon 2020][7]) - -The goal of the initiative is to get Drupal 10 ready, and this involves: - - * Releasing Drupal 10 on time - * Getting compatible with the latest versions of the dependencies for security - * Deprecating the dependencies, libraries, modules, and themes that are no longer needed and removing them from Drupal 10 core. - - - -At the [Drupal 10 Readiness Initiative day][12], April 16, you can learn about the tools you'll use to update your websites and modules from Drupal 9 to Drupal 10 efficiently. There are various things you can do to help make Drupal better. Content authors will get an opportunity to peek into the new CKEditor 5, its new features, and improved editing experience. - -### Learn more at DrupalCon - -Drupal is celebrating its 20th year and its evolution to a more relevant, easier to adopt open source software. Leading an evolution is close to impossible without taking up strategic initiatives. Although the initial initiatives did not focus on offering great user experiences, today, ease of use and out-of-the-box experience are Drupal's most significant goals. - -Our ambition is to create software that works for everyone. At every DrupalCon, the intent is to connect with the community that fosters the same belief, learn from each other, and ultimately, build a better Drupal. - -[DrupalCon North America][13], hosted by the Drupal Association, is the largest Drupal event of the year. Drupal experts, enthusiasts, and users will unite online April 12–16, 2021, share lessons learned and best practices, and collaborate on creating better, more engaging digital experiences. PHP and JavaScript developers, designers, marketers, and anyone interested in a career in open source will be able to learn, connect, and build by attending DrupalCon. - -The [Drupal Association][14] is the nonprofit organization focused on accelerating Drupal, fostering the Drupal community's growth, and supporting the project's vision to create a safe, secure, and open web for everyone. DrupalCon is the primary source of funding for the Drupal Association. Your support and attendance at DrupalCon make our work possible. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/drupal-updates - -作者:[Shefali Shetty][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/shefalishetty -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) -[2]: https://www.drupal.org/ -[3]: https://en.wikipedia.org/wiki/Law_of_triviality -[4]: https://events.drupal.org/global2020/program/driesnote -[5]: https://events.drupal.org/northamerica2021/decoupled-menus-day -[6]: https://opensource.com/sites/default/files/uploads/cms_preferences.png (CMS users' preferences) -[7]: https://youtu.be/RIeRpLgI1mM -[8]: https://events.drupal.org/northamerica2021/easy-out-box-day -[9]: http://drupal.org/project/automatic_updates/ -[10]: https://events.drupal.org/northamerica2021/automatic-updates-day -[11]: https://opensource.com/sites/default/files/uploads/cms_releasecycles.png (CMS Release Cycles) -[12]: https://events.drupal.org/northamerica2021/drupal-10-readiness-day -[13]: https://events.drupal.org/northamerica2021?utm_source=replyio&utm_medium=email&utm_campaign=DCNA2021-20210318 -[14]: https://www.drupal.org/association diff --git a/sources/tech/20210414 Fedora Workstation 34 feature focus- Btrfs transparent compression.md b/sources/tech/20210414 Fedora Workstation 34 feature focus- Btrfs transparent compression.md deleted file mode 100644 index 530feb0a03..0000000000 --- a/sources/tech/20210414 Fedora Workstation 34 feature focus- Btrfs transparent compression.md +++ /dev/null @@ -1,145 +0,0 @@ -[#]: subject: (Fedora Workstation 34 feature focus: Btrfs transparent compression) -[#]: via: (https://fedoramagazine.org/fedora-workstation-34-feature-focus-btrfs-transparent-compression/) -[#]: author: (nickavem https://fedoramagazine.org/author/nickavem/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Fedora Workstation 34 feature focus: Btrfs transparent compression -====== - -![][1] - -Photo by [Patrick Lindenberg][2] on [Unsplash][3] - -The release of Fedora 34 grows ever closer, and with that, some fun new features! A [previous feature focus][4] talked about some changes coming to GNOME version 40. This article is going to go a little further under the hood and talk about data compression and _transparent compression_ in _btrfs_. A term like that may sound scary at first, but less technical users need not be wary. This change is simple to grasp, and will help many Workstation users in several key areas. - -### What is transparent compression exactly? - -Transparent compression is complex, but at its core it is simple to understand: it makes files take up less space. It is somewhat like a compressed tar file or ZIP file. Transparent compression will dynamically optimize your file system’s bits and bytes into a smaller, reversible format. This has many benefits that will be discussed in more depth later on, however, at its core, it makes files smaller. This may leave most computer users with a question: “I can’t just read ZIP files. You need to decompress them. Am I going to need to constantly decompress things when I access them?”. That is where the “transparent” part of this whole concept comes in. - -Transparent compression makes a file smaller, but the final version is indistinguishable from the original by the human viewer. If you have ever worked with Audio, Video, or Photography you have probably heard of the terms “lossless” and “lossy”. Think of transparent compression like a lossless compressed PNG file. You want the image to look exactly like the original. Small enough to be streamed over the web but still readable by a human. Transparent compression works similarly. Your file system will look and behave the same way as before (no ZIP files everywhere, no major speed reductions). Everything will look, feel, and behave the same. However, in the background it is taking up much less disk space. This is because BTRFS will dynamically compress and decompress your files for you. It’s “Transparent” because even with all this going on, you won’t notice the difference. - -> You can learn more about transparent compression at - -### Transparent compression sounds cool, but also too good to be true… - -I would be lying if I said transparent compression doesn’t slow some things down. It adds extra CPU cycles to pretty much any I/O operation, and can affect performance in certain scenarios. However, Fedora is using the extremely efficient _zstd:1_ algorithm. [Several tests][5] show that relative to the other benefits, the downsides are negligible (as I mentioned in my explanation before). Better disk space usage is the greatest benefit. You may also receive reduction of write amplification (can increase the lifespan of SSDs), and enhanced read/write performance. - -Btrfs transparent compression is extremely performant, and chances are you won’t even notice a difference when it’s there. - -### I’m convinced! How do I get this working? - -In fresh **installations of Fedora 34 and its [corresponding beta][6], it should be enabled by default. However, it is also straightforward to enable before and after an upgrade from Fedora 33. You can even enable it in Fedora 33, if you aren’t ready to upgrade just yet. - - 1. (Optional) Backup any important data. The process itself is completely safe, but human error isn’t. - 2. To truly begin you will be editing your _[fstab][7]_. This file tells your computer what file systems exist where, and how they should be handled. You need to be cautious here, but only a few small changes will be made so don’t be intimidated. On an installation of Fedora 33 with the default Btrfs layout the _/etc/fstab_ file will probably look something like this: - - -``` - -``` - -<strong>$ $EDITOR /etc/fstab</strong> -UUID=1234 /                       btrfs   subvol=root     0 0 -UUID=1234 /boot                   ext4    defaults        1 2 -UUID=1234         /boot/efi               vfat    umask=0077,shortname=winnt 0 2 -UUID=1234 /home                   btrfs   subvol=home     0 0 -``` - -``` - -NOTE: _While this guide builds around the standard partition layout, you may be an advanced enough user to partition things yourself. If so, you are probably also advanced enough to extrapolate the info given here onto your existing system. However, comments on this article are always open for any questions._ - -Disregard the _/boot_ and _/boot/efi_ directories as they aren’t ([currently][8]) compressed. You will be adding the argument _compress=zstd:1_. This tells the computer that it should transparently compress any newly written files if they benefit from it. Add this option in the fourth column, which currently only contains the _subvol_ option for both /home and /: -``` - -``` - -UUID=1234 /                       btrfs   subvol=root,compress=zstd:1     0 0 -UUID=1234 /boot                   ext4    defaults        1 2 -UUID=1234         /boot/efi               vfat    umask=0077,shortname=winnt 0 2 -UUID=1234 /home                   btrfs   subvol=home,compress=zstd:1     0 0 -``` - -``` - -Once complete, simply save and exit (on the default _nano_ editor this is CTRL-X, SHIFT-Y, then ENTER). - -3\. Now that fstab has been edited, tell the computer to read it again. After this, it will make all the changes required: - -``` -$ sudo mount -o remount / /home/ -``` - -Once you’ve done this, you officially have transparent compression enabled for all newly written files! - -### Recommended: Retroactively compress old files - -Chances are you already have many files on your computer. While the previous configuration _will_ compress all newly written files, those old files will not benefit. I recommend taking this next (but optional) step to receive the full benefits of transparent compression. - - 1. (Optional) Clean out any data you don’t need (empty trash etc.). This will speed things up. However, it’s not required. - 2. Time to compress your data. One simple command can do this, but its form is dependent on your system. Fedora Workstation (and any other desktop spins using the DNF package manager) should use: - - - -``` -$ sudo btrfs filesystem defrag -czstd -rv / /home/ -``` - -Fedora Silverblue users should use: - -``` -$ sudo btrfs filesystem defrag -czstd -rv / /var/home/ -``` - -Silverblue users may take note of the immutability of some parts of the file system as described [here][9] as well as this [Bugzilla entry][10]. - -NOTE: _You may receive several warnings that say something like “Cannot compress permission denied.”. This is because some files, on Silverblue systems especially, the user cannot easily modify. This is a tiny subset of files. They will most likely compress on their own, in time, as the system upgrades._ - -Compression can take anywhere from a few minutes to an hour depending on how much data you have. Luckily, since all new writes are compressed, you can continue working while this process completes. Just remember it may partially slow down your work at hand and/or the process itself depending on your hardware. - -Once this command completes you are officially fully compressed! - -### How much file space is used, how big are my files - -Due to the nature of transparent compression, utilities like _du_ will only report exact, uncompressed, files space usage. This is not the actual space they take up on the disk. The [_compsize_][11] utility is the best way to see how much space your files are actually taking up on disk. An example of a _compsize_ command is: - -``` -$ sudo compsize -x / /home/ -``` - -This example provides exact information on how the two locations, / and /home/ are currently, transparently, compressed. If not installed, this utility is available in the Fedora Linux repository. - -### Conclusion: - -Transparent compression is a small but powerful change. It should benefit everyone from developers to sysadmin, from writers to artists, from hobbyists to gamers. It is one among many of the changes in Fedora 34. These changes will allow us to take further advantage of our hardware, and of the powerful Fedora Linux operating system. I have only just touched the surface here. I encourage those of you with interest to begin at the [Fedora Project Wiki][12] and [Btrfs Wiki][13] to learn more! - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/fedora-workstation-34-feature-focus-btrfs-transparent-compression/ - -作者:[nickavem][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/nickavem/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/btrfs_compression-1-816x345.jpg -[2]: https://unsplash.com/@heapdump?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[3]: https://unsplash.com/s/photos/hdd-compare?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: https://fedoramagazine.org/fedora-34-feature-focus-updated-activities-overview/ -[5]: https://fedoraproject.org/wiki/Changes/BtrfsTransparentCompression#Simple_Analysis_of_btrfs_zstd_compression_level -[6]: https://fedoramagazine.org/announcing-fedora-34-beta/ -[7]: https://en.wikipedia.org/wiki/Fstab -[8]: https://fedoraproject.org/wiki/Changes/BtrfsTransparentCompression#Q:_Will_.2Fboot_be_compressed.3F -[9]: https://docs.fedoraproject.org/en-US/fedora-silverblue/technical-information/#filesystem-layout -[10]: https://bugzilla.redhat.com/show_bug.cgi?id=1943850 -[11]: https://github.com/kilobyte/compsize -[12]: https://fedoraproject.org/wiki/Changes/BtrfsTransparentCompression -[13]: https://btrfs.wiki.kernel.org/index.php/Compression diff --git a/sources/tech/20210419 How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution.md b/sources/tech/20210419 How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution.md deleted file mode 100644 index 97fd223969..0000000000 --- a/sources/tech/20210419 How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution.md +++ /dev/null @@ -1,282 +0,0 @@ -[#]: subject: (How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution) -[#]: via: (https://itsfoss.com/deploy-seafile-server-docker/) -[#]: author: (Hunter Wittenborn https://itsfoss.com/author/hunter/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution -====== - -First off, what is Seafile? - -[Seafile][1] is a self-hosted file synchronization program that works with the server-client model, as in you have several devices like your laptop and phone that connect to a central server. - -Unlike some more popular alternatives like [Nextcloud or ownCloud][2], Seafile tries to follow the philosophy of “do one thing only, but do it well”. Likewise, Seafile doesn’t have extra goodies built in like Contacts or Calendar integration. - -Seafile instead focuses solely on file syncing, sharing, and the things surrounding it, and that’s it. As a result of that though, it ends up doing so _extremely_ well. - -### Deploying Seafile Server with Docker and NGINX - -Advanced tutorial - -Most tutorials on It’s FOSS are focused on beginners. This one is not. It is intended for advanced users who tinker a lot with DIY projects and prefer to self-host. -This tutorial presumes that you are comfortable using the command line, and that you are at least decently knowledgeable with the programs we’ll be using. - -While the whole process could be done without using NGINX at all, using NGINX will allow for an easier setup, as well as making it significantly easier to self-host more services in the future. - -If you want to use a full-on Docker setup, you could set up [NGINX inside of Docker][3] as well, but it will only make things more complex and doesn’t add too much of a benefit, and likewise won’t be covered in this tutorial. - -#### Installing and Setting Up NGINX - -_**I will be using Ubuntu in this tutorial and will thus be using apt to install packages. If you use Fedora or some other non-Debian distribution, please use your distribution’s [package manager][4].**_ - -[NGINX][5], as well as being a web server, is what’s known as a proxy. It will function as the connection between the Seafile server and the internet, whilst also making several tasks easier to deal with. - -To install NGINX, use the following command: - -``` -sudo apt install nginx -``` - -If you want to use HTTPS (that little padlock in your browser), you will also need to install [Certbot][6]: - -``` -sudo apt install certbot python3-certbot-nginx -``` - -Next, you need to configure NGINX to connect to the Seafile instance that we set up later. - -First, run the following command: - -``` -sudo nano /etc/nginx/sites-available/seafile.conf -``` - -Enter the following text into the file: - -``` -server { - server_name localhost; - location / { - proxy_pass http://localhost:8080; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - } -} -``` - -**Important**: Replace **localhost** on the **server_name** line with the address you’ll be accessing your server from (i.e. **seafile.example.com** or **192.168.0.0**). Not sure what to put? - - * If you are testing just for the sake of it, use localhost. This setup will **only allow you to access the server from your computer**, and that’s it. - * If you want to use Seafile across your local WiFi connection(any device on the same WiFi network as you), you should enter [your computer’s IP address][7]. You may also want to look into [setting a static IP address][8], though it isn’t necessary. - * If you have a public IP address that you know points to your system, use that. - * If you have a domain name(i.e. **example.com**, **example.org**) _and_ a public IP address for your system, change your DNS settings to point the domain name to your system’s IP address. This will also require the public IP address to point to your system. - - - -Now you need to copy the config file to the directory NGINX looks at for files, then restart NGINX: - -``` -sudo ln -s /etc/nginx/sites-available/seafile.conf /etc/nginx/sites-enabled/seafile.conf -sudo systemctl restart nginx -``` - -If you set up Certbot, you’ll also need to run the following to set up HTTPS: - -``` -sudo certbot -``` - -If asked to redirect HTTP traffic to HTTPS, choose **2**. - -Now would be a good time to make sure everything we’ve set up so far is working. If you visit your site, you should get a screen that says something on the lines of `502 Bad Gateway`. - -![][9] - -#### Install Docker and Docker Compose - -Now to get into the fun stuff! - -First things first, you need to have [Docker][10] and [Docker Compose][11] installed. Docker Compose is needed to utilize a docker-compose.yml file, which will make managing the various Docker [containers][12] Seafile needs easier. - -Docker and Docker Compose can be installed with the following command: - -``` -sudo apt install docker.io docker-compose -``` - -To check if Docker is installed and running, run the following: - -``` -sudo docker run --rm hello-world -``` - -You should see something along the lines of this in your terminal if it completed successfully: - -![][13] - -If you would like to avoid adding `sudo` to the beginning of the `docker` command, you can run the following commands to add yourself to the `docker` group: - -``` -sudo groupadd docker -sudo usermod -aG docker $USER -``` - -The rest of this tutorial assumes you ran the above two commands. If you didn’t, add `sudo` to all commands that start with `docker` or `docker-compose`. - -#### Installing Seafile Server - -This part is significantly easier than the part before this. All you need to do is put some text into a file and run a few commands. - -Open up a terminal. Then create a directory where you’d like the contents of the Seafile server to be stored and enter the directory: - -``` -mkdir ~/seafile-server && cd ~/seafile-server -``` - -![][14] - -Go to the directory you created and run the following: - -``` -nano docker-compose.yml -``` - -Next, enter the text below into the window that pops up: - -``` -version: '2.0' -services: - db: - image: mariadb - container_name: seafile-mysql - environment: - - MYSQL_ROOT_PASSWORD=password - - MYSQL_LOG_CONSOLE=true - volumes: - - ./data/mariadb:/var/lib/mysql - networks: - - seafile-net - - memcached: - image: memcached - container_name: seafile-memcached - entrypoint: memcached -m 256 - networks: - - seafile-net - - seafile: - image: seafileltd/seafile-mc - container_name: seafile - ports: - - "8080:80" - volumes: - - ./data/app:/shared - environment: - - DB_HOST=db - - DB_ROOT_PASSWD=password - - TIME_ZONE=Etc/UTC - - [email protected] - - SEAFILE_ADMIN_PASSWORD=password - - SEAFILE_SERVER_LETSENCRYPT=false - - SEAFILE_SERVER_HOSTNAME=docs.seafile.com - depends_on: - - db - - memcached - networks: - - seafile-net - -networks: - seafile-net: -``` - -Before saving the file, a few things will need to be changed: - - * **MYSQL_ROOT_PASSWORD**: Change to a stronger password, you _don’t_ need to remember this, so don’t try to pick anything easy. If you need help making one, use a [password generator][15]. I’d recommend 20 characters long and avoiding any special characters(all the **[[email protected]][16]#$%^&*** symbols). - * **DB_ROOT_PASSWD**: Change to the value you set for ****MYSQL_ROOT_PASSWORD****. - * ****SEAFILE_ADMIN_EMAIL****: Sets the email address for the admin account. - * **SEAFILE_ADMIN_PASSWORD**: Sets the password for the admin account. Avoid making this the same as **MYSQL_ROOT_PASSWORD** or **DB_ROOT_PASSWD**. - * **SEAFILE_SERVER_HOSTNAME**: Set to the address you set in the NGINX configuration. - - - -With that done, you can bring up the whole thing with `docker-compose`: - -``` -docker-compose up -d -``` - -It might take a minute or two depending on your internet connection, as it has to pull down several containers that Seafile needs to run. - -After it’s done, give it a few more minutes to finish up. You can also check the status of it by running the following: - -``` -docker logs seafile -``` - -When it’s done, you’ll see the following output: - -![][17] - -Next, just type the address you set for ****SEAFILE_SERVER_HOSTNAME**** into your browser, and you should be at a login screen. - -![][18] - -And there you go! Everything’s now fully functional and ready to be used with the clients. - -#### Installing the Seafile Clients - -Seafile on mobile is available on [Google Play][19], [F-Droid][20], and on the [iOS App Store][21]. Seafile also has desktop clients available for Linux, Windows, and Mac, available [here][22]. - -Seafile is readily available on Ubuntu systems via the `seafile-gui` package: - -``` -sudo apt install seafile-gui -``` - -Seafile is also in the AUR for Arch users via the `seafile-client` package. - -### Closing Up - -Feel free to explore the clients and all they have to offer. I’ll go into all of what the Seafile clients are capable of in a future article (stay tuned 😃). - -If something’s not working right, or you just have a question in general, feel free to leave it in the comments below – I’ll try to respond whenever I can! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/deploy-seafile-server-docker/ - -作者:[Hunter Wittenborn][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/hunter/ -[b]: https://github.com/lujun9972 -[1]: https://www.seafile.com/en/home/ -[2]: https://itsfoss.com/nextcloud-vs-owncloud/ -[3]: https://linuxhandbook.com/nginx-reverse-proxy-docker/ -[4]: https://itsfoss.com/package-manager/ -[5]: https://www.nginx.com/ -[6]: https://certbot.eff.org/ -[7]: https://itsfoss.com/check-ip-address-ubuntu/ -[8]: https://itsfoss.com/static-ip-ubuntu/ -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/nginx_bad_gateway.png?resize=489%2C167&ssl=1 -[10]: https://www.docker.com/ -[11]: https://docs.docker.com/compose/ -[12]: https://www.docker.com/resources/what-container -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/seafile-docker-helloworld.png?resize=752%2C416&ssl=1 -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/seafile-dir.png?resize=731%2C174&ssl=1 -[15]: https://itsfoss.com/password-generators-linux/ -[16]: https://itsfoss.com/cdn-cgi/l/email-protection -[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/seafile-running.png?resize=752%2C484&ssl=1 -[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/seafile-login.jpg?resize=800%2C341&ssl=1 -[19]: https://play.google.com/store/apps/details?id=com.seafile.seadroid2 -[20]: https://f-droid.org/repository/browse/?fdid=com.seafile.seadroid2 -[21]: https://itunes.apple.com/cn/app/seafile-pro/id639202512?l=en&mt=8 -[22]: https://www.seafile.com/en/download/ diff --git a/sources/tech/20210424 Getting Started With Markdown -Beginner-s Guide.md b/sources/tech/20210424 Getting Started With Markdown -Beginner-s Guide.md deleted file mode 100644 index 74b14bf09c..0000000000 --- a/sources/tech/20210424 Getting Started With Markdown -Beginner-s Guide.md +++ /dev/null @@ -1,303 +0,0 @@ -[#]: subject: (Getting Started With Markdown [Beginner’s Guide]) -[#]: via: (https://itsfoss.com/markdown-guide/) -[#]: author: (Bill Dyer https://itsfoss.com/author/bill/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Getting Started With Markdown [Beginner’s Guide] -====== - -In my work, I often have to write code, write the documentation that goes with that code, create Web pages, and work on text restoration projects, and have written several formal papers while I was in school. I can include class notes here, too; I needed to write them for nearly every class. - -I use Markdown for nearly all of my writing and it is a major time-saver for me. - -In this article, I am going to share my experience with Markdown. You’ll be learning the following: - - * What is Markdown? - * How does it work? - * Markdown basic syntax and how to use them - - - -### What is Markdown? - -If you are new to Markdown, it is a text-to-HTML conversion tool for web writers. Markdown files follow a specific syntax that is easy to read and just as easy to write. They are plain text files so they can be created using any text editor on any computer. These files can then be turned into Web pages – and Web pages are built using a markup called HTML. - -Markdown then, is just a way to create Web pages without the need (or even know how) to write HTML code. Actually, Markdown is an great way to format plain text even if you don’t have to convert to HTML. Someone once described Markdown to me this way: - -> “It isn’t _what you see is what you get_, but _what you see is what you mean_”. - -Markdown, however, is more than an easy formatting scheme, it is also a software tool that converts the plain text formatting to HTML. - -This is why the syntax is important. If you want a title on your Web page, Markdown will create one based on the character(s) you use in front of your title. A sampling of some of Markdown’s syntax is shown this screenshot: - -![Markdown to HTML conversion][1] - -### So how do I make this plain text to HTML conversion? - -John Gruber’s Markdown is a Perl script that is run on the command line. Basically, it reads the Markdown text that you create and builds a Web page from it. - -I will avoid the command line here since there are [many outstanding Markdown editors][2] that can do this conversion for you. Not only that, many of these editors will let you write your text and show you what the Web page will look like (called _rendering_) at the same time. - -Markdown editors are generally set up to show two frames. The left frame is where you write your text and the right frame shows you what the formatted text will look like in HTML: - -![Most Markdown editors have two panes to write and preview the text][3] - -When you are finished with your text and are happy with it, simply save the Markdown file. This way, you’ll always have it in case you need to edit or rewrite later. Once the file is saved, you can have the editor export the markdown file to HTML. - -The editor will create the Web page, using your Markdown as a reference. Your Markdown file will not be changed during an export – you will still have it – along with a separate, newly created HTML (Web page) file that you can put on a Web server. - -**Note**: Many Markdown editors can also export your Markdown files to other formats, such as `.doc`, `.docx`, and `.pdf`. You can learn about those advanced setups, and extra software you might need, later on. - -### Basic Markdown Syntax - -To get the new Markdown user up to speed quickly, I will limit this to cover the syntax I use most often. These, I believe will be the most helpful – you can be productive now while you learn more about what Markdown can do for you later on. - -#### Write Headings - -I normally use `#` characters to denote headings. There are six levels: - -``` -# Level 1 Heading -## Level 2 Heading -### Level 3 Heading -#### Level 4 Heading -##### Level 5 Heading -###### Level 6 Heading -``` - -There is another heading style that uses lines underneath the text. I rarely use this type of heading since I am limited to only two. A double line, which is made with the `=` character, makes a `H1` heading. A single line, made with the `-` character, makes a `H2` heading: - -``` -Level 1 Heading -=============== - -Level 2 Heading ---------------- -``` - -![][4] - -#### Paragraphs - -Paragraphs are separated by a blank line (make sure that there is a blank line between paragraphs). Do not indent the first line at all. Indenting with a `` or `` has a different purpose in Markdown. - -A paragraph is a block of text and should not be indented with spaces or tabs. It can have one line or many lines. To end a paragraph and start a new one, the `` key is hit twice; paragraphs are separated by a blank line. - -![][5] - -#### Line Breaks - -Remember that with paragraphs, a blank line has to separate them and this is done by pressing twice on the `` key. Markdown is strict about it. - -Markdown does not support “hard-wrapped” or “fixed-line-length” paragraphs. That is, hitting the `` key once will not force text to a new line. It may appear so in the editing window, but the HTML won’t show it. - -Yet, there will be times when you may need to break up paragraphs with some way to break up a line. Markdown does have a way to do this but it may seem a little strange at first: **a line break is made by ending a line with two or more spaces and then hitting the `` key once.** - -![][6] - -Here is a working example of a short verse. Each line has two spaces at the end. The last line, since it’s the end of the verse, doesn’t have the extra spaces. Since it’s the end of the verse (paragraph), I hit the `` key twice: - -Baa, baa black sheep, -Have you any wool?. -Yes, sir. Yes, sir. -Three bags full. - -Adding two spaces at the end of a line, to create a line break, can take some getting used to. - -![][7] - -#### Horizontal Rules - -Horizontal rules are great for splitting up text into sections. - -Use three or more dashes `-`, underscores `_`, or asterisks `*` for horizontal rules, like so: - -``` -`---` - -`***` - -`___` -``` - -You can even put spaces between the characters: - -``` -`- - -` -``` - -I do not use horizontal rules very often in articles or papers, but they come in handy for me in journal entries, system logs, and class notes. - -![][8] - -#### Emphasis on text with bold and italics - -When you want a word or phrase to stand out and be noticed, you can either make it bold or italicized. Italics and bold text can be made on one of two ways. The first is by surrounding the text with asterisks `*`, while the second is to use underscores `_`. - -To italicize a word or phrase, surround the text with one underscore or asterisk. To make a word or phrase bold, surround it with two underscores or asterisks: - -``` -This is *italics* made with asterisks. - -This is _italics_ made with underscores. - -This is **bold** made with asterisks. - -This is __bold__ made with underscores. -``` - -Remember to use the same character. An asterisk on one side of a word or phrase, and an underscore on the side, will not work. The same character has to be on both sides of the word or phrase. - -![][9] - -#### Block quotes - -Block quotes are used for direct quotes. If you were writing a blog entry and you wanted to repeat something that Benjamin Franklin said, you could use a block quote. - -A right angle bracket is used to specify a block quote: - -``` -> This is a block quote. - ->> Use two right angle brackets if you want a block quote that is further indented. -``` - -![][10] - -#### Adding links in Markdown - -Links are just plain cool. There are three ways to create links on basic Markdown, but I will only cover two here: Regular links and automatic links. - -The third type of link, called reference links, are supported in basic Markdown and more advanced flavors. I want to get to started quickly. You can look up reference links when you are ready for that. - -Regular links let you link to various websites. The name of the site, or a phrase you want to use, is placed in square brackets `[]`. The actual link is inside parentheses `()`. - -``` -Visit [It's FOSS](https://itsfoss.com) today! -``` - -Automatic links are made with angle brackets `<>` surrounding the link. The link is an actual address (either a Web or email address). The link is spelled out and, when it is converted to HTML, the spelled out link becomes a working link. - -``` - - -<[email protected]> -``` - -This is useful for when you want to spell out the address in your text: - -![][11] - -#### Adding images in Markdown - -Links to images are almost identical to links to Web sites. The small difference between site links and images, is that image links begin with a bang (exclamation point) `!` - -The name of the image, or a descriptive phrase of the image, is placed in square brackets `[]`. The actual link is inside parentheses `()`. - -You can embed images like so: - -``` -![alternate text](./images/image.jpg) -``` - -Here’s an example image link. It is a sample link, with no image, but it is a decent sample of how an actual link might look like: - -``` -![a picture of bill](./images/my_photo_of_me.jpg) -``` - -![][12] - -#### Lists - -Lists are made for many reasons. They can be used as ‘things to do’ items, topic elements in an outline, parts lists in an assembly project, and so on. There are two main types of lists: unordered and ordered. - -Unordered lists are not numbered; these are the ‘bullet items’ we see in many documents. Ordered lists are numbered. - -To create an ordered (numbered) list, just begin each line with a number, like so: - -``` -1. Item one. -2. Item two. -3. Item three. -``` - -Unordered lists are not numbered, but use either an asterisk `*`, a plus sign `+`, or a minus sign `-` at the beginning of each item on the list. I prefer to use either an asterisk or minus sign, but you get to choose: - -``` -* Item one. -+ Item two. -- Item three. -``` - -Sub-items can be added to both ordered and unordered lists by indenting, like so: - -``` -1. Item 1 - 1. Sub-item 1 - 2. Sub-item 2 -2. Item 2 -3. Item 3 -``` - -![][13] - -### Markdown syntax cheat sheet - -For your reference, here is a short listing of Markdown syntax that has been covered in this small introduction. - -If you decide to adopt it as a writing tool, you’ll find that Markdown has the means to simplify writing even more. - -![][14] - -[Download Markdown Cheat Sheet in PDF format][15] - -### Conclusion - -Markdown can do more than what I have described here. A huge percentage of my writing can be accomplished with the Markdown syntax I have covered here – and these are the items I use most often even in more complex projects. - -If all of this seems too simple, it really is that easy. Markdown was built to simply the writing task, but you don’t have to take my word for it. Try it out! There is no need to install a Markdown editor; you can do this online. There are several [good online Markdown editors][16]. Here are three that I prefer: - -John Gruber’s [Dingus][17], [Editor.md][18], and [Dillinger][19]. Editor.md and Dillinger will let you see your Markdown rendered as HTML in real time. Dingus doesn’t preview in real time, but there is a Markdown syntax cheat sheet on the page for reference. - -![][20] - -Try out some of the examples in this article on either of these online editors. Try out some of your own ideas, too. This will let you get used to Markdown before possibly committing to learn more about it. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/markdown-guide/ - -作者:[Bill Dyer][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/bill/ -[b]: https://github.com/lujun9972 -[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/retext_window_showing_syntax_and_preview-2.png?resize=800%2C429&ssl=1 -[2]: https://itsfoss.com/best-markdown-editors-linux/ -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/ghostwriter_two_frames-1.png?resize=800%2C458&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/1_md_headings_vscodium.png?resize=800%2C485&ssl=1 -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/2_md_paragraphs_example_vscodium.png?resize=800%2C593&ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/3_md_line_break_fail_vscodium.png?resize=800%2C593&ssl=1 -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/4_md_line_break_success_vscodium.png?resize=800%2C450&ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/5_md_horizontal_rules_vscodium.png?resize=800%2C326&ssl=1 -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/6_md_emphasis_vscodium.png?resize=800%2C393&ssl=1 -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/7_md_blockquotes_vscodium.png?resize=800%2C393&ssl=1 -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/8_md_links_vscodium.png?resize=800%2C678&ssl=1 -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/9_md_images_vscodium.png?resize=800%2C725&ssl=1 -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/10_md_lists_vscodium.png?resize=800%2C725&ssl=1 -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/markdown-syntax-cheatsheet.png?resize=727%2C743&ssl=1 -[15]: https://drive.google.com/file/d/1y-Qz9PX_2HksEG5D_WwN-asNB-tpjZHV/view?usp=sharing -[16]: https://itsfoss.com/online-markdown-editors/ -[17]: https://daringfireball.net/projects/markdown/dingus -[18]: http://editor.md.ipandao.com/en.html -[19]: https://dillinger.io/ -[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/editor-md_page_in_browser-1.png?resize=800%2C505&ssl=1 diff --git a/sources/tech/20210428 Share files between Linux and Windows computers.md b/sources/tech/20210428 Share files between Linux and Windows computers.md deleted file mode 100644 index 8ba6282397..0000000000 --- a/sources/tech/20210428 Share files between Linux and Windows computers.md +++ /dev/null @@ -1,274 +0,0 @@ -[#]: subject: (Share files between Linux and Windows computers) -[#]: via: (https://opensource.com/article/21/4/share-files-linux-windows) -[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Share files between Linux and Windows computers -====== -Set up cross-platform file sharing with Samba. -![Blue folders flying in the clouds above a city skyline][1] - -If you work with different operating systems, it's handy to be able to share files between them. This article explains how to set up file access between Linux ([Fedora 33][2]) and Windows 10 using [Samba][3] and [mount.cifs][4]. - -Samba is the Linux implementation of the [SMB/CIFS][5] protocol, allowing direct access to shared folders and printers over a network. Mount.cifs is part of the Samba suite and allows you to mount the [CIFS][5] filesystem under Linux. - -> **Caution**: These instructions are for sharing files within your private local network or in a virtualized host-only network between a Linux host machine and a virtualized Windows guest. Don't consider this article a guideline for your corporate network, as it doesn't implement the necessary cybersecurity considerations. - -### Access Linux from Windows - -This section explains how to access a user's Linux home directory from Windows File Explorer. - -#### 1\. Install and configure Samba - -Start on your Linux system by installing Samba: - - -``` -`dnf install samba` -``` - -Samba is a system daemon, and its configuration file is located in `/etc/samba/smb.conf`. Its default configuration should work. If not, this minimal configuration should do the job: - - -``` -[global] -        workgroup = SAMBA -        server string = %h server (Samba %v) -        invalid users = root -        security = user -[homes] -        comment = Home Directories -        browseable = no -        valid users = %S -        writable = yes -``` - -You can find a detailed description of the parameters in the [smb.conf][6] section of the project's website. - -#### 2\. Modify LinuxSE - -If your Linux distribution is protected by [SELinux][7] (as Fedora is), you have to enable Samba to be able to access the user's home directory: - - -``` -`setsebool -P samba_enable_home_dirs on` -``` - -Check that the value is set by typing: - - -``` -`getsebool samba_enable_home_dirs` -``` - -Your output should look like this: - -![Sebool][8] - -(Stephan Avenwedde, [CC BY-SA 4.0][9]) - -#### 3\. Enable your user - -Samba uses a set of users and passwords that have permission to connect. Add your Linux user to the set by typing: - - -``` -`smbpasswd -a ` -``` - -You will be prompted for a password. This is a _completely new_ password; it is not the current password for your account. Enter the password you want to use to log in to Samba. - -To get a list of allowed user types: - - -``` -`pdbedit -L -v` -``` - -Remove a user by typing: - - -``` -`smbpasswd -x ` -``` - -#### 4\. Start Samba - -Because Samba is a system daemon, you can start it on Fedora with: - - -``` -`systemctl start smb` -``` - -This starts Samba for the current session. If you want Samba to start automatically on system startup, enter: - - -``` -`systemctl enable smb` -``` - -On some systems, the Samba daemon is registered as `smbd`. - -#### 4\. Configure the firewall - -By default, Samba is blocked by your firewall. Allow Samba to access the network permanently by configuring the firewall. - -You can do it on the command line with: - - -``` -`firewall-cmd --add-service=samba --permanent` -``` - -Or you do it graphically with the firewall-config tool: - -![firewall-config][10] - -(Stephan Avenwedde, [CC BY-SA 4.0][9]) - -#### 5\. Access Samba from Windows - -In Windows, open File Explorer. On the address line, type in two backslashes followed by your Linux machine's address (IP address or hostname): - -![Accessing Linux machine from Windows][11] - -(Stephan Avenwedde, [CC BY-SA 4.0][9]) - -You will be prompted for your login information. Type in the username and password combination from step 3. You should now be able to access your home directory on your Linux machine: - -![Accessing Linux machine from Windows][12] - -(Stephan Avenwedde, [CC BY-SA 4.0][9]) - -### Access Windows from Linux - -The following steps explain how to access a shared Windows folder from Linux. To implement them, you need Administrator rights on your Windows user account. - -#### 1\. Enable file sharing - -Open the** Network and Sharing Center** either by clicking on the - -**Windows Button > Settings > Network & Internet** - -or by right-clicking the little monitor icon on the bottom-right of your taskbar: - -![Open network and sharing center][13] - -(Stephan Avenwedde, [CC BY-SA 4.0][9]) - -In the window that opens, find the connection you want to use and note its profile. I used **Ethernet 3**, which is tagged as a **Public network**. - -> **Caution**: Consider changing your local machine's connection profile to **Private** if your PC is frequently connected to public networks. - -Remember your network profile and click on **Change advanced sharing settings**: - -![Change advanced sharing settings][14] - -(Stephan Avenwedde, [CC BY-SA 4.0][9]) - -Select the profile that corresponds to your connection and turn on **network discovery** and **file and printer sharing**: - -![Network sharing settings][15] - -(Stephan Avenwedde, [CC BY-SA 4.0][9]) - -#### 2\. Define a shared folder - -Open the context menu by right-clicking on the folder you want to share, navigate to **Give access to**, and select **Specific people...** : - -![Give access][16] - -(Stephan Avenwedde, [CC BY-SA 4.0][9]) - -Check whether your current username is on the list. Click on **Share** to tag this folder as shared: - -![Tag as shared][17] - -(Stephan Avenwedde, [CC BY-SA 4.0][9]) - -You can display a list of all shared folders by entering `\\localhost` in File Explorer's address line: - -![Shared folders][18] - -(Stephan Avenwedde, [CC BY-SA 4.0][9]) - -![Shared folders][19] - -(Stephan Avenwedde, [CC BY-SA 4.0][9]) - -#### 3\. Mount the shared folder under Linux - -Go back to your Linux system, open a command shell, and create a new folder where you want to mount the Windows share: - - -``` -`mkdir ~/WindowsShare` -``` - -Mounting Windows shares is done with mount.cifs, which should be installed by default. To mount your shared folder temporarily, use: - - -``` -`sudo mount.cifs ///MySharedFolder ~/WindowsShare/ -o user=,uid=$UID` -``` - -In this command: - - * `` is the Windows PC's address info (IP or hostname) - * ``is the user that is allowed to access the shared folder (from step 2) - - - -You will be prompted for your Windows password. Enter it, and you will be able to access the shared folder on Windows with your normal Linux user. - -To unmount the shared folder: - - -``` -`sudo umount ~/WindowsShare/` -``` - -You can also mount a Windows shared folder on system startup. Follow [these steps][20] to configure your system accordingly. - -### Summary - -This shows how to establish temporary shared folder access that must be renewed after each boot. It is relatively easy to modify this configuration for permanent access. I often switch back and forth between different systems, so I consider it incredibly practical to set up direct file access. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/share-files-linux-windows - -作者:[Stephan Avenwedde][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/hansic99 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_cloud21x_cc.png?itok=5UwC92dO (Blue folders flying in the clouds above a city skyline) -[2]: https://getfedora.org/en/workstation/download/ -[3]: https://www.samba.org/ -[4]: https://linux.die.net/man/8/mount.cifs -[5]: https://en.wikipedia.org/wiki/Server_Message_Block -[6]: https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html -[7]: https://www.redhat.com/en/topics/linux/what-is-selinux -[8]: https://opensource.com/sites/default/files/uploads/sebool.png (Enabling Samba to enable user directory access) -[9]: https://creativecommons.org/licenses/by-sa/4.0/ -[10]: https://opensource.com/sites/default/files/uploads/firewall_configuration.png (firewall-config tool) -[11]: https://opensource.com/sites/default/files/uploads/windows_access_shared_1.png (Accessing Linux machine from Windows) -[12]: https://opensource.com/sites/default/files/uploads/windows_acess_shared_2.png (Accessing Linux machine from Windows) -[13]: https://opensource.com/sites/default/files/uploads/open_network_and_sharing_center.png (Open network and sharing center) -[14]: https://opensource.com/sites/default/files/uploads/network_and_sharing_center_2.png (Change advanced sharing settings) -[15]: https://opensource.com/sites/default/files/uploads/network_sharing.png (Network sharing settings) -[16]: https://opensource.com/sites/default/files/pictures/give_access_to.png (Give access) -[17]: https://opensource.com/sites/default/files/pictures/tag_as_shared.png (Tag as shared) -[18]: https://opensource.com/sites/default/files/uploads/show_shared_folder_1.png (Shared folders) -[19]: https://opensource.com/sites/default/files/uploads/show_shared_folder_2.png (Shared folders) -[20]: https://timlehr.com/auto-mount-samba-cifs-shares-via-fstab-on-linux/ diff --git a/sources/tech/20210526 6 exciting new ShellHub features to look for in 2021.md b/sources/tech/20210526 6 exciting new ShellHub features to look for in 2021.md deleted file mode 100644 index 9b5310bd12..0000000000 --- a/sources/tech/20210526 6 exciting new ShellHub features to look for in 2021.md +++ /dev/null @@ -1,139 +0,0 @@ -[#]: subject: (6 exciting new ShellHub features to look for in 2021) -[#]: via: (https://opensource.com/article/21/5/shellhub-new-features) -[#]: author: (Domarys https://opensource.com/users/domarys) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -6 exciting new ShellHub features to look for in 2021 -====== -ShellHub's community has been busy adding new features to the open -source remote-access tool. -![People work on a computer server with devices][1] - -ShellHub is a cloud server that allows universal access to your networked devices from any external network. Using it prevents being blocked by firewalls or overly complex networks because [ShellHub][2] uses the HTTP protocol to encapsulate the SSH protocol. This transport layer allows seamless use on most networks, as it is commonly available and accepted by most companies' firewall rules and policies. - -Best of all, ShellHub is open source (released under the Apache 2.0 license) and facilitates developers' and programmers' remote tasks and making access to Linux devices possible for any hardware architecture. - -For a full demo, please read my previous article, [_Bypass your Linux firewall with SSH over HTTP_][3]. In this follow-up article, I'll cover some of the developments and additions in the [0.7.0 release][4]. - -ShellHub offers a safe and quick way to access your devices from anywhere. It has a robust [community][5], whose contributions are essential to the tool's growth, new features, and improvements. I'll describe some of the updates that are (or will soon be) in the [tool's code][6] below. - -### Namespace - -The namespace enables you to create a set of devices to share with other ShellHub users. You can put as many devices as you want in a namespace, but a device registered in one namespace cannot belong to another. - -You can access your namespace by using the top-right button on the Dashboard. There, you will find the namespace Tenant ID, which is used to register a device, and any other namespaces you have created. You can also create a new namespace and access namespace settings. - -You can rename, delete, and invite other users to your namespace. Namespace user permissions work based on privilege, depending on user rank. (See [Privileges][7] for more information.) - -![Namespace][8] - -(Domarys, [CC BY-SA 4.0][9]) - -This feature is available in all editions. The difference is that in the open source version, you must use the terminal to issue commands: - - -``` -`./bin/add-namespace ` -``` - -![Running namespace commands in the terminal][10] - -(Domarys, [CC BY-SA 4.0][9]) - -### Privileges - -Privileges are an organization-level mode for authoring actions in ShellHub. This ensures only the owner has permissions to do potentially dangerous actions. - -There are two privilege ranks: - - * **ADM:** Only the namespace owner has administrator privileges to run an action. The admin can accept and reject devices; view and delete session recordings; create, change, or delete firewall rules; and invite users to the namespace. - * **USER:** A user must be invited by the owner. A user can access devices and any information in the namespace enabled by the owner but cannot remove devices, change firewall rules, or watch session recordings. - - - -### Session recordings - -This new feature records all actions in a ShellHub connection executed by a user or owner. Session recordings are available in the Dashboard in ShellHub Cloud and Enterprise versions. - -![Session recordings][11] - -(Domarys, [CC BY-SA 4.0][9]) - -The session recording feature is on by default. If you are the owner, you can change this in a namespace's Settings. - -![Session recording settings][12] - -(Domarys, [CC BY-SA 4.0][9]) - -Each session's page has details such as hostname, user, authentication, IP address, and session begin and end time. The device's user ID (UID) is available in Details. - -### Firewall rules - -![Firewall rules][13] - -(Domarys, [CC BY-SA 4.0][9]) - -Firewall rules define network traffic permissions (or blocks) to ShellHub devices. This feature is available in the Cloud and Enterprise editions. These rules allow or prevent a device's connection to defined IPs, users, or hostnames. Rules can be set only by a namespace owner. - -In addition to defining the rules, ShellHub enables an owner to set priorities, which block sets of locations or permit access to a location in a blocked set if necessary. - -### Admin console - -![Admin console][14] - -(Domarys, [CC BY-SA 4.0][9]) - -ShellHub developed the admin console to facilitate user support. It offers an easy and clear interface for administrators of large teams to manage and check the activities executed in the ShellHub server. It's available in the Enterprise edition. - -### Automatic access with public keys - -![ShellHub public key][15] - -(Domarys, [CC BY-SA 4.0][9]) - -Automatic connection using public keys is a new feature that will be released soon. It aims to simplify access for users with many different devices and credentials because using a public key makes access quicker and more secure. - -The ShellHub server keeps public key information safe and uses the key only for logging into devices. It also does not have access to users' private keys or other sensitive information. - -Automatic connections using public keys is a recent feature added in ShellHub. - -### Learn more - -Stay up to date on this and other new features and updates on OS Systems' [Twitter][16], [LinkedIn][17], [GitHub][18], or [website][19]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/shellhub-new-features - -作者:[Domarys][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/domarys -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices) -[2]: https://www.shellhub.io/ -[3]: https://opensource.com/article/20/7/linux-shellhub -[4]: https://github.com/shellhub-io/shellhub/releases/tag/v0.7.0 -[5]: https://www.shellhub.io/community -[6]: https://github.com/shellhub-io -[7]: tmp.jW5CEfWWTN#Privileges -[8]: https://opensource.com/sites/default/files/uploads/shellhub_3namespace.png (Namespace) -[9]: https://creativecommons.org/licenses/by-sa/4.0/ -[10]: https://opensource.com/sites/default/files/uploads/shellhub_2terminal.png (Running namespace commands in the terminal) -[11]: https://opensource.com/sites/default/files/uploads/shellhub_1sessionrecordings.png (Session recordings) -[12]: https://opensource.com/sites/default/files/uploads/shellhub_6sessionrecording.png (Session recording settings) -[13]: https://opensource.com/sites/default/files/uploads/shellhub_5firewallrules.png (Firewall rules) -[14]: https://opensource.com/sites/default/files/uploads/shellhub_4admin.png (Admin console) -[15]: https://opensource.com/sites/default/files/pictures/public_key.png (ShellHub public key) -[16]: https://twitter.com/os_systems -[17]: https://www.linkedin.com/company/ossystems/ -[18]: https://www.facebook.com/ossystems -[19]: https://www.ossystems.com.br/ diff --git a/sources/tech/20210530 Complete Guide to Configuring SSH in Ubuntu.md b/sources/tech/20210530 Complete Guide to Configuring SSH in Ubuntu.md index 1ba15f11d2..b66a99ec02 100644 --- a/sources/tech/20210530 Complete Guide to Configuring SSH in Ubuntu.md +++ b/sources/tech/20210530 Complete Guide to Configuring SSH in Ubuntu.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/set-up-ssh-ubuntu/) [#]: author: (Chris Patrick Carias Stas https://itsfoss.com/author/chris/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (hwlife) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210606 5 handy guides to open source for teachers.md b/sources/tech/20210606 5 handy guides to open source for teachers.md deleted file mode 100644 index 2fe49a3e9f..0000000000 --- a/sources/tech/20210606 5 handy guides to open source for teachers.md +++ /dev/null @@ -1,76 +0,0 @@ -[#]: subject: (5 handy guides to open source for teachers) -[#]: via: (https://opensource.com/article/21/6/open-source-guides-teachers) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -5 handy guides to open source for teachers -====== -To help you get the most out of your summer, but also satiate the real -need to plan for the coming school year, we've collected some of our -favorite concise guides to help you plan. -![Looking at a map][1] - -For some teachers, summer is here and thus a long (hopefully, relaxing) break. All the teachers I know are proud lifelong learners, though, and at the end of the summer break there's a new school year awaiting. To help you get the most out of your summer, but also satiate the real need to plan for the coming school year, we've collected some of our favorite _concise_ guides to help you plan. - -### How to make your school pandemic-ready - -By going [all-in on Linux][2], teacher Robert Maynord ensured his school was ready for remote learning—even before it needed to be. We still don't know what the rest of the year has in store, but if there's anything that the pandemic has shown the world, it's that [digital transformation][3] (the integration of digital technology into all areas of education) is not only possible, but beneficial to both teachers and students. You may not have the authority to change the way your classroom operates on a technological level, but there are lots of small changes you can make to create a more agile learning experience for your pupils. - -### The ultimate guide to open source for teachers - -With this article, you can learn how to [incorporate open source principles][4] in your classroom. Open source is about more than just technology. It's about sharing knowledge, collaborating, working together toward a common goal. You can transform your classroom into a shared space where students learn from each other just as much as they do from you. Read it, put it into practice, and encourage it. - -### 8 WordPress plugins for virtual classrooms - -The WordPress web platform is a powerful tool for building websites. In the classroom, [it can serve as a great tool][5] to teach both web technology and creative or academic writing. It can also be used to enable remote learning, or to integrate everyday schoolwork with the digital realm. Gain the most benefit from WordPress for educational purposes by mastering its many [add-on features][6]. - -### Teach kids Python (interactive gaming) - -Open source tools can help anyone get started learning Python in an easy and fun way—making games. Of course, Python is a big topic, but we have a curriculum to take you from installing Python, taking your first steps with code with simple text and "turtle" drawing games, all the way to intermediate game development. - - 1. Start out by installing Python and getting used to how code works in our [Python 101 article.][7] This article alone can probably serve as the basis for two or three distinct classroom lessons. - 2. If you're familiar with [Jupyter][8], then learn to [program a simple game with Python and Jupyter][9]. - 3. You can also learn [game development with this free Python ebook][10], which teaches you how to use Git, Python, and PyGame. Once you've learned the basics, check out [this collection of cool creations from the book's "playtesters"][11]. - - - -If Python is too advanced for you or your students, take a look at [Twine][12], a simple HTML-based interactive storytelling tool. - -### Teach kids the Raspberry Pi (programming) - -This article in our guide to [getting started with the Raspberry Pi][13] explores resources for helping kids learn to program. The Raspberry Pi has the unique quality of costing only $35 USD, while also being a full-powered Linux computer that can be used for anything from basic Python lessons to actual webservers, so it's full of potential for education. It's a reasonable goal to have a Pi per child in your classroom, or you can have a single Pi for the classroom to explore together (Linux is a multi-user OS, so with the right setup all of your students can use one Pi at the same time until you sell their parents or your principle on the value of purchasing more). - -### Learn together - -Part of an open classroom is being brave enough to learn alongside your students. As a teacher, you might be used to having all the answers, but the digital world is ever-changing and evolving. Don't be afraid to learn Python, Linux, the Raspberry Pi, and anything else _with_ your students. Work together to learn new fundamentals, new tricks, and new ways of solving problems. Open source is a proven and successful methodology, so don't just teach it—make it happen in your classroom. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/open-source-guides-teachers - -作者:[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/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png?itok=L0BQHgjr (Looking at a map) -[2]: https://opensource.com/article/21/5/linux-school-servers -[3]: https://enterprisersproject.com/what-is-digital-transformation -[4]: https://opensource.com/article/20/7/open-source-teachers -[5]: https://opensource.com/article/20/3/wordpress-education -[6]: https://opensource.com/article/20/5/wordpress-plugins-education -[7]: https://opensource.com/article/17/10/python-101 -[8]: https://opensource.com/article/18/3/getting-started-jupyter-notebooks -[9]: https://opensource.com/article/20/5/python-games -[10]: https://opensource.com/article/20/10/learn-python-ebook -[11]: https://github.com/MakerBox-NZ?q=pygame&type=&language=&sort= -[12]: https://opensource.com/article/18/2/twine-gaming -[13]: https://opensource.com/article/19/3/teach-kids-program-raspberry-pi diff --git a/sources/tech/20210615 Listen to music on FreeDOS.md b/sources/tech/20210615 Listen to music on FreeDOS.md deleted file mode 100644 index 35431d0388..0000000000 --- a/sources/tech/20210615 Listen to music on FreeDOS.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: subject: (Listen to music on FreeDOS) -[#]: via: (https://opensource.com/article/21/6/listen-music-freedos) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Listen to music on FreeDOS -====== -Mplayer is an open source media player that's usually found on Linux, -Windows, Mac, and DOS. -![Woman programming][1] - -Music is a great way to relax. On Linux, I listen to music using Rhythmbox. But did you know you can listen to music on FreeDOS, as well? Let's take a look at two popular programs to listen to music: - -### Listen to music with Mplayer - -[Mplayer][2] is an open source media player that's usually found on Linux, Windows, and Mac—but there's a DOS version available, too. And that's the version we include in FreeDOS. While the DOS port is based on an older version (version 1.0rc2-3-3-2 from 2007) it is perfectly serviceable for playing media on DOS. - -I use Mplayer to listen to music files on FreeDOS. For this example, I've copied one of my favorite audiobooks, Doctor Who: Flashpoint by [Big Finish Productions][3], and saved it as `C:\MUSIC\FLASHPNT.MP3` on my FreeDOS computer. To listen to Flashpoint on FreeDOS, I launch Mplayer from the FreeDOS command line and specify the MP3 filename to play. The basic usage of Mplayer is `mplayer [options] filename` so if the default settings work well for you, then you can just launch Mplayer with the filename. In this case, I ran these commands to change my working directory to `\MUSIC` and then run Mplayer with my MP3 audiobook file: - - -``` -CD \MUSIC -MPLAYER FLASHPNT.MP3 -``` - -FreeDOS is _case insensitive_, so it will accept uppercase or lowercase letters for DOS commands and any files or directories. You could also type `cd \music` or `Cd \Music` to move into the Music directory, and that would work the same. - -![mplayer on FreeDOS][4] - -You can use Mplayer to listen to MP3 files -(Jim Hall, [CC-BY SA 4.0][5]) - -Using Mplayer is a "no frills" way to listen to music files on FreeDOS. But at the same time, it's not distracting, so I can leave FreeDOS to play the MP3 file on my DOS computer while I use my other computer to do something else. However, FreeDOS runs tasks one at a time (in other words, DOS is a "single-tasking" operating system) so I cannot run Mplayer in the "background" on FreeDOS while I work on something else _on the same FreeDOS computer_. - -Note that Mplayer is a big program that requires a lot of memory to run. While DOS itself doesn't require much RAM to operate, I recommend at least 16 megabytes of memory to run Mplayer. - -### Listen to audio files with Open Cubic Player - -FreeDOS offers more than just Mplayer for playing media. We also include the [Open Cubic Player][6], which supports a variety of file formats including Midi and WAV files. - -In 1999, I recorded a short audio file of me saying, "Hello, this is Jim Hall, and I pronounce 'FreeDOS' as _FreeDOS_." This was meant as a joke, riffing off of a [similar audio file][7] (`english.au`, included in the Linux source code tree in 1994) recorded by Linus Torvalds to demonstrate how he pronounces "Linux." We don't distribute the _FreeDOS_ audio clip in FreeDOS itself, but you are welcome to download it from our [Silly Sounds][8] directory, found in the FreeDOS files archive at [Ibiblio][9]. - -You can listen to the _FreeDOS_ audio clip using the Open Cubic Player. To run Open Cubic Player, you normally would run `CP` from the `\APPS\OPENCP` directory. However, Open Cubic Player is a 32-bit application that requires a 32-bit DOS extender. A common DOS extender is DOS/4GW. While free to use, DOS/4GW is not an open source program, so we do not distribute it as a FreeDOS package. - -Instead, FreeDOS provides another open source 32-bit extender called DOS/32A. If you did not install everything when you installed FreeDOS, you may need to install it using [FDIMPLES][10]. I used these two commands to move into the `\APPS\OPENCP` directory, and to run Open Cubic Player using the DOS/32A extender: - - -``` -CD \APPS\OPENCP -DOS32A CP -``` - -Open Cubic Player doesn't sport a fancy user interface, but you can use the arrow keys to navigate the _File Selector_ to the directory that contains the media file you want to play. - -![Open Cubic Player][11] - -Open Cubic Player opens with a file selector -(Jim Hall, [CC-BY SA 4.0][5]) - -The text appears smaller than in other DOS applications because Open Cubic Player automatically changes the display to use 50 lines of text, instead of the usual 25 lines. Open Cubic Player will reset the display back to 25 lines when you exit the program. - -When you have selected your media file, Open Cubic Player will play it in a loop. (Press the Esc key on your keyboard to quit.) As the file plays over the speakers, Open Cubic Player displays a spectrum analyzer so you can see the audio for the left and right channels. The _FreeDOS_ audio clip is recorded in mono, so the left and right channels are the same. - -![Open Cubic Player][12] - -Open Cubic Player playing the "FreeDOS" audio clip -(Jim Hall, [CC-BY SA 4.0][5]) - -DOS may be from an older era, but that doesn't mean you can't use FreeDOS to run modern tasks or play current media. If you like to listen to digital music, try using Open Cubic Player or Mplayer on FreeDOS. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/listen-music-freedos - -作者:[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/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming) -[2]: https://en.wikipedia.org/wiki/MPlayer -[3]: https://bigfinish.com/ -[4]: https://opensource.com/sites/default/files/uploads/mplayer.png (You can use Mplayer to listen to MP3 files) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ -[6]: https://www.cubic.org/player/ -[7]: https://commons.wikimedia.org/wiki/File:Linus-linux.ogg -[8]: https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/util/sillysounds/ -[9]: https://www.ibiblio.org/ -[10]: https://opensource.com/article/21/6/freedos-package-manager -[11]: https://opensource.com/sites/default/files/uploads/opencp1.png (Open Cubic Player opens with a file selector) -[12]: https://opensource.com/sites/default/files/uploads/opencp2.png (Open Cubic Player playing the "FreeDOS" audio clip) diff --git a/sources/tech/20210617 Linux package management with dnf.md b/sources/tech/20210617 Linux package management with dnf.md deleted file mode 100644 index 5aa3c827b4..0000000000 --- a/sources/tech/20210617 Linux package management with dnf.md +++ /dev/null @@ -1,182 +0,0 @@ -[#]: subject: (Linux package management with dnf) -[#]: via: (https://opensource.com/article/21/6/dnf-linux) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Linux package management with dnf -====== -Learn how to install packages on Linux with the dnf command, then -download our cheat sheet to keep the right command at your fingertips. -![Package wrapped with brown paper and red bow][1] - -Installing an application on a computer system is pretty simple. You copy files from an archive (like a .zip file) onto the target computer in a place the operating system expects there to be applications. Because many of us are accustomed to having fancy installer "wizards" to help us get software on our computers, the process seems like it should be technically more complex than it is. - -What _is_ complex, though, is the issue of what makes up an application. What users think of as a single application actually contains code borrowing from software libraries (i.e., `.so` files on Linux, `.dll` files on Windows, and `.dylib` on macOS) scattered throughout an operating system. - -So that users don't have to worry about that veritable matrix of interdependent code, Linux uses a **package management system** to track what application needs what library, and which library or application has security or feature updates, and what extra data files were installed with each software title. A package manager is, essentially, an installer wizard. They're easy to use, they provide both graphical interfaces and terminal-based interfaces, and they make your life easier. The better you know your distribution's package manager, the easier your life gets. - -### Installing applications on Linux - -If you're a casual desktop user who wants to install an application on Linux, then you may be looking for [GNOME Software][2], a desktop application browser. - -![Image of the GNOME Software application][3] - -It works as you'd expect: You click through its interface until you find an application that seems like it would be useful, and then you click the **Install** button. - -Alternately, you can open `.rpm` or `.flatpakref` packages downloaded from the web in GNOME Software for it to install them for you. - -If you're inclined toward controlling your computer with typed commands, read on! - -### Finding software with dnf - -Before you can install an application, you may need to confirm that it exists on your distribution's servers. Usually, searching for the common name of an application with `dnf` suffices. For instance, say you recently read [an article about Cockpit][4] and decide you want to try it. You could search for `cockpit` to verify that your distribution includes it: - - -``` -$ dnf search cockpit - Last metadata expiration check: 0:01:46 ago on Tue 18 May 2021 19:18:15 NZST. - ==== Name Exactly Matched: cockpit ==== - cockpit.x86_64 : Web Console for Linux servers - -==== Name & Summary Matched: cockpit == - cockpit-bridge.x86_64 : Cockpit bridge server-side component - cockpit-composer.noarch : Composer GUI for use with Cockpit - [...] -``` - -There's an exact match. The package listed as a match is called `cockpit.x86_64`, but the `.x86_64` part of the name only denotes the CPU architecture it's compatible with. By default, your system installs packages with matching CPU architectures, so you can ignore that extension. Therefore, you've confirmed that the package you're looking for is indeed called simply `cockpit`. - -Now you can confidently install it with `dnf install`. This step requires administrative privileges: - - -``` -`$ sudo dnf install cockpit` -``` - -More often than not, that's the typical `dnf` workflow: search and install. - -Sometimes, however, the results of `dnf search` aren't clear to you, or you want more information about a package than just its common name. There are a few relevant `dnf` subcommands, depending on what information you're after. - -### Package metadata - -If you feel like your search got you _close_ to the package you want, but you're just not sure yet, it's often helpful to take a look at the package's metadata, such as the project's URL and description. To get this info, use the pleasantly intuitive `dnf info` command: - - -``` -$ dnf info terminator -Available Packages -Name         : terminator -Version      : 1.92 -Release      : 2.el8 -Architecture : noarch -Size         : 526 k -Source       : terminator-1.92-2.el8.src.rpm -Repository   : epel -Summary      : Store and run multiple GNOME terminals in one window -URL          : -License      : GPLv2 -Description  : Multiple GNOME terminals in one window.  This is a project to produce -             : an efficient way of filling a large area of screen space with -             : terminals. This is done by splitting the window into a resizeable -             : grid of terminals. As such, you can  produce a very flexible -             : arrangements of terminals for different tasks. -``` - -This info dump tells you the version of the available package, which repository registered with your system provides it, the project's website, and a long description of what it does. - -### What package provides a file? - -Package names don't always match what you're looking for. For instance, suppose you're reading documentation telling you that you must install something called `qmake-qt5`: - - -``` -$ dnf search qmake-qt5 -No matches found. -``` - -The `dnf` database is extensive, so you don't have to restrict yourself to searches for exact matches. You can use the `dnf provides` command to learn whether anything provides what you're looking for as part of some larger package: - - -``` -$ dnf provides qmake-qt5 -qt5-qtbase-devel-5.12.5-8.el8.i686 : Development files for qt5-qtbase -Repo        : appstream -Matched from: -Filename    : /usr/bin/qmake-qt5 - -qt5-qtbase-devel-5.15.2-3.el8.x86_64 : Development files for qt5-qtbase -Repo        : appstream -Matched from: -Filename    : /usr/bin/qmake-qt5 -``` - -This confirms that the application `qmake-qt5` is a part of a package named `qt5-qtbase-devel`. It also tells you that the application gets installed to `/usr/bin`, so you know exactly where to find it once it's installed. - -### What files are included in a package? - -There are times when I find myself approaching `dnf` from a different angle entirely. Sometimes, I've already confirmed that an application is installed on my system; I just can't figure out how I got it. Other times, I know I have a specific package installed, but I'm not clear on exactly what that package put on my system. - -If you ever need to "reverse engineer" a package's payload, you can use the `dnf repoquery` command along with the `--list` option. This looks at the repository's metadata about a package and returns a list of all files provided by that package: - - -``` -$ dnf repoquery --list qt5-qtbase-devel -/usr/bin/fixqt4headers.pl -/usr/bin/moc-qt5 -/usr/bin/qdbuscpp2xml-qt5 -/usr/bin/qdbusxml2cpp-qt5 -/usr/bin/qlalr -/usr/bin/qmake-qt5 -/usr/bin/qvkgen -/usr/bin/rcc-qt5 -[...] -``` - -These lists can get long, so it helps to pipe the command through `less` or your favorite pager. - -### Removing an application - -Should you decide you no longer need an application installed on your system, you can use `dnf remove` to uninstall it, all of the files that were installed as part of its package, and any dependencies that are no longer necessary: - - -``` -`$ dnf remove bigapp` -``` - -Sometimes, dependencies get installed with one app and are later found useful by some other application you install. In the event that two packages require the same dependency, `dnf remove` does _not_ remove the dependency. It's not unheard of to end up with a stray package here and there after installing and uninstalling lots of applications. About once a year, I perform a `dnf autoremove` to clear out any unused packages: - - -``` -`$ dnf autoremove` -``` - -This isn't necessary, but it's a housecleaning step that makes me feel better about my computer. - -### Getting to know dnf - -The more you know about how your package manager works, the easier it is for you to install and query applications when necessary. Even if you're not a regular `dnf` user, it can be useful to know it when you find yourself interfacing with an RPM-based distro. - -Having graduated from `yum`, one of my favorite package managers is the `dnf` command. While I don't love all its subcommands, I find it to be one of the more robust package management systems out there. [**Download our `dnf` cheat sheet**][5] to get used to the command, and don't be afraid to try some new tricks with it. Once you get familiar with it, you might find it hard to use anything else. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/dnf-linux - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brown-package-red-bow.jpg?itok=oxZYQzH- (Package wrapped with brown paper and red bow) -[2]: https://wiki.gnome.org/Apps/Software -[3]: https://opensource.com/sites/default/files/gnome-software.png (The GNOME Software app) -[4]: https://opensource.com/article/20/11/cockpit-server-management -[5]: https://opensource.com/downloads/dnf-cheat-sheet diff --git a/sources/tech/20210622 How to Make LibreOffice Look Like Microsoft Office.md b/sources/tech/20210622 How to Make LibreOffice Look Like Microsoft Office.md deleted file mode 100644 index c97da88123..0000000000 --- a/sources/tech/20210622 How to Make LibreOffice Look Like Microsoft Office.md +++ /dev/null @@ -1,134 +0,0 @@ -[#]: subject: (How to Make LibreOffice Look Like Microsoft Office) -[#]: via: (https://www.debugpoint.com/2021/06/libreoffice-like-microsoft-office/) -[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to Make LibreOffice Look Like Microsoft Office -====== -We made an attempt to make the LibreOffice suite look like Microsoft -Office. Is it possible? Let’s find out. -[LibreOffice][1] is a free and open-source office productivity suite that provides you a complete collection of applications. It consists of a Word processor (Writer), a spreadsheet program (Calc), Presentation (Impress), and a drawing program (Draw). It also gives you a stand-alone database system LibreOffice Base while LibreOffice Math is a program that helps students, researchers to write formulas and equations. - -While, the widely used [Microsoft Office][2] is a paid office productivity suite that gives you excellent programs to perform almost all tasks related to study, office, and enterprise usage. - -Both of the programs are different but their objective is the same in terms of functionality. Due to its popularity, Microsoft office is used widely and well known to the users. However, there are many users who prefer the free LibreOffice for their work and activities. Adopting LibreOffice sometimes difficult compared to Microsoft Office – although most of the menu items, tools are the same. - -That said, if you can make LibreOffice look like Microsoft Office, then it is much easier for first-time users to adopt – mostly coming from Microsoft Office background. The look and feel play a big part in users’ minds including their muscle memory and familiarity of colors, menu items. - -Of course, you can not make it exactly like Microsoft Office because of different icons, fonts, etc. However, you can make it look up to a certain amount. - -### Make LibreOffice Look Like Microsoft Office - -_This guide is prepared in LibreOffice 7.2 (dev) version._ - -#### 1\. User Interface changes - -LibreOffice has a “Ribbon” style toolbar called Tabbed Bar. Although it comes with many options of the toolbar (see below). For this guide, I have used the Tabbed bar option. - - * Open LibreOffice and go to `Menu > View > User Interface`. - * Select `Tabbed` from the UI Section. - - - -![tabbed bar option][3] - - * Click on Apply to All. LibreOffice also provides an option to apply the toolbar type-specific to Writer or Calc. If you want a different toolbar type, you can choose that way. But I would recommend using the Apply to All to make it consistent. - - - * Now you should have the Microsoft Office-style Ribbon. Although they are not exactly the same, you get the feel of it. - - - -#### 2\. Microsoft Office Icons for LibreOffice - -The Icons in the toolbar play a big part in your workflow. LibreOffice provides some nice icons for your toolbar. The best ones are the – - - * Karasa Jaga - * Colibre - * Elementary - - - -For this guide, we will use [Office 2013 icon set][4] which is developed by an author. It is available in Devian Art. - - * Go to the below link and download the LibreOffice extension file (*.oxt). For the newer versions of LibreOffice, you need to use extension files to install icon sets. - - - -[download office 2013 icon sets for libreoffice][5] - - * After download, double click the .oxt file to open. Or, press CTRL+ALT+E to open the Extension Manager and select the downloaded .oxt file using the Add button. Close the window once done. - - - -![Import icon sets in Extension Manager][6] - - * Now go to `Tools > Options > View`. From the Icon style choose Office 2013. - - - * Change the icon size via `Icon Size > Notebookbar > Large`. If you feel the icons are small, you can change them. However, I feel to make it more Office-like, the large settings work better. - - - -![Change icons in Options][7] - -And, that’s it. Your LibreOffice installation should look like this. - -[][8] - -SEE ALSO:   LibreOffice 7.2 - New Features and Release Details - -![Making LibreOffice look like Microsoft Office in KDE Plasma][9] - -![Making LibreOffice look like Microsoft Office in Windows 10][10] - -![Making LibreOffice look like Microsoft Office in GNOME][11] - -Remember, if you are using Ubuntu, KDE Plasma, or any Linux distribution, the looks may be different. But in my opinion, it looks closer to Microsoft Office in KDE Plasma than GNOME. LibreOffice doesn’t look good in GTK based systems at the moment. - -In Windows, however, it looks better because it uses system font, color palette. - -These are some settings that you can use, however, you can play around with more customizations, icons, and themes as you wish. If you fancy dark mode in LibreOffice, you may want to read our tutorial – [how to enable dark mode in LibreOffice][12]. - -### Closing Notes - -Microsoft Office is undoubtedly the market leader in the Office productivity space. There is a reason for it, it comes with decades of development, and it’s not a free product. In fact, the latest Office 365 Home usage price is around ~7 USD per month for 3 to 4 devices. Which is a bit pricy if you ask me. - -Whereas LibreOffice is free and community developed headed by The Document Foundation. Hence, the development is slower and features arrive late. It is not trying to be Microsoft Office but gives millions of users, schools, non-profits, colleges, students an opportunity to work and learn using a free office suite. - -Hence, it is beneficial if it can mimic the basic look and feel to make it like Microsoft Office to increase LibreOffice adoption. And I hope this guide serves a little purpose in that direction. - -[_Link: Official Feature comparison between LibreOffice and Microsoft Office._][13] - -* * * - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2021/06/libreoffice-like-microsoft-office/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: http://libreoffice.com -[2]: http://office.com -[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/tabbed-bar-option.jpg -[4]: https://www.deviantart.com/charliecnr/art/Office-2013-theme-for-LibreOffice-512127527 -[5]: https://www.deviantart.com/users/outgoing?https://1drv.ms/u/s!ArgKmgFcmBYHhSQkPfyMZRnXX5LJ -[6]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Import-icon-sets-in-Extension-Manager.jpg -[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Change-icons-in-Options-1024x574.jpg -[8]: https://www.debugpoint.com/2021/05/libreoffice-7-2/ -[9]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Making-LibreOffice-look-like-Microsoft-Office-in-KDE-Plasma-1024x441.jpg -[10]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Making-LibreOffice-look-like-Microsoft-Office-in-Windows-10-1024x554.jpg -[11]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Making-LibreOffice-look-like-Microsoft-Office-in-GNOME-1024x498.jpg -[12]: https://www.debugpoint.com/2020/01/how-to-enable-dark-mode-libreoffice/ -[13]: https://wiki.documentfoundation.org/Feature_Comparison:_LibreOffice_-_Microsoft_Office diff --git a/sources/tech/20210624 Linux package management with apt.md b/sources/tech/20210624 Linux package management with apt.md deleted file mode 100644 index 3e826c7dc1..0000000000 --- a/sources/tech/20210624 Linux package management with apt.md +++ /dev/null @@ -1,192 +0,0 @@ -[#]: subject: (Linux package management with apt) -[#]: via: (https://opensource.com/article/21/6/apt-linux) -[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Linux package management with apt -====== -Learn how to install packages on Debian-based Linux distros with the apt -command, then download our cheat sheet to keep the right command at your -fingertips. -![bash logo on green background][1] - -On Linux, [package managers][2] help you handle updates, uninstalls, troubleshooting, and more for the software on your computer. Seth Kenlon [wrote about `dnf`][3], the command-line package management tool for installing software in RHEL, CentOS, Fedora, Mageia, OpenMandriva, and other Linux distros. - -Debian and Debian-based distros such as MX Linux, Deepin, Ubuntu—and distros based on Ubuntu, such as Linux Mint and Pop!_OS—have `apt`, a "similar but different" tool. In this article, I'll follow Seth's examples—but with `apt`—to show you how to use it. - -Before I start, I want to mention four `apt`-related tools for installing software: - - * [Synaptic][4] is a GTK+ based graphical user interface (GUI) front end for `apt`. - * [Aptitude][5] is an Ncurses-based full-screen command-line front end for `apt`. - * There are `apt-get`, `apt-cache`, and other predecessors of `apt`. - * [Dpkg][6] is the "behind the scenes" package manager `apt` uses to do the heavy lifting. - - - -There are other packaging systems, such as [Flatpak][7] and [Snap][8], that you might run into on Debian and Debian-based systems, but I'm not going to discuss them here. There are also application "stores," such as [GNOME Software][9], that overlap with `apt` and other packaging technologies; again, I'm not going to discuss them here. Finally, there are other Linux distros such as [Arch][10] and [Gentoo][11] that use neither `dnf` nor `apt`, and I'm not going to discuss those here either! - -With all the things I'm not going to discuss here, you may be wondering what tiny subset of software `apt` handles. Well, on my Ubuntu 20.04, `apt` gives me access to 69,371 packages, from the `0ad` real-time strategy game of ancient warfare to the `zzuf` transparent application fuzzer. Not bad at all. - -### Finding software with apt - -The first step in using a package manager such as `apt` is finding a software package of interest. Seth's `dnf` article used the [Cockpit][12] server management application as an example, so I will, too: - - -``` -$ apt search cockpit -Sorting... Done -Full Text Search... Done -389-ds/hirsute,hirsute 1.4.4.11-1 all -  389 Directory Server suite - metapackage - -cockpit/hirsute,hirsute 238-1 all -  Web Console for Linux servers - -... -$ -``` - -The second package above is the one you're after (it's the line beginning with `cockpit/hirsute`). If you decide you want to install it, enter: - - -``` -`$ sudo apt install cockpit` -``` - -`apt` will take care of installing Cockpit and all the bits and pieces, or _dependencies_, needed to make it work. Sometimes that's all that's needed; sometimes it's not. It's possible that having a bit more information could be useful in deciding whether you really want to install this application. - -### Package metadata - -To find out more about a package, use the `apt show` command: - - -``` -$ apt show cockpit -Package: cockpit -Version: 238-1 -Priority: optional -Section: universe/admin -Origin: Ubuntu -Maintainer: Ubuntu Developers <[ubuntu-devel-discuss@lists.ubuntu.com][13]> -Original-Maintainer: Utopia Maintenance Team <[pkg-utopia-maintainers@lists.alioth.debian.org][14]> -Bugs: -Installed-Size: 88.1 kB -Depends: cockpit-bridge (>= 238-1), cockpit-ws (>= 238-1), cockpit-system (>= 238-1) -Recommends: cockpit-storaged (>= 238-1), cockpit-networkmanager (>= 238-1), cockpit-packagekit (>= 238-1) -Suggests: cockpit-doc (>= 238-1), cockpit-pcp (>= 238-1), cockpit-machines (>= 238-1), xdg-utils -Homepage: -Download-Size: 21.3 kB -APT-Sources: hirsute/universe amd64 Packages -Description: Web Console for Linux servers - The Cockpit Web Console enables users to administer GNU/Linux servers using a - web browser. - . - It offers network configuration, log inspection, diagnostic reports, SELinux - troubleshooting, interactive command-line sessions, and more. - -$ -``` - -In particular, notice the `Description` field, which tells you more about the application. The `Depends` field says what else must be installed, and `Recommends` shows what other—if any—cooperating components are suggested alongside it. The `Homepage` field offers a URL in case you need more info. - -### What package provides a file? - -Sometimes you don't know the package name, but you know a file that must be in a package. Seth offers as an example the `qmake-qt5` utility. Using `apt search` doesn't find it: - - -``` -$ apt search qmake-qt5 -Sorting... Done -Full Text Search... Done -$ -``` - -However, a related command, `apt-file` will explore inside packages: - - -``` -$ apt-file search qmake-qt5 -qt5-qmake-bin: /usr/share/man/man1/qmake-qt5.1.gz -$ -``` - -This turns up a man page for `qmake-qt5` that is part of a package called `qt5-qmake-bin`. Note that this package name reverses the `qmake` and `qt5` parts. - -### What files are included in a package? - -That handy `apt-file` command also tells which files are included in a given package. For example: - - -``` -$ apt-file list cockpit -cockpit: /usr/share/doc/cockpit/TODO.Debian -cockpit: /usr/share/doc/cockpit/changelog.Debian.gz -cockpit: /usr/share/doc/cockpit/copyright -cockpit: /usr/share/man/man1/cockpit.1.gz -cockpit: /usr/share/metainfo/cockpit.appdata.xml -cockpit: /usr/share/pixmaps/cockpit.png -$ -``` - -Note that this is distinct from the info provided by the `apt show` command, which lists the package's dependencies (other packages that must be installed). - -### Removing an application - -You can also remove packages with `apt`. For example, to remove the `apt-file` application: - - -``` -`$ sudo apt purge apt-file` -``` - -Note that a superuser must run `apt` to install or remove applications. - -Removing a package doesn't automatically remove all the dependencies that `apt` installs along the way. However, it's easy to carry out that little bit of tidying: - - -``` -`$ sudo apt autoremove` -``` - -### Getting to know apt - -As Seth wrote, "the more you know about how your package manager works, the easier it is for you to install and query applications when necessary." - -Even if you're not a regular `apt` user, knowing it can be useful when you need to work at the command line while installing or removing packages (for example, on a remote server or when following a how-to published by some helpful soul). You may also need to know a bit about Dkpg (mentioned above); for example, some software creators provide a bare `.pkg` file. - -I find the Synaptic package manager to be a really useful tool on my desktop, but I also use `apt` on a handful of servers that I maintain for various purposes. - -**[Download our `apt` cheat sheet][15]** to get used to the command and try some new tricks with it. Once you do, you might find it hard to use anything else. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/apt-linux - -作者:[Chris Hermansen][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/clhermansen -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background) -[2]: https://opensource.com/article/21/2/linux-package-management -[3]: https://opensource.com/article/21/5/dnf -[4]: https://www.nongnu.org/synaptic/ -[5]: https://wiki.debian.org/Aptitude -[6]: https://wiki.debian.org/Teams/Dpkg -[7]: https://flatpak.org/ -[8]: https://snapcraft.io/ -[9]: https://wiki.gnome.org/Apps/Software -[10]: https://archlinux.org/ -[11]: https://www.gentoo.org/ -[12]: https://opensource.com/article/20/11/cockpit-server-management -[13]: mailto:ubuntu-devel-discuss@lists.ubuntu.com -[14]: mailto:pkg-utopia-maintainers@lists.alioth.debian.org -[15]: https://opensource.com/downloads/apt-cheat-sheet diff --git a/sources/tech/20210626 How I helped my mom switch from Windows to Linux.md b/sources/tech/20210626 How I helped my mom switch from Windows to Linux.md deleted file mode 100644 index 7e0a4ae5fa..0000000000 --- a/sources/tech/20210626 How I helped my mom switch from Windows to Linux.md +++ /dev/null @@ -1,161 +0,0 @@ -[#]: subject: (How I helped my mom switch from Windows to Linux) -[#]: via: (https://opensource.com/article/21/6/mom-switch-linux) -[#]: author: (Tomasz https://opensource.com/users/tomaszwaraksa) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How I helped my mom switch from Windows to Linux -====== -With Linux, novice users will gain a smooth, polished desktop experience -with a multitude of familiar applications. -![Red Lego Heart][1] - -The Large Hadron Collider is [powered by Linux][2]. Laptops on the International Space Station [run on Linux][3]. So do [Instagram][4] and [Nest thermostats][5]. Recently, we watched Ingenuity fly over Mars, an amazing robo-copter driven by… [Linux][6]! It's yet more proof of how flexible and versatile this operating system can be. - -But now, the really big news. It's official. Linux can handle Mom and Dad just as well! - -### The story - -About a year ago, I decided to migrate my mom to Linux. A year has passed, so it's time for retrospection and conclusions. - -Like most of us, I'm officially _Mom's Computer Admin_. Mom is a lovely lady in her late 60s—a real sweetheart. Mom's computer skills are basic. Mom's computer needs are basic, too. Read the internets, send email, type text, browse and edit photos, play videos and music, call family and friends on Skype or Signal. - -Until last year, she was using a Windows laptop, old but not too bad. Then one day, through deceit, threats, and obnoxious popups, Microsoft finally made her click that dreaded "UPGRADE TO WINDOWS 10" button. - -My life as Mom's Computer Admin quickly turned into hell with her desperate calls for help. Why does everything look so different? Where is my app menu? What, this pile of tiles is now my app menu? Why is the computer so slow? Why does it restart daily for updates, just when I need to use it?! Why is something (she meant the hard drive) making noise all the time? What is it actually doing all the time? - -And how would I know that without any ability to look into the source code? - -I considered rolling back the upgrade. But with Windows 7 reaching end-of-life soon, I feared the worst: Without security updates, Mom's computer would soon become a member of countless bot networks, mining cryptocurrencies, mailing spam, and launching vicious DDOS attacks on the vital infrastructure of entire countries. And I'd be the one to clean this mess—every weekend. - -### Linux to the rescue - -With nothing to lose, I decided to migrate her to Linux. I made "the move" five years ago and have never been happier. It surely wouldn't do harm to try it with her. - -Mom was happy when I declared to fix her problems once and for all. What she didn't know is that she would become the crucial part of a year-long scientific experiment named: "Can Mom survive Linux?" - -![Cowsay "Can Mom Survive Linux?"][7] - -(Tomasz Waraksa, [CC BY-SA 4.0][8]) - -And so, one day in February 2020, I arrived from faraway Dublin with a seven-year-old Lenovo Yoga 13, which had similar specs but a much nicer screen and half the weight. After some deliberations and testing various Linux distributions on VirtualBox, I decided on the [Zorin OS][9] distribution, proudly made in Ireland. My choice was driven by the following factors: - - * It's based on Ubuntu Linux, with which I'm most familiar. - * It closely resembles Windows 7, being carefully designed with Windows refugees in mind. - * It feels lightweight, simple, and sufficiently conservative for Mom. No shiny macOS Big Sur glitz anywhere around! - - - -![Zorin OS desktop][10] - -(Tomasz Waraksa, [CC BY-SA 4.0][8]) - -### System installation - -I installed the operating system my usual way, with the `/home` folder on a dedicated partition to keep Mom's Stuff safe in the unlikely case of system reinstallation. It's my old trick that makes late-night distro-hopping much easier. - -During installation, I chose Polish as the user interface (UI) language. Just like me, Mom is Polish to the bone. No worries, Linux seems to support every possible language, including [Klingon][11]. - -Then, I installed the following applications to cover Mom's needs: - - * Skype - * [Signal for Desktop][12] - * Google Chrome browser - * [Geary][13] email client - * [gThumb][14] for photo viewing and editing - * [VLC][15] for playing video and music - * Softmaker Office for text editing and spreadsheets - - - -Notice how there's no antivirus on the list. Yay! - -An hour later, her Zorin OS box was ready and loaded with applications. - -![Zorin OS home folder][16] - -(Tomasz Waraksa, [CC BY-SA 4.0][8]) - -### System configuration - -I made myself Mom's Computer Admin by doing the following: - - * Created an admin account for myself - * Turned Mom's account into non-admin - * Installed the `ssh` daemon for remote unattended access - * Added the machine to my Hamachi VPN: This way, I can securely connect via `ssh` without opening port 22 on the router. Hamachi is a VPN service by LogMeIn. An old-school VPN, I mean. Intended not for running Netflix from another country but for connecting computers into a secure network over the internet. - * Enabled Uncomplicated Firewall ( `ufw`) and allowed ssh traffic - * Installed AnyDesk for logging in to the desktop - - - -With this, I have secure ssh access to Mom's laptop. I can perform periodic maintenance via shell without Mom even noticing anything. That's because Linux normally _does not_ require a reboot after completed updates; what a miracle, how's that even possible? - -![Updating software remotely][17] - -(Tomasz Waraksa, [CC BY-SA 4.0][8]) - -### Can Mom survive Linux? - -Without the slightest doubt! - -When I showed Mom her new PC, she did ask why this new Windows looked different _again_. I had to reveal that this is not Windows at all, but Linux, and explain why we all love Linux. But she picked it up quickly. The classic Zorin OS desktop is very much like her old Windows 7. I watched her find her way through the system and launch her familiar applications with ease. - -She immediately noticed how much faster the computer starts and how much better it performs. - -She's been asking me when I will do the usual computer cleanup so that it doesn't become slow again. I've explained that, with her average use, it won't be needed. Linux simply doesn't rot on its own as Windows does. So far, this has been true. Her PC runs as smooth and fast as on day one. - -Every now and then, I ask how she feels about her new computer. She invariably answers that she's happy with it. Everything works smoothly. The computer doesn't get busy for no reason. No more interrupting her with Very Important Updates. And the menu is where it should always be. She's comfortable with her usual applications in this entirely new environment. - -Over the year, I've logged in remotely a few times to run routine package upgrades. I've logged in with AnyDesk twice. Once, when Mom asked whether photos from an inserted SD card could be imported automatically into the `~/Pictures` folder, and preferably into folders named by dates. Yes, `gThumb` can easily be made to do that with a bit of Bash. Another time, I logged in to add frequently used websites as desktop icons. - -And this has been all of my effort as Mom's Linux Admin so far! At this pace, I could be Mom's Computer Admin to 50 other moms! - -### Summary - -I hope that my story will inspire you to think about migrating to Linux. In the past, we considered Linux to be too difficult for casual users. But today I believe that the opposite is true. The less proficient computer users are, the more reasons they have to migrate to Linux! - -With Linux, novice users will gain a smooth, polished desktop experience with a multitude of familiar applications. They will be much safer than on any other popular computing platform. And helping them with remote access has never been easier and more secure! - -_Disclaimer: This article is not promoting any of the described products, services, or vendors. I don't have any commercial interest nor associations with them. I'm not trying to suggest that these products or services are best for you, nor promising that your experience will be the same._ - -* * * - -_This article originally appeared on [Let's Debug It][18] and is reused with permission._ - -Sandstorm's Jade Wang shares some of her favorite open source web apps that are self-hosted... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/mom-switch-linux - -作者:[Tomasz][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/tomaszwaraksa -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/heart_lego_ccby20.jpg?itok=VRpHf4iU (Red Lego Heart) -[2]: https://www.redhat.com/en/about/press-releases/red-hat-provides-cern-platform-mission-critical-applications -[3]: https://www.extremetech.com/extreme/155392-international-space-station-switches-from-windows-to-linux-for-improved-reliability -[4]: https://instagram-engineering.com/what-powers-instagram-hundreds-of-instances-dozens-of-technologies-adf2e22da2ad -[5]: https://www.theverge.com/2011/11/14/2559567/tony-fadell-nest-learning-thermostat -[6]: https://www.zdnet.com/article/to-infinity-and-beyond-linux-and-open-source-goes-to-mars/ -[7]: https://opensource.com/sites/default/files/uploads/intro.png (Cowsay "Can Mom Survive Linux?") -[8]: https://creativecommons.org/licenses/by-sa/4.0/ -[9]: https://zorinos.com/ -[10]: https://opensource.com/sites/default/files/uploads/zorin-os-desktop.png (Zorin OS desktop) -[11]: https://blogs.gnome.org/muelli/2010/04/klingon-language-support/ -[12]: https://github.com/signalapp -[13]: https://wiki.gnome.org/Apps/Geary -[14]: https://wiki.gnome.org/Apps/Gthumb -[15]: https://www.videolan.org/vlc/ -[16]: https://opensource.com/sites/default/files/uploads/zorin-os-home-folder.png (Zorin OS home folder) -[17]: https://opensource.com/sites/default/files/uploads/upgrading-software.png (Updating software remotely) -[18]: https://letsdebug.it/post/16-linux-for-mars-copters-moms-and-pops/ diff --git a/sources/tech/20210705 Things to do after installing Fedora 34 Workstation.md b/sources/tech/20210705 Things to do after installing Fedora 34 Workstation.md deleted file mode 100644 index 26240956dc..0000000000 --- a/sources/tech/20210705 Things to do after installing Fedora 34 Workstation.md +++ /dev/null @@ -1,168 +0,0 @@ -[#]: subject: (Things to do after installing Fedora 34 Workstation) -[#]: via: (https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/) -[#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Things to do after installing Fedora 34 Workstation -====== - -![][1] - -Using a new operating system can be a lot of fun. But it often becomes confusing when we first use it, especially for new users who are not very familiar with computer systems. For those of you who are using Fedora for the first time and have successfully installed Fedora 34 Workstation, this article can be an initial guide. I’m sure that you want to feel more at home with your new fresh Fedora. These are several things to do after installing your Fedora 34 Workstation. - -### System update - -Maybe you think that you have installed the most recent version of Fedora 34 Workstation, so your Fedora should be up to date. But you still have to make sure that your Fedora Linux has all the updated packages. Because in every new release of an operating system, usually there are still many things that continue to be improved. You can use the terminal or GNOME software to run the update. - -If you want to update via the terminal, then you just have to open a terminal and type the following command. - -``` -$ sudo dnf update -``` - -But if you want to do it with GNOME _Software_, open the application by selecting _Activities_ then locating and selecting the _Software_ item in the taskbar at the bottom of the screen. When it opens select the _Update_s tab at the top. After that you just click the _Download_ button. An update may require a restart afterwards and _Update_ will tell you that. - -![GNOME Software location in the taskbar at the bottom of the screen][2] - -_note: another way to select Activities is to press the super key on the keyboard. Super key is the button that has the Windows logo on most keyboards._ - -![Gnome Software showing Updates][3] - -### System settings - -You can view and configure your device’s system through _System Settings_. These include items like network, keyboard, mouse, sound, displays, etc. You can run it by pressing the _super_ key on your keyboard, clicking _Show Applications_ in the task bar at the bottom of the window, then selecting _Settings_. Configure it according to your needs. - -![Settings menu showing Network selected][4] - -### Additional repositories - -Maybe some packages you need are not available to be installed from the official Fedora Repository. You can add software repositories with the _dnf config-manager_ command. Please be careful if you want to add other repositories besides the official Fedora repository. - -The first thing you should do is define a new repository by adding a new file ending in _.repo_ to the _/etc/yum.repos.d/_ directory. Run the following command in the terminal. - -``` -$ sudo dnf config-manager --add-repo /etc/yum.repos.d/file_name.repo -``` - -_note: replace file_name with the repository file name._ - -Or you can use GNOME _Software_. Open it as described in the System Update section above. Now select the “hamburger” icon (three horizontal lines) on the top right and select _Software Repositories_. You can add the repository from there using the _Install_ option. - -![GNOME Software showing location of Software Repositories menu][5] - -Most people will enable RPM Fusion. It’s a third party repository. You can read about third party repositories in [Fedora Docs][6]. - -### Fastest mirror and Delta RPM - -There are several things you can do to speed up your download times when using DNF to update your system. You can enable Fastest Mirror and Delta RPM. Edit _/etc/dnf/dnf.conf_ using a text editor, such as gedit or nano. Here’s the example to open _dnf.conf_ file with _nano_ in _terminal_. - -``` -$ sudo nano /etc/dnf/dnf.conf -``` - -Append the following line onto your _dnf.conf_ file. - -``` -fastestmirror=true -deltarpm=true -``` - -Press _ctrl+o_ to save the file then _ctrl+x_ to quit from _nano_. - -### Multimedia plugins for audio and video - -You may need some plugins for your multimedia needs. You can install multimedia plugins by running this command in a terminal. - -``` -$ sudo dnf group upgrade --with-optional Multimedia -``` - -Please pay attention to the regulations and standards in your country regarding multimedia codecs. You can read about this in [Fedora Docs][7]. - -### Tweaks and Extentions - -Fedora 34 Workstation comes with GNOME as the default Desktop Environment. We can do various configurations of GNOME by using Tweaks and Extensions, like changing themes, changing buttons in the window dialog, and many more. - -Open your terminal and run this command to install GNOME Tweaks. - -``` -$ sudo dnf install gnome-tweaks -``` - -And run this command to install GNOME Extensions. - -``` -$ sudo dnf install gnome-extensions-app -``` - -Do the same way as above when you search for _GNOME Software_. Select _Activities_ or press the _super_ key then select _Show Applications_ to see a list of installed applications. You can find both applications in the list. You can do the same thing every time you want to search for installed applications. Then do the configuration with your preferences with _Tweaks_ and _Extensions_. - -![GNOME Tweaks][8] - -![GNOME Extensions][9] - -### Install applications - -When you first install Fedora, you will find several installed apps. You can add other applications according to your needs with GNOME Software. Do the same way to open GNOME Software as described earlier. Then find the application you want, select the application, and then press the Install button. - -![GNOME Software][10] - -Or you can do it with terminal. Here are the commands to find and install the application. - -Command to search for available applications: - -``` -$ sudo dnf search application_name -``` - -The command to install the application: - -``` -$ sudo dnf install application_name -``` - -Commands to remove installed applications: - -``` -$ sudo dnf remove application_name -``` - -_note: replace application_name with the name of the application._ - -You can search for installed applications by viewing them in _Show Applications_. Select _Activities_ or press the _super_ key and select _Show Applications_. Then you can select the application you want to run from the list. - -![Installed application list][11] - -### Conclusion - -Fedora Workstation is an easy-to-use and customizable operating system. There are many things you can do after installing Fedora 34 Workstation according to your needs. This article is just a basic guide for your first steps before you have more fun with your Fedora Linux system. You can read [Fedora Docs][12] for more detailed information. I hope you enjoy using Fedora Linux. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/ - -作者:[Arman Arisman][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/armanwu/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Cover_ThingsToDo.png -[2]: https://fedoramagazine.org/wp-content/uploads/2021/07/GNOME_Software_location-1024x576.png -[3]: https://fedoramagazine.org/wp-content/uploads/2021/07/Software_Updates-1024x735.png -[4]: https://fedoramagazine.org/wp-content/uploads/2021/07/Settings-1024x764.png -[5]: https://fedoramagazine.org/wp-content/uploads/2021/07/Software_Hamburger_-1-1024x685.png -[6]: https://docs.fedoraproject.org/en-US/quick-docs/setup_rpmfusion/ -[7]: https://docs.fedoraproject.org/en-US/quick-docs/assembly_installing-plugins-for-playing-movies-and-music/ -[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/Tweaks-1024x733.png -[9]: https://fedoramagazine.org/wp-content/uploads/2021/07/GNOME_Extensions.png -[10]: https://fedoramagazine.org/wp-content/uploads/2021/07/GNOME_Software-1-1024x687.png -[11]: https://fedoramagazine.org/wp-content/uploads/2021/07/Show_Application-1024x576.png -[12]: https://docs.fedoraproject.org/en-US/fedora/f34/ diff --git a/sources/tech/20210706 How to Install Fedora 34 Workstation -Step by Step.md b/sources/tech/20210706 How to Install Fedora 34 Workstation -Step by Step.md deleted file mode 100644 index 5ea4a8a2d4..0000000000 --- a/sources/tech/20210706 How to Install Fedora 34 Workstation -Step by Step.md +++ /dev/null @@ -1,151 +0,0 @@ -[#]: subject: (How to Install Fedora 34 Workstation [Step by Step]) -[#]: via: (https://www.debugpoint.com/2021/07/install-fedora-34-workstation/) -[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to Install Fedora 34 Workstation [Step by Step] -====== -In this absolute beginner’s guide, we explain the steps required to -install Fedora 34 workstation edition (GNOME desktop environment). -This page covers the following topics - - * [Fedora 34 Minimum system requirements][1] - * [Pre-Steps before installation][2] - * [Download and create LIVE USB][3] - * [Install Fedora 34][4] - - - -[Fedora][5] is a Linux based distribution which offers desktop and server flavors. It is a free and open-source Linux distribution sponsored by Red Hat and developed and contributed by the community. It works as an upstream distribution for Red Hat Enterprise Linux. Hence, with Fedora you get the latest Linux Kernel, packages with cutting edge features and applications. - -Fedora desktop edition offers almost all popular desktop environments. A quick list of desktop environment is below which has official Fedora flavor. - - * KDE Plasma - * GNOME - * Xfce - * LXDE - * LXQt - * i3 WM - * MATE - * Cinnamon (via repo) - - - -This is why it is very popular, and many users choose Fedora to Ubuntu because you get a perfect system with many packages pre-installed. Mostly experienced users prefer Fedora, but it is absolutely useful for beginner’s as well. If you are an Ubuntu user and want to jump the ship to Fedora, well, you may want to check out our [Ubuntu to Fedora migration guide][6]. - -The Fedora 34 which we are going to install in this post brings some interesting changes. Fedora 34 brings Linux Kernel 5.11, Zstd compression when btrfs is used, default sound daemon Pipewire, GNOME 40 desktop, KDE Plasma 5.21 and many Wayland related updates. For a detailed coverage, visit our [Fedora 34 topics][7] to learn more. - -### Fedora 34 workstation – System requirement - -This is the minimum system requirement for installing Fedora in general. - - * 2 GHz dual-core processor - * 4 GiB RAM (system memory) - * 20 GB of hard-drive space - * VGA capable of 1024×768 screen resolution - * Either a CD/DVD drive or a USB port for the installer media - * Internet access is not mandatory for installation - - - -### Pre-Step Before Installation - -Before you start the installation, make sure of the followings. - - * If you are installing in a physical system, make sure to decide which partition you want to install. - * If you are planning to dual boot with Windows or any other Linux Systems, then make sure you decide which partition to install. - * Take a backup of your personal data. - * Keep a LIVE USB with [Boot Repair][8] handy, in case something goes wrong. - - - -[][9] - -SEE ALSO:   How to Upgrade to Fedora 34 from Fedora 33 Workstation (GUI and CLI Method) - -### Download and prepare LIVE USB - -Download the Workstation edition from the below link. It contains the torrent of the .ISO file and also includes all other [Fedora 34 Spins][10] as well. - -[fedora torrents][11] - -After the download is complete, create a LIVE USB using any utility such as [Etcher][12]. Plug in the USB in your system, change BIOS settings to boot from it. - -### Install Fedora 34 – Steps - -1\. The LIVE Fedora installation system boot up to a LIVE desktop, that gives you options to install to a Physical medium. - -![Install to Hard Driver Option in LIVE Media][13] - -2\. In the next screen, select language and continue. Then click on the Installation destination to select which partition you would like to install. - -![Select Language][14] - -![Installation Destination Select][15] - -3\. In the installation destination screen, select the disk and choose Storage Configuration: Custom. And click Done at the top. - -![Select Disk][16] - -4\. In the partitioning screen, choose your partition sizes for root, and boot partitions. For example, keep /boot at around 1GB and rest you can assign to /root partition. - -5\. For Fedora 34, it is better to use btrfs for root partition for better performance. Do not forget to set the mount point as / in root partition. - -![root partition][17] - -![boot partition][18] - -6\. When you are satisfied with your new file system, click on Done. In the next screen, make sure to verify carefully the summary of changes that is going to happen to your disk. Because this will make changes to your system and can not be reverted. Click Accept changes once you are ready. - -![Summary of Changes][19] - -7\. Wait for the installation to complete. Once it is finished, click on Finish Installation and reboot the LIVE system. - -![Installation complete][20] - -So, that’s about it. If all goes well, after reboot, you should be greeted with Fedora 34 workstation edition desktop with GNOME 40. - -![Fedora 34 Desktop][21] - -I hope this basic guide to install Fedora 34 helps beginner’s or advanced users for their work. If you run into a problem, such as with dual boot, or any other installation error, let me know in the comment box below. - -* * * - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2021/07/install-fedora-34-workstation/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: tmp.cwqzC2PPCj#min-requirement -[2]: tmp.cwqzC2PPCj#pre-steps -[3]: tmp.cwqzC2PPCj#download-create-USB -[4]: tmp.cwqzC2PPCj#install-fedora-34 -[5]: https://getfedora.org/ -[6]: https://www.debugpoint.com/2021/04/migrate-to-fedora-from-ubuntu/ -[7]: https://www.debugpoint.com/tag/fedora-34 -[8]: https://sourceforge.net/p/boot-repair/home/Home/ -[9]: https://www.debugpoint.com/2021/04/upgrade-fedora-34-from-fedora-33/ -[10]: https://www.debugpoint.com/2021/04/fedora-34-desktop-spins/ -[11]: https://torrent.fedoraproject.org/ -[12]: https://www.debugpoint.com/2021/01/etcher-bootable-usb-linux/ -[13]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Install-to-Hard-Driver-Option-in-LIVE-Media.jpeg -[14]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Select-Language.jpeg -[15]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Installation-Destination-Select.jpeg -[16]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Select-Disk.jpeg -[17]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/root-partition-1024x532.jpeg -[18]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/boot-partition.jpeg -[19]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Summary-of-Changes.jpeg -[20]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Installation-complete-1024x526.jpeg -[21]: https://www.debugpoint.com/blog/wp-content/uploads/2021/04/Fedora-34-Desktop--1024x529.jpg diff --git a/sources/tech/20210707 Parsing config files with Java.md b/sources/tech/20210707 Parsing config files with Java.md deleted file mode 100644 index 56e086085e..0000000000 --- a/sources/tech/20210707 Parsing config files with Java.md +++ /dev/null @@ -1,358 +0,0 @@ -[#]: subject: (Parsing config files with Java) -[#]: via: (https://opensource.com/article/21/7/parsing-config-files-java) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Parsing config files with Java -====== -Implement persistent settings when you're writing software in Java. -![Person drinking a hot drink at the computer][1] - -When you write an application, you often want users to be able to configure how they interact with it and how it interacts with their system. These are commonly called "preferences" or "settings," and they're stored in "preference files" or "configuration files," or just "configs." There are many different formats for config files, including INI, JSON, YAML, and XML, and every language parses these languages differently. This article discusses some of the ways you can implement persistent settings when you're writing software in the [Java programming language][2]. - -### Choose a format - -Writing configuration files is surprisingly flexible. I've kept configuration options in a simple comma-delimited text file, and I've kept options in highly detailed YAML or XML. The most important thing about configuration files is that they are consistent and predictable. This makes it easy for you to write code that can quickly and easily extract data from the configuration file, as well as save and update options when the user decides to make a change. - -There are [several popular formats for configuration files][3]. Java has libraries for most of the common configuration formats, but in this article, I'll use the XML format. For some projects, you might choose to use XML for its inherent ability to provide lots of metadata about the data it contains, while for others, you may choose to avoid it due to its verbosity. Java makes working with XML relatively easy because it includes robust XML libraries by default. - -### XML basics - -XML is a big topic. Just one of the books I own about XML is over 700 pages. Fortunately, using XML doesn't require in-depth knowledge of all its many features. Like HTML, XML is a hierarchical markup language with opening and closing tags, which may contain zero or more data. Here's a sample snippet of XML: - - -``` -<xml> -  <node> -    <element>Penguin</element> -  </node> -</xml> -``` - -In this rather self-descriptive example, here are the terms that XML parsers use: - - * **Document:** The `` tag opens a _document_, and the `` tag closes it. - * **Node:** The `` tag is a _node_. - * **Element:** The `Penguin`, from the first `<` to the last `>`, is an _element_. - * **Content:** In the `` element, the string `Penguin` is the _content_. - - - -Believe it or not, that's all you need to know about XML to be able to write and parse it. - -### Create a sample config file - -A minimal example of a config file is all you need to learn how to parse XML. Imagine a config file tracking some display properties of a GUI window: - - -``` -<xml> -  <window> -    <theme>Dark</theme> -    <fullscreen>0</fullscreen> -    <icons>Tango</icons> -</window> -</xml> -``` - -Create a directory called `~/.config/DemoXMLParser`: - - -``` -`$ mkdir ~/.config/DemoXMLParser` -``` - -On Linux, the `~/.config` directory is the default configuration file location, as defined by the [Freedesktop][4] specification. If you're on an operating system that doesn't follow Freedesktop standards, you can still use this location, but you may have to create all the directories yourself. - -Copy and paste the sample configuration XML into a file and save it as `~/.config/DemoXMLParser/myconfig.xml`. - -### Parse XML with Java - -If you're new to Java, start by reading my [7 tips for new Java developers][5] article. Once you're relatively comfortable with Java, open your favorite integrated development environment (IDE) and create a new project. I call mine **myConfigParser**. - -Without worrying too much about imports and error catching initially, you can instantiate a parser using the standard Java extensions found in the `javax` and `java.io` libraries. If you're using an IDE, you'll be prompted to import the appropriate libraries; otherwise, you can find a full list of libraries in the complete version of this code later in this article. - - -``` -Path configPath = Paths.get([System][6].getProperty("user.home"), ".config", "DemoXMLParser"); -[File][7] configFile = new [File][7](configPath.toString(), "myconfig.xml"); - -DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - -DocumentBuilder builder = null; -builder = factory.newDocumentBuilder(); - -[Document][8] doc = null; -doc = builder.parse(configFile); -doc.getDocumentElement().normalize(); -``` - -This example code uses the `java.nio.Paths` library to locate the user's home directory, adding the default configuration location to the path. Then it defines the configuration file to be parsed as a File object using the `java.io.File` library. - -Next, it uses the `javax.xml.parsers.DocumentBuilder` and `javax.xml.parsers.DocumentBuilderFactory` libraries to create an internal document builder so that the Java program can ingest and parse XML data. - -Finally, Java builds a document called `doc` and loads the `configFile` file into it. Using `org.w3c.dom` libraries, it normalizes the ingested XML data. - -That's essentially it. Technically, you're done parsing the data. But parsed data isn't of much use to you if you can't access it, so write some queries to extract important values from your configuration. - -### Accessing XML values with Java - -Getting data from your ingested XML document is a matter of referencing a specific node and then "walking" through the elements it contains. It's common to use a series of loops to iterate through elements in nodes, but I'll keep that to a minimum here, just to keep the code easy to read: - - -``` -NodeList nodes = doc.getElementsByTagName("window"); - -for (int i = 0; i < nodes.getLength(); i++) { - Node mynode = nodes.item(i); - System.out.println("Property = " + mynode.getNodeName()); -        - if (mynode.getNodeType() == Node.ELEMENT_NODE) { -   Element myelement = (Element) mynode; -              -   System.out.println("Theme = " + myelement.getElementsByTagName("theme").item(0).getTextContent()); -   System.out.println("Fullscreen = " + myelement.getElementsByTagName("fullscreen").item(0).getTextContent()); -   System.out.println("Icon set = " + myelement.getElementsByTagName("icons").item(0).getTextContent()); - } -} -``` - -This sample code creates a `NodeList` object called `nodes` using the `org.w3c.dom.NodeList;` library. This object contains any child node with a name that matches the string `window`, which is the only node in the sample config file created in this article. - -Next, it creates a for-loop to iterate over the `nodes` list, taking each node in order of appearance and processing it with an if-then loop. The if-then loop creates an `Element` object called `myelement` that contains all elements within the current node. You can query the elements using methods like `getChildNodes`, `getElementById`, and others, as [documented][9] by the project. - -In this example, the elements are essentially the configuration keys. The values are stored as the content of the element, which you can extract with the `.getTextContent` method. - -Run the code either in your IDE or as a binary: - - -``` -$ java ./DemoXMLParser.java -Property = window -Theme = Dark -Fullscreen = 0 -Icon set = Tango -``` - -Here's the full code: - - -``` -package myConfigParser; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Path; -import java.nio.file.Paths; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - -public class ConfigParser { - -        public static void main([String][10][] args) { -                Path configPath = Paths.get([System][6].getProperty("user.home"), ".config", "DemoXMLParser"); -                [File][7] configFile = new [File][7](configPath.toString(), "myconfig.xml"); -                DocumentBuilderFactory factory = -                DocumentBuilderFactory.newInstance(); -                DocumentBuilder builder = null; -                -                try { -                        builder = factory.newDocumentBuilder(); -                } catch (ParserConfigurationException e) { -                        e.printStackTrace(); -                } -        -                [Document][8] doc = null; -        -                try { -                        doc = builder.parse(configFile); -                } catch (SAXException e) { -                        e.printStackTrace(); -                } catch ([IOException][11] e) { -                        e.printStackTrace(); -                } -        doc.getDocumentElement().normalize(); -        -        NodeList nodes = doc.getElementsByTagName("window"); -        for (int i = 0; i < nodes.getLength(); i++) { -           Node mynode = nodes.item(i); -           [System][6].out.println("Property = " + mynode.getNodeName()); -            -           if (mynode.getNodeType() == Node.ELEMENT_NODE) { -               [Element][12] myelement = ([Element][12]) mynode; - -               [System][6].out.println("Theme = " + myelement.getElementsByTagName("theme").item(0).getTextContent()); -               [System][6].out.println("Fullscreen = " + myelement.getElementsByTagName("fullscreen").item(0).getTextContent()); -               [System][6].out.println("Icon set = " + myelement.getElementsByTagName("icons").item(0).getTextContent()); -           } // close if -        } // close for -    } // close method -} //close class -``` - -### Updating XML with Java - -From time to time, a user is going to change a preference. The `org.w3c.dom` libraries can update the contents of an XML element; you only have to select the XML element the same way you did when reading it. Instead of using the `.getTextContent` method, you use the `.setTextContent` method: - - -``` -updatePref = myelement.getElementsByTagName("fullscreen").item(0); -updatePref.setTextContent("1"); - -[System][6].out.println("Updated fullscreen to " + myelement.getElementsByTagName("fullscreen").item(0).getTextContent());   -``` - -This changes the XML document in your application's memory, but it doesn't write the data back to the drive. Using a combination of `javax` and `w3c` libraries, you can place your ingested XML back into your configuration file: - - -``` -TransformerFactory transformerFactory = TransformerFactory.newInstance(); - -Transformer xtransform; -xtransform = transformerFactory.newTransformer(); - -DOMSource mydom = new DOMSource(doc); -StreamResult streamResult = new StreamResult(configFile); - -xtransform.transform(mydom, streamResult); -``` - -This silently overwrites the previous configuration file with transformed data. - -Here's the full code, complete with the updater: - - -``` -package myConfigParser; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Path; -import java.nio.file.Paths; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - -public class ConfigParser { - -        public static void main([String][10][] args) { -                Path configPath = Paths.get([System][6].getProperty("user.home"), ".config", "DemoXMLParser"); -                [File][7] configFile = new [File][7](configPath.toString(), "myconfig.xml"); -                DocumentBuilderFactory factory = -                DocumentBuilderFactory.newInstance(); -                DocumentBuilder builder = null; -                -                try { -                        builder = factory.newDocumentBuilder(); -                } catch (ParserConfigurationException e) { -                        // TODO Auto-generated catch block -                        e.printStackTrace(); -                } -        -                [Document][8] doc = null; -        -                try { -                        doc = builder.parse(configFile); -                } catch (SAXException e) { -                        // TODO Auto-generated catch block -                        e.printStackTrace(); -                } catch ([IOException][11] e) { -                        // TODO Auto-generated catch block -                        e.printStackTrace(); -                } -        doc.getDocumentElement().normalize(); -        Node updatePref = null; -//        NodeList nodes = doc.getChildNodes(); -        NodeList nodes = doc.getElementsByTagName("window"); -        for (int i = 0; i < nodes.getLength(); i++) { -           Node mynode = nodes.item(i); -           [System][6].out.println("Property = " + mynode.getNodeName()); -            -           if (mynode.getNodeType() == Node.ELEMENT_NODE) { -               [Element][12] myelement = ([Element][12]) mynode; - -               [System][6].out.println("Theme = " + myelement.getElementsByTagName("theme").item(0).getTextContent()); -               [System][6].out.println("Fullscreen = " + myelement.getElementsByTagName("fullscreen").item(0).getTextContent()); -               [System][6].out.println("Icon set = " + myelement.getElementsByTagName("icons").item(0).getTextContent()); - -               updatePref = myelement.getElementsByTagName("fullscreen").item(0); -               updatePref.setTextContent("2"); -               [System][6].out.println("Updated fullscreen to " + myelement.getElementsByTagName("fullscreen").item(0).getTextContent());           -           } // close if -            -        }// close for - -        // write DOM back to the file -        TransformerFactory transformerFactory = TransformerFactory.newInstance(); -        Transformer xtransform; - -        DOMSource mydom = new DOMSource(doc); -        StreamResult streamResult = new StreamResult(configFile); - -        try { -                xtransform = transformerFactory.newTransformer(); -                xtransform.transform(mydom, streamResult); -        } catch (TransformerException e) { -                e.printStackTrace(); -        } -                        -    } // close method -} //close class -``` - -### Keep configuration trouble-free - -Configuration can be a deceptively simple routine. You might start with a simple plain text config format while your application has only a few configurable features, but as you introduce more options, reading or writing incorrect data can cause unexpected behavior from your application. One way to help keep your configuration process safe from failure is to use a strict format like XML and to lean on your programming language's built-in features to handle the complexity. - -I like using Java and XML for this very reason. When I try to read the wrong configuration value, Java lets me know, often because the node my code claims to want to read doesn't exist in the XML path I expect. XML's highly structured format helps me keep my code reliable, and that benefits both the users and the developer. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/parsing-config-files-java - -作者:[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/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hot drink at the computer) -[2]: https://opensource.com/resources/java -[3]: https://opensource.com/article/21/6/what-config-files -[4]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html -[5]: https://opensource.com/article/19/10/java-basics -[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system -[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+file -[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+document -[9]: https://www.w3.org/2003/01/dom2-javadoc/org/w3c/dom/Document.html -[10]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string -[11]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+ioexception -[12]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+element diff --git a/sources/tech/20210710 A new open source operating system for embedded systems.md b/sources/tech/20210710 A new open source operating system for embedded systems.md deleted file mode 100644 index e8658cdb55..0000000000 --- a/sources/tech/20210710 A new open source operating system for embedded systems.md +++ /dev/null @@ -1,92 +0,0 @@ -[#]: subject: (A new open source operating system for embedded systems) -[#]: via: (https://opensource.com/article/21/7/rt-thread-smart) -[#]: author: (Zhu Tianlong https://opensource.com/users/zhu-tianlong) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -A new open source operating system for embedded systems -====== -RT-Thread Smart is working to open source the world of IoT and edge -computing. -![An intersection of pipes.][1] - -There's a growing demand for [embedded operating systems][2], and it's best when the one you build upon is open source. The [RT-Thread][3] project's R&D team has spent three years of research and intensive development to arrive at the project's latest offering: RT-Thread Smart. It is a microkernel operating system aimed primarily at midrange to high-end processors such as RISC-V with a memory management unit (MMU) and provides a competitive software platform for all industries in the embedded space. - -### Who needs RT-Thread Smart? - -RT-Thread Smart is a professional, high-performance, microkernel operating system for real-time applications. It offers an open source foundation for embedded devices in any market, including security (e.g., internet protocol cameras), industrial control, onboard devices, consumer electronics, and anything else using embedded technology (which is increasingly coming to mean "everything"). It's significant because, unlike traditional IoT operating systems, a microkernel operating system can fill the gap between a traditional real-time operating system (RTOS) and a comparatively large operating system like Linux to achieve the best balance between real-time performance, cost, security, startup speed, and more. - -### RT-Thread Smart's architecture - -RT-Thread Smart separates a system into kernel mode and user mode by taking advantage of the MMU and system call methods. It then divides the address space for each mode (a 32-bit system provides 4G address space). - -![RT-Thread Smart architecture][4] - -(RT-Thread, [CC BY-SA 4.0)][5] - -The RT-Thread Smart kernel includes the platform's basic functionality and supports customizations. RT-Thread Smart's userspace application environment uses [musl libc][6] to provide [POSIX][7] interface calls and C runtime supports. It also inherits the original RT-Thread ecosystem, using [SCons][8] or other build tools such as [Autotools][9], Makefiles, [CMake][10], and so on to support development, as well as RT-Thread's out-of-the-box online software packages (over 342 at the time of this writing). You can even port Linux applications, such as wget/cURL, BusyBox, OpenSSL, and Simple DirectMedia Layer, to your platform. - -The compressed RT-Thread Smart kernel is just 217KB, with a root filesystem of 127KB. Typical memory usage is about 2MB. - -Including full support for filesystems, network protocol stacks, and multimedia, it takes only three to five seconds for RT-Thread to finish its startup process. Without running any functional components, RT-Thread Smart requires less than 500ms to start and be ready. - -With its integrated Persimmon user interface (UI) component, the time it takes from power-on to a running UI is about one second. In other words, this is a seriously tiny and fast system. Of course, "real time" isn't about startup but how the system performs consistently over time. For RT-Thread, real-time performance is a priority, and the interrupt latency is less than 1 μs, which meets most application cases with the strictest real-time requirements. - -### RT-Thread Smart vs. RT-Thread - -You might be wondering about the differences between RT-Thread Smart and RT-Thread. Simply put, RT-Thread Smart is an RT-Thread RTOS-based operating system, but it integrates the user-state process. The kernel part of RT-Smart is essentially RT-Thread RTOS; it runs on virtual addresses, joins process management, and uses interprocess communication mechanisms, virtual memory/address space management, ELF loaders, and so on, and it makes all of these features components within RT-Thread RTOS. When the IwP components are disabled, RT-Smart falls back onto RT-Thread RTOS. - -Here's a comparison: - -| RT-Thread | RT-Thread Smart ----|---|--- -Supported chips | Cortex-M/R, RISC-V RV32IMAC (and similar), Cortex-A MPU | MPU with MMU, such as Cortex-A -Compiling | The kernel and application are compiled into an image program. | The kernel and application can be separately compiled and executed. -Memory | Runs on a linear address space (even with MMU) and uses virtual addressing with the physical address | Runs on a 32-bit system with the kernel running on more than 1GB, the user-state process has separate address spaces that are isolated from each other. Peripheral drivers must access peripherals with virtual addresses. -Running errors | When an application fails, the overall system collapses. | When an application fails, it does not affect kernel and other process execution. -Running model | Multiprocess model | Multiprocess model (multithread is supported within the process, and kernel threads are supported by the kernel) -User model | Single-user model | Single-user model -API | RT-Thread API, POSIX PSE52 | RT-Thread API (on kernel and userspace), plus a full POSIX API -Real time | Preemptive hard real-time system | Preemptive hard real-time system -Resource utilization | Very small | Relatively small -Debugging | Generally debugged through the emulator | No emulator required according to the way the software debugs - -RT-Thread RTOS is very compact. All applications and subsystems are compiled into the image, and multitasking runs and shares the same address space. - -RT-Thread Smart is independent. Systems and applications are separately compiled and executed. Applications have a complete address space and are kept isolated from each other. It also inherits all the great real-time features of RT-Thread and features a POSIX environment. - -Similarly, they're both compatible with the RT-Thread API, so applications on RT-Thread RTOS can be smoothly ported to RT-Thread Smart. - -### Embed open source - -RT-Thread Smart is an open source project, with its code available on [GitHub][11]. You can download the code and its documentation, give it a try, submit comments and feedback, and help spread it to more open source advocates. Embedded systems should belong to their users, and there are too many embedded developers out there who don't realize what's available. - -If you're a developer, help hack on RT-Thread Smart! As the RT-Thread project continues to advance, we aim to make the exciting worlds of IoT and edge computing open source. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/rt-thread-smart - -作者:[Zhu Tianlong][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/zhu-tianlong -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LAW-Internet_construction_9401467_520x292_0512_dc.png?itok=RPkPPtDe (An intersection of pipes.) -[2]: https://opensource.com/article/20/6/open-source-rtos -[3]: https://www.rt-thread.io/ -[4]: https://opensource.com/sites/default/files/uploads/rt-thread-smart.png (RT-Thread Smart architecture) -[5]: https://creativecommons.org/licenses/by-sa/4.0/legalcode -[6]: https://musl.libc.org/ -[7]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains -[8]: https://scons.org/ -[9]: https://opensource.com/article/19/7/introduction-gnu-autotools -[10]: https://opensource.com/article/21/5/cmake -[11]: https://github.com/RT-Thread/rt-thread/tree/rt-smart diff --git a/sources/tech/20210711 How to Dual Boot Fedora and Windows.md b/sources/tech/20210711 How to Dual Boot Fedora and Windows.md deleted file mode 100644 index 2680d11032..0000000000 --- a/sources/tech/20210711 How to Dual Boot Fedora and Windows.md +++ /dev/null @@ -1,242 +0,0 @@ -[#]: subject: (How to Dual Boot Fedora and Windows) -[#]: via: (https://itsfoss.com/dual-boot-fedora-windows/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to Dual Boot Fedora and Windows -====== - -_**Brief:** This detailed tutorial shows you **how to dual boot Fedora Linux with Windows 10**, step-by-step, accompanied by proper screenshots._ - -Dual booting Linux and Windows is one of the popular ways to enjoy the full potential of the two operating systems. You have both Linux and Windows installed on the same system and you can choose which one to use after starting your system. - -![On the grub screen, you can select the operating system][1] - -If you have a system with Windows installed already, you’ll learn how to install Fedora alongside Windows in this tutorial. - -### Installing Fedora alongside Windows - -![][2] - -The tutorial has been performed on a system with Windows already installed, GPT partitioning and UEFI boot. It should be applicable to other systems with MBR partitioning and legacy BIOS system as well, but I cannot confirm that. - -Note: If your Windows system uses BitLocker encryption, it will be a good idea to disable it first before you go on installing Fedora. - -#### Requirements - -Here’s what you’ll need to follow this tutorial: - - * A system preinstalled with Windows - * Good speed internet connection - * A USB key (pen drive) with at least 4 GB in size - * Optional: External USB disk for making back up of your existing data on Windows. - * Optional: Windows recovery or bootable disk (if you encounter any major boot issues, you can fix with it). - - - -Let’s see the steps. - -#### Step 1: Make a backup of data on your Windows system [optional] - -Backup is always a good idea. You will be dealing with the disk partitions. In the rare unfortunate case, if you make a mistake and delete the wrong partition, you’ll lose your data. - -The simplest way would to be to copy the data in Documents, Videos, Music, Pictures and other folders to an external USB disk. You can use an external HDD (slower but cheaper) or SSD (faster but expensive) and copy the important files and folders on it. - -Preview | Product | Price | ----|---|---|--- -![SanDisk 500GB Extreme Portable SSD - Up to 1050MB/s - USB-C, USB 3.2 Gen 2 - External Solid State Drive - SDSSDE61-500G-G25][3] ![SanDisk 500GB Extreme Portable SSD - Up to 1050MB/s - USB-C, USB 3.2 Gen 2 - External Solid State Drive - SDSSDE61-500G-G25][3] | [SanDisk 500GB Extreme Portable SSD - Up to 1050MB/s - USB-C, USB 3.2 Gen 2 - External Solid State...][4] | $89.99[][5] | [Buy on Amazon][6] -Preview | Product | Price | ----|---|---|--- -![Toshiba Canvio Advance 1TB Portable External Hard Drive USB 3.0, Black - HDTCA10XK3AA][7] ![Toshiba Canvio Advance 1TB Portable External Hard Drive USB 3.0, Black - HDTCA10XK3AA][7] | [Toshiba Canvio Advance 1TB Portable External Hard Drive USB 3.0, Black - HDTCA10XK3AA][8] | $51.99[][5] | [Buy on Amazon][9] - -#### Step 2: Make some free space for Fedora installation - -You need to create a partition where you’ll be installing Fedora. If you just have C drive, shrink it. If you have D, E or F drive, see if you can move their data to some other partition and delete or shrink one of them. Anything above 40 GB should be comfortable enough space for Fedora. - -In the Windows menu, search for ‘disk partitions’ and go to ‘Create and format hard disk partitions’. - -![][10] - -In the Disk Management tool, right-click on the drive which you want to partition and select **shrink volume**. - -If you have just one partition like this, you need to make some free space out of it for Linux. If you have several partitions of considerable size, use any of them except C drive because it may erase the data. - -![][11] - -#### Step 3: Making a live USB of Fedora in Windows - -Now, this can be done in different ways. You can download the ISO and [use Etcher][12] or Rufus or some other tool to write the ISO image to the USB disk. - -However, Fedora provides a dedicated tool for downloading and making live USB. I am going to use that in this tutorial. The Fedora team put some effort in creating this tool, so why not use it. - -But first, **plug in the USB key**. Now, go to the download page of Fedora: - -[Fedora Download][13] - -You’ll see the option to download the Fedora Media Writer tool for Windows. - -![][14] - -It will download an exe file. Once downloaded, go to your downloads folder and double-click the FedoraMediaWriter exe file to install the Fedora Media Writer tool. Just keep on hitting next. - -![][15] - -Once installed, run the Fedora Media Writer tool. But before that, **make sure that you have plugged in the USB**. - -It will give you the option to install various editions of Fedora. For desktops, go with Workstation. - -![][16] - -On the next screen, you’ll get the option to create live USB. When you hit that button, it starts downloading the ISO. It will also recognize your inserted USB key. - -You need to have a good speed internet connection to download the 2 GB of ISO in a comfortable time span. - -![][17] - -After downloading the ISO, it checks the download automatically and then gives you the option to write the ISO image to the USB disk, i.e. create the live USB. Hit the “Write to Disk” button. - -![][18] - -It will take a couple of minutes to complete the process. It displays “Finished” message and you can close the Fedora Media Writer tool now. - -![][19] - -Good! So now you have the Fedora live USB ready with you. Time to use it for installing Fedora with Windows. - -#### Step 4: Boot from live USB and install Fedora - -Some systems do not allow you to boot from live USB with secure boot. If that’s the case with you, please [disable secure boot][20]. - -At the screen that shows the logo of your system manufacturer, press the **F2 or F10 or F12** key. You may try pressing all of them one by one if you are not sure of the key. But **be quick** when you do that otherwise it will boot into the operating system. - -This key is different for different brand of computers. Some may even use **Esc** or **Del** keys for this purpose. - -![Quickly press F2, F10 or F12 keys at the screen showing your system manufacturer’s logo][21] - -In some rare cases, you may have to [access the UEFI boot settings from within Windows][22]. - -In the BIOS settings, normally, you should see a screen like this. Here, you use the arrow keys to move down to USB option and press enter to boot from the USB. Please note that the screen may look different in different systems. - -![][23] - -If things go right, you should see a screen like below. **Go with the first option “Start Fedora Workstation”:** - -![][24] - -After some seconds, you should boot into the live Fedora session and see the option to try or install it. Go with “Install to Hard Drive”. - -![][25] - -It will ask to choose the language of choice for the installation process. - -![][26] - -The next screen is important. If you had created the free space in the step 2, you should be able to hit on the “Begin Installation”. If you see an exclamation mark on the disk icon under System, click on it and see what kind of disk configuration you can use here. - -If you have more than one disk, you can choose which disk to use for Fedora. - -![][27] - -Select the disk and click on Done. You may see a warning message now. In my case, I did not create free space in the step 2 and hence it complained that there is not enough free space to install Fedora. - -![][28] - -I clicked on reclaim space and shrank the Windows partition here. - -![][29] - -After this, the “Begin Installation” option appeared to start the installation. - -![][30] - -Now it’s just a waiting game. It will take a few minutes to extract files and install them. - -![][31] - -When the process completes, you’ll see the “Finish Installation” button. Hit it. - -![][32] - -You’ll be back to Fedora live session. Click the top right corner to bring down the menu and select Restart. - -![][33] - -When the system starts now, you should see the [Grub bootloader][34] screen with option to boot into Fedora and Windows. - -![][1] - -#### Step 5: Complete Fedora setup - -You are almost there. Did you notice that Fedora didn’t ask you to enter username and password? Many distributions like Ubuntu ask you to create an admin user during the installation itself. On the other hand, Fedora gives you this option when you log in to the installed system for the first time. - -When you first log in, it runs a setup and creation of user and password is part of this initial setup. - -![][35] - -![][36] - -![][37] - -Once you do that, you are ready to enjoy Fedora Linux. - -![][38] - -That’s it. You can enjoy Fedora Linux and Windows in dual boot mode on the same system. - -If you have any questions or if you are facing any issues while following this tutorial, please let me know in the comment system. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/dual-boot-fedora-windows/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/dual-boot-grub-screen-fedora-windows.jpg?resize=800%2C350&ssl=1 -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-windows-dual-boot.jpg?resize=800%2C450&ssl=1 -[3]: https://i1.wp.com/m.media-amazon.com/images/I/41zwkV8VfPL._SL160_.jpg?ssl=1 -[4]: https://www.amazon.com/dp/B08GTXVG9P?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (SanDisk 500GB Extreme Portable SSD - Up to 1050MB/s - USB-C, USB 3.2 Gen 2 - External Solid State Drive - SDSSDE61-500G-G25) -[5]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) -[6]: https://www.amazon.com/dp/B08GTXVG9P?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Buy on Amazon) -[7]: https://i0.wp.com/m.media-amazon.com/images/I/31-nRLIONWL._SL160_.jpg?ssl=1 -[8]: https://www.amazon.com/dp/B08JKFY8FH?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Toshiba Canvio Advance 1TB Portable External Hard Drive USB 3.0, Black - HDTCA10XK3AA) -[9]: https://www.amazon.com/dp/B08JKFY8FH?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Buy on Amazon) -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/disc-management-windows.png?resize=800%2C561&ssl=1 -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/making-free-space-for-dual-boot.jpg?resize=1226%2C728&ssl=1 -[12]: https://itsfoss.com/install-etcher-linux/ -[13]: https://getfedora.org/en/workstation/download/ -[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/download-fedora-media-writer-tool.png?resize=800%2C373&ssl=1 -[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-Fedora-Media-Writer-tool-Windows.png?resize=745%2C581&ssl=1 -[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-media-writer-1.png?resize=800%2C425&ssl=1 -[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-media-writer-2.jpg?resize=800%2C422&ssl=1 -[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/writing-fedora-iso-to-usb-with-Fedora-Media-Writer-Tool.png?resize=800%2C285&ssl=1 -[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedoa-live-usb-with-fedora-media-writer.png?resize=800%2C300&ssl=1 -[20]: https://itsfoss.com/disable-secure-boot-windows/ -[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/acer-predator-boot.jpg?resize=800%2C600&ssl=1 -[22]: https://itsfoss.com/access-uefi-settings-windows-10/ -[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/select-boot-from-live-usb.jpg?resize=800%2C330&ssl=1 -[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-live-screen.jpg?resize=800%2C350&ssl=1 -[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/Fedora-install-screen.jpg?resize=800%2C450&ssl=1 -[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-1.png?resize=800%2C450&ssl=1 -[27]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-2.png?resize=800%2C450&ssl=1 -[28]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-3.png?resize=800%2C450&ssl=1 -[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-4.png?resize=800%2C450&ssl=1 -[30]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-5.png?resize=800%2C450&ssl=1 -[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-6.png?resize=800%2C450&ssl=1 -[32]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-7.png?resize=800%2C450&ssl=1 -[33]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/restart-gnome-fedora.jpg?resize=799%2C439&ssl=1 -[34]: https://itsfoss.com/what-is-grub/ -[35]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-setup-1.png?resize=800%2C575&ssl=1 -[36]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-setup-2.png?resize=800%2C593&ssl=1 -[37]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-setup-3.png?resize=800%2C591&ssl=1 -[38]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-setup-completed.jpg?resize=800%2C500&ssl=1 diff --git a/sources/tech/20210724 How to Fix yay- error while loading shared libraries- libalpm.so.12.md b/sources/tech/20210724 How to Fix yay- error while loading shared libraries- libalpm.so.12.md index 49cfea21b5..7808a3994d 100644 --- a/sources/tech/20210724 How to Fix yay- error while loading shared libraries- libalpm.so.12.md +++ b/sources/tech/20210724 How to Fix yay- error while loading shared libraries- libalpm.so.12.md @@ -1,19 +1,19 @@ -[#]: 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: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: 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: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " How to Fix yay: error while loading shared libraries: libalpm.so.12 ====== -This quick guide is to help you to fix yay error – while loading shared -libraries: libalpm.so.12. -If you are running [Arch Linux][1] in a system for a longer time, things can break due to its rolling release nature combined with your hardware support. If you use the [AUR Helper Yay][2], then sometimes, yay can be corrupted due to several installations, upgrade of other packages. +This quick guide is to help you to fix yay error – while loading shared libraries: libalpm.so.12. -The YAY helper itself is very stable, but sometimes it gets messed up, and you can not do any installation using it until you fix it. And one of the nagging error is this: +If you are running [Arch Linux][1] in a system for longer, things can break due to its rolling release nature combined with your hardware support. If you use the AUR Helper Yay, then sometimes, yay can be corrupted due to several installations upgrades of other packages. + +The YAY helper is very stable, but sometimes it gets messed up, and you can not do any installation using it until you fix it. And one of the nagging errors is this: ``` yay: error while loading shared libraries: libalpm.so.12: cannot open shared object file: No such file or directory @@ -21,21 +21,17 @@ yay: error while loading shared libraries: libalpm.so.12: cannot open shared obj This error particularly comes after upgrading to pacman 6.0 due to incompatibility of shared libraries. -![error while loading shared libraries – yay][3] +![error while loading shared libraries - yay][2] ### How to fix yay error – while loading shared libraries: libalpm.so.12 - * This error can only be fixed by uninstalling yay completely, including its dependencies. - * Then re-installing yay. - - - * There is no other way to solve this error. - - - * We already have a guide [how to install Yay][4], however, here are the steps to fix. - * Clone the yay repo from AUR and build. Run the following command in sequence from a terminal window. +* This error can only be fixed by uninstalling yay completely, including its dependencies. +* Then re-installing yay. +* There is no other way to solve this error. +* We already have a guide [how to install Yay][3], however, here are the steps to fix. +* Clone the yay repo from AUR and build. Run the following command in sequence from a terminal window. ``` cd /tmp @@ -46,32 +42,24 @@ cd ~ rm -rf /tmp/yay/ ``` -After installation, you can try running the command which gave you this error. And you should be all set. If you’re still having error, let me know in the comment box below. +After installation, you can try running the command which gave you this error. And you should be all set. If you still have this error, let me know in the comment box below. -Apparently, this has been encountered by many people and [several discussions][5] happened across web. Above is the only solution to this error. And I could not find exact root cause of the problem anywhere except it starts after pacman 6.0 update. - -[][6] - -SEE ALSO:   How to Install Java in Arch Linux and Manjaro - -* * * +Many people have encountered this, and [several discussions][4] happened across the web. Above is the only solution to this error. And I could not find the exact root cause of the problem anywhere except it started after pacman 6.0 update. -------------------------------------------------------------------------------- via: https://www.debugpoint.com/2021/07/yay-error-libalpm-so-12/ 作者:[Arindam][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 +[b]: https://github.com/lkxed [1]: https://archlinux.org/ -[2]: https://aur.archlinux.org/packages/yay/ -[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/error-while-loading-shared-libraries-yay.jpg -[4]: https://www.debugpoint.com/2021/01/install-yay-arch/ -[5]: https://github.com/Jguer/yay/issues/1519 -[6]: https://www.debugpoint.com/2021/02/install-java-arch/ +[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/sources/tech/20210725 How to Recover Arch Linux Install via chroot.md b/sources/tech/20210725 How to Recover Arch Linux Install via chroot.md index 66497c1592..bf684b6e08 100644 --- a/sources/tech/20210725 How to Recover Arch Linux Install via chroot.md +++ b/sources/tech/20210725 How to Recover Arch Linux Install via chroot.md @@ -1,16 +1,16 @@ -[#]: 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: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: 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: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " How to Recover Arch Linux Install via chroot ====== -This quick guide explains some of the steps which may come in handy to -recover an Arch Linux Install. +This quick guide explains some of the steps which may come in handy to recover an Arch Linux Install. + Being a rolling release, sometimes things breaks in [Arch Linux][1]. Not because of your own actions, but hundreds of other reasons such as new Kernel vs your hardware, or software compatibility. But still, Arch Linux is still better and provides the latest packages and applications. But sometimes, it gives you trouble and you end up with a blinking cursor and nothing else. @@ -19,126 +19,100 @@ So, in those scenarios, instead of re-formatting or reinstalling, you may want t ### Recover Arch Linux Installation - * First step is to **create a bootable LIVE USB** with Arch Linux. Download the .ISO from this link and create a bootable .ISO. You can check out this guide on [how to create bootable .ISO using Etcher][2]. Remember this step require another working stable system obviously as your current system is not usable. - - +* First step is to create a bootable LIVE USB with Arch Linux. Download the .ISO from this link and create a bootable .ISO. You can check out this guide on [how to create bootable .ISO using Etcher][2]. Remember this step require another working stable system obviously as your current system is not usable. [download arch linux][3] - * You need to know on **which partition your Arch Linux** is installed. This is a very important step. If you don’t know, you can use GParted to find out. Or check in your Grub menu, Or you can run the below command to find out. This will list all of your disk partitions with their size, labels. - - +* You need to know on which partition your Arch Linux is installed. This is a very important step. If you don’t know, you can use GParted to find out. Or check in your Grub menu, Or you can run the below command to find out. This will list all of your disk partitions with their size, labels. ``` sudo lsblk -o name,mountpoint,label,size,uuid ``` - * Once done, plug-in the USB stick and boot from it. And you should see the Arch Linux prompt in the LIVE medium. - - - * Now, mount to the Arch Linux partition using below. Change the `/dev/sda3` to your respective partition. - +* Once done, plug-in the USB stick and boot from it. And you should see the Arch Linux prompt in the LIVE medium. +* Now, mount to the Arch Linux partition using below. Change the /dev/sda3 to your respective partition. ``` -mount /dev/sda3 /mnt -arch-chroot /mnt +/dev/sda3 ``` - * The arch-chroot command will mount your Arch Linux partition in the terminal, so login using your Arch credentials. Now, at this stage, you have the following options, based on what you want. +``` +mount /dev/sda3 /mntarch-chroot /mnt +``` +* The arch-chroot command will mount your Arch Linux partition in the terminal, so login using your Arch credentials. Now, at this stage, you have the following options, based on what you want. - * You can take backups of your data by going through /home folders. In case, troubleshooter doesn’t work. You may copy the files to external USB or another partition. - - - * Verify the log files, specially the **pacman logs**. Because, unstable system may be caused by upgrading some packages such graphics driver or any other driver. Based on the log, you may want to downgrade any specific package if you want. - * You may use the below command to view last 200 lines of the pacman log file to find out any failing items or dependency removal. - +* You can take backups of your data by going through /home folders. In case, troubleshooter doesn’t work. You may copy the files to external USB or another partition. +* Verify the log files, specially the pacman logs. Because, unstable system may be caused by upgrading some packages such graphics driver or any other driver. Based on the log, you may want to downgrade any specific package if you want. +* You may use the below command to view last 200 lines of the pacman log file to find out any failing items or dependency removal. ``` tail -n 200 /var/log/pacman.log | less ``` - * The above command gives you the 200 lines from the end of the pacman.log file to verify. Now, carefully check which of the packages were updates since your successful boot. - - - * And note down the package name and version somewhere. And you may try to downgrade packages one-by-one or if you think a specific package created a problem. Use the -U switch of pacman command to downgrade. - +* The above command gives you the 200 lines from the end of the pacman.log file to verify. Now, carefully check which of the packages were updates since your successful boot. +* And note down the package name and version somewhere. And you may try to downgrade packages one-by-one or if you think a specific package created a problem. Use the -U switch of pacman command to downgrade. ``` pacman -U ``` - * You can run the following to start your Arch system after downgrading, if any. - - +* You can run the following to start your Arch system after downgrading, if any. ``` exec /sbin/init ``` - * Check the status of your display manager, whether if there are any errors. Sometimes, display manager creates a problem which can’t communicate with X Server. For example, if you are using lightdm, then you can check its status via below. - - +* Check the status of your display manager, whether if there are any errors. Sometimes, display manager creates a problem which can’t communicate with X Server. For example, if you are using lightdm, then you can check its status via below. ``` systemctl status lightdm ``` - * Or, may want to start it via below command and check what is the error. - - +* Or, may want to start it via below command and check what is the error. ``` lightdm --test-mode --debug ``` - * Here is an example of lightdm failure which caused an unstable Arch system. +* Here is an example of lightdm failure which caused an unstable Arch system. +![lightdm - test mode][4] +* Or check via kicking off the X server using startx. -![lightdm – test mode][4] +``` +startx +``` - * Or check via kicking off the X server using `startx`. +* In my experience, if you see errors in the above command, try to install another display manager such as sddm and enable it. It may eliminate the error. - - * In my experience, if you see errors in the above command, try to install another display manager such as **sddm** and enable it. It may eliminate the error. - - - * Try the above steps, based on the state of your system, and troubleshoot. For errors specific to display manager lightdm, we have a [guide][5] which you may want to check out. - * If you are using sddm, then check out [these troubleshooting steps][6] if something works. - - - -[][7] - -SEE ALSO:   Essential Pacman Commands for Arch Linux [With Examples] +* Try the above steps, based on the state of your system, and troubleshoot. For errors specific to display manager lightdm, we have a [guide][5] which you may want to check out. +* If you are using sddm, then check out [these troubleshooting steps][6] if something works. ### Closing Notes Every installation is different. And above steps may/may not work for you. But it is worth a try and as per experience, it works. If it works, well, good for you. Either way, do let me know in the comment box below, how it goes. -* * * - -------------------------------------------------------------------------------- via: https://www.debugpoint.com/2021/07/recover-arch-linux/ 作者:[Arindam][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 +[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/blog/wp-content/uploads/2021/03/lightdm-test-mode.jpg +[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 -[7]: https://www.debugpoint.com/2021/02/pacman-command-arch-examples/ diff --git a/sources/tech/20210809 How to Enable Minimize, Maximize Window Buttons in elementary OS.md b/sources/tech/20210809 How to Enable Minimize, Maximize Window Buttons in elementary OS.md index b4a8a8453f..8e10260309 100644 --- a/sources/tech/20210809 How to Enable Minimize, Maximize Window Buttons in elementary OS.md +++ b/sources/tech/20210809 How to Enable Minimize, Maximize Window Buttons in elementary OS.md @@ -1,7 +1,7 @@ [#]: subject: "How to Enable Minimize, Maximize Window Buttons in elementary OS" [#]: via: "https://www.debugpoint.com/2021/08/enable-minimize-maximize-elementary/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" +[#]: collector: "lkxed" [#]: translator: " " [#]: reviewer: " " [#]: publisher: " " @@ -9,15 +9,13 @@ How to Enable Minimize, Maximize Window Buttons in elementary OS ====== -This is how you can enable the Minimize, Maximize window buttons in -elementary OS. +This is how you can enable the Minimize, Maximize window buttons in elementary OS. + Many people (mostly new users to elementary OS) asks these questions in various forums: - 1. How do I enable minimize buttons in elementary OS? - 2. How to I enable restore, minimize, maximize? - 3. Is it possible to bring back the minimize and maximize buttons? - - +1. How do I enable minimize buttons in elementary OS? +2. How to I enable restore, minimize, maximize? +3. Is it possible to bring back the minimize and maximize buttons? And they are completely valid questions, and It’s okay to ask questions. Right? This guide to help them to get those buttons in elementary OS. @@ -55,18 +53,13 @@ sudo apt install -y elementary-tweaks #### Change the settings - * After installation, click on the Application at the top bar and open System Settings. -In the **System settings** window, click on **Tweaks** under Personal section. - * In the Tweaks window, go to **Appearance** section. - * Under **Window** Controls, select **Layout: Windows**. - - +* After installation, click on the Application at the top bar and open System Settings.In the System settings window, click on Tweaks under Personal section. +* In the Tweaks window, go to Appearance section. +* Under Window Controls, select Layout: Windows. ![enable minimize maximize buttons elementary OS][3] - * And you should have the minimized, maximize and close button on the right side of the top window bar. - - +* And you should have the minimized, maximize and close button on the right side of the top window bar. There are other combinations as well, such as Ubuntu, macOS, etc. You can choose whatever you feel like: @@ -76,22 +69,20 @@ This step completes the guide. There are other options in gsettings which you ma I hope this guide helps you to enable minimize maximize buttons elementary OS. Let me know in the comment box below if you need any help. -* * * - -------------------------------------------------------------------------------- via: https://www.debugpoint.com/2021/08/enable-minimize-maximize-elementary/ 作者:[Arindam][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 +[b]: https://github.com/lkxed [1]: https://github.com/pantheon-tweaks/pantheon-tweaks [2]: https://github.com/elementary-tweaks/elementary-tweaks -[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/enable-minimize-maximize-buttons-elementary-OS-1024x501.png -[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Other-Options-of-Window-buttons-in-elementary.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2021/08/enable-minimize-maximize-buttons-elementary-OS.png +[4]: https://www.debugpoint.com/wp-content/uploads/2021/08/Other-Options-of-Window-buttons-in-elementary.jpg diff --git a/sources/tech/20210812 A guide to the Linux terminal for beginners.md b/sources/tech/20210812 A guide to the Linux terminal for beginners.md deleted file mode 100644 index 1bdf2b16a6..0000000000 --- a/sources/tech/20210812 A guide to the Linux terminal for beginners.md +++ /dev/null @@ -1,129 +0,0 @@ -[#]: subject: "A guide to the Linux terminal for beginners" -[#]: via: "https://opensource.com/article/21/8/linux-terminal" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -A guide to the Linux terminal for beginners -====== -Learn the differences between Linux terminal commands, arguments, and -options, and how to use them to control your computer. -![Terminal command prompt on orange background][1] - -There's a café a few streets away from where I live, and I go there every Sunday for a regularly scheduled game of D&D. They have a menu, and the first few times I ordered, I looked over the menu for several minutes to see what my choices were. Being a creature of habit, I eventually stopped referring to the menu because I knew exactly what they have for sale, and I know exactly what I want. Ordering food for the table is now as easy as saying "the usual" and waiting for the cups of coffee and bowls of chips and scones to be delivered (usually inconveniently at just the moment we've rolled for initiative, but that's hardly the staff's fault or problem). - -Similar to a restaurant menu, graphical interfaces for computers offer users a choice of actions. There are icons and windows and buttons, and you hunt for the one you're looking for, click on items, drag other items, and manipulate graphical representations until a task is complete. After a while, though, this can become cumbersome and, worse yet, inefficient. You know exactly what needs to be done, so wouldn't it be nice to just tell the computer exactly what you want to happen, rather than going through the physical and mental motions of hunting for components and repeating a mouse-based dance routine? - -### What is the Linux terminal? - -The Linux terminal is a text-based interface used to control a Linux computer. It's just one of the many tools provided to Linux users for accomplishing any given task, but it's widely considered the most efficient method available. Outside of writing code, it's certainly the most direct method possible. It's so popular, in fact, that Apple changed its foundation to Unix and has gained the [Bash and Z shell][2], and Microsoft developed [PowerShell][3], its very own open source command line. - -### What is a Linux command? - -A **command** is a special keyword you can use in a terminal to tell your computer to perform an action. Most commands are tiny little applications that get installed with the rest of your operating system. You may not realize they're on your computer because they're generally kept in relatively obscure directories like `/bin`, `/sbin`, `/usr/bin`, and `/usr/sbin`, but your terminal knows where to find them (thanks to something called the [PATH][4]). Other commands are built into your terminal. You don't have to worry about whether a command was installed or comes built-in because your terminal knows the commands either way. Better yet, on most Linux distributions, when your terminal can't find a command, it searches the internet for a package to provide that command and then offers to install and run it for you! - -Here's a simple command: - - -``` -`$ ls` -``` - -The `ls` command is short for "list," and it lists the contents of your current directory. Open a terminal and try it out. Then open a file manager window (_Files_ on Linux, _Finder_ on macOS, _Windows Explorer_ on Windows) and compare. It's two different views of the same data. - -### What is an argument in a Linux command? - -An **argument** is any part of a command that isn't the command. For instance, to list the contents of a specific directory, you can provide the name of that directory as an argument: - - -``` -`$ ls Documents` -``` - -In this example, `ls` is the command and `Documents` is the argument. This would render a list of your `Documents` directory's contents. - -### What are options in Linux? - -Command **options**, also called **flags** or **switches**, are part of command arguments. A command argument is anything that follows a command, and an option is usually (but not always) demarcated by a dash or double dashes. For instance: - - -``` -`$ ls --classify Documents` -``` - -In this example, `--classify` is an option. It also has a short version because terminal users tend to prefer the efficiency of less typing: - - -``` -`$ ls -F Documents` -``` - -Short options can usually be combined. Here's an `ls` command combining the `-l` option with the `--human-readable`, `--classify`, and `--ignore-backups` options: - - -``` -`$ ls -lhFB` -``` - -Some options can take arguments themselves. For instance, the `--format` option for `ls` lets you change how information is presented. By default, the contents of directories are provided to you in columns, but if you need them to be listed in a comma-delimited list, you can set `format` to `comma`: - - -``` -$ ls --format=comma Documents -alluvial, android-info.txt, arduinoIntro, dmschema, -headers.snippet, twine, workshop.odt -``` - -The equal sign (`=`) is optional, so this works just as well: - - -``` -$ ls --format comma Documents -alluvial, android-info.txt, arduinoIntro, dmschema, -headers.snippet, twine, workshop.odt -``` - -### Learning to use the Linux terminal - -Learning how to use a terminal can increase efficiency and productivity—and can also make computing a lot of fun. There are few times when I run a carefully crafted command and don't sit back marveling at what I've managed to make happen with just a few words typed into an otherwise blank screen. A terminal is many things—programming, poetry, puzzle, and pragmatism—but no matter how you see it, it's a lasting innovation that's worth learning. - - * [Use the Linux terminal to see what files are on your computer][5] - * [How to open and close directories in the Linux terminal][6] - * [Navigating in the Linux terminal][7] - * [Move a file in the Linux terminal][8] - * [Rename a file in the Linux terminal][9] - * [Copy files and folders in the Linux terminal][10] - * [Remove files and folders in the Linux Terminal][11] - - - -After reading and practicing the lessons in these articles, download our free ebook, [Sysadmin's guide to Bash scripting][12] for even more fun in the terminal. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/linux-terminal - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) -[2]: https://opensource.com/business/16/3/top-linux-shells -[3]: https://opensource.com/article/18/2/powershell-people -[4]: https://opensource.com/article/17/6/set-path-linux -[5]: https://opensource.com/article/21/7/linux-terminal-basics-see-what-files-are-your-computer -[6]: https://opensource.com/article/21/7/linux-terminal-basics-opening-and-closing-directories -[7]: https://opensource.com/article/21/7/terminal-basics-moving-around-your-computer -[8]: https://opensource.com/article/21/7/terminal-basics-moving-files-linux-terminal -[9]: https://opensource.com/article/21/7/terminal-basics-rename-file-linux-terminal -[10]: https://opensource.com/article/21/7/terminal-basics-copying-files-linux-terminal -[11]: https://opensource.com/article/21/7/terminal-basics-removing-files-and-folders-linux-terminal -[12]: https://opensource.com/downloads/bash-scripting-ebook \ No newline at end of file diff --git a/sources/tech/20210824 Solve the repository impedance mismatch in CI-CD.md b/sources/tech/20210824 Solve the repository impedance mismatch in CI-CD.md deleted file mode 100644 index b47bdfdc67..0000000000 --- a/sources/tech/20210824 Solve the repository impedance mismatch in CI-CD.md +++ /dev/null @@ -1,207 +0,0 @@ -[#]: subject: "Solve the repository impedance mismatch in CI/CD" -[#]: via: "https://opensource.com/article/21/8/impedance-mismatch-cicd" -[#]: author: "Evan "Hippy" Slatis https://opensource.com/users/hippyod" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Solve the repository impedance mismatch in CI/CD -====== -Aligning deployment images and descriptors can be difficult, but here -are few strategies to streamline the process. -![Tips and gears turning][1] - -An _impedance mismatch_ in software architecture happens when there's a set of conceptual and technical difficulties between two components. It's actually a term borrowed from electrical engineering, where the impedance of electrical input and output must match for the circuit to work. - -In software development, an impedance mismatch exists between images stored in an image repository and its deployment descriptors stored in the SCM. How do you know whether the deployment descriptors stored in the SCM are actually meant for the image in question? The two repositories don't track the data they hold the same way, so matching an image (an immutable binary stored individually in an image repository) to its specific deployment descriptors (text files stored as a series of changes in Git) isn't straightforward. - -**NOTE**: This article assumes at least a passing familiarity with the following concepts: - - * Source Control Management (SCM) systems and branching - * Docker/OCI-compliant images and containers - * Container Orchestration Platforms (COP) such as Kubernetes - * Continuous Integration/Continuous Delivery (CI/CD) - * Software development lifecycle (SDLC) environments - - - -### Impedance mismatch: SCM and image repositories - -To fully understand where this becomes a problem, consider a set of basic Software Development LifeCycle (SDLC) environments typically used in any given project; for example, dev, test, and prod (or release) environments. - -The dev environment does not suffer from an impedance mismatch. Best practices, which today include using CI/CD, dictate that the latest commit to your development branch should reflect what's deployed in the development environment. So, given a typical, successful CI/CD development workflow: - - 1. A commit is made to the development branch in the SCM - 2. The commit triggers an image build - 3. The new, distinct image is pushed to the image repository and tagged as being in dev - 4. The image is deployed to the dev environment in a Container Orchestration Platform (COP) with the latest deployment descriptors pulled from the SCM - - - -In other words, the latest image is always matched to the latest deployment descriptors in the development environment. Rolling back to a previous build isn't an issue, either, because that implies rolling back the SCM, too. - -Eventually, though, development progresses to the point where more formal testing needs to occur, so an image—which implicitly relates to a specific commit in the SCM—is promoted to a test environment. Again, assuming a successful build, this isn't much of a problem because the image promoted from development should reflect the latest in the development branch: - - 1. The latest deployment to development is approved for promotion, and the promotion process is triggered - 2. The latest development image tagged as being in test - 3. The image is pulled and deployed to the test environment using the latest deployment descriptors pulled from the SCM - - - -So far, so good, right? But what happens in either of the following scenarios? - -**Scenario A**. The image is promoted to the next downstream environment, e.g., user acceptance testing (UAT) or even a production environment. - -**Scenario B**. A breaking bug is discovered in the test environment, and the image needs to be rolled back to a known good image. - -In either scenario, it's not as if development has stopped, which means one or more commits to the development branch may have occurred, which in turn means it's possible the latest deployment descriptors have changed, and the latest image isn't the same as what was previously deployed in test. Changes to the deployment descriptors may or may not apply to older versions of an image, but they certainly can't be trusted. If they have changed, they certainly aren't the same deployment descriptors you've been testing with up to now with the image you want to deploy. - -And that's the crux of the problem: I**f the image being deployed isn't the latest from the image repository, how do you identify which deployment descriptors in the SCM apply specifically to the image being deployed?** The short answer is, you can't. The two repositories have an impedance mismatch. The longer answer is that you can, but you have to work for it, which will be the subject of the rest of this article. Note that the following isn't necessarily the only solution to this problem, but it has been put into production and proven to work for dozens of projects that, in turn, have been built and deployed in production for more than a year now. - -### Binaries and deployment descriptors - -A common artifact produced from building source code is a Docker or OCI-compliant image, and that image will typically be deployed to a Container Orchestration Platform (COP) such as Kubernetes. Deploying to a COP requires deployment descriptors defining how the image is to be deployed and run as a container, e.g., [Kubernetes Deployments][2] or [CronJobs][3]. It is because of the fundamental difference between what an image is and its deployment descriptors where the impedance mismatch manifests itself. For this discussion, think of images as immutable binaries stored in an image repository. Any change in the source code does not change the image but rather replaces it with a distinct, new image. - -By contrast, deployment descriptors are text files and thus can be considered source code and mutable. If best practices are being followed, then the deployment descriptors are stored in SCM, and all changes are committed there first to be properly tracked. - -### Solving the impedance mismatch - -The first part of the proposed solution is to ensure that a method exists of matching the image in the image repository to the source commit in the SCM, which holds the deployment descriptors. The most straightforward solution is to tag the image with its source commit hash. This will keep different versions of the image separate, easily identifiable, and provide enough information to find the correct deployment descriptors so that the image can be properly deployed in the COP. - -Reviewing the scenarios above again: - -**Scenario A**. _Promoting an image from one downstream environment to the next_: When the image is promoted from test to UAT, the image's tag tells us from which source commit in the SCM to pull the deployment descriptors. - -**Scenario B**. _When an image needs to be rolled back in a downstream environment_: Whichever image we choose to roll back to will also tell us from which source commit in the SCM to pull the correct deployment descriptors. - -In each case, it doesn't matter how many development branch commits and builds have taken place since a particular image has been deployed in test since every image that's been promoted can find the exact deployment descriptors it was originally deployed with. - -This isn't a complete solution to the impedance mismatch, however. Consider two additional scenarios: - -**Scenario C**. In a load testing environment, different deployment descriptors are tried at various times to see how a particular build performs. - -**Scenario D**. An image is promoted to a downstream environment, and there's an error in the deployment descriptors for that environment. - -In each of these scenarios, changes need to be made to the deployment descriptors, but right now all we have is a source commit hash. Remember that best practices require all source code changes to be committed back to SCM first. The commit at that hash is immutable by itself, so a better solution than just tracking the initial source commit hash is clearly needed. - -The solution here is a new branch created at the original source commit hash. This will be dubbed a **Deployment Branch**. Every time an image is promoted to a downstream test or release environment, you should create a new Deployment Branch **from the head of the previous SDLC environment's Deployment Branch**. - -This will allow the same image to be deployed differently and repeatedly within each SDLC environment and also pick up any changes discovered or applied for that image in each subsequent environment. - -**NOTE:** How changes applied in one environment's deployment descriptors are applied to the next, whether by tools that enable sharing values such as Helm Charts or by manually cutting and pasting across directories, is beyond the scope of this article. - -So, when an image is promoted from one SDLC environment to the next: - - 1. A Deployment Branch is created - 1. If the image is being promoted from the dev environment, the branch is created from the source commit hash that built the image - 2. Otherwise, _the Deployment Branch is created from the head of the current Deployment Branch_ - 2. The image is deployed into the next SDLC environment using the deployment descriptors from the newly created Deployment Branch for that environment - - - -![deployment branching tree][4] - -Figure 1: Deployment branches - - 1. Development branch - 2. First downstream environment's Deployment Branch with a single commit - 3. Second downstream environment's Deployment Branch with a single commit - - - -Revisiting Scenarios C and D from above with Deployment Branches as a solution: - -**Scenario C**. Change the deployment descriptors for an image deployed to a downstream SDLC environment - -**Scenario D**. Fix an error in the deployment descriptors for a particular SDLC environment - -In each scenario, the workflow is as follows: - - 1. Commit the changes to the deployment descriptors to the Deployment Branch for the SLDC environment and image - 2. Redeploy the image into the SLDC environment using the deployment descriptors at the head of the Deployment Branch - - - -Thus, Deployment Branches fully resolve the impedance mismatch between image repositories storing a single, immutable image representing a unique build and SCM repositories storing mutable deployment descriptors for one more downstream SDLC environments. - -### Practical considerations - -While this seems like a workable solution, it also opens up several new practical questions for developers and operations resources alike, such as: - -A. Where should deployment descriptors be kept as source to best facilitate Deployment Branch management, i.e., in the same or a different SCM repository than the source that built the image? - -Up until now, we've avoided speaking about which repository the deployment descriptors should reside. Without going into too much detail, we recommend putting the deployment descriptors for all SDLC environments into the same SCM repository as the image source. As Deployment Branches are created, the source for the images will follow and act as an easy-to-find reference for what is actually running in the container being deployed. - -As mentioned above, images will be associated with the original source commit via their tag. Finding the reference for the source at a particular commit in a separate repository would add a level of difficulty to developers, even with tooling, which is unnecessary by keeping everything in a single repository. - -B. Should the source code that built the image be modified on a Deployment Branch? - -Short answer: **NEVER**. - -Longer answer: No, because images should never be built from Deployment Branches. They're built from development branches. Changing the source that defines an image in a Deployment Branch will destroy the record of what built the image being deployed and doesn't actually modify the functionality of the image. This could also become an issue when comparing two Deployment Branches from different versions. It might give a false positive for differences in functionality between them (a small but additional benefit to using Deployment Branches). - -C. Why an image tag? Couldn't image labels be used? - -Tags are easily readable and searchable for images stored in a repository. Reading and searching for labels with a particular value over a group of images requires pulling the manifest for each image, which adds complexity and reduces performance. Also, tagging images for different versions is still necessary for historical record and finding different versions, so using the source commit hash is the easiest solution that guarantees uniqueness while also containing instantly useful information. - -D. What is the most practical way to create Deployment Branches? - -The first three rules of DevOps are _automate_, _automate_, _automate_. - -Relying on resources to enforce best practices uniformly is hit and miss at best, so when implementing a CI/CD pipeline for image promotion, rollback, etc., incorporate automated Deployment Branching into the script. - -E. Any suggestions for a naming convention for Deployment Branches? - -<_**deployment-branch-identifier**_>-<_**env**_>-<_**src-commit-hash**_> - - * _**deployment-branch-identifier:**_ A unique string used by every Deployment Branch to identify it as a Deployment Branch; e.g. 'deployment' or 'deploy' - * _**env:**_ The SDLC environment the Deployment Branch pertains to; e.g. 'qa', 'stg', or' prod' for the test, staging, and production environments, respectively - * _**src-commit-hash:**_ The source code commit hash that holds the original code that built the image being deployed, which allows developers to easily find the original commit that created the image while ensuring the branch name is unique - - - -For example, _**deployment-qa-asdf78s**_ or _**deployment-stg-asdf78s**_ for Deployment Branches promoted to the QA and STG environments, respectively. - -F. How do you tell which version of the image is running in the environment? - -Our suggestion is to [label][5] all your deployment resources with the latest Deployment Branch commit hash and the source commit hash. These two unique identifiers will allow developers and operations personnel to find everything that was deployed and from where. It also makes cleanup of resources trivial using those selectors on deployments of different versions, e.g., on rollback or roll forward operations. - -G. When is it appropriate to merge changes from Deployment Branches back into the development branch? - -It's completely up to the development team on what makes sense. - -If you're making changes for load testing purposes just to see what will break your application, for example, then those changes may not be the best thing to merge back into the development branch. On the other hand, if you find and fix an error or tune a deployment in a downstream environment, merging the Deployment Branch changes back into the development branch makes sense. - -H. Is there a working example of Deployment Branching to test with first? - -[el-CICD][6] has been successfully using this strategy for a year and a half in production for more than a hundred projects across all SDLC downstream environments, including managing deployments to production. If you have access to an [OKD][7], Red Hat OpenShift lab cluster, or [Red Hat CodeReady Containers][8], you can download the [latest el-CICD version][9] and run through the [tutorial][10] to see how and when Deployment Branches are created and used. - -### Wrap up - -Using the working example above would be a good exercise to help you better understand the issues surrounding impedance mismatches in development processes. Maintaining alignment between images and deployment descriptors is a critical part of successfully managing deployments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/impedance-mismatch-cicd - -作者:[Evan "Hippy" Slatis][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/hippyod -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) -[2]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ -[3]: https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/ -[4]: https://opensource.com/sites/default/files/picture1.png -[5]: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ -[6]: https://github.com/elcicd -[7]: https://www.okd.io/ -[8]: https://cloud.redhat.com/openshift/create/local -[9]: https://github.com/elcicd/el-CICD-RELEASES -[10]: https://github.com/elcicd/el-CICD-docs/blob/master/tutorial.md diff --git a/sources/tech/20210903 How to Completely Uninstall Google Chrome From Ubuntu.md b/sources/tech/20210903 How to Completely Uninstall Google Chrome From Ubuntu.md deleted file mode 100644 index 0abd1eea46..0000000000 --- a/sources/tech/20210903 How to Completely Uninstall Google Chrome From Ubuntu.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: subject: "How to Completely Uninstall Google Chrome From Ubuntu" -[#]: via: "https://itsfoss.com/uninstall-chrome-from-ubuntu/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Completely Uninstall Google Chrome From Ubuntu -====== - -So, you managed to [install Google Chrome on Ubuntu][1]. It is the most popular web browser in the world, after all. - -But perhaps you dislike Google products for the heavy tracking and data mining they employ on its users. You decided to opt for [other web browsers on Ubuntu][2], perhaps a [non-Chromium browser][3]. - -Now that you are no longer using it, it would be wise to remove [Google Chrome][4] from Ubuntu. - -How to do that? Let me show you the steps. - -### Remove Google Chrome completely from Ubuntu - -![Illustration for removing Google Chrome from Ubuntu][5] - -You probably installed Google Chrome graphically. Unfortunately, you’ll have to resort to command line for removing it, unless you opt to [use Synaptic Package Manager][6]. - -It is not too difficult. Press the [Ctrl+Alt+T keyboard shortcut in Ubuntu to open a terminal][7]. - -Type the following command in the terminal: - -``` -sudo apt purge google-chrome-stable -``` - -It asks for a password. It is your user account’s password, the one which you use to log in to your Ubuntu system. - -When you type the password, nothing is displayed on the screen. This is normal behavior in Linux. Just type the password blindly and press enter. - -It will ask you to confirm the removal of Google Chrome by entering Y or simply pressing the enter key. - -![Removing Google Chrome for Ubuntu][8] - -This will remove Google Chrome from your Ubuntu Linux system along with most of the system files. - -However, the personal setting files remain in your home directory. This includes things like cookie sessions, bookmarks and other Chrome related settings for your user account. If you install Google Chrome again, the same files could be used by Chrome again. - -![Google Chrome leftover settings in Ubuntu][9] - -If you want to completely uninstall Google Chrome, you may want to remove these files as well. Here’s what you should do. - -Change to the .config directory. _**Mind the dot before config**_. That’s the [way to hide files and folders in Linux][10]. - -``` -cd ~/.config -``` - -And now remove the google-chrome directory: - -``` -rm -rf google-chrome -``` - -![Removing the leftover Google Chrome settings from Ubuntu][11] - -You could have also used rm -rf ~/.config/google-chrome to delete it in one single command. Since this tutorial is focused on absolute beginners, I made it in two steps to reduce the error margin because of a typo. - -Tip - -Want to make your terminal look beautiful like the ones in the screenshot? Use these [terminal customization tips][12]. - -I hope this quick beginner tip helped you to get rid of Google Chrome from Ubuntu Linux. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/uninstall-chrome-from-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/install-chrome-ubuntu/ -[2]: https://itsfoss.com/best-browsers-ubuntu-linux/ -[3]: https://itsfoss.com/open-source-browsers-linux/ -[4]: https://www.google.com/chrome/index.html -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/removing-google-chrome-ubuntu.png?resize=800%2C450&ssl=1 -[6]: https://itsfoss.com/synaptic-package-manager/ -[7]: https://itsfoss.com/open-terminal-ubuntu/ -[8]: https://itsfoss.com/wp-content/uploads/2021/09/remove-google-chrome-ubuntu.webp -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/google-chrome-ubuntu-leftover-settings.png?resize=800%2C518&ssl=1 -[10]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/remove-google-chrome-leftover-settings-from-Ubuntu.png?resize=800%2C277&ssl=1 -[12]: https://itsfoss.com/customize-linux-terminal/ diff --git a/sources/tech/20210908 How I migrated a WordPress website to a new host.md b/sources/tech/20210908 How I migrated a WordPress website to a new host.md deleted file mode 100644 index 637074a2f1..0000000000 --- a/sources/tech/20210908 How I migrated a WordPress website to a new host.md +++ /dev/null @@ -1,288 +0,0 @@ -[#]: subject: "How I migrated a WordPress website to a new host" -[#]: via: "https://opensource.com/article/21/9/migrate-wordpress" -[#]: author: "David Both https://opensource.com/users/dboth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How I migrated a WordPress website to a new host -====== -Use this simple approach to migrate a website and manage firewall -configurations. -![Text editor on a browser, in blue][1] - -Have you ever needed to migrate a WordPress website to a new host? I have done it several times and found the process to be quite easy. Of course, I don't use the recommended methods for doing most things, and this is no exception–I use the easy way, and that is what I recommend. - -This migration is non-destructive, so it is simple to revert to the original server if that should be necessary for any reason. - -### Components of a WordPress website - -Three main components are required to run a website based on [WordPress][2]: WordPress itself, a webserver such as [Apache][3] (which I use), and the [MariaDB][4]. MariaDB is a fork of MySQL and is functionally equivalent. - -There are plenty of webservers out there, but I prefer Apache because I have used it for so long. You may need to adapt the Apache configuration I use here to whatever webserver you are using. - -### The original setup - -I use one Linux host as a firewall and router for my network. The webserver is a different host inside my network. My internal network uses what used to be called a class C private network address range, but which is simply referred to as 192.168.0.0/24 in the [Classless Internet Domain Routing (CIDR)][5] methodology. - -For the firewall, I use the very simple [IPTables][6], which I prefer over the much more complex `firewalld`. One line in this firewall configuration sends incoming packets on port 80 (HTTP) to the webserver. As you can see by the comments, I placed rules to forward other inbound server connections to the same server on their appropriate ports in the `/etc/sysconfig/iptables` file. - - -``` -# Reroute ports for inbound connections to the appropriate web/email/etc server. -# HTTPD goes to 192.168.0.75 --A PREROUTING -d 45.20.209.41/255.255.255.248 -p tcp -m tcp --dport 80 \ - -  -j DNAT --to-destination 192.168.0.75:80 -``` - -I set up my original Apache webserver using named virtual hosts because I served multiple websites from this one HTTPD instance. It is always a good idea to use the named virtual host configuration approach because, like me, you may decide to host additional sites later, and this process makes that easier to do. - -The virtual host stanza for the website to be moved in `/etc/httpd/conf/httpd.conf` looks like the one below. There are no IP addresses in this stanza, so it needs no changes for use on the new server. - - -``` -<VirtualHost *:80> -   ServerName [www.website1.org][7] -   ServerAlias server.org - -DocumentRoot "/var/website1/html" -   ErrorLog "logs/error_log" -   ServerAdmin [me@website1.org][8] -  -<Directory "/var/website1/html"> -      Options Indexes FollowSymLinks -  -AllowOverride None -      Require all granted -  -</Directory> -</VirtualHost> -``` - -The `Listen` directive near the top of the `httpd.conf` file looks like this before the migration. This is the actual IP private address of the server and not the public IP address. - - -``` -`Listen 192.168.0.75:80` -``` - -You need to change the `Listen` IP address on the new host. - -### Preparation - -The preparation can be accomplished with three steps: - - * Install the services. - * Configure the firewall. - * Configure the webserver. - - - -#### Install Apache and MariaDB - -Install Apache and MariaDB if they are not already on your new server. It is not necessary to install WordPress. - - -``` -`dnf -y install httpd mariadb` -``` - -#### New server firewall configuration - -Ensure that the firewall on the new server allows port 80. You do have a firewall on _all_ of your computers, right? Most modern distributions use an initial setup that includes a firewall that blocks all incoming traffic to ensure a higher level of security. - -The first line in the snippet below may already be part of your IPTables or other netfilter-based firewall. It identifies inbound packets that have already been recognized as coming from an acceptable source and bypasses additional INPUT filter rules, thus saving time and CPU cycles. The last line in the snippet identifies new incoming connections to HTTPD on port 80 and accepts them. - - -``` --A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -<snip> -# HTTP --A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT -``` - -The following sample `/etc/sysconfig/iptables` file is an example of a minimal set of IPTables rules that allow incoming connections on SSH (port 22) and HTTPD (port 80) . - - -``` -*filter -:INPUT ACCEPT [0:0] -:FORWARD ACCEPT [0:0] -:OUTPUT ACCEPT [0:0] --A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT --A INPUT -p icmp -j ACCEPT --A INPUT -i lo -j ACCEPT -# SSHD --A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT -# HTTP --A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT - -# Final disposition for unmatched packets --A INPUT -j REJECT --reject-with icmp-host-prohibited --A FORWARD -j REJECT --reject-with icmp-host-prohibited -COMMIT -``` - -All I needed on my new server host was to add the last line in the snippet above to my firewall rules in the `/etc/sysconfig/iptables` file and then reload the revised ruleset. - - -``` -`iptables-restore /etc/sysconfig/iptables` -``` - -Most current Red Hat-based distributions, such as Fedora, use `firewalld`. I don't use it because I find it far more complex than it needs to be for use cases such as home or small to medium businesses. To add inbound port 80 to `firewalld`, I suggest you refer to the [firewalld web page][9]. - -Your firewall and its configuration details might differ from these, but the objective is to allow incoming connections to HTTPD on port 80 of the new web server. - -#### HTTPD configuration - -Configure HTTPD in the `/etc/httpd/conf/httpd.conf` file. Set the IP address in the Listen stanza as shown below. The IP address of my new web server is 192.168.0.125. - - -``` -`Listen 192.168.0.125:80` -``` - -Copy the VirtualHost stanza for the website being moved and paste it at the end of the `httpd.conf` file of the new server. - -### The move - -Only two sets of data need to be moved to the new server—the database itself and the website directory structure. Create `tar` archives of the two directories. - - -``` -cd /var ; tar -cvf /tmp/website.tar website1/ -cd /var/lib ; tar -cvf /tmp/database.tar mysql/ -``` - -Copy those tarballs to the new server. I usually store files like this in `/tmp`, which is what it is for. Run the following commands on the new server to extract the files from the tar archives into the correct directories. - - -``` -cd /var ; tar -xvf /tmp/website.tar -cd /var/lib ; tar -xvf /tmp/database.tar -``` - -All WordPress files are contained in the `/var/website1`, so they do not need to be installed on the new server. The WordPress installation procedure does not need to be performed on the new server. - -This directory is all that needs to be moved to the new server. - -The last step before making the switch is to start (or restart) the `mysqld` and `httpd` service daemons. WordPress is not a service, so it is not started as a daemon. - - -``` -`systemctl start mysqld ; systemctl start httpd` -``` - -You should check the status of these services after starting them. - - -``` -systemctl status mysqld -● mariadb.service - MariaDB 10.5 database server -    Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) -    Active: active (running) since Sat 2021-08-21 14:03:44 EDT; 4 days ago -        Docs: man:mariadbd(8) - - -   Process: 251783 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS) -   Process: 251805 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS) -   Process: 251856 ExecStartPost=/usr/libexec/mariadb-check-upgrade (code=exited, status=0/SUCCESS) - Main PID: 251841 (mariadbd) -      Status: "Taking your SQL requests now..." -      Tasks: 15 (limit: 19003) -    Memory: 131.8M -        CPU: 1min 31.793s -    CGroup: /system.slice/mariadb.service -└─251841 /usr/libexec/mariadbd --basedir=/usr - -Aug 21 14:03:43 simba.stmarks-ral.org systemd[1]: Starting MariaDB 10.5 database server... -Aug 21 14:03:43 simba.stmarks-ral.org mariadb-prepare-db-dir[251805]: Database MariaDB is probably initialized in /var/lib/mysql already, n> -Aug 21 14:03:43 simba.stmarks-ral.org mariadb-prepare-db-dir[251805]: If this is not the case, make sure the /var/lib/mysql is empty before> -Aug 21 14:03:44 simba.stmarks-ral.org mariadbd[251841]: 2021-08-21 14:03:44 0 [Note] /usr/libexec/mariadbd (mysqld 10.5.11-MariaDB) startin> -Aug 21 14:03:44 simba.stmarks-ral.org systemd[1]: Started MariaDB 10.5 database server. - -systemctl status httpd -● httpd.service - The Apache HTTP Server -   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) -   Drop-In: /usr/lib/systemd/system/httpd.service.d -└─php-fpm.conf -      Active: active (running) since Sat 2021-08-21 14:08:39 EDT; 4 days ago -        Docs: man:httpd.service(8) -   Main PID: 252458 (httpd) -      Status: "Total requests: 10340; Idle/Busy workers 100/0;Requests/sec: 0.0294; Bytes served/sec: 616 B/sec" -        Tasks: 278 (limit: 19003) -      Memory: 44.7M -        CPU: 2min 31.603s -   CGroup: /system.slice/httpd.service -├─252458 /usr/sbin/httpd -DFOREGROUND -├─252459 /usr/sbin/httpd -DFOREGROUND -├─252460 /usr/sbin/httpd -DFOREGROUND -├─252461 /usr/sbin/httpd -DFOREGROUND -├─252462 /usr/sbin/httpd -DFOREGROUND -└─252676 /usr/sbin/httpd -DFOREGROUND - -Aug 21 14:08:39 simba.stmarks-ral.org systemd[1]: Starting The Apache HTTP Server... -Aug 21 14:08:39 simba.stmarks-ral.org httpd[252458]: AH00112: Warning: DocumentRoot [/var/teststmarks-ral/html] does not exist -Aug 21 14:08:39 simba.stmarks-ral.org httpd[252458]: Server configured, listening on: port 80 -Aug 21 14:08:39 simba.stmarks-ral.org systemd[1]: Started The Apache HTTP Server. -``` - -### Making the final switch - -Now that the required services are up and running, you can change the firewall rule for HTTPD to the following in the `/etc/sysconfig/iptables` file. - - -``` --A PREROUTING -d 45.20.209.41/255.255.255.248 -p tcp -m tcp --dport 80 \ -  -j DNAT --to-destination 192.168.0.125:80 -``` - -Then reload the IPTables rule set. - - -``` -`iptables-restore /etc/sysconfig/iptables` -``` - -Because of the firewall rules in the firewall host, it is not necessary to change the external DNS entries to point to the new server. If you use an internal DNS server, you will need to make the IP address change to that A record in your internal DNS database. If you don't use an internal DNS server, be sure to set the correct address for your new server in the `/etc/hosts` files of your host computers. - -### Testing and cleanup - -Be sure to test your new setup. First, turn off the `mysqld` and `httpd` services on the old server. Then access the website with a browser. If everything works as it should, you can disable `mysqld` and `httpd` on the old server. If there is a failure, you can change the IPTables routing rule back to the old server until the problem is fixed. - -I then removed both MySQL and HTTPD from the old server to ensure that they cannot be started accidentally. - -### Conclusion - -It really is that simple. There is no need to perform export or import procedures on the database because everything necessary is copied over in the `mysql` directory. The only reason you might want to deal with the export/import procedure is if there are databases other than those for the website or sites in the same instance of the MariaDB that you don't want copied to the new server. - -Migrating the rest of the websites served by the old server is easy too. All of the databases required for the additional sites have already been moved over with MariaDB. It is only necessary to move the `/var/website` directories to the new server, add the appropriate virtual host stanzas, and restart HTTPD. - -I have used this procedure multiple times for migrating a website from one server to another, and it always works well. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/migrate-wordpress - -作者:[David Both][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/dboth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue) -[2]: https://wordpress.org/ -[3]: https://opensource.com/article/18/2/how-configure-apache-web-server -[4]: https://mariadb.org/ -[5]: https://opensource.com/article/16/12/cidr-network-notation-configuration-linux -[6]: https://en.wikipedia.org/wiki/Iptables -[7]: http://www.website1.org -[8]: mailto:me@website1.org -[9]: https://firewalld.org/documentation/howto/open-a-port-or-service.html diff --git a/sources/tech/20210923 Fedora Linux earns recognition from the Digital Public Goods Alliance as a DPG.md b/sources/tech/20210923 Fedora Linux earns recognition from the Digital Public Goods Alliance as a DPG.md deleted file mode 100644 index 234f49b192..0000000000 --- a/sources/tech/20210923 Fedora Linux earns recognition from the Digital Public Goods Alliance as a DPG.md +++ /dev/null @@ -1,67 +0,0 @@ -[#]: subject: "Fedora Linux earns recognition from the Digital Public Goods Alliance as a DPG!" -[#]: via: "https://fedoramagazine.org/fedora-linux-earns-recognition-from-the-digital-public-goods-alliance-as-a-dpg/" -[#]: author: "Justin W. FloryAlberto Rodriguez SanchezMatthew Miller https://fedoramagazine.org/author/jflory7/https://fedoramagazine.org/author/bt0dotninja/https://fedoramagazine.org/author/mattdm/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Fedora Linux earns recognition from the Digital Public Goods Alliance as a DPG! -====== - -![][1] - -In the Fedora Project community, [we look at open source][2] as not only code that can change how we interact with computers, but also as a way for us to positively influence and shape the future. The more hands that help shape a project, the more ideas, viewpoints and experiences the project represents — that’s truly what the spirit of open source is built from. - -But it’s not just the global contributors to the Fedora Project who feel this way. August 2021 saw Fedora Linux recognized as a digital public good by the [Digital Public Goods Alliance (DPGA)][3], a significant achievement and a testament to the openness and inclusivity of the project. - -We know that digital technologies can save lives, improve the well-being of billions, and contribute to a more sustainable future. We also know that in tackling those challenges, Open Source is uniquely positioned in the world of digital solutions by inherently welcoming different ideas and perspectives critical to lasting success. - -But, we also know that many regions and countries around the world do not have access to those technologies. Open Source technologies can be the difference between achieving the [Sustainable Development Goals][4] (SDGs) by 2030 or missing the targets. Projects like Fedora Linux, which [represent much more than code itself][2], are the game-changers we need. Already, individuals, organizations, governments, and Open Source communities, including the Fedora Project’s own, are working to make sure the potential of Open Source is realized and equipped to take on the monumental challenges being faced. - -The Digital Public Goods Alliance is a multi-stakeholder initiative, endorsed by the United Nations Secretary-General. It works to accelerate the attainment of the SDGs in low- and middle-income countries by facilitating the discovery, development, use of, and investment in digital public goods (DPGs). DPGs are Open Source software, open data, open AI models, open standards, and open content that adhere to privacy and other applicable best practices, and do no harm. This definition, drawn from the UN Secretary-General’s [2020 Roadmap for Digital Cooperation][5], serves as the foundation of the DPG Registry, an online repository for DPGs.  - -The DPG Registry was created to help increase the likelihood of discovery, and therefore use of, DPGs. Today, we are excited to share that Fedora Linux was added to the [DPG Registry][6]! Recognition as a DPG increases the visibility, support for, and prominence of open projects that have the potential to tackle global challenges. To become a digital public good, all projects are required to meet the [DPG Standard][7] to ensure they truly encapsulate Open Source principles.  - -As an Open Source leader, Fedora Linux can make achieving the SDGs a reality through its role as a convener of many Open Source “upstream” communities. In addition to providing a fully-featured desktop, server, cloud, and container operating system, it also acts as a platform where different Open Source software and work come together. Fedora Linux by default only ships its releases with purely Open Source software packages and components. While third-party repositories are available for use with proprietary packages or closed components, Fedora Linux is a complete offering with some of the greatest innovations that Open Source has to offer. Collectively this means Fedora Linux can act as a gateway, empowering the creation of more and better solutions to better tackle the challenges they are trying to address. - -The DPG designation also aligns with Fedora’s fundamental foundations: - - * **Freedom**: Fedora Linux was built as Free and Open Source Software from the beginning. Fedora Linux only ships and distributes Free Software from its default repositories. Fedora Linux already uses widely-accepted Open Source licenses. - * **Friends**: Fedora has an international community of hundreds spread across six continents. The Fedora Community is strong and well-positioned to scale as the upstream distribution of the world’s most-widely used enterprise flavor of Linux. - * **Features**: Fedora consistently delivers on innovation and features in Open Source. Fedora Linux 34 was a record-breaking release, with 63 new approved Changes in the last release. - * **First**: Fedora leverages its unique position and resources in the Free Software world to deliver on innovation. New ideas and features are tried out in the Fedora Community to discover what works, and what doesn’t. We have many stories of both. - - - -![][8] - -For us, recognition as a digital public good brings honor and is a great moment for us, as a community, to reaffirm our commitment to contribute and grow the Open Source ecosystem. - -This is a proud moment for each Fedora Community member because we are making a difference. Our work matters and has value in creating an equitable world; this is a fantastic and important feeling. - -If you have an interest in learning more about the Digital Public Goods Alliance please reach out to [hello@digitalpublicgoods.net][9]. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/fedora-linux-earns-recognition-from-the-digital-public-goods-alliance-as-a-dpg/ - -作者:[Justin W. FloryAlberto Rodriguez SanchezMatthew Miller][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/jflory7/https://fedoramagazine.org/author/bt0dotninja/https://fedoramagazine.org/author/mattdm/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/09/DPG_recognition-816x345.jpg -[2]: https://docs.fedoraproject.org/en-US/project/ -[3]: https://digitalpublicgoods.net/frequently-asked-questions/ -[4]: https://sdgs.un.org/goals -[5]: https://www.un.org/en/content/digital-cooperation-roadmap/ -[6]: http://digitalpublicgoods.net/registry/ -[7]: http://digitalpublicgoods.net/standard/ -[8]: https://lh6.googleusercontent.com/lzxUQ45O79-kK_LHsokEChsfMCyAz4fpTx1zEaj6sN_-IiJp5AVqpsISdcxvc8gFCU-HBv43lylwkqjItSm1X1rG_sl9is1ou9QbIUpJTGyzr4fQKWm_QujF55Uyi-hRrta1M9qB=s0 -[9]: mailto:hello@digitalpublicgoods.net diff --git a/sources/tech/20210928 What is port forwarding.md b/sources/tech/20210928 What is port forwarding.md deleted file mode 100644 index 0cccbb2063..0000000000 --- a/sources/tech/20210928 What is port forwarding.md +++ /dev/null @@ -1,98 +0,0 @@ -[#]: subject: "What is port forwarding?" -[#]: via: "https://opensource.com/article/21/9/what-port-forwarding" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -What is port forwarding? -====== -This article demonstrates the most common scenarios for port forwarding. -![Multi-colored and directional network computer cables][1] - -Port forwarding transfers network traffic from one network listener (called a "port") to another, either on the same computer or a different computer. Ports, in this context, are not physical objects but a software routine listening for network activity. - -When traffic directed at a specific port arrives at a router or a firewall, or other networked application, the response it receives can be defined according to the port it's trying to communicate with. When you use port forwarding, you can catch communication coming in on port 8080, for instance, and forward it on to port 80 instead. The new destination port may be on the same device as the one receiving the signal or on a different device. There are many ways to forward ports, and there are different reasons for doing it. This article demonstrates the most common scenarios. - -### Port forwarding with your router - -You usually need to forward ports when you host a server at home. Your home router (usually the WiFi appliance you get from your ISP) has a built-in firewall designed to prevent the outside world from getting onto your home network. You can use port forwarding to allow traffic on a specific port through your router's firewall, sending it to a specific IP address on your network. - -For instance, say you're hosting a [Minetest server][2] and want to invite friends. For them to get through your router and into your Minetest server, you must forward a port from the router to the computer hosting Minetest. By default, a Minetest server runs on port 30000. You can port forward 30000 on your router to port 30000 on your Minetest server, or you could arbitrarily invent a simpler port for your players to remember and then forward that instead. I find that people inevitably miscount the zeroes in 30000 (especially without the benefit of a comma to help), so I use port 1234 and forward it to my internal 30000 port. - -Router interfaces differ from manufacturer to manufacturer, but the idea is the same regardless of what brand of router you have in your home. First, log in to your router. -Its IP address and login information is often printed on the router itself or in its documentation. I own a TP-Link GX90 router, and I log in to it by pointing my web browser to 10.0.1.1, but your router might be 192.168.0.1 or some other address. - -My GX90 router calls port forwarding "Virtual servers," which is a category found in the router's **NAT forwarding** tab. NAT stands for _Network Address Translation_. Other routers may just call it **Port forwarding** or **Firewall** or **Services**. It may take a little clicking around to find the right category, or you may need to spend some time studying your router's documentation. - -When you find the port forwarding setting, add a new rule that names an external port (1234, in my example) and an internal one (30000). Forward the external port to the internal port on the IP address of the computer you want people to be able to access. If you need help finding your IP address, read Archit Modi's _[How to find your IP address on Linux][3]_ article. - -![A sample port forwarding rule][4] - -A sample port forwarding rule -(Seth Kenlon, [CC BY-SA 4.0][5]) - -In this example, I'm forwarding traffic that reaches my home network at port 1234 to port 30000 of my home server located at 10.0.1.2. - -Save the rule to proceed. - -Next, you need to know your home network's public IP address. You can obtain this from websites like [ifconfig.me][6] or [icanhazip.com][7]. Either open a browser to one of those sites or get the IP using the [curl][8] command: - - -``` -$ curl ifconfig.me -93.184.216.34 -``` - -Your friends can now join your Minetest server by entering the `169.169.23.49:1234` into their Minetest client. - -### Port forwarding with a firewall - -Sysadmins sometimes need to forward ports for traffic reaching a server. For example, you may want to accept traffic to port 80 but present the user with a service running on port 8065. Without port forwarding, your users would have to remember to append a specific port at the end of the URL they enter into their browser, such as `example.com:8065`.  Most users aren't used to thinking about ports, so intercepting a call to the common web port 80 and redirecting it to the obscure one your web app runs on is a big convenience for your users. - -You can forward traffic on a server using [firewall-cmd][9], the front-end command to the `firewalld` daemon. - -First, set the ports and protocols you want to forward: - - -``` -$ sudo firewall-cmd \ -\--add-forward-port \ -port=80:proto=tcp:toport=8065 -``` - -To make the change permanent, use the `--runtime-to-permanent` option: - - -``` -`$ sudo firewall-cmd --runtime-to-permanent` -``` - -### Network forwarding - -In networking, there are other kinds of forwarding aside from port forwarding. For instance, both IP forwarding and proxying are forms of forwarding. As you get familiar with how network information is processed as it's routed, you can try different kinds of forwarding (and watch it with `tcpdump` or similar) to see what works best for your setup. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/what-port-forwarding - -作者:[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/connections_wires_sysadmin_cable.png?itok=d5WqHmnJ (Multi-colored and directional network computer cables) -[2]: https://opensource.com/alternatives/minecraft#minetest -[3]: https://opensource.com/article/18/5/how-find-ip-address-linux -[4]: https://opensource.com/sites/default/files/uploads/router-port-forward.jpg (A sample port forwarding rule) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ -[6]: http://ifconfig.me -[7]: http://icanhazip.com -[8]: https://opensource.com/article/20/5/curl-cheat-sheet -[9]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd diff --git a/sources/tech/20211022 How to Install Visual Studio Code Extensions.md b/sources/tech/20211022 How to Install Visual Studio Code Extensions.md index 3eebef5da2..331593b7bb 100644 --- a/sources/tech/20211022 How to Install Visual Studio Code Extensions.md +++ b/sources/tech/20211022 How to Install Visual Studio Code Extensions.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/install-vs-code-extensions/" [#]: author: "Pratham Patel https://itsfoss.com/author/pratham/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "CoWave-Fall" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " diff --git a/sources/tech/20211223 10 open source career lessons from 2021.md b/sources/tech/20211223 10 open source career lessons from 2021.md deleted file mode 100644 index 646cc5c2c8..0000000000 --- a/sources/tech/20211223 10 open source career lessons from 2021.md +++ /dev/null @@ -1,104 +0,0 @@ -[#]: subject: "10 open source career lessons from 2021" -[#]: via: "https://opensource.com/article/21/12/open-source-career-lessons" -[#]: author: "Lauren Maffeo https://opensource.com/users/lmaffeo" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -10 open source career lessons from 2021 -====== -Whether you're looking for a great open source note-taking app or want -inspiration for non-coding roles in tech, Opensource.com's authors -covered it all. -![Working from home at a laptop][1] - -The ongoing pandemic kept 2021 far from normal, yet there were glimmers of hope through the uncertainty. In-person conferences slowly resumed, if smaller and with more masks than in years past. And the asynchronous essence of open source allowed many people to keep working on passion projects while growing their careers. - -Accordingly, readers loved the past year's posts on all things work and career. Below, we've shared 10 of our most popular articles on these subjects in 2021. Whether you're looking for a great open source note-taking app or want inspiration for non-coding roles in tech, Opensource.com's authors covered it all. - -### 3 open source tools that make Linux the ideal workstation - -Is there anything Linux can't do? Seth Kenlon doesn't think so. In our [most popular career article][2] this year, Seth shares three office applications that run on Linux. - -From macro support on LibreOffice to the spreadsheets in Gnumeric, open source enthusiasts looking for new tools can look outside the box. Many options in this article are minimalist, and Seth says that's a good thing. Big office suites can't solve every problem. Stepping back to consider your true needs and finding tools that meet them is the best choice. - -### Use Joplin to find your notes faster - -No one beats Kevin Sonney when it comes to productivity tips. His annual productivity series [had a twist][3] in 2021: Instead of covering specific apps, Sonney shared strategies and all-in-one solutions to help open sourcers work smarter. - -A digital notes enthusiast, Kevin uses this piece to share why he chose Joplin to keep them all organized. Its search functionality, ability to sync between devices, and use of Markdown are just a few reasons why this note-taking app rules them all. - -### 5 open source alternatives to Zoom - -Zoom fatigue reached new heights in open source this year: Seth Kenlon's article on open source Zoom alternatives was [a 2021 favorite][4] across several categories. - -Kenlon wrote this piece after attending a conference run on open source video conferencing software. If you want to use something other than Zoom, you have options. There's an open source tool for every unique need, from familiar favorites like Signal's group video call feature to solutions for classroom and conference presentations like BigBlueButton. - -### Open source tools and tips for staying focused - -Kevin Sonney's 2021 productivity series hit a pain point with readers. His tips to stay focused using open source tools [caught the eyes][5] of open sourcers who (like me) struggled to keep our attention on the tasks at hand this year. - -This piece highlights Mater, a taskbar app that lets users set 25-minute timers before taking a break. It's an open source take on the Pomodoro Technique that helps users do deep work before taking strategic breaks. Kevin finds that using Mater for productivity sprints, combined with a buddy, helps keep him accountable. That's a lesson we can all take into 2022. - -### My open source internship during a pandemic - -Nearly two years into the pandemic, many people have started new jobs and internships remotely. In May 2020, Gerrod Ubben found his junior year of college cut short and learned that his summer internship at Red Hat would happen remotely. [This piece][6] shares his experience on Red Hat's Pulp team. - -Gerrod did a lot of work updating Pulp's Python plugin, thanks to mentorship from several Red Hat engineers. He also worked with the Bandersnatch community to broaden their code so the Bandersnatch API could mirror Python content from sources including Pulp. If you've doubted what fully remote interns can do, this piece will put those doubts to rest. - -### 4 tech jobs for people who don't code - -Nithya Ruff is one of my open source heroes because she advocates for diverse contributions to open source beyond code. As a career techie who has always held non-coding roles, Dawn Parzych's piece [highlighting four of these positions][7] struck a familiar chord. - -Whether you have a talent for technical writing or a desire to do data analysis, each of the four roles highlighted here brings its own value to tech. Lest you fear that all of them are too far from the code, developer relations made the list. This fairly new discipline puts developer needs first, and while coding isn't required for all roles, it's a huge plus. - -### 16 efficient breakfasts of open source technologists from around the world - -What's your favorite meal to start the day? That's what Jen Wike Huger asked us Opensource.com writers this past spring. [The answers][8] were diverse like we are, often reflecting where we live around the world. - -From bacon, egg, and cheese bagels in New York City to copious cups of tea in England, 16 of us shared what we eat to start our days off right. I'm still trying to convince myself that coffee in itself is not a meal, but that's another article. - -### My open source disaster recovery strategy for the home office - -What's the worst that could happen? In Howard Fosdick's case, it's the risk that a home-based device might fail for remote employees. This article [walks readers through solutions][9] should the worst happen to you. - -Howard is upfront that his strategies (which include defining high availability and confirming allowable downtime) might not work in all scenarios. Still, the tips he offers are customizable. The critical takeaway is to plan ahead. That way, if the worst happens, you've got a plan to tackle the challenge. - -### 3 wishes for open source productivity in 2021 - -January 31, 2021, feels like a lifetime ago. That's when Kevin Sonney [shared some hopes][10] he had for productivity in open source this year. - -To conclude his series on productivity, Kevin said he wanted open sourcers to be more mindful and inclusive. This includes a call to disconnect by turning off devices when we're not working. For my part, I tried to do this by keeping my phone in "Do Not Disturb" mode in another room during heads-down work. How did you stay productive this year? - -### 15 unusual paths to tech - -Is tech your second career? It is for many Opensource.com writers, as we learned when Jen Wike Huger asked which roles we held before taking the techie path. Janitor, papermaker, map editor, and musician are just a few past lives that came up. - -[The complete list][11] is a fascinating read that confirms why open source is so special: Done well, it unites folks with diverse skillsets and experiences to build something great. It also confirms that it's never too late—and you're never too "out of place"— to jump into open source. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/12/open-source-career-lessons - -作者:[Lauren Maffeo][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/lmaffeo -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) -[2]: https://opensource.com/article/21/2/linux-workday -[3]: https://opensource.com/article/21/1/notes-joplin -[4]: https://opensource.com/article/21/9/alternatives-zoom -[5]: https://opensource.com/article/21/1/stay-focused -[6]: https://opensource.com/article/21/2/python-pulp-internship -[7]: https://opensource.com/article/21/2/non-engineering-jobs-tech -[8]: https://opensource.com/article/21/5/breakfast -[9]: https://opensource.com/article/21/2/high-availability-home-office -[10]: https://opensource.com/article/21/1/productivity-wishlist -[11]: https://opensource.com/article/21/5/unusual-tech-career-paths diff --git a/sources/tech/20220111 What is KDE Connect- How Do You Use It- -Beginner-s Guide.md b/sources/tech/20220108 What is KDE Connect- How Do You Use It- [Beginner-s Guide].md similarity index 76% rename from sources/tech/20220111 What is KDE Connect- How Do You Use It- -Beginner-s Guide.md rename to sources/tech/20220108 What is KDE Connect- How Do You Use It- [Beginner-s Guide].md index a73a1b8ec1..e8bba64799 100644 --- a/sources/tech/20220111 What is KDE Connect- How Do You Use It- -Beginner-s Guide.md +++ b/sources/tech/20220108 What is KDE Connect- How Do You Use It- [Beginner-s Guide].md @@ -1,7 +1,7 @@ [#]: subject: "What is KDE Connect? How Do You Use It? [Beginner’s Guide]" [#]: via: "https://www.debugpoint.com/2022/01/kde-connect-guide/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" +[#]: collector: "lkxed" [#]: translator: " " [#]: reviewer: " " [#]: publisher: " " @@ -9,8 +9,8 @@ What is KDE Connect? How Do You Use It? [Beginner’s Guide] ====== -IN THIS ARTICLE, WE EXPLAIN WHAT IS KDE CONNECT, ITS MAIN FEATURES, -BASIC USAGE GUIDE AND INSTALLATION STEPS. +In this article, we explain what is KDE Connect, its main features, basic usage guide and installation steps. + The technology evolving at a rapid space. That includes the software, hardware and different form factor devices. The future is all about seamless integration and workflow across different devices. Every day, we are moving a little closer to a state where you send and receive data across all connected devices. And KDE Connect application is a flag bearer on the Linux desktop systems. ### What is KDE Connect? @@ -34,25 +34,19 @@ KDE Connect set up is a two-way process. You have to install KDE Connect in your Installing KDE Connect in your Linux Distribution is easy. It is available in all major Linux distribution’s official repo. If you are using Ubuntu, and want a terminal way of installing, run below. ``` - - sudo apt install kdeconnect - +sudo apt install kdeconnect ``` For Fedora ``` - - sudo dnf install kdeconnect - +sudo dnf install kdeconnect ``` For [Arch Linux][2] ``` - - pacman -S kdeconnect - +pacman -S kdeconnect ``` Or, you can search in Software and hit install. @@ -67,7 +61,7 @@ Search for KDE Connect in Google Play Store and hit install to install it in you If you are using a Free/Libre version of Android, you can get it via f-droid store using the below link (Thanks to our readers for this tip). - +[https://f-droid.org/en/packages/org.kde.kdeconnect_tp/][5] ### Setting Up KDE Connect @@ -75,53 +69,45 @@ KDE Connect helps to connect devices that are in the same network. So, make sure Now open the KDE Connect App in your mobile phone. You should see the name of your Linux Systems. If you do not see anything, make sure your device and Linux both are connected in same network and hit Refresh. -![KDE Connect in Android Device showing connected Linux System][5] +![KDE Connect in Android Device showing connected Linux System][6] Open the KDE Connect in Linux and you should see your mobile phone entry as shown in the below image. -![KDE Connect before pairing][6] +![KDE Connect before pairing][7] -Now, click on the name of your mobile phone and hit . Once you do that, immediately you get a notification in your mobile phone for Pairing Accept or Reject. Tap on Accept. +Now, click on the name of your mobile phone and hit **Pair**. Once you do that, immediately you get a notification in your mobile phone for Pairing Accept or Reject. Tap on Accept. -![Pairing Request for KDE Connect][7] +![Pairing Request for KDE Connect][8] The icon of your Phone should turn GREEN, and it shows that your mobile phone and Linux system both are connected and paired. -![KDE Connect after successful pairing][8] +![KDE Connect after successful pairing][9] By default, the app grants you the below permissions – - * Multimedia control - * Remote Input - * Presentation Remote - * Finding Device - * Sharing Files - - - -[][9] - -SEE ALSO:   KDE Connect Arrives for iPhone, At last. Here’s How to Try. +* Multimedia control +* Remote Input +* Presentation Remote +* Finding Device +* Sharing Files And the following features required explicit permission in your Android device, which you need to grant them manually. Because they are little privacy centric. - * SMS sending and receiving - * Media Player Control - * Receive Keystrokes from Computer to Mobile Phone - * Notification Sync - * Telephone Notifier - * Contact Sync - * Mouse Receiver - - +* SMS sending and receiving +* Media Player Control +* Receive Keystrokes from Computer to Mobile Phone +* Notification Sync +* Telephone Notifier +* Contact Sync +* Mouse Receiver For all these, you have to tap on the option and grant access in Android phone. Then you will be able to enjoy these services in Linux device. ### Example – Notification Sync -I will show you one example where Notification Sync option is enabled. Open the app in your Android phone, go to the section. Tap on **Notification Sync** and take option **Open Settings**. +I will show you one example where Notification Sync option is enabled. Open the app in your Android phone, go to the **Connected Device** section. Tap on **Notification Sync** and take option **Open Settings**. -Enable Notification access against and tap on **Allow**. +Enable Notification access against **KDE Connect** and tap on **Allow**. ![Enabling Notification Sync][10] @@ -141,38 +127,28 @@ I hope this guide helps you to set up KDE Connect in your Linux system and mobil What do you think about KDE Connect? Let me know in the comment box below. -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][13], [Twitter][14], [YouTube][15], and [Facebook][16] and never miss an update! - -##### Also Read - -------------------------------------------------------------------------------- via: https://www.debugpoint.com/2022/01/kde-connect-guide/ 作者:[Arindam][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 +[b]: https://github.com/lkxed [1]: https://kdeconnect.kde.org/ [2]: https://www.debugpoint.com/tag/arch-linux [3]: https://kdeconnect.kde.org/download.html [4]: https://play.google.com/store/apps/details?id=org.kde.kdeconnect_tp&hl=en_IN&gl=US -[5]: https://www.debugpoint.com/wp-content/uploads/2022/01/KDE-Connect-in-Android-Device-showing-connected-Linux-System-1024x656.jpg -[6]: https://www.debugpoint.com/wp-content/uploads/2022/01/KDE-Connect-before-pairing-1024x368.jpg -[7]: https://www.debugpoint.com/wp-content/uploads/2022/01/Pairing-Request-for-KDE-Connect-1024x917.jpg -[8]: https://www.debugpoint.com/wp-content/uploads/2022/01/KDE-Connect-after-successful-pairing-1024x249.jpg -[9]: https://www.debugpoint.com/2021/10/kde-connect-iphone/ +[5]: https://f-droid.org/en/packages/org.kde.kdeconnect_tp/ +[6]: https://www.debugpoint.com/wp-content/uploads/2022/01/KDE-Connect-in-Android-Device-showing-connected-Linux-System-1024x656.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/01/KDE-Connect-before-pairing-1024x368.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/01/Pairing-Request-for-KDE-Connect-1024x917.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/01/KDE-Connect-after-successful-pairing-1024x249.jpg [10]: https://www.debugpoint.com/wp-content/uploads/2022/01/Enabling-Notification-Sync-1024x718.jpg [11]: https://www.debugpoint.com/wp-content/uploads/2022/01/Sample-Notification-in-Mobile-Phone-914x1024.jpg [12]: https://www.debugpoint.com/wp-content/uploads/2022/01/Sample-Notification-in-KDE-Connect-from-Mobile-Phone.jpg -[13]: https://t.me/debugpoint -[14]: https://twitter.com/DebugPoint -[15]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[16]: https://facebook.com/DebugPoint diff --git a/sources/tech/20220113 Learn Rust in 2022.md b/sources/tech/20220113 Learn Rust in 2022.md deleted file mode 100644 index 15451e16a6..0000000000 --- a/sources/tech/20220113 Learn Rust in 2022.md +++ /dev/null @@ -1,329 +0,0 @@ -[#]: subject: "Learn Rust in 2022" -[#]: via: "https://opensource.com/article/22/1/rust-cheat-sheet" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Learn Rust in 2022 -====== -If you're going to explore Rust this year, download our free Rust cheat -sheet, so you have a quick reference for the basics. -![Cheat Sheet cover image][1] - -Rust is a relatively new programming language, and it's already a popular one [winning over programmers][2] from all industries. Still, it's also a language that builds on everything that's come before. Rust wasn't made in a day, after all, so even though there are concepts in Rust that seem wildly different from what you might have learned from Python, Java, C++, and so on, they all have a foundation in the same CPU and NUMA architecture you've always been (whether you know it or not) interacting with, and so some of what's new in Rust feels somehow familiar. - -Now, I'm not a programmer by trade. I'm impatient yet obsessive. If a language doesn't help me get the results I want relatively quickly, I rarely find myself inspired to use it when I need to get something done. Rust tries to bring into balance two conflicting things: The modern computer's need for secure and structured code, and the modern programmer's desire to do less work while attaining more success. - -### Install Rust - -The [rust-lang.org][3] website has great documentation on installing Rust, but usually, it's as simple as downloading the `sh.rustup.rs` script and running it. - - -``` - - -$ curl --proto '=https' --tlsv1.2 -sSf - -$ less sh.rustup.sh - -$ sh ./sh.rustup.rs - -``` - -### No classes - -Rust doesn't have classes and does not use the `class` keyword. Rust does have the `struct` data type, however, its purpose is to serve as a kind of template for a collection of data. So instead of creating a class to represent a virtual object, you can use a struct: - - -``` - - -struct Penguin { -    genus: String, -    species: String, -    extinct: bool, -    classified: u64, -} - -``` - -You can use this similar to how a class is used. For instance, once a `Penguin` struct is defined, you can create instances of it, and interact with that instance: - - -``` - - -struct Penguin { -    genus: String, -    species: String, -    extinct: bool, -    classified: u64, -} - -fn main() { -    let p = Penguin { genus: "Pygoscelis".to_owned(), -         species: "R adeliæ".to_owned(),  -         extinct: false,  -         classified: 1841 }; - -    println!("Species: {}", p.species);     -    println!("Genus: {}", p.genus); -    println!("Classified in {}", p.classified); -    if p.extinct == true { -        println!("Sadly this penguin has been made extinct."); -    } -     -} - -``` - -Using the `impl` data type in conjunction with the `struct` data type, you can implement a struct containing functions, and you can add inheritance and other class-like features. - -### Functions - -Functions in Rust are a lot like functions in other languages. Each one represents a discreet set of tasks that you can call upon when needed. The primary function must be called `main`. - -Functions are declared using the `fn` keyword, followed by the function's name and any parameters the function accepts. - - -``` - - -fn foo() { -  let n = 8; -  println!("Eight is written as {}", n); -} - -``` - -Passing information from one function to another gets done with parameters. For instance, I've already created a `Penguin` class, and I've got an instance of a penguin as `p`, so passing the attributes of `p` from one function to another requires me to specify `p` as an accepted `Penguin` type for its destination function. - - -``` - - -fn main() { -  let p = Penguin { genus: "Pygoscelis".to_owned(),  -    species: "R adeliæ".to_owned(),  -    extinct: false, classified: 1841 }; -  printer(p); -} - -fn printer(p: Penguin) { -  println!("Species: {}", p.species);     -  println!("Genus: {}", p.genus); -  println!("Classified in {}", p.classified); -  if p.extinct == true { -      println!("Sadly this penguin has been made extinct."); -  } -} - -``` - -### Variables  - -Rust creates immutable variables by default. That means that a variable you create cannot be changed later. This code, humble though it may be, cannot be compiled: - - -``` - - -fn main() { - let n = 6; - let n = 5; - } - -``` - -However, you can declare a mutable variable with the keyword `mut`, so this code compiles successfully: - - -``` - - -fn main() { - let mut n = 6; - println!("Value is {}", n); - n = 5; - println!("Value is {}", n); -} - -``` - -### Compiler  - -The Rust compiler, at least in terms of its error messages, is one of the nicest compilers available. When you get something wrong in Rust, the compiler makes a sincere effort to tell you what you did wrong. I've actually learned many nuances of Rust (insofar as I understand any nuance of Rust) just by learning from compiler error messages. Even when an error message is too obscure to learn from directly, it's almost always enough for an internet search to explain. - -The easiest way to start a Rust program is to use `cargo`, the Rust package management and build system. - - -``` - - -$ mkdir myproject -$ cd myproject -$ cargo init  - -``` - -This creates the basic infrastructure for a project, most notably a `main.rs` file in the `src` subdirectory. Open this file and paste in the example code I've generated for this article: - - -``` - - -struct Penguin { -    genus: String, -    species: String, -    extinct: bool, -    classified: u64, -} - -fn main() { -    let p = Penguin { genus: "Pygoscelis".to_owned(), species: "R adeliæ".to_owned(), extinct: false, classified: 1841 }; -    printer(p); -    foo(); -} - -fn printer(p: Penguin) { -    println!("Species: {}", p.species);     -    println!("Genus: {}", p.genus); -    println!("Classified in {}", p.classified); -    if p.extinct == true { -        println!("Sadly this penguin has been made extinct."); -    } -} - -fn foo() { -     let mut n = 6; - println!("Value is {}", n); - n = 8; -  println!("Eight is written as {}", n); -} - -``` - -To compile, use the `cargo build` command: - - -``` -`$ cargo build` -``` - -To run your project, execute the binary in the `target` subdirectory, or else just use `cargo run`:  - - -``` - - -$ cargo run -Species: R adeliæ -Genus: Pygoscelis -Classified in 1841 -Value is 6 -Eight is written as 8 - -``` - -### Crates - -Much of the convenience of any language comes from its libraries or modules. In Rust, libraries get distributed and tracked as "crates". The [crates.io][4] website is a good registry of community crates. - -To add a crate to your Rust project, list them in the `Cargo.toml` file. For instance, to install a random number function, I use the `rand` crate, with `*` serving as a wildcard to ensure that I get the latest version at compile time: - - -``` - - -[package] -name = "myproject" -version = "0.1.0" -authors = ["Seth <[seth@opensource.com][5]>"] -edition = "2022" - -[dependencies] -rand = "*" - -``` - -Using it in Rust code requires a `use` statement at the top: - - -``` -`use rand::Rng;` -``` - -Some sample code that creates a random seed and then a random range: - - -``` - - -fn foo() { -    let mut rng = rand::thread_rng(); -    let mut n = rng.gen_range(1..99); - -    println!("Value is {}", n); -    n = rng.gen_range(1..99); -    println!("Value is {}", n); -} - -``` - -You can use `cargo run` to run it, which detects the code change and triggers a new build. The build process downloads the `rand` crate and all the crates that it, in turn, depends upon, compiles the code, and then runs it: - - -``` - - -$ cargo run -Updating crates.io index -Downloaded ppv-lite86 v0.2.16 -Downloaded 1 crate (22.2 KB) in 1.40s - Compiling libc v0.2.112 - Compiling cfg-if v1.0.0 - Compiling ppv-lite86 v0.2.16 - Compiling getrandom v0.2.3 - Compiling rand_core v0.6.3 - Compiling rand_chacha v0.3.1 - Compiling rand v0.8.4 - Compiling rustpenguin v0.1.0 (/home/sek/Demo/rustpenguin) - Finished dev [unoptimized + debuginfo] target(s) in 13.97s - Running `target/debug/rustpenguin` - -Species: R adeliæ -Genus: Pygoscelis -Classified in 1841 -Value is 70 -Value is 35 - -``` - -### Rust cheat sheet - -Rust is a supremely pleasant language. Thanks to its integration with online registries, its helpful compiler, and its almost intuitive syntax, it feels appropriately modern. - -Make no mistake, though, it's also a complex language, with strict data types, strongly scoped variables, and many built-in methods. Rust is worth looking at, and if you're going to explore Rust, then you should download our free **[Rust cheat sheet][6]**, so you have a quick reference for the basics. The sooner you get started, the sooner you'll know Rust. And, of course, you should practice often to avoid getting rusty. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/1/rust-cheat-sheet - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coverimage_cheat_sheet.png?itok=lYkNKieP (Cheat Sheet cover image) -[2]: https://opensource.com/article/20/5/rust-java -[3]: http://rust-lang.org -[4]: https://crates.io/ -[5]: mailto:seth@opensource.com -[6]: https://opensource.com/downloads/rust-cheat-sheet diff --git a/sources/tech/20220114 Installing Arch Linux Using archinstall Automated Script -Complete Guide.md b/sources/tech/20220114 Installing Arch Linux Using archinstall Automated Script -Complete Guide.md deleted file mode 100644 index a67513fdaf..0000000000 --- a/sources/tech/20220114 Installing Arch Linux Using archinstall Automated Script -Complete Guide.md +++ /dev/null @@ -1,195 +0,0 @@ -[#]: subject: "Installing Arch Linux Using archinstall Automated Script [Complete Guide]" -[#]: via: "https://www.debugpoint.com/2022/01/archinstall-guide/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Installing Arch Linux Using archinstall Automated Script [Complete Guide] -====== -IN THIS GUIDE, WE EXPLAIN THE SUPER EASY WAY OF INSTALLING ARCH LINUX -USING AUTOMATED SCRIPT ARCHINSTALL. INTENDED FOR BEGINNER TO ADVANCED -USERS. -Installing Arch Linux is still troublesome for many new users. It requires a fair amount of knowledge of the commands, inner working of a Linux system including boot process, Kernel and Grub concepts. And these are not known to many. But new users still want to install and experience Arch Linux. - -I personally feel that operating system installation should be always simple in this age of computing. Things should be abstracted to the end user as much as possible. After all, all operating system exists for only one purpose – to help the end user to perform certain tasks and help them. - -### What is the archinstall automated script? - -That said, we covered installing Arch Linux as a bare metal system a while back. Since then, the Arch Linux team came up with an automated and interactive script called [archinstall][1]. This script is far easy way to install Arch Linux today, can can be done by anyone. - -That leads us to the intent of this Arch Linux installation guide, using this automated script called archinstall. - -Let’s dig in. - -### Guide to install Arch Linux using archinstall script - -I would split this guide in three sections. First download Arch Linux .ISO file, create a disk with boot. Second is the actual installation and finally configuration with an example desktop. - -#### Section 1: Download .ISO file - -Visit the below link. Download the .ISO file of Arch Linux. You can go for a direct HTTP download or use torrent/magnet files. - -[Download Arch Linux][2] - -Once downloaded, create a bootable USB stick using [Etcher][3] or some other utility. - -Once done, plug-in the USB stick and boot from it. - -Before you begin the next section, make sure you are connected to the internet. In general, if you are in a wired network, you should be good. If you need to configure Wi-Fi via command line in Arch – [follow this guide][4]. Just make sure you are connected to internet. - -#### Section 2: Install using archinstall - -Once boot is complete, you should see a prompt like below. Type `archinstall` and hit enter. - -![First prompt for archinstall][5] - -The command will check for internet connectivity to the Arch Linux mirrors. And once done, a series of questions (like this) will pop up. All you have to do is read and respond. - -So, for this guide, I give the most basic and easy ones to get you started. You can also experiment with other options if you are confident. But I recommend follow the basic options as outlined below, and next time you can experiment. - -Fair enough? Okay. - -So, the first question is Keyboard Layout type. It is shown by the two byte country specific layout codes. You can either type that or the number beside it. For English-US, I entered us. - -![Keyboard Type – archinstall][6] - -Next is Keyboard Language, for which I entered 65 for the United States. - -![Keyboard Language – archinstall][7] - -Next up is the hard drive selection. The script auto-detects the available drives in your target system. For example, in the below image, it shows 17 GB /dev/vda is the main block device. That is where I am going to install the system. Do not skip this step. - -[][8] - -SEE ALSO:   How to Install Cinnamon Desktop in Arch Linux - -For this guide, I have entered 2 which is for /dev/vda. So, enter the number as per your system. - -Once you do that, you should see a double arrow >> beside the device to configure. If you are done, hit enter to proceed. - -![Choose Block Device -1][9] - -![Choose Block Device -2][10] - -In the next option, be very careful. The script asks whether you want to erase the device and go for an auto partition. Or you want to manually partition the drive. For the sake of simplicity, I selected option 0. - -![Select partition option – archinstall][11] - -In the next set of questions, follow as in the image below. It’s more of the file system type, host name, root password, etc. Follow the on-screen instructions. For your help, I have added the questions and their answers used for this guide in the below table. - -Question | Option ----|--- -Question | Option -Select main file system | ext4 -Would you like to use swap on zram? | n -Enter disk encyption password | keep it blank (hit enter) -hostname or the computer name | Enter any name you want -Enter root password | Enter the password you want -Enter a pre-programmed profile name – -0 – desktop -1 – minimal -2 – server -3 – xorg | Choose 3 – xorg -Install graphics driver | Choose as per your system. Or hit enter without any option for default -Install Audio Server | Choose pulseaudio - -![Various options in archinstall -1][12] - -In the next question of choosing a Kernel, choose linux. And enter the name of any additional packages you would like this script to install for you – such as firefox, nano, etc. - -Select the network interface as NetworkManager and choose default options for timezone. - -![Various options in archinstall -2][13] - -And that’s about it. Once you are done, the script would generate and wait for you to hit enter to start the installation process. - -![archinstall starts downloading packages][14] - -Wait until this step finishes. It takes some time to download and install all the packages, depends on your system and internet connection speed. Sometimes Arch mirrors are slow, so wait till it finishes. - -#### Section 3 – Install a desktop environment - -After you install the base system using the above method, you can install any additional desktop environment such as GNOME, KDE Plasma, MATE, Xfce – so on. We have several guides for each of them in the below pages. You can visit your choice of desktop installation page and jump straight to the bottom of these pages for exact command to install a desktop. - - * [Xfce][15] - * [GNOME][16] - * [KDE Plasma][17] - * [Cinnamon][8] - * [LXQt][18] - - - -For example, if you want to install GNOME Desktop basic components, you can simply run the below command to install. - -``` - - sudo pacman -S --needed gnome gnome-tweaks nautilus-sendto gnome-nettool gnome-usage gnome multi-writer adwaita-icon-theme chrome-gnome-shell xdg-user-dirs-gtk fwupd arc-gtk-theme seahosrse gdm firefox gedit - -``` - -``` - - systemctl enable gdm - -``` - -``` - - systemctl enable NetworkManager - -``` - -Once you are done, type reboot. - -And congratulations. You have finally installed Arch Linux using the awesome archinstall script using this guide. - -### Closing Notes - -I believe, this is one of the impressive script that is developed by the team. And it is definitely going to increase the coverage of the Arch Linux with growing user base. - -Having trouble using this script? Let me know in the comment section below. - -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][19], [Twitter][20], [YouTube][21], and [Facebook][22] and never miss an update! - -##### Also Read - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2022/01/archinstall-guide/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://github.com/archlinux/archinstall -[2]: https://archlinux.org/download/ -[3]: https://www.debugpoint.com/2021/01/etcher-bootable-usb-linux/ -[4]: https://www.debugpoint.com/2020/11/connect-wifi-terminal-linux/ -[5]: https://www.debugpoint.com/wp-content/uploads/2022/01/image.png -[6]: https://www.debugpoint.com/wp-content/uploads/2022/01/Keyboard-Type-archinstall.jpg -[7]: https://www.debugpoint.com/wp-content/uploads/2022/01/Keyboard-Language-archinstall.jpg -[8]: https://www.debugpoint.com/2021/02/cinnamon-arch-linux-install/ -[9]: https://www.debugpoint.com/wp-content/uploads/2022/01/Choose-Block-Device-1.jpg -[10]: https://www.debugpoint.com/wp-content/uploads/2022/01/Choose-Block-Device-2.jpg -[11]: https://www.debugpoint.com/wp-content/uploads/2022/01/Select-partition-option-archinstall.jpg -[12]: https://www.debugpoint.com/wp-content/uploads/2022/01/Various-options-in-archinstall-1.jpg -[13]: https://www.debugpoint.com/wp-content/uploads/2022/01/Various-options-in-archinstall-2.jpg -[14]: https://www.debugpoint.com/wp-content/uploads/2022/01/archinstall-starts-downloading-packages.jpg -[15]: https://www.debugpoint.com/2020/12/xfce-arch-linux-install-4-16/ -[16]: https://www.debugpoint.com/2020/12/gnome-arch-linux-install/ -[17]: https://www.debugpoint.com/2021/01/kde-plasma-arch-linux-install/ -[18]: https://www.debugpoint.com/2020/12/lxqt-arch-linux-install/ -[19]: https://t.me/debugpoint -[20]: https://twitter.com/DebugPoint -[21]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[22]: https://facebook.com/DebugPoint diff --git a/sources/tech/20220114 Ubuntu 22.04 LTS -Jammy Jellyfish- - New Features and Release Details.md b/sources/tech/20220114 Ubuntu 22.04 LTS -Jammy Jellyfish- - New Features and Release Details.md deleted file mode 100644 index a65ed67057..0000000000 --- a/sources/tech/20220114 Ubuntu 22.04 LTS -Jammy Jellyfish- - New Features and Release Details.md +++ /dev/null @@ -1,184 +0,0 @@ -[#]: subject: "Ubuntu 22.04 LTS “Jammy Jellyfish” – New Features and Release Details" -[#]: via: "https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Ubuntu 22.04 LTS “Jammy Jellyfish” – New Features and Release Details -====== -IT’S TIME TO UNWRAP THE NEW FEATURES OF UBUNTU 22.04 LTS “JAMMY -JELLYFISH”. WE GIVE YOU ALL THE RELEVANT INFORMATION, AND YOU STAY UP TO -DATE UNTIL THE FINAL RELEASE. -The Ubuntu LTS releases are rare, and they are significant because they set the course for the next five years for everyone – from you/me to the enterprises who run thousands of machines/virtual systems with Ubuntu. - -The upcoming Ubuntu 22.04 LTS code named Jammy Jellyfish is shaping up to be another big LTS release, although there will be misses in terms of the latest tech and packages. - -As of first writing this post, we have some idea about the new features, updates and enhancements from several official/unofficial sources. And we intend to give you a summary of those while keeping this post updated until the final release so that you get a single source of all the information about Ubuntu 22.04 LTS. - -Let’s take a look at the official schedule. - -### Ubuntu 22.04 LTS – Release Schedule - -Ubuntu 22.04 LTS Jammy Jellyfish releases on April 21, 2022. Before that, the Ubuntu team should meet the following milestones. - - * February 24, 2022: **Feature Freeze** - * March 17, 2022: **UI Freeze** - * March 31, 2022: **Beta Release** - * April 21, 2022: **Final Release** - - - -This release is supported until April 2027. - -![Ubuntu 22.04 LTS \(daily build\) Desktop][1] - -### Ubuntu 22.04 – New Features - -#### Kernel - -Linux Kernel 5.15 LTS will be the initial Kernel for this long term Ubuntu release. Released around Halloween 2021 last year, Linux Kernel 5.15 brings several essential improvements. Usual new driver and hardware updates across processor, GPU, network, file system families. This Kernel also brings the fast NTFS3 driver from Paragon Software, mainlined in this version. Other notable benefits of this Kernel are Apple M1 SOC support, in-Kernel SMB driver, Realtech Wi-Fi driver support for RTL8188EU chipset, etc. You can read the details about what this Kernel has to offer in our [Linux Kernel 5.15 coverage][2]. - -#### GNOME Desktop Version - -There is still discussion on the base version of GNOME in this LTS release. However, it is confirmed that [GNOME 42][3] will be the default gnome-shell version. - -But there is a catch. - -You must have heard that GNOME 42 is bringing an updated version of GTK4 applications with libadwaita library-port for those apps. The Ubuntu desktop team plans for GNOME 42, but the default installed applications remain based on GTK3. A sensible decision from the desktop team, in my opinion. Because moving to GNOME 42 + GTK4 + libadwaita ports – all of these requires a lot of regression tests. Not to mention the risk of breaking things here and there. This is too much of an overhead for LTS release, a default choice for most of the user base and arguably the most downloaded/upgraded version. - -Now, Ubuntu already has a dark theme in its settings. GNOME 42 also brings system-wide dark style preference, which the applications can adapt automatically. How both these pans out – is still under discussion at the moment. - -#### Look and Feel - -On the look-n-feel side, there is a change in the Yaru GTK theme base colour, which is the default theme for Ubuntu. The usual Purple accent colour is changing to Orange. Now, be cautious that it may feel like staggering orange shades. Look at this screenshot. - -![Is this too Orange-y?][4] - -#### New Installer - -The default installer of Ubuntu hasn’t changed much since, like, forever. So, with that in mind, the team was working on the new Flutter based installer to replace the old one. Now, it has been in the works for the last couple of months and hasn’t made it to the final release. - -![New Flutter based Ubuntu Installer][5] - -Hopefully, the new installer can make it to this LTS release. But it is still not arrived in daily-build. And when I tried this in Canary .ISO – it crashed even before installing. Let’s keep the finger crossed, and we hope to see it in action in the final release. - -[][6] - -SEE ALSO:   Ubuntu 22.04 Jammy Jellyfish Daily Builds Are Now Available - -#### Packages and Application Updates - -Besides the above changes, core packages default applications bring their latest stable version. Here’s a quick list. - - * Python 3.10 - * Php8.1 - * Ruby 3.0 - * Thunderbird 91.5 - * Firefox 96.0 - * LibreOffice 7.2.5 - * PulseAudio 15.0 - * NetworkManager 1.32 - - - -And the new Yaru icon theme in LibreOffice looks stunning, though. - -![Yaru Icon Theme for LibreOffice looks stunning with Orange color][7] - -#### Updating from Ubuntu 20.04 LTS? - -In general, if you plan to switch to this LTS version from Ubuntu 21.10, you should notice a few items of change. But if you are planning to upgrade from prior Ubuntu 20.04 LTS – then a lot for you to experience. For example, you get a horizontal workspace horizontal app launcher, those introduced since [GNOME 40][8]. - -Also, other notable differences or rather new features are the power profiles menu in the top bar, multitasking option in settings and performance improvements of GNOME Shell and Mutter. - -#### Ubuntu Official Flavors - -Alongside the base version, the official Ubuntu flavours are getting their latest versions of their respective desktop environments in this LTS version. Apart from KDE Plasma, most desktops remained with their last stable release for more than a year. So, you may not experience much of a difference. - -Here’s a quick summary: - - * Kubuntu 22.04 with [KDE Plasma 5.24][9] - * Xubuntu 22.04 with [Xfce 4.16][10] - * Lubuntu 22.04 with [LxQt 1.0][11] - * Ubuntu Budgie with Budgie version 10.5.3 - * Ubuntu Mate with MATE 1.26 - - - -### Download - -This version of Ubuntu is under development at the moment. If you want to give it for a quick spin in your favourite VM, then grab the daily build copy .ISO from the below link. - -Remember, this copy may be unstable and contain bugs. So, you have been warned. - -[Download Ubuntu 22.04 – daily build][12] - -If you want a super-unstable copy of Canary Build, you can get it from the below link. I would not recommend using this Canary .ISO at all unless you have plenty of time to play. Oh, so that you know, this Canary copy .ISO have the new Flutter-based installer. Although I tried to use this new installer, it crashes every time. - -[Daily Canary Build iso][13] - -#### Download the Flavors - -If you want to try out the official Ubuntu flavours as daily build copy, you can get them via the below links. - - * - * - * - * - * - * - * - - - -### Closing Notes - -The LTS releases are conservative in new tech adaptation and other long term impacts. Many organizations and businesses opt for LTS for more than five years of support window and stability. Stability is more important than new technology when running thousands of machines critical to your company. So, that said, many new features or packages may not make it to the final release, but eventually, this release set the course for the next LTS. One step at a time. - -So, what is the feature or package you are expecting in Ubuntu 22.04 and hoping for it? Let me know in the comment section below. - -_References_ - -_ - -_ - -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][14], [Twitter][15], [YouTube][16], and [Facebook][17] and never miss an update! - -##### Also Read - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://www.debugpoint.com/wp-content/uploads/2022/01/Ubuntu-22.04-LTS-daily-build-Desktop-1024x578.jpg -[2]: https://www.debugpoint.com/2021/11/linux-kernel-5-15/ -[3]: https://www.debugpoint.com/2021/12/gnome-42/ -[4]: https://www.debugpoint.com/wp-content/uploads/2022/01/Is-this-too-Orange-y.jpg -[5]: https://www.debugpoint.com/wp-content/uploads/2022/01/New-Flutter-based-Ubuntu-Installer.jpg -[6]: https://www.debugpoint.com/2021/10/ubuntu-22-04-daily-builds/ -[7]: https://www.debugpoint.com/wp-content/uploads/2022/01/Yaru-Icon-Theme-for-LibreOffice-looks-stunning-with-Orange-color-1024x226.jpg -[8]: https://www.debugpoint.com/2021/03/gnome-40-release/ -[9]: https://www.debugpoint.com/2022/01/kde-plasma-5-24/ -[10]: https://www.debugpoint.com/2021/02/xfce-4-16-review/ -[11]: https://www.debugpoint.com/2021/11/lxqt-1-0-release/ -[12]: https://cdimage.ubuntu.com/daily-live/current/ -[13]: https://cdimage.ubuntu.com/daily-canary/current/ -[14]: https://t.me/debugpoint -[15]: https://twitter.com/DebugPoint -[16]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[17]: https://facebook.com/DebugPoint diff --git a/sources/tech/20220118 KDE Plasma Desktop Guide [A Beginner-s Manual].md b/sources/tech/20220118 KDE Plasma Desktop Guide [A Beginner-s Manual].md new file mode 100644 index 0000000000..b9fede8842 --- /dev/null +++ b/sources/tech/20220118 KDE Plasma Desktop Guide [A Beginner-s Manual].md @@ -0,0 +1,177 @@ +[#]: subject: "KDE Plasma Desktop Guide [A Beginner’s Manual]" +[#]: via: "https://www.debugpoint.com/2022/01/kde-plasma-guide/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +KDE Plasma Desktop Guide [A Beginner’s Manual] +====== +This comprehensive article gives you a getting started guide with KDE Plasma desktop. + +KDE Plasma is the most popular and widely used Linux desktop today. If you plan to switch to Linux from Windows, this is a perfect desktop to start with. If you are a student – planning to start your Linux journey with KDE Plasma desktop, you are at the right place. + +This overview article gives you easy-to-understand pointers on using the KDE Plasma desktop while referring to the basic functionalities and activities. This guide is heavily inclined to the absolute new users starting their Linux Journey with KDE Plasma desktop. Furthermore, we explained most of the topics via the GUI method to help the newbies. + +Let’s begin. + +![Kubnutu 21.04 running with KDE Plasma 5.22][1] + +### KDE Plasma Desktop – Beginner’s Guide + +#### Installation of Kubuntu with KDE Plasma as Dual Boot + +KDE Plasma desktop is available with Kubuntu, Fedora Linux, and other Linux distributions. So, to install KDE Plasma Desktop on your computer, you need to download a Linux Distribution. + +I would recommend trying Kubuntu or Fedora Linux KDE Edition for a beginner. Link for downloading those, present below. I believe Kubuntu LTS editions are perfect and stable for new users. + +[Download Kubuntu][2] + +[Download Fedora KDE Edition][3] + +The installation is not part of this article. However, if you are using Windows, you can install using [this guide][4] as a dual boot. If you have a spare Laptop or desktop, you can create a bootable USB stick via [this nice tutorial][5]and boot from it. + +Then follow the on-screen instructions to install Linux with KDE Plasma desktop. + +#### Desktop Overview + +When you first experience the KDE Plasma desktop, you should see a nice desktop with a default bottom panel which includes a standard shortcut of primary applications and a system tray. This desktop follows the traditional menu-driven user interface principles, which requires little to no learning for people migrating from Windows. You do not need to learn tweaks, gestures, or other special features to start using this. + +![KDE Plasma Desktop Showing Basic Items][6] + +The Application Menu can be launched from the very left icon of the Panel. The icon might be different for Ubuntu or Fedora. But you get the idea. + +On the right-click context menu of the desktop, you have all the necessary actions, such as changing wallpaper, settings. They are pretty self-explanatory. + +The Application menu gives you all the necessary application names to start your work on this desktop. If you don’t know which application is needed to perform a specific task, you can find out by typing some text in the search bar. + +#### Connecting to Internet + +Perhaps the most important first task is to connect to the internet. If you have Wi-Fi zones, you can easily find that out from the icon in the system tray. Then click on the name of the connection, enter the password. And you should be connected. + +![KDE Plasma System Tray Showing Wi-Fi Networks][7] + +If you want to configure more, you can search System Settings in Application Launch and open it. Then under Connections, you can further configure your Wi-Fi or wired network. + +#### How to change the look and feel – wallpaper, themes, etc.? + +Obviously, you may need to change the default wallpaper, themes, and colours – right? Changing those are super easy in KDE Plasma. Hit the Application menu, open System Settings. The default first page should allow you to change the wallpaper, as outlined in the below image. + +You can select your favourite one and press Ok. You can also choose any other image using the Add Image button at the bottom. + +![Changing Wallpaper is Easy in KDE Plasma Desktop][8] + +#### How to update your system and install/uninstall software? + +The KDE Plasma desktop has a utility called Discover to manage the installation and removal of software in your system. It supports almost all popular package management formats – apt, dnf, Flatpak, Snap and AppImage. To open this application, search for Discover in Application Menu. + +The user interface of Discover is straightforward to grasp for novice users. + +![Discover Showing Various Options][9] + +On the left side, you have options to view the installed application from the “Installed” button. The “Updates” button gives you details about the update available in your system. Usually, Discover checks automatically for updates. However, you can still force check updates using the “Check for Updates” button. + +And when you hit the “Update All” button, Discover downloads and applies those updates. No further action is required from your end. + +Furthermore, the search button at the top left corner gives you the option to find any application you want for installation. It searches the application in your software sources defined. The software sources are present in the settings of Discover. + +Discover also gives you the ability to browse the application catalogue via their type from the “Applications” button on the left of the window. + +And with just a click on the “Install” button, installs any application. To uninstall any application, click on the Installed button on the left, giving you the list of installed applications with a “Remove” button. + +#### File Manager or File Explorer + +The heart of any desktop is the file manager. Perhaps, this is the most used application in any system. KDE Plasma’s file manager’s name is Dolphin. Dolphin is one of the best Linux File managers today. It comes with almost all the required settings and features needed for your work. If you compare this to Windows Explorer, Dolphin is far smarter than Windows Explorer. + +Here’s how it looks. Drive, network path, and folder shortcuts are present on the left side. Search, view options and the additional menu are present at the top. + +![Dolphin File Manager Showing Options][10] + +Perhaps Dolphin’s most crucial usability feature is the Split view and tabbed view. Most file manager, including Windows Explorer, lacks these two features. + +#### Learn About KDE Ecosystem and Applications + +KDE Plasma desktop brings many in-house standalone desktop applications to help you with your day-to-day work. They are specially designed to work well with Plasma desktop with better integration and performance. + +A few of the apps are installed by default. However, you can install several additional KDE native applications via the Discover Software catalogue. Another way is to go to [https://apps.kde.org/][11] and learn more about KDE Applications. + +![apps.kde.org gives you one stop shop for all KDE App Info][12] + +#### Be productive using KRunner + +The default launcher of KDE Plasma desktop is called KRunner. It is a program designed to search and launch any applications, quick calculation, search inside files and many new features. + +You can launch it anytime, during any workflow situation on the desktop. Launch it via ALT+F2 and type anything. + +![Open any program using Krunner][13] + +![calculate using Krunner][14] + +#### How to watch movies, Netflix and other streaming services? + +If you are just a casual user and plan to adopt KDE Plasma desktop as a daily driver, it’s a perfect choice. For example, watching YouTube, Netflix, or other streaming services are easy and well-supported by this desktop with any Linux Distributions. Usually, these are browser-based activities, which can quickly be done using the default Firefox browser. So, open the Firefox web browser and play your favourite streaming services without any issues. + +#### What happens if you run into errors or need help? + +If you are a beginner, there will be times when you are stuck or run into some errors. So, the first option I would suggest is to do a Google search to find out the details about your issue on the KDE Plasma desktop. + +You can also take help from the helpful community using the below forums: + +* [https://forum.kde.org/][15] +* [https://www.reddit.com/r/kde/][16] + +### What’s Next? + +Now that you learned about the basics of the KDE Plasma desktop, I would recommend you to arm yourself with more features and tricks of this desktop using our following exclusive guides. + +**[Top 10 KDE Plasma Hidden Feature That You Didn’t Know About][17]** + +**[Top 10 KDE Applications That You Didn’t Know About][18]** + +**[What is KDE Connect? How Do You Use It?][19]** + +**[Top 10 KDE Plasma Tips to Make You Super Productive][20]** + +### Closing Notes + +I hope this KDE Plasma guide helps you get started with this awesome desktop within minutes. And remember, the KDE Plasma desktop can be customized to a great extent. You can transform this desktop into anything. It is loaded with many options, tweaks – that is impossible to memorize together. + +As you get started, you should start exploring more options, tweaks in this awesome desktop. And say goodbye to Windows. + +What do you think about this KDE Plasma guide? Does it help? Let me know in the comment box below. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/01/kde-plasma-guide/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2021/06/Kubutu-21.04-running-with-KDE-Plasma-5.22-1024x531.jpg +[2]: https://kubuntu.org/ +[3]: https://spins.fedoraproject.org/kde/ +[4]: https://www.debugpoint.com/2019/01/complete-guide-how-dual-boot-ubuntu-windows/ +[5]: https://nextstep.tcs.com/campus/ +[6]: https://www.debugpoint.com/wp-content/uploads/2022/01/KDE-Plasma-Desktop-Showing-Basic-Items-1024x576.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/01/KDE-Plasma-System-Tray-Showing-Wi-Fi-Icons.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/01/Changing-Wallpaper-is-Easy-in-KDE-Plasma-Desktop-1024x464.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/01/Discover-Showing-Variosu-Options.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/01/Dolphin-File-Manager-Showing-Options-1024x567.jpg +[11]: https://apps.kde.org/ +[12]: https://www.debugpoint.com/wp-content/uploads/2022/01/apps.kde_.org-gives-you-one-stop-shop-for-all-KDE-App-Info-1024x765.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2021/01/Open-any-program-using-Krunner.gif +[14]: https://www.debugpoint.com/wp-content/uploads/2021/01/calculate-using-Krunner.gif +[15]: https://forum.kde.org/ +[16]: https://www.reddit.com/r/kde/ +[17]: https://www.debugpoint.com/2021/12/kde-plasma-hidden-feature/ +[18]: https://www.debugpoint.com/2021/12/top-10-uknown-kde-application/ +[19]: https://www.debugpoint.com/2022/01/kde-connect-guide/ +[20]: https://www.debugpoint.com/2021/01/top-10-kde-plasma-tips-2021/ diff --git a/sources/tech/20220119 Manage your passwords in the Linux terminal.md b/sources/tech/20220119 Manage your passwords in the Linux terminal.md deleted file mode 100644 index 87805bf010..0000000000 --- a/sources/tech/20220119 Manage your passwords in the Linux terminal.md +++ /dev/null @@ -1,259 +0,0 @@ -[#]: subject: "Manage your passwords in the Linux terminal" -[#]: via: "https://opensource.com/article/22/1/manage-passwords-linux-terminal" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Manage your passwords in the Linux terminal -====== -Pass is a classic UNIX-style password management system that uses GnuPG -(GPG) for encryption, and the terminal as its primary interface. -![Linux keys on the keyboard for a desktop computer][1] - -These days, we all have a few dozen passwords. Fortunately, the bulk of those passwords are probably for websites, and you probably access most websites through your internet browser, and most browsers have a built-in password manager. The most common internet browsers also have a synchronization feature to help you distribute your passwords between the browsers you run across all your devices, so you're never without your login information when you need it. If that's not enough for you, there are excellent open source projects like [BitWarden][2] that can host your encrypted passwords, ensuring that only you have the key to unlock them. These solutions help make maintaining unique passwords easy, and I use these convenient systems for a selection of passwords. But my main vault of password storage is a lot simpler than any of these methods. I primarily use [pass][3], a classic UNIX-style password management system that uses GnuPG (GPG) for encryption, and the terminal as its primary interface. - -### Install pass - -You can install the `pass` command from your distribution repository. - -On Fedora, Mageia, and similar distributions, you can install it with your package manager: - - -``` -`$ sudo dnf install pass` -``` - -On Elementary, Mint, and other Debian-based distributions: - - -``` -`$ sudo apt install pass` -``` - -On macOS, you can install it using [Homebrew][4]: - - -``` -`$ brew install pass` -``` - -### Configuring GnuPG - -Before you can use `pass`, you need a valid PGP ("Pretty Good Privacy") key. If you already maintain a PGP key, you can skip this step, or you can choose to create a new key exclusively for use with `pass`. The most common open source PGP implementation is GnuPG (GPG), which ships with Linux, and you can install it on macOS from [gpgtools.org][5], Homebrew, or [Macports][6]. To create a GnuPG key, run this command: - - -``` -`$ gpg --generate-key` -``` - -You're prompted for your name and email address and create a password for the key. Your key is a digital file, and your password is known only to you. Combined, these two things can lock and unlock encrypted information, such as a file containing a password. - -A GPG key is much like a house key or a car key. Should you lose it, anything locked by it becomes unobtainable. Just knowing your password is not enough. - -If you already manage several SSH keys, you're probably used to this. If you're new to digital encryption keys, it can take some getting used to. Backup your `~/.gnupg` directory, so you don't accidentally erase it the next time you decide to try an exciting new distro on a whim. - -Make a backup and keep the backup safe. - -### Configuring pass - -To start using `pass`, you must initialize a _password store_, which is defined as a storage location configured to use a specific encryption key. You can indicate what GPG key you want to use for your password store by either the name associated with the key or the digital fingerprint. Your own name is usually the easier option: - - -``` - - -$ pass init seth -mkdir: created directory '/home/seth/.password-store/' -Password store initialized for seth - -``` - -If you've managed to forget your name, you can see the digital fingerprint and name associated with your key with the `gpg` command: - - -``` - - -$ gpg --list-keys -gpg --list-keys -/home/seth/.gnupg/pubring.kbx -\----------------------------- -pub  ed25519 2022-01-06 [SC] [expires: 2024-01-06] -     2BFF94286461216C907CBA52F067996F13EF10D8 -uid  [ultimate] Seth Kenlon <[seth@example.com][7]> -sub  cv25519 2022-01-06 [E] [expires: 2024-01-06] - -``` - -Initializing a password store with the fingerprint is basically the same as with your name: - - -``` -`$ pass init 2BFF94286461216C907CBA52F067996F13EF10D8` -``` - -### Store a password - -Add a password to your password store with the `pass add` command: - - -``` - - -$ pass add [www.example.com][8] -Enter password for [www.example.com][8]: - -``` - -Enter the password you want to add when prompted. - -The password now gets stored in your password store. You can take a look for yourself: - - -``` - - -$ ls /root/.password-store/ -[www.example.com.gpg][9] - -``` - -Of course, the file is unreadable, and if you attempt to run `cat` or `less` on it, you'll get unprintable characters in your terminal (use `reset` to fix your terminal if its display gets too untidy.) - -### Edit a password with pass - -I use different user names for different activities online, so the username for a site is often just as important as the password. The `pass` system allows for this, even though it doesn't prompt you for it by default. You can add a user name to a password file using the `pass edit` command: - - -``` -`$ pass edit www.example.com` -``` - -This opens a text editor (specifically the editor you have set as your `EDITOR` or `VISUAL` [environment variable][10]) displaying the contents of the `www.example.com` file. Currently, that's just a password, but you can add a user name and even another URL or any information you want. It's an encrypted file, so you're free to keep what you want in it. - - -``` - - -bd%dc$3a49af49498bb6f31bc964718C -user: seth123 -url: example.com - -``` - -Save the file and close it. - -### Get a password from pass - -To see the contents of a password file, use the `pass show` command: - - -``` - - -$ pass show [www.example.com][8] -bd%dc$3a49af49498bb6f31bc964718C -user: seth123 -url: [www.example.org][11] - -``` - -### Search for a password - -Sometimes it's tough to remember whether a password is filed under `www.example.com` or just `example.com` or even something like `app.example.com`. Furthermore, some website infrastructures use different URLs for different site functions, so you might file a password away under `www.example.com` even though you also use the same login information for the partner site `www.example.org`. - -When in doubt, use `grep`. The `pass grep` command shows all instances of a search term, either in a file name or in the contents of a file: - - -``` - - -$ pass grep example -[www.example.com][8]: -url: [www.example.org][11] - -``` - -### Using pass with a browser - -I use `pass` for information beyond just internet passwords, but websites are where I most often need passwords. I usually have a terminal open somewhere on my computer, so it's not much trouble to **Alt+Tab** to a terminal and get the information I need with `pass`. But that's not what I do because there are plugins to integrate `pass` with web browsers. - -#### Pass host script - -First, install the `pass` host script: - - -``` -`$ curl -sSL github.com/passff/passff-host/release/latest/download/install_host_app.sh` -``` - -This install script places a Python script that helps your browser access your password store and GPG keys. Run it along with the name of the browser you use (or nothing, to see all options): - - -``` -`$ bash ./install_host_app.sh firefox` -``` - -If you use multiple browsers, you can install it for each. - -#### Pass Add-on - -Once you've installed the host application, you can install an add-on or extension for your browser. Search for the `PassFF` plugin in your browser's add-on or extension manager. - -![PassFF][12] - -(Seth Kenlon, [CC BY-SA 4.0][13]) - -Install the add-on, and then close and re-launch your browser. - -Navigate to a site you've got a password for in your password store. There's now a small **P** icon in the right of your login text fields. - -![PassFF browser prompt][14] - -(Seth Kenlon, [CC BY-SA 4.0][13]) - -Click on the **P** button to see a list of matching site names in your password store. - -![PassFF browser menu][15] - -(Seth Kenlon, [CC BY-SA 4.0][13]) - -Click the pen-and-paper icon to fill in the form or the paper-airplane icon to fill and auto-submit the form. - -Easy password management and fully integrated! - -### Try pass as your Linux password manager - -The `pass` command is a great option for users who want to manage passwords and personal information using tools they already use on a daily basis. If you rely on GPG and a terminal already, then you may enjoy the `pass` system. It's also an important option for users who don't want their passwords tied to a specific application. Maybe you don't use just one browser, or you don't like the idea that it might be difficult to extract your passwords from an application if you decide to stop using it. With `pass`, you maintain control of your secrets in a UNIX-like and straightforward system. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/1/manage-passwords-linux-terminal - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) -[2]: http://bitwarden.com -[3]: https://www.passwordstore.org/ -[4]: https://opensource.com/article/20/6/homebrew-mac -[5]: https://gpgtools.org/ -[6]: https://opensource.com/article/20/11/macports -[7]: mailto:seth@example.com -[8]: http://www.example.com -[9]: http://www.example.com.gpg -[10]: https://opensource.com/article/19/8/what-are-environment-variables -[11]: http://www.example.org -[12]: https://opensource.com/sites/default/files/uploads/passff.jpg (PassFF) -[13]: https://creativecommons.org/licenses/by-sa/4.0/ -[14]: https://opensource.com/sites/default/files/uploads/passff-button-web.jpg (PassFF browser prompt) -[15]: https://opensource.com/sites/default/files/uploads/passff-menu-web.jpg (PassFF browser menu) diff --git a/sources/tech/20220121 10 Great Apps to Improve Your GNOME Experience -Part 3.md b/sources/tech/20220121 10 Great Apps to Improve Your GNOME Experience -Part 3.md deleted file mode 100644 index 53dfd37e8b..0000000000 --- a/sources/tech/20220121 10 Great Apps to Improve Your GNOME Experience -Part 3.md +++ /dev/null @@ -1,334 +0,0 @@ -[#]: subject: "10 Great Apps to Improve Your GNOME Experience [Part 3]" -[#]: via: "https://www.debugpoint.com/2022/01/best-gnome-apps-part-3/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -10 Great Apps to Improve Your GNOME Experience [Part 3] -====== -WE PRESENT THE NEXT SET OF GREAT GNOME APPS THAT BRINGS MULTITUDE OF -PRODUCTIVITY BOOST WHILE USING YOUR FAVORITE GNOME DESKTOP. -We are progressing with the best GNOME Apps discovery series with this article. The purpose of the series is to create awareness and highlight several unknown GNOME Apps. This gives boost to the developers and overall development. Also helps the end user – like you and me – with their daily work in GNOME desktop. - -This is part 3 of the 5 part series. In case you have arrived here from other references, you can read the previous posts here: - - * [Part 1][1] - * [Part 2][2] - * [Part 4][3] - - - -In this article, we covered the following list of great GNOME Apps. - - * [Sysprof – System Profiler][4] - * [Pika Backup – Backup Software][5] - * [Contrast – Color Combination Checker][6] - * [Decoder – QR Code Scanner and Generator][7] - * [Mahjongg – The Classic Game][8] - * [Authenticator – 2FA Authentication][9] - * [Drawing – A Painting App for GNOME Desktop][10] - * [Curtail – Image Compression App][11] - * [Fractal – Matrix Messaging Client for GNOME][12] - * [Telegrand – Telegram Client][13] - - - -### Great GNOME Apps – Part 3 - -#### Sysprof – System Profiler - -The first app we highlight is called sysprof. This is mostly developer specific application that gives you system performance details for Linux Kernel and other user-space applications. With this application, you can identify the threads, stacks, their individual performances, object types and a good deal of other information. Armed with this information, a developer can easily debug and find out the problems in their respective application. - -This is a GNOME Circle app and well maintained. - -![Sysprof – GNOME Apps][14] - -This application does not come with Flatpak executable module. So, you have to compile and build using Kernel Headers for your system. You can find the detailed steps outlined in the below links. - -[How to compile and Build sysprof][15] -[Getting Started Guide of sysprof][16] - -More Information: - - * [Home Page][17] 1 - * [Home Page 2][18] - * [Source][19] - - - -#### Pika Backup – Backup Software - -When you lose data, then only you remember about Backup software. This is a true fact. Worry not. Pika Backup takes care of all the hassles of taking backups with its simply UI. It is powered by the popular borg-backup software and comes with all necessary feature such as – - -a) Ability to take backups in local or remote location -b) Feature of only backing up the changed files/directories, saving time and bandwidth -c) Encryption support -d) recovery from backup -e) Browsing the already created backups. - -However, scheduling backups is under development, and we hope it soon arrives. - -This is a GNOME Circle app and one of the must-have GNOME App for your desktop. - -![Pika Backup App][20] - -Here’s how to install. - -[Setup Flatpak][21] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - -[Install Pika Backup][22] - -Additional Information about Pika Backup - - * [Home Page][23] - * [Source Code][24] - - - -#### Contrast – Color Combination Checker - -This nice little tool is mostly for web developers who want to quickly pick up two colors that look great. Named Contrast, this utility follows [Web Content Accessibility Guidelines][25] (WCAG) with options to choose HEX color codes, view the contrast ratio. A great time saving tool for the developers. - -![Contrast App][26] - -Here’s how to install. - -[Setup Flatpak][21] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - -[Install Contrast][27] - -Additional information about Contrast: - -[Source Code][28] - -#### Decoder – QR Code Scanner and Generator - -Decoder is a simple tool that helps to do everything related to QR Code. This GNOME Circle app is capable of generating QR code, scan for codes, scan via uploading an image and obviously parse QR Code contents. - -A nifty tool for your GNOME Desktop when you need it. Here’s how it looks and how to install. - -![Decoder App][29] - -[Setup Flatpak][21] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - -[Install Decoder][30] - -Additional information about Decoder: - - * [Home Page][31] - * [Source Code][32] - - - -#### Mahjongg – The Classic Game - -This is one of the game that was available in several Linux distributions since the beginning of Linux. And now it is available for your GNOME desktop. Mahjongg is a one-player version of the classic Eastern tile game, whose only objective is to select a pair of similar tiles. - -A Fun fact: There is a theory that this game is made by the famous Chinese philosopher Confucius. - -![Mahjongg – A Classic Game][33] - -This is how you can install this addictive game in your GNOME Desktop. - -[][34] - -SEE ALSO:   Top 10 KDE Application That You Didn't Know About - -[Setup Flatpak][21] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - -[Install Mahjongg][35] - -Additional information about this great GNOME Game app: - - * [Source Code][36] - * [Home Page][37] - * [How to play][38] - - - -#### Authenticator – 2FA Authentication - -Two-Factor Authentication (2FA) is everywhere these days. It is one of the safest authentication method used by all popular service providers such as Google, GitHub, etc. Mostly, there are apps available for 2FA in all mobile Platform. However, you can also set this up as a native desktop app in your GNOME desktop. - -The Authenticator app generates 2FA codes and supports Time-based/Counter-based/Steam methods. You can easily set up the methods using its built-in QR code scanner or via uploading an image. - -![Authenticator GNOME App][39] - -This is how you can install this GNOME Circle app. - -[Setup Flatpak][21] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - -[Install Authenticator App][40] - -Additional information of this app: - - * [Home Page][41] - * [Source Code][42] - - - -#### Drawing – A Painting App for GNOME Desktop - -Drawing is one of the best GNOME apps out there which is a perfect program for quick drawing. It is an alternative to MS Paint program and capable of doing all necessary editing tasks such as: - - * Draw and Edit with pencil, line or arc tool - * Selection support (cut, copy, paste, drag) - * Shapes (rectangle, circle, polygon) - * Editing features – resize, crop, rotate - * Available in GNU/Linux Phones as an App - * And supports both X11 and Wayland display servers - - - -![Drawing GNOME App][43] - -This is how to install this great GNOME app. - -[Setup Flatpak][21] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - -[Install Drawing][44] - -Additional information about this app. - - * [Home Page][45] - * [Source Code][46] - - - -#### Curtail – Image Compression App - -Need a quick image compression tool? Try Curtail. This GNOME app is another best tool to quickly reduce size of your images with its simple UI. It supports WebP, PNG, JPG image types. Curtail can compress both lossless and lossy types with option to remove metadata. - -![Curtail][47] - -This is one of the must-have tool for your GNOME desktop. This is how to install. - -[Setup Flatpak][21] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - -[Install Curtail][48] - -Additional information about Curtail - - * [Home Page][49] - * [Source Code][50] - - - -#### Fractal – Matrix Messaging Client for GNOME - -Fractal is a Matrix messaging client for your GNOME desktop. It is written in rust and provides all necessary features for your collaboration in the popular Matrix messaging platform. - -![Fractal – Matrix Messaging Client][51] - -This is how to install. - -[Setup Flatpak][21] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - -[Install Fractal][52] - -Additional information about Fractal - -[Source Code][53] - -#### Telegrand – Telegram Client - -The final app in this list is Telegrand. This application is not stable at the moment and under development. However, I feel it is worth mentioning here because of its potential. The Telegram messaging app have its own native desktop application. However, this GTK based Telegrand act perfectly for your desktop with its features. - -There is no installer available at the moment. But you can easily build it from source via instructions present in [GitHub][54]. - -We hope to see this app become stable in near future and available in GNOME Desktop as well as in GNU/Linux Phones. - -### Closing Notes - -So, with these 10 apps, we conclude the Part 3 of the great GNOME Apps series. We covered some unique and unknown application in this article. I hope you can utilize some of these apps for your daily workflow. - -If you missed the other parts of the series, they are present in the below links. - - * [Part 1][1] - * [Part 2][2] - * [Part 4][3] - - - -Let me know your comments or suggestions about the apps, or, this series as a whole. - -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][55], [Twitter][56], [YouTube][57], and [Facebook][58] and never miss an update! - -##### Also Read - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2022/01/best-gnome-apps-part-3/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://www.debugpoint.com/2021/12/best-gnome-apps-part-1/ -[2]: https://www.debugpoint.com/2021/12/best-gnome-apps-part-2/ -[3]: https://www.debugpoint.com/2022/02/best-gnome-apps-part-4/ -[4]: tmp.W80b1YR7vZ#sysprof -[5]: tmp.W80b1YR7vZ#pika-backup -[6]: tmp.W80b1YR7vZ#contrast -[7]: tmp.W80b1YR7vZ#decoder -[8]: tmp.W80b1YR7vZ#mahjongg -[9]: tmp.W80b1YR7vZ#authenticator -[10]: tmp.W80b1YR7vZ#drawing -[11]: tmp.W80b1YR7vZ#curtail -[12]: tmp.W80b1YR7vZ#fractal -[13]: tmp.W80b1YR7vZ#telegrand -[14]: https://www.debugpoint.com/wp-content/uploads/2022/01/Sysprof-GNOME-Apps.jpg -[15]: https://gitlab.gnome.org/GNOME/sysprof#building-sysprof -[16]: https://blogs.gnome.org/chergert/2020/03/14/how-to-use-sysprof-to/ -[17]: https://apps.gnome.org/app/org.gnome.Sysprof3/ -[18]: http://www.sysprof.com/ -[19]: https://gitlab.gnome.org/GNOME/sysprof -[20]: https://www.debugpoint.com/wp-content/uploads/2022/01/Pika-Backup-App.jpg -[21]: https://flatpak.org/setup/ -[22]: https://dl.flathub.org/repo/appstream/org.gnome.World.PikaBackup.flatpakref -[23]: https://apps.gnome.org/app/org.gnome.World.PikaBackup/ -[24]: https://gitlab.gnome.org/World/pika-backup/ -[25]: https://www.w3.org/WAI/standards-guidelines/wcag/ -[26]: https://www.debugpoint.com/wp-content/uploads/2022/01/Contrast-App.jpg -[27]: https://dl.flathub.org/repo/appstream/org.gnome.design.Contrast.flatpakref -[28]: https://gitlab.gnome.org/World/design/contrast -[29]: https://www.debugpoint.com/wp-content/uploads/2022/01/Decoder-App.jpg -[30]: https://www.debugpoint.com/2022/01/best-gnome-apps-part-3/Setup%20Flatpak%20for%20your%20Linux%20distribution.%20And%20then%20click%20on%20the%20below%20button%20to%20launch%20the%20native%20software%20manager%20to%20install%20(such%20as%20Software%20or%20Discover). -[31]: https://apps.gnome.org/app/com.belmoussaoui.Decoder/ -[32]: https://gitlab.gnome.org/World/decoder/ -[33]: https://www.debugpoint.com/wp-content/uploads/2022/01/Mahjongg-A-Classic-Game.jpg -[34]: https://www.debugpoint.com/2021/12/top-10-uknown-kde-application/ -[35]: https://dl.flathub.org/repo/appstream/org.gnome.Mahjongg.flatpakref -[36]: https://gitlab.gnome.org/GNOME/gnome-mahjongg/ -[37]: https://wiki.gnome.org/Apps/Mahjongg -[38]: https://help.gnome.org/users/gnome-mahjongg/stable/ -[39]: https://www.debugpoint.com/wp-content/uploads/2022/01/Authenticator-GNOME-App4.jpg -[40]: https://dl.flathub.org/repo/appstream/com.belmoussaoui.Authenticator.flatpakref -[41]: https://apps.gnome.org/app/com.belmoussaoui.Authenticator/ -[42]: https://gitlab.gnome.org/World/Authenticator -[43]: https://www.debugpoint.com/wp-content/uploads/2022/01/Drawing-GNOME-App2.png -[44]: https://dl.flathub.org/repo/appstream/com.github.maoschanz.drawing.flatpakref -[45]: https://maoschanz.github.io/drawing/ -[46]: https://github.com/maoschanz/drawing/ -[47]: https://www.debugpoint.com/wp-content/uploads/2022/01/Curtail.jpg -[48]: https://dl.flathub.org/repo/appstream/com.github.huluti.Curtail.flatpakref -[49]: https://apps.gnome.org/app/com.github.huluti.Curtail/ -[50]: https://github.com/Huluti/Curtail/ -[51]: https://www.debugpoint.com/wp-content/uploads/2022/01/Fractal-Matrix-Messaging-Client.jpg -[52]: https://dl.flathub.org/repo/appstream/org.gnome.Fractal.flatpakref -[53]: https://gitlab.gnome.org/GNOME/fractal -[54]: https://github.com/melix99/telegrand/ -[55]: https://t.me/debugpoint -[56]: https://twitter.com/DebugPoint -[57]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[58]: https://facebook.com/DebugPoint diff --git a/sources/tech/20220121 KDE Plasma Desktop Guide -A Beginner-s Manual.md b/sources/tech/20220121 KDE Plasma Desktop Guide -A Beginner-s Manual.md deleted file mode 100644 index eb8c0d1198..0000000000 --- a/sources/tech/20220121 KDE Plasma Desktop Guide -A Beginner-s Manual.md +++ /dev/null @@ -1,179 +0,0 @@ -[#]: subject: "KDE Plasma Desktop Guide [A Beginner’s Manual]" -[#]: via: "https://www.debugpoint.com/2022/01/kde-plasma-guide/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -KDE Plasma Desktop Guide [A Beginner’s Manual] -====== -WE GIVE YOU A GETTING STARTED GUIDE WITH KDE PLASMA DESKTOP IN THIS -COMPREHENSIVE ARTICLE. -KDE Plasma is the most popular and widely used Linux desktop today. If you are planning to switch to Linux from Windows, then this is a perfect desktop to start with. If you are a student – planning to start your Linux journey with KDE Plasma desktop, then you are at the right place. - -In this overview article, we give you easy to understand pointers on how to use KDE Plasma desktop while referring to the basic functionalities and activities. This guide is heavily inclined to the absolute new users starting their Linux Journey with KDE Plasma desktop. Furthermore, we explained most of the topics via GUI method to help the newbies. - -Let’s begin. - -![Kubnutu 21.04 running with KDE Plasma 5.22][1] - -### KDE Plasma Desktop – Beginner’s Guide - -#### Installation of Kubuntu with KDE Plasma as Dual Boot - -KDE Plasma desktop is available with Kubuntu, Fedora Linux, and other Linux distributions. So, to install KDE Plasma Desktop in your computer, you need to download a Linux Distribution. - -For a beginner, I would recommend trying Kubuntu or Fedora Linux KDE Edition. Link for downloading those, present below. I believe, Kubuntu LTS editions are the perfect and stable for new users. - -[Download Kubuntu][2] - -[Download Fedora KDE Edition][3] - -The installation is not part of this article. However, if you are using Windows, you can install using [this guide][4] as a dual boot. If you have a spare Laptop or desktop, you can create a bootable USB stick via [this nice tutorial][5] and boot from it. - -Then follow the on-screen instructions to install Linux with KDE Plasma desktop. - -#### Desktop Overview - -When you first experience KDE Plasma desktop, you should see a nice desktop with a default bottom panel which includes standard shortcut of main applications and a system tray. This desktop follows the traditional menu-driven user interface principles, which requires little to no learning for people migrating from Windows. You do not need to learn tweaks, gestures or any other special features to start using this. - -![KDE Plasma Desktop Showing Basic Items][6] - -The Application menu can be launched from the very left icon of the Panel. The icon might be different for Ubuntu or Fedora. But you get the idea. - -On the right click context menu of the desktop, you have all the necessary actions such as changing wallpaper, settings. They are pretty self-explanatory. - -The Application menu gives you all the necessary application names to start your work on this desktop. If you don’t know which application is needed to perform a specific task, then you can simply find out by typing some text in the search bar. - -#### Connecting to Internet - -Perhaps the most important first task is to connect to the internet. If you have Wi-Fi zones, you can easily find that out from the icon in the system tray. Then click on the name of the connection, enter password. And you should be connected. - -![KDE Plasma System Tray Showing Wi-Fi Networks][7] - -If you want to configure more, you can search System Settings in Application Launch and open it. Then under Connections, you can further configure your Wi-Fi or wired network. - -#### How to change the look and feel – wallpaper, themes, etc. ? - -It is obvious that you may need to change the default wallpaper, themes, colors – right? Changing those are super easy in KDE Plasma. Hit the Application menu, open System Settings. The default first page should give you the option to change the wallpaper, as outlined in the below image. - -You can select your favorite one and press Ok. You can also choose any other image using the Add Image button at the bottom. - -![Changing Wallpaper is Easy in KDE Plasma Desktop][8] - -#### How to update your system and install/uninstall software? - -The KDE Plasma desktop has a utility called Discover to manage installation and removal of software in your system. It supports almost all popular package management format – apt, dnf, Flatpak, Snap and AppImage. To open this application, search for Discover in Application Menu. - -The user interface of Discover very easy to grasp for novice users. - -![Discover Showing Various Options][9] - -On the left side you have options to view installed application from the “Installed” button. The “Updates” button gives you details about the update available in your system. Usually Discover automatically checks for updates. However you can still force check updates using the “Check for Updates” button. - -And when you hit the “Update All” button, Discover downloads and applies those updates. No further action required from your end. - -[][10] - -SEE ALSO:   Top 10 KDE Application That You Didn't Know About - -Furthermore, the search button at top left corner gives you option to find any application you want for installation. It searches the application in your software sources defined. The software sources are present in the settings of Discover. - -Discover is also gives you ability browse application catalogue via their type from the “Applications” button on the left of the window. - -And with just a click on the “Install” button, installs any application. To uninstall any application, click on the Installed button on the left which gives you the list of installed applications with a “Remove” button. - -#### File Manager or File Explorer - -The heart of any desktop is the file manager. Perhaps, this is the most used application in any system. KDE Plasma’s file manager name is Dolphin. Dolphin is one of the best Linux File manager today. It comes with almost all required settings and features that are required for your work. If you compare this to Windows Explorer, well, Dolphin is far smarter than Windows Explorer. - -Here’s how it looks. On the left side, drives, network path, and folder shortcuts are present. Search, view options and additional menu is present at the top. - -![Dolphin File Manager Showing Options][11] - -Perhaps the most important usability feature of Dolphin is the Split view and tabbed view. Most of the file manager including Windows Explorer lacks this two feature. - -#### Learn About KDE Ecosystem and Applications - -KDE Plasma desktop brings lots of in-house standalone desktop application to help you on your day-to-day work. They are specially designed to work well with Plasma desktop with better integration and performance. - -A few of the apps installed by default. However, several additional KDE native applications which you can install via Discover Software catalog. Another way is to go to and learn more about KDE Applications. - -![apps.kde.org gives you one-stop shop for all KDE App Info][12] - -#### Be productive using KRunner - -The default launcher of KDE Plasma desktop is called KRunner. It is a program designed to search and launch any applications, quick calculation, search inside files and many new features. - -You can launch it anytime, during any workflow situation in the desktop. Launch it via ALT+F2 and type anything. - -![Open any program using Krunner][13] - -![calculate using Krunner][14] - -#### How to watch movies, Netflix and other streaming services? - -If you are just a casual user and planning to adopt KDE Plasma desktop as daily driver, then it’s a perfect choice. For example, watching YouTube, Netflix or other streaming services are easy and well-supported by this desktop with any Linux Distributions. Usually these are browser based activity, which can easily be done using the default Firefox browser. So, open Firefox web browser and play your favorite streaming services without any issues. - -#### What happens, if you run into errors or need help? - -If you are a beginner, there will be time when you are stuck or ran into some errors. So, first option I would suggest is do a Google Search to find out the details about your issue in KDE Plasma desktop. - -You can also take help from helpful community using the below forums: - - * - * - - - -### What’s Next? - -Now that you learned about basics of KDE Plasma desktop, I would recommend you to arm yourself with more features and tricks of this desktop using our following exclusive guides. - -### Closing Notes - -I hope, this KDE Plasma guide helps you to get started with this awesome desktop within minutes. And remember, KDE Plasma desktop can be customized to a great extent. You can literally transform this desktop to anything. It is loaded with many options, tweaks – that is impossible to memorize together. - -That said, as you get started, you should start exploring more options, tweaks in this awesome desktop. And say goodbye to Windows. - -What you think about this KDE Plasma guide? Does it help? Let me know in the comment box below. - -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][15], [Twitter][16], [YouTube][17], and [Facebook][18] and never miss an update! - -##### Also Read - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2022/01/kde-plasma-guide/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://www.debugpoint.com/wp-content/uploads/2021/06/Kubutu-21.04-running-with-KDE-Plasma-5.22-1024x531.jpg -[2]: https://kubuntu.org/ -[3]: https://spins.fedoraproject.org/kde/ -[4]: https://www.debugpoint.com/2019/01/complete-guide-how-dual-boot-ubuntu-windows/ -[5]: https://nextstep.tcs.com/campus/ -[6]: https://www.debugpoint.com/wp-content/uploads/2022/01/KDE-Plasma-Desktop-Showing-Basic-Items-1024x576.jpg -[7]: https://www.debugpoint.com/wp-content/uploads/2022/01/KDE-Plasma-System-Tray-Showing-Wi-Fi-Icons.jpg -[8]: https://www.debugpoint.com/wp-content/uploads/2022/01/Changing-Wallpaper-is-Easy-in-KDE-Plasma-Desktop-1024x464.jpg -[9]: https://www.debugpoint.com/wp-content/uploads/2022/01/Discover-Showing-Variosu-Options.jpg -[10]: https://www.debugpoint.com/2021/12/top-10-uknown-kde-application/ -[11]: https://www.debugpoint.com/wp-content/uploads/2022/01/Dolphin-File-Manager-Showing-Options-1024x567.jpg -[12]: https://www.debugpoint.com/wp-content/uploads/2022/01/apps.kde_.org-gives-you-one-stop-shop-for-all-KDE-App-Info-1024x765.jpg -[13]: https://www.debugpoint.com/wp-content/uploads/2021/01/Open-any-program-using-Krunner.gif -[14]: https://www.debugpoint.com/wp-content/uploads/2021/01/calculate-using-Krunner.gif -[15]: https://t.me/debugpoint -[16]: https://twitter.com/DebugPoint -[17]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[18]: https://facebook.com/DebugPoint diff --git a/sources/tech/20220121 What you need to know about fuzz testing and Go.md b/sources/tech/20220121 What you need to know about fuzz testing and Go.md deleted file mode 100644 index 47f60db5de..0000000000 --- a/sources/tech/20220121 What you need to know about fuzz testing and Go.md +++ /dev/null @@ -1,163 +0,0 @@ -[#]: subject: "What you need to know about fuzz testing and Go" -[#]: via: "https://opensource.com/article/22/1/native-go-fuzz-testing" -[#]: author: "Gaurav Kamathe https://opensource.com/users/gkamathe" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -What you need to know about fuzz testing and Go -====== -The Go team has accepted a proposal to add fuzz testing support to the -language. -![Person using a laptop][1] - -The usage of [Go][2] is growing rapidly. It is now the preferred language for writing cloud-native software, container software, command-line tools, databases, and more. Go has had built-in [support for testing][3] for quite some time now. It makes writing tests and running them using the Go tool relatively easy. - -### What is fuzz testing? - -Fuzzing, sometimes also called fuzz testing, is the practice of giving unexpected input to your software. Ideally, this test causes your application to crash, or behave in unexpected ways. Regardless of what happens, you can learn a lot from how your code reacts to data it wasn't programmed to accept, and you can add appropriate error handling. - -Any given software program consists of instructions that accept input or data from various sources, then it processes this data and generates appropriate output. As software gets developed, a team of test engineers tests this software to find bugs in the software that can then be reported and fixed. Often, the intent is to see if the software behaves as expected. Testing can further get divided into multiple areas, such as functional testing, integration testing, performance testing, and more. Each focuses on a specific aspect of the software functionality to find bugs or improve reliability or performance. - -Fuzzing takes this testing process a step further and tries to provide "invalid" or "random" data to the software program. This is intentional, and the expectation is that the program should crash or behave unexpectedly to uncover bugs in the program so the developers can fix them. Like testing, doing this manually doesn't scale, so many fuzzing tools have been written to automate this process. - -### Software testing in Go - -As an example to test `Add()` function within `add.go`, you could write tests within `add_test.go` by importing the "testing" package and adding the test functionality within a function starting with `TestXXX()`. - -Given this code: - - -``` - - -func Add(num1, num2 int) int { -} - -``` - -In a file called `add_test.go`, you might have this code for testing: - - -``` - - -import "testing" - -func TestAdd(t *testing.T) { -} - -``` - -Run the test: - - -``` -`$ go test` -``` - -### Addition of fuzz testing support - -The Go team has accepted a [proposal to add fuzz testing support][4] to the language to further this effort. This involves adding a new `testing.F` type, the addition of `FuzzXXX()` functions within the `_test.go` files, and to run these tests with the `-fuzz` option is being added to the Go tool. - -In a file called `add_test.go`: - - -``` - - -func FuzzAdd(f *testing.F) { -} - -``` - -Run the code: - - -``` -`$ go test -fuzz` -``` - -This [feature is experimental][5] at the time of writing, but it should be included in the 1.18 release. Also, many features like `-keepfuzzing` and `-race` are not supported at the moment. The Go team has recently published [a tutorial on fuzzing][6], which is well worth a read. - -### Get the latest features with gotip installation - -If you are enthusiastic and wish to try out the feature before the official release, you can utilize `gotip`, which allows you to test upcoming Go features and provide feedback. To install `gotip`, you can use the commands below. After installation, you can use the `gotip` utility to compile and run the program instead of the usual `go` utility. - - -``` - - -$ go install golang.org/dl/gotip@latest -$ gotip download - -$ gotip version -go version devel go1.18-f009910 Thu Jan 6 16:22:21 2022 +0000 linux/amd64 -$ - -``` - -### Fuzzing opinions in the community - -Fuzzing is often a point of discussion among the software community, and we find people on both ends of the spectrum. Some consider it a useful technique to find bugs, especially on the security front. Whereas given the required resources (CPU/memory) for fuzzing, some consider it a waste or prefer other techniques over it. This is even evident in the Go team as well. We can see Go co-founder Rob Pike being slightly skeptical about the uses of fuzzing and its implementation in Go. - -> _... Although fuzzing is good at finding certain classes of bugs, it is very expensive in CPU and storage, and cost/benefit ratio remains unclear. I worry about wasting energy and filling up git repos with testdata noise..._ -> -> _~_[Rob Pike][7] - -However, another member of the Go security team, Filo Sottile, seems quite optimistic about the addition of fuzz support to Go, also backing it up with some examples and wants it to be a part of the development process. - -> *I like to say that fuzzing finds bugs at the margin. It's why we are interested in it as the security team: bugs caught at the margin are ones that don't make it into production to become vulnerabilities. * -> -> _We want fuzzing to be part of the development—not build or security—process: make a change to the relevant code…_ -> -> _~_[Filo Sottile][8] - -### Real-world fuzzing - -To me, fuzzing seems quite effective at findings bugs and making systems more secure and resilient. To give an example, even the Linux kernel is fuzz tested using a tool called [syzkaller][9], and it has uncovered a [variety of bugs][10]. - -[AFL][11]** **is another popular fuzzer, used to fuzz programs written in C/C++. - -There were options available for fuzzing Go programs as well in the past, one of them being [go-fuzz][12] which Filo mentions in his GitHub comments - -> _The track record of go-fuzz provides pretty amazing evidence that fuzzing is good at finding bugs that humans had not found. In my experience, just a few CPU minutes of fuzzing can be extremely effective at the margin_ - -### Why add native fuzzing support in Go - -If the requirement is to fuzz Go programs and existing tools like `go-fuzz` could do it, why add native fuzzing support to the language? The [Go fuzzing design draft][13] provides some rationale for doing so. The idea was to bring simplicity to the process as using the above tools adds more work for the developer and has many missing features. If you are new to fuzzing, I recommend reading the design draft document. - -> Developers could use tools like go-fuzz or fzgo (built on top of go-fuzz) to solve some of their needs. However, each existing solution involves more work than typical Go testing and is missing crucial features. Fuzz testing shouldn't be any more complicated or less feature-complete than other types of Go testing (like benchmarking or unit testing). Existing solutions add extra overhead, such as custom command-line tools, - -### Fuzz tooling - -Fuzzing is a welcome addition to the Go language's long list of desired features. Although experimental for now, it's expected to become robust in upcoming releases. This gives sufficient time to try it out and explore its use cases. Rather than seeing it as an overhead, it should be seen as an effective testing tool to uncover hidden bugs if used correctly. Teams using Go should encourage its use, starting with developers writing small fuzz tests and testing teams extending it further to utilize its potential fully. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/1/native-go-fuzz-testing - -作者:[Gaurav Kamathe][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/gkamathe -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) -[2]: https://go.dev/ -[3]: https://pkg.go.dev/testing -[4]: https://github.com/golang/go/issues/44551 -[5]: https://go.dev/blog/fuzz-beta -[6]: https://go.dev/doc/tutorial/fuzz -[7]: https://github.com/golang/go/issues/44551#issuecomment-784584785 -[8]: https://github.com/golang/go/issues/44551#issuecomment-784655571 -[9]: https://github.com/google/syzkaller -[10]: https://github.com/google/syzkaller/blob/master/docs/linux/found_bugs.md -[11]: https://github.com/google/AFL -[12]: https://github.com/dvyukov/go-fuzz -[13]: https://go.googlesource.com/proposal/+/master/design/draft-fuzzing.md diff --git a/sources/tech/20220123 10 Great Apps to Improve Your GNOME Experience [Part 3].md b/sources/tech/20220123 10 Great Apps to Improve Your GNOME Experience [Part 3].md new file mode 100644 index 0000000000..2d64cbea17 --- /dev/null +++ b/sources/tech/20220123 10 Great Apps to Improve Your GNOME Experience [Part 3].md @@ -0,0 +1,295 @@ +[#]: subject: "10 Great Apps to Improve Your GNOME Experience [Part 3]" +[#]: via: "https://www.debugpoint.com/2022/01/best-gnome-apps-part-3/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +10 Great Apps to Improve Your GNOME Experience [Part 3] +====== +We present the next set of great GNOME Apps that brings a multitude of productivity boost while using your favourite GNOME desktop. + +We are progressing with the best GNOME Apps discovery series with this article. The purpose of the series is to create awareness and highlight several unknown GNOME Apps. This gives a boost to the developers and overall development. Also helps the end-user – like you and me – with their daily work on the GNOME desktop. + +This is part 3 of the 5 part series. In case you have arrived here from other references, you can read the previous posts here: + +* [Part 1][1] +* [Part 2][2] +* [Part 4][3] +* [Part 5][4] + +In this article, we covered the following list of great GNOME Apps. + +* Sysprof – System Profiler +* Pika Backup – Backup Software +* Contrast – Color Combination Checker +* Decoder – QR Code Scanner and Generator +* Mahjongg – The Classic Game +* Authenticator – 2FA Authentication +* Drawing – A Painting App for GNOME Desktop +* Curtail – Image Compression App +* Fractal – Matrix Messaging Client for GNOME +* Telegrand – Telegram Client + +### Great GNOME Apps – Part 3 + +#### Sysprof – System Profiler + +The first app we highlight is called sysprof. This is a mostly developer-specific application that gives you system performance details for Linux Kernel and other user-space applications. With this application, you can identify the threads, stacks, their individual performances, object types and a good deal of other information. Armed with this information, a developer can easily debug and find out the problems in their respective application. + +This is a GNOME Circle app and is well maintained. + +![Sysprof - A great GNOME Apps][5] + +This application does not come with Flatpak executable module. So, you have to compile and build using Kernel Headers for your system. You can find the detailed steps outlined in the below links. + +[How to compile and Build sysprof][6][Getting Started Guide of sysprof][7] + +More Information: + +* [Home Page][8] 1 +* [Home Page 2][9] +* [Source][10] + +#### Pika Backup – Backup Software + +When you lose data, then only you remember about Backup software. This is a true fact. Worry not. Pika Backup takes care of all the hassles of taking backups with its simple UI. It is powered by the popular borg-backup software and comes with all necessary features such as – + +a) Ability to take backups in a local or remote locationb) Feature of only backing up the changed files/directories, saving time and bandwidthc) Encryption supportd) recovery from backupe) Browsing the already created backups. + +However, scheduling backups is under development, and we hope it soon arrives. + +This is a GNOME Circle app and one of the must-have GNOME App for your desktop. + +![Pika Backup App][11] + +Here’s how to install. + +[Setup Flatpak][12] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). + +[Install Pika Backup][13] + +Additional Information about Pika Backup + +* [Home Page][14] +* [Source Code][15] + +#### Contrast – Color Combination Checker + +This nice little tool is mostly for web developers who want to quickly pick up two colours that look great. Named Contrast, this utility follows Web Content Accessibility Guidelines (WCAG) with options to choose HEX colour codes, view the contrast ratio. A great time-saving tool for the developers. + +![Contrast App][16] + +Here’s how to install it. + +[Setup Flatpak][17] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). + +[Install Contrast][18] + +Additional information about Contrast: + +[Source Code][19] + +#### Decoder – QR Code Scanner and Generator + +Decoder is a simple tool that helps to do everything related to QR codes. This GNOME Circle app is capable of generating QR codes, scanning for codes, scanning via uploading an image and obviously parse QR Code contents. + +A nifty tool for your GNOME Desktop when you need it. Here’s how it looks and how to install it. + +![Decoder - A great GNOME App][20] + +[Setup Flatpak][21] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). + +[Install Decoder][22] + +Additional information about Decoder: + +* [Home Page][23] +* [Source Code][24] + +#### Mahjongg – The Classic Game + +This is one of the games that was available in several Linux distributions since the beginning of Linux. And now it is available for your GNOME desktop. Mahjongg is a one-player version of the classic Eastern tile game, whose only objective is to select a pair of similar tiles. + +A fun fact: There is a theory that this game is made by the famous Chinese philosopher Confucius. + +![Mahjongg - A Classic Game][25] + +This is how you can install this addictive game in your GNOME Desktop. + +[Setup Flatpak][26] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). + +[Install Mahjongg][27] + +Additional information about this great GNOME Game app: + +* [Source Code][28] +* [Home Page][29] +* [How to play][30] + +#### Authenticator – 2FA Authentication + +Two-Factor Authentication (2FA) is everywhere these days. It is one of the safest authentication methods used by all popular service providers such as Google, GitHub, etc. Mostly, there are apps available for 2FA in all mobile Platforms. However, you can also set this up as a native desktop app on your GNOME desktop. + +The Authenticator app generates 2FA codes and supports Time-based/Counter-based/Steam methods. You can easily set up the methods using its built-in QR code scanner or via uploading an image. + +![Authenticator GNOME App][31] + +This is how you can install this GNOME Circle app. + +[Setup Flatpak][32] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). + +[Install Authenticator App][33] + +Additional information of this app: + +* [Home Page][34] +* [Source Code][35] + +#### Drawing – A Painting App for GNOME Desktop + +Drawing is one of the best GNOME apps out there which is a perfect program for quick drawing. It is an alternative to the MS Paint program and capable of doing all necessary editing tasks such as: + +* Draw and Edit with pencil, line or arc tool +* Selection support (cut, copy, paste, drag) +* Shapes (rectangle, circle, polygon) +* Editing features – resize, crop, rotate +* Available in GNU/Linux Phones as an App +* And supports both X11 and Wayland display servers + +![Drawing GNOME App][36] + +This is how to install this great GNOME app. + +[Setup Flatpak][37] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). + +[Install Drawing][38] + +Additional information about this app. + +* [Home Page][39] +* [Source Code][40] + +#### Curtail – Image Compression App + +Need a quick image compression tool? Try Curtail. This GNOME app is another best tool to quickly reduce the size of your images with its simple UI. It supports WebP, PNG, JPG image types. Curtail can compress both lossless and lossy types with the option to remove metadata. + +![Curtail][41] + +This is one of the must-have tools for your GNOME desktop. This is how to install. + +[Setup Flatpak][42] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). + +[Install Curtail][43] + +Additional information about Curtail + +* [Home Page][44] +* [Source Code][45] + +#### Fractal – Matrix Messaging Client for GNOME + +Fractal is a Matrix messaging client for your GNOME desktop. It is written in rust and provides all necessary features for your collaboration in the popular Matrix messaging platform. + +![Fractal - Another great GNOME Apps][46] + +This is how to install. + +[Setup Flatpak][47] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). + +[Install Fractal][48] + +Additional information about Fractal + +[Source Code][49] + +#### Telegrand – Telegram Client + +The final app in this list is Telegrand. This application is not stable at the moment and is under development. However, I feel it is worth mentioning here because of its potential. The Telegram messaging app has its own native desktop application. However, this GTK based Telegrand act perfectly for your desktop with its features. + +There is no installer available at the moment. But you can easily build it from the source via instructions present in [GitHub][50]. + +We hope to see this app become stable in near future and available in GNOME Desktop as well as in GNU/Linux Phones. + +### Closing Notes + +So, with these 10 apps, we conclude Part 3 of the great GNOME Apps series. We covered some unique and unknown applications in this article. I hope you can utilize some of these apps for your daily workflow. + +If you missed the other parts of the series, they are present in the below links. + +* [Part 1][51] +* [Part 2][52] +* [Part 4][53] +* [Part 5][54] + +Let me know your comments or suggestions about the apps, or, this series as a whole. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/01/best-gnome-apps-part-3/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/2021/12/best-gnome-apps-part-1/ +[2]: https://www.debugpoint.com/2021/12/best-gnome-apps-part-2/ +[3]: https://www.debugpoint.com/2022/02/best-gnome-apps-part-4/ +[4]: https://www.debugpoint.com/2022/03/best-gnome-apps-part-5/ +[5]: https://www.debugpoint.com/wp-content/uploads/2022/01/Sysprof-GNOME-Apps.jpg +[6]: https://gitlab.gnome.org/GNOME/sysprof#building-sysprof +[7]: https://blogs.gnome.org/chergert/2020/03/14/how-to-use-sysprof-to/ +[8]: https://apps.gnome.org/app/org.gnome.Sysprof3/ +[9]: http://www.sysprof.com/ +[10]: https://gitlab.gnome.org/GNOME/sysprof +[11]: https://www.debugpoint.com/wp-content/uploads/2022/01/Pika-Backup-App.jpg +[12]: https://flatpak.org/setup/ +[13]: https://dl.flathub.org/repo/appstream/org.gnome.World.PikaBackup.flatpakref +[14]: https://apps.gnome.org/app/org.gnome.World.PikaBackup/ +[15]: https://gitlab.gnome.org/World/pika-backup/ +[16]: https://www.debugpoint.com/wp-content/uploads/2022/01/Contrast-App.jpg +[17]: https://flatpak.org/setup/ +[18]: https://dl.flathub.org/repo/appstream/org.gnome.design.Contrast.flatpakref +[19]: https://gitlab.gnome.org/World/design/contrast +[20]: https://www.debugpoint.com/wp-content/uploads/2022/01/Decoder-App.jpg +[21]: https://flatpak.org/setup/ +[22]: https://www.debugpoint.com/Setup%20Flatpak%20for%20your%20Linux%20distribution.%20And%20then%20click%20on%20the%20below%20button%20to%20launch%20the%20native%20software%20manager%20to%20install%20(such%20as%20Software%20or%20Discover). +[23]: https://apps.gnome.org/app/com.belmoussaoui.Decoder/ +[24]: https://gitlab.gnome.org/World/decoder/ +[25]: https://www.debugpoint.com/wp-content/uploads/2022/01/Mahjongg-A-Classic-Game.jpg +[26]: https://flatpak.org/setup/ +[27]: https://dl.flathub.org/repo/appstream/org.gnome.Mahjongg.flatpakref +[28]: https://gitlab.gnome.org/GNOME/gnome-mahjongg/ +[29]: https://wiki.gnome.org/Apps/Mahjongg +[30]: https://help.gnome.org/users/gnome-mahjongg/stable/ +[31]: https://www.debugpoint.com/wp-content/uploads/2022/01/Authenticator-GNOME-App4.jpg +[32]: https://flatpak.org/setup/ +[33]: https://dl.flathub.org/repo/appstream/com.belmoussaoui.Authenticator.flatpakref +[34]: https://apps.gnome.org/app/com.belmoussaoui.Authenticator/ +[35]: https://gitlab.gnome.org/World/Authenticator +[36]: https://www.debugpoint.com/wp-content/uploads/2022/01/Drawing-GNOME-App2.png +[37]: https://flatpak.org/setup/ +[38]: https://dl.flathub.org/repo/appstream/com.github.maoschanz.drawing.flatpakref +[39]: https://maoschanz.github.io/drawing/ +[40]: https://github.com/maoschanz/drawing/ +[41]: https://www.debugpoint.com/wp-content/uploads/2022/01/Curtail.jpg +[42]: https://flatpak.org/setup/ +[43]: https://dl.flathub.org/repo/appstream/com.github.huluti.Curtail.flatpakref +[44]: https://apps.gnome.org/app/com.github.huluti.Curtail/ +[45]: https://github.com/Huluti/Curtail/ +[46]: https://www.debugpoint.com/wp-content/uploads/2022/01/Fractal-Matrix-Messaging-Client.jpg +[47]: https://flatpak.org/setup/ +[48]: https://dl.flathub.org/repo/appstream/org.gnome.Fractal.flatpakref +[49]: https://gitlab.gnome.org/GNOME/fractal +[50]: https://github.com/melix99/telegrand/ +[51]: https://www.debugpoint.com/2021/12/best-gnome-apps-part-1/ +[52]: https://www.debugpoint.com/2021/12/best-gnome-apps-part-2/ +[53]: https://www.debugpoint.com/2022/02/best-gnome-apps-part-4/ +[54]: https://www.debugpoint.com/2022/03/best-gnome-apps-part-5/ diff --git a/sources/tech/20220125 Creating and initializing lists in Java and Groovy.md b/sources/tech/20220125 Creating and initializing lists in Java and Groovy.md deleted file mode 100644 index 98e70c2377..0000000000 --- a/sources/tech/20220125 Creating and initializing lists in Java and Groovy.md +++ /dev/null @@ -1,189 +0,0 @@ -[#]: subject: "Creating and initializing lists in Java and Groovy" -[#]: via: "https://opensource.com/article/22/1/creating-lists-groovy-java" -[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Creating and initializing lists in Java and Groovy -====== -Create and initialize a list of integers, first in Java and then in -Groovy. -![Developing code.][1] - -I like the [Groovy programming language][2] a lot. I like it because, in the end, I like Java, even though Java sometimes feels clumsy. And because I like Java so much, I don't find many other JVM languages especially attractive. Kotlin, Scala, and Clojure, for example, don't feel much like Java, pursuing their own perspectives on what makes a good programming language. Groovy is different; in my view, Groovy is the perfect antidote to those situations when a programmer who likes Java just needs something a bit more flexible, compact, and sometimes even straightforward. - -A good example is the List data structure, which is used to hold an ordered list of numbers, strings, or objects, and allows the programmer to iterate through those items in an efficient fashion. Especially for people writing and maintaining scripts, "efficiency" is mostly about clear and brief expressions that don't require a bunch of ceremony that obscures the intent of the code. - -### Install Java and Groovy - -Groovy is based on Java and requires a Java installation as well. Both a recent and decent version of Java and Groovy might be in your Linux distribution's repositories. Otherwise, you can install Groovy by following [these instructions][3]. A nice alternative for Linux users is SDKMan, which can be used to get multiple versions of Java, Groovy, and many other related tools. For this article, I use SDK's releases of: - - * Java: version 11.0.12-open of OpenJDK 11 - * Groovy: version 3.0.8 - - - -### Back to the problem - -There have been various ways of instantiating and initializing lists in Java since they were first introduced (I think that was Java 1.5, but please don't quote me). Two current interesting ways involve two different libraries: **java.util.Arrays** and **java.util.List**. - -#### Use java.util.Arrays - -**java.util.Arrays** defines the static method **asList()**, which can be used to create a list that is backed by an array and is therefore also immutable, though its elements are mutable. Here it is in action: - - -``` - - -var a1 = [Arrays][4].asList(1,2,3,4,5,6,7,8,9,10); // immutable list of mutable elements - -[System][5].out.println("a1 = " + a1); -[System][5].out.println("a1 is an instance of " + a1.getClass()); - -// output is -// a1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] -// a1 is an instance of class java.util.Arrays$ArrayList - -a1.set(0,0); // succeeds -[System][5].out.println("a1 = " + a1); // output is -// a1 = [0, 2, 3, 4, 5, 6, 7, 8, 9, 10] - -a1.add(11); // fails producing -// Exception in thread "main" java.lang.UnsupportedOperationException -[System][5].out.println("a1 = " + a1); // not reached - -``` - -#### Use java.util.List - -**java.util.List** defines the static method **of().** This can be used to create an immutable list with elements that may or may not be immutable, depending on whether the items in the list of elements are immutable. Here is this version in action: - - -``` - - -var a2 = [List][6].of(1,2,3,4,5,6,7,8,9,10); - -[System][5].out.println("a2 = " + a2); -[System][5].out.println("a2 is an instance of " + a2.getClass()); - -// output is -// a2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] -// a2 is an instance of class java.util.ImmutableCollections$ListN - -a2.set(0,0); // fails producing -// Exception in thread "main" java.lang.UnsupportedOperationException -[System][5].out.println("a2 = " + a2); // not reached - -a2.add(11); // also fails for same reason if above two lines commented out -[System][5].out.println("a2 = " + a2); // not reached - -``` - -So, I can use either **Arrays.asList()** or **List.of()** if I want a list that can't be grown (or shrunk) and may or may not have alterable elements. - -If I want an initialized mutable list I would probably resort to using those immutable-ish lists as arguments to a list constructor, for example: - - -``` - - -var a1 = new ArrayList<Integer>([Arrays][4].asList(1,2,3,4,5,6,7,8,9,10)); - -[System][5].out.println("a1 = " + a1); -[System][5].out.println("a1 is an instance of " + a1.getClass()); - -// output is -// a1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] -// a1 is an instance of class java.util.ArrayList - -a1.set(0,0); -[System][5].out.println("a1 = " + a1); - -//output is -// a1 = [0, 2, 3, 4, 5, 6, 7, 8, 9, 10] - -a1.add(11); -[System][5].out.println("a1 = " + a1); - -// output is -// a1 = [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] - -``` - -Note that the **Arrays.AsList()** was used to initialize the new **ArrayList<Integer>()**, which created a mutable copy of the argument. - -Now maybe it's just me, but this seems like an awful lot of theory—needing to be situationally aware of the details of **java.util.Arrays** or **java.util.List**—just to create and initialize a mutable list of integers, though the actual statement used is not overly "ceremonial." Here it is again, just for reference: - - -``` -`var a1 = new ArrayList(Arrays.asList(1,2,3,4,5,6,7,8,9,10));` -``` - -### The Groovy approach - -Here is the Groovy version of the above: - - -``` - - -def a1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - -println "a1 = $a1" -println "a1 is an instance of ${a1.getClass()}" - -// output is -// a1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] -// a1 is an instance of class java.util.ArrayList - -a1[0] = 0 -println "a1 = $a1" - -// output is -// a1 = [0, 2, 3, 4, 5, 6, 7, 8, 9, 10] - -a1 << 11 -println "a1 = $a1" - -// output is -// a1 = [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] - -``` - -At a glance, Groovy uses the **def** keyword rather than **var**. I also know that I can create a list representation by putting a list of things—in this case, integers—between brackets. Moreover, the list instance so created is precisely what I want: a mutable instance of **ArrayList**. - -Now maybe it's just me, again, but the above seems to be a whole lot simpler—no remembering the semi-immutable results returned by **.of()** or **.asList()** and compensating for them. It's also nice that I can refer to a specific element of the list using the brackets with an index value between them, rather than the method call **set()**, and that the `<<` operator appends to the end of a list so that I don't have to use the method call **add()**. Also, did you notice the lack of semi-colons? Yep, in Groovy, they're optional. And finally, observe the use of string interpolation, with the **$variable** or **${expression}** inside a double-quoted string providing that capability. - -There’s more going on "under the covers" in the Groovy world. That definition is an example of dynamic typing (the default in Groovy) versus the static typing of Java. In the Groovy definition line, the type of **a1** is inferred at runtime from the type of the expression evaluated on the right-hand side. Now we all know that dynamic programming languages give us great power and that with great power comes many good opportunities to mess up. But for programmers who don't like dynamic typing, Groovy offers the option of static typing. - -### Groovy resources - -The Apache Groovy site I mentioned at the beginning has a lot of great documentation. Another excellent Groovy resource is [Mr. Haki][7]. And a really good reason to learn Groovy is to go on and learn [Grails][8], which is a wonderfully productive full-stack web framework built on top of excellent components like Hibernate, Spring Boot, and Micronaut. - -This article is dedicated to my very dear friend Anil Mukhi, who passed away on 3 January 2022. Thank you, Anil, for giving me the opportunity to learn so much about Groovy, Grails, and horse racing data. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/1/creating-lists-groovy-java - -作者:[Chris Hermansen][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/clhermansen -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_development_programming.png?itok=M_QDcgz5 (Developing code.) -[2]: http://www.groovy-lang.org/ -[3]: http://www.groovy-lang.org/install.html -[4]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+arrays -[5]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system -[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+list -[7]: https://www.mrhaki.com/ -[8]: https://grails.org/ diff --git a/sources/tech/20220128 Essential DNF Commands for Linux Users -With Examples.md b/sources/tech/20220128 Essential DNF Commands for Linux Users -With Examples.md index 5c96fc9a5a..ec683545ff 100644 --- a/sources/tech/20220128 Essential DNF Commands for Linux Users -With Examples.md +++ b/sources/tech/20220128 Essential DNF Commands for Linux Users -With Examples.md @@ -1,7 +1,7 @@ [#]: subject: "Essential DNF Commands for Linux Users [With Examples]" [#]: via: "https://www.debugpoint.com/2022/01/dnf-commands-examples/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" +[#]: collector: "lkxed" [#]: translator: " " [#]: reviewer: " " [#]: publisher: " " @@ -9,9 +9,9 @@ Essential DNF Commands for Linux Users [With Examples] ====== -WE GIVE YOU A QUICK REFERENCE OF ESSENTIAL DNF COMMANDS WITH EXAMPLES IN -THIS GUIDE. -### What is DNF ? +We give you a quick reference of essential dnf commands with examples in this guide. + +### What is DNF? DNF (Dandified Yum) is a package manager used in RPM based Linux systems (RHEL, [Fedora][1], etc.). It is a successor of Yum package manager (Yellowdog Update Modified). The DNF package manager is efficient on performance, memory consumption and dependency resolution issues. @@ -63,259 +63,205 @@ Now, let’s look at the above DNF commands with examples. This might be the rare scenario when DNF is not installed in an applicable Linux system. But if DNF is not installed in your RPM based distribution, you can use Yum to install DNF. ``` - yum install dnf - ``` -#### 1\. Check the version of DNF installed in your systems +#### 1. Check the version of DNF installed in your systems The following command shows the version included in your Linux system. ``` - dnf --version - ``` -#### 2\. Getting the help about DNF +#### 2. Getting the help about DNF You can easily get all the necessary DNF options and command line switches using the help option. ``` - dnf help - ``` For a specific help, say, about installation for example, you can pass the parameter as below to show that piece of help. ``` - dnf help search - ``` -#### 3\. List of Installed and Available Packages +#### 3. List of Installed and Available Packages The dnf list command gives you the list of installed and available packages. A little caution. This command may take some to execute, depending on your system state, and internet connection. Because it fetches the metadata from server. ``` - dnf list - ``` If you want a more specific list, you can use the available or installed switch to filter out the list. See below. ``` - dnf list available - ``` For installed list, use the below command. ``` - dnf list installed - ``` ![dnf installed packages][19] -#### 4\. Repository list using DNF +#### 4. Repository list using DNF There are times you want to see the list of enabled repositories in your Linux systems. With the dnf repolist command, you can achieve that. ``` - dnf repolist - ``` So, this command gives you all the enabled repo. If you want the disabled ones as well, try below command. ``` - dnf repolist all - ``` ![Repo list using DNF][20] -#### 5\. Display specific information about a package +#### 5. Display specific information about a package There are times when you need to find out details about a package. So, you can easily find that out using the below command. ``` - dnf info package_name - ``` ![Information about a specific package using DNF][21] -#### 6\. Search for any package and details about it +#### 6. Search for any package and details about it Use the following search command to find any package and their source. Replace package_name with your own. As you can see in this below example, it highlights the package and their source. It gives you the result in two sections – when name is exactly matched and also in summary/description. ``` - dnf search package_name - ``` ![Search for any package using DNF][22] -#### 7\. Find which package contains a package, value +#### 7. Find which package contains a package, value Sometimes, you require finding out which packages or sources contains a particular executable or package name. Then the dnf provides command helps. For example, you want to find out which sources contain ifconfig, then you can find it out like below example. This is one of the best feature of dnf while researching dependency problems. ``` - dnf provides package_name - ``` ![dnf provides command example][23] -#### 8\. Installing packages using DNF +#### 8. Installing packages using DNF Probably the most used command is dnf install which helps to install an application or package. The command is simple. ``` - dnf install package_name - ``` If you want to install from a specific repo, you can use the –enablerepo switch while issuing this command. ``` - dnf --enablerepo=epel install phpmyadmin - ``` -#### 9\. Installing a package that you downloaded manually +#### 9. Installing a package that you downloaded manually There are times, when you manually downloaded a .rpm package locally. And you want to install. You can install the same using localinstall command with .rpm file full qualified path. ``` - dnf localinstall your_package_name.rpm - ``` [][24] -SEE ALSO:   How to Switch Desktop Environment in Fedora - The above command should resolve all the dependencies while installing a target .rpm package. If not, one can issue the following command. ``` - dnf --nogpgcheck localinstall your_package_name.rpm - ``` Another way to install a local .rpm package is using the dnf install command. ``` - dnf install *.rpm - ``` -#### 10\. Reinstalling a package +#### 10. Reinstalling a package Reinstalling a package is simple using the reinstallation switch of DNF. ``` - dnf reinstall package_name - ``` -#### 11\. Update Check and Updating your system +#### 11. Update Check and Updating your system In an RPM based system (such as Fedora, Red Hat Linux, etc.), update is primarily handled by DNF package manager. The following four commands take care of various update scenarios, as explained below. The check-update option checks for all the update available for your system. This option also takes a package name in its parameter. However, if no package name is specified, then it checks for updates for all installed packages in your system. ``` - dnf check-update - ``` To list out all the updates in your Linux system, use the list option. ``` - dnf list updates - ``` And to install updates for your entire Linux system, issue the update option. ``` - dnf update - ``` You can also update a specific application or package by mentioning the package name as parameter to the update option. ``` - dnf update package_name - ``` -#### 12\. Downgrading a package +#### 12. Downgrading a package If you need to downgrade a package to its prior version, then you can use the downgrade option of DNF. Be very careful while issuing this command. This command erases the current version of a package and install the highest of all the prior lower version available. ``` - dnf downgrade package_name - ``` ![Downgrading a package using DNF][25] -#### 13\. Downgrade or upgrade all packages +#### 13. Downgrade or upgrade all packages The distro-sync command downgrade or upgrade all packages to the latest versions for your system enabled repos. ``` - dnf distro-sync - ``` -#### 14\. Uninstall a package +#### 14. Uninstall a package You can uninstall or remove any application or package using remove option of DNF. ``` - dnf remove application_name - ``` -#### 15\. Group operations using DNF +#### 15. Group operations using DNF One of the great feature of RPM based system is grouping of packages. A group is a collection of packages logically grouped together. It helps to install them all at one go by issuing a single command with group name. The grouplist command gives you the name of available groups. ``` - dnf grouplist - ``` ![DNF grouplist command][26] @@ -323,27 +269,21 @@ The grouplist command gives you the name of available groups. And to install a group with all packages of it, use groupinstall option with the group name. ``` - dnf groupinstall group_name - ``` Remove a group and all the packages using the groupremove option. ``` - dnf groupremove group_name - ``` -#### 16\. Clean up your system using DNF +#### 16. Clean up your system using DNF To remove all the temporary files for enabled repos in your system, use the clean option with all switch. ``` - dnf clean all - ``` If you want to remove a specific temporary file, use the various options as outlined below. @@ -351,61 +291,47 @@ If you want to remove a specific temporary file, use the various options as outl Removes cache files for repo metadata. ``` - dnf clean dbcache - ``` Remove the local cookie files that contains download time signature of the packages for each repo. ``` - dnf clean expire-cache - ``` Removes all the repo metadata. ``` - dnf clean metadata - ``` Removes any cached packages. ``` - dnf clean packages - ``` Over time, a system consumes many applications and packages installed by the user. The following autoremove option removes all the leaf packages that are installed as dependencies for any user installed applications but no longer needed. So, they can be safely removed to recover disk space. ``` - dnf autoremove - ``` ![Clean up your system using DNF][27] -#### 17\. Find out DNF command execution history +#### 17. Find out DNF command execution history If you want a list of all commands that has run using DNF since the beginning of a Linux system, then use the history option. This lists all the commands that issued until now. ``` - dnf history - ``` To view more details about a specific history, use the info option with the ID number, as shown in the above list. This is one of the amazing feature of DNF, where you can exactly find out what happened on that particular DNF command. It contains the start and end time, who ran it, what are the packages installed, updated, etc. ``` - dnf history info id_number - ``` ![DNF history command examples][28] @@ -418,12 +344,6 @@ Let me know whether this helps, or, any command you would like to add in this li _[Official DNF Command reference][29]_ -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][30], [Twitter][31], [YouTube][32], and [Facebook][33] and never miss an update! - -##### Also Read - -------------------------------------------------------------------------------- via: https://www.debugpoint.com/2022/01/dnf-commands-examples/ @@ -466,7 +386,3 @@ via: https://www.debugpoint.com/2022/01/dnf-commands-examples/ [27]: https://www.debugpoint.com/wp-content/uploads/2022/01/Clean-up-your-system-using-DNF-1024x216.jpg [28]: https://www.debugpoint.com/wp-content/uploads/2022/01/DNF-history-command-examples-1024x711.jpg [29]: https://dnf.readthedocs.io/en/latest/command_ref.html -[30]: https://t.me/debugpoint -[31]: https://twitter.com/DebugPoint -[32]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[33]: https://facebook.com/DebugPoint diff --git a/sources/tech/20220201 View your Linux server-s network connections with netstat.md b/sources/tech/20220201 View your Linux server-s network connections with netstat.md deleted file mode 100644 index dd88bea922..0000000000 --- a/sources/tech/20220201 View your Linux server-s network connections with netstat.md +++ /dev/null @@ -1,203 +0,0 @@ -[#]: subject: "View your Linux server's network connections with netstat" -[#]: via: "https://opensource.com/article/22/2/linux-network-security-netstat" -[#]: author: "Sahana Sreeram https://opensource.com/users/sahanasreeram01gmailcom" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -View your Linux server's network connections with netstat -====== -The netstat command provides important insight into your Linux server, -both for monitoring and network troubleshooting. -![A rack of servers, blue background][1] - -I shared some important first steps to help manage your personal Linux server in a [previous article][2]. I briefly mentioned monitoring network connections for listening ports, and I want to expand on this by using the `netstat` command for Linux systems. - -Service monitoring and port scanning are standard industry practices. There's very good software like [Prometheus][3] to help automate the process, and [SELinux][4] to help contextualize and protect system access. However, I believe that understanding how your server connects to other networks and devices is key to establishing a baseline of what's normal for your server, which helps you recognize abnormalities that may suggest a bug or intrusion. As a beginner, I've discovered that the `netstat` command provides important insight into my server, both for monitoring and network troubleshooting. - -Netstat and similar network monitoring tools, grouped together in the [net-tools package][5], display information about active network connections. Because services running on open ports are often vulnerable to exploitation, practicing regular network monitoring can help you detect suspicious activity early. - -### Install netstat - -Netstat is frequently pre-installed on Linux distributions. If netstat is not installed on your server, install it with your package manager. On a Debian-based system: - - -``` -`$ sudo apt-get install net-tools` -``` - -For Fedora-based systems: - - -``` -`$ dnf install net-tools` -``` - -### Use netstat - -On its own, the `netstat` command displays all established connections. You can use the `netstat` options above to specify the intended output further. For example, to show all listening and non-listening connections, use the `--all` (`-a` for short) option. This returns a lot of results, so in this example I pipe the output to `head` to display just the first 15 lines of output: - - -``` - - -$ netstat --all | head -n 15 -Active Internet connections (servers and established) -Proto Recv-Q Send-Q Local Address           Foreign Address         State       -tcp        0      0 *:27036                 *:*                     LISTEN       -tcp        0      0 localhost:27060         *:*                     LISTEN       -tcp        0      0 *:16001                 *:*                     LISTEN       -tcp        0      0 localhost:6463          *:*                     LISTEN       -tcp        0      0 *:ssh                   *:*                     LISTEN       -tcp        0      0 localhost:57343         *:*                     LISTEN       -tcp        0      0 *:ipp                   *:*                     LISTEN       -tcp        0      0 *:4713                  *:*                     LISTEN       -tcp        0      0 10.0.1.222:48388        syd15s17-in-f5.1e:https ESTABLISHED -tcp        0      0 10.0.1.222:48194        ec2-35-86-38-2.us:https ESTABLISHED -tcp        0      0 10.0.1.222:56075        103-10-125-164.va:27024 ESTABLISHED -tcp        0      0 10.0.1.222:46680        syd15s20-in-f10.1:https ESTABLISHED -tcp        0      0 10.0.1.222:52730        syd09s23-in-f3.1e:https ESTABLISHED - -``` - -To show only TCP ports, use the `--all` and `--tcp` options, or `-at` for short: - - -``` - - -$ netstat -at | head -n 5 -Active Internet connections (servers and established) -Proto Recv-Q Send-Q Local Address   Foreign Address  State       -tcp        0      0 *:27036         *:*              LISTEN       -tcp        0      0 localhost:27060 *:*              LISTEN       -tcp        0      0 *:16001         *:*              LISTEN - -``` - -To show only UDP ports, use the `--all` and `--udp` options, or `-au` for short: - - -``` - - -$ netstat -au | head -n 5 -Active Internet connections (servers and established) -Proto Recv-Q Send-Q Local Address     Foreign Address    State       -udp        0      0 *:27036           *:*                                 -udp        0      0 10.0.1.222:44741  224.0.0.56:46164   ESTABLISHED -udp        0      0 *:bootpc           - -``` - -The options for netstat are often intuitive. For example, to show all listening TCP and UDP ports with process ID (PID) and numerical address: - - -``` - - -$ sudo netstat --tcp --udp --listening --programs --numeric -Active Internet connections (only servers) -Proto Recv-Q Send-Q Local Address      Foreign Addr  State   PID/Program name     -tcp        0      0 0.0.0.0:111        0.0.0.0:*     LISTEN  1/systemd             -tcp        0      0 192.168.122.1:53   0.0.0.0:*     LISTEN  2500/dnsmasq         -tcp        0      0 0.0.0.0:22         0.0.0.0:*     LISTEN  1726/sshd             -tcp        0      0 127.0.0.1:631      0.0.0.0:*     LISTEN  1721/cupsd           -tcp        0      0 127.0.0.1:6010     0.0.0.0:*     LISTEN  4023/sshd: tux@   -tcp6       0      0 :::111             :::*          LISTEN  1/systemd             -tcp6       0      0 :::22              :::*          LISTEN  1726/sshd             -tcp6       0      0 ::1:631            :::*          LISTEN  1721/cupsd           -tcp6       0      0 ::1:6010           :::*          LISTEN  4023/sshd: tux@   -udp        0      0 0.0.0.0:40514      0.0.0.0:*             1499/avahi-daemon:   -udp        0      0 192.168.122.1:53   0.0.0.0:*             2500/dnsmasq         -udp        0      0 0.0.0.0:67         0.0.0.0:*             2500/dnsmasq         -udp        0      0 0.0.0.0:111        0.0.0.0:*             1/systemd             -udp        0      0 0.0.0.0:5353       0.0.0.0:*             1499/avahi-daemon:   -udp6       0      0 :::111             :::*                  1/systemd             -udp6       0      0 :::44235           :::*                  1499/avahi-daemon:   -udp6       0      0 :::5353            :::*                  1499/avahi-daemon: - -``` - -The short version of this common combination is `-tulpn`. - -To display information about a specific service, [filter with `grep`][6]: - - -``` - - -$ sudo netstat -anlp | grep cups -tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      1721/cupsd           tcp6       0      0 ::1:631                 :::*                    LISTEN      1721/cupsd -unix  2      [ ACC ]     STREAM     LISTENING     27251    1/systemd /var/run/cups/cups.sock -unix  2      [ ]         DGRAM                    59530    1721/cupsd -unix  3      [ ]         STREAM     CONNECTED     55196    1721/cupsd /var/run/cups/cups.sock - -``` - -### Next steps - -Once you've run the `netstat` command, you can take steps to secure your system by ensuring that only services that you actively use are listening on your network. - - 1. Recognize commonly exploited ports and services. As a general rule, close the ports you're not actually using. - 2. Be on the lookout for uncommon port numbers, and learn to recognize legitimate ports in use on your system. - 3. Pay close attention to SELinux errors. Sometimes all you need to do is update contexts to match a legitimate change you've made to your system, but read the errors to make sure that SELinux isn't alerting you of suspicious or malicious activity. - - - -If you find that a port is running a suspicious service, or you simply want to close a port that you no longer use, you can manually deny port access through firewall rules by following these steps: - -If you're using `firewall-cmd`, run these commands: - - -``` - - -$ sudo firewall-cmd –remove-port=<port number>/tcp -$ sudo firewall-cmd –runtime-to-permanent - -``` - -If you're using UFW, run the following command: - - -``` -`$ sudo ufw deny ` -``` - -Next, stop the service itself using `systemctl`: - - -``` -`$ systemctl stop ` -``` - -### Learn netstat - -Netstat is a useful tool to quickly collect information about your server's network connections. Regular network monitoring is important an important part of getting to know your system, and it helps you keep your system safe. To incorporate this step into your administrative routine, you can use network monitoring tools like netstat or ss, as well as open source port [scanners such as Nmap or sniffers like Wireshark][7], which allow for [scheduled tasks][8]. - -As servers house larger amounts of personal data, it's increasingly important to ensure the security of personal servers. By understanding how your server connects to the Internet, you can decrease your machine's vulnerability, while still benefiting from the growing connectivity of the digital age. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/2/linux-network-security-netstat - -作者:[Sahana Sreeram][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/sahanasreeram01gmailcom -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rack_server_sysadmin_cloud_520.png?itok=fGmwhf8I (A rack of servers, blue background) -[2]: https://opensource.com/article/21/4/securing-linux-servers -[3]: https://opensource.com/article/19/11/introduction-monitoring-prometheus -[4]: https://opensource.com/business/13/11/selinux-policy-guide -[5]: http://sourceforge.net/projects/net-tools/ -[6]: https://opensource.com/article/21/3/grep-cheat-sheet -[7]: https://redhat.com/sysadmin/troubleshoot-dhcp-nmap-tcpdump-and-wireshark -[8]: https://opensource.com/article/22/2/redhat.com/sysadmin/nmap-scripting-engine diff --git a/sources/tech/20220202 Read and Organize Markdown Files in Linux Terminal With Glow.md b/sources/tech/20220202 Read and Organize Markdown Files in Linux Terminal With Glow.md deleted file mode 100644 index 2f3ace7e51..0000000000 --- a/sources/tech/20220202 Read and Organize Markdown Files in Linux Terminal With Glow.md +++ /dev/null @@ -1,135 +0,0 @@ -[#]: subject: "Read and Organize Markdown Files in Linux Terminal With Glow" -[#]: via: "https://itsfoss.com/glow-cli-tool-markdown/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Read and Organize Markdown Files in Linux Terminal With Glow -====== - -_**Brief: Glow is a CLI tool that lets you render Markdown files in the Linux terminal. You can also organize Markdown files with it.**_ - -I love Markdown. I am not an expert Markdown user but I can surely write most of my articles in Markdown. - -If you are a regular at It’s FOSS, you might have come across [Markdown guides][1], editors and tools like Obsidian. I’ll add one more tool to this list. It’s called [Glow][2] and unlike previously covered applications, Glow enables you to read Markdown files in the terminal. - -Wait! Can you not read Markdown in the terminal using the regular [Linux commands to read text files][3] like cat, less or even editors like Vim? - -Yes, you can. But it will be the raw markdown file with all the codes displayed as it is, rather than showing a properly formatted text. - -![Glow renders the Markdown file][4] - -Do note that Glow is not an editor. You cannot use it to write in Markdown text. - -### Glow features Markdown lovers will love - -Glow can be used in two formats: [CLI and TUI][5]. - -Simply using Glow on a Markdown file will display the entire rendered content on the screen. - -``` - - glow markdown_file - -``` - -![Markdown display with Glow][6] - -That’s good but Glow can do even better. It has additional options that open up the TUI mode (terminal user interface) and allows you to do more with it. - -You can use the pager option to display the rendered text in pager mode (like how the less command shows the text without cluttering the screen). - -``` - - glow -p markdown_file - -``` - -In this pager view, you can use the **/ key and search** for a certain text the same way you do with the less command. You can press **q key to exit** the view. - -![Pager view similar to the less command][7] - -That’s not it. You can use the -a option and it will find all the Markdown files in the current directory and its subdirectories. - -``` - - glow -a - -``` - -You can use the arrow keys to scroll the files in the display. Up and down keys to move up and down, left and right arrow keys to move by pages. - -![With -a option, Glow finds and displays all Markdown files in current directory][8] - -You can see the help options displayed at the bottom. The find option in this view allows you to search files by name (not their content). - -![You can search files by their name][9] - -There are also tabs. You can move between the tabs using the tab key, of course. - -The stash tab works like a bookmark. You can create a stash/bookmark by pressing the s key while browsing files or while viewing their content. This bookmark will be visible only in the current directory. - -You can press x key to remove bookmark (not file) or even add a memo by pressing the m key. - -![You can bookmark files by stashing them with s key][10] - -The News tabs shows changelogs and other messages from the Glow developer(s). - -![The news tab shows messages from the developers][11] - -When you have found your desired file, you can view it by pressing enter. Since you are in the TUI mode, you get additional keyboard options here. The options can be displayed by pressing the ? key. - -![You can view keyboard shortcuts by pressing the ? key][12] - -### Installing Glow on Linux - -Glow is available for Linux and macOS. You can install it [using Homebrew on Linux][13] and macOS, however, I would advise using the Linux packages here. - -Glow is available in the repository of Void, Solus and Arch Linux. You can use their package managers to install it. - -On Arch-based distributions, use: - -``` - - sudo pacman -S glow - -``` - -For Ubuntu, Debian, Fedora and SUSE, there are .DEB and .RPM binaries available for various architectures and you may find that on its release page. - -[Download Glow for other Linux distros][14] - -### Conclusion - -Overall, Glow is a handy tool to beautifully view and organize Markdown files in the terminal. Like most other CLI tools, it is not for everyone. If you dwell in the terminal with a liking for Markdown files, you may give it a try. And when you do, please share your experience with it in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/glow-cli-tool-markdown/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/markdown-guide/ -[2]: https://github.com/charmbracelet/glow -[3]: https://linuxhandbook.com/view-file-linux/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/markdown-display-with-cat.png?resize=1572%2C962&ssl=1 -[5]: https://itsfoss.com/gui-cli-tui/ -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/markdown-display-with-glow.png?resize=800%2C490&ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/pager-view-with-glow.png?resize=800%2C451&ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/glow-collection.png?resize=800%2C451&ssl=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/find-files-in-glow.png?resize=800%2C451&ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/stash-feature-glow.png?resize=800%2C374&ssl=1 -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/glow-news-tab.png?resize=800%2C451&ssl=1 -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/display-help-in-file-view-in-glow.png?resize=800%2C490&ssl=1 -[13]: https://itsfoss.com/homebrew-linux/ -[14]: https://github.com/charmbracelet/glow/releases diff --git a/sources/tech/20220204 10 Necessary Apps to Improve Your GNOME Desktop Experience -Part 4.md b/sources/tech/20220204 10 Necessary Apps to Improve Your GNOME Desktop Experience [Part 4].md similarity index 54% rename from sources/tech/20220204 10 Necessary Apps to Improve Your GNOME Desktop Experience -Part 4.md rename to sources/tech/20220204 10 Necessary Apps to Improve Your GNOME Desktop Experience [Part 4].md index 1bfd8a058e..0a6793baaa 100644 --- a/sources/tech/20220204 10 Necessary Apps to Improve Your GNOME Desktop Experience -Part 4.md +++ b/sources/tech/20220204 10 Necessary Apps to Improve Your GNOME Desktop Experience [Part 4].md @@ -1,7 +1,7 @@ [#]: subject: "10 Necessary Apps to Improve Your GNOME Desktop Experience [Part 4]" [#]: via: "https://www.debugpoint.com/2022/02/best-gnome-apps-part-4/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" +[#]: collector: "lkxed" [#]: translator: " " [#]: reviewer: " " [#]: publisher: " " @@ -9,32 +9,29 @@ 10 Necessary Apps to Improve Your GNOME Desktop Experience [Part 4] ====== -WE GIVE YOU THE NEXT SET OF 10 GNOME APPS THAT WILL SUPERCHARGE YOUR -PRODUCTIVITY WHILE USING GNOME DESKTOP. +We give you the next set of 10 GNOME Apps that will supercharge your productivity while using GNOME Desktop. + At debugpoint.com, we highlight some unknown but useful GNOME apps over a five-part article series. The primary purpose of the series is to give these excellent little apps much-needed visibility via our readers. This helps the developer and the end-users due to increased usage of these necessary GNOME Apps and much-deserved attention. This post is Part 4 of the series. In this article, we will highlight ten necessary GNOME Apps. If you missed the last parts, you could read the other parts of this series via the below links. - * [Part 1][1] - * [Part 2][2] - * [Part 3][3] - - +* [Part 1][1] +* [Part 2][2] +* [Part 3][3] +* [Part 5][4] In this article, we covered the following list of great GNOME Apps. - * [Secrets – Password Manager][4] - * [Font Downloader][5] - * [Gaphor – UML Modeling Utility][6] - * [Hashbrown – Check Hash of your files][7] - * [Identity – Compare images and videos][8] - * [Khronos – Time Logging][9] - * [Markets – Watch Stock Markets][10] - * [Obfuscate – Redact Images][11] - * [Plots – Simple Graph Plotting][12] - * [squeekboard – On-screen keyboard for wayland][13] - - +* Secrets – Password Manager +* Font Downloader +* Gaphor – UML Modeling Utility +* Hashbrown – Check Hash of your files +* Identity – Compare images and videos +* Khronos – Time Logging +* Markets – Watch Stock Markets +* Obfuscate – Redact Images +* Plots – Simple Graph Plotting +* squeekboard – On-screen keyboard for wayland ### 10 Necessary GNOME Apps @@ -42,18 +39,18 @@ In this article, we covered the following list of great GNOME Apps. The first app that we highlight is a password manager called Secrets. This GNOME Circle app uses KeePass 0.4 format to store the password in its database. This app comes with a simple interface that gives you complete control of your password and managing them. Secret perfectly integrates with your GNOME desktop, which you can install. -![Secrets – GNOME App][14] +![Secrets][5] -You need to [Setup Flatpak][15] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). +**How to Install** -[Install Secrets][16] +You need to [Setup Flatpak][6] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). -s - - * [Home Page][17] - * [Source Code][18] +[Install Secrets][7] +**More Details about Secrets** +* [Home Page][8] +* [Source Code][9] #### Font Downloader @@ -61,36 +58,40 @@ Installing font via terminal for new users is a bit complicated process. The nex But this app takes care of all the hassles that an average faces. You can search fonts in Google Fonts directly from its UI and install it with just a click of a button. A perfect and necessary GNOME app for your desktop. -![Font Downloader – GNOME Apps][19] +![Font Downloader][10] Here’s how to install it. -You need to [Setup Flatpak][15] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). +**How to Install** -[Install Font Downloader][20] +You need to [Setup Flatpak][11] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - * [Home Page][21] - * [Source Code][22] +[Install Font Downloader][12] +**More details about Font Downloader** +* [Home Page][13] +* [Source Code][14] #### Gaphor – UML Modeling Utility -Out of all the GNOME apps we have covered so far, this one is one of the best apps. Named Gaphor, this application helps you design complex systems via Unified Modelling Language. It currently supports UML, SysML, RAAML and C4 languages and is fully compliant with the [UML 2 data model][23]. +Out of all the GNOME apps we have covered so far, this one is one of the best apps. Named Gaphor, this application helps you design complex systems via Unified Modelling Language. It currently supports UML, SysML, RAAML and C4 languages and is fully compliant with the [UML 2 data model][15]. It is a perfect GNOME app for students or system design professionals. -![Gaphor – GNOME Apps][24] +![Gaphor][16] -You need to [Setup Flatpak][15] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). +**How to Install** -[Install Gaphor][25] +You need to [Setup Flatpak][17] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - * [Home Page][26] - * [Home Page (official)][27] - * [Source Code][28] +[Install Gaphor][18] +**More details about Gaphor** +* [Home Page][19] +* [Home Page (official)][20] +* [Source Code][21] #### Hashbrown – Check Hash of your files @@ -100,36 +101,36 @@ So, a hash is a way to verify whether your downloaded file is original or not. I This GNOME App – Hashbrown, does that job for you. Its unique and straightforward UI helps you to compare several hash types of a file. This app currently supports MD5, SHA-256, SHA-512 and SHA-1 hashes. A perfect and necessary utility for your GNOME desktop. -![Hashbrown – GNOME App][29] +![Hashbrown][22] -You need to [Setup Flatpak][15] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). +**How to Install** -[Install Hashbrown][30] +You need to [Setup Flatpak][23] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - * [Official Home Page][31] _(Fun fact: You will be amazed if you open this site. Check out by yourself!)_ - * [Home Page][32] - * [Source Code][33] +[Install Hashbrown][24] +**More details about Hashbrown** +* [Official Home Page][25] (Fun fact: You will be amazed if you open this site. Check out by yourself!) +* [Home Page][26] +* [Source Code][27] #### Identity – Compare images and videos If you need to compare multiple images or video files, you should use Identity. This GNOME app compares and gives you information about the target files. Powered by GStreamer, Identity also comes with the command line utility to compare the files. -![Identity][34] +![Identity][28] -You need to [Setup Flatpak][15] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). +**How to install** -[Install Identity][35] +You need to [Setup Flatpak][29] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - * [Home Page][36] - * [Source Code][37] +[Install Identity][30] +**More details about Identity** - -[][2] - -SEE ALSO:   10 Perfect Apps to Improve Your GNOME Experience [Part 2] +* [Home Page][31] +* [Source Code][32] #### Khronos – Time Logging @@ -137,16 +138,18 @@ If you ever need an on-demand timer that keeps track of time while you complete It is a friendly GNOME app for those who need it. -![Khronos – GNOME App][38] +![Khronos - GNOME App][33] -You need to [Setup Flatpak][15] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). +**How to Install** -[Install Khronos][39] +You need to [Setup Flatpak][34] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - * [Home Page][40] - * [Source Code][41] +[Install Khronos][35] +**More details about Khronos** +* [Home Page][36] +* [Source Code][37] #### Markets – Watch Stock Markets @@ -154,25 +157,25 @@ I am sure you keep track of your favourite stocks or overall investment portfoli Markets is a GNOME Circle app, and it brings a list of cool features to track stocks and helps you stay in profits. Features such as – - * Individual Stock tracking - * Create your portfolio - * Track Cryptocurrencies, commodities - * Details via Yahoo! finance - * Supported in Linux-based smartphones (Librem5, PinePhone) - * Adjust refresh rate and Dark Mode Support +* Individual Stock tracking +* Create your portfolio +* Track Cryptocurrencies, commodities +* Details via Yahoo! finance +* Supported in Linux-based smartphones (Librem5, PinePhone) +* Adjust refresh rate and Dark Mode Support +![Markets - A Necessary GNOME Apps][38] +**How to Install** -![Markets – A Necessary GNOME App][42] +You need to [Setup Flatpak][39] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). -You need to [Setup Flatpak][15] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - -[Install Markets][43] - - * [Home page][44] - * [Source code][45] +[Install Markets][40] +**More details about Markets** +* [Home page][41] +* [Source code][42] #### Obfuscate – Redact Images @@ -180,16 +183,18 @@ We often need to gray out or remove certain sensitive sections of any image for If you think that is too much work, try Obfuscate native app for GNOME. This GNOME Circle app helps you redact custom sections from any image and export them. This app supports all major image types. However, you can do these using LibreOffice, which requires inserting an image to the Writer document and whatnot. Try it out. -![Obfuscate – GNOME App][46] +![Obfuscate - A Necessary GNOME Apps][43] -You need to [Setup Flatpak][15] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). +**How to Install** -[Install Obfuscate][47] +You need to [Setup Flatpak][44] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - * [Home page][48] - * [Source code][49] +[Install Obfuscate][45] +**More details about Obfuscate** +* [Home page][46] +* [Source code][47] #### Plots – Simple Graph Plotting @@ -197,114 +202,107 @@ If you need a quick tool to visualize those complex math formulae in nice graphs Here are some of its unique features: - * Support for trigonometric, hyperbolic, exponential and logarithmic functions, as well as arbitrary sums and products - * Ability to utilize your system hardware with the support of OpenGL - * Color Support for graphs -Easy customization of graphs with the value bar which you can increase or decrease interactively to see the graphs +* Support for trigonometric, hyperbolic, exponential and logarithmic functions, as well as arbitrary sums and products +* Ability to utilize your system hardware with the support of OpenGL +* Color Support for graphsEasy customization of graphs with the value bar which you can increase or decrease interactively to see the graphs +![Plots][48] +**How to Install** -![Plots][50] +You need to [Setup Flatpak][49] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). -You need to [Setup Flatpak][15] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - -[Install Plots][51] - - * [Home page][52] - * [Source code][53] +[Install Plots][50] +**More Details about Plots** +* [Home page][51] +* [Source code][52] #### squeekboard – On-screen keyboard for wayland The final app in this post is for only Linux mobile phones. I thought it was worth mentioning this app because of Wayland. The squeekboard is an on-screen keyboard designed for Librem5 Linux Smartphones for Wayland compositor. This GTK and Rust based application is currently under development, but most of the essential features are already implemented. -You can learn more about it in [GitLab][54]. I couldn’t find a screenshot to share with you. However, if you are interested, try it out. +You can learn more about it in [GitLab][53]. I couldn’t find a screenshot to share with you. However, if you are interested, try it out. ### Closing Notes I hope some of these necessary GNOME apps you found helpful for your daily workflow. I am sure they did. With that said, we are wrapping up Part 4 of the series. If you would like to read the other parts, you can go over them via the links below. -[Part 1][1] -[Part 2][2] -[Part 3][3] +* [Part 1][54] +* [Part 2][55] +* [Part 3][56] +* [Part 5][57] And do let me know your thoughts about this article or this series as a whole. Cheers. -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][55], [Twitter][56], [YouTube][57], and [Facebook][58] and never miss an update! - -##### Also Read - -------------------------------------------------------------------------------- via: https://www.debugpoint.com/2022/02/best-gnome-apps-part-4/ 作者:[Arindam][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 +[b]: https://github.com/lkxed [1]: https://www.debugpoint.com/2021/12/best-gnome-apps-part-1/ [2]: https://www.debugpoint.com/2021/12/best-gnome-apps-part-2/ [3]: https://www.debugpoint.com/2022/01/best-gnome-apps-part-3/ -[4]: tmp.UAQ8Cc4ZnO#secrets-password-manager -[5]: tmp.UAQ8Cc4ZnO#font-downloader -[6]: tmp.UAQ8Cc4ZnO#gaphor-uml-modeling-utility -[7]: tmp.UAQ8Cc4ZnO#hashbrown-check-hash-of-your-files -[8]: tmp.UAQ8Cc4ZnO#identity-compare-images-and-videos -[9]: tmp.UAQ8Cc4ZnO#khronos-time-logging -[10]: tmp.UAQ8Cc4ZnO#markets-watch-stock-markets -[11]: tmp.UAQ8Cc4ZnO#obfuscate-redact-images -[12]: tmp.UAQ8Cc4ZnO#plots-simple-graph-plotting -[13]: tmp.UAQ8Cc4ZnO#squeekboard-on-screen-keyboard-for-wayland -[14]: https://www.debugpoint.com/wp-content/uploads/2022/02/Secrets-GNOME-App.jpg -[15]: https://flatpak.org/setup/ -[16]: https://flathub.org/apps/details/org.gnome.World.Secrets -[17]: https://apps.gnome.org/app/org.gnome.World.Secrets/ -[18]: https://gitlab.gnome.org/World/secrets -[19]: https://www.debugpoint.com/wp-content/uploads/2022/02/Font-Downloader-GNOME-Apps.jpg -[20]: https://dl.flathub.org/repo/appstream/org.gustavoperedo.FontDownloader.flatpakref -[21]: https://apps.gnome.org/app/org.gustavoperedo.FontDownloader/ -[22]: https://github.com/GustavoPeredo/font-downloader -[23]: https://en.wikipedia.org/wiki/Unified_Modeling_Language#UML_2 -[24]: https://www.debugpoint.com/wp-content/uploads/2022/02/Gaphor-GNOME-Apps.jpg -[25]: https://dl.flathub.org/repo/appstream/org.gaphor.Gaphor.flatpakref -[26]: https://apps.gnome.org/app/org.gaphor.Gaphor/ -[27]: https://gaphor.org/ -[28]: https://github.com/gaphor/gaphor -[29]: https://www.debugpoint.com/wp-content/uploads/2022/02/Hashbrown-GNOME-App.jpg -[30]: https://dl.flathub.org/repo/appstream/dev.geopjr.Hashbrown.flatpakref -[31]: https://hashbrown.geopjr.dev/ -[32]: https://apps.gnome.org/app/dev.geopjr.Hashbrown/ -[33]: https://github.com/GeopJr/Hashbrown -[34]: https://www.debugpoint.com/wp-content/uploads/2022/02/Identity.jpg -[35]: https://dl.flathub.org/repo/appstream/org.gnome.gitlab.YaLTeR.Identity.flatpakref -[36]: https://apps.gnome.org/app/org.gnome.gitlab.YaLTeR.Identity/ -[37]: https://gitlab.gnome.org/YaLTeR/identity -[38]: https://www.debugpoint.com/wp-content/uploads/2022/02/Khronos-GNOME-App.jpg -[39]: https://dl.flathub.org/repo/appstream/io.github.lainsce.Khronos.flatpakref -[40]: https://apps.gnome.org/app/io.github.lainsce.Khronos/ -[41]: https://github.com/lainsce/khronos -[42]: https://www.debugpoint.com/wp-content/uploads/2022/02/Markets-A-Necessary-GNOME-App.jpg -[43]: https://dl.flathub.org/repo/appstream/com.bitstower.Markets.flatpakref -[44]: https://apps.gnome.org/app/com.bitstower.Markets/ -[45]: https://github.com/bitstower/markets -[46]: https://www.debugpoint.com/wp-content/uploads/2022/02/Obfuscate-GNOME-App.jpg -[47]: https://dl.flathub.org/repo/appstream/com.belmoussaoui.Obfuscate.flatpakref -[48]: https://apps.gnome.org/app/com.belmoussaoui.Obfuscate/ -[49]: https://gitlab.gnome.org/World/obfuscate/ -[50]: https://www.debugpoint.com/wp-content/uploads/2022/02/Plots-GNOME-App.jpg -[51]: https://dl.flathub.org/repo/appstream/com.github.alexhuntley.Plots.flatpakref -[52]: https://apps.gnome.org/app/com.github.alexhuntley.Plots/ -[53]: https://github.com/alexhuntley/Plots -[54]: https://gitlab.gnome.org/World/Phosh/squeekboard -[55]: https://t.me/debugpoint -[56]: https://twitter.com/DebugPoint -[57]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[58]: https://facebook.com/DebugPoint +[4]: https://www.debugpoint.com/2022/03/best-gnome-apps-part-5/ +[5]: https://www.debugpoint.com/wp-content/uploads/2022/02/Secrets-GNOME-App.jpg +[6]: https://flatpak.org/setup/ +[7]: https://flathub.org/apps/details/org.gnome.World.Secrets +[8]: https://apps.gnome.org/app/org.gnome.World.Secrets/ +[9]: https://gitlab.gnome.org/World/secrets +[10]: https://www.debugpoint.com/wp-content/uploads/2022/02/Font-Downloader-GNOME-Apps.jpg +[11]: https://flatpak.org/setup/ +[12]: https://dl.flathub.org/repo/appstream/org.gustavoperedo.FontDownloader.flatpakref +[13]: https://apps.gnome.org/app/org.gustavoperedo.FontDownloader/ +[14]: https://github.com/GustavoPeredo/font-downloader +[15]: https://en.wikipedia.org/wiki/Unified_Modeling_Language#UML_2 +[16]: https://www.debugpoint.com/wp-content/uploads/2022/02/Gaphor-GNOME-Apps.jpg +[17]: https://flatpak.org/setup/ +[18]: https://dl.flathub.org/repo/appstream/org.gaphor.Gaphor.flatpakref +[19]: https://apps.gnome.org/app/org.gaphor.Gaphor/ +[20]: https://gaphor.org/ +[21]: https://github.com/gaphor/gaphor +[22]: https://www.debugpoint.com/wp-content/uploads/2022/02/Hashbrown-GNOME-App.jpg +[23]: https://flatpak.org/setup/ +[24]: https://dl.flathub.org/repo/appstream/dev.geopjr.Hashbrown.flatpakref +[25]: https://hashbrown.geopjr.dev/ +[26]: https://apps.gnome.org/app/dev.geopjr.Hashbrown/ +[27]: https://github.com/GeopJr/Hashbrown +[28]: https://www.debugpoint.com/wp-content/uploads/2022/02/Identity.jpg +[29]: https://flatpak.org/setup/ +[30]: https://dl.flathub.org/repo/appstream/org.gnome.gitlab.YaLTeR.Identity.flatpakref +[31]: https://apps.gnome.org/app/org.gnome.gitlab.YaLTeR.Identity/ +[32]: https://gitlab.gnome.org/YaLTeR/identity +[33]: https://www.debugpoint.com/wp-content/uploads/2022/02/Khronos-GNOME-App.jpg +[34]: https://flatpak.org/setup/ +[35]: https://dl.flathub.org/repo/appstream/io.github.lainsce.Khronos.flatpakref +[36]: https://apps.gnome.org/app/io.github.lainsce.Khronos/ +[37]: https://github.com/lainsce/khronos +[38]: https://www.debugpoint.com/wp-content/uploads/2022/02/Markets-A-Necessary-GNOME-App.jpg +[39]: https://flatpak.org/setup/ +[40]: https://dl.flathub.org/repo/appstream/com.bitstower.Markets.flatpakref +[41]: https://apps.gnome.org/app/com.bitstower.Markets/ +[42]: https://github.com/bitstower/markets +[43]: https://www.debugpoint.com/wp-content/uploads/2022/02/Obfuscate-GNOME-App.jpg +[44]: https://flatpak.org/setup/ +[45]: https://dl.flathub.org/repo/appstream/com.belmoussaoui.Obfuscate.flatpakref +[46]: https://apps.gnome.org/app/com.belmoussaoui.Obfuscate/ +[47]: https://gitlab.gnome.org/World/obfuscate/ +[48]: https://www.debugpoint.com/wp-content/uploads/2022/02/Plots-GNOME-App.jpg +[49]: https://flatpak.org/setup/ +[50]: https://dl.flathub.org/repo/appstream/com.github.alexhuntley.Plots.flatpakref +[51]: https://apps.gnome.org/app/com.github.alexhuntley.Plots/ +[52]: https://github.com/alexhuntley/Plots +[53]: https://www.debugpoint.com//gitlab.gnome.org/World/Phosh/squeekboard +[54]: https://www.debugpoint.com/2021/12/best-gnome-apps-part-1/ +[55]: https://www.debugpoint.com/2021/12/best-gnome-apps-part-2/ +[56]: https://www.debugpoint.com/2022/01/best-gnome-apps-part-3/ +[57]: https://www.debugpoint.com/2022/03/best-gnome-apps-part-5/ diff --git a/sources/tech/20220209 Give Your Linux Mint and Xubuntu a Visual Uplift Using Twister UI.md b/sources/tech/20220209 Give Your Linux Mint and Xubuntu a Visual Uplift Using Twister UI.md deleted file mode 100644 index d0ad8493a6..0000000000 --- a/sources/tech/20220209 Give Your Linux Mint and Xubuntu a Visual Uplift Using Twister UI.md +++ /dev/null @@ -1,167 +0,0 @@ -[#]: subject: "Give Your Linux Mint and Xubuntu a Visual Uplift Using Twister UI" -[#]: via: "https://www.debugpoint.com/2022/02/twister-ui-2022/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Give Your Linux Mint and Xubuntu a Visual Uplift Using Twister UI -====== -TWISTER UI IS THE EASIEST WAY TO GIVE YOUR LINUX MINT AND XUBUNTU A -VISUAL UPLIFT USING PRE-LOADED THEMES. HERE’S HOW. -[Twister UI][1] is an add-on to your existing Linux Mint and Xubuntu installation. The Pi Labs created this UI, who made the [Twister OS][2] for Raspberry Pi and related hardware. - -### Twister UI - -The Twister UI is a collection of packages for [Linux Mint][3], and Xubuntu brings several popular OS-specific themes and configurations out of the box. You can apply them with just a click of a button. You do not need to download separate icons, themes or cursors. - -The latest release gives out-of-box desktop theme, icons, sound, and other settings changes for the below OS types. - - * Native Twister OS Theme - * Windows 98, Windows 7, Windows XP - * Windows 11, Windows 10 - * iTwister and iTwister Sur (for macOS) - - - -#### How does it work? - -The team prepared automated scripts that download all popular OS-specific themes, sounds, etc., from GitHub. Then the script modifies them, download additional packages from the Ubuntu repository and installs this add-on as a whole. The installer takes care of installing everything by itself, and all you need to do is wait. - -Before we explain to you how to install it, let’s look at some of the screenshots and features of this OS mod. These screenshots are from the Linux Mint Xfce edition with this OS mod applied. - -#### How it looks (screenshots) - -![Twister UI – macOS Theme][4] - -![Twister UI – Windows XP Theme][5] - -![native Twister OS theme][6] - -#### Contents of the Twister UI Package - -The package brings its own settings app called ThemeTwister. You can use this to switch themes quickly. You can change as many times you want between them. Nothing breaks. - -The project also installs some good open-source packages by default. It installs Lutris, Steam gaming platforms to help you quickly play games. It also installs Discord, Wine emulator for the users. - -As you can see, the team carefully thought of which packages to install, considering the user base of this add-on. - -### How to Install - -If you plan to install this, I recommend using this package in Linux Mint Xfce edition and Xubuntu. Do not try to install it in other Linux distributions _(I tried before reading the documentation, I messed up my Fedora install, so don’t try it in other distributions)_. - -The requirement is a Linux Mint Xfce or Xubuntu installation (wither 32-bit 64-bit). It also requires around 5 GB of disk space. - -First, download the package from the below link, which contains the Torrent link. It is not an ISO file. It consists of three files, one of which is the actual script. - -[Download Twister UI][1] - -Once downloaded, open the downloaded folder, and you should see a file with extension .run (as below). - -![Give the execute permission to the run file][7] - -Change the permission of the file to make it executable. Then run it via the terminal. - -The script requires an admin password, so provide that once asked. Before you start the installation, make sure that you have a stable internet connection to download additional packages on the fly. - -![Starting the installation script][8] - -The download and installation take some time. Depending on your internet speed, it might take around 15 to 20 minutes. - -[][9] - -SEE ALSO:   Zorin OS 16 Lite Review - Perfect Combination of Beauty, Performance and Simplicity - -You should know that the installer will replace the default Plymouth and . - -Once installation completes, the script should prompt you to reboot. - -After reboot, log in to your Linux Mint Xfce or Xubuntu system. - -### How to Change Themes - -If you are using the Linux Mint Xfce edition, you need to make the following additional changes for the best results before changing the theme: - - * Open Application Menu > Settings > Desktop, under the Icons tab, uncheck the Use custom font size. - * Open Application Menu > Settings > Window Manager tweaks, under the Compositor tab, uncheck Show shadows under dock windows. - - - -You should now see a “ThemeTwister” icon on the desktop and open the application. This application gives you options to change themes, as shown below. - -![Changing theme using ThemeTwister tool][10] - -Select a theme and click on the respective button. Each time you change or apply a piece, the script asks you to log off. So make sure you close all your programs before changing the theme. - -### How to Uninstall - -If you are done and want to uninstall, then open a terminal and run the following shell script. - -``` - - sh /usr/share/ThemeSwitcher/uninstall.sh - -``` - -The above script only uninstalls Twister UI components and doesn’t uninstall Steam, Lutris etc. So if you want to uninstall, use the Software manager to uninstall them. - -It would be best if you did a reboot after uninstallation. - -### Review and Performance - -As per the Pi Labs documentation, the customizations should not consume much additional memory. And it is true. - -The customization is not impacting much on the desktop performance. When I ran one or two of the customization in Linux Mint Xfce edition in idle mode, it consumed around 740 MB of memory with CPU around 2% to 3%. This itself is impressive. The only cost of using this is the additional disk space. - -![Resource Usage in Linux Mint with Twister UI][11] - -The theme switcher is excellent and flawlessly changes the theme without surprises or errors. - -In general, the entire process is error-free and went well as per its design. - -### Closing Notes - -After downloading individual themes icons and changing settings, you can manually configure your Linux distribution to look like Windows or macOS. That takes a lot of time and is sometimes difficult for new users. With that in mind, I think this new approach is a time saver and very easy for everyone. You can get all the required mods with just a click of a button. - -There will always be an argument about why a Linux need to look like Windows or macOS. But older folks may not be familiar with computers much and remember the Windows colours and icons. They can adapt Linux using this simple modification without any hassles. - -Overall, it’s an excellent project from the Pi Labs and helps many users worldwide. - -So, what do you think about this project? Let me know in the comment box below. - -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][12], [Twitter][13], [YouTube][14], and [Facebook][15] and never miss an update! - -##### Also Read - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2022/02/twister-ui-2022/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://twisteros.com/twisterui.html -[2]: https://twisteros.com -[3]: https://www.debugpoint.com/2021/11/linux-mint-20-3-new-app/ -[4]: https://www.debugpoint.com/wp-content/uploads/2022/02/Twister-UI-macOS-Theme-1024x576.jpg -[5]: https://www.debugpoint.com/wp-content/uploads/2022/02/Twister-UI-Windows-XP-Theme-1024x574.jpg -[6]: https://www.debugpoint.com/wp-content/uploads/2022/02/native-Twister-OS-theme-1024x581.jpg -[7]: https://www.debugpoint.com/wp-content/uploads/2022/02/Give-the-execute-permission-to-the-run-file-1024x521.jpg -[8]: https://www.debugpoint.com/wp-content/uploads/2022/02/Starting-the-installation-script.jpg -[9]: https://www.debugpoint.com/2021/12/zorin-os-16-lite-review-xfce/ -[10]: https://www.debugpoint.com/wp-content/uploads/2022/02/Changing-theme-using-ThemeTwister-tool.jpg -[11]: https://www.debugpoint.com/wp-content/uploads/2022/02/Resource-Usage-in-Linux-Mint-with-Twister-UI-1024x579.jpg -[12]: https://t.me/debugpoint -[13]: https://twitter.com/DebugPoint -[14]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[15]: https://facebook.com/DebugPoint diff --git a/sources/tech/20220214 A guide to Kubernetes architecture.md b/sources/tech/20220214 A guide to Kubernetes architecture.md index 2f3ce6fc63..f334912823 100644 --- a/sources/tech/20220214 A guide to Kubernetes architecture.md +++ b/sources/tech/20220214 A guide to Kubernetes architecture.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/22/2/kubernetes-architecture" [#]: author: "Nived Velayudhan https://opensource.com/users/nivedv" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "MjSeven" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " diff --git a/sources/tech/20220214 How I configure Vim as my default editor on Linux.md b/sources/tech/20220214 How I configure Vim as my default editor on Linux.md deleted file mode 100644 index a6b8764302..0000000000 --- a/sources/tech/20220214 How I configure Vim as my default editor on Linux.md +++ /dev/null @@ -1,111 +0,0 @@ -[#]: subject: "How I configure Vim as my default editor on Linux" -[#]: via: "https://opensource.com/article/22/2/configure-vim-default-editor" -[#]: author: "David Both https://opensource.com/users/dboth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How I configure Vim as my default editor on Linux -====== -Vim is my favorite editor. These changes to my system make Vim available -as the default in programs that use a different editor by default. -![Person using a laptop][1] - -I have used Linux for about 25 years and Unix for a few years before that. During that time, I have developed preferences for some tools that I use daily. One of the most important tools I use is the Vim editor. - -I started using Vi when I learned Solaris in the early ‘90s because I was told that it would always be available on any system, which is true in my experience. I have tried other editors, and they all do the job. However, I find that Vim works best for me, and I use it so much that my Vim muscle memory causes me to attempt to use its command keystrokes even with other editors. - -Plus, I just really like Vim. - -Many configuration files use Vi instead of Vim, and you can run the `vi` command. However, the `vi` command is a link to `vim`. - -Many Linux tools use editors that emulate or just call [Nano][2], [Emacs][3], or Vim. Some other tools allow users—like those with clear preferences—to link to their favorite editor. The two examples that affected me the most were Bash command-line editing, which defaults to Emacs, and the Alpine text-mode email client, which defaults to the Pico editor. In fact, the Pico editor was written explicitly for use in the Pine email client, which is the predecessor to Alpine. - -Not all programs that use external editors are configurable. Some use only the editor specified by the developer. For those applications that are configurable, there are different methods for selecting your preferred editor. - -### Linux command-line editing - -Besides actually editing text files, the other tool I use that requires the most editing is the Bash shell. The default Bash editor is Emacs. Although I have used Emacs, I definitely prefer Vim. So many years ago, I switched the default editing style for Bash command-line editing from Emacs to Vim, which is much more comfortable for me. - -There are a couple of ways to configure Bash. You can use a local configuration file, such as `/home/yourhomedirectory/.bashrc`, which only changes the default for your user account and not for other users on the same system. I prefer to make these types of changes global, which basically means my personal account and root. In this second case, you can create your own configuration file and place it in the `/etc/profile.d` directory. - -I added a file named `myBashConfig.sh` to `/etc/profile.d`. There are files for all the installed shells in the `/etc/profile.d` directory. During the launch of a terminal session, each shell reads only the files intended for it based on the file name extensions. For example, the Bash shell only reads the files with a `.sh` extension. - - -``` - - -<SNIP> -alias vim='vim -c "colorscheme desert" ' -# Set vi for bash editing mode -set -o vi -# Set vi as the default editor for all apps that check this -EDITOR=vi -<SNIP> - -``` - -The line **set -o vi** in this global Bash configuration file segment sets Vi as the default editor. The **-o** option on this **set** command defines vi as the editor. You need to close any running Bash sessions and open new ones for this to take effect. - -At this point, you can now use all of your familiar Vim editing commands, including cursor movement. Just press the **Escape** key to enter Vim editing mode. I especially like the ability to use **b** multiple times to move the cursor back multiple words. - -### Set Vim as the default for other programs - -Some Linux command-line tools and programs check the **$EDITOR** environment variable to determine which editor to use. You can check the current value of this variable for yourself using the following command. I did this on one of my newly installed virtual machines to verify what the default actually is. - - -``` - - -# echo $EDITOR -/usr/bin/nano -# - -``` - -By default, Fedora programs that check the **$EDITOR** environment variable will use the Nano editor. Adding the line **EDITOR=vi** as shown in the snippet above to `myBashConfig.sh` changes the default to the Vi (Vim) editor. Not all command-line programs that use an external editor check this environment variable. - -### Edit email in Alpine - -A few weeks ago, I decided that Pico was just not working well for me as my email editor. I could make it work and did for some time after switching to [Alpine][4] from Thunderbird. I found that Pico was getting in my way when I tried to use Vim key sequences, impacting my productivity. - -I read in the Alpine Help that it is possible to change the default editor. I decided to change it to Vim. This is actually very easy to do. - -On the Alpine main menu, press the **S** key to enter setup and then **C** for configuration. In the _Composer Preferences_ section, select the _Enable Alternate Editor Command_ and _Enable Alternate Editor Implicitly_ items with an **X**. Several pages down in the _Advanced User Preferences_ section, find the **Editor** line. It should look like this if it has not already been changed. - - -``` -`Editor    = ` -``` - -Highlight this **Editor** line with the cursor bar, and press **Enter** to edit the line. Change **<No Value Set>** to **vim**, press **Enter**, and then press the **E** key to exit and **Y** to save the changes you have made. - -To edit an email message using Vim, just enter the email body, and Vim starts automatically, just like Pico does. All of my favorite editing capabilities are there because it is actually using Vim. Even the **Esc :wq** sequence to exit Vim is the same. - -### Final thoughts - -I much prefer Vim to other editors, and these changes to my system make it available as the default in programs that use a different editor by default. Some programs use the **$EDITOR** environment variable, so you only need to make that change once. Other programs like Alpine have user configuration options that you must set individually for each program. - -This ability to select your preferred external editor is quite in line with the Unix Philosophy tenet, “Each program should do one thing and do it well.” Why write another editor when there are several perfectly good ones out there? And it also meets the Linux Philosophy tenet, “Use your favorite editor.” - -Of course, you can change your default text-mode editor to Nano, Pico, EMACS, or any other one that you prefer. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/2/configure-vim-default-editor - -作者:[David Both][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/dboth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) -[2]: https://opensource.com/article/20/12/gnu-nano -[3]: https://opensource.com/tags/emacs -[4]: https://opensource.com/article/21/5/alpine-linux-email diff --git a/sources/tech/20220215 Manage your calendar from the Linux terminal with the konsolekalendar command.md b/sources/tech/20220215 Manage your calendar from the Linux terminal with the konsolekalendar command.md deleted file mode 100644 index 2fa79216f3..0000000000 --- a/sources/tech/20220215 Manage your calendar from the Linux terminal with the konsolekalendar command.md +++ /dev/null @@ -1,151 +0,0 @@ -[#]: subject: "Manage your calendar from the Linux terminal with the konsolekalendar command" -[#]: via: "https://opensource.com/article/22/2/manage-calendar-linux-konsolekalender-kde" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Manage your calendar from the Linux terminal with the konsolekalendar command -====== -KDE is well-suited for terminal-based calendaring on Linux. The -konsolekalendar command lets you view and manage an iCal calendar from -the terminal. -![Calendar close up snapshot][1] - -I'm a [KDE user][2], and for years I've been on a seemingly endless journey of discovery with the Plasma Desktop. If you were to ask me in public, I'd probably claim to know everything there is to know about the desktop I use every day of my life. But in truth, I've actually only just scratched the surface. It seems every day I learn a new KDE trick that either makes my life easier or just more fun, and my latest discovery is the `konsolekalendar` command, which lets you view and manage an iCal calendar from the terminal. - -### Akonadi - -The Akonadi project is a low-level KDE Framework that helps the Plasma Desktop keep track of all the Personal Information Manager (PIM) data. It's mostly for developers and includes lots of libraries that allow a programmer to create applications through which you can access your contacts, notes, emails, calendar, and so on. Some terminal commands are included in Akonadi, such as `akonadictl` to start and stop the Akonadi service, but they're mostly for troubleshooting. However, `konsolekalendar` is a user-facing command that provides you full access to all the data in the Kontact suite, including KMail, Notes, and the Calendar. - -If you're running KDE's Plasma Desktop, then you already have the Kontact suite installed. - -![Kontact UI][3] - -(Seth Kenlon, [CC BY-SA 4.0][4]) - -You also already have Akonadi and its tools installed, so everything you need for terminal-based calendaring is in place! - -### View your calendar from the terminal - -You can host your own iCal calendaring service thanks to projects like [NextCloud][5] and [Radicale][6], or you may already have an iCal account with popular providers (for instance, Google). When you use Kontact for calendaring, you subscribe to a calendar object (a "collection" in Akonadi's terminology). When you make updates to your local calendar, the changes get sent back to your iCal server to synchronize your calendar server and client. - -Whether or not you've used the calendaring part of Kontact yet, you have some default calendar objects in Kontact. You have one called **Personal Calendar** and **Birthdays & Anniversaries**. - -Here's how to display the current day's calendar (**Personal Calendar** by default): - - -``` - - -$ konsolekalendar -Date:   Saturday, January 15, 2022 -        10:00 AM - 11:00 AM -Summary: Covid booster shot -UID: 8d8a1e38-c88c-4d84-99e5-23... -\---------------------------------- -Date:   Saturday, January 15, 2022 -        12:00 PM - 01:00 PM -Summary: Lunch -UID: 7aa89a... -\---------------------------------- -Date:   Saturday, January 15, 2022 -        01:00 PM - 04:45 PM -Summary: Afternoon coding -UID: 9cde38b... -\---------------------------------- -Date:   Saturday, January 15, 2022 -        06:00 PM - 10:00 PM -Summary: Planescape game -UID: c73f7e98-722f-48a2-8006-66... -\---------------------------------- - -``` - -### Add an event - -To see all calendars you've subscribed to, use the `--list-calendars` option: - - -``` - - -$ konsolekalendar --list-calendars -\---------------------------------- -3  - (Read only) Birthdays & Anniversaries -11 - Personal Calendar -60 - (Read only) Open Invitations -61 - (Read only) Declined Invitations -66 - Dnd -67 - Work -68 - Museum - -``` - -The numbers on the left are calendar IDs. To add an event to a specific calendar, use the `--calendar` option, followed by the calendar ID: - - -``` - - -$ konsolekalendar --add --calendar 66 \ -\--date 2022-01-16 \ -\--time 20:00 --end-time 23:59 \ -\--summary "Another game" \ -\--description "Remember to bring dice" \ -Success: "Another game" inserted - -``` - -### Delete an event - -You can also remove events. Each event has a unique ID (UID), provided at the bottom of each event listing: - - -``` - - -$ konsolekalendar --list -Date:   Saturday, January 15, 2022 -        06:00 PM - 10:00 PM -Summary: Planescape game -UID: c73f7e98-722f-48a2-8006-66aa8ddcf789 - -``` - -To delete an event, use the `--delete` option along with the `--uid` option: - - -``` - - -$ konsolekalendar --delete \ -\--uid c73f7e98-722f-48a2-8006-66aa8ddcf789 - -``` - -### Akonadi in the terminal - -Everything you do with `konsolekalendar` is immediately performed in Akonadi and is reflected just as quickly in Kontact itself. Using one doesn't mean you have to give up the other. Thanks to their shared Akonadi backend, the two view and edit the same data. The `konsolekalendar` command is a work in progress. Future plans include integration with the Notes and Journal parts of Kontact, and there are many more options available than this article covered. If you're using the KDE desktop, try `konsolekalendar` and experience a PIM for your terminal! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/2/manage-calendar-linux-konsolekalender-kde - -作者:[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/calendar.jpg?itok=jEKbhvDT (Calendar close up snapshot) -[2]: https://opensource.com/article/17/5/7-cool-kde-tweaks-will-improve-your-life -[3]: https://opensource.com/sites/default/files/uploads/kontact.jpg (Kontact UI) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://opensource.com/article/21/1/nextcloud-productivity -[6]: https://radicale.org/v3.html diff --git a/sources/tech/20220216 Archive files on your Linux desktop with Ark for KDE.md b/sources/tech/20220216 Archive files on your Linux desktop with Ark for KDE.md deleted file mode 100644 index 34efc05ffe..0000000000 --- a/sources/tech/20220216 Archive files on your Linux desktop with Ark for KDE.md +++ /dev/null @@ -1,128 +0,0 @@ -[#]: subject: "Archive files on your Linux desktop with Ark for KDE" -[#]: via: "https://opensource.com/article/22/2/archives-files-linux-ark-kde" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Archive files on your Linux desktop with Ark for KDE -====== -Create, examine, and expand compressed archives on KDE. -![Hand putting a Linux file folder into a drawer][1] - -When I finish with a project, I often like to take all the files I've created for the project and put them into an archive. It not only [saves space][2], but it gets those files out of my way, and prevents them from turning up as results when I use [find][3] and [grep][4] to search through files I consider current. Once files are in an archive, they're treated as a single object by your filesystem, which means that you can't browse them the way you can a normal folder. You could unarchive them, or you could open a terminal and run the appropriate archive command, such as [tar][5], to list the contents of the archive. Or you can use an application like Ark to list, preview, modify, and manage your archives. - -### Install Ark on Linux - -If you're running the KDE Plasma Desktop, you already have Ark installed, but if not then it's available from your package manager. On Fedora, Mageia, and similar: - - -``` -`$ sudo dnf install ark` -``` - -On Debian, Elementary, and similar: - - -``` -`$ sudo apt install ark` -``` - -You can [install it as a Flatpak][6] from [Flathub][7], too. - -### Create an archive - -The best way to get comfortable with archives is to create one for yourself, and then explore it. All of this can be done with just Ark. - -First, launch Ark from your application menu, and then go to the **Archive** menu and select **New**. - -![Creating a new archive with Ark][8] - -(Seth Kenlon, [CC BY-SA 4.0][9]) - -Give your archive a filename, accept the default compression settings, and save it to your home directory. - -Ark won't create an empty archive, but after you've set a name and location, Ark is poised to create an archive as soon as you add a file to it. - -To add a file to your soon-to-be archive, just drag and drop a file into the Ark window. - -![Items in an archive][10] - -(Seth Kenlon, [CC BY-SA 4.0][9]) - -There are two benefits to archiving: consolidation and compression. By adding files to the archive, you've consolidated files into one place. They exist in the archive now, so you can throw the original copies in the trash if it's part of your goal to get files out of the way. - -To see how much disk space you've saved by compressing your files, go to the **Archive** menu and select **Properties**. This shows you the size of the unpacked archive as well as the size of the packed archive, and a lot of other useful metadata. - -![Archive properties and metadata][11] - -(Seth Kenlon, [CC BY-SA 4.0][9]) - -There's a lot more that Ark can do, but for now close Ark as if you were finished. Your achive now exists in the location where you saved it (in this example, it's **example.tar.gz** in my home folder.) - -### Viewing files in an archive - -Any archive can be opened in Ark, just as if it were a normal folder. To open an archive in Ark, just click on it in your file manager, or right-click on it and select **Open with Ark**. - -Once the archive is open in Ark, you can perform most actions you could do from a file manager, including removing files, adding new files, previewing the contents of a file, and more. - -### Removing a file from an archive - -Sometimes you put a file into an archive you don't need. When you want to remove a file from an archive, right-click on the file and select **Delete**. - -![Right-click menu][12] - -(Seth Kenlon, [CC BY-SA 4.0][9]) - -### Adding files to an archive - -Adding a file to an archive is even easier. You can just drag and drop a file from your file manager into Ark. Alternately, you can select **Add Files** from the right-click menu in Ark. - -### Extracting just one file from an archive - -When faced with an archive, many people just unarchive the entire thing and then fish for the one or two files they actually need. For small archives, that's fine, but for big archives that takes time and disk space, even if only temporarily. - -With Ark, you can extract only the files you need by dragging them from the Ark window to the destination you want to save them to. Alternately, select **Extract** from the right-click menu. - -### Previewing files in an archive - -You don't always need to extract a file. If you just need to refer to a file quickly, Ark may be able to show you a preview of the file without extracting it to your drive. - -To preview a file, double-click on it in Ark. - -![Previewing a file in Ark][13] - -(Seth Kenlon, [CC BY-SA 4.0][9]) - -### Archive it - -Managing archives on a Linux desktop is easy and intuitive. Ark is a great archive tool, and many other Linux desktops have similar tools, so even if you're not using Ark you might find something similar to it equally as useful. For me, archiving has been an important part of keeping my files organized, and conserving disk space. As for Ark, it makes interacting with those archives convenient. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/2/archives-files-linux-ark-kde - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) -[2]: https://opensource.com/article/21/11/linux-commands-convert-files -[3]: https://opensource.com/article/21/9/linux-find-command -[4]: https://opensource.com/article/21/3/grep-cheat-sheet -[5]: https://opensource.com/article/17/7/how-unzip-targz-file -[6]: https://opensource.com/article/21/11/install-flatpak-linux -[7]: https://flathub.org/apps/details/org.kde.ark -[8]: https://opensource.com/sites/default/files/ark-new.jpg (Creating a new archive in Ark) -[9]: https://creativecommons.org/licenses/by-sa/4.0/ -[10]: https://opensource.com/sites/default/files/ark-items.jpg (Items in an archive) -[11]: https://opensource.com/sites/default/files/ark-properties.jpg (Archive properties and metadata) -[12]: https://opensource.com/sites/default/files/ark-menu-click-right.jpg (Right-click menu) -[13]: https://opensource.com/sites/default/files/ark-preview.jpg (Previewing a file in Ark) diff --git a/sources/tech/20220217 Top 5 Live Streaming Application for Ubuntu and Other Linux -2022 Edition.md b/sources/tech/20220217 Top 5 Live Streaming Application for Ubuntu and Other Linux [2022 Edition].md similarity index 66% rename from sources/tech/20220217 Top 5 Live Streaming Application for Ubuntu and Other Linux -2022 Edition.md rename to sources/tech/20220217 Top 5 Live Streaming Application for Ubuntu and Other Linux [2022 Edition].md index 47ad2f916b..4753330660 100644 --- a/sources/tech/20220217 Top 5 Live Streaming Application for Ubuntu and Other Linux -2022 Edition.md +++ b/sources/tech/20220217 Top 5 Live Streaming Application for Ubuntu and Other Linux [2022 Edition].md @@ -1,7 +1,7 @@ [#]: subject: "Top 5 Live Streaming Application for Ubuntu and Other Linux [2022 Edition]" [#]: via: "https://www.debugpoint.com/2022/02/live-streaming-applications-linux-2022/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" +[#]: collector: "lkxed" [#]: translator: " " [#]: reviewer: " " [#]: publisher: " " @@ -9,8 +9,8 @@ Top 5 Live Streaming Application for Ubuntu and Other Linux [2022 Edition] ====== -THIS POST LISTS THE TOP FIVE LIVE STREAMING APPLICATIONS FOR UBUNTU -LINUX WITH FEATURES, HIGHLIGHTS, DOWNLOAD DETAILS, AND COMPARISON. +This post lists the top five live streaming applications for Ubuntu Linux with features, highlights, download details, and comparison. + It is the best time to incorporate online video content for your business. Why? Because research suggests that the global online video market is growing at a rate of ~20% per year. And thanks to some excellent software from developers, it has become easy for anyone to create video content and stream them over several popular platforms such as YouTube and Twitch. If you think about it, you see you are consuming more video content today while online than text-based content. @@ -27,7 +27,9 @@ OBS Studio is the best one on this list because several reasons. The encoding is The user interface is reasonably straightforward and features rich. You can get help from third-party developed plugins to extend their functionalities, such as – mixing live tweets from Twitter on your streaming media while live streaming. However, OBS does not support multi-bitrate streaming. -![OBS Studio][1] +![OBS Studio - Live Streaming Applications for Linux][1] + +**How to Install** OBS Studio is available in all Linux Distribution’s official repositories. Detailed instruction for installations is present in the below link. @@ -35,10 +37,8 @@ OBS Studio is available in all Linux Distribution’s official repositories. Det More Information - * [Home Page][3] - * [Documentation][4] - - +* [Home Page][3] +* [Documentation][4] #### VokoscreenNG @@ -46,7 +46,9 @@ The second application we would feature in this list is VokoscreenNG. It is a fo It is available for Linux and Windows for free. -![vokoscreenNG][5] +![vokoscreenNG - Live Streaming Applications for Linux][5] + +**How to Install** You can download the compressed executable from the below link for Linux systems. Once downloaded, extract them. Then execute the binary to launch the application. @@ -54,9 +56,9 @@ Remember, this application requires X11, PulseAudio and GStreamer plugins instal [Download VokoscreenNG][6] - * [Home page][7] - +**More Information** +* [Home page][7] #### Restreamer @@ -64,52 +66,46 @@ The Restreamer application enables you to live stream videos and screencasts dir This application is feature-rich and comes with a fair list of features. Here’s a quick peek at its features: - * H.264 streaming support - * Built-in HTML5 video play - * Available for Linux, macOS, Windows and as Docker images - * Supports your own website plus YouTube, Twitchm, Facebook, Vimeo, Wowza and more - * Multiple video source support – [IP Camera][8], USB Cameram or any H.2645 streams - * Encoding and Audio source support - * Snapshots as form of JPEG support in regular interval - * Access stream status via JSON HTTP API for additional programming - - +* H.264 streaming support +* Built-in HTML5 video play +* Available for Linux, macOS, Windows and as Docker images +* Supports your own website plus YouTube, Twitchm, Facebook, Vimeo, Wowza and more +* Multiple video source support – [IP Camera][8], USB Cameram or any H.2645 streams +* Encoding and Audio source support +* Snapshots as form of JPEG support in regular interval +* Access stream status via JSON HTTP API for additional programming ![Restreamer][9] -[][10] - -SEE ALSO:   10 Necessary Apps to Improve Your GNOME Desktop Experience [Part 4] +**How to Install** The installation of Restreamer is a little tricky because it’s distributed via Docker images. You can find the instructions to install Linux, Windows, and macOS on the below link. -[Download Restreamer][11] - - * [Home Page][12] - * [Documentation][13] - * [Source Code][14] +[Download Restreamer][10] +**More Information** +* [Home Page][11] +* [Documentation][12] +* [Source Code][13] #### ffscreencast The ffscreencast is a command-line streaming application that uses the ffmpeg library. It leverages the power of ffmpeg and acts as a wrapper to it. Although it is available as a command line, you can take advantage of its powerful features such as multiple sources and recordings devices directly via the terminal. It supports multiple display setups as well. You can also overlay your camera feed on top of your desktop screencast. -![Open Streaming Platform][15] +![Open Streaming Platform - - Live Streaming Applications for Linux][14] + +**How to Install** To install this application, you need to clone the git repo and then copy the contents to /bin directory for the global execution of the `ffscreencast` command. ``` - - git clone https://github.com/cytopia/ffscreencast - cd ffscreencast - sudo cp bin/ffscreencast /usr/local/bin - +git clone https://github.com/cytopia/ffscreencastcd ffscreencastsudo cp bin/ffscreencast /usr/local/bin ``` You can run this application with `ffscreencast` command from the terminal. -[Source code & Home page][16] +[Source code & Home page][15] #### Open Streaming platforms @@ -117,31 +113,31 @@ The final application in this list is Open Streaming Platform (OSP), an open-sou This application is feature-rich and powerful when used correctly. Because of the below essential features: - * RTMP Streaming from an input source like Open Broadcast Software (OBS). - * Multiple Channels per User, allowing a single user to broadcast multiple streams at the same time without needing multiple accounts. - * Video Stream Recording and On-Demand Playback. - * Manual Video Uploading of MP4s that are sourced outside of OSP - * Video Clipping – Create Shorter Videos of Notable Moments - * Real-Time Chat Moderation by Channel Owners (Banning/Unbanning) - * Admin Controlled Adaptive Streaming - * Protected Channels – Allow Access only to the audience you want. - * Live Channels – Keep chatting and hang out when a stream isn’t on - * Webhooks – Connect OSP to other services via fully customizable HTTP requests which will pass information - * Embed your stream or video directly into another web page easily - * Share channels or videos via Facebook or Twitter quickly - * Ability to Customize the UI as a Theme for your own personal look - +* RTMP Streaming from an input source like Open Broadcast Software (OBS). +* Multiple Channels per User, allowing a single user to broadcast multiple streams at the same time without needing multiple accounts. +* Video Stream Recording and On-Demand Playback. +* Manual Video Uploading of MP4s that are sourced outside of OSP +* Video Clipping – Create Shorter Videos of Notable Moments +* Real-Time Chat Moderation by Channel Owners (Banning/Unbanning) +* Admin Controlled Adaptive Streaming +* Protected Channels – Allow Access only to the audience you want. +* Live Channels – Keep chatting and hang out when a stream isn’t on +* Webhooks – Connect OSP to other services via fully customizable HTTP requests which will pass information +* Embed your stream or video directly into another web page easily +* Share channels or videos via Facebook or Twitter quickly +* Ability to Customize the UI as a Theme for your own personal look +**How to Install** To install the Open Streaming Platform, follow the below page for detailed instructions. -[Download Open Streaming Platform][17] - - * [Home Page][18] - * [Source Code][19] - * [Documentation][20] +[Download Open Streaming Platform][16] +**More Information** +* [Home Page][17] +* [Source Code][18] +* [Documentation][19] ### Closing Notes @@ -151,25 +147,19 @@ Let me know your favourite live streaming software in the comment box below. Cheers. -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][21], [Twitter][22], [YouTube][23], and [Facebook][24] and never miss an update! - -##### Also Read - -------------------------------------------------------------------------------- via: https://www.debugpoint.com/2022/02/live-streaming-applications-linux-2022/ 作者:[Arindam][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 +[b]: https://github.com/lkxed [1]: https://www.debugpoint.com/wp-content/uploads/2022/02/OBS-Studio.jpg [2]: https://obsproject.com/wiki/install-instructions#linux [3]: https://obsproject.com/ @@ -179,18 +169,13 @@ via: https://www.debugpoint.com/2022/02/live-streaming-applications-linux-2022/ [7]: https://linuxecke.volkoh.de/vokoscreen/vokoscreen.html [8]: https://www.debugpoint.com/2018/08/onvifviewer-internet-camera-viewer-for-linux/ [9]: https://www.debugpoint.com/wp-content/uploads/2022/02/Restreamer.jpg -[10]: https://www.debugpoint.com/2022/02/best-gnome-apps-part-4/ -[11]: https://datarhei.github.io/restreamer/docs/installation-index.html -[12]: https://datarhei.github.io/restreamer/ -[13]: https://datarhei.github.io/restreamer/docs/index.html -[14]: https://github.com/datarhei/restreamer -[15]: https://www.debugpoint.com/wp-content/uploads/2022/02/Open-Streaming-Platform-1024x513.jpg -[16]: https://github.com/cytopia/ffscreencast -[17]: https://wiki.openstreamingplatform.com/Install/Standard -[18]: https://openstreamingplatform.com/ -[19]: https://gitlab.com/Deamos/flask-nginx-rtmp-manager -[20]: https://wiki.openstreamingplatform.com/ -[21]: https://t.me/debugpoint -[22]: https://twitter.com/DebugPoint -[23]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[24]: https://facebook.com/DebugPoint +[10]: https://datarhei.github.io/restreamer/docs/installation-index.html +[11]: https://datarhei.github.io/restreamer/ +[12]: https://datarhei.github.io/restreamer/docs/index.html +[13]: https://github.com/datarhei/restreamer +[14]: https://www.debugpoint.com/wp-content/uploads/2022/02/Open-Streaming-Platform-1024x513.jpg +[15]: https://github.com/cytopia/ffscreencast +[16]: https://wiki.openstreamingplatform.com/Install/Standard +[17]: https://openstreamingplatform.com/ +[18]: https://gitlab.com/Deamos/flask-nginx-rtmp-manager +[19]: https://wiki.openstreamingplatform.com/ diff --git a/sources/tech/20220219 Crop and resize photos on Linux with Gwenview.md b/sources/tech/20220219 Crop and resize photos on Linux with Gwenview.md deleted file mode 100644 index 7d151e011c..0000000000 --- a/sources/tech/20220219 Crop and resize photos on Linux with Gwenview.md +++ /dev/null @@ -1,125 +0,0 @@ -[#]: subject: "Crop and resize photos on Linux with Gwenview" -[#]: via: "https://opensource.com/article/22/2/crop-resize-photos-gwenview-kde" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Crop and resize photos on Linux with Gwenview -====== -Gwenview is an excellent photo editor for casual photographers to use on -the Linux KDE desktop. -![Polaroids and palm trees][1] - -A good photo can be a powerful thing. It expresses what you saw in a very literal sense, but it also speaks to what you experienced. Little things say a lot: the angle you choose when taking the photo, how large something looms in the frame, and by contrast the absence of those conscious choices. - -Photos are often not meant as documentation of what really happened, and instead they become insights into how you, the photographer, perceived what happened. - -This is one of the reasons photo editing is so commonplace. When you're posting pictures to your online image gallery or social network, you shouldn't have to post a photo that doesn't accurately represent the feelings the photo encapsulates. But by the same token, you also shouldn't have to become a professional photo compositer just to crop out the random photo bomber who poked their head into your family snapshot at the last moment. If you're using KDE, you have a casual photo editor available in the form of Gwenview. - -### Install Gwenview on Linux - -If you're running the KDE Plasma Desktop, you probably already have Gwenview installed. If you don't have it installed, or you're using a different desktop and you want to try Gwenview, then you can install it with your package manager. - -I recommend installing both Gwenview and the Kipi plugin set, which connects Gwenview with several online photo services so you can easily upload photos. On Fedora, Mageia, and similar distributions: - - -``` -`$ sudo dnf install gwenview kipi-plugins` -``` - -On Debian, Elementary, and similar: - - -``` -`$ sudo apt install gwenview kipi-plugins` -``` - -### Using Gwenview - -Gwenview is commonly launched in one of two ways. You can click on an image file in Dolphin and choose to open it in Gwenview, or you can launch Gwenview and hunt for a photo in your folders with Gwenview acting more or less as your file manager. The first method is a direct method, great for previewing an image file quickly and conveniently. The second method you're likely to use when you're browsing through lots of photos, unsure of which version of a photo is the "right" one. - -Regardless of how you launch Gwenview, the interface and functionality is the same: there's a workspace on the right, and a panel on the left. - -![Gwenview][2] - -(Seth Kenlon [CC BY-SA 4.0][3], Photo courtesy [Andrea De Santis][4]) - -Below the panel on the left, there are three tabs. - - * Folders: Displays a tree view of the folders on your computer so you can browse your files for more photos. - * Information: Provides metadata about the photo you're currently viewing. - * Operations: Allows you to make small modifications to the current photo, such as rotating between landscape and portrait, resizing, and cropping. - - - -Gwenview is always aware of the file system, so you can press the **Right** or **Left** **Arrow** on your keyboard to see the previous or next photo in a folder. - -To leave the single-photo view and see all of the images in a folder, click the **Browse** button in the top toolbar. - -![Browsing photos in a folder][5] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -You can also have both views at the same time. Click the **Thumbnail Bar** button at the bottom of Gwenview to see the other images in your current folder as a filmstrip, with the currently selected photo in the main panel. - -![Thumbnail view][6] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -### Editing photos with Gwenview - -Digital photos are pretty common, and so it's equally as common to need to make minor adjustments to a photo before posting it online or sharing it with friends. There are very good applications that can edit photos, and in fact one of the best of them is another KDE application called Krita (you can read about how I use it for photographs in my [Krita for photographers][7] article), but small adjustments shouldn't require an art degree. That's exactly what Gwenview ensures: easy and quick photo adjustments with a casual but powerful application that's integrated into the rest of your Plasma Desktop. - -The most common adjustments most of us make to photos are: - - * **Rotation**: When your camera doesn't provide the correct metadata for your computer to know whether a photo is meant to be viewed in landscape or portrait orientation, you can fix it manually. - * **Mirror**: Many laptop or face cameras mimic a mirror, which is useful because that's how we're used to seeing ourselves. However, it renders writing backward. The **Mirror** function flips (or flops?) an image from right to left. - * **Flip**: Less common with digital cameras and laptops, the phenomenon of taking a photo with an upside-down device is not uncommon with a mobile phone with a screen that flips no matter how you're holding your phone. The **Flip** function rotates an image 180 degrees. - * **Resize**: Digital images are often in super HD sizes now, and sometimes that's a lot more than you need. If you're sending a photo by email or posting it on a web page you want to optimize for loading time, you can shrink the dimensions (and file size accordingly) to something smaller. - * **Crop**: You have a great picture of yourself, and accidentally a random person you thought was just out of frame. Cut out everything you don't want in frame with the **Crop** tool. - * **Red** **Eye**: When your retinas reflect the flash of your camera back into the camera, you get a red eye effect. Gwenview can reduce this by desaturating and darkening the red channel in an adjustable area. - - - -All of these tools are available in the **Operations** side panel or in the **Edit** menu. The operations are destructive, so after you make a change, click **Save As** to save a _copy_ of the image. - -![Cropping a photo in Gwenview][8] - -(Seth Kenlon, [CC BY-SA 4.0][3], Photo courtesy [Elise Wilcox][9]) - -### Sharing photos - -When you're ready to share a photo, click the **Share** button in the top toolbar, or go to the **Plugins** menu and select **Export**. Gwenview, along with the Kipi plug-in set, can share photos with [Nextcloud][10], [Piwigo][11], plain old email, and services like Google Drive, Flickr, Dropbox, and more. - -### Photo editing essentials on Linux - -Gwenview has all the essentials for a desktop photo manager. If you need more than the basics, you can open a photo in Krita or [Digikam][12] and make major modifications as needed. For everything else, from browsing, ranking, tagging, and small adjustments, you have Gwenview close at hand. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/2/crop-resize-photos-gwenview-kde - -作者:[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/design_photo_art_polaroids.png?itok=SqPLgWxJ (Polaroids and palm trees) -[2]: https://opensource.com/sites/default/files/kde-gwenview-ui.jpg (Gwenview) -[3]: https://creativecommons.org/licenses/by-sa/4.0/ -[4]: http://unsplash.com/@santesson89 -[5]: https://opensource.com/sites/default/files/kde-gwenview-browse.jpg (Browsing photos in a folder) -[6]: https://opensource.com/sites/default/files/kde-gwenview-thumbnail.jpg (Thumbnail view) -[7]: https://opensource.com/article/21/12/open-source-photo-editing-krita -[8]: https://opensource.com/sites/default/files/kde-gwenview-crop.jpg (Cropping a photo in Gwenview) -[9]: http://unsplash.com/@elise_outside -[10]: https://opensource.com/article/20/7/nextcloud -[11]: https://opensource.com/alternatives/google-photos -[12]: https://opensource.com/life/16/5/how-use-digikam-photo-management diff --git a/sources/tech/20220220 Transform Your Arch Installation with Stunning XMonad WM Setup.md b/sources/tech/20220220 Transform Your Arch Installation with Stunning XMonad WM Setup.md index 12a3b4280f..5a115c4278 100644 --- a/sources/tech/20220220 Transform Your Arch Installation with Stunning XMonad WM Setup.md +++ b/sources/tech/20220220 Transform Your Arch Installation with Stunning XMonad WM Setup.md @@ -9,8 +9,8 @@ Transform Your Arch Installation with Stunning XMonad WM Setup ====== -THIS ARTICLE GIVES YOU A STEP-BY-STEP INSTALLATION GUIDE FOR THE XMONAD -SETUP IN ARCH LINUX WITH A CUSTOM PRE-CONFIGURED SCRIPT. +This article gives you a step-by-step installation guide for the xmonad setup in arch linux with a custom pre-configured script. + ### What is XMonad The [xmonad][1] is a dynamic tiling window manager for X Window system written in Haskell programming language. It is famous for its window automation, stability, minimal, workspace features, and more unique features. With features like – multiple display support, auto window tiling management, quick keyboard navigation, extension support, this window manager is one of the popular choices for those users who wants a productive and faster working system. @@ -25,48 +25,32 @@ You can learn more about this window manager at [https://xmon][1][ad.org/][1]. This guide assumes that you have a functional Arch Linux system ready to follow the below steps. If you want to install Arch Linux, then you can follow our guides as below: - * [How to Install Arch Linux via archinstall (recommended)][3] - * [How to Install Arch Linux (basics)][4] - - +* [How to Install Arch Linux via archinstall (recommended)][3] +* [How to Install Arch Linux (basics)][4] For this guide, we will use [Axarva’s pre-configured xmonad script][5], which comes with xmonad, Eww (Elkowars Wacky Widgets is a standalone widget system made in Rust), rofi (window switcher), tint2 (panels and taskbar) and some cool widgets. This guide is only for physical systems and not virtual machines. Using this personal script is best for novice Arch Linux users because it is unnecessary to go through the hassles of choosing and installing each of the above components and configure them separately. - * Ensure that you are logged on to the Arch Linux system as an admin user (preferable). And connected to the internet. - - - * In the terminal prompt, install the following components while in the home directory. - - +* Ensure that you are logged on to the Arch Linux system as an admin user (preferable). And connected to the internet. +* In the terminal prompt, install the following components while in the home directory. ``` - sudo pacman -Syu base-devel git nano - ``` - * Wait for the download to complete. Then clone the following [Axarva’s repo][5] from GitHub. - - +* Wait for the download to complete. Then clone the following [Axarva’s repo][5] from GitHub. ``` - git clone https://github.com/Axarva/dotfiles-2.0.git - ``` - * After the above command is complete, browse to the dotfiles-2.0 directory. Here you should see a script – `install-on-arch.sh`. Give the execute permission on this script and run. All these you can do with the below set of commands. - - +* After the above command is complete, browse to the dotfiles-2.0 directory. Here you should see a script – `install-on-arch.sh`. Give the execute permission on this script and run. All these you can do with the below set of commands. ``` - cd ./dotfiles-2.0 chmod +x ./install-on-arch.sh ./install-on-arch.sh - ``` The above script will take some time to complete. It will download all the required packages for xmonad setup in Arch Linux. And at the end, the script will compile the entire source code that you downloaded in the first step, including xmonad and other additional utilities. @@ -89,30 +73,20 @@ Congratulations if you reached this far. It’s time for some configuration. Onc Installing the xmonad window manager is not sufficient. You have to tell the Arch system where it should pick the executables and widgets. Also, you have to manually configure to tell X Windows server to execute the main xmonad binary. When you use a stacking window system (such as GNOME, KDE Plasma, etc.), the display manager (such as lightdm) takes care of this. - * Open the `~/.bashrc` file from the terminal prompt and append the $HOME/bin. - - +* Open the `~/.bashrc` file from the terminal prompt and append the $HOME/bin. ![Updating bashrc file][9] - * Open the `~/.bash_profile` file and add startx at the beginning to start the xserver when logging in. Save and exit from the file. - - +* Open the `~/.bash_profile` file and add startx at the beginning to start the xserver when logging in. Save and exit from the file. ![Updating bash_profile file][10] - * Open `~/.xinitrc` file and add `exec xmonad`. This file is new. Save the file once you add the command. - - +* Open `~/.xinitrc` file and add `exec xmonad`. This file is new. Save the file once you add the command. ![Create xinitrc file][11] - * The steps are almost complete, open the `~/dotfiles-2.0/.config/alacritty.yml` file and change the font size for the terminal to something larger than the default value of 9. This is an optional step, but it’s better to change this. Save and close the file. - - - * Exit and log in again. And if all goes well, you should see a default xmonad desktop as below. Now, if you like to configure further such as installing applications and other steps, proceed to the next step. - - +* The steps are almost complete, open the `~/dotfiles-2.0/.config/alacritty.yml` file and change the font size for the terminal to something larger than the default value of 9. This is an optional step, but it’s better to change this. Save and close the file. +* Exit and log in again. And if all goes well, you should see a default xmonad desktop as below. Now, if you like to configure further such as installing applications and other steps, proceed to the next step. ![xmonad base install in Arch Linux – before configuration][12] @@ -122,8 +96,6 @@ The default install in this process gives you a basic setup without the necessar [][13] -SEE ALSO:   How to Install yay AUR Helper in Arch Linux [Beginner’s Guide] - Here, I have compiled a list of some famous and essential software for this setup. This step is optional, and you can install something else as you wish. However, you can install using the command that follows this list. * Ristretto – Image viewer @@ -134,12 +106,8 @@ Here, I have compiled a list of some famous and essential software for this setu * Thunar – File manager * KSnip – Screenshot tool - - ``` - pacman -S gtklib firefox leafpad libreoffice thunar ksnip ristretto gimp feh gvfs polkit-gnome - ``` The gvfs and polkit-gnome packages are for Thunar and detect USB drives. @@ -201,12 +169,6 @@ With that said, I hope this guide helps you to set up your xmonad window manager Cheers. -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][19], [Twitter][20], [YouTube][21], and [Facebook][22] and never miss an update! - -##### Also Read - -------------------------------------------------------------------------------- via: https://www.debugpoint.com/2022/02/xmonad-arch-linux-setup/ @@ -238,7 +200,3 @@ via: https://www.debugpoint.com/2022/02/xmonad-arch-linux-setup/ [16]: https://www.debugpoint.com/wp-content/uploads/2022/02/xmonad-performance-in-Arch-Linux-during-idle-state-1024x575.jpg [17]: https://www.debugpoint.com/wp-content/uploads/2022/02/xmonad-performance-in-Arch-Linux-during-heavy-workflow-state-1024x575.jpg [18]: https://www.debugpoint.com/tag/arch-linux -[19]: https://t.me/debugpoint -[20]: https://twitter.com/DebugPoint -[21]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[22]: https://facebook.com/DebugPoint diff --git a/sources/tech/20220221 3 steps to start running containers today.md b/sources/tech/20220221 3 steps to start running containers today.md deleted file mode 100644 index 9eaf660165..0000000000 --- a/sources/tech/20220221 3 steps to start running containers today.md +++ /dev/null @@ -1,219 +0,0 @@ -[#]: subject: "3 steps to start running containers today" -[#]: via: "https://opensource.com/article/22/2/start-running-containers" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -3 steps to start running containers today -====== -In this tutorial, you will learn how to run two containers in a pod to -host a WordPress site. -![Shipping containers stacked][1] - -Whether you're interested in them as part of your job, for future job opportunities, or just out of interest in new technology, containers can seem pretty overwhelming to even an experienced systems administrator. So how do you actually get started with containers? And what's the path from containers to [Kubernetes][2]? Also, why is there a path from one to the other at all? As you might expect, the best place to start is the beginning. - -### 1\. Understanding containers - -On second thought, starting at the beginning arguably dates back to early BSD and their special chroot jails, so skip ahead to the middle instead. - -Not so very long ago, the Linux kernel introduced _cgroups_, which enables you to "tag" processes with something called a _namespace_. When you group processes together into a namespace, those processes act as if nothing outside that namespace exists. It's as if you've put those processes into a sort of container. Of course, the container is virtual, and it exists inside your computer. It runs on the same kernel, RAM, and CPU that the rest of your operating system is running on, but you've contained the processes. - -Pre-made containers get distributed with just what's necessary to run the application it contains. With a container engine, like [Podman][3], Docker, or CRI-O, you can run a containerized application without installing it in any traditional sense. Container engines are often cross-platform, so even though containers run Linux, you can launch containers on Linux, macOS, or Windows. - -More importantly, you can run more than one container of the same application when there's high demand for it. - -Now that you know what a container is. The next step is to run one. - -**[ Get the cheat sheet: [What’s the difference between a pod, a cluster, and a container?][4] ]** - -### 2\. Run a container - -Before running a container, you should have a reason for running a container. You can make up a reason, but it's helpful for that reason to interest you, so you're inspired actually to use the container you run. After all, running a container but never using the application it provides only proves that you're not noticing any failures, but using the container demonstrates that it works. - -I recommend WordPress as a start. It's a popular web application that's easy to use, so you can test drive the app once you've got the container running. While you can easily set up a WordPress container, there are many configuration options, which can lead you to discover more container options (like running a database container) and how containers communicate. - -I use Podman, which is a friendly, convenient, and daemonless container engine. If you don't have Podman available, you can use the Docker command instead. Both are great open source container engines, and their syntax is identical (just type `docker` instead of `podman`). Because Podman doesn't run a daemon, it requires more setup than Docker, but the ability to run rootless daemonless containers is worth it. - -If you're going with Docker, you can skip down to the [WordPress subheading][5]. Otherwise, open a terminal to install and configure Podman: - - -``` -`$ sudo dnf install podman` -``` - -Containers spawn many processes, and normally only the root user has permission to create thousands of process IDs. Add some extra process IDs to your user by creating a file called `/etc/subuid` and defining a suitably high start UID with a suitable large number of permitted PIDs: - - -``` -`seth:200000:165536` -``` - -Do the same for your group in a file called `/etc/subgid`. In this example, my primary group is `staff` (it may be `users` for you, or the same as your username, depending on how you've configured your system.) - - -``` -`staff:200000:165536` -``` - -Finally, confirm that your user is also permitted to manage thousands of namespaces: - - -``` - - -$ sysctl --all --pattern user_namespaces -user.max_user_namespaces = 28633 - -``` - -If your user doesn't have permission to manage at least 28,000 namespaces, increase the number by creating the file `/etc/sysctl.d/userns.conf` and enter: - - -``` -`user.max_user_namespaces=28633` -``` - -#### Running WordPress as a container - -Now, whether you're using Podman or Docker, you can pull a WordPress container from a container registry online and run it. You can do all this with a single Podman command: - - -``` - - -$ podman run --name mypress \ --p 8080:80 -d wordpress - -``` - -Give Podman a few moments to find the container, copy it from the internet, and start it up. - -Start a web browser once you get a terminal prompt back and navigate to `localhost:8080`. WordPress is running, waiting for you to set it up. - -![WordPress running in a container][6] - -(Seth Kenlon, [CC BY-SA 4.0][7]) - -It doesn't take long to reach your next hurdle, though. WordPress uses a database to keep track of data, so you need to provide it with a database where it can store its information. - -Before continuing, stop and remove the WordPress container: - - -``` - - -$ podman stop mypress -$ podman rm mypress - -``` - -### 3\. Run containers in a pod - -Containers are, by design and, as their name suggests, self-contained. An application running in a container isn't supposed to interact with applications or infrastructure outside of its container. So when one container requires another container to function, one solution is to put those two containers inside a bigger container called a _pod_. A pod ensures that its containers can share important namespaces to communicate with one another. - -Create a new pod, providing a name for the pod and which ports you want to be able to access: - - -``` - - -$ podman pod create \ -\--name wp_pod \ -\--publish 8080:80 - -``` - -Confirm that the pod exists: - - -``` - - -$ podman pod list -POD ID        NAME     STATUS    INFRA ID      # OF CONTAINERS -100e138a29bd  wp_pod   Created   22ace92df3ef   1 - -``` - -#### Add a container to a pod - -Now that you have a pod for your interdependent containers, you launch each container by specifying a pod for it to run in. - -First, launch a database. You can make up your own credentials as long as you use those same credentials when connecting to the database from WordPress. - - -``` - - -$ podman run --detach \ -\--pod wp_pod \ -\--restart=always \ --e MYSQL_ROOT_PASSWORD="badpassword0" \ --e MYSQL_DATABASE="wp_db" \ --e MYSQL_USER="tux" \ --e MYSQL_PASSWORD="badpassword1" \ -\--name=wp_db mariadb - -``` - -Next, launch the WordPress container into the same pod: - - -``` - - -$ podman run --detach \ -\--restart=always --pod=wp_pod \ --e WORDPRESS_DB_NAME="wp_db" \ --e WORDPRESS_DB_USER="tux" \ --e WORDPRESS_DB_PASSWORD="badpassword1" \ --e WORDPRESS_DB_HOST="127.0.0.1" \ -\--name mypress wordpress - -``` - -Now launch your favorite web browser and navigate to `localhost:8080`. - -This time, the setup goes as expected. WordPress connects to the database because you've passed those environment variables while launching the container. - -![WordPress setup][8] - -(Seth Kenlon, [CC BY-SA 4.0][7]) - -After you've created a user account, you can log in to see the WordPress dashboard. - -![WordPress dashboard running in a container][9] - -(Seth Kenlon, [CC BY-SA 4.0][7]) - -### Next steps - -You've created two containers, and you've run them in a pod. You know enough now to run services in containers on your own server. If you want to move to the cloud, containers are, of course, well-suited for that. With tools like Kubernetes and OpenShift, you can automate the process of launching [containers and pods on a cluster][10]. If you're thinking about taking the next step, read [3 ways to get started with Kubernetes][11] by Kevin Casey, and give the Minikube tutorial he mentions a try. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/2/start-running-containers - -作者:[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/bus-containers.png?itok=d_4QhZxT (Shipping containers stacked) -[2]: https://opensource.com/tags/kubernetes -[3]: https://www.redhat.com/sysadmin/podman-guides-2020 -[4]: https://enterprisersproject.com/cheat-sheet-what-s-difference-between-pod-cluster-and-container -[5]: tmp.1zBHYsK8TH#wp -[6]: https://opensource.com/sites/default/files/uploads/podman-wordpress.jpg (WordPress running in a container) -[7]: https://creativecommons.org/licenses/by-sa/4.0/ -[8]: https://opensource.com/sites/default/files/uploads/wordpress-setup.jpg (WordPress setup) -[9]: https://opensource.com/sites/default/files/uploads/wordpress-welcome.jpg (WordPress dashboard running in a container) -[10]: https://enterprisersproject.com/article/2020/9/pod-cluster-container-what-is-difference -[11]: https://enterprisersproject.com/article/2019/11/kubernetes-3-ways-get-started diff --git a/sources/tech/20220224 Scan documents and old photos on Linux with Skanlite.md b/sources/tech/20220224 Scan documents and old photos on Linux with Skanlite.md deleted file mode 100644 index aa291c2b5c..0000000000 --- a/sources/tech/20220224 Scan documents and old photos on Linux with Skanlite.md +++ /dev/null @@ -1,94 +0,0 @@ -[#]: subject: "Scan documents and old photos on Linux with Skanlite" -[#]: via: "https://opensource.com/article/22/2/scan-documents-skanlite-linux-kde" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Scan documents and old photos on Linux with Skanlite -====== -Use this Linux KDE application to digitize your archives. -![Filing papers and documents][1] - -Although the world has mostly gone digital now, there are still times when you just have to print a form, sign it, and scan it back in. Sometimes, I find that a snapshot on my phone suffices, but some industries require a better copy than a hasty snapshot, and so a flatbed scanner is necessary. The KDE project provides an application called Skanlite that helps you import documents scanned on a flatbed, or even a tethered camera. - -### Install Skanlite on Linux - -You can install Skanlite from your software repository. On Fedora, Mageia, and similar: - - -``` -`$ sudo dnf install skanlite` -``` - -On Elementary, Linux Mint, and other Debian-based distributions: - - -``` -`$ sudo apt install skanlite` -``` - -### Scanner drivers - -Most scanners on the market are compatible with the SANE scanner API. SANE isn't really a driver, but a protocol that can receive input from image capture devices and provide options to a programmer looking to build an application around it. Skanlite is one such application. - -I've yet to come across a scanner that doesn't interface with SANE, but there are probably scanners out there that don't. In those cases, look on the manufacturer's website for SANE or TWAIN drivers, or else for their proprietary driver and scanner interface. The latter may not be usable with Skanlite, but Skanlite is always worth launching when you're unsure whether your scanner communicates over standard protocols. I've even had printer and scanner combination devices where the scanner is recognized immediately, even though the printer requires an additional driver. - -### Using Skanlite - -When you launch Skanlite, it first searches your system for image capture devices. On laptops, Skanlite usually discovers the webcam as a valid input source (because it is), but it also locates flatbed scanners attached to your machine. Select the scanner you want to use, and then continue. - -To see what's on the scanbed, click the **Preview** button in the bottom right corner of the application. - -![Skanlite with custom artwork][2] - -(Image courtesy KDE) - -This displays a preview image in the right panel. Nothing has been saved to your drive, this only shows you what your scanner has on it at the moment. - -### Selecting a scan area - -If you only need a portion of what's on the scanner, you can select an area you want to save. To select a single region, click and drag your mouse over the area you want to save. When there's an active selection, only the portion of the document you've selected will be saved when you click the **Scan** button. - -You can have more than one selection, which is especially efficient when you need to scan several small images or only specific parts of one larger documents. To add a selection, click the **+** icon that appears in the center of your selection. - -![Adding selections][3] - -(Image courtesy KDE) - -You can remove selections by clicking the **-** icon, which appears when you have multiple active selections. - -### Scan settings - -Image capture settings are located in the left panel. These controls allow you to import images in color or grayscale, and make adjustments to the brightness and contrast of the image. These options are software-based and don't affect how your scanner behaves, but they're common adjustments to make, and doing those adjustments here can save you from having to post-process the image in GIMP or Gwenview. - -In many cases, your scanner may have configurable settings, found in the **Scanner Specific Options** tab on the left of the Skanlite window. Some scanners allow you to adjust color temperature, brightness, saturation, and other attributes that happen in firmware. Available options vary depending on the device and vendor, so you're likely to see changes in this panel depending on which device you're interfacing with. - -### Scan and save - -When you're ready to import the image (or the selected area of the image, if you've made selections), click the **Scan** button in the bottom right corner of the Skanlite window. Depending on your device, it may take a few moments to create the scan, but when it's done you're prompted to save or discard the image. If you like what you see, click **Save**. - -Images are saved to whatever default location you have configured. To see the default location, click the **Settings** button in the bottom right corner of the window. In **Skanlite Settings**, you can set the default save location, the default name format, and the image resolution. You can also control whether you're prompted to save or discard an image after each scan, or whether you prefer to save everything and sort through it later. - -### Scanning is easy on Linux - -Scanning documents on Linux is so easy, I rarely give it a second thought. There aren't usually special drivers or applications you need to hunt down and install, because applications like Skanlite use open protocols to make the process simple. The next time you have a hard copy that you need to digitize, import it with Skanlite. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/2/scan-documents-skanlite-linux-kde - -作者:[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/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) -[2]: https://opensource.com/sites/default/files/skanlite.png (Skanlite with custom artwork) -[3]: https://opensource.com/sites/default/files/skanlite-selection.jpg (Adding selections) diff --git a/sources/tech/20220226 How to Configure Task Switcher in KDE Plasma Desktop.md b/sources/tech/20220226 How to Configure Task Switcher in KDE Plasma Desktop.md deleted file mode 100644 index d221377523..0000000000 --- a/sources/tech/20220226 How to Configure Task Switcher in KDE Plasma Desktop.md +++ /dev/null @@ -1,151 +0,0 @@ -[#]: subject: "How to Configure Task Switcher in KDE Plasma Desktop" -[#]: via: "https://www.debugpoint.com/2022/02/configure-task-switcher-kde/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Configure Task Switcher in KDE Plasma Desktop -====== -This guide explains how to configure the Task Switcher in the KDE Plasma -desktop. -This guide explains how to configure the Task Switcher in the KDE Plasma desktop. - -![Configure KDE Plasma Task Switcher][1] - -### What is Task Switcher? - -A [task switcher][2] is a component that helps you to switch between open windows or applications in your current desktop session. Usually, the feature shows up as a list of icons when you press `Alt+Tab`. - -![Thumbnail Grid Task Switcher][3] - -And this is highly configurable as per your exact needs in KDE Plasma. You can customise its looks, the sort order of the icons, grouping of same applications and more. - -### Changing Task Switcher in KDE Plasma - -Open `System Settings`. Under `Workspace` group, click on `Window Management > Task Switcher`. - -On the Main tab, the Visualisation section has a below drop-down. This drop-down contains several Task Switcher options which you can try. - -Select your favourite option and hit the preview button. If you are satisfied, then you can click on Apply. - -![Configure Task Switcher in KDE][4] - -This is how you can change the task switcher in the KDE Plasma desktop. - -### The Alternative Switcher - -The Alternative tab also contains the same visualisation options for the task switcher. However, you can set a different key combination other than Alt+Tab for the Alternatives configuration set. This way, you can simultaneously experience two different groups of task switchers with different combinations. - -### Visualisations - -As of writing this guide [until [KDE Plasma 5.24][5]], the following options are available for different task switchers. - - * Breeze - * Breeze Dark - * Breeze Twilight - * Compact - * Fedora - * Grid - * Informative - * large Icons - * Small Icons - * Text Only - * Thumbnail Grid - * Thumbnails - - - -And here are the screenshots of the above task switchers. - -![Various Task Switcher][6] - -![][7] - -![][8] - -![][9] - -![][10] - -![][11] - -![][12] - -![][13] - -![][14] - -Now, that is the basic configuration of the Task Switcher in the KDE Plasma desktop. Now I am going to explain how it behaves in the below scenarios. - -### Task Switcher in Multiple Monitor or Display - -If you have a multiple monitor or display setup, you do not need to do anything. The Task witcher will show up based on where your mouse cursor is. That means it will show up in the active display. - -[][15] - -SEE ALSO:   MX Linux Launches First-Ever KDE Edition with Plasma Desktop - -### Task Switcher with Same Application Grouping - -You can also group the same application icons in the task switcher to keep it simple and crisp. For example, if you have multiple Dolphin file manager instances open, you can select the below option to appear Dolphin icon only once in the task switcher visualisation. - -![Same application grouping][16] - -But you might be wondering how to navigate through the same application instances if it appears only once. You can navigate the same applications via `Alt+`` (default value) in the task switcher. Here are the options you can change as per your need and work. - -### Download more task switchers - -If you are not satisfied with all the above options, you can download additional task switchers from KDE Store via the same settings window. - -Click on the Get New Task Switchers [annotation#5 in above image] and select your favourite one. And click Install. After complete installation, come back to the main settings window and apply the newly downloaded visualisation. - -Remember, these additional items are user-contributed and may break your current theme in some cases. So use with caution. At any time, you can hit the Reset button to come back to the stock Task Switcher visualisation. - -### Closing Notes - -I hope this guide helps you set up a beautiful but productive task switcher in the KDE Plasma desktop. As I said, the customisation options are plenty, and you can play around with them. - -Cheers. - -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][17], [Twitter][18], [YouTube][19], and [Facebook][20] and never miss an update! - -##### Also Read - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2022/02/configure-task-switcher-kde/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://www.debugpoint.com/wp-content/uploads/2022/02/kdetaskw1-1024x576.jpg -[2]: https://docs.kde.org/trunk5/en/kwin/kcontrol/kwintabbox/index.html -[3]: https://www.debugpoint.com/wp-content/uploads/2022/02/Thumbnail-Grid-1024x177.jpg -[4]: https://www.debugpoint.com/wp-content/uploads/2022/02/Configure-Task-Switcher-in-KDE-1024x652.jpg -[5]: https://www.debugpoint.com/2022/01/kde-plasma-5-24/ -[6]: https://www.debugpoint.com/wp-content/uploads/2022/02/Thumbnails-150x150.jpg -[7]: https://www.debugpoint.com/wp-content/uploads/2022/02/Thumbnail-Grid-150x150.jpg -[8]: https://www.debugpoint.com/wp-content/uploads/2022/02/Text-Only-150x150.jpg -[9]: https://www.debugpoint.com/wp-content/uploads/2022/02/Small-Icons-150x108.jpg -[10]: https://www.debugpoint.com/wp-content/uploads/2022/02/Large-Icons-150x150.jpg -[11]: https://www.debugpoint.com/wp-content/uploads/2022/02/Informative-150x150.jpg -[12]: https://www.debugpoint.com/wp-content/uploads/2022/02/Grid-Task-Switcher-150x150.jpg -[13]: https://www.debugpoint.com/wp-content/uploads/2022/02/Compact-Task-Switcher-150x150.jpg -[14]: https://www.debugpoint.com/wp-content/uploads/2022/02/Breeze-Task-Switcher-150x150.jpg -[15]: https://www.debugpoint.com/2020/08/mx-linux-kde-edition-19-2/ -[16]: https://www.debugpoint.com/wp-content/uploads/2022/02/Same-application-grouping.jpg -[17]: https://t.me/debugpoint -[18]: https://twitter.com/DebugPoint -[19]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[20]: https://facebook.com/DebugPoint diff --git a/sources/tech/20220226 My favorite casual games to play on Linux.md b/sources/tech/20220226 My favorite casual games to play on Linux.md deleted file mode 100644 index 7c54582318..0000000000 --- a/sources/tech/20220226 My favorite casual games to play on Linux.md +++ /dev/null @@ -1,79 +0,0 @@ -[#]: subject: "My favorite casual games to play on Linux" -[#]: via: "https://opensource.com/article/22/2/casual-gaming-linux-kde" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -My favorite casual games to play on Linux -====== -Play a video game on Linux while your open source code compiles. -![Gaming with penguin pawns][1] - -I love a good game that you can immerse yourself in for hours, but I don't always have the luxury of ignoring daily tasks to disappear into a video game. Still, I do love a fun challenge from time to time, and two of my favourite applications to launch when my computer gets busy doing something that I need to wait on are games from the KDE Games package: **KBlocks** and **Kolf**. - -### KBlocks - -My favorite video game involves blocks falling from the sky, and ideally landing in rows which magically disappear when blocks are contiguous. KBlocks is one implementation of that format, and it's a good one. It's got responsive block rotation with **Left** and **Right Arrow**, adjustable faster fall with the **Down Arrow**, instant fall with **Spacebar**, There are a few different levels of difficulty to control how quickly blocks fall. - -![KBlocks][2] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -The default theme of KBlocks is ancient Egyptian, which has no bearing on gameplay but can be pleasant for Egyptophiles. You can change the theme, though, in the **Configure KBlocks** menu item. An alternate theme called **Plasma** is included, or you can click on **Get New Themes** button and download user-contributor themes. - -![KBlocks Invaders by José Jorge][4] - -(Seth Kenlon, CC BY-SA 4.0) - -The theme is purely aesthetic, but for the artistic type, creating a theme for a casual game could be a fun way to contribute to an open source project. - -#### A gateway game to the KDE Plasma Desktop - -I'll admit, KBlocks is difficult for me to put down. In fact, it was my desire to play games during meetings that led me to find the `M-x tetris` command in Emacs, which in turn caused me to discover, and fall in love with, Linux in the first place. There's great power in this game. Maybe KBlocks will be the way you discover the KDE Plasma Desktop? - -### Kolf - -I don't like golf in real life, but on the computer miniature golf is a pleasantly frustrating mix of simulated physics and fun level design. With Kolf, the goal is as you'd expect: hit a golf ball into a hole. The destination is, of course, always around a corner, over a hill, past a pond, or behind a wall, so it's your goal to calculate ball speed, friction, incline, and trajectory with such perfection that you get the ball home in as few hits as possible. - -![Miniature golf][5] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -It's never as easy as it looks, and I don't think it ever gets old to watch the golf ball bounce off of objects and roll down hills that you never intended for it to go near. - -#### Designing your own course - -The fun really begins when you try your hand at designing your own miniature golf course. Yes, Kolf has a level editor, in which you can build walls, place ponds and hills and sandtraps, add pinball-style bumbers, and more. - -![Kolf editor][6] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -Because Kolf can be a multi-player game, it's especially fun to give each player five minutes to design a level, and then see who does best at whose level. - -### Linux KDE games - -These aren't by any means the only two games from the KDE project. There are many others, including card games, tile games, and arcade games. The nice thing about the KDE Games package is that they contain games you're happy to walk away from at a moment's notice, and they only require about a fourth of your attention. I use these to kill time while compiling code. Sometimes I don't get a full game in, but I always appreciate the subtle shift in mental gears. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/2/casual-gaming-linux-kde - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gaming_grid_penguin.png?itok=7Fv83mHR (Gaming with penguin pawns) -[2]: https://opensource.com/sites/default/files/kblocks.jpg (KBlocks) -[3]: https://creativecommons.org/licenses/by-sa/4.0/ -[4]: https://opensource.com/sites/default/files/kblocks-invaders.jpg (KBlocks Invaders by José Jorge) -[5]: https://opensource.com/sites/default/files/kolf.jpg (Miniature golf) -[6]: https://opensource.com/sites/default/files/kolf-edit.jpg (Kolf editor) diff --git a/sources/tech/20220301 Boost your home network with DNS caching on the edge.md b/sources/tech/20220301 Boost your home network with DNS caching on the edge.md deleted file mode 100644 index 81a0754840..0000000000 --- a/sources/tech/20220301 Boost your home network with DNS caching on the edge.md +++ /dev/null @@ -1,268 +0,0 @@ -[#]: subject: "Boost your home network with DNS caching on the edge" -[#]: via: "https://opensource.com/article/22/3/dns-caching-edge" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Boost your home network with DNS caching on the edge -====== -Create your own edge by running a DNS caching service on your home or -business network. -![Mesh networking connected dots][1] - -If you've been hearing a lot of talk about "the cloud" over the past several years, then you may also have heard rumblings about something called "the edge." - -The term _edge computing_ reflects the recognition that the cloud has boundaries. To reach those boundaries, your data has to connect with one of the physical datacenters powering the cloud. Getting data from a user's computer to a cluster of servers might be quick in some settings, but it depends heavily on geographic location and network infrastructure. The cloud itself can be as fast and powerful as possible, but it can't do much to offset the time required for the roundtrip your data has to make. - -**[ What's the latest in edge? See [Red Hat's news roundup][2] from Mobile World Congress 2022. ]** - -The answer is to use the edge of the boundaries of regional networks and the cloud. When initial services or computation happen on servers at the edge, it speeds up a user's interactions with the cloud. - -By the same principle, you can create your own edge by running some services on your home server to minimize roundtrip lag times. Don't let the special terminology intimidate you. Edge computing can be as simple as an IoT device or running a server connected to [federated services][3]. - -One particularly useful and easy change you can make to your home or business network to give it a boost is running a DNS caching service. - -### What is DNS? - -The Domain Name System (DNS) is what enables us to translate the IP addresses of servers, whether they're in the cloud or just across town, to friendly website names like `opensource.com`. - -Behind every domain name is a number—names are simply a convenience for humans, who are more likely to remember a few words than a string of numerals. When you type `example.com` into a web browser, your web browser silently sends a request over port 53 to a DNS server to cross-reference the name `example.com` with its registry, then sends back the last known IP address assigned to that name. - -That's one roundtrip from your computer to the internet. - -Armed with the correct number, your web browser makes a second request, this time with the number instead of the name, directly to your destination. - -That's another roundtrip. - -To make matters worse, your computer (depending on your configuration) may also be sending requests to DNS servers for named devices on your local network. - -You can cut out all of this extra traffic by using a local cache. With a DNS caching service running on your network, once any one device on your network obtains a number assigned to a website, that number is stored locally, so no request from your network need ask for that number again. - -As a bonus, running your own DNS caching server also enables you to block ads and generally take control of how any device on your network interacts with some of the low-level technologies of the internet. - -### Install Dnsmasq on Linux - -Install Dnsmasq using your package manager. - -On Fedora, CentOS, Mageia, and similar: - - -``` -$ sudo dnf install dnsmasq dnsmasq-utils -``` - -On Debian and Debian-based systems, use `apt` instead of `dnf`. - -### Configure Dnsmasq - -There are many options in Dnsmasq's default configuration file. - -It's located at `/etc/dnsmasq.conf` by default, and it's well commented, so you can read through it and choose what you prefer for your network. - -Here are some of the options I like. - -Keep your local domains local: - - -``` - - -# Never forward plain names (without a dot or domain part) -domain-needed -# Never forward addresses in the non-routed address spaces -bogus-priv - -``` - -Ignore content from common ad sites. This syntax replaces the string between the first forward-slashes with the trailing address: - - -``` - - -# replace ad site domain names with an IP with no ads -address=/double-click.net/127.0.0.1 - -``` - -Set the cache size. The default suggestion is 150, but I've never felt that 150 websites sounded like enough. - - -``` - - -# Set the cachesize here -cache-size=1500 - -``` - -### Finding resolv.conf - -On most Linux systems, the systemd `resolved` service manages the `/etc/resolv.conf` file, which governs what DNS nameservers your computer contacts for name to IP address resolution. - -You can disable `resolved` and run `dnsmasq` alone, or you can run them both, pointing `dnsmasq` to its own resolver file. - -To disable `resolved`: - - -``` -`$ sudo systemctl disable --now systemd-resolved` -``` - -Alternately, to run them both: - - -``` - - -$ cat << EOF >> /etc/resolvmasq.conf -# my network name -domain home.local -# local hosts -enterprise 10.0.170.1 -yorktown 10.0.170.4 -# nameservers -nameserver 208.67.222.222 -nameserver 208.67.220.220 -EOF - -``` - -In this example, `home.local` is a domain name I give, either over Dynamic Host Configuration Protocol (DHCP) or locally, to all devices on my network. The computers `enterprise` and `yorktown` are my home servers, and by listing them here along with their local IP addresses, I can contact them by name through `dnsmasq`. Finally, the `nameserver` entries point to known good nameservers on the internet. You can use the nameservers listed here, or you can use nameservers provided to you by your ISP or any public nameserver you prefer. - -In your `dnsmasq.conf` file, set the `resolv-file` value to `resolvmasq.conf`: - - -``` -resolv-file=/etc/resolvmasq.conf -``` - -### Start dnsmasq - -Some distributions may have already started `dnsmasq` automatically upon installation. Others let you start it yourself when you're ready. Either way, you can use systemd to start the service: - - -``` -$ sudo systemd enable --now dnsmasq -``` - -Test it with the `dig` command. - -When you first contact a server, the query time might be anywhere from 50 to 500 milliseconds (hopefully not more than that): - - -``` - - -$ dig example.com | grep Query\ time -;; Query time: 56 msec - -``` - -The next time you try it, however, the query time is drastically reduced: - - -``` - - -$ dig example.com | grep Query\ time -;; Query time: 0 msec - -``` - -Much better! - -### Enable dnsmasq for your whole network - -Dnsmasq is a useful tool on one device, but it's even better when you let all the devices on your network benefit. - -Here's how you open the `dnsmasq` service up to your whole local network: - -#### 1\. Get the IP address of the server running the `dnsmasq` service - -On the computer running `dnsmasq`, get the local IP address: - - -``` - - -$ dig example.com | grep Query\ time -;; Query time: 0 msec - -``` - -In this example, the IP address of the Raspberry Pi I'm running `dnsmasq` on is 10.0.170.170. Because this Pi is now an important part of my network infrastructure, I have its address statically assigned by my DHCP router. Were I to allow it to get a dynamic IP address, it _probably_ would not change (DHCP is designed to be helpful that way) but if it did then my whole network would miss out on the benefit of `dnsmasq`. - -#### 2\. Modify the server's firewall to allow traffic on port 53 - -Open a port in your server's firewall using [firewall-cmd][4] so it allows DNS requests and sends responses. - - -``` -$ sudo firewall-cmd --add-service dns --permanent -``` - -#### 3\. Add the IP address of the server to the `nameserver` entry of your home router - -Knowing that my local DNS server's address is 10.0.170.170 (remember that it's almost certainly different on your own network), I can add it as the primary nameserver in my home router. - -There are many routers out there, and there's no singular interface. - -However, the task is the same, and the workflow is usually relatively similar from model to model. - -In my [Turris Omnia router][5], the advanced interface allows DNS forwarding, which sends DNS requests to a server of my choosing. - -Entering `10.0.170.170` (the IP of my `dnsmasq` server) here forces all DNS traffic to be routed through Dnsmasq for caching and resolution. - -![Screenshot of fields for DNS server settings for Turris Omnia router][6] - -(Seth Kenlon, [CC BY-SA 4.0][7]) - -  - -In my TP-Link router, on the other hand, DNS settings are configured in the DHCP panel. - -  - -![Advanced DNS settings for tp-link router][8] - -(Seth Kenlon, [CC BY-SA 4.0][7]) - -It may take some exploration, so don't be afraid to look around in your router's interface for DNS server settings. When you find it, enter your Dnsmasq server address and then save the changes. - -Some models require the router to reboot when changes are made. - -All devices on your network inherit settings from the router, so now all DNS traffic passing from a device to the internet gets passed through your Dnsmasq server. - -### Close to the edge - -As more and more websites get added to your server's DNS cache, DNS traffic will have to go farther than your local Dnsmasq server less and less often. - -The principle of computing locally and quickly whenever possible drives edge computing. You can imagine how important it is, just by going through this exercise, that technologies use strategic geographic locations to speed up internet interactions. - -Whether you're working on edge computing at home, at work, or as a cloud architect, the edge is an important component of the cloud, and it's one you can use to your advantage. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/3/dns-caching-edge - -作者:[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/mesh_networking_dots_connected.png?itok=ovINTRR3 (Mesh networking connected dots) -[2]: https://www.redhat.com/en/blog/red-hat-telecommunications-news?intcmp=7013a000002qLH8AAM -[3]: https://opensource.com/article/17/4/guide-to-mastodon -[4]: https://opensource.com/article/20/2/firewall-cheat-sheet -[5]: https://opensource.com/article/22/1/turris-omnia-open-source-router -[6]: https://opensource.com/sites/default/files/uploads/turris-dns.jpeg (Turris Omnia) -[7]: https://creativecommons.org/licenses/by-sa/4.0/ -[8]: https://opensource.com/sites/default/files/uploads/tplink-dns.jpeg (tp-link) diff --git a/sources/tech/20220301 Experience the Stunning Cutefish Desktop in Arch Linux.md b/sources/tech/20220301 Experience the Stunning Cutefish Desktop in Arch Linux.md deleted file mode 100644 index b31c1b4d6d..0000000000 --- a/sources/tech/20220301 Experience the Stunning Cutefish Desktop in Arch Linux.md +++ /dev/null @@ -1,150 +0,0 @@ -[#]: subject: "Experience the Stunning Cutefish Desktop in Arch Linux" -[#]: via: "https://www.debugpoint.com/2022/02/cutefish-arch-linux-install/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Experience the Stunning Cutefish Desktop in Arch Linux -====== -NOW YOU CAN EXPERIENCE THE CUTEFISH DESKTOP IN VANILLA ARCH LINUX. THIS -ARTICLE OUTLINES THE STEPS TO INSTALL THE CUTEFISH DESKTOP ENVIRONMENT -IN ARCH LINUX SYSTEMS. -![Cutefish Desktop in Arch Linux][1] - -### Cutefish Desktop - -A while back, [we reviewed CutefishOS][2], which features the awesome looking Cutefish desktop, which has received a positive reaction and reaches from the readers of our portal. So, we thought this was a perfect time if you want to do some experiments with this desktop in your favourite Arch Linux. Why not? - -Before you jump on to the installation part, here are some nuggets about Cutefish Desktop. - -Cutefish Desktop is part of [Cutefish OS][3], a new Linux distribution under development. This Debian based Linux distribution features the incredible looking, lightweight Cutefish Desktop. - -The Cutefish Desktop is written on Qt Quick, QML, C++ and KDE Framework for its inner workings. This modern desktop environment uses KWin and SDDM for window and display management. - -Cutefish Desktop brings a complete macOS inspired to look for your Linux desktop out-of-the-box. That means you get stunning icons, wallpapers, a global menu, a top bar with nice notification popups and a bottom dock. - -You can read a detailed review in our complete [write up here][2]. - -### Install Cutefish Desktop in Arch Linux - -#### Install base Arch System - -This guide assumes that you have a base Arch Linux installed in your system before trying these steps. Or, you can try if you have any Arch-based Linux distributions installed as well. Just be careful about the display management in those cases. - -You can refer to our guide for Arch Linux installation if you are new to Arch. - - * [How to install Arch Linux using archinstall (recommended)][4] - * [How to install Arch Linux (basic guide)][5] - - - -#### Install Cutefish Desktop - -The Arch Linux community repository contains the Cutefish group, which have all the component required for this desktop to run. It includes core packages, native applications and additional tools as mentioned below. - -At the terminal prompt of your Arch Linux system, run the below command to install all the Cutefish Desktop packages. - -``` - - pacman -S cutefish - -``` - -![A base Arch Linux prompt][6] - -![Install Cutefish in Arch Linux][7] - -Next, we need to install Xorg and display manager SDDM via the below command. Be careful if you install Cutefish desktop in an Arch install with other desktop environments – such as GNOME, KDE Plasma or Xfce. Because you already have a display manager and Xorg installed. So, you can easily skip this step. - -``` - - pacman -S xorg sddm - -``` - -After the above commands are complete, enable the display manager via systemctl. - -``` - - systemctl enable sddm - -``` - -That’s all you need to install Cutefish desktop as bare metal level. Once done, reboot the system, and you should see Cutefish Desktop as below after logging in. - -[][8] - -SEE ALSO:   How to Install GNOME Desktop in Arch Linux [Complete Guide] - -The base install requires additional customization because it’s not as close as Cutefish OS. - -### Post Install Configuration - -Although Cutefish group in Arch repo includes its native apps, such as Calculator and file manager, the desktop lacks basic applications that you need to install separately to make it a fully functional and productive desktop. - -I recommend installing the following essential apps using the below command for your base installation. You can skip this step or choose any other applications/combinations of your choice. - - * Firefox web browser - * Kwrite text editor - * Fonts (ttf-freefont) - * VLC media player - * Gwenview Image viewer - * GIMP Image Editor - * LibreOffice - * Transmission - - - -``` - - pacman -S firefox ttf-freefont kwrite vlc gwenview gimp libreoffice-still transmission-qt - -``` - -After installation, open the Settings and change the font of your choice. The default font was courier, which looks terrible on the desktop itself. - -Reboot the system once you complete all the customizations as per your choice. And enjoy Cutefish desktop in Arch Linux. - -![The Stunning Login Lock Screen of Cutefish Desktop][9] - -### Closing Notes - -This desktop is under development, so you would not find many settings items as of writing this. For example, there is no way to change resolutions, hiding dock and other options. That said, you can still use this with additional applications for your use. If you want to experiment, you can go ahead and try. - -Cheers. - -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][10], [Twitter][11], [YouTube][12], and [Facebook][13] and never miss an update! - -##### Also Read - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2022/02/cutefish-arch-linux-install/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://www.debugpoint.com/wp-content/uploads/2022/02/Cutefish-Desktop-in-Arch-Linux-1024x575.jpg -[2]: https://www.debugpoint.com/2021/11/cutefish-os-review-2021/ -[3]: https://en.cutefishos.com/ -[4]: https://www.debugpoint.com/2022/01/archinstall-guide/ -[5]: https://www.debugpoint.com/2020/11/install-arch-linux/ -[6]: https://www.debugpoint.com/wp-content/uploads/2022/02/A-base-Arch-Linux-prompt.jpg -[7]: https://www.debugpoint.com/wp-content/uploads/2022/02/Install-Cutefish-in-Arch-Linux.jpg -[8]: https://www.debugpoint.com/2020/12/gnome-arch-linux-install/ -[9]: https://www.debugpoint.com/wp-content/uploads/2022/02/The-Stunning-Login-Lock-Screen-of-Cutefish-Desktop-1024x576.jpg -[10]: https://t.me/debugpoint -[11]: https://twitter.com/DebugPoint -[12]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[13]: https://facebook.com/DebugPoint diff --git a/sources/tech/20220303 Nautilus File Manager Looks Amazing with GTK4 and Libadwaita - A Deep Dive.md b/sources/tech/20220303 Nautilus File Manager Looks Amazing with GTK4 and Libadwaita - A Deep Dive.md deleted file mode 100644 index f4c2b58a89..0000000000 --- a/sources/tech/20220303 Nautilus File Manager Looks Amazing with GTK4 and Libadwaita - A Deep Dive.md +++ /dev/null @@ -1,123 +0,0 @@ -[#]: subject: "Nautilus File Manager Looks Amazing with GTK4 and Libadwaita – A Deep Dive" -[#]: via: "https://www.debugpoint.com/2022/03/gnome-files-43/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Nautilus File Manager Looks Amazing with GTK4 and Libadwaita – A Deep Dive -====== -WE TEST-DRIVE THE DEVELOPMENT VERSION OF GNOME FILES VERSION 43 AND GIVE -YOU DETAILS ABOUT ITS LOOKS, FEATURES AND PERFORMANCE. -GNOME Files (formerly Nautilus) is perhaps the most used desktop application today in GNOME eco-space. And it never received much of an overhaul since its first release while the rest of the GNOME applications and the desktop itself moved to a newer tech stack. - -Everything changes now. The GNOME developers are adopting GTK4 and libadwaita for the entire desktop and Files. - -GNOME Files version 43, which would release with GNOME 43 release later in 2022, would be impressive. The much-needed [rework][1] brings native dark mode, great UI with nice libadwaita touch and GTK4 performance boost. - -### GNOME Files 43 - -We installed the development Flatpak version of GNOME Files 43, and here’s what we found. - -At first glance, you should notice the nice UI touch – thanks to Libadwaita. The close button is nice and round, while the address bar, selection highlighter, and entire Files window are all properly spaced with rounded corners. - -The border highlighters are not present for all the components. - -Here’s a quick comparison of the light and dark modes for versions 43 (left) and 42 (right). - -![GNOME Files 43 and 42 – Light Mode Comparison][2] - -![GNOME Files 43 and 42 – Dark Mode Comparison][3] - -The address bar folder separator remains the same. However, the fonts are a little polished. The address bar context menu changed. The option is gone; instead, you get **Open in Other application** menu item. A new option, **Create Link**, is introduced. I think many users will miss the Open in Terminal option. - -![New option in address bar menu][4] - -Another significant change you should notice in the two main toolbar menus – a) view button and the b) main hamburger menu. Those context menu items show the keyboard shortcuts along with menu items. This makes them look a little more prominent as well. - -![The Hamburger menu now have keyboard shortcuts][5] - -The folder’s context menu now has a little up arrow pointing to the folder from where it popped up. The right-click context menu for a folder is well organized with groups. For example, the opening actions are grouped while cut, copy, paste are distinctively separate with a horizontal bar in the context menu. - -![Context Menu for folder changes][6] - -I also noticed a new option, “Paste into the folder”, which is nice. - -The Nautilus Search remains almost the same as Files 42, except you can search by Created date/time in Files 43. - -However, I noticed one exciting change. The application name for file association in the context menu is removed. For example, if you try to open a text document today in Files 42, it shows the application name associated with it in the context menu. In Files 43, it just shows “Open”. This change, I feel, was unnecessary. It was better earlier. - -![A subtle change in context menu for file association][7] - -So, that’s the overall changes I found in the new GTK4 version of this application. But it looks nice? Isn’t it. Moreover, if you are coming straight from Ubuntu 20.04 LTS, which contains Files 3.38, then perhaps your experience would be a “wow”. Most of the sections changed if you compare Files 43 with Files 3.38. It would be quite an experience for those users. - -[][8] - -SEE ALSO:   Access Google Drive and Sync Calendar in Ubuntu 16.04 using Nautilus - -You should remember version 43 is still in development so that things may change in the coming days in the final shipment. - -### Wish List - -If I compare various Linux file managers, others have far more options than GNOME Files today. - -I agree. - -For example, Nemo or Dolphin – the two best file managers outsmart Files in various ways. To compare the features, GNOME Files doesn’t have some popular features – - - * Dual-pane or split view - * Opening a root folder from the context menu is difficult - * An up arrow for folder browsing - * No option to create a new file (text, spreadsheet, etc.) from the context menu - * More Sorting and Searching Functions - - - -We hope these features come to GNOME Files soon. - -### When it will be available - -As stated above, this version of GNOME Files will be available with GNOME 43. Hence, you should have it on Ubuntu 22.10 during the October 2022 cycle and Fedora 37 later this year from the Linux Distribution schedule perspective. - -Unfortunately, [Ubuntu 22.04 LTS][9] (Jammy Jellyfish) and [GNOME 42][10] with [Fedora 36][11] would not have GNOME Files 43. The primary reason is the schedule mismatch, and it is one of the complex applications to port to GTK4 and test thoroughly. However, most of the above stated internal features would still be available with Files 42. But it may lack the nice UI changes and theme. - -That said, I believe the popular file manager looks nice, and users should be thrilled to use it when it releases. Let me know your opinion about the new changes in GNOME Files 43 below in the comment box. - -Cheers. - -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][12], [Twitter][13], [YouTube][14], and [Facebook][15] and never miss an update! - -##### Also Read - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2022/03/gnome-files-43/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://gitlab.gnome.org/GNOME/nautilus -[2]: https://www.debugpoint.com/wp-content/uploads/2022/03/GNOME-Files-43-and-42-Light-Mode-Comparison-1024x502.jpg -[3]: https://www.debugpoint.com/wp-content/uploads/2022/03/GNOME-Files-43-and-42-Dark-Mode-Comparison-1024x493.jpg -[4]: https://www.debugpoint.com/wp-content/uploads/2022/03/New-option-in-address-bar-menu-1024x267.jpg -[5]: https://www.debugpoint.com/wp-content/uploads/2022/03/The-Hamburger-menu-now-have-keyboard-shortcuts-1024x331.jpg -[6]: https://www.debugpoint.com/wp-content/uploads/2022/03/Context-Menu-for-folder-changes-1024x560.jpg -[7]: https://www.debugpoint.com/wp-content/uploads/2022/03/A-subtle-change-in-context-menu-for-file-association-1024x524.jpg -[8]: https://www.debugpoint.com/2016/05/access-google-drive-and-sync-calendar-in-ubuntu-16-04-using-nautilus/ -[9]: https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/ -[10]: https://www.debugpoint.com/2021/12/gnome-42/ -[11]: https://www.debugpoint.com/2022/02/fedora-36/ -[12]: https://t.me/debugpoint -[13]: https://twitter.com/DebugPoint -[14]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[15]: https://facebook.com/DebugPoint diff --git a/sources/tech/20220303 Ubuntu vs Arch- Which Linux Distro is better.md b/sources/tech/20220303 Ubuntu vs Arch- Which Linux Distro is better.md deleted file mode 100644 index d2233d6598..0000000000 --- a/sources/tech/20220303 Ubuntu vs Arch- Which Linux Distro is better.md +++ /dev/null @@ -1,287 +0,0 @@ -[#]: subject: "Ubuntu vs Arch: Which Linux Distro is better?" -[#]: via: "https://itsfoss.com/ubuntu-vs-arch/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Ubuntu vs Arch: Which Linux Distro is better? -====== - -Ubuntu and Arch Linux offer entirely different desktop experiences.  - -It is often tough to choose one of them as your daily driver, especially when you cannot ignore the [benefits of Arch Linux][1] and Ubuntu. - -They are both incredible choices for what they are. But, how do you choose what is best between these two? - -Here, I highlight various differences between Ubuntu and Arch Linux that can help you decide. - -![][2] - -### 1\. Targeted Users - -Arch Linux aims to provide a **Do-It-Yourself (DIY)** experience to tinkerers looking to customize various elements of their Linux system. - -Things like building packages to customizing the desktop, everything counts.  - -The out-of-the-box experience depends on the user who [installs and sets up Arch Linux][3]. Hence, it can easily cater to users looking for different packages, desktop environments, and more. - -On the other hand, Ubuntu targets users who want a **hassle-free pre-configured setup** for their Linux system. - -These users want essential tools installed, ensuring it all works as it is supposed to. In other words, the user gets an ideal desktop experience without worrying about setting it up. - -Ubuntu does not want users to put more effort into improving their experience. Instead, they present it as they think would suit most users. - -### 2\. Installation - -Undoubtedly, Ubuntu provides a more straightforward installation method, given that you get a GUI to help install it to your desktop. - -![][4] - -You can even [install a GUI on the Ubuntu server][5] if you want. - -With Arch Linux, you will have to rely on the terminal (or the command-line) to complete the installation. - -![][6] - -Fortunately, [Arch Linux now has a guided installer][7], which makes it easier to follow through installing Arch Linux via the terminal. - -![][8] - -Still, Ubuntu takes the lead with the convenience. - -### 3\. Desktop Experience - -![][9] - -Ubuntu is tailored to **provide convenience** to its users. To achieve that, Canonical provides a customized GNOME desktop environment experience to make things easy. - -While you may not get the same level of customization that KDE Plasma provides, you still have plenty of options, to begin with. If you are curious, you may check out our [KDE vs GNOME comparison][10] for more details. - -Ubuntu also takes regular user experience feedback from its users and tries its best to offer the best workflow/productivity. - -Arch Linux focuses **more on functionality**, and other technical aspects, over the desktop user experience. The end-user experience entirely depends on how you set things up when installing Arch Linux on your system. - -You will have to rely on what the desktop environment offers out-of-the-box; there are no custom-made improvements for you. If you want something different, you will have to tweak things to make it happen. - -![Arch Linux with GNOME][11] - -However, the ability to opt for KDE Plasma, GNOME, or any [other desktop environment][12] can give you some advantages as per your preferences. - -Not only that, but you can also choose window tiling managers when installing Arch Linux. - -Overall, with Ubuntu, you get a particular type of desktop experience offered to every user, with little to no ability to customize it. - -But, Arch Linux gives you the **freedom to define how you want the desktop experience**. Note that this might be a good thing for experienced Linux users. But, if you are new to Linux, this can be overwhelming. - -### 4\. File System - -Most users do not need to worry about the file system used by their Linux distribution. - -Hence, Ubuntu sticks with **ext4** for its file system, a robust file system with all the essentials needed for a modern computing experience. - -However, if you want to choose a different file system for various benefits over the most-commonly used **ext4**, Arch Linux can come in handy. - -![][13] - -You can choose between btrfs, ext4, xfs, and f2fs. The benefits of these file systems are beyond the scope of this article, but make sure that you know what you are doing if selecting anything else over **ext4**. - -### 5\. App Ecosystem - -Ubuntu offers support for a wide range of applications. Undoubtedly, this is why [most of the popular Linux distributions][14] are based on Ubuntu. - -![][15] - -And, keeping its popularity in mind, various tools primarily support Ubuntu among other Linux distributions. - -Not just the choices of apps/packages, but it is also effortless to install packages available for Ubuntu. You can install packages through its official repositories, use PPAs, or its software center (with Snap integration). - -While it does not have [Flatpak][16] built-in, you can [set it up to install apps from Flathub][17]. - -Arch Linux also gets you access to countless applications through its official repositories. - -However, some app developers may not officially support Arch Linux compared to Ubuntu. - -Additionally, you will notice that you need to utilize [pacman to install/manage packages][18]. The GUI to install/manage applications will depend on the desktop environment you select to install. - -![][19] - -For instance, you can access GNOME’s software center if you install GNOME. And, Discover for KDE Plasma. - -You will have no Snap or Flatpak integration built-in, so you must set it up as required. - -To get access to more packages, you can use [AUR][20]. Note that it features community-builds for packages and may not be officially recommended for everything. - -![][21] - -Despite that, it is often considered a strong point for Arch Linux because the number of packages offered overall could be more extensive than what Ubuntu features. - -You can use some [AUR helpers][22] to improve the experience. - -Overall, if you want a single portal to easily manage/install software, Ubuntu - -### 6\. Minimal vs Bloat Experience - -This is purely based on preferences. Just because Arch Linux lets you control everything when you set it up, you can choose to install a minimum number of packages. - -In contrast, Ubuntu comes pre-installed with several utilities. For some, Ubuntu can come in handy for the presence of valuable tools. - -![][23] - -Of course, you can uninstall packages that you do not need. - -However, some users might find it unnecessary (or bloat). - -So, you will need to decide if you want the necessary tools pre-installed (Ubuntu) or prefer a distro that lets you install only the tools you need (Arch) without any bloat. - -### 7\. Freedom to Choose vs Restrictions - -![Arch Linux \(Neofetch\)][24] - -As I mentioned, Arch Linux lets you control everything; it gives you plenty of freedom to customize your experience. - -Not just limited to the desktop environment or tiling window managers, but more. - -For instance, you can select the preferred audio server between PulseAudio and pipewire. - -You can also choose a specific Linux Kernel, like a hardened version for additional security, a zen variant for an enhanced experience, or the LTS version of the Linux Kernel. - -In contrast, Ubuntu sticks to the Linux Kernel, which has been thoroughly tested and uses PulseAudio as audio server by default (at the time of writing this). - -Ultimately, what you want will influence what’s best for you. - -### 8\. Community Support - -Ubuntu, with its vast user base offers massive community support. There are numerous forums/portals to guide Ubuntu users and help troubleshoot issues. - -![itsfoss community][25] - -You can also ask around the forums (including our [It’s FOSS community][26]), to get quick help. - -Arch Linux does not offer that kind of community support, given its userbase. However, the Arch Linux wiki provides excellent documentation on almost everything to compensate for that. - -![arch wiki][27] - -[Arch Linux wiki][28] is probably one of the most extensive documentation if you want to explore yourself. - -### 9\. Release Schedule - -Ubuntu offers a [Long-Term Support version][29] that receives minor updates for five years or more (for enterprises). - -![][30] - -It also provides non-LTS versions that receive updates for about nine months while having a new release available every six months. The non-LTS version suits users who want the latest updates/packages, with potentially significant changes with every upgrade. - -The LTS version is better suited for users who do not want experience-breaking changes with every update. - -For more information, you can explore our resource on [Ubuntu’s release cycles and end of life][31]. - -Arch Linux does not bother with any of these; instead, it relies on a [rolling-release schedule][32]. You receive updates as they come, whether it’s minor/major. - -![][33] - -This ensures that you are using the latest and greatest packages all the time. This can sometimes be a good thing, but it can be inconvenient for some users when it breaks something. - -### 10\. Hardware Compatibility - -![][34] - -Ubuntu is a popular distribution aimed at desktops. So, it is tested for compatibility with a range of hardware before releasing a version. - -So, it is safe to say that **Ubuntu offers good hardware compatibility out of the box**. - -In the case of Arch Linux, it does not get tested as extensively as Ubuntu. So, it may/may not work with the hardware you have. - -However, just because it features the latest and greatest Linux Kernel packages, it could prove to work better than Ubuntu in some cases. - -If you are confused about the compatibility of your hardware, I would suggest asking around to make sure that there are no known issues with the system you want to run Arch Linux. - -With Ubuntu, everything works unless you have bleeding-edge tech. - -### 11\. Stability - -If you do not need your distro to fail or encounter an error, **Ubuntu should be a better choice**. - -In the case of Arch Linux, the answer is not straightforward, and it can work well or go down with an update. - -Arch Linux is not inherently stable, and you need to maintain it yourself to ensure that nothing breaks with customization and updates. - -### Final Thoughts: What Should You Pick? - -Keeping stability, compatibility, app ecosystem, and the learning curve in mind, Ubuntu is perfectly suitable for anyone who wants to get things done on their computer instead of tweaking the experience. - -Arch Linux comes on top for users looking to customize their desktop experience to suit their workflow and choose to have some of the latest and greatest stuff. - -Arch Linux can be an exciting experience if you are looking for an adventure, but overwhelming for some compared to Ubuntu. - -So, considering all that, **what do you think you will choose?** Let me know your thoughts in the comments below. - -### Frequently Asked Questions: If You Still Haven’t Picked One - -Some of you still might have questions to come up with a conclusion, here’s an FAQ to address that: - -**Is Arch Better than Ubuntu?** - -Yes, and no. Arch Linux is technically better, but you also need to think about its stability, app ecosystem, and the learning curve to maintain it. So, you need to re-evaluate the answer to this question based on your preferences. - -**Which is faster, Ubuntu or Arch?** - -Arch Linux, with a minimal installation setup. But, the answer will change as per your configuration. - -Note that Ubuntu is not noticeably slower, but just because it includes more packages out of the box, some might find it bloated. - -**Should I switch to Arch Linux from Ubuntu?** - -If you want to tweak your experience, and want the latest/greatest packages all the time without worrying about stability, Arch Linux is your friend. - -If you think that you just need the essentials to carry out the tasks on your PC, Ubuntu should suffice. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ubuntu-vs-arch/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/why-arch-linux/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/ubuntu-vs-arch.jpg?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/install-arch-linux/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/try-ubuntu-install-ubuntu.jpeg?resize=800%2C530&ssl=1 -[5]: https://itsfoss.com/install-gui-ubuntu-server/ -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/arch-linux-boot-menu-install.png?resize=635%2C481&ssl=1 -[7]: https://news.itsfoss.com/arch-new-guided-installer/ -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/arch-install-terminal.png?resize=800%2C279&ssl=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/ubuntu-20-04-ux.jpg?resize=800%2C407&ssl=1 -[10]: https://itsfoss.com/kde-vs-gnome/ -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/arch-linux-gnome.png?resize=732%2C413&ssl=1 -[12]: https://itsfoss.com/what-is-desktop-environment/ -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/arch-linux-filesystem.png?resize=800%2C149&ssl=1 -[14]: https://itsfoss.com/best-linux-distributions/ -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/ubuntu-software-center.png?resize=800%2C574&ssl=1 -[16]: https://itsfoss.com/what-is-flatpak/ -[17]: https://itsfoss.com/flatpak-guide/ -[18]: https://itsfoss.com/pacman-command/ -[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/arch-install-terminal-software.png?resize=763%2C431&ssl=1 -[20]: https://itsfoss.com/aur-arch-linux/ -[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/sky-aur-install.png?resize=800%2C560&ssl=1 -[22]: https://itsfoss.com/best-aur-helpers/ -[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/ubuntu-utilities.png?resize=800%2C520&ssl=1 -[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/arch-linux-neofetch.png?resize=800%2C533&ssl=1 -[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/itsfoss-community.jpg?resize=800%2C580&ssl=1 -[26]: https://itsfoss.community/ -[27]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/arch-wiki.png?resize=800%2C332&ssl=1 -[28]: https://wiki.archlinux.org/ -[29]: https://itsfoss.com/long-term-support-lts/ -[30]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/ubuntu-info.png?resize=800%2C595&ssl=1 -[31]: https://itsfoss.com/end-of-life-ubuntu/ -[32]: https://itsfoss.com/rolling-release/ -[33]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/arch-info.png?resize=800%2C573&ssl=1 -[34]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/hardware-compatibility-illustration.png?resize=800%2C450&ssl=1 diff --git a/sources/tech/20220305 10 Awesome Apps to Improve Your GNOME Desktop Experience -Part 5.md b/sources/tech/20220305 10 Awesome Apps to Improve Your GNOME Desktop Experience [Part 5].md similarity index 58% rename from sources/tech/20220305 10 Awesome Apps to Improve Your GNOME Desktop Experience -Part 5.md rename to sources/tech/20220305 10 Awesome Apps to Improve Your GNOME Desktop Experience [Part 5].md index ba0a15e91a..f9f723f476 100644 --- a/sources/tech/20220305 10 Awesome Apps to Improve Your GNOME Desktop Experience -Part 5.md +++ b/sources/tech/20220305 10 Awesome Apps to Improve Your GNOME Desktop Experience [Part 5].md @@ -1,7 +1,7 @@ [#]: subject: "10 Awesome Apps to Improve Your GNOME Desktop Experience [Part 5]" [#]: via: "https://www.debugpoint.com/2022/03/best-gnome-apps-part-5/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" +[#]: collector: "lkxed" [#]: translator: " " [#]: reviewer: " " [#]: publisher: " " @@ -9,35 +9,31 @@ 10 Awesome Apps to Improve Your GNOME Desktop Experience [Part 5] ====== -HERE, WE SHOWCASE THE NEXT SET OF 10 GNOME APPS THAT WILL SUPERCHARGE -YOUR PRODUCTIVITY WHILE USING GNOME DESKTOP. +Here, we showcase the next set of 10 GNOME Apps that will improve your productivity while using your favourite GNOME Desktop. + At debugpoint.com, we showcase some cool and helpful GNOME apps over a five-part series. The main reason is to raise awareness about the rich GNOME ecosystems with these awesome apps. And it also helps the developers as our readers give these awesome GNOME apps much-needed recognition. This post is the final part, i.e. part 5 of the awesome GNOME app series. In this part 5, we will showcase ten applications. If you missed the last parts, you can read the other parts of this series via the below links. - * [Part 1][1] - * [Part 2][2] - * [Part 3][3] - * [Part 4][4] - - +* [Part 1][1] +* [Part 2][2] +* [Part 3][3] +* [Part 4][4] In this article, we covered the following list of awesome GNOME Apps. - * [Podcasts – podcasts client][5] - * [Tootle – Mastodon client][6] - * [Tangram – Web App Browser][7] - * [Wike – Wikipedia browser for desktop][8] - * [Devhelp – API Search for developers][9] - * [Lorem – Random text generator][10] - * [Rnote – Whiteboard drawing app][11] - * [Frogr – Flickr Client][12] - * [GTG – Personal task and to-do manager][13] - * [Recipes – Cooking guide][14] - - +* Podcasts – podcasts client +* Tootle – Mastodon client +* Tangram – Web App Browser +* Wike – Wikipedia browser for desktop +* Devhelp – API Search for developers +* Lorem – Random text generator +* Rnote – Whiteboard drawing app +* Frogr – Flickr Client +* GTG – Personal task and to-do manager +* Recipes – Cooking guide ### 10 Awesome GNOME Apps @@ -47,25 +43,25 @@ We all love Podcasts, and it’s still going strong. Podcasts are native GNOME a Here’s a quick summary of the features: - * Nice and clean user interface UI - * Play, update and complete management of your podcasts from UI - * Well, integration with GNOME Desktop such as notifications. - * Bookmark your listening to start listening over again - * Support of RSS/Atop for podcasting service via Soundcloud and iTunes - * Import option via OPML files +* Nice and clean user interface UI +* Play, update and complete management of your podcasts from UI +* Well, integration with GNOME Desktop such as notifications. +* Bookmark your listening to start listening over again +* Support of RSS/Atop for podcasting service via Soundcloud and iTunes +* Import option via OPML files +![Podcasts App][5] +**How to Install** -![Podcasts App][15] +You need to [Setup Flatpak][6] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). -You need to [Setup Flatpak][16] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - -[Install Podcast][17] - - * [Home page][18] - * [Source code][19] +[Install Podcast][7] +**More details about Podcasts** +* [Home page][8] +* [Source code][9] #### Tootle – Mastodon client @@ -73,65 +69,69 @@ The next app we would like to feature is Tootle – a Mastodon client for the GN This application well integrates with the GNOME desktop and comes with a Flatpak build for installation. -![Tootle][20] +![Tootle][10] -You need to [Setup Flatpak][16] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). +**How to Install** -[Install Tootle][21] +You need to [Setup Flatpak][11] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - * [Home page][22] - * [Source code][23] +[Install Tootle][12] +**More details about Tootle** +* [Home page][13] +* [Source code][14] #### Tangram – Web app browser This application is one of my favourites. And I am sure it would be for you as well. Tangram is a browser for Web Apps. Web Apps behaves as desktop apps for your favourite websites. So, using Tangram, you can manage your multiple web applications together with its unique vertical tab browser. -Each of the tabs is persistent and independent. That means, for example, you can open multiple Google accounts together in separate tabs without worrying about login conflicts or expiry. You can also group the type of web apps using this application. Suppose you would like to group all messager applications such as WhatsApp, Facebook Meeesagner & Telegram. In that case, you can do that quickly, and it’s easier for you to monitor and be productive. +Each of the tabs is persistent and independent. That means, for example, you can open multiple Google accounts together in separate tabs without worrying about login conflicts or expiry. You can also group the type of web apps using this application. Suppose you would like to group all messager applications such as WhatsApp, Facebook Meeesagner & Telegram. In that case, you can do that quickly, and it’s easier for you to monitor and be productive. If used and appropriately configured, Tangram can reduce digital notification overhead in your mobile, save time and eventually help you focus more. -![Tangram][24] +![Tangram - an awesome GNOME app for all][15] + +**How to Install** You need to [Setup Flatpak][16] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). -[Install Tangram][25] - - * [Home page][26] - * [Source code][27] +[Install Tangram][17] +**More details about Tangram** +* [Home page][18] +* [Source code][19] #### Wike – Wikipedia Browser We all love Wikipedia. There is a GNOME native application to browse Wikipedia, right from your desktop if I tell you. The app’s name is Wike, and it comes with the below set of features. - * Open multiple articles in tabs - * Multiple languages - * Search suggestions - * List of recent articles - * Simple bookmarks management - * Text search in articles - * Article table of contents - * View article in other languages - * GNOME Shell search integration - * Light, dark and sepia themes - - +* Open multiple articles in tabs +* Multiple languages +* Search suggestions +* List of recent articles +* Simple bookmarks management +* Text search in articles +* Article table of contents +* View article in other languages +* GNOME Shell search integration +* Light, dark and sepia themes I am sure you can get the most out of Wikipedia for your research, knowledge gathering, or work with the above features. -![Wike – an awesome GNOME app][28] +![Wike - an awesome GNOME app][20] -You need to [Setup Flatpak][16] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). +**How to Install** -[Install Wike][29] +You need to [Setup Flatpak][21] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - * [Home page][30] - * [Source code][30] +[Install Wike][22] +**More details about Wike** +* [Home page][23] +* [Source code][24] #### Devhelp – API Browser @@ -139,22 +139,20 @@ The next app we would like to highlight is Devhelp. As its name says, this deskt By default, it comes with GTK-doc, i.e. GTK documentation are available as per the installations. However, you can configure it for other development languages provided; you have the API documentation HTML and *.devhelp2 index file is generated. -[][31] - -SEE ALSO:   Top 10 KDE Plasma Hidden Feature That You Didn't Know About - A fantastic tool, I must say. -![Devhelp][32] +![Devhelp][25] -You need to [Setup Flatpak][16] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). +**How to Install** -[Install devhelp][33] +You need to [Setup Flatpak][26] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - * [Home page][34] - * [Source code][35] +[Install devhelp][27] +**More details about Devhelp** +* [Home page][28] +* [Source code][29] #### Lorem – Random Text Generator @@ -162,32 +160,36 @@ We often need placeholder text for various needs. And for that, the famous “Lo This GNOME app, named Lorem, does just that. Based on your input, it can generate blocks of text that you can easily copy and use for your work. -![Lorem][36] +![Lorem][30] -You need to [Setup Flatpak][16] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). +**How to Install** -[Install Lorem][37] +You need to [Setup Flatpak][31] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - * [Home page][38] - * [Source code][39] +[Install Lorem][32] +**More details about Lorem** +* [Home page][33] +* [Source code][34] #### Rnote – Whiteboard Tool Rnote is an excellent application for taking handwritten notes via touch devices. This application is vector image-based and helps to draw annotate pictures and PDFs. It brings native .rnote file format with import/export options for png, jpeg, SVG and PDF. -One of the cool features of Rnote is that it supports [Xournal++ file format][40] support which makes it a must-have tool. +One of the cool features of Rnote is that it supports [Xournal++ file format][35] support which makes it a must-have tool. -![Rnote – Whiteboard Application for Linux based on GTK4 and Rust][41] +![Rnote – Whiteboard Application for Linux based on GTK4 and Rust][36] -You need to [Setup Flatpak][16] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). +**How to Install** -[Install Rnote][42] +You need to [Setup Flatpak][37] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - * [Source code][43] +[Install Rnote][38] +**More details about Rnote** +* [Source code][39] #### Frogr – Flickr Client @@ -195,33 +197,37 @@ If you still love and use the image hosting platform Flickr, then Frogr is the t It is a perfect application for those whose workflow deals with heavy photo management and doesn’t want to deal with web browsers. -![Frogr][44] +![Frogr][40] -You need to [Setup Flatpak][16] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). +**How to Install** -[Install Frogr][45] +You need to [Setup Flatpak][41] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - * [Home page][46] - * [Source code][47] +[Install Frogr][42] +**More details about Frogr** +* [Home page][43] +* [Source code][44] #### GTG – Getting Things GNOME: To do manager -Are you procrastinating too much or having trouble finishing small to larger tasks in your day to day life. Then this next application is perfect for you. GTG, aka Getting Things Gnome, is one of the best personal tasks and to-do managers and organizers for GNOME Desktop. It is inspired by the [Getting Things Done methodology][48] and brings more features to manage your time while accomplishing tasks perfectly. +Are you procrastinating too much or having trouble finishing small to larger tasks in your day to day life. Then this next application is perfect for you. GTG, aka Getting Things Gnome, is one of the best personal tasks and to-do managers and organizers for GNOME Desktop. It is inspired by the[Getting Things Done methodology][45] and brings more features to manage your time while accomplishing tasks perfectly. GTG user interface is neat with flexibility that helps you create and manage tasks with tagging, dependencies, colour codes, search, and many search features. If you have not tried this app yet, you should check it out. -![GTG][49] +![GTG][46] -You need to [Setup Flatpak][16] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). +**How to Install** -[Install GTG][50] +You need to [Setup Flatpak][47] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - * [Home page][51] - * [Documentation][52] +[Install GTG][48] +**More details about GTG** +* [Home page][49] +* [Documentation][50] #### Recipes – Cooking helper @@ -231,16 +237,18 @@ Right from its user interface, you can discover what to cook today, tomorrow or Interested? Here’s how to install it. -![Recipes][53] +![Recipes][51] -You need to [Setup Flatpak][16] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). +**How to Install** -[Install Recipes][54] +You need to [Setup Flatpak][52] for your Linux distribution. And then click on the below button to launch the native software manager to install (such as Software or Discover). - * [Home page][55] - * [Source code][56] +[Install Recipes][53] +**More details about Recipes** +* [Home page][54] +* [Source code][55] ### Closing Notes @@ -248,90 +256,83 @@ This concludes part 5 and the GNOME Apps series. I hope you get to know many unk If you missed the previous stories, you could read them here. -[Part 1][1] – [Part 2][2] – [Part 3][3] – [Part 4][4] +[Part 1][56] – [Part 2][57] – [Part 3][58] – [Part 4][59] And finally, do let me know your comments, suggestions, or anything in the comment box below. And stay tuned for the next series on a different topic. Cheers. -_Some image credit: GNOME and respective developers_ - -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][57], [Twitter][58], [YouTube][59], and [Facebook][60] and never miss an update! - -##### Also Read +*Some image credit: GNOME and respective developers* -------------------------------------------------------------------------------- via: https://www.debugpoint.com/2022/03/best-gnome-apps-part-5/ 作者:[Arindam][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 +[b]: https://github.com/lkxed [1]: https://www.debugpoint.com/2021/12/best-gnome-apps-part-1/ [2]: https://www.debugpoint.com/2021/12/best-gnome-apps-part-2/ [3]: https://www.debugpoint.com/2022/01/best-gnome-apps-part-3/ [4]: https://www.debugpoint.com/2022/02/best-gnome-apps-part-4/ -[5]: tmp.LpD9K2ZERp#podcasts -[6]: tmp.LpD9K2ZERp#tootle -[7]: tmp.LpD9K2ZERp#tangram -[8]: tmp.LpD9K2ZERp#wike -[9]: tmp.LpD9K2ZERp#devhelp -[10]: tmp.LpD9K2ZERp#lorem -[11]: tmp.LpD9K2ZERp#rnote -[12]: tmp.LpD9K2ZERp#frogr -[13]: tmp.LpD9K2ZERp#gtg -[14]: tmp.LpD9K2ZERp#recipes -[15]: https://www.debugpoint.com/wp-content/uploads/2022/03/Podcasts-App-1024x579.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/03/Podcasts-App.jpg +[6]: https://flatpak.org/setup/ +[7]: https://dl.flathub.org/repo/appstream/org.gnome.Podcasts.flatpakref +[8]: https://wiki.gnome.org/Apps/Podcasts +[9]: https://gitlab.gnome.org/World/podcasts +[10]: https://www.debugpoint.com/wp-content/uploads/2022/03/Tootle.jpg +[11]: https://flatpak.org/setup/ +[12]: https://dl.flathub.org/repo/appstream/com.github.bleakgrey.tootle.flatpakref +[13]: https://apps.gnome.org/app/com.github.bleakgrey.tootle/ +[14]: https://github.com/bleakgrey/tootle +[15]: https://www.debugpoint.com/wp-content/uploads/2022/03/Tangram-1024x573.jpg [16]: https://flatpak.org/setup/ -[17]: https://dl.flathub.org/repo/appstream/org.gnome.Podcasts.flatpakref -[18]: https://wiki.gnome.org/Apps/Podcasts -[19]: https://gitlab.gnome.org/World/podcasts -[20]: https://www.debugpoint.com/wp-content/uploads/2022/03/Tootle.jpg -[21]: https://dl.flathub.org/repo/appstream/com.github.bleakgrey.tootle.flatpakref -[22]: https://apps.gnome.org/app/com.github.bleakgrey.tootle/ -[23]: https://github.com/bleakgrey/tootle -[24]: https://www.debugpoint.com/wp-content/uploads/2022/03/Tangram-1024x573.jpg -[25]: https://dl.flathub.org/repo/appstream/re.sonny.Tangram.flatpakref -[26]: https://apps.gnome.org/app/re.sonny.Tangram/ -[27]: https://github.com/sonnyp/Tangram -[28]: https://www.debugpoint.com/wp-content/uploads/2022/03/Wike-an-awesome-GNOME-app.jpg -[29]: https://dl.flathub.org/repo/appstream/com.github.hugolabe.Wike.flatpakref -[30]: https://hugolabe.github.io/Wike/ -[31]: https://www.debugpoint.com/2021/12/kde-plasma-hidden-feature/ -[32]: https://www.debugpoint.com/wp-content/uploads/2022/03/Devhelp-1024x574.jpg -[33]: https://dl.flathub.org/repo/appstream/org.gnome.Devhelp.flatpakref -[34]: https://apps.gnome.org/app/org.gnome.Devhelp/ -[35]: https://gitlab.gnome.org/GNOME/devhelp -[36]: https://www.debugpoint.com/wp-content/uploads/2022/03/Lorem.jpg -[37]: https://dl.flathub.org/repo/appstream/org.gnome.design.Lorem.flatpakref -[38]: https://apps.gnome.org/app/org.gnome.design.Lorem/ -[39]: https://gitlab.gnome.org/World/design/lorem -[40]: https://www.debugpoint.com/2022/02/top-whiteboard-applications-linux/ -[41]: https://www.debugpoint.com/wp-content/uploads/2022/02/Rnote-Whiteboard-Application-for-Linux-based-on-GTK4-and-Rust-1024x576.jpg -[42]: https://dl.flathub.org/repo/appstream/com.github.flxzt.rnote.flatpakref -[43]: https://github.com/flxzt/rnote -[44]: https://www.debugpoint.com/wp-content/uploads/2022/03/Frogr.jpg -[45]: https://flathub.org/repo/appstream/org.gnome.frogr.flatpakref -[46]: https://wiki.gnome.org/Apps/Frogr -[47]: https://gitlab.gnome.org/GNOME/frogr -[48]: https://en.wikipedia.org/wiki/Getting_Things_Done -[49]: https://www.debugpoint.com/wp-content/uploads/2022/03/GTG-1024x669.jpg -[50]: https://dl.flathub.org/repo/appstream/org.gnome.GTG.flatpakref -[51]: https://wiki.gnome.org/Apps/GTG -[52]: https://fortintam.com/gtg/user_manual/ -[53]: https://www.debugpoint.com/wp-content/uploads/2022/03/Recepies.jpg -[54]: https://gitlab.gnome.org/GNOME/recipes/raw/master/flatpak/gnome-recipes.flatpakref -[55]: https://wiki.gnome.org/Apps/Recipes -[56]: https://gitlab.gnome.org/GNOME/recipes/ -[57]: https://t.me/debugpoint -[58]: https://twitter.com/DebugPoint -[59]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[60]: https://facebook.com/DebugPoint +[17]: https://dl.flathub.org/repo/appstream/re.sonny.Tangram.flatpakref +[18]: https://apps.gnome.org/app/re.sonny.Tangram/ +[19]: https://github.com/sonnyp/Tangram +[20]: https://www.debugpoint.com/wp-content/uploads/2022/03/Wike-an-awesome-GNOME-app.jpg +[21]: https://flatpak.org/setup/ +[22]: https://dl.flathub.org/repo/appstream/com.github.hugolabe.Wike.flatpakref +[23]: https://hugolabe.github.io/Wike/ +[24]: https://hugolabe.github.io/Wike/ +[25]: https://www.debugpoint.com/wp-content/uploads/2022/03/Devhelp.jpg +[26]: https://flatpak.org/setup/ +[27]: https://dl.flathub.org/repo/appstream/org.gnome.Devhelp.flatpakref +[28]: https://apps.gnome.org/app/org.gnome.Devhelp/ +[29]: https://gitlab.gnome.org/GNOME/devhelp +[30]: https://www.debugpoint.com/wp-content/uploads/2022/03/Lorem.jpg +[31]: https://flatpak.org/setup/ +[32]: https://dl.flathub.org/repo/appstream/org.gnome.design.Lorem.flatpakref +[33]: https://apps.gnome.org/app/org.gnome.design.Lorem/ +[34]: https://gitlab.gnome.org/World/design/lorem +[35]: https://www.debugpoint.com/2022/02/top-whiteboard-applications-linux/ +[36]: https://www.debugpoint.com/wp-content/uploads/2022/02/Rnote-Whiteboard-Application-for-Linux-based-on-GTK4-and-Rust.jpg +[37]: https://flatpak.org/setup/ +[38]: https://dl.flathub.org/repo/appstream/com.github.flxzt.rnote.flatpakref +[39]: https://github.com/flxzt/rnote +[40]: https://www.debugpoint.com/wp-content/uploads/2022/03/Frogr.jpg +[41]: https://flatpak.org/setup/ +[42]: https://flathub.org/repo/appstream/org.gnome.frogr.flatpakref +[43]: https://wiki.gnome.org/Apps/Frogr +[44]: https://gitlab.gnome.org/GNOME/frogr +[45]: https://en.wikipedia.org/wiki/Getting_Things_Done +[46]: https://www.debugpoint.com/wp-content/uploads/2022/03/GTG.jpg +[47]: https://flatpak.org/setup/ +[48]: https://dl.flathub.org/repo/appstream/org.gnome.GTG.flatpakref +[49]: https://wiki.gnome.org/Apps/GTG +[50]: https://www.debugpoint.com//fortintam.com/gtg/user_manual/ +[51]: https://www.debugpoint.com/wp-content/uploads/2022/03/Recepies.jpg +[52]: https://flatpak.org/setup/ +[53]: https://gitlab.gnome.org/GNOME/recipes/raw/master/flatpak/gnome-recipes.flatpakref +[54]: https://wiki.gnome.org/Apps/Recipes +[55]: https://gitlab.gnome.org/GNOME/recipes/ +[56]: https://www.debugpoint.com/2021/12/best-gnome-apps-part-1/ +[57]: https://www.debugpoint.com/2021/12/best-gnome-apps-part-2/ +[58]: https://www.debugpoint.com/2022/01/best-gnome-apps-part-3/ +[59]: https://www.debugpoint.com/2022/02/best-gnome-apps-part-4/ diff --git a/sources/tech/20220305 Creating and initializing maps in Groovy vs Java.md b/sources/tech/20220305 Creating and initializing maps in Groovy vs Java.md deleted file mode 100644 index 4e6656ca7b..0000000000 --- a/sources/tech/20220305 Creating and initializing maps in Groovy vs Java.md +++ /dev/null @@ -1,272 +0,0 @@ -[#]: subject: "Creating and initializing maps in Groovy vs Java" -[#]: via: "https://opensource.com/article/22/3/maps-groovy-vs-java" -[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Creating and initializing maps in Groovy vs Java -====== -Java and Groovy maps are nicely general, permitting keys and values to -be any classes that extend the Object class. -![Business woman on laptop sitting in front of window][1] - -I’ve recently explored some of the differences between Java and Groovy when [creating and initializing lists][2] and [building lists at runtime][3]. I observed the simple facilities provided by Groovy for these purposes in comparison to the complexity required in Java. - -In this article, I examine creating and initializing maps in Java and Groovy. Maps provide the ability to develop structures you can search by _key_. And if the key gets found, that returns the _value_ associated with that key. Today, maps are implemented in many programming languages, including Java and Groovy, but also Python (where they are called dictionaries), Perl, awk, and many others. Another term commonly used to describe maps is _associative arrays_, which you can read about in [this Wikipedia article][4]. Java and Groovy maps are nicely general, permitting keys and values to be any classes that extend the `Object` class. - -### Install Java and Groovy - -Groovy is based on Java and requires a Java installation as well. Both a recent and decent version of Java and Groovy might be in your Linux distribution’s repositories. Or, you can install Groovy following the instructions on the link mentioned above. A nice alternative for Linux users is [SDKMan][5], which you can use to get multiple versions of Java, Groovy, and many other related tools. For this article, I’m using SDK’s releases of: - - * Java: version 11.0.12-open of OpenJDK 11; - * Groovy: version 3.0.8. - - - -### Back to the problem - -Java offers a number of ways to instantiate and initialize maps, and since Java 9, several new approaches got added. The most obvious candidate is the static method `java.util.Map.of()` which you can use as follows:      - - -``` - - -var m1 = [Map][6].of( -    "AF", "Afghanistan", -    "AX", "Åland Islands", -    "AL", "Albania", -    "DZ", "Algeria", -    "AS", "American Samoa", -    "AD", "Andorra", -    "AO", "Angola", -    "AI", "Anguilla", -    "AQ", "Antarctica"); - -[System][7].out.println("m1 = " + m1); -[System][7].out.println("m1 is an instance of " + m1.getClass()); - -``` - -It turns out that `Map.of()` used in this fashion bears two important restrictions. First, the map instance you create this way is immutable. Second, this way you can supply at most 20 arguments, representing ten key-value pairs. - -Try adding tenth and eleventh pairs, say "AG", "Antigua and Barbuda", and "AR", "Argentina" to see what happens. You’ll see the Java compiler looking for a version of `Map.of()` that accepts 11 pairs and fails. - -A quick look at [the documentation for java.util.Map][8] shows the reason for this second limitation, and shows a way out of that conundrum: - - -``` - - -var m2 = [Map][6].ofEntries( -    [Map][6].entry("AF", "Afghanistan"), -    [Map][6].entry("AX", "Åland Islands"), -    [Map][6].entry("AL", "Albania"), -    [Map][6].entry("DZ", "Algeria"), -    [Map][6].entry("AS", "American Samoa"), -    [Map][6].entry("AD", "Andorra"), -    [Map][6].entry("AO", "Angola"), -    [Map][6].entry("AI", "Anguilla"), -    [Map][6].entry("AQ", "Antarctica"), -    [Map][6].entry("AG", "Antigua and Barbuda"), -    [Map][6].entry("AR", "Argentina"), -    [Map][6].entry("AM", "Armenia"), -    [Map][6].entry("AW", "Aruba"), -    [Map][6].entry("AU", "Australia"), -    [Map][6].entry("AT", "Austria"), -    [Map][6].entry("AZ", "Azerbaijan"), -    [Map][6].entry("BS", "Bahamas"), -    [Map][6].entry("BH", "Bahrain"), -    [Map][6].entry("BD", "Bangladesh"), -    [Map][6].entry("BB", "Barbados") -); -        -[System][7].out.println("m2 = " + m2); -[System][7].out.println("m2 is an instance of " + m2.getClass()); - -``` - -As long as I don’t need to subsequently change the contents of the map created and initialized with `Map.ofEntries()`, this is a decent solution. Note above that rather than using `Map.of()` as in the first example, I used `Map.ofEntries()`. - -However, supposing I want to create and initialize a map instance with some entries and later add to that map, I need to do something like this: - - -``` - - -var m3 = new HashMap<[String][9],String>([Map][6].ofEntries( -    [Map][6].entry("AF", "Afghanistan"), -    [Map][6].entry("AX", "Åland Islands"), -    [Map][6].entry("AL", "Albania"), -    [Map][6].entry("DZ", "Algeria"), -    [Map][6].entry("AS", "American Samoa"), -    [Map][6].entry("AD", "Andorra"), -    [Map][6].entry("AO", "Angola"), -    [Map][6].entry("AI", "Anguilla"), -    [Map][6].entry("AQ", "Antarctica"), -    [Map][6].entry("AG", "Antigua and Barbuda"), -    [Map][6].entry("AR", "Argentina"), -    [Map][6].entry("AM", "Armenia"), -    [Map][6].entry("AW", "Aruba"), -    [Map][6].entry("AU", "Australia"), -    [Map][6].entry("AT", "Austria"), -    [Map][6].entry("AZ", "Azerbaijan"), -    [Map][6].entry("BS", "Bahamas"), -    [Map][6].entry("BH", "Bahrain"), -    [Map][6].entry("BD", "Bangladesh"), -    [Map][6].entry("BB", "Barbados") -)); - -[System][7].out.println("m3 = " + m3); -[System][7].out.println("m3 is an instance of " + m3.getClass()); - -m3.put("BY", "Belarus"); -[System][7].out.println("BY: " + m3.get("BY")); - -``` - -Here, by using the immutable map created by `Map.ofEntries()` as an argument to the `HashMap` constructor, I create a mutable copy of it, which I can then alter—for example, with the `put()` method. - -Take a look at the Groovy version of the above: - - -``` - - -def m1 = [ -    "AF": "Afghanistan", -    "AX": "Åland Islands", -    "AL": "Albania", -    "DZ": "Algeria", -    "AS": "American Samoa", -    "AD": "Andorra", -    "AO": "Angola", -    "AI": "Anguilla", -    "AQ": "Antarctica", -    "AG": "Antigua and Barbuda", -    "AR": "Argentina", -    "AM": "Armenia", -    "AW": "Aruba", -    "AU": "Australia", -    "AT": "Austria", -    "AZ": "Azerbaijan", -    "BS": "Bahamas", -    "BH": "Bahrain", -    "BD": "Bangladesh", -    "BB": "Barbados"] - -println "m1 = $m1" -println "m1 is an instance of ${m1.getClass()}" - -m1["BY"] = "Belarus" -println "m1 = $m1" - -``` - -At a glance, you see Groovy uses the `def` keyword rather than `var`—although in late-model Groovy (version 3+), it’s possible to use `var` instead. - -You also see that you can create a map representation by putting a list of key-value pairs between brackets. Moreover, the list instance so created is quite useful for a couple of reasons. First, it’s mutable, and second, it’s an instance of `LinkedHashMap`**,** which preserves the order of insertion. So when you run the Java version and print the variable `m3`, you see: - - -``` -`m3 = {BB=Barbados, BD=Bangladesh, AD=Andorra, AF=Afghanistan, AG=Antigua and Barbuda, BH=Bahrain, AI=Anguilla, AL=Albania, AM=Armenia, AO=Angola, AQ=Antarctica, BS=Bahamas, AR=Argentina, AS=American Samoa, AT=Austria, AU=Australia, DZ=Algeria, AW=Aruba, AX=Åland Islands, AZ=Azerbaijan}` -``` - -When you run the Groovy version, you see: - - -``` -`m1 = [AF:Afghanistan, AX:Åland Islands, AL:Albania, DZ:Algeria, AS:American Samoa, AD:Andorra, AO:Angola, AI:Anguilla, AQ:Antarctica, AG:Antigua and Barbuda, AR:Argentina, AM:Armenia, AW:Aruba, AU:Australia, AT:Austria, AZ:Azerbaijan, BS:Bahamas, BH:Bahrain, BD:Bangladesh, BB:Barbados]` -``` - -Once again, you see how Groovy simplifies the situation. The syntax is very straightforward, somewhat reminiscent of Python’s dictionaries, and no need to remember the various contortions necessary if you have an initial list longer than ten pairs. Note that we use the expression: - - -``` -`m1[“BY”] = “Belarus”` -``` - -Rather than the Java: - - -``` -`m1.put(“BY”, “Belarus”)` -``` - -Also, the map is by default mutable, which is arguably good or bad, depending on the needs. I think what bothers me about the “immutable default” of the Java situation is that there isn’t something like `Map.mutableOfMutableEntries()`. This forces the programmer, who has just figured out how to declare and initialize a map, to switch gears and think about just how to convert the immutable map they have into something mutable. I also kind of wonder about the business of creating something immutable just to throw it away. - -Another thing to think about is the square brackets as key lookup works to replace both `put()` and `get()` in Java, so you can write: - - -``` -`m1[“ZZ”] = m1[“BY”]` -``` - -Instead of: - - -``` -`m1.put(“ZZ”,m1.get(“BY”))` -``` - -Sometimes, it’s nice to think of keys and their values in the same way you think of fields in the instance of a class. Imagine you have a bunch of properties you want to set: In Groovy, this could look like: - - -``` - - -def properties = [ -      verbose: true, -      debug: false, -      logging: false] - -``` - -And then later you can change it as: - - -``` -`properties.verbose = false` -``` - -This works because, as long as the key follows certain rules, you can omit the quotes and use the dot operator instead of square brackets. While this can be quite useful and pleasant, it also means that to use the value of a variable as a key value in a map representation, you must enclose the variable in parentheses, like: - - -``` -`def myMap = [(k1): v1, (k2): v2]` -``` - -This is a good moment to remind the diligent reader that Groovy is particularly well-suited to scripting. Often, maps are a key element in scripts, providing lookup tables and generally functioning as an in-memory database. The example I’ve used here is a subset of the ISO 3166 two-character country codes and country names. The codes are familiar to anyone who accesses internet hostnames in countries around the world, which could form a useful part of a scripting utility that looks at internet hostnames in log files to learn about the geographic distribution of users. - -### Groovy resources - -The [Apache Groovy site][10] has a lot of great documentation. Another great Groovy resource is [Mr. Haki][11]. The [Baeldung site][12] provides a lot of useful how-to in Java and Groovy. And a really great reason to learn Groovy is to go on and learn [Grails][13], which is a wonderfully productive full-stack web framework built on top of excellent components like Hibernate, Spring Boot, and Micronaut. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/3/maps-groovy-vs-java - -作者:[Chris Hermansen][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/clhermansen -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) -[2]: https://opensource.com/article/22/1/creating-lists-groovy-java -[3]: https://opensource.com/article/22/2/accumulating-lists-groovy-vs-java -[4]: https://en.wikipedia.org/wiki/Associative_array -[5]: https://sdkman.io/ -[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+map -[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system -[8]: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html -[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string -[10]: https://groovy-lang.org/ -[11]: https://blog.mrhaki.com/ -[12]: https://www.baeldung.com/ -[13]: https://grails.org/ diff --git a/sources/tech/20220307 Using FileZilla for Connecting to SFTP Server Via GUI.md b/sources/tech/20220307 Using FileZilla for Connecting to SFTP Server Via GUI.md deleted file mode 100644 index 7054743c1b..0000000000 --- a/sources/tech/20220307 Using FileZilla for Connecting to SFTP Server Via GUI.md +++ /dev/null @@ -1,160 +0,0 @@ -[#]: subject: "Using FileZilla for Connecting to SFTP Server Via GUI" -[#]: via: "https://itsfoss.com/filezilla-ubuntu/" -[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Using FileZilla for Connecting to SFTP Server Via GUI -====== - -If you ask the geeky sysadmins, they will swear by [rsync or scp commands for transferring files between remote server and local system][1]. - -However, those are command line methods and not everyone feels comfortable. - -Thankfully, there are some GUI tools available that let you transfer files to or from the remote servers. - -[FileZilla][2] is a popular, cross-platform, open-source tool for this purpose. It supports transferring file using FTP over TLS or SSL (FTPS) and also FTP over SSH (SFTP) along with old FTP protocol. - -Let me show how to install FileZilla on Linux and then use it for file transfer. - -So, let’s get started! - -### Installing FileZilla on Ubuntu and other Linux distributions - -You can get the source code tarball but it is always recommended to use your distribution provided package. Since it is a popular software, it should be available in the software repository of most Linux distributions (if not all). _**Please use your distribution’s software center and package manager**_. - -On Ubuntu, you can install it from the software center: - -![FileZilla is available in the Ubuntu Software Center][3] - -You can also use the command line method to install it. - -``` - - sudo apt install filezilla - -``` - -If you see the [package not found error][4], you should [enable the Universe repository][5]. - -Once installed, go to the menu (by pressing the windows key), type FileZilla and start it. - -![Start FileZilla from the system menu][6] - -### Using FileZilla - -When you first run FileZilla, you’ll see an interface like the picture below. - -![Screenshot of FileZilla running][7] - -The left side pane shows the files and directory from your local system. The right side pane is empty for now. When you connect to a remote server, the files from your remote system will be displayed there. - -Before I show you that, let me share a few details on understanding the important aspects of FileZilla interface. - -#### Understaing the FileZilla interface - -The image below give you an overview of the different sections of the window layout of FileZilla. - -![FileZilla Window Layout | image credit][8] - -The GUI is split in 6 different zones/window layout. Let me briefly explain them to you. - -**1\. Toolbar:** It has a variety of options like opening the Site Manager, refreshing local and/or remote directory file and folder lists, start processing current queue of files to be transferred, stop all transfers and discard files from queue, etc. - -**2\. The Quick connect bar:** As its name suggests, allows you to quickly connect to a remote site without specifying many details about it except the host, username, password and port. - -**3\. The Message log:** It shows you a log, regardless if the connection was successful or not. The errors are in red, normal messages are in white, and commands are in blue. - -**4 & 5\. The Local pane and remote panes**: Both are very similar except for the fact that the Local pane shows contents of a local directory and a context menu has options for uploading files. Whereas, the remote pane shows contents of a remote directory and has options for downloading files from a remote directory to your local storage. - -**6\. Transfer queue**: Lastly, the Transfer queue pane shows the status of items being transferred, their transfer speeds, items in queue and the file transfer history (limited to current instance - -#### Connecting to a SFTP server using FileZilla - -_**You need to know the username, password and the IP address of the remote server. The remote server should also be configured to accept connections with the provided details. You also need to have correct access settings in the destination folder.**_ - -To add a new SFTP connection, you need to open the site manager. There are two ways to open it. - -There is a “Site Manager” item under the “Files” menu option on the menu bar. Or, you can click on the “Site manager” icon on the toolbar. - -![the Site Manager button on the toolbar][9] - -Once the Site Manager dialog pops up, click on the “New site” button and [optionally] rename the new site that is added to the entry. I have called mine “test8”. - -![screenshot of the Site Manager][10] - -To the right, under the General tab, ensure that the protocol used is appropriate to what the server administer has set for you. In my case, I set up a SFTP server (FTP over SSH) so I will proceed by choosing the option “SFTP – SSH File Transfer Protocol”. - -The next field is for the IP address of the remote server. - -If you do not mention the port number, FileZilla will assume that the port number to be used is the default SSH port 22. - -There are a few options for the “Logon Type” drop-down. In the Normal logon method, you provide the username and password. - -The Key file authentication method is useful for you if you have a pair of public and private keys set up to authenticate your SSH connection for the user. - -Once you have filled all the appropriate details for the remote server and authentication, click on the “Connect” button positioned at the bottom to connect to the site. Do not worry, the new site you just established a connection to, will be saved in compliance to the “Logon Type”. - -![Remote pane being populated after a successful connection][11] - -If you see a status message as “Connected to <host IP address>” and the most recent status message as “Directory listing of “/” was successful”, you have successfully connected to the remote SFTP server (FTP using the SSH protocol). - -Another indicator of a successful SFTP connection is that the remote directory pane gets populated when a connection is successfully established. - -#### Sending files to remote system - -You must **make sure to be in the directories where you have to transfer the file**. Transferring files is as simple as **double-clicking on the file** without explicitly specifying the target location. - -If you click on a file from the left pane, it immediately gets transferred (or added to the queue if there are pending transfers) to the directory visible in the right pane. - -The same goes from transferring files from right to left, i.e., from remote server to local. **This is why it is important to be in the correct locations in both local and remote systems**. - -Alternatively, you can right-click on the file(s) and upload them (or add them to the upload queue). The destination is always the directory displayed in FileZilla interface. - -![Transfer queue pane showing the local file name, remote destination, transfer speed and an ETA][12] - -There isn’t much difference in either way of uploading files except for convenience and timing. - -#### Downloading files from remote system - -Just like uploading files, you get two options when transferring file from a remote server to local storage, but instead of “Upload” it is “Download”. - -Downloading a file will download that file in the local directory that you currently have open in the Local directory pane. - -You will notice a consistent behavior in downloading and uploading files, except for the sender and receiver. The file transfers will be in done in parallel unless the number of connections is restricted. - -### Conclusion - -Awesome! With the basics covered, you should be able to transfer files to and from your computer to your server. I hope you learnt something new :) - -If you have any queries, please ask them in the [It’s FOSS community forums][13]. If you felt this was helpful to you, do let me know with a comment down below! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/filezilla-ubuntu/ - -作者:[Pratham Patel][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/pratham/ -[b]: https://github.com/lujun9972 -[1]: https://linuxhandbook.com/transfer-files-ssh/ -[2]: https://filezilla-project.org/ -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/filezilla-ubuntu-software-center.png?resize=751%2C382&ssl=1 -[4]: https://itsfoss.com/unable-to-locate-package-error-ubuntu/ -[5]: https://itsfoss.com/ubuntu-repositories/ -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/filezilla-ubuntu.png?resize=763%2C224&ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/01_filezilla.webp?resize=800%2C431&ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/02_filezilla_layout.webp?resize=800%2C504&ssl=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/03_site_manager_annotated.webp?resize=386%2C170&ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/04_site_manager.webp?resize=800%2C577&ssl=1 -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/05_successful_connection.webp?resize=800%2C431&ssl=1 -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/01/07_transfer_pane_populated-1.webp?resize=800%2C431&ssl=1 -[13]: https://itsfoss.community/ diff --git a/sources/tech/20220308 Top Nitrux Applications (Maui) Everyone Should Try.md b/sources/tech/20220308 Top Nitrux Applications (Maui) Everyone Should Try.md index 51c0f78410..7e284505ee 100644 --- a/sources/tech/20220308 Top Nitrux Applications (Maui) Everyone Should Try.md +++ b/sources/tech/20220308 Top Nitrux Applications (Maui) Everyone Should Try.md @@ -9,8 +9,8 @@ Top Nitrux Applications (Maui) Everyone Should Try ====== -THIS ARTICLE SHOWCASES SOME OF THE EXCELLENT MAUI NATIVE APPLICATIONS -THAT COME AS DEFAULT IN NITRUX OS LINUX DISTRIBUTION. +This article showcases some of the excellent maui native applications that come as default in nitrux os linux distribution. + ### What is Maui Apps and Nitrux OS [Nitrux][1] is a Linux Distribution and a complete operating system based on Debian with the power NX Desktop, which uses KDE Plasma and Mauikit components. It is one of the beautiful Linux distributions today, giving you the best looks and performance. @@ -56,8 +56,6 @@ Other features that make it a most desirable text editors are – * Autosave * Supports dark and light themes - - This text editor reminds me of the great Gedit, which is [not a default editor anymore][7] in GNOME. Gedit [has all the features][8] of this text editor via plugins. ![Nota Text Editor][9] @@ -76,8 +74,6 @@ The [Clip][12] is the convergence video player for desktop and mobile phones tha [][13] -SEE ALSO:   10 Necessary Apps to Improve Your GNOME Desktop Experience [Part 4] - ##### Quick features of Clip * Local, network and internet streaming playback (limited) @@ -86,8 +82,6 @@ SEE ALSO:   10 Necessary Apps to Improve Your GNOME Desktop Experience [Part 4] * Subtitles support * Based on the MPV video player - - ![Clip Video Player][14] #### Station – Terminal @@ -120,8 +114,6 @@ You can view the image metadata and basic image edition as well. The image editi * Supports layers * Cropping and rotating - - However, you can not annotate with arrows or add any texts into the image. ![Pix Image Viewer][20] @@ -156,14 +148,6 @@ So, what is your favourite application on this list? Let me know in the comment Cheers. -_Some image credits – Maui, Nitrux team._ - -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][22], [Twitter][23], [YouTube][24], and [Facebook][25] and never miss an update! - -##### Also Read - -------------------------------------------------------------------------------- via: https://www.debugpoint.com/2022/03/top-nitrux-maui-applications/ @@ -198,7 +182,3 @@ via: https://www.debugpoint.com/2022/03/top-nitrux-maui-applications/ [19]: https://mauikit.org/apps/pix/ [20]: https://www.debugpoint.com/wp-content/uploads/2022/03/Pix-Image-Viewer.jpg [21]: https://www.debugpoint.com/wp-content/uploads/2022/03/Downlaod-Nitrux-Maui-application-appimage-and-apk-files-1024x584.jpg -[22]: https://t.me/debugpoint -[23]: https://twitter.com/DebugPoint -[24]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[25]: https://facebook.com/DebugPoint diff --git a/sources/tech/20220309 Using Homebrew Package Manager on Fedora Linux.md b/sources/tech/20220309 Using Homebrew Package Manager on Fedora Linux.md deleted file mode 100644 index 9caf23dc2c..0000000000 --- a/sources/tech/20220309 Using Homebrew Package Manager on Fedora Linux.md +++ /dev/null @@ -1,171 +0,0 @@ -[#]: subject: "Using Homebrew Package Manager on Fedora Linux" -[#]: via: "https://fedoramagazine.org/using-homebrew-package-manager-on-fedora-linux/" -[#]: author: "Mehdi Haghgoo https://fedoramagazine.org/author/powergame/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Using Homebrew Package Manager on Fedora Linux -====== - -![][1] - -### Introduction - -Homebrew is a package manager for macOS to install UNIX tools on macOS. But, it can be used on Linux (and Windows WSL) as well. It is written in Ruby and provides software packages that might not be provided by the host system (macOS or Linux), so it offers an auxiliary package manager besides the OS package manager. In addition, it installs packages only to its prefix (either /home/linuxbrew/.linuxbrew or ~/.linuxbrew) as a non-root user, without polluting system paths. This package manager works on Fedora Linux too. In this article, I will try to show you how Homebrew is different from Fedora Linux package manager _dnf_ , why you might want to install and use it on Fedora Linux, and how. - -##### Warning - -You should always inspect the packages and binaries you are installing on your system. Homebrew packages usually run as a non-sudoer user and to a dedicated prefix so they are quite unlikely to cause harm or misconfigurations. However, do all the installations at your own risk. The author and the Fedora community are not responsible for any damages that might result directly or indirectly from following this article. - -### How Homebrew Works - -Homebrew uses Ruby and Git behind the scenes. It builds software from source using special Ruby scripts called formulae which look like this (Using wget package as an example): - -``` - - class Wget < Formula - homepage "https://www.gnu.org/software/wget/" - url "https://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz" - sha256 "52126be8cf1bddd7536886e74c053ad7d0ed2aa89b4b630f76785bac21695fcd" - - def install - system "./configure", "--prefix=#{prefix}" - system "make", "install" - end - end - -``` - -### How Homebrew is Different from _dnf_ - -Homebrew is a package manager that provides up-to-date versions of many UNIX software tools and packages e.g. ffmpeg, composer, minikube, etc. It proves useful when you want to install some packages that are not available in Fedora Linux _rpm_ repositories for some reason. So, it does not replace _dnf_. - -### Install Homebrew - -Before starting to install Homebrew, make sure you have glibc and gcc installed. These tools can be installed on Fedora with: - -``` - - sudo dnf groupinstall "Development Tools" - -``` - -Then, install Homebrew by running the following command in a terminal: - -``` - - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - -``` - -During the installation you will be prompted for your sudo password. Also, you will have the option to choose the installation prefix for Homebrew, but the default prefix is fine. During the install, you will be made the owner of the Homebrew prefix, so that you will not have to enter the sudo password to install packages. The installation will take several minutes. Once finished, run the following commands to add brew to your PATH: - -``` - - echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bash_profile - eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - -``` - -### Install and Investigate Packages - -To install a package using a formula on Homebrew, simply run: - -``` - - brew install - -``` - -Replace <formula> with the name of the formula you want to install. For example, to install Minikube, simply run: - -``` - - brew install minikube - -``` - -You can also search for formulae with: - -``` - - brew search - -``` - -To get information about a formula, run: - -``` - - brew info - -``` - -Also, you can see all the installed formulae with the following command: - -``` - - brew list - -``` - -### Uninstall Packages - -To uninstall a package from your Homebrew prefix, run: - -``` - - brew uninstall - -``` - -### Upgrade Packages - -To upgrade a specific package installed with Homebrew, run: - -``` - - brew upgrade - -``` - -To update Homebrew and all the installed Formulae to the latest versions, run: - -``` - - brew update - -``` - -### Wrap Up - -Homebrew is a simple package manager that can be a helpful tool alongside _dnf_ (The two are not related at all). Try to stick with the native _dnf_ package manager for Fedora to avoid software conflicts. However, if you don’t find a piece of software in the Fedora Linux repositories, then you might be able to find and install it with Homebrew. See the [Formulae list][2] for what is available. Also, Homebrew on Fedora Linux does not support graphical applications (called casks in Homebrew terminology) yet. At least, I didn’t have any luck installing any GUI apps. - -### References and Further Reading - -To learn more about Homebrew, check out the following resources: - - * Homebrew Homepage: - * Homebrew Docs: - * Wikipedia Homebrew Page: - - - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/using-homebrew-package-manager-on-fedora-linux/ - -作者:[Mehdi Haghgoo][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/powergame/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2022/03/homebrew_sized-up-816x346.png -[2]: https://formulae.brew.sh/formula/ diff --git a/sources/tech/20220310 Piwigo- An Open-Source Google Photos Alternative That You Can Self-Host.md b/sources/tech/20220310 Piwigo- An Open-Source Google Photos Alternative That You Can Self-Host.md deleted file mode 100644 index 6f672900f5..0000000000 --- a/sources/tech/20220310 Piwigo- An Open-Source Google Photos Alternative That You Can Self-Host.md +++ /dev/null @@ -1,160 +0,0 @@ -[#]: subject: "Piwigo: An Open-Source Google Photos Alternative That You Can Self-Host" -[#]: via: "https://itsfoss.com/piwigo/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Piwigo: An Open-Source Google Photos Alternative That You Can Self-Host -====== - -**Brief:** _If you are moving away from Google Photos, Piwigo is an impressive open-source alternative with the ability to self-host. Let’s explore more about it._ - -Google Photos is one of the most popular options to back up your photos and videos. - -Considering that it is the default choice for most Android phones, it is a seamless experience managing photos/videos using Google Photos. - -But, what if you want to move away from it for something open-source and more privacy-friendly? Not just from Google Photos, from proprietary photo hosting platforms overall. - -Meet Piwigo, an open-source [photo management software][1] to the rescue. - -### Piwigo: Open-Source Photo Library That You Can Self-Host - -![][2] - -[Piwigo][3] is an open-source solution to help manage your photos and videos. - -You can choose to host it yourself, take control of your data, or opt for cloud hosting (**data stored in France, with backups**). - -The company has its origins in France, if you are curious. - -Not just for individuals, but Piwigo is also tailored for organizations and teams. - -If you are worried about the privacy policies when you upload using Google Photos or similar services, Piwigo can be a brilliant replacement. - -Piwigo offers a range of features and fine-grained control to manage your photos. - -### Features of Piwigo - -![][4] - -While it is a viable alternative to mainstream services, it offers advanced capabilities for individuals and organizations. - -Some features include: - - * Get your dedicated subdomain with cloud hosting (*.piwigo.com) - * Ability to download in batch - * Create albums - * Select photos to assign existing album collections - * Share photos by link - * Access management with public and private mode - * Ability to group users to manage your albums or photos (effective for organizations/teams) - * Basic analytics to track your usage and storage used - * Supports adding tags to albums/photos - * Dark mode support - * Ability to edit the photo metadata - * Filters to quickly find a photo/album - * Support for JPG/JPEG, PNG, and GIF files (for individuals) - * Support for all file types (for enterprise use only) - * Unlimited storage for individual users - * Supports custom domain names (even for cloud hosting option) - * Plugins to extend functionalities - * Theme support - * Mobile support (Android and iOS) - - - -In addition to the features mentioned above, you get additional options to improve the user management and the overall user experience with Piwigo. - -![][5] - -I tested it for a quick overview using its cloud hosting option for individuals (**with a 30-day trial period**). Let me share some of my insights to help you understand them before you try. - -### Using Piwigo to Manage Photos - -When you sign up for an account, you get to specify your custom subdomain. - -For instance, I have my test account on **ankushsoul.piwigo.com**. - -![][6] - -Anyone can access my publicly shared photos/albums by entering the above URL in their browsers. - -So, it is better to keep the subdomain’s name as unique as possible. In either case, you can also restrict the albums/photos to logged-in users (or to yourself), where no one else can access your photos even if they know your subdomain. - -![][7] - -You can head to its dashboard to check your storage usage and the overall activity. - -There are two activated plugins, one for internal functionality and another to fight spammers by default. - -![][8] - -You will find plenty of plugins to enhance batch management, enable admin messages, activate comments on albums, add expiration on your albums, limit downloads, and access to several exciting features. - -It would be best if you took a moment to browse the available selection of plugins to evaluate how useful they can be compared to Google Photos. - -Of course, you do not get this kind of control with any mainstream cloud photo hosting services. - -So, it is well worth the exploration. - -![][9] - -For the rest of the existing features, you can manage multiple users, control access, send notifications (via email), and also get to perform some maintenance activities. - -Overall, the user experience is pretty good. It may not offer the most modern user interface, but it works and is easy to manage. - -**Note**: The mobile experience (on Android) may not be satisfactory, considering the app available on the Play Store hasn’t received any recent updates. However, you can find the latest version APK file on their GitHub. - -### Get Started With Piwigo - -I think Piwigo is perfect for a range of individuals, starting from someone who wants to organize photos, to users who want to collaborate/share pictures for work. - -If you choose to self-host it, you should check out its [documentation][10] and explore the [GitHub page][11]. - -You will need to maintain the instance properly and have a backup of your data, considering you manage it all alone. - -If you opt for the [cloud hosting option][12] (as an individual), the pricing starts at **39 Euros** per year for unlimited image file uploads and will be cheaper if you get a 3-year subscription. - -![][13] - -The individual plans do not mention a specific storage limit (unlimited). So, it is safe to say that you should not have any issues unless you start abusing the service. - -Given the control you get with the service, most users will prefer to use the cloud hosting service and ditch services like Google Photos. - -Pricing plans for enterprises/organizations will be expensive (per month). However, it supports all file types for enterprises. - -[Piwigo][3] - -_What do you think about a self-hosted alternative to Google Photos like Piwigo? Have you tried it? Is the cloud hosting option a viable alternative to mainstream options?_ - -_Let me know your thoughts in the comments below._ - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/piwigo/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/linux-photo-management-software/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/piwigo-feature.jpg?resize=800%2C424&ssl=1 -[3]: https://piwigo.com/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/piwigo-album-edit.png?resize=800%2C451&ssl=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/piwigo-upload.png?resize=800%2C665&ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/piwigo-sign-up.png?resize=800%2C646&ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/piwigo-dashboard.png?resize=800%2C435&ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/piwigo-plugins.png?resize=800%2C499&ssl=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/piwigo-config.png?resize=800%2C632&ssl=1 -[10]: https://piwigo.org/doc/doku.php -[11]: https://github.com/Piwigo -[12]: https://piwigo.com/pricing -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/piwigo-pricing.png?resize=800%2C509&ssl=1 diff --git a/sources/tech/20220311 Zorin OS 16.1 Brings Much Needed Stability and Improvements.md b/sources/tech/20220311 Zorin OS 16.1 Brings Much Needed Stability and Improvements.md deleted file mode 100644 index f69b1d5232..0000000000 --- a/sources/tech/20220311 Zorin OS 16.1 Brings Much Needed Stability and Improvements.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: subject: "Zorin OS 16.1 Brings Much Needed Stability and Improvements" -[#]: via: "https://www.debugpoint.com/2022/03/zorin-os-16-1-release/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Zorin OS 16.1 Brings Much Needed Stability and Improvements -====== -ZORIN OS 16.1 WAS RELEASED WITH SECURITY PATCHES, NEW SOFTWARE AND THE -TEAM AIMS FOR A BETTER CAUSE. -Zorin OS is popular because it gives the perfect starting point for Windows users in their Linux journey. Thanks to its simple design, elegant selection of packages and out of the box Windows looks, it’s one of the popular and sought after Linux Distribution today for all users. - -Coming after almost two months since [Zorin OS 16][1], this first point release is now available for download and upgrades for those who are already running the 16.0 version. - -![Zorin OS 16.1 Desktop][2] - -### Zorin OS 16.1 – What’s New - -Zorin OS 16.1 brings obvious up to date security patches for your system with goodies such as LibreOffice 7.3 office suites and several updated packages. - -If you just bought a new Laptop or set up a new gaming workstation, Zorin OS 16.1 also comes with support for Sony’s PlayStation 5 Dual Sense game controller and Apple’s Magic Mouse 2. Plus, you get excellent support for Intel 12th Gen processors and NVIDIA RTX 3050 graphics cards. - -Moreover, Zorin devs promise better support for Wi-Fi cars and printers thanks to the latest packages. - -Here’s a quick summary of this minor release’s updated packages and applications. - - * Based on Ubuntu 20.04.3 LTS - * Zorin Desktop is based on GNOME 3.38.4 - * LibreOffice 7.3 - * Firefox 98 - * Linux Kernel 5.13 - * GIMP 2.10.18 - * Evolution Email client - - - -Full detail is available [here][3] if you care to dig deep into the changes. - -So, where to download? - -### Download - -Before you hit download, you should know that it has a “Pro” version with additional themes and out of the box settings worth $39. And the “Core” version is completely free to download. You can read the comparison between “Pro” and “Core” on the download page. - -[][4] - -SEE ALSO:   Zorin OS 16 Released with Stunning New Look and Array of Updates - -In my opinion, the Core version should be sufficient, and if you are experienced enough, you can change the settings to make it a Pro version. So we recommend the Core version for general use. - -Just so you know, if you purchase the Pro version this time (within March 17), you will be helping war-torn Ukraine as the profits foes to humanitarian aid via charities. - -[Download Zorin OS 16.1][5] - -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][6], [Twitter][7], [YouTube][8], and [Facebook][9] and never miss an update! - -##### Also Read - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2022/03/zorin-os-16-1-release/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://www.debugpoint.com/2021/12/zorin-os-16-lite-review-xfce/ -[2]: https://www.debugpoint.com/wp-content/uploads/2022/03/Zorin-OS-16.1-Desktop-1024x575.jpg -[3]: https://blog.zorin.com/2022/03/10/zorin-os-16-1-released-support-for-ukraine/ -[4]: https://www.debugpoint.com/2021/08/zorin-os-16-release-announcement/ -[5]: https://zorin.com/os/download/ -[6]: https://t.me/debugpoint -[7]: https://twitter.com/DebugPoint -[8]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[9]: https://facebook.com/DebugPoint diff --git a/sources/tech/20220312 Best 5 Alternatives to Microsoft Office -Compared.md b/sources/tech/20220312 Best 5 Alternatives to Microsoft Office -Compared.md deleted file mode 100644 index d03b8a1610..0000000000 --- a/sources/tech/20220312 Best 5 Alternatives to Microsoft Office -Compared.md +++ /dev/null @@ -1,219 +0,0 @@ -[#]: subject: "Best 5 Alternatives to Microsoft Office [Compared]" -[#]: via: "https://www.debugpoint.com/2022/03/best-alternatives-microsoft-office-2022/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Best 5 Alternatives to Microsoft Office [Compared] -====== -HERE WE GIVE YOU THE FIVE BEST ALTERNATIVES TO MICROSOFT OFFICE. WE -COMPARE THEM BASED ON FEATURES, ARE EASY TO USE AND PROVIDE YOU GUIDE TO -CHOOSE THE ONE YOU NEED. -I think we all agree that Microsoft Office is one of the best software developed by Mircosoft. It has a presence almost everywhere in the entire world in nearly every business. It is a fine piece of software that evolved over a couple of past decades. - -And obviously, it doesn’t have a Linux native installer and comes with a significant price. If you are a business owner or a personal user, the current Microsoft Office 365 subscription pricing is a little higher. And not everyone can afford that price bucket for a longer time. - -Then what are the alternatives? You can try other options that relatively get the job done for most users or businesses. - -This article gives you the five best alternatives to Microsoft Office. - -### Best Alternatives to Microsoft Office - -### LibreOffice - -![LibreOffice][1] - -The first alternative we highlight here is [LibreOffice][2]. The Document Foundation develops and manages the entire LibreOffice free and open-source office suite, available for Linux, macOS and Windows. - -It comes with a spreadsheet ([Calc][3]), word processor (Writer), presentation (Impress), drawing (Draw) and a database program (Base). - -This project is actively developed, and compatibility with Microsoft Office documents is improved in every release iteration. If appropriately used, LibreOffice can effectively do all the work that a Mircosoft office program does. A massive set of documentation and communities can help you adopt LibreOffice in no time. - -If you are a small or a large corporation, you don’t need to pay for the software itself. But paid deployment and support is also available at minimal cost if you require them for your critical work. - -However, LibreOffice does not come with an Outlook-like email program. This might be one of the minor drawbacks, but you can access emails from web browsers today for all email service providers. - - * [Home page][2] - * [For Business][4] - * [Download for general-purpose personal use][5] - * [Help and Documentation][6] - * [Official support forum][7] - - - -* * * - -### Google Docs - -![Google Docs][8] - -The search engine giant Google provides a complete web-based Office suite (aka [Google Docs][9]) with its own Docs (document processor), Sheets (spreadsheet program) and Slides (presentation) for free users. - -You can access and create documents in your Google Drive account by default for free and access them from anywhere in the world. The office components provide well-designed web-based toolbars, advanced options, spell check, Voice to Text feature (only in Chrome), encryption and cloud access. Google also offers mobile apps for iOS and Android to access your documents and edit them on the go. - -One of the best features of Google Docs is templates. With the power of pre-built templates, you can start professional-grade documents in time. The collaboration option gives you more control when sharing and deploying documents with a Google account-based authentication and authorization mechanism for a wider audience. - -If you need more from Google Docs, you may opt for Google Workspace with a very minimal price compared to costly Microsoft Office. The Google Workspace is a complete and integrated solution that gives you Google Forms to collect data and integrate into your docs and Sheets, website builder Google Sites, Google Calendar and more storage options to keep your document. - - * [Home page][9] - * [Documentation][10] - - - -### OnlyOffice - -![OnlyOffice][11] - -[OnlyOffice][12] (styled as ONLYOFFICE) is a free and open-source complete Office productivity suite that contains text editor, spreadsheet program, presentation tool for you and your office work. It supports advanced features such as real-time collaboration with proper tracking changes for your shared documents, fillable forms and many such features. - -This powerful office suite looks better with its Office 365 type ribbons which helps to adopt this program quickly. OnlyOffice has better Microsoft Office compatibility with .docx .xlsx and .pptx file formats which are easy for you and your organization to share documents. - -[][13] - -SEE ALSO:   10 Best Apps to Improve Your GNOME Experience [Part 1] - -It’s worth mentioning that OnlyOffice provides an Enterprise office suite,, aka “ONLYOFFICE Workspace, ” a paid product with additional features and instant support. This enterprise suite is perfect for those with a tight budget on office products but needs near compatibility with Office 365. - -The ONLYOFFICE Workspace comes with an Email client, CRM product, Project Management tool and an integrated calendar. Although everything works well, you face some issues with spell checking, print preview, page size and some bugs. But you should not worry as the team is receptive, and you can report issues in GitHub and get help. - - * [Home page][12] - * [Download][14] - * [Documentation and help][15] - - - -### Softmaker Free Office - -![FreeOffice][16] - -The [FreeOffice][17] is another option if you are looking for Microsoft Office alternatives. This office suite was developed by SoftMaker and is arguably one of the choices that you may have. The FreeOffice brings TextMaker (like Word), PlanMaker (like Excel), Presentations and a comparison utility. The user interfaces as two options. The modern Ribbon option makes it a desirable product due to its popularity. It also has a traditional Legacy user interface with a menu and toolbar with a considerable fanbase. - -The SoftMaker FreeOffice provides a specific user interface and features in touch-based devices. The Microsoft Office document format compatibility is well established to get the most done. - -However, you may have little trouble working with Open Document Format files, whose support is limited. - -This is a closed source product. - - * [Home page][17] - * [Download][18] - * [Documentation and help][19] - - - -### WPS Office - -![WPS Office][20] - -Remember Kingston Office? Well, it’s now renamed and repackaged as WPS Office, which is the acronym for ord, **P**resentation and **S**preadsheets. Today, the WPS Office is one of the oldest office suites with more than three decades of development and releases. It is a fully-featured office suite available for all platforms and mobile devices. - -Some of the unique features of WPS Office are its real-time collaboration in its core programs which helps you work in a team in a shared document. The office suite comes with 100,000+ templates which allows you to create professional-grade documents and presentations. - -The WPS Office comes with the standard edition, free to download and use but limited in features. - -If you need additional features such as PDF editing, Cloud support, collaborations and enterprise support, then you can opt for the WPS Premium of WPS Business option with a price. - -Its important to mention that this is a closed source program and may contain Ads. Also its developed by a Chinese company. - - * [Home page][21] - * [Documentation][22] - * [Download][23] - - - -### Comparison - -Here’s a quick comparison of the above free Microsoft office alternatives based on features and other details. - -Product | Price | Source Type | Pros | Cons ----|---|---|---|--- -LibreOffice | Free | Open source | Free and cross platform -Multi language support -Complete support of ODF files -Best compatibility support of Microsoft Office -Very active deleopment | No email and project management suite -The database program depends on Java -Google Docs | Free | Close source | Free and cross platform -Well documented support -Access documents via cloud anywhere -Complete Mobile device support | Requires internet connection -Little slow due to web based tool -No native desktop executable available -OnlyOffice | Free (basic product) | Open source | The user interface almost similar to Microsoft Office -Better support and compatibility with Microsoft Office files -Cloud integration, and plugin support -Cross platform | May face problems with some basic features. -Cloud integrations are not compatible with EU due to GDPR -The web app version is slow -FreeOffice | Free (basic product) | Close source | Free and lightweight compared to LibreOffice. -Touchscreen support -Good Microsoft Office compatibility -Cross platform | Free version only have document, spreadsheet and presentation. -Additional prodcuts needs purchase -Open Document Format support is limited -Not open source product -WPS Office | Free | Close source | Good Microsoft office compatibility -Cross platform product -Tabbed interface -Multi language support | Not open source product -Developed by a Chinese company -May contain ads - -### Our Recommendation - -Leaving aside all the pros and cons, if you cannot choose which of the Office suite is best for you, I would recommend going ahead with LibreOffice always. Because LibreOffice and TDF has a good vision, active development and worldwide community support. LibreOffice has a considerable knowledge base about tips tutorials on the helpful web. And you can easily automate tasks with Basic or Python Macro. - -### Closing Notes - -I hope this guide helps you choose the best alternatives for Microsoft Office for your personal or business usage. Genuinely speaking, none of the above office products come close in comparison to Microsoft Office in true sense. Not everyone or every business is able to pay hefty subscription fee every month for Microsoft Office. For those, I believe some of these options can be a good starting point. - -_Some image credits: Respective product owner_ - -* * * - -We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][24], [Twitter][25], [YouTube][26], and [Facebook][27] and never miss an update! - -##### Also Read - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2022/03/best-alternatives-microsoft-office-2022/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://www.debugpoint.com/wp-content/uploads/2022/03/LibreOffice-1024x535.jpg -[2]: https://www.libreoffice.org/discover/libreoffice/ -[3]: https://www.debugpoint.com/category/libreoffice/libreoffice-calc/ -[4]: https://www.libreoffice.org/download/libreoffice-in-business/ -[5]: https://www.libreoffice.org/download/download/ -[6]: https://help.libreoffice.org/latest/en-US/text/shared/05/new_help.html -[7]: https://ask.libreoffice.org/ -[8]: https://www.debugpoint.com/wp-content/uploads/2022/03/Google-Docs.jpg -[9]: https://www.google.com/docs/about/ -[10]: https://support.google.com/docs/?hl=en#topic=1382883 -[11]: https://www.debugpoint.com/wp-content/uploads/2022/03/OnlyOffice.jpg -[12]: https://www.onlyoffice.com/ -[13]: https://www.debugpoint.com/2021/12/best-gnome-apps-part-1/ -[14]: https://www.onlyoffice.com/desktop.aspx -[15]: https://forum.onlyoffice.com/ -[16]: https://www.debugpoint.com/wp-content/uploads/2022/03/FreeOffice.jpg -[17]: https://www.freeoffice.com/en/ -[18]: https://www.freeoffice.com/en/download/applications -[19]: https://forum.softmaker.com/ -[20]: https://www.debugpoint.com/wp-content/uploads/2022/03/WPS-Office-1024x499.jpg -[21]: https://www.wps.com/ -[22]: https://www.wps.com/academy/ -[23]: https://www.wps.com/download/ -[24]: https://t.me/debugpoint -[25]: https://twitter.com/DebugPoint -[26]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 -[27]: https://facebook.com/DebugPoint diff --git a/sources/tech/20220323 10 Features Why GNOME 42 is the Greatest Release Ever.md b/sources/tech/20220323 10 Features Why GNOME 42 is the Greatest Release Ever.md new file mode 100644 index 0000000000..f0e0fcc130 --- /dev/null +++ b/sources/tech/20220323 10 Features Why GNOME 42 is the Greatest Release Ever.md @@ -0,0 +1,148 @@ +[#]: subject: "10 Features Why GNOME 42 is the Greatest Release Ever" +[#]: via: "https://www.debugpoint.com/2022/03/gnome-42-release/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +10 Features Why GNOME 42 is the Greatest Release Ever +====== +We think these GNOME 42 release features make it one of the great releases in GNOME’s history. Here’s why. + +The GNOME Desktop is the most widely used desktop environment today. And it is probably the only desktop that new users to Linux experience for the first time. GNOME is the default desktop environment for Ubuntu and Fedora Linux. Hence its user base is in millions. + +The upcoming GNOME 42 releases soon. And perhaps it’s one of the best releases so far in terms of new features, adoption of modern tech and moving away from the legacy codebase. + +The core, look and feel under the hood changes – everything looks different for new and experienced users. + +![GNOME 42 Desktop][1] + +In this article, we would like to give you a tour of 10 features of GNOME 42, which makes it a significant release. + +### Great Features of GNOME 42 Release + +#### 1. Libadwaita and GTK4 + +The libadwaita library is the modern building block for GTK4 applications. It’s the GTK4 port of the libhandy library that defines the visual language of the GNOME desktop. The adoption of libadwaita is complex, and it impacts almost every modules component of the modern GNOME desktop, including the native applications. Imagine how difficult it is for a complete libadwaita and GTK4 adoption in development efforts, testing and other regressions. + +The work started in GNOME 41 is now nearing completion in this GNOME 42 release. But what are the changes? + +The libadwaita and GTK4 changes are visible in every user interface of the entire desktop. For example, you can see the flat buttons, well-justified labels, new colours, rounded corners, refined controls, etc. + +Hence, from Files to Web, the Shell controls, menu items – everything would look stunning with libadwaita and GTK4 in the GNOME 42 release. + +#### 2. Updated GNOME Shell Theme + +The GNOME default Shell theme changed in several places. In this release, those items’ menus, notifications, and overall look are more compact. + +The menu items at the top bar, such as the Calendar or the system tray menu, are now closer to the top bar. The spacing between the text and options inside the menu is decreased. + +![GNOME 42 Shell updates][2] + +The on-screen display notifications are changed. Earlier, it used to be the large boxes with notification labels that are now changed to “pills” with a lesser display footprint. + +![Revamped OSD and menu in GNOME 42][3] + +And also, some inside performance boost makes GNOME 42 much faster than its predecessors. + +#### 3. Adaptive Dark Theme + +If you love dark themes and want your app to honour the system’s dark look, you are in for a treat. The GNOME 42, with the help of libadwaita, brings native dark mode for all the supported applications. + +If you choose a dark theme for GNOME Shell, the apps also follow that shell’s system style. + +For example, if you choose the below option in the new Text editor, it changes to a dark theme when you change the GNOME Shell theme. + +![This option makes it follow dark and light theme automatically][4] + +However, this feature needs to be implemented by the app developer to consume the exposed Shell settings. + +#### 4. Revamped System Settings with new Appearances + +The fulcrum of the entire GNOME desktop is its settings window. From the settings window, you can tweak most of the desktop behaviour. The setting application itself is a complex app, and it’s ported to libadwaita. So, the looks of it changed with new styled widgets and controls. + +One of the vital changes in the Settings window is the new Appearance page. This page gives you the option to view and toggle the desktop theme between light and dark. + +The Sharing page in the settings window gives you a redesigned remote desktop dialog showing options and preferences for remote desktop connection via RDP (not VNC). + +![Appearance page in Settings][5] + +#### 5. Wallpaper that switches automatically with theme + +The above appearance page in settings also gives you a nice side-by-side look of the light and dark version. And when you change the system theme, the wallpaper also changes automatically! This is by far the most remarkable feature that GNOME 42 release brings. + +#### 6. Files icon change + +The default folder icons in Files (Nautilus) didn’t change for many years. In my opinion, everything changed over the years, but this piece remains the same. In GNOME 42, the folder icons colour in the Files file manager changes to light blue. + +Arguably, blue might not be the best colour considering every aspect. But blue still goes well with GNOME’s default wallpaper and other component pallets. And a change to the default Files look is always welcome. + +![Files with new color folders in GNOME 42][6] + +#### 7. A brand new text editor + +A new Text Editor replaces the famous and fabulous Gedit in GNOME 42. The Gedit is a powerful and time-tested utility, and replacing all of its functionality takes time. The new Text Editor is built in GTK4 from scratch and brings some outstanding features, including built-in themes and light and dark mode. More features are expected to arrive in Text Editor in future. + +To be clear, Gedit doesn’t go away. It’s still there in the respective Linux distribution’s repo, and you can install it whatever you want. + +You can read our exclusive piece on Gedit and GNOME Text Editor below. + +[Features about GNOME Text Editor][7] + +[Why Gedit is the great text editor][8] + +#### 8. A native screenshot tool + +One of the best features of the GNOME 42 release is the built-in screenshot and screen recording tool. You do not install any additional app for this. Your life will be easier with this tool, which takes care of the screenshot and screen recording with its nifty user interface when you press the `Print Screen` button. + +In earlier releases, hitting the Print Screen takes the entire desktop screenshot and saves it. Now, you need to hit Enter key after pressing Print Screen from the keyboard. + +![GNOME 42 introduces new screenshot tool][9] + +#### 9. Stunning Wallpapers + +A set of awesome wallpapers is about to treat you and give your favourite GNOME 42 desktop a visual uplift. And the wallpapers also have a dark version, which is set automatically when you choose dark over light. + +#### 10. Other Changes + +Some of the misc changes in the GNOME 42 release is the Eye of GNOME (image viewer) received a much-needed performance boost, Web browser GNOME Web now support hardware acceleration and user interface update in Maps. Also, a new Console application is a nice add on to this release which replaces GNOME Terminal. + +So, that’s about significant changes. But many changes make GNOME 42 release is one of the biggest releases in its history. + +### How to get GNOME 42 + +GNOME 42 [was released on March 23, 2022][10], and you get to experience it via [GNOME OS][11] right away. + +If you plan to get it via Linux Distribution, you have to wait for a little. [Ubuntu 22.04 LTS][12] will feature GNOME 42 (partial), due April 2022. And [Fedora 36][13], which is expected in April as well. + +If you are an Arch Linux user, GNOME 42 will arrive soon in the main extra repo. Keep a watch on [this page][14] or check your Arch system via the usual `pacman -Syu` command. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/03/gnome-42-release/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/03/GNOME-42-Desktop.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2022/03/GNOME-42-Shell-updates.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/03/Revamped-OSD-and-menu-in-GNOME-42.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/03/This-option-makes-it-folow-dar-and-light-theme-automatically.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/03/Appearance-page-in-Settings.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/03/Files-with-new-color-folders-in-GNOME-42.jpg +[7]: https://www.debugpoint.com/2021/12/gnome-text-editor/ +[8]: https://www.debugpoint.com/2021/04/gedit-features/ +[9]: https://www.debugpoint.com/wp-content/uploads/2022/03/GNOME-42-introduces-new-screenshot-tool.jpg +[10]: https://release.gnome.org/42/ +[11]: https://os.gnome.org/ +[12]: https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/ +[13]: https://www.debugpoint.com/2022/02/fedora-36/ +[14]: https://archlinux.org/groups/x86_64/gnome/ diff --git a/sources/tech/20220323 Implementing a toy version of TLS 1.3.md b/sources/tech/20220323 Implementing a toy version of TLS 1.3.md new file mode 100644 index 0000000000..6611661145 --- /dev/null +++ b/sources/tech/20220323 Implementing a toy version of TLS 1.3.md @@ -0,0 +1,427 @@ +[#]: subject: "Implementing a toy version of TLS 1.3" +[#]: via: "https://jvns.ca/blog/2022/03/23/a-toy-version-of-tls/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Implementing a toy version of TLS 1.3 +====== + +Hello! Recently I’ve been thinking about how I find it fun to learn computer networking by implementing working versions of real network protocols. + +And it made me wonder – I’ve implemented toy versions of [traceroute][1], [TCP][2] and [DNS][3]. What about TLS? Could I implement a toy version of that to learn more about how it works? + +I asked on Twitter if this would be hard, got [some encouragement and pointers for where to start][4], so I decided to go for it. + +This was really fun and I learned a little more about how involved real cryptography is – thanks to [cryptopals][5], I already 100% believed that I should not invent my own crypto implementations, and seeing how the crypto in TLS 1.3 works gave me even more of an appreciation for why I shouldn’t :) + +As a warning: I am really not a cryptography person, I will probably say some incorrect things about cryptography in this post and I absolutely do not know the history of past TLS vulnerabilities that informed TLS 1.3’s design. + +All of that said, let’s go implement some cryptography! All of my hacky code is [on github][6]. I decided to use Go because I heard that Go has good crypto libraries. + +### the simplifications + +I only wanted to work on this for a few days at most, so I needed to make some pretty dramatic simplifications to make it possible to get it done quickly. + +I decided my goal was going to be to download this blog’s homepage with TLS. So I don’t need to implement a fully general TLS implementation, I just need to successfully connect to one website. + +Specifically, this means that: + + * I only support one cipher suite + * I don’t verify the server’s certificate at all, I just ignore it + * my parsing and message formatting can be extremely janky and fragile because I only need to be able to talk to one specific TLS implementation (and believe me, they are) + + + +### an amazing TLS resource: tls13.ulfheim.net + +Luckily, before starting this I remembered vaguely that I’d seen a website that explained every single byte in a TLS 1.3 connection, with detailed code examples to reproduce every part. Some googling revealed that it was [The New Illustrated TLS Connection][7]. + +I can’t stress enough how helpful this was, I looked at probably more than a hundred times and I only looked at the TLS 1.3 RFC for a few small things. + +### some cryptography basics + +Before I started working on this, my understanding of TLS was: + + 1. at the beginning there’s some sort of Diffie-Hellman key exchange + 2. you use the key exchange to somehow (how???) get an AES symmetric key and encrypt the rest of the connection with AES + + + +This was sort of right, but it turns out it’s more complicated than that. + +Okay, let’s get into my hacky toy TLS implementation. It hopefully goes without saying that you should absolutely not use this code for anything. + +### step 1: say hello + +First we need to send a “Client Hello” message. For my purposes this has just 4 pieces of information in it: + + 1. A randomly generated public key + 2. 32 bytes of random data (the “Client Random”) + 3. The domain name I want to connect to (`jvns.ca`) + 4. The cipher suites/signature algorithms we want to use (which I just copied from tls.ulfheim.net). This negotiation process is pretty important in general but I’m ignoring it because I only support one signature algorithm / cipher suite. + + + +The most interesting part of this to me was part 1 – how do I generate the public key? + +I was confused about this for a while but it ended up being just 2 lines of code. + +``` + + privateKey := random(32) + publicKey, err := curve25519.X25519(privateKey, curve25519.Basepoint) + +``` + +You can see the rest of the code to generate the [client hello message here][8] but it’s very boring, it’s just a lot of bit fiddling. + +### elliptic curve cryptography is cool + +I am not going to give an explanation of elliptic curve cryptography here, but I just want to say how point out how cool it is that you can: + + * generate a random 32-byte string as a private key + * “multiply” the private key by the curve’s base point to get the public key (this is elliptic curve “multiplication”, where `n * P` means “add P to itself n times”) + * that’s it!! + + + +I am not going to say more about elliptic curve cryptography here but I love how simple this is to use – it seems a lot straightforward than RSA where your private keys have to be prime numbers. + +I don’t know if “you can use any 32-byte string as a private key” is true for all elliptic curves or just for this specific elliptic curve ([Curve25519][9]). + +### step 2: parse the server hello + +Next the server says hello. This is very boring, basically we just need to parse it to get the server’s public key which is 32 bytes. [Here’s the code though][10]. + +### step 3: calculate the keys to encrypt the handshake + +Now that we have the server’s public key and we’ve sent the server our public key, we can start to calculate the keys we’re going to use to actually encrypt data. + +I was surprised to learn that there are at least 4 different symmetric keys involved in TLS: + + * client handshake key/iv (for the data the client sends in the handshake) + * server handshake key/iv (for the data the server sends in the handshaek) + * client application key/iv (for the rest of the data the client sends) + * server application key/iv (for the rest of the data the server sends) + * I think also another key for session resumption, but I didn’t implement that + + + +We start out by combining the server’s public key and our private key to get a shared secret. This is called “elliptic curve diffie hellman” or ECDH and it’s pretty simple: “multiply” the server’s private key by our public key: + +``` + + sharedSecret, err := curve25519.X25519(session.Keys.Private, session.ServerHello.PublicKey) + +``` + +This gives us a 32-byte secret key that both the client and the server has. Yay! + +But we need 96 bytes (16 + 12) * 4 of keys in total. That’s more than 32 bytes! + +### time for key derivation + +Apparently the way you turn a small key into more keys is called “key derivation”, and TLS 1.3 uses an algorithm called “HKDF” to do this. I honestly do not understand this but here is what my code to do it looks like. + +It seems to involve alternately calling `hkdf.Expand` and `hkdf.Extract` over and over again a bunch of times. + +``` + + func (session *Session) MakeHandshakeKeys() { + zeros := make([]byte, 32) + psk := make([]byte, 32) + // ok so far + if err != nil { + panic(err) + } + earlySecret := hkdf.Extract(sha256.New, psk, zeros) // TODO: psk might be wrong + derivedSecret := deriveSecret(earlySecret, "derived", []byte{}) + session.Keys.HandshakeSecret = hkdf.Extract(sha256.New, sharedSecret, derivedSecret) + handshakeMessages := concatenate(session.Messages.ClientHello.Contents(), session.Messages.ServerHello.Contents()) + + cHsSecret := deriveSecret(session.Keys.HandshakeSecret, "c hs traffic", handshakeMessages) + session.Keys.ClientHandshakeSecret = cHsSecret + session.Keys.ClientHandshakeKey = hkdfExpandLabel(cHsSecret, "key", []byte{}, 16) + session.Keys.ClientHandshakeIV = hkdfExpandLabel(cHsSecret, "iv", []byte{}, 12) + + sHsSecret := deriveSecret(session.Keys.HandshakeSecret, "s hs traffic", handshakeMessages) + session.Keys.ServerHandshakeKey = hkdfExpandLabel(sHsSecret, "key", []byte{}, 16) + session.Keys.ServerHandshakeIV = hkdfExpandLabel(sHsSecret, "iv", []byte{}, 12) + } + +``` + +This was pretty annoying to get working because I kept passing the wrong arguments to things. The only reason I managed it was because provided a bunch of example inputs and outputs and example code so I was able to write some unit tests and check my code against the site’s example implementation. + +Anyway, eventually I got all my keys calculated and it was time to start decrypting! + +### an aside on IVs + +For each key there’s also an “IV” which stands for “initialization vector”. The idea seems to be to use a different initialization vector for every message we encrypt/decrypt, for More Security ™. + +In this implementation the way we get a different IV for each message is by xoring the IV with the number of messages sent/received so far. + +### step 4: write some decryption code + +Now that we have all these keys and IVs, we can write a `decrypt` function. + +I thought that TLS just used AES, but apparently it uses something called “authentication encryption” on top of AES that I hadn’t heard of before. + +The wikipedia article explanation of authenticated encryption is actually pretty clear: + +> … authenticated encryption can provide security against **chosen ciphertext** attack. In these attacks, an adversary attempts to gain an advantage against a cryptosystem (e.g., information about the secret decryption key) by submitting carefully chosen ciphertexts to some “decryption oracle” and analyzing the decrypted results. Authenticated encryption schemes can recognize improperly-constructed ciphertexts and refuse to decrypt them. This, in turn, prevents the attacker from requesting the decryption of any ciphertext unless it was generated correctly using the encryption algorithm + +This makes sense to me because I did some of the cryptopals challenges and there’s an attack a bit like this in [cryptopals set 2][11] (I don’t know if it’s the exact same thing). + +Anyway, here’s some code that uses authenticated encryption the way the TLS 1.3 spec says it should. I think GCM is an authenticated encryption algorithm. + +``` + + func decrypt(key, iv, wrapper []byte) []byte { + + block, err := aes.NewCipher(key) + if err != nil { + panic(err.Error()) + } + + aesgcm, err := cipher.NewGCM(block) + if err != nil { + panic(err.Error()) + } + + additional := wrapper[:5] + ciphertext := wrapper[5:] + + plaintext, err := aesgcm.Open(nil, iv, ciphertext, additional) + if err != nil { + panic(err.Error()) + } + return plaintext + } + +``` + +### step 5: decrypt the server handshake + +Next the server sends some more handshake data. This contains the certificate and some other stuff. + +Here’s my code for decrypting the handshake. Basically it just reads the encrypted data from the network, decrypts it, and saves it. + +``` + + record := readRecord(session.Conn) + if record.Type() != 0x17 { + panic("expected wrapper") + } + session.Messages.ServerHandshake = decrypt(session.Keys.ServerHandshakeKey, session.Keys.ServerHandshakeIV, record) + +``` + +You might notice that we don’t actually _parse_ this data at all – that’s because we don’t need the contents, since we’re not verifying the server’s certificate. + +I was surprised that you don’t technically need to look at the server’s certificate at all to make a TLS connection (though obviously you should verify it!). I thought you would need to at least parse it to get a key out of it or something. + +We do need to be able to hash the handshake for the next step though, so we have to store it. + +### step 6: derive more keys + +We use a hash of the SHA256 handshake data we just got from the server to generate even more symmetric keys. This is almost the last step! + +This is almost exactly the same as the key derivation code from before, but I’m including it because I was surprised by how much work needed to be done to generate all these keys. + +``` + + func (session *Session) MakeApplicationKeys() { + handshakeMessages := concatenate( + session.Messages.ClientHello.Contents(), + session.Messages.ServerHello.Contents(), + session.Messages.ServerHandshake.Contents()) + + zeros := make([]byte, 32) + derivedSecret := deriveSecret(session.Keys.HandshakeSecret, "derived", []byte{}) + masterSecret := hkdf.Extract(sha256.New, zeros, derivedSecret) + + cApSecret := deriveSecret(masterSecret, "c ap traffic", handshakeMessages) + session.Keys.ClientApplicationKey = hkdfExpandLabel(cApSecret, "key", []byte{}, 16) + session.Keys.ClientApplicationIV = hkdfExpandLabel(cApSecret, "iv", []byte{}, 12) + + sApSecret := deriveSecret(masterSecret, "s ap traffic", handshakeMessages) + session.Keys.ServerApplicationKey = hkdfExpandLabel(sApSecret, "key", []byte{}, 16) + session.Keys.ServerApplicationIV = hkdfExpandLabel(sApSecret, "iv", []byte{}, 12) + } + +``` + +### step 7: finish the handshake + +Next we need to send a “handshake finished” message to the server to verify that everything is done. That code is [here][12]. + +And now we’re done the handshake! That was the hard part, sending and receiving the data is relatively easy. + +### step 8: make a HTTP request + +I wrote a `SendData` function that encrypts and sends data using our keys. This time we’re using the “application” keys and not the handshake keys. This made making a HTTP request pretty simple: + +``` + + req := fmt.Sprintf("GET / HTTP/1.1\r\nHost: %s\r\n\r\n", domain) + session.SendData([]byte(req)) + +``` + +### step 9: we can actually decrypt the response!!! + +Now comes the moment I’d been waiting for — actually decrypting the response from the server!!! But here I needed to learn something else about TLS. + +### TLS data comes in blocks + +I previously thought that once you established the connection, encrypted TLS data was just a stream. But that’s not how it works – instead, it’s transmitted in blocks. Like, you’ll get a chunk of ~1400 bytes to decrypt, and then another chunk, and then another chunk. + +I’m not sure why the blocks have the size they do (maybe it’s so that each one will fit inside a TCP packet ???), but in theory I think they could be up to 65535 bytes, since their size field is 2 bytes. The blocks I got were all 1386 bytes each. + +Every time we get a block, we have to: + + * calculate a new IV as `old_iv xor num_records_received` + * decrypt it using the key and the new IV + * increment the count of records received + + + +Here’s what the `ReceiveData()` function I wrote looks like. + +The most interesting part of this is the `iv[11] ^= session.RecordsReceived` – that’s the part that adjusts the IV for each block. + +``` + + func (session *Session) ReceiveData() []byte { + record := readRecord(session.Conn) + iv := make([]byte, 12) + copy(iv, session.Keys.ServerApplicationIV) + iv[11] ^= session.RecordsReceived + plaintext := decrypt(session.Keys.ServerApplicationKey, iv, record) + session.RecordsReceived += 1 + return plaintext + } + +``` + +This `iv[11]` thing assumes that there are less than 255 blocks which obviously is not true in general in TLS, but I was lazy and to download my blog’s homepage I only needed 82 blocks. + +We actually have to do this when we send data too, but I didn’t implement it because we only sent 1 packet. + +### problem: getting the whole block of tLS data + +I ran into one problem with TCP where sometimes I’d try to read a block of TLS data (~1386 bytes), but I wouldn’t get the whole thing. I guess the TLS blocks can be split up across multiple TCP packets. + +I fixed this in a really dumb way, by just polling the TCP connection in a loop until it gave me the data I wanted. Here’s my code to do that: + +``` + + func read(length int, reader io.Reader) []byte { + var buf []byte + for len(buf) != length { + buf = append(buf, readUpto(length-len(buf), reader)...) + } + return buf + } + +``` + +I assume a real TLS implementation would use a thread pool or coroutines or something to manage this. + +### step 10: knowing when we’re done + +When the HTTP response is done, we get these bytes: `[]byte{48, 13, 10, 13, 10, 23}`. I don’t know what this is supposed to mean exactly but it seems to signal the end of the connection. + +So here’s the code to receive the HTTP response. Basically we just loop until we see those bytes, then we stop. + +``` + + func (session *Session) ReceiveHTTPResponse() []byte { + var response []byte + for { + pt := session.ReceiveData() + if string(pt) == string([]byte{48, 13, 10, 13, 10, 23}) { + break + } + response = append(response, pt...) + } + return response + } + +``` + +### that’s it! + +Finally, I ran the program and I downloaded my blog’s homepage! It worked! Here’s what the results look like: + +``` + + $ go build; ./tiny-tls + HTTP/1.1 200 OK + Date: Wed, 23 Mar 2022 19:37:47 GMT + Content-Type: text/html + Transfer-Encoding: chunked + Connection: keep-alive + ... lots more headers and HTML follow... + +``` + +Okay, the results are kind of anticlimactic, it’s just the same as what you’d see if you ran `curl -i https://jvns.ca` except with no formatting. But I was extremely excited when I saw it. + +### the block thing is kind of weird + +I find it a bit weird that TLS data is sent/received in blocks. I assume it makes sense from a cryptography perspective (because you want to change your IVs frequently or something?). + +But from a networking perspective it feels a bit strange. Like, TCP is built on top of a packet system, and then with TLS you sort of have another packet system on top of TCP. + +Maybe one of the motivations for QUIC is to design a network protocol which has TLS as more of a first-class citizen, so you don’t have this weird packet/stream/packet thing? + +### some things I learned + +This was really fun! I learned that + + * elliptic curve diffie-hellman is very cool, and at least with Curve25519 you can use literally any 32-byte string as a private key + * there are a LOT of different symmetric keys involved in TLS and the key derivation process is pretty complicated + * TLS uses AES with some extra “authenticated encryption” algorithms on top + * TLS data is sent/received as a bunch of blocks, not as a stream + + + +My code truly is terrible, it can connect to my site (`jvns.ca`) and I think literally no other sites. + +I won’t pretend to understand all the reasons TLS is designed this way, but it was a fun way to spend a couple of days, I feel a little more informed, and I think it’ll be easier for me to understand things I read about TLS in the future. + +### a plug for cryptopals + +If you want to learn about cryptography and you haven’t tried the [cryptopals][5] challenges, I really recommend them – you get to implement a lot of attacks on crypto systems and it’s very fun. + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2022/03/23/a-toy-version-of-tls/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://jvns.ca/blog/2013/10/31/day-20-scapy-and-traceroute/ +[2]: https://jvns.ca/blog/2014/08/12/what-happens-if-you-write-a-tcp-stack-in-python/ +[3]: https://jvns.ca/blog/2022/02/01/a-dns-resolver-in-80-lines-of-go/ +[4]: https://twitter.com/Lukasaoz/status/1505593360521777157 +[5]: https://cryptopals.com/ +[6]: https://github.com/jvns/tiny-tls/ +[7]: https://tls13.ulfheim.net +[8]: https://github.com/jvns/tiny-tls/blob/cb5a3665c3487ad1f1d5f917ad069c93dd44967e/format.go#L41 +[9]: https://en.wikipedia.org/wiki/Curve25519 +[10]: https://github.com/jvns/tiny-tls/blob/cb5a3665c3487ad1f1d5f917ad069c93dd44967e/format.go#L98-L131 +[11]: https://cryptopals.com/sets/2/challenges/14 +[12]: https://github.com/jvns/tiny-tls/blob/cb5a3665c3487ad1f1d5f917ad069c93dd44967e/crypto.go#L177-L183 diff --git a/sources/tech/20220328 Not a Systemd Fan- Here are 11 Systemd-Free Linux Distributions.md b/sources/tech/20220328 Not a Systemd Fan- Here are 11 Systemd-Free Linux Distributions.md new file mode 100644 index 0000000000..a3d913712a --- /dev/null +++ b/sources/tech/20220328 Not a Systemd Fan- Here are 11 Systemd-Free Linux Distributions.md @@ -0,0 +1,238 @@ +[#]: subject: "Not a Systemd Fan? Here are 11 Systemd-Free Linux Distributions" +[#]: via: "https://itsfoss.com/systemd-free-distros/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Not a Systemd Fan? Here are 11 Systemd-Free Linux Distributions +====== + +systemd is a popular init system adopted by most of the major Linux distributions backed by dozens of developers and companies. + +In case you’re curious, the init system is the first process after the Linux Kernel comes into action in the boot process to initialize various device management, logging, and networking service. You may know them as [daemons][1] as well. + +Technically, systemd solved numerous issues that made Linux distributions more reliable to use on desktop and massive server configurations. + +So, it is safe to say that many believe that it is meant to be to make the boot process reliable and fast with the ability to initialize things in parallel,. + +However, there are other users who absolutely hate the inclusion of it in modern Linux distributions. Hence, demanding systemd-free Linux distributions. + +But, why is that? + +Furthermore, what are your options if you do not want systemd on your Linux system? + +This article will briefly discuss why some users prefer system-free distros and some of the best options available. + +![][2] + +### Why systemd-free Alternatives? + +Primarily, systemd is considered as a bloated implementation compared to the classic init systems like SysVinit (or System V init). + +It is also believed to go against the UNIX philosophy, where the aim should have been to keep things simple and focus on doing a single thing efficiently. + +Moreover, systemd is a complex implementation with various modules, which potentially increases the attack surface compared to SysVinit. + +In addition to some of these reasons, desktop environments like GNOME and KDE are known to depend on systemd components. However, some argue that other tools/services should not be entirely dependent on systemd, taking the freedom of a user to use another init system. + +### 11 Systemd-free Linux Distro Options + +However, the list of distributions without systemd involves some options that use [elogind][3] and some systemd parts. + +These are some of the options that help you run distros without systemd while fulfilling some of the dependencies of systemd. + +Fret not, the list also involves options that are entirely systemd-free without elogind and other systemd-parts. The list mentions the use of the same wherever necessary. + +The list is in no particular order of ranking. + +#### 1\. Devuan + +![Credits: Distrowatch][4] + +Devuan is a Debian fork without systemd. It is usually based on the latest stable Debian version available. + +The project’s aim is to allow users to control the choice of Init system. You can choose to use sysVinit, runit, and openRC. + +With Devuan, you will have access to all the desktop environments that are available in Debian. It works with the systemd-free configurations. Compared to some other systemd-free distros, Devuan can be an easier option with respectable accessibility improvements and a smooth installation process. + +At the time of publishing this, you can try Devuan on 32-bit and 64-bit systems. + +[Devuan][5] + +#### 2\. AntiX + +![Credits: Distrowatch][6] + +AntiX is an interesting systemd-free distro based on Debian (Stable), which is also [one of the best options for 32-bit systems][7]. + +Considering it offers support for both 64-bit and 32-bit systems and uses IceWM window manager, it is [one of the most lightweight options][8] as well. + +You also get the option to use Fluxbox, and a couple of other window managers as per your requirements. + +When it comes to the Init system, you can choose to download the runit edition or sysVinit version. There are different editions available to get started. + +[AntiX][9] + +#### 3\. Void Linux + +![Credits: Distrowatch][10] + +Void Linux is a unique offering that is not based on any existing Linux distro. It is entirely independent and actively developed. + +It prefers to use runit as the init system instead of systemd. While it focuses on providing stability, they follow a [rolling release schedule][11] with their continuous build system. + +You get to use its native package manager, written from scratch, to quickly install and manage software in your system. + +They offer detailed documentation to explain the available features and instructions to configure your experience. + +[Void Linux][12] + +#### 4\. GoboLinux + +![Credits: Distrowatch][13] + +If you are feeling adventurous, and do not have an issue playing with the terminal, GoboLinux is an interesting pick. While it does offer a desktop, you get the bare minimum and don’t expect something like you see in Ubuntu. + +Unlike most, it is a modular Linux distribution that focuses on an efficient file system to organize the programs. Usually, when we install something on Linux, the files for programs get scattered all over the system at different directories. + +GoboLinux aims to simplify that by giving each program its directory. On top of all the unique points, it is also a systemd-free distro. + +[GoboLinux][14] + +#### 5\. Alpine Linux + +![][15] + +Alpine Linux is yet another independent Linux distribution without systemd. When it comes to init system, it uses OpenRC. + +The distribution focuses on security and resource efficiency. So, if you were looking for a simple systemd-free distro with a focus on security, Alpine Linux can be a good choice. + +[Alpine Linux][16] + +### 6\. Artix + +![Credits: Distrowatch][17] + +Artix is an Arch-based distro without systemd. You can configure it to use OpenRC, Runit, or dinit (a new init system). + +It does utilize **elogind** as its user login manager to try making the move to a systemd-free distro seamless. However, if you dislike its presence, you can try running it without it. + +Compared to some other options, Artix is only suitable for experienced Arch users who can configure their setup. + +[Artix Linux][18] + +### 7\. TinyCore Linux + +![Credits: Distrowatch][19] + +TinyCore Linux is a modular Linux distribution with community-built extensions. You get a Linux kernel, root filesystem, and some startup-up scripts to install some kernel modules. + +Basically, you build your minimal Linux distribution with TinyCore Linux. + +As the name suggests, it is a tiny installation barely taking up any storage space (as low as 10 MB) as per modern OS standards. + +Considering it is modular, you can fully customize your configuration without systemd, or making use of elogind. You can quickly install a variety of desktop environments and window managers to get started. + +For obvious reasons, it can run perfectly fine on older computers. + +[TinyCore Linux][20] + +### 8\. Chimera Linux + +![][21] + +Chimera Linux is an experimental option if you like to compile things yourself and use a Linux distribution. However, you get ISO images available with GUI. + +It is based on FreeBSD, and uses dinit as its init system. + +You can install GNOME or Enlightenment desktop with Chimera Linux to get a full-fledged desktop experience. + +[Chimera Linux][22] + +### 9\. Venom Linux + +![Credits: Distrowatch][23] + +Venom Linux is yet another source-based Linux distribution, giving you the ability to customize things while keeping it minimal. + +It does not rely on systemd or elogind. + +[Venom Linux][24] + +### 10\. Kiss Linux + +Kiss Linux is a rolling release distribution where you need to download the tarball, unpack and rebuild the system as per your requirements. + +The default init system is busybox. But, you can experiment with other init systems as well. + +[Kiss Linux][25] + +### 11\. PCLinuxOS + +![PCLinuxOS][26] + +PCLinuxOS is a fantastic choice for users who want a working desktop environment without all the hassle. + +It does not rely on systemd, but you also get all the essential tools with the distribution baked in. So, compared to most other options, the challenges of not having systemd will be minimal, making the user experience better. + +It uses sysVinit and also features a package manager to help you manage software. + +[PCLinuxOS][27] + +### Systemd or Not? + +Bloat or not, Systemd has made it possible to make numerous things easy while improving performance. + +You will not have any compatibility issues when choosing a distro with systemd. + +Considering most of the popular Linux distributions rely on it, there’s something about it that makes sense to provide a better user experience to the end-user. + +However, if you are someone who wants an init system that follows the traditional approach, systemd-free distros should suit you well. + +Note that you might face some issues/challenges when it comes to some systemd-free distros. So, make sure you do your research before trying anything. + +If you know of some other good Linux distro that doesn’t use systemd, do let us know in the comments. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/systemd-free-distros/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/linux-daemons/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/systemd-free-distros.png?resize=800%2C450&ssl=1 +[3]: https://wiki.gentoo.org/wiki/Elogind +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/devuan.png?resize=800%2C500&ssl=1 +[5]: https://www.devuan.org/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/antix.png?resize=800%2C500&ssl=1 +[7]: https://itsfoss.com/32-bit-linux-distributions/ +[8]: https://itsfoss.com/lightweight-linux-beginners/ +[9]: https://antixlinux.com/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/void.jpg?resize=800%2C500&ssl=1 +[11]: https://itsfoss.com/rolling-release/ +[12]: https://voidlinux.org/ +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/gobo.png?resize=800%2C450&ssl=1 +[14]: https://gobolinux.org/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/AlpineDesktop.png?resize=800%2C452&ssl=1 +[16]: https://alpinelinux.org/ +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/artix.jpg?resize=800%2C500&ssl=1 +[18]: https://artixlinux.org/ +[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/tinycore.jpg?resize=800%2C640&ssl=1 +[20]: http://tinycorelinux.net/ +[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/chimera-screenshot.jpg?resize=800%2C450&ssl=1 +[22]: https://chimera-linux.org/ +[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/venom.jpg?resize=800%2C500&ssl=1 +[24]: https://venomlinux.org/ +[25]: https://kisslinux.org/ +[26]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/03/pclinuxos.jpg?resize=800%2C500&ssl=1 +[27]: https://www.pclinuxos.com/ diff --git a/sources/tech/20220408 Samba as AD and Domain Controller.md b/sources/tech/20220408 Samba as AD and Domain Controller.md new file mode 100644 index 0000000000..c85a6cdda0 --- /dev/null +++ b/sources/tech/20220408 Samba as AD and Domain Controller.md @@ -0,0 +1,391 @@ +[#]: subject: "Samba as AD and Domain Controller" +[#]: via: "https://fedoramagazine.org/samba-as-ad-and-domain-controller/" +[#]: author: "Daniel Kühl https://fedoramagazine.org/author/dklima/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Samba as AD and Domain Controller +====== + +![Samba AD Domain Controller][1] + +Photo by [Eric Schirtzinger][2] on [Unsplash][3] + +Having a server with Samba providing AD and Domain Controller functionality will provide you with a very mature and professional way to have a centralized place with all users and groups information. It will free you from the burden of having to manage users and groups on each server. This solution is useful for authenticating applications such as WordPress, FTP servers, HTTP servers, you name it. + +This step-by-step tutorial about setting up Samba as an AD and Domain Controller will demonstrate to you how you can achieve this solution for your network, servers, and applications. + +### Pre-requisites + +A fresh Fedora Linux 35 server installation. + +### Definitions + +**Hostname**: dc1 +**Domain**: onda.org +**IP**: 10.1.1.10/24 + +### Considerations + + * Once the domain was chosen, you can’t change it, be wise; + * In the _/etc/hosts_ file, the server name can’t be on _127.0.0.1_ line, it must be on its IP address line; + * Use a fixed IP address for the server, as a result, the server’s IP won’t change; + * Once you provision the DC server, do not provision another one, join other ones to the domain instead; + * For the DNS server, we will choose _SAMBA_INTERNAL_, so we can have the DNS forwarding feature; + * It is necessary to have a time synchronization service running in the server, like _chrony_ or _ntp_, so you can avoid numerous problems from not having the server and clients synchronized with the same time; + + + +### Samba installation + +Let’s install the required software to get through this guide. It will provide all the applications you will need. + +``` + + sudo dnf install samba samba-dc samba-client heimdal-workstation + +``` + +![Samba installation][4] + +### Configurations + +For setting up Samba as an AD and Domain Controller, you will have to prepare the environment with a functional configuration before you start using it. + +#### Firewall + +You will need to allow some UDP and TCP ports through the firewall so that clients will be able to connect to the Domain Controller. + +I will show you two methods to add them. Choose the one that suits you best. + +##### First method + +This is the most straightforward method, _firewalld_ comes with a service with all ports needed to open Samba DC, which is called _samba-dc_. Add it to the firewall rules: + +Add the service: + +``` + + sudo firewall-cmd --permanent --add-service samba-dc + +``` + +##### Second method + +Alternatively, you can add the rules from the command line: + +``` + + sudo firewall-cmd --permanent --add-port={53/udp,53/tcp,88/udp,88/tcp,123/udp,135/tcp,137/udp,138/udp,139/tcp,389/udp,389/tcp,445/tcp,464/udp,464/tcp,636/tcp,3268/tcp,3269/tcp,49152-65535/tcp} + +``` + +Reload _firewalld_: + +``` + + sudo firewall-cmd --reload + +``` + +For more information about _firewalld_, check the following article: [Control the firewall at the command line][5] + +#### SELinux + +To run a Samba DC and running with SELinux in enforcing mode, it is necessary to set some samba booleans for SELinux to on. After these booleans are set, it should not be necessary to disable SELinux. + +``` + + sudo setsebool -P samba_create_home_dirs=on samba_domain_controller=on samba_enable_home_dirs=on samba_portmapper=on use_samba_home_dirs=on + +``` + +Restore the default SELinux security contexts for files: + +``` + + sudo restorecon -Rv / + +``` + +#### Samba + +First, remove the _/etc/samba/smb.conf_ file if it exists: + +``` + + sudo rm /etc/samba/smb.conf + +``` + +Samba uses its own DNS service, and for that reason, the service won’t start if _systemd-resolved_ is running, that is why it is necessary to edit its configuration to stop listening on port 53 and use Samba’s DNS. + +Create the directory _/etc/systemd/resolved.conf.d/_ if it does not exist: + +``` + + sudo mkdir /etc/systemd/resolved.conf.d/ + +``` + +Create the file _/etc/systemd/resolved.conf.d/custom.conf_ that contains the custom config: + +``` + + [Resolve] + DNSStubListener=no + Domains=onda.org + DNS=10.1.1.10 + +``` + +**Remember to change the _DNS_ and _Domains_ entries to be your Samba DC server.** + +![][6] + +Restart the _systemd-resolved_ service: + +``` + + sudo systemctl restart systemd-resolved + +``` + +Finally, provision the Samba configuration. _samba-tool_ provides every step needed to make Samba an AD server. + +Using the _samba-tool_, provision the Samba configuration: + +``` + + sudo samba-tool domain provision --server-role=dc --use-rfc2307 --dns-backend=SAMBA_INTERNAL --realm=ONDA.ORG --domain=ONDA --adminpass=sVbOQ66iCD3hHShg + +``` + +![Samba domain provisioning][7] + +The _‐‐use-rfc2307_ argument provides POSIX attributes to Active Directory, which stores Unix user and group information on LDAP ([rfc2307.txt][8]). + +Make sure that you have the correct _dns forwarder_ address set in _/etc/samba/smb.conf_. Concerning this tutorial, it should be **different** from the server’s own IP address 10.1.1.10, in my case I set to 8.8.8.8, however your mileage may vary: + +![Changing the dns forwarder value on /etc/samba/smb.conf file][9] + +After changing the _dns forwarder value_, restart _samba_ service: + +``` + + sudo systemctl restart samba + +``` + +#### Kerberos + +After Samba installation, it was provided a _krb5.conf_ file that we will use: + +``` + + sudo cp /usr/share/samba/setup/krb5.conf /etc/krb5.conf.d/samba-dc + +``` + +Edit _/etc/krb5.conf.d/samba-dc_ content to match your organization information: + +``` + + [libdefaults] + default_realm = ONDA.ORG + dns_lookup_realm = false + dns_lookup_kdc = true + + [realms] + ONDA.ORG = { + default_domain = ONDA + } + + [domain_realm] + dc1.onda.org = ONDA.ORG + +``` + +#### Starting and enabling Samba on boot time + +To make sure that Samba will start on system initialization, enable and start it: + +``` + + sudo systemctl enable samba + sudo systemctl start samba + +``` + +### Testing + +#### Connectivity + +``` + + $ smbclient -L localhost -N + +``` + +As a result of _smbclient_ command, shows that connection **was successful. + +``` + + Anonymous login successful + Sharename Type Comment + --------- ---- ------- + sysvol Disk + netlogon Disk + IPC$ IPC IPC Service (Samba 4.15.6) + SMB1 disabled -- no workgroup available + +``` + +![smbclient connection test][10] + +Now, test the _Administrator_ login to _netlogon_ share: + +``` + + $ smbclient //localhost/netlogon -UAdministrator -c 'ls' + +``` + +``` + + Password for [ONDA\Administrator]: + . D 0 Sat Mar 26 05:45:13 2022 + .. D 0 Sat Mar 26 05:45:18 2022 + + 8154588 blocks of size 1024. 7307736 blocks available + +``` + +![smbclient Administrator connection test][11] + +#### DNS test + +To test if the name resolution is working, execute the following commands: + +``` + + $ host -t SRV _ldap._tcp.onda.org. + _ldap._tcp.onda.org has SRV record 0 100 389 dc1.onda.org. + +``` + +``` + + $ host -t SRV _kerberos._udp.onda.org. + _kerberos._udp.onda.org has SRV record 0 100 88 dc1.onda.org. + +``` + +``` + + $ host -t A dc1.onda.org. + dc1.onda.org has address 10.1.1.10 + +``` + +If you get the error: + +``` + + -bash: host: command not found + +``` + +Install the _bind-utils_ package: + +``` + + sudo dnf install bind-utils + +``` + +#### Kerberos test + +Testing Kerberos is important because it generates the required tickets to let clients authenticate with encryption. It heavily relies on correct time. + +It can’t be stressed enough to have date and time set correctly, and that is why it is so important to have a time synchronization service running on both clients and servers. + +``` + + $ /usr/lib/heimdal/bin/kinit administrator + $ /usr/lib/heimdal/bin/klist + +``` + +![Kerberos ticket validation][12] + +### Adding a user to the Domain + +_samba-tool_ provides us an interface for executing Domain administration tasks, so we can add a user to the Domain easily. + +The _samba-tool_ help is very comprehensive: + +``` + + $ samba-tool user add --help + +``` + +Adding user _danielk_ to the domain: + +``` + + sudo samba-tool user add danielk --unix-home=/home/danielk --login-shell=/bin/bash --gecos 'Daniel K.' --given-name=Daniel --surname='Kühl' --mail-address='danielk@onda.org' + +``` + +![Adding user to the Domain][13] + +To list the users on Domain: + +``` + + sudo samba-tool user list + +``` + +### Wrap up and conclusion + +We started out by installing Samba and required applications in a fresh Fedora Linux 35 installation. We’ve also explained the problems that this solution solves. Thereafter, we did an initial configuration that prepares the environment to be ready to Samba to operate as an AD and Domain Controller. + +Then, we proceeded to cover how to have Samba up and running alongside Fedora Linux security features, like having it working with _firewalld_ and SELinux enabled. We did some important testing to make sure everything was fine and ended by showing a bit on how to administrate users using _samba-tool_. + +To summarize, if you want to establish a robust solution for centralizing authentication across your network, servers (If one wanted to, one could even join a Windows 10 client to this Samba domain [_tested with Windows 10 Professional version 20H2_]) and services, consider using this approach as part of your infrastructure. + +Now that you know how to have a Samba as AD and Domain Controller solution, what would you like to see covered next? Share your thoughts in the [comments below][14]. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/samba-as-ad-and-domain-controller/ + +作者:[Daniel Kühl][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/dklima/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2022/04/samba-addc-816x346.jpg +[2]: https://unsplash.com/@eschirtz?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/tree?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/wp-content/uploads/2022/03/samba-install-1.gif +[5]: https://fedoramagazine.org/control-the-firewall-at-the-command-line/ +[6]: https://fedoramagazine.org/wp-content/uploads/2022/04/samba-systemd-resolved.gif +[7]: https://fedoramagazine.org/wp-content/uploads/2022/03/samba-domain-provision.gif +[8]: https://www.rfc-editor.org/rfc/rfc2307.txt +[9]: https://fedoramagazine.org/wp-content/uploads/2022/04/samba-dns-forwarder.gif +[10]: https://fedoramagazine.org/wp-content/uploads/2022/03/samba-testing1.gif +[11]: https://fedoramagazine.org/wp-content/uploads/2022/03/samba-testing2.gif +[12]: https://fedoramagazine.org/wp-content/uploads/2022/03/samba-kerberos.gif +[13]: https://fedoramagazine.org/wp-content/uploads/2022/04/samba-adding-user-1.gif +[14]: tmp.RAEqol0F4Y#comments diff --git a/sources/tech/20220421 10 Things to Do After Installing Ubuntu 22.04 [With Bonus Tip].md b/sources/tech/20220421 10 Things to Do After Installing Ubuntu 22.04 [With Bonus Tip].md new file mode 100644 index 0000000000..6f8b58849b --- /dev/null +++ b/sources/tech/20220421 10 Things to Do After Installing Ubuntu 22.04 [With Bonus Tip].md @@ -0,0 +1,193 @@ +[#]: subject: "10 Things to Do After Installing Ubuntu 22.04 [With Bonus Tip]" +[#]: via: "https://www.debugpoint.com/2022/04/10-things-to-do-ubuntu-22-04-after-install/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +10 Things to Do After Installing Ubuntu 22.04 [With Bonus Tip] +====== +You may want to try a summary of 10 things after installing Ubuntu 22.04 LTS “Jammy Jellyfish” (GNOME Edition). + +I am sure you are excited to experience the brand new Ubuntu 22.04 LTS and its shiny new features. If you have already installed or upgraded from the prior release, you may want to customise your system before you start using it. Although the customisations are subjective and vary with use cases. However, we give you 10 pointers that you can do after installing Ubuntu 22.04 LTS. I hope it helps. + +### 10 Things to Do After Installing Ubuntu 22.04 + +#### 1. Update Your System + +Firstly, you should do some housekeeping after installing Ubuntu 22.04 LTS. Before you begin using the new system and configuring it, ensure that it is up to date with the latest packages from the Ubuntu Jammy repo. So, open a terminal window and run the below commands. Or, open Software Updater from the search. + +``` +sudo apt update && sudo apt upgrade +``` + +![Update your Ubuntu 22.04 LTS System][1] + +Software application takes some time to load for the first time; hence you must do it as a number one step to save time later. It is best if you wait until the update finishes. Once the update is complete, open the Software App and ensure it completes downloading the app metadata. + +Finally, when everything completes, reboot your system to proceed. + +#### 2. Opt-In/Opt-Out from data collection and history settings + +Secondly, it’s essential to review the privacy settings before using the system. Because we are all concerned about our usage data, location tracking, etc. So, to check them, open Settings from search and go to Privacy. The items you should review are Location Services and File History usage in your system. Make sure to change them as per your need. + +![Review the privacy settings][2] + +#### 3. Configure KB shortcuts + +To effectively use Ubuntu 22.04 system, keyboard shortcuts are essential. It helps your work faster. So, ideally, keyboard shortcuts are pre-configured, but you may want to change them based on your habits from `Settings > Keyboard > View and Customize Shortcuts`. + +![Configure Keyboard shortcuts in Ubuntu 22.04][3] + +#### 4. Prepare for the backup + +If you plan to use the system for a longer duration, it is super important to create a system checkpoint just after installation. Because in the future, if something goes wrong, you can always revert to your system as a fresh install. + +Ubuntu 22.04 comes with the built-in backup tool – Backups. You can go ahead and use it to create a system checkpoint. + +However, we recommend you use the great backup and restore tool TImeshift. It has many additional options and is well documented for heavy usage. To install Timeshift, you can use software or the terminal commands mentioned below. + +As of writing this post, this Timeshift PPA is yet to be updated for Jammy Jellyfish. So, I would recommend you wait for a couple of days to install it via PPA. You can also monitor PPA updates [here][4]. You can always use the built-in backup tool as mentioned above. + +After installation, launch Timeshift and follow the on-screen instructions to create a system restore point. + +``` +sudo add-apt-repository -y ppa:teejee2008/ppasudo apt-get updatesudo apt-get install timeshift +``` + +#### 5. Explore the New Features + +Once you complete the above set of housekeepings, it’s time for you to explore the new features of Ubuntu 22.04. We covered the unique features of Ubuntu 22.04 and its flavours in detail in dedicated posts. You may want to check them out below. + +* [Ubuntu 22.04 LTS – GNOME][5] +* [Ubuntu MATE 22.04 LTS][6] +* [Kubuntu 22.04 LTS][7] +* [Xubuntu 22.04 LTS][8] +* [Ubuntu Budgie 22.04 LTS][9] +* [Lubuntu 22.04 LTS][10] +* [Ubuntu Kylin 22.04 LTS][11] +* [Ubuntu Studio 22.04 LTS][12] +* [Ubuntu 20.04 vs Ubuntu 22.04 – Differences][13] + +#### 6. Experience the first-ever Accent Colour in Ubuntu + +In addition to the above items, you may find the new accent colour interesting in this release. This is one of the new features which was due for a long time. So, in the Appearance settings, you can find the selected colour options. + +You can choose your favourite colour and see the selection, the folder icon gradient changes with the colour. However, you can not select the custom colour at the moment. I am sure it will eventually come up in future releases. + +![How Accent colour change impact looks in Ubuntu 22.04 LTS][14] + +#### 7. Dark Mode and new controls + +Besides that accent colour, this release, alongside GNOME 42, brings new style changes, thanks to GTK4 and libadwaita adoption. With this change, the built-in dark mode can apply across the desktop and application that supports it. Also, the controls such as buttons, notifications, rounded corners, scroll bars, etc. all are more stylish and compact in this release. + +All of these together make this release a beautiful one. + +#### 8. Install GNOME Extensions + +Additionally, you can take advantage of hundreds of excellent GNOME Extensions available. For example, you may want to customise the default Dock, Or, like a super cool blur effect, etc. – you can quickly achieve these using the extensions. + +We list here some of the exciting extensions you may want to try out after installing this release. + +* [Blur My Shell][15] – get an exciting blur effect on the default shell +* [Floating Dock][16] – make your dock float wherever you want +* Dash to Dock: Enables you to control your Dash across the screen with various options. +* Caffeine: Enables you more productively. +* [Time ++][17]: Super handy extension to give you an alarm clock, stopwatch, time tracker, Pomodoro, and todo.txt manager – all together. +* [NetSpeed][18]: Show your internet download and upload speed in the system tray. + +Before installing the above extensions, open a terminal prompt and install the chrome-gnome-shell using the below command to enable extensions. + +``` +sudo apt-get install chrome-gnome-shell +``` + +Then go to [https://extensions.gnome.org][19] and enable the extensions for Firefox. + +If you use the Snap version of Firefox, then the extension connectivity won’t work. So, uninstall the Firefox Snap version and [use an alternate installation][20] Or use a different browser (Such as Google Chrome, Chromium) that has a .deb version. Or, install the extension using the manual steps [outlined here in this article][21]. + +#### 9. Configure Email Client + +Moreover, a native desktop email client is always preferable over browser-based email access. Hence, I would recommend you configure Thunderbird with your email service provider. The setup is more straightforward and wizard-driven. It helps for offline and drafting work for heavy email users. + +Alternatively, if you do not like Thunderbird, try to check out options – you can read our list of [top free native Linux desktop email clients list][22] and choose your favourite. + +#### 10. Install some additional packages and Software + +In addition to the above items, you should install some additional packages and software because Ubuntu doesn’t come with extra apps other than the native GNOME applications. We list here some of the important applications needed for basic desktop usage. + +You can install them using the Software application. + +* GIMP – Advanced photo editor +* VLC – Media play that plays anything without the need for additional codecs +* Google Chrome – Browser for Google users. +* Leafpad – A lightweight text editor (even lightweight from default gedit) +* Synaptic – A far better package manager + +Moreover, while installing Ubuntu, if you have not selected to install the restricted software to play audio and video media files, you can do it now. Because GNOME default Video player (Totem) can not play the basic mp4, etc. files without restricted software. + +So, to install them, open the terminal and run the below command to install. + +``` +sudo apt install ubuntu-restricted-extras +``` + +You can now play most video/audio files without any problem in Ubuntu. + +#### Bonus Tip 💡 + +Finally, I recommend you set up Flatpak the first time after installing Ubuntu 22.04 LTS. Because over time, I am sure you would install many Flatpak applications. + +To set up Flatpak, [visit this page][23] and follow the instructions. + +Once you complete the setup, I recommend installing the below two Flatpak apps. The Extension application helps you manage the GNOME Extensions installed in your system. Other than that, the Flatseal application helps you manage Flatpak applications’ permissions in a super friendly way. + +* [Flatseal][24] – Manage Flatpak permissions +* [Extensions][25] – Manage GNOME extensions + +### Summary + +Also, one of the crucial debatable things to do after installing Ubuntu 22.04 is to delete Snap. Deleting Snap is a bit advanced process and may lead to an unstable system because of the tight coupling of Snap in Ubuntu. + +That said, I hope this list gives you and new users of Ubuntu some idea about making a productive Ubuntu 22.04 LTS desktop. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/04/10-things-to-do-ubuntu-22-04-after-install/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/04/Update-your-Ubuntu-22.04-LTS-System.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2022/04/Review-the-privacy-settings.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/04/Configure-Keyboard-shortcuts-in-Ubuntu-22.04.jpg +[4]: https://launchpad.net/~teejee2008/+archive/ubuntu/timeshift/+packages +[5]: https://www.debugpoint.com/2022/01/ubuntu-22-04-lts/ +[6]: https://www.debugpoint.com/2022/04/ubuntu-mate-22-04-lts/ +[7]: https://www.debugpoint.com/2022/04/kubuntu-22-04-lts/ +[8]: https://www.debugpoint.com/2022/04/xubuntu-22-04-lts/ +[9]: https://www.debugpoint.com/2022/04/ubuntu-budgie-22-04-lts/ +[10]: https://www.debugpoint.com/2022/04/lubuntu-22-04-lts/ +[11]: https://www.debugpoint.com/2022/04/ubuntu-kylin-22-04-lts/ +[12]: https://www.debugpoint.com/2022/04/ubuntu-studio-22-04-lts/ +[13]: https://www.debugpoint.com/2022/04/difference-ubuntu-22-04-20-04/ +[14]: https://www.debugpoint.com/wp-content/uploads/2022/04/How-Accent-colour-change-impact-looks-in-Ubuntu-22.04-LTS.jpg +[15]: https://extensions.gnome.org/extension/3193/blur-my-shell/ +[16]: https://extensions.gnome.org/extension/3730/floating-dock/ +[17]: https://extensions.gnome.org/extension/1238/time/ +[18]: https://extensions.gnome.org/extension/104/netspeed/ +[19]: https://extensions.gnome.org/ +[20]: https://www.debugpoint.com/2021/09/remove-firefox-snap-ubuntu/ +[21]: https://www.debugpoint.com/2021/10/manual-installation-gnome-extension/ +[22]: https://www.debugpoint.com/2019/06/best-email-client-linux-windows/ +[23]: https://flatpak.org/setup/ +[24]: https://flathub.org/apps/details/com.github.tchx84.Flatseal +[25]: https://flathub.org/apps/details/org.gnome.Extensions diff --git a/sources/tech/20220421 Ubuntu 20.04 vs 22.04- What Has Changed Between the Two LTS Releases.md b/sources/tech/20220421 Ubuntu 20.04 vs 22.04- What Has Changed Between the Two LTS Releases.md new file mode 100644 index 0000000000..9323926286 --- /dev/null +++ b/sources/tech/20220421 Ubuntu 20.04 vs 22.04- What Has Changed Between the Two LTS Releases.md @@ -0,0 +1,196 @@ +[#]: subject: "Ubuntu 20.04 vs 22.04: What Has Changed Between the Two LTS Releases?" +[#]: via: "https://itsfoss.com/ubuntu-20-04-vs-22-04/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Ubuntu 20.04 vs 22.04: What Has Changed Between the Two LTS Releases? +====== + +Ubuntu 20.04 was an impressive release with a [list of exciting features][1]. + +Even with GNOME 3.36 on board, we had a fair share of visual upgrades. Now, Ubuntu 22.04 LTS comes packed with GNOME 42. So, naturally, there should be a variety of visual refinements. + +Not just limited to the look and feel, [Ubuntu 22.04 LTS has numerous interesting features][2] to offer as well. + +Here, I try to compare the feature offerings between the two to help you decide if you should upgrade. + +### 1\. Support Lifespan + +Undoubtedly, both being LTS ([Long-Term Release][3]) versions, you can pick any of them and still be able to use them for a couple of years, at the very least. + +To be accurate, Ubuntu 22.04 will be supported with maintenance updates for **five years** until **April 2027**. + +And, Ubuntu 20.04 LTS will be supported until **2025**, meaning, you have **three more years** of software update support. + +### 2\. Logo and Branding + +Ubuntu’s branding focused on a purple accent for some elements like toggles, sliders, etc. on Ubuntu 20.04 LTS. + +However, with Ubuntu 22.04 LTS, they focused on a different accent color with changes to the icon theme as well. + +Not to forget, the [new Ubuntu 22.04 logo looks weird][4], and as of now, we do not have a proper logo file available to use on images. + +The logo associated with Ubuntu 20.04 was clean, without any solid rectangle structure attached to it. + +![][5] + +Accordingly, the boot animation has changed as well, reflecting the latest branding. + +### 3\. Accent Color Selection + +With Ubuntu 20.04, you couldn’t select custom accent colors. You had to stick with the default or customize things yourself with [GNOME Tweaks][6]. + +![Ubuntu 20.04 vs Ubuntu 22.04 \(Appearance setting\)][7] + +However, that changes with Ubuntu 22.04 LTS, you can finally [select additional accent colors in Ubuntu 22.04 LTS][8]. + +### 4\. Wallpapers + +![Ubuntu 20.04 vs Ubuntu 22.04 \(Desktop featuring default wallpapers\)][9] + +It is obvious to expect a new wallpaper that reflects the name of the Ubuntu upgrade. + +Ubuntu 22.04 is code named as “**Jammy Jellyfish**“, so the new wallpaper illustrates the same beautifully: + +On the other hand, Ubuntu 20.04 is code named “**Focal Fossa**”, which refers to a cat-like predator based found in Madagascar. + +Both have similar color combinations, but I tend to like the new one. + +### 5\. Log in Screen and Lock screen + +As per the changes to the default theme and accent colors, the choices for the log-in and lock screen have differences. + +Both of the lock screens offer a blurred view of the default wallpapers, with Ubuntu 20.04 turning out to be darker than Ubuntu 22.04. + +![Ubuntu 20.04 vs Ubuntu 22.04 \(Lockscreen\)][10] + +The log in screen is entirely different in Ubuntu 22.04 with a black background, here’s how it looks: + +![Ubuntu 20.04 vs Ubuntu 22.04 \(Log in screen\)][11] + +### 6\. Appearance Settings & Dark Mode Improvements + +Ubuntu 20.04 did feature a dark mode to keep up with modern standards. With Ubuntu 22.04 LTS, the dark mode has improved to provide you with a complete system-wide dark mode experience. + +![Ubuntu 20.04 vs Ubuntu 22.04 \(Appearance settings\)][12] + +Along with the new dark mode implementation, you get to see an entire revamp for the appearance settings, giving you more options in an organized manner. + +Furthermore, you can notice that Ubuntu 22.04 LTS no longer features the standard theme, so it’s either entirely light or dark. + +### 7\. GNOME 42 and the horizontal layout + +Ubuntu 20.04 makes use of GNOME 3.36.8 to provide a stable experience without a lot of appearance tweaks. + +But, all thanks to GNOME 42, the dark mode improvements, appearance tweaks, it’s all part of the [GNOME 42 features][13]. + +Not just the visual changes, but the entire workflow should feel a bit different with the revamped activities view, app menu, and further adjustments: + +![Ubuntu 20.04 vs Ubuntu 22.04 \(Activities\)][14] + +The three finger swipe also provides a smooth and rich experience for accessing the activity overview. + +Ubuntu 22.04 did not implement the horizontal dock. But, it’s still a significant change to offer something different for a good user experience. + +The application menu also looks a tad different, including the virtual desktops in the same view compared to Ubuntu 20.04. + +![Ubuntu 20.04 vs Ubuntu 22.04 \(App menu\)][15] + +### 8\. Multitasking Capabilities + +Ubuntu 22.04 now includes a dedicated menu in the system settings to facilitate enhancements to multitasking with the use of Hot Corner, Screen Edges, Workspace tweaks, and more. + +![][16] + +You do not find these options with Ubuntu 20.04 LTS. + +### 9\. Linux kernel version + +Ubuntu 22.04 features multiple Linux Kernel versions as per the product. Ubuntu 22.04 Desktop uses [Linux Kernel 5.17][17]. + +The desktop version also uses a rolling HWE kernel for previous-gen hardware based on Linux Kernel 5.15, to exist until the first point release. + +Ubuntu 22.04 server uses non-rolling Linux Kernel 5.15 LTS. + +On the other hand, Ubuntu 20.04.4, features [Linux Kernel 5.13][18] at the time of writing this. + +### 10\. Shrinking the Dock in Ubuntu 22.04 + +Surprisingly, you can shrink the dock on Ubuntu 22.04 to change the default look. You need to disable the “Panel” mode under the Dock settings in Appearance tweaks, as shown in the image below: + +![][19] + +It may not be a massive change, but some do appreciate a compact dock, instead of having the dock stick to the entire left side of the screen, ditching the Unity-type look. + +### 11\. Screenshot tool + +Ubuntu 20.04 LTS utilized GNOME’s screenshot tool to get things done. It was a simple and effective tool. + +![][20] + +With GNOME 42 on board, Ubuntu 22.04 LTS has the latest screenshot tool and received upgrades to its UI with a modern layout, and the ability to record the screen as well. + +### 12\. File Manager + +The file manager has a refreshed look/feel compared to Ubuntu 20.04 LTS. Of course, the standard theme on Ubuntu 20.04 can no longer be seen with Ubuntu 22.04 LTS, so that’s a part of the visible change. + +![][21] + +### 13\. Software Center + +Ubuntu 22.04 LTS features an improved software center that provides you more information on the software, clarifying the ratings, project details, download size, status, and more. + +![][22] + +Ubuntu 20.04 LTS did have improvements to it back then, but it is a simpler software center comparatively. + +![Ubuntu 22.04 LTS \(Software Center\)][23] + +### Wrapping Up + +Ubuntu 22.04 LTS is certainly a major overhaul in terms of user experience compared to Ubuntu 20.04. + +Some changes may not be as functional as they look, so as per your preferences, it is best to evaluate your requirements if you want to switch to the latest Ubuntu 22.04 LTS or stick to Ubuntu 20.04 LTS. + +What do you think about the difference between the two LTS releases? Are the differences compelling enough for you to switch? Let me know your thoughts in the comments section below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-20-04-vs-22-04/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-20-04-release-features/ +[2]: https://itsfoss.com/ubuntu-22-04-release-features/ +[3]: https://itsfoss.com/long-term-support-lts/ +[4]: https://news.itsfoss.com/ubuntu-new-logo/ +[5]: https://itsfoss.com/wp-content/uploads/2022/04/cof_orange_hex.jpg +[6]: https://itsfoss.com/gnome-tweak-tool/ +[7]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-20-04-appearance.jpg +[8]: https://news.itsfoss.com/ubuntu-22-04-accent-color/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2022/04/ubuntu-20-04-desktop.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2022/04/ubuntu-20-04-lockscreen-1.png?ssl=1 +[11]: https://itsfoss.com/wp-content/uploads/2022/04/login-screen.png +[12]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-20-04-dark-mode.jpg +[13]: https://news.itsfoss.com/gnome-42-features/ +[14]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-20-04-activities.jpg +[15]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-20-04-application-view.jpg +[16]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-multitasking.jpg +[17]: https://news.itsfoss.com/linux-kernel-5-17-release/ +[18]: https://news.itsfoss.com/linux-kernel-5-13-release/ +[19]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-dock-shrink.jpg +[20]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-20-04-screenshot.jpg +[21]: https://itsfoss.com/wp-content/uploads/2022/04/filemanager.jpg +[22]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-20-04-software-center.jpg +[23]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-software.jpg diff --git a/sources/tech/20220422 Things to do After Installing Ubuntu 22.04.md b/sources/tech/20220422 Things to do After Installing Ubuntu 22.04.md new file mode 100644 index 0000000000..ab9ea8cafc --- /dev/null +++ b/sources/tech/20220422 Things to do After Installing Ubuntu 22.04.md @@ -0,0 +1,346 @@ +[#]: subject: "Things to do After Installing Ubuntu 22.04" +[#]: via: "https://itsfoss.com/things-to-do-after-installing-ubuntu-22-04/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Things to do After Installing Ubuntu 22.04 +====== + +_**Here is a list of simple tweaks and things to do after installing Ubuntu 22.04, to get a smoother and better experience.**_ + +I presume that you are absolutely new to Ubuntu while sharing these tips. If you are an existing Ubuntu user, some tips may sound too elementary to you. However, you’ll still find a few good tweaks that are specific to the [new Ubuntu 22.04 features][1]. + +### Things to do after installing Ubuntu 22.04 LTS “Jammy Jellyfish” + +Again, what I recommend here is based on my experience and preference. Yours could be different from mine. Skim around and see if you get some interesting and useful advice. + +Another thing. Most of the suggestions are for the default GNOME desktop environment. If you are using the default Ubuntu, you should be good. If you have doubt, please [check the Ubuntu version][2] and [desktop environment you are using][3]. + +Let’s see them one by one. + +#### 1\. Getting your system ready with updates and repositories + +The first thing you should do after installing Ubuntu is to update it. Linux works on a local database of available packages and it needs to be synced for you to be able to install any software. + +It is straightforward to [update Ubuntu][4]. You can run the software updater from the menu (press the Windows key and search for software updater): + +![][5] + +Now, make sure that you have [universe and multiverse repositories enabled][6]. These repositories should be enabled already, but no harm in verifying that. You’ll have access to a lot more software with these repositories. + +Search for Software & Updates in the menu: + +![][7] + +Check the boxes in front of the repositories: + +![][8] + +#### 2\. Install media codecs to play various kinds of media files + +To play media files like MP3, MPEG4, AVI, etc, you’ll need to install media codecs. Ubuntu doesn’t install it by default because of copyright issues in various countries. + +You can install these media codecs as an individual [using the Ubuntu Restricted Extra package][9]. It installs media codecs and [Microsoft True Type Fonts on your Ubuntu system][10]. + +You can install it by using this command: + +``` + + sudo apt install ubuntu-restricted-extras + +``` + +If you encounter the EULA or the license screen, remember to use the tab key to select between the options and then hit enter to confirm your choice. + +![Press tab to select OK and press enter][11] + +#### 3\. Install applications of your choice from the software center or the web + +A fresh installed Ubuntu system will have only a limited set of necessary applications installed. + +For the rest, you can find them in the software center, through the apt package manager, or get them from their official websites. + +Look into the software center first and see if the application is available here. + +![][12] + +Some applications provide an easy-to-use DEB file on their website. For example, to [install Google Chrome on Ubuntu][13], you can download it from its official website. + +Usually, you double-click on the deb file and install the application using the software center. If it opens the deb file in archive manager, [use this trick][14] to make it work. + +#### 4\. Enjoy gaming on Linux with Steam Proton + +There are plenty of tools that allow you to play games on Linux. Steam is perhaps the most convenient, mainstream way of getting thousands of games. + +[Install Steam on Ubuntu][15] and [enable Steam Play][16]. You should have access to a good set of games, provided your system has enough hardware configuration to run all kinds of games. + +Needs some suggestions? Check this list of [indie games for Linux users][17]. + +#### 5\. Get familiar with auto-updates + +Your Ubuntu system automatically checks for system updates and installs them automatically when needed. + +This check happens when your system starts. If you try to perform a system update or install an application at this time, you’ll see a warning or message to wait. + +You can control the auto-updates behavior if you like. + +![][18] + +#### 6\. Give your Ubuntu a different color + +Ubuntu 22.04 gives you the ability to choose a different color than the usual orange. There are nine other colors to choose from. From the Settings-Appearance, select the color you want and it will give change the accent color of your system. + +![][19] + +#### 7\. Get familiar with the new screenshot tool + +Ubuntu 22.04 has a new screenshot tool that also includes the screencast (video recording of desktop) option. + +When you press the Print Screen button to take the screenshot, it opens the UI and gives you the option to take the screenshot of the selected area, entire screen, or current application window. The screenshots are copied to the clipboard and saved to the Screenshots folder under the Pictures directory. + +![][20] + +You can also record the screen with the screencast option available in the same interface (click the video camera icon). It lets you record the entire screen and works very well under Wayland. + +#### 8\. Experiment with the dock + +Go to the Appearance Settings and you’ll see the option for disabling Panel mode. + +![][21] + +This will shrink the launcher on the left side and make it look like the Vanilla GNOME launcher. You should use it with ‘auto-hide’ option for better experience. + +You may [move the launcher to the bottom][22] or the right side if you like. There are plenty of [ways to customize the dock in Ubuntu][23]. + +#### 9\. Get GNOME Tweaks tool for additional customization + +Though the system settings application now includes several new options, [GNOME Tweaks still provides additional customization options][24]. + +With GNOME Tweaks, you can move the windows control button on the left, change themes, change the lock screen background, etc. More on its usage later. For the moment, just get this tool from the software center or use the apt command. + +![][25] + +#### 10\. Minimize to click + +When you click an icon in the launcher, it opens the application. You click the icon again and nothing happens. + +I don’t like this. I prefer that when I click on the icon of an application in focus, it gets minimized. + +If you share the same preference, use this command in the terminal to [enable minimize on click in Ubuntu][26]: + +``` + + gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize' + +``` + +#### 11\. Get familiar with the terminal + +![][27] + +Speaking of the terminal, please don’t be too scared of this awesome tool. I know that the command line gives cold feet to many new Linux users. However, knowing a little could help you big in long run. + +I am not going to teach you the basics of the Linux command line here. Though I have written a pretty good post that tells you several [useful information on using the terminal in Ubuntu][28]. You should read the article even if you can use the terminal every now and then. + +#### 12\. Few tweaks for laptop users + +If you are using Ubuntu 22.04 on a laptop, here are a few tips on improving your performance and getting rid of annoyances. + +You’ll notice that you have to press the left touchpad button for the left mouse button action. This is annoying. Enable the tap for click option and just tap the touchpad anywhere to get the left mouse click. + +![][29] + +From the Power settings, **enable the battery percentage display** to keep a track of the remaining battery on your laptop. + +![][30] + +Since you’ll be using your system on battery power, **choose an appropriate power profile** under the Power settings. + +![][31] + +This is perhaps not entirely for laptop users. By default, Ubuntu locks the screen after 5 minutes of inactivity and puts the system in suspend mode after 20 minutes of activity. + +I don’t like entering my password so frequently. I **prefer to lock the screen at my convenience**. If you share the same feeling, you can also disable this behavior. + +![][32] + +#### 13\. Disable characters from GNOME search + +The GNOME Search is an excellent tool for finding installed applications, files, etc. However, you’ll notice that it often shows matching ‘characters’. + +![Emojis Desktop Search Ubuntu][33] + +Actually, your Ubuntu system has built-in emoji support. Apart from the regular emoticons, the system also has support for letters in various languages like Thai, Latin, Vietnamese, etc. + +When you search for something, the term could also match these special characters. Click on it and it gets copied to the clipboard and you can paste them wherever you want. + +If you are not going to use this feature, you should disable the characters’ search. + +![][34] + +#### 14\. Use the night light feature to reduce eye strain at night + +My favorite feature and I am glad it now works in the multi-monitor settings as well. + +[Enable the night light feature][35] so that it adds a yellow tint to the screen which is less pinching than the white light at night. + +Go to Settings -> Displays, switch to Night Light tab, and enable it. You can also set the ‘yellowness’ as per your liking. + +![][36] + +#### 15\. Enable fractional scaling if you’ve got a 4K screen + +If you have a 2K or 4K screen, you’ll find that the icons, fonts and folders look too small. You should enable the fractional scaling and scale the size that suits your preference. + +![][37] + +#### 16\. Know that you have the option to go back to Xorg + +Ubuntu 22.04 defaults to Wayland once again if you don’t have an Nvidia system. Wayland is the modern replacement of the legacy x server and it works very well with the newer GNOME components. + +However, some older applications may not work properly under Wayland. For example, most screen recording tools don’t support Wayland yet. + +If you encounter such a situation where a must-use application doesn’t work in Wayland, log out from the session and click on the gear icon in the bottom right to [switch to the X display session][38]. + +#### 17\. Classic GNOME is still available + +Speaking of options, you can also access the classic GNOME. If you are not aware, the classic GNOME or GNOME version 2 was a popular desktop choice before GNOME 3 arrived with radical new changes around 2011. + +GNOME 2 gave birth to the Cinnamon and MATE desktop environment because its die-hard users just didn’t want to give up on the classic interface. Perhaps that’s the reason why GNOME Classic has always been a part of Ubuntu even though it moved to Unity and (modern) GNOME. + +Though it says classic, it doesn’t look as dated as it was in 2010. + +![GNOME Classic][39] + +When you log out of the system, click on the user name and you should see a gear symbol at the bottom. Click on it and you should see the classic GNOME option here. + +#### 18\. Know about cleaning your system + +The classic apt autoremove command is a good way to remove packages that are not required anymore. + +``` + + sudo apt autoremove + +``` + +I think it is also part of the software updater tool now meaning it runs the autoremove command after running updates or so I have noticed. + +Apart from that, there are a [few more ways to clean up your Ubuntu system][40]. GUI tools like Stacer are now available in the repositories and you may use them to clean your system without going into the command line. + +#### 19\. Master the keyboard shortcuts + +I am not asking you to ditch the mouse altogether but trust me on this using the keyboard shortcut saves plenty of time. + +From the application switcher to opening the terminal, things feel a lot faster with the correct shortcuts at your finger. + +![keyboard switching with key shortcut in Ubuntu][41] + +I have an entire article dedicated to [keyboard shortcuts in Ubuntu][42]. Feel free to check that out. + +#### 20\. Use the ‘do not disturb mode to focus on work + +There are plenty of productivity tools available for Ubuntu but this little hack is my favorite. + +When I am working on something that requires my complete focus, like writing this article, I enable the Do Not Disturb mode. + +![][43] + +With that, the notifications from messaging services stop appearing on the screen and I don’t get distracted. Once I am back to relaxed working, I disable it again. + +#### 21\. Get back the original Firefox or go for some other browser + +Ubuntu 22.04 Jammy Jellyfish comes with the Snap version of Firefox. It takes longer to start and forces you to log in to the accounts again and again. + +Try the Snap version of Firefox first. If it works for you, good. If not and you feel fed up with the Firefox experience, you have two options: + + * Switch to another browser like Brave, Vivaldi, LibreWolf, etc + * Switch to Firefox ESR or a non-Snap version of Firefox + + + +Firefox ESR (extended support release) doesn’t come with the latest feature like the regular Firefox but it is maintained for security and stability fixes. + +There are a couple of ways of [getting the non-Snap version of Firefox][44] as described by Jim at Ubuntu Handbook. However, it is slightly more complicated than just adding a PPA. + +#### 22\. Get missing Windows back if you use a dual boot system + +During the early testing of Ubuntu 22.04, I noticed a known bug that came with the new Grub 2.6. It had disabled the os-prober by default. This means that Grub won’t check for the presence of other operating systems. In other words, it won’t see Windows (or other Linux distributions) if you opted for a dual boot system. + +Now, I haven’t checked if this issue has been fixed or not but if you face this issue with your dual boot system, then edit the /etc/default/grub file to add GRUB_DISABLE_OS_PROBER=false to this file. Save this file, [update grub][45] and Grub should see other operating systems now. + +#### Where to go from here? + +![][46] + +Honestly, you could do a lot more even after you have done all the points I mentioned in this list here. There is no end to things you could do after installing Ubuntu 22.04. + +If you are new, there is plenty to explore. If you are an experienced one, you could still spend considerable time tweaking and setting up your system as per your liking. + +It all comes down to personal preference. Some people would just do some basic changes and go on with using the operating system. Some folks would spend hours setting everything to perfection. + +Now that I have finished my recommendations, I would like your views. Did you find some useful tips here? What other usual stuff do you do after installing Ubuntu? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/things-to-do-after-installing-ubuntu-22-04/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-22-04-release-features/ +[2]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ +[3]: https://itsfoss.com/find-desktop-environment/ +[4]: https://itsfoss.com/update-ubuntu/ +[5]: https://itsfoss.com/wp-content/uploads/2022/04/software-updater-ubuntu-22-04.jpg +[6]: https://itsfoss.com/ubuntu-repositories/ +[7]: https://itsfoss.com/wp-content/uploads/2022/04/software-and-updates-tool.jpg +[8]: https://itsfoss.com/wp-content/uploads/2022/04/enable-additional-repo-ubuntu-22-04.jpg +[9]: https://itsfoss.com/install-media-codecs-ubuntu/ +[10]: https://itsfoss.com/install-microsoft-fonts-ubuntu/ +[11]: https://itsfoss.com/wp-content/uploads/2020/02/installing_ubuntu_restricted_extras.jpg +[12]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-software-center-22-04-800x539.png +[13]: https://itsfoss.com/install-chrome-ubuntu/ +[14]: https://itsfoss.com/cant-install-deb-file-ubuntu/ +[15]: https://itsfoss.com/install-steam-ubuntu-linux/ +[16]: https://itsfoss.com/steam-play/ +[17]: https://itsfoss.com/best-indie-rpg-games-linux/ +[18]: https://itsfoss.com/wp-content/uploads/2020/04/auto-updates-ubuntu-800x361.png +[19]: https://itsfoss.com/wp-content/uploads/2022/03/ubuntu-22-04-appearance-settings.png +[20]: https://news.itsfoss.com/wp-content/uploads/2022/03/ubuntu-22-04-screenshot-ui.jpg +[21]: https://itsfoss.com/wp-content/uploads/2022/04/panel-mode-ubuntu-22-800x529.png +[22]: https://itsfoss.com/move-unity-launcher-bottom/ +[23]: https://itsfoss.com/customize-ubuntu-dock/ +[24]: https://itsfoss.com/gnome-tweak-tool/ +[25]: https://itsfoss.com/wp-content/uploads/2020/04/gnome-tweaks-tool-ubuntu-20-04-800x551.png +[26]: https://itsfoss.com/click-to-minimize-ubuntu/ +[27]: https://itsfoss.com/wp-content/uploads/2021/12/linux-terminal-introduction.png +[28]: https://itsfoss.com/basic-terminal-tips-ubuntu/ +[29]: https://itsfoss.com/wp-content/uploads/2022/04/tap-to-click-ubuntu-22-800x483.png +[30]: https://itsfoss.com/wp-content/uploads/2022/04/show-battery-percentage-ubuntu-22-800x489.png +[31]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-new-power-profile-800x489.png +[32]: https://itsfoss.com/wp-content/uploads/2022/04/Power-Settings-in-Ubuntu.jpg +[33]: https://itsfoss.com/wp-content/uploads/2020/04/emojis-desktop-search-ubuntu.jpg +[34]: https://itsfoss.com/wp-content/uploads/2020/04/search-settings-control-ubuntu-800x534.png +[35]: https://itsfoss.com/night-shift-flux-ubuntu-linux/ +[36]: https://itsfoss.com/wp-content/uploads/2020/04/nightlight-ubuntu-20-04.png +[37]: https://itsfoss.com/wp-content/uploads/2022/04/fractional-scaling-in-ubuntu-22-04-800x674.png +[38]: https://itsfoss.com/switch-xorg-wayland/ +[39]: https://itsfoss.com/wp-content/uploads/2022/04/gnome-classic-ubuntu-22-800x450.png +[40]: https://itsfoss.com/free-up-space-ubuntu-linux/ +[41]: https://itsfoss.com/wp-content/uploads/2022/02/keyboard-switch-shortcut-ubuntu.jpeg +[42]: https://itsfoss.com/ubuntu-shortcuts/ +[43]: https://itsfoss.com/wp-content/uploads/2022/04/don-not-disturb-ubuntu-22.jpg +[44]: https://ubuntuhandbook.org/index.php/2022/04/install-firefox-deb-ubuntu-22-04/ +[45]: https://itsfoss.com/update-grub/ +[46]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-neofetch-lolcat-800x445.png diff --git a/sources/tech/20220427 5 Best Mastodon Clients for Ubuntu and Other Linux.md b/sources/tech/20220427 5 Best Mastodon Clients for Ubuntu and Other Linux.md new file mode 100644 index 0000000000..5b91a032d3 --- /dev/null +++ b/sources/tech/20220427 5 Best Mastodon Clients for Ubuntu and Other Linux.md @@ -0,0 +1,153 @@ +[#]: subject: "5 Best Mastodon Clients for Ubuntu and Other Linux" +[#]: via: "https://www.debugpoint.com/2022/04/mastodon-clients-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +5 Best Mastodon Clients for Ubuntu and Other Linux +====== +Are you planning to leave Twitter and join Mastodon? Use these free and open-source Mastodon clients for your Linux desktop. + +[Mastodon][1] is a free and open-source microblogging platform similar to Twitter. It is designed as a decentralised platform that can communicate with other Fediverse protocols such as GNU Social and Pleroma. With the recent news stories about Twitter, many users are trying Mastodon and migrating to the platform. + +With that in mind, we give you a list of free Mastodon clients for Linux desktops as well as Windows and macOS in this post. + +### Top 5 Mastodon Clients for Ubuntu and Other Linux Distributions + +#### 1. Tootle + +Perhaps the best on this list is the GNOME App Tootle. Tootle is a super-fast Mastodon client for Linux desktops written in GTK. It comes with a clean and native interface that you can use while using Mastodon. With this app, you can easily browse posts, view feeds, have a customised home page and follow accounts. In addition to that, dedicated tabs gives you options to quickly jump between your home page, notifications, mentions and federated feed. + +Tootle is actively developed, and it is an official GNOME Circle app. And we featured it in our [GNOME Apps series (#5)][2]. + +![Tootle][3] + +The easiest way to install Tootle is using Flatpak in any Linux distribution. Setup your system using this [guide for Flatpa][4]k (if not done yet) and hit the below link to install. + +[Install Tootle][5] + +**More information about Tootle** + +* [Source Code][6] +* [Home page][7] + +#### 2. Tokodon + +The Tokodon is another Mastodon client which brings a little different user interface to access this social platform. Its part of KDE Applications and built primarily using C++. It gives you an excellent clean user interface with a basic home page view. On top of that, you can browse local accounts to your mastodon server and the global ones. The bottom navigation gives easy access to all the Mastodon sections. + +![Tokodon Mastodon Client for Linux][8] + +The easiest way to install Tokodon is using Flatpak in any Linux distribution. Setup your system using this [guide for Flatpa][9]k (if not done yet) and hit the below link to install. + +[Install Tokodon via Flathub][10] + +**More information about** **Tokodon** + +* [Source code][11] +* [Home page][12] + +#### 3. Sengi + +Among this list, Sengi is most likely the versatile Mastodon client for Linux desktops. It comes with usual features such as notification, account view and follows features. On top of that, it brings Tweetdeck styled live interface with the timeline. + +Sengi is perfect for heavy Mastodon users who want to manage multiple accounts and timelines. You can even set up and Twitter bridge as well. + +Furthermore, you should note that it is designed with web technology and packaged as desktop applications. Finally, it is available for Linux, macOS and Windows as well. + +![Sengi Mastodon Client | Image Credit: Sengi][13] + +Finally, installing Sengi is very easy because the developer provides all types of executables, including native deb and AppImage. You can grab the .deb or .appimage file from the below link in addition to the windows and Mac executables. + +[Download Sengi][14] + +**More information about Sengi** + +* [Source code][15] + +#### 4. Whalebird + +Whalebird is another free and open-source Mastodon client built using Electron. Moreover, this web-based application is feature-rich and is the most stable Mastodon client. Using Whalebird, you can manage multiple accounts and monitor multiple timelines. In addition to that, you can also create a custom timeline to follow your favourite hashtags with a simple chronological workspace view. + +![Whalebird Mastodon Client | Image Credit: Whalebird][16] + +Finally, installing Whalebird is easy because it comes with an AppImage executable for Linux. Also, it provides the exe and dmg file for other OSes, which you can grab using the below link. + +[Download Whalebird][17] + +**More information about Whalebird** + +* [Source code][18] + +#### 5. TheDesk + +The fifth Mastodon client for Linux and other OSes we would like to feature is TheDesk. It is perhaps the most feature-rich client with a vast list of features. Its workflow is similar to Hootsuite and Tweetdeck for heavy social media monitoring and usage. You can customise it to follow a particular user, hashtags with options to create multiple timeline views. + +But it might not be a stable client and may contain bugs. But you can still try it out. + +Installing is made easy by its developer with app image, deb, snap and exe files available on GitHub for its releases. You can grab them here. + +**More information about TheDesk** + +* [Source code][19] +* [Home page][20] + +### Other Options to access Mastodon + +#### Mastodon Web + +If you are reluctant to install another app, you can use the web version of your choice or favourite pod. You can register for a new account using the below link and connect via the web. + +[https://joinmastodon.org/][21] + +#### Tusky + +Finally, if you are an Android mobile phone user, you can try Tusky. It is a fine and superfast Mastodon client available for Android with many features. You can [download it from Google Play Store here][22]. You can also [get the F-Droid version][23] of this app for Linux Phones. + +### Closing Notes + +Wrapping up the list of Mastodon clients for Linux, I hope you get to choose your favourite for your Linux distribution or mobile from the above list. Also, you can always use the Mastodon web for easy access. + +Finally, don’t forget to follow us on our official Mastodon page using the link below. + +* [][24] + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/04/mastodon-clients-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://joinmastodon.org/ +[2]: https://www.debugpoint.com/2022/03/best-gnome-apps-part-5/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/03/Tootle.jpg +[4]: https://flatpak.org/setup/ +[5]: https://dl.flathub.org/repo/appstream/com.github.bleakgrey.tootle.flatpakref +[6]: https://github.com/bleakgrey/tootle +[7]: https://apps.gnome.org/app/com.github.bleakgrey.tootle/ +[8]: https://www.debugpoint.com/wp-content/uploads/2022/04/Tokodon-Mastodon-Client-for-Linux.jpg +[9]: https://flatpak.org/setup/ +[10]: https://dl.flathub.org/repo/appstream/org.kde.tokodon.flatpakref +[11]: https://invent.kde.org/network/tokodon +[12]: https://apps.kde.org/tokodon/ +[13]: https://www.debugpoint.com/wp-content/uploads/2022/04/Sengi-Mastodon-Client.jpg +[14]: https://github.com/NicolasConstant/sengi/releases +[15]: https://nicolasconstant.github.io/sengi/ +[16]: https://www.debugpoint.com/wp-content/uploads/2022/04/Whalebird-Mastodon-Client.jpg +[17]: https://github.com/h3poteto/whalebird-desktop/releases +[18]: https://github.com/h3poteto/whalebird-desktop +[19]: https://github.com/cutls/TheDesk +[20]: https://thedesk.top/en/ +[21]: https://joinmastodon.org/ +[22]: https://play.google.com/store/apps/details?id=com.keylesspalace.tusky&hl=en_IN&gl=US +[23]: https://tusky.app/ +[24]: https://floss.social/@debugpoint diff --git a/sources/tech/20220427 Updating Edge Devices with OSTree and Pulp.md b/sources/tech/20220427 Updating Edge Devices with OSTree and Pulp.md new file mode 100644 index 0000000000..f2464c0116 --- /dev/null +++ b/sources/tech/20220427 Updating Edge Devices with OSTree and Pulp.md @@ -0,0 +1,302 @@ +[#]: subject: "Updating Edge Devices with OSTree and Pulp" +[#]: via: "https://fedoramagazine.org/updating-edge-devices-with-ostree-and-pulp/" +[#]: author: "lubosmj https://fedoramagazine.org/author/lubosmj/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Updating Edge Devices with OSTree and Pulp +====== + +![][1] + +Photo by [Shubham Dhage][2] on [Unsplash][3] + +Connecting industrial machinery to the internet has given birth to infinite opportunities that range from performance improvements and predictive maintenance to data modelling that can lead to novel solutions and use cases. The possibilities are endless. Connecting machinery on such a scale can test the limits of cloud connectivity, depending on your location and network limitations. + +An edge device is any piece of hardware that sits at the boundary between two networks. When initial computation happens on servers at the edge, it speeds up user’s interactions with the cloud. Therefore, adding edge devices provides opportunities to optimize performance, shorten the journey, and lighten the load on your cloud connection. + +As amazing as it sounds, managing all of this functionality demands continuous attention from administrators. Having a reliable solution to distribute, deploy, and update systems for edge devices from the outset will help you spend time on things that matter. + +In this article, we look at how OSTree is well-positioned for upgrading and updating edge devices with versioned updates of Linux-based operating systems. Furthermore, we’ll explore how Pulp facilitates managing and preparing updates of the OSTree content, as well as making it available to edge devices. Together, they provide a powerful free and open-source solution for administering edge devices. + +### How does OSTree help manage Edge devices? + +If you need to deploy hundreds of operating systems to edge devices, safe in the knowledge that you can easily manage future updates and maintenance, an OSTree’s immutable and image-based operating system is ready for the task. + +[OSTree][4] functions like git, but for operating system binaries. It has git-like content-addressed repositories. The ability to commit and branch entire root filesystem trees resembles the way you submit changes in git. With OSTree, you build an operating system with pre-installed packages, known as an operating system image. After you build the operating system image, it is possible to track it, sign it, test it, and deploy it. These images function as immutable file system trees. When the time comes to change or update, you simply build a new image and deploy it. By atomically switching between different versions of images, you are completely replacing filesystem trees. + +OSTree also has a simple CLI that you can use for managing simple workflows, for example, for switching between different versions of images/filesystem trees. + +### Where do Fedora-IoT Images feature? + +As a standalone tool, the base OSTree CLI is not the most feature-rich utility for managing repository content. To make life easier, in the following demo, we will use _[rpm-ostree][5]_. _rpm-ostree_ is a hybrid image/package system that combines the standard OSTree technology as a base image format and accepts RPM on both the client and server-side. + +_rpm-ostree_ integrates with Fedora IoT. In comparison to other ecosystems, instead of installing packages via DNF, you install packages with _rpm-ostree_. After rebooting all changes are applied to a new version of the image. + +You can also upgrade or install a new Fedora IoT image with the _rpm-ostree_ utility. + +### Where and how does Pulp come into this? + +[Pulp][6] is a platform that handles content management workflows. Using Pulp, you can sync packages from remote repositories such as an RPM server, PyPI, Docker Hub, Ansible Galaxy, and many more. You can host and modify synced packages in repositories inside the Pulp server. You can publish repositories that contain packages available for deployment to production environments. + +In our scenario, Pulp provides a platform for storing particular versions of OSTree content, promoting approved content through the content management lifecycle, for example from _dev_ to _test_, and from _test_ to _prod_. Pulp also provides a method for publishing content that is consumed by edge devices. Using Pulp, you can pull the latest packages, test, and publish only when safe to do so. Pulp ensures the safety, security, and repeatability of your content supply chain. + +The following diagram provides a simplified overview of Pulp. On the left are shown different content types that are mirrored into Pulp from remote sources. These repositories are then served, for instance, to different CI/CD or production environments. + +![A simplified overview of Pulp. The content is mirrored from remote repositories and made available to different types of environments.][7] + +Pulp creates a new repository version automatically when updating or removing packages in a repository. You can distribute each repository version independently. + +Pulp has a plugin-based architecture, which means that you must add a plugin for each content type you want to use. For managing OSTree content, you need [the OSTree plugin][8]. You can then mirror content from a remote repository, import content from a local tarball, and modify content within a Pulp repository while preserving the integrity of the original content. You can move commits and refs from one repository to another or delete them. Pulp ensures that you are safe to experiment while your production environment remains pinned to a particular version. + +### Putting it all together + +In this section, let’s look at how to build an image with an OSTree commit. + +#### Building a Customized Fedora-IoT Image + +We start by booting a new virtual machine (VM) that will have an installed Fedora-IoT OS. For the purposes of this example, it is best to have the same version of the OS installed as the running edge devices have. + +All commands in this section are executed on the main admin VM (Fedora IoT 35 OS). On this admin VM, we will build the images that we will then distribute to the edge devices. + +##### Before you begin: + + * First, ensure that the VM is accessible via SSH. To test, enter the following command from within the target OS: + + + +``` + + $ systemctl is-active sshd + +``` + + * Next, ensure that the following tools for composing operating system images are installed:  + + + +``` + + $ sudo rpm-ostree install osbuild-composer composer-cli + $ sudo systemctl enable --now osbuild-composer.socket + +``` + + * Now, apply the installed packages by rebooting the system. + + + +* * * + +In this example a nano editor package is installed on all edge devices. We need to build an image containing a commit with the package. + +Create a blueprint file that describes what changes you want to make to the image as shown here: + +``` + + $ cat install-nano.toml + + name = "nano-commit" + description = "Installing nano" + version = "0.0.1" + + [[packages]] + name = "nano" + version = "*" + +``` + +Push this blueprint to the os build composer utility, which is a tool for composing operating system images. _composer-cli_ communicates with _osbuild composer_ through the CLI: + +``` + + $ composer-cli blueprints push install-nano.toml + +``` + +Build a new image: + +``` + + $ composer-cli compose start-ostree nano-commit fedora-iot-commit --ref fedora/stable/x86_64/iot + +``` + +The composer will use resources available in your current OS (such as a default operating system version). + +Regularly check the status of the build: + +``` + + $ composer-cli compose status + +``` + +When the build finishes, download the image: + +``` + + $ composer-cli compose image ${IMAGE_UUID} + +``` + +The downloaded image is basically an OSTree repository packed into a tarball. When you extract the archived content, you will notice that one ref is referencing the checksum of a commit. You can find it inside the _refs/heads/_ directory. + +#### Publishing the Customized Image with Pulp + +All commands shown in this section are executed on the main admin VM (Fedora IoT 35 OS). + +##### Before you begin: + + * Ensure that you have installed Pulp and the Pulp CLI for managing OSTree repositories: + + + +``` + + $ python3 -m venv venv && source venv/bin/activate + $ pip install pulp-cli-ostree + +``` + + * Then [configure][9] the reference to the Pulp server: + + + +``` + + $ pulp config create && pulp status + +``` + +Now configure a proxy server or SSH port forwarding to enable network communication between the VM and Pulp. Ensure that you can ping the Pulp server from the VM. + +* * * + +First, create a new OSTree repository: + +``` + + $ pulp ostree repository create --name fedora-iot + +``` + +The following command will import the tarball created in the previous section into Pulp: + +``` + + $ pulp ostree repository import-commits --name fedora-iot --file ${IMAGE_TARBALL_C1} --repository_name repo + +``` + +Publish the parsed commit as a remote OSTree repository hosted by Pulp: + +``` + + $ pulp ostree distribution create --name fedora-iot --base-path fedora-iot --repository fedora-iot + +``` + +Try to fetch the commit checksum from the ref: + +``` + + $ curl http://${PULP_BASE_ADDR}/pulp/content/pulp-fedora-iot/refs/heads/fedora/stable/x86_64/iot + +``` + +#### **Distributing the Customized Image to an Edge Device** + +The Edge device can be another VM or a real device running Fedora IoT. + +All commands shown in this section are executed on an Edge device (Fedora IoT 35 OS). + +##### Before you begin: + + * Configure a proxy server or SSH port forwarding to enable network communication between an Edge device and Pulp. Ensure that you can ping the Pulp server from the Edge device.  + * Ensure that the Edge device is accessible with SSH: + + + +``` + + $ systemctl is-active sshd + +``` + +* * * + +The nano package should NOT come pre-installed with the official bare Fedora IoT 35 image. Verify that by attempting to run _nano_ inside your terminal. + +In Fedora IoT, updates are retrieved from the URL defined in **/etc/ostree/remotes.d/fedora-iot.conf**. This file can be modified manually or by adding a new remote repository. Learn more at [Adding and Removing Remote Repositories][10]. + +You can automate the upgrade procedure with an upgrade policy that will be configured at the beginning of deployment. This is done by writing a kickstart file that will boot up an edge device into a headless state. However, for demonstrative purposes, let’s act like a villain and update the aforementioned configuration file manually to have the following content: + +``` + + [remote "fedora-iot"] + url=http://${PULP_BASE_ADDR}/pulp/content/pulp-fedora-iot/refs/heads/fedora/stable/x86_64/iot + gpg-verify=false + ref=fedora/stable/x86_64/iot + +``` + +Do not forget to replace the variable _${PULP_BASE_ADDR}_ with a valid base path to the pulp server. + +The following command shows you that some packages are going to be installed: + +``` + + $ rpm-ostree upgrade + +``` + +Reboot the edge device: + +``` + + $ systemctl reboot + +``` + +_…rebooting…_ + +Log in to the edge VM via ssh, and check the presence of the nano package that comes from Pulp: + +``` + + $ nano + +``` + +**Done! You have successfully distributed a customized Fedora IoT image via Pulp!** + +In case of any questions, do not hesitate to reach out to us at [https://pulpproject.org/help][11]. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/updating-edge-devices-with-ostree-and-pulp/ + +作者:[lubosmj][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/lubosmj/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2022/04/updating_edge_devices-816x345.jpg +[2]: https://unsplash.com/@theshubhamdhage?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/upload-network?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://ostree.readthedocs.io/en/latest/ +[5]: https://coreos.github.io/rpm-ostree/ +[6]: https://pulpproject.org/ +[7]: https://fedoramagazine.org/wp-content/uploads/2022/04/pulp101-simplified-overview.png +[8]: https://github.com/pulp/pulp_ostree +[9]: https://docs.pulpproject.org/pulp_cli/configuration/ +[10]: https://docs.fedoraproject.org/en-US/iot/rebasing/#_adding_and_removing_remote_repositories +[11]: https://pulpproject.org/help/#pulp-community-discourse diff --git a/sources/tech/20220428 Following Musk’s Acquisition Of Twitter, An Open Source Alternative Is Exploding.md b/sources/tech/20220428 Following Musk’s Acquisition Of Twitter, An Open Source Alternative Is Exploding.md new file mode 100644 index 0000000000..28b3228705 --- /dev/null +++ b/sources/tech/20220428 Following Musk’s Acquisition Of Twitter, An Open Source Alternative Is Exploding.md @@ -0,0 +1,46 @@ +[#]: subject: "Following Musk’s Acquisition Of Twitter, An Open Source Alternative Is Exploding" +[#]: via: "https://www.opensourceforu.com/2022/04/following-musks-acquisition-of-twitter-an-open-source-alternative-is-exploding/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Following Musk’s Acquisition Of Twitter, An Open Source Alternative Is Exploding +====== +![220405-ROB-Elon-Musk-Twitter-jg-af752e][1] + +Although we don’t yet know what Elon Musk’s acquisition of Twitter means for the platform, one Twitter alternative is already thriving as a result of the news. According to [Mastodon’s][2] founder, the open source social media platform that describes itself as the “biggest decentralised social network on the internet” has been “exploding” since Musk’s takeover. + +Employees and users have been shaken by the news of Twitter’s purchase, since Musk has stated that he intends to take a much more hands-off approach to content management. As is customary when Twitter makes a contentious move, some users have vowed to abandon the platform, while opponents have pushed the hashtag #RIPTWITTER to the top of the search results. + +In this scenario, at least some angry users appear to be considering Mastodon as a possible replacement. Mastodon says it experienced “an influx of approx. 41,287 users” hours after the Twitter takeover was revealed. In a blog post, Mastodon founder Eugen Rochko stated that roughly 30,000 of those were new users. + +According to data from analytics firm Sensor Tower, Mastodon’s official iOS and Android apps are also witnessing an increase in usage. According to the company, the apps have been downloaded 5,000 times since Monday, “or about 10% of its lifetime total” downloads. On the App Store’s social media app charts, the app is presently placed No. 32. + +This isn’t the first time Mastodon has benefited from Twitter’s problems. Following controversy over Twitter’s decision to remove user handles from the character restriction for @-replies, the startup gained popularity for a brief while in 2017. (back when Twitter changed its product so infrequently even mundane changes were fodder for mass outrage). Mastodon had another surge in popularity in 2019, after users in India were enraged by moderation practises. + +Mastodon had previously been mentioned as a possible Twitter alternative, although it has yet to gain traction in the public. However, its current popularity coincides with Twitter’s exploration of how it could become an open-source protocol, similar to Mastodon. + +Mastodon, unlike Twitter, is not a single, centralised service. Though the interface resembles Twitter (it has a 500-character restriction but is otherwise very similar to Twitter), it is based on an open-source protocol. Users can form and maintain their own “instances,” each with its own set of rules for membership, moderation, and other critical policies. Users can also take their followers with them from one instance to the next. + +Mastodon has its own instances, mastodon.social and mastodon.online, although Rochko claims that these are overburdened and recommends that new users sign up using the official applications and join other Mastodon communities. Mastodon also makes its code available on GitHub because it’s open source, something Musk has praised when it comes to Twitter’s algorithms. + +All of this adds to the difficulty for new users who may not be familiar with Mastodon’s structure or how it functions. Those who stay long enough may notice some important new features. End-to-end encrypted communications is in the works, as is “very amazing groups functionality,” according to Rochko. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/04/following-musks-acquisition-of-twitter-an-open-source-alternative-is-exploding/ + +作者:[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/04/220405-ROB-Elon-Musk-Twitter-jg-af752e-696x348.jpg +[2]: https://joinmastodon.org/communities diff --git a/sources/tech/20220429 From ifcfg to keyfiles- modernizing NetworkManager configuration in Fedora Linux 36.md b/sources/tech/20220429 From ifcfg to keyfiles- modernizing NetworkManager configuration in Fedora Linux 36.md new file mode 100644 index 0000000000..7849bbddd6 --- /dev/null +++ b/sources/tech/20220429 From ifcfg to keyfiles- modernizing NetworkManager configuration in Fedora Linux 36.md @@ -0,0 +1,186 @@ +[#]: subject: "From ifcfg to keyfiles: modernizing NetworkManager configuration in Fedora Linux 36" +[#]: via: "https://fedoramagazine.org/converting-networkmanager-from-ifcfg-to-keyfiles/" +[#]: author: "Lubomir Rintel https://fedoramagazine.org/author/lkundrak/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +From ifcfg to keyfiles: modernizing NetworkManager configuration in Fedora Linux 36 +====== + +![][1] + +Photo by [Compare Fibre][2] on [Unsplash][3] + +One of the changes in Fedora Linux 36 is that new installations will [no longer support the ifcfg files to configure networking][4]. What are those and what replaces them? + +### A bit of history + +In the good old days, connecting a Linux box to a network was easy. For each of the interface cards connected to a network, the system administrator would drop a configuration file into the _/etc_ directory. That configuration file would describe the addressing configuration for a particular network. On Fedora Linux, the configuration file would actually be a shell script snippet like this: + +``` + + $ cat /etc/sysconfig/network-scripts/ifcfg-eth0 + TYPE=Ethernet + DEVICE=eth0 + BOOTPROTO=dhcp + +``` + +A shell script executed on startup would read the file and apply the configuration. Simple. + +Towards the end of 2004, however, a change was in the air. Quite literally — the Wi-Fi has become ubiquitous. The portable computers of the day could rapidly connect to new networks and the USB bus allowed even the wired network adapters to come and go while the system was up and running. The network configuration became more dynamic than ever before, rendering the existing network configuration tooling impractical. To the rescue came [NetworkManager][5]. On a Fedora Linux system, NetworkManager uses configuration like this: + +``` + + $ cat /etc/sysconfig/network-scripts/ifcfg-eth0 + TYPE=Ethernet + DEVICE=eth0 + BOOTPROTO=dhcp + +``` + +Looks familiar? It should. From the beginning, NetworkManager was intended to work with the existing configuration formats. In fact, it ended up with plugins which would seamlessly convert between NetworkManager’s internal configuration model and the distribution’s native format. On Fedora, it would be the aforementioned _ifcfg_ files. + +Let’s take a closer look at them. + +### Ifcfg files + +The legacy network service, now part of the _network-scripts_ package, originally defined the _ifcfg_ file format. Along with the package comes a file called [sysconfig.txt][6] that, quite helpfully, documents the format. + +As NetworkManager gained traction it often found itself in need of expressing a configuration that was not supported by the old fashioned network service. Given the nature of configuring things with shell scripts, adding new settings is no big deal. The unknown ones are generally just silently ignored. The NetworkManager’s idea of what ifcfg files should look like is described in the [nm-settings-ifcfg-rh(5)][7] manual. + +In general, NetworkManager tries hard to write _ifcfg_ files that work well with the legacy network service. Nevertheless, sometimes it is just not possible. These days, the number of network connection types that NetworkManager supports vastly outnumber what the legacy network service can configure. . A new format is now used to express what the legacy format can not. This includes VPN connections, broadband modems and more. + +### Keyfiles + +The new format closely resembled the NetworkManager’s native configuration model: + +``` + + $ cat /etc/NetworkManager/system-connections/VPN.ovpn + [connection] + id=My VPN + uuid=c85a7cdb-973b-491f-998d-b09a590af10e + type=vpn + + [vpn] + ca=/etc/pki/tls/certs/vpn-ca.pem + connection-type=password + remote=vpn.example.com + username=lkundrak + service-type=org.freedesktop.NetworkManager.openvpn + + [ipv6] + method=auto + never-default=true + +``` + +The actual format should be instantly familiar to everyone familiar with Linux systems. It’s the “ini file” or “keyfile” — a bunch of plain text key-value pairs, much like the ifcfg files use, grouped into sections. The [nm-settings-ifcfg-keyfile(5)][8] manual documents the format thoroughly. + +The main advantage of using this format is that it closely resembles NetworkManager’s idea of how to express network configuration, used both internally and on the D-Bus API. It’s easier to extend without taking into consideration the quirks of the mechanism that was designed in without the benefit of foresight back when the world was young. This means less code, less surprises and less bugs. + +In fact there’s nothing the _keyfile_ format can’t express that _ifcfg_ files can. It can express the simple wired connections just as well as the VPNs or modems. + +### Migrating to keyfiles + +The legacy network service served us well for many years, but its days are now long over. Fedora Linux dropped it many releases ago and without it there is seemingly little reason to use the ifcfg files. That is, for new configurations. While Fedora Linux still supports the _ifcfg_ files, it has defaulted to writing _keyfiles_ for quite some time. + +Starting with Fedora Linux 36, the ifcfg support will no longer be present in new installations. If you’re still using _ifcfg_ files, do not worry — the existing systems will keep it on upgrades. Nevertheless, you can still decide to uninstall it and carry your configuration over to _keyfiles_. Keep on reading to learn how. + +If you’re like me, you installed your system years ago and you have a mixture of _keyfiles_ and _ifcfg_ files. Here’s how can you check: + +``` + + $ nmcli -f TYPE,FILENAME,NAME conn + TYPE FILENAME NAME + ethernet /etc/sysconfig/network-scripts/ifcfg-eth0 eth0 + wifi /etc/sysconfig/network-scripts/ifcfg-Guest Guest + wifi /etc/NetworkManager/system-connections/Base48 Base48 + vpn /etc/NetworkManager/system-connections/VPN.ovpn My VPN + +``` + +This example shows a VPN connection that must have always used a keyfile and a Wi-Fi connection presumably created after Fedora Linux switched to writing _keyfiles_ by default. There’s also an Ethernet connection and Wi-Fi one from back in the day that use the _ifcfg_ plugin. Let’s see how we can convert those to keyfiles. + +The NetworkManager’s command line utility, [nmcli(1)][9], acquired a new _connection migrate_ command, that can change the configuration backend used by a connection profile. + +It’s a good idea to make a backup of _/etc/sysconfig/network-scripts/ifcfg-*_ files, in case anything goes wrong. Once you have the backup you can try migrating a single connection to a different configuration backend (_keyfile_ by default): + +``` + + $ nmcli connection migrate eth0 + Connection 'eth0' (336aba93-1cd7-4cf4-8e90-e2009db3d4d0) successfully migrated. + +``` + +Did it work? + +``` + + $ nmcli -f TYPE,FILENAME,NAME conn + TYPE FILENAME NAME + ethernet /etc/NetworkManager/system-connections/eth0.nmc eth0 + wifi /etc/sysconfig/network-scripts/ifcfg-Guest Guest + wifi /etc/NetworkManager/system-connections/Base48 Base48 + vpn /etc/NetworkManager/system-connections/VPN.ovpn My VPN + +``` + +Cool. Can I migrate it back, for no good reason? + +``` + + $ nmcli conn migrate --plugin ifcfg-rh eth0 + Connection 'eth0' (336aba93-1cd7-4cf4-8e90-e2009db3d4d0) successfully migrated. + +``` + +Excellent. Without specifying more options, the “connection migrate” command ensures all connections use the keyfile backend: + +``` + + $ nmcli conn migrate + Connection '336aba93-1cd7-4cf4-8e90-e2009db3d4d0' (eth0) successfully migrated. + Connection '3802a9bc-6ca5-4a17-9d0b-346f7212f2d3' (Red Hat Guest) successfully migrated. + Connection 'a082d5a0-5e29-4c67-8b6b-09af1b8d55a0' (Base48) successfully migrated. + Connection 'c85a7cdb-973b-491f-998d-b09a590af10e' (Oh My VPN) successfully migrated. + +``` + +And that’s all. Now that your system has no _ifcfg_ files, the configuration backend that supports them is of no use and you can remove it: + +``` + + # dnf remove NetworkManager-initscripts-ifcfg-rh + … + +``` + +Your system now works the same as it did before, but you can rejoice, for it is now modern. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/converting-networkmanager-from-ifcfg-to-keyfiles/ + +作者:[Lubomir Rintel][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/lkundrak/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2022/04/ifcfg_to_keyfiles-816x345.jpg +[2]: https://unsplash.com/@comparefibre?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/network-cable?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoraproject.org/wiki/Releases/36/ChangeSet#No_ifcfg_by_default +[5]: https://networkmanager.dev/ +[6]: https://github.com/fedora-sysv/initscripts/blob/master/doc/sysconfig.txt#L416 +[7]: https://networkmanager.dev/docs/api/latest/nm-settings-ifcfg-rh.html +[8]: https://networkmanager.dev/docs/api/latest/nm-settings-ifcfg-keyfile.html +[9]: https://networkmanager.dev/docs/api/latest/nmcli.html diff --git a/sources/tech/20220502 Data Profiler- An Open Source Machine Learning Technology For Data Monitoring.md b/sources/tech/20220502 Data Profiler- An Open Source Machine Learning Technology For Data Monitoring.md new file mode 100644 index 0000000000..3ad7c7161b --- /dev/null +++ b/sources/tech/20220502 Data Profiler- An Open Source Machine Learning Technology For Data Monitoring.md @@ -0,0 +1,47 @@ +[#]: subject: "Data Profiler: An Open Source Machine Learning Technology For Data Monitoring" +[#]: via: "https://www.opensourceforu.com/2022/05/data-profiler-an-open-source-machine-learning-technology-for-data-monitoring/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Data Profiler: An Open Source Machine Learning Technology For Data Monitoring +====== +![Business Network concept, Social Network Concept, Profiling and human behavior analysis by artificial intelligence technology, Futuristic Technology background][1] + +The amount of data that firms can manage has increased rapidly since moving to the cloud. This is why Capital One developed Data Profiler, an open source Python package that uses machine learning to assist users in monitoring huge data and detecting sensitive information. Data Profiler provides users with a pre-trained deep learning model for quick detection of sensitive information, as well as components for statistical analysis of the dataset and an API for creating data labelers. + +He went on to say that the data labeler’s deep learning model analyses a dataset’s unstructured text and then determines what type of data is being represented in that particular dataset. + +“Our library has a list of labels of which a subset is considered non-public personally identifiable pieces of information… the data labeler is able to use that deep learning model to identify where that exists in a dataset… and calls out where that exists to that user that’s doing the analysis,” Goodsitt explained. + +Customers can use Data Profiler in a variety of ways. The library can detect the schema, statistics, and entities from any data, whether it is structured, unstructured, or semi-structured. This flexibility allows models to be changed and allows many models to be run on the same dataset with only a few lines of code. + +Goodsitt also talked about how this sensitive data detection methodology might be used to sanitise datasets on a mobile device so that when they leave the customer’s device, the specific personal information is deleted, guaranteeing that the data is safe no matter where it travels. + +The key reasons for Capital One’s decision to open source Data Profiler, according to Nureen D’Souza, leader of the Open-Source Program Office, are to promote cooperation with new talent, display the expertise of its data scientists, and give back to the open-source community. + +“We can now have others in a similar field contribute to this project and make Data Profiler greater than it is today,” she said, “We thought it would be good to open source because it solves the problem that we are seeing, and we couldn’t find another open source project that would.” + +Goodsitt also emphasised the advantages of Data Profiler’s reader feature. This is a single command class that allows customers to point to various sorts of files or even a URL that hosts a dataset, and it will automatically identify and read that dataset for them. + +Users can also use Data Profiler to parallelize, batch, or stream profile a dataset so that it does not have to be profiled all at once. This functionality was not easily discoverable before to this release, according to Goodsitt, unless you were doing your own statistical study. Since its debut in 2021, Data Profiler has received 54 forks on GitHub and over 700 stars, according to D’Souza, demonstrating how highly this open-source tool is regarded by the community, with no signs of slowing down. + +This open source solution will be showcased at PyCon 2022, the Python Conference, which will take place in Salt Lake City from April 27 to May 3. PyCon is returning in person after two years of being a virtual event, with various health and safety requirements in place. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/data-profiler-an-open-source-machine-learning-technology-for-data-monitoring/ + +作者:[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/05/Data-Profiling-1-696x464.jpeg diff --git a/sources/tech/20220502 Trinity Desktop Environment -TDE- Latest Release Brings PolicyKit Support and Updates.md b/sources/tech/20220502 Trinity Desktop Environment -TDE- Latest Release Brings PolicyKit Support and Updates.md new file mode 100644 index 0000000000..b0d8125554 --- /dev/null +++ b/sources/tech/20220502 Trinity Desktop Environment -TDE- Latest Release Brings PolicyKit Support and Updates.md @@ -0,0 +1,87 @@ +[#]: subject: "Trinity Desktop Environment (TDE) Latest Release Brings PolicyKit Support and Updates" +[#]: via: "https://www.debugpoint.com/2022/05/tde-release-r14-0-12/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Trinity Desktop Environment (TDE) Latest Release Brings PolicyKit Support and Updates +====== +Trinity Desktop Environment (TDE) brings the latest application updates, bug fixes, and enhancements to its release Trinity R14.0.12. + +Trinity Desktop Environment is a Fork of KDE version 3.5 and a continuation of feature updates and bug fixes by a small development team. This independent and standalone desktop project is still alive today for those who believe how excellent the KDE 3 desktop methodology is. + +Trinity Desktop Environment release R14.0.12 brings new applications, enhancements and significant bug fixes. + +[TDE release R14.0.12][1] is the 12th maintenance release of the R14.0 series built upon its previous iteration released in Oct 2021. This release brings new applications, 10+ enhancements, bug fixes and support for the latest [Ubuntu 22.04 Jammy Jellyfish][2] and other distributions. + +![Trinity Desktop Environment – TDE release R14.0.12][3] + +### Trinity Desktop Environment – TDE release R14.0.12 + +Firstly, TDE R14.0.12 introduces Polkit-agent-tde and Polkit-tqt, which helps with the PolicyKit authentication triggered by the TQt interfaces. That means, when required, the admin password prompt is now invoked via PolicyKit for authentication. Also, a new embeddable lightweight markdown document viewer is introduced in this release. + +Secondly, the list of enhancements includes the Konsole applications improvements, support for complex characters and HTML5 in Quanta (web dev editor), and support for Let’s Encrypt certificates. Not only that, TDE’s overall look is improved in addition to translation updates, and support for Python3 are some of the exciting enhancements in this release. + +Moreover, on the building aspect, several packages migrated to the CMake build system while automake build system dropped for others. + +Other than that, the application bug fixes include, Kaffeine seeing a fix on the libdvdcss codec detection in its player module, Amarok fixing errors for the latest Ruby programming language, and KMail correcting the email redirection to the default account. + +Among all, other notable core bug fixes include a timeout fix in dbus service startup and a system hang fix during the shutdown. + +Furthermore, following the other Linux distribution’s latest releases, TDE R14.0.12 introduces Ubuntu 22.04 LTS Jammy Jellyfish support, dropped support for Debian Jessie and improvements for Gentoo. + +All of these changes with some additional updates for developers who build applications for this KDE 3.5 tech can be found in the official changelog of TDE R14.0.12 on this [page][4]. + +Finally, you should be happy to know that Good ol’ Trinity Desktop Environment is available for all mainstream Linux Distribution for installation, including Ubuntu, Fedora, Arch Linux, etc. A list of installation instructions is available [here][5]. + +#### Installing TDE in Ubuntu 22.04 LTS + +Open a terminal and run the following commands in sequence to install this desktop environment. Also, make sure to log off after completion and choose TDE from the login. While installing, the installer would prompt you to choose the display manager. Choose the option gdm (GNOME Display Manager). + +``` +sudo gedit /etc/apt/sources.list +``` + +Add the following line and save the file. + +``` +deb http://mirror.ppa.trinitydesktop.org/trinity/deb/trinity-sb jammy deps-r14 main-r14deb-src http://mirror.ppa.trinitydesktop.org/trinity/deb/trinity-sb jammy deps-r14 main-r14 +``` + +``` +wget http://mirror.ppa.trinitydesktop.org/trinity/deb/trinity-keyring.debsudo dpkg -i trinity-keyring.debsudo apt updatesudo apt install kubuntu-default-settings-trinity kubuntu-desktop-trinity +``` + +### Video walkthrough of this release + +Here’s a quick video we prepared for you of this release. Don’t forget to subscribe to us! + +![Trinity Desktop Environment TDE R14 0 12 Walkthrough Video][6] + +As always, make sure to check out the official [contribution][7] page to help the dev team with your expertise and capacity. + +*Via Release announcement* + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/tde-release-r14-0-12/ + +作者:[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://wiki.trinitydesktop.org/Release_Notes_For_R14.0.12 +[2]: https://www.debugpoint.com/2022/04/ubuntu-studio-22-04-lts/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/Trinity-Desktop-Environment-TDE-release-R14.0.12.jpg +[4]: https://wiki.trinitydesktop.org/Release_Notes_For_R14.0.12 +[5]: https://wiki.trinitydesktop.org/Category:Installation +[6]: https://youtu.be/qoGylRyAJEo +[7]: https://www.trinitydesktop.org/helpwanted.php diff --git a/sources/tech/20220502 dahliaOS – A Unique Linux Distribution Based on Google Fuchsia [First Look].md b/sources/tech/20220502 dahliaOS – A Unique Linux Distribution Based on Google Fuchsia [First Look].md new file mode 100644 index 0000000000..17b1bc5584 --- /dev/null +++ b/sources/tech/20220502 dahliaOS – A Unique Linux Distribution Based on Google Fuchsia [First Look].md @@ -0,0 +1,127 @@ +[#]: subject: "dahliaOS – A Unique Linux Distribution Based on Google Fuchsia [First Look]" +[#]: via: "https://www.debugpoint.com/2022/05/dahlia-os-alpha" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +dahliaOS – A Unique Linux Distribution Based on Google Fuchsia [First Look] +====== +Our first look at the dahliaOS Alpha version, based on Google’s Fuchsia operating system. + +The [dahliaOS][1] is a unique distribution and a “fork” of the Google [Fuchsia][2] operating system that runs on mainline Linux Kernel and [Zircon Kernel][3]. The Zircon kernel is a newly designed kernel developed by Google for its own set of projects and devices. + +The parent OS Fuchsia is designed to work on any hardware, including car dashboards to PCs. That said, the dahliaOS is a new promising operating system (or should I say a new Linux Distribution?) which brings a new era of desktop computing experience to traditional Linux distributions. + +![dahliaOS Alpha Desktop][4] + +### dahliaOS – First Look (ALPHA) + +#### Core Architecture + +It’s an ALPHA software as of writing this review. So, there are bugs. I would not recommend it for your daily driver or any serious work. + +Firstly, the team of dahliaOS managed to run this fork on top of the mainline Linux Kernel ([Kernel 5.17][5] in this alpha version). You still have the option to use the zircon kernel. On top of that, it uses the init system for boot up and other initial functions. + +Secondly, dahliaOS’s user interface is called Pangolin desktop, which is based on deprecated capybara UI, and it provides a desktop shell. + +In addition to those, the Pangolin Shell interacts with X.Org and Flutter. While researching, I found traces of Openbox Window manager; perhaps it’s also used. + +However, the X.Org display server communicates with userspace and the userspace talks to Linux Kernel. The overall architecture is explained below image (credit: dahliaOS team). + +![dahlisOS Architecture][6] + +#### The Pangolin Desktop + +At the first look, it’s a stunning looking desktop and very fast. The overall look may feel similar to Chrome OS, but there are differences. The primary reason maybe it’s designed differently and written in Flutter. + +The design is pretty standard with a bottom main panel with an application menu at the left, a middle dock and a system tray. + +The application menu launches full screen, and it’s unique. At the top, you get a global search bar which searches your entire desktop and web. In the middle, an icon-based application grid gives you access to all the installed packages in your system. One of the unique aspects of this menu is an additional menu bar that shows the application categories in this fullscreen view. + +![Full-screen application view][7] + +Finally, a small section shows shortcuts to the power menu, system settings, and user profile at the bottom. + +Not only that, the bottom panel does not overlay with the fullscreen application menu; it remains visible. + +But that’s not all. My favourite is the system tray pop-up menu which summarizes the system state with toggle switches to turn on or off several settings. See for yourself in the below image. + +![System Tray][8] + +It’s a fine work of user interface design that brings all these options together without the feeling of clumsiness. + +Moreover, the different search options and a nice workspace view give this desktop an additional advantage. + +#### Applications and Settings + +Firstly, I want to discuss how well the Settings window is designed. Settings application gives you access to all tweaks for dahliaOS. This responsive application (adapts to the screen size), offers an array of options on the left panel with its details on the right. + +![Settings Window][9] + +Network, Customizations, Connected devices, and notifications are some of the critical settings that you can find. However, being an alpha copy, some are still under development. + +In addition, dahliaOS comes with built-in dark and light mode with an option to change the primary taskbar alignment, coloured title bars with transparency effect (wow) and a settings slider to change the window border radius! + +Finally, a file manager, photo viewer, terminal and calculator – all developed in Flutter give a different feel if you are an avid Linux user. + +![dahliaOS Running Apps][10] + +Installing software is a little different as dahliaOS manages all of them via Web App. + +#### Installing native apps or Linux packages + +I am not sure whether dahliaOS would allow the installation of native Linux packages via apt, Flathub or Snap. But the possibility is there as a future roadmap. + +#### Performance + +Overall, the performance is speedy, and the resource consumption metric is good. In a virtual machine environment, dahliaOS consumes about 330MB of memory. But CPU is surprisingly little higher in my opinion, which hovers around 10 % to 13% range. The Pangolin desktop consumes most of the resources, followed by the X.Org. + +![dahliaOS ALPHA System Performance][11] + +Finally, you might feel some strange desktop behaviour related to in-focus and out of focus situations in applications – perhaps due to FLutter. Sometimes, the focus is not registered even if you select a window via mouse. It might well be a bug. + +### Video of dahliaOS walkthrough – Alpha + +Here’s a quick walkthrough of dahliaOS, which I recorded for our readers to give you some idea before you try. + +![dahliaOS A Unique Linux Distribution Based on Google Fuchsia First Look][12] + +### Closing Notes + +To wrap up, I think it is one of the promising Linux distributions in the making, which takes a different path than traditional forks. + +We will keep a close watch on this project and give you updates here. + +If you want to learn more, contribute, visit the official website for more [details][13] ([source][14]). Finally, if you are planning to install or try, visit this [page][15]. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/dahlia-os-alpha + +作者:[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://dahliaos.io/ +[2]: https://fuchsia.dev/ +[3]: https://fuchsia.dev/fuchsia-src/concepts/kernel +[4]: https://www.debugpoint.com/wp-content/uploads/2022/05/dahliaOS-Alpha-Desktop.jpg +[5]: https://www.debugpoint.com/2022/03/linux-kernel-5-17/ +[6]: https://www.debugpoint.com/wp-content/uploads/2022/05/dahlisOS-Architecture.png +[7]: https://www.debugpoint.com/wp-content/uploads/2022/05/Full-screen-application-view.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/System-Tray.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/05/Settings-Window.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/05/dahliaOS-Running-Apps.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2022/05/dahliaOS-ALPHA-System-Performance.jpg +[12]: https://youtu.be/Cy8iDOkMp9s +[13]: https://docs.dahliaos.io/ +[14]: https://github.com/dahliaOS/ +[15]: https://docs.dahliaos.io/install/efi diff --git a/sources/tech/20220503 Automate and manage multiple devices with Remote Home Assistant.md b/sources/tech/20220503 Automate and manage multiple devices with Remote Home Assistant.md new file mode 100644 index 0000000000..b0ae836090 --- /dev/null +++ b/sources/tech/20220503 Automate and manage multiple devices with Remote Home Assistant.md @@ -0,0 +1,66 @@ +[#]: subject: "Automate and manage multiple devices with Remote Home Assistant" +[#]: via: "https://opensource.com/article/22/5/remote-home-assistant" +[#]: author: "Kevin Sonney https://opensource.com/users/ksonney" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Automate and manage multiple devices with Remote Home Assistant +====== +Link together multiple Home Assistant devices with this centralized control panel. + +![Houses in a row][1] +(Image by: [27707][2] via [Pixabay][3], CC0. Modified by Jen Wike Huger.) + +Automation is a hot topic right now. In my day job as an SRE part of my remit is to automate as many repeating tasks as possible. But how many of us do that in our daily, not-work, lives? This year, I am focused on automating away the toil so that we can focus on the things that are important. + +There are a lot of guides out there on [Setting Up Home Assistant][4], but what if you have multiple Home Assistant installations (like I do), and want to display and control them all from a single, central Home Assistant? + +There is an amazing add-on called Remote Home Assistant ([https://github.com/custom-components/remote_homeassistant][5]) that makes this an absolute breeze. And it really helps me manage and automate things without having to set up any complex software (although I have done this with MQTT in the past — it was a challenge). + +![Image of Remote Home Assistant][6] +(Image by: Kevin Sonney, CC BY-SA 40) + +The easiest way to set up Remote Home Assistant is to install the [Home Assistant Community Store][7] (HACS) on both HASS installations. HACS is an absolutely massive collection of third-party add-ons for Home Assistant. The instructions are very straight forward, and cover most use cases — including using  Home Assistant OS (which is my central node), and Home Assistant Core (one of my remote nodes). It installs as a new Integration, so you can add it like any other integration. You must be able to log into GitHub for HACS to work, but HACS walks you through that as part of the configuration flow. After it's complete, it loads all the known add-on repositories. To see the status of it, click the new **HACS** option in the navigation menu on the left. + +![Image of HACS Main Page][8] +(Image by: Kevin Sonney, CC BY-SA 40) + +Select **Integrations** and search for **Remote Home Assistant** when it has completed loading all the store information. Install the add-on with the **Install** button, and restart Home Assistant. When the restart is complete, you have a new custom integration available, which can be added like any other. + +On the remote node (“lizardhaus”), you need to [generate a long-lived token][9], and then add the **Remote Home Assistant** integration. Select **Setup as remote node** and that's all you need to do. + +On the central node (“homeassistant”), the configuration flow is different. Add the integration as before, but do not create an access token. Select **Add a remote node** and click **Submit**. You are asked for the site name, the address (which can be a name or an IP address), the port, and the access token generated on the remote node. You can enable or disable SSL (and I STRONGLY recommend setting up SSL on the remote if it's exposed to the internet). After it connects, it prompts you for additional information, such as a prefix for the entities from the remote node (I like to include a trailing "_" character), what entities to fetch, and what to include and exclude. You can get events that can be triggered remotely, like turning on and off switches. + +![Image of Remote Home Assistant Setup Step 2][10] +(Image by: Kevin Sonney, CC BY-SA 40) + +After that, the remote items appear to home assistant like any other item. And you can control them in the same way, as long as you added the correct triggers and entities. + +Remote Home Assistant is really useful if you have devices like Bluetooth Low Energy plant sensors that are too far away from the main HASS machine. You can place a Raspberry Pi with HassOS near the plants then use Remote Home Assistant to put them in your central dashboard, and get an alert when they need watering, and so on. Overall, linking together multiple Home Assistant configurations is surprisingly easy, and VERY helpful. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/remote-home-assistant + +作者:[Kevin Sonney][a] +选题:[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/ksonney +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/house_home_colors_live_building.jpg +[2]: https://pixabay.com/en/users/27707-27707/ +[3]: https://pixabay.com/en/buildings-houses-cliff-top-home-1008677/ +[4]: https://opensource.com/article/20/12/home-assistant +[5]: https://github.com/custom-components/remote_homeassistant +[6]: https://opensource.com/sites/default/files/2022-04/CronyDay03-1.png +[7]: https://hacs.xyz +[8]: https://opensource.com/sites/default/files/2022-04/CronyDay03-2.png +[9]: https://www.atomicha.com/home-assistant-how-to-generate-long-lived-access-token-part-1/ +[10]: https://opensource.com/sites/default/files/2022-04/CronyDay03-3_0.png diff --git a/sources/tech/20220503 How I use the Bacula GUI for backup and recovery.md b/sources/tech/20220503 How I use the Bacula GUI for backup and recovery.md new file mode 100644 index 0000000000..3203fafa19 --- /dev/null +++ b/sources/tech/20220503 How I use the Bacula GUI for backup and recovery.md @@ -0,0 +1,223 @@ +[#]: subject: "How I use the Bacula GUI for backup and recovery" +[#]: via: "https://opensource.com/article/22/5/baculum-open-source-backup" +[#]: author: "Rob Morrison https://opensource.com/users/robmorrison" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I use the Bacula GUI for backup and recovery +====== +Baculum is an open source web application for using Bacula's range of backup and restore jobs. + +![Text editor on a browser, in blue][1] + +Today, when best practices for backup and recovery are more important than ever before, it's good to know that high-end fully open source enterprise backup solutions exist for even the largest organizations. Perhaps the most powerful open source solution in its class is Bacula, a highly scalable software for backup, recovery, and data verification. It is a mature yet still significantly developing project used by MSPs, defense organizations, ISVs, and e-commerce companies worldwide and runs on many different Linux flavors. Bacula has a thriving community, and many Linux enthusiasts use it to provide a strong level of data protection. + +With the many severe disruptions that ransomware causes today, it's critical that the client system being backed up is never aware of storage targets and has no credentials for accessing them. This is true in Bacula's case, and in addition: + +* Storage and Storage Deamon hosts are dedicated systems, strictly secured, allowing only Bacula-related traffic and admin access and nothing else. +* Bacula's "Director" (core management module) is a dedicated system with the same restrictive access. + +Bacula has plenty of additional configuration options to tune backups to user needs. It functions in networks and can back up both remote and local hosts. For first-time users, it can look complex, but fortunately, the Bacula Project also provides the [Baculum][2] web interface to ease administration. Many Linux users are more than happy to rely on Bacula's command-line interface to exploit its considerable range of capabilities, but sometimes it's good to have an effective GUI, too. That's where the open source Baculum comes in. + +### Baculum + +Baculum's installation process is reasonably simple because its repositories provide binary packages for popular Linux distributions. After installation, you have access to two wizards: + +* The Baculum API - a REST API component for working with Bacula data. +* The Baculum Web component - the web interface itself. + +The Baculum API is installed on hosts with Bacula components which you manage from the web interface level. Baculum Web is usually one instance that connects all Baculum API hosts and makes it possible to manage all of them. This architecture fits well with the Bacula network architecture because you can manage all Bacula hosts from one interface. It's important to know that the web interface does not store any Bacula-specific configuration from any host but manages them by sending API requests instead. When you modify the interface or run Bacula actions, they are done in real-time. When you click on the save configuration button, the modification is done simultaneously on the targeted hosts. + +Below is a sample Bacula and Baculum topology. + +![Baculum API][3] + +One disadvantage of this approach is that you need to install one Baculum API instance on each Bacula host that you want to manage. If there are many servers to back up, it is possible to automate the installation process using an application-deployment tool like Ansible. + +In my case, I have a much simpler topology with only one host managed by Baculum. My topology looks like the one below. + +![Baculum web interface topology][4] + +You can decide what Bacula resources to share on each Baculum API host. You can set the API hosts to do configuration work, access the Bacula catalog database, run Bacula console commands, or any combination. + +After installing the web interface in the Bacula environment, you see a dashboard page like this: + +![Baculum dashboard][5] + +### Create a backup job + +To define a new backup job, go to the job page to see some wizards for creating backup, copy, or migrate jobs using a custom job form. For this demonstration, I chose the **backup job**, which displays the first wizard step: + +![New backup job wizard][6] + +First, type the new job name and optional description. In the second step, decide what to backup. For this example, I chose a Bacula client and FileSet, which defines the paths to be backed up. Usually, in this window, there aren't any FileSet options to choose from yet, but you can create one with the **Add new fileset** button in the wizard. To define paths, I decided to browse the client filesystem and select paths in the drag and drop browser, as in the image below. + +![Select file set][7] + +Once the FileSet is ready, the next step is to select where to save the backed-up data for this job. Select a storage location and a volume pool. + +![select storage and pool][8] + +As with FileSets, you have an option to create a new pool. In this example, I chose an existing volume pool. + +In the next step are job-specific options like choosing the job level (full, incremental, differential, etc.), job priority, and a few other settings. + +![select job objectives][9] + +On the next wizard page, specify when to run this backup job. Backups are usually run periodically, and here you can choose a schedule for this job. If you don't have a schedule, you can create it in this interface: + +![Define a schedule][10] + +The last wizard step is just a summary of all values selected in the previous steps. + +![job summary][11] + +Review all the values, and if they look correct, create the new job. + +### Run the backup + +OK, you have a new backup job. To run the initial backup, you may choose to start it manually using the **Run job** button. There is a useful capability in the **Run job** window to estimate a job before running it. Run this estimation to know in advance how many files and how many bytes will be backed up by this job. + +![manually run the job][12] + +After running the job, you move to a job view page where you can see backup progress from the client's perspective. + +![Job page][13] + +You can track job status from three places on the interface: + +* The Bacula client (shown above). +* The Bacula director component side. +* The storage daemon perspective. + +Here you can see the job progress on the director and storage daemon side: + +![job progress][14] + +![job progress][15] + +The backup job completes. + +### Restore data + +Of course, you must be able to restore the backed-up data. Baculum provides a **Restore wizard** in the primary sidebar menu. After opening it, you see a backup client selection to which you can restore the data. + +![Restore job wizard][16] + +Select the client and go to the second step. Here you see all backups from that client. Your backup is at the top, so it is easy to choose. However, if you want to find a past backup, search the backups data grid. There is also an option to find a backup by filename, with or without a path. + +![Select backup job][17] + +Select the backup and go to file selection on the third restore wizard step. Here, in the file browser, choose directories and files to restore. The browser also has an area to select a specific file version if it exists in other backups. + +![Select files to restore][18] + +The next wizard step defines the destination where the restore will save the data. By default, the client from which the backup originates is selected, but you can change that to restore to a different host than the original. You can also define an absolute path on the client to restore the data. The media required to complete this restore is displayed. This is very useful for a backup tape device operator to prepare for the restore job. Personally, I use disk media, and my volumes are available for the storage daemon all the time. + +![Select restore destination][19] + +The next step offers the restore options, such as replacing a policy for existing files on the filesystem or file relocation fields. I keep them untouched and go to the summary step before running the restore. + +![Restore job summary][20] + +In the restore job—just like in the backup job—you see the running restore job's progress. After completion, there is a summary of the entire process. + +![Restore job summary details][21] + +That's just about it. The backup and a restore are done. The process may be a little simpler with other tools, but Bacula offers Linux enthusiasts hundreds of very useful options. This limits how much you can simplify the interface, and most users of Bacula don't want that. + +### Copy jobs + +Besides doing traditional backup and restore jobs, Bacula also provides a few other job types. One of them is **Copy job**, which copies backups between storage devices from one pool of volumes to another. One storage device can be a disk, and another can be a tape or tape library. Copy job reads data from file volumes and sends it to tape devices for saving on magnetic tapes. Bacula users can configure a backup D2D2T strategy (disk-to-disk-to-tape). Source and destination storage can be of different types (disk and tape), but it works just as well when copying backup jobs between the same device types. + +Baculum has full support for copy jobs, including configuring copy jobs and ending with restoring data directly from copy jobs. Configure a copy job using the copy job wizard visible in the image below. + +![Copy job wizard][22] + +After typing the new copy job name, choose the source storage and source volume pool. This is the storage that reads data when the copy job runs. + +![Copy job source][23] + +The third wizard step specifies how to copy jobs. In other words, you can define the selection criteria used for choosing the backups that will be copied. You can select backups by patterns like: + +* Job name +* Client +* Volume +* Smallest volume in the pool +* Oldest volume in the pool +* SQL query +* Copy all uncopied jobs so far from the pool + +In this example, I chose a selection by job name. + +![Copy job selection][24] + +Select the destination storage and pool in the next step. This storage writes backups to the destination pool when you run the copy job. + +![Copy job destination][25] + +In the penultimate step are a couple of options, such as the maximum number of spawned jobs. You can also set a schedule to run the copy job periodically. + +![Copy job options][26] + +After saving the wizard, run the copy job in the same place where you started the backup job. You can see the live updated job log output. + +![Copy job history][27] + +### Wrap up + +Done! You have performed a backup job, restored a job, and created a copy job. + +There are two Baculum functions that I think many folks will find useful. + +First, its simple interface enables the user to administer Bacula from any mobile device. This can be crucial for cases when you are outside the office and somebody from the organization sends a text message like: "Hey! I accidentally deleted an important report file and need it urgently. Are you able to restore it to my computer?" You could do this restore using a mobile phone and the same wizard steps described above. + +The second important function is its multi-user interface with several authentication methods (local user, basic authentication, LDAP, etc.). It enables company employees to use Baculum to backup and restore their own resources without requiring access to any other utilities. You can customize the role-based access control interface for each group of users. + +Of course, these options are just the tip of the iceberg regarding Bacula's capabilities with Baculum. Baculum really is about being configurable. I hope you can enjoy its benefits and the empowerment it brings you to make your data safer and your life easier! + +(Image by: Rob Morrison, CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/baculum-open-source-backup + +作者:[Rob Morrison][a] +选题:[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/robmorrison +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/browser_blue_text_editor_web.png +[2]: https://baculum.app/ +[3]: https://opensource.com/sites/default/files/2022-04/1baculumAPI.png +[4]: https://opensource.com/sites/default/files/2022-04/2baculumwebinterface.png +[5]: https://opensource.com/sites/default/files/2022-04/3dashboard.png +[6]: https://opensource.com/sites/default/files/2022-04/4newBUwizard.png +[7]: https://opensource.com/sites/default/files/2022-04/5FileSet.png +[8]: https://opensource.com/sites/default/files/2022-04/6storage-and-pool.png +[9]: https://opensource.com/sites/default/files/2022-04/7job-directives.png +[10]: https://opensource.com/sites/default/files/2022-04/8schedule.png +[11]: https://opensource.com/sites/default/files/2022-04/9summary.png +[12]: https://opensource.com/sites/default/files/2022-04/10runjob.png +[13]: https://opensource.com/sites/default/files/2022-04/11jobhistory.png +[14]: https://opensource.com/sites/default/files/2022-04/12job-from-daemon.png +[15]: https://opensource.com/sites/default/files/2022-04/13jobstoragedaemon.png +[16]: https://opensource.com/sites/default/files/2022-04/14restorewizard.png +[17]: https://opensource.com/sites/default/files/2022-04/15selectjobtorestore.png +[18]: https://opensource.com/sites/default/files/2022-04/16selectfilestorestore.png +[19]: https://opensource.com/sites/default/files/2022-04/17selectstoragedestination.png +[20]: https://opensource.com/sites/default/files/2022-04/18restoresummary.png +[21]: https://opensource.com/sites/default/files/2022-04/19restorehistory.png +[22]: https://opensource.com/sites/default/files/2022-04/20copyjobwizard.png +[23]: https://opensource.com/sites/default/files/2022-04/21copysource.png +[24]: https://opensource.com/sites/default/files/2022-04/22copy-files.png +[25]: https://opensource.com/sites/default/files/2022-04/23copydestination.png +[26]: https://opensource.com/sites/default/files/2022-04/24copyoptions.png +[27]: https://opensource.com/sites/default/files/2022-04/25copyhistory.png diff --git a/sources/tech/20220503 PHP MySQL WHERE Clause.md b/sources/tech/20220503 PHP MySQL WHERE Clause.md new file mode 100644 index 0000000000..b74f4e1761 --- /dev/null +++ b/sources/tech/20220503 PHP MySQL WHERE Clause.md @@ -0,0 +1,282 @@ +[#]: subject: "PHP MySQL WHERE Clause" +[#]: via: "https://ostechnix.com/php-mysql-where-clause/" +[#]: author: "Sravan Kumar https://ostechnix.com/author/sravankumar/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +PHP MySQL WHERE Clause +====== +How To Select And Filter Data From A MySQL Database Using PHP In XAMPP + +In this guide, we will discuss how to select the records from a MySQL database based on specific conditions with the WHERE clause and the SELECT command using PHP in XAMPP stack. + +### Prerequisites + +Make sure you've created a database and table in XAMPP stack as described in the following guide. + +* Create MySQL Database And Table Using PHP In XAMPP + +For demonstration purpose, I've created a table named **"sales"** in a MySQL database called **"my_company"** with the below schema and records. + +![Database Schema And Records][1] + +### Filtering Data From MySQL Table With WHERE Clause Using PHP + +The WHERE clause is used to extract only the records that matches a specific condition. The WHERE clause will check the condition by taking an operator followed by a value. + +**WHERE Clause Syntax:** + +``` +SELECT column1,column2,.,column n from table_name WHERE column_name operator value; +``` + +Where, + +* column_name - the column on which condition is applied. +* operator - It is used to check the condition. +* value - It is the string/numeric value compared with each and every column values present in the table. + +``` +column_name +``` + +``` +operator +``` + +``` +value +``` + +### Steps + +**1.** Specify the servername (E.g. localhost), database username (E.g. `root` ), root user password and the database name (E.g. my_company). Here, my `root` user's password is empty. + +**2.** Establish a connection using the `mysqli_connect()` function. It will take servername, username and password as parameters. + +**Code:** + +``` +$connection = mysqli_connect($server_name, $user_name, $password, $database_name); +``` + +**3.** Specify the SQL Query to select a particular column or all columns' records from the table by a condition. In this step, we can specify the SQL query to select columns from the table into a variable. + +For example, I am going to use the database name called **my_company** and I am storing it in a variable named **query**. The table name is **sales** that has three columns. + +**Code:** + +``` +$query = "SELECT column1,…. from sales where column_name operator value"; +``` + +**4.** Store the selected results into a variable called **"final"** using the `mysqli_query()` function. It will take "connection" and "query" as parameters. + +**Code:** + +``` +mysqli_query($connection, $query); +``` + +**5.** Get the rows one by one from the "final" variable using the `mysqli_num_rows()` function. After that fetch the results by iterating through a **while** loop using `mysqli_fetch_assoc()` function. It will take the "`final` " variable as a parameter. + +**Code:** + +``` +if (mysqli_num_rows($final) > 0) { + //get the output of each row + while($i = mysqli_fetch_assoc($final)) { + echo $i["column1”],…………..; + } +} else { + echo "No results"; +} +``` + +**6.** Finally, close the connection by using the `mysqli_close()` function. + +**Code:** + +``` +mysqli_close($connection); +``` + +Now, let us write a sample PHP code based on the above steps. + +### PHP code To Select Data From MySQL Database Using WHERE Clause + +**Example Code 1:** + +In this example, we will select all columns from the "sales" table where the **id value is greater than 4** and display the result in a PHP page. + +So our operator will be greater than (**">"**) and the value is **4** by specifying the **column_name** as **id**. + +Create a new file named `select.php` under the `/htdocs` folder with the following contents in it. + +**Heads Up:** If you use Linux, the **htdocs** folder will be under **/opt/lampp/** directory. If you're on Windows, the **htdocs** will be usually in **C:\xampp**\ folder. + +``` +4"; + +#get the result +$final = mysqli_query($connection, $query); + +if (mysqli_num_rows($final) > 0) { + //get the output of each row + while($i = mysqli_fetch_assoc($final)) { + //get all columns + echo "id: " . $i["id"]. " ----> name: " . $i["name"]." ----> count: " . $i["count"]. "
"; + } +} else { + echo "No results"; +} + +//close the connection +mysqli_close($connection); +?> +``` + +Open your web browser and point it to **http://localhost/select.php** URL. You can see that data is selected where **id is greater than 4** and the result is displayed in the browser window. + +![Select Data From MySQL Database Using WHERE Clause][2] + +**Example Code 2:** + +In this example, we will select all columns from the "sales" table with the name as "Eggs" and display the result in the PHP page. + +So our operator will be equal to (**"="**) and the value is "Eggs" by specifying the `column_name` as **name**. + +``` + 0) { + //get the output of each row + while($i = mysqli_fetch_assoc($final)) { + //get all columns + echo "id: " . $i["id"]. " ----> name: " . $i["name"]." ----> count: " . $i["count"]. "
"; + } +} else { + echo "No results"; +} + +//close the connection +mysqli_close($connection); +?> +``` + +Open your web browser and point it to **http://localhost/select.php** URL. You can see that data is selected where name ='Eggs' and displayed. + +![Select Columns That Contains The Name Eggs][3] + +**Example Code 3:** + +In this example, we will select all columns from the "sales" table with **count as 45** and display the result in the PHP page. + +So our operator will be equal to (**"="**) and the value is 45 by specifying the column_name as **count**. + +``` + 0) { + //get the output of each row + while($i = mysqli_fetch_assoc($final)) { + //get all columns + echo "id: " . $i["id"]. " ----> name: " . $i["name"]." ----> count: " . $i["count"]. "
"; + } +} else { + echo "No results"; +} + +//close the connection +mysqli_close($connection); +?> +``` + +Open your web browser and point it to **http://localhost/select.php** URL. You can see that data is selected where **count = 45** and the resulting column is displayed. + +![Select Columns That Contains The Count 45][4] + +### Conclusion + +In this tutorial, we've discussed three different ways to select data from a MySQL database based on particular conditions using PHP with WHERE clause. The first example showed you how to filter the data by using the numeric value "id". The second and third examples explained how to select data by using the string value "name" and the numeric value "count" respectively. + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/php-mysql-where-clause/ + +作者:[Sravan Kumar][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sravankumar/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/wp-content/uploads/2022/05/Database-Schema-And-Records.png +[2]: https://ostechnix.com/wp-content/uploads/2022/05/Select-Data-From-MySQL-Database-Using-WHERE-Clause.png +[3]: https://ostechnix.com/wp-content/uploads/2022/05/Select-Columns-That-Contains-The-Name-Eggs.png +[4]: https://ostechnix.com/wp-content/uploads/2022/05/Select-Columns-That-Contains-The-Count-45.png diff --git a/sources/tech/20220505 Boost the power of C with these open source libraries.md b/sources/tech/20220505 Boost the power of C with these open source libraries.md new file mode 100644 index 0000000000..96a806a4f4 --- /dev/null +++ b/sources/tech/20220505 Boost the power of C with these open source libraries.md @@ -0,0 +1,321 @@ +[#]: subject: "Boost the power of C with these open source libraries" +[#]: via: "https://opensource.com/article/22/5/libsoup-gobject-c" +[#]: author: "Joël Krähemann https://opensource.com/users/joel2001k" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Boost the power of C with these open source libraries +====== +GObject and libsoup do a lot of work for you, so you can turn your attention to inventing amazing applications in C. + +![Why and how to handle exceptions in Python Flask][1] +(Image by: Image from Unsplash.com, Creative Commons Zero) + +The [GLib Object System (GObject)][2] is a library providing a flexible and extensible object-oriented framework for C. In this article, I demonstrate using the 2.4 version of the library. + +The GObject libraries extend the ANSI C standard, with typedefs for common types such as: + +* gchar: a character type +* guchar: an unsigned character type +* gunichar: a fixed 32 bit width unichar type +* gboolean: a boolean type +* gint8, gint16, gint32, gint64: 8, 16, 32, and 64 bit integers +* guint8, guint16, guint32, guint64: unsigned 8, 16, 32, and 64 bit integers +* gfloat: an IEEE Standard 754 single precision floating point number +* gdouble: an IEEE Standard 754 double precision floating point number +* gpointer: a generic pointer type + +### Function pointers + +GObject also introduces a type and object system with classes and interfaces. This is possible because the ANSI C language understands function pointers. + +To declare a function pointer, you can do this: + +```c +void (*my_callback)(gpointer data); +``` + +But first, you need to assign the `my_callback` variable: + +```c +void my_callback_func(gpointer data) +{ +  //do something +} + +my_callback = my_callback_func; +``` + +The function pointer `my_callback` can be invoked like this: + +```c +gpointer data; +data = g_malloc(512 * sizeof(gint16)); +my_callback(data); +``` + +### Object classes + +The GObject base class consists of 2 structs (`GObject` and `GObjectClass` ) which you inherit to implement your very own objects. + +You embed GObject and GObjectClass as the first struct field: + +```c +struct _MyObject +{ +  GObject gobject; +  //your fields +}; + +struct _MyObjectClass +{ +  GObjectClass gobject; +  //your class methods +}; + +GType my_object_get_type(void); +``` + +The object’s implementation contains fields, which might be exposed as properties. GObject provides a solution to private fields, too. This is actually a struct in the C source file, instead of the header file. The class usually contains function pointers only. + +An interface can’t be derived from another interface and is implemented as following: + +```c +struct _MyInterface +{ +  GInterface ginterface; +  //your interface methods +}; +``` + +Properties are accessed by `g_object_get()` and `g_object_set()` function calls. To get a property, you must provide the return location of the specific type. It’s recommended that you initialize the return location first: + +```c +gchar *str + +str = NULL; + +g_object_get(gobject, +  "my-name", &str, +  NULL); +``` + +Or you might want to set the property: + +```c +g_object_set(gobject, +  "my-name", "Anderson", +  NULL); +``` + +### The libsoup HTTP library + +The `libsoup` project provides an HTTP client and server library for GNOME. It uses GObjects and the glib main loop to integrate with GNOME applications, and also has a synchronous API for use in command-line tools. First, create a `libsoup` session with an authentication callback specified. You can also make use of cookies. + +```c +SoupSession *soup_session; +SoupCookieJar *jar; + +soup_session = soup_session_new_with_options(SOUP_SESSION_ADD_FEATURE_BY_TYPE, SOUP_TYPE_AUTH_BASIC, +  SOUP_SESSION_ADD_FEATURE_BY_TYPE, SOUP_TYPE_AUTH_DIGEST, +  NULL); + +jar = soup_cookie_jar_text_new("cookies.txt", +  FALSE);     + +soup_session_add_feature(soup_session, jar); +g_signal_connect(soup_session, "authenticate", +  G_CALLBACK(my_authenticate_callback), NULL); +``` + +Then you can create a HTTP GET request like the following: + +```c +SoupMessage *msg; +SoupMessageHeaders *response_headers; +SoupMessageBody *response_body; +guint status; +GError *error; + +msg = soup_form_request_new("GET", +  "http://127.0.0.1:8080/my-xmlrpc", +  NULL); + +status = soup_session_send_message(soup_session, +  msg); + +response_headers = NULL; +response_body = NULL; + +g_object_get(msg, +  "response-headers", &response_headers, +  "response-body", &response_body, +  NULL); + +g_message("status %d", status); +cookie = NULL; +soup_message_headers_iter_init(&iter, +response_headers); + +while(soup_message_headers_iter_next(&iter, &name, &value)){     +  g_message("%s: %s", name, value); +} + +g_message("%s", response_body->data); +if(status == 200){ +  cookie = soup_cookies_from_response(msg); +  while(cookie != NULL){ +    char *cookie_name; +    cookie_name = soup_cookie_get_name(cookie->data); +    //parse cookies +    cookie = cookie->next; +  } +} +``` + +The authentication callback is called as the web server asks for authentication. + +Here’s a function signature: + +```c +#define MY_AUTHENTICATE_LOGIN "my-username" +#define MY_AUTHENTICATE_PASSWORD "my-password" + +void my_authenticate_callback(SoupSession *session, +  SoupMessage *msg, +  SoupAuth *auth, +  gboolean retrying, +  gpointer user_data) +{ +  g_message("authenticate: ****"); +  soup_auth_authenticate(auth, +                         MY_AUTHENTICATE_LOGIN, +                         MY_AUTHENTICATE_PASSWORD); +} +``` + +### A libsoup server + +For basic HTTP authentication to work, you must specify a callback and server context path. Then you add a handler with another callback. + +This example listens to any IPv4 address on localhost port 8080: + +```c +SoupServer *soup_server; +SoupAuthDomain *auth_domain; +GSocket *ip4_socket; +GSocketAddress *ip4_address; +MyObject *my_object; +GError *error; + +soup_server = soup_server_new(NULL); +auth_domain = soup_auth_domain_basic_new(SOUP_AUTH_DOMAIN_REALM, "my-realm", +  SOUP_AUTH_DOMAIN_BASIC_AUTH_CALLBACK, my_xmlrpc_server_auth_callback, +  SOUP_AUTH_DOMAIN_BASIC_AUTH_DATA, my_object, +  SOUP_AUTH_DOMAIN_ADD_PATH, "my-xmlrpc", +  NULL); + +soup_server_add_auth_domain(soup_server, auth_domain); +soup_server_add_handler(soup_server, +  "my-xmlrpc", +  my_xmlrpc_server_callback, +  my_object, +  NULL); + +ip4_socket = g_socket_new(G_SOCKET_FAMILY_IPV4, +  G_SOCKET_TYPE_STREAM, +  G_SOCKET_PROTOCOL_TCP, +  &error); + +ip4_address = g_inet_socket_address_new(g_inet_address_new_any(G_SOCKET_FAMILY_IPV4), +  8080); +error = NULL; +g_socket_bind(ip4_socket, +  ip4_address, +  TRUE, +  &error); +error = NULL; +g_socket_listen(ip4_socket, &error); + +error = NULL; +soup_server_listen_socket(soup_server, +  ip4_socket, 0, &error); +``` + +In this example code, there are two callbacks. One handles authentication, and the other handles the request itself. + +Suppose you want a web server to allow a login with the credentials username **my-username** and the password **my-password**, and to set a session cookie with a random unique user ID (UUID) string. + +```c +gboolean my_xmlrpc_server_auth_callback(SoupAuthDomain *domain, +  SoupMessage *msg, +  const char *username, +  const char *password, +  MyObject *my_object) +{ +  if(username == NULL || password == NULL){ +    return(FALSE); +  } + +  if(!strcmp(username, "my-username") && +     !strcmp(password, "my-password")){ +    SoupCookie *session_cookie; +    GSList *cookie; +    gchar *security_token; +    cookie = NULL; + +    security_token = g_uuid_string_random(); +    session_cookie = soup_cookie_new("my-srv-security-token", +      security_token, +      "localhost", +      "my-xmlrpc", +      -1); + +     cookie = g_slist_prepend(cookie, +       session_cookie);   +     soup_cookies_to_request(cookie, +       msg); +    return(TRUE); +  } +  return(FALSE); +} +``` + +A handler for the context path **my-xmlrpc**: + +```c +void my_xmlrpc_server_callback(SoupServer *soup_server, +  SoupMessage *msg, +  const char *path, +  GHashTable *query, +  SoupClientContext *client, +  MyObject *my_object) +{ +  GSList *cookie; +  cookie = soup_cookies_from_request(msg); +  //check cookies +} +``` + +### A more powerful C + +I hope my examples show how the GObject and libsoup projects give C a very real boost. Libraries like these extend C in a literal sense, and by doing so they make C more approachable. They do a lot of work for you, so you can turn your attention to inventing amazing applications in the simple, direct, and timeless C language. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/libsoup-gobject-c + +作者:[Joël Krähemann][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/joel2001k +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/computer_code_programming_laptop.jpg +[2]: https://docs.gtk.org/gobject/concepts.html diff --git a/sources/tech/20220506 Tails 5 Review- A Perfect Privacy-Focused Linux.md b/sources/tech/20220506 Tails 5 Review- A Perfect Privacy-Focused Linux.md new file mode 100644 index 0000000000..5f123f8045 --- /dev/null +++ b/sources/tech/20220506 Tails 5 Review- A Perfect Privacy-Focused Linux.md @@ -0,0 +1,115 @@ +[#]: subject: "Tails 5 Review: A Perfect Privacy-Focused Linux" +[#]: via: "https://www.debugpoint.com/2022/05/tails-5-review/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Tails 5 Review: A Perfect Privacy-Focused Linux +====== +Here’s a quick review of Debian-based Tails 5, released a while back, refreshing its core modules with Debian 11 Bullseye. + +Before we jump into the review of Tails 5, it’s worth mentioning what Tails are about. Tails, aka The Amnesic Incognito Live System, is a [privacy-focussed Linux Distribution][1] which uses the Tor network to protect you while browsing the web. Tails are based on Debian stable branch and come with many goodies such as an IRC client, Tor browser, email clients, and messengers to help you roam around on the web anonymously. + +![Tails 5 Desktop Running GNOME 3.38][2] + +### Tails 5 Review + +#### ISO, Installation + +Tails are available as a complete installation ISO image with an additional image capable of running from the USB drive itself. If you plan to use Tails, you should first think about your primary purpose for using Tails. And choose the ISO you want. + +I would recommend that everyone be ready with a Tails USB stick. It’s handy on many occasions. For example, if you want to be anonymous for a short time and travel with public Wi-Fi, you might want to create a bootable Thumb drive to carry. + +Both images are around 1.2GB in size and are available for download from the official website. + +Installation of Tails is a little different, and you can find the guide [here][3]. + +#### First Impression + +The first-time boot of Tails asks you to confirm the keyboard layout and language and followed by connecting to the Tor network. If you are not familiar with the Tor network, it gives two easy options. The Easier option is recommended for all users as it takes care of connecting to the Tor network with bridge setup, etc. You can also choose the “safer” option if you know what the options mean. + +Once you complete the setup, you get a nice and clean GNOME Desktop environment which comes as default with Tails with additional applications. The GNOME version for Tails 5 is GNOME 3.38.6 stable which is the pre-GNOME 40 desktop with the traditional application menu with a vertical dock and workspaces. + +You don’t need anything fancy desktop while using Tails for some critical work. GNOME 3.38x does just fine and it’s fast. + +![Tails Welcome Screen][4] + +![Tails 5 – Initial Tor Setup][5] + +#### Tor Network and Application Updates + +At its core, Tails 5 is based on [Debian 11 Bullseye][6](which is the current stable version) and [Linux Kernel 5.10][7]. + +The application list of Tails is mostly curated for privacy oriented work. The Tails application list includes the Tor Browser, Tor Connection Manager, and Onion Circuits Manager. During my test, the Tor network connected properly without any problem. + +In addition to that, this release introduces Kleopatra (replaces Seahorse) which is a Certification manager to GnuPG and helps to manage OpenPGP certificates and keys. + +One of the essential features of Tails is the persistance storage configuration which is required if you use Tails via a USB stick. Tails 5 imprves the Persistance Storage option to make it more faster and rubust in nature. + +Furthermore, the application stack in Tails 5.0 refreshed with their respective stable version according to Debian Bullseye listed below. + +* Tor Browser 11.0.11 +* GNOME 3.38.6 +* MAT 0.12 +* Audacity 2.4.2 +* GNOME Disks 3.38 +* GIMP 2.10.22 +* Inkscape 1.0 +* LibreOffice 7.0 + +Tails packages all necessary applications to help with your purpose of anonymity, and those are acihved by its specific applications as listed here. + +* Password manager – KeePassXC +* Pidgin Internet messenger +* Thunderbird Email Client +* Tor Browser and Connection Manager +* Onion Circuit manager +* Application for configuring Persistance Storage +* GtkHash checks for files +* Root Terminal + +A tool called Additional Software that Tails includes; it helps run the different applications from the local media instead of downloading them after each boot. + +#### Performance + +The performance of Tails is stable and depends on GNOME Desktop. During my test, it behaved well, no major surprises of problems. Overall desktop feel is faster considering it is still GNOME 3.38 version. + +So, during the performance test at idle, it was consuming around 4% CPU on average and memory is at 1.6 GB. It may be a little higher for an idle state, but being a privacy-focused distro, background processes, and daemon running contributed to this metric. + +Also, the network histroy shows a continuous packaet traction at an idle state which I believe is due to some daemon running continuously. + +![Tails 5 Performance shows continuous network ping][8] + +### Closing Notes + +Privacy is more important than ever today. And Tails is the best Linux distro for privacy-focused people out there. With the solid Debian stable base, GNOME desktop and [robust documentation,][9] Tails is a “go-to” distro for security researchers and advanced users. Moreover, the Tails team did an excellent job with its nicely crafted documentation which takes care of most of the problems you may face while using it. With that said, if you want to try out Tails 5, visit [this page for download][10] and read the installation [guide][11]. + +A word of caution: While using Tails, try not to visit banks or financial websites or make any transactions requiring 2FA authentication. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/tails-5-review/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/2022/04/privacy-linux-distributions-2022/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/05/Tails-5-Desktop-Running-GNOME-3.38.jpg +[3]: https://tails.boum.org/install/linux/index.en.html +[4]: https://www.debugpoint.com/wp-content/uploads/2022/05/Tails-Welcome-Screen.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/05/Tails-5-Initial-Tor-Setup.jpg +[6]: https://www.debugpoint.com/2021/05/debian-11-features/ +[7]: https://www.debugpoint.com/2020/12/linux-kernel-5-10-release-announcement/ +[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/Tails-5-Performance-shows-continuous-network-ping.jpg +[9]: https://tails.boum.org/doc/index.en.html +[10]: https://tails.boum.org/install/index.en.html +[11]: https://tails.boum.org/install/linux/index.en.html diff --git a/sources/tech/20220508 KDE Plasma 5.25- Top New Features and Release Details.md b/sources/tech/20220508 KDE Plasma 5.25- Top New Features and Release Details.md new file mode 100644 index 0000000000..824a7b32d5 --- /dev/null +++ b/sources/tech/20220508 KDE Plasma 5.25- Top New Features and Release Details.md @@ -0,0 +1,127 @@ +[#]: subject: "KDE Plasma 5.25: Top New Features and Release Details" +[#]: via: "https://www.debugpoint.com/2022/05/kde-plasma-5-25" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +KDE Plasma 5.25: Top New Features and Release Details +====== +We will give you the feature summary of the KDE Plasma 5.25 desktop environment (upcoming). + +KDE Plasma 5.25 is the 27th version of KDE Plasma desktop, not an LTS release. This release is followed by the prior [5.24 LTS][1], released in February. KDE Plasma 5.25 brings several exciting updates on the desktop UI, polished applets, widgets, a good set of gesture updates for touch-based devices and a massive list of bug fixes. Plasma 5.25 is based on Qt 5.15.2 and KDE Frameworks 5.94. + +KDE Plasma releases on June 14, 2022, but before that following milestones are to be met: + +* Soft feature freeze: May 5, 2022 (Completed) +* Beta: May 19, 2022 +* Final release: June 14, 2022 + +The list of bug fixes and features is around 400+, and it’s challenging to cover them in a single article. We filtered out in this article some of the essential and visual changes which are more impactful straightaway to the general user base. + +### KDE Plasma 5.25 – Top New Features + +#### Plasma Workspace & Desktop + +Perhaps the most important visual change in KDE Plasma 5.25 is accent colour change based on the Wallpaper. As reported earlier, this change gives the final touch to the entire accent colour functionality and makes it complete with dynamic colour, custom colour and pre-sets. The option is available in the Appearance module. ([MR#1325)][2] + +![KDE Plasma 5.25 – Accent Colour Change Based on the wallpaper][3] + +In addition, the accent colour change to the title bar was [also implemented][4] in the Breeze Classic theme and made it more consistent across the desktop. + +Another exciting change that KDE Plasma 5.25 brings is an option for Themes to make the Panel float. When selected, the Panel detaches itself from the bottom of the screen with rounded corners and gives a floating feeling. The option is available in the additional settings in Edit Panel mode. Here’s how it looks. ([MR#714)][5] + +In addition to that, the power profiles menu in the system tray now has [icons][6] with their names in the [tooltip][7]. + +The login and logout screen see a [small UI change][8] to display avatar and profile name with longer user names. + +Also, the spacing between the avatar icon and name with the logout screen action buttons is [increased][9] to give a more consistent look. + +A fix was made to the Plasma Desktop to prevent widgets from [retaining position][10]when resolution changes back from fullscreen gaming. The widgets remember their position for respective resolutions. + +The plasma Workspace module [reverts][11]to the lock screen behaviour on mouse move, which was removed accidentally earlier. + +The Digital Clock “Copy to Clipboard” menu is now [more clean][12] with the removal of duplicate items and separate entries when seconds are enabled. + +#### KWin Updates + +KWin introduces an [option to hide][13] minimised windows in KDE Plasma 5.25. In addition to that, the desktop grid effect is [completely replaced][14] with the QML Version. + +Furthermore, it is now possible to switch between display specific resolutions which are not visible to the operating system in Wayland. The change adds [libxcvt][15] dependency in Kwin, and details of this change can be found [here][16]. + +With this release, the switching between the dark and light mode is more smooth and animated thanks to this [MR][17], inspired by GNOME. It was not smooth earlier and now looks more professional behaviour. + +#### Changes in Discover + +The application page of Discover is now complete with [more focused details][18] at the top with Application metadata and images. The spacing of the app name, ratings and developer with the image at the header section with the summary in the middle. And rest at the bottom. Here’s a side by side comparison of the earlier version with 5.25. + +One tiny yet impactful change in Discover related to Flatpak apps. Discover now [shows][19] a message with an action button to clean Flatpak data for uninstalled apps. + +Moreover, Discover now [shows the required permissions][20]of the Flatpak applications before you install them. In addition, if you are planning to install proprietary software, you get a warning message saying the potential consequences of using those (such as Microsoft Teams). + +#### Application and Applet Changes + +The System Monitor (KSystemStats) shows new [information about your window system][21] whether you are running X11 or Wayland. This should also display on the overview screen of the KSysGuard. + +The Open With Dialog of XGD Portal sees a [complete UI rework][22]. The top section label is merged into one single information line for better clarity. Also, the search field is now visible for all modes, and the Show More button is moved up beside Search with better clarity. You can look at the below image (Credit KDE Team) for this change. + +The Plasma Applet for NetworkManager now [shows][23] the WiFi frequency connection nection details to help distinguish which frequency you are connected to in the same SSID (same Wi-Fi Router). It’s really helpful if both the band have the same Wifi Accent point name and you cannot distinguish between 4G or 5G. + +The cuttlefish icon viewer now helps you [open the file path via the file manager][24] directly of the selected icon. + +Plasma desktop now gives a [more organised view][25]in “Recent Documents” with the ability to show “non-file” items such as RDP or remote connections. + +Moreover, the spell checker module in KRunner now [detects][26] the search language and gives you results. + +When you run into an error, the KInfocenter now gives you [more information][27] about the error. The new design gives you what is the error, why it happened, whether you can fix it by yourself and how to report it to the devs. This is a nifty change that has a more significant impact. Here’s a side by side view of the change. + +### Closing Notes + +Along with the above changes, this release improves several gestures for touch devices and a massive list of performance and bug fixes (counting 150+), which will enhance the KDE Plasma 5.25 experience for all of its users. + +If you want to give a hand on testing, read the [contribution guide][28], and you can try the [unstable edition of KDE Neon][29] until the BETA release. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/kde-plasma-5-25 + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/2022/03/kde-plasma-5-24-review/ +[2]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1325 +[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/KDE-Plasma-5.25-Accent-Colour-Change-Based-on-wallpaper-1024x611.jpg +[4]: https://invent.kde.org/plasma/breeze/-/merge_requests/182 +[5]: https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/714 +[6]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1585 +[7]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1668 +[8]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1654 +[9]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1647 +[10]: https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/608 +[11]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1707 +[12]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1693 +[13]: https://invent.kde.org/plasma/kwin/-/merge_requests/2341 +[14]: https://invent.kde.org/plasma/kwin/-/merge_requests/2327 +[15]: https://gitlab.freedesktop.org/xorg/lib/libxcvt +[16]: https://bugs.kde.org/448398 +[17]: https://invent.kde.org/plasma/kwin/-/merge_requests/2088 +[18]: https://invent.kde.org/plasma/discover/-/merge_requests/246 +[19]: https://invent.kde.org/plasma/discover/-/merge_requests/297 +[20]: https://invent.kde.org/plasma/discover/-/merge_requests/282 +[21]: https://invent.kde.org/plasma/ksystemstats/-/merge_requests/34 +[22]: https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/94 +[23]: https://invent.kde.org/plasma/plasma-nm/-/merge_requests/112 +[24]: https://invent.kde.org/plasma/plasma-sdk/-/merge_requests/32 +[25]: https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/551 +[26]: https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/122 +[27]: https://invent.kde.org/plasma/kinfocenter/-/merge_requests/90 +[28]: https://community.kde.org/Get_Involved +[29]: https://neon.kde.org/download diff --git a/sources/tech/20220510 10 Best Features of Fedora 36 That Makes it a Powerful Release.md b/sources/tech/20220510 10 Best Features of Fedora 36 That Makes it a Powerful Release.md new file mode 100644 index 0000000000..43037d3e9f --- /dev/null +++ b/sources/tech/20220510 10 Best Features of Fedora 36 That Makes it a Powerful Release.md @@ -0,0 +1,118 @@ +[#]: subject: "10 Best Features of Fedora 36 That Makes it a Powerful Release" +[#]: via: "https://www.debugpoint.com/2022/05/fedora-36-features/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +10 Best Features of Fedora 36 That Makes it a Powerful Release +====== +If you are excited about the Fedora 36 release, here’s a quick summary of the 10 best Fedora 36 features that you should check out before trying. + +![Fedora 36 Workstation Desktop][1] + +Fedora 36 releases on May 10, 2022, and it brings a list of special features across the desktop, flavours, internal structures and more. Before installing or upgrading it, you should know about the unique features. Here they are. + +### Best Fedora 36 Features + +#### 1. GNOME 42 as Default Workstation Desktop + +The most important feature of Fedora 36 is the brand new GNOME 42, which comes as default with the Fedora Workstation edition. With the Fedora Workstation edition, you get the original GNOME 42 version without any customisation, unlike Ubuntu. Hence to experience the vanilla GNOME 42, Fedora 36 is the perfect choice for you. + +Firstly, GNOME 42 brings the modern GTK4 and libadwaita based Shell and native applications. Most native GNOME apps are already ported to GTK4, giving a revamped look with friendly UI components. You should notice the difference in every nook and corner of the desktop. + +Not only that, this version of GNOME introduces the Dark and Light Style in the Appearance section. The native applications also adapt to the light and dark styles automatically. Moreover, the wallpaper can also change based on the style, and you can create [dark and light versions of the wallpaper][2]. + +Furthermore, GNOME 42 brings a [new text editor][3], a new screenshot and screencast tool and well designed on-screen display. You may want to read the [features of GNOME 42 here in detail][4]. + +#### 2. Linux Kernel 5.17 + +In addition to that, Fedora 36 also brings the latest mainline Linux Kernel 5.17, which has support for all the modern GPU, CPU and other improvements. The updates in this Kernel include temperature support for the AMD Zen family of devices, a long-standing Floppy Disk hangs bug, a handful of ARM/SoC support and performance improvements across all subsystems. + +You can read our [detailed Linux Kernel 5.17][5] coverage to learn more. + +#### 3. Wayland by Default for NVIDIA Proprietary Drivers + +Perhaps the most impactful change in this release is the decision from Fedora to make [Wayland as default][6] session with NVIDIA proprietary driver. If you remember, Wayland was the default server since Fedora 22, but it has not defaulted when the NVIDIA proprietary driver is in use. And it changes now. So, while updating or installing an NVIDIA system, check the session type before login. + +#### 4. Systemd Messages Updates + +Other than the above changes, the systemd messages become more friendly with a small but impactful change on how the messages are logged in this release. In Fedora 36, the systemd messages show the unit name with the usual name. For example, if it shows “Network Manager”, it would now show “NetworkManager.service” and the name. This will help debug some problems in a system requiring scrolling through thousands of messages. + +![More detailed journalctl messages in Fedora 36][7] + +#### 5. System Font Changes + +On top of the above changes, the default font type is changing to Noto Font from DejaVu fonts. This will provide a better experience and consistent text rendering across the desktop. So, google-noto-sans* packages will be installed by default to replace dejavu*. + +#### 6. Updated Spins + +That’s not all the changes, the official Fedora flavours or Spins are also refreshed with their stable versions. Not all desktop environments get major releases in a year, but you always get the latest bugfix versions with Fedora. + +Here’s a quick recap of the version of the official Fedora Spins in this release. + +* Fedora KDE with KDE Plasma 5.24 +* Fedora with Xfce 4.16 +* Fedora with LXQt 1.1 +* Fedora MATE-Compiz with MATE 1.24 + +#### 7. Tool Chain Updates + +Many Fedora users are the developers who use it for their personal or professional work. For programmers or developers, the toolchain is important. Because Fedora features the latest compilers, databases and other dependent packages. Here’s a quick list of packages and applications: + +* PHP 8.1 +* Ruby on Rails 7.0 +* OpenJDK 17 +* Django 4.0 +* gcc 12 +* glibc 2.35 +* Golang 1.18 +* OpenSSL 3.0 +* Ruby 3.1 +* Ansible 5 +* Firefox 100 +* LibreOffice 7.3 + +#### 8. Single User as Admin + +The majority of the Fedora workstation installations are single-user types than the shared or enterprise users. Hence, Fedora 36 makes the single user as administrator by default during installation with this release. The Anaconda installer sets the admin option by default. + +#### 9. RPM Structure + +The internal RPM package database in the Fedora system is located under `/var` today. With this release, it is [moving][8] to `/usr` directory. The primary reason is consistency with other RPM-based distributions such as openSUSE and Fedora rpm-ostree based systems (Kinoite, Silverblue, etc.) + +#### 10. NetworkManager Configuration + +Finally, this release removes the NetworkManager legacy configuration file support (ifcfg files). This is a classic case of Fedora being a pioneer in adopting new methods, deprecating the older way of doing things. The NetworkManager evolved over the years and now uses more streamlined configuration files called keyfiles. Hence, it is no longer necessary to support the older ifcfg files for compatibility reasons. For more details about this change, visit this [excellent article][9] from Fedora Magazine. + +### Closing Notes + +In addition to the above changes, this release brings many more under the hood performance tweaks and bug fixes which you can read [here][10]. + +Fedora 36 releases on May 10, 2022. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/fedora-36-features/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/05/Fedora-36-Workstation-Desktop.jpg +[2]: https://www.debugpoint.com/2022/04/custom-light-dark-wallpaper-gnome/ +[3]: https://www.debugpoint.com/2021/12/gnome-text-editor/ +[4]: https://www.debugpoint.com/2022/03/gnome-42-release/ +[5]: https://www.debugpoint.com/2022/03/linux-kernel-5-17/ +[6]: https://www.debugpoint.com/wp-admin/.org/wiki/Changes/WaylandByDefaultOnNVIDIA +[7]: https://www.debugpoint.com/wp-content/uploads/2022/05/More-detailed-journalctl-messages-in-Fedora-36.jpg +[8]: https://fedoraproject.org/wiki/Changes/RelocateRPMToUsr +[9]: https://fedoramagazine.org/converting-networkmanager-from-ifcfg-to-keyfiles/ +[10]: https://fedoraproject.org/wiki/Releases/36/ChangeSet diff --git a/sources/tech/20220510 Easily Connect your iPhone with Linux as KDE Connect Arrives on the App Store.md b/sources/tech/20220510 Easily Connect your iPhone with Linux as KDE Connect Arrives on the App Store.md new file mode 100644 index 0000000000..d1344560db --- /dev/null +++ b/sources/tech/20220510 Easily Connect your iPhone with Linux as KDE Connect Arrives on the App Store.md @@ -0,0 +1,67 @@ +[#]: subject: "Easily Connect your iPhone with Linux as KDE Connect Arrives on the App Store" +[#]: via: "https://news.itsfoss.com/kde-connect-ios/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Easily Connect your iPhone with Linux as KDE Connect Arrives on the App Store +====== +The impressive open-source client to help connect mobiles with computers is now available for iPhones and iPad. Try it out! + +![kde connect][1] + +KDE Connect is an open-source tool that lets you connect your mobile phone with your PC. + +Originally, KDE Connect supported Android devices to connect with Linux. Gradually, they added support for Windows. + +Now, it looks like you can use KDE Connect with your iOS device (iPhone or iPad) to connect to your Windows/Linux computer. + +Note that macOS is also in the list of supported platforms. However, it is still an early release version for macOS. So, it may not work as good as it does with other platforms. + +### KDE Connect on the App Store + +![][2] + +We did not notice any official announcement for this. However, some users spotted KDE Connect being available on the [App Store for iOS users][3] right after the release of [version 0.2.1][4]. + +The App Store lists all the essential features including: + +* Shared clipboard: to copy/paste between devices. +* Ability to share files and URLs to your computer from any app. +* Use your phone screen as your computer’s touchpad (visual touchpad). +* Remote presentation remote mode. +* Run commands on your computer from your phone +* End-to-end TLS encryption for security. + +While this remains as an open-source app, the app licensing is a bit different as spotted by [OMGUbuntu][5] to comply with App Store guidelines. + +It is also worth noting that the feature set may not be the same as its Android counterpart, but at least we finally have KDE Connect for iOS users, making it a truly open-source cross-plaform solution to connect mobiles with computers. + +I’d be comfortable recommending KDE Connect to anyone who wants to keep things in check with their mobile through computers. + +Head to the app store from the button below to get started installing it. You can also find various other installation options for different supported platforms on its [official download page][6]. + +Have you tried KDE Connect on iOS yet? Let me know your thoughts in the comments. + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kde-connect-ios/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/kde-connect-on-iphone-ipad.jpg +[2]: https://news.itsfoss.com/wp-content/uploads/2022/05/kde-connect-ios.jpg +[3]: https://apps.apple.com/id/app/kde-connect/id1580245991 +[4]: https://invent.kde.org/network/kdeconnect-ios/-/commit/43d2ecbbb7e4e70274849f5ec987721318eb9f57 +[5]: https://www.omgubuntu.co.uk/2022/05/kde-connect-iphone-app-available +[6]: https://kdeconnect.kde.org/download.html diff --git a/sources/tech/20220510 Fedora 35 v Fedora 36- What-s the Difference-.md b/sources/tech/20220510 Fedora 35 v Fedora 36- What-s the Difference-.md new file mode 100644 index 0000000000..92644e25b3 --- /dev/null +++ b/sources/tech/20220510 Fedora 35 v Fedora 36- What-s the Difference-.md @@ -0,0 +1,207 @@ +[#]: subject: "Fedora 35 v Fedora 36: What’s the Difference?" +[#]: via: "https://news.itsfoss.com/fedora-35-v-fedora-36/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Fedora 35 v Fedora 36: What’s the Difference? +====== +Fedora 36 is here. It’s a significant upgrade. So, what’s different from Fedora 35? Should you upgrade now? Let’s take a look. + +![fedora comparison][1] + +Fedora 36 is an impressive release with a [list of interesting feature upgrades][2]. + +While Fedora 35 included GNOME 41 and [debuted with a new KDE variant][3] (Fedora Kinoite) and several other technical changes, Fedora 36 is another interesting upgrade. + +Fedora 36 packs in GNOME 42 with new feature additions, and some usual technical improvements. + +What’s different between the two releases? + +Here, we shall be focusing on the key changes considering the desktop user experience along with some technical differences. + +#### 1. Support Lifespan + +If you are reading this when we published this article, you still have the time to continue using Fedora 35 or upgrade to Fedora 36. + +Fedora 35 will be supported until **November 2022**. Typically, every Fedora release gets support for 13 months. + +So, you can expect Fedora 36 to be maintained until **June 2023**. + +#### 2. Desktop Environment Choices + +The primary offering for Fedora 35 features GNOME 41, and Fedora 36 comes with GNOME 42. + +In addition to its GNOME editions, you can also find KDE and LXQt versions as other popular variants. + +With Fedora 35, you get the option to use KDE Plasma 5.22 or LXQt 0.17. + +And, with Fedora 36, you can find KDE Plasma 5.24 and LXQt 1.0 as your options. + +#### 3. Wayland by Default for Nvidia + +With Fedora 35, you already had Wayland by default for desktop sessions (initially introduced with Fedora 34), excluding proprietary Nvidia drivers. + +Now, with Fedora 36, if you use a proprietary Nvidia driver, the GDM sessions will use Wayland by default. + +#### 4. Wallpapers + +Fedora always features some kind of artistic/creative wallpaper. You can see the default wallpaper difference in action here: + +![][4] + +![][5] + +In addition to the default, Fedora 36 also comes with a newer collection of wallpapers. + +Fedora 36 also includes dark/light variants of the wallpapers to blend in with the new dark mode theme preference. + +![][6] + +![][7] + +#### 5. Appearance Menu & Dark Theme + +Thanks to GNOME 42, Fedora 36 now features a new Appearance option in the system settings that lets you switch to a system-wide dark/light theme. + +![Fedora 36 (Appearance menu)][8] + +With Fedora 35, you did not have any options to enable a dark theme, which was a bummer at the time. + +And, as mentioned previously, with the theme preferences, the background also changes automatically. + +#### 6. Settings Menu + +![][9] + +![][10] + +Fedora 36 received an upgrade to the settings menu with new options, dark mode support, and subtle changes to the look with an enhanced GNOME experience. + +#### 7. Login and Lockscreen + +You will also notice differences in the login screen with a darker default avatar ditching the red icon, making them look cleaner. + +![][11] + +![][12] + +While I mention the details for the font changes later in the article, the lock screen lets you notice that significantly with the change in font size for the clock/time in the lock screen. + +Of course, the blur effect for the background remains in both. + +![][13] + +![][14] + +#### 7. Linux Kernel + +Fedora releases always include the latest and greatest Linux Kernel available. So, if you’re using the up-to-date version of Fedora 35/46, you will be getting the same Linux Kernel. + +With Fedora 36, you get [Linux Kernel 5.17][15] out of the box which comes with a range of next-gen hardware support and improvements. + +And, Fedora 35 featured Linux Kernel 5.14, but now you can find Linux Kernel 5.17. + +#### 8. Screenshot UI + +Yet another exciting [feature upgrade in GNOME 42][16]. The screenshot user interface is entirely different in Fedora 36 with an added ability to record the screen. + +![][17] + +![][18] + +In Fedora 35, you can take screenshots similarly using the GNOME Screenshot app, but it does not have an integrated screen recording feature. + +In addition to this, on Fedora 36, you get the ability to take a screenshot when you perform a right-click on the title bar of a window. + +![Fedora 36][19] + +You don’t get to see this feature on Fedora 35. + +#### 9. File Manager + +File Manager isn’t functionally different. However, with the user interface overhaul, icon changes, and improvements, Fedora 36 features a snappier file manager overall. + +![][20] + +![][21] + +I never liked the icon theme on Fedora 35. So, that’s a pretty good upgrade for users like me. + +Of course, you can always look for [GTK icon themes][22] to personalize the experience. + +#### 10. Software Center + +![Software Center on Fedora 36][23] + +The software center has received improvements in Fedora 36 for its user experience and being more responsive to different screen resolutions. + +You get all the essential details when comes to an app you select to view/install on Fedora, 35 and 36. Hence, the difference is limited to the overall UI and UX. + +![Software Center on Fedora 35][24] + +#### 11. Default Font Changes + +Fedora 35 relies on multiple fonts for various languages. By default, it uses the DejaVu font, however, when you select a different language like Chinese, Japanese, Korean, etc, it has other defaults. + +So, to make things consistent, Fedora 36 is making **Noto Fonts** the default, which supports various languages, and are generally higher quality fonts. + +#### 12. Technical Changes + +If you are looking to explore all the details, the official changelog would be better. However, to highlight a few important things, these are some of the noteworthy upgrades in Fedora 36: + +* Golang 1.18 +* Ruby 3.1 +* GNOME Text Editor replacing Gedit +* Subtle changes to the terminal application + +### Wrapping Up + +Unlike Ubuntu LTS releases (for instance, [20.04 vs 22.04][25]), when it comes to Fedora, you do have some time to upgrade, but you will have to eventually upgrade to keep getting updates/security fixes. + +If you do not like the changes with newer Fedora releases, you may want to try Ubuntu or switch to an Arch Linux distro like [Manjaro][26]. + +*What do you think about the latest Fedora 36 release? Let us know your thoughts in the comments below.* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/fedora-35-v-fedora-36/ + +作者:[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/04/fedora-35-vs-fedora-36.jpg +[2]: https://news.itsfoss.com/fedora-36-release-date-features/ +[3]: https://news.itsfoss.com/fedora-35-release/ +[4]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-35-wallpaper.jpg +[5]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-36-wallpaper.jpg +[6]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-35-wallpaper-collection.jpg +[7]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-36-wallpaper-collection.jpg +[8]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-36-appearance.png +[9]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-35-settings.jpg +[10]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-36-settings.png +[11]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-35-login.jpg +[12]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-36-login.jpg +[13]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-35-lockscreen.jpg +[14]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-36-lockscreen.jpg +[15]: https://news.itsfoss.com/linux-kernel-5-17-release/ +[16]: https://news.itsfoss.com/gnome-42-features/ +[17]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-35-screenshot.jpg +[18]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-36-screenshot-ui.jpg +[19]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-36-take-screenshot.jpg +[20]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-35-file-manager.png +[21]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-36-file-manager.png +[22]: https://itsfoss.com/best-gtk-themes/ +[23]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-36-software-center.png +[24]: https://news.itsfoss.com/wp-content/uploads/2022/04/fedora-35-software-center.png +[25]: https://itsfoss.com/ubuntu-20-04-vs-22-04/ +[26]: https://news.itsfoss.com/manjaro-linux-experience/ diff --git a/sources/tech/20220510 How to (safely) read user input with the getline function.md b/sources/tech/20220510 How to (safely) read user input with the getline function.md new file mode 100644 index 0000000000..46f51fe62c --- /dev/null +++ b/sources/tech/20220510 How to (safely) read user input with the getline function.md @@ -0,0 +1,176 @@ +[#]: subject: "How to (safely) read user input with the getline function" +[#]: via: "https://opensource.com/article/22/5/safely-read-user-input-getline" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to (safely) read user input with the getline function +====== +Getline offers a more flexible way to read user data into your program without breaking the system. + +![Woman using laptop concentrating][1] +(Image by Mapbox Uncharted ERG, [CC-BY 3.0 US][2]) + +Reading strings in C used to be a very dangerous thing to do. When reading input from the user, programmers might be tempted to use the `gets` function from the C Standard Library. The usage for `gets` is simple enough: + +`char *gets(char *string);` + +That is, `gets` reads data from standard input, and stores the result in a string variable. Using `gets` returns a pointer to the string, or the value NULL if nothing was read. + +As a simple example, we might ask the user a question and read the result into a string: + +```c +#include +#include + +int main() +{ +  char city[10]; // Such as "Chicago" + +  // this is bad .. please don't use gets + +  puts("Where do you live?"); +  gets(city); + +  printf("<%s> is length %ld\n", city, strlen(city)); + +  return 0; +} +``` + +Entering a relatively short value with the above program works well enough: + +``` +Where do you live? +Chicago + is length 7 +``` + +However, the `gets` function is very simple, and will naively read data until it thinks the user is finished. But `gets` doesn't check that the string is long enough to hold the user's input. Entering a very long value will cause `gets` to store more data than the string variable can hold, resulting in overwriting other parts of memory. + +``` +Where do you live? +Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch + is length 58 +Segmentation fault (core dumped) +``` + +At best, overwriting parts of memory simply breaks the program. At worst, this introduces a critical security bug where a bad user can insert arbitrary data into the computer's memory via your program. + +That's why the `gets` function is dangerous to use in a program. Using `gets`, you have no control over how much data your program attempts to read from the user. This often leads to buffer overflow. + +The `fgets` function has historically been the recommended way to read strings safely. This version of `gets` provides a safety check by only reading up to a certain number of characters, passed as a function argument: + +`char *fgets(char *string, int size, FILE *stream);` + +The `fgets` function reads from the file pointer, and stores data into a string variable, but only up to the length indicated by `size`. We can test this by updating our sample program to use `fgets` instead of `gets` : + +```c +#include +#include + +int main() +{ + char city[10]; // Such as "Chicago" + + puts("Where do you live?"); + + // fgets is better but not perfect + fgets(city, 10, stdin); + + printf("<%s> is length %ld\n", city, strlen(city)); + + return 0; +} +``` + +If you compile and run this program, you can enter an arbitrarily long city name at the prompt. However, the program will only read enough data to fit into a string variable of `size` =10. And because C adds a null (‘\0') character to the ends of strings, that means`fgets` will only read 9 characters into the string: + +``` +Where do you live? +Minneapolis + is length 9 +``` + +While this is certainly safer than using `fgets` to read user input, it does so at the cost of "cutting off" your user's input if it is too long. + +A more flexible solution to reading long data is to allow the string-reading function to allocate more memory to the string, if the user entered more data than the variable might hold. By resizing the string variable as necessary, the program always has enough room to store the user's input. + +The `getline` function does exactly that. This function reads input from an input stream, such as the keyboard or a file, and stores the data in a string variable. But unlike `fgets` and `gets`, `getline` resizes the string with `realloc` to ensure there is enough memory to store the complete input. + +`ssize_t getline(char **pstring, size_t *size, FILE *stream);` + +The`getline` is actually a wrapper to a similar function called `getdelim` that reads data up to a special delimiter character. In this case, `getline` uses a newline ('\n') as the delimiter, because when reading user input either from the keyboard or from a file, lines of data are separated by a newline character. + +The result is a much safer method to read arbitrary data, one line at a time. To use `getline`, define a string pointer and set it to NULL to indicate no memory has been set aside yet. Also define a "string size" variable of type `size_t` and give it a zero value. When you call `getline`, you'll use pointers to both the string and the string size variables, and indicate where to read data. For a sample program, we can read from the standard input: + +```c +#include +#include +#include + +int main() +{ +  char *string = NULL; +  size_t size = 0; +  ssize_t chars_read; + +  // read a long string with getline + +  puts("Enter a really long string:"); + +  chars_read = getline(&string, &size, stdin); +  printf("getline returned %ld\n", chars_read); + +  // check for errors + +  if (chars_read < 0) { +    puts("couldn't read the input"); +    free(string); +    return 1; +  } + +  // print the string + +  printf("<%s> is length %ld\n", string, strlen(string)); + +  // free the memory used by string + +  free(string); + +  return 0; +} +``` + +As the `getline` reads data, it will automatically reallocate more memory for the string variable as needed. When the function has read all the data from one line, it updates the size of the string via the pointer, and returns the number of characters read, including the delimiter. + +``` +Enter a really long string: +Supercalifragilisticexpialidocious +getline returned 35 + is length 35 +``` + +Note that the string includes the delimiter character. For `getline`, the delimiter is the newline, which is why the output has a line feed in there. If you don't want the delimiter in your string value, you can use another function to change the delimiter to a null character in the string. + +With`getline`, programmers can safely avoid one of the common pitfalls of C programming. You can never tell what data your user might try to enter, which is why using `gets` is unsafe, and `fgets` is awkward. Instead, `getline` offers a more flexible way to read user data into your program without breaking the system. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/safely-read-user-input-getline + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png +[2]: https://creativecommons.org/licenses/by/3.0/us/ diff --git a/sources/tech/20220510 How to Upgrade to Fedora 36 from Fedora 35 Workstation (GUI and CLI Method).md b/sources/tech/20220510 How to Upgrade to Fedora 36 from Fedora 35 Workstation (GUI and CLI Method).md new file mode 100644 index 0000000000..b76c19242f --- /dev/null +++ b/sources/tech/20220510 How to Upgrade to Fedora 36 from Fedora 35 Workstation (GUI and CLI Method).md @@ -0,0 +1,132 @@ +[#]: subject: "How to Upgrade to Fedora 36 from Fedora 35 Workstation (GUI and CLI Method)" +[#]: via: "https://www.debugpoint.com/2022/05/upgrade-fedora-36-from-fedora-35/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Upgrade to Fedora 36 from Fedora 35 Workstation (GUI and CLI Method) +====== +Complete steps to upgrade to fedora 36 from fedora 35 workstation edition with gui and cli method. + +Fedora 36 brings several important features such as the beautiful GNOME 42, Linux Kernel 5.17, default font changes and many stunning features. Moreover, Fedora 36 also brings Wayland display server as the default NVIDIA proprietary driver. Plus several other significant changes that Fedora 36 brings, which you can read here in our [top 10 feature coverage][1]. + +If you plan to upgrade to Fedora 36 from Fedora 35 workstation edition, here are the steps you need to perform. + +![Fedora 36 Workstation Desktop][2] + +### Upgrade to Fedora 36 + +There are two methods to upgrade to Fedora 36 workstation. The first is the command line method (CLI), and the second is the GUI method which is completely graphical. We will cover both ways in this guide. + +However, before you get excited to upgrade, there is some housekeeping that you should do. + +#### Steps to Follow before upgrading to Fedora 36 + +Firstly, Open GNOME Software and check for any pending updates. Or, open a terminal and run the following command to ensure that your system is up-to-date. + +``` + sudo dnf update +``` + +After the above command is complete, reboot your system to ensure all the updates are applied. + +Secondly, take backups of your important documents such as pictures, docs or videos from your home directory to a safe place (perhaps a separate partition or USB stick). The Fedora upgrade process never fails, but if you use NVIDIA or any specific hardware with a dual boot system, I recommend you take backups. + +Third, install the [Extensions Flatpak application][3] and disable all the GNOME Extensions (for the GNOME desktop). The primary reason is not all the extensions are ported yet to GNOME 42. Hence it is safe to disable all of them before upgrading. And you can enable them later after you complete the upgrade process. + +Moreover, glance over the [Fedora 36 common bugs page][4] and the [forum][5] for any ongoing major bugs which may impact the upgrade process. Don’t spend much time on this. + +Finally, the upgrade process takes some time (in hours), so ensure you have sufficient time and a stable internet connection. + +#### How to Upgrade to Fedora 36 Workstation + +##### Graphical Method (GUI) + +After the official release of Fedora 36, you should see a prompt in GNOME Software showing that an upgrade is available. If you do not see any prompt, don’t worry. Wait for a day or two, and you should have it. + +Also, you can visit the Updates tab in GNOME Software and see if it is available. + +Click on the notification and hit Download to start the upgrade process. The upgrader will download the required packages and prompt you to restart. Hit restart to continue the upgrade process. + +Fedora will apply the upgrades during reboot. + +##### Command-Line method (CLI) + +Firstly, you can follow the below steps, even if Fedora 36 is not yet released. And you can follow the same steps after the official release. + +If you are comfortable with the command line, you can use the dnf upgrade command to perform the upgrade process. + +Open up the terminal and run the below command: + +``` + sudo dnf upgrade --refresh +``` + +This command will refresh the packages for the new upgrade stream to get ready for Fedora 36. + +Next, install the dnf upgrade plugin by running the below command. This is required for the upgrade process. + +``` + sudo dnf install dnf-plugin-system-upgrade +``` + +Make sure your system is up-to-date by running the below command and installing any necessary pending updates. Do it once again (if you have done it via pre-upgrade steps) + +``` + sudo dnf --refresh upgrade +``` + +Initiate the download process by running the below command. This command will fetch all required packages and save them locally before the upgrade. + +``` + sudo dnf system-upgrade download --releasever=36 +``` + +If you installed many packages and applications manually and are unsure whether they are correctly supported by Fedora 36, run the above command with “–allowerasing” flag. When you provide this, dnf will remove the packages that are blockers for your system upgrade. + +The above command displays what will be replaced, updated, upgraded, or downgraded. Carefully glance through the list if you want to review the list. Or, you can check the red-marked items and start the upgrade process—something like below. + +![Fedora 36 upgrade via CLI][6] + +![Review the RED marked items][7] + +![Start the Fedora 36 Upgrade from CLI][8] + +Remember, the download size ideally is in GB, so that it might take some time based on your internet speed. + +After the above command is complete, run the below command to start the upgrade. + +``` + sudo dnf system-upgrade reboot +``` + +The system will reboot automatically and wait until the entire upgrade process completes. As I mentioned earlier, this might take time in terms of hours, depending on your system hardware. Hence be patient. + +You will be greeted with a brand new Fedora 36 system if all goes well. + +Good luck! 🤞 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/upgrade-fedora-36-from-fedora-35/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/2021/04/fedora-34-features/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/05/Fedora-36-Workstation-Desktop2.jpg +[3]: https://flathub.org/apps/details/org.gnome.Extensions +[4]: https://fedoraproject.org/wiki/Common_F36_bugs +[5]: https://ask.fedoraproject.org/tags/c/common-issues/141/none/f36/l/latest +[6]: https://www.debugpoint.com/wp-content/uploads/2022/05/Fedora-36-upgrade-via-CLI.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/05/Review-the-RED-marked-items.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/Start-the-Fedora-36-Upgrade-from-CLI.jpg diff --git a/sources/tech/20220510 What-s new in Fedora Workstation 36.md b/sources/tech/20220510 What-s new in Fedora Workstation 36.md new file mode 100644 index 0000000000..21009fdd62 --- /dev/null +++ b/sources/tech/20220510 What-s new in Fedora Workstation 36.md @@ -0,0 +1,104 @@ +[#]: subject: "What’s new in Fedora Workstation 36" +[#]: via: "https://fedoramagazine.org/whats-new-fedora-36-workstation/" +[#]: author: "Merlin Cooper https://fedoramagazine.org/author/mxanthropocene/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What’s new in Fedora Workstation 36 +====== + +![][1] + +The latest release of Fedora Workstation 36 continues the Fedora Project’s ongoing commitment to delivering the latest innovations in the open source world. This article describes some of the notable user-facing changes that appear in this version. + +### GNOME 42 + +Fedora Workstation 36 includes the latest version of the GNOME desktop environment. GNOME 42 includes many improvements and new features. Just some of the improvements include: + +* Significantly improved input handling, resulting in lower input latency and improved responsiveness when the system is under load. This is particularly beneficial for games and graphics applications. +* The Wayland session is now the default for those who use Nvidia’s proprietary graphics driver. +* A universal dark mode is now available. +* A new interface has been added for taking screenshots and screen video recordings. + +In addition, many of the core apps have been ported to GTK 4, and the shell features a number of subtle refinements. + +#### Refreshed look and feel + +![GNOME 42 as featured in Fedora Workstation 36][2] + +GNOME Shell features a refreshed look and feel, with rounder and more clearly separated elements throughout. All the symbolic icons have been updated and the top bar is no longer rounded. + +#### Universal dark mode option + +In Settings > Appearance, you can now choose a dark mode option which applies a dark theme to all supported applications. In addition, the pre-installed wallpapers now include dark mode variants. Dark themes can help reduce eye-strain when there is low ambient light, can help conserve battery life on devices with OLED displays, and can reduce the risk of burn-in on OLED displays. Plus, it looks cool! + +#### New screenshot interface + +![Taking screenshots and screen video recordings is now easier than ever][3] + +Previously, pressing the Print Screen key simply took a screenshot of the entire screen and saved it to the Pictures folder. If you wanted to customize your screenshots, you had to remember a keyboard shortcut, or manually open the Screenshots app and use that to take the screenshot you wanted. This was inconvenient. + +Now, pressing Print Screen presents you with an all-new user interface that allows you to take a screenshot of either your entire screen, just one window, or a rectangular selection. You can also choose whether to hide or show the mouse pointer, and you can also now take a screen video recording from within the new interface. + +#### Core applications + +![Apps made in GTK 4 + libadwaita feature a distinct visual style][4] + +GNOME’s core applications have seen a number of improvements. A number of them have been ported to GTK 4 and use libadwaita, a new widget library that implements GNOME’s Human Interface Guidelines. + +* Files now includes the ability to sort files by creation date, and includes some visual refinements, such as a tweaked headerbar design and file renaming interface. +* The Software app now includes a more informative update interface, and more prominently features GNOME Circle apps. +* The Settings app now has a more visually appealing interface matching the visual tweaks present throughout GNOME Shell. +* Text Editor replaces Gedit by default. Text Editor is an all-new app built in GTK 4 and libadwaita. You can always reinstall Gedit by searching for it in the Software app. + +#### Wayland support on Nvidia’s proprietary graphics driver + +In previous versions, Fedora Workstation defaulted to the X display server when using Nvidia’s proprietary graphics driver – now, Fedora Workstation 36 uses the Wayland session by default when using Nvidia’s proprietary graphics driver. + +If you experience issues with the Wayland session, you can always switch back to the Xorg session by clicking the gear icon at the bottom-right corner of the login screen and choosing “GNOME on Xorg”. + +### Under-the-hood changes throughout Fedora Linux 36 + +* When installing or upgrading packages with DNF or PackageKit, weak dependencies that have been manually removed will no longer be reinstalled. That is to say: if _foo_ is installed and it has _bar_ as a weak dependency, and _bar_ is then removed, _bar_ will not be reinstalled when _foo_ is updated. +* The Noto fonts are now used by default for many languages. This provides greater coverage for different character sets. For users who write in the Malayalam script, the new Meera and RIT Rachana fonts are now the default. +* systemd messages now include unit names by default rather than just the description, making troubleshooting easier. + +![systemd messages shows unit names by default][5] + +### Upgrade now! + +You can upgrade your system through GNOME Software, via _[dnf system-upgrade][6]_ in the terminal, or [download the live ISO image][7] from the official website. + +### Also check out… + +There are always cool things happening in the Fedora Project! + +* The social links in the upper right corner on Fedora Magazine now include our official [Fedora YouTube prescence][8], [Fedora Matrix homeserver][9], and the [Fedora Discussion][10] website! +* Fedora Discussion has been lightly renovated! Come and chat with us! ☺️ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/whats-new-fedora-36-workstation/ + +作者:[Merlin Cooper][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/mxanthropocene/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2022/04/fedora36workstation-816x345.jpg +[2]: https://fedoramagazine.org/wp-content/uploads/2022/03/fw36-1-1024x640.png +[3]: https://fedoramagazine.org/wp-content/uploads/2022/03/scrui.png +[4]: https://fedoramagazine.org/wp-content/uploads/2022/03/libadwaitat-1024x633.png +[5]: https://fedoramagazine.org/wp-content/uploads/2022/03/systemdmsg.png +[6]: https://docs.fedoraproject.org/en-US/quick-docs/dnf-system-upgrade/ +[7]: https://getfedora.org/en/workstation/download/ +[8]: https://www.youtube.com/channel/UCnIfca4LPFVn8-FjpPVc1ow +[9]: https://chat.fedoraproject.org/#/welcome +[10]: https://discussion.fedoraproject.org/ diff --git a/sources/tech/20220511 10 Things to Do After Installing Fedora 36 Workstation [With Bonus Tip].md b/sources/tech/20220511 10 Things to Do After Installing Fedora 36 Workstation [With Bonus Tip].md new file mode 100644 index 0000000000..eeba2703bc --- /dev/null +++ b/sources/tech/20220511 10 Things to Do After Installing Fedora 36 Workstation [With Bonus Tip].md @@ -0,0 +1,214 @@ +[#]: subject: "10 Things to Do After Installing Fedora 36 Workstation [With Bonus Tip]" +[#]: via: "https://www.debugpoint.com/2022/05/10-things-to-do-fedora-36-after-install/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +10 Things to Do After Installing Fedora 36 Workstation [With Bonus Tip] +====== +I am sure you have already updated or installed Fedora 36 Workstation Edition. With that said, here’s our traditional article – “10 Things to Do After Installing Fedora 36”, to give you some post-install tweak ideas. + +This guide is primarily for the Fedora 36 Workstation edition, i.e., GNOME Desktop. Because it is the default version and the most popular in terms of the user base. Hence, to make yourself more productive and tweak the entire desktop in the best possible way, here are the 10 things you can do after installing Fedora 36 Workstation Edition (GNOME). + +### 10 Things to Do After Installing Fedora 36 Workstation + +#### 1. Update DNF Configuration + +Before you make any updates or changes in your system, it’s worth checking the dnf package manager configuration file for existing settings. The DNF is the default package manager (like apt) for Fedora Linux. + +If you are a long time Fedora Linux user, you may know that dnf package downloads are sometimes slower despite having high-speed internet. + +You can use the max_parallel_downloads option, among other tricks, in the /etc/dnf/dnf.conf file to make it faster. + +This option takes a number (from 3 to 20) as its value which you specify in the file, and that many numbers of packages can be downloaded parallelly using dnf. + +``` +sudo gnome-text-editor /etc/dnf/dnf.conf +``` + +``` +max_parallel_downloads=10 +``` + +Open the config file using any text editor and add the below line. + +After the update, your file should look like the one below. Save and close the file. + +#### 2. Update your system + +After you make the above changes and perform any other work, it’s always a good idea to update your system to ensure all the latest packages are downloaded and installed. You can open the Software application and go to the Updates Tab. Or, open a terminal and use the following command to update your system. + +``` +sudo dnf update +``` + +``` +sudo dnf upgrade +``` + +![dnf update][1] + +#### 3. Firmware Updates + +If your hardware manufacturer supports a special firmware package for Linux, you can quickly check them and get those updates via the following sequence of commands. However, it may not always be available, but it is worth trying. + +``` +sudo fwupdmgr refresh --forcesudo fwupdmgr get-updatessudo fwupdmgr update +``` + +#### 4. Change Touchpad settings + +If you are a Laptop user, check whether the “Tap to Click” option is enabled in the settings. Open the Settings application, navigate to the “Mouse and Touchpad” tab and verify. + +#### 5. Enable RPM Fusion + +The RPM Fusion library is a set of packages and applications provided by the community. For example, DVD or media codecs, etc. The Official Fedora repo does not offer them because of proprietary in nature. You can read our complete guide here to [enable RPM Fusion in Fedora][2]. Or, run the following commands in sequence to make it available for Fedora 36. + +``` +sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm +``` + +``` +sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm +``` + +After the above commands are complete, run the following to update your system. + +``` +sudo dnf upgrade --refreshsudo dnf groupupdate core +``` + +#### 6. Install GNOME Tweaks + +The GNOME Tweaks is the essential application for Fedora 36 Workstation. It helps you to manage many areas of your GNOME desktop. After installation, you can launch it via the application menu. To install, run the following commands from the terminal. + +``` +sudo dnf install gnome-tweak-tool +``` + +#### 7. Enable Flatpak and Install Extensions + +The more we are moving ahead with the adaptation of sandboxing of applications, Flatpak is becoming more and more essential on the Linux desktop. Arguably, Flatpak performs better and is widely adopted compared to Snap. + +Hence, you should enable Flatpak beforehand as you continue to make your system productive. + +Open a terminal and run the below command to enable Flatpak. + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +Then you can check out several applications available in [Flathub][3] to install. + +However, one particular application that we recommend installing via Flathub is “[Extensions][4]“. This application helps you manage all the installed GNOME Extensions in your system. You can enable/disable them, launch settings of individual extensions and many such housekeeping tasks related to extensions. To install, open a terminal and run the below command. Once completed, you can launch the Extension application from the application menu. + +``` +flatpak install flathub org.gnome.Extensions +``` + +Alternatively, another application, “[Extension Manager][5]“, gives you some additional settings, and you may also try that via the below command. + +``` +flatpak install flathub com.mattjakeman.ExtensionManager +``` + +#### 8. Enable GNOME Extensions + +Since we are talking about extensions, you need to set up your system before you install them. Open a terminal and run the below command to install the plugin to enable the hook to install extensions via the Firefox web browser. + +``` +sudo dnf install chrome-gnome-shell +``` + +Then open Firefox, and [visit this page][6]. And at the top, click on “install browser extension” and Continue. + +![Add Browser Add-on for GNOME Shell Extension][7] + +#### 9. Install these recommended GNOME Extensions + +There are hundreds of GNOME Extensions available for various needs on the [official website][8]. However, here’s a curated list that we think should be installed by everyone while using Fedora 36 with the latest GNOME 42 desktop. + +**Dash to Dock** (for COSMIC): Convert the bottom dock to a fully functional application dock with features such as autohide, extend to edges, move around and always show. + +**GSConnet**: Install this extension if you want to get notification and SMS alerts from your Android mobile phone to the GNOME desktop. This is an alternative to KDE Connect for GNOME Desktop. + +**Just Perfection**: This extension helps you make any changes to your GNOME Shell. You can change the visibility of almost all components of GNOME Shell, behaviour tweaks and customise panels, and more. + +[Blur My Shell:][9]The default GNOME activities background is grey while showing the wallpaper of the workspaces. This extension makes your background wallpaper blur and gives a nice blurry drop shadow to the workspaces. And it comes with many other options as well. + +[Net Speed Simplified:][10]This extension shows the data transfer speed of your active network as upload/download speed right at the top panel. + +#### 10. Install Recommended Applications + +The default GNOME Desktop brings very minimal required applications. They are not sufficient for a functioning and productive desktop. Hence, here’s a quick list of commands with essential applications that you can install, including a media player, torrent client, image editor, and more. + +Copy and paste these into the terminal to install. + +``` +sudo dnf install -y vlcsudo dnf install -y steamsudo dnf install -y transmissionsudo dnf install -y gimpsudo dnf install -y gearysudo dnf install -y dropbox nautilus-dropboxsudo dnf install -y unzip p7zip p7zip-plugins unrar +``` + +If you prefer Flatpaks, here’s the command for that. + +``` +flatpak install flathub org.videolan.VLCflatpak install flathub com.valvesoftware.Steamflatpak install flathub com.transmissionbt.Transmissionflatpak install flathub org.gimp.GIMPflatpak install flathub org.gnome.Gearyflatpak install flathub com.dropbox.Client +``` + +### Bonus Tip(s) + +And finally, here are three bonus tips exclusively for you. + +#### Enable Battery percentage + +If you want to view the battery percentage at the system tray, run the following command to show it via settings. + +``` +gsettings set org.gnome.desktop.interface show-battery-percentage true +``` + +#### Install nice looking fonts + +GNOME desktop’s default font on Fedora 36 is perfect. But if you crave more, here are some of the cool fonts you can install. After installation, you can use GNOME Tweak Tool to change. + +``` +sudo dnf install -y 'google-roboto*' 'mozilla-fira*' fira-code-fonts +``` + +#### TLP + +Last but not least, you should install TLP if you are a Laptop user. TLP is a great utility to help optimise your Laptop’s battery. This utility comes with various command-line options to tweak and view reports about power consumption. All you need to do is install and forget it. It takes care of the basic power-saving optimisations. + +``` +sudo dnf install tlp tlp-rdw +``` + +### Closing Notes + +I hope you enjoyed reading these tips and applied some of them. So, what is your favourite must-do post-install tip? Let me know in the comment box down below! + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/10-things-to-do-fedora-36-after-install/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2020/10/dnf-update.png +[2]: https://www.debugpoint.com/2020/07/enable-rpm-fusion-fedora-rhel-centos/ +[3]: https://flathub.org/ +[4]: https://flathub.org/apps/details/org.gnome.Extensions +[5]: https://flathub.org/apps/details/com.mattjakeman.ExtensionManager +[6]: https://extensions.gnome.org/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/03/Add-Browser-Add-on-for-GNOME-Shell-Extension.jpg +[8]: https://extensions.gnome.org/ +[9]: https://extensions.gnome.org/extension/3193/blur-my-shell/ +[10]: https://extensions.gnome.org/extension/3724/net-speed-simplified/ diff --git a/sources/tech/20220511 5 surprising things I do with Linux.md b/sources/tech/20220511 5 surprising things I do with Linux.md new file mode 100644 index 0000000000..92c3e120ee --- /dev/null +++ b/sources/tech/20220511 5 surprising things I do with Linux.md @@ -0,0 +1,117 @@ +[#]: subject: "5 surprising things I do with Linux" +[#]: via: "https://opensource.com/article/22/5/surprising-things-i-do-linux" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +5 surprising things I do with Linux +====== +Linux powers most of the internet, most of the cloud, and nearly all supercomputers. I also love to use Linux for gaming, office work, and my creative pursuits. + +![Penguins gathered together in the Artic][1] +Image by: Opensource.com + +When you're used to one operating system, it can be easy to look at other operating systems almost as if they were apps. If you use one OS on your desktop, you might think of another OS as the app that people use to run servers, and another OS as the app that plays games, and so on. We sometimes forget that an operating system is the part of a computer that manages a countless number of tasks (millions per second, technically), and they're usually designed to be capable of a diverse set of tasks. When people ask me what Linux *does*, I usually ask what they *want* it to do. There's no single answer, so here are five surprising things I do with Linux. + +### 1. Laser cutting with Linux + +![Blueprint by MSRaynsford][2] +Image by: MSRaynsford, CC BY-NC 4.0 + +At my nearest makerspace, there's a big industrial machine, about the size of a sofa, that slices through all kinds of materials according to a simple line-drawing design file. It's a powerful laser cutter, and I the first time I used it I was surprised to find that it just connected to my Linux laptop with a USB cable. In fact, in many ways, it was easier to connect to this laser cutter than it is to connect with many desktop printers, many of which require over-complicated and bloated drivers. + +Using Inkscape and [a simple plugin][3], you can design cut lines for industrial laser cutters. Design a case for your Raspberry Pi laptop, use these Creative Commons design plans to build [a cryptex lockbox][4], cut out a sign for your shopfront, or whatever it is you have in mind. And do it using an entirely open source stack. + +### 2. Gaming on Linux + +![lutris desktop client][5] +Image by: The Lutris desktop client + +Open source has [always had games][6], and there have been some high profile Linux games in the recent past. The first gaming PC I built was a Linux PC, and I don't think any of the people I had over for friendly couch co-op games realized they were using Linux by playing. And that's a good thing. It's a smooth and seamless experience, and the sky's the limit, depending on how much you want to spend on hardware. + +What's more is that it's not just the games that have been coming to Linux, but the platform too. Valve's recent Steam Deck is a popular handheld gaming console that runs Linux. Better still, many open source software titles have been publishing releases on Steam, including [Blender][7] and [Krita][8], as ways to encourage wider adoption. + +### 3. Office work on Linux + +![Calligra Words][9] +Image by: [Opensource.com][10] + +Linux, like life, isn't always necessarily exciting. Sometimes, you need a computer to do ordinary things, like when you pay bills, make a budget, or write a paper for school or a report for work. Regardless of the task, Linux is also normal, everyday desktop computer. You can use Linux for the mundane, the everyday, the "usual". + +You're not limited to just the big name applications, either. I do my fair share of work in the excellent LibreOffice suite, but on my oldest computer I use the simpler Abiword instead. Sometimes, I like to explore Calligra, the KDE office suite, and when there's precision [design work][11] to be done (including [specialized procedural design work][12]), I use Scribus. + +The greatest thing about using Linux for everyday tasks is that ultimately nobody knows what you used to get to the end product. Your tool chain and your workflow is yours, and the results are as good or better than what locked-down, non-open software produces. I have found that using Linux for the everyday tasks makes those tasks more fun for me, because open source software inherently permits me to develop my own path to my desired outcome. I try to create solutions that help me [get work done efficiently][13], or that help me [automate important tasks][14], but I also just enjoy the flexibility of the system. I don't want to adapt for my tool chain, I want to adapt my tools so that they work for me. + +### 4. Music production on Linux + +![Ardour][15] +Image by: [Opensource.com][16] + +I'm a hobbyist musician, and before I started doing all of my production on computers I owned several synthesizers and sequencers and multi-track recorders. One reason it took me as long as it did to switch to computer music was that it didn't feel modular enough for me. When you're used to wiring physical boxes to one another to route sound through filters and effects and mixers and auxiliary mixers, an all-in-one application looks a little underwhelming. + +It's not that an all-in-one app isn't appreciated, by any means. I like being able to open up one application, like [LMMS][17], that happens to have everything I want. However, in practice it seems that no music application I tried on a computer actually had everything I needed. + +When I switched to Linux, I discovered a landscape built with modularity as one of its founding principles. I found applications that were just [sequencers][18], applications that were just synthesizers, mixers, recorders, patch bays, and so on. I could build my own studio on my computer just as I'd built my own studio in real life. Audio production has developed in leaps and bounds on Linux, and today there are open source [applications][19] that can act as a unified control center while retaining the extensibility to pull in sounds from elsewhere on the system. For a patchwork producer like me, it's a dream studio. + +### 5. Retro computing on Linux + +![Mageia 8][20] +Image by: [Opensource.com][21] + +I don't like throwing away old computers, because very rarely do old computers actually die. Usually, an old computer is "outgrown" by the rest of the world. Operating systems get too bloated for an old computer to handle, so you stop getting OS and security updates, applications start to demand resources your old computer just doesn't have, and so on. + +I tend to [adopt old computers][22], putting them to work as either lab machines or home servers. Lately, I find that adding an SSD drive to serve as the root partition, and using XFCE or a similar lightweight desktop, makes even a computer from the previous decade a pleasantly usable machine for a lot more work than you might expect. Graphic design, web design, programming, stop-motion animation, and much more, are trivial tasks on low spec machines, to say nothing of simple office work. With Linux driving a machine, it's a wonder businesses ever upgrade. + +Everybody has their favorite "rescue" distribution. Mine are Slackware and Mageia, both of which still release 32-bit installer images. Mageia is RPM-based, too, so you can use modern packaging tools like `dnf` and `rpmbuild`. + +### Bonus: Linux servers + +OK, I admit Linux on servers isn't at all surprising. In fact, to people who know of Linux but don't use Linux themselves, a data center is usually the first thing that pops into their heads when "Linux" is mentioned. The problem with that assumption is that it can make it seem obvious that Linux ought to be great on the server, as if Linux doesn't even have to try. It's a flattering sentiment, but the fact is that Linux is great on servers because there's a monumental effort across global development teams to make Linux especially effective at what it does. + +It isn't by chance that Linux is the robust operating system that powers most of the internet, [most of the cloud][23], nearly all the supercomputers in existence, and more. Linux isn't stagnate, and while it has a rich history behind it, it's not so steeped in tradition that it fails to progress. New technologies are being developed all the time, and Linux is a part of that progress. Modern Linux adapts to growing demands from a changing world to make it possible for systems administrators to provide networked services to people all over the world. + +It's not everything Linux can do, but it's no small feat, either. + +### Linux isn't that surprising + +I remember the first time I met someone who'd grown up using Linux. It never seemed to happen for most of the time I've been a Linux user, but lately it's relatively common. I think the most surprising encounter was with a young woman, toddler in tow, who saw whatever geeky t-shirt I was wearing at the time and casually mentioned that she also used Linux, because she'd grown up with it. It actually made me a little jealous, but then I remembered that Unix on a desktop computer simply *didn't exist* when I was growing up. Still, it's fun to think about how casual Linux has become over the past few decades. It's even more fun to be a part of it. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/surprising-things-i-do-linux + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/OSDC_Penguin_Image_520x292_12324207_0714_mm_v1a.png +[2]: https://opensource.com/sites/default/files/2022-05/bitmap.png +[3]: https://github.com/JTechPhotonics/J-Tech-Photonics-Laser-Tool/releases/tag/v1.0-beta_ink0.9 +[4]: https://msraynsford.blogspot.com/2016/10/laser-cut-cryptex.html +[5]: https://opensource.com/sites/default/files/uploads/lutris.png +[6]: https://opensource.com/article/20/5/open-source-fps-games +[7]: http://blender.org +[8]: http://krita.org +[9]: https://opensource.com/sites/default/files/2022-05/calligra-words.jpg +[10]: https://opensource.com/home-page-new +[11]: https://opensource.com/article/21/12/desktop-publishing-scribus +[12]: https://opensource.com/article/19/7/rgb-cube-python-scribus +[13]: https://opensource.com/article/21/1/raspberry-pi-productivity +[14]: https://opensource.com/article/22/5/remote-home-assistant +[15]: https://opensource.com/sites/default/files/2022-05/music.jpg +[16]: https://opensource.com/home-page-new +[17]: https://opensource.com/life/16/2/linux-multimedia-studio +[18]: https://opensource.com/article/21/12/midi-loops-seq24 +[19]: https://opensource.com/article/17/6/qtractor-audio +[20]: https://opensource.com/sites/default/files/2022-05/mageia.jpg +[21]: https://opensource.com/home-page-new +[22]: https://opensource.com/article/19/7/how-make-old-computer-useful-again +[23]: https://opensource.com/article/20/10/keep-cloud-open diff --git a/sources/tech/20220511 How To Upgrade To Fedora 36 From Fedora 35 [Workstation And Server].md b/sources/tech/20220511 How To Upgrade To Fedora 36 From Fedora 35 [Workstation And Server].md new file mode 100644 index 0000000000..e6d3c6bbf8 --- /dev/null +++ b/sources/tech/20220511 How To Upgrade To Fedora 36 From Fedora 35 [Workstation And Server].md @@ -0,0 +1,336 @@ +[#]: subject: "How To Upgrade To Fedora 36 From Fedora 35 [Workstation And Server]" +[#]: via: "https://ostechnix.com/upgrade-to-fedora-36-from-fedora-35/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How To Upgrade To Fedora 36 From Fedora 35 [Workstation And Server] +====== +A Step By Step Guide To Upgrade Fedora 35 To Fedora 36 + +Fedora 36 has been released! This step by step tutorial tutorial explains how to upgrade to Fedora 36 from Fedora 35 and older versions. If you're already using Fedora 35, you can now safely upgrade to Fedora 36 desktop or server edition for latest features, performance and stability improvements. + +### Prerequisites + +Before upgrading to Fedora 36, you need to do a few important tasks. + +1. It is strongly RECOMMENDED to Backup your important data before upgrading to Fedora 36. This should be your first step when you want to upgrade any system, regardless of the underlying operating system. Make sure you've backup of all important files, directories, configuration settings, browser bookmarks, and dot files etc. +2. Fedora 36 upgrade will probably take several minutes to complete. So make sure you've stable Internet connection and uninterrupted power supply. +3. During upgrade, your system will reboot automatically to apply updates. So ensure that there aren't any important jobs currently running (E.g. Scheduled backups). +4. See the Fedora 36 common issues and decide if you want to proceed. +5. Upgrades to the very next release (e.g. 35 to 36) as well as upgrades skipping one release (e.g. 34 to 36) are both supported. Upgrades across more than two releases are not supported. For example - you can't go from Fedora 33 to 36. It might work sometimes. However, if you encounter with any issues, you won't get any support. In such cases, first upgrade to next release (i.e. 33 to 34) and then try to upgrade from 34 to 36. It is always recommended to upgrade to next release before it reaches EOL. + +Well, without further ado, let us start Fedora 36 upgrade task! + +### Upgrade to Fedora 36 From Fedora 35 + +We can upgrade to Fedora 36 via GNOME software (GUI) and from command line (CLI). First, we will see the Graphical method using GNOME Software. This is suitable for those who use Fedora desktop edition. + +Before get started, update your Fedora 35 system: + +``` +$ sudo dnf --refresh update +``` + +``` +$ sudo dnf upgrade +``` + +Reboot your system to apply the updates: + +``` +$ sudo reboot +``` + +Let us check the current version using the following commands: + +``` +$ cat /etc/fedora-release +``` + +To view the detailed version output, run this instead: + +``` +$ cat /etc/os-release +``` + +![Display Fedora Version][1] + +Now, follow any one of the below methods to upgrade Fedora to 36 desktop or server. + +#### 1. Upgrade To Fedora 36 Workstation Via GNOME Software + +**Step 1:** Open your Gnome Software Center and go to **Updates** section. You will see a notification that says - **Fedora 36 Now Available**. Click the Download button to download Fedora 36 packages. + +![Download Fedora 36 From Gnome Software][2] + +The required packages will be downloaded now. This will take a while depending on the Internet speed. + +![Downloading Fedora Linux 36][3] + +**Step 2:** Once the download is complete, you will be prompted to restart and upgrade. Click the "Restart & Upgrade" button to continue installing the updates. + +![Click Restart And Upgrade Button][4] + +**Step 3:** A new pop up window will appear and prompt you to click **Restart & Install Upgrade**. Just click on it to reboot your Fedora system. + +![Click Restart And Install Upgrade Button][5] + +After system reboot, the downloaded packages will be installed. This will take a while depending on the number of packages to install. Make sure your system is plugged into the power outlet and you have uninterrupted power supply. + +![Installing Updates][6] + +After installing the updates, the system will automatically reboot into the brand new Fedora 36 desktop. + +You can check if your Fedora system is up-to-date under **Updates** section in Gnome Software. + +![Check For Updates In Gnome Software][7] + +Congratulations! We've successfully upgraded to Fedora 36! + +**Step 4:** Open a Terminal window and check the installed Fedora version using command: + +``` +$ cat /etc/fedora-release +Fedora release 36 (Thirty Six) +``` + +To view the detailed output, run: + +``` +$ cat /etc/os-release +``` + +**Sample output:** + +``` +NAME="Fedora Linux" +VERSION="36 (Workstation Edition)" +ID=fedora +VERSION_ID=36 +VERSION_CODENAME="" +PLATFORM_ID="platform:f36" +PRETTY_NAME="Fedora Linux 36 (Workstation Edition)" +ANSI_COLOR="0;38;2;60;110;180" +LOGO=fedora-logo-icon +CPE_NAME="cpe:/o:fedoraproject:fedora:36" +HOME_URL="https://fedoraproject.org/" +DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f36/system-administrators-guide/" +SUPPORT_URL="https://ask.fedoraproject.org/" +BUG_REPORT_URL="https://bugzilla.redhat.com/" +REDHAT_BUGZILLA_PRODUCT="Fedora" +REDHAT_BUGZILLA_PRODUCT_VERSION=36 +REDHAT_SUPPORT_PRODUCT="Fedora" +REDHAT_SUPPORT_PRODUCT_VERSION=36 +PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy" +VARIANT="Workstation Edition" +VARIANT_ID=workstation +``` + +![Check Fedora 36 Version From Terminal][8] + +Alternatively, You can check the Fedora version under **Settings -> About** section. + +![Check Fedora 36 Version From Settings Section][9] + +#### 2. Upgrade To Fedora 36 Server From Commandline + +This method is for those who runs Fedora server edition in their system. + +**Step 1:** Update Fedora 35 server using command: + +``` +$ sudo dnf --refresh update +``` + +``` +$ sudo dnf upgrade +``` + +Reboot your system to apply the updates. + +``` +$ sudo reboot +``` + +**Step 2:** Install dnf upgrade plugin by running the following command: + +``` +$ sudo dnf install dnf-plugin-system-upgrade +``` + +**Step 3:** Download Fedora 36 packages using command: + +``` +$ sudo dnf system-upgrade download --releasever=36 +``` + +This command will download all latest packages and display the summary of what packages are going to be replaced, updated, upgraded, or downgraded. This task should take several minutes to complete as it downloads a lot of packages. + +If some of your packages have unsatisfied dependencies, the upgrade will refuse to continue until you run it again with an extra `--allowerasing` option. + +``` +$ sudo dnf system-upgrade download --releasever=36 --allowerasing +``` + +**Step 4:** Once all packages are downloaded, run the following command to start actual upgrade. + +``` +$ sudo dnf system-upgrade reboot +``` + +Your system will reboot automatically and upgrade task will start to install all downloaded packages. + +Upon successful upgrade, the system reboots into the new Fedora 36 server edition. + +That's it. Start using your newly upgraded Fedora 36 server system. + +### Fedora Post-upgrade Tasks + +In this section, we will discuss about a few post-upgrade tasks such as changing the hostname, removing unwanted packages, updating configuration files, deleting orphaned symlinks, and cleaning up old kernels etc. + +The steps provided below are applicable for both Fedora desktop and server editions. + +#### 1. Change Hostname + +I usually use distribution's name as hostname. For example, the hostname for my Fedora 34 desktop would be **fedora34**. If you're anything like me, change the hostname to match with your current version. + +To **change hostname**, run: + +``` +$ sudo hostnamectl set-hostname fedora36 +``` + +#### 2. Clean DNF Metadata Cache + +After upgrade, the cached metadata and transacation can cleared using the following commands: + +``` +$ sudo dnf system-upgrade clean +``` + +``` +$ sudo dnf clean packages +``` + +#### 3. Remove Old Packages + +List all packages with broken or unsatisfied dependencies, run: + +``` +$ sudo dnf update +``` + +``` +$ sudo dnf repoquery --unsatisfied +``` + +List all duplicate packages using command: + +``` +$ sudo dnf repoquery --duplicates +``` + +List all packages that are not in the repositories: + +``` +$ sudo dnf list extras +``` + +If you don't need them anymore, simply run the following commands to remove old, and unused packages. + +``` +$ sudo dnf remove $(sudo dnf repoquery --extras --exclude=kernel,kernel-*) +``` + +``` +$ sudo dnf autoremove +``` + +#### 4. Clean Up Retired Packages + +A few packages will be retired in each Fedora release. They could be obsolete or the maintainer abandoned the packages. The retired packages packages will not get any updates. Not even security updates. + +To remove obsolete and retired packages, run: + +``` +$ sudo dnf install remove-retired-packages +``` + +``` +$ remove-retired-packages +``` + +#### 5. Update System Configuration Files + +To update system configuration files, use `rpmconf` tool. + +To install `rpmconf` tool, run: + +``` +$ sudo dnf install rpmconf +``` + +Once the install is complete, run the following command: + +``` +$ sudo rpmconf -a +``` + +#### 6. Clean Up Old Kernels + +The `dnf autoremove` command will not remove any unused kernels to avoid unintentional Kernel removals. If you want to remove old kernels, you can use the following command: + +``` +$ sudo dnf remove $(dnf repoquery --installonly --latest-limit=-3) +``` + +The above command will remove all old kernels and retain only the latest 3 kernels. + +**Heads Up:** It is HIGHLY RECOMMENDED to **keep at least two kernels**. Because, if there is a problem in the current Kernel version after upgrading, you can safely switch to the older kernel. + +#### 7. Remove Broken Symlinks + +After system upgrade, there would be some unused symlinks left in your system. You need to **find and delete the dangling soft links or symlinks** that don't point anywhere. + +To find broken symlinks in `/usr` directory, run: + +``` +$ sudo symlinks -r /usr | grep dangling +``` + +To remove the dangling symlinks, run: + +``` +$ sudo symlinks -r -d /usr +``` + +### Conclusion + +In this guide, we have seen how to upgrade to Fedora 36 from Fedora 35 via Gnome Software center and from terminal. At the end, we included a few post-upgrade steps that needs to done to cleanup the fedora system. + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/upgrade-to-fedora-36-from-fedora-35/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/wp-content/uploads/2022/05/Display-Fedora-Version.png +[2]: https://ostechnix.com/wp-content/uploads/2022/05/Download-Fedora-36-From-Gnome-Software.png +[3]: https://ostechnix.com/wp-content/uploads/2022/05/Downloading-Fedora-Linux-36.png +[4]: https://ostechnix.com/wp-content/uploads/2022/05/Click-Restart-And-Upgrade-Button.png +[5]: https://ostechnix.com/wp-content/uploads/2022/05/Click-Restart-And-Install-Upgrade-Button.png +[6]: https://ostechnix.com/wp-content/uploads/2022/05/Installing-Updates.png +[7]: https://ostechnix.com/wp-content/uploads/2022/05/Check-For-Updates-In-Gnome-Software.png +[8]: https://ostechnix.com/wp-content/uploads/2022/05/Check-Fedora-36-Version-From-Terminal.png +[9]: https://ostechnix.com/wp-content/uploads/2022/05/Check-Fedora-36-Version-From-Settings-Section.png diff --git a/sources/tech/20220511 Manage your Gmail filters from the Linux command line.md b/sources/tech/20220511 Manage your Gmail filters from the Linux command line.md new file mode 100644 index 0000000000..f298e9fa2f --- /dev/null +++ b/sources/tech/20220511 Manage your Gmail filters from the Linux command line.md @@ -0,0 +1,195 @@ +[#]: subject: "Manage your Gmail filters from the Linux command line" +[#]: via: "https://opensource.com/article/22/5/gmailctl-linux-command-line-tool" +[#]: author: "Kevin Sonney https://opensource.com/users/ksonney" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Manage your Gmail filters from the Linux command line +====== +The gmailctl command-line tool manages email filters with a simple standards-based configuration file. + +![email or newsletters via inbox and browser][1] +Image by: [Ribkahn][2] via [Pixabay][3], [CCO][4] + +Automation is a hot topic right now. In my day job as an SRE part of my remit is to automate as many repeating tasks as possible. But how many of us do that in our daily, not-work, lives? This year, I am focused on automating away the toil so that we can focus on the things that are important. + +Server-side mail rules are one of the most efficient ways to pre-sort and filter mail. Sadly, Gmail, the most popular mail service in the world, doesn't use any of the standard protocols to allow users to manage their rules. Adding, editing, or removing a single rule can be a time-consuming task in the web interface, depending on how many rules the user has in place. The options for editing them "out of band" as provided by the company are limited to an XML export and import. + +I have 109 mail filters, so I know what a chore it can be to manage them using the provided methods. At least until I discovered [gmailctl][5], the command-line tool for managing Gmail filters with a (relatively) simple standards-based configuration file. + +``` +$ gmailctl test +$ gmailctl diff +Filters: +--- Current ++++ TO BE APPLIED +@@ -1 +1,6 @@ ++* Criteria: ++ from: @opensource.com ++ Actions: ++ mark as important ++ never mark as spam + +$ gmailctl apply +You are going to apply the following changes to your settings: +Filters: +--- Current ++++ TO BE APPLIED +@@ -1 +1,6 @@ ++* Criteria: ++ from: @opensource.com ++ Actions: ++ mark as important ++ never mark as spam +Do you want to apply them? [y/N]: +``` + +To define rules in a flexible manner `gmailctl` uses the [jsonnet][6] templating language. Using `gmailctl` also allows the user to export the existing rules for modification. + +To get started, install `gmailctl` via your system's package manager, or install from source with `go install github.com/mbrt/gmailctl/cmd/gmailctl@latest`. Follow that with `gmailctl init` which will walk you through the process of setting up your credentials and the correct permissions in Google. If you already have rules in Gmail, I recommend running `gmailctl download` next, in order to backup the existing rules. These will be saved in the default configuration file `~/.gmailctl/config.jsonnet`. Copy that file somewhere safe for future reference, or to restore your old rules just in case! + +If you wish to start from a clean slate, or you don't have any rules yet, you need to create a new, empty `~/.gmailctl/config.jsonnet` file. The most basic structure for this file is: + +``` +local lib = import 'gmailctl.libsonnet'; +{ +  version: "v1alpha3", +  author: { +    name: "OSDC User", +    email: "your-email@gmail.com" +  }, +  rules: [ +    { +      filter: { +        or: [ +          { from: "@opensource.com" }, +        ] +      }, +      actions: { +        markRead: false, +        markSpam: false, +        markImportant: true +      }, +    }, +  ] +} +``` + +As you can see, this file format is similar to, but not as strict as `JSON`. This file sets up a simple rule to mark any mail from `opensource.com` as important, leave it unread, and not mark it as spam. It does this by defining the criteria in the `filters` section, and then the rules to apply in the `actions` section. Actions include the following boolean commands: `markRead`, `markSpam`,`markImportant`, and `archive`. You can also use actions to specify a `category` for the mail, and assign folders, which we will get to later in the article. + +Once the file is saved, the configuration file format can be verified with `gmailctl test`. If everything is good, then you can use `gmailctl diff` to view what changes are going to be made, and `gmailctl apply` to upload your new rule to Gmail. + +``` +$ gmailctl diff +Filters: +--- +Current ++++ TO BE APPLIED +@@ -1,6 +1,8 @@ +* Criteria: +from: @opensource.com Actions: ++ archive +  mark as important +  never mark as spam ++ apply label: 1-Projects/2022-OSDC + +$ gmailctl apply -y +You are going to apply the following changes to your settings: +Filters: +--- Current ++++ TO BE APPLIED +@@ -1,6 +1,8 @@ +* Criteria: +  from: @opensource.com Actions: ++ archive +  mark as important +  never mark as spam +  apply label: 1-Projects/2022-OSDC + +Applying the changes... +``` + +As mentioned previously, new mail messages can be auto-filed by setting labels in the configuration. I want to assign all mails from Opensource.com to a folder specifically for them, and remove them from the inbox (or `archive` in Gmail terms). To do that, I would change the `actions` section to be: + +``` +actions: { +        markRead: false, +        markSpam: false, +        markImportant: true, +        archive: true, +        labels: [ +          "1-Projects/2022-OSDC" +        ] +      }, +``` + +As you can see in the image above, `gmailctl diff` now shows only what is going to change. To apply it, I used `gmailctl apply -y` to skip the confirmation prompt. If the label doesn't exist, then an error is given, since a filter cannot be made for a label that does not already exist. + +You can also make more complex rules that target specific conditions or multiple emails. For example, the following rule uses an `and` condition to look for messages from `Cloudflare` that are not purchase confirmations. + +``` +filter: { + and: [ + { from: "noreply@notify.cloudflare.com" }, + { subject: "[cloudflare]" }, + { query: "-{Purchase Confirmation}" } + ] + }, +``` + +In the case of a rule that performs the same action on multiple messages, you can use an `or` structure. I use that to file all emails relating to tabletop games to a single folder. + +``` +filter: { + or: [ + { from: "no-reply@obsidianportal.com" }, + { from: "no-reply@roll20.net" }, + { from: "team@arcanegoods.com" }, + { from: "team@dndbeyond.com" }, + { from: "noreply@forge-vtt.com" }, + { from: "@elventower.com" }, + { from: "no-reply@dmsguild.com"}, + { from: "info@goodman-games.com" }, + { from: "contact@mg.ndhobbies.com" }, + { from: "@monkeyblooddesign.co.uk" }, + ] + }, +``` + +For people with multiple Gmail accounts that need their own sets of rules, you can specify a unique configuration file for them with the `--config` command line parameter. For example, my work uses Gmail, and I have a whole *other* set of rules for that. I can create a new `gmailctl` directory, and use that for the work configuration, like so: + +``` +$ gmailctl --config ~/.gmailctl-work/ diff +``` + +To make this easier on myself, I have two shell aliases to make it clear which configuration I'm using. + +``` +alias gmailctl-home="gmailctl --config $HOME/.gmailctl" +alias gmailctl-work="gmailctl --config $HOME/.gmailctl-work" +``` + +The one drawback `gmailctl` has is that it will not apply a new filter to existing messages, so you still have to manually do things for mail received before doing `gmailctl apply`. I hope they are able to sort that out in the future. Other than that, `gmailctl` has allowed me to make adding and updating Gmail filters fast and almost completely automatic, and I can use my favorite email client without having to constantly go back to the web UI to change or update a filter. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/gmailctl-linux-command-line-tool + +作者:[Kevin Sonney][a] +选题:[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/ksonney +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/newsletter_email_mail_web_browser.jpg +[2]: https://pixabay.com/en/users/ribkhan-380399/ +[3]: https://pixabay.com/en/email-newsletter-marketing-online-3249062/ +[4]: https://pixabay.com/en/service/terms/#usage +[5]: https://github.com/mbrt/gmailctl +[6]: https://jsonnet.org/ diff --git a/sources/tech/20220511 Share Files Between Guest and Host OS in GNOME Boxes.md b/sources/tech/20220511 Share Files Between Guest and Host OS in GNOME Boxes.md new file mode 100644 index 0000000000..fadbacb2e2 --- /dev/null +++ b/sources/tech/20220511 Share Files Between Guest and Host OS in GNOME Boxes.md @@ -0,0 +1,142 @@ +[#]: subject: "Share Files Between Guest and Host OS in GNOME Boxes" +[#]: via: "https://itsfoss.com/share-files-gnome-boxes/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Share Files Between Guest and Host OS in GNOME Boxes +====== +Using GNOME Boxes tool for virtual machines but cannot figure out how to share files between the host OS and the OS in VM? This tutorial will help you with that. + +[GNOME Boxes][1] is a VirtualBox and VM Ware like virtualization tool focusing on desktop Linux. It provides a simple GUI to create and manage virtual operating systems. + +Virtual machines are a good way to test another operating system or distribution (in Linux context). + +One of the pain points you’ll experience with VMs is the trouble in copying-pasting and file sharing between the guest and host systems. + +Imagine you saved a file in the virtual machines but now you need it in your actual host system outside the VM. The ability to share the files between the two systems makes the VM experience quite smooth. + +Let me show you how to do file sharing with GNOME Boxes. It consists of three steps: + +* Installing the required package on the guest OS (VM) to enable file sharing +* Knowing how to transfer files from the host OS to the guest OS (drag and drop) +* Knowing how to transfer files from the guest OS to the host OS (through a shared folder) + +**Note: Guest OS is the operating system inside the VM. Host OS is the main operating system where you are running the GNOME Boxes.** + +### Install the required package on guest OS + +Your guest OS (Linux distribution in the VM) needs a SPICE package in order to share files with the host OS (the main operating system). + +On Debian, Ubuntu and Fedora based distributions, this package is named **spice-webdavd**. You can use your distribution’s package manager to install it inside the guest OS (running in the virtual machine). + +For Ubuntu and Debian based systems, use this command: + +``` +sudo apt install spice-webdavd +``` + +For [Fedora based distributions][2], use this command: + +``` +sudo dnf install spice-webdavd +``` + +Restart the guest OS. + +Remember that you need this package on all the guest operating systems. So every time you create a new VM, you have to take care of this package. + +### Transfer files from the host OS to the guest OS + +This is the simpler of the two. You just have to drag the desired file to the guest OS running in the VM. + +You’ll see that when you are dragging the file to the VM, it starts showing a ‘Ready to Recieve File’ option. + +![Drag and drop files to the guest OS from host OS][3] + +The transferred files are saved in the Downloads directory. + +**Alternatively**, you can also send files from the GNOME Boxes menu. Just hit the hamburger menu and click on Send File option. + +![Sending files in GNOME Boxes][4] + +### Transfer files from the guest OS to the host OS + +This one is not as straightforward as dragging and dropping. + +Here, you use the [SPICE protocol][5] to mount a folder of the host OS. You drop the files here and it is transferred to that folder on the host. + +The package you installed earlier was required for this kind of operation. + +Click on the hamburger menu and select the Preferences option. + +![Select GNOME Boxes Preferences][6] + +Here, go to the **Devices & Shares** tab. Look under the **Shared Folder** section. You should see a **+ button. Click on it,** and it will give the default location of the Public folder on your host operating system. You can change it to any folder of your liking. + +![Sharing host OS’s folder in GNOME Boxes][7] + +With that set, open the **File Explorer in the guest OS**. Here, click on the **Other Locations** option (in GNOME’s Nautilus file explorer). + +![Mount Spice client folder][8] + +This will mount the Spice client folder. + +![mounting spice client folder GNOME Boxes][9] + +Enter this mounted folder and you should see the folder you had added via the Preference menu here. In the screenshot below, I have two shared folder (because I added another one later on). + +![mounted spice client folders][10] + +In the shared folders, you can create new folders or copy-paste the files. They will be immediately available in the host OS. + +I shared two screenshots taken in the guest OS and put them in the mounted Spice client folder. + +![Sharing files from the guest OS to the host OS][11] + +It immediately appeared in the public folder of the host OS. + +![Shared files appear in the host OS][12] + +Of course, it’s a two-way sharing. If you put something in the shared folder on the host OS, it will be accessible in the mounted folder in the guest OS. + +Note that you have added the host OS’s folder on GNOME Boxes level. This means that if you have multiple VMs, all of them should be able to mount that folder. + +To keep things organized, you may add multiple shared folders and name them in a way that you can recognize which VM uses them. + +### Did it work for you? + +GNOME Boxes is a pretty good tool for trying various Linux distributions as virtual machines. You can **also share the clipboard between the guest and host systems** with the method described here. This means that if you copied some text in the host OS, you could paste it into the guest OS and vice versa. + +This is pretty much what you need to know and do about sharing files between guest and host OS with GNOME Boxes. + +Do let me know if you managed to make it work or if you still face issues. The comment section is all yours. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/share-files-gnome-boxes/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://help.gnome.org/users/gnome-boxes/stable/ +[2]: https://itsfoss.com/best-fedora-linux-distributions/ +[3]: https://itsfoss.com/wp-content/uploads/2022/05/drag-drop-guest-host-gnome-boxes.webp +[4]: https://itsfoss.com/wp-content/uploads/2022/05/sending-files-in-gnome-boxes.png +[5]: https://www.spice-space.org/spice-user-manual.html +[6]: https://itsfoss.com/wp-content/uploads/2022/05/gnome-boxes-preferences.png +[7]: https://itsfoss.com/wp-content/uploads/2022/05/share-folder-GNOME-Boxes.png +[8]: https://itsfoss.com/wp-content/uploads/2022/05/mount-spice-folder-gnome-boxes-800x511.png +[9]: https://itsfoss.com/wp-content/uploads/2022/05/mounting-spice-client-folder-gnome-boxes-800x511.png +[10]: https://itsfoss.com/wp-content/uploads/2022/05/mounted-spice-client-folders-800x517.png +[11]: https://itsfoss.com/wp-content/uploads/2022/05/sharing-files-from-guest-to-host-os-gnome-boxes-800x511.png +[12]: https://itsfoss.com/wp-content/uploads/2022/05/shared-files-between-host-guest-800x463.png diff --git a/sources/tech/20220512 Get started with Bareos, an open source client-server backup solution.md b/sources/tech/20220512 Get started with Bareos, an open source client-server backup solution.md new file mode 100644 index 0000000000..f8c12d79e9 --- /dev/null +++ b/sources/tech/20220512 Get started with Bareos, an open source client-server backup solution.md @@ -0,0 +1,98 @@ +[#]: subject: "Get started with Bareos, an open source client-server backup solution" +[#]: via: "https://opensource.com/article/22/5/bareos-open-source-client-server-backup-solution" +[#]: author: "Heike Jurzik https://opensource.com/users/hej" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Get started with Bareos, an open source client-server backup solution +====== +Bareos preserves, archives, and recovers data from all major operating systems. Discover how its modular design and key features support flexibility, availability, and performance. + +![Puzzle pieces coming together to form a computer screen][1] +Image by: Opensource.com + +[Bareos][2] (Backup Archiving Recovery Open Sourced) is a distributed open source backup solution (licensed under AGPLv3) that preserves, archives, and recovers data from all major operating systems. + +Bareos has been around since 2010 and is (mainly) developed by the company Bareos GmbH & Co. KG, based in Cologne, Germany. The vendor not only provides further development as open source software but also offers subscriptions, professional support, development, and consulting. This article introduces Bareos, its services, and basic backup concepts. It also describes where to get ready-built packages and how to join the Bareos community. + +### Modular design + +Bareos consists of several services and applications which communicate securely over the network: the Bareos Director (Dir), one or more Storage Daemons (SD), and File Daemons (FD) installed on the client machines to be backed up. This modular design makes Bareos flexible and scalable—it's up to you whether to install all components on one system or several hundred computers, even in different locations. The client-server software stores backups on all kinds of physical and virtual storage (HDD/SSD/SDS), tape libraries, and in the cloud. Bareos includes several plug-ins to support virtual infrastructures, application servers (like databases, such as PostgreSQL, MySQL, MSSQL, MariaDB, etc.), and LDAP directory services. + +Here are the Bareos components, what they do, and how they work together: + +![Bareos components][3] +Image by: (Heike Jurzik, CC BY-SA 4.0) + +#### Bareos Director + +This is the core component and the control center of Bareos, which manages the database (i.e., the Catalog), clients, file sets (defining the data in the backups), the plug-ins' configuration, backup jobs and schedules, storage and media pools, before and after jobs (programs to be executed before or after a backup/restore job), etc. + +#### Catalog + +The database maintains a record of all backup jobs, saved files, and backup volumes. Bareos uses PostgreSQL as the database backend. + +#### File Daemon + +The File Daemon (FD) runs on every client machine or the virtual layer to handle backup and restore operations. After the File Daemon has received the director's instructions, it executes them and then transmits the data to (or from) the Storage Daemon. Bareos offers client packages for various operating systems, including Windows, Linux, macOS, FreeBSD, Solaris, and other Unix-based systems on request. + +#### Storage Daemon + +This Storage Daemon (SD) receives data from one or more FDs and stores data on the configured backup medium. The SD runs on the machine handling the backup devices. Bareos supports backup media like hard disks and flash arrays, tapes and tape libraries, and S3-compatible cloud solutions. If there is a media changer involved, the SD controls that device as well. The SD sends the correct data back to the requesting File Daemon during the restore process. To increase flexibility, availability, and performance, there can be multiple SDs, for example, one per location. + +### Jobs and schedules + +A backup job in Bareos describes what to back up (in a so-called FileSet directive on the client), when to back up (Schedule directive), and where to back up the data (Pool directive). This modular design lets you define multiple jobs and combine several directives, such as FileSets, Pools, and Schedules. Bareos allows you to have two different job resources managing various servers but using the same Schedule and FileSet, maybe even the same Pool. + +The schedule not only sets the backup type (full, incremental, or differential) but also describes when a job is supposed to run, i.e., on different days of the week or month. Because of that, you can plan a detailed schedule and run full backups every Monday, incremental backups the rest of the week, etc. If more than one backup job uses the same schedule, you can set the job priority and thus tell Bareos which job is supposed to run first. + +### Encrypted communication + +As mentioned, all Bareos services and applications communicate with each other over the network. Bareos provides TLS/SSL with pre-shared keys or certificates to ensure encrypted data transport. On top of that, Bareos can encrypt and sign data on the File Daemons before sending the backups to the Storage Daemon. Encryption and signing on the clients are implemented using RSA private keys combined with X.509 certificates (Public Key Infrastructure). Before the restore process, Bareos validates file signatures and reports any mismatches. Neither the Director nor the Storage Daemon has access to unencrypted content. + +As a Bareos administrator, you can communicate with the backup software using a command-line interface (bconsole) or your preferred web browser (Bareos WebUI). The multilingual web interface manages multiple Bareos Directors and their databases. Also, it's possible to configure role-based access and create different profiles with ACLs (Access Control Lists) to control what a user can see and execute in the WebUI. + +![Bareos WebUI][4] +Image by: (Heike Jurzik, CC BY-SA 4.0) + +The WebUI provides an overview and detailed information about backup jobs, clients, file sets, pools, volumes, and more. It's also possible to start backup and restore jobs via the web interface. Starting with Bareos 21, the WebUI provides a timeline to display selected jobs. This timeline makes it easy to spot running, finished, or even failed jobs. This is a great feature, especially in larger environments, as it lets you detect gaps in the schedule or identify which backup jobs are taking up the most time. + +### Packages, support, and training + +There are no license fees for using Bareos. In addition to the Bareos source code, which is available on [GitHub][5], the vendor provides Bareos packages in two different repositories: + +* The community repository contains packages for all major releases (without support). +* The subscription repository also offers packages for minor releases with updates, bug fixes, etc., for customers with a Bareos subscription. + +Customers with a valid subscription can also buy support and consulting from the manufacturer or sponsor the development of new features. Bareos GmbH & Co. KG has a global partner network, offering support and training in multiple languages. + +### Join the Bareos community + +Bareos is a very [active open source project][6] with a great community. The source code of the software and the [Bareos manual][7] sources are hosted on GitHub, and everyone is welcome to contribute. Bareos also offers two mailing lists, one for users ([bareos-users][8]) and one for developers ([bareos-devel][9]). For news and announcements, technical guides, quick howtos, and more, you can also follow the [Bareos blog][10]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/bareos-open-source-client-server-backup-solution + +作者:[Heike Jurzik][a] +选题:[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/hej +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/puzzle_computer_solve_fix_tool.png +[2]: https://www.bareos.com/ +[3]: https://opensource.com/sites/default/files/2022-05/components.png +[4]: https://opensource.com/sites/default/files/2022-05/webui-restore-single-file.png +[5]: https://www.bareos.com/community/github/ +[6]: https://www.openhub.net/p/bareos +[7]: https://docs.bareos.org/ +[8]: https://groups.google.com/forum/#!forum/bareos-users +[9]: https://groups.google.com/forum/#!forum/bareos-devel +[10]: https://www.bareos.com/blog/ diff --git a/sources/tech/20220512 sqlite-utils- a nice way to import data into SQLite for analysis.md b/sources/tech/20220512 sqlite-utils- a nice way to import data into SQLite for analysis.md new file mode 100644 index 0000000000..30725d2daf --- /dev/null +++ b/sources/tech/20220512 sqlite-utils- a nice way to import data into SQLite for analysis.md @@ -0,0 +1,120 @@ +[#]: subject: "sqlite-utils: a nice way to import data into SQLite for analysis" +[#]: via: "https://jvns.ca/blog/2022/05/12/sqlite-utils--a-nice-way-to-import-data-into-sqlite/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +sqlite-utils: a nice way to import data into SQLite for analysis +====== + +Hello! This is a quick post about a nice tool I found recently called [sqlite-utils][1], from the [tools category][2]. + +Recently I wanted to do some basic data analysis using data from my Shopify store. So I figured I’d query the Shopify API and import my data into SQLite, and then I could make queries to get the graphs I want. + +But this seemed like a lot of boring work, like I’d have to write a schema and write a Python program. So I hunted around for a solution, and I found `sqlite-utils`, a tool designed to make it easy to import arbitrary data into SQLite to do data analysis on the data. + +### sqlite-utils automatically generates a schema + +The Shopify data has about a billion fields and I really did not want to type out a schema for it. `sqlite-utils` solves this problem: if I have an array of JSON orders, I can create a new SQLite table with that data in it like this: + +``` + + import sqlite_utils + + orders = ... # (some code to get the `orders` array here) + + db = sqlite_utils.Database('orders.db') + db['shopify_orders'].insert_all(orders) + +``` + +### you can alter the schema if there are new fields (with `alter`) + +Next, I ran into a problem where on the 5th page of downloads, the JSON contained a new field that I hadn’t seen before. + +Luckily, `sqlite-utils` thought of that: there’s an `alter` flag which will update the table’s schema to include the new fields. ``` + +Here’s what the code for that looks like + +``` + + db['shopify_orders'].insert_all(orders, alter=True) + +``` + +### you can deduplicate existing rows (with `upsert`) + +Next I ran into a problem where sometimes when doing a sync, I’d download data from the API where some of it was new and some wasn’t. + +So I wanted to do an “upsert” where it only created new rows if the item didn’t already exist. `sqlite-utils` also thought of this, and there’s an `upsert` method. + +For this to work you have to specify the primary key. For me that was `pk="id"`. Here’s what my final code looks like: + +``` + + db['shopify_orders'].upsert_all( + orders, + pk="id", + alter=True + ) + +``` + +### there’s also a command line tool + +I’ve talked about using `sqlite-utils` as a library so far, but there’s also a command line tool which is really useful. + +For example, this inserts the data from a `plants.csv` into a `plants` table: + +``` + + sqlite-utils insert plants.db plants plants.csv --csv + +``` + +### format conversions + +I haven’t tried this yet, but here’s a cool example from the help docs of how you can do format conversions, like converting a string to a float: + +``` + + sqlite-utils insert plants.db plants plants.csv --csv --convert ' + return { + "name": row["name"].upper(), + "latitude": float(row["latitude"]), + "longitude": float(row["longitude"]), + }' + +``` + +This seems really useful for CSVs, where by default it’ll often interpret numeric data as strings if you don’t do this conversions. + +### metabase seems nice too + +Once I had all the data in SQLite, I needed a way to draw graphs with it. I wanted some dashboards, so I ended up using [Metabase][3], an open source business intelligence tool. I found it very straightforward and it seems like a really easy way to turn SQL queries into graphs. + +This whole setup (sqlite-utils + metabase + SQL) feels a lot easier to use than my previous setup, where I had a custom Flask website that used plotly and pandas to draw graphs. + +### that’s all! + +I was really delighted by `sqlite-utils`, it was super easy to use and it did everything I wanted. + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2022/05/12/sqlite-utils--a-nice-way-to-import-data-into-sqlite/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://sqlite-utils.datasette.io +[2]: https://jvns.ca/#cool-computer-tools---features---ideas +[3]: https://www.metabase.com/ diff --git a/sources/tech/20220513 Fedora Media Writer- World-Class LIVE USB Creator [Tutorial].md b/sources/tech/20220513 Fedora Media Writer- World-Class LIVE USB Creator [Tutorial].md new file mode 100644 index 0000000000..fe5a49701a --- /dev/null +++ b/sources/tech/20220513 Fedora Media Writer- World-Class LIVE USB Creator [Tutorial].md @@ -0,0 +1,105 @@ +[#]: subject: "Fedora Media Writer: World-Class LIVE USB Creator [Tutorial]" +[#]: via: "https://www.debugpoint.com/2022/05/fedora-media-writer/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Fedora Media Writer: World-Class LIVE USB Creator [Tutorial] +====== +A tutorial on installing and using Fedora Media Writer to create LIVE USB from Linux & Windows. + +### Fedora Media Writer + +The community and Fedora Linux team develop and maintain the [Fedora Media Writer app][1]. This application writes any ISO image to your flash drive (USB stick). In addition, Fedora Media Writer also has features to download the ISO file directly from the Fedora Mirrors, provided you have a stable internet connection. + +Moreover, it gives you a list of options for download – such as Official Editions, Emerging Editions, Spins and Fedora Labs images. + +Not only that, but you can also use this nifty utility to write any other ISO images to your flash drive. It need not be the Fedora ISO always. + +Although there are other popular utilities available for creating LIVE USBs, such as [Etcher][2], Ventoy, and Rufus – you can still give this utility a try, considering the team develops it from mainstream Fedora Linux with contributors. + +So, in summary, here are quick feature highlights of Fedora Media Writer. + +#### Features Summary of Fedora Media Writer + +* Available for Linux, Windows and macOS +* Directly download + write the images to a USB flash drive +* Official Editions (Workstation, IoT, Server) download +* Emerging Editions (Silverblue, Kinoite) download +* Spins (KDE Plasma, Xfce, etc) +* Labs (Fedora Astronomy, Robotic and other flavours) +* Available as Flatpak for Linux Distros +* Also, can write any other ISO images (non-Fedora) to a USB stick. +* Ability to format USB stick, restore flash drive +* Based on Qt + +### How to Install + +#### Linux + +Fedora Media Writer is available as Flatpak for Linux Distributions. To install it in any Linux (such as Fedora, Ubuntu, or Linux Mint) – [set up Flatpak by following this guide][3]. + +Then, click on the below link to install. This will launch the official Software application of your Linux Distro (such as Discover, GNOME Software). After installation, you can launch it via Application Menu. + +#### Windows + +If you are a Windows user and planning to migrate to Linux (or Fedora), it is a perfect tool. You need to download the exe installer from GitHub (link below) and follow the onscreen instruction for installation. + +[Latest Installer for Windows (exe)][4] + +After installation, you can launch it from Start Menu. + +For macOS, you can get the dmg file in the above link. + +### How to use Fedora Media Writer to Create LIVE USB in Linux + +The first screen gives you two main options. The automatic download option is for downloading the ISO images on the fly. And the second option is to write the already downloaded ISO files from your disk directly. + +If you have already plugged in the USB, you should see it as the third option. The third option is to format and delete all the data from your USB stick and restore it to its factory settings. + +Furthermore, you can use this utility for just formatting your USB flash drive as well. You do not need any command or anything fancy. A point to note is that this option is only visible when your USB stick has data. If it’s already formatted, the tool can detect it and won’t show you the option to restore it!! 😲 + +#### Automatic Download and Write + +The automatic Download option gives you the following screen to download any Fedora ISO you want from mirrors. This is useful for many because it eliminates the hassles of separately downloading ISO files, verifying checksum, etc. + +After choosing the distribution, the final screen gives you the option for version (Fedora 36, 35, etc.) and architecture (x86, ARM, etc.). Also, you should see the USB destination. Click on Download and Write to start the process. + +#### Write an existing ISO file from the disk. + +When you choose the ‘select iso file’ option, you can select the file from your system. After that, select the destination USB drive and click Write to start the process. + +After the write operation is finished, you can see a confirmation message shown above. It took standard time to write a 3GB~ ISO during my test, around 3 to 4 minutes. + +### Using Fedora Media Writer to Create LIVE USB in Windows, macOS + +The steps are the same to use this utility in Windows and macOS, as shown above for Linux. You can easily find the shortcuts after installation and launch in the same way. + +### Closing Notes + +I hope this guide helps you use Fedora Media Writer for your day to day USB writing work. Also, the good thing about this utility is that you can use it for formatting/restoring your USB stick. You do not require GParted or GNOME Disks anymore. + +It’s such a terrific utility for Linux, Windows and macOS users. + +Cheers. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/fedora-media-writer/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://github.com/FedoraQt/MediaWriter +[2]: https://www.debugpoint.com/2021/01/etcher-bootable-usb-linux/ +[3]: https://flatpak.org/setup/ +[4]: https://github.com/FedoraQt/MediaWriter/releases/latest diff --git a/sources/tech/20220513 Install Third Party Software Using Fedy In Fedora 36.md b/sources/tech/20220513 Install Third Party Software Using Fedy In Fedora 36.md new file mode 100644 index 0000000000..e10ed011d1 --- /dev/null +++ b/sources/tech/20220513 Install Third Party Software Using Fedy In Fedora 36.md @@ -0,0 +1,162 @@ +[#]: subject: "Install Third Party Software Using Fedy In Fedora 36" +[#]: via: "https://ostechnix.com/install-third-party-software-fedy-fedora/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Install Third Party Software Using Fedy In Fedora 36 +====== +Install third-party software and multimedia codecs with Fedy in Fedora + +The Fedora project will not include any package that doesn't comply with [Fedora licensing policies][1] in the official repositories. So, the Fedora users rely on third-party repositories like **RPM Fusion** to install propriety drivers, software and codecs that Fedora doesn't want to ship due to legal and licensing reasons. In this guide, we will see what is **Fedy** and how to install third-party software and multimedia codecs with Fedy in Fedora Linux operating systems. + +### What is Fedy? + +Fedy is a simple graphical application that allows you to install several third-party applications, development tools, drivers, themes, and utilities in Fedora. + +You can install everything with a single mouse click! No need to use DNF/YUM or any other CLI/GUI package managers! Fedy will automatically add the respective repositories and install the selected applications. + +Fedy is a perfect post-installer application for Fedora that allows you to quickly install frequently used essential applications after a fresh Fedora installation. + +Whether you want to install a new software or a codec or apply a tweak, Fedy lets you do it without much hassle. + +Please note that Fedy doesn't have its own repository. It will simply search and add the repository(s) which has the required software and automatically install them. It is just like a GUI front-end to the DNF/YUM package manager. + +Fedy is free, open source application released under GPLv3. The source code of Fedy is hosted in GitHub. + +### Install Fedy in Fedora Linux + +First, you need to add and **enable RPM Fusion repository** in your Fedora system: + +``` +$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm +``` + +Next, add fedy copr repository using command: + +``` +$ sudo dnf copr enable kwizart/fedy +``` + +After enabling RPM Fusion and Fedy copr repositories, run the following command to install fedy in Fedora: + +``` +$ sudo dnf install fedy -y +``` + +Now let us see how to use Fedy to install/remove third-party applications in Fedora. + +### Install essential third-party applications in Fedora using Fedy + +Launch Fedy either from the Terminal by using command: + +``` +$ fedy +``` + +You can also open Fedy from the Application launcher or Dash or Menu. + +![Launch Fedy][2] + +The default interface of fedy will look like below: + +![Fedy main interface][3] + +As you can see, Fedy interface is very simple! + +As stated already, Fedy includes a lot of open and closed source applications, drivers and tools. All packages are categorized under six distinct sections as listed below: + +1. Apps +2. Development tools +3. Drivers +4. Themes +5. Tweaks +6. Utilities + +Just navigate to any section and install the available application(s). There is a search box on the top right-corner, which helps you to easily find a application to install or a tweak to apply. + +#### Install and remove applications + +The **Apps** section includes popular applications such as 1password, Anydesk, Insync, Microsoft teams, OneDrive, Spotify, Steam, WPS office, Zoom and many. + +To install any application, just click on the **Install** button next to the application's name. You will be prompted to enter the `sudo` password. Once the password is entered, Fedy will add the appropriate repository for the application and install it. It's that simple! + +![Install applications using Fedy in Fedora][4] + +You can also remove the installed applications from the Fedy interface as well. No need to use GNOME software or DNF package manager. + +#### Install development tools + +From Development tools section, you can install various development tools like Android studio, CUDA toolkit, Eclipse IDE, Google Cloud SDK, JetBrains, MongoDB, Oracle JDK, Pycharm, Rstudio, Sublime text, Visual studio code and more. + +#### Install drivers + +The Drivers section in Fedy contains drivers and firmware for audio, video, Bluetooth, GPU, and filesystem etc. In this section, you can also install LTS Kernel as well. + +Some of the notable drivers included in Fedy are: Broadcom 802.11 STA driver, Fuse exFAT driver, Intel legacy VAAPI driver, Nvidia GPU driver, and a few more. + +#### Install themes + +Fedy also allows you to change the look and feel of your Fedora desktop. You can make your desktop beautiful by installing popular themes like Flat-remix, Numix, and Papirus themes. + +#### Tweak your Fedora system + +This is my favorite section in Fedy. From Tweaks section in Fedora, you can tweak various settings, including the following: + +* Clean junk files, +* Disable Wayland, +* Disable mouse acceleration, +* Add colors to bash prompt and make it fancy, +* Configure GRUB2, +* Set SELinux to permissive mode, +* Enable system-wide touchpad tap-to-click, +* Fix Intel throttling issues with Lenova notebooks. + +![Tweak Fedora system using Fedy][5] + +As stated already, all settings can be configured with a single mouse click! No need to edit configuration files and do changes manually. Fedy will set the optimal settings automatically! + +#### Fedy utilities section + +This is yet another important section in Fedy. + +We can do the following from utilities section: + +* Adobe flash browser plug-in and player +* Archive utilities to compress and extract different file formats +* Necessary multimedia codecs to encode or decode audio/video streams +* Enable encrypted DVD playback +* Microsoft TrueType fonts such as Arial, Times New Roman, and other core Microsoft fonts +* Oracle JRE to run JAVA applications +* and theme engines used by GTK themes to draw widgets + +### Conclusion + +As far as I tested, Fedy seems quite useful for Fedora users, especially for the newbies. Using Fedy, you can quickly setup a full-fledged Fedora desktop with all necessary applications for personal as well as professional usage. + +**Resource:** + +* [Fedy GitHub Repository][6] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/install-third-party-software-fedy-fedora/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/ +[2]: https://ostechnix.com/wp-content/uploads/2022/05/Launch-Fedy.png +[3]: https://ostechnix.com/wp-content/uploads/2021/09/Fedy-main-interface.png +[4]: https://ostechnix.com/wp-content/uploads/2021/09/Install-applications-using-Fedy-in-Fedora.png +[5]: https://ostechnix.com/wp-content/uploads/2021/09/Tweak-Fedora-system-using-Fedy.png +[6]: https://github.com/rpmfusion-infra/fedy diff --git a/sources/tech/20220514 An introduction to USB Device Emulation and how to take advantage of it.md b/sources/tech/20220514 An introduction to USB Device Emulation and how to take advantage of it.md new file mode 100644 index 0000000000..8aebcf286b --- /dev/null +++ b/sources/tech/20220514 An introduction to USB Device Emulation and how to take advantage of it.md @@ -0,0 +1,472 @@ +[#]: subject: "An introduction to USB Device Emulation and how to take advantage of it" +[#]: via: "https://fedoramagazine.org/an-introduction-to-usb-device-emulation-and-how-to-take-advantage-of-it/" +[#]: author: "Jose Ignacio Tornos Martinez https://fedoramagazine.org/author/jtornosm/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +An introduction to USB Device Emulation and how to take advantage of it +====== +![][1] + +A big bunch of USB devices by Jose Ignacio Tornos Martinez + +### Introduction + +Nowadays, the number of devices is getting bigger and bigger, and modern operating systems must try to support all types and several of them with every integration, with every release. Maintaining a large number of devices is difficult, expensive and also hard to test, specially for plug-and-play devices, like USB devices. + +Therefore, it is necessary to create a mechanism to facilitate the maintenance and testing of old and new USB devices. And this is where USB device emulation comes in. In that way, a complete framework including a big bunch of emulated and validated USB devices will allow easier integration and release. The area of application would be very wide: earlier bug search/detection even during development, automatic tests, continuous integration, etc. + +### How to emulate USB devices + +[USB/IP project][2] allows sharing the USB devices connected to a local machine so that they can be managed by another machine connected to the network by means of a TCP/IP connection. + +Then USB/IP project consists of two parts: + +* local device support (host) to allow remote access to every necessary control events and data +* remote control that catches every necessary control event and data to process like a normal driver + +The procedure is valid for Linux and Windows, here I will focus only on Linux. + +The idea behind emulation is to replace the remote device support with an application that behaves in the same way. In this way we can emulate devices with software applications that follow the commented USB/IP protocol specification. + +In the following points I will describe how to configure and run the remote support and how to connect to our USB emulated device. + +#### Remote support + +Remote support is divided in two parts: + +* kernel space to control a remote device as it was local, that is, to be probed by the normal driver. +* user space application to configure access to remote devices. + +At this point, it is important to remark that the device emulators, after configuration by user space application, will communicate directly with the kernel space. + +Local support has a very similar structure, but the focus of this article is device emulation. + +Let’s analyze every part of remote support. + +##### Kernel space + +First of all, in order to get the functionality we need to compile the Linux Kernel with the following options: + +``` +CONFIG_USBIP_CORE=mCONFIG_USBIP_VHCI_HCD=m +``` + +These options enable the USB/IP virtual host controller driver, which is run on the remote machine. + +Normal USB drivers need to be also included because they will be probed and configured in the same way from virtual host controller drivers. + +Besides there are other important configuration options: + +``` +CONFIG_USBIP_VHCI_HC_PORTS=8CONFIG_USBIP_VHCI_NR_HCS=1 +``` + +These options define the number of ports per USB/IP virtual host controller and the number of USB/IP virtual host controllers as if adding physical host controllers. These are the default values if *CONFIG_USBIP_VHCI_HCD* is enabled, increase if necessary. + +The commented options and kernel modules are already included in some Linux distributions like Fedora Linux. + +Let’s see an example of available virtual USB buses and ports that we will use later. + +Default and real resources in example equipment: + +``` +$ lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub $ lsusb -t /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/15p, 5000M /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/15p, 480M |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 480M$ +``` + +Now, we will load the module vhci-hcd into the system (default configuration for *CONFIG_USBIP_VHCI_HC_PORTS* and *CONFIG_USBIP_VHCI_NR_HCS*): + +``` +$ sudo modprobe vhci-hcd $ lsusb Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub $ lsusb -t /: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=vhci_hcd/8p, 5000M /: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=vhci_hcd/8p, 480M /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/15p, 5000M /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/15p, 480M |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 480M$ +``` + +The remote USB/IP virtual host controller driver will only use the configured virtualized resources. Of course, emulated devices will work in the same way. + +##### User space + +The other necessary part in the USB/IP project is the user space tool *usbip* and needs to be used to configure the referred kernel space on both sides, although, in the same way, we only focus on the remote side, since the local side will be represented by the emulator. + +That is, *usbip*tool will configure the USB/IP virtual controller (tcp client) in kernel space to connect to the device emulator (tcp server) in order to establish a direct connection between them for USB configuration, events, data, etc. exchange. + +The tool is independent of the type of device and is able to provide information about available and reserved resources (see more information in the examples below). + +The local USB/IP virtual host controller needs to specify the pair bus-port that will used for remote access, it will be the same for emulated devices, but in this case, this pair can be anything because there is no real device and resource reservation is not necessary. + +This tool is found on the Linux Kernel repository in order to be totally synchronized with it. + +Location of the tool on the Linux Kernel repository: *./tools/usb/usbip* + +In some distribution like Fedora Linux, the *usbip* utility can be installed by means of *usbip* package from repositories. If *usbip* utility or related package can not be found, follow the instruction in the available README file to compile and install. Suitable rpm package can also be generated from the [usbip-emulator][3]repository: + +``` +$ git clone https://github.com/jtornosm/USBIP-Virtual-USB-Device.git +$ cd USBIP-Virtual-USB-Device/usbip +$ make rpm +... +$ +``` + +#### How to emulate USB devices + +Emulators are generated in Python and C. I have started with C development (I will focus on this part), but the same could be done in Python. + +For C development, compile emulation tools from the [usbip-emulator][4]repository: + +``` +$ git clone https://github.com/jtornosm/USBIP-Virtual-USB-Device.git +$ cd USBIP-Virtual-USB-Device/c +$ make +... +$ +``` + +All the supported devices emulated at this moment will be generated: + +* hid-keyboard +* hid-mouse +* cdc-adm +* hso +* cdc-ether +* bt + +rpm package (*usbip-emulator*) can be also generated with: + +``` +$ make rpm +... +$ +``` + +As examples, Vendor and Product IDs are hardcoded in the code. + +Following three examples to show how emulation works. We are using the same equipment for the emulator and remote USB/IP but they could run in different equipment. Besides, we are reserving different resources so all the devices could be emulated at the same time. + +##### Example 1: hso + +From one terminal, let’s emulate the hso device: + +(“1-1” is the pair bus-port for the USB device on the local machine, as we are emulating, it could be anything. It is only important because *usbip* tool will have to use the same name to request the emulated device) + +``` +$ hso -p 3241 -b 1-1 +hso started.... +server usbip tcp port: 3241 +Bus-Port: 3-0:1.0 +... +``` + +From another terminal, connect to the emulator: + +(localhost because emulator is running in the same equipment and the same name for pair bus-port as the emulator) + +``` +$ sudo modprobe vhci-hcd $ sudo usbip --tcp-port 3241 attach -r 127.0.0.1 -b 1-1 usbip: info: using port 3241 ("3241") $ +``` + +Now we can check that the new device is present: + +(As we saw previously, for this example machine, bus 3 is virtualized) + +``` +$ ip addr show dev hso +0 3: hso0: mtu 1486 qdisc noop state DOWN group default qlen 10 +link/none +$ rfkill list +0: hso-0: Wireless WAN +Soft blocked: no +Hard blocked: no +... +$ lsusb +... +Bus 003 Device 002: ID 0af0:6711 Option GlobeTrotter Express 7.2 v2 +... +$ lsusb -t +... +/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=vhci_hcd/8p, 480M +|__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=hso, 12M +... +$ +``` + +In order to release resources: + +``` +$ sudo usbip port Imported USB devices ==================== Port 00: at Full Speed(12Mbps) Option : GlobeTrotter Express 7.2 v2 (0af0:6711) 3-1 -> usbip://127.0.0.1:3241/1-1 -> remote bus/dev 001/002 $ sudo usbip detach -p 00 usbip: info: Port 0 is now detached! $ +``` + +And we can check that the device is released: + +``` +$ ip addr show dev hso0 +Device "hso0" does not exist. +$ rfkill list +... +$ lsusb +... +$ +``` + +After this, we can emulate again or stop the emulated device from the first terminal (i.e. with Ctrl-C). + +##### Example 2: cdc-ether + +From one terminal, let’s emulate the cdc-ether device (root permission is required because raw socket needs to bind to specified interface for data plane): + +(“1-1” is the pair bus-port for the USB device on the local machine, as we are emulating, it could be anything. It is only important because *usbip* tool will have to use the same name to request the emulated device) + +``` +$ sudo cdc-ether -e 88:00:66:99:5b:aa -i enp1s0 -p 3242 -b 1-1 +cdc-ether started.... +server usbip tcp port: 3242 +Bus-Port: 1-1 +Ethernet address: 88:00:66:99:5b:aa +Manufacturer: Temium +Network interface to bind: enp1s0 +... +``` + +From another terminal connect to the emulator: + +(localhost because emulator is running in the same equipment and the same name for pair bus-port as the emulator) + +``` +$ sudo modprobe vhci-hcd $ sudo usbip --tcp-port 3242 attach -r 127.0.0.1 -b 1-1 usbip: info: using port 3242 ("3242") $ +``` + +Now we can check that the new device is present: + +(As we saw previously, for this example machine, bus 3 is virtualized) + +``` +$ ip addr show dev eth0 +4: eth0: mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000 +link/ether 88:00:66:99:5b:aa brd ff:ff:ff:ff:ff:ff +$ sudo ethtool eth0 +... +Link detected: yes +$ lsusb +... +Bus 003 Device 003: ID 0fe6:9900 ICS Advent +... +$ lsusb -t +... +/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=vhci_hcd/8p, 480M +|__ Port 2: Dev 3, If 0, Class=Communications, Driver=cdc_ether, 480M +|__ Port 2: Dev 3, If 1, Class=CDC Data, Driver=cdc_ether, 480M +... +$ +``` + +For this example, we can also test the data plane. + +(IP forwarding is disabled in both sides) + +First, we can configure the IP address in the emulated device: + +``` +$ sudo ip addr add 10.0.0.1/24 dev eth0 $ ip addr show dev eth0 4: eth0: mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000 link/ether 88:00:66:99:5b:aa brd ff:ff:ff:ff:ff:ff inet 10.0.0.1/24 scope global eth0 valid_lft forever preferred_lft forever $ +``` + +Second, for example, from other directly Ethernet connected machine (real or virtual) we can configure a macvlan interface in the same subnet to send/receive traffic (ping, iperf, etc.): + +``` +$ sudo ip link add macvlan0 link enp1s0 type macvlan mode bridge +$ sudo ip addr add 10.0.0.2/24 dev macvlan0 +$ sudo ip link set macvlan0 up +$ ip addr show dev macvlan0 +3: macvlan0@enp1s0: mtu 1500 qdisc noqueue state UP group default qlen 1000 +link/ether d6:f1:cd:f1:cc:02 brd ff:ff:ff:ff:ff:ff +inet 10.0.0.2/24 scope global macvlan0 +valid_lft forever preferred_lft forever +inet6 fe80::d4f1:cdff:fef1:cc02/64 scope link +valid_lft forever preferred_lft forever +$ ping 10.0.0.1 +PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data. +64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=55.6 ms +64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=2.19 ms +64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=1.74 ms +64 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=1.76 ms +64 bytes from 10.0.0.1: icmp_seq=5 ttl=64 time=1.93 ms +64 bytes from 10.0.0.1: icmp_seq=6 ttl=64 time=1.65 ms +... +``` + +In order to release resources: + +``` +$ sudo usbip port +Imported USB devices +==================== +... +Port 01: at High Speed(480Mbps) +ICS Advent : unknown product (0fe6:9900) +3-2 -> usbip://127.0.0.1:3245/1-1 +-> remote bus/dev 001/003 +$ sudo usbip detach -p 01 +usbip: info: Port 1 is now detached! +$ +``` + +And we can check that the device is released: + +``` +$ ip addr show dev eth0 Device "eth0" does not exist. $ lsusb ... $ +``` + +And of course, traffic from the other machine is not working: + +``` +From 10.0.0.2 icmp_seq=167 Destination Host Unreachable +From 10.0.0.2 icmp_seq=168 Destination Host Unreachable +From 10.0.0.2 icmp_seq=169 Destination Host Unreachable +From 10.0.0.2 icmp_seq=170 Destination Host Unreachable +... +``` + +After this, we can emulate again or stop the emulated device from the first terminal (i.e. with Ctrl-C). + +##### Example 3: bt + +From one terminal, let’s emulate the Bluetooth device: + +(“1-1” is the pair bus-port for the USB device on the local machine, as we are emulating, it could be anything. It is only important because *usbip* tool will have to use the same name to request the emulated device) + +``` +$ bt -a aa:bb:cc:dd:ee:11 -p 3243 -b 1-1 +bt started.... +server usbip tcp port: 3243 +Bus-Port: 1-1 +BD address: aa:bb:cc:dd:ee:11 +Manufacturer: Trust +... +``` + +From another terminal connect to the emulator: + +(localhost because emulator is running in the same equipment and the same name for pair bus-port as the emulator) + +``` +$ sudo modprobe vhci-hcd $ sudo usbip --tcp-port 3243 attach -r 127.0.0.1 -b 1-1 usbip: info: using port 3243 ("3243") $ +``` + +Now we can check that the new device is present: + +(As we saw previously, for this example machine, bus 3 is virtualized) + +``` +$ hciconfig -a +hci0: Type: Primary Bus: USB +BD Address: AA:BB:CC:DD:EE:11 ACL MTU: 310:10 SCO MTU: 64:8 +UP RUNNING PSCAN ISCAN INQUIRY +RX bytes:1451 acl:0 sco:0 events:80 errors:0 +TX bytes:1115 acl:0 sco:0 commands:73 errors:0 +Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 0x87 +Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 +Link policy: RSWITCH HOLD SNIFF PARK +Link mode: SLAVE ACCEPT +Name: 'BT USB TEST - CSR8510 A10' +Class: 0x000000 +Service Classes: Unspecified +Device Class: Miscellaneous, +HCI Version: 4.0 (0x6) Revision: 0x22bb +LMP Version: 3.0 (0x5) Subversion: 0x22bb +Manufacturer: Cambridge Silicon Radio (10) + +$ rfkill list +... +1: hci0: Bluetooth +Soft blocked: no +Hard blocked: no +$ lsusb +... +Bus 003 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) +... +$ lsusb -t +... +/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=vhci_hcd/8p, 480M +|__ Port 3: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M +|__ Port 3: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M +... +$ +``` + +And we can turn off and turn on the emulated Bluetooth device, detecting several fake Bluetooth devices: + +(At this moment, fake Bluetooth devices are not emulated/simulated so we can not set up) + +![Turn Bluetooth off][5] + +![Turn Bluetooth on][6] + +In order to release resources: + +``` +$ sudo usbip port +Imported USB devices +==================== +... +Port 02: at Full Speed(12Mbps) +Cambridge Silicon Radio, Ltd : Bluetooth Dongle (HCI mode) (0a12:0001) +3-3 -> usbip://127.0.0.1:3243/1-1 +-> remote bus/dev 001/002 +$ sudo usbip detach -p 02 +usbip: info: Port 2 is now detached! +$ +``` + +And we can check that the device is released: + +``` +$ hciconfig +$ rfkill list +... +$ lsusb +... +$ +``` + +And of course, device is not detected (as before emulation): + +![Bluetooth is not found][7] + +After this, we can emulate again or stop the emulated device from the first terminal (i.e. with Ctrl-C). + +### Emulated vs real USB devices + +When the real hardware and/or final device is not used to test, we can always feel insecure about the results, and this is the biggest hurdle that we will have to overcome to check the correct operation of the devices by means of emulation. + +So, in order to be confident, emulation must be as close as possible to the real hardware and in order to get the most real emulation every aspect of the device must be covered (or at least the necessary ones if they are not related with other aspects). In fact, for a correct test, we must not modify the driver, that is, we must only emulate the physical layer, so that the driver is not able to know if the device is real or emulated. + +Starting to test with the real hardware device is a very good idea to get a reference to build the emulator with the same features. For the case of USB devices, the device emulator building is easier because of the existing procedure to get remote control that complies with all the characteristics mentioned above. + +### Conclusion + +USB device emulation is the best way to integrate and test the related features in an efficient, automatic and easy way. But, in order to be confident about the emulation procedure, device emulators need to be previously validated to confirm that they work in the same way as real hardware. + +Of course, the USB device emulator is not the same as the real hardware device, but the commented method, thanks to the tested procedure to get remote control of the device, it’s very close to the real scenario and can help a lot to improve our release and testing processes. + +Finally, I would like to comment that one of the best advantages of using software emulators is that we will be able to cause specific behaviors, in a simple way, that would be very difficult to reproduce with real hardware, and this could help to find issues and be more robust. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/an-introduction-to-usb-device-emulation-and-how-to-take-advantage-of-it/ + +作者:[Jose Ignacio Tornos Martinez][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/jtornosm/ +[b]: https://github.com/lkxed +[1]: https://fedoramagazine.org/wp-content/uploads/2022/05/usb_device_emulation-4-816x345.jpg +[2]: http://usbip.sourceforge.net/ +[3]: https://github.com/jtornosm/USBIP-Virtual-USB-Device.git +[4]: https://github.com/jtornosm/USBIP-Virtual-USB-Device.git +[5]: https://jtornosm.fedorapeople.org/usb_device_emulation/usb-emulator_html_2ad86980149353eb.png +[6]: https://jtornosm.fedorapeople.org/usb_device_emulation/usb-emulator_html_2b57acabd220bd97.png +[7]: https://jtornosm.fedorapeople.org/usb_device_emulation/usb-emulator_html_d21fdeeff70f0d57.png diff --git a/sources/tech/20220514 Hidden Features! 25 Fun Things You Can Do With DuckDuckGo Search Engine.md b/sources/tech/20220514 Hidden Features! 25 Fun Things You Can Do With DuckDuckGo Search Engine.md new file mode 100644 index 0000000000..a7e0d70e42 --- /dev/null +++ b/sources/tech/20220514 Hidden Features! 25 Fun Things You Can Do With DuckDuckGo Search Engine.md @@ -0,0 +1,235 @@ +[#]: 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: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Hidden Features! 25 Fun Things You Can Do With DuckDuckGo Search Engine +====== +DuckDuckGo is one of the alternative search engines that is less privacy intruding than the omnipresent Google. + +DuckDuckGo is one of the [alternative search engines that is less privacy intruding][1] than the omnipresent Google. + +It has improved a lot lately and works quite satisfactorily for general web search. It is nowhere close to Google when it comes to local search. + +However, DuckDuckGo (fondly nicknamed DDG) has some cool features most users are not aware of. If you are an ardent DDG fan, you may enjoy enhancing your search experience with these tricks. + +### 1. Jump on a specific website + +Type ! before your favorite website name and directly enter the website. This is like the ‘feeling lucky’ feature of Google but in DDG terms, it’s called ‘bangs.’ + +There are short forms for the websites, which will be suggested when we start typing. + +![duckduckgo bang feature][2] + +Entering the search term just after the website name will land you on the required result from that website. + +### 2. Convert text to ASCII + +Figlet is one of the [fun Linux commands][3]. It converts any text into a decorated ASCII format. + +Type **figlet** before any search term; it will print its ASCII output. No need to open the terminal. + +![Figlet in DDG][4] + +### 3. Check social media status + +Use ‘@’ in front of the proper twitter name of someone will show their status (followers etc.). + +![Itsfoss Twitter][5] + +### 4. Generate a strong password + +Type ‘password’ followed by the number of characters to be included and it will generate a strong, unique password for you. + +![Generating password in DuckDuckGo][6] + +### 5. Generate Random Passphrase + +Type ‘random passphrase’ to generate a passphrase, usually 4 words long. + +![Random Passphrase][7] + +### 6. Get a cheatsheet + +Type cheatsheet after the term whose cheatsheet you want. If there is a cheat sheet for the searched term, it will show it immediately on the search page. + +![Vim Cheatsheet][8] + +### 7. Get color from the color code + +Type ‘color’ followed by the hex code of the color you want to check and it will show what that color looks like. + +![Color][9] + +### 8. Generate a random number + +Searching ‘random number’ will output a random number between 0 and 1 + +![Random Number][10] + +You can also specify the range to look for. + +![Random Number between 1 and 1000][11] + +### 9. Convert to binary and other formats + +Type a binary number and append it with ‘binary’ will convert it from binary to decimal + +![Binary to Decimal][12] + +Similarly, it works for hexadecimal and oct, but I am confused about their logic. + +### 10. Find rhyming words + +Type ‘what rhymes with ‘ followed by the word you want to get rhymes of. Helps with your poetry skills, no? + +![What rhymes with rain][13] + +### 11. Get Ramanujan number, Pi, and other constants + +Type the name of the constant whose value you want and you get it right in the search result page. + +![Ramanujan Number][14] + +### 12. Check who is currently in space + +Type ‘people in space’ and get the list of those currently in space. It also shows how long they have been in space. + +![People in Space][15] + +### 13. Check if a website is down + +If you want to know if a particular website is down for you or for everyone, just use the “is xyz.com is down” search query. + +![Is down?][16] + +### 14. Get quotes on certain topics + +Type a word followed by quotes, and it will give quotes related to that word. + +![Get quotes in DDG][17] + +### 15. Get Placeholder texts + +Search for ‘lorem ipsum’ and get 5 paragraphs of placeholder texts. Useful for web developers perhaps. + +![Lorem ipsum][18] + +### 16. Get the calendar of any month + +Type calendar followed by day, month, and year and it gives you an interactive calendar of that month. + +![Calendar][19] + +### 17. Generate QR code + +Search ‘qr’ followed by any text, be it a link or anything, will generate the respective QR Code. + +![QRCode][20] + +### 18. Get some CSS Animations + +Search for ‘css animations’ to get some CSS animation examples. + +![CSS Animations][21] + +### 19. Expand a shortened link + +Got a bitly or some other shortened link but not sure where it takes you. Instead of landing on a spammy website, expand the shortened URL and see the actual website URL. + +Use the keyword expand followed by the shortened URL and it will show the actual destination URL. + +![Expand Link][22] + +### 20. Get HTML codes for special characters + +Search ‘html chars’ and get a very long list of HTML entities and their description, if pressed show more in the result + +![HTML Chars][23] + +### 21. Why should I use this? + +This one is pretty useless. If you enter the term “why should I use this?” it shows “cause it’s awesome” at the top of the search result page. Clearly, DuckDuckGo is referring to itself. + +![Why should I use this?][24] + +### 22. Convert case + +This works in two cases. lowercase will show the lowered case result + +![Lowercase][25] + +uppercase will show an uppercase result. + +![Uppercase][26] + +### 23. Encode a URL + +Search ‘encode’ followed by a URL will give an encoded result + +![URL Encode][27] + +### 24. Motherboard + +Search for ‘Motherboard’, and you can see that the logo of DuckDuckGo on the left side is changed. It shows a random logo from the selection of a few. + +![Motherboard][28] + +### 25. Get HTML Color Codes + +Search for ‘color codes’ and you get a chart of colors. Again, this one is more for web developers and designers. + +![Color Codes][29] + +### There are many more… + +My teammate Sreenath came up with this post idea. He says there are more such ‘easter eggs’ in DuckDuckGo and I believe him. But it won’t be feasible to list them all here. + +If you know more such interesting DDG search features, share them in the comments. If you found your next favorite search feature, do mention that too. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/duckduckgo-easter-eggs/ + +作者:[sreenath][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sreenath/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/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/sources/tech/20220515 Top 10 Best Linux Distributions in 2022 For Everyone.md b/sources/tech/20220515 Top 10 Best Linux Distributions in 2022 For Everyone.md new file mode 100644 index 0000000000..82641d620f --- /dev/null +++ b/sources/tech/20220515 Top 10 Best Linux Distributions in 2022 For Everyone.md @@ -0,0 +1,206 @@ +[#]: subject: "Top 10 Best Linux Distributions in 2022 For Everyone" +[#]: via: "https://www.debugpoint.com/2022/05/best-linux-distributions-2022/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top 10 Best Linux Distributions in 2022 For Everyone +====== +We compiled a list of the 10 best Linux distributions for everyone in 2022 based on their stability, attractiveness and time required to configure after installation. + +The Linux Distribution space is heavily fragmented to the point that a new fork is being created almost every day. A very few of them are unique and bring something different to the table. Most of them are just the same Ubuntu or Debian based with a different theme or a wrapper. + +The Linux distro landscape is so dynamic that it changes every month. Some Linux distributions become more stable with ever-changing packages and components, while others become unstable in quality. Hence, it’s challenging to pick and choose the best Linux distribution for your school, work or for just casual browsing, watching movies, etc. Not to mention, many Linux distributions are discontinued every year due to a lack of contributions, cost-overrun and other reasons. + +That said, we compiled the below 10 best Linux distributions in 2022, which is perfect for any user or use case. That includes casual dual-boot users with Windows 10 or 11, students, teachers, developers, creators, etc. Take a look. + +### Best Linux Distributions of 2022 + +#### 1. Fedora KDE + +The first Linux distribution, which I think is the best on this list, is Fedora Linux KDE Edition. The primary reason is that the Fedora Linux is very stable with the latest tech, and KDE Plasma is super fast and perfect for all users. Moreover, this Fedora and KDE Plasma combination doesn’t require further modification or tweaks after installation. Over the last couple of releases and after the latest [Fedora 36][1] release feedback, Fedora Linux with KDE Plasma has become the go-to distribution for every possible use case and workflow. + +In addition, KDE Plasma also brings KDE Applications and goodies, eliminating additional software you need. And with the help of Fedora repo and [RPM Fusion][2], you can blindly trust Fedora Linux with KDE Edition for your daily driver. + +![Fedora KDE Edition][3] + +On a side note, you can also consider the [Fedora Linux workstation][4] edition with GNOME if you prefer a GNOME-styled desktop. In addition, you might consider other [Fedora Spins][5] or [Fedora Labs][6] if you like a different desktop flavour. + +You can download Fedora KDE Edition here. Other downloads with [torrent details][7] are present here. + +[Download Fedora][8] + +#### 2. KDE Neon + +The second distribution we would like to feature in this list is KDE Neon. The KDE Neon is based on the Ubuntu LTS release at its base. But the KDE Framework and KDE Applications with KDE Plasma desktop are the latest from the team. The primary reason for featuring this is that it is perfect for you if you want a Ubuntu LTS base distribution but want the latest KDE Applications. In fact, you can use it for your daily driver for years to come, provided you keep your system up to date. + +In contrast, the Kubuntu LTS releases are also perfect. But they may not have the latest KDE Framework or applications. + +![KDE Neon][9] + +You can download the KDE Neon at the below link. Make sure to choose the user edition while downloading. + +[Download KDE Neon][10] + +#### 3. Ubuntu LTS Releases with GNOME + +The Ubuntu LTS releases (with default GNOME Desktop) are the most used Linux Distribution today. It’s the most popular, most downloaded and used by users, enterprises and several real-world needs. + +There is no doubt about the Ubuntu LTS version’s power and stability. It has been time tested. With the vast community support, Ubuntu LTS versions with customised GNOME might be the perfect fit for your needs. + +Most of the third-party applications and games primarily target Ubuntu, and you get a much bigger support base compared to the all distribution in this list. But the recent trends of decisions from Canonical (Ubuntu’s creator), such as forcing users to adopt Snap and other stuff, may raise a concern for you if you are an advanced user. + +But for casual users who want to browse the internet, watch movies, listen to music and do personal work, you can blindly trust Ubuntu LTS versions as your best Linux distribution. + +![Ubuntu LTS with GNOME][11] + +Finally, you can download Ubuntu 22.04 LTS (the current one) using the below link. + +[Download Ubuntu][12] + +#### 4. Linux Mint Cinnamon + +One of the Linux distributions that “just works” out-of-the-box in “any” type of hardware. The Linux Mint is fourth on this list. The above three distributions (Fedora, Ubuntu LTS) may not work well in older hardware (PC or Laptop) having low memory and older CPU. But Linux Mint is perfect in those use cases with its unique ability to make everyone welcome. + +Furthermore, with Linux Mint, you do not need to install any additional applications after a fresh install. It comes with every possible driver and utility for all use cases. For example, your printer, webcam, and Bluetooth would work in Linux Mint. + +In addition, if you are new to Linux or Windows users who plan to migrate, then it is a perfect distribution to start. Its legacy menu-driven Cinnamon desktop is one of the best open-source desktops today. + +![Linux Mint Cinnamon Edition][13] + +If you ever get confused or have no time to choose which distribution is best for you, choose the Linux Mint Cinnamon edition. With that said, you can download Linux Mint using the below link. + +[Download Linux Mint][14] + +#### 5. Pop OS + +The Pop OS is developed by American computer manufacturer System76 for their hardware lineup. But it is one of the famous and emerging Linux distributions based on Ubuntu. The Pop OS is primarily known to have perfect for modern hardware (including NVIDIA graphics) and brings some unique features absent in the traditional Ubuntu with GNOME desktop. For example, you get a well-designed COSMIC desktop with Pop OS, built-in tiling feature, well-optimized power controls, and a stunning Pop Shop. The Pop Shop is a software store designed by its maker to give you a well-categorized set of applications for your study, learning, development, gaming, etc. This distribution is also perfect for gaming if you plan to start your Linux journey with gaming in mind. + +In addition, if you want to get a professional-grade Linux distribution with official help and support, you should check out actual System76 hardware with Pop OS. + +![Pop OS][15] + +However, you can download the Pop OS for various hardware for free using the link below. + +[Download Pop OS][16] + +#### 6. MX Linux + +MX Linux is a well designed Linux distribution primarily targeted at the older hardware with productivity and stability in mind. It’s an emerging Linux distribution that is free from systemd and uses the init system. Based on the Debian Stable branch, it brings Xfce Desktop, KDE Plasma desktop and Fluxbox with its own powerful MX utilities. + +You can use MX Linux for all of your needs. But I would not recommend it for gaming or development work. If you need a stable Linux distribution for your older hardware, free from systemd, you can choose MX Linux. Especially the Fluxbox edition. + +![MX Linux][17] + +You can download MX Linux from its official website below. + +[Download MX Linux][18] + +#### 7. Endeavour OS + +If you like the concept of “Rolling release”, which gives you all the latest packages and operating system components, then Arch Linux is perhaps the best you can have. However, installing Arch Linux might be tricky for new users, although the recent [archinstall][19] does a pretty job. + +However, EndeavourOS is a perfect Arch Linux based distribution which features Xfce, KDE Plasma and other popular desktops out of the box. Armed with the Calamares installer, it is super easy to install Endeavour OS. + +However, this might not be the best Linux distribution for beginners. But the best one for little advanced users who are familiar already with Linux in general. On the brighter side, you get to say, “btw, I use Arch”. + +![EndeavourOS][20] + +Last but not least, EndeavourOS has excellent community support, and its Telegram channel support is the best in my personal experience. So, if you ever get stuck, help is just a message away. + +Download this excellent and emerging Linux distribution using the link below. + +[Download Endeavour OS][21] + +#### 8. Zorin OS + +Zorin OS is a Linux distribution based on Ubuntu Linux and is best for those who want nice looks, power, stability, and a productive system. In this Linux distribution, the default desktop is a blend of Xfce and GNOME 3, heavily customised. One of the advantages of Zorin is it comes with ready-made themes. With those themes, you can make Zorin OS look like Windows and macOS with just one click. + +This helps the new users easily migrate to Linux and use Zorin for their day to day work. + +![Zorin OS][22] + +Other than that, Zorin OS maintains three editions – Pro, Lite and Core, which cater to the different user bases. The Pro edition is a paid version with additional themes and tweaks out of the box with a minimal fee. + +You can download Zorin OS from the below link. + +[Download Zorin OS][23] + +#### 9. Debian with Xfce + +There are many Linux Distribution which is based on Debian. But the only reason I have included vanilla Debian in this list is because of its excellent stability and power. Debian – termed a “Universal Operating System”, is perfect for moderately experienced users of Linux. But if you can set up a daily driver with Debian Stable with Xfce, you can run it for years without reformating or reinstalling for fear of breaking your system. + +Debian package repo contains all possible packages, which give you the ultimate flexibility to set up any custom system you want. + +![Debian with Xfce Desktop][24] + +A perfect Linux distribution if you know how to set up a Debian box with some experience. You can download and install Debian after choosing the proper installer for your system here. Debian comes with an installer for several architectures. You may [read our guide][25]if you are confused about which one to choose and how to install it. + +[Download Debian][26] + +#### 10. Ubuntu Studio + +The final best Linux distribution we feature in this list is Ubuntu Studio. Ubuntu Studio is an official Ubuntu Linux distribution specially curated for Multimedia production type of work. + +Ubuntu Studio comes with the low-latency mainline Linux Kernel to give additional advantage to multiple operations. In addition, Ubuntu Studio brings its native “Ubuntu Studio Controls”, which provides creators with several options to tweak CPU settings for heavy CPU intensive rendering and processing. + +![Ubuntu Studio 22.04 LTS Desktop][27] + +Moreover, a massive list of free and open-source audio, graphics, and video applications is pre-loaded into the ISO, saving time if you plan to build a multimedia workstation. + +Ubuntu Studio is powered by the KDE Plasma desktop, the perfect Linux distribution for all creators worldwide. + +You can download Ubuntu Studio from the below link. + +[Download Ubuntu Studio][28] + +### Closing Notes + +I hope this list of “curated and best Linux distributions” helps you pick one for yourself, your friends and co-workers. These are based on their current status (active project), prospects (i.e. it has a well-defined vision for the future) and how easy to set up and out-of-the-box experience. + +Finally, which Linux distribution do you think should be in the top 10 list? Let me know in the comment box below. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/best-linux-distributions-2022/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/2022/02/fedora-36/ +[2]: https://www.debugpoint.com/2020/07/enable-rpm-fusion-fedora-rhel-centos/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/Fedora-KDE-Edition.jpg +[4]: https://getfedora.org/en/workstation/download/ +[5]: https://spins.fedoraproject.org/ +[6]: https://labs.fedoraproject.org/ +[7]: https://torrent.fedoraproject.org/ +[8]: https://spins.fedoraproject.org/kde/download/index.html +[9]: https://www.debugpoint.com/wp-content/uploads/2022/05/KDE-Neon.jpg +[10]: https://neon.kde.org/download +[11]: https://www.debugpoint.com/wp-content/uploads/2022/05/Ubuntu-LTS-with-GNOME.jpg +[12]: https://ubuntu.com/download/desktop +[13]: https://www.debugpoint.com/wp-content/uploads/2022/05/Linux-Mint-Cinnamon-Edition.jpg +[14]: https://linuxmint.com/download.php +[15]: https://www.debugpoint.com/wp-content/uploads/2022/05/Pop-OS.jpg +[16]: https://pop.system76.com/ +[17]: https://www.debugpoint.com/wp-content/uploads/2022/05/MX-Linux.jpg +[18]: https://mxlinux.org/download-links/ +[19]: https://www.debugpoint.com/2022/01/archinstall-guide/ +[20]: https://www.debugpoint.com/wp-content/uploads/2022/05/EndeavourOS.jpg +[21]: https://endeavouros.com/download/ +[22]: https://www.debugpoint.com/wp-content/uploads/2022/05/Zorin-OS.jpg +[23]: https://zorin.com/os/download/ +[24]: https://www.debugpoint.com/wp-content/uploads/2022/05/Debian-with-Xfce-Desktop.jpg +[25]: https://www.debugpoint.com/2021/01/install-debian-buster/ +[26]: https://www.debian.org/distrib/ +[27]: https://www.debugpoint.com/wp-content/uploads/2022/04/Ubuntu-Studio-22.04-LTS-Desktop.jpg +[28]: https://ubuntustudio.org/download/ diff --git a/sources/tech/20220516 -Extension Manager- App Helps You Install and Manage GNOME Shell Extensions.md b/sources/tech/20220516 -Extension Manager- App Helps You Install and Manage GNOME Shell Extensions.md new file mode 100644 index 0000000000..f2fcedf69d --- /dev/null +++ b/sources/tech/20220516 -Extension Manager- App Helps You Install and Manage GNOME Shell Extensions.md @@ -0,0 +1,116 @@ +[#]: subject: "‘Extension Manager’ App Helps You Install and Manage GNOME Shell Extensions" +[#]: via: "https://itsfoss.com/extension-manager/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +‘Extension Manager’ App Helps You Install and Manage GNOME Shell Extensions +====== +Brief: Extension Manager is an exciting unofficial alternative to GNOME’s official Extensions app to help you manage GNOME shell extensions. Let’s take a closer look. + +GNOME extensions are incredibly useful. Of course, using many of them may not be the best solution to your problem. + +However, if you rely on the GNOME extensions to tweak your desktop workflow on any Linux distribution, a convenient option to manage all the extensions should help save your time. + +The GNOME team already offers you an “**Extensions**” app to configure and manage GNOME extensions. But, it does not come pre-installed on every Linux distribution. + +So, should you use the official Extensions app, or is there something better? + +Well, technically, it depends on your use case and requirements. But, there’s an **“Extension Manager**” that helps you manage GNOME Shell extensions while also allowing you to search and install new extensions without using the browser. + +![extension manager ft][1] + +### Extension Manager: An Alternative to “Extensions” + +If you already have “Extensions” installed, you may not have a big reason to use this. + +However, with the Extension Manager by **Matt Jakeman**, you get a useful app to easily enable/disable, configure, and install/uninstall new GNOME extensions. + +You no longer need to follow the usual [method to install GNOME extensions][2] that involve a web page, a browser add-on, and more. + +It offers a separate tab to search and install GNOME extensions available. + +![extension manager search][3] + +As you can notice in the screenshot above, you do not have to tweak the GNOME Shell version number and see if it is supported. This app directly highlights if the extension is supported on your system. + +So, you can easily explore the [best GNOME extensions][4] and see if it works for you. + +Furthermore, you can also explore more about an extension when clicking on it. It could improve the way the information is presented, but it should be good enough for most. + +![extension manager info][5] + +### Features of Extension Manager + +![extension manager about][6] + +To sum up the features: + +* Configure existing/pre-installed GNOME extensions. +* Enable/Disable shell extensions. +* Ability to search for new extensions from the web. +* Install new extensions from the web. +* Choose the app theme as per your preference or follow the system theme. +* Update the extension from within the app. + +### Extensions vs. Extension Manager: What’s the difference? + +If you’re wondering: what’s the difference between Extensions and Extension Manager? + +Here’s a **screenshot comparison**: + +![extensions gnome][7] + +![extension manager][8] + +Overall, the user interface is a bit different. But it’s mostly the same, minus the ability to search/install GNOME extensions from the web. + +However, you can toggle the theme to light/dark (or follow the system preference) with Extension Manager. With Extensions, the app tracks the system theme by default. + +### Install Extension Manager on Linux + +Using the official repositories, you can easily install the extension manager on [Ubuntu 22.04 LTS][9]. + +So, you can look for it in the software center or install it via the terminal using the following command: + +``` +sudo apt install gnome-shell-extension-manager +``` + +For any other Linux distribution, you can refer to our [Flatpak guide][10] and install the Flatpak package available on [Flathub][11]. + +You should also find it available in [AUR][12] for Arch Linux distros. + +Head to its [GitHub page][13] to explore more about the app and other installation methods. + +*What do you prefer to help manage GNOME shell extensions? Feel free to share your thoughts in the comments.* + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/extension-manager/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/05/extension-manager-ft.png +[2]: https://itsfoss.com/gnome-shell-extensions/ +[3]: https://itsfoss.com/wp-content/uploads/2022/05/extension-manager-search.png +[4]: https://itsfoss.com/best-gnome-extensions/ +[5]: https://itsfoss.com/wp-content/uploads/2022/05/extension-manager-info.png +[6]: https://itsfoss.com/wp-content/uploads/2022/05/extension-manager-about.jpg +[7]: https://itsfoss.com/wp-content/uploads/2022/05/extensions-gnome.png +[8]: https://itsfoss.com/wp-content/uploads/2022/05/extension-manager.png +[9]: https://itsfoss.com/ubuntu-22-04-release-features/ +[10]: https://itsfoss.com/flatpak-guide/ +[11]: https://flathub.org/apps/details/com.mattjakeman.ExtensionManager +[12]: https://itsfoss.com/aur-arch-linux/ +[13]: https://github.com/mjakeman/extension-manager diff --git a/sources/tech/20220516 How to Dual Boot Ubuntu 22.04 LTS and Windows 11.md b/sources/tech/20220516 How to Dual Boot Ubuntu 22.04 LTS and Windows 11.md new file mode 100644 index 0000000000..0a13767da7 --- /dev/null +++ b/sources/tech/20220516 How to Dual Boot Ubuntu 22.04 LTS and Windows 11.md @@ -0,0 +1,194 @@ +[#]: 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: " " +[#]: publisher: " " +[#]: url: " " + +How to Dual Boot Ubuntu 22.04 LTS and Windows 11 +====== +Hey guys, in this guide we will demonstrate how to configure a dual-boot setup of Ubuntu 22.04 LTS (Jammy Jellyfish) alongside Windows 11. + +For this to work, you need to have Windows 11 already installed on your PC.  You will then need to create a separate partition on your hard drive on which Ubuntu 22.04 will be installed. We will go over all this, so don’t worry. + +##### Prerequisites  + +Before setting sail with the dual-boot setup, here is what you need. + +* A bootable USB drive of Ubuntu 22.04 You can download Ubuntu 22.04 ISO image by heading over to the [Ubuntu 22.04 download page][1]. With the ISO image in place, grab a 16GB USB drive and use  Rufus application to make it bootable. + +* A fast and stable internet connection + +### Step 1) Create a Free Partition on Your Hard Drive  + +As mentioned in the introduction, we first and foremost need to create a separate partition on the hard drive on which we are going to install Ubuntu 22.04. + +So, open the disk management utility by pressing Windows Key + R + +In the dialogue box, type diskmgmt.msc and hit ENTER. + +![][2] + +The disk management console displays the current disk partitions as you can see below. We are going to create a partition for installing Ubuntu by Shrinking ‘Volume E’. This might be different in your setup, but just follow along and you will get the drift. + +![][3] + +So, right-click on the volume that you want to shrink and select ‘Shrink’. + +![][4] + +A pop-up dialogue box will appear as shown below. Specify the amount of space to shrink in MB and click ‘Shrink’. + +This is the space that is designated for the Ubuntu 22.04 installation. + +![][5] + +After shrinking the space, it will appear as ‘Unallocated’ or ‘Free Space’ as shown. + +![][6] + +With the free space in place, now plug the bootable USB medium into your PC and reboot your system. Also, be sure to access the BIOS setup and modify the boot priority to have the USB drive as the first priority. Save the BIOS changes and proceed to boot. + +### Step 2) Begin the installation + +On the first screen, you will get the GRUB menu displayed as shown. Select the first option ‘Try or Install Ubuntu’ and press ENTER. + +![][7] + +Ubuntu 22.04 will start loading as shown below. This takes a minute at most. + +![][8] + +Thereafter, the installation wizard will pop open providing you with two options: ‘Try Ubuntu’ and ‘Install Ubuntu’.  Since our mission is to install Ubuntu, select the latter. + +![][9] + +Next, select your preferred Keyboard layout and click ‘Continue’. + +![][10] + +In the ‘Updates and Other Software’ step, select ‘Normal Installation’ in order to install the GUI version of Ubuntu and check the rest of the options to allow download of updates and installation of third-party software for graphics, WiFi hardware and other utilities. + +Then click ‘Continue’. + +![][11] + +The next step provides two options for installation. The first option -’Erase disk and install Ubuntu’ – completely wipes out your drive and installs Ubuntu’. But since this is a dual boot setup, this option will be disastrous to your existing Windows installation. + +Therefore, select ‘Something else’ and click ‘Continue’. + +![][12] + +The partition table will be displayed with all the existing disk partitions. So far, we only have the NTFS partitions and the free space we shrunk earlier. + +For Ubuntu 22.04, we will create the following partitions: + +* /boot        –        1 GB +* /home        –        10 GB +* /            –        12 GB +* Swap         –         2 GB +* EFI          –       300 MB + +To get started with the partitions, click on the [ + ] sign below the ‘Free Space’ partition. + +![][13] + +Fill in the /boot partition details as shown then click ‘OK’. + +![][14] + +Next up, specify the /home partition and click ‘OK’. + +![][15] + +Next, define the / ( root ) partition and click ‘OK’. + +![][16] + +To define swap space, set the size and select ‘Swap area’ for the ‘Use as:’ option. + +![][17] + +Finally, create an EFI system partition if you are using UEFI boot mode. We will assign 300 MB to the EFI partition. + +![][18] + +Below is a summary of the partitions in our partition table. + +![][19] + +To continue with the installation, click ‘Install Now’. On the pop-up shown below, click ‘Continue’ to save the changes to the disk. + +![][20] + +Next, the installation wizard will auto-detect your location. Simply click ‘Continue’. + +![][21] + +Next, create a login user by specifying the name, computer’s name and password. Then click ‘Continue’. + +![][22] + +At this point, the installation wizard will copy all the Ubuntu files and packages to the manually created hard drive partitions and install the required software packages. + +This process takes quite a while, so be patient. In our case, it took roughly 30 minutes. + +![][23] + +Once the installation is completed, click on ‘Restart Now’ to reboot the system. + +![][24] + +At this point, remove your bootable USB drive and press ‘ENTER’ + +![][25] + +When the system restarts, you will find all options for both Ubuntu and Windows 11. + +Select ‘Ubuntu’ to boot into your new Ubuntu 22.04 installation. To boot into Windows 11, select the entry labeled ‘Windows Recovery Environment. + +![][26] + +And there you have it. We have demonstrated how to dual-boot Windows 11 with Ubuntu 22.04. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/dual-boot-ubuntu-22-04-and-windows-11/ + +作者:[James Kiarie][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/james/ +[b]: https://github.com/lkxed +[1]: https://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/sources/tech/20220516 How to rebase to Fedora Linux 36 on Silverblue.md b/sources/tech/20220516 How to rebase to Fedora Linux 36 on Silverblue.md new file mode 100644 index 0000000000..a09955f6ab --- /dev/null +++ b/sources/tech/20220516 How to rebase to Fedora Linux 36 on Silverblue.md @@ -0,0 +1,102 @@ +[#]: subject: "How to rebase to Fedora Linux 36 on Silverblue" +[#]: via: "https://fedoramagazine.org/how-to-rebase-to-fedora-linux-36-on-silverblue/" +[#]: author: "Michal Konečný https://fedoramagazine.org/author/zlopez/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to rebase to Fedora Linux 36 on Silverblue +====== +![][1] + +Fedora Silverblue is [an operating system for your desktop built][2][on Fedora Linux][3]. It’s excellent for daily use, development, and container-based workflows. It offers [numerous advantages][4] such as being able to roll back in case of any problems. If you want to update or rebase to Fedora Linux 36 on your Fedora Silverblue system (these instructions are similar for Fedora Kinoite), this article tells you how. It not only shows you what to do, but also how to revert things if something unforeseen happens. + +Prior to actually doing the rebase to Fedora Linux 36, you should apply any pending updates. Enter the following in the terminal: + +``` +$ rpm-ostree update +``` + +or install updates through GNOME Software and reboot. + +### Rebasing using GNOME Software + +GNOME Software shows you that there is new version of Fedora Linux available on the Updates screen. + +![Fedora 36 update available][5] + +First thing you need to do is download the new image, so click on the *Download* button. This will take some time. When it’s done you will see that the update is ready to install. + +![Fedora 36 update ready to install][6] + +Click on the *Restart & Upgrade* button. This step will take only a few moments and the computer will be restarted at the end. After restart you will end up in new and shiny release of Fedora Linux 36. Easy, isn’t it? + +### Rebasing using terminal + +If you prefer to do everything in a terminal, then this part of the guide is for you. + +Rebasing to Fedora Linux 36 using the terminal is easy. First, check if the 36 branch is available: + +``` +$ ostree remote refs fedora +``` + +You should see the following in the output: + +``` +fedora:fedora/36/x86_64/silverblue +``` + +If you want to pin the current deployment (this deployment will stay as option in GRUB until you remove it), you can do it by running: + +``` +$ sudo ostree admin pin 0 +``` + +To remove the pinned deployment use the following command: + +``` +$ sudo ostree admin pin --unpin 2 +``` + +where 2 is the position in the $rpm-ostree status + +Next, rebase your system to the Fedora Linux 36 branch. + +``` +$ rpm-ostree rebase fedora:fedora/36/x86_64/silverblue +``` + +Finally, the last thing to do is restart your computer and boot to Fedora Linux 36. + +### How to roll back + +If anything bad happens—for instance, if you can’t boot to Fedora Linux 36 at all—it’s easy to go back. Pick the previous entry in the GRUB menu at boot (if you don’t see it, try to press ESC during boot), and your system will start in its previous state before switching to Fedora Linux 36. To make this change permanent, use the following command: + +``` +$ rpm-ostree rollback +``` + +That’s it. Now you know how to rebase Fedora Silverblue to Fedora Linux 36 and roll back. So why not do it today? + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-to-rebase-to-fedora-linux-36-on-silverblue/ + +作者:[Michal Konečný][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/zlopez/ +[b]: https://github.com/lkxed +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/silverblue-rebase-816x345.jpg +[2]: https://docs.fedoraproject.org/en-US/fedora-silverblue/ +[3]: https://docs.fedoraproject.org/en-US/fedora-silverblue/ +[4]: https://fedoramagazine.org/give-fedora-silverblue-a-test-drive/ +[5]: https://fedoramagazine.org/wp-content/uploads/2022/05/Screenshot-from-2022-05-11-09-33-55.png +[6]: https://fedoramagazine.org/wp-content/uploads/2022/05/Screenshot-from-2022-05-11-09-40-07.png diff --git a/sources/tech/20220516 Use Composer to require Git repositories within PHP projects.md b/sources/tech/20220516 Use Composer to require Git repositories within PHP projects.md new file mode 100644 index 0000000000..1604430b42 --- /dev/null +++ b/sources/tech/20220516 Use Composer to require Git repositories within PHP projects.md @@ -0,0 +1,228 @@ +[#]: subject: "Use Composer to require Git repositories within PHP projects" +[#]: via: "https://opensource.com/article/22/5/composer-git-repositories" +[#]: author: "Jonathan Daggerhart https://opensource.com/users/daggerhart" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Use Composer to require Git repositories within PHP projects +====== +This dependency management tool makes it easier to require a repository even when it hasn't been created as a package. + +![young woman working on a laptop][1] + +Image by: CC BY 3.0 US Mapbox Uncharted ERG + +The dependency management tool [Composer][2] provides multiple ways to include Git repositories within a PHP: Hypertext Preprocessor (PHP) project. + +In many cases, repositories have been created on Packagist, so requiring them with Composer is very straightforward. But what do you do when a repository has not been created as a package on Packagist? You use Composer to require the package directly from the repository. This article explains how. + +Note: Some of the terminology in this post is confusing because multiple words are used to describe different things. Here is a quick vocabulary list that will help: + +* Project: The custom software you are building. This can be a website, a command-line utility, an application, or anything else you dream up. +* Package: Any third-party software you want to download and use within your project. It can be a library, Drupal theme, WordPress plugin, or any other number of things. +* Git repository: Also called the Git repo, this is the version-control host for a package. Common hosts include GitHub, GitLab, or Bitbucket, but any URL-accessible Git repository will work for this tutorial. +* Composer repositories: In a composer.json file, there is an optional property named "repositories." This property is where you can define new places for Composer to look when downloading packages. + +``` +composer.json +``` + +When adding a Git repo to your project with Composer, you can find yourself in two situations: Either the repo contains a `composer.json` file, which defines how the repo should be handled when required, or it does not. You can add the Git repository to your project in both cases, with different methods. + +### Git repo with composer.json + +When a repository includes a `composer.json` file, it defines aspects of itself that are important to how Composer manages the package. Here is an example of a simple `composer.json` file a package may include: + +``` +{ + "name": "mynamespace/my-custom-library", + "type": "library" +} +``` + +This example shows two important properties that a `composer.json` file can define: + +* Name: The package's namespaced name. In this case, "mynamespace" is the namespace for the package "my-custom-library." +* Type: The type of package the repo represents. Package types are used for installation logic. Out of the box, Composer allows for the following package types: library, project, metapackage, and composer-plugin. + +You can verify this by looking at the `composer.json` file of any popular GitHub project. They each define their package name and the package type near the top of the file. When a repository has this information defined in its `composer.json` file, requiring the repository within your project is quite simple. + +### Require a Git repository that has a composer.json file + +After you've identified a Git repository with a `composer.json` file, you can require that repository as a package within your project. + +Within your project's `composer.json` file, you need to define a new property (assuming it doesn't exist already) named "repositories." The value of the repositories property is an array of objects, each containing information about the repository you want to include in your project. Consider this `composer.json` file for your custom project. + +``` +{ + "name": "mynamespace/my-project-that-uses-composer", + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/mynamespace/my-custom-library.git" + } + ], + "require": { + "mynamespace/my-custom-library": "dev-master" + } +} +``` + +You are doing two important things here. First, you're defining a new repository that Composer can reference when requiring packages. And second, you're requiring the package from the newly defined repository. + +Note: The package version is a part of the require statement and not a part of the repository property. You can require a specific branch of a repo by choosing a version named "dev-". + +If you were to run `composer install` in the context of this file, Composer would look for a project at the defined URL. If that URL represents a Git repo that contains a `composer.json` file that defines its name and type, Composer will download that package to your project and place it in the appropriate location. + +### Custom package types + +The example package shown above is of the type "library," but with WordPress and Drupal you're dealing with plugins, modules, and themes. When requiring special package types in your project, it's important to install them in specific locations within the project file structure. Wouldn't it be nice if you could convince Composer to treat these types of packages as special cases? Well, you're in luck. There is an official Composer plugin that will do that for you. + +The [Installers][3] plugin for Composer contains the custom logic required for handling many different package types for a large variety of projects. It is extremely helpful when working with projects that have well-known and supported package installation steps. + +This project allows you to define package types like drupal-theme, drupal-module, wordpress-plugin, wordpress-theme, and many more, for a variety of projects. In the case of a drupal-theme package, the Installers plugin will place the required repo within the `/themes/contrib` folder of your Drupal installation. + +Here is an example of a `composer.json` file that might live within a Drupal theme project as its own Git repository: + +``` +{ + "name": "mynamespace/whatever-i-call-my-theme", + "type": "drupal-theme", + "description": "Drupal 8 theme", + "license": "GPL-2.0+" +} +``` + +Note that the only meaningful difference here is that the type is now drupal-theme. With the drupal-theme type defined, any project that uses the Installers plugin can easily require your repo in its Drupal project, and it will be treated as a contributed theme. + +### Require any Git repository with Composer + +What happens when the repo you want to include in your project does not define anything about itself with a `composer.json` file? When a repo does not define its name or type, you have to define that information for the repo within your project's `composer.json` file. Take a look at this example: + +``` +{ + "name": "mynamespace/my-project-that-uses-composer", + "repositories": [ + { + "type": "package", + "package": { + "name": "mynamespace/my-custom-theme", + "version": "1.2.3", + "type": "drupal-theme", + "source": { + "url": "https://github.com/mynamespace/my-custom-theme.git", + "type": "git", + "reference": "master" + } + } + } + ], + "require": { + "mynamespace/my-custom-theme": "^1", + "composer/installers": "^1" + } +} +``` + +Notice that your repository type is now "package." That is where you will define everything about the package you want to require. + +Create a new object named "package" where you define all the essential information that Composer needs to know to be able to include this arbitrary git repo within your project, including: + +* Name: The namespaced package name. It should probably match the repository you're requiring but doesn't have to. +* Type: The type of package. This reflects how you want Composer to treat this repository. +* Version: A version number for the repo. You will need to make this up. +* Source: An object that contains the following repository information: + +URL: The Git or other version-control system (VCS) URL where the package repo can be found +Type: The VCS type for the package, such as git, svn, cvs, and so on +Reference: The branch or tag you want to download +* URL: The Git or other version-control system (VCS) URL where the package repo can be found +* Type: The VCS type for the package, such as git, svn, cvs, and so on +* Reference: The branch or tag you want to download + +* URL: The Git or other version-control system (VCS) URL where the package repo can be found +* Type: The VCS type for the package, such as git, svn, cvs, and so on +* Reference: The branch or tag you want to download + +I recommend reviewing the [official documentation][4] on Composer package repositories. Note that it is possible to include zip files as Composer packages as well. Essentially, you are now responsible for all parts of how Composer treats this repository. Since the repository itself is not providing Composer with any information, you are responsible for determining almost everything, including the current version number for the package. + +This approach allows you to include almost anything as a Composer package in your project, but it has some notable drawbacks: + +* Composer will not update the package unless you change the version field. +* Composer will not update the commit references. If you use master as a reference, you will have to delete the package to force an update, and you will have to deal with an unstable lock file. + +``` +version +``` + +``` +master +``` + +### Custom package versions + +Maintaining the package version in your `composer.json` file isn't always necessary. Composer is smart enough to look for GitHub releases and use them as the package versions. But eventually you will likely want to include a simple project that has only a few branches and no official releases. + +When a repository does not have releases, you will be responsible for deciding what version the repository branch represents to your project. In other words, if you want composer to update the package, you will need to increment the "version” defined in your project's `composer.json` file before running `composer update`. + +### Overriding a Git repository's composer.json + +When defining a new Composer repository of the type package, you can override a package's own `composer.json` definitions. Consider a Git repository that defines itself as a library in its `composer.json`, but you know that the code is actually a drupal-theme. You can use the above approach to include the Git repository within your project as a drupal-theme, allowing Composer to treat the code appropriately when required. + +Example: Require Guzzle as a drupal-theme just to prove that you can. + +``` +{ + "name": "mynamespace/my-project-that-uses-composer", + "repositories": [ + { + "type": "package", + "package": { + "name": "mynamespace/guzzle-theme", + "version": "1.2.3", + "type": "drupal-theme", + "source": { + "url": "https://github.com/guzzle/guzzle.git", + "type": "git", + "reference": "master" + } + } + } + ], + "require": { + "mynamespace/guzzle-theme": "^1", + "composer/installers": "^1" + } +} +``` + +This works! You've downloaded the Guzzle library and placed it within the `/themes` folder of your Drupal project. This is not a very practical example, but it highlights how much control the package type approach provides. + +### Summary + +Composer offers plenty of options for including arbitrary packages within a project. Determining how those packages are included in the project primarily comes down to who defines the package information. If the Git repository includes a `composer.json` file that defines its name and type, you can have Composer rely on the repository itself for the definition. + +But if you want to include a repository that does not define its name and type, then it is up to your project to define and maintain that information for your own internal use. Alternatively, if a repository doesn't define a `composer.json` file, consider submitting a pull request that adds it. + +*This article originally appeared on the Daggerhart Lab blog and is republished with permission.* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/composer-git-repositories + +作者:[Jonathan Daggerhart][a] +选题:[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/daggerhart +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/lenovo-thinkpad-laptop-window-focus.png +[2]: https://getcomposer.org/ +[3]: https://github.com/composer/installers +[4]: https://getcomposer.org/doc/05-repositories.md#package-2 diff --git a/sources/tech/20220517 Top 10 Best GNOME Extensions in 2022.md b/sources/tech/20220517 Top 10 Best GNOME Extensions in 2022.md new file mode 100644 index 0000000000..b05583366a --- /dev/null +++ b/sources/tech/20220517 Top 10 Best GNOME Extensions in 2022.md @@ -0,0 +1,196 @@ +[#]: subject: "Top 10 Best GNOME Extensions in 2022" +[#]: via: "https://www.debugpoint.com/2022/05/gnome-extensions-2022/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top 10 Best GNOME Extensions in 2022 +====== +You can try a list of 10 finest GNOME Extensions in 2022 in Ubuntu, Fedora, and other Linux distributions. Take a look. + +It’s time to refresh the list of best GNOME Extensions that we [featured][1] sometime back. The primary reason is the iconic GNOME 42 release that brings GTK4, libadwaita, native dark style and much more updates. + +As GNOME progresses towards a more user-friendly experience, the extension ecosystem also evolves with updated features and extensions for the latest GNOME desktop. Many extensions were discontinued because of lack of interest or simply not being relevant with GNOME versions. + +One of the critical aspects of extension is that with every new GNOME release, the extensions require updates conforming to the latest GNOME version. At the same time, this ensures quality but is also a little difficult for the developer to keep up with two major GNOME releases per year. + +If my math is correct, there are about 400+ extensions present on the official website for all possible tweaks in the GNOME desktop. Hence, we list the 10 best GNOME Extensions that you can try out in Ubuntu Linux, Fedora Workstation, openSUSE or any Linux distribution with a GNOME desktop environment. + +*Note: These GNOME extensions are tested with GNOME 42.* + +### Top 10 GNOME Extensions in 2022 (for everyone) + +The following list of extensions requires initial setup for GNOME extensions which you need to enable as per your Linux distribution. Refer [to this guide for the initial setup][2]. Moreover, to manage these extensions, you should install the [Extensions][3] app from Flathub. + +#### 1. Arc Menu + +The popular Arc Menu GNOME Extension gives you a traditional desktop menu from the modern GNOME desktop panel. It brings well-categorised menu items with installed applications in your system. Arc menu is one of the best GNOME Extensions, which is a must for every workflow. + +A shortcut for the activities overview of GNOME is a nifty feature which is a plus. Moreover, Arc Menu also gives you a search bar which kicks off when you start typing for easy navigation. In addition, you get the logout, restart, lock and power off the menu at the bottom of the Arc Menu. + +Here’s how it looks. + +Try [Arc Menu][4] in GNOME Extension. + +![Arc Menu GNOME Extension][5] + +#### 2. Dash to Panel + +The second extension in this list is the famous “Dash to Panel”, a fixed panel for the GNOME desktop that combines the default dock and top panel. It is essential for the GNOME desktop because it gives you much bigger flexibility in your workflow. With its extensive options such as position, colour, transparency, size, etc., you can make your panel look like anything. + +One of the best GNOME extensions, and you can download it from here. + +[Dash to Panel][6] + +![Dash to Panel with its settings][7] + +#### 3. Blur My Shell + +If you want the ultimate blur effect in the entire GNOME desktop, you should install ‘Blur My Shell’. As its name says, it blurs the application overview screen, application view and the default top panels. + +In addition, you can also control the blur intensity, and brightness with this extension. If you use the Dash to Dock extension, you can also blur the dock! + +Here’s a side by side view of how it looks without blur and with blur effects. + +[Blur My Shell][8] + +![][9] + +![][10] + +#### 4. Floating Dock + +If you want a different type of dock for your GNOME desktop, try Floating Dock. As its name suggests, it creates a dock that floats on your desktop. Moreover, you can easily use the drag handle to place it anywhere. + +One of the exciting features is that this extension gives you the flexibility to change the pop out direction of the dock. For example, you can change the dock to expand to the right side via its context menu (which opens via a right-click on the dock handle). + +[Floating Dock][11] + +![Floating Dock][12] + +![Floating dock position change][13] + +#### 5. Gnome 4x UI Improvements + +The fifth extension is a combination of several tweaks for your GNOME desktop. Using the GNOME 4x UI Improvements, you can do the followings. + +* Hide the application view search bar +* Increase the desktop thumbnail scale in the overview +* Change the desktop thumbnail background +* Hide thumbnail when there is only one workspace +* And display Firefox PIP (picture in picture) window in the overview! + +These are neat features that give a cleaner look to the GNOME desktop. + +Here is a side-by-side view of the extension with all its options enabled (before and after). + +[GNOME 40x UI Improvements][14] + +![Before GNOME 40x UI Improvements][15] + +![GNOME 40x UI Improvements][16] + +#### 6. User Themes + +If you plan to use any custom GNOME Shell themes, you need an extension. It helps you apply the custom Shell themes quickly unless you try it via GNOME Tweaks. Moreover, you can use the GNOME Classic themes as well. + +An extension that is a must for custom themes, and try it [from this link][17]. + +![User Themes Extension][18] + +#### 7. Desktop Icons NG (DING) + +If you are one of those folks who like icons on the desktop and feel little comfortable with items in the desktop, then this is a perfect extension for you. The Desktop Icons bring back the original desktop icons with drag and drop features. Moreover, you can also tweak it further to change the size of the desktop icons, alignment and other additional features, as shown below. + +One of the best extensions that is available today. + +[Desktop Icons NG (DING)][19] + +![Desktop Icons Extension][20] + +#### 8. GSConnect + +GSConnect is a complete implementation of the [KDE Connect][21]application. The GSConnect helps you connect your Android device to get alerts and notifications at your GNOME desktop. In addition, GSCOnnect seamlessly integrates with Nautilus, Google Chrome and Firefox. Furthermore, using GSConnect it is possible to remote control your Android mobile phone, share a clipboard, reply to SMSes and many additional features. + +One of the must-have Extensions for productive work. + +[GSConnect Extension][22] + +![GSConnect (Image credit: developer)][23] + +#### 9. Clipboard Indicator + +Clipboard indicator is one of the best among GNOME Extensions which gives you a running list of Clipboard history in your system. Ideal for heavy work, it gives you options for the number of items in the list, refreshes interval, option to clear history and many such features as in the below image. + +You can try it here: [Clipboard Indicator][24]. + +![Clipboard Indicator GNOME Extension][25] + +#### 10. Vitals + +The final extension in the list of Top 10 Extensions is Vitals. Vitals helps you to monitor your system hardware metric from the system tray. You can check the temperature, voltage, fan speed, storage utilisation and many more features. Furthermore, you can change the position of the Vitals menu and tweak the refresh internal and some more features as below. + +[Vitals][26] + +![Vitals – GNOME Extensions][27] + +Finally, here are another 5 GNOME Extensions which you may want to try. These are simple, but they are handy. + +#### Bonus GNOME Extensions + +11. [Net Speed SImplified][28]: Shows the internet upload and download speed at the top panel, near the system tray.12. [Espresso][29]: A perfect extension helps you disable the screensaver and stand-by modes. FOr example, if you are watching Netflix or any videos and don’t want the screensaver to kick in.13. [OpenWeather][30]: Shows weather forecast and information from any location from Planet Earth at the top bar of GNOME Shell.14.[Tray Icons: Reloaded][31]: If you miss the tray icons for applications, try this extension. One of the best ones on the list.15. [Lock Keys][32]: Finally, if you need an indicator for CAPS and NUM lock keys at the system tray, use this Extension. + +### Closing Notes + +It isn’t easy to filter out the best 10 from hundreds of extensions. Also, the choice is different for everyone. With that said, I hope you find this list of best GNOME Extensions in 2022 helpful and get to use them in your daily workflow. + +What are your favourite GNOME extensions of all time? Let me know in the comment section below. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/gnome-extensions-2022/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/2021/04/gnome-40-extensions/ +[2]: https://www.debugpoint.com/2018/05/how-to-install-and-use-gnome-shell-extensions-in-ubuntu/ +[3]: https://flathub.org/apps/details/org.gnome.Extensions +[4]: https://extensions.gnome.org/extension/3628/arcmenu/ +[5]: https://www.debugpoint.com/wp-content/uploads/2022/05/Arc-Menu-GNOME-Extension.jpg +[6]: https://extensions.gnome.org/extension/1160/dash-to-panel/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/05/Dash-to-Panel-with-its-settings.jpg +[8]: https://extensions.gnome.org/extension/3193/blur-my-shell/ +[9]: https://www.debugpoint.com/wp-content/uploads/2022/05/Before-Blur-My-Shell-Extension.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/05/Blur-My-Shell-Extension.jpg +[11]: https://extensions.gnome.org/extension/2542/floating-dock/ +[12]: https://www.debugpoint.com/wp-content/uploads/2021/04/Floating-Dock.gif +[13]: https://www.debugpoint.com/wp-content/uploads/2022/05/Floating-dock-position-change.gif +[14]: https://extensions.gnome.org/extension/4158/gnome-40-ui-improvements/ +[15]: https://i2.wp.com/www.debugpoint.com/wp-content/uploads/2022/05/Before-GNOME-40x-UI-Improvements.jpg?ssl=1 +[16]: https://i1.wp.com/www.debugpoint.com/wp-content/uploads/2022/05/GNOME-40x-UI-Improvements.jpg?ssl=1 +[17]: https://extensions.gnome.org/extension/19/user-themes/ +[18]: https://www.debugpoint.com/wp-content/uploads/2022/05/User-Themes-Extension.jpg +[19]: https://extensions.gnome.org/extension/2087/desktop-icons-ng-ding/ +[20]: https://www.debugpoint.com/wp-content/uploads/2022/05/Desktop-Icons-Extenstion.gif +[21]: https://www.debugpoint.com/2022/01/kde-connect-guide/ +[22]: https://extensions.gnome.org/extension/1319/gsconnect/ +[23]: https://www.debugpoint.com/wp-content/uploads/2022/05/GSConnect-Image-credit-developer.jpg +[24]: https://extensions.gnome.org/extension/779/clipboard-indicator/ +[25]: https://www.debugpoint.com/wp-content/uploads/2022/05/Clipboard-Indicator-GNOME-Extension.jpg +[26]: https://extensions.gnome.org/extension/1460/vitals/ +[27]: https://www.debugpoint.com/wp-content/uploads/2022/05/Vitals-GNOME-Extensions-2.jpg +[28]: https://extensions.gnome.org/extension/3724/net-speed-simplified/ +[29]: https://extensions.gnome.org/extension/4135/espresso/ +[30]: https://extensions.gnome.org/extension/750/openweather/ +[31]: https://extensions.gnome.org/extension/2890/tray-icons-reloaded/ +[32]: https://extensions.gnome.org/extension/1532/lock-keys/ diff --git a/sources/tech/20220517 Travel off the grid and still send emails with putmail.md b/sources/tech/20220517 Travel off the grid and still send emails with putmail.md new file mode 100644 index 0000000000..cc96281798 --- /dev/null +++ b/sources/tech/20220517 Travel off the grid and still send emails with putmail.md @@ -0,0 +1,79 @@ +[#]: subject: "Travel off the grid and still send emails with putmail" +[#]: via: "https://opensource.com/article/22/5/send-email-putmail" +[#]: author: "Kevin Sonney https://opensource.com/users/ksonney" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Travel off the grid and still send emails with putmail +====== +Configure your mail client to automatically send emails next time you have an internet connection. + +![Chat via email][1] + +*Automation is a hot topic right now. In my day job as an SRE part of my remit is to automate as many repeating tasks as possible. But how many of us do that in our daily, not-work, lives? This year, I am focused on automating away the toil so that we can focus on the things that are important.* + +In "normal times" my wife and I travel a lot. And as anyone who similarly travels a lot knows, connectivity can be very expensive. We were recently on a cruise and the "Premium" ship-board internet cost upwards of $200 for the full 7 days, and even then it had all the drawbacks of satellite internet in terms of speed and congestion. So to make my life easier, I set up [offlineimap][2] to download my mail, [dovecot][3] to let me use an IMAP client to read my mail, and [msmtp][4] to send mail from my various accounts. I covered much of [this setup in 2020][5], and the rest is documented in many places online. + +What is not often discussed is that you still need to be online to send mail. The most common recommended solution for sending mail is msmtp, and it always rejects mail if it can't connect to the desired host. But it does have a daemon option (`msmtpd` ) that can be used to accept local SMTP connections and forward them to another program. By default, this is `msmtp` itself. But again, I don't want to send things now, I want to send things when I have a connection, which is when I stumbled upon [putmail][6]. + +`Putmail` is a set of Python scripts that sends mail to pre-configured smtp servers based on the `From` address in a mail message. It is stable (unmodified since 2011), and just works. If you, like me, have multiple email addresses which have to be sent via multiple SMTP relays, this is just the thing you need. Each email address you send from has its own configuration file, and since `putmail` decides on which to use based on the message itself, there's no need to have to set up multiple sending setups in a single mail client. + +As an example, to send with a `gmail` account, you would create the file `.putmail/yourname@gmail.com` and fill in the following information. + +``` +yourname@gmail.com putmail configuration +[config] +email = yourname@gmail.com +server = smtp.gmail.com +port = 587 +username = yourname@gmail.com +password = XXXXXXXXXXXXXXXXX +tls = on +``` + +And that's it. Configure a mail client to send via `putmail.py` instead of `sendmail` or `msmtp` and send a message. + +The next best things are the `putmail_enque.py` and `putmail_dequeue.py` scripts. The first takes an email and stores it to send later. The second loops through the queue and delivers the mail. By specifying `putmail_enqueue.py` as the program `msmtpd` runs, I can "send" an email now, and it just waits for me to run `putmail_dequeue.py` later. Here is my `msmtpd` startup command, specifying `putmail_enqueue.py` as the item to be used for mail delivery. + +``` +msmtpd --port=1025 --log=/tmp/msmtpd.log --command='putmail_enqueue.py -f %F' - +``` + +I use the following script as a `presynchook` in `offlineimap` to check to see if I am connected, and if so, send mail. + +``` +#!/bin/bash +echo Sending queued messages \(if any\) +QUEUEDMAIL=$(find $HOME/.putmail/queue -type f | wc -l) +if [ $QUEUEDMAIL -ne 0 ]; then +  ping -n -c 1 imap.gmail.com >/dev/null 2>/dev/null +  if [ $? -eq 0 ]; then +    putmail_dequeue.py +  fi +fi +``` + +After all that, I can use any mail client I wish and send mail with a standard SMTP call to `localhost:1025` and have it delivered next time I'm connected to the internet. And the best part is, I don't have to change my workflow for email if I'm home or traveling — it all just happens automatically in the background. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/send-email-putmail + +作者:[Kevin Sonney][a] +选题:[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/ksonney +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/email_chat_communication_message.png +[2]: https://www.offlineimap.org/ +[3]: https://www.dovecot.org/ +[4]: https://marlam.de/msmtp/ +[5]: https://opensource.com/article/20/1/sync-email-offlineimap +[6]: https://github.com/tgray/putmail diff --git a/sources/tech/20220518 A guide to Pipy, a programmable network proxy for cloud.md b/sources/tech/20220518 A guide to Pipy, a programmable network proxy for cloud.md new file mode 100644 index 0000000000..ef97d7a9f5 --- /dev/null +++ b/sources/tech/20220518 A guide to Pipy, a programmable network proxy for cloud.md @@ -0,0 +1,548 @@ +[#]: subject: "A guide to Pipy, a programmable network proxy for cloud" +[#]: via: "https://opensource.com/article/22/5/pipy-programmable-network-proxy-cloud" +[#]: author: "Ali Naqvi https://opensource.com/users/alinaqvi" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A guide to Pipy, a programmable network proxy for cloud +====== +Pipy is an open source, extremely fast, and lightweight network traffic processor. It has a variety of use cases including edge routers, load balancing and proxying, API gateways, static HTTP servers, service mesh sidecars, and many other applications. + +![Woman using laptop concentrating][1] +Image by Mapbox Uncharted ERG, [CC-BY 3.0 US][2] + +Pipy is an open source, cloud-native, network stream processor. It is modular by design and can create a high-performance network proxy. It's written in C++ and is built on top of the Asio asynchronous I/O library. Pipy is ideal for a variety of use cases ranging from edge routers, load balancers, proxy solutions, API gateways, static HTTP servers, service mesh sidecars, and more. + +Pipy also comes with built-in JavaScript support through PipyJS. PipyJS is highly customizable and predictable in performance, with no garbage collection overhead. Currently, PipyJS is part of the Pipy code base, but it has no dependency on it and in the future it may be moved to a standalone package. + +### Pipy quick start guide + +You can run the production version of Pipy using Podman or Docker with one of the tutorial scripts provided on the official Pipy Git repository. The Pipy container image can be configured with a few environment variables: + +* PIPY_CONFIG_FILE=
sets the location of the Pipy configuration file. +* PIPY_SPAWN=n sets the number of Pipy instances you want to start, where n is the number of instances. This is a zero-based index, so 0 represents 1 instance. For example, use PIPY_SPAWN=3 for 4 instances. + +Start the Pipy server with this example script: + +``` +$ docker run --rm -e PIPY_CONFIG_FILE=\ +https://raw.githubusercontent.com/flomesh-io/pipy/main/tutorial/01-hello \ +-e PIPY_SPAWN=1 -p 8080:8080 flomesh/pipy-pjs:latest +``` + +You may notice that instead of a local file, this code provides a link to a remote Pipy script through the environment variable `PIPY_CONFIG_FILE`. Pipy is smart enough to handle that. + +For your reference, here are the contents of the file `tutorial/01-hello/hello.js` : + +``` +pipy() +.listen(8080) +.serveHTTP( +new Message('Hi, there!\n') +) +``` + +This simple script defines one Port pipeline, which listens on port 8080 and returns "Hi, there!" for each HTTP request received on the listening port. + +As you've exposed local port 8080 with the docker run command, you can proceed with a test on the same port: + +``` +$ curl http://localhost:8080 +``` + +Executing the above command displays `Hi, there!` on the console. + +For learning, development, or debugging purposes it's recommended to proceed with the local installation (either build Pipy from sources or download a release for your OS) of Pipy, as it comes with an admin web console along with documentation and tutorials. + +Once installed locally, running `pipy` without any arguments starts the admin console on port 6060, but it can be configured to listen on the different port with the `--admin-port` option. + +![Pipy admin console listening on port 6060][3] + +To build Pipy from source, or to install a precompiled binary for your operating system, refer to README.md on the [Pipy][4] Git repository. + +#### Running Pipy in a terminal + +To start a Pipy proxy, run Pipy with a PipyJS script file, for example, the script in `tutorial/01-hello/hello.js` if you need a simple echo server that responds with the same message body received with every incoming request: + +``` +$ pipy tutorial/01-hello/hello.js +``` + +Alternatively, while developing and debugging, one can start Pipy with a builtin web UI: + +``` +$ pipy tutorial/01-hello/hello.js --admin-port=6060 +``` + +To see all command-line options, use the `--help` flag: + +``` +$ pipy --help +``` + +### Pipy is a stream processor + +Pipy operates on network streams using an event-driven pipeline where it consumes the input stream, performs user-provided transformations, and outputs the stream. A pipy data stream takes raw data and abstracts it into an event. An event can belong to one of four categories: + +* Data: Network streams are composed of data bytes and come in chunks. Pipy abstracts out chunks into a Data event. +* MessageStart, MessageEnd, StreamEnd: These three non-data events work as markers, giving the raw byte streams high-level semantics for business logic to rely on. + +### Pipy Design + +The internal workings of Pipy are similar to [Unix Pipelines][5] but unlike Unix pipelines, which deal with discreet bytes, Pipy deals with streams of events. + +Pipy processes incoming streams through a chain of filters, where each filter deals with general concerns like request logging, authentication, SSL offloading, request forwarding, and so on. Each filter reads from its input and writes to its output, with the output of one filter connected to the input of the next. + +#### Pipelines + +A chain of filters is called a pipeline and Pipy categorizes pipelines in 3 different categories according to their input sources. + +* Port pipeline: Reads in Data events from a network port, processes them, and then writes the result back to the same port. This is the most commonly used request and response model. For instance, when Pipy works like an HTTP server, the input to a Port pipeline is an HTTP request from the clients, and the output from the pipeline would be an HTTP response sent back to clients. +* Timer pipeline: Gets a pair of MessageStart and MessageEnd events as its input periodically. Useful when [Cron][6] [job-like][7] functionality is required. +* Sub-pipeline: Works in conjunction with a join filter, such as link, which takes in events from its predecessor pipeline, feeds them into a sub-pipeline for processing, reads back the output from the sub-pipeline, and then pumps it down to the next filter. +The best way to look at sub-pipelines and join filters is to think of them as callees and callers of a subroutine in procedural programming. The input to the joint filter is the subroutine's parameters, the output from the joint filter is its return value. +A root pipeline, such as Port or Timer, cannot be called from join filters. +To get a list of builtin filters and their parameters: +$  pipy --list-filters +$  pipy --help-filters + +``` +$  pipy --list-filters +$  pipy --help-filters +``` + +#### Context + +Another important notion in Pipy is that of contexts. A context is a set of variables attached to a pipeline. Every pipeline gets access to the same set of variables across a Pipy instance. In other words, contexts have the same shape. When you start a Pipy instance, the first thing you do is define the shape of the context by defining variable(s) and their initial values. + +Every root pipeline clones the initial context you define at the start. When a sub-pipeline starts, it either shares or clones its parent's context, depending on which joint filter you use. For instance, a link filter shares its parent's context while a demux filter clones it. + +To the scripts embedded in a pipeline, these context variables are their global variables, which means that these variables are always accessible to scripts from anywhere if they live in the same script file. + +This might seem odd to a seasoned programmer because global variables usually mean they are globally unique. You have only one set of these variables, whereas in Pipy we can have many sets of them (contexts) depending on how many root pipelines are open for incoming network connections and how many sub-pipelines clone their parents' contexts. + +### Writing a Network Proxy + +Suppose you're running separate instances of different services and you want to add a proxy to forward traffic to the relevant services based on the request URL path. This would give you the benefit of exposing a single URL and scaling your services in the back end without users having to remember a distinct service URL. In normal situations, your services would be running on different nodes and each service could have multiple instances running. In this example, assume you're running the services below, and want to distribute traffic to them based on the URI. + +* service-hi at /hi/* (127.0.0.1:8080, 127.0.0.1:8082) +* service-echo at /echo (127.0.0.1:8081) +* service-tell-ip at /ip_/_* (127.0.0.1:8082) + +Pipy scripts are written in JavaScript, and you can use any text editor of your choice to edit them. Alternatively, if you have installed Pipy locally, you can use Pipy admin Web UI, which comes with syntax highlighting, auto-completion, hints, as well as the ability to run scripts, all from the same console. + +Start a Pipy instance, without any arguments, so the Pipy admin console launches on port 6060. Now open your favorite web browser and navigate to [[http://localhost:6060](http://localhost:6060/][8] to see the built-in Pipy Administration Web UI. + +![Built-in Pipy administration web UI][9] + +### Create a Pipy program + +A good design practice is that code and configurations are separated. Pipy supports such modular design through its Plugins, which you can think of as JavaScript modules. That said, you store your configuration data in the config folder, and your coding logic in separate files under the plugins folder. The main proxy server script is stored in the root folder, the main proxy script (`proxy.js` ) will include and combine the functionality defined in separate modules. In the end, your final folder structure is: + +``` +├── config +│ ├── balancer.json +│ ├── proxy.json +│ └── router.json +├── plugins +│ ├── balancer.js +│ ├── default.js +│ └── router.js +└── proxy.js +``` + +1.Click **New Codebase**, enter `/proxy` for the Codebase *name* in the dialog and then click **Create**. + +1. Click the + button to add a new file. Enter /config/proxy.json for its filename and then click Create. This is the configuration file used to configure your proxy. +2. You now see proxy.json listed under the config folder in the left pane. Click on the file to open it and add the configuration shown below and make sure you save your file by clicking the disk icon on the top panel. +   +{ +"listen": 8000, +"plugins": [ +"plugins/router.js", +"plugins/balancer.js", +"plugins/default.js" ] +} +3. Repeat steps 2 and 3 to create another file, /config/router.json, to store route information. Enter this configuration data: +{ +"routes": { +"/hi/*": "service-hi", +"/echo": "service-echo", +"/ip/*": "service-tell-ip" } +} +4. Repeat steps 2 and 3 to create another file, /config/balancer.json to store your service-to-target map. Enter the following data: +{ +"services": { +"service-hi" : ["127.0.0.1:8080", "127.0.0.1:8082"], +"service-echo" : ["127.0.0.1:8081"], +"service-tell-ip" : ["127.0.0.1:8082"] } +} +5. Now it's time to write your very first Pipy script, which will be used as a default fallback when your server receives a request for which you don't have any target (an endpoint) configured. Create the file /plugins/default.js. The name here is just a convention and Pipy doesn't rely on names, so you can choose any name you like. The script will contain the code shown below, which returns the HTTP Status code 404 with a message of No handler found: +   +pipy() +.pipeline('request') +.replaceMessage( +new Message({ status: 404 }, 'No handler found')) + +``` +{ +"listen": 8000, +"plugins": [ +"plugins/router.js", +"plugins/balancer.js", +"plugins/default.js" ] +} +``` + +``` +{ +"routes": { +"/hi/*": "service-hi", +"/echo": "service-echo", +"/ip/*": "service-tell-ip" } +} +``` + +``` +{ +"services": { +"service-hi" : ["127.0.0.1:8080", "127.0.0.1:8082"], +"service-echo" : ["127.0.0.1:8081"], +"service-tell-ip" : ["127.0.0.1:8082"] } +} +``` + +``` +pipy() +.pipeline('request') +.replaceMessage( +new Message({ status: 404 }, 'No handler found')) +``` + +7.Create the file `/plugins/router.js`, which stores your routing logic: + +``` +(config => +pipy({ +_router: new algo.URLRouter(config.routes), }) +.export('router', { +__serviceID: '', }) +.pipeline('request') +.handleMessageStart( +msg => ( +__serviceID = _router.find( +msg.head.headers.host, +msg.head.path, ) +) ) +)(JSON.decode(pipy.load('config/router.json'))) +``` + +1. Create the file /plugins/balancer.js, which stores your load balancing logic as a side-note. Pipy comes with multiple Load Balancing algorithms, but for simplicity, you're using the Round Robin algorithm here. +(config => + +pipy({ +  _services: ( +    Object.fromEntries( +      Object.entries(config.services).map( +        ([k, v]) => [ +          k, new algo.RoundRobinLoadBalancer(v) +        ] +      ) +    ) +  ), + +  _balancer: null, +  _balancerCache: null, +  _target: '', +}) + +.import({ +  __turnDown: 'proxy', +  __serviceID: 'router', +}) + +.pipeline('session') +  .handleStreamStart( +    () => ( +      _balancerCache = new algo.Cache( +        // k is a balancer, v is a target +        (k  ) => k.select(), +        (k,v) => k.deselect(v), +      ) +    ) +  ) +  .handleStreamEnd( +    () => ( +      _balancerCache.clear() +    ) +  ) + +.pipeline('request') +  .handleMessageStart( +    () => ( +      _balancer = _services[__serviceID], +      _balancer && (_target = _balancerCache.get(_balancer)), +      _target && (__turnDown = true) +    ) +  ) +  .link( +    'forward', () => Boolean(_target), +    '' +  ) + +.pipeline('forward') +  .muxHTTP( +    'connection', +    () => _target +  ) + +.pipeline('connection') +  .connect( +    () => _target +  ) + +)(JSON.decode(pipy.load('config/balancer.json'))) +2. Now write the entry point, or the proxy server script, to use the above plugins. Creating a new code base (step 1) creates a default main.js file as an entry point. You can use that as your main entry point, or if you prefer to go with a different name, feel free to delete main.js and create a new file with the name of your choice. For this example, delete it and create a new file named /proxy.js. Make sure you click the top flag icon to make it the main entry point, to ensure script execution is started when you hit the run button (the arrow icon on the right). +(config => + +pipy() + +.export('proxy', { +  __turnDown: false, +}) + +.listen(config.listen) +  .use(config.plugins, 'session') +  .demuxHTTP('request') + +.pipeline('request') +  .use( +    config.plugins, +    'request', +    'response', +    () => __turnDown +  ) + +)(JSON.decode(pipy.load('config/proxy.json'))) + +``` +(config => + +pipy({ +  _services: ( +    Object.fromEntries( +      Object.entries(config.services).map( +        ([k, v]) => [ +          k, new algo.RoundRobinLoadBalancer(v) +        ] +      ) +    ) +  ), + +  _balancer: null, +  _balancerCache: null, +  _target: '', +}) + +.import({ +  __turnDown: 'proxy', +  __serviceID: 'router', +}) + +.pipeline('session') +  .handleStreamStart( +    () => ( +      _balancerCache = new algo.Cache( +        // k is a balancer, v is a target +        (k  ) => k.select(), +        (k,v) => k.deselect(v), +      ) +    ) +  ) +  .handleStreamEnd( +    () => ( +      _balancerCache.clear() +    ) +  ) + +.pipeline('request') +  .handleMessageStart( +    () => ( +      _balancer = _services[__serviceID], +      _balancer && (_target = _balancerCache.get(_balancer)), +      _target && (__turnDown = true) +    ) +  ) +  .link( +    'forward', () => Boolean(_target), +    '' +  ) + +.pipeline('forward') +  .muxHTTP( +    'connection', +    () => _target +  ) + +.pipeline('connection') +  .connect( +    () => _target +  ) + +)(JSON.decode(pipy.load('config/balancer.json'))) +``` + +``` +(config => + +pipy() + +.export('proxy', { +  __turnDown: false, +}) + +.listen(config.listen) +  .use(config.plugins, 'session') +  .demuxHTTP('request') + +.pipeline('request') +  .use( +    config.plugins, +    'request', +    'response', +    () => __turnDown +  ) + +)(JSON.decode(pipy.load('config/proxy.json'))) +``` + +So far, your workspace looks like this: + +![Image of workspace][10] + +To run your script, click the play icon button (4th from right). Pipy runs your proxy script, and you see output similar to this: + +![Image of output][11] + +This shows that your proxy server is listening on port 8000 (which you configured in your `/config/proxy.json` ). Use [curl to run a test][12]: + +``` +$ curl -i [http://localhost:8000](http://localhost:8000) +HTTP/1.1 404 Not Found +content-length: 10 +connection: keep-alive +No handler found +``` + +That response makes sense because you haven't configured any target for root. Try one of your configured routes, such as `/hi` : + +``` +$ curl -i [http://localhost:8000/hi](http://localhost:8000/hi) +HTTP/1.1 502 Connection Refused +content-length: 0 +connection: keep-alive +``` + +You get `502 Connection Refused` because you have no service running on your configured target port. + +You can update `/config/balancer.json` with details like the host and port of your already running services to make it fit for your use case, or you can just write a script in Pipy to listen on your configured ports, and return simple messages. + +Save this code to a file on your local computer named `mock-proxy.js`, and remember the location where you stored it: + +``` +pipy() + +.listen(8080) +  .serveHTTP( +    new Message('Hi, there!\n') +  ) + +.listen(8081) +  .serveHTTP( +    msg => new Message(msg.body) +  ) + +.listen(8082) +  .serveHTTP( +    msg => new Message( +      `You are requesting ${msg.head.path} from ${__inbound.remoteAddress}\n` +    ) +  ) +``` + +Open a new terminal window and run this script with Pipy (change `/path/to` to the location where you stored this script file): + +``` +$ pipy /path/to/mock-proxy.js +2022-01-11 18:56:31 [INF] [config] +2022-01-11 18:56:31 [INF] [config] Module /mock-proxy.js +2022-01-11 18:56:31 [INF] [config] ================ +2022-01-11 18:56:31 [INF] [config] +2022-01-11 18:56:31 [INF] [config] [Listen on :::8080] +2022-01-11 18:56:31 [INF] [config] ----->| +2022-01-11 18:56:31 [INF] [config] | +2022-01-11 18:56:31 [INF] [config] serveHTTP +2022-01-11 18:56:31 [INF] [config] | +2022-01-11 18:56:31 [INF] [config] <-----| +2022-01-11 18:56:31 [INF] [config] +2022-01-11 18:56:31 [INF] [config] [Listen on :::8081] +2022-01-11 18:56:31 [INF] [config] ----->| +2022-01-11 18:56:31 [INF] [config] | +2022-01-11 18:56:31 [INF] [config] serveHTTP +2022-01-11 18:56:31 [INF] [config] | +2022-01-11 18:56:31 [INF] [config] <-----| +2022-01-11 18:56:31 [INF] [config] +2022-01-11 18:56:31 [INF] [config] [Listen on :::8082] +2022-01-11 18:56:31 [INF] [config] ----->| +2022-01-11 18:56:31 [INF] [config] | +2022-01-11 18:56:31 [INF] [config] serveHTTP +2022-01-11 18:56:31 [INF] [config] | +2022-01-11 18:56:31 [INF] [config] <-----| +2022-01-11 18:56:31 [INF] [config] +2022-01-11 18:56:31 [INF] [listener] Listening on port 8080 at :: +2022-01-11 18:56:31 [INF] [listener] Listening on port 8081 at :: +2022-01-11 18:56:31 [INF] [listener] Listening on port 8082 at :: +``` + +You now have your mock services listening on ports 8080, 8081, and 8082. Do a test again on your proxy server to see the correct response returned from your mock service. + +### Summary + +You've used a number of Pipy features, including variable declaration, importing and exporting variables, plugins, Pipelines, sub-pipelines, filter chaining, Pipy filters like `handleMessageStart`, `handleStreamStart`, and link, and Pipy classes like JSON, `algo.URLRouter`, `algo.RoundRobinLoadBalancer`, `algo.Cache`, and others. For more information, read the excellent [Pipy documentation][13], and through Pipy's admin web UI, and follow the step-by-step tutorials that come with it. + +### Conclusion + +Pipy from [Flomesh][14] is an open source, extremely fast, and lightweight network traffic processor. You can use it in a variety of use cases ranging from edge routers, load balancing and proxying (forward and reverse), API gateways, static HTTP servers, service mesh sidecars, and many other applications. Pipy is in active development and is maintained by full-time committers and contributors. + +Images by: (Ali Naqvi, CC BY-SA 40) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/pipy-programmable-network-proxy-cloud + +作者:[Ali Naqvi][a] +选题:[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/alinaqvi +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png +[2]: https://creativecommons.org/licenses/by/3.0/us/ +[3]: https://opensource.com/sites/default/files/2022-05/pipy1.png +[4]: https://github.com/flomesh-io/pipy +[5]: https://opensource.com/article/19/4/interprocess-communication-linux-channels +[6]: https://en.wikipedia.org/wiki/Cron +[7]: https://en.wikipedia.org/wiki/Cron +[8]: http://localhost:6060 +[9]: https://opensource.com/sites/default/files/2022-05/pipy2.png +[10]: https://opensource.com/sites/default/files/2022-05/pipy3.png +[11]: https://opensource.com/sites/default/files/2022-05/pipy4.png +[12]: https://www.redhat.com/sysadmin/social-media-curl +[13]: https://flomesh.io +[14]: https://flomesh.io diff --git a/sources/tech/20220518 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 22.04 - 20.04 - 18.04.md b/sources/tech/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..0824725cdf --- /dev/null +++ b/sources/tech/20220518 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 22.04 - 20.04 - 18.04.md @@ -0,0 +1,273 @@ +[#]: 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: " " +[#]: publisher: " " +[#]: url: " " + +How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 22.04 / 20.04 / 18.04 +====== +This tutorial explains how to boot into **rescue mode** or **emergency mode**in Ubuntu 22.04, 20.04 and 18.04 LTS editions. + +As you might already know, **Runlevels** are replaced with **Systemd targets** in many Linux distributions such as RHEL 7 / RHEL 8 and Ubuntu 16.04 LTS and newer versions. For more details about runlevels and systemd target, refer to [this guide][1]. + +This guide is specifically written for Ubuntu, however the steps given below should work on most Linux distributions that use **Systemd** as the default service manager. + +Before getting into the topic, let us have a brief understanding about what is rescue mode and emergency mode and what is the purpose of these both modes. + +### What Is Rescue Mode? + +The **rescue mode** is equivalent to **single user mode** in Linux distributions that use **SysV** as the default service manager. In rescue mode, all local filesystems will be mounted, only some important services will be started. However, no normal services (E.g network services) won't be started. + +The rescue mode is helpful in situations where the system can't boot normally. Also, we can perform some important rescue operations, such as [reset root password][2], in rescue mode. + +### What Is Emergency Mode? + +In contrast to the rescue mode, nothing is started in the **emergency mode**. No services are started, no mount points are mounted, no sockets are established, nothing. All you will have is just a **raw shell**. Emergency mode is suitable for debugging purposes. + +First, we will see how to boot into rescue mode and emergency mode in Ubuntu 22.04 and 20.04 LTS distributions. The procedure for entering rescue mode in Ubuntu 22.04 and 20.04 LTS is exactly the same! + +### Boot Into Rescue Mode In Ubuntu 22.04 / 20.04 LTS + +We can boot into rescue mode in two ways. + +#### Method 1 + +Power on your Ubuntu system. Hit the ESC key right after the BIOS logo disappears to display the Grub menu. + +In the GRUB menu, choose the first entry and press **"e"** to edit it. + +![GRUB Menu In Ubuntu 22.04 / 20.04 LTS][3] + +Hit the DOWN arrow and find the line that starts with the word **"linux"** and add the following line at the end of it. To reach the end, just press **CTRL+e** or use the **END** key or **LEFT/RIGHT** arrows in your keyboard. + +``` +systemd.unit=rescue.target +``` + +![Edit Grub Boot Menu Entries To Enter Into Rescue Mode In Ubuntu 22.04 / 20.04 LTS][4] + +After adding the above line, hit **Ctrl+x** or**F10** to boot into rescue mode. + +After a few seconds, you will be landed in the rescue mode (single user mode) as root user. You will be prompted to press ENTER to enter the maintenance mode. + +Here is how rescue mode looks like in Ubuntu 22.04 / 20.04 LTS systems: + +![Boot Into Rescue Mode In Ubuntu 22.04 / 20.04 LTS][5] + +Now do whatever you want to do in the rescue mode. You may need to mount the root (**/**) file system in read/write mode before doing any operations in rescue mode. + +``` +mount -n -o remount,rw / +``` + +![Mount Root File System In Read Write Mode In Ubuntu 22.04 / 20.04 LTS][6] + +Once done, press **"Ctrl+d"** to boot into normal mode. Alternatively, you can type any one of the following commands to boot into normal mode. + +``` +systemctl default +``` + +Or, + +``` +exit +``` + +If you want to reboot the system instead of booting into normal mode, enter: + +``` +systemctl reboot +``` + +#### Method 2 + +In this method, you don't need to edit the grub boot menu entries. + +Power on the system and choose **"Advanced options for Ubuntu"** from the Grub boot menu. + +![Choose Advanced Options For Ubuntu From Grub Boot Menu][7] + +Next, you will see the list of available Ubuntu versions with Kernel versions. Choose the **"Recovery mode"** in the grub boot menu in Ubuntu. + +![Choose Recovery Mode In Grub Boot Menu In Ubuntu 22.04 / 20.04 LTS][8] + +After a few seconds, you will see the Ubuntu recovery menu. From the recovery menu, choose **"Drop to root shell prompt"** option and hit the ENTER key. + +![Enter Into Root Shell Prompt In Ubuntu 22.04 / 20.04 LTS][9] + +Now you will be landed in the rescue mode. + +![Ubuntu Maintenance Mode][10] + +Mount the root (**/**) file system in read/write mode by entering the following command: + +``` +mount -n -o remount,rw / +``` + +![Mount Root File System In Read Write Mode In Ubuntu][11] + +Do whatever you want to do in the rescue mode. + +Once done, type exit to return back to the recovery menu. + +``` +exit +``` + +Finally, choose **"Resume normal boot"** option and hit the ENTER key. + +![Boot Into Normal Mode In Ubuntu][12] + +Press ENTER key again to exit recovery mode and continue booting into normal mode. + +![Exit The Recovery Mode In Ubuntu][13] + +If you don't want to boot into normal mode, type **"reboot"** and press ENTER from the maintenance mode to restart your system. + +### Boot Into Emergency Mode In Ubuntu 22.04 / 20.04 LTS + +When the GRUB boot menu appears, press **"e"** to edit it. + +![GRUB Menu In Ubuntu 22.04 / 20.04 LTS][14] + +Find the line that starts with the word **"linux"** and add the following line at the end of it. + +``` +systemd.unit=emergency.target +``` + +![Edit Grub Boot Menu Entries To Enter Into Emergency Mode In Ubuntu 22.04 / 20.04 LTS][15] + +After adding the above line, hit **Ctrl+x** or**F10** to boot into emergency mode. + +After a few seconds, you will be landed in the emergency mode as `root` user. You will be prompted to press ENTER to enter the maintenance mode. + +Here is how emergency mode looks like in Ubuntu 22.04 / 20.04 LTS system: + +![Boot Into Emergency Mode In Ubuntu 22.04 / 20.04 LTS][16] + +Now do whatever you want to do in the emergency mode. You may need to mount the root (**/**) file system in read/write mode before doing any operations in this mode. + +``` +mount -n -o remount,rw / +``` + +Once done, press **"Ctrl+d"** to boot into normal mode. Alternatively, you can type any one of the following commands to boot into normal mode. + +``` +systemctl default +``` + +Or, + +``` +exit +``` + +If you want to reboot the system instead of booting into normal mode, enter: + +``` +systemctl reboot +``` + +### Boot Into Rescue Mode In Ubuntu 18.04 LTS + +Boot your Ubuntu system. When the Grub menu appears, choose the first entry and press **e** to edit. (To reach the end, just press **CTRL+e** or use the END key or LEFT/RIGHT arrows in your keyboard): + +![Grub Menu][17] + +If you don't see the Grub menu, just hit ESC key right after the BIOS logo disappears. + +Find the line that starts with word **"linux"**and add the following line at the end of that line (To reach the end, just press **CTRL+e** or use the END key or LEFT/RIGHT arrows in your keyboard): + +``` +systemd.unit=rescue.target +``` + +![Edit Grub Menu][18] + +Once you added the above line, just press **CTRL+x** or **F10** to continue to boot into rescue mode. After a few seconds, you will be landed in the rescue mode (single user mode) as root user. + +Here is how rescue mode looks like in Ubuntu 18.04 LTS server: + +![Ubuntu Rescue Mode][19] + +Next, type the following command to mount root (**/**) file system into read/write mode. + +``` +mount -n -o remount,rw / +``` + +### Boot Into Emergency Mode + +Booting your Ubuntu into emergency is as same as above method. All you have to do is replace **"systemd.unit=rescue.target"** with **"systemd.unit=emergency.target"** when editing grub menu. + +![Edit Grub Menu][20] + +Once you added "systemd.unit=emergency.target", press **Ctrl+x** or **F10** to continue booting into emergency mode. + +![Ubuntu Emergency Mode][21] + +Finally, you can mount root filesystem into read/write mode with command: + +``` +mount -n -o remount,rw / +``` + +### Switch Between Rescue And Emergency Modes + +If you are in rescue mode, you don't have to edit the grub boot entry as I mentioned above. Instead, just type the following command to switch to emergency mode instantly: + +``` +systemctl emergency +``` + +Similarly, to switch from emergency to rescue mode, type: + +``` +systemctl rescue +``` + +### Conclusion + +You know now what is rescue and emergency modes and how to boot into those modes in Ubuntu 22.04, 20.04 and 18.04 LTS systems. Like I already mentioned, the steps provided here will work on many recent Linux versions that uses Systemd. + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/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/sources/tech/20220518 Install Specific Package Version With Apt Command in Ubuntu.md b/sources/tech/20220518 Install Specific Package Version With Apt Command in Ubuntu.md new file mode 100644 index 0000000000..c88a655218 --- /dev/null +++ b/sources/tech/20220518 Install Specific Package Version With Apt Command in Ubuntu.md @@ -0,0 +1,191 @@ +[#]: subject: "Install Specific Package Version With Apt Command in Ubuntu" +[#]: via: "https://itsfoss.com/apt-install-specific-version-2/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Install Specific Package Version With Apt Command in Ubuntu +====== + +Want to install a specific version of a package in Ubuntu? You can do that ‘easily’ in the following manner: + +``` +sudo apt install package_name=package_version +``` + +How do you know which versions are available for a certain package? Use this command: + +``` +apt list --all-versions package_name +``` + +In the screenshot below, you can see that I have two versions of VLC available and I use the command to install the older version: + +![install specific versions apt ubuntu][1] + +Sounds like a simple task, right? But things are not as simple as they look. There are several ifs and buts involved here. + +This tutorial will cover all the important aspects of installing a specific program version using apt or apt-get commands. + +### Things to know about installing a specific version of a program + +You need to know a few things about how APT and repositories work in Ubuntu and Debian-based distributions. + +#### No older versions from the same source + +Ubuntu doesn’t keep older versions of packages in the repository. You may see more than one version in specific cases, temporarily. For example, you run the apt update (but not upgrade), and a new version is available. You may see two versions for the same package in the apt cache. But as soon as the package is upgraded to the new version, the older version is removed from the cache as well as the repositories. + +#### Use multiple sources for different versions + +To get multiple versions of the same package, you’ll have to add multiple sources. For example, VLC is in version 3.x. Adding the [VLC daily build PPA][2] will give the (unstable) version 4.x. + +Similarly, **you can download a DEB file with a different version and install it**. + +#### The higher version always gets the priority + +If you have the same package available from more than one source, by default, Ubuntu will install the highest available version. + +In the previous example, if I install VLC, it will install version 4.x, not 3.x. + +#### The older version gets upgraded to the available newer version + +That’s another potential problem. Even if you install the older version of a package, it gets upgraded to the newer version (if available). You have to [hold the package and stop it from upgrading][3]. + +#### Dependencies also need to be installed + +If the package has dependencies, you’ll have to install the required version of the dependent packages as well. + +Now that you know a few potential issues let’s see how to tackle them. + +### Installing specific version of a package + +I am taking the example of VLC in this tutorial. VLC version 3.0.16 is available in Ubuntu’s repositories. I added the daily build PPA and that gives me the release candidate of VLC version 4.0. + +As you can see, I have two VLC versions available in the system right now: + +![install specific versions apt ubuntu][4] + +``` +[email protected]:~$ apt list -a vlc +Listing... Done +vlc/jammy 4.0.0~rc1~~git20220516+r92284+296~ubuntu22.04.1 amd64 +vlc/jammy 3.0.16-1build7 amd64 +vlc/jammy 3.0.16-1build7 i386 +``` + +Since the higher version takes priority, using ‘apt install vlc’ will result in the installation of VLC 4.0. But I want to install the older version 3.0.16 for the sake of this tutorial. + +``` +sudo apt install vlc=3.0.16-1build7 +``` + +But here’s the thing. The vlc package has several dependencies and those dependencies also need specific versions. However, Ubuntu tries to install the available higher versions for them, and thus, you get the classic ‘[you have held broken packages][5]‘ error. + +![problem installing specific version apt ubuntu][6] + +To fix this, you have to provide specific versions of all the dependent packages it complains about. So that command becomes something like this: + +``` +sudo apt install vlc=3.0.16-1build7 \ + vlc-bin=3.0.16-1build7 \ + vlc-plugin-base=3.0.16-1build7 \ + vlc-plugin-qt=3.0.16-1build7 \ + vlc-plugin-video-output=3.0.16-1build7 \ + vlc-l10n=3.0.16-1build7 \ + vlc-plugin-access-extra=3.0.16-1build7 \ + vlc-plugin-notify=3.0.16-1build7 \ + vlc-plugin-samba=3.0.16-1build7 \ + vlc-plugin-skins2=3.0.16-1build7 \ + vlc-plugin-video-splitter=3.0.16-1build7 \ + vlc-plugin-visualization=3.0.16-1build7 +``` + +In case you are wondering, the trailing \ at the end of each line is just a way to write a single command over multiple lines. + +**Does it work? In many cases, it will.** But I have chosen a complicated example of VLC, which has lots of dependencies. Even the mentioned dependencies have dependencies on other packages. It gets messy. + +An alternative is to specify the source while installing. + +#### Alternatively, specify the repository source + +You have added multiple sources, so you should have some idea about the sources the package comes from. + +Use the command below and search for the repository: + +``` +apt-cache policy | less +``` + +Focus on the lines that come after the repository name: + +``` +500 http://security.ubuntu.com/ubuntu jammy-security/multiverse i386 Packages + release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=multiverse,b=i386 + origin security.ubuntu.com +``` + +You can specify the o,l,a, etc parameters. + +In my original example, I want to install VLC from Ubuntu’s repository (to get 3.16) instead of the PPA (which gives me 4). + +So the command below will install VLC 3.16 along with all the dependencies: + +``` +sudo apt install -t "o=ubuntu" vlc +``` + +![install from repository source][7] + +Looks good? But the problem comes when you have to update the system. Then it complains about not finding the specified version. + +**What else can be done?** + +To install an older version, remove the source of the newer version from your system (if possible). It helps get rid of the dependencies hell issues. + +If that’s not possible, check if you can get it in some other packaging formats like Snap, Flatpak, AppImage, etc. In fact, Snap and Flatpak also allow you to choose and install from available versions. Since the applications are sandboxed, it’s easier to manage the dependencies for different versions. + +#### Hold the package and prevent upgrade + +If you manage to install a specific program version, you may want to avoid accidentally upgrading to the newer version. It’s not too complicated to achieve this. + +``` +sudo apt-mark hold package_name +``` + +You can remove the hold so that it can be upgraded later: + +``` +sudo apt-mark unhold package_name +``` + +Note that dependencies of a package are not automatically held. They need to be individually mentioned. + +### Conclusion + +As you can see, there is a provision to install the selected version of a program. Things only get complicated if the package has dependencies. Then you get into the dependency hell. + +I hope you learned a few new things in this tutorial. If you have questions or suggestions to improve it, please let me know in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/apt-install-specific-version-2/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/05/install-specific-versions-apt-ubuntu.png +[2]: https://launchpad.net/~videolan/+archive/ubuntu/master-daily +[3]: https://itsfoss.com/prevent-package-update-ubuntu/ +[4]: https://itsfoss.com/wp-content/uploads/2022/05/install-specific-versions-apt-ubuntu.png +[5]: https://itsfoss.com/held-broken-packages-error/ +[6]: https://itsfoss.com/wp-content/uploads/2022/05/problem-installing-specific-version-apt-ubuntu-800x365.png +[7]: https://itsfoss.com/wp-content/uploads/2022/05/install-from-repository-source-800x578.png diff --git a/sources/tech/20220519 For the Love of Ubuntu- Here are the Mascots of All Ubuntu Releases.md b/sources/tech/20220519 For the Love of Ubuntu- Here are the Mascots of All Ubuntu Releases.md new file mode 100644 index 0000000000..096deb298b --- /dev/null +++ b/sources/tech/20220519 For the Love of Ubuntu- Here are the Mascots of All Ubuntu Releases.md @@ -0,0 +1,461 @@ +[#]: subject: "For the Love of Ubuntu: Here are the Mascots of All Ubuntu Releases" +[#]: via: "https://itsfoss.com/all-Ubuntu-mascots/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +For the Love of Ubuntu: Here are the Mascots of All Ubuntu Releases +====== +This is a collection of the mascots of all the Ubuntu releases so far. + +You may have noticed that every Ubuntu release has a version name and codename. The codename is composed of two words that start with the same letter. The first word is an adjective, and the other one is (usually) an (endangered) species. + +These releases also have a mascot for those codenames. Ubuntu 22.04 is codenamed Jammy Jellyfish and hence the Jellyfish mascot on its wallpaper. + +These ‘mascots’ were not always part of Ubuntu releases. The codenames were always there, but not the mascots. + +The first-ever Ubuntu release was version 4.10 in October 2004. But it wasn’t until the Ubuntu 8.04 LTS ‘Hardy Heron’ release that you saw the associated mascot. + +Earlier, I complied the [list of the default wallpapers of all Ubuntu releases][1]. In this one, you get to look at the mascots of those releases. + +Let’s hop on to Ubuntu’s mascot journey in reverse chronological order. + +### Ubuntu 22.04 Jammy Jellyfish + +![Ubuntu 22.04 mascot][2] + +Released on 21 April 2021. + +Jammy means covered with, filled with, or resembling jam. Informally, it also means lucky. + +Jellyfish are mainly free-swimming marine animals with umbrella-shaped bells and trailing tentacles, although a few are anchored to the seabed by stalks rather than being mobile. + +### Ubuntu 21.10 Impish Indri + +![Ubuntu 21.10 mascot][3] + +Released on 14 October 2021. + +Impish means showing no respect for somebody/something in a way that is amusing rather than serious. + +The Indri, also called the babakoto, is one of the largest living lemurs, with a head-and-body length of about 64–72 cm and a weight of between 6 and 9.5 kg. It has a black and white coat and maintains an upright posture when climbing or clinging + +### Ubuntu 21.04 Hirsute Hippo + +![Ubuntu 21.04 mascot][4] + +Released on 22 April 2021. + +Hirsute means hairy. + +The hippopotamus, also called the hippo, common hippopotamus, or river hippopotamus, is a large semiaquatic mammal native to sub-Saharan Africa. It is one of only two extant species in the family Hippopotamidae, the other being the pygmy hippopotamus. Its name comes from the ancient Greek for “river horse”. + +Not sure if I have seen many hairy hippo. + +### Ubuntu 20.10 Groovy Gorilla + +![Ubuntu 20.10 mascot][5] + +Released on 22 October 2020. + +Groovy means fashionable and exciting. + +Gorillas are herbivorous, predominantly ground-dwelling great apes that inhabit the tropical forests of equatorial Africa. The genus Gorilla is divided into two species: the eastern gorilla and the western gorilla, and either four or five subspecies. + +### Ubuntu 20.04 LTS Focal Fossa + +![Ubuntu 20.04 mascot 1][6] + +Released on 23 April 2020. + +Focal means something providing a focus, important in other meaning. + +The fossa (Cryptoprocta ferox) is **the largest carnivorous mammal on the island of Madagascar**. They can reach nearly six feet in length, with half of that due to their long tails. They look like a cross between a cat, a dog, and a mongoose. Fossas have slender bodies, muscular limbs, and short, reddish-brown coats. + +### Ubuntu 19.10 Eoan Ermine + +![Ubuntu 19.10 mascot][7] + +Released on 17 October 2019. + +Eoan means relating to dawn or east. + +The stoat or short-tailed weasel, also known as the Eurasian ermine, Beringian ermine, or simply ermine, is a mustelid native to Eurasia and the northern portions of North America. Because of its wide circumpolar distribution, it is listed as Least Concern on the IUCN Red List. + +### Ubuntu 19.04 Disco Dingo + +![Ubuntu 19.04 mascot][8] + +Released on 18 April 2019. + +Disco relates to the disco music and nightclubs. + +The dingo is an ancient lineage of dog found in Australia. Its taxonomic classification is debated as indicated by the variety of scientific names presently applied in different publications. + +### Ubuntu 18.10 Cosmic Cuttlefish + +![Ubuntu 18.10 mascot][9] + +Released on 18 October 2018. + +Cosmic means something distinct from the earth, + +Cuttlefish or cuttles are marine molluscs of the order Sepiida. They belong to the class Cephalopoda, which also includes squid, octopuses, and nautiluses. Cuttlefish have a unique internal shell, the cuttlebone, which is used for control of buoyancy. + +### Ubuntu 18.04 LTS Bionic Beaver + +![Ubuntu 18.04 mascot][10] + +Released on 26 April 2018. + +Bionic means having or denoting an artificial, typically electromechanical, body part or parts. + +Beavers are large, semiaquatic rodents in the genus Castor native to the temperate Northern Hemisphere. There are two extant species: the North American beaver and the Eurasian beaver. Beavers are the second-largest living rodents after the capybaras. + +The British users found this release name particularly amusing. + +### Ubuntu 17.10 Artful Aardvark + +![Ubuntu 17.10 mascot][11] + +Released on 19 October 2017. + +Ubuntu switched back to GNOME by default with this release. + +Artful means cleaver or carfty. + +The aardvark is a medium-sized, burrowing, nocturnal mammal native to Africa. It is the only living species of the order Tubulidentata, although other prehistoric species and genera of Tubulidentata are known. Unlike most other insectivores, it has a long pig-like snout, which is used to sniff out food. + +### Ubuntu 17.04 Zesty Zapus + +![Ubuntu 17.04 mascot][12] + +Released on 13 April 2017. + +Last release to feature the Unity desktop. + +Zesty means having a strong, pleasant, and somewhat spicy flavor. + +Zapus is a genus of North American jumping mouse. It is the only genus whose members have the dental formula. Zapus are the only extant mammals aside from the Aye-aye with a total of 18 teeth. + +### Ubuntu 16.10 Yakkety Yak + +![Ubuntu 16.10 mascot][13] + +Released on 13 October 2016. + +‘Yakkety’ could mean a lot of things. While ‘yakking’ is an informal term for talking a lot, ‘yakkety’ could be an alternative spelling of ‘Yakety’ Sax — a well known pop-jazz musical instrument, says OMGUbuntu!. + +Yak is a large domesticated wild ox with shaggy hair, humped shoulders, and large horns, used in Tibet as a pack animal and for its milk, meat, and hide. + +### Ubuntu 16.04 LTS Xenial Xerus + +![Ubuntu 16.04 mascot][14] + +Released on 21 April 2016. + +Xenial means something related to hospitality. + +The Xerus has four subspecies – **cape ground squirrel, striped ground squirrel, mountain ground squirrel, and unstriped ground squirrel**. These animals are diurnal and are usually known to be herbivores in nature and usually eat nuts, roots, and seeds. However, sometimes they also eat eggs and other small animals. + +### Ubuntu 15.10 Wily Werewolf + +![Ubuntu 15.10 mascot][15] + +Released on 22 October 2015. + +Perhaps one of the rare Ubuntu releases that had a finctional character in its codename, unless you don’t consider warewolves fictional. + +Wily means skilled at gaining an advantage, especially deceitfully. + +The werewolves are mythical creatures that can hide their ears and tail. It is a human but also a wolf, and most people fear them because of how they look. + +### Ubuntu 15.04 Vivid Vervet + +![Ubuntu 15.04 mascot][16] + +Released on 23 April 2015. + +Vivid means intensely deep or bright.. + +The vervet monkey, or simply vervet, is an Old World monkey of the family Cercopithecidae native to Africa. The term “vervet” is also used to refer to all the members of the genus Chlorocebus. The five distinct subspecies can be found mostly throughout Southern Africa, as well as some of the eastern countries. + +### Ubuntu 14.10 Utopic Unicorn + +![Ubuntu 14.10 mascot][17] + +Released on 23 October 2014. + +Another of the Ubuntu release with fictional animal in its release codename unless you consider Unicrons are real. + +Utopic relates to utopia which is a fictional, impractical but ideal place. + +The **unicorn** is a legendary creature that has been described since antiquity as a beast with a single large, pointed, spiraling horn projecting from its forehead. + +### Ubuntu 14.04 LTS Trusty Tahr + +![Ubuntu 14.04 mascot][18] + +Released on 17 April 2014. + +Trusty means reliable or faithful. + +Tahr is a goatlike mammal that inhabits cliffs and mountain slopes in Oman, southern India, and the Himalayas. + +### Ubuntu 13.10 Saucy Salamander + +![Ubuntu 13.10 mascot][19] + +Released on 17 October 2013. + +Saucy means expressing in a bold, lively, or spirited manner. + +Salamanders are a group of amphibians typically characterized by their lizard-like appearance, with slender bodies, blunt snouts, short limbs projecting at right angles to the body, and the presence of a tail in both larvae and adults. All ten extant salamander families are grouped together under the order Urodela. + +### Ubuntu 13.04 Raring Ringtail + +![Ubuntu 13.04 mascot][20] + +Released on 25 April 2013. + +Raring means very enthusiastic and eager to do something. + +The Ringtail is **a cat-sized carnivore resembling a small fox with a long raccoonlike tail**. Its bushy tail is flattened and nearly as long as the head and body, with alternating black and white rings. These animals are almost wholly nocturnal and spend the majority of the day sleeping in their dens. + +### Ubuntu 12.10 Quantal Quetzal + +![Ubuntu 12.10 mascot][21] + +Released on 18 October 2012. + +Quantal means relating to a quantum or quanta, or to quantum theory. + +**Quetzals** are strikingly colored birds in the trogon family. They are found in forests, especially in humid highlands, with the five species from the genus *Pharomachrus* being exclusively Neotropical, while a single species, the eared quetzal, *Euptilotis neoxenus*, is found in Mexico and very locally in the southernmost United States. Quetzals are fairly large (all over 32 cm or 13 inches long), slightly bigger than other trogon species. The resplendent quetzal is the national bird of Guatemala because of its vibrant colour. + +### Ubuntu 12.04 LTS Precise Pangolin + +![Ubuntu 12.04 mascot][22] + +Released on 26 April 2012. + +Precise means marked by exactness and accuracy of expression or detail. + +Pangolins, sometimes known as scaly anteaters, are mammals of the order Pholidota. The one extant family, the Manidae, has three genera: Manis, Phataginus, and Smutsia. Manis comprises the four species found in Asia, while Phataginus and Smutsia include two species each, all found in sub-Saharan Africa. + +### Ubuntu 11.10 Oneiric Ocelot + +![Ubuntu 11.10 mascot][23] + +Released on 13 October 2011. + +Onerice relates to dreams or dreaming. + +The ocelot (Leopardus pardalis) is a medium-sized spotted wild cat that reaches 40–50 cm (15.7–19.7 in) at the shoulders and weighs between 8 and 15.5 kg (17.6 and 34.2 lb). It was first described by Carl Linnaeus in 1758. + +### Ubuntu 11.04 Natty Narwhal + +![Ubuntu 11.04 mascot][24] + +Released on 28 April 2011. + +The first release to feature the Unity desktop. + +Natty means smart and fashionable. + +The narwhal, also known as a narwhale, is a medium-sized toothed whale that possesses a large “tusk” from a protruding canine tooth. It lives year-round in the Arctic waters around Greenland, Canada and Russia. It is one of two living species of whale in the family Monodontidae, along with the beluga whale. + +### Ubuntu 10.10 Maverick Meerkat + +![Ubuntu 10.10 mascot][25] + +Released on 10 October 2010. + +Maverick means an unorthodox or independent-minded person. + +The meerkat or suricate is a small mongoose found in southern Africa. It is characterised by a broad head, large eyes, a pointed snout, long legs, a thin tapering tail, and a brindled coat pattern. + +### Ubuntu 10.04 LTS Lucid Lynx + +![Ubuntu 10.04 mascot][26] + +Released on 29 April 2010. + +Lucid means easy to understand or bright. + +A lynx is any of the four species within the medium-sized wild cat genus Lynx. The name lynx originated in Middle English via Latin from the Greek word λύγξ, derived from the Indo-European root leuk- in reference to the luminescence of its reflective eyes. + +### Ubuntu 9.10 Karmic Koala + +![Ubuntu 9.10 mascot][27] + +Released on 29 October 2009. + +Karmic means relating to or characteristic of karma. + +The koala or, inaccurately, koala bear is an arboreal herbivorous marsupial native to Australia. It is the only extant representative of the family Phascolarctidae and its closest living relatives are the wombats. + +### Ubuntu 9.04 Jaunty Jackalope + +![Ubuntu 9.04 mascot][28] + +Released on 23 April 2009. + +The first Ubuntu version I ever used. + +Jaunty means having or expressing a lively, cheerful, and self-confident manner. + +The jackalope is **a mythical animal of North American folklore, in the category of fearsome critters, described as a jackrabbit with antelope horns**. The word jackalope is a portmanteau of jackrabbit and antelope. Many jackalope taxidermy mounts, including the original, are made with deer antlers. + +### Ubuntu 8.10 Intrepid Ibex + +![Ubuntu 8.10 mascot][29] + +Released on 30 October 2008. + +Intrepid means fearless; adventurous. + +An ibex is any of several species of wild goat, distinguished by the male’s large recurved horns, which are transversely ridged in front. Ibex are found in Eurasia, North Africa and East Africa. + +### Ubuntu 8.04 LTS Hardy Heron + +![Ubuntu 8.04 mascot][30] + +Released on 24 April 2008. + +The first Ubuntu release where the mascot appeared on its default wallpaper. + +Hardy means capable of enduring difficult conditions; robust. + +The herons are long-legged, long-necked, freshwater and coastal birds + +### Ubuntu 7.10 Gutsy Gibbon + +![Ubuntu 7.10 mascot][31] + +Released on 18 October 2007. + +Gusty is characterized by or blowing in gusts. + +Gibbons are apes live in subtropical and tropical rainforest from eastern Bangladesh to Northeast India to southern China and Indonesia + +### Ubuntu 7.04 Feisty Fawn + +![Ubuntu 7.04 mascot][32] + +Released on 19 April 2007. + +Feisty means small but determined. Fawn is a young deer in its first year. + +### Ubuntu 6.10 Edgy Eft  + +![Ubuntu 6.10 mascot][33] + +Released on 26 October 2006. + +Edgy means tense or nervous. + +Eft is the terrestrial juvenile phase of newt. A newt is a type of salamander (a type of lizard). This newt has three distinct developmental life stages: aquatic larva, terrestrial juvenile (eft), and adult. + +So basically eft is a teenaged newt :) + +### Ubuntu 6.06 Dapper Drake + +![Ubuntu 6.06 mascot][34] + +Released on 1 June 2006. + +Dapper means neat and trim in dress and appearance. Drake is a fully sexually mature adult male duck of any duck species. + +### Ubuntu 5.10 Breezy Badger + +![Ubuntu 5.10 mascot][35] + +Released on 12 October 2005. + +Breezy means pleasantly windy. + +Badgers are short-legged omnivores, united by their squat bodies, adapted for fossorial activity. + +### Ubuntu 5.04 Hoary Hedgehog  + +![Ubuntu 5.04 mascot][36] + +Released on 8 April 2005. + +Hoary means greyish white. + +A hedgehogis a spiny mammal found throughout parts of Europe, Asia, and Africa, and in New Zealand by introduction. + +### Ubuntu 4.10 : Warty Warthog + +![Ubuntu 4.10 mascot][37] + +Released on 20 October 2004. + +This is where it all started. + +Wart is a small, hard, benign growth on the skin, caused by a virus. Warty means someone full of warts. + +The common warthog is a wild member of the pig family found in grassland, savanna, and woodland in sub-Saharan Africa. + +### Conclusion + +Does this article add value to an Ubuntu user? Not technically, but it’s good to look back at the history. If you have been an Ubuntu user for years, it could trigger nostalgia. + +Ubuntu 9.04 was the first time I tried Linux on a desktop. It was in late September of 2009 if I recall correctly. Only a few weeks later, my system was upgraded to Ubuntu 9.10. I used to spend time browing in Ubuntu Forum thoses days, exploring this new OS and learning new things. + +So, did this article bring back some good old memories? Which was your first Ubuntu version? Share it in the comments. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/all-Ubuntu-mascots/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/Ubuntu-default-wallpapers-download/ +[2]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-22-04-mascot.jpg +[3]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-21-10-mascot.jpg +[4]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-21-04-mascot.jpg +[5]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-20-10-mascot.jpg +[6]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-20-04-mascot-1.jpg +[7]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-19-10-mascot.jpg +[8]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-19-04-mascot.jpg +[9]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-18-10-mascot.jpg +[10]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-18-04-mascot.jpg +[11]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-17-10-mascot.jpg +[12]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-17-04-mascot.jpg +[13]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-16-10-mascot.jpg +[14]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-16-04-mascot.jpg +[15]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-15-10-mascot.jpg +[16]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-15-04-mascot.jpg +[17]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-14-10-mascot.jpg +[18]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-14-04-mascot.jpg +[19]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-13-10-mascot.jpg +[20]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-13-04-mascot.jpg +[21]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-12-10-mascot.jpg +[22]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-12-04-mascot.jpg +[23]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-11-10-mascot.jpg +[24]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-11-04-mascot.jpg +[25]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-10-10-mascot.jpg +[26]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-10-04-mascot.jpg +[27]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-9-10-mascot.jpg +[28]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-9-04-mascot.jpg +[29]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-8-10-mascot.jpg +[30]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-8-04-mascot.jpg +[31]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-7-10-mascot.jpg +[32]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-7-04-mascot.jpg +[33]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-6-10-mascot.jpg +[34]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-6-06-mascot.jpg +[35]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-5-10-mascot.jpg +[36]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-5-04-mascot.jpg +[37]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-4-10-mascot.jpg diff --git a/sources/tech/20220519 Top 10 Essential Ubuntu Apps For Everyone in 2022.md b/sources/tech/20220519 Top 10 Essential Ubuntu Apps For Everyone in 2022.md new file mode 100644 index 0000000000..aa53c063ec --- /dev/null +++ b/sources/tech/20220519 Top 10 Essential Ubuntu Apps For Everyone in 2022.md @@ -0,0 +1,196 @@ +[#]: subject: "Top 10 Essential Ubuntu Apps For Everyone in 2022" +[#]: via: "https://www.debugpoint.com/2022/05/essential-ubuntu-apps-2022-part-1/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top 10 Essential Ubuntu Apps For Everyone in 2022 +====== +This article lists the top 10 essential Ubuntu apps for various use cases in 2022. + +If you are a casual user, student, teacher, scientist, developer or creator – you need additional applications for your workflow. The Linux ecosystem has thousands of applications scattered around for almost all possible needs. Most of the mainstream Linux distribution, including Ubuntu, features only basic applications as default. + +In this part 1 article (of a 5 part series), we list some of the professional-grade applications for everyone. + +### Essential Ubuntu Apps in 2022 – Part 1 + +#### 1. GNOME Tweak Tool + +The [GNOME Tweak Tool][1] is a must-have utility for your Ubuntu desktop if you are using the Ubuntu GNOME edition. To customise your desktop using this utility, you can change the font, scaling, themes, cursor, and many additional options. The default settings window doesn’t expose all the options today. + +In addition, you can also change the window decorations, title bar, title bar buttons and startup applications using this application. + +You can install it using the Software app by searching “Tweaks” or via the commands from the terminal as mentioned below. + +``` +sudo apt install gnome-tweaks +``` + +![GNOME Tweaks Tool][2] + +#### 2. Steam + +Gaming in Linux is not that difficult anymore, thanks to Valve and associated contributions from the community. [Steam][3] is a front end of video games service developed by Valve, which gives you access to the latest games on the Ubuntu platform with top features. Moreover, the Steam client also offers anti-cheat measures, auto-update and support for social conversation with streaming features. + +If you are a gamer and use Linux, Steam is a go-to client which you can install with the below commands. Also, you can search in Software as “Steam Installer” and install using [Flatpak][4] or [Snap][5]. + +``` +sudo apt install steam +``` + +![Steam Client][6] + +#### 3. Peek + +[Peek][7] is, in my opinion, an underrated application. It is an animated GIF recorder which is very useful for various workflow. This is such a powerful utility that it right fits in at Ubuntu or any Linux distro. Moreover, Peek brings options like recording area selection, countdown, gif, mp4 and WebM support. It uses ffmpeg for its backend. + +Install this excellent utility using Software by searching “peek” or by terminal commands mentioned below. + +``` +sudo apt install peek +``` + +![Peek][8] + +#### 4. Synaptic + +[Synaptic][9] is an excellent package manager that helps you add and remove packages traditionally. Those who are little experienced in Linux know about its features and flexibility. You can search for packages in various repositories, verify dependencies and proceed with the installation. + +A perfect application if you frequently install and uninstall packages. You can install synaptic using the commands mentioned below or search in Software with “synaptic”. + +``` +sudo apt install synaptic +``` + +![Synaptic Package Manager][10] + +#### 5. GDebi + +As we mentioned Synaptic above, you should also try out the [GDebi][11] package installer, which brings several features. The GDebi package installer is a command-line utility used to install external deb files. In addition, GDebi is much faster and more efficient installing .deb packages and resolves the dependencies on the fly and downloads them for you. + +One of the best terminal based Ubuntu applications for installing .deb packages, and you can install it using the below command. After installation, you can run `gdebi ` for installation of any packages. + +``` +sudo apt install gdebi +``` + +#### 6. Geary + +You always need a native [email client][12] for your Ubuntu desktop for any workflow. Emails are still relevant and valuable to many. While Ubuntu brings the great Thunderbird email client by default, you can always use another email client application which gives you a better experience. + +[Geary][13] has a friendly and straightforward user interface which gives you an easy way to set up multiple email accounts. In addition, Geary also brings conversation features, faster search, rich text email composing and other features which make it a “go-to” email client for Linux desktops. + +You can install Geary using the command below or search it in Software with the keyword “Geary”. It is also available as [Flatpak][14]. + +``` +sudo apt install geary +``` + +![Geary][15] + +#### 7. Google Chrome + +While many of you are concerned about privacy and tracking, Google Chrome is still the market leader in the browser space. Ubuntu features Firefox web browser by default, and with the recent snap events with Firefox, you may want to switch to another browser. + +You may think of using Google Chrome if you are tightly connected with the Google ecosystem and want a better web experience in streaming and browsing. However, if you are concerned about privacy and tracking, you may choose some other browsers such as Brave or Vivaldi. + +You can install Google Chrome after downloading the .deb file from the below link for Ubuntu Linux. After installation, you can open it via Software to install. + +[Download Google Chrome][16] + +#### 8. Kdenlive + +One of the best free and open-source video editors in Linux is [Kdenlive][17]. The KDenlive is simple to use with its well-designed user interface and comes with various features. Firstly, with Kdenlive, you can easily import video clips, change canvas resolution, and export to a wide range of formats after editing. Secondly, the timeline and tools allow you to cut and add titles, transitions and effects with just a click of a button. Moreover, it’s super easy to learn if you are new to video editing. + +Kdenlive is a very active project, and it’s getting more advanced features with every major release. This is one of the essential Ubuntu apps in 2022, which we feature in this list if you compare it with other [free video editors][18]. + +Installing Kdenlive is easy using the below command. In addition to that, you can also use [Flatpak][19] or [Snap][20] version to install. + +``` +sudo apt install kdenlive +``` + +![Kdenlive Video Editor][21] + +#### 9. Spectacle + +You may have tried many screenshot applications. But in my opinion, [Spectacle][22] is perhaps the best and underrated. The Spectacle is a KDE application that is super fast and perfectly fits any workflow that requires taking screenshots and using them. Firstly, you can capture the entire desktop, a portion of it or a window with a customised time. Secondly, the window captures can also pick the window decoration and cursor if needed. Third, Spectacle also gives you a built-in annotation feature to withdraw, write, and label your images. + +Furthermore, you can also open the image in GIMP or any image editor right from its main window and export them. In addition, autosave, copying the capture to the clipboard, and sharing to social media are some of the unique features of Spectacle. + +In my opinion, a complete screenshot tool with a built-in screen recorder. + +You can install Spectacle using the below command or from the [Snap store][23]. + +``` +sudo apt install kde-spectacle +``` + +![Spectacle Screenshot tool][24] + +#### 10. VLC Media Player + +Ubuntu Linux with GNOME desktop brings the GNOME Videos application by default for playing video files. But GNOME Videos cannot play several video formats due to a lack of decoding features. That is why, you should always consider [VLC Media Player][25] – which is a “go-to” media player on Linux desktops. + +VLC can play any format, literally. It even helps you to play corrupted video files having incomplete data. It is one of the powerful media players you can install using the command below. + +In addition, If you prefer another mode of installation, you can get it via [Flatpak][26] or [Snap][27]. + +``` +sudo apt install vlc +``` + +![VLC Media Player][28] + +### Closing Notes + +This concludes part 1 of a 5-part series of essential Ubuntu Apps in 2022. With the information above, I hope you get to choose some of the apps for your daily usage. And let me know which apps you prefer from this list in the comment box below. + +Finally, stay tuned for part 2 of this Ubuntu apps series. + +Cheers. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/essential-ubuntu-apps-2022-part-1/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://gitlab.gnome.org/GNOME/gnome-tweaks +[2]: https://www.debugpoint.com/wp-content/uploads/2022/05/GNOME-Tweaks-Tool.jpg +[3]: https://store.steampowered.com/ +[4]: https://flathub.org/apps/details/com.valvesoftware.Steam +[5]: https://snapcraft.io/steam +[6]: https://www.debugpoint.com/wp-content/uploads/2022/05/Steam-Client.jpg +[7]: https://github.com/phw/peek +[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/Peek-in-action2.jpg +[9]: https://www.nongnu.org/synaptic/ +[10]: https://www.debugpoint.com/wp-content/uploads/2022/05/Synaptic-Package-Manager.jpg +[11]: https://launchpad.net/gdebi +[12]: https://www.debugpoint.com/2019/06/best-email-client-linux-windows/ +[13]: https://wiki.gnome.org/Apps/Geary +[14]: https://flathub.org/apps/details/org.gnome.Geary +[15]: https://www.debugpoint.com/wp-content/uploads/2019/06/Geary.png +[16]: https://www.google.com/chrome +[17]: https://kdenlive.org/ +[18]: https://www.debugpoint.com/2019/09/best-free-video-editors-linux-ubuntu/ +[19]: https://flathub.org/apps/details/org.kde.kdenlive +[20]: https://snapcraft.io/kdenlive +[21]: https://www.debugpoint.com/wp-content/uploads/2021/01/Kdenlive-Video-Editor.jpg +[22]: https://apps.kde.org/spectacle/ +[23]: https://snapcraft.io/spectacle +[24]: https://www.debugpoint.com/wp-content/uploads/2022/05/Spectacle-Screenshot-tool.jpg +[25]: https://www.videolan.org/vlc +[26]: https://flathub.org/apps/details/org.videolan.VLC +[27]: https://snapcraft.io/vlc +[28]: https://www.debugpoint.com/wp-content/uploads/2022/05/VLC-Media-Player.jpg diff --git a/sources/tech/20220520 Add, Delete And Grant Sudo Privileges To Users In Fedora 36.md b/sources/tech/20220520 Add, Delete And Grant Sudo Privileges To Users In Fedora 36.md new file mode 100644 index 0000000000..25c2a9af5b --- /dev/null +++ b/sources/tech/20220520 Add, Delete And Grant Sudo Privileges To Users In Fedora 36.md @@ -0,0 +1,218 @@ +[#]: subject: "Add, Delete And Grant Sudo Privileges To Users In Fedora 36" +[#]: via: "https://ostechnix.com/add-delete-and-grant-sudo-privileges-to-users-in-fedora/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Add, Delete And Grant Sudo Privileges To Users In Fedora 36 +====== +Create sudo user in Fedora + +Using `sudo` program, we can elevate the ability of a normal user to run administrative tasks, without giving away the `root` user's password in Linux operating systems. This guide explains how to add, delete and grant sudo privileges to users in Fedora 36 desktop and server editions. + +I've divided this guide in three sections. The first section teaches you how to create a new user. In the second section, you'll learn how to give sudo access to the existing user. And in the last section, you will know how to remove sudo access from a user. I've also provided example commands in each section, so you can understand it better. + +First, we will start with giving sudo access to a new user. + +### 1. Create A New User In Fedora + +Login to your Fedora system as `root` user or `sudo` user. + +We can use either `useradd` or `adduser` commands to create users in Linux. + +For the purpose of this guide, I am going to create a new user called **"senthil"** using `adduser` command. + +To do so, I run the following command with `sudo` or `root` privilege: + +``` +$ sudo adduser senthil +``` + +Next, I am going to set a password to the newly created user "senthil" with `passwd` command: + +``` +$ sudo passwd senthil +``` + +![Create A New User In Fedora][1] + +We just created a normal user called "senthil". This user has not been given sudo access yet. So he can't perform any administrative tasks. + +You can verify if an user has sudo access or not like below. + +``` +$ sudo -l -U senthil +``` + +**Sample output:** + +``` +User senthil is not allowed to run sudo on fedora. +``` + +![Check If An User Has Sudo Access][2] + +As you can see, the user "senthil" is not yet allowed to run sudo. Let us go ahead and give him sudo access in the following steps. + +### 2. Grant Sudo Privileges To Users In Fedora + +To add a normal user to **sudoers** group, simply add him/her to the `wheel` group. + +For those wondering, the `wheel` is a special group in some Unix-like operating systems (E.g. RHEL based systems). All the members of `wheel` group are allowed to perform administrative tasks. Wheel group is similar to `sudo` group in Debian-based systems. + +We can add users to sudoers list in two ways. The first method is by using `chmod` command. + +#### 2.1. Add Users To Sudoers Using Usermod Command + +``` +Usermod +``` + +To grant sudo privileges to a user called "senthil", just add him to the `wheel` group using `usermod` command as shown below: + +``` +$ sudo usermod -aG wheel senthil +``` + +Here, `-aG` refers append to a supplementary group. In our case, it is `wheel` group. + +Verify if the user is in the sudoers list with command: + +``` +$ sudo -l -U senthil +``` + +If you output something like below, it means the user has been given sudo access and he can able to perform all administrative tasks. + +``` +Matching Defaults entries for senthil on fedora: + !visiblepw, always_set_home, match_group_by_gid, always_query_group_plugin, + env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS", + env_keep+="MAIL QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE", + env_keep+="LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES", + env_keep+="LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE", + env_keep+="LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY", + secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/var/lib/snapd/snap/bin + +User senthil may run the following commands on fedora: + (ALL) ALL +``` + +![Add A User To Sudoers Group Using Usermod Command][3] + +As you see in the above output, the user "Senthil" can run ALL commands on any host. + +#### 2.2. Add Users To Sudoers By Editing Sudoers Configuration File + +The another way to add users to sudoers list is by directly adding him/her to the sudoers configuration file. + +Edit sudoers configuration file using command: + +``` +$ sudo visudo +``` + +This will open `/etc/sudoers` file in your **Vi** editor or whatever you have in your `$PATH`. Scroll down until you find following entry: + +``` +root ALL=(ALL) ALL +``` + +Right after the above entry, add the following line: + +``` +senthil ALL=(ALL) ALL +``` + +![Add Users To Sudoers Group By Editing Sudoers Configuration File][4] + +Here, the line `ALL=(ALL) ALL` refers the user "senthil" can perform any commands on any host. Replace "senthil" with your own username. Save the file and close it. + +That's it. The user has been granted sudo access. + +#### 2.3. Verify Sudo Users + +Log out from the current session and log back in as the newly created sudo user. Alternatively, you can directly switch to the other user, without having to log out from the current session, using the following command: + +``` +$ sudo -i -u senthil +``` + +![Switch To New User In Fedora Linux][5] + +Now, verify if the user can able to perform any administrative task with `sudo` permission: + +``` +$ sudo dnf --refresh update +``` + +![Run Dnf Update Command With Sudo][6] + +Great! The user can able to run the `dnf update` command with sudo privilege. From now on, the user can perform all commands prefixed with sudo. + +### 3. Delete Sudo Access From A User + +Make sure you logged out of the user's session and log back in as `root` or some other sudo user. Because you can't delete the sudo access of the currently logged in user. + +We can remove sudo privileges from an user without having to entirely delete the user account. + +To do so, use `gpasswd` command to revoke sudo permissions from a user: + +``` +$ sudo gpasswd -d senthil wheel +``` + +**Sample output:** + +``` +Removing user senthil from group wheel +``` + +This will only remove sudo privilege of the given user. The user still exists in the system + +Verify if the sudo access has been removed using command: + +``` +$ sudo -l -U senthil +User senthil is not allowed to run sudo on fedora35. +``` + +![Delete Sudo Access From A User Using Gpasswd Command][7] + +#### 3.1. Permanently Delete User + +If you don't need the user any more, you can permanently remove the user from the system using `userdel` command like below. + +``` +$ sudo userdel -r senthil +``` + +The above command will delete the user "senthil" along with his  `home` directory and mail spool. + +### Conclusion + +This concludes how to add, delete and grant sudo privileges to users in Fedora 36 operating system. This method is same for other RPM-based systems as well. + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/add-delete-and-grant-sudo-privileges-to-users-in-fedora/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/wp-content/uploads/2022/05/Create-A-New-User-In-Fedora.png +[2]: https://ostechnix.com/wp-content/uploads/2022/05/Check-If-An-User-Has-Sudo-Access.png +[3]: https://ostechnix.com/wp-content/uploads/2022/05/Add-A-User-To-Sudoers-Group-Using-Usermod-Command.png +[4]: https://ostechnix.com/wp-content/uploads/2022/05/Add-Users-To-Sudoers-Group-By-Editing-Sudoers-Configuration-File.png +[5]: https://ostechnix.com/wp-content/uploads/2022/05/Switch-To-New-User-In-Fedora-Linux.png +[6]: https://ostechnix.com/wp-content/uploads/2022/05/Run-Dnf-Update-Command-With-Sudo.png +[7]: https://ostechnix.com/wp-content/uploads/2022/05/Delete-Sudo-Access-From-A-User-Using-Gpasswd-Command.png diff --git a/sources/tech/20220520 Ubuntu vs Manjaro- Comparing the Different Linux Experiences.md b/sources/tech/20220520 Ubuntu vs Manjaro- Comparing the Different Linux Experiences.md new file mode 100644 index 0000000000..caee2de033 --- /dev/null +++ b/sources/tech/20220520 Ubuntu vs Manjaro- Comparing the Different Linux Experiences.md @@ -0,0 +1,206 @@ +[#]: subject: "Ubuntu vs Manjaro: Comparing the Different Linux Experiences" +[#]: via: "https://itsfoss.com/ubuntu-vs-manjaro/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Ubuntu vs Manjaro: Comparing the Different Linux Experiences +====== +Ubuntu is the most popular Debian-based Linux distribution for desktops and servers. + +And Manjaro Linux is an Arch-based distro tailored for desktops. + +Both are entirely different when it comes to user experience and features. + +However, one of the common grounds is the [desktop environment][1] when considering Manjaro’s GNOME edition with Ubuntu. + +But, what exactly are the differences? Is the package manager on Manjaro better? Are software tools available on both Ubuntu and Manjaro? + +Here, we shall look at the differences in both the Linux distributions at certain key points. + +### Release Cycle + +Ubuntu offers two different release cycles, considering the version you pick. If you are going with the Long-Term Support version, you get security/maintenance updates for at least five years from its release. + +Suppose if you install Ubuntu 22.04 LTS, you will be getting updates until **April 2027**. + +![ubuntu22 04 lts about][2] + +The LTS version is what we recommend for most desktop users. + +However, if you want the latest and greatest, you can opt for the non-LTS releases that need an upgrade every **nine months**. Examples include Ubuntu 21.04, Ubuntu 21.10, and Ubuntu 22.10. + +Note that the non-LTS releases involve changes that may affect your workflow and user experience. So, it isn’t recommended for everyone. + +When choosing Manjaro Linux, you get a rolling release schedule for updates. So, you do not have to worry about the support for the version you use. It will automatically upgrade to the latest available version through regular updates. + +![manjaro about][3] + +With a rolling release cycle, you get the latest packages quickly. So, if you want to keep using an older version of the software, Manjaro Linux may not be the right choice for you. + +### Desktop Environments + +Ubuntu features a customized version of the GNOME desktop. It may not be the latest, but it is likely to include the latest GNOME desktop environment if you use a newer Ubuntu version. + +![ubuntu 22 04 wallpaper][4] + +There are no other desktop environments by Canonical (the company behind Ubuntu). + +However, if you want other desktop environments on top of Ubuntu, you can choose the official [Ubuntu flavours][5] including KDE, Budgie, LXQt, MATE, and XFCE as desktop environments. They are well-tested and stable Ubuntu Linux distributions when compared to unofficial or newer spins of Ubuntu with another desktop environment. + +However, Ubuntu flavours do not get five years of software support; instead, you will be limited to three years of support for LTS versions. + +With Manjaro, you can choose three official editions: XFCE, KDE, and GNOME. No matter the desktop environment, you stick to the rolling release model. + +![manjaro gnome 42][6] + +You do have some community editions with Budgie, MATE, LXQt, and more as well. + +### Package Manager or Software Ecosystem + +You shouldn’t have trouble finding most of the [essential Linux apps][7] on both the distros. + +However, Manjaro Linux gets an edge with a snappier experience using Pamac as its package manager. + +![manjaro package manager][8] + +Compared to the software center on Ubuntu, Manjaro Linux offers a better experience for quickly installing/updating the software. And, it also supports Flatpak/Snap out-of-the-box if you want to enable them with a single click. + +Ubuntu emphasizes Snap packages, and you will find some applications pre-installed as Snap (like Firefox web browser). + +![firefox as snap][9] + +In the case of Manjaro Linux, you get the freedom to enable Flatpak/Snap if required. + +With Ubuntu, the Software Center is not the best Linux offers. It could prove to be slower, as per your system configuration and over the year as you use it. + +![ubuntu 22 04 software center][10] + +In addition to that, Manjaro Linux has access to [AUR][11], which opens up access to almost every software that you may not find in Ubuntu’s software center. + +So, in terms of the software ecosystem and the package manager, Manjaro Linux does provide many advantages over Ubuntu. + +### Ease of Use and Targeted Users + +Ubuntu desktop is primarily tailored for ease of use. It focuses on providing the best possible combination of software and hardware compatibility to let any computer user work with Ubuntu Linux without needing to know most of the things in the Linux world. + +Even if someone doesn’t know what a “package manager” on Linux is, they can understand it perfectly fine as a unique replacement to Windows/macOS when they use it. + +Of course, we also have a guide to help you with [things to do after installing the latest Ubuntu version][12]. + +Manjaro Linux is also tailored for desktop usage. But, it isn’t primarily tailored for first-time Linux users. + +It aims to make the experience with Arch Linux easy. So, it mainly targets Linux users who want to use Arch Linux, but with some added convenience. + +### Stability + +![stability tux][13] + +Ubuntu LTS releases primarily focus on stability and reliability, so you can also use them on servers. + +Comparatively, Manjaro Linux may not be as stable out-of-the-box. You will have to choose the packages carefully to install in Manjaro Linux and keep an eye on your configurations to ensure that an update does not break your system experience. + +As for Ubuntu, you do not need to stress about the software updates, especially when considering the LTS version. The updates should not generally break your system. + +### Customization + +Ubuntu features a customized GNOME experience as set by Canonical for end-users. While you can choose to customize various aspects of your Linux distribution, Ubuntu offers little out of the box. + +Ubuntu has improved over the years, recently adding the ability to [add accent colors in Ubuntu 22.04 LTS][14]. But, it still has a long way to go. + +You will have to take the help of apps like [GNOME Tweak][15] to customize the desktop experience. + +When considering Manjaro’s GNOME edition, you will have to use the same tool to customize things yourself. + +Manjaro also performs a few customization tweaks to the look. But, it gives more control to change the layout and few other options. + +![manjaro layout][16] + +In terms of customization, you should be able to do the same thing on both Manjaro and Ubuntu. + +If you want more customization options, Manjaro Linux can be a good pick. And, if you want a customized experience without a lot of control over it, Ubuntu should be good enough. + +### Bloatware + +This may not be a big deal for everyone. But, if you dislike having many pre-installed applications, Ubuntu can be an annoyance. + +![ubuntu 22 apps][17] + +You can always remove the applications you do not want. However, you will find more applications and services installed with Ubuntu out of the box. + +With Manjaro, you also get to see the minimal essentials installed. But, they stick to the most essential utilities, minimizing the number of packages pre-installed. So, Manjaro gets an edge with less bloatware. + +However, there are chances that you may not find your favorite Linux app installed on Manjaro by default. So, if you like access to some of your favorite apps right after installation, Ubuntu can be a good choice. + +### Performance + +![ubuntu 22 04 neofetch lolcat][18] + +While Ubuntu has improved its performance and even works on a Raspberry Pi 2 GB variant, it is still not the best-performing Linux distribution. + +Of course, the performance does depend on the desktop environment you choose to use. + +However, compared to Manjaro’s GNOME edition, Manjaro provides a snappier experience. + +Note that your user experience with the performance and animation preferences also depends on your system configuration. For instance, the recommended system requirements (1 GB RAM + 1 GHz processor) for Manjaro give you room to use older computers. + +But, with Ubuntu, at the time of writing, you need at least 4 GB RAM and a 2 GHz dual-core processor to get an ideal desktop experience. + +### Documentation + +Ubuntu is easier to use and potentially more comfortable for new users, considering its popularity. + +[Ubuntu’s documentation][19] is good enough, if not excellent. + +When it comes to Manjaro Linux, they have a [wiki][20] with essential information and in-depth guides to help you out. + +In general, the [documentation available for Arch Linux][21] is meticulous, and almost everyone (even the veterans) refers to it to get help. + +The documentation for Arch Linux also applies to Manjaro Linux in a big way, so you do get an advantage in terms of documentation with Manjaro Linux over Ubuntu. + +### Wrapping Up + +Being two entirely different Linux distributions, they serve various kinds of users. You can choose to use anything if you want to explore the operating system and see if it suits you. + +However, if you want to avoid making any changes to your system and want to focus on your work, irrespective of the Linux distro, Ubuntu should be a no-brainer. + +In any case, if the performance with Ubuntu affects your experience by a considerable margin, you should try Manjaro. You can read my [initial thoughts on switching to Manjaro from Ubuntu][22]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-vs-manjaro/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/what-is-desktop-environment/ +[2]: https://itsfoss.com/wp-content/uploads/2022/05/ubuntu22-04-lts-about.png +[3]: https://itsfoss.com/wp-content/uploads/2022/05/manjaro-about.png +[4]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-wallpaper.jpg +[5]: https://itsfoss.com/which-ubuntu-install/ +[6]: https://itsfoss.com/wp-content/uploads/2022/05/manjaro-gnome-42.png +[7]: https://itsfoss.com/essential-linux-applications/ +[8]: https://itsfoss.com/wp-content/uploads/2022/05/manjaro-package-manager.png +[9]: https://itsfoss.com/wp-content/uploads/2022/04/firefox-as-snap.jpg +[10]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-software-center.jpg +[11]: https://itsfoss.com/aur-arch-linux/ +[12]: https://itsfoss.com/things-to-do-after-installing-ubuntu-22-04/ +[13]: https://itsfoss.com/wp-content/uploads/2022/05/stability-tux.png +[14]: https://itsfoss.com/accent-color-ubuntu/ +[15]: https://itsfoss.com/gnome-tweak-tool/ +[16]: https://itsfoss.com/wp-content/uploads/2022/05/manjaro-layout.png +[17]: https://itsfoss.com/wp-content/uploads/2022/05/ubuntu-22-apps.jpg +[18]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-neofetch-lolcat-800x445.png +[19]: https://help.ubuntu.com/ +[20]: https://wiki.manjaro.org/index.php/Main_Page +[21]: https://wiki.archlinux.org/ +[22]: https://news.itsfoss.com/manjaro-linux-experience/ diff --git a/sources/tech/20220522 Ultramarine Linux- Ultimate Fedora Spin with Budgie, Cutefish and Pantheon.md b/sources/tech/20220522 Ultramarine Linux- Ultimate Fedora Spin with Budgie, Cutefish and Pantheon.md new file mode 100644 index 0000000000..bfc6389374 --- /dev/null +++ b/sources/tech/20220522 Ultramarine Linux- Ultimate Fedora Spin with Budgie, Cutefish and Pantheon.md @@ -0,0 +1,141 @@ +[#]: subject: "Ultramarine Linux: Ultimate Fedora Spin with Budgie, Cutefish and Pantheon" +[#]: via: "https://www.debugpoint.com/2022/05/ultramarine-linux-36/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Ultramarine Linux: Ultimate Fedora Spin with Budgie, Cutefish and Pantheon +====== +A review of Ultramarine Linux features some unique desktop environments out-of-the-box with a Fedora base. + +Ultramarine Linux is a Fedora-based distribution which offers Budgie, Cutefish, Pantheon and GNOME desktop environments. This distro gives you an out-of-the-box experience with all these desktop favours with under-the-hood tweaks and packages. In addition, it pre-loads several packages (RPM Fusion, etc.) for Fedora, which you usually do as a post-install[tweak][1]. + +On top of that, Ultramarine Linux also brings several packages from its [own copr repo][2] for package distribution. + +### Ultramarine Linux Review (version 36) + +#### What does it offer? + +In a nutshell, Ultramarine Linux built itself on the Fedora Linux base. In addition, it gives you four desktop flavours – Budgie (flagship), Cutefish, Pantheon (of elementary OS) and GNOME desktop. The pre-loaded applications are typical as same as Fedora. Moreover, the application list changes based on your desktop environment of choice. + +As it is based on Fedora Linux, you get to experience the latest and greatest of technology such as Linux Kernel, audio and video tech, latest file system improvements, programming environment, etc. + +The distro is a unique combination of the latest tech with the beautiful desktops. + +#### Installation + +![Ultramarine uses Anaconda Installer][3] + +The distro brings separate ISO files for different desktop environments. From the installer, you can not choose the desktop environment. You need to download the one which you prefer. + +In a way, it is a good approach because isolating different ISO help to keep the ISO size in a range of ~2 GB. + +It uses the same Fedora’s Anaconda installer, which is easy to use. During the test, I could not find any problem while downloading the ISO or installing it. All went super-smooth. + +#### Desktop Flavours – the selling point + +This review is based on the latest Ultramarine Linux 36 (Rhode Island) based on the recently released [Fedora 36][4]. With version 36, you get the [Linux Kernel 5.17][5] and the latest applications and packages. + +##### Pantheon Flavour + +![Ultramarine Linux with Pantheon Desktop][6] + +The Pantheon desktop is surprisingly stable in Ultramarine Linux. When using, you may not feel sometimes it is elementary OS. But obviously, it is not. + +The team also included the elementaryOS AppCenter, which gives you access to a massive list of software and apps. Moreover, the Fedora system updates and upgrades are also possible from AppCenter itself. In addition to Fedora base, you get the elementaryOS File manager, text editor and system settings in Ultramarine Linux. + +![AppCenter works well with Fedora base][7] + +##### Budgie Flavour + +![Ultramarine Linux with Budgie Desktop][8] + +The Budgie desktop is the flagship offering of Ultramarine Linux and gives you a stock Budgie desktop experience. On top of the base applications and packages from Fedora Linux, the Budgie flavour brings Budgie Control Center and Budgie Desktop settings to tweak your desktop. The Budgie is blazing fast and should be a choice for you if you want it to be a productive desktop. + +This version 36 also includes the branding related changes for Fedora 37 as the [Budgie team is working on a Fedora spin][9]. + +##### Cutefish Flavour + +![Ultramarine Linux – Cutefish desktop flavour][10] + +A while back, when we [reviewed][11] the Cutefish desktop. Firstly, the Cutefish desktop is a new desktop environment created from the ground up with a vision to look beautiful while being productive. It comes with a native dark mode, a built-in global menu, and many unique features that you can read in our detailed review. Perhaps the Ultramarine is the first distro with Fedora, which provides a Cutefish desktop as an option. + +Second, the team integrated the Cutefish flavour with Fedora in an organized way to give you this nice desktop with applications such as Cutefish’s file manager, terminal and settings window. + +System upgrade/update Cutefish flavour uses GNOME Software similar to the Budgie flavour to install and uninstall applications. + +##### GNOME Flavour + +Finally, the GNOME version is similar to the Fedora workstation edition. It’s almost identical in terms of GNOME Shell and native application versions. The only difference is the RPM fusion, as reviewed below. + +#### Applications and Differences with stock Fedora Linux + +Firstly, the base applications are installed in all the above-stated desktop environments. Essential applications such as Firefox, LibreOffice, and system monitors are all installed by default in this distro. Other than that, the default shell is [ZSH with a Starship theme][12], which definitely improves productivity over the bash shell. + +Secondly, the critical addition or difference from the stock Fedora version is that Ultramarine Linux includes the RPM Fusion repo by default. The RPM Fusion repo is a collection of packages or software available as a community project. They are not included in the official Fedora distribution because of their proprietary nature. + +![Ultramarine packages RPM Fusion by default][13] + +The Ultramarine Linux brings all the RPM Fusions types – free, non-free, free-tainted and non-free trained. So, from a general user standpoint, you need not worry about [adding RPM Fusion separately][14] to install extra media playback codecs or such apps. + +The distro follows a release cadence based on Fedora Linux. So, in general, you get the updates within a month or so after an official Fedora release. + +#### Performance + +During our test, the performance is impressive in both virtual machines and physical systems. All the above desktop flavours have fantastic desktop responsiveness and an overall good impression while using them. + +For example, Pantheon, which is a little resource heavy, uses 1.3 GB of RAM, and the CPU is on average 2% in an idle state. It uses 1.8 GB of RAM with a little higher CPU of around 4% based on the applications you are running in a hefty workload mode. We tested it during the heavy workload phase using text editor, Firefox, LibreOffice calc, image viewer, and two sessions of terminal applications. + +![Idle state performance while using the Pantheon version][15] + +![Heavy workload performance while using the Pantheon version][16] + +Furthermore, I think the other desktop flavours would also be in a similar performance metric. + +I think the performance is excellent, considering it’s based on optimized Fedora. You can efficiently run this distro in the moderately newer hardware (perhaps Intel i3 and above with good RAM capacity). + +### Closing Notes + +To summarize the Ultramarine Linux 36 review, I believe it’s one of the coolest Fedora spins with some beautiful desktop environments. The vision of this distro is perfect and has a good user base. One of the plus points is the Pantheon desktop which many users like, and you get it with Fedora without manual installation. An underrated distro, in my opinion, needs more love from the community. + +If you like this Linux distribution and believe in its offerings, you should head to their community pages ([Twitter][17], [Discord][18]) for contributions/donations. The project needs some contributors as it’s a small member team. + +You can download Ultramarine Linux from the[official website][19]. + +Finally, in the comment box below, let me know your opinion about this distro. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/ultramarine-linux-36/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/2022/05/10-things-to-do-fedora-36-after-install/ +[2]: https://copr.fedorainfracloud.org/coprs/cappyishihara/ultramarine/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/Ultramarine-uses-Anaconda-Installer.jpg +[4]: https://www.debugpoint.com/2022/05/fedora-36-features/ +[5]: https://www.debugpoint.com/2022/03/linux-kernel-5-17/ +[6]: https://www.debugpoint.com/wp-content/uploads/2022/05/Ultramine-Linux-with-Pantheon-Desktop.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/05/AppCenter-works-well-with-Fedora-base.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/Ultramine-Linux-with-Budgie-Desktop.jpg +[9]: https://debugpointnews.com/fedora-budgie-fudgie/ +[10]: https://www.debugpoint.com/wp-content/uploads/2022/05/Ultramarine-Linux-Cutefosh-desktop-flavour.jpg +[11]: https://www.debugpoint.com/2021/11/cutefish-os-review-2021/ +[12]: https://www.debugpoint.com/2021/10/install-use-zsh/ +[13]: https://www.debugpoint.com/wp-content/uploads/2022/05/Ultramarine-packages-RPM-Fusion-by-default.jpg +[14]: https://www.debugpoint.com/2020/07/enable-rpm-fusion-fedora-rhel-centos/ +[15]: https://www.debugpoint.com/wp-content/uploads/2022/05/Idle-state-performance-while-using-Pantheon-version.jpg +[16]: https://www.debugpoint.com/wp-content/uploads/2022/05/Heavy-workload-performance-while-using-Pantheon-version.jpg +[17]: https://twitter.com/UltramarineProj +[18]: https://discord.gg/bUuQasHdrF +[19]: https://ultramarine-linux.org/download diff --git a/sources/tech/20220523 -Speek!- - An Open-Source Chat App That Uses Tor.md b/sources/tech/20220523 -Speek!- - An Open-Source Chat App That Uses Tor.md new file mode 100644 index 0000000000..941be75d6d --- /dev/null +++ b/sources/tech/20220523 -Speek!- - An Open-Source Chat App That Uses Tor.md @@ -0,0 +1,109 @@ +[#]: subject: "‘Speek!’ : An Open-Source Chat App That Uses Tor" +[#]: via: "https://itsfoss.com/speek/" +[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +‘Speek!’ : An Open-Source Chat App That Uses Tor +====== +An interesting open-source private messenger that utilizes Tor to keep your communications secure and private. + +Speek is an internet messaging service that leverages multiple technologies to help keep your internet chats private. + +It is end-to-end encrypted, decentralized, and open-source. + +Undoubtedly, it aims to pitch itself as one of the [WhatsApp alternatives][1] and a competitor to [Signal on Linux][2]. + +So, what is it all about? Let us take a closer look at the details. + +### ‘Speek!’ A Peer-to-Peer Instant Messaging App for Linux and Android + +![screenshot of Speek][3] + +Speek! (with an exclamation mark as part of its name) is an encrypted chat messenger that aims to fight against censorship while keeping your data private. + +To keep things simple, we ignore the exclamation mark for the rest of the article. + +You can also find it as an alternative to [Session][4], but with some differences. + +It is a fairly new competitor compared to other messengers available. However, it should be a candidate to try as an open-source solution. + +While it claims to keep you anonymous, you should always be cautious of your activities on your devices to ensure complete anonymity, if that’s what you require. It’s not just the messenger that you need to think of. + +![speek id][5] + +It utilizes a decentralized Tor network to keep things secure and private. And, this enables it to make the service useful without needing your phone number. You just require your Speek ID to connect with people, and it is tough for someone to know your ID. + +### Features of Speek + +![speek options][6] + +Some key highlights include: + +* End-to-end encryption: No one except for the recipient can view your messages. +* Routing traffic over TOR: Using TOR for routing messages, enhances privacy. +* No centralized server: Increases resistance against censorship because it’s tough to shut down the service. Moreover, no single attack point for hackers. +* No sign-ups: You do not need to share any personal information to start using the service. You just need a public key to identify/add users. +* Self-destructing chat: When you close the app, the messages are automatically deleted. For an extra layer of privacy and security. +* No metadata: It eliminates any metadata when you exchange messages. +* Private file sharing: You can also use the service to share files securely. + +### Download Speek For Linux and Other Platforms + +You can download Speek from their [official website][7]. + +At the time of writing this article, Speek is available only on Linux, Android macOS, and Windows. + +For Linux, you will find an [AppImage][8] file. In case you are unaware of AppImages, you can refer to our [AppImage guide][9] to run the application. + +![speek android][10] + +And, the Android app on the [Google Play Store][11] is fairly new. So, you should expect improvements when you try it out. + +[Speek!][12] + +### Thoughts on Using Speek + +![screenshot of Speek][13] + +The user experience for the app is pretty satisfying, and checks all the essentials required. It could be better, but it’s decent. + +Well, there isn’t much to say about Speek’s GUI. The GUI is very minimal. It is a chat app at its core and does exactly that. No stories, no maps, no unnecessary add-ons. + +In my limited time of using the app, I am satisfied with its functionalities. The features that it offers, make it a good chat app for providing a secure and private messaging experience with all the tech behind it. + +If you’re going to compare it with some commercially successful chat apps, it falls short on features. But then again, Speek is not designed as a trendy chat app with a sole focus on user experience. + +So, I would only recommend Speek for privacy-conscious users. If you want a balance of user experience and features, you might want to continue using private messengers like Signal. + +*What do you think about Speek? Is it a good private messenger for privacy-focused users? Kindly let me know your thoughts in the comments section below.* + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/speek/ + +作者:[Pratham Patel][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/pratham/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/private-whatsapp-alternatives/ +[2]: https://itsfoss.com/install-signal-ubuntu/ +[3]: https://itsfoss.com/wp-content/uploads/2022/05/01_speek_gui-1-800x532.webp +[4]: https://itsfoss.com/session-messenger/ +[5]: https://itsfoss.com/wp-content/uploads/2022/05/speek-id-800x497.png +[6]: https://itsfoss.com/wp-content/uploads/2022/05/speek-options-800x483.png +[7]: https://speek.network +[8]: https://itsfoss.com/appimage-interview/ +[9]: https://itsfoss.com/use-appimage-linux/ +[10]: https://itsfoss.com/wp-content/uploads/2022/05/speek-android.jpg +[11]: https://play.google.com/store/apps/details?id=com.speek.chat +[12]: https://speek.network/ +[13]: https://itsfoss.com/wp-content/uploads/2022/05/01_speek_gui-1-800x532.webp diff --git a/sources/tech/20220523 A hands-on guide to images and containers for developers.md b/sources/tech/20220523 A hands-on guide to images and containers for developers.md new file mode 100644 index 0000000000..daa4579027 --- /dev/null +++ b/sources/tech/20220523 A hands-on guide to images and containers for developers.md @@ -0,0 +1,409 @@ +[#]: subject: "A hands-on guide to images and containers for developers" +[#]: via: "https://opensource.com/article/22/5/guide-containers-images" +[#]: author: "Evan "Hippy" Slatis https://opensource.com/users/hippyod" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A hands-on guide to images and containers for developers +====== +Understand the key concepts behind images and containers. Then try a lab that demonstrates building and running images and containers. + +![Shipping containers stacked in a yard][1] + +Image by: Lucarelli via Wikimedia Commons. CC-BY-SA 3.0 + +Containers and Open Container Initiative (OCI) images are important open source application packaging and delivery technologies made popular by projects like Docker and Kubernetes. The better you understand them, the more able you will be to use them to enhance the consistency and scalability of your projects. + +In this article, I will describe this technology in simple terms, highlight the essential aspects of images and containers for a developer to understand, then wrap up by discussing some best practices developers can follow to make their containers portable. I will also walk you through a simple lab that demonstrates building and running images and containers. + +### What are images? + +Images are nothing more than a packaging format for software. A great analogy is Java's JAR file or a Python wheel. JAR (or EAR or WAR) files are simply ZIP files with a different extension, and Python wheels are distributed as gzipped tarballs. All of them conform to a standard directory structure internally. + +Images are packaged as `tar.gz` (gzipped tarballs), and they include the software you're building and/or distributing, but this is where the analogy to JARs and wheels ends. For one thing, images package not just your software but all supporting dependencies needed to run your software, up to and including a complete operating system. Whereas wheels and JARs are usually built as dependencies but can be executable, images are almost always built to be executed and more rarely as a dependency. + +Knowing the details of what's in the images isn't necessary to understand how to use images or to write and design software for them (if you're interested, read ["What is a container image?"][2]). From your perspective, and especially from the perspective of your software, what's important to understand is that the images you create will contain a *complete operating system*. Because images are packaged as if they're a complete operating system from the perspective of the software you wish to run, they are necessarily much larger than software packaged in a more traditional fashion. + +Note that images are immutable. They cannot be changed once they are built. If you modify the software running on the image, you must build an entirely new image and replace the old one. + +#### Tags + +When images are created, they are created with a unique hash, but they are typically identified with a human-readable name such as `ubi`, `ubi-minimal`, `openjdk11`, and so on. However, there can be different versions of the image for each of their names, and those are typically differentiated by tags. For example, the `openjdk11` image might be tagged as `jre-11.0.14.1_1-ubi` and `jre-11.0.14.1_1-ubi-minimal,` denoting image builds of the openjdk11 software package version 11.0.14.1_1 installed on a Red Hat `ubi` and `ubi minimal` image, respectively. + +### What are containers? + +Containers are images that have been realized and executed on a host system. Running a container from an image is a two-step process: create and start. Create takes the image and gives it its own ID and filesystem. Create (as in `docker create`, for example) can be repeated many times in order to create many instances of a running image, each with its own ID and filesystem. Starting the container will launch an isolated process on the host machine in which the software running inside the container will behave as if it is running in its very own virtual machine. A container is thus an isolated process on the host machine, with its own ID and independent filesystem. + +From a software developer's perspective, there are two primary reasons to use containers: consistency and scalability. These are related to each other, and together they allow projects to use one of the most promising innovations to come to software development in recent years, the principle of "Build once, deploy many." + +#### Consistency + +Because images are immutable and include all of the dependencies needed to run your software from the OS on up, you gain consistency wherever you choose to deploy it. This means whether you launch an image as a container in a development, test, or any number of production environments, the container will run exactly the same way. As a software developer, you won't have to worry about whether any of those environments are running on a different host operating system or version, because the container is running the same operating system every time. That's the benefit of packaging your software along with its complete runtime environment, rather than just your software without the complete set of dependencies needed to run it. + +This consistency means that in almost all cases, when an issue is found in one environment (for example, production), you can be confident that you'll be able to reproduce that issue in development or some other environment, so you can confirm the behavior and focus on fixing it. Your project should never get mired in and stumped by the dreaded "But it works on my machine" problem again. + +#### Scalability + +Images contain not only your software but also all the dependencies needed to run your software, including the underlying operating system. This means all processes running inside the container view the container as the host system, the host system is invisible to processes running inside the container, and, from the host system's point of view, the container is just another process it manages. Of course, virtual machines do almost the same thing, which raises a valid question: Why use container technology instead of a virtual machine? The answer lies in both speed and size. + +Containers run only the software required to support an independent host without the overhead of having to mimic the hardware. Virtual machines must contain a complete operating system and mimic the underlying hardware. The latter is a very heavyweight solution, which also results in much larger files. Because containers are treated as just another running process from the host system's perspective, they can be spun up in seconds rather than minutes. When your application needs to scale quickly, containers will beat a virtual machine in resources and speed every time. Containers are also easier to scale back down. + +Scaling is outside the scope of this article from a functional standpoint, so the lab will not be demonstrating this feature, but it's important to understand the principle in order to understand why container technology represents such a significant advance in the packaging and deployment of software. + +Note: While it is possible to [run a container that does not include a complete operating system][3], this is rarely done because the minimal images available are usually an insufficient starting point. + +### How to find and store images + +Like every other type of software packaging technology, containers need a place where packages can be shared, found, and reused. These are called image registries, analogous to Java Maven and Python wheel repositories or npm registries. + +These are a sampling of different image registries available on the internet: + +* [Docker Hub][4]: The original Docker registry, which hosts many Docker official images used widely among projects worldwide and provides opportunities for individuals to host their own images. One of the organizations that hosts images on Docker Hub is adoptopenjdk; view their repository for examples of images and tags for the [openjdk11][5] project. +* [Red Hat Image Registry][6]: Red Hat's official image registry provides images to those with valid Red Hat subscriptions. +* [Quay][7]: Red Hat's public image registry hosts many of Red Hat's publicly available images and provides providing opportunities for individuals to host their own images. + +### Using images and containers + +There are two utilities whose purpose is to manage images and containers: [Docker][8]and [Podman][9]. They are available for Windows, Linux, and Mac workstations. From a developer's point of view, they are completely equivalent when executing commands. They can be considered aliases of one another. You can even install a package on many systems that will automatically change Docker into a Podman alias. Wherever Podman is mentioned in this document, Docker can be safely substituted with no change in outcome. + +You'll immediately notice these utilities are very similar to [Git][10] in that they perform tagging, pushing, and pulling. You will use or refer to this functionality regularly. They should not be confused with Git, however, since Git also manages version control, whereas images are immutable and their management utilities and registry have no concept of change management. If you push two images with the same name and tag to the same repository, the second image will overwrite the first with no way to see or understand what has changed. + +#### Subcommands + +The following are a sampling of Podman and Docker subcommands you will commonly use or refer to: + +* build: `build` an image + * Example: `podman build -t org/some-image-repo -f Dockerfile` +* image: manage `image`s locally + * Example: `podman image rm -a` will remove all local images. +* images: list `images` stored locally + * tag: `tag` an image +* container: manage `container`s + * Example: `podman container rm -a` will remove all stopped local containers. +* run: `create` and `start` a container + * also `stop` and `restart` +* pull/push: `pull`/push and image from/to a repository on a registry + +#### Dockerfiles + +Dockerfiles are the source files that define images and are processed with the `build` subcommand. They will define a parent or base image, copy in or install any extra software you want to have available to run in your image, define any extra metadata to be used during the build and/or runtime, and potentially specify a command to run when a container defined by your image is run. A more detailed description of the anatomy of a Dockerfile and some of the more common commands used in them is in the lab below. A link to the complete Dockerfile reference appears at the end of this article. + +#### Fundamental differences between Docker and Podman + +Docker is a daemon in Unix-like systems and a service in Windows. This means it runs in the background all the time, and it runs with root or administrator privileges. Podman is binary. This means it runs only on demand, and can run as an unprivileged user. + +This makes Podman more secure and more efficient with system resources (why run all the time if you don't have to?). Running anything with root privileges is, by definition, less secure. When using images on the cloud, the cloud that will host your containers can manage images and containers more securely. + +#### Skopeo and Buildah + +While Docker is a singular utility, Podman has two other related utilities maintained by the Containers organization on GitHub: [Skopeo][11] and [Buildah][12]. Both provide functionality that Podman and Docker do not, and both are part of the container-tools package group with Podman for installation on the Red Hat family of Linux distributions. + +For the most part, builds can be executed through Docker and Podman, but Buildah exists in case more complicated builds of images are required. The details of these more complicated builds are far outside the scope of this article, and you'll rarely, if ever, encounter the need for it, but I include mention of this utility here for completeness. + +Skopeo provides two utility functions that Docker does not: the ability to copy images from one registry to another and to delete an image from a remote registry. Again, this functionality is outside the scope of this discussion, but the functionality could eventually be of use to you, especially if you need to write some DevOps scripts. + +### Dockerfiles lab + +The following is a very short lab (about 10 minutes) that will teach you how to build images using Dockerfiles and run those images as containers. It will also demonstrate how to externalize your container's configuration to realize the full benefits of container development and "Build once, deploy many." + +#### Installation + +The following lab was created and tested locally running Fedora and in a [Red Hat sandbox environment][13] with Podman and Git already installed. I believe you'll get the most out of this lab running it in the Red Hat sandbox environment, but running it locally is perfectly acceptable. + +You can also install Docker or Podman on your own workstation and work locally. As a reminder, if you install Docker, `podman` and `docker` are completely interchangeable for this lab. + +#### Building Images + +**1. Clone the Git repository from GitHub:** + +``` +$ git clone https://github.com/hippyod/hello-world-container-lab +``` + +**2. Open the Dockerfile:** + +``` +$ cd hello-world-container-lab +$ vim Dockerfile +``` + +``` +1 FROM Docker.io/adoptopenjdk/openjdk11:x86_64-ubi-minimal-jre-11.0.14.1_1 + +2 + +3 USER root + +4 + +5 ARG ARG_MESSAGE_WELCOME='Hello, World' + +6 ENV MESSAGE_WELCOME=${ARG_MESSAGE_WELCOME} + +7 + +8 ARG JAR_FILE=target/*.jar + +9 COPY ${JAR_FILE} app.jar + +10 + +11 USER 1001 + +12 + +13 ENTRYPOINT ["java", "-jar", "/app.jar"] +``` + +This Dockerfile has the following features: + +* The FROM statement (line 1) defines the base (or parent) image this new image will be built from. +* The USER statements (lines 3 and 11) define which user is running during the build and at execution. At first, root is running in the build process. In more complicated Dockerfiles I would need to be root to install any extra software, change file permissions, and so forth, to complete the new image. At the end of the Dockerfile, I switch to the user with UID 1001 so that, whenever the image is realized as a container and executes, the user will not be root, and therefore more secure. I use the UID rather than a username so that the host can recognize which user is running in the container in case the host has enhanced security measures that prevent containers from running as the root user. +* The ARG statements (lines 5 and 8) define variables that can be used during the build process only. +* The ENV statement (line 6) defines an environment variable and value that can be used during the build process but will also be available whenever the image is run as a container. Note how it obtains its value by referencing the variable defined by the previous ARG statement. +* The COPY statement (line 9) copies the JAR file created by the Spring Boot Maven build into the image. For the convenience of users running in the Red Hat sandbox, which doesn't have Java or Maven installed, I have pre-built the JAR file and pushed it to the hello-world-container-lab repo. There is no need to do a Maven build in this lab. (Note: There is also an `add` command that can be substituted for COPY. Because the `add` command can have unpredictable behavior, COPY is preferable.) +* Finally, the ENTRYPOINT statement defines the command and arguments that should be executed in the container when the container starts up. If this image ever becomes a base image for a subsequent image definition and a new ENTRYPOINT is defined, it will override this one. (Note: There is also a `cmd` command that can be substituted for ENTRYPOINT. The difference between the two is irrelevant in this context and outside the scope of this article.) + +Type `:q` and hit **Enter** to quit the Dockerfile and return to the shell. + +**3. Build the image:** + +``` +$ podman build --squash -t test/hello-world -f Dockerfile +``` + +You should see: + +``` +STEP 1: FROM docker.io/adoptopenjdk/openjdk11:x86_64-ubi-minimal-jre-11.0.14.1_1 +Getting image source signatures +Copying blob d46336f50433 done   +Copying blob be961ec68663 done +... +STEP 7/8: USER 1001 +STEP 8/8: ENTRYPOINT ["java", "-jar", "/app.jar"] +COMMIT test/hello-world +... +Successfully tagged localhost/test/hello-world:latest +5482c3b153c44ea8502552c6bd7ca285a69070d037156b6627f53293d6b05fd7 +``` + +In addition to building the image the commands provide the following instructions: + +The `--squash` flag will reduce image size by ensuring that only one layer is added to the base image when the image build completes. Excess layers will inflate the size of the resulting image. FROM, RUN, and COPY/ADD statements add layers, and best practices are to concatenate these statements when possible, for example: + +``` +RUN dnf -y --refresh update && \ +    dnf install -y --nodocs podman skopeo buildah && \ +    dnf clean all +``` + +The above RUN statement will not only run each statement to create only a single layer but will also fail the build should any one of them fail. + +The `-t flag` is for naming the image. Because I did not explicitly define a tag for the name (such as `test/hello-world:1.0)`, the image will be tagged as latest by default. I also did not define a registry (such as `quay.io/test/hello-world` ), so the default registry will be localhost. + +The `-f` flag is for explicitly declaring the Dockerfile to be built. + +When running the build, Podman will track the downloading of "blobs." These are the image layers your image will be built upon. They are initially pulled from the remote registry, and they will be cached locally to speed up future builds. + +``` +Copying blob d46336f50433 done   +Copying blob be961ec68663 done +... +Copying blob 744c86b54390 skipped: already exists   +Copying blob 1323ffbff4dd skipped: already exists +``` + +**4. When the build completes, list the image to confirm it was successfully built:** + +``` +$ podman images +``` + +You should see: + +``` +REPOSITORY                                        TAG                                                      IMAGE ID      CREATED               SIZE +localhost/test/hello-world                 latest                                                    140c09fc9d1d  7 seconds ago  454 MB +docker.io/adoptopenjdk/openjdk11  x86_64-ubi-minimal-jre-11.0.14.1_1  5b0423ba7bec  22 hours ago   445 MB +``` + +#### Running containers + +**5. Run the image:** + +``` +$ podman run test/hello-world +``` + +You should see: + +``` +.   ____          _            __ _ _ + /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/  ___)| |_)| | | | | || (_| |  ) ) ) ) +  '  |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot ::                (v2.5.4) + +... +GREETING: Hello, world +GREETING: Hello, world +``` + +The output will continue printing "Hello, world" every three seconds until you exit: + +``` +crtl-c +``` + +**6. Prove that Java is installed only in the container:** + +``` +$ java -version +``` + +The Spring Boot application running inside the container requires Java to run, which is why I chose the base image. If you're running in the Red Hat sandbox environment for the lab, this prove sthat Java is installed only in the container, and not on the host: + +``` +-bash: java: command not found... +``` + +#### Externalize your configuration + +The image is now built, but what happens when I want the "Hello, world" message to be different for each environment I deploy the image to? For example, I might want to change it because the environment is for a different phase of development or a different locale. If I change the value in the Dockerfile, I'm required to build a new image to see the message, which breaks one of the most fundamental benefits of containers—"Build once, deploy many." So how do I make my image truly portable so it can be deployed wherever I need it? The answer lies in externalizing the configuration. + +7. Run the image with a new, external welcome message: + +``` +$ podman run -e 'MESSAGE_WELCOME=Hello, world DIT' test/hello-world +``` + +You should see: + +``` +Output: +  .   ____          _            __ _ _ + /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/  ___)| |_)| | | | | || (_| |  ) ) ) ) +  '  |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot ::                (v2.5.4) + +... +GREETING: Hello, world DIT +GREETING: Hello, world DIT +``` + +Stop using by using `crtl-c` and adapt the message: + +``` +$ podman run -e 'MESSAGE_WELCOME=Hola Mundo' test/hello-world +``` + +``` +.   ____          _            __ _ _ + /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/  ___)| |_)| | | | | || (_| |  ) ) ) ) +  '  |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot ::                (v2.5.4) + +... +GREETING: Hola Mundo +GREETING: Hola Mundo +``` + +The `-e` flag defines an environment variable and value to inject into the container at startup. As you can see, even if the variable was built into the original image (the `ENV MESSAGE_WELCOME=${ARG_MESSAGE_WELCOME}` statement in your Dockerfile), it will be overridden. You've now externalized data that needed to change based on where it was to be deployed (for example, in a DIT environment or for Spanish speakers) and thus made your images portable. + +**8. Run the image with a new message defined in a file:** + +``` +$ echo 'Hello, world from a file' > greetings.txt +$ podman run -v "$(pwd):/mnt/data:Z" \ +    -e 'MESSAGE_FILE=/mnt/data/greetings.txt' test/hello-world +``` + +In this case you should see: + +``` +.   ____          _            __ _ _ + /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/  ___)| |_)| | | | | || (_| |  ) ) ) ) +  '  |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot ::                (v2.5.4) + +... +GREETING: Hello, world from a file +GREETING: Hello, world from a file +``` + +Repeat until you hit `crtl-c` to stop + +The `-e` flag in this case defines a path to the file at `/mnt/data/greetings.txt` that was mounted from the host's local file system with the `-v` flag at `$(pwd)/greetings.txt` (`pwd` is a bash utility that outputs the absolute path of the current directory, which in your case should be the `hello-world-container-lab` ). You've now externalized data that needed to change based on where it was to be deployed, but this time your data was defined in an external file you mounted into the container. Environment variable settings are OK for a limited number of settings, but when you have several settings to apply, a file is a more efficient way of injecting the values into your containers. + +Note: The `:Z` flag at the end of the volume definition above is for systems using [SELinux][14]. SELinux manages security on many Linux distributions, and the flag allows the container access to the directory. Without the flag, SELinux would prevent the reading of the file, and an exception would be thrown in the container. Try running the command above again after removing the `:Z` to see a demonstration. + +This concludes the lab. + +### Developing for containers: externalize the configuration + +"Build once, deploy many" works because the immutable containers running in different environments don't have to worry about differences in the hardware or software required to support your particular software project. This principle makes software development, debugging, deployment, and ongoing maintenance much faster and easier. It also isn't perfect, and some minor changes have to be made in how you code to make your container truly portable. + +The most important design principle when writing software for containerization is deciding what to externalize. These decisions ultimately make your images portable so they can fully realize the "Build once, deploy many" paradigm. Although this may seem complicated, there are some easy-to-remember factors to consider when deciding whether the configuration data should be injectable into your running container: + +* Is the data environment-specific? This includes any data that needs to be configured based on where the container is running, whether the environment is a production, non-production, or development environment. Data of this sort includes internationalization configuration, datastore information, and the specific testing profile(s) you want your application to run under. +* Is the data release independent? Data of this sort can run the gamut from feature flags to internationalization files to log levels—basically, any data you might want or need to change between releases without a build and new deployment. +* Is the data a secret? Credentials should never be hard coded or stored in an image. Credentials typically need to be refreshed on schedules that don't match release schedules, and embedding a secret in an image stored in an image registry is a security risk. + +The best practice is to choose where your configuration data should be externalized (that is, in an environment variable or a file) and only externalize those pieces that meet the above criteria. If it doesn't meet the above criteria, it is best to leave it as part of the immutable image. Following these guidelines will make your images truly portable and keep your external configuration reasonably sized and manageable. + +### Summary + +This article introduces four key ideas for software developers new to images and containers: + +1. Images are immutable binaries: Images are a means of packaging software for later reuse or deployment. +2. Containers are isolated processes: When they are created, containers are a runtime instantiation of an image. When containers are started, they become processes in memory on a host machine, which is much lighter and faster than a virtual machine. For the most part, developers only need to know the latter, but understanding the former is helpful. +3. "Build once, deploy many": This principle is what makes container technology so useful. Images and containers provide consistency in deployments and independence from the host machine, allowing you to deploy with confidence across many different environments. Containers are also easily scalable because of this principle. +4. Externalize the configuration: If your image has configuration data that is environment-specific, release-independent, or secret, consider making that data external to the image and containers. You can inject this data into your running image by injecting an environment variable or mounting an external file into the container. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/guide-containers-images + +作者:[Evan "Hippy" Slatis][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hippyod +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/bus-containers2.png +[2]: https://opensource.com/article/21/8/container-image +[3]: https://opensource.com/article/22/2/build-your-own-container-linux-buildah +[4]: http://hub.docker.com/ +[5]: https://hub.docker.com/r/adoptopenjdk/openjdk11/tags?page=1&name=jre-11.0.14.1_1-ubi +[6]: http://registry.redhat.io/ +[7]: http://quay.io/ +[8]: https://opensource.com/resources/what-docker +[9]: https://www.redhat.com/sysadmin/podman-guides-2020 +[10]: https://git-scm.com/) +[11]: https://github.com/containers/skopeo/blob/main/install.md +[12]: https://github.com/containers/buildah +[13]: https://developers.redhat.com/courses/red-hat-enterprise-linux/deploy-containers-podman +[14]: https://www.redhat.com/en/topics/linux/what-is-selinux +[15]: https://www.redhat.com/en/services/training/do080-deploying-containerized-applications-technical-overview?intcmp=7013a000002qLH8AAM +[16]: https://blog.aquasec.com/a-brief-history-of-containers-from-1970s-chroot-to-docker-2016 +[17]: https://developers.redhat.com/blog/2018/02/22/container-terminology-practical-introduction?intcmp=7013a000002qLH8AAM +[18]: https://docs.docker.com/engine/reference/builder/ +[19]: https://www.imaginarycloud.com/blog/podman-vs-docker/#:~:text=Docker%20uses%20a%20daemon%2C%20an,does%20not%20need%20the%20mediator. diff --git a/sources/tech/20220524 12 essential Linux commands for beginners.md b/sources/tech/20220524 12 essential Linux commands for beginners.md new file mode 100644 index 0000000000..c5273a7bc3 --- /dev/null +++ b/sources/tech/20220524 12 essential Linux commands for beginners.md @@ -0,0 +1,187 @@ +[#]: subject: "12 essential Linux commands for beginners" +[#]: via: "https://opensource.com/article/22/5/essential-linux-commands" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +12 essential Linux commands for beginners +====== +I recommend these commands to anyone who is getting started with Linux. + +![Command line prompt][1] + +Image by: Opensource.com + +When operating on the Linux command line, it is easy to get disoriented, which can have disastrous consequences. I once issued a remove command before realizing that I'd moved the boot directory of my computer. I learned to use the `pwd` command to know exactly which part of the file system I was in (and these days, there are command projects, like [trashy and trash-cli][2], that serve as intermediates when removing files). + +When I was new to Linux, I had a cheat sheet that hung over my desk to help me remember those commands as I managed my Linux servers. It was called the *101 commands for Linux* cheat sheet. As I became more familiar with these commands, I became more proficient with server administration. + +Here are 12 Linux commands I find most useful. + +### 1. Print working directory (pwd) + +The `pwd` command prints your working directory. In other words, it outputs the path of the directory you are currently working in. There are two options: `--logical` to display your location with any symlinks and `--physical` to display your location after resolving any symlinks. + +### 2. Make directory (mkdir) + +Making directories is easy with the `mkdir` command. The following command creates a directory called `example` unless `example` already exists: + +``` +$ mkdir example +``` + +You can make directories within directories: + +``` +$ mkdir -p example/one/two +``` + +If directories `example` and `one` already exist, only directory `two` is created. If none of them exist, then three nested directories are created. + +### 3. List (ls) + +Coming from MS-DOS, I was used to listing files with the `dir` command. I don't recall working on Linux at the time, although today, `dir` is in the GNU Core Utilities package. Most people use the `ls` command to display the files, along with all their properties, are in a directory. The `ls` command has many options, including `-l` to view a long listing of files, displaying the file owner and permissions. + +### 4. Change directory (cd) + +It is often necessary to change directories. That's the `cd` command's function. For instance, this example takes you from your home directory into the `Documents` directory: + +``` +$ cd Documents +``` + +You can quickly change to your home directory with `cd ~` or just `cd` on most systems. You can use `cd ..` to move up a level. + +### 5. Remove a file (rm) + +Removing files is inherently dangerous. Traditionally, the Linux terminal has no Trash or Bin like the desktop does, so many terminal users have the bad habit of permanently removing data they believe they no longer need. There's no "un-remove" command, though, so this habit can be problematic should you accidentally delete a directory containing important data. + +A Linux system provides `rm` and `shred` for data removal. To delete file `example.txt`, type the following: + +``` +$ rm example.txt +``` + +However, it's much safer to install a trash command, such as [trashy][3] or [trash-cli][4]. Then you can send files to a staging area before deleting them forever: + +``` +$ trash example.txt +``` + +### 6. Copy a file (cp) + +Copy files with the `cp` command. The syntax is copy *from-here* *to-there*. Here's an example: + +``` +$ cp file1.txt newfile1.txt +``` + +You can copy entire directories, too: + +``` +$ cp -r dir1 newdirectory +``` + +### 7. Move and rename a file (mv) + +Renaming and moving a file is functionally the same process. When you move a file, you take a file from one directory and put it into a new one. When renaming a file, you take a file from one directory and put it back into the same directory or a different directory, but with a new name. Either way, you use the `mv` command: + +``` +$ mv file1.txt file_001.txt +``` + +### 8. Create an empty file (touch) + +Easily create an empty file with the `touch` command: + +``` +$ touch one.txt + +$ touch two.txt + +$ touch three.md +``` + +### 9. Change permissions (chmod) + +Change the permissions of a file with the `chmod` command. One of the most common uses of `chmod` is making a file executable: + +``` +$ chmod +x myfile +``` + +This example is how you give a file permission to be executed as a command. This is particularly handy for scripts. Try this simple exercise: + +``` +$ echo 'echo Hello $USER' > hello.sh + +$ chmod +x hello.sh + +$ ./hello.sh +Hello, Don +``` + +### 10. Escalate privileges (sudo) + +While administering your system, it may be necessary to act as the super user (also called root). This is where the `sudo` (or *super user do*) command comes in. Assuming you're trying to do something that your computer alerts you that only an administrator (or root) user can do, just preface it with the command `sudo` : + +``` +$ touch /etc/os-release && echo "Success" +touch: cannot touch '/etc/os-release': Permission denied + +$ sudo touch /etc/os-release && echo "Success" +Success +``` + +### 11. Shut down (poweroff) + +The `poweroff` command does exactly what it sounds like: it powers your computer down. It requires `sudo` to succeed. + +There are actually many ways to shut down your computer and some variations on the process. For instance, the `shutdown` command allows you to power down your computer after an arbitrary amount of time, such as 60 seconds: + +``` +$ sudo shutdown -h 60 +``` + +Or immediately: + +``` +$ sudo shutdown -h now +``` + +You can also restart your computer with `sudo shutdown -r now` or just `reboot`. + +### 12. Read the manual (man) + +The `man` command could be the most important command of all. It gets you to the documentation for each of the commands on your Linux system. For instance, to read more about `mkdir` : + +``` +$ man mkdir +``` + +A related command is `info`, which provides a different set of manuals (as long as they're available) usually written more verbosely than the often terse man pages. + +### What's your favorite Linux command? + +There are many more commands on a Linux system—hundreds! What's your favorite command, the one you find yourself using time and time again? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/essential-linux-commands + +作者:[Don Watkins][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/command_line_prompt.png +[2]: https://www.redhat.com/sysadmin/recover-file-deletion-linux +[3]: https://gitlab.com/trashy/trashy +[4]: https://github.com/andreafrancia/trash-cli diff --git a/sources/tech/20220524 Build a Quarkus reactive application using Kubernetes Secrets.md b/sources/tech/20220524 Build a Quarkus reactive application using Kubernetes Secrets.md new file mode 100644 index 0000000000..d69869e358 --- /dev/null +++ b/sources/tech/20220524 Build a Quarkus reactive application using Kubernetes Secrets.md @@ -0,0 +1,232 @@ +[#]: subject: "Build a Quarkus reactive application using Kubernetes Secrets" +[#]: via: "https://opensource.com/article/22/5/quarkus-kubernetes-secrets" +[#]: author: "Daniel Oh https://opensource.com/users/daniel-oh" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Build a Quarkus reactive application using Kubernetes Secrets +====== +Follow security policies while developing applications for the cloud by using Kubernetes Secrets. + +![Improve your DevOps security game with Ansible Vault][1] + +Image by: Opensource.com + +Many organizations have security policies in place that dictate how to store sensitive information. When you're developing applications for the cloud, you're probably expected to follow those policies, and to do that you often have to externalize your data storage. Kubernetes has a built-in system to access external secrets, and learning to use that is key to a safe cloud-native app. + +In this article, I'm going to demonstrate how to build a Quarkus reactive application with externalized sensitive information—for instance, a password or token—using [Kubernetes Secrets][2]. A secret is a good example of how cloud platforms can secure applications by removing sensitive data from your static code. Note that you can find a solution to this tutorial [in this GitHub repository][3]. + +### 1. Scaffold a new reactive Quarkus project + +Use the Quarkus command-line interface (CLI) to scaffold a new project. If you haven't already installed the Quarkus CLI, follow these [instructions][5] according to your operating system. + +Run the following Quarkus CLI in your project directory to add `kubernetes-config`, `resteasy-reactive`, and `openshift` extensions: + +``` +$ quarkus create app quarkus-secret-example \ +-x resteasy-reactive,kubernetes-config,openshift +``` + +The output should look like this: + +``` +Looking for the newly published extensions in registry.quarkus.io +selected extensions: +- io.quarkus:quarkus-kubernetes-config +- io.quarkus:quarkus-resteasy-reactive +- io.quarkus:quarkus-openshift + + +applying codestarts... +📚  java +🔨  maven +📦  quarkus +📝  config-properties +🔧  dockerfiles +🔧  maven-wrapper +🚀  resteasy-reactive-codestart + +----------- + +[SUCCESS] ✅  quarkus project has been successfully generated in: +--> /tmp/quarkus-secret-example +----------- +Navigate into this directory and get started: quarkus dev +``` + +### 2. Create a Secret in Kubernetes + +To manage the Kubernetes Secrets, you have three options: + +* Using kubectl +* Using Configuration File +* Node [Kustomize][6] + +Use the `kubectl` command to create a new database credential (a username and password). Run the following command: + +``` +$ kubectl create secret generic db-credentials \                                                                       + --from-literal=username=admin \ + --from-literal=password=secret +``` + +If you haven't already installed a Kubernetes cluster locally, or you have no remote cluster, you can sign in to the [developer sandbox][7], a no-cost sandbox environment for Red Hat OpenShift and CodeReady Workspaces. + +You can confirm that the Secret is created properly by using the following command: + +``` +$ kubectl get secret/db-credentials -o yaml +``` + +The output should look like this: + +``` +apiVersion: v1 +data: +  password: c2VjcmV0 +  username: YWRtaW4= +kind: Secret +metadata: +  creationTimestamp: "2022-05-02T13:46:18Z" +  name: db-credentials +  namespace: doh-dev +  resourceVersion: "1190920736" +  uid: 936abd44-1097-4c1f-a9d8-8008a01c0add +type: Opaque +``` + +The username and password are encoded by default. + +### 3. Create a new RESTful API to access the Secret + +Now you can add a new RESTful (for Representational State Transfer) API to print out the username and password stored in the Kubernetes Secret. Quarkus enables developers to refer to the secret as a normal configuration using a `@ConfigureProperty` annotation. + +Open a `GreetingResource.java` file in `src/main/java/org/acme`. Then, add the following method and configurations: + +``` +@ConfigProperty(name = "username") +    String username; + +    @ConfigProperty(name = "password") +    String password; + +    @GET +    @Produces(MediaType.TEXT_PLAIN) +    @Path("/securty") +    public Map securty() { +        HashMap map = new HashMap<>(); +        map.put("db.username", username); +        map.put("db.password", password); +        return map; +    } +``` + +Save the file. + +### 4. Set the configurations for Kubernetes deployment + +Open the `application.properties` file in the `src/main/resources` directory. Add the following configuration for the Kubernetes deployment. In the tutorial, I'll demonstrate using the developer sandbox, so the configurations tie to the OpenShift cluster. + +If you want to deploy it to the Kubernetes cluster, you can package the application via Docker container directly. Then, you need to push the container image to an external container registry (for example, Docker Hub, quay.io, or Google container registry). + +``` +# Kubernetes Deployment +quarkus.kubernetes.deploy=true +quarkus.kubernetes.deployment-target=openshift +openshift.expose=true +quarkus.openshift.build-strategy=docker +quarkus.kubernetes-client.trust-certs=true + +# Kubernetes Secret +quarkus.kubernetes-config.secrets.enabled=true +quarkus.kubernetes-config.secrets=db-credentials +``` + +Save the file. + +### 5. Build and deploy the application to Kubernetes + +To build and deploy the reactive application, you can also use the following Quarkus CLI: + +``` +$ quarkus build +``` + +This command triggers the application build to generate a `fast-jar` file. Then the application `Jar` file is containerized using a Dockerfile, which was already generated in the `src/main/docker` directory when you created the project. Finally, the application image is pushed into the integrated container registry inside the OpenShift cluster. + +The output should end with a `BUILD SUCCESS` message. + +When you deploy the application to the developer sandbox or normal OpenShift cluster, you can find the application in the Topology view in the Developer perspective, as shown in the figure below. + +![A screenshot of Red Hat OpenShift Dedicated. In the left sidebar menu Topology is highlighted, and in the main screen there is a Quarkus icon][8] + +Image by: (Daniel Oh, CC BY-SA 4.0) + +### 6. Verify the sensitive information + +To verify that your Quarkus application can refer to the sensitive information from the Kubernetes Secret, get the route URL using the following `kubectl` command: + +``` +$ kubectl get route +``` + +The output is similar to this: + +``` +NAME                     HOST/PORT                                                               PATH   SERVICES                 PORT   TERMINATION   WILDCARD +quarkus-secret-example   quarkus-secret-example-doh-dev.apps.sandbox.x8i5.p1.openshiftapps.com          quarkus-secret-example   8080                 None +``` + +Use the [curl command][9] to access the RESTful API: + +``` +$ curl http://YOUR_ROUTE_URL/hello/security +``` + +The output: + +``` +{db.password=secret, db.username=admin} +``` + +Awesome! The above `username` and `password` are the same as those you stored in the `db-credentials` secret. + +### Where to learn more + +This guide has shown how Quarkus enables developers to externalize sensitive information using Kubernetes Secrets. Find additional resources to develop cloud-native microservices using Quarkus on Kubernetes here: + +* [7 guides for developing applications on the cloud with Quarkus][10] +* [Extend Kubernetes service discovery with Stork and Quarkus][11] +* [Deploy Quarkus applications to Kubernetes using a Helm chart][12] + +You can also watch this step-by-step [tutorial video][13] on how to manage Kubernetes Secrets with Quarkus. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/quarkus-kubernetes-secrets + +作者:[Daniel Oh][a] +选题:[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/daniel-oh +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/rh_003601_05_mech_osyearbook2016_security_cc.png +[2]: https://kubernetes.io/docs/concepts/configuration/secret/ +[3]: https://github.com/danieloh30/quarkus-secret-example.git +[4]: https://enterprisersproject.com/article/2019/8/kubernetes-secrets-explained-plain-english?intcmp=7013a000002qLH8AAM +[5]: https://quarkus.io/guides/cli-tooling#installing-the-cli +[6]: https://kustomize.io/ +[7]: https://developers.redhat.com/developer-sandbox/get-started +[8]: https://opensource.com/sites/default/files/2022-05/quarkus.png +[9]: https://opensource.com/article/20/5/curl-cheat-sheet +[10]: https://opensource.com/article/22/4/developing-applications-cloud-quarkus +[11]: https://opensource.com/article/22/4/kubernetes-service-discovery-stork-quarkus +[12]: https://opensource.com/article/21/10/quarkus-helm-chart +[13]: https://youtu.be/ak9R9-E_0_k diff --git a/sources/tech/20220524 How to Install KVM on Ubuntu 22.04 -Jammy Jellyfish-.md b/sources/tech/20220524 How to Install KVM on Ubuntu 22.04 -Jammy Jellyfish-.md new file mode 100644 index 0000000000..16ec7ebb1d --- /dev/null +++ b/sources/tech/20220524 How to Install KVM on Ubuntu 22.04 -Jammy Jellyfish-.md @@ -0,0 +1,261 @@ +[#]: subject: "How to Install KVM on Ubuntu 22.04 (Jammy Jellyfish)" +[#]: via: "https://www.linuxtechi.com/how-to-install-kvm-on-ubuntu-22-04/" +[#]: author: "James Kiarie https://www.linuxtechi.com/author/james/" +[#]: collector: "lkxed" +[#]: translator: "turbokernel" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install KVM on Ubuntu 22.04 (Jammy Jellyfish) +====== +KVM, an acronym for Kernel-based Virtual Machine is an opensource virtualization technology integrated into the Linux kernel. It’s a type 1 (bare metal ) hypervisor that enables the kernel to act as a bare-metal hypervisor. + +KVM allows users to create and run multiple guest machines which can be either Windows or Linux. Each guest machine runs independently of other virtual machines and the underlying OS ( host system ) and has its own computing resources such as CPU, RAM, network interfaces, and storage to mention a few. + +This guide shows you how to install KVM on Ubuntu 22.04 LTS (Jammy Jellyfish). At the tail end of this guide, we will demonstrate how you can create a virtual machine once the installation of KVM is complete. + +### 1) Update Ubuntu 22.04 + +To get off the ground, launch the terminal and update your local package index as follows. + +``` +$ sudo apt update +``` + +### 2) Check if Virtualization is enabled + +Before you proceed any further, you need to check if your CPU supports KVM virtualization. For this to be possible, your system needs to either have a VT-x( vmx ) Intel processor or an AMD-V (svm) processor. + +This is achieved by running the following command. if the output is greater than 0, then virtualization is enabled. Otherwise, virtualization is disabled and you need to enable it. + +``` +$ egrep -c '(vmx|svm)' /proc/cpuinfo +``` + +![SVM-VMX-Flags-Cpuinfo-linux][1] + +From the above output, you can deduce that virtualization is enabled since the result printed is greater than 0. If Virtualization is not enabled, be sure to enable the virtualization feature in your system’s BIOS settings. + +In addition, you can verify if KVM virtualization is enabled by running the following command: + +``` +$ kvm-ok +``` + +For this to work, you need to have installed the cpu-checker package, otherwise, you will bump into the error ‘Command ‘kvm-ok’ not found’. + +Directly below, you will get instructions on how to resolve this issue, and that is to install the cpu-checker package. + +![KVM-OK-Command-Not-Found-Ubuntu][2] + +Therefore, install the cpu-checker package as follows. + +``` +$ sudo apt install -y cpu-checker +``` + +Then run the kvm-ok command, and if KVM virtualization is enabled, you should get the following output. + +``` +$ kvm-ok +``` + +![KVM-OK-Command-Output][3] + +### 3) Install KVM on Ubuntu 22.04 + +Next, run the command below to install KVM and additional virtualization packages on Ubuntu 22.04. + +``` +$ sudo apt install -y qemu-kvm virt-manager libvirt-daemon-system virtinst libvirt-clients bridge-utils +``` + +Let us break down the packages that we are installing: + +* qemu-kvm  – An opensource emulator and virtualization package that provides hardware emulation. +* virt-manager – A Qt-based graphical interface for managing virtual machines via the libvirt daemon. +* libvirt-daemon-system – A package that provides configuration files required to run the libvirt daemon. +* virtinst – A  set of command-line utilities for provisioning and modifying virtual machines. +* libvirt-clients – A set of client-side libraries and APIs for managing and controlling virtual machines & hypervisors from the command line. +* bridge-utils – A set of tools for creating and managing bridge devices. + +###  4) Enable the virtualization daemon (libvirtd) + +With all the packages installed, enable and start the Libvirt daemon. + +``` +$ sudo systemctl enable --now libvirtd +$ sudo systemctl start libvirtd +``` + +Confirm that the virtualization daemon is running as shown. + +``` +$ sudo systemctl status libvirtd +``` + +![Libvirtd-Status-Ubuntu-Linux][4] + +In addition, you need to add the currently logged-in user to the kvm and libvirt groups so that they can create and manage virtual machines. + +``` +$ sudo usermod -aG kvm $USER +$ sudo usermod -aG libvirt $USER +``` + +The $USER environment variable points to the name of the currently logged-in user.  To apply this change, you need to log out and log back again. + +### 5) Create Network Bridge (br0) + +If you are planning to access KVM virtual machines outside from your Ubuntu 22.04 system, then you must map VM’s interface to a network bridge. Though a virtual bridge named virbr0, created automatically when KVM is installed but it is used for testing purposes. + +To create a network bridge, create the file ‘01-netcfg.yaml’ with following content under the folder /etc/netplan. + +``` +$ sudo vi /etc/netplan/01-netcfg.yaml +network: +  ethernets: +    enp0s3: +      dhcp4: false +      dhcp6: false +  # add configuration for bridge interface +  bridges: +    br0: +      interfaces: [enp0s3] +      dhcp4: false +      addresses: [192.168.1.162/24] +      macaddress: 08:00:27:4b:1d:45 +      routes: +        - to: default +          via: 192.168.1.1 +          metric: 100 +      nameservers: +        addresses: [4.2.2.2] +      parameters: +        stp: false +      dhcp6: false +  version: 2 +``` + +save and exit the file. + +Note: These details as per my setup, so replace the IP address entries, interface name and mac address as per your setup. + +To apply above change, run ‘netplan apply’ + +``` +$ sudo netplan apply +``` + +Verify the network bridge ‘br0’, run below ip command + +``` +$ ip add show +``` + +![Network-Bridge-br0-ubuntu-linux][5] + +### 6) Launch KVM Virtual Machines Manager + +With KVM installed, you can begin creating your virtual machines using the virt-manager GUI tool. To get started, use the GNOME search utility and search for ‘Virtual machine Manager’. + +Click on the icon that pops up. + +![Access-Virtual-Machine-Manager-Ubuntu-Linux][6] + +This launches the Virtual Machine Manager Interface. + +![Virtual-Machine-Manager-Interface-Ubuntu-Linux][7] + +Click on “File” then select “New Virtual Machine”. Alternatively, you can click on the button shown. + +![New-Virtual-Machine-Icon-Virt-Manager][8] + +This pops open the virtual machine installation wizard which presents you with the following four options: + +* Local install Media ( ISO image or CDROM ) +* Network Install ( HTTP, HTTPS, and FTP ) +* Import existing disk image +* Manual Install + +In this guide, we have downloaded a Debian 11 ISO image, and therefore, if you have an ISO image, select the first option and click ‘Forward’. + +![Local-Install-Media-ISO-Virt-Manager][9] + +In the next step, click ‘Browse’ to navigate to the location of the ISO image, + +![Browse-ISO-File-Virt-Manager-Ubuntu-Linux][10] + +In the next window, click ‘Browse local’ in order to select the ISO image from the local directories on your Linux PC. + +![Browse-Local-ISO-Virt-Manager][11] + +As demonstrated below, we have selected the Debian 11 ISO image. Then click ‘Open’ + +![Choose-ISO-File-Virt-Manager][12] + +Once the ISO image is selected, click ‘Forward’ to proceed to the next step. + +![Forward-after-browsing-iso-file-virt-manager][13] + +Next, define the RAM and the number of CPU cores for your virtual machine and click ‘Forward’. + +![Virtual-Machine-RAM-CPU-Virt-Manager][14] + +In the next step, define the disk space for your virtual machine and click ‘Forward’. + +![Storage-for-Virtual-Machine-KVM-Virt-Manager][15] + +To associate virtual machine’s nic to network bridge, click on ‘Network selection’ and choose br0 bridge. + +![Network-Selection-KVM-Virtual-Machine-Virt-Manager][16] + +Finally, click ‘Finish’ to wind up setting the virtual machine. + +![Choose-Finish-to-OS-Installation-KVM-VM][17] + +Shortly afterward, the virtual machine creation will get underway. + +![Creating-Domain-Virtual-Machine-Virt-Manager][18] + +Once completed, the virtual machine will start with the OS installer displayed. Below is the Debian 11 installer listing the options for installation. From here, you can proceed to install your preferred system. + +![Virtual-Machine-Console-Virt-Manager][19] + +##### Conclusion + +And that’s it. In this guide, we have demonstrated how you can install the KVM hypervisor on Ubuntu 22.04. Your feedback on this guide is much welcome. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/how-to-install-kvm-on-ubuntu-22-04/ + +作者:[James Kiarie][a] +选题:[lkxed][b] +译者:[turbokernel](https://github.com/turbokernel) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/james/ +[b]: https://github.com/lkxed +[1]: https://www.linuxtechi.com/wp-content/uploads/2022/05/SVM-VMX-Flags-Cpuinfo-linux.png +[2]: https://www.linuxtechi.com/wp-content/uploads/2022/05/KVM-OK-Command-Not-Found-Ubuntu.png +[3]: https://www.linuxtechi.com/wp-content/uploads/2022/05/KVM-OK-Command-Output.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Libvirtd-Status-Ubuntu-Linux.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Network-Bridge-br0-ubuntu-linux.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Access-Virtual-Machine-Manager-Ubuntu-Linux.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Virtual-Machine-Manager-Interface-Ubuntu-Linux.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2022/05/New-Virtual-Machine-Icon-Virt-Manager.png +[9]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Local-Install-Media-ISO-Virt-Manager.png +[10]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Browse-ISO-File-Virt-Manager-Ubuntu-Linux.png +[11]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Browse-Local-ISO-Virt-Manager.png +[12]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Choose-ISO-File-Virt-Manager.png +[13]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Forward-after-browsing-iso-file-virt-manager.png +[14]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Virtual-Machine-RAM-CPU-Virt-Manager.png +[15]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Storage-for-Virtual-Machine-KVM-Virt-Manager.png +[16]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Network-Selection-KVM-Virtual-Machine-Virt-Manager.png +[17]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Choose-Finish-to-OS-Installation-KVM-VM.png +[18]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Creating-Domain-Virtual-Machine-Virt-Manager.png +[19]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Virtual-Machine-Console-Virt-Manager.png diff --git a/sources/tech/20220524 The Basic Concepts of Shell Scripting.md b/sources/tech/20220524 The Basic Concepts of Shell Scripting.md new file mode 100644 index 0000000000..e3ed827d57 --- /dev/null +++ b/sources/tech/20220524 The Basic Concepts of Shell Scripting.md @@ -0,0 +1,190 @@ +[#]: subject: "The Basic Concepts of Shell Scripting" +[#]: via: "https://www.opensourceforu.com/2022/05/the-basic-concepts-of-shell-scripting/" +[#]: author: "Sathyanarayanan Thangavelu https://www.opensourceforu.com/author/sathyanarayanan-thangavelu/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +The Basic Concepts of Shell Scripting +====== +If you want to automate regular tasks and make your life easier, using shell scripts is a good option. This article introduces you to the basic concepts that will help you to write efficient shell scripts. + +![Shell-scripting][1] + +Ashell script is a computer program designed to be run by the UNIX shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing of text. A script that sets up the environment, runs the program, and does any necessary cleanup or logging, is called a wrapper. + +### Identification of shell prompt + +You can identify whether the shell prompt on a Linux based computer is a normal or super user by looking at the symbols of the prompt in the terminal window. The ‘#’ symbol is used for a super user and the ‘$’ symbol is used for a user with standard privileges. + +![Figure 1: Manual of date command][2] + +### Basic commands + +The script comes with too many commands that can be executed on the terminal window to manage your computer. Details of each command can be found in the manual included with the command. To view the manual, you need to run the command: + +``` +$man +``` + +A few frequently used commands are: + +``` +$date #display current date and time +$cal #display current month calendar +$df #displays disk usages +$free #display memory usage +$ls #List files and directories +$mkdir #Creates directory +``` + +Each command comes with several options that can be used along with it. You can refer to the manual for more details. See Figure 1 for the output of: + +``` +$man date +``` + +### Redirection operators + +The redirection operator is really useful when you want to capture the output of a command in a file or redirect to a file. + +| - | - | +| :- | :- | +| $ls -l /usr/bin >file | default stdout to file | +| $ls -l /usr/bin 2>file | redirects stderr to file | +| $ls -l /usr/bin > ls-output 2>&1 | redirects stderr & stdout to file | +| $ls -l /usr/bin &> ls-output | redirects stderr & stdout to file | +| $ls -l /usr/bin 2> /dev/null | /dev/null bitbucket | + +## Brace expansion + +Brace expansion is one of the powerful options UNIX has. It helps do a lot of operations with minimal commands in a single line instruction. For example: + +``` +$echo Front-{A,B,C}-Back +Front-A-Back, Front-B-Back, Front-C-Back + +$echo {Z..A} +Z Y X W V U T S R Q P O N M L K J I H G F E D C B A + +$mkdir {2009..2011}-0{1..9} {2009..2011}-{10..12} +``` + +This creates a directory for 12 months from 2009 to 2011. + +### Environment variables + +An environment variable is a dynamic-named value that can affect the way running processes will behave on a computer. This variable is a part of the environment in which a process runs. + +| - | - | +| :- | :- | +| printenv | Print part of all of the environment | +| set | set shell options | +| export | export environment to subsequently executed programs | +| alias | create an alias for command | + +### Network commands + +Network commands are very useful for troubleshooting issues on the network and to check the particular port connecting to the client. + +| - | - | +| :- | :- | +| ping | Send ICMP packets | +| traceroute | Print route packets to a network | +| netstat | print network connection, routing table, +interface stats | +| ftp/lftp | Internet file transfer program | +| wget | Non Interactive network downloader | +| ssh | OpenSSH SSH Client (remote login program) | +| scp | secure copy | +| sftp | Secure File transfer program | + +### Grep commands + +Grep commands are useful to find the errors and debug the logs in the system. It is one of the powerful tools that shell has. + +| - | - | +| :- | :- | +| grep -h ‘.zip’ file.list | . is any character | +| grep -h ‘^zip’ file.list | starts with zip | +| grep -h ‘zip$’ file.list | ends with zip | +| grep -h ‘^zip$’ file.list | containing only zip | +| grep -h ‘[^bz]zip’ file.list | not containing b and z | +| grep -h ‘^[A-Za-z0-9]’ file.list | file containing any valid names | + +### Quantifiers + +Here are some examples of quantifiers: + +| - | - | +| :- | :- | +| ? | match element zero or one time | +| * | match an element zero or more times | +| + | Match an element one or more times | +| {} | match an element specfic number of times | + +### Text processing + +Text processing is another important task in the current IT world. Programmers and administrators can use the commands to dice, cut and process texts. + +| - | - | +| :- | :- | +| cat -A $FILE | To find any CTRL character introduced | +| sort file1.txt file2.txt file3.txt > +final_sorted_list.txt | sort all files once | +| ls - l | sort -nr -k 5 | key field 5th column | +| sort --key=1,1 --key=2n distor.txt | key field 1,1 sort and second column sort +by numeric | +| sort foo.txt | uniq -c | to find repetition | +| cut -f 3 distro.txt | cut column 3 | +| cut -c 7-10 | cut character 7 - 10 | +| cut -d ‘:’ -f 1 /etc/password | delimiter : | +| sort -k 3.7nbr -k 3.1nbr -k 3.4nbr + distro.txt | 3 rd field 7 the character, +3rd field 1 character | +| paste file1.txt file2.txt > newfile.txt | merge two files | +| join file1.txt file2.txt | join on common two fields | + +### Hacks and tips + +In Linux, we can go back to our history of commands by either using simple commands or control options. + +| - | - | +| :- | :- | +| clear | clears the screen | +| history | stores the history | +| script filename | capture all command execution in a file | + + +Tips: + +> History : CTRL + {R, P} +> !!number : command history number +> !! : last command +> !?string : history containing last string +> !string : history containing last string + +``` +export HISTCONTROL=ignoredups +export HISTSIZE=10000 +``` + +As you get familiar with the Linux commands, you will be able to write wrapper scripts. All manual tasks like taking regular backups, cleaning up files, monitoring the system usage, etc, can be automated using scripts. This article will help you to start scripting, before you move to learning advanced concepts. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/the-basic-concepts-of-shell-scripting/ + +作者:[Sathyanarayanan Thangavelu][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/sathyanarayanan-thangavelu/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Shell-scripting.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Manual-of-date-command.jpg diff --git a/sources/tech/20220524 pdfgrep- Use Grep Like Search on PDF Files in Linux Command Line.md b/sources/tech/20220524 pdfgrep- Use Grep Like Search on PDF Files in Linux Command Line.md new file mode 100644 index 0000000000..1dcbd177c6 --- /dev/null +++ b/sources/tech/20220524 pdfgrep- Use Grep Like Search on PDF Files in Linux Command Line.md @@ -0,0 +1,234 @@ +[#]: subject: "pdfgrep: Use Grep Like Search on PDF Files in Linux Command Line" +[#]: via: "https://itsfoss.com/pdfgrep/" +[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +pdfgrep: Use Grep Like Search on PDF Files in Linux Command Line +====== + +Even if you use the Linux command line moderately, you must have come across the [grep command][1]. + +Grep is used to search for a pattern in a text file. It can do crazy powerful things, like search for new lines, search for lines where there are no uppercase characters, search for lines where the initial character is a number, and much, much more. Check out some [common grep command examples][2] if you are interested. + +But grep works only on plain text files. It won’t work on PDF files because they are binary files. + +This is where pdfgrep comes into the picture. It works like grep for PDF files. Let us have a look at that. + +### Meet pdfgrep: grep like regex search for PDF files + +[pdfgrep][3] tries to be compatible with GNU Grep, where it makes sense. Several of your favorite grep options are supported (such as -r, -i, -n or -c). You can use to search for text inside the contents of PDF files. + +Though it doesn’t come pre-installed like grep, it is available in the repositories of most Linux distributions. + +You can use your distribution’s [package manager][4] to install this awesome tool. + +For users of Ubuntu and Debian-based distributions, use the apt command: + +``` +sudo apt install pdfgrep +``` + +For Red Hat and Fedora, you can use the dnf command: + +``` +sudo dnf install pdfgrep +``` + +Btw, do you run Arch? You can [use the pacman command][5]: + +``` +sudo pacman -S pdfgrep +``` + +### Using pdfgrep command + +Now that pdfgrep is installed let me show you how to use it in most common scenarios. + +If you have any experience with grep, then most of the options will feel familiar to you. + +To demonstrate, I will be using [The Linux Command Line][6] PDF book, written by William Shotts. It’s one of the [few Linux books that are legally available for free][7]. + +The syntax for pdfgrep is as follows: + +``` +pdfgrep [PATTERN] [FILE.pdf] +``` + +#### Normal search + +Let’s try doing a basic search for the text ‘xdg’ in the PDF file. + +``` +pdfgrep xdg TLCL-19.01.pdf +``` + +![simple search using pdfgrep][8] + +This resulted in only one match… But a match nonetheless! + +#### Case insensitive search + +Most of the time, the term ‘xdg’ is used with capitalized alphabetical characters. So, let’s try doing a case-insensitive search. For a case insensitive search, I will use the –ignore-case option. + +You can also use the shorter alternative, which is -i. + +``` +pdfgrep --ignore-case xdg TLCL-19.01.pdf +``` + +![case insensitive search using pdfgrep][9] + +As you can see, I got more matches after turning on case insensitive searching. + +#### Get a count of all matches + +Sometimes, the user wants to know how many matches were found of the word. Let’s see how many times the word ‘Linux’ is mentioned (with case insensitive matching). + +The option to use in this scenario is –count (or -c for short). + +``` +pdfgrep --ignore-case linux TLCL-19.01.pdf --count +``` + +![getting a count of matches using pdfgrep][10] + +Woah! Linux was mentioned 1200 times in this book… That was unexpected. + +#### Show page number + +Regular text files are giant monolithic files. There are no pages. But a PDF file has pages. So, you can see where the pattern was found and on which page. Use the –page-number option to show the page number where the pattern was matched. You can also use the `-n` option as a shorter alternative. + +Let us see how it works with an example. I want to see the pages where the word ‘awk’ matches. I added a space at the end of the pattern to prevent matching with words like ‘awkward’, getting unintentional matches would be *awkward*. Instead of escaping space with a backslash, you can also enclose it in single quotes ‘awk ‘. + +``` +pdfgrep --page-number --ignore-case awk\ TLCL-19.01.pdf +``` + +![show which pattern was found on which page using pdfgrep][11] + +The word ‘awk’ was found twice on page number 333, once on page 515 and once again on page 543 in the PDF file. + +#### Show match count per page + +Do you want to know how many matches were found on which page instead of showing the matches themselves? If you said yes, well it is your lucky day! + +Using the –page-count option does exactly that. As a shorter alternative, you use the -p option. When you provide this option to pdfgrep, it is assumed that you requested `-n` as well. + +Let’s take a look at how the output looks. For this example, I will see where the [ln command][12] is used in the book. + +``` +pdfgrep --page-count ln\ TLCL-19.01.pdf +``` + +![show which page has how many matches using pdfgrep][13] + +The output is in the form of ‘page number: matches’. This means, on page number 4, the command (or rather “pattern”) was found only once. But on page number 57, pdfgrep found 4 matches. + +#### Get some context + +When the number of matches found is quite big, it is nice to have some context. For that, pdfgrep provides some options. + +* –after-context NUM: Print NUM of lines that come after the matching lines (or use `-A`) +* –before-context NUM: Print NUM of lines that are before the matching lines (or use `-B`) +* –context NUM: Print NUM of lines that are before and come after the matching lines (or use `-C`) + +Let’s find ‘XDG’ in the PDF file, but this time, with a little more context ( ͡❛ ͜ʖ ͡❛) + +**Context after matches** + +Using the –after-context option along with a number, I can see which lines come after the line(s) that match. Below is an example of how it looks. + +``` +pdfgrep --after-context 2 XDG TLCL-19.01.pdf +``` + +![using '--after-context' option in pdfgrep][14] + +**Context before matches** + +Same thing can be done for scenarios when you need to know what lines are present before the line that matches. In that case, use the –before-context option, along with a number. Below is an example demonstrating usage of this option. + +``` +pdfgrep --before-context 2 XDG TLCL-19.01.pdf +``` + +![using '--before-context' option in pdfgrep][15] + +**Context around matches** + +If you want to see which lines are present before and come after the line that matched, use the –context option and also provide a number. Below is an example. + +``` +pdfgrep --context 2 XDG TLCL-19.01.pdf +``` + +![using '--context' option in pdfgrep][16] + +#### Caching + +A PDF file consists of images as well as text. When you have a large PDF file, it might take some time to skip other media, extract text and then “grep” it. Doing it often and waiting every time can get frustrating. + +For that reason, the –cache option exists. It caches the rendered text to speed up grep-ing. This is especially noticeable on large files. + +``` +pdfgrep --cache --ignore-case grep TLCL-19.01.pdf +``` + +![getting faster results using the '--cache' option][17] + +While not the be-all and end-all, I carried out a search 4 times. Twice with cache enable and twice without cache enable. To show the speed difference, I used the time command. Look closely at the time indicated by ‘real’ value. + +As you can see, the commands that include –cache option were completed faster than the ones that didn’t include it. + +Additionally, I suppressed the output using the –quiet option for faster completion. + +#### Password protected PDF files + +Yes, pdfgrep supports grep-ing even password-protected files. All you have to do is use the –password option, followed by the password. + +I do not have a password-protected file to demonstrate with, but you can use this option in the following manner: + +``` +pdfgrep --password [PASSWORD] [PATTERN] [FILE.pdf] +``` + +### Conclusion + +pdfgrep is a very handy tool if you are dealing with PDF files and want the functionality of ‘grep’, but for PDF files. A reason why I like pdfgrep is that it tries to be compatible with GNU Grep. + +Give it a try and let me know what you think of pdfgrep. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/pdfgrep/ + +作者:[Pratham Patel][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/pratham/ +[b]: https://github.com/lkxed +[1]: https://linuxhandbook.com/what-is-grep/ +[2]: https://linuxhandbook.com/grep-command-examples/ +[3]: https://pdfgrep.org/ +[4]: https://itsfoss.com/package-manager/ +[5]: https://itsfoss.com/pacman-command/ +[6]: https://www.linuxcommand.org/tlcl.php +[7]: https://itsfoss.com/learn-linux-for-free/ +[8]: https://itsfoss.com/wp-content/uploads/2022/05/01_pdfgrep_normal_search-1-800x308.webp +[9]: https://itsfoss.com/wp-content/uploads/2022/05/02_pdfgrep_case_insensitive-800x413.webp +[10]: https://itsfoss.com/wp-content/uploads/2022/05/03_pdfgrep_count-800x353.webp +[11]: https://itsfoss.com/wp-content/uploads/2022/05/04_pdfgrep_page_number-800x346.webp +[12]: https://linuxhandbook.com/ln-command/ +[13]: https://itsfoss.com/wp-content/uploads/2022/05/05_pdfgrep_pg_count-800x280.webp +[14]: https://itsfoss.com/wp-content/uploads/2022/05/06_pdfgrep_after_context-800x340.webp +[15]: https://itsfoss.com/wp-content/uploads/2022/05/07_pdfgrep_before_context-800x356.webp +[16]: https://itsfoss.com/wp-content/uploads/2022/05/08_pdfgrep_context-800x453.webp +[17]: https://itsfoss.com/wp-content/uploads/2022/05/09_pdfgrep_cache-800x575.webp diff --git a/sources/tech/20220525 Improve network performance with this open source framework.md b/sources/tech/20220525 Improve network performance with this open source framework.md new file mode 100644 index 0000000000..ee1af4ee28 --- /dev/null +++ b/sources/tech/20220525 Improve network performance with this open source framework.md @@ -0,0 +1,138 @@ +[#]: subject: "Improve network performance with this open source framework" +[#]: via: "https://opensource.com/article/22/5/improve-network-performance-pbench" +[#]: author: "Hifza Khalid https://opensource.com/users/hifza-khalid" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Improve network performance with this open source framework +====== +Use Pbench to predict throughput and latency for specific workloads. + +![Mesh networking connected dots][1] + +In the age of high-speed internet, most large information systems are structured as distributed systems with components running on different machines. The performance of these systems is generally assessed by their throughput and response time. When performance is poor, debugging these systems is challenging due to the complex interactions between different subcomponents and the possibility of the problem occurring at various places along the communication path. + +On the fastest networks, the performance of a distributed system is limited by the host's ability to generate, transmit, process, and receive data, which is in turn dependent on its hardware and configuration. What if it were possible to tune the network performance of a distributed system using a repository of network benchmark runs and suggest a subset of hardware and OS parameters that are the most effective in improving network performance? + +To answer this question, our team used [P][2][bench][3], a benchmarking and performance analysis framework developed by the performance engineering team at Red Hat. This article will walk step by step through our process of determining the most effective methods and implementing them in a predictive performance tuning tool. + +### What is the proposed approach? + +Given a dataset of network benchmark runs, we propose the following steps to solve this problem. + +1. Data preparation: Gather the configuration information, workload, and performance results for the network benchmark; clean the data; and store it in a format that is easy to work with +2. Finding significant features: Choose an initial set of OS and hardware parameters and use various feature selection methods to identify the significant parameters +3. Develop a predictive model: Develop a machine learning model that can predict network performance for a given client and server system and workload +4. Recommend configurations: Given the user's desired network performance, suggest a configuration for the client and the server with the closest performance in the database, along with data showing the potential window of variation in results +5. Evaluation: Determine the model's effectiveness using cross-validation, and suggest ways to quantify the improvement due to configuration recommendations + +We collected the data for this project using Pbench. Pbench takes as input a benchmark type with its workload, performance tools to run, and hosts on which to execute the benchmark, as shown in the figure below. It outputs the benchmark results, tool results, and the system configuration information for all the hosts. + +![An infographic showing inputs and outputs for Pbench. Benchmark type (with workload and systems) and performance tools to run along pbench (e.g., sar, vamstat) go into the central box representing pbench. Three things come out of pbench: configuration of all the systems involved, tool results and benchmark performance results][4] + +Image by: (Hifza Khalid, CC BY-SA 4.0) + +Out of the different benchmark scripts that Pbench runs, we used data collected using the uperf benchmark. Uperf is a network performance tool that takes the description of the workload as input and generates the load accordingly to measure system performance. + +### Data preparation + +There are two disjoint sets of data generated by Pbench. The configuration data from the systems under test is stored in a file system. The performance results, along with the workload metadata, are indexed into an Elasticsearch instance. The mapping between the configuration data and the performance results is also stored in Elasticsearch. To interact with the data in Elasticsearch, we used Kibana. Using both of these datasets, we combined the workload metadata, configuration data, and performance results for each benchmark run. + +### Finding significant features + +To select an initial set of hardware specifications and operating system configurations, we used performance-tuning configuration guides and feedback from experts at Red Hat. The goal of this step was to start working with a small set of parameters and refine it with further analysis. The set was based on parameters from almost all major system subcomponents, including hardware, memory, disk, network, kernel, and CPU. + +Once we selected the preliminary set of features, we used one of the most common dimensionality-reduction techniques to eliminate the redundant parameters: remove parameters with constant values. While this step eliminated some of the parameters, given the complexity of the relationship between system information and performance, we resolved to use advanced feature selection methods. + +#### Correlation-based feature selection + +Correlation is a common measure used to find the association between two features. The features have a high correlation if they are linearly dependent. If the two features increase simultaneously, their correlation is +1; if they decrease concurrently, it is -1. If the two features are uncorrelated, their correlation is close to 0. + +We used the correlation between the system configuration and the target variable to identify and cut down insignificant features further. To do so, we calculated the correlation between the configuration parameters and the target variable and eliminated all parameters with a value less than |0.1|, which is a commonly used threshold to identify the uncorrelated pairs. + +#### Feature-selection methods + +Since correlation does not imply causation, we needed additional feature-selection methods to extract the parameters affecting the target variables. We could choose between wrapper methods like recursive feature elimination and embedded methods like Lasso (Least Absolute Shrinkage and Selection Operator) and tree-based methods. + +We chose to work with tree-based embedded methods for their simplicity, flexibility, and low computational cost compared to wrapper methods. These methods have built-in feature selection methods. Among tree-based methods, we had three options: a classification and regression tree (CART), Random Forest, and XGBoost. + +We calculated our final set of significant features for the client and server systems by taking a union of the results received from the three tree-based methods, as shown in the following table. + +| Parameters | client/server | Description | +| :- | :- | :- | +| Advertised_auto-negotation | client | If the linked advertised auto-negotiation | +| CPU(s) | server | Number of logical cores on the machine | +| Network speed | server | Speed of the ethernet device | +| Model name | client | Processor model | +| rx_dropped | server | Packets dropped after entering the computer stack | +| Model name | server | Processor model | +| System type | server | Virtual or physical system | + +#### Develop predictive model + +For this step, we used the Random Forest (RF) prediction model since it is known to perform better than CART and is also easier to visualize. + +Random Forest (RF) builds multiple decision trees and merges them to get a more stable and accurate prediction. It builds the trees the same way CART does, but to ensure that the trees are uncorrelated to protect each other from their individual errors, it uses a technique known as bagging. Bagging uses random samples from the data with replacement to train the individual trees. Another difference between trees in a Random Forest and a CART decision tree is the choice of features considered for each split. CART considers every possible feature for each split. However, each tree in a Random Forest picks only from a random subset of features. This leads to even more variation among the Random Forest trees. + +The RF model was constructed separately for both the target variables. + +### Recommend configurations + +For this step, given desired throughput and response time values, along with the workload of interest, our tool searches through the database of benchmark runs to return the configuration with the performance results closest to what the user requires. It also returns the standard deviation for various samples of that run, suggesting potential variation in the actual results. + +### Evaluation + +To evaluate our predictive model, we used a repeated [K-Fold cross-validation][5] technique. It is a popular choice to get an accurate estimate of the efficiency of the predictive model. + +To evaluate the predictive model with a dataset of 9,048 points, we used k equal to 10 and repeated the cross-validation method three times. The accuracy was calculated using the two metrics given below. + +* R2 score: The proportion of the variance in the dependent variable that is predictable from the independent variable(s). Its value varies between -1 and 1. +* Root mean squared error (RMSE): It measures the average squared difference between the estimated values and the actual values and returns its square root. + +Based on the above two criteria, the results for the predictive model with throughput and latency as target variables are as follows: + +* Throughput (trans/sec): + * R2 score: 0.984 + * RMSE: 0.012 +* Latency (usec): + * R2 score: 0.930 + * RMSE: 0.025 + +### What does the final tool look like? + +We implemented our approach in a tool shown in the following figure. The tool is implemented in Python. It takes as input the dataset containing the information about benchmark runs as a CSV file, including client and server configuration, workload, and the desired values for latency and throughput. The tool uses this information to predict the latency and throughput results for the user's client server system. It then searches through the database of benchmark runs to return the configuration that has performance results closest to what the user requires, along with the standard deviation for that run. The standard deviation is part of the dataset and is calculated using repeated samples for one iteration or run. + +![An infographic showing inputs and outputs for the Performance Predictor and Tuner (PPT). The inputs are client and server sosreports (tarball), workload, and expected latency and throughput. The outputs are latency (usce) and throughput (trans/sec), configuration for the client and the server, and the standard deviation for results.][6] + +Image by: (Hifza Khalid, CC BY-SA 4.0) + +### What were the challenges with this approach? + +While working on this problem, there were several challenges that we addressed. The first major challenge was gathering benchmark data, which required learning Elasticsearch and Kibana, the two industrial tools used by Red Hat to index, store, and interact with [P][7][bench][8] data. Another difficulty was dealing with the inconsistencies in data, missing data, and errors in the indexed data. For example, workload data for the benchmark runs was indexed in Elasticsearch, but one of the crucial workload parameters, runtime, was missing. For that, we had to write extra code to access it from the raw benchmark data stored on Red Hat servers. + +Once we overcame the above challenges, we spent a large chunk of our effort trying out almost all the feature selection techniques available and figuring out a representative set of hardware and OS parameters for network performance. It was challenging to understand the inner workings of these techniques, their limitations, and their applications and analyze why most of them did not apply to our case. Because of space limitations and shortage of time, we did not discuss all of these methods in this article. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/improve-network-performance-pbench + +作者:[Hifza Khalid][a] +选题:[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/hifza-khalid +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/mesh_networking_dots_connected.png +[2]: https://distributed-system-analysis.github.io/pbench/ +[3]: https://distributed-system-analysis.github.io/pbench/ +[4]: https://opensource.com/sites/default/files/2022-05/pbench%20figure.png +[5]: https://vitalflux.com/k-fold-cross-validation-python-example/ +[6]: https://opensource.com/sites/default/files/2022-05/PPT.png +[7]: https://github.com/distributed-system-analysis/pbench +[8]: https://github.com/distributed-system-analysis/pbench diff --git a/sources/tech/20220525 Machine Learning- Classification Using Python.md b/sources/tech/20220525 Machine Learning- Classification Using Python.md new file mode 100644 index 0000000000..1d1606d788 --- /dev/null +++ b/sources/tech/20220525 Machine Learning- Classification Using Python.md @@ -0,0 +1,108 @@ +[#]: subject: "Machine Learning: Classification Using Python" +[#]: via: "https://www.opensourceforu.com/2022/05/machine-learning-classification-using-python/" +[#]: author: "Gayatri Venugopal https://www.opensourceforu.com/author/gayatri-venugopal/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Machine Learning: Classification Using Python +====== +In machine learning (ML), a set of data is analysed to predict a result. Python is considered one of the best programming language choices for ML. In this article, we will discuss machine learning with respect to classification using Python. + +![machine-learning-classification][1] + +Let’s say you want to teach a child to differentiate between apples and oranges. There are various ways to do this. You could ask the child to touch both kinds of fruits so that they get familiar with the shape and the softness. You could also show her multiple examples of apples and oranges, so that they can visually spot the differences. The technological equivalent of this process is known as machine learning. + +Machine learning teaches computers to solve a particular problem, and to get better at it through experience. The example discussed here is a classification problem, where the machine is given various labelled examples, and is expected to label an unlabelled sample using the knowledge it acquired from the labelled samples. A machine learning problem can also take the form of regression, where it is expected to predict a real-valued solution to a given problem based on known samples and their solutions. Classification and regression are broadly termed as supervised learning. Machine learning can also be unsupervised, where the machine identifies patterns in unlabelled data, and forms clusters of samples with similar patterns. Another form of machine learning is reinforcement learning, where the machine learns from its environment by making mistakes. + +### Classification + +Classification is the process of predicting the label of a given set of points based on the information obtained from known points. The class, or label, associated with a data set could be binary or multiple in nature. As an example, if we have to label the sentiment associated with a sentence, we could label it as positive, negative or neutral. On the other hand, problems where we have to predict whether a fruit is an apple or an orange will have binary labels. Table 1 gives a sample data set for a classification problem. + +In this table, the value of the last column, i.e., loan approved, is expected to be predicted based on the other variables. In the subsequent sections, we will learn how to train and evaluate a classifier using Python. + +| - | - | - | - | - | +| :- | :- | :- | :- | :- | +| Age | Credit rating | Job | Property owned | Load approval | +| 35 | good | yes | yes | yes | +| 32 | poor | yes | no | no | +| 22 | fair | no | no | no | +| 42 | good | yes | no | yes | + +Table 1 + +### Training and evaluating a classifier + +In order to train a classifier, we need to have a data set containing labelled examples. Though the process of cleaning the data is not covered in this section, it is recommended that you read about various data preprocessing and cleaning techniques before feeding your data set to a classifier. In order to process the data set in Python, we will import the pandas package and the data frame structure. You may then choose from a variety of classification algorithms such as decision tree, support vector classifier, random forest, XG boost, ADA boost, etc. We will look at the random forest classifier, which is an ensemble classifier formed using multiple decision trees. + +``` +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 +``` + +Although this program uses accuracy as the performance metric, a combination of metrics should be used, as accuracy tends to generate non-representative results when the test set is imbalanced. For instance, we will get a high accuracy if the model gives the same prediction for every record and the data set that is used to test the model is imbalanced, i.e., most of the records in the data set have the same class that the model predicted. + +### Tuning a classifier + +Tuning refers to the process of modifying the values of the hyperparameters of a model in order to improve its performance. A hyperparameter is a parameter whose value can be changed to improve the learning process of the algorithm. + +The following code depicts random search hyperparameter tuning. In this, we define a search space from which the algorithm will pick different values, and choose the one that produces the best results: + +``` +from sklearn.model_selection import RandomizedSearchCV + +#define the search space +min_samples_split = [2, 5, 10] +min_samples_leaf = [1, 2, 4] +grid = {‘min_samples_split’ : min_samples_split, ‘min_samples_leaf’ : min_samples_leaf} + +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 + +classifier.fit(X_train, y_train) +``` + +### Voting classifier + +You can also use multiple classifiers and their predictions to create a model that will give a single prediction based on the individual predictions. This process (in which only the number of classifiers that voted for each prediction is considered) is called hard voting. Soft voting is a process in which each classifier generates a probability of a given record belonging to a particular class, and the voting classifier generates as its prediction, the class that obtained the maximum probability. + +A code snippet for creating a soft voting classifier is given below: + +``` +soft_voting_clf = VotingClassifier( +estimators=[(‘rf’, rf_clf), (‘ada’, ada_clf), (‘xgb’, xgb_clf), (‘et’, et_clf), (‘gb’, gb_clf)], +voting=’soft’) +soft_voting_clf.fit(X_train, y_train) +``` + +This article has summarised the use of classifiers, tuning a classifier and the process of combining the results of multiple classifiers. Do use this as a reference point and explore each area in detail. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/machine-learning-classification-using-python/ + +作者:[Gayatri Venugopal][a] +选题:[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/gayatri-venugopal/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/machine-learning-classification.jpg diff --git a/sources/tech/20220525 Migrate databases to Kubernetes using Konveyor.md b/sources/tech/20220525 Migrate databases to Kubernetes using Konveyor.md new file mode 100644 index 0000000000..274b44e06d --- /dev/null +++ b/sources/tech/20220525 Migrate databases to Kubernetes using Konveyor.md @@ -0,0 +1,198 @@ +[#]: subject: "Migrate databases to Kubernetes using Konveyor" +[#]: via: "https://opensource.com/article/22/5/migrating-databases-kubernetes-using-konveyor" +[#]: author: "Yasu Katsuno https://opensource.com/users/yasu-katsuno" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Migrate databases to Kubernetes using Konveyor +====== +Konveyor Tackle-DiVA-DOA helps database engineers easily migrate database servers to Kubernetes. + +![Ships at sea on the web][1] + +Kubernetes Database Operator is useful for building scalable database servers as a database (DB) cluster. But because you have to create new artifacts expressed as YAML files, migrating existing databases to Kubernetes requires a lot of manual effort. This article introduces a new open source tool named Konveyor [Tackle-DiVA-DOA][2] (Data-intensive Validity Analyzer-Database Operator Adaptation). It automatically generates deployment-ready artifacts for database operator migration. And it does that through datacentric code analysis. + +### What is Tackle-DiVA-DOA? + +Tackle-DiVA-DOA (DOA, for short) is an open source datacentric database configuration analytics tool in Konveyor Tackle. It imports target database configuration files (such as SQL and XML) and generates a set of Kubernetes artifacts for database migration to operators such as [Zalando Postgres Operator][3]. + +![A flowchart shows a database cluster with three virtual machines and SQL and XML files transformed by going through Tackle-DiVA-DOA into a Kubernetes Database Operator structure and a YAML file][4] + +Image by: (Yasuharu Katsuno and Shin Saito, CC BY-SA 4.0) + +DOA finds and analyzes the settings of an existing system that uses a database management system (DBMS). Then it generates manifests (YAML files) of Kubernetes and the Postgres operator for deploying an equivalent DB cluster. + +![A flowchart shows the four elements of an existing system (as described in the text below), the manifests generated by them, and those that transfer to a PostgreSQL cluster][5] + +Image by: (Yasuharu Katsuno and Shin Saito, CC BY-SA 4.0) + +Database settings of an application consist of DBMS configurations, SQL files, DB initialization scripts, and program codes to access the DB. + +* DBMS configurations include parameters of DBMS, cluster configuration, and credentials. DOA stores the configuration to `postgres.yaml` and secrets to `secret-db.yaml` if you need custom credentials. +* SQL files are used to define and initialize tables, views, and other entities in the database. These are stored in the Kubernetes ConfigMap definition `cm-sqls.yaml`. +* Database initialization scripts typically create databases and schema and grant users access to the DB entities so that SQL files work correctly. DOA tries to find initialization requirements from scripts and documents or guesses if it can't. The result will also be stored in a ConfigMap named `cm-init-db.yaml`. +* Code to access the database, such as host and database name, is in some cases embedded in program code. These are rewritten to work with the migrated DB cluster. + +### Tutorial + +DOA is expected to run within a container and comes with a script to build its image. Make sure Docker and Bash are installed on your environment, and then run the build script as follows: + +``` +$ cd /tmp +$ git clone https://github.com/konveyor/tackle-diva.git +$ cd tackle-diva/doa +$ bash util/build.sh +… +docker image ls diva-doa +REPOSITORY   TAG       IMAGE ID       CREATED        SIZE +diva-doa     2.2.0     5f9dd8f9f0eb   14 hours ago   1.27GB +diva-doa     latest    5f9dd8f9f0eb   14 hours ago   1.27GB +``` + +This builds DOA and packs as container images. Now DOA is ready to use. + +The next step executes a bundled `run-doa.sh` wrapper script, which runs the DOA container. Specify the Git repository of the target database application. This example uses a Postgres database in the [TradeApp][6] application. You can use the `-o` option for the location of output files and an `-i` option for the name of the database initialization script: + +``` +$ cd /tmp/tackle-diva/doa +$ bash run-doa.sh -o /tmp/out -i start_up.sh \ +      https://github.com/saud-aslam/trading-app +[OK] successfully completed. +``` + +The `/tmp/out/` directory and `/tmp/out/trading-app`, a directory with the target application name, are created. In this example, the application name is `trading-app`, which is the GitHub repository name. Generated artifacts (the YAML files) are also generated under the application-name directory: + +``` +$ ls -FR /tmp/out/trading-app/ +/tmp/out/trading-app/: +cm-init-db.yaml  cm-sqls.yaml  create.sh*  delete.sh*  job-init.yaml  postgres.yaml  test/ + +/tmp/out/trading-app/test: +pod-test.yaml +``` + +The prefix of each YAML file denotes the kind of resource that the file defines. For instance, each `cm-*.yaml` file defines a ConfigMap, and `job-init.yaml` defines a Job resource. At this point, `secret-db.yaml` is not created, and DOA uses credentials that the Postgres operator automatically generates. + +Now you have the resource definitions required to deploy a PostgreSQL cluster on a Kubernetes instance. You can deploy them using the utility script `create.sh`. Alternatively, you can use the `kubectl create` command: + +``` +$ cd /tmp/out/trading-app +$ bash create.sh  # or simply “kubectl apply -f .” + +configmap/trading-app-cm-init-db created +configmap/trading-app-cm-sqls created +job.batch/trading-app-init created +postgresql.acid.zalan.do/diva-trading-app-db created +``` + +The Kubernetes resources are created, including `postgresql` (a resource of the database cluster created by the Postgres operator), `service`, `rs`, `pod`, `job`, `cm`, `secret`, `pv`, and `pvc`. For example, you can see four database pods named `trading-app-*`, because the number of database instances is defined as four in `postgres.yaml`. + +``` +$ kubectl get all,postgresql,cm,secret,pv,pvc +NAME                                        READY   STATUS      RESTARTS   AGE +… +pod/trading-app-db-0                        1/1     Running     0          7m11s +pod/trading-app-db-1                        1/1     Running     0          5m +pod/trading-app-db-2                        1/1     Running     0          4m14s +pod/trading-app-db-3                        1/1     Running     0          4m + +NAME                                      TEAM          VERSION   PODS   VOLUME   CPU-REQUEST   MEMORY-REQUEST   AGE   STATUS +postgresql.acid.zalan.do/trading-app-db   trading-app   13        4      1Gi                                     15m   Running + +NAME                            TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE +service/trading-app-db          ClusterIP   10.97.59.252            5432/TCP   15m +service/trading-app-db-repl     ClusterIP   10.108.49.133          5432/TCP   15m + +NAME                         COMPLETIONS   DURATION   AGE +job.batch/trading-app-init   1/1           2m39s      15m +``` + +Note that the Postgres operator comes with a user interface (UI). You can find the created cluster on the UI. You need to export the endpoint URL to open the UI on a browser. If you use minikube, do as follows: + +``` +$ minikube service postgres-operator-ui +``` + +Then a browser window automatically opens that shows the UI. + +![Screenshot of the UI showing the Cluster YAML definition on the left with the Cluster UID underneath it. On the right of the screen a header reads "Checking status of cluster," and items in green under that heading show successful creation of manifests and other elements][7] + +Image by: (Yasuharu Katsuno and Shin Saito, CC BY-SA 4.0) + +Now you can get access to the database instances using a test pod. DOA also generated a pod definition for testing. + +``` +$ kubectl apply -f /tmp/out/trading-app/test/pod-test.yaml # creates a test Pod +pod/trading-app-test created +$ kubectl exec trading-app-test -it -- bash  # login to the pod +``` + +The database hostname and the credential to access the DB are injected into the pod, so you can access the database using them. Execute the `psql` metacommand to show all tables and views (in a database): + +``` +# printenv DB_HOST; printenv PGPASSWORD +(values of the variable are shown) + +# psql -h ${DB_HOST} -U postgres -d jrvstrading -c '\dt' +             List of relations + Schema |      Name      | Type  |  Owner   +--------+----------------+-------+---------- + public | account        | table | postgres + public | quote          | table | postgres + public | security_order | table | postgres + public | trader         | table | postgres +(4 rows) + +# psql -h ${DB_HOST} -U postgres -d jrvstrading -c '\dv' +                List of relations + Schema |         Name          | Type |  Owner   +--------+-----------------------+------+---------- + public | pg_stat_kcache        | view | postgres + public | pg_stat_kcache_detail | view | postgres + public | pg_stat_statements    | view | postgres + public | position              | view | postgres +(4 rows) +``` + +After the test is done, log out from the pod and remove the test pod: + +``` +# exit +$ kubectl delete -f /tmp/out/trading-app/test/pod-test.yaml +``` + +Finally, delete the created cluster using a script: + +``` +$ bash delete.sh +``` + +### Welcome to Konveyor Tackle world! + +To learn more about application refactoring, you can check out the [Konveyor Tackle site][8], join the community, and access the source code on [GitHub][9]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/migrating-databases-kubernetes-using-konveyor + +作者:[Yasu Katsuno][a] +选题:[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/yasu-katsuno +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/kubernetes_containers_ship_lead.png +[2]: https://github.com/konveyor/tackle-diva/tree/main/doa +[3]: https://github.com/zalando/postgres-operator +[4]: https://opensource.com/sites/default/files/2022-05/tackle%20illustration.png +[5]: https://opensource.com/sites/default/files/2022-05/existing%20system%20tackle.png +[6]: https://github.com/saud-aslam/trading-app +[7]: https://opensource.com/sites/default/files/2022-05/postgreSQ-.png +[8]: https://www.konveyor.io/tools/tackle/ +[9]: https://github.com/konveyor/tackle-diva diff --git a/sources/tech/20220526 Document your source code with Doxygen on Linux.md b/sources/tech/20220526 Document your source code with Doxygen on Linux.md new file mode 100644 index 0000000000..053e300e79 --- /dev/null +++ b/sources/tech/20220526 Document your source code with Doxygen on Linux.md @@ -0,0 +1,254 @@ +[#]: subject: "Document your source code with Doxygen on Linux" +[#]: via: "https://opensource.com/article/22/5/document-source-code-doxygen-linux" +[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Document your source code with Doxygen on Linux +====== +This widely used open source tool can generate documentation from your comments. + +![5 trends in open source documentation][1] + +Image by: Internet Archive Book Images. Modified by Opensource.com. CC BY-SA 4.0 + +When trying to familiarize yourself with someone else's project, you usually appreciate the comments left behind that help you understand the meaning of their code. In the same way, whenever you are programming, whether for yourself or for others, it is good practice to comment your own code. All programming languages offer a special syntax to mark a word, a line, or a whole section as a comment. Those areas are then ignored by the compiler or interpreter when the source code is processed. + +Comments don't take the place of documentation, but there is a way to use your comments to produce documentation easily. Meet [Doxygen][2], an open source tool for generating HTML or LaTeX documentation based on comments in the code. Doxygen enables you to provide a comprehensive overview of the structure of your code without additional effort. While Doxygen is mainly used to document C++, you can use it for many other languages, like C, Objective-C, C#, PHP, Java, Python, and more. + +To use Doxygen, you simply comment your source code in a syntax that Doxygen can read. Doxygen then walks through your source files and creates HTML or LaTeX documentation based on those special comments. The C++ example project below will illustrate how the source code is commented and how the documentation is generated from it. The example is available on [GitHub][3], and I will also include references to different sections of the [Doxygen manual and documentation][4]. + +### Install Doxygen on Linux + +On Fedora, Doxygen is available as a package. Open a terminal and run: + +``` +sudo dnf install doxygen +``` + +On Debian-based systems, you can install it by running: + +``` +sudo apt-get install doxygen +``` + +### Usage + +Once installed, all you need is a project with Doxygen-compatible comments and a Doxyfile, a configuration file that controls the behavior of Doxygen. + +Note: If you stick to the related example project on GitHub, you can omit the next step. + +If there is no `Doxyfile` yet, you can simply let Doxygen generate a standard template. To do so, navigate to the root of your project and run: + +``` +doxygen -g +``` + +The `-g` stands for generate. You should now notice a newly created file called `Doxyfile`. You can invoke Doxygen by simply running: + +``` +doxygen +``` + +You should now notice two newly created folders: + +* html/ +* latex/ + +By default, Doxygen outputs LaTeX-formatted documentation as well as HTML-based documentation. In this article, I will focus only on HTML-based documentation. You can find out more about LaTeX output in the official Doxygen documentation, in the *Getting started* section. + +Double click on `html/index.html` to open the actual HTML documentation. With a blank configuration, it probably looks like the screenshot below: + +![A screenshot of a doxygen generated main page on Firefox. The content field under My Project Documentation is blank.][6] + +Now it's time to modify the `Doxyfile` and add some special comments to the source code. + +### Doxyfile + +The `Doxyfile` allows you to define tons of adjustment possibilities, so I will describe only a very small subset. The settings correspond to the `Doxyfile` of the example project. + +#### Line 35: Project name + +Here you can specify the project name, which will be visible in the header line and the browser tab. + +``` +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME           = "My Project" +``` + +#### Line 47: Project brief description + +The brief description will also be shown in the header but in a smaller font. + +``` +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF          = "An example of using Doxygen in C++" +``` + +#### Line 926: Inclusion of subdirectories + +Allow Doxygen to walk recursively through subdirectories to find source and documentation files. + +``` +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES +``` + +#### Line 1769: Disable LaTeX output + +If you are just interested in the HTML output, you can disable the LaTeX code generation using this switch. + +``` +# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. + +# The default value is: YES. + +GENERATE_LATEX = NO +``` + +After every change, you can run Doxygen again to check whether your changes have had the desired effect. If you just want to check which modification an existing `Doxyfile` has, invoke Doxygen with the `-x` switch: + +![A screenshot of the terminal showing the differences, Project Name, Project Brief, Recursive, and status of Generate Latex][7] + +As with the command `diff`, Doxygen displays only the differences between the actual Doxyfile and the template. + +### Special comments + +Doxygen reads the sources and checks each file for special comments. Based on those comments and keywords, it builds up the HTML documentation. The anatomy of the special comments can be well explained using the header file of the class ByteStream, as shown in the GitHub example linked above. + +I will look at the constructor and destructor as an example: + +``` +/*! @brief Constructor which takes an external buffer to operate on +* +* The specified buffer already exist. +* Memory and size can be accessed by buffer() and size(). +* +* @param[in] pBuf Pointer to existing buffer +* @param[in] size Size of the existing buffer +*/ + +ByteStream(char* pBuf, size_t size) noexcept; +``` + +There are different flavors of formatting a special comment block. I prefer to start the comment in the Qt-style (`/*!` ) and add an asterisk (`*` ) before each line. The block then ends with an asterisk followed by a forward slash (`*/` ). To get an overview of the different style options, refer to the Doxygen manual, in the section *Documenting the code*. + +Comments in Doxygen are divided into two sections, a brief description and a detailed description. Both sections are optional. In the code sample above, the comment block refers to the following line of code, the declaration of a constructor. The sentence behind the `@brief` will be shown in the compact class overview: + +![A screenshot of the C++ example of using Doxygen showing the Byte Stream Class Reference. The categories in the list are public member functions, writing (operators for writing to the stream), and reading (operators for reading from the stream)][8] + +After a blank line (blank lines are treated as paragraph separators), the actual documentation for the constructor begins. With the `@param[in/out]` keyword, you can mark the arguments passed to the constructor, and Doxygen will make a clear argument list from it: + +![Screenshot of the Doxygen example showing the parameters under ByteStream][9] + +Note that Doxygen automatically creates a link to the mentioned `buffer()` and `size()` method in the comment. In contrast, the comment before the destructor declaration won't have any effect on Doxygen as it is not recognized as a special comment: + +``` +// Destructor +~ByteStream(); +``` + +Now you have seen 90% of the magic. By using a slightly modified syntax for your comments, you can convert them into special comments that Doxygen can read. Furthermore, by using a few keywords, you can advance the formatting. In addition, Doxygen has some special features, which I will highlight in the following section. + +### Features + +Most of the work is already done via your regular commenting on the source code. But with a few tweaks, you can easily enhance the output of Doxygen. + +#### Markdown + +For advanced formatting, Doxygen supports Markdown syntax and HTML commands. There is a Markdown cheat sheet available in the [download section][10] of opensource.com. + +#### Mainpage + +Aside from your customized header, you will get a mostly empty page when you open `html/index.html`. You can add some meaningful content to this empty space by using specific keywords. Because the main page is usually not dedicated to a particular source code file, you can add an ordinary text file containing the content for the main page into the root of your project. You can see this in the example on GitHub. The comments in there produce the following output: + +![The Doxygen Example Documentation field now contains headings and documentation: Introduction, Running the example, System requirements, and Building the code, with step by step examples and code snippets (all can be found in the example on GitHub)][11] + +#### Automatic link generation + +As noted above, Doxygen automatically figures out when you are referring to an existing part of the code and creates a link to the related documentation. Be aware that automatic link creation only works if the part you refer to is documented as well. + +More information can be found in the official documentation, under *Automatic link generation*. + +#### Groups + +The ByteStream class has overloaded stream operators for writing (`<<` ) and reading (`>>` ). In the class overview in the **Special comments** section above, you can see that the operator declarations are grouped as Writing and Reading. These groups are defined and named in the ByteStream header file. + +Grouping is done using a special syntax: You start a group with `@{` and end it with `}@`. All members inside those marks belong to this group. In the header `ByteStream.h` it is implemented as follows: + +``` +/** @name Writing +* Operators for writing to the stream +* @{ +*/ + +(...) + +/** @} +* @name Reading +* Operators for reading from the stream +* @{ +*/ + +(...) + +/** @} */ +``` + +You can find more information about grouping in the Doxygen documentation, under *Grouping*. + +#### LLVM Support + +If you are building with [Clang][12], you can apply the flag `-Wdocumentation` to the build process to let Clang check your special comments. You can find more information about this feature in the LLVM Users Manual or in Dmitri Gribenko's presentation, both on the Clang website. + +### Where Doxygen is used + +Doxygen was first released in 1997, so it has been already around for some years. Despite its age, many projects use Doxygen to create their documentation. Some examples are NASA's [F Prime][13] flight software framework, the image processing library [OpenCV][14], and the package manager [RPM][15]. You can also find the Doxygen syntax in other areas, like in the documentation standards of the content management platform [Drupal][16]. + +A caveat: One drawback of using Doxygen is that it outputs HTML documentation with the look and feel of web pages from the nineties. It is also hard to depict the architecture of meta and template programming using Doxygen. For those cases, you would probably choose [Sphinx][17] over Doxygen. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/document-source-code-doxygen-linux + +作者:[Stephan Avenwedde][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hansic99 +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/documentation-type-keys-yearbook.png +[2]: https://www.doxygen.n/ +[3]: https://github.com/hANSIc99/DoxygenSample +[4]: https://www.doxygen.nl/manual/ +[5]: https://opensource.com/downloads/doxygen-cheat-sheet +[6]: https://opensource.com/sites/default/files/2022-05/main%20page%20doxy.png +[7]: https://opensource.com/sites/default/files/2022-05/doxygen%20class%20overview.png +[8]: https://opensource.com/sites/default/files/2022-05/actual%20doxy%20byte%20stream%20class.png +[9]: https://opensource.com/sites/default/files/2022-05/argument%20list%20from%20Doxygen.png +[10]: https://opensource.com/downloads/cheat-sheet-markdown +[11]: https://opensource.com/sites/default/files/2022-05/main%20page%20doxygen.png +[12]: https://clang.llvm.org/ +[13]: https://github.com/nasa/fprime +[14]: https://docs.opencv.org/4.5.5/index.html +[15]: https://github.com/rpm-software-management/rpm +[16]: https://www.drupal.org/docs/develop/standards/api-documentation-and-comment-standards +[17]: https://opensource.com/article/18/11/building-custom-workflows-sphinx +[18]: https://opensource.com/downloads/doxygen-cheat-sheet diff --git a/sources/tech/20220526 Garuda Linux- All-Rounder Distro Based on Arch Linux.md b/sources/tech/20220526 Garuda Linux- All-Rounder Distro Based on Arch Linux.md new file mode 100644 index 0000000000..8862a57bb2 --- /dev/null +++ b/sources/tech/20220526 Garuda Linux- All-Rounder Distro Based on Arch Linux.md @@ -0,0 +1,154 @@ +[#]: subject: "Garuda Linux: All-Rounder Distro Based on Arch Linux" +[#]: via: "https://www.debugpoint.com/2022/05/garuda-linux-review-2022/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Garuda Linux: All-Rounder Distro Based on Arch Linux +====== +A review of the Arch Linux based Garuda Linux, which brings a collection of desktop environments, window managers, and tools for general users and gamers. + +I have been planning to review Garuda Linux for a long time. But never got into it due to several reasons. Over the years, we [reviewed][1] a couple of Arch-based distros – spread across new ones, stables distros and more. Each one of them is a little different from the others. Finally, we review the Garuda Linux in 2022 – it’s our first review of this distro, and we will continue with all the major releases. + +![Garuda Linux Desktop (2022)][2] + +### What does it offer? + +There are many customized and easy-to-use Arch-based Linux distributions available. Every one of those tries to present something new other than just another variant of Arch Linux. + +Garuda Linux does offer a few new features compared to others. Firstly, it brings almost all popular desktops and window managers such as KDE, Xfce, GNOME, LXQt-kwin, Cinnamon, Mate, Wayfire, Qtile, i3wm and Sway. Second, it offers the default BTRFS file system with zstd compression for better performance. In addition, it provides the popular Chaotic-Aur, which contains a vast collection of pre-compiled binaries from AUR. Moreover, a group of hand-picked themes, icons and cursors give Garuda Linux an edge over the other Arch-based distros. + +Finally, its primary selling point is its pre-made for Gaming in Arch Linux with native apps such as Garuda Gamer and the option for Zen Kernel. + +### Garuda Linux Review – 2022 Edition + +This review is based on Garuda’s default offering, i.e. Garuda dragonized zen kernel with KDE Plasma (April 28, 2022 iso). + +#### Download and Installation + +![Garuda Linux – boot screen][3] + +The download via torrent was fast without any problems. The LIVE boot gives you whether you want to boot using the open-source or NVIDIA drivers. Finally, the welcome screen is well designed and gives you clear instructions to launch the installer. + +Garuda offers separate ISO files for different desktops and window managers. Because a massive set of packages pre-loaded in ISO files also gives you the option for the LITE version with KDE Plasma. The LITE versions are the base Garuda Linux without additional theming and packages. + +So, pick the one you want for your needs. + +Garuda Linux uses Calamares installer. The Calamares are not configured heavily, and installation is pretty straightforward. However, Calamares doesn’t give you the option to choose the desktop environments or packages. As I mentioned above, it has a separate installer for each of those. + +During my test, the installation went smooth, and it took around 5 minutes for launching the LIVE medium to installation completion in an Intel i5, 8 GB, SSD configuration. It’s blazing fast, in my opinion. + +#### Look and Feel + +After the successful installation, you see a nice login screen (SDDM with themes). It is well designed and aligned with Garda Linux’s design patterns. + +![The Login screen (SDDM) of Garuda Linux][4] + +The KDE Plasma desktop is heavily customized in terms of look in Garuda Linux. Firstly, the Latte dock is well placed with essential shortcuts at the bottom. No unnecessary shortcuts are there, which is nice. + +![Garuda Linux Desktop with Latte dock][5] + +Second, at the top bar, you get the application menu of KDE Plasma with Latte dock widgets. All the widgets are well placed and necessary for all user bases. By default, the top bar contains NEtSpeed widgets, clipboard and volume controls and the event calendar widget of the Latte dock. + +Garuda Linux uses Kvantum theme engine with “sweetified-plasma” theme with kvantum-dark application style, giving it its unique look. In addition, the famous BeautyLine icon theme provides the much-needed contrast (as designed) to this distro. + +#### Initial Setup and Applications + +Firstly, the initial setup gives you several options to quickly configure your desktop before your first use. A series of terminal-based operations is provided by its welcome applications such as system upgrades, etc. + +The welcome application gives an assorted list of Garuda utilities, ranging from system configurations to changing looks. It includes system cleaner, partition manager, Chaotic-aur managers, Gaming utilities, etc. + +Not only that, but it also provides access to Garuda services for its users directly from the desktop. It helps new to advanced users in terms of discovery of the services and features. + +![Garuda Welcome App][6] + +Now, I would like to highlight two crucial apps in this Garuda Linux review. First, the Snapper tool gives you controls to create a system restore points using several options. If your system breaks at some point, you can always restore it to a stable state using this utility. This is one of the much-needed applications, considering it’s a rolling release. + +![The Snapper Tools for system restore points][7] + +Second, the Octopi software manager (similar to synaptic) gives you access to all necessary packages in the Arch repo. You can easily install with one click after verifying the dependencies. Moreover, it also gives you the ability to add and remove Arch repositories via GUI. It’s worth mentioning here that Garuda includes “chaotic-aur” and “multilib” repo by default in addition to the typical “community”, “extra”, and “core” repo. + +![Octopi Software Manager][8] + +#### The Browser + +Garuda doesn’t provide a Firefox web browser by default. It includes the customized LibreWolf-based [FireDragon][9] web browser, which integrates well with the KDE Plasma desktop. In addition, UBlock Origin and Dark Reader add-ons are pre-installed in FireDragon. The FireDragon web browser uses Garuda’s server for searching the web. I am not entirely sure whether it connects to Google in the backend. + +![FireDragon Web browser][10] + +In addition to the above apps, Garuda uses the advanced Fish shell for command line work. However, LibreOffice and other graphical utilities are not installed by default. + +#### Performance and Resource Usage + +Garuda is a little resource heavy, even in an idle state. It consumed around 17% of CPU and RAM usage of approximately 1.2 GB at idle. And if you open more apps, then it will further shoot up. + +The htop shows that most of the idle state resources are consumed by KWin. I am not sure why there are five forks of KWin running (perhaps for Kvuntam and other theming). I cross-checked this with a standard Plasma installation, where only one process of KWin runs. + +The default KDE Plasma edition of Garuda Linux takes around 6.4 GB of disk space. + +![Garuda Linux Performance – Idle State][11] + +With the above performance metric, you may not be able to run it in low-end hardware. For better performance, I recommend using an Intel i7 or similar system with at least 8GB of memory. However, the official system requirement states 4 GB of memory as below. + +* 30 GB storage space +* 4 GB RAM +* Video card with OpenGL 3.3 or better +* 64-bit system + +Also, it is worth mentioning that other flavours such as GNOME, Cinnamon etc, should have much better performance metrics. + +### Things which grabbed my attention + +Garuda requires 30 GB of disk space, which I overlooked before installing. And it also seems a hard requirement, and the Calamares installer is configured that way. So, you have to have a minimum of 30 GB of root partition to install this version of Garuda Linux. + +Moreover, it takes around 6 GB of disk space for a default install, and I am not sure why the 30 GB limit is too hardcoded in the installer. + +![Garuda Linux requires min 30 GB disk space for installation][12] + +While Garuda Linux looks wonderful, I feel the default theming and colour contrast are a little “too much”. It feels excellent with high contrast colours on a dark backdrop at first look. But it does look a little “fanboy” type. Although look and feel are subjective, everyone has a different taste. + +But always, you can change the themes, icons and whatnot with just a click in KDE Plasma. + +### Closing Notes + +Finally, to wrap up the Garuda Linux review of 2022, I must say it is one of the Arch-based distros which stands out from the other distros in the same category. Due to its popularity and active participation from the user base, it shall not be discontinued in the future. + +From a general user’s perspective, community help is available via several active channels (which can be accessed via shortcuts from the welcome screen). + +If you are keen on gaming, zen Kernel and passionate about Arch Linux, you can choose Garuda. The use case of this distro may vary. I would not recommend it for serious development, projects, media related work. + +Then again, Garuda undoubtedly brings unique apps to manage Arch Linux, which is also a plus point. If you need a fancy looking Arch-based distro to start your Linux journey, it’s perfect. + +That said, you can download Garuda Linux from the [official website][13]. + +And do let me know your opinion about Garuda in the comment box down below. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/garuda-linux-review-2022/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/tag/linux-distro-review +[2]: https://www.debugpoint.com/wp-content/uploads/2022/05/Garuda-Linux-Desktop-2022.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/Garuda-Linux-boot-screen.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/05/The-Login-screen-SDDM-of-Garuda-Linux.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/05/Garuda-Linux-Desktop-with-Latte-dock.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/05/Garuda-Welcome-App.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/05/The-Snapper-Tools-for-system-restore-points.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/Octopi-Software-Manager.jpg +[9]: https://github.com/dr460nf1r3/firedragon-browser +[10]: https://www.debugpoint.com/wp-content/uploads/2022/05/FireDragon-Web-browser.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2022/05/Garuda-Linux-Performance-Idle-State.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2022/05/Garuda-Linux-requires-min-30-GB-disk-space-for-installation.jpg +[13]: https://garudalinux.org/downloads.html diff --git a/sources/tech/20220526 Shell Scripting is Still Going Strong.md b/sources/tech/20220526 Shell Scripting is Still Going Strong.md new file mode 100644 index 0000000000..f4a5b767cd --- /dev/null +++ b/sources/tech/20220526 Shell Scripting is Still Going Strong.md @@ -0,0 +1,198 @@ +[#]: subject: "Shell Scripting is Still Going Strong" +[#]: via: "https://www.opensourceforu.com/2022/05/shell-scripting-is-still-going-strong/" +[#]: author: "Bipin Patwardhan https://www.opensourceforu.com/author/bipin-patwardhan/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Shell Scripting is Still Going Strong +====== +This article introduces you to the basics of shell scripting and its importance in day-to-day life. A shell script is a command-line interpreter that runs on a UNIX/Linux shell. + +![Penguin-with-linux-command][1] + +The first thing we notice when we log into a UNIX/Linux system is the blinking cursor next to the $ sign. This is the shell. It has been – for many decades – the ubiquitous (and many times the only) interface to interact with a computer. Before the advent and popularity of graphical user interfaces (GUIs), the terminal and the shell were the only mechanism to make the computer do what we wanted it to do. At first glance, one may wonder what the shell does – other than passing commands to the underlying operating system for execution. Most of us are familiar with commands like ‘ls’ (for listing contents of a directory), ‘cd’ (for changing the current directory), and so on. It is through the shell that we can execute these commands. The shell understands the text we type — converts it into tokens — and then executes them on the operating system. + +### Flavours + +Initially, the terminal started with the humble Bourne shell or ‘sh’. Over the years, many shell variants were developed and used. Some of the popular ones are ‘C Shell’ / ‘csh’ and ‘Korn Shell’ / ‘ksh’. ‘sh’ fell out of favour for a few years, but has gained popularity once again through its recent avatar, namely ‘bash’ / ‘Bourne Again Shell’. + +### What does the shell actually do? + +The shell is the immediate interface between the operating system (OS) and the user. We make the computer do what we want, by using commands and applications supported by the tools installed on the computer we are using. Some commands are applications installed on the operating system, while some are built into the shell itself. Some of the commands built into bash are ‘clear’, ‘cd’, ‘eval’, and ‘exec’, to name a few, while commands like ‘ls’, and ‘mkdir’ are applications. The commands built into the shell vary as per the shell. + +In this article, we cover a few aspects related to ‘bash’. + +### More about the shell + +Most of us have used commands like ‘ls’, ‘cd’, and ‘mkdir’. When we run the ‘ls -l’ command on a directory, all the directories and files in that directory are listed on the screen. If the number is large, the screen scrolls. If the terminal does not support scroll bars (as was the case for many years), there is no way to look at the entries that have scrolled past. To help overcome this, we use commands like ‘more’ and ‘less’. These allow us to view the output on a page-by-page basis. The command typically used is: + +``` +ls -l | less +``` + +What is the shell doing here? What looks like a single command is actually two commands executing one after the other, ls and less. The pipe (‘|’) connects the two programs, but the connection is managed by the shell. Because of the pipe character, the shell connects the two programs – it connects the standard output of the ls command and connects it to the standard input or standard in or stdin of less. The pipe feature allows us to take the output of any program and provide it as the input to another program – without us having to do any changes to the programs. This is the philosophy of many UNIX/Linux applications — keep the applications simple and then combine many applications together to achieve the end result, rather than having one program do many things. + +If needed, we can redirect the output of ls to a file and then view it using ‘vi’. For this, we use the command: + +``` +ls -l > /tmp/my_file.txt +vi /tmp/my_file.txt +``` + +In this case, the output of ls is being redirected to a file. This is managed by the shell, which understands the ‘>’ symbol to mean redirection. It treats the token that follows as a file. + +### Automation using shell + +This ability to combine commands is one of the key elements for the creation of automation scripts using shell commands. In my most recent project, we were executing Python/Spark (PySpark) applications using cluster mode. Each application executed many structured query language (SQL) statements – SparkSQL. To keep track of application progress, we were printing details about the SQL being executed. This allowed us to maintain a log of what was happening in the application. As the applications were executed in cluster mode, to view the log, we had to use the yarn command as follows: + +``` +yarn log –applicationId [application_id] +``` + +In most cases, the log produced by an application was very large. So we typically piped the log to ‘less’ or redirected it to a file. The command we used was: + +``` +yarn log –aplicationId [application_id] | less +``` + +Our development team had a strength of 40 people. Each one had to remember this command. To make it simpler, I converted this command into a bash script. For this, I created a file with a ‘.sh’ extension. On UNIX and Linux systems, file extension does not matter. As long as the file is an executable, it will work. Extensions have significance on MS Windows. + +### Important thing to remember + +The shell is an interpreter. This means that it will read the program line by line and execute it. The limitation of this approach is that errors (if any) are not identified upfront. Errors are not identified till they are read and executed by the interpreter. In short, we can have a shell program that will execute perfectly for the first 20 lines and then fail due to a syntax error on line 21. When the script fails at line 21, the shell does not unroll/undo the previous steps. When such a thing occurs, we have to correct the script and start execution from the first line. Thus, as an example, if we have deleted a few files before encountering an error, execution of the shell script will stop, but the files are gone forever. + +The script I created was: + +``` +#!/bin/bash +yarn log –applicationId 123 | less +``` + +…where 123 was the application ID. + +The first two characters of the first line are magic characters. They tell the script that this is an executable file and the line contains the name of the program to be used for execution. The remaining lines of the script are passed to the program mentioned. In this case, we are going to execute bash. Even after including the first line, we have to apply execute permissions to the file using: + +``` +chmod +x my_file.sh +``` + +After giving execute permissions to the file, we can execute it as: + +``` +./my_file.sh +``` + +If we do not give execute permissions to the file, we can execute the script as: + +``` +sh ./my_file.sh +``` + +### Passing parameters + +You will realise quickly that such a script is handy, but becomes useless immediately. Each time we execute the Python/Spark application, a new ID is generated. Hence, for each run, we have to edit the file and add the new application ID. This definitely reduces the usability of the script. To be useful, we should be passing the application ID as a parameter: + +``` +#!/bin/bash +yarn –log -applicationId ${1} | less +``` + +We need to execute the script as: + +``` +./show_log.sh 123 +``` + +The script will execute the yarn command, fetch the log for the application and allow us to view it. + +What if we want to redirect the output to a file? Not a problem. Instead of sending the output to less, we can redirect it to a file: + +``` +#!/bin/bash +ls –l ${1} > ${2} +view ${2} +``` + +To run the script, we have to provide two parameters, and the command becomes: + +``` +./my_file.sh /tmp /tmp/listing.txt +``` + +When executed, $1 will bind to /tmp and $2 will bind to /tmp/listing.txt. For the shell, the parameters are named from one to nine. This does not mean we cannot pass more than nine parameters to a script. We can, but that is the topic of another article. You will note that I have mentioned the parameters as ${1} and ${2} instead of $1 and $2. It is a good practice to enclose the name of the parameter in curly brackets as it allows us to unambiguously combine the parameters as part of a longer variable. For example, we can ask the user to provide file name as a parameter and then use that to form a larger file name. As an example, we can take $1 as the parameter and create a new file name as ${1}_student_names.txt. + +### Making the script robust + +What if the user forgets to provide parameters? The shell allows us to check for such conditions. We modify the script as below: + +``` +#!/bin/bash +if [ -z “${2}” ]; then +echo “file name not provided” +exit 1 +fi +if [ -z “${1}” ]; then +echo “directory name not provided” +exit 1 +fi +DIR_NAME=${1} +FILE_NAME=${2} +ls -l ${DIR_NAME} > /tmp/${FILE_NAME} +view /tmp/${FILE_NAME} +``` + +In this program, we check if the proper parameters are passed. We exit the script if parameters are not passed. You will note that I am checking the parameters in reverse order. If we check for the presence of the first parameter before checking the presence of the second parameter, the script will pass to the next step if only one parameter is passed. While the presence of parameters can be checked in ascending order, I recently realised that it might be better to check from nine to one, as we can provide proper error messages. You will also note that the parameters have been assigned to variables. The parameters one to nine are positional parameters. Assigning positional parameters to named parameters makes it easy to debug the script in case of issues. + +### Automating backup + +Another task that I automated was that of taking a backup. During development, in the initial days, we did not have a version control system in place. But we needed to have a mechanism to take regular backups. So the best method was to write a shell script that, when executed, copied all the code files into a separate directory, zipped them and then uploaded them to HDFS, using the date and time as the suffix. I know that this method is not as clean as having a version control system, as we store complete files and finding differences still needs the use of a program like diff; however, it is better than nothing. While we did not end up deleting the code files, the team did end up deleting the bin directory where the helper scripts were stored!!! And for this directory I did not have a backup. I had no choice but to re-create all the scripts. + +Once the source code control system was in place, I easily extended the backup script to upload the files to the version control system in addition to the previous method uploading to HDFS. + +### Summing up + +These days, programming languages like Python, Spark, Scala, and Java are in vogue as they are used to develop applications related to artificial intelligence and machine learning. While these languages are far more powerful when compared to shells, the ‘humble’ shell provides a ready platform that allows us to create helper scripts that ease our day-to-day tasks. The shell is quite powerful, more so because we can combine the powers of all the applications installed on the OS. As I found out in my project, even after many decades, shell scripting is still going strong. I hope I have convinced you to give it a try. + +### One for the road + +Shell scripts can be very handy. Consider the following command: + +``` +spark3-submit --queue pyspark --conf “spark.yarn.principal= abcd@abcd.com --conf “spark.yarn.keytab=/keytabs/abcd.keytab --jars /opt/custom_jars/abcd_1.jar --deploy-mode cluster --master yarn $* +``` + +We were expected to use this command while executing a Python/Spark application. Now imagine this command has to be used multiple times a day, by a team of 40 people. Most of us will copy this command in Notepad++, and each time we need to use it, we will copy it from Notepad++ and paste it on the terminal. What if there is an error during copy paste? What if someone uses the parameters incorrectly? How do we debug which command was used? Looking at history does not help much. +To make it simple for the team to get on with the task of Python/Spark application execution, we can create a bash shell script as follows: + +``` +#!/bin/bash +SERVICE_PRINCIPAL=abcd@abcd.com +KEYTAB_PATH=/keytabs/abcd.keytab +MY_JARS=/opt/custom_jars/abcd_1.jar +MAX_RETRIES=128 +QUEUE=pyspark +MASTER=yarn +MODE=cluster + +spark3-submit --queue ${QUEUE} --conf “spark.yarn.principal=${SERVICE_PRINCIPAL} --conf “spark.yarn.keytab=${KEYTAB_PATH} --jars ${MY_JARS} --deploy-mode ${MODE} --master ${MASTER} $* +``` + +This demonstrates how powerful a shell script can be and make our life easy. You can try more commands and scripts as per your requirement and explore further. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/shell-scripting-is-still-going-strong/ + +作者:[Bipin Patwardhan][a] +选题:[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/bipin-patwardhan/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Penguin-with-linux-command.jpg diff --git a/sources/tech/20220526 Write C applications using Vely on Linux.md b/sources/tech/20220526 Write C applications using Vely on Linux.md new file mode 100644 index 0000000000..858cd4ed19 --- /dev/null +++ b/sources/tech/20220526 Write C applications using Vely on Linux.md @@ -0,0 +1,306 @@ +[#]: subject: "Write C applications using Vely on Linux" +[#]: via: "https://opensource.com/article/22/5/write-c-appplications-vely-linux" +[#]: author: "Sergio Mijatovic https://opensource.com/users/vely" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Write C applications using Vely on Linux +====== +Vely is an open source tool for writing web and command-line applications in C on major Linux distributions. + +![Women in computing and open source][1] + +Image by: Ray Smith + +Vely is a tool for writing web and command-line applications in C. Vely combines high performance and the low footprint associated with C programming with ease of use and improved safety reminiscent of languages like PHP. It's free and open source software, and licensed under GPLv3 and LGPL 3 for libraries, so you can even build commercial software with it. + +Vely works on major Linux distributions and processor architectures. You can use webservers, such as Apache, Nginx, or others, and databases such as MariaDB, PostgreSQL, and SQLite. + +You can use Vely for web applications, command-line programs, as middleware, database applications, services software, data integration, IoT (Internet of Things), and anywhere else. It's well suited for the cloud, works easily in a container, and, due to low resource requirements, it's also a good choice when memory and processing power are at a premium. + +### Install Vely + +To try Vely, install the Apache webserver and [MariaDB database][2]. You can use a different webserver and database, and the setup would be similar, but in this example, I use Apache and MariaDB. + +Next, install Vely. On Linux use a package manager such as `dnf` or `apt`. + +### Stock tickers project + +This example saves the names of stock tickers and their prices so you can view them in a list. + +Start by creating `stock.v` file, and paste this code into it: + +``` +#include "vely.h" + +void stock() { +   out-header default +   @ +       @ +       input-param action +       input-param stock_name +       input-param stock_price +       if (!strcmp (action, "add")) { +          // Add to stock table, update if stock exists +          run-query#add_data@db = "insert into stock (stock_name,\ +              stock_price) values ('%s', '%s') on duplicate key \ +              update stock_price='%s'" : stock_name, stock_price, \ +              stock_price +           end-query +           error#add_data to define err +           if (strcmp (err, "0")) { +               report-error "Cannot update stock price, error [%s]", err +           } +           @
+              @Stock price updated! +           @
+       } else if (!strcmp (action, "show")) { +         // Show stock names and values +           @ +               @ +                   @ +                   @ +               @ +               run-query#show_data@db = "select stock_name, \ +                    stock_price from stock" output stock_name, \ +                    stock_price +                   @ +                       @ +                       @ +                   @ +               end-query +           @
Stock nameStock price
+                       query-result#show_data, stock_name +                       @ +                       query-result#show_data, stock_price +                       @
+       } else { +           @
Unrecognized request!
+       } +       @ +   @ +} +``` + +### Build the database + +For this example, create a database named `dbstock`, owned by user `vely` with the password `your_password`. These are arbitrary names, and in real life, you can use whatever values you want, as long as they're consistent throughout your code. + +First, log in to the MariaDB database as root and execute this: + +``` +CREATE DATABASE IF NOT EXISTS dbstock; +FLUSH privileges; +CREATE USER IF NOT EXISTS vely@localhost IDENTIFIED BY 'your_password'; +FLUSH privileges; +GRANT ALL privileges ON dbstock.* TO vely@localhost; +FLUSH privileges; +exit; +``` + +Now log in to MariaDB again and set the current database: + +``` +$ mysql -u vely -pyour_password +``` + +Now you can create the database objects needed for the application. You need a `stock` table in the `dbstock` database for this example. + +``` +USE dbstock; +CREATE TABLE IF NOT EXISTS stock (stock_name VARCHAR(100) PRIMARY KEY, stock_price BIGINT); +``` + +Finally, create a database configuration file named `db` so that your application can log into the database. You must call it `db` because that's what the code in `stock.v` uses. For instance: + +``` +[...] +run-query#add_data@db = "insert into stock ..." +[...] +``` + +The database name is preceded by the `@` sign, in this case, `@db`, so the name of the database configuration file is `db`. As with other values, you can name your database configuration file whatever you want, as long as your code is consistent. + +Here's the configuration for the `db` file: + +``` +[client] +user=vely +password=your_password +database=dbstock +``` + +The above is a standard MariaDB [client options file][3]. Vely uses native database connectivity, so you can specify any options a given database allows. + +### Build the application + +Next, you can create your Vely application. For this example, you're going to create a web app called `stockapp` : + +``` +$ sudo vf -i -u $(whoami) stockapp +``` + +This creates an application home under the Vely directory (`/var/lib/vv` ) and performs the required application setup steps for you. + +To build your application, use the `vv` command: + +``` +$ vv -q --db=mariadb:db stockapp +``` + +Here's what each option means: + +* -q builds an application +* --db specifies the database to be used (mariadb:db, as specified in your configuration file) +* stockapp is the application name + +You can actually use any number of databases and different vendors in your application. This example is simple, though, so you only need one database. Vely has many other useful options you can use, but this is sufficient for now. + +### Configure web access + +To access your application via a web browser or various web clients, you need to set up a webserver. It can be Apache, Nginx, or any other server that supports FastCGI proxying (most, if not all, webservers and load balancers do this). Here, I will set up Apache, but the setup is similar for other webservers. + +The `proxy` and `proxy_fcgi` modules are installed and enabled by default on the Fedora install of the Apache web server, but you must enable them on Debian-based systems (like Ubuntu): + +``` +$ sudo a2enmod proxy +$ sudo a2enmod proxy_fcgi +$ sudo systemctl restart apache2 +``` + +If you're not on a Debian-based system, you can enable an Apache module by adding it to the Apache configuration file or in a file in the `/etc/httpd/conf.modules.d/` directory, depending on your distribution's configuration. + +Next, open your Apache configuration file in a text editor. For example, on a Debian-based system: + +``` +$ sudo vi /etc/apache2/apache2.conf +``` + +On a Fedora system (including Red Hat Enterprise Linux and CentOS): + +``` +$ sudo vi /etc/httpd/conf/httpd.conf +``` + +Add this line to the end of the file: + +``` +ProxyPass "/stockapp" unix:///var/lib/vv/stockapp/sock/sock|fcgi://localhost/stockapp +``` + +Depending on your webserver configuration, there may be a better place to add the `ProxyPass` directive. For this example, though, the above is sufficient. + +Save the file and restart the webserver. On Fedora-based systems: + +``` +$ sudo systemctl restart httpd +``` + +On Debian-based systems: + +``` +$ sudo systemctl restart apache2 +``` + +In this case, you're connecting to your application through a socket, but you can use a TCP port instead (which comes in handy when your application resides in a container or something similar). + +### Run the application + +Start the application server for your application: + +``` +$ vf stockapp +``` + +By default, this runs anywhere from 0 to 20 server processes for your application, depending on the load. When the user load is low, your application uses virtually no memory at all. + +That was it! Navigate to [http://127.0.0.1/stockapp?req=stock&action=add&stock_name=XYZ&stock_pri…][4] in your web browser to see the application. + +You've just updated the stock price for ticker "XYZ" to 440. Try different tickers and prices to build a list of stocks, which you can view with the URL [http://127.0.0.1/stockapp?req=stock&action=show][5]. + +Congratulations, you've created your first Vely application, reverse proxied behind a web server. + +You can also view the output without a graphical browser by [using curl][6]: + +``` +$ curl -s \ +"http://127.0.0.1/stockapp?req=stock&action=add&stock_name=XYZ&stock_price=440" +$ curl -s "http://127.0.0.1/stockapp?req=stock&action=show" +``` + +### Run the application from the terminal + +You can run your application from the terminal, too. A terminal command is always made along with the FastCGI application server, and it's named the same as your application (in this case, `stockapp` ). It works exactly the same as the web app. You can write some requests to your application to be fulfilled as web requests and others to run from the command-line. To do that, you provide the request as environment variables. For instance, to output the list of stocks as HTML, type: + +``` +$ export REQUEST_METHOD=GET +$ export QUERY_STRING="req=stock&action=show" +$ /var/lib/vv/bld/stockapp/stockapp +``` + +To suppress HTTP headers, use: + +``` +$ export VV_SILENT_HEADER=yes +$ /var/lib/vv/bld/stockapp/stockapp +``` + +### How Vely works + +Your application works by processing requests and sending back replies. A request is one of two HTTP methods: GET or POST. + +A request always has a parameter `req`. In the example here, its value is `stock`. That means source code compiled from file `stock.v` is called automatically to handle such a request. + +A source file like this can do many different things, all grouped logically under a single request. Here, you have another parameter `action`, which can have a value of `add` (to add or update a stock) or `show` (to show a list of stocks). You specify `stock_name` and `stock_price` parameters when adding or updating. Pretty easy stuff. Other than `req`, you can choose parameter names however you wish. + +Looking at the code in `stock.v`, it's simple to follow. You use the [input-param][7] construct to get the values for your input parameters. Yes, those strange things in the C code that aren't C are [Vely language constructs][8], and they do lots of useful stuff for you, such as [run-query][9], which (as you might expect from the name) runs your queries. An easy one is `@`, which is an [output construct][10]. String handling is made simple and reliable without worrying about buffer overruns. Check out the [full reference of Vely constructs][11] to understand Vely's capabilities. + +Vely converts all constructs in your code into pure C and makes a native executable that is very small and fast. Your application runs as several FastCGI server processes, which stay resident in memory while accepting and processing requests. All of these processes work in parallel. + +For more info, see [how Vely works][12] and read more about [Vely architecture][13]. + +### Manage strings and memory + +Vely has automatic garbage collection for all of its constructs. In fact, most of the time, you shouldn't need to free memory at all, so application development is even simpler. Leave that to Vely and enjoy computing free of memory leaks and far fewer memory issues than you might expect. String constructs such as `write-string` make it safe, fast, and easy to create complex strings just as they do simple ones. + +### FastCGI program manager + +Even if you don't want to develop your own applications with Vely, you can use `vf`, [Vely's FastCGI program manager][14], with any generic FastCGI program, not just those created with Vely. + +### Want to learn more about Vely? + +I sometimes get asked about the project name. *Vely* is short for *Vel(ocit)y*. It's fast to program with, fast to understand code and maintain, and fast (and small!) at run time. It's even easy to containerize. + +Check out the documentation at [vely.dev][15], which features downloads and examples that go beyond the introduction this article provides. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/write-c-appplications-vely-linux + +作者:[Sergio Mijatovic][a] +选题:[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/vely +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/OSDC_women_computing_2.png +[2]: https://www.redhat.com/sysadmin/mysql-mariadb-introduction?intcmp=7013a000002qLH8AAM +[3]: https://mariadb.com/kb/en/configuring-mariadb-connectorc-with-option-files/#options +[4]: http://127.0.0.1/stockapp?req=stock&action=add&stock_name=XYZ&stock_price=440 +[5]: http://127.0.0.1/stockapp?req=stock&action=show +[6]: https://opensource.com/article/20/5/curl-cheat-sheet +[7]: https://vely.dev/input-param.html +[8]: https://vely.dev/language_constructs.html +[9]: https://vely.dev/run-query.html +[10]: https://vely.dev/output_construct.html +[11]: https://vely.dev/reference.html +[12]: https://vely.dev/how_vely_works.html +[13]: https://vely.dev/vely_architecture.html +[14]: https://vely.dev/plain_C_FCGI.html +[15]: http://vely.dev diff --git a/sources/tech/20220527 4 cool new projects to try in Copr for May 2022.md b/sources/tech/20220527 4 cool new projects to try in Copr for May 2022.md new file mode 100644 index 0000000000..4ea0efa4fc --- /dev/null +++ b/sources/tech/20220527 4 cool new projects to try in Copr for May 2022.md @@ -0,0 +1,149 @@ +[#]: subject: "4 cool new projects to try in Copr for May 2022" +[#]: via: "https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-may-2022/" +[#]: author: "Miroslav Suchý https://fedoramagazine.org/author/msuchy/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +4 cool new projects to try in Copr for May 2022 +====== + +![4 packages to try from the Copr repos][1] + +[Copr][2] is a build system for anyone in the Fedora community. It hosts thousands of projects for various purposes and audiences. Some of them should never be installed by anyone, some are already being transitioned to the official Fedora Linux repositories, and the rest are somewhere in between. Copr gives you the opportunity to install third-party software that is not available in Fedora Linux repositories, try nightly versions of your dependencies, use patched builds of your favorite tools to support some non-standard use cases, and just experiment freely. + +If you don’t know [how to enable a repository][3] or if you are concerned about whether [it is safe to use Copr][4], please consult the [project documentation][5]. + +This article takes a closer look at interesting projects that recently landed in Copr. + +### Python-QT6 + +Do you miss QT6 Python bindings for Fedora Linux? Here they are. [https://copr.fedorainfracloud.org/coprs/g/kdesig/python-qt6/][6] + +KDE SIG owns this project. Therefore, it should be a quality one. And one day, it may land in Fedora Linux. + +Example of usage: + +``` +$ python + Python 3.10.4 (main, Mar 25 2022, 00:00:00) [GCC 12.0.1 20220308 (Red Hat 12.0.1-0)] on linux + Type "help", "copyright", "credits" or "license" for more information. + >>> import PyQt6 + >>> from PyQt6.QtWidgets import QApplication, QWidget + >>> import sys + >>> app = QApplication(sys.argv) + >>> window = QWidget() + >>> window.show() + >>> app.exec() + 0 +``` + +More documentation can be found at + +[https://www.pythonguis.com/tutorials/pyqt6-creating-your-first-window/][7]. + +**Installation instructions** + +This package is available for Fedora Linux 36 and Rawhide. To install it, enter these commands: + +``` +sudo dnf copr enable @kdesig/python-qt6 +sudo dnf install python3-qt6 +``` + +### Cloud-Native Utilities + +[A collection of cloud-native development tools][8]. + +These packages do not follow Fedora packaging guidelines, are statically built, and opt to bundle all dependencies. + +**Currently available packages**: + +* Terraform – terraform +* Packer – packer +* Helm – helm +* Tekton CLI – tektoncd-cli tektoncd-cli-doc +* Knative CLI – knative-client knative-client-doc +* Buildpack CLI – pack + +All build recipes can be viewed in dist-git or from Pagure:[https://pagure.io/mroche/cloud-utilities][9] + +**Installation instructions** + +These packages are available for Fedora 36 Linux and Rawhide. To install them, enter this command: + +``` +sudo dnf copr enable mroche/cloud-native-utilities +``` + +### DNF 5 + +You may be aware the DNF team is working on DNF5. There is a [change proposal][10] for Fedora Linux 38. The benefit is that every package management software — including PackageKit, and DNFDragora — should use a common *libdnf* library. If you have an application that handles RPM packages, you should definitely check out this project. + +[https://copr.fedorainfracloud.org/coprs][11][/][12][rpmsoftwaremanagement/dnf5-unstable/][13] + +Another similar project from the DNF team is + +[https://copr.fedorainfracloud.org/coprs/jmracek/dnf5-alternatives/][14]. + +**Installation instructions** + +These packages are available for Fedora Linux 35, 36 and Rawhide. To install them, enter these commands: + +``` +sudo dnf copr enable  rpmsoftwaremanagement/dnf5-unstable +sudo dnf install dnf5 +sudo dnf copr enable jmracek/dnf5-alternatives +sudo dnf install microdnf-deprecated +``` + +### Hare + +[Hare][15] is a systems programming language designed to be simple, stable and robust. Hare uses a static type system, manual memory management, and a minimal runtime. It is well suited to writing operating systems, system tools, compilers, networking software, and other low-level, high-performance tasks. A detailed overview can be found in [these slides][16]. + +My summary is: Hare is simpler than C. It can be easy. But if you insist on shooting in your legs, Hare will allow you to do it. + +[Copr project][17]. + +**Installation Instructions** + +These packages are available for Fedora Linux 35, 36 and Rawhide. They are also available for OpenSUSE Leap and Tumbleweed. To install them, enter these commands: + +``` +sudo dnf copr enable sentry/qbe +sudo dnf copr enable sentry/hare +sudo dnf install hare harec qbe +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-may-2022/ + +作者:[Miroslav Suchý][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/msuchy/ +[b]: https://github.com/lkxed +[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/4-copr-945x400.jpg +[2]: https://copr.fedorainfracloud.org/ +[3]: https://docs.pagure.org/copr.copr/how_to_enable_repo.html#how-to-enable-repo +[4]: https://docs.pagure.org/copr.copr/user_documentation.html#is-it-safe-to-use-copr +[5]: https://docs.pagure.org/copr.copr/user_documentation.html +[6]: https://copr.fedorainfracloud.org/coprs/g/kdesig/python-qt6/ +[7]: https://www.pythonguis.com/tutorials/pyqt6-creating-your-first-window/ +[8]: https://copr.fedorainfracloud.org/coprs/mroche/cloud-native-utilities/ +[9]: https://pagure.io/mroche/cloud-utilities +[10]: https://fedoraproject.org/wiki/Changes/MajorUpgradeOfMicrodnf +[11]: https://copr.fedorainfracloud.org/coprs/rpmsoftwaremanagement/dnf5-unstable/ +[12]: https://copr.fedorainfracloud.org/coprs/rpmsoftwaremanagement/dnf5-unstable/ +[13]: https://copr.fedorainfracloud.org/coprs/rpmsoftwaremanagement/dnf5-unstable/ +[14]: https://copr.fedorainfracloud.org/coprs/jmracek/dnf5-alternatives/ +[15]: https://harelang.org/ +[16]: https://mirror.drewdevault.com/hare.pdf +[17]: https://copr.fedorainfracloud.org/coprs/sentry/hare/ diff --git a/sources/tech/20220527 Plotting Data in R- Graphs.md b/sources/tech/20220527 Plotting Data in R- Graphs.md new file mode 100644 index 0000000000..b7d1506fd2 --- /dev/null +++ b/sources/tech/20220527 Plotting Data in R- Graphs.md @@ -0,0 +1,311 @@ +[#]: subject: "Plotting Data in R: Graphs" +[#]: via: "https://www.opensourceforu.com/2022/05/plotting-data-in-r-graphs/" +[#]: author: "Shakthi Kannan https://www.opensourceforu.com/author/shakthi-kannan/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Plotting Data in R: Graphs +====== +R has a number of packages for plotting graphs and data visualisation, such as graphics, lattice, and ggplot2. In this ninth article in the R series, we shall explore the various functions to plot data in R. + +![business-man-visulising-graphs][1] + +We will be using R version 4.1.2 installed on Parabola GNU/Linux-libre (x86-64) for the code snippets. + +``` +$ R --version + +R version 4.1.2 (2021-11-01) -- “Bird Hippie” +Copyright (C) 2021 The R Foundation for Statistical Computing +Platform: x86_64-pc-linux-gnu (64-bit) +``` + +R is free software and comes with absolutely no warranty. You are welcome to redistribute it under the terms of the GNU General Public License versions 2 or 3. For more information about these matters, see *https://www.gnu.org/licenses/.* + +### Plot + +Consider the all-India consumer price index (CPI – rural/urban) data set up to November 2021 available at *https://data.gov.in/catalog/all-india-consumer-price-index-ruralurban-0* for the different states in India. We can read the data from the downloaded file using the read.csv function, as shown below: + +``` +> cpi <- read.csv(file=”CPI.csv”, sep=”,”) + +> head(cpi) +Sector Year Name Andhra.Pradesh Arunachal.Pradesh Assam Bihar +1 Rural 2011 January 104 NA 104 NA +2 Urban 2011 January 103 NA 103 NA +3 Rural+Urban 2011 January 103 NA 104 NA +4 Rural 2011 February 107 NA 105 NA +5 Urban 2011 February 106 NA 106 NA +6 Rural+Urban 2011 February 105 NA 105 NA +Chattisgarh Delhi Goa Gujarat Haryana Himachal.Pradesh Jharkhand Karnataka +1 105 NA 103 104 104 104 105 104 +2 104 NA 103 104 104 103 104 104 +3 104 NA 103 104 104 103 105 104 +4 107 NA 105 106 106 105 107 106 +5 106 NA 105 107 107 105 107 108 +6 105 NA 104 105 106 104 106 106 +... +``` + +Let us aggregate the CPI values per year for the state of Punjab, and plot a line chart using the plot function, as follows: + +``` +> punjab <- aggregate(x=cpi$Punjab, by=list(cpi$Year), FUN=sum) + +> head(punjab) +Group.1 x +1 2011 3881.76 +2 2012 4183.30 +3 2013 4368.40 +4 2014 4455.50 +5 2015 4584.30 +6 2016 4715.80 + +> plot(punjab$Group.1, punjab$x, type=”l”, main=”Punjab Consumer Price Index upto November 2021”, xlab=”Year”, ylab=”Consumer Price Index”) +``` + +The following arguments are supported by the plot function: + +| Argument | Description | +| :- | :- | +| x | A vector for the x-axis | +| y | The vector or list in the y-axis | +| type | ‘p’ for points, ‘l’ for lines, ‘o’ for overplotted plots and lines, ‘s’ for stair steps, ‘h’ for histogram | +| xlim | The x limits of the plot | +| ylim | The y limits of the plot | +| main | The title of the plot | +| sub | The subtitle of the plot | +| xlab | The label for the x-axis | +| ylab | The label for the y-axis | +| axes | Logical value to draw the axes | + +The line chart is shown in Figure 1. + +![Figure 1: Line chart][2] + +The autocorrelation plot can be used to obtain correlation statistics for time series analysis, and the same can be generated using the acf function in R. You can specify the following autocorrelation types: *correlation, covariance*, or partial. Figure 2 shows the ACF chart that represents the CPI values (‘x’ in the chart) for the state of Punjab. + +![Figure 2: ACF chart][3] + +The function*acf* accepts the following arguments: + +| Argument | Description | +| :- | :- | +| x | A univariate or multivariate object or vector or matrix | +| lag.max | The maximum lag to calculate the acf | +| type | Supported values ‘correlation’, ‘covariance’, ‘partial’ | +| plot | The acf is plotted if this value is TRUE | +| i | A set of time difference lags to retain | +| j | A collection of names or numbers to retain | + +### Bar chart + +The barplot function is used to draw a bar chart. The chart for Punjab’s CPI can be generated as follows, and is shown in Figure 3: + +![Figure 3: Line chart of Punjab’s CPI][4] + +``` +> barplot(punjab$x, main=”Punjab Consumer Price Index”, sub=”Upto November 2021”, xlab=”Year”, ylab=”Consumer Price Index”, col=”navy”) +``` + +The function is quite flexible and supports the following arguments: + +| Argument | Description | +| :- | :- | +| height | A numeric vector or matrix that contains the values | +| width | A numeric vector that specifies the widths of the bars | +| space | The amount of space between bars | +| beside | A logical value to specify if the bars should be stacked or next to each other | +| density | A numerical value that specifies the density of the shading lines | +| angle | The angle used to shade the lines | +| border | The colour of the border | +| main | The title of the chart | +| sub | The sub-title of the chart | +| xlab | The label for the x-axis | +| ylab | The label for the y-axis | +| xlim | The limits for the x-axis | +| ylim | The limits for the y-axis | +| axes | A value that specifies whether the axes should be drawn | + +You can get more details on the barplot function using the help command, as shown below: + +``` +> help(barplot) + +acf package:stats R Documentation + +Auto- and Cross- Covariance and -Correlation Function Estimation + +Description: + +The function ‘acf’ computes (and by default plots) estimates of +the autocovariance or autocorrelation function. Function ‘pacf’ +is the function used for the partial autocorrelations. Function +‘ccf’ computes the cross-correlation or cross-covariance of two +univariate series. + +Usage: + +acf(x, lag.max = NULL, +type = c(“correlation”, “covariance”, “partial”), +plot = TRUE, na.action = na.fail, demean = TRUE, ...) + +pacf(x, lag.max, plot, na.action, ...) + +## Default S3 method: +pacf(x, lag.max = NULL, plot = TRUE, na.action = na.fail, +...) + +ccf(x, y, lag.max = NULL, type = c(“correlation”, “covariance”), +plot = TRUE, na.action = na.fail, ...) + +## S3 method for class ‘acf’ +x[i, j] +``` + +### Pie chart + +Pie charts need to be used wisely, as they may not actually show relative differences among the slices. We can generate the Rural, Urban, and Rural+Urban values for the month of January 2021 for Gujarat as follows, using the subset function: + +``` +> jan2021 <- subset(cpi, Name==”January” & Year==”2021”) + +> jan2021$Gujarat +[1] 153.9 151.2 149.1 + +> names <- c(‘Rural’, ‘Urban’, ‘Rural+Urban’) +``` + +![Figure 4: Pie chart][5] + +The pie function can be used to generate the actual pie chart for the state of Gujarat, as shown below: + +``` +> pie(jan2021$Gujarat, names, main=”Gujarat CPI Rural and Urban Pie Chart”) +``` + +The following arguments are supported by the pie function: + +| Argument | Description | +| :- | :- | +| x | Positive numeric values to be plotted | +| label | A vector of character strings for the labels | +| radius | The size of the pie | +| clockwise | A value to indicate if the pie should be drawn clockwise or counter-clockwise | +| density | A value for the density of shading lines per inch | +| angle | The angle that specifies the slope of the shading lines in degrees | +| col | A numeric vector of colours to be used | +| lty | The line type for each slice | +| main | The title of the chart | + +### Boxplot + +A boxplot shows the interquartile range between the 25th and 75th percentile using two ‘whiskers’ for the distribution of a variable. The values outside the range are plotted separately. The boxplot functions take the following arguments: + +| Argument | Description | +| :- | :- | +| data | A data frame or list that is defined | +| x | A vector that contains the values to plot | +| width | The width of the boxes to be plotted | +| outline | A logical value indicating whether to draw the outliers | +| names | The names of the labels for each box plot | +| border | The colour to use for the outline of each box plot | +| range | A maximum numerical amount the whiskers should extend from the boxes | +| plot | The boxes are plotted if this value is TRUE | +| horizontal | A logical value to indicate if the boxes should be drawn horizontally | + +The boxplot for a few states from the CPI data is shown below: + +``` +> names <- c (‘Andaman and Nicobar’, ‘Lakshadweep’, ‘Delhi’, ‘Goa’, ‘Gujarat’, ‘Bihar’) +> boxplot(cpi$Andaman.and.Nicobar, cpi$Lakshadweep, cpi$Delhi, cpi$Goa, cpi$Gujarat, cpi$Bihar, names=names) +``` + +![Figure 5: Box plot][6] + +![Figure 6: Q-Q plot][7] + +### Q-Q plot + +The Quantile-Quantile (Q-Q) plot is a way to compare two data sets. You can also compare a data set with a theoretical distribution. The qqnorm function is a generic function, and we can view the Q-Q plot for the Punjab CPI data as shown below: + +``` +> qqnorm(punjab$x) +``` + +![Figure 7: Volcano][8] + +The*qqline* function adds a theoretical line to a normal, quantile-quantile plot. The following arguments are accepted by these functions: + +| Argument | Description | +| :- | :- | +| x | The first data sample | +| y | The second data sample | +| datax | A logical value indicating if values should be on the x-axis | +| probs | A numerical vector representing probabilities | +| xlab | The label for x-axis | +| ylab | The label for y-axis | +| qtype | The type of quantile computation | + +### Contour plot + +The contour function is useful for plotting three-dimensional data. You can generate a new contour plot, or add contour lines to an existing chart. These are commonly used along with image charts. The volcano data set in R provides information on the Maunga Whau (Mt Eden) volcanic field, and the same can be visualised with the contour function as follows: + +``` +> contour(volcano) +``` + +The contour function accepts the following arguments: + +| Argument | Description | +| :- | :- | +| x,y | The location of the grid for z | +| z | A numeric vector to be plotted | +| nlevels | The number of contour levels | +| labels | A vector of labels for the contour lines | +| xlim | The x limits for the plot | +| ylim | The y limits for the plot | +| zlim | The z limits for the plot | +| axes | A value to indicate to print the axes | +| col | The colour for the contour lines | +| lty | The line type to draw | +| lwd | Width for the lines | +| vfont | The font for the labels | + +The areas between the contour lines can be filled using a solid colour to indicate the levels, as shown below: + +``` +> filled.contour(volcano, asp = 1) +``` + +The same volcano data set with the filled.contour colours is illustrated in Figure 8. + +![Figure 8: Filled volcano][9] + +You are encouraged to explore the other functions and charts in the graphics package in R. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/plotting-data-in-r-graphs/ + +作者:[Shakthi Kannan][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/shakthi-kannan/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/business-man-visulising-graphs.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Line-chart.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-2-ACF-chart.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-3-Line-chart-of-Punjabs-CPI.jpg +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-4-Pie-chart.jpg +[6]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-5-ox-plot.jpg +[7]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-6-Q-Q-plot.jpg +[8]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-7-Volcano.jpg +[9]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-8-Filled-volcano.jpg diff --git a/sources/tech/20220528 How I automate plant care using Raspberry Pi and open source tools.md b/sources/tech/20220528 How I automate plant care using Raspberry Pi and open source tools.md new file mode 100644 index 0000000000..d11da87617 --- /dev/null +++ b/sources/tech/20220528 How I automate plant care using Raspberry Pi and open source tools.md @@ -0,0 +1,90 @@ +[#]: subject: "How I automate plant care using Raspberry Pi and open source tools" +[#]: via: "https://opensource.com/article/22/5/plant-care" +[#]: author: "Kevin Sonney https://opensource.com/users/ksonney" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I automate plant care using Raspberry Pi and open source tools +====== +I keep tabs on all my houseplants by using Home Assistant and a Raspberry Pi. + +![Digital images of a computer desktop][1] + +Image by: Opensource.com + +> Automation is a hot topic right now. In my day job as an SRE part of my remit is to automate as many repeating tasks as possible. But how many of us do that in our daily, not-work, lives? This year, I am focused on automating away the toil so that we can focus on the things that are important. + +Home Assistant has so many features and integrations, it can be overwhelming at times. And as I’ve mentioned in previous articles, I use it for many things, including monitoring plants. + +``` +$ bluetoothctl scan le +Discovery started +[NEW] Device +[NEW] Device +[NEW] Device +[NEW] Device +[NEW] Device +[NEW] Device +[NEW] Device +``` + +There are numerous little devices you can buy to keep an eye on your plants. The Xiomi MiaFlora devices are small, inexpensive, and have a native integration with Home Assistant. Which is great—as long as the plant and Home Assistant are in the same room. + +We've all been in places where one spot there is a great signal, and moving 1mm in any direction makes it a dead zone—and it is even more frustrating when you are indoors. Most Bluetooth LE (Low Energy) devices have a range of about 100m, but that's using line of sight, and does not include interference from things like walls, doors, windows, or major appliances (seriously, a refrigerator is a great big signal blocker). Remote Home Assistant is perfect for this. You can set up a Raspberry Pi with Home Assistant Operating System (HASSOS) in the room with the plants, and then use the main Home Assistant as a central control panel. I tried this on a Raspberry Pi Zero W, and while the Pi Zero W can run Home Assistant, it doesn't do it very well. You probably want a Pi 3 or Pi 4 when doing this. + +Start with a fresh HASSOS installation, and make sure everything is up-to-date, then install HACS and Remote Home Assistant like I did in my article [Automate and manage multiple devices with Remote Home Assistant][2]. Now for the tricky bits. Install the `SSH and Web Terminal` Add-on, and turn off `Protection Mode` so that you can get a session on the base OS and not in a container. Start the add-on, and it appears on the sidebar. Click on it to load the terminal. + +You are now in a root session terminal on the Pi. Insert all the warnings here about being careful and how you can mess up the system (you know the ones). Inside the terminal, run `bluetoothctl scan le` to find the plant sensor, often named "Flower Care" like mine. + +![Image of finding plant sensors][3] + +Image by: (Kevin Sonney, CC BY-SA 40) + +Make a note of the address for the plant sensor. If you have more than one, it could be confusing to figure out which is which, and can take some trial and error. Once you've identified the plant sensor, it is time to add it to Home Assistant. This requires editing the `configuration.yml` file directly, either with the file editor add on, or in the terminal you just created. In my case, I added both a sensor and a plant block to the configuration. + +``` +sensor: + - platform: miflora + scan_interval: 60 + mac: "C4:7C:8D:6C:DE:FE" + name: "pitcher_plant" + plant: + pitcher_plant: + sensors: + moisture: sensor.pitcher_plant_moisture + battery: sensor.pitcher_plant_battery + temperature: sensor.pitcher_plant_temperature + conductivity: sensor.pitcher_plant_conductivity + brightness: sensor.pitcher_plant_brightness +``` + +Save the file, and restart Home Assistant, and you should see a plant card on the Overview tab. + +![Image showing plant needs watering][4] + +Image by: (Kevin Sonney, CC BY-SA 40) + +Once that's done, go back to the main Home Assistant, and add the newly available `plant` component to the list of things to import from the remote. You can then add the component to dashboards on the main HASS installation, and create automations and notifications based on the plant status. + +I use this to monitor a pitcher plant, and I have more sensors on the way so I can keep tabs on all my houseplants—all of which live outside the Bluetooth range of my central Home Assistant Pi. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/plant-care + +作者:[Kevin Sonney][a] +选题:[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/ksonney +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/computer_desk_home_laptop_browser.png +[2]: https://opensource.com/article/22/5/remote-home-assistant +[3]: https://opensource.com/sites/default/files/2022-05/Day_06-2.png +[4]: https://opensource.com/sites/default/files/2022-05/Day_06-3.png diff --git a/sources/tech/20220528 Portmaster- A GlassWire Alternative for Linux to Monitor & Secure Network Connections.md b/sources/tech/20220528 Portmaster- A GlassWire Alternative for Linux to Monitor & Secure Network Connections.md new file mode 100644 index 0000000000..a90aa18bbf --- /dev/null +++ b/sources/tech/20220528 Portmaster- A GlassWire Alternative for Linux to Monitor & Secure Network Connections.md @@ -0,0 +1,114 @@ +[#]: subject: "Portmaster: A GlassWire Alternative for Linux to Monitor & Secure Network Connections" +[#]: via: "https://itsfoss.com/portmaster/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Portmaster: A GlassWire Alternative for Linux to Monitor & Secure Network Connections +====== +GlassWire is a popular network monitoring app (with no support for Linux) that helps you track data usage, unusual network activity, malicious access to the network, and more. + +I wish it supports Linux, but for now, it only works on Windows and Android. + +For Linux, we do not have a full-fledged GUI-based application that helps us [monitor the network in Linux][1]. + +However, I recently stumbled upon “Portmaster”, an open-source network monitor available for Linux and other platforms. Interestingly, it offers some of the same abilities as seen with Glasswire, with some extras. + +Note that it is not exactly a replacement for “GlassWire” but a potential alternative in the making. + +Here, I shall share more details about it. + +Note + +> Safing Portmaster (or simply ‘Portmaster’) is in its early stages of development (Alpha). We feature it here, considering it aims to offer something new to Linux users. +> +> While it worked fine in our quick tests, you can expect issues with it. + +### Portmaster: Open-Source App to Monitor Computer’s Network Connection + +![portmaster][2] + +Portmaster by [Safing][3] is an open-source GUI program available for Windows and Linux. + +You can track every connection being made through the applications and services used in your Linux distribution. + +It is an entirely free and open-source software that aims to make money using its paid VPN service (**SPN**), which uses onion-encryption (inspired by Tor) to route your connections from through destinations keeping your identity private. + +The paid VPN is a part of the tool, but it is also in the alpha testing stage. + +Even if you download things from your terminal, it tracks them and provides you the detailed information regarding the domain, IP, encryption status, protocol, and the option to block future connections if needed. + +![portmaster network monitor][4] + +You also get several abilities to manage the network connections, add filter lists, rules, and some other advanced options. + +Portmaster gives you an overview of all the connections per application/service and also lets you view the data associated with an individual application. + +![portmaster connection details][5] + +It supports numerous useful features that include real-time network monitoring. + +### Features of Portmaster + +![portmaster firewall network][6] + +Portmaster is not just a simple network connection monitor, it also gives you great control to enforce a secure DNS, and filter your network connections for best security. + +Some key features include: + +* Network monitor overview to sum up connections from the entire system. +* Provide debug information for every app connection history. +* Ability to block a domain from the connection list. +* Retain connection history offline. +* Manage P2P connections. +* Ability to block incoming connections. +* Option to add outgoing rules to manage the network connections easily. +* Add a filter list to easily block connections that you do not want. For instance, preventing NSFW domains to load on your network. +* Choose from different secure DNS servers (Cloudflare as the preferred default) +* Stats about network connections, destinations connected, countries involved, allowed, and blocked connections. + +In addition to the mentioned features, you will find fine-grained controls to get prompts for network connections (block/allow), customize your privacy filter, choose a different DNS, inspect DNS requests for the connections made, and so much more. + +### Install Portmaster on Linux + +Portmaster is officially supported for Ubuntu and Fedora with .deb and .rpm packages available. + +You can download the package from its [official website][7] to try on a supported Linux distribution. + +The [installation documentation][8] gives you more details about the steps for Arch Linux and other Linux distributions. + +You can also explore more about it in its [GitHub page][9]. + +### Wrapping Up + +Portmaster is certainly an interesting addition to the Linux and open-source world. It could become the one tool that everyone uses to monitor, and secure networks while enhancing their online privacy. + +The feature set is promising, but whether it can replace proprietary network monitors like “GlassWire” is another story to be unraveled in the future. + +*What do you think about Portmaster? Please let me know your thoughts in the comments below.* + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/portmaster/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/network-speed-monitor-linux/ +[2]: https://itsfoss.com/wp-content/uploads/2022/05/portmaster.jpg +[3]: https://safing.io/ +[4]: https://itsfoss.com/wp-content/uploads/2022/05/portmaster-network-monitor.jpg +[5]: https://itsfoss.com/wp-content/uploads/2022/05/portmaster-connection-details.jpg +[6]: https://itsfoss.com/wp-content/uploads/2022/05/portmaster-firewall-network.jpg +[7]: https://safing.io/portmaster/#download +[8]: https://docs.safing.io/portmaster/install/linux +[9]: https://github.com/safing/portmaster/ diff --git a/sources/tech/20220528 Top 10 GNOME Themes for Your Ubuntu Desktop.md b/sources/tech/20220528 Top 10 GNOME Themes for Your Ubuntu Desktop.md new file mode 100644 index 0000000000..580bf5b306 --- /dev/null +++ b/sources/tech/20220528 Top 10 GNOME Themes for Your Ubuntu Desktop.md @@ -0,0 +1,205 @@ +[#]: subject: "Top 10 GNOME Themes for Your Ubuntu Desktop" +[#]: via: "https://www.debugpoint.com/2022/05/gnome-themes-2022/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top 10 GNOME Themes for Your Ubuntu Desktop +====== +You can use this list of 10 GNOME themes to transform your Ubuntu distro look in 2022. + +You can use GTK themes to give your GNOME or Ubuntu a sassy look without much effort. Themes are straightforward to download/install, and the result is a stunning desktop. + +There are hundreds of GTK themes available. It’s challenging to pick the best ten among them. To help you choose some of the best ones, we give you the ten best GTK based themes on this page. + +### Points to Note + +Before you apply these themes to your latest GNOME desktop and Ubuntu, a few important points. + +* All the below GNOME themes uses the GNOME Tweak tool for configuration. Also, you should install the User Themes GNOME extensions to apply these themes. + +* Moreover, if you apply these themes, the GNOME’s default light and dark styles in settings are automatically turned off. If you are using Ubuntu 22.04 and above, the accent colour is also turned off to honour custom themes. Because accent colours and the light/dark style combinations set the respective Yaru theme variant. + +* Make sure to close the Settings application in Ubuntu while applying the themes because the settings window gives default Yaru themes higher priority via the Appearance tab. + +* Finally, change the Shell and Legacy Application themes to custom themes (see the below example image). + +![Changing GNOME Theme in Tweaks Tool][1] + +### Best GNOME Themes For Your Ubuntu Desktop in 2022 + +### 1. Arc + +The first GNOME theme we want to feature in this list is the Arc theme. It is the most popular GNOME theme and is suitable for giving the best look with its looks. Arc brings a simple 2D interface with a basic flat look across the desktop. The Flat look is designed so lovely that it gives you a perfect modern desktop look without gradient or glossy effects. It also provides a nice touch to the sidebars in Nautilus and other sidebar-based apps with its Dark version. + +Arc theme comes in light, dark and darker versions. Installing the Arc theme is easy in Ubuntu because it is available in the official repo. Fire up a terminal window and run the following command to install. + +``` +sudo apt install arc-theme +``` + +If you want to install via source, you can grab the files on [GitHub][2] and follow the compilation instructions. + +After the installation, set the theme using the Tweaks tool and pair it using any Yaru-blue icons in Ubuntu for the best look. + +![Arc Darker Theme in Ubuntu GNOME][3] + +#### 2. Layan + +The second theme we highlight here is Layan. Based on material design (materia-gtk), Layan gives you a flat layout for the entire GNOME Shell. In addition, it comes with a few more rounded corners in the windows and larger shadows. Moreover, it brings light and dark variants for every taste bud. + +Perhaps the unique feature of this theme is the sidebar in Nautilus (see below image). It’s a sleek vertical bar with a little mountain icon at the top. I must say, it enhances the entire desktop look with this touch. + +We recommend that you pair it with Yaru-prusiangreen icon and a nice gradient wallpaper for best results. + +For installation, [download the theme from GitHub][4]and extract it. Then run the install.sh. + +It is also available as a snap if you prefer. + +``` +sudo snap install layan-themes +``` + +![Layan GNOME Theme][5] + +#### 3. Orchis + +If you ask me to choose one theme for all possible renovation of your desktop, then I would suggest Orchis. The Orchis theme combines Google’s material design and rounded corners with a sober colour palette. Furthermore, Orchis is bound to make an impression with its visual tone, which brings eight colour options, with each having dark, compact and light variants. + +![Orchis colour options][6] + +For an instant desktop makeover, you can easily pair Orchis with any icon themes and wallpaper. + +Installation is super easy for Orchis. [Download the package from Github][7]. Then run the below command from the installation directory for all variants and colours. + +``` +./install.sh -t all +``` + +![Orchis GNOME Theme][8] + +#### 4. Numix + +Numix theme for GNOME desktops is similar to the Arc theme featured in this list. But it’s a little different in terms of its colour tone. The primary highlight colour is complemented by its flat design. It comes with light and dark variants. However, you can only download and install the light version for free. + +You can easily install it using the following command in Ubuntu. + +``` +sudo apt install numix-gtk-theme +``` + +If you prefer the dark variant, you can get it via the [developer’s home page][9] instructions. + +![Numix Theme | image credit: Author of Numix][10] + +#### 5. Adapta + +[Adapta][11] is one of the most popular GTK themes, which inspired many child themes. The theme creators often base their theme on Adapta and modify it further. Hence you can imagine its flexibility and features. In addition, Adapta is based on Google’s Material Design principle. + +Moreover, if you like the Android user interface, you will enjoy the Adapta theme on your GNOME desktop because it brings ample padding, well-placed shadows and layers, better contrast, etc. + +Before installing, you should know that the installation size is slightly larger for a theme (~200MB+). + +Finally, you can easily install the Adapta theme using the command below. + +``` +sudo apt install adapta-gtk-theme +``` + +![Adapta Theme – follows Android Style][12] + +#### 6. Cloudy + +Cloudy provides a comfortable and smooth look. It is based on the Arc theme featured in this list. In addition, it follows the material design approach that offers a unique feel of “cloudy sky”. Moreover, the Cloudy theme offers grey and blue flavour with light/dark variants. + +If you love the colour sky blue and want a material design theme, then choose this one. + +Download this theme from the gnome-look website [here][13] and copy the extracted files in your ~/.themes directory to install. + +![Cloudy GNOME Theme][14] + +#### 7. Nord + +The Nord theme is one of the famous GTK themes you can install on the GNOME desktop. It tenders a cool and stylish piece with several colour options. In addition, all the colour options come with light and dark variants. + +The colour options are blue, green and grey. If you want this for your desktop, follow the below instructions to install. + +[Download the files][15] from gnome-look and place them in the ~/.themes folder after extract. + +![Nord Theme | Image Credit: Ant Author][16] + +#### 8. Prof-GNOME + +The eighth theme in this list is the Prof-GNOME theme. It is a perfect theme that calms your mind with its unique way of resting your eyes. In my opinion, if you want to renovate your GNOME desktop but still want it to look like a professional desktop with a legacy macOS look, then choose Prof-GNOME. + +Moreover, it is not a fancy theme but rather a legacy theme with a modern approach to design, keeping the older macOS look alive. + +To try this theme, download the files from [GitHub][17] and place them to ~/.themes after extracting. + +However, a word of caution is that it’s not updated for some time. + +![Prof-GNOME Theme][18] + +#### 9. Whitesur + +A list of GNOME themes is incomplete without a theme which makes your desktop look like macOS. Hence, as its name suggests, we present the 9th theme in this list – the popular [Whitesur theme][19]. It’s a GTK theme that helps you make your desktop look like macOS Big Sur. + +Furthermore, the Whitesur theme is compatible with non-GNOME based desktop Xfce, Cinnamon, etc. + +Pair it with the Plack Dock and Whitesur Icon theme for a complete macOS makeover. + +[Download][20] the theme from GitHub and place the files in the ~/.themes after extracting. + +![Whitesur theme for GNOME][21] + +#### 10. Ant + +The final theme in this list is Ant. The Ant is an exciting theme which is a little bold in its approach. It brings the Flat look and feels but with a twist of “Dracula” and “Bloody” flavour. + +I must say a perfect Halloween theme, and you can download it from [here][22]. + +![Ant Theme for GNOME | Image Credit: Author of Ant theme][23] + +### Closing Notes + +I hope this list of 10 best GNOME themes of 2022 encourages your to renovate the rather mundane Ubuntu distro look or any GNOME desktop setup. In the comment box below, let me know which one is your favourite? Also, add your favourite one, which you think should be on the list. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/gnome-themes-2022/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/05/Changing-GNOME-Theme-in-Tweaks-Tool.jpg +[2]: https://github.com/jnsh/arc-theme +[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/Arc-Darker-Theme-in-Ubuntu-GNOME-1.jpg +[4]: https://github.com/vinceliuice/Layan-gtk-theme/archive/refs/heads/master.zip +[5]: https://www.debugpoint.com/wp-content/uploads/2022/05/Layan-GNOME-Theme.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/05/Orchis-colour-options.jpg +[7]: https://github.com/vinceliuice/Orchis-theme/archive/refs/heads/master.zip +[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/Orchis-GNOME-Theme.jpg +[9]: https://satya164.deviantart.com/art/Numix-GTK3-theme-360223962 +[10]: https://www.debugpoint.com/wp-content/uploads/2022/05/Numix-Theme.jpg +[11]: https://github.com/adapta-project/adapta-gtk-theme +[12]: https://www.debugpoint.com/wp-content/uploads/2022/05/Adapta-Theme-follows-Android-Style.jpg +[13]: https://www.gnome-look.org/p/1242416/ +[14]: https://www.debugpoint.com/wp-content/uploads/2022/05/Cloudy-GNOME-Theme.jpg +[15]: https://www.gnome-look.org/p/1267246/ +[16]: https://www.debugpoint.com/wp-content/uploads/2022/05/Nord-Theme.jpg +[17]: https://github.com/paullinuxthemer/Prof-Gnome/archive/refs/heads/master.zip +[18]: https://www.debugpoint.com/wp-content/uploads/2022/05/Prof-GNOME-Theme.jpg +[19]: https://github.com/vinceliuice/WhiteSur-gtk-theme +[20]: https://github.com/vinceliuice/WhiteSur-gtk-theme +[21]: https://www.debugpoint.com/wp-content/uploads/2022/05/Whitesur-theme-for-GNOME.jpg +[22]: https://www.gnome-look.org/p/1099856/#files +[23]: https://www.debugpoint.com/wp-content/uploads/2022/05/Ant-Theme-for-GNOME.jpg diff --git a/sources/tech/20220529 Compile GNOME Shell and Apps From Source [Beginner-s Guide].md b/sources/tech/20220529 Compile GNOME Shell and Apps From Source [Beginner-s Guide].md new file mode 100644 index 0000000000..6d8cf31684 --- /dev/null +++ b/sources/tech/20220529 Compile GNOME Shell and Apps From Source [Beginner-s Guide].md @@ -0,0 +1,168 @@ +[#]: subject: "Compile GNOME Shell and Apps From Source [Beginner’s Guide]" +[#]: via: "https://www.debugpoint.com/2022/05/compile-gnome-source/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Compile GNOME Shell and Apps From Source [Beginner’s Guide] +====== +Here’s a quick guide for you on how to compile GNOME from its source, including the shell, mutter and some native apps. + +Before you compile, you need to make sure certain things because the following compilation is directly from the master branch in GitLab, which contains some development packages. + +In general, you can compile in any Linux distribution of your choice. But I would recommend using Fedora Rawhide which is the development branch of Fedora, for future releases. + +Also, do not try this in a stable system. Because things may go wrong, you may end up with a broken system. + +To summarize, you need the following to compile GNOME from the source. + +* A test setup ([Virtual machine][1] or a test system) +* Fedora Rawhide Distro (recommended. [Download from here][2]) +* Make sure your distro is up to date. +* And you are logged in to an X.Org session. + +I would not recommend compiling in the Wayland session because you will run into problems. + +### Compile GNOME from the Source + +The GNOME desktop is a collection of packages based on their functions. The desktop component of a Linux distribution works under a window manager and shell. + +So for GNOME, I will first compile mutter – the window manager for GNOME Shell. And then followed by the compilation of GNOME Shell. Finally, I will compile some native apps. + +I will use the meson build system for compilation. The meson is a beautiful build system which is fast and user friendly. + +#### Compile Mutter + +Open a terminal and install the required packages for GNOME Shell and mutter. + +``` +sudo dnf build-dep mutter gnome-shell +``` + +Create a demo directory in your home drive (or anywhere you want). + +``` +cd ~ +``` + +``` +mkdir demo +``` + +``` +cd demo +``` + +Clone the mutter master branch from GitLab. + +git clone https://gitlab.gnome.org/GNOME/mutter + +Go to the cloning directory and use the below meson command to prepare the build files. By default, meson uses `/usr/local` for building files. However, you can also use prefix switch to redirect the output to a specific folder (shown below). + +``` +cd mutter +``` + +``` +meson _build --prefix=/usr +``` + +![Compile Mutter for GNOME][3] + +Install mutter in your system when the build is complete using the below command. + +``` +sudo ninja install -C _build +``` + +#### Compile GNOME Shell + +The compilation of GNOME Shell and other packages are similar. First, clone the GNOME Shell master repository from GitLab, then build and install. You can follow the below commands in sequence. + +There are two dependencies which you need for GNOME Shell. They are [asciidoc][4] and [sassc][5]. Install them before you build GNOME Shell. + +``` +sudo dnf install asciidoc +``` + +``` +sudo dnf install sassc +``` + +After installing these dependencies, follow the below commands to build and install GNOME Shell. Make sure you go back to the `demo` folder (which I created in the first step) before running this command. + +``` +git clone https://gitlab.gnome.org/GNOME/gnome-shellcd gnome-shellmeson _build --prefix=/usrsudo ninja install -C _build +``` + +### Running the GNOME Shell + +After you finish compiling, you can try restarting the GNOME Shell to see the changes from the master branch. + +Before you restart, as I mentioned earlier, make sure you are in the X.Org session. Press `ALT+F2` and type `r`. Then press enter. This command will restart GNOME Shell. + +![Restart GNOME Shell (X11)][6] + +And congratulations! You have successfully compiled GNOME Shell and Mutter. + +Now, it’s time to compile some sample GNOME native applications. + +### Compile GNOME Native Applications + +The steps are the same for all sources of GNOME or any applications. You need to change the repo name. So, here are some sample commands to compile necessary GNOME native apps. + +#### Files (Nautilus) + +``` +git clone https://gitlab.gnome.org/GNOME/nautilus/cd gnome-shellmeson _build --prefix=/usrsudo ninja install -C _build +``` + +#### GNOME Software + +``` +git clone https://gitlab.gnome.org/GNOME/gnome-software/cd gnome-shellmeson _build --prefix=/usrsudo ninja install -C _build +``` + +#### GNOME Control Center + +``` +git clone https://gitlab.gnome.org/GNOME/gnome-control-center/cd gnome-shellmeson _build --prefix=/usrsudo ninja install -C _build +``` + +### FAQ + +1. Using the above steps, you can compile any source branch. Not only GNOME. +2. The GitLab server is sometimes slow, and it may take a longer time to clone a repo. If the `git clone` fails, I would recommend you to try again. + +### Closing Notes + +I hope this little advanced tutorial helps you try out new GNOME features before they land in GNOME nightly OS. Since you compiled, you may also contribute to testing new GNOME features and report any bugs or problems on the GitLab Issues page for specific packages. + +This article is the first instalment of the open-source app compilation series. Stay tuned for more compilation articles of more open-source apps. + +Also, do let me know your comments, suggestions, or any error you faced using these instructions in the comment box. + +Cheers. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/compile-gnome-source/ + +作者:[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/virtual-machine +[2]: https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Workstation/x86_64/iso/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/Compile-Mutter-for-GNOME.jpg +[4]: https://asciidoc.org/ +[5]: https://github.com/sass/sassc +[6]: https://www.debugpoint.com/wp-content/uploads/2022/05/Restart-GNOME-Shell-X11.jpg diff --git a/sources/tech/20220530 Using a Machine Learning Model to Make Predictions.md b/sources/tech/20220530 Using a Machine Learning Model to Make Predictions.md new file mode 100644 index 0000000000..c8e7fbf0be --- /dev/null +++ b/sources/tech/20220530 Using a Machine Learning Model to Make Predictions.md @@ -0,0 +1,89 @@ +[#]: subject: "Using a Machine Learning Model to Make Predictions" +[#]: via: "https://www.opensourceforu.com/2022/05/using-a-machine-learning-model-to-make-predictions/" +[#]: author: "Jishnu Saurav Mittapalli https://www.opensourceforu.com/author/jishnu-saurav-mittapalli/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Using a Machine Learning Model to Make Predictions +====== +Machine learning is basically a subset of artificial intelligence that uses previously existing data to make a prediction on new data. Of course, all of us know this by now! This article demonstrates how a machine learning model developed in Python can be used as a part of a Java code to make predictions. + +![Machine-learning][1] + +This article assumes you are familiar with the basic development skills and understanding of machine learning. We will start with training our model, and then make a machine learning model in Python. + +This article assumes you are familiar with the basic development skills and understanding of machine learning. We will start with training our model, and then make a machine learning model in Python. + +I am taking the example of a flood prediction model. First, import the following libraries: + +``` +import pandas as pd +import numpy as np +import matplotlib.pyplot as plt +``` + +Once we have successfully imported the libraries, we need to take in the data sets, as shown in the code below. To predict floods, I am using the river level data set. + +``` +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 +``` + +The upload widget is only available when the cell has been executed in the current browser session. Please rerun this cell to enable*Saving Hoppers Crossing-Hourly-River-Level.csv to Hoppers Crossing-Hourly-River-Level.csv User uploaded file “Hoppers Crossing-Hourly-River-Level.csv”* with length 2207036 bytes. + +Once this is done, we can train our model using the *sklearn library*. For this, we first need to import the library and the algorithm model, as shown in Figure 1. + +![Figure 1: Training the model][2] + +``` +from sklearn.linear_model import LinearRegression +regressor = LinearRegression() +regressor.fit(X_train, y_train) +``` + +Once that is done we have trained our model, and it’s now ready to make predictions, as shown in Figure 2. + +![Figure 2: Making predictions][3] + +### Using ML model in Java + +What we need to do now is to convert the ML model into a model that can be used by a Java program. There is a library called sklearn2pmml that helps us do this: + +``` +# Install the library +pip install sklearn2pmml +``` + +Once the library is installed we can convert our already trained model, as shown below: + +``` +sklearn2pmml(pipeline, ‘model.pmml’, with_repr = True) +``` + +This is it! We can now use the generated `model.pmml` file in our Java code to make predictions. Do try it out! + +(LCTT 译注:Java 中有第三方库 [jpmml/jpmml-evaluator][4],它能帮助你使用生成的 `model.pmml` 进行预测。) + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/using-a-machine-learning-model-to-make-predictions/ + +作者:[Jishnu Saurav Mittapalli][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/jishnu-saurav-mittapalli/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Machine-learning.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-1Training-the-model.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-2-Making-predictions.jpg +[4]: https://github.com/jpmml/jpmml-evaluator diff --git a/translated/news/20220524 Woah! Broadcom Could Acquire VMware for $60 Billion.md b/translated/news/20220524 Woah! Broadcom Could Acquire VMware for $60 Billion.md new file mode 100644 index 0000000000..7c1faf0c04 --- /dev/null +++ b/translated/news/20220524 Woah! Broadcom Could Acquire VMware for $60 Billion.md @@ -0,0 +1,63 @@ +[#]: subject: "Woah! Broadcom Could Acquire VMware for $60 Billion" +[#]: via: "https://news.itsfoss.com/broadcom-vmware-deal/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +震惊!博通或以 600 亿美元收购 VMware +====== +Broadcom’s interested to acquire VMware for $60 billion, making it one of the biggest tech deals in 2022. +博通有意以 600 亿美元收购 VMware,这或将成为 2022 年最大的科技交易之一。 + +![博通][1] + +博通Broadcom 是一家半导体芯片公司,其无线适配器/无线网卡和驱动程序的不兼容问题,使得它在桌面 Linux 用户中臭名昭著。 + +现在,它正计划通过收购业内最大的参与者之一,也就是 **VMware**,来进入云计算市场。 + +VMware 不是一家开源公司,但它为其虚拟化软件提供了一些开源工具和 Linux 支持。 + +据 **《华尔街日报》** [报道][2],博通和 VMware 可能会在本周四(5 月 26 日)的晚些时候宣布此次收购。(LCTT 译注:抱歉,我们来晚了……) + +### 博通进军云计算市场 + +当谈到无线网络芯片及其驱动程序时,[博通][3] 应该是一个 Linux 用户熟悉的名称。 + +现在,若能以 600 亿美元交易收购 [VMware][4],他们就可以借助 VMware 在云计算领域的影响力,来扩大自身在该行业的影响力。 + +因此,他们的决定也会影响有关博通收购的讨论。 + +可以肯定地说,如果讨论的意见不一,这笔交易就不一定能继续进行下去了。 + +为了能够成功支付(这笔巨款),该报告还提到博通计划接受银行提供的 400 亿美元的债务帮助。 + +考虑到该报告提到最终价格仍有待讨论,600 亿美元的价值可能会发生变化(但不会太大)。(LCTT 译注:最新的数字是 610 亿美元,该收购预计要到 2023 年才能完成。) + +### 说在最后 + +如果你有兴趣踏入股市,(这段时间)你可以关注一下 VMware 的股票和博通公司(的动态)。 + +你怎么看待博通收购 VMware 这件事呢?你认为它最后的结局会是戴尔成为公司的大股东吗?(LCTT 译注:这里的关系有点复杂,简单来说,VMware 曾经是 EMC 的子公司,后来戴尔收购了 EMC,再后来 VMware 独立。) + +有任何想法,都请在下面的评论中分享吧! + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/broadcom-vmware-deal/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/broadcom-vmware-acquisition.jpg +[2]: https://www.wsj.com/articles/broadcom-discussing-paying-around-140-a-share-for-vmware-people-say-11653334946 +[3]: https://www.broadcom.com/ +[4]: https://www.vmware.com/i diff --git a/translated/news/20220526 Plex Desktop Player is Now Available for Linux.md b/translated/news/20220526 Plex Desktop Player is Now Available for Linux.md new file mode 100644 index 0000000000..3abeea5a3b --- /dev/null +++ b/translated/news/20220526 Plex Desktop Player is Now Available for Linux.md @@ -0,0 +1,73 @@ +[#]: subject: "Plex Desktop Player is Now Available for Linux" +[#]: via: "https://news.itsfoss.com/plex-desktop-linux/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Plex 桌面播放器现已支持 Linux +====== +Plex.tv 终于在 Linux 上增加了它的桌面版本和全新的 HTPC 应用。不过,它目前只提供了 snap 包。 + +![plex][1] + +Plex 是一个流行的流媒体播放器,同时,它能够用作一个媒体服务器软件。 + +事实上,它也是 [Linux 上最好的媒体服务器软件][2] 之一。 + +是的,这个媒体服务器已经支持 Linux,而且还提供了一个 [包含安装步骤的教程][3]。 + +### Linux 上的 Plex 桌面播放器提供 Snap 包 + +我知道很多人都不喜欢使用 Snap 包来安装这个桌面播放器。但现在,这个桌面播放器已在 Snap 商店中提供,你可以轻松地在任何 Linux 发行版上安装它。 + +![][4] + +幸运的是,这个桌面播放器的 [公告][5] 还提到他们正在开发一个 **Flatpak 包**,它应该会在近期登陆 Flathub。 + +这样一来,借助 Flatpak 和 Snap 软件包,Plex 就可以成为在 Linux 上流式传输和组织个人媒体收藏的绝佳选择。 + +![][6] + +如果你感兴趣的话,HTPC 是 PMP TV(全称为 Plex Media Player TV)模式的继承者。 + +官网上发布了这款产品,以及它的 Linux 桌面应用程序 。 + +使用 HTPC,这个桌面应用就可以和电视共享,并支持音频直通、刷新率切换、控制器支持和可配置输入映射等高级功能。 + +![][7] + +因此,如果你有一个大屏幕,并且想要连接你的系统(不管是什么桌面平台)的话,你现在可以使用 HTPC 应用程序来完成。 + +[Plex 桌面版][8] + +[Plex HTPC][9] + +在 Linux 系统或联网电视上流式传输内容时,你通常会使用什么呢?你觉得 Plex 能满足你的需求吗?即然它支持 Linux 了,你会想要用它来替代当前使用的软件吗? + +欢迎在评论区告诉我们你的想法! + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/plex-desktop-linux/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/plex-ft.jpg +[2]: https://itsfoss.com/best-linux-media-server/ +[3]: https://itsfoss.com/install-plex-ubuntu/ +[4]: https://news.itsfoss.com/wp-content/uploads/2022/05/plex-desktop-ubuntu.jpg +[5]: https://www.plex.tv/blog/way-to-be-htpc/ +[6]: https://news.itsfoss.com/wp-content/uploads/2022/05/plex-snap-1024x524.jpg +[7]: https://news.itsfoss.com/wp-content/uploads/2022/05/plex-feat-1024x576.jpg +[8]: https://snapcraft.io/plex-desktop +[9]: https://snapcraft.io/plex-htpc diff --git a/translated/talk/20220221 6 Reasons to Try Nitrux OS.md b/translated/talk/20220221 6 Reasons to Try Nitrux OS.md deleted file mode 100644 index 8661ea731d..0000000000 --- a/translated/talk/20220221 6 Reasons to Try Nitrux OS.md +++ /dev/null @@ -1,143 +0,0 @@ -[#]: subject: "6 Reasons to Try Nitrux OS" -[#]: via: "https://news.itsfoss.com/reasons-to-try-nitrux-os/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "aREversez" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -6大理由,让你尝试 Nitrux 系统 -====== - -Nitrux 系统也许算不上 Linux 的主流发行版本之一,但它绝对是一款极其独特的产品。 - -2019 年,我们[采访了 Nitrux 的创始人 Uri Herrera][1],了解到 Herrera 等人开发这款系统的初衷:超越 Linux 传统的发行版本。 - -自那之后,过了许久,我们终于迎来了 [Nitrux 2.0 版本][2]。 - -不要忘了,Nitrux 在去年[放弃基于 Ubuntu 而选择 Debian][3]。 - -考虑到自 Nitrux 发行以来的数年间,也发生了许多大事,所以你应该尝试一下这款系统。 - -这里,我要分享一些体验 [Nitrux 系统][4]的理由: - -### 1\. Nitrux 不再基于 Ubuntu - -![][5] - -人们一般都会推荐基于 Ubuntu 的 Linux 发行版本,来满足日常所需。 - -当然,在我们[为新手推荐的 Linux 系统][6]中,也包括了许多基于 Ubuntu 的版本,但是请不要误会。 - -我们之所以推荐基于 Ubuntu 的发行版本,唯一的理由在于它们简单易用,支持大量的商业软件。 - -所以,如果你不是刚开始使用 Linux 系统,同时也想尝试既能让你耳目一新,又不至于使你感到陌生,而且十分稳定的发行版,基于 Debian 的 Nirtux 是一个不错的选择。 - -你完全不需要在短期内迅速了解这款系统,就可以得心应手地使用终端来完成各项工作。 - -感兴趣的话,可以参考我们的文章 [Debian vs Ubuntu][7],了解更多. - -### 2\. 专注 AppImages - -![][5] - -[AppImage][8] 是通用的软件包系统,没有任何依赖。你不需要在 Linux 上安装任何软件包管理器或者依赖包,就可以直接运行 AppImage 应用。 - -AppImage 旨在打造便携、高效的软件包系统,省去安装的步骤,与 Windows 系统的便携版软件非常相似。 - -Nitrux 操作系统专注 AppImage 应用软件,为你带来流畅的用户体验。 - -NX 软件中心是一个 GUI 程序,用户可以通过使用 Mauikit(该软件中心的 UI 框架),安装、管理 AppImage 应用程序。 - -### 3\. 基于 KDE 桌面环境的发行版本 - -![][5] - -Nitrux 操作系统是[搭载 KDE 桌面环境中最好的 Linux 发行版本][9]之一。 如果你不喜欢 GNOME 或者其他开箱即用的桌面环境,KDE 会是一个不错的选择。 - -也许你还不知道, 相较于其他桌面环境,[KDE 支持自定义配置][10]。 - -因此,在 KED 桌面环境下,你可以毫不费力地打造自己的个性化桌面。 - -### 4\. 独特的用户体验 - -![][11] - -Nitrux 的用户体验设计包括了最好的 KDE 桌面环境与 Qt 技术及其调整工具,为你带来全新的用户体验。 - -虽然在使用 Nitrux 操作系统时,你不会觉得十分陌生,但是还是会感到有些许的不同。 - -即使你没有对 Nitrux 系统做任何自定义的设置,开箱即用的体验也足以让它成为[最优雅的发行版][12]之一。 - -### 5\. Maui Shell - -![][11] - -[Maui Shell][13] 是 Nitrux 用户体验的亮点之一。近来,Maui Shell 得到了进一步的完善,将同时支持桌面端和移动端。 - -尽管 Maui Shell 目前还不成熟,但是外观看起来十分大气简约,就像 [System76 将要推出基于 Rust 的桌面环境][14]一样令人兴奋。 - -这也是我们推荐尝试 Nitrux 系统最重要的原因之一。时间会证明,Nitrux 系统是否将会开启桌面体验的全新时代。 - -### 6\. Xanmod 内核 - -![][5] - -[Xanmod 内核][15] 是主流 Linux 内核的定制版本,对性能进行了适当的调整,附加了一些其他功能。有了它,你的桌面体验一定能得到大幅提升。 - -自 2.0 版本起,Nitrux 操作系统选用 Xanmod 作为默认内核,为用户提供“升级版”的桌面体验。 - -当然你也可以选择其他 Linux 内核,比如 Liquorix 和 Libre,它们都有着各自的优点。 - -如果你不喜欢 Xanmod,也可以选择主流长期支持版的内核。所以说,在 Nitrux 操作系统上,你完全可以修改使用不同的内核。 - -[Nitrux OS][4] - -### 总结 - -诚然,从主流发行版转到像 Nitrux 这样的操作系统,需要考虑各种风险。 - -但是,**我建议你好好考虑一番:** - -Nitrux 等发行版本在每一次版本升级中,都会尽全力去完善各项功能。 - -尽管背后没有强大的企业和财力支撑,他们依然可以开发出这款令人惊艳的发行版本、进阶版的 [Maui 项目][16],以及别开生面的 Maui shell. - -所以,我认为,我们也应该以己所能,尽己之力,支持这些优秀的发行版。 - -不过话说回来,每一款 Linux 发行版都会或多或少地存在一些问题。当你试用一款新的发行版本时,你需要给它点儿时间,在最终将它作为日常使用的操作系统之前,慢慢地去适应它。 - -换言之,我推荐你在业余时间试用 Nitrux 操作系统,或者直接装个虚拟机来一探究竟。 - -_我很关注大家对这篇文章的看法,请在下方评论留言_ - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/reasons-to-try-nitrux-os/ - -作者:[Ankush Das][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://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/nitrux-linux/ -[2]: https://news.itsfoss.com/nitrux-2-0-release/ -[3]: https://news.itsfoss.com/nitrux-linux-debian/ -[4]: https://nxos.org/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: https://itsfoss.com/best-linux-beginners/ -[7]: https://itsfoss.com/debian-vs-ubuntu/ -[8]: https://itsfoss.com/use-appimage-linux/ -[9]: https://itsfoss.com/best-kde-distributions/ -[10]: https://itsfoss.com/kde-customization/ -[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[12]: https://itsfoss.com/beautiful-linux-distributions/ -[13]: https://news.itsfoss.com/maui-shell-unveiled/ -[14]: https://news.itsfoss.com/system76-cosmic-panel/ -[15]: https://xanmod.org/ -[16]: https://mauikit.org diff --git a/translated/tech/20180625 3 ways to copy files in Go.md b/translated/tech/20180625 3 ways to copy files in Go.md new file mode 100644 index 0000000000..b362d05e2f --- /dev/null +++ b/translated/tech/20180625 3 ways to copy files in Go.md @@ -0,0 +1,217 @@ +[#]: subject: "3 ways to copy files in Go" +[#]: via: "https://opensource.com/article/18/6/copying-files-go" +[#]: author: "Mihalis Tsoukalos https://opensource.com/users/mtsouk" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +在 Go 中复制文件的三种方法 +====== +本文是 Go 系列的第三篇文章,我将介绍三种最流行的复制文件的方法。 + +![][1] + +图源:Opensource.com + +本文将介绍展示如何使用 [Go 编程语言][3] 来复制文件。在 Go 中复制文件的方法有很多,我只介绍三种最常见的:使用 Go 库中的 `io.Copy()` 函数调用、一次读取输入文件并将其写入另一个文件,以及使用缓冲区一块块地复制文件。 + +### 方法一:使用 io.Copy() + +第一种方法就是使用 Go 标准库的 `io.Copy()` 函数。你可以在 `copy()` 函数的代码中找到它的实现逻辑,如下所示: + +``` +func copy(src, dst string) (int64, error) { + sourceFileStat, err := os.Stat(src) + if err != nil { + return 0, err + } + + if !sourceFileStat.Mode().IsRegular() { + return 0, fmt.Errorf("%s is not a regular file", src) + } + + source, err := os.Open(src) + if err != nil { + return 0, err + } + defer source.Close() + + destination, err := os.Create(dst) + if err != nil { + return 0, err + } + defer destination.Close() + nBytes, err := io.Copy(destination, source) + return nBytes, err + } +``` + +首先,上述代码做了两个判断,以便确定它可以被打开读取:一是判断将要复制的文件是否存在(`os.Stat(src)`),二是判断它是否为常规文件(`sourceFileStat.Mode().IsRegular()`)。剩下的所有工作都由 `io.Copy(destination, source)` 这行代码来完成。`io.Copy()` 函数执行结束后,会返回复制的字节数和复制过程中发生的第一条错误消息。在 Go 中,如果没有错误消息,错误变量的值就为 `nil`。 + +你可以在 [io 包][4] 的文档页面了解有关 `io.Copy()` 函数的更多信息。 + +运行 `cp1.go` 将产生以下输出: + +``` +$ go run cp1.go +Please provide two command line arguments! +$ go run cp1.go fileCP.txt /tmp/fileCPCOPY +Copied 3826 bytes! +$ diff fileCP.txt /tmp/fileCPCOPY +``` + +这个方法已经非常简单了,不过它没有为开发者提供灵活性。这并不总是一件坏事,但是,有些时候,开发者可能会需要/想要告诉程序该如何读取文件。 + +### 方法二:使用 ioutil.WriteFile() 和 ioutil.ReadFile() + +复制文件的第二种方法是使用 `ioutil.ReadFile()` 和 `ioutil.WriteFile()` 函数。第一个函数用于将整个文件的内容,一次性地读入到某个内存中的字节切片里;第二个函数则用于将字节切片的内容写入到一个磁盘文件中。 + +实现代码如下: + +``` +input, err := ioutil.ReadFile(sourceFile) +if err != nil { + fmt.Println(err) + return +} + +err = ioutil.WriteFile(destinationFile, input, 0644) +if err != nil { + fmt.Println("Error creating", destinationFile) + fmt.Println(err) + return +} +``` + +上述代码包括了两个 if 代码块(嗯,用 Go 写程序就是这样的),程序的实际功能其实体现在 `ioutil.ReadFile()` 和 `ioutil.WriteFile()` 这两行代码中。 + +运行 `cp2.go`,你会得到下面的输出: + +``` +$ go run cp2.go +Please provide two command line arguments! +$ go run cp2.go fileCP.txt /tmp/copyFileCP +$ diff fileCP.txt /tmp/copyFileCP +``` + +请注意,虽然这种方法能够实现文件复制,但它在复制大文件时的效率可能不高。这是因为当文件很大时,`ioutil.ReadFile()` 返回的字节切片会很大。 + +### 方法三:使用 os.Read() 和 os.Write() + +在 Go 中复制文件的第三种方法就是下面要介绍的 `cp3.go`。它接受三个参数:输入文件名、输出文件名和缓冲区大小。 + +`cp3.go` 最重要的部分位于以下 `for` 循环中,你可以在 `copy()` 函数中找到它,如下所示: + +``` +buf := make([]byte, BUFFERSIZE) +for { + n, err := source.Read(buf) + if err != nil && err != io.EOF { + return err + } + if n == 0 { + break + } + + if _, err := destination.Write(buf[:n]); err != nil { + return err + } +} +``` + +该方法使用 `os.Read()` 将输入文件的一小部分读入名为 `buf` 的缓冲区,然后使用 `os.Write()` 将该缓冲区的内容写入文件。当读取出错或到达文件末尾(`io.EOF`)时,复制过程将停止。 + +运行 `cp3.go`,你会得到下面的输出: + +``` +$ go run cp3.go +usage: cp3 source destination BUFFERSIZE +$ go run cp3.go fileCP.txt /tmp/buf10 10 +Copying fileCP.txt to /tmp/buf10 +$ go run cp3.go fileCP.txt /tmp/buf20 20 +Copying fileCP.txt to /tmp/buf20 +``` + +在接下来的基准测试中,你会发现,缓冲区的大小极大地影响了 `cp3.go` 的性能。 + +### 运行基准测试 + +在本文的最后一部分,我将尝试比较这三个程序以及 `cp3.go` 在不同缓冲区大小下的性能(使用 `time(1)` 命令行工具)。 + +以下输出显示了复制 500MB 大小的文件时,`cp1.go`、`cp2.go` 和 `cp3.go` 的性能对比: + +``` +$ ls -l INPUT +-rw-r--r--  1 mtsouk  staff  512000000 Jun  5 09:39 INPUT +$ time go run cp1.go INPUT /tmp/cp1 +Copied 512000000 bytes! + +real    0m0.980s +user    0m0.219s +sys     0m0.719s +$ time go run cp2.go INPUT /tmp/cp2 + +real    0m1.139s +user    0m0.196s +sys     0m0.654s +$ time go run cp3.go INPUT /tmp/cp3 1000000 +Copying INPUT to /tmp/cp3 + +real    0m1.025s +user    0m0.195s +sys     0m0.486s +``` + +我们可以看出,这三个程序的性能非常接近,这意味着 Go 标准库函数的实现非常聪明、经过了充分优化。 + +现在,让我们测试一下缓冲区大小对 `cp3.go` 的性能有什么影响吧!执行 `cp3.go`,并分别指定缓冲区大小为 10、20 和 1000 字节,在一台运行很快的机器上复制 500MB 文件,得到的结果如下: + +``` +$ ls -l INPUT +-rw-r--r--  1 mtsouk  staff  512000000 Jun  5 09:39 INPUT +$ time go run cp3.go INPUT /tmp/buf10 10 +Copying INPUT to /tmp/buf10 + +real    6m39.721s +user    1m18.457s +sys 5m19.186s +$ time go run cp3.go INPUT /tmp/buf20 20 +Copying INPUT to /tmp/buf20 + +real    3m20.819s +user    0m39.444s +sys 2m40.380s +$ time go run cp3.go INPUT /tmp/buf1000 1000 +Copying INPUT to /tmp/buf1000 + +real    0m4.916s +user    0m1.001s +sys     0m3.986s +``` + +我们可以发现,缓冲区越大,`cp3.go` 运行得就越快,这或多或少是符合预期的。此外,使用小于 20 字节的缓冲区来复制大文件会非常缓慢,应该避免。 + +你可以在 [GitHub][5] 找到 `cp1.go`、`cp2.go` 和 `cp3.go` 的 Go 代码。 + +如果你有任何问题或反馈,请在(原文)下方发表评论或在 [Twitter][6] 上与我(原作者)联系。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/6/copying-files-go + +作者:[Mihalis Tsoukalos][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/mtsouk +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/LIFE_cat.png +[3]: https://golang.org/ +[4]: https://golang.org/pkg/io/ +[5]: https://github.com/mactsouk/opensource.com +[6]: https://twitter.com/mactsouk diff --git a/translated/tech/20180712 An introduction to Go arrays and slices.md b/translated/tech/20180712 An introduction to Go arrays and slices.md new file mode 100644 index 0000000000..40e3f9a3b6 --- /dev/null +++ b/translated/tech/20180712 An introduction to Go arrays and slices.md @@ -0,0 +1,216 @@ +[#]: subject: "An introduction to Go arrays and slices" +[#]: via: "https://opensource.com/article/18/7/introduction-go-arrays-and-slices" +[#]: author: "Mihalis Tsoukalos https://opensource.com/users/mtsouk" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Go 数组和切片的介绍 +====== +了解使用数组和切片在 Go 中存储数据的优缺点,以及为什么其中一个比另一个更好。 + +![][1] + +图源:carrotmadman6,经 Opensource.com 修改,CC BY-SA 2.0 + +在本系列的第四篇文章中,我将解释 [Go][5] 数组和切片,包括如何使用它们,以及为什么你通常要选择其中一个而不是另一个。 + +### 数组 + +数组是编程语言中最流行的数据结构之一,主要原因有两个:一是简单易懂,二是可以存储许多不同类型的数据。 + +你可以声明一个名为 `anArray` 的 Go 数组,该数组存储四个整数,如下所示: + +``` +anArray := [4]int{-1, 2, 0, -4} +``` +数组的大小应该在它的类型之前声明,而类型应该在声明元素之前定义。`len()` 函数可以帮助你得到任何数组的长度。上面数组的大小是 4。 + +如果你熟悉其他编程语言,你可能会尝试使用 `for` 循环来遍历数组。Go 当然也支持 `for` 循环,不过,正如你将在下面看到的,Go 的 `range` 关键字可以让你更优雅地遍历数组或切片。 + +最后,你也可以定义一个二维数组,如下: + +``` +twoD := [3][3]int{ + {1, 2, 3}, + {6, 7, 8}, + {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 数组的示例代码。其中最重要的部分是: + +``` +for i := 0; i < len(twoD); i++ { + k := twoD[i] + for j := 0; j < len(k); j++ { + fmt.Print(k[j], " ") + } + fmt.Println() +} + +for _, a := range twoD { + for _, j := range a { + fmt.Print(j, " ") + } + fmt.Println() +} +``` + +通过上述代码,我们知道了如何使用 `for` 循环和 `range` 关键字迭代数组的元素。`arrays.go` 的其余代码则展示了如何将数组作为参数传递给函数。 + +以下是 `arrays.go` 的输出: + +``` +$ go run arrays.go +Before change(): [-1 2 0 -4] +After change(): [-1 2 0 -4] +1 2 3 +6 7 8 +10 11 12 +1 2 3 +6 7 8 +10 11 12 +``` + +这个输出告诉我们:对函数内的数组所做的更改,会在函数退出后丢失。 + +### 数组的缺点 + +Go 数组有很多缺点,你应该重新考虑是否要在 Go 项目中使用它们。 + +首先,数组定义之后,大小就无法改变,这意味着 Go 数组不是动态的。简而言之,如果你需要将一个元素添加到一个没有剩余空间的数组中,你将需要创建一个更大的数组,并将旧数组的所有元素复制到新数组中。 + +其次,当你将数组作为参数传递给函数时,实际上是传递了数组的副本,这意味着你对函数内部的数组所做的任何更改,都将在函数退出后丢失。 + +最后,将大数组传递给函数可能会很慢,主要是因为 Go 必须创建数组的副本。 + +以上这些问题的解决方案,就是使用 Go 切片。 + +### 切片 + +Go 切片与 Go 数组类似,但是它没有后者的缺点。 + +首先,你可以使用 `append()` 函数将元素添加到现有切片中。此外,Go 切片在内部使用数组实现,这意味着 Go 中每个切片都有一个底层数组。 + +切片具有 `capacity` 属性和 `length` 属性,它们并不总是相同的。切片的长度与元素个数相同的数组的长度相同,可以使用 `len()` 函数得到。切片的容量是当前为切片分配的空间,可以使用 `cap()` 函数得到。 + +由于切片的大小是动态的,如果切片空间不足(也就是说,当你尝试再向切片中添加一个元素时,底层数组的长度恰好与容量相等),Go 会自动将它的当前容量加倍,使其空间能够容纳更多元素,然后将请求的元素添加到底层数组中。 + +此外,切片是通过引用传递给函数的,这意味着实际传递给函数的是切片变量的内存地址,这样一来,你对函数内部的切片所做的任何修改,都不会在函数退出后丢失。因此,将大切片传递给函数,要比将具有相同数量元素的数组传递给同一函数快得多。这是因为 Go 不必拷贝切片 —— 它只需传递切片变量的内存地址。 + +Go slices are illustrated in `slice.go`, which contains the following code: +`slice.go` 源文件中有 Go 切片的代码示例,其中包含以下代码: + +``` +package main + +import ( + "fmt" +) + +func negative(x []int) { + for i, k := range x { + x[i] = -k + } +} + +func printSlice(x []int) { + for _, number := range x { + fmt.Printf("%d ", number) + } + fmt.Println() +} + +func main() { + s := []int{0, 14, 5, 0, 7, 19} + printSlice(s) + negative(s) + printSlice(s) + + fmt.Printf("Before. Cap: %d, length: %d\n", cap(s), len(s)) + s = append(s, -100) + fmt.Printf("After. Cap: %d, length: %d\n", cap(s), len(s)) + printSlice(s) + + anotherSlice := make([]int, 4) + fmt.Printf("A new slice with 4 elements: ") + printSlice(anotherSlice) +} +``` + +切片和数组在定义方式上的最大区别就在于:你不需要指定切片的大小。实际上,切片的大小取决于你要放入其中的元素数量。此外,`append()` 函数允许你将元素添加到现有切片 —— 请注意,即使切片的容量允许你将元素添加到该切片,它的长度也不会被修改,除非你调用 `append ()`。上述代码中的 `printSlice()` 函数是一个辅助函数,用于打印切片中的所有元素,而 `negative()` 函数将切片中的每个元素都变为各自的相反数。 + +运行 `slice.go` 将得到以下输出: + +``` +$ go run slice.go +0 14 5 0 7 19 +0 -14 -5 0 -7 -19 +Before. Cap: 6, length: 6 +After. Cap: 12, length: 7 +0 -14 -5 0 -7 -19 -100 +A new slice with 4 elements: 0 0 0 0 +``` + +请注意,当你创建一个新切片,并为给定数量的元素分配内存空间时,Go 会自动地将所有元素都初始化为其类型的零值,在本例中为 0(`int` 类型的零值)。 + +### 使用切片来引用数组 + +Go 允许你使用 `[:]` 语法,使用切片来引用现有的数组。在这种情况下,你对切片所做的任何更改都将传播到数组中 —— 详见 `refArray.go`。请记住,使用 `[:]` 不会创建数组的副本,它只是对数组的引用。 + +`refArray.go` 中最有趣的部分是: + +``` +func main() { + anArray := [5]int{-1, 2, -3, 4, -5} + refAnArray := anArray[:] + + fmt.Println("Array:", anArray) + printSlice(refAnArray) + negative(refAnArray) + fmt.Println("Array:", anArray) +} +``` + +运行 `refArray.go`,输出如下: + +``` +$ go run refArray.go +Array: [-1 2 -3 4 -5] +-1 2 -3 4 -5 +Array: [1 -2 3 -4 5] +``` + +我们可以发现:对 `anArray` 数组的切片引用进行了操作后,它本身也被改变了。 + +### 总结 + +尽管 Go 提供了数组和切片两种类型,你很可能还是会使用切片,因为它们比 Go 数组更加通用、强大。只有少数情况需要使用数组而不是切片,特别是当你完全确定元素的数量固定不变时。 + +你可以在 [GitHub][6] 上找到 `arrays.go`、`slice.go` 和 `refArray.go` 的源代码。 + +如果您有任何问题或反馈,请在下方发表评论或在 [Twitter][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) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mtsouk +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/traffic-light-go.png +[2]: https://opensource.com/article/18/5/creating-random-secure-passwords-go +[3]: https://opensource.com/article/18/5/building-concurrent-tcp-server-go +[4]: https://opensource.com/article/18/6/copying-files-go +[5]: https://golang.org/ +[6]: https://github.com/mactsouk/opensource.com +[7]: https://twitter.com/mactsouk diff --git a/translated/tech/20210115 Learn awk by coding a -guess the number- game.md b/translated/tech/20210115 Learn awk by coding a -guess the number- game.md new file mode 100644 index 0000000000..30040b9347 --- /dev/null +++ b/translated/tech/20210115 Learn awk by coding a -guess the number- game.md @@ -0,0 +1,199 @@ +[#]: collector: (lujun9972) +[#]: translator: (FYJNEVERFOLLOWS ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: 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 编写一个“猜数”程序来展示熟悉的概念。 + +![question mark in chalk][1] + +当你学习一门新的编程语言时,最好把重点放在大多数编程语言都有的共同点上: + * 变量 —— 存储信息的地方 + * 表达式 —— 计算的方法 + * 语句 —— 在程序中表示状态变化的方法 + + +这些概念是大多是编程语言的基础。 + +一旦你理解了这些概念,你就可以开始把其他的弄清楚。例如,大多数语言都有得到其设计支持的“处理方式”,这些方式在不同语言之间可能有很大的不同。这些方法包括模块化(将相关功能分组在一起)、声明性与命令性、面向对象、低级与高级语法特性等等。许多程序员熟悉的一个例子是“仪式”,即,在处理问题之前设置场景所需的工作量。据说 Java 编程语言有一个重要的仪式要求,这源于它的设计,要求所有代码都在一个类中定义。 + +但是回到最基本的,编程语言通常有相似之处。一旦你掌握了一种编程语言,就从学习另一种语言的基本知识开始,去品味这种新语言的不同之处。 + +继续进行的一个好方法是创建一组基本的测试程序。有了这些,就可以从这些相似之处开始学习。 + +你可以选择创建的一个测试程序是“猜数字”程序。电脑从 1 到 100 之间选择一个数字,让你猜这个数字。程序一直循环,直到你猜对为止。 + +“猜数字”程序练习了编程语言中的几个概念: + * 变量 + * 输入 + * 输出 + * 条件判断 + * 循环 + + +这是学习一门新的编程语言的一个很好的实践实验。 + + +**注**:本文改编自 Moshe Zadka 关于在 [Julia][2] 中使用这种方法的文章和Jim Hall关于在 [Bash][3] 中使用这种方法的文章。 + +### 在 awk 程序中猜数 +让我们编写一个实现“猜数字”游戏的 awk 程序。 + +Awk 是动态类型的,是一种面向数据转换的脚本语言,并且对交互使用有着令人惊讶的良好支持。Awk 出现于 20 世纪 70 年代,最初是 Unix 操作系统的一部分。如果你不了解 Awk,但是喜欢电子表格,可以看一下这个链接 [去学习 Awk][4]! + +您可以通过编写一个版本的“猜数字”游戏来开始对 Awk 的探索。 + +以下是我的实现(带有行号,以便我们可以查看一些特定功能): + + +``` +     1    BEGIN { +     2        srand(42) +     3        randomNumber = int(rand() * 100) + 1 +     4        print "random number is",randomNumber +     5        printf "guess a number between 1 and 100\n" +     6    } +     7    { +     8        guess = int($0) +     9        if (guess < randomNumber) { +    10            printf "too low, try again:" +    11        } else if (guess > randomNumber) { +    12            printf "too high, try again:" +    13        } else { +    14            printf "that's right\n" +    15            exit +    16        } +    17    } +``` +我们可以立即看到 Awk 控制结构与 C 或 Java 的相似之处,但与 Python 不同。 +在像 *if-then-else*、*while* 这样的语句中,*then*、*else* 和 *while* 部分接受一个语句或一组被 **{** 和 **}** 包围的语句。然而,Awk 有一个很大的区别需要从一开始就了解: + +根据设计,Awk 是围绕数据管道构建的。 + +这是什么意思呢?大多数 Awk 程序都是一些代码片段,它们接收一行输入,对数据做一些处理,然后将其写入输出。认识到这种转换管道的需要,Awk 默认情况下提供了所有的转换管道。让我们通过关于上面程序的一个基本问题来探索:“从控制台读取数据”的结构在哪里? + +答案是——“内置的”。特别的,第 7-17 行告诉 Awk 如何处理被读取的每一行。在这种情况下,很容易看到第 1-6 行在读取任何内容之前被执行。 + +更具体地说,第 1 行上的 **BEGIN** 关键字是一种“模式”,在本例中,它指示 Awk 在读取任何数据之前,应该先执行 { … } 中 **BEGIN** 后面的内容。另一个类似的关键字 **END**,在这个程序中没有被使用,它指示 Awk 在读取完所有内容后要做什么。 + +回到第 7-17 行,我们看到它们创建了一个类似代码块 { … } 的片段,但前面没有关键字。因为在 **{** 之前没有任何东西可以让 Awk 匹配,所以它将把这一行用于接收每一行输入。每一行的输入都将由用户输入作为猜测。 + +让我们看看正在执行的代码。首先,在读取任何输入之前发生的序言。 + +在第 2 行,我们用数字 42 初始化随机数生成器(如果不提供参数,则使用系统时钟)。为什么要用 42?[当然要选 42!][5] 第 3 行计算 1 到 100 之间的随机数,第 4 行输出该随机数以供调试使用。第 5 行邀请用户猜一个数字。注意这一行使用的是 `printf`,而不是 `print`。和 C 语言一样,`printf` 的第一个参数是一个用于格式化输出的模板。 + +既然用户知道程序需要输入,她就可以在控制台上键入猜测。如前所述,Awk 将这种猜测提供给第 7-17 行的代码。第 18 行将输入记录转换为整数;`$0` 表示整个输入记录,而 `$1` 表示输入记录的第一个字段,`$2` 表示第二个字段,以此类推。是的,Awk 使用预定义的分隔符(默认为空格)将输入行分割为组成字段。第 9-15 行将猜测结果与随机数进行比较,打印适当的响应。如果猜对了,第 15 行就会从输入行处理管道中提前退出。 + +就这么简单! + +考虑到 Awk 程序不同寻常的结构,代码片段会对特定的输入行配置做出反应,并处理数据,让我们看看另一种结构,看看过滤部分是如何工作的: + + +``` +     1    BEGIN { +     2        srand(42) +     3        randomNumber = int(rand() * 100) + 1 +     4        print "random number is",randomNumber +     5        printf "guess a number between 1 and 100\n" +     6    } +     7    int($0) < randomNumber { +     8        printf "too low, try again: " +     9    } +    10    int($0) > randomNumber { +    11        printf "too high, try again: " +    12    } +    13    int($0) == randomNumber { +    14        printf "that's right\n" +    15        exit +    16    } +``` + +第 1–6 行代码没有改变。但是现在我们看到第 7-9 行是当输入整数值小于随机数时执行的代码,第 10-12 行是当输入整数值大于随机数时执行的代码,第 13-16 行是两者相等时执行的代码。 + +这看起来“很酷但很奇怪” —— 例如,为什么我们会重复计算 `int($0)`?可以肯定的是,用这种方法来解决问题会很奇怪。但这些模式确实是分离条件处理的非常好的方式,因为它们可以使用正则表达式或 Awk 支持的任何其他结构。 + +为了完整起见,我们可以使用这些模式将普通的计算与只适用于特定环境的计算分离开来。下面是第三个版本: + + +``` +     1    BEGIN { +     2        srand(42) +     3        randomNumber = int(rand() * 100) + 1 +     4        print "random number is",randomNumber +     5        printf "guess a number between 1 and 100\n" +     6    } +     7    { +     8        guess = int($0) +     9    } +    10    guess < randomNumber { +    11        printf "too low, try again: " +    12    } +    13    guess > randomNumber { +    14        printf "too high, try again: " +    15    } +    16    guess == randomNumber { +    17        printf "that's right\n" +    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 能够长期存在的一个原因是 Awk 程序是紧凑的,而它们紧凑的一个原因是不需要从控制台或文件中读取样板文件。 + +让我们运行下面这个程序: + + +``` +$ awk -f guess.awk +random number is 25 +guess a number between 1 and 100: 50 +too high, try again: 30 +too high, try again: 10 +too low, try again: 25 +that's right +$ +``` + +我们没有涉及的一件事是注释。Awk 注释以“#”开头,以行尾结束。 + +### 总结 + +Awk 非常强大,这种“猜数字”游戏是入门的好方法。但这不应该是你探索 Awk 的终点。你可以 [阅读关于 Awk 和 Gawk (GNU Awk) 的历史][6],Gawk是 Awk 的扩展版本,如果你在电脑上运行Linux,可能会有这个。或者,你可以 [阅读所有关于它最初开发者的原始版本][7]。 + +你还可以 [下载我们的备忘单][8] 来帮你记录下你所学的一切。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/learn-awk + +作者:[Chris Hermansen][a] +选题:[lujun9972][b] +译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/question-mark_chalkboard.jpg?itok=DaG4tje9 (question mark in chalk) +[2]: https://opensource.com/article/20/12/julia +[3]: https://opensource.com/article/20/12/learn-bash +[4]: https://opensource.com/article/20/9/awk-ebook +[5]: https://en.wikipedia.org/wiki/42_(number)#The_Hitchhiker's_Guide_to_the_Galaxy +[6]: https://www.gnu.org/software/gawk/manual/html_node/History.html +[7]: https://archive.org/details/pdfy-MgN0H1joIoDVoIC7 +[8]: https://opensource.com/downloads/cheat-sheet-awk-features diff --git a/translated/tech/20220303 9 resources to help you contribute to open source in 2022.md b/translated/tech/20220303 9 resources to help you contribute to open source in 2022.md deleted file mode 100644 index 65d1118a87..0000000000 --- a/translated/tech/20220303 9 resources to help you contribute to open source in 2022.md +++ /dev/null @@ -1,75 +0,0 @@ -[#]: subject: "9 resources to help you contribute to open source in 2022" -[#]: via: "https://opensource.com/article/22/3/contribute-open-source-2022" -[#]: author: "Opensource.com https://opensource.com/users/admin" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -9 种资源帮助你在 2022 年为开源做出贡献 -====== -你准备好推进你的开源之旅了吗?这里有一些如何给开源做贡献的提示和教程。参加投票,以分享你参与开源有多久了。 -![Working from home at a laptop][1] - -在 2022 年,开源正变得越来越家喻户晓。但多年来,开源一直被认为是企业 IT 环境中斗志旺盛的弱者。开源已经以某种形式或方式存在了[几十年][2],但甚至直到 20 世纪 90 年代末,它才以其[名称][3]正式出现。你可能一直都在使用开源技术,但却不知道。事实上,你目前正在阅读的网站就是在开源的内容管理系统 [Drupal][4] 上运行。你的汽车、笔记本电脑、智能手表和电子游戏很可能[由 Linux][5],一个开源操作系统支持。 - -红帽公司的年度[企业开源状况][6]最近发布,其中包含了大量的见解,对任何在开源技术领域发展的人都有帮助。首先,77% 的 IT 领导对企业开源的看法比一年前更积极,82% 的 IT 领导更可能选择对开源社区有贡献的供应商。这意味着,参与开源比以往任何时候都更重要。现在是推进你的开源之旅的时候了,无论你在哪里。这里有一些资源可以帮助你走这条路。 - -### 为什么要为开源做贡献? - - * [是什么激励了开源软件的贡献者?][7] 新的研究发现人们贡献的原因自 21 世纪初以来已经改变。 - * [现在为开源做贡献的 3 个理由][8]。现在,比以往任何时候都更加是为开源做贡献的理想时机。以下是原因。 - * [为开放源码做贡献时的 7 个成功策略][9]。一位作者在为开源项目做贡献的经验帮助她在技术领域找到了她梦想的工作。 - - - -### 为开源做出你的第一次贡献 - - * [8 种非编码方式为开源做贡献][10]。无论你是程序员新手,还是经验丰富的老手,或者根本不是工程师,在编码之外还有很多方式为开源项目做贡献。 - * [为 Slack 的开源替代方案做贡献的 6 种方式][11]。加入成千上万为 Mattermost 这个开源消息平台贡献代码、翻译、文档等的人。 - * [任何人都可以为开放实践图书馆做出贡献的 7 种方式][12]。为开放实践图书馆做出贡献是参与全球从业者社区的一种有趣方式,这些从业者都愿意分享他们的知识并改进他们自己的工作方式。 - * [如果你有一份全职工作,如何为 Kubernetes 做贡献][13]。你可以在业余时间从事最大的开源项目之一的内部工作。 - - - -### 鼓励他人为开源做贡献 - - * [为什么你的开源项目需要的不仅仅是程序员][14]。仅仅是开发人员并不能创造出满足各种需求的长保质期的开源项目,是时候欢迎更多的角色和人才了。 - * [开源贡献者加入的 10 条提示][15]。让新的贡献者感到自己在社区中受到欢迎,对项目的未来至关重要,因此,在加入时投入时间和注意力是很重要的。 - - - -### 分享你对开源贡献的建议 - -当涉及到参与开源社区时,有无限的可能性。在 Opensource.com,我们的目标是庆祝社区的不同观点和背景,其中包括你。你的独特故事激励着全球各地的人们参与到开源中来。来吧,[把你的文章想法发给我们][16]! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/3/contribute-open-source-2022 - -作者:[Opensource.com][a] -选题:[lujun9972][b] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/admin -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) -[2]: https://www.redhat.com/en/topics/open-source/what-is-open-source#the-history-of-open-source?intcmp=7013a000002qLH8AAM -[3]: https://opensource.com/article/18/2/coining-term-open-source-software -[4]: https://opensource.com/tags/drupal -[5]: https://opensource.com/article/19/8/everyday-tech-runs-linux -[6]: https://www.redhat.com/en/enterprise-open-source-report/2022?intcmp=7013a000002qLH8AAM -[7]: https://opensource.com/article/21/4/motivates-open-source-contributors -[8]: https://opensource.com/article/20/6/why-contribute-open-source -[9]: https://opensource.com/article/22/1/open-source-contributions-career -[10]: https://opensource.com/life/16/1/8-ways-contribute-open-source-without-writing-code -[11]: https://opensource.com/article/20/7/mattermost -[12]: https://opensource.com/article/21/10/open-practice-library -[13]: https://opensource.com/article/19/11/how-contribute-kubernetes -[14]: https://opensource.com/article/20/9/open-source-role-diversity -[15]: https://opensource.com/article/19/12/open-source-contributors -[16]: https://opensource.com/how-submit-article diff --git a/translated/tech/20220310 How to use undocumented web APIs.md b/translated/tech/20220310 How to use undocumented web APIs.md deleted file mode 100644 index d05c04e97c..0000000000 --- a/translated/tech/20220310 How to use undocumented web APIs.md +++ /dev/null @@ -1,233 +0,0 @@ -[#]: subject: "How to use undocumented web APIs" -[#]: via: "https://jvns.ca/blog/2022/03/10/how-to-use-undocumented-web-apis/" -[#]: author: "Julia Evans https://jvns.ca/" -[#]: collector: "lujun9972" -[#]: translator: "lxbwolf" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -如何调用没有文档说明的 web API -====== - -大家好!几天前我写了篇[个人 demo 小程序][1],里面提到了调用没有文档说明的“私有” API 很有意思,你需要从你的浏览器中把 cookies 复制出来才能访问。 - -有些读者问如何实现,因此我打算详细描述下,其实过程很简单。我们还会涉及一点点在调用没有文档说明的 API 时,可能会遇到的麻烦。 - -我们用谷歌论坛举例。我之所以选择它,不是因为这个例子最有用(我认为官方的 API 更有实践意义),而是因为在这个场景中更有用的网站很多是小网站,而小网站的 API 一旦被滥用,受到的伤害会更大。因此我们使用谷歌论坛,因为我 100% 肯定谷歌论坛对于这种试探请求可以很快恢复。 - -我们现在开始! - -### 第一步:打开开发者工具,找一个 JSON 响应 - -我浏览了,在 Firefox 的开发者工具中打开网络标签,找到一个 JSON 响应。你也可以使用 Chrome 的开发者工具。 - -打开之后界面如下图 - -![][2] - -找到其中一条 “Type” 列显示为 ”json“ 的请求。 - -为了找一条感兴趣的请求,我找了好一会儿,突然我找到一条 ”people“ 的 endpoint,看起来是返回我们的联系人信息。听起来很有意思,我们来看一下。 - -### 第二步:复制为 cURL - -下一步,我在感兴趣的请求上右键,点击 ”复制“ -> ”复制为 cURL“。 - -然后我把 `curl` 命令粘贴到终端并运行。下面是运行结果: - -``` - - $ curl 'https://people-pa.clients6.google.com/v2/people/?key=REDACTED' -X POST ........ (a bunch of headers removed) - Warning: Binary output can mess up your terminal. Use "--output -" to tell - Warning: curl to output it to your terminal anyway, or consider "--output - Warning: " to save to a file. - -``` - -你可能会想 —— 很奇怪,”二进制的输出在你的终端上无法正常显示“ 是什么错误?原因是,浏览器默认情况下发给服务器的请求头中有 `Accept-Encoding: gzip, deflate` 参数,会把输出结果进行压缩。 - -我们可以通过管道把输出传递给 `gunzip` 来解压,但是我们发现不带这个参数进行请求会更简单。因此我们去掉一些不相关的请求头。 - -### 第三步:去掉不相关的请求头 - -下面是我从浏览器获得的完整 `curl` 命令。有很多行!我用反斜杠(`\`)把请求分开,这样每个请求头占一行,看起来更清晰。 - -``` - - curl 'https://people-pa.clients6.google.com/v2/people/?key=REDACTED' \ - -X POST \ - -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0' \ - -H 'Accept: */*' \ - -H 'Accept-Language: en' \ - -H 'Accept-Encoding: gzip, deflate' \ - -H 'X-HTTP-Method-Override: GET' \ - -H 'Authorization: SAPISIDHASH REDACTED' \ - -H 'Cookie: REDACTED' - -H 'Content-Type: application/x-www-form-urlencoded' \ - -H 'X-Goog-AuthUser: 0' \ - -H 'Origin: https://hangouts.google.com' \ - -H 'Connection: keep-alive' \ - -H 'Referer: https://hangouts.google.com/' \ - -H 'Sec-Fetch-Dest: empty' \ - -H 'Sec-Fetch-Mode: cors' \ - -H 'Sec-Fetch-Site: same-site' \ - -H 'Sec-GPC: 1' \ - -H 'DNT: 1' \ - -H 'Pragma: no-cache' \ - -H 'Cache-Control: no-cache' \ - -H 'TE: trailers' \ - --data-raw 'personId=101777723309&personId=1175339043204&personId=1115266537043&personId=116731406166&extensionSet.extensionNames=HANGOUTS_ADDITIONAL_DATA&extensionSet.extensionNames=HANGOUTS_OFF_NETWORK_GAIA_GET&extensionSet.extensionNames=HANGOUTS_PHONE_DATA&includedProfileStates=ADMIN_BLOCKED&includedProfileStates=DELETED&includedProfileStates=PRIVATE_PROFILE&mergedPersonSourceOptions.includeAffinity=CHAT_AUTOCOMPLETE&coreIdParams.useRealtimeNotificationExpandedAcls=true&requestMask.includeField.paths=person.email&requestMask.includeField.paths=person.gender&requestMask.includeField.paths=person.in_app_reachability&requestMask.includeField.paths=person.metadata&requestMask.includeField.paths=person.name&requestMask.includeField.paths=person.phone&requestMask.includeField.paths=person.photo&requestMask.includeField.paths=person.read_only_profile_info&requestMask.includeField.paths=person.organization&requestMask.includeField.paths=person.location&requestMask.includeField.paths=person.cover_photo&requestMask.includeContainer=PROFILE&requestMask.includeContainer=DOMAIN_PROFILE&requestMask.includeContainer=CONTACT&key=REDACTED' - -``` - -第一眼看起来内容有很多,但是现在你不需要考虑每一行是什么意思。你只需要把不相关的行删掉就可以了。 - -我通常通过删掉某行查看是否有错误来验证该行是不是可以删除 —— 只要请求没有错误就一直删请求头。通常情况下,你可以删掉 `Accept*`、`Referer`、`Sec-*`、`DNT`、`User-Agent` 和缓存相关的头。 - -在这个例子中,我把请求删成下面的样子: - -``` - - curl 'https://people-pa.clients6.google.com/v2/people/?key=REDACTED' \ - -X POST \ - -H 'Authorization: SAPISIDHASH REDACTED' \ - -H 'Content-Type: application/x-www-form-urlencoded' \ - -H 'Origin: https://hangouts.google.com' \ - -H 'Cookie: REDACTED'\ - --data-raw 'personId=101777723309&personId=1175339043204&personId=1115266537043&personId=116731406166&extensionSet.extensionNames=HANGOUTS_ADDITIONAL_DATA&extensionSet.extensionNames=HANGOUTS_OFF_NETWORK_GAIA_GET&extensionSet.extensionNames=HANGOUTS_PHONE_DATA&includedProfileStates=ADMIN_BLOCKED&includedProfileStates=DELETED&includedProfileStates=PRIVATE_PROFILE&mergedPersonSourceOptions.includeAffinity=CHAT_AUTOCOMPLETE&coreIdParams.useRealtimeNotificationExpandedAcls=true&requestMask.includeField.paths=person.email&requestMask.includeField.paths=person.gender&requestMask.includeField.paths=person.in_app_reachability&requestMask.includeField.paths=person.metadata&requestMask.includeField.paths=person.name&requestMask.includeField.paths=person.phone&requestMask.includeField.paths=person.photo&requestMask.includeField.paths=person.read_only_profile_info&requestMask.includeField.paths=person.organization&requestMask.includeField.paths=person.location&requestMask.includeField.paths=person.cover_photo&requestMask.includeContainer=PROFILE&requestMask.includeContainer=DOMAIN_PROFILE&requestMask.includeContainer=CONTACT&key=REDACTED' - -``` - -这样我只需要 4 个请求头:`Authorization`、`Content-Type`、`Origin` 和 `Cookie`。这样容易管理得多。 - -### 第四步:在 Python 中发请求 - -现在我们知道了我们需要哪些请求头,我们可以把 `curl` 命令翻译进 Python 程序!这部分是相当机械化的过程,目标仅仅是用 Python 发送与 curl 相同的数据。 - -下面是代码实例。我们使用 Python 的 `requests` 包实现了与前面 `curl` 命令相同的功能。我把整个长请求分解成了元组的数组,以便看起来更简洁。 - -``` - - import requests - import urllib - - data = [ - ('personId','101777723'), # I redacted these IDs a bit too - ('personId','117533904'), - ('personId','111526653'), - ('personId','116731406'), - ('extensionSet.extensionNames','HANGOUTS_ADDITIONAL_DATA'), - ('extensionSet.extensionNames','HANGOUTS_OFF_NETWORK_GAIA_GET'), - ('extensionSet.extensionNames','HANGOUTS_PHONE_DATA'), - ('includedProfileStates','ADMIN_BLOCKED'), - ('includedProfileStates','DELETED'), - ('includedProfileStates','PRIVATE_PROFILE'), - ('mergedPersonSourceOptions.includeAffinity','CHAT_AUTOCOMPLETE'), - ('coreIdParams.useRealtimeNotificationExpandedAcls','true'), - ('requestMask.includeField.paths','person.email'), - ('requestMask.includeField.paths','person.gender'), - ('requestMask.includeField.paths','person.in_app_reachability'), - ('requestMask.includeField.paths','person.metadata'), - ('requestMask.includeField.paths','person.name'), - ('requestMask.includeField.paths','person.phone'), - ('requestMask.includeField.paths','person.photo'), - ('requestMask.includeField.paths','person.read_only_profile_info'), - ('requestMask.includeField.paths','person.organization'), - ('requestMask.includeField.paths','person.location'), - ('requestMask.includeField.paths','person.cover_photo'), - ('requestMask.includeContainer','PROFILE'), - ('requestMask.includeContainer','DOMAIN_PROFILE'), - ('requestMask.includeContainer','CONTACT'), - ('key','REDACTED') - ] - response = requests.post('https://people-pa.clients6.google.com/v2/people/?key=REDACTED', - headers={ - 'X-HTTP-Method-Override': 'GET', - 'Authorization': 'SAPISIDHASH REDACTED', - 'Content-Type': 'application/x-www-form-urlencoded', - 'Origin': 'https://hangouts.google.com', - 'Cookie': 'REDACTED', - }, - data=urllib.parse.urlencode(data), - ) - - print(response.text) - -``` - -我执行这个程序后正常运行 —— 输出了一堆 JSON 数据!太棒了! - -你会注意到有些地方我用 `REDACTED` 代替了,因为如果我把原始数据列出来你就可以用我的账号来访问谷歌论坛了,这就很不好了。 - -### 运行结束! - -现在我可以随意修改 Python 程序,比如传入不同的参数,或解析结果等。 - -我不打算用它来做其他有意思的事了,因为我压根对这个 API 没兴趣,我只是用它来阐述请求 API 的过程。 - -但是你确实可以对返回的一堆 JSON 做一些处理。 - -### curlconverter 看起来很强大 - -有人评论说可以使用自动把 curl 转换成 Python(和一些其他的语言!),这看起来很神奇 —— 我都是手动转的。我在这个例子里使用了它,看起来一切正常。 - -### 追踪 API 的处理过程并不容易 - -我不打算夸大追踪 API 处理过程的难度 —— API 的处理过程并不明显!我也不知道传给这个谷歌论坛 API 的一堆参数都是做什么的! - -但是有一些参数看起来很直观,比如 `requestMask.includeField.paths=person.email` 可能表示”包含每个人的邮件地址“。因此我只关心我能看懂的参数,不关心看不懂的。 - -### (理论上)适用于所有场景 - -可能有人质疑 —— 这个方法适用于所有场景吗? - -答案是肯定的 —— 浏览器不是魔法!浏览器发送给你的服务器的所有信息都是 HTTP 请求。因此如果我复制了浏览器发送的所有的 HTTP 请求头,那么后端就会认为请求是从我的浏览器发出的,而不是用 Python 程序发出的。 - -当然,我们去掉了一些浏览器发送的请求头,因此理论上后端是可以识别出来请求是从浏览器还是 Python 程序发出的,但是它们通常不会检查。 - -这里有一些对读者的告诫 —— 一些谷歌服务的后端会通过令人难以理解(对我来说是)方式跟前端通信,因此即使理论上你可以模拟前端的请求,但实际上可能行不通。可能会遭受更多攻击的大型 API 会有更多的保护措施。 - -我们已经知道了如何调用没有文档说明的 API。现在我们再来聊聊可能遇到的问题。 - -### 问题 1:session cookies 过期 - -一个大问题是我用我的谷歌 session cookie 作为身份认证,因此当我的浏览器 session 过期后,这个脚本就不能用了。 - -这意味着这种方式不能长久使用(我宁愿调一个真正的 API),但是如果我只是要一次性快速抓取一小组数据,那么可以使用它。 - -### 问题 2:滥用 - -如果我正在请求一个小网站,那么我的 Python 脚本可能会把服务打垮,因为请求数超出了它们的处理能力。因此我请求时尽量谨慎,尽量不过快地发送大量请求。 - -这尤其重要,因为没有官方 API 的网站往往是些小网站且没有足够的资源。 - -很明显在这个例子中这不是问题 —— 我认为在写这篇文章的过程我一共向谷歌论坛的后端发送了 20 次请求,他们肯定可以处理。 - -如果你用自己的账号资格过度访问这个 API 并导致了故障,那么你的账号可能(情理之中)会被暂时封禁。 - -我只下载我自己的数据或公共的数据 —— 我的目的不是寻找网站的弱点。 - -### 请记住所有人都可以访问你没有文档说明的 API - -我认为本文最重要的信息并不是如何使用其他人没有文档说明的 API。虽然很有趣,但是也有一些限制,而且我也不会经常这么做。 - -更重要的一点是,任何人都可以这么访问你后端的 API!每个人都有开发者工具和网络标签,查看你传到后端的参数、修改它们都很容易。 - -因此如果一个人通过修改某些参数来获取其他用户的信息,这不值得提倡。我认为提供公开 API 的大部分开发者们都知道,但是我之所以再提一次,是因为每个初学者都应该了解。:) - --------------------------------------------------------------------------------- - -via: https://jvns.ca/blog/2022/03/10/how-to-use-undocumented-web-apis/ - -作者:[Julia Evans][a] -选题:[lujun9972][b] -译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://jvns.ca/ -[b]: https://github.com/lujun9972 -[1]: https://jvns.ca/blog/2022/03/08/tiny-programs/ -[2]: https://jvns.ca/images/network-tab.png diff --git a/translated/tech/20220518 Five common mistakes when using automation.md b/translated/tech/20220518 Five common mistakes when using automation.md new file mode 100644 index 0000000000..cf8b52b775 --- /dev/null +++ b/translated/tech/20220518 Five common mistakes when using automation.md @@ -0,0 +1,58 @@ +[#]: subject: "Five common mistakes when using automation" +[#]: via: "https://fedoramagazine.org/five-common-mistakes-when-using-automation/" +[#]: author: "Gary Scarborough https://fedoramagazine.org/author/gscarbor/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用自动化时的五个常见错误 +====== + +![][1] + +背景图片来自 [“Modern Times”(1936)][2],[United Artists][3],公共领域,通过 Wikimedia Commons + +随着自动化扩展到涵盖 IT 的更多方面,越来越多的管理员正在学习自动化技能并应用它们来减轻他们的工作量。自动化可以减轻重复性任务的负担,并为基础设施增加一定程度的一致性。但是,当 IT 工作人员部署自动化时,会出现可能对大大小小的基础设施造成严重破坏的常见错误。在自动化部署中通常会出现五个常见错误。 + +### 缺乏测试 + +初学者常犯的错误是自动化脚本没有经过全面测试。由于拼写错误或逻辑错误,简单的 shell 脚本可能会对服务器产生不利影响。将该错误乘以基础架构中的服务器数量,你可能会遇到一大堆问题需要清理。在大规模部署之前始终测试你的自动化脚本。 + +### 意外的服务器负载 + +经常发生的第二个错误是没有预测脚本可能对其他资源施加的系统负载。当目标是十几个服务器时,运行从仓库下载文件或安装包的脚本可能没问题。脚本通常在成百上千台服务器上运行。这种负载可以使支持服务停止或完全崩溃。不要忘记考虑端点影响或设置合理的并发率。 + +### 离开脚本 + +自动化工具的一种用途是确保符合标准设置。自动化可以轻松确保组中的每台服务器都具有完全相同的设置。如果该组中的服务器需要根据该基线进行更改,同时管理员不了解合规标准,那么可能会出现问题。安装和启用不需要和不想要的服务,从而导致可能的安全问题。 + +### 缺乏文档 + +管理员的一项固定职责应该是记录他们的工作。由于合同到期、升职或定期员工流动,公司可能会在 IT 部门频繁招聘新员工。公司内的工作组相互隔离也很常见。由于这些原因,重要的是记录哪些自动化已经到位。与用户运行脚本不同,自动化可能会在创建它的人离开组之后继续很长时间。管理员可能会发现自己在其基础设施中面临着来自自动化未经检查的奇怪行为。 + +### 缺乏经验 + +列表中的最后一个错误是管理员对他们正在自动化的系统不够了解。管理员经常被雇用到他们没有接受过足够培训且没有人可以学习的职位上工作。自 COVID 以来,当公司努力填补空缺时,这一点尤其重要。然后管理员被迫处理他们没有设置并且可能不完全理解的基础设施。这可能会导致非常低效的脚本浪费资源或配置错误的服务器。 + +### 结论 + +越来越多的管理员正在学习自动化来帮助他们完成日常任务。因此,自动化正被应用于更多的技术领域。希望此列表将有助于防止新用户犯这些错误,并敦促经验丰富的管理员重新评估他们的 IT 策略。自动化旨在减轻重复性任务的负担,而不是为最终用户带来更多工作。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/five-common-mistakes-when-using-automation/ + +作者:[Gary Scarborough][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/gscarbor/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2022/05/modern-times-816x345.jpg +[2]: https://en.wikipedia.org/wiki/Modern_Times_(film) +[3]: https://commons.wikimedia.org/wiki/File:Chaplin_-_Modern_Times.jpg diff --git a/translated/tech/20220519 Use this open source screen reader on Windows.md b/translated/tech/20220519 Use this open source screen reader on Windows.md new file mode 100644 index 0000000000..27bcf2fe00 --- /dev/null +++ b/translated/tech/20220519 Use this open source screen reader on Windows.md @@ -0,0 +1,69 @@ +[#]: subject: "Use this open source screen reader on Windows" +[#]: via: "https://opensource.com/article/22/5/open-source-screen-reader-windows-nvda" +[#]: author: "Peter Cheer https://opensource.com/users/petercheer" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +在 Windows 上使用这个开源屏幕阅读器 +====== +为纪念全球无障碍意识日,了解 NVDA 开源屏幕阅读器,以及你如何参与其中,为所有网络用户提高无障碍性。 + +![Working from home at a laptop][1] +图片提供:Opensource.com + +屏幕阅读器是辅助技术软件的一个专门领域,它可以阅读并说出计算机屏幕上的内容。完全没有视力的人只是视力障碍者的一小部分,屏幕阅读器软件可以帮助所有群体。屏幕阅读器大多特定于操作系统,供有视觉障碍的人和无障碍培训师使用,以及想要测试网站或应用的无障碍访问程度的开发人员和无障碍顾问。 + +### 如何使用 NVDA 屏幕阅读器 + +[WebAIM 屏幕阅读器用户调查][2]始于 2009 年,一直持续到 2021 年。在第一次调查中,最常用的屏幕阅读器是 JAWS,占 74%。它是 Microsoft Windows 的商业产品,并且是长期的市场领导者。 NVDA 当时是一个相对较新的 Windows 开源屏幕阅读器,仅占 8%。快进到 2021 年,JAWS 占 53.7%,NVDA 占 30.7%。 + +你可以从 [NVAccess 网站][3]下载最新版本的 NVDA。为什么我要使用 NVDA 并将它推荐给我使用微软 Windows 的客户?嗯,它是开源的,速度快,功能强大,易于安装,支持多种语言,可以作为便携式应用运行,拥有庞大的用户群,并且有定期发布新版本的周期。 + +NVDA 已被翻译成 55 种语言,并在 175 个不同的国家/地区使用。还有一个活跃的开发者社区,拥有自己的[社区插件网站][4]。你选择安装的任何附加组件都将取决于你的需求,并且有很多可供选择,包括常见视频会议平台的扩展。 + +与所有屏幕阅读器一样,NVDA 有很多组合键需要学习。熟练使用任何屏幕阅读器都需要培训和练习。 + +![Image of NVDA welcome screen][5] + +向熟悉计算机和会使用键盘的人教授 NVDA 并不太难。向一个完全初学者教授基本的计算机技能(没有鼠标、触摸板和键盘技能)和使用 NVDA 是一个更大的挑战。个人的学习方式和偏好不同。此外,如果人们只想浏览网页和使用电子邮件,他们可能不需要学习如何做所有事情。NVDA 教程和资源的一个很好的链接来源是[无障碍中心][6]。 + +当你掌握了使用键盘命令操作 NVDA,它就会变得更容易,但是还有一个菜单驱动的系统可以完成许多配置任务。 + +![Image of NVDA menu][7] + +### 测试无障碍性 + +多年来,屏幕阅读器用户无法访问某些网站一直是个问题,尽管美国残疾人法案(ADA)等残疾人平等立法仍然存在。 NVDA 在有视力的社区中的一个很好的用途是用于网站无障碍性测试。NVDA 可以免费下载,并且通过运行便携式版本,网站开发人员甚至不需要安装它。运行 NVDA,关闭显示器或闭上眼睛,看看你在浏览网站或应用时的表现如何。 + +NVDA 也可用于测试(通常被忽略的)正确[标记 PDF 文档以实现无障碍性][8]任务。 + +有几个指南专注于使用 NVDA 进行无障碍性测试。我可以推荐[使用 NVDA 测试网页][9]和使用 [NVDA 评估 Web 无障碍性][10]。 + +图片提供:(Peter Cheer,CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +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) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/petercheer +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/wfh_work_home_laptop_work.png +[2]: https://webaim.org/projects +[3]: https://www.nvaccess.org +[4]: https://addons.nvda-project.org/index.en.html +[5]: https://opensource.com/sites/default/files/2022-05/nvda1.png +[6]: http://www.accessibilitycentral.net/ +[7]: https://opensource.com/sites/default/files/2022-05/nvda2.png +[8]: https://www.youtube.com/watch?v=rRzWRk6cXIE +[9]: https://www.unimelb.edu.au/accessibility/tools/testing-web-pages-with-nvda +[10]: https://webaim.org/articles/nvda diff --git a/translated/tech/20220524 Collision- Linux App to Verify ISO and Other Files.md b/translated/tech/20220524 Collision- Linux App to Verify ISO and Other Files.md new file mode 100644 index 0000000000..7d59ad4431 --- /dev/null +++ b/translated/tech/20220524 Collision- Linux App to Verify ISO and Other Files.md @@ -0,0 +1,130 @@ +[#]: subject: "Collision: Linux App to Verify ISO and Other Files" +[#]: via: "https://www.debugpoint.com/2022/05/collision/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Collision:用于验证 ISO 和其他文件的 Linux 应用 +====== +本教程概述了 Collision 的功能和使用指南。它是一个基于 GUI 且易于使用的程序,可让你使用加密哈希函数验证文件。 + +### 为什么需要验证文件? + +每个人每天都通过 Internet 下载文件。但许多用户从不费心去验证他们的完整性或真实性。这意味着该文件是否合法且未被任何恶意代码篡改。 + +以作为标准安装镜像的 [Linux 发行版][1]的 ISO 文件为例。所有流行的发行版制造商还提供哈希文件和 ISO 文件。使用该文件,你可以轻松比较下载文件的哈希值。你可以放心,你的文件是正确的并且没有以任何方式损坏。 + +此外,如果你通过不稳定的互联网连接下载大文件,该文件可能会损坏。在这些情况下,它也有助于验证。 + +### Collision – 功能和使用方法 + +[Collision][2] 使用加密哈希函数来帮助你验证文件。加密哈希函数是一种流行的算法,它通过多种加密算法将文件数据生成为固定长度的数据流。最受欢迎的是 MD5、SHA-1、SHA-256 和 SHA-512。所有这些 Collision 都支持。 + +除此之外,Collision 还提供了一个简洁的用户界面,它对每个 Linux 用户都简单易用。这是它的外观。 + +![Collision – First Screen][3] + +首先,它有两个主要特点。 a) 上传文件以获取校验和和或哈希值 b) 将校验和与上传的文件进行比较。 + +例如,如果你有一个简单的文件,你可以通过“打开文件”按钮或“打开”按钮重新上传另一个文件。 + +如下图所示,文本文件具有以下各种哈希函数的校验和。现在你可以通过互联网/与任何人共享该文件,以及用于验证的校验和值。 + +![Hash values of a test file][4] + +此外,如果有人篡改文件(即使是单个字节)或文件在分发过程中被破坏,那么哈希值就会完全改变。 + +其次,如果要验证已下载文件的完整性,请点击“验证”选项卡。然后上传文件,输入你收到的上传文件的哈希值。 + +如果匹配,你应该会看到一个绿色勾号,显示其真实性。 + +![Collision verifies a sample file with SHA-256][5] + +此外,这是另一个示例,我修改了测试文件并保持值相同。这个场景清楚地表明它对该文件无效。 + +![Collision showing that a file is not valid][6] + +#### 重要说明 + +这里值得一提的是,哈希方法不会验证文件元属性,如修改时间、修改日期等。如果有人篡改了文件并将其还原为原始内容,哈希方法将其称为有效文件。 + +现在,让我们看一个验证 ISO 文件的典型示例。 + +### 使用 Collision 验证 Ubuntu Linux 的示例 ISO 文件 + +我相信你在使用 Linux 时通常会下载许多 ISO 文件。为了说明,我从官方 Ubuntu 下载页面下载了流行的 Ubuntu ISO 服务器镜像。 + +![Ubuntu server ISO file and checksums][7] + +SHA256SUMS 文件具有以下安装程序的校验和值,如上所示。 + +![SHA-256 value of Ubuntu server ISO image][8] + +下载后,打开 Collision 应用并通过验证选项卡上传 ISO 文件。然后复制 SHA-256 值并将其粘贴到左侧的校验和框中。 + +如果你已正确下载并按照步骤操作,你应该会看到该文件是真实的。 + +![Ubuntu server ISO image verified][9] + +### 如何安装 Collision + +使用 Flatpak 可以轻松安装 Collision 应用。你需要为你的 Linux 发行版[设置 Flatpak][10],并单击以下链接以安装 Collision。 + +[通过 Flathub 安装 Collision][11] + +安装后,你应该通过发行版的应用菜单找到它。 + +### 有没有其他方法可以在没有任何应用的情况下验证文件? + +是的,所有 Linux 发行版中都有一些内置程序,你还可以使用它们来使用终端验证文件及其完整性。 + +下面的终端程序可用于确定任何文件的哈希值。它们默认安装在所有发行版中,你甚至可以将它们用于你的 shell 脚本以实现自动化。 + +``` +md5sum <文件名> +``` + +``` +sha1sum <文件名> +``` + +``` +sha256sum <文件名> +``` + +使用上述程序,你可以找出哈希值。但是你需要比较它们以手动验证。 + +![Verify files via command-line utilities][12] + +### 结束语 + +我希望本指南可以帮助你使用 Collision GTK 应用验证你的文件。它使用起来很简单。此外,你可以在终端中使用命令行方法来验证您想要的任何文件。另外,最好的做法是尽可能始终检查文件完整性。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/collision/ + +作者:[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://collision.geopjr.dev/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/Collision-First-Screen.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/05/Hash-values-of-a-test-file.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/05/Collision-verifies-a-sample-file-with-SHA-256.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/05/Collision-showing-that-a-file-is-not-valid.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/05/Ubuntu-server-ISO-file-and-checksums.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/SHA-256-valud-of-Ubuntu-server-ISO-image.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/05/Ubuntu-server-ISO-image-verified.jpg +[10]: https://flatpak.org/setup/ +[11]: https://dl.flathub.org/repo/appstream/dev.geopjr.Collision.flatpakref +[12]: https://www.debugpoint.com/wp-content/uploads/2022/05/Verify-files-via-command-line-utilities.jpg diff --git a/translated/tech/20220525 Package is -set to manually installed-- What does it Mean-.md b/translated/tech/20220525 Package is -set to manually installed-- What does it Mean-.md new file mode 100644 index 0000000000..13f06a1f14 --- /dev/null +++ b/translated/tech/20220525 Package is -set to manually installed-- What does it Mean-.md @@ -0,0 +1,95 @@ +[#]: subject: "Package is “set to manually installed”? What does it Mean?" +[#]: via: "https://itsfoss.com/package-set-manually-installed/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +软件包 “set to manually installed”?这是什么意思? +====== +如果你使用 apt 命令在终端中安装软件包,你将看到各种输出。 + +如果你注意并查看输出,有时你会注意到一条消息: + +**package_name set to manually installed** + +你有没有想过这条消息是什么意思,为什么你没有在所有包上看到它?让我在本篇中分享一些细节。 + +### 理解 “Package set to manually installed” + +当你尝试安装已安装的库或开发包时,你会看到此消息。此依赖包是与另一个包一起自动安装的。如果删除了主包,则使用 apt autoremove 命令删除依赖包。 + +但是由于你试图显式安装依赖包,你的 Ubuntu 系统认为你需要这个包独立于主包。因此,该软件包被标记为手动安装,因此不会自动删除。 + +不是很清楚,对吧?以[在 Ubuntu 上安装 VLC][1] 为例。 + +由于主 vlc 包依赖于许多其他包,因此这些包会自动安装。 + +![installing vlc with apt ubuntu][2] + +如果你检查名称中包含 vlc 的[已安装软件包列表][3],你会看到除了 vlc,其余都标记为“自动”。这表明这些软件包是自动安装的(使用 vlc),它们将使用 apt autoremove 命令自动删除(当 vlc 被卸载时)。 + +![list installed packages vlc ubuntu][4] + +现在假设你出于某种原因考虑安装 “vlc-plugin-base”。如果你在其上运行 apt install 命令,系统会告诉你该软件包已安装。同时,它将标记从自动更改为手动,因为系统认为你在尝试手动安装时明确需要此 vlc-plugin-base。 + +![package set manually][5] + +可以看到它的状态已经从 [installed,automatic] 变成了 [installed]。 + +![listing installed packages with vlc][6] + +现在,让我删除 VLC 并运行 autoremove 命令。你可以看到 “vlc-plugin-base” 不在要删除的软件包列表中。 + +![autoremove vlc ubuntu][7] + +再次检查已安装软件包的列表。vlc-plugin-base 仍然安装在系统上。 + +![listing installed packages after removing vlc][8] + +你可以在这里看到另外两个与 vlc 相关的包。这些是 vlc-plugin-base 包的依赖项,这就是为什么它们也存在于系统上但标记为 “automatic” 的原因。 + +我相信现在有了这些例子,事情就更清楚了。让我给你一个额外提示。 + +### 将包重置为自动 + +如果包的状态从自动更改为手动,你可以通过以下方式将其设置回自动: + +``` +sudo apt-mark auto 包名 +``` + +![set package to automatic][9] + +### 结论 + +这不是一个重大错误,也不会阻止你在系统中进行工作。但是,了解这些小事会增加你的知识。 + +**好奇心可能会害死猫,但它会让企鹅变得更聪明**。这是为这篇原本枯燥的文章增添幽默感的原始引述 :) + +如果你想阅读更多这样的文章,这些文章可能看起来微不足道,但可以帮助你更好地了解您的 Linux 系统,请告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/package-set-manually-installed/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/install-latest-vlc/ +[2]: https://itsfoss.com/wp-content/uploads/2022/05/installing-vlc-with-apt-ubuntu-800x489.png +[3]: https://itsfoss.com/list-installed-packages-ubuntu/ +[4]: https://itsfoss.com/wp-content/uploads/2022/05/list-installed-packages-vlc-ubuntu-800x477.png +[5]: https://itsfoss.com/wp-content/uploads/2022/05/package-set-manually.png +[6]: https://itsfoss.com/wp-content/uploads/2022/05/listing-installed-packages-with-vlc.png +[7]: https://itsfoss.com/wp-content/uploads/2022/05/autoremove-vlc-ubuntu.png +[8]: https://itsfoss.com/wp-content/uploads/2022/05/listing-installed-packages-after-removing-vlc.png +[9]: https://itsfoss.com/wp-content/uploads/2022/05/set-package-to-automatic.png