mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-21 02:10:11 +08:00
commit
01923f6baa
@ -3,60 +3,60 @@
|
||||
[#]: author: (Miguel Perez Colino https://opensource.com/users/mperezco)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-13520-1.html)
|
||||
|
||||
用这个新工具将虚拟机迁移到 Kubernetes 上
|
||||
用 Forklift 将虚拟机迁移到 Kubernetes 上
|
||||
======
|
||||
用 Forklift 将你的虚拟化工作负载过渡到 Kubernetes。
|
||||
![Containers on a ship on the ocean][1]
|
||||
|
||||
2017 年,[KubeVirt][2] 团队[发起][3]了一个在 [Kubernetes][4] 中与容器一起管理虚拟机 (VM) 的项目。这个开源项目的意图是让虚拟机成为这个环境中的一等公民。
|
||||
> 用 Forklift 将你的虚拟化工作负载过渡到 Kubernetes。
|
||||
|
||||
自从在 [2018 年开源峰会][5]上推出以来,KubeVirt 一直在不断成熟和发展。它在 GitHub 上已经达到了 200 多颗星,甚至在 2021 年 2 月推出了自己的活动:[KubeVirt 峰会][6]。
|
||||

|
||||
|
||||
2017 年,[KubeVirt][2] 团队 [发起][3] 了一个在 [Kubernetes][4] 中管理容器及相关的虚拟机(VM)的项目。这个开源项目的意图是让虚拟机成为这个环境中的一等公民。
|
||||
|
||||
自从在 [2018 年开源峰会][5] 上推出以来,KubeVirt 一直在不断成熟和发展。它在 GitHub 上已经达到了 200 多颗星,甚至在 2021 年 2 月推出了自己的活动:[KubeVirt 峰会][6]。
|
||||
|
||||
![KubeVirt architecture][7]
|
||||
|
||||
KubeVirt架构(© 2020,[Red Hat OpenShift][8])
|
||||
*KubeVirt 架构(© 2020,[Red Hat OpenShift][8])*
|
||||
|
||||
KubeVirt 是 [OpenShift 虚拟化][9]的基础,它帮助开发者将虚拟机带入容器化工作流程。
|
||||
KubeVirt 是 [OpenShift 虚拟化][9] 的基础,它帮助开发者将虚拟机带入容器化工作流程。
|
||||
|
||||
### 在 Kubernetes 中使用虚拟机
|
||||
|
||||
KubeVirt 使你能够在虚拟机上原生使用 Kubernetes。这意味着它们可以连接到使用标准 Kubernetes 方法访问的 pod 网络,包括服务、路由、管道等。应用于虚拟机 pod 的网络策略与应用于应用的 pod 方式相同,它提供一个一致的模型来管理虚拟机到 pod (反之亦然)的通信。
|
||||
KubeVirt 使你能够在虚拟机上原生使用 Kubernetes。这意味着它们可以连接到使用标准 Kubernetes 方法(如服务、路由、管道等)访问的<ruby>吊舱<rt>Pod</rt></ruby>网络。应用于虚拟机吊舱的网络策略与应用于应用吊舱的方式相同,它提供一个一致的模型来管理虚拟机到吊舱(或反之)的通信。
|
||||
|
||||
这方面的一个真实例子是一家航空公司利用旧的模拟器软件的方式。它注入了人工智能和机器学习 (AI/ML) 的模型,然后在基于虚拟机的模拟器上自动部署和测试它们。这使得它能够使用 Kubernetes 和 [Kubeflow][10] 完全自动化地获得测试结果和新的遥测训练数据。
|
||||
|
||||
![VM-creation workflow][11]
|
||||
|
||||
(Konveyor, [CC BY-SA 4.0][12])
|
||||
*(Konveyor, [CC BY-SA 4.0][12])*
|
||||
|
||||
[Konveyor.io][13] 是一个开源项目,帮助现有工作负载(开发、测试和生产)过渡到 Kubernetes。其工具包括 [Crane][14],将容器从一个 Kubernetes 平台转移到另一个平台、[Move2Kube][15],将工作负载从 Cloud Foundry 带到 Kubernetes,以及 [Tackle][16],分析 Java 应用,使其对 Kubernetes 等容器化平台中的运行时更加标准和便携,从而使其现代化。
|
||||
[Konveyor.io][13] 是一个开源项目,帮助现有工作负载(开发、测试和生产)过渡到 Kubernetes。其工具包括将容器从一个 Kubernetes 平台转移到另一个平台的 [Crane][14];将工作负载从 Cloud Foundry 带到 Kubernetes的 [Move2Kube][15];以及分析 Java 应用,使其对 Kubernetes 等容器化平台中的运行时更加标准和可移植,从而使其现代化的 [Tackle][16]。
|
||||
|
||||
这些工具在转化模式中很有用,但许多项目希望在早期阶段利用 Kubernetes,以变得更加敏捷和富有成效。在基础设施方面,这些好处可能包括蓝/绿负载均衡、路由管理、声明式部署,或(取决于你的部署方式)由于不可变的基础设施而更容易升级。在开发方面,它们可能包括将持续集成/持续开发 (CI/CD) 管道与平台整合,使应用更快地投入生产,自我提供资源,或整合健康检查和监控。
|
||||
|
||||
KubeVirt 可以通过在 Kubernetes 环境中作为虚拟机运行工作负载来帮助你。它能让你的工作负载迅速使用 Kubernetes,享受它的好处,并随着时间的推移稳步实现工作负载的现代化。但是,你仍然有一个问题,就是把你的虚拟机从传统的虚拟化平台带到现代的 Kubernetes 平台。这就是 Konveyor 的 [Forklift][17] 项目的意义所在。
|
||||
KubeVirt 可以通过在 Kubernetes 环境中以虚拟机来运行工作负载帮助你。它能让你的工作负载迅速使用 Kubernetes,享受它的好处,并随着时间的推移稳步实现工作负载的现代化。但是,仍然有一个问题,就是把你的虚拟机从传统的虚拟化平台带到现代的 Kubernetes 平台。这就是 Konveyor 的 [Forklift][17] 项目的意义所在。
|
||||
|
||||
### 关于 Forklift
|
||||
|
||||
Forklift 使用 KubeVirt 将不同来源的虚拟化工作负载迁移到 Kubernetes。它被设计成使任务变得简单,以便你可以从一两台机器到数百台机器迁移任何东西。
|
||||
Forklift 使用 KubeVirt 将不同来源的虚拟化工作负载迁移到 Kubernetes。它的设计目标是使任务变得简单,以便你可以从一两台机器到数百台机器迁移任何东西。
|
||||
|
||||
迁移是一个简单的、三阶段的过程:
|
||||
|
||||
1. 连接到一个现有的虚拟化平台(称为“源提供者”)和一个 Kubernetes 环境(“目标提供者”)。
|
||||
2. 将网络和存储资源从源提供者映射到目标提供者,在两者中寻找相同的资源。
|
||||
2. 将网络和存储资源从源提供者映射到目标提供者,在两者中寻找等价的资源。
|
||||
3. 选择要迁移的虚拟机,分配网络和存储映射,制定迁移计划。然后运行它。
|
||||
|
||||
|
||||
|
||||
### 如何开始
|
||||
|
||||
要开始使用 Forklift,首先,你需要一个兼容的源提供商。你还需要一个带有 KubeVirt 0.40 或更新版本的 Kubernetes 环境和裸机节点(尽管为了测试,你可以使用嵌套虚拟化)。用读-写-执行 (RWX) 功能配置你的存储类,并使用 [Multus][18] 配置你的网络,以匹配你的虚拟机在源提供者中使用的网络。(如果你不能这样做,也不用担心。你也可以选择重新分配 IP 地址。)
|
||||
|
||||
最后,使用提供的操作者在你的 Kubernetes 上[安装 Forklift][19],并进入用户界面,开始运行你的第一次测试迁移。
|
||||
最后,使用提供的操作器在你的 Kubernetes 上[安装 Forklift][19],并进入用户界面,开始运行你的第一次测试迁移。
|
||||
|
||||
Forklift 是 Red Hat 的[虚拟化迁移工具套件][20]的上游版本。因此,如果你想在生产环境中使用它,你可以考虑使用该工具的支持版本。
|
||||
Forklift 是 Red Hat 的 [虚拟化迁移工具套件][20] 的上游版本。因此,如果你想在生产环境中使用它,你可以考虑使用该工具的支持版本。
|
||||
|
||||
迁移愉快!
|
||||
|
||||
@ -67,7 +67,7 @@ via: https://opensource.com/article/21/6/migrate-vms-kubernetes-forklift
|
||||
作者:[Miguel Perez Colino][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
220
published/20210618 Systemd Timers for Scheduling Tasks.md
Normal file
220
published/20210618 Systemd Timers for Scheduling Tasks.md
Normal file
@ -0,0 +1,220 @@
|
||||
[#]: subject: (Systemd Timers for Scheduling Tasks)
|
||||
[#]: via: (https://fedoramagazine.org/systemd-timers-for-scheduling-tasks/)
|
||||
[#]: author: (Richard England https://fedoramagazine.org/author/rlengland/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (dcoliversun)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-13522-1.html)
|
||||
|
||||
用于调度任务的 systemd 定时器
|
||||
======
|
||||
|
||||

|
||||
|
||||
systemd 提供定时器有一段时间了,定时器替代了 cron 功能,这一特性值得看看。本文将向你介绍在系统启动后如何使用 systemd 中的定时器来运行任务,并在此后重复运行。这不是对 systemd 的全面讨论,只是对此特性的一个介绍。
|
||||
|
||||
### 快速回顾:cron、anacron 与 systemd
|
||||
|
||||
cron 可以以几分钟到几个月或更长时间的粒度调度运行一个任务。设置起来相对简单,它只需要一个配置文件。虽然配置过程有些深奥,但一般用户也可以使用。
|
||||
|
||||
然而,如果你的系统在需要执行的时间没有运行,那么 cron 会失败。
|
||||
|
||||
anacron 克服了“系统没有运行”的问题。它确保任务将在你的系统再次启动时执行。虽然它旨在给管理员使用,但有些系统允许普通用户访问 anacron。
|
||||
|
||||
但是,anacron 的执行频率不能低于每天一次。
|
||||
|
||||
cron 和 anacron 都存在执行上下文一致性的问题。必须注意任务运行时有效的环境与测试时使用的环境完全相同。必须提供相同的 shell、环境变量和路径。这意味着测试和调试有时会很困难。
|
||||
|
||||
systemd 定时器提供了 cron 和 anacron 二者的优点,允许调度到分钟粒度。确保在系统再次运行时执行任务,即使在预期的执行时间内系统处于关闭状态。它对所有用户都可用。你可以在它将要运行的环境中测试和调试执行。
|
||||
|
||||
但是,它的配置更加复杂,至少需要两个配置文件。
|
||||
|
||||
如果你的 cron 和 anacron 配置可以很好地为你服务,那么可能没有理由改变。但是 systemd 至少值得研究,因为它可以简化任何当前的 cron/anacron 工作方式。
|
||||
|
||||
### 配置
|
||||
|
||||
systemd 定时器执行功能至少需要两个文件。这两个是“<ruby>定时器单元<rt>timer unit</rt></ruby>”和“<ruby>服务单元<rt>service unit</rt></ruby>”。(其执行的)“动作”不仅仅是简单的命令,你还需要一个“作业”文件或脚本来执行必要的功能。
|
||||
|
||||
定时器单元文件定义调度表,而服务单元文件定义执行的任务。有关的更多详细信息请参考 `man systemd.timer` 中提供的 .timer 单元。服务单元的详细信息可在 `man systemd.service` 中找到。
|
||||
|
||||
单元文件存放在几个位置(在手册页中有列出)。然而,对于普通用户来说,最容易找到的位置可能是 `~/.config/systemd/user`。请注意,这里的 `user` 是字符串 `user`。
|
||||
|
||||
### 示例
|
||||
|
||||
此示例是一个创建用户调度作业而不是(以 root 用户身份运行的)系统调度作业的简单示例。它将消息、日期和时间打印到文件中。
|
||||
|
||||
1、首先创建一个执行任务的 shell 脚本。在你的本地 `bin` 目录中创建它,例如在 `~/bin/schedule-test.sh` 中。
|
||||
|
||||
创建文件:
|
||||
|
||||
```
|
||||
touch ~/bin/schedule-test.sh
|
||||
```
|
||||
|
||||
然后将以下内容添加到你刚刚创建的文件中:
|
||||
|
||||
```
|
||||
#!/bin/sh
|
||||
echo "This is only a test: $(date)" >> "$HOME/schedule-test-output.txt"
|
||||
```
|
||||
|
||||
记住赋予你的 shell 脚本执行权限。
|
||||
|
||||
2、创建 .service 单元调用上面的脚本。在以下位置创建目录与文件:`~/.config/systemd/user/schedule-test.service`:
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=A job to test the systemd scheduler
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/home/<user>/bin/schedule-test.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
```
|
||||
|
||||
请注意 `<user>` 应该是你的家目录地址,但是单元文件路径名中的 `user` 实际上是字符串 `user`。
|
||||
|
||||
`ExecStart` 应该提供一个没有变量的绝对地址。例外情况是,对于用户单元文件,你可以用 `%h` 替换 `$HOME`。换句话说,你可以使用:
|
||||
|
||||
```
|
||||
ExecStart=%h/bin/schedule-test.sh
|
||||
```
|
||||
|
||||
这仅用于用户单元文件,而不适用于系统服务,因为在系统环境中运行时 `%h` 总是返回 `/root`。其他特殊符号可在 `man systemd.unit` 的 `SPECIFIERS` 中找到。因为它超出了本文的范围,所以这就是我们目前需要了解的关于特殊符号的全部内容。
|
||||
|
||||
3、创建一个 .timer 单元文件,该文件实际上调度你创建的 .service 单元文件。在 .service 单元文件相同位置创建它:`~/.config/systemd/user/schedule-test.timer`。请注意,文件名仅在扩展名上有所不同,例如一个是 `.service`,一个是 `.timer`。
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=Schedule a message every 1 minute
|
||||
RefuseManualStart=no # Allow manual starts
|
||||
RefuseManualStop=no # Allow manual stops
|
||||
|
||||
[Timer]
|
||||
#Execute job if it missed a run due to machine being off
|
||||
Persistent=true
|
||||
#Run 120 seconds after boot for the first time
|
||||
OnBootSec=120
|
||||
#Run every 1 minute thereafter
|
||||
OnUnitActiveSec=60
|
||||
#File describing job to execute
|
||||
Unit=schedule-test.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
```
|
||||
|
||||
请注意,这个 .timer 单元文件使用了 `OnUnitActiveSec` 来指定调度表。`OnCalendar` 选项更加灵活。例如:
|
||||
|
||||
```
|
||||
# run on the minute of every minute every hour of every day
|
||||
OnCalendar=*-*-* *:*:00
|
||||
# run on the hour of every hour of every day
|
||||
OnCalendar=*-*-* *:00:00
|
||||
# run every day
|
||||
OnCalendar=*-*-* 00:00:00
|
||||
# run 11:12:13 of the first or fifth day of any month of the year
|
||||
# 2012, but only if that day is a Thursday or Friday
|
||||
OnCalendar=Thu,Fri 2012-*-1,5 11:12:13
|
||||
```
|
||||
|
||||
有关 `OnCalendar` 的更多信息参见 [这里][2]。
|
||||
|
||||
4、所有的部件都已就位,但你应该进行测试,以确保一切正常。首先,启用该用户服务:
|
||||
|
||||
```
|
||||
$ systemctl --user enable schedule-test.service
|
||||
```
|
||||
|
||||
这将导致类似如下的输出:
|
||||
|
||||
```
|
||||
Created symlink /home/<user>/.config/systemd/user/default.target.wants/schedule-test.service → /home/<user>/.config/systemd/user/schedule-test.service.
|
||||
```
|
||||
|
||||
现在执行测试工作:
|
||||
|
||||
```
|
||||
$ systemctl --user start schedule-test.service
|
||||
```
|
||||
|
||||
检查你的输出文件(`$HOME/schedule-test-output.txt`),确保你的脚本运行正常。应该只有一个条目,因为我们还没有启动定时器。必要时进行调试。如果你需要更改 .service 单元文件,而不是更改它调用的 shell 脚本,请不要忘记再次启用该服务。
|
||||
|
||||
5、一旦作业正常运行,通过为服务启用、启动用户定时器来实时调度作业:
|
||||
|
||||
```
|
||||
$ systemctl --user enable schedule-test.timer
|
||||
$ systemctl --user start schedule-test.timer
|
||||
```
|
||||
|
||||
请注意,你已经在上面的步骤 4 中启动、启用了服务,因此只需要为它启用、启动定时器。
|
||||
|
||||
`enable` 命令会产生如下输出:
|
||||
|
||||
```
|
||||
Created symlink /home/<user>/.config/systemd/user/timers.target.wants/schedule-test.timer → /home/<user>/.config/systemd/user/schedule-test.timer.
|
||||
```
|
||||
|
||||
`start` 命令将只是返回命令行界面提示符。
|
||||
|
||||
### 其他操作
|
||||
|
||||
你可以检查和监控服务。如果你从系统服务收到错误,下面的第一个命令特别有用:
|
||||
|
||||
```
|
||||
$ systemctl --user status schedule-test
|
||||
$ systemctl --user list-unit-files
|
||||
```
|
||||
|
||||
手动停止服务:
|
||||
|
||||
```
|
||||
$ systemctl --user stop schedule-test.service
|
||||
```
|
||||
|
||||
永久停止并禁用定时器和服务,重新加载守护程序配置并重置任何失败通知:
|
||||
|
||||
```
|
||||
$ systemctl --user stop schedule-test.timer
|
||||
$ systemctl --user disable schedule-test.timer
|
||||
$ systemctl --user stop schedule-test.service
|
||||
$ systemctl --user disable schedule-test.service
|
||||
$ systemctl --user daemon-reload
|
||||
$ systemctl --user reset-failed
|
||||
```
|
||||
|
||||
### 总结
|
||||
|
||||
本文以 systemd 定时器为出发点,但是 systemd 的内容远不止于此。这篇文章应该为你提供一个基础。你可以从 [Fedora Magazine systemd 系列][3] 开始探索更多。
|
||||
|
||||
### 参考
|
||||
|
||||
更多阅读:
|
||||
|
||||
* `man systemd.timer`
|
||||
* `man systemd.service`
|
||||
* [Use systemd timers instead of cronjobs][4]
|
||||
* [Understanding and administering systemd][5]
|
||||
* <https://opensource.com/> 内有 systemd 速查表
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/systemd-timers-for-scheduling-tasks/
|
||||
|
||||
作者:[Richard England][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[dcoliversun](https://github.com/dcoliversun)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/rlengland/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2021/06/schedule_withsystemdtimer-816x345.jpg
|
||||
[2]: https://www.freedesktop.org/software/systemd/man/systemd.time.html#Calendar%20Events
|
||||
[3]: https://fedoramagazine.org/what-is-an-init-system/
|
||||
[4]: https://opensource.com/article/20/7/systemd-timers
|
||||
[5]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/
|
@ -0,0 +1,128 @@
|
||||
[#]: subject: "Here’s Why Switching to Linux Makes Sense in 2021"
|
||||
[#]: via: "https://news.itsfoss.com/switch-to-linux-in-2021/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "zepoch"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-13519-1.html"
|
||||
|
||||
为什么在 2021 年我仍然推荐你使用 Linux
|
||||
======
|
||||
|
||||

|
||||
|
||||
在某些领域,Linux 确实要比 Windows 和 macOS 更加优秀。人们正在意识到这一点,而且 Linux 也在桌面操作系统市场上变得愈发流行。
|
||||
|
||||
当然,目前大多数桌面操作系统用户仍然对 Windows 或者 macOS 推崇备至,但是也有着越来越多的用户开始尝试新的 Linux 发行版,看看他们是否可以从原来的系统切换到 Linux 系统。
|
||||
|
||||
他们可能已经听过 [用 Linux 作为桌面操作系统](https://news.itsfoss.com/linux-foundation-linux-desktop/) 的一些优秀案例,又或者是仅仅想要去尝试一些与原先不同的事物,谁知道呢?
|
||||
|
||||
在这里,我将为你解释为什么在 2021 年我仍然推荐你使用 Linux。
|
||||
|
||||
### Linux 真棒,但是究竟是什么让其在 2021 年值得推荐呢?
|
||||
|
||||
如果已经知道了 [使用 Linux 的优点](https://itsfoss.com/reasons-switch-linux-windows-xp/),你可能就知道接下来我会说些什么。
|
||||
|
||||
#### 1、你不需要购买许可证
|
||||
|
||||
![][3]
|
||||
|
||||
你必须付费才能获得 Windows 10 许可证。
|
||||
|
||||
虽然有更便宜的选择,如获得 OEM 密钥。但是,如果你不愿意通过一些地下网站,而是从官方网站获得许可证,那么仅授权使用 1 台 PC 的**家庭版**就至少需要花费 **140 美元**。
|
||||
|
||||
当然,macOS 是一个完全不同的模式(你需要购买先进的硬件才能使用 macOS)——所以我们才会一直使用微软的 Windows。
|
||||
|
||||
关键是,在失业的浪潮中,配置一台新电脑是一个挑战。此外,你还需要花钱购买操作系统的许可证,但是你却可以在多台计算机上免费使用 Linux。
|
||||
|
||||
是的,你不需要为 Linux 获取许可证密钥。你可以轻松下载 [Linux 发行版][4],并根据需要将其安装在尽可能多的设备上。
|
||||
|
||||
不要担心,如果你不了解 Linux 发行版,你可以看看我们的 [最好的 Linux 发行版](https://itsfoss.com/best-linux-distributions/) 列表。
|
||||
|
||||
#### 2、重新唤醒你的 PC 并节省资金
|
||||
|
||||
[全球芯片短缺](https://www.cnbc.com/2021/05/12/the-global-chip-shortage-could-last-until-2023-.html) 已经严重影响了电脑组件的价格,特别是**显卡**。并不是简单的价格上升,而是你不得不支付 **2 到 5 倍**的零售价来购得显卡。
|
||||
|
||||
当然,如果你没有电脑,现在配置一个新的电脑可能是难以置信的挑战,但如果你有一个旧电脑的话,选择在上面运行 Windows 10 将会是十分卡顿的。
|
||||
|
||||
如果你不想要 Windows 系统,那 macOS 呢?入门级 Mac 系统将会花费至少 **1100** 美金,甚至更多,这取决于你住在哪里。对许多人来说,这会是一笔昂贵的开销。
|
||||
|
||||
你肯定需要升级你的系统 —— 但是如果我说 Linux 可以让你的旧电脑重新派上用场,能为你省钱呢?
|
||||
|
||||
你将能够在你认为无法运行最新版本的微软 Windows 的电脑上运行 Linux。是的,就是这样的。
|
||||
|
||||
Linux 是一个资源高效型的操作系统,可在各种较旧的系统配置上运行。
|
||||
|
||||
所有你需要做的只是参考我们的列表 [轻量级 Linux 发行版][7],并选择一个你喜欢的。
|
||||
|
||||
#### 3、通过再次利用系统来减少电子浪费
|
||||
|
||||
![][8]
|
||||
|
||||
考虑到电子废物正在全球不断产生,尤其是由加密矿工产生的,我们可以尽量减少浪费。除非你真正需要新的硬件,否则最好将现有硬件设备重新用于新任务。
|
||||
|
||||
而且,多亏了 Linux,你可以将旧电脑或单片机转变成媒体服务器或个人 [Nextcloud][9] 服务器。
|
||||
|
||||
你可以在现有硬件上使用 Linux 做更多工作。
|
||||
|
||||
因此,这将显著降低对新硬件的需求,并让你高效地重复使用现有的设备。
|
||||
|
||||
#### 4、远离病毒和恶意软件
|
||||
|
||||
![][10]
|
||||
|
||||
在远程工作无处不在的时代,病毒和恶意软件显著增加。因此,即使你想平静地工作,你最终也可能受到恶意软件的影响。
|
||||
|
||||
Windows 和 macOS 比以往任何时候都更容易受到恶意软件的影响。但是,对于 Linux?这是不太可能的。
|
||||
|
||||
Linux 发行版会定期修补,以确保最佳安全性。
|
||||
|
||||
此外,正因为用户群体小,攻击者就不会花太多时间制作欺骗 Linux 用户的病毒或软件。因此,在使用 Linux 时遇到某种形式的恶意软件的机会较小。
|
||||
|
||||
#### 5、没有强制更新
|
||||
|
||||
![][11]
|
||||
|
||||
在一个人们压力倍增的时代,强制更新然后发现计算机无法启动可能是一大烦恼。
|
||||
|
||||
至少,Windows 用户的情况就是这样。
|
||||
|
||||
但是,使用 Linux,你可以继续使用你的系统,而无需在后台强制下载任何更新。
|
||||
|
||||
你的操作系统只有你能决定。
|
||||
|
||||
当你想要更新你的 Linux 发行版本时,你可以选择更新,也可以不更新,它可以一直保持不更新的状态并且不会打扰你,除非你有很长一段时间没有更新。
|
||||
|
||||
### 总结
|
||||
|
||||
这些只是我能想到的几个原因之一,Linux 作为操作系统的选择在 2021 年比以往任何时候都更值得被推荐。
|
||||
|
||||
当然,这也取决于你的要求,这些好处可能不会体现在在你的用例中。但是,如果你确实不了解 Linux,至少,现在你可以评估你的需求,重新作出选择。
|
||||
|
||||
除了上述几点之外,你还能想到什么?请在下面的评论中告诉我。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/switch-to-linux-in-2021/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[zepoch](https://github.com/zepoch)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://news.itsfoss.com/linux-foundation-linux-desktop/
|
||||
[2]: https://itsfoss.com/reasons-switch-linux-windows-xp/
|
||||
[3]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/license-agreement.jpg?w=1000&ssl=1
|
||||
[4]: https://itsfoss.com/what-is-linux-distribution/
|
||||
[5]: https://itsfoss.com/best-linux-distributions/
|
||||
[6]: https://www.cnbc.com/2021/05/12/the-global-chip-shortage-could-last-until-2023-.html
|
||||
[7]: https://itsfoss.com/lightweight-linux-beginners/
|
||||
[8]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/05/e-waste-illustration.jpg?w=800&ssl=1
|
||||
[9]: https://itsfoss.com/nextcloud/
|
||||
[10]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/05/system-malware.jpg?w=800&ssl=1
|
||||
[11]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/05/linux-system-update.jpg?w=800&ssl=1
|
@ -1,91 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (stevenzdg988)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How key Python projects are maintained)
|
||||
[#]: via: (https://opensource.com/article/20/2/python-maintained)
|
||||
[#]: author: (Moshe Zadka https://opensource.com/users/moshez)
|
||||
|
||||
How key Python projects are maintained
|
||||
======
|
||||
A peek behind the scenes of the community that keeps open source Python
|
||||
projects running smoothly.
|
||||
![and old computer and a new computer, representing migration to new software or hardware][1]
|
||||
|
||||
Jannis Leidel is part of the [Jazzband][2] community. Jazzband is a collaborative community that shares the responsibility of maintaining [Python][3]-based projects.
|
||||
|
||||
Jazzband was born out of the stress of maintaining an open source project alone for a longer time. Jannis is a roadie, which means he does administrative tasks and makes sure the people in the band can play when they want.
|
||||
|
||||
Jazzband is not his first open source volunteer work—he is a former [Django][4] core developer, [Django Software Foundation][5] board member, has written many Django apps and Python projects, has been a [pip][6] and [virtualenv][7] core developer and release manager, co-founded the [Python Packaging Authority][8], and been a [PyPI][9] admin. On the community front, he co-founded the German Django Association, served as [DjangoCon Europe][10] 2010 co-chairperson, has spoken at several conferences, and for the last year has served as a director and co-communication chair of the [Python Software Foundation][11].
|
||||
|
||||
### Moshe Zadka: How did you get started with programming?
|
||||
|
||||
Jannis Leidel: I got started with programming as part of the regular German computer science lessons in high school, where I dabbled with Turbo Pascal and Prolog. I quickly got drawn into the world of web development and wrote small websites with PHP3, [Perl5][12], and [MySQL][13]. Later at university, I picked up programming again while working on media arts projects and found [Ruby][14], Perl, and Python to be particularly helpful. I eventually stuck with Python for its versatility and ease of use. I'm very happy to have been able to use Python and open web technologies (HTML/JS/CSS) in my career since then.
|
||||
|
||||
### Zadka: How did you get started with open source?
|
||||
|
||||
Leidel: As part of an art project at university, I needed a way to talk to various web services and interact with some electronics and found my prior PHP skills not up to the task. So I took a class about programming with Python and got interested in learning more about how frameworks work—compared to libraries—as they further enshrine best practices that I wanted to know about. In particular, the nascent Django Web Framework really appealed to me since it favored a pragmatic approach and provided lots of guidance for how to develop web applications. In 2007 I participated as a student in the Google Summer of Code for Django and later contributed more to Django and its ecosystem of reusable components—after a while as a Django core developer as well. While finishing my degree, I was able to use those skills to work as a freelancer and also spend time on many different parts of the Django community. Moving laterally to the broader Python community was only natural at that point.
|
||||
|
||||
### Zadka: What do you for your day job?
|
||||
|
||||
Leidel: I'm a Staff Software Engineer at Mozilla, working on data tools for the Firefox data pipeline. In practice, that means I'm working in the broader Firefox Engineering team on various internal and public-facing web-based projects that help Mozilla employees and community members to make sense of the telemetry data that the Firefox web browser sends. Part of my current focus is maintaining our data analysis and visualization platform, which is based on the open source project [Redash][15], and also contributing back to it. Other projects that I contribute to are our next-gen telemetry system [Glean][16] and a tool that allows you to do data science in the browser (including the Scientific Python stack) called [Iodide][17].
|
||||
|
||||
### Zadka: How did you get involved with Jazzband?
|
||||
|
||||
Leidel: Back in 2015, I was frustrated with maintaining projects alone that a lot of people depended on and saw many of my community peers struggle with similar issues. I didn't know a good way to reach more people in the community who may also have an interest in long-term maintenance. On some occasions, I felt that the new "social coding" paradigm was rarely social and often rather isolating and sometimes even traumatic for old and new contributors. I believe the inequality in our community that I find intolerable nowadays was even more rampant at the time, which made providing a safe environment for contributors difficult—something which we now know is essential for stable project maintenance. I wondered if we were missing a more collaborative and inclusive approach to software development.
|
||||
|
||||
The Jazzband project was launched in an attempt to lower the barriers to entry for maintenance and simplify some of the more boring aspects of it (e.g., best practices around [CI][18]).
|
||||
|
||||
### Zadka: What is your favorite thing about Jazzband?
|
||||
|
||||
Leidel: My favorite thing about Jazzband is the fact that we've secured the maintenance of many projects that a lot of people depend on while also making sure that new contributors of any level of experience can join.
|
||||
|
||||
### Zadka: What is the job of a "roadie" in Jazzband?
|
||||
|
||||
Leidel: A "roadie" is a go-to person when it comes to all things behind the scenes for Jazzband. That means, for example, dealing with onboarding new projects, maintaining the Jazzband website that handles user management and project releases, acting as a first responder to security or Code of Conduct incidents, and much more. The term "roadies" is borrowed from the music and event industry for support personnel that takes care of almost everything that needs to be done while traveling on tour, except for the actual artistic performance. In Jazzband, they are there to make sure the members can work on the projects. That also means that some tasks are partially or fully automated, where it makes sense, and that best practices are applied to the majority of the Jazzband projects like packaging setup, documentation hosting or continuous integration.
|
||||
|
||||
### Zadka: What is the most challenging aspect of your job as a roadie for Jazzband?
|
||||
|
||||
Leidel: At the moment, the most challenging aspect of my job as a roadie is to implement improvements for Jazzband that community members have proposed without risking the workflow that they have come to rely on. In other words, scaling the project on a conceptual level has become more difficult the bigger Jazzband gets. There is a certain irony in the fact that I'm the only roadie at the moment and handle some of the tasks alone while Jazzband tries to prevent that from happening for its projects. This is a big concern for the future of Jazzband.
|
||||
|
||||
### Zadka: What would you say to someone who is wondering whether they should join Jazzband?
|
||||
|
||||
Leidel: If you're interested in joining a group of people who believe that working collaboratively is better than working alone, or if you have struggled with maintenance burden on your own and don't know how to proceed, consider joining Jazzband. It simplifies onboarding new contributors, provides a framework for disputes, and automates releases to [PyPI][19]. There are many best practices that work well for reducing the risk of projects becoming unmaintained.
|
||||
|
||||
### Zadka: Is there anything else you want to tell our readers?
|
||||
|
||||
Leidel: I encourage everyone working on open source projects to consider the people on the other side of the screen. Be empathetic and remember that your own experience may not be the experience of your peers. Understand that you are members of a global and diverse community, which requires us always to take leaps of respect for the differences between us.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/python-maintained
|
||||
|
||||
作者:[Moshe Zadka][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[stevenzdg988](https://github.com/stevenzdg988)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/moshez
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/migration_innovation_computer_software.png?itok=VCFLtd0q (and old computer and a new computer, representing migration to new software or hardware)
|
||||
[2]: https://jazzband.co/
|
||||
[3]: https://opensource.com/resources/python
|
||||
[4]: https://opensource.com/article/18/8/django-framework
|
||||
[5]: https://www.djangoproject.com/foundation/
|
||||
[6]: https://opensource.com/article/19/11/python-pip-cheat-sheet
|
||||
[7]: https://virtualenv.pypa.io/en/latest/
|
||||
[8]: https://www.pypa.io/en/latest/
|
||||
[9]: https://pypi.org/
|
||||
[10]: https://djangocon.eu/
|
||||
[11]: https://www.python.org/psf/
|
||||
[12]: http://opensource.com/article/18/1/why-i-love-perl-5
|
||||
[13]: https://opensource.com/life/16/10/all-things-open-interview-dave-stokes
|
||||
[14]: http://opensource.com/business/16/4/save-development-time-and-effort-ruby
|
||||
[15]: https://redash.io/
|
||||
[16]: https://firefox-source-docs.mozilla.org/toolkit/components/telemetry/start/report-gecko-telemetry-in-glean.html
|
||||
[17]: https://alpha.iodide.io/
|
||||
[18]: https://opensource.com/article/19/12/cicd-resources
|
||||
[19]: https://opensource.com/downloads/7-essential-pypi-libraries
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (stevenzdg988)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
@ -86,7 +86,7 @@ via: https://opensource.com/article/20/2/linux-open-source-music
|
||||
|
||||
作者:[Alan Formy-Duval][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[stevenzdg988](https://github.com/stevenzdg988)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,60 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (baddate)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Learn Bash with this book of puzzles)
|
||||
[#]: via: (https://opensource.com/article/20/4/bash-it-out-book)
|
||||
[#]: author: (Carlos Aguayo https://opensource.com/users/hwmaster1)
|
||||
|
||||
Learn Bash with this book of puzzles
|
||||
======
|
||||
'Bash it out' covers basic, medium, and advanced Bash scripting using 16
|
||||
puzzles.
|
||||
![Puzzle pieces coming together to form a computer screen][1]
|
||||
|
||||
Computers are both my hobby and my profession. I have about 10 of them scattered around my apartment, all running Linux (including my Macs). Since I enjoy upgrading my computers and my computer skills, when I came across [_Bash it out_][2] by Sylvain Leroux, I jumped on the chance to buy it. I use the command line a lot on Debian Linux, and it seemed like a great opportunity to expand my Bash knowledge. I smiled when the author explained in the preface that he uses Debian Linux, which is one of my two favorite distributions.
|
||||
|
||||
Bash lets you automate tasks, so it's a labor-saving, interesting, and useful tool. Before reading the book, I already had a fair amount of experience with Bash on Unix and Linux. I'm not an expert, in part because the scripting language is so extensive and powerful. I first became intrigued with Bash when I saw it on the welcome screen of [EndeavourOS][3], an Arch-based Linux distribution.
|
||||
|
||||
The following screenshots show some options from EndeavourOS. Beleieve it or not, these panels just point to Bash scripts, each of which accomplish some relatively complex tasks. And because it's all open source, I can modify any of these scripts if I want.
|
||||
|
||||
![EndeavourOS after install][4]
|
||||
|
||||
![EndeavourOS install apps][5]
|
||||
|
||||
### Always something to learn
|
||||
|
||||
My impressions of this book are very favorable. It's not long, but it is well-thought-out. The author has very extensive knowledge of Bash and an uncanny ability to explain how to use it. The book covers basic, medium, and advanced Bash scripting using 16 puzzles, which he calls "challenges." This taught me to see Bash scripting as a programming puzzle to solve, which makes it more interesting to play with.
|
||||
|
||||
An exciting aspect of Bash is that it's deeply integrated with the Linux system. While part of its power lies in its syntax, it's also powerful because it has access to so much. You can script repetitive tasks, or tasks that are easy but you're just tired of performing manually. Nothing is too great or too small, and _Bash it out_ helps you understand both what you can do, and how to achieve it.
|
||||
|
||||
This review would not be complete if I didn't mention David Both's free resource [_A sysadmin's guide to Bash scripting_][6] on Opensource.com. This 17-page PDF guide is different from _Bash it out_, but together they make a winning combination for anyone who wants to learn about it.
|
||||
|
||||
I am not a computer programmer, but _Bash it out_ has increased my desire to get into more advanced levels of Bash scripting—I might inadvertently end up as a computer programmer without planning to.
|
||||
|
||||
One reason I love Linux is because of how powerful and versatile the operating system is. However much I know about Linux, there is always something new to learn that makes me appreciate Linux even more.
|
||||
|
||||
In a competitive and ever-changing job market, it behooves all of us to continuously update our skills. This book helped me learn Bash in a very hands-on way. It almost felt as if the author was in the same room with me, patiently guiding me in my learning.
|
||||
|
||||
The author, Leroux, has an uncanny ability to engage readers. This is a rare gift that I think is even more valuable than his technical expertise. In fact, I am writing this book review to thank the author for anticipating my own learning needs; although we have never met, I have benefited in real ways from his gifts.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/bash-it-out-book
|
||||
|
||||
作者:[Carlos Aguayo][a]
|
||||
选题:[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/hwmaster1
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen)
|
||||
[2]: https://www.amazon.com/Bash-Out-Strengthen-challenges-difficulties/dp/1521773262/
|
||||
[3]: https://endeavouros.com/
|
||||
[4]: https://opensource.com/sites/default/files/uploads/endeavouros-welcome.png (EndeavourOS after install)
|
||||
[5]: https://opensource.com/sites/default/files/uploads/endeavouros-install-apps.png (EndeavourOS install apps)
|
||||
[6]: https://opensource.com/downloads/bash-scripting-ebook
|
@ -1,83 +0,0 @@
|
||||
[#]: subject: (What is a CI/CD pipeline?)
|
||||
[#]: via: (https://opensource.com/article/21/6/what-cicd-pipeline)
|
||||
[#]: author: (Will Kelly https://opensource.com/users/willkelly)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
What is a CI/CD pipeline?
|
||||
======
|
||||
How you define a continuous integration/continuous deployment pipeline
|
||||
depends on your organization's requirements.
|
||||
![Plumbing tubes in many directions][1]
|
||||
|
||||
A continuous integration/continuous deployment (CI/CD) pipeline is an anchor for every DevOps initiative. The CI/CD pipeline breaks down traditional silos and enables development and operations teams to collaborate throughout the entire software development lifecycle.
|
||||
|
||||
Better yet, moving to DevOps and a CI/CD pipeline can help your organization [deliver software][2] more securely at a higher velocity.
|
||||
|
||||
### Breaking down the CI/CD pipeline
|
||||
|
||||
There are many definitions of CI/CD pipelines out there, so I always advise organizations to define their own version of a CI/CD pipeline and other DevOps concepts rather than using someone else's. Open source CI/CD tools give you the freedom and options to construct a CI/CD pipeline that meets your organization's requirements.
|
||||
|
||||
The stages that form a CI/CD pipeline are distinct subsets of tasks grouped into _pipeline stages_. Typical pipeline stages include:
|
||||
|
||||
* **Build:** Developers compile the application code.
|
||||
* **Test**: The quality assurance (QA) team tests the application code using automated testing tools and strategies.
|
||||
* **Release:** The development team delivers the application code to the code repository.
|
||||
* **Deploy**: The DevOps team stages application code to production.
|
||||
* **Security and compliance**: The QA team validates a build based on the project's requirements. This is the stage where organizations deploy container-scanning tools that check the quality of images against Common Vulnerabilities and Exposures (CVEs).
|
||||
|
||||
|
||||
|
||||
These are standard stages for a CI/CD pipeline, yet some organizations adapt the CI/CD pipeline model to fit their requirements. For example, an organization building applications for the healthcare market, with its stringent compliance standards, may distribute the test, validation, and compliance gates throughout their toolchain.
|
||||
|
||||
Other examples might be an organization that depends on a complex software supply chain with open source software (OSS). Commercial components may institute a gate where development team members generate a [software bill of materials][3] (SBOM) for OSS packages or the outside commercial software vendor must deliver an SBOM as part of their contract deliverable.
|
||||
|
||||
### Barriers to CI/CD pipelines
|
||||
|
||||
Implementing a CI/CD pipeline changes a team's processes and culture. While many developers are receptive to automation of some tasks and testing, people can be a barrier to CI/CD adoption.
|
||||
|
||||
Moving from a waterfall process to CI/CD can shake up the fundamental and implied power structure in some organizations. Since a CI/CD pipeline increases software delivery velocity, the "gatekeepers" of your old manual process may feel threatened by this change.
|
||||
|
||||
### Integration opportunities
|
||||
|
||||
The open source roots of the tools comprising a CI/CD toolchain create opportunities for some exciting integrations as you achieve greater DevOps maturity levels in your culture, processes, and tooling.
|
||||
|
||||
Analyst firm Forrester predicted in 2020 that just-in-time learning will join the CI/CD pipeline. It makes sense if you think about it. It makes even more sense in the current era of remote work and even for remote onboarding of new employees. For instance, an organization could integrate a documentation wiki into its pipeline with documentation of internal processes.
|
||||
|
||||
A more ambitious organization can integrate a learning management system (LMS) such as [Moodle][4] into its CI/CD pipeline. It could use the LMS to publish short videos about new DevOps toolchain features that developers need to learn as they onboard or when tools are updated across the pipeline.
|
||||
|
||||
Some organizations are integrating group chat and other collaboration tools directly into their CI/CD pipelines. The chat platform serves alerts and enables collaboration and communication among teams. Integrating Mattermost, Rocket.Chat, or another [enterprise chat][5] platform into your CI/CD pipeline requires upfront planning and analysis to ensure that pipeline users won't drown in alerts.
|
||||
|
||||
Another integration opportunity to explore is building analytics and advanced reporting into your CI/CD pipeline. This helps you harness the data that courses through your pipeline.
|
||||
|
||||
### Final thoughts
|
||||
|
||||
The CI/CD pipeline is foundational to DevOps. And open source makes it adaptable and flexible to new requirements resulting from operational changes you implement during your DevOps journey.
|
||||
|
||||
I hope to see an open source response to the unified DevOps platform trend, in which organizations seek an end-to-end CI/CD solution. The makings of such a solution are out there. After all, GitLab and GitHub trace their platforms back to open source roots.
|
||||
|
||||
Lastly, don't forget the education and outreach underlying every successful CI/CD toolchain. Documenting your toolchains and accompanying processes will improve developer onboarding and ongoing DevOps team training.
|
||||
|
||||
How do you and your organization define your CI/CD toolchain? Please share your feedback in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/6/what-cicd-pipeline
|
||||
|
||||
作者:[Will Kelly][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/willkelly
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions)
|
||||
[2]: https://techbeacon.com/devops/5-reasons-why-cicd-vital-your-organizations-value-stream
|
||||
[3]: https://www.ntia.gov/SBOM
|
||||
[4]: https://moodle.org/
|
||||
[5]: https://opensource.com/alternatives/slack
|
@ -1,110 +0,0 @@
|
||||
[#]: subject: (KTorrent: An Incredibly Useful BitTorrent Application by KDE)
|
||||
[#]: via: (https://itsfoss.com/ktorrent/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
KTorrent: An Incredibly Useful BitTorrent Application by KDE
|
||||
======
|
||||
|
||||
There are a variety of BitTorrent applications available for Linux. But finding a good application that offers many features should save you some time.
|
||||
|
||||
KTorrent by KDE is one such BitTorrent app built for Linux.
|
||||
|
||||
While there are [several torrent clients for Linux][1], I recently found KTorrent interesting for my use-case.
|
||||
|
||||
### KTorrent: Open Source BitTorrent Client for Linux
|
||||
|
||||
![][2]
|
||||
|
||||
KTorrent is a full-fledged torrent client primarily tailored for KDE desktop. It should work simply fine no matter what desktop environment you use.
|
||||
|
||||
Of course, with KDE desktop, you may get a seamless user experience.
|
||||
|
||||
Let us look at the all the features offered.
|
||||
|
||||
### Features of KTorrent
|
||||
|
||||
![][3]
|
||||
|
||||
For regular torrent users, having an extensive set of features makes things easy. And KTorrent is no exception. Here, I’ll highlight the key highlights of KTorrent:
|
||||
|
||||
* Adding torrent downloads in a queue
|
||||
* Ability to control the speed limits per download (or overall)
|
||||
* Video and audio file preview option
|
||||
* Supports importing of downloaded files (partial/full)
|
||||
* Ability to prioritize torrent downloads when downloading multiple files
|
||||
* Selection of specific files to download for multi-file torrents
|
||||
* IP filter with the option of kicking/banning peers
|
||||
* UDP tracker support
|
||||
* µTorrent peer support
|
||||
* Support for protocol encryption
|
||||
* Ability to create trackerless torrent
|
||||
* Scripting support
|
||||
* System tray integration
|
||||
* Connection through a proxy
|
||||
* Added plugin support
|
||||
* Supports IPv6
|
||||
|
||||
|
||||
|
||||
KTorrent sounds something useful as a torrent client that you can use daily with control to manage all your torrent downloads at one place.
|
||||
|
||||
![][4]
|
||||
|
||||
In addition to the features mentioned above, it offers great control over the behavior of the client as well. For instance, tweaking the color that indicates downloads/pause/trackers.
|
||||
|
||||
You also get the ability to set the notification if you want to disable the sound of completing a torrent download or getting notified of the activity.
|
||||
|
||||
![][5]
|
||||
|
||||
While features like protocol encryption support may not be able to replace some of the [best VPN][6] services, it is an important addition for desktop clients.
|
||||
|
||||
### Installing KTorrent in Linux
|
||||
|
||||
KTorrent should be available through your package managers like [Synaptic][7] or the default repositories. You can also find it listed in your software center for easy installation.
|
||||
|
||||
In addition to this, it also offers a [Flatpak][8] official package on [Flathub][9] for any Linux distribution. If you need help with that, we have a [Flatpak guide][10] for reference.
|
||||
|
||||
You can also try the [snap package][11] available if you prefer that.
|
||||
|
||||
To explore more about it and the source code, head to its [official KDE app page][12].
|
||||
|
||||
[KTorrent][12]
|
||||
|
||||
### Closing Thoughts
|
||||
|
||||
KTorrent is a phenomenal torrent client for Linux. I tried it on my Linux Mint system on top of Cinnamon desktop, and it worked great.
|
||||
|
||||
I like how simple, yet configurable it is. Even though I don’t use a torrent client every day, I did not see anything weird with KTorrent in my brief testing.
|
||||
|
||||
What do you think about KTorrent as a torrent client for Linux? What do you prefer to use it instead?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/ktorrent/
|
||||
|
||||
作者:[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/best-torrent-ubuntu/
|
||||
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-download.png?resize=850%2C582&ssl=1
|
||||
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-configure.png?resize=850%2C656&ssl=1
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-speed-limit.png?resize=850%2C585&ssl=1
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-plugins.png?resize=850%2C643&ssl=1
|
||||
[6]: https://itsfoss.com/best-vpn-linux/
|
||||
[7]: https://itsfoss.com/synaptic-package-manager/
|
||||
[8]: https://itsfoss.com/what-is-flatpak/
|
||||
[9]: https://flathub.org/apps/details/org.kde.ktorrent
|
||||
[10]: https://itsfoss.com/flatpak-guide/
|
||||
[11]: https://snapcraft.io/ktorrent
|
||||
[12]: https://apps.kde.org/ktorrent/
|
@ -2,7 +2,7 @@
|
||||
[#]: via: (https://fedoramagazine.org/python-3-10-beta-in-fedora-linux/)
|
||||
[#]: author: (Miro Hrončok https://fedoramagazine.org/author/churchyard/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
129
sources/tech/20210624 Copy files between Linux and FreeDOS.md
Normal file
129
sources/tech/20210624 Copy files between Linux and FreeDOS.md
Normal file
@ -0,0 +1,129 @@
|
||||
[#]: subject: (Copy files between Linux and FreeDOS)
|
||||
[#]: via: (https://opensource.com/article/21/6/copy-files-linux-freedos)
|
||||
[#]: author: (Jim Hall https://opensource.com/users/jim-hall)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
Copy files between Linux and FreeDOS
|
||||
======
|
||||
Here's how I transfer files between my FreeDOS virtual machine and my
|
||||
Linux desktop system.
|
||||
![Files in a folder][1]
|
||||
|
||||
I run Linux as my primary operating system, and I boot FreeDOS in a virtual machine. Most of the time, I use QEMU as my PC emulator, but sometimes I'll run other experiments with GNOME Boxes (which uses QEMU as a back-end virtual machine) or with VirtualBox.
|
||||
|
||||
I like to play classic DOS games, and sometimes I'll bring up a favorite DOS application. I teach a Management Information Systems (MIS) class where I talk about the history of computing, and I'll sometimes record a demonstration using FreeDOS and a legacy DOS application, such as As-Easy-As (my favorite DOS spreadsheet—once released as "shareware" but now available [for free from TRIUS, Inc][2]).
|
||||
|
||||
But using FreeDOS this way means I need to transfer files between my FreeDOS virtual machine and my Linux desktop system. Let me show you how I do that.
|
||||
|
||||
### Accessing the image with guestmount
|
||||
|
||||
I used to access my virtual disk image by calculating the offset to the first DOS partition, then calling the Linux `mount` command with the right mix of options to match that offset. This was always error-prone and not very flexible. Fortunately, there's an easier way to do it. The `guestmount` program from the [libguestfs-tools][3] package lets you access or _mount_ the virtual disk image from Linux. You can install `libguestfs-tools` using this command on Fedora:
|
||||
|
||||
|
||||
```
|
||||
`$ yum install libguestfs-tools libguestfs`
|
||||
```
|
||||
|
||||
Using `guestmount` is not as easy as double-clicking the file from the GNOME file manager, but the command line isn't too difficult to use. The basic usage of `guestmount` is:
|
||||
|
||||
|
||||
```
|
||||
`$ guestmount -a image -m device mountpoint`
|
||||
```
|
||||
|
||||
In this usage, _image_ is the virtual disk image to use. On my system, I created my QEMU virtual disk image with the `qemu-img` command. The g`uestmount` program can read this disk image format, as well as the QCOW2 image format used by GNOME Boxes, or the VDI image format used in VirtualBox.
|
||||
|
||||
The _device_ option indicates the partition on the virtual disk. Imagine using this virtual disk as a real hard drive. You would access the first partition as `/dev/sda1`, the second partition as `/dev/sda2`, and so on. That's the syntax for `guestmount`. By default, FreeDOS 1.3 RC4 creates one partition on an empty drive, so access that partition as `/dev/sda1`.
|
||||
|
||||
And _mountpoint_ is the location to "mount" the DOS filesystem on your local Linux system. I'll usually create a temporary directory to work with. You only need the mount point while you're accessing the virtual disk.
|
||||
|
||||
Putting that all together, I use this set of commands to access my FreeDOS virtual disk image from Linux:
|
||||
|
||||
|
||||
```
|
||||
$ mkdir /tmp/freedos
|
||||
$ guestmount -a freedos.img -m /dev/sda1 /tmp/freedos
|
||||
```
|
||||
|
||||
After that, I can access my FreeDOS files via the `/tmp/freedos` directory, using normal tools on Linux. I might use `ls /tmp/freedos` at the command line, or open the `/tmp/freedos` mount point using the desktop file manager.
|
||||
|
||||
|
||||
```
|
||||
$ ls -l /tmp/freedos
|
||||
total 216
|
||||
drwxr-xr-x. 5 root root 8192 May 10 15:53 APPS
|
||||
-rwxr-xr-x. 1 root root 85048 Apr 30 07:54 COMMAND.COM
|
||||
-rwxr-xr-x. 1 root root 103 May 13 15:48 CONFIG.SYS
|
||||
drwxr-xr-x. 5 root root 8192 May 15 16:52 DEVEL
|
||||
drwxr-xr-x. 2 root root 8192 May 15 13:36 EDLIN
|
||||
-rwxr-xr-x. 1 root root 1821 May 10 15:57 FDAUTO.BAT
|
||||
-rwxr-xr-x. 1 root root 740 May 13 15:47 FDCONFIG.SYS
|
||||
drwxr-xr-x. 10 root root 8192 May 10 15:49 FDOS
|
||||
-rwxr-xr-x. 1 root root 46685 Apr 30 07:54 KERNEL.SYS
|
||||
drwxr-xr-x. 2 root root 8192 May 10 15:57 SRC
|
||||
-rwxr-xr-x. 1 root root 3190 May 16 08:34 SRC.ZIP
|
||||
drwxr-xr-x. 3 root root 8192 May 11 18:33 TEMP
|
||||
```
|
||||
|
||||
![GNOME file manager][4]
|
||||
|
||||
Using GNOME file manager to access the virtual disk
|
||||
(Jim Hall, [CC-BY SA 4.0][5])
|
||||
|
||||
For example, to copy several C source files from my Linux `projects` directory into `C:\SRC` on the virtual disk image, so I can use the files under FreeDOS later, I can use the Linux `cp` command:
|
||||
|
||||
|
||||
```
|
||||
`$ cp /home/jhall/projects/*.c /tmp/freedos/SRC`
|
||||
```
|
||||
|
||||
The files and directories on the virtual drive are technically _case insensitive_, so you can refer to them using uppercase or lowercase letters. However, I find it more natural to type DOS files and directories using all uppercase.
|
||||
|
||||
|
||||
```
|
||||
$ ls /tmp/freedos
|
||||
APPS CONFIG.SYS EDLIN FDCONFIG.SYS KERNEL.SYS SRC.ZIP
|
||||
COMMAND.COM DEVEL FDAUTO.BAT FDOS SRC TEMP
|
||||
|
||||
$ ls /tmp/freedos/EDLIN
|
||||
EDLIN.EXE MAKEFILE.OW
|
||||
|
||||
$ ls /tmp/freedos/edlin
|
||||
EDLIN.EXE MAKEFILE.OW
|
||||
```
|
||||
|
||||
### Unmounting with guestmount
|
||||
|
||||
You should always _unmount_ the virtual disk image before you use it again in your virtual machine. If you leave the image mounted while you run QEMU or VirtualBox, you risk messing up your files.
|
||||
|
||||
The companion command to `guestmount` is `guestunmount`, to unmount the disk image. Just give the mount point that you wish to unmount:
|
||||
|
||||
|
||||
```
|
||||
`$ guestunmount /tmp/freedos`
|
||||
```
|
||||
|
||||
Note that this command is spelled slightly differently from the Linux `umount` system command.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/6/copy-files-linux-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/files_documents_paper_folder.png?itok=eIJWac15 (Files in a folder)
|
||||
[2]: http://www.triusinc.com/forums/viewtopic.php?t=10
|
||||
[3]: https://libguestfs.org/
|
||||
[4]: https://opensource.com/sites/default/files/uploads/gnome-file-manager.png (Using GNOME file manager to access the virtual disk)
|
||||
[5]: https://creativecommons.org/licenses/by-sa/4.0/
|
192
sources/tech/20210624 Linux package management with apt.md
Normal file
192
sources/tech/20210624 Linux package management with apt.md
Normal file
@ -0,0 +1,192 @@
|
||||
[#]: 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: <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.
|
||||
|
||||
$
|
||||
```
|
||||
|
||||
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
|
@ -0,0 +1,201 @@
|
||||
[#]: subject: (View statistics about your code with Tokei)
|
||||
[#]: via: (https://opensource.com/article/21/6/tokei)
|
||||
[#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
View statistics about your code with Tokei
|
||||
======
|
||||
Learn details about projects' programming languages and more.
|
||||
![A screen of code.][1]
|
||||
|
||||
Recently, GitHub added a small indicator that shows details about projects, including what programming languages a project uses. Before this, it was hard for new contributors to know this type of information about the projects they were interested in.
|
||||
|
||||
This addition is helpful, but what if you want to know the same information about projects in your local repository? That's where [Tokei][2] comes in handy. It's a tool that tells you code statistics about a project, which is especially useful when you want to build a project with people who are proficient in different languages.
|
||||
|
||||
### Exploring Tokei
|
||||
|
||||
According to its [README][3], "Tokei is a program that displays statistics about your code. Tokei will show the number of files, total lines within those files and code, comments, and blanks grouped by language." The introduction to its v.12.1.0 release [elaborates][4], "Tokei is a fast and accurate code analysis CLI tool and library, allowing you to easily and quickly see how many blank lines, comments, and lines of code are in your codebase." It can identify over 150 programming languages.
|
||||
|
||||
|
||||
```
|
||||
$ ./tokei ~/exa/src ~/Work/wildfly/jaxrs
|
||||
==================
|
||||
Language Files Lines Code Comments Blank
|
||||
Java 46 6135 4324 945 632
|
||||
XML 23 5211 4839 473 224
|
||||
\---------------------------------
|
||||
Rust
|
||||
Markdown
|
||||
\-----------------------------------
|
||||
Total
|
||||
```
|
||||
|
||||
### Install Tokei
|
||||
|
||||
To install Tokei in Fedora:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install tokei`
|
||||
```
|
||||
|
||||
To install it with Rust's Cargo package manager:
|
||||
|
||||
|
||||
```
|
||||
`$ cargo install tokei`
|
||||
```
|
||||
|
||||
### Use Tokei
|
||||
|
||||
To list code statistics for the current directory:
|
||||
|
||||
|
||||
```
|
||||
$ tokei
|
||||
===============================================================================
|
||||
Language Files Lines Code Comments Blanks
|
||||
===============================================================================
|
||||
Ada 10 2840 1681 560 599
|
||||
Assembly 4 2508 1509 458 541
|
||||
GNU Style Assembly 4 2751 1528 748 475
|
||||
Autoconf 16 2294 1153 756 385
|
||||
Automake 1 45 34 0 11
|
||||
BASH 4 1895 1602 133 160
|
||||
Batch 2 4 4 0 0
|
||||
C 330 206433 150241 23402 32790
|
||||
C Header 342 60941 24682 29143 7116
|
||||
CMake 48 4572 3459 548 565
|
||||
C# 9 1615 879 506 230
|
||||
C++ 5 907 599 136 172
|
||||
Dockerfile 2 16 10 0 6
|
||||
Fish 1 87 77 5 5
|
||||
HTML 1 545 544 1 0
|
||||
JSON 5 8995 8995 0 0
|
||||
Makefile 10 504 293 72 139
|
||||
Module-Definition 12 1183 1046 65 72
|
||||
MSBuild 1 141 140 0 1
|
||||
Pascal 4 1443 1016 216 211
|
||||
Perl 2 189 137 16 36
|
||||
Python 4 1257 949 112 196
|
||||
Ruby 1 23 18 1 4
|
||||
Shell 15 1860 1411 222 227
|
||||
Plain Text 35 29425 0 26369 3056
|
||||
TOML 64 3180 2302 453 425
|
||||
Visual Studio Pro| 30 14597 14597 0 0
|
||||
Visual Studio Sol| 6 655 650 0 5
|
||||
XML 1 116 95 17 4
|
||||
YAML 2 81 56 12 13
|
||||
Zsh 1 59 48 8 3
|
||||
\-------------------------------------------------------------------------------
|
||||
Markdown 55 4677 0 3214 1463
|
||||
|- C 1 2 2 0 0
|
||||
|- Rust 19 336 268 20 48
|
||||
|- TOML 23 61 60 0 1
|
||||
(Total) 5076 330 3234 1512
|
||||
\-------------------------------------------------------------------------------
|
||||
Rust 496 210966 188958 5348 16660
|
||||
|- Markdown 249 17676 1551 12502 3623
|
||||
(Total) 228642 190509 17850 20283
|
||||
===============================================================================
|
||||
Total 1523 566804 408713 92521 65570
|
||||
===============================================================================
|
||||
$
|
||||
```
|
||||
|
||||
The following command prints out the supported languages and extensions:
|
||||
|
||||
|
||||
```
|
||||
$ tokei -l
|
||||
ABNF
|
||||
ABAP
|
||||
ActionScript
|
||||
Ada
|
||||
Agda
|
||||
Alex
|
||||
Alloy
|
||||
Arduino C++
|
||||
AsciiDoc
|
||||
ASN.1
|
||||
ASP
|
||||
ASP.NET
|
||||
Assembly
|
||||
GNU Style Assembly
|
||||
```
|
||||
|
||||
If you run `tokei` on two files and specify their location as an argument, it prints the stats for individual files in a last-in-first-out format:
|
||||
|
||||
![Running Tokei on two files][5]
|
||||
|
||||
(Sudeshna Sur, [CC BY-SA 4.0][6])
|
||||
|
||||
By default, `tokei` outputs only data about the languages used, but using the `--files` flag provides individual file statistics:
|
||||
|
||||
|
||||
```
|
||||
$ tokei ~/exa/src --files
|
||||
===========================================================================================
|
||||
Language Files Lines Code Comments Blanks
|
||||
===========================================================================================
|
||||
Rust 54 9339 7070 400 1869
|
||||
|- Markdown 33 1306 0 1165 141
|
||||
(Total) 10645 7070 1565 2010
|
||||
\-------------------------------------------------------------------------------------------
|
||||
/home/ssur/exa/src/theme/default_theme.rs 130 107 0 23
|
||||
/home/ssur/exa/src/output/render/times.rs 30 24 0 6
|
||||
/home/ssur/exa/src/output/render/users.rs 98 76 0 22
|
||||
/home/ssur/exa/src/output/render/size.rs 182 141 3 38
|
||||
/home/ssur/exa/src/output/render/octal.rs 116 88 0 28
|
||||
/home/ssur/exa/src/output/render/mod.rs 33 20 3 10
|
||||
/home/ssur/exa/src/output/render/inode.rs 28 20 0 8
|
||||
/home/ssur/exa/src/output/render/links.rs 87 65 0 22
|
||||
/home/ssur/exa/src/output/render/groups.rs 123 93 0 30
|
||||
|ome/ssur/exa/src/output/render/filetype.rs 31 26 0 5
|
||||
/home/ssur/exa/src/output/render/blocks.rs 57 40 0 17
|
||||
/home/ssur/exa/src/output/render/git.rs 108 87 0 21
|
||||
|/ssur/exa/src/output/render/permissions.rs 204 160 3 41
|
||||
/home/ssur/exa/src/output/grid.rs 67 51 3 13
|
||||
/home/ssur/exa/src/output/escape.rs 26 18 4 4
|
||||
/home/ssur/exa/src/theme/lsc.rs 235 158 39 38
|
||||
/home/ssur/exa/src/options/theme.rs 159 124 6 29
|
||||
/home/ssur/exa/src/options/file_name.rs 46 39 0 7
|
||||
/home/ssur/exa/src/options/flags.rs 84 63 6 15
|
||||
/home/ssur/exa/src/fs/mod.rs 10 8 0 2
|
||||
/home/ssur/exa/src/fs/feature/mod.rs 33 25 0 8
|
||||
\-- /home/ssur/exa/src/output/time.rs ---------------------------------------------------------------
|
||||
|- Rust 215 170 5 40
|
||||
|- Markdown 28 0 25 3
|
||||
```
|
||||
|
||||
### Conclusion
|
||||
|
||||
I found it very easy to use `tokei` to learn more about my code statistics. Another good thing about `tokei` is that it can be used as a library, which makes it easy to integrate into other projects. Visit Tokei's [Crate.io page][7] and [Docs.rs][8] to learn more about its usage. If you would like to get involved, you can also contribute to Tokei through its [GitHub repository][2].
|
||||
|
||||
Do you find Tokei useful? Let us know in the comments section below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/6/tokei
|
||||
|
||||
作者:[Sudeshna Sur][a]
|
||||
选题:[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/sudeshna-sur
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_development_programming_screen.png?itok=BgcSm5Pl (A screen of code.)
|
||||
[2]: https://github.com/XAMPPRocky/tokei
|
||||
[3]: https://github.com/XAMPPRocky/tokei/blob/master/README.md
|
||||
[4]: https://github.com/XAMPPRocky/tokei/releases/tag/v12.1.0
|
||||
[5]: https://opensource.com/sites/default/files/uploads/tokei-two-files_0.png (Running Tokei on two files)
|
||||
[6]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[7]: https://crates.io/crates/tokei
|
||||
[8]: https://docs.rs/tokei/12.1.2/tokei/
|
@ -0,0 +1,161 @@
|
||||
[#]: subject: (9 Features in Brave Search That Make it a Great Google Search Alternative)
|
||||
[#]: via: (https://itsfoss.com/brave-search-features/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
9 Features in Brave Search That Make it a Great Google Search Alternative
|
||||
======
|
||||
|
||||
Brave Search is an ambitious initiative by Brave Software based on the open-source project [Tailcat][1], which tries to take on the big tech by introducing the ability to search anonymously. Brave Search itself is [not open source at the moment][2].
|
||||
|
||||
Of course, there are various other [private search engines][3] available out there trying to offer a privacy-focused experience. Even though not every service proves to be better than Google (regarding features), Brave Search seems to be a compelling choice when considering Brave Browser as a successful open-source replacement to Google Chrome.
|
||||
|
||||
Here, let me highlight a few features in Brave Search that makes it an interesting alternative to Google Search.
|
||||
|
||||
### Top 9 Brave Search Features
|
||||
|
||||
Brave Search does a few things better than Google and those are worth highlighting as unique feature offerings that sets it apart.
|
||||
|
||||
Brave Search is in beta at the time of writing this article. If you notice something different with your experience, there are chances that they may have made an improvement/change. Let me know in the comments below if that’s the case.
|
||||
|
||||
#### 1\. Anonymous Search
|
||||
|
||||
![][4]
|
||||
|
||||
Google tracks your search queries, keeps a log of your history (unless you manually delete it or disable recording your activity). Not just the basics, but your IP address and the website you visit from the search result is also recorded in the process.
|
||||
|
||||
In contrast, Brave Search does not track the IP, or the search queries made using their search portal.
|
||||
|
||||
You stay completely anonymous, along with your search history being private only to yourself.
|
||||
|
||||
This could eliminate the need of using a [secure VPN service][5] to keep your Internet search activity private.
|
||||
|
||||
#### 2\. Ad-Free Version (Coming Soon)
|
||||
|
||||
![][6]
|
||||
|
||||
All the private search engines include advertisements to make money (which is fair). The advertisements used by Google Search include trackers when you click on it, which is not the case with privacy-focused search engines.
|
||||
|
||||
But Brave Search tries to go a little further by offering a choice to the users.
|
||||
|
||||
It is a feature that has been planned for addition, but it is worth mentioning. If you want to get rid of the ads, you can opt for the paid version of the search engine where you can explore the web ad-free.
|
||||
|
||||
I think that’s a win-win for both Brave and you as a user. They do not lose on making revenue and you get to experience a truly ad-free search engine.
|
||||
|
||||
#### 3\. Community Curated Search Rankings (Coming Soon)
|
||||
|
||||
Users can help spot the quality of a web resource better than an algorithm often.
|
||||
|
||||
So, Brave Search aims to work on a community-curated search ranking system, which will be open to all when it is available.
|
||||
|
||||
This should improve the collaborative approach of exploring the web, which should be an impressive feature of Brave Search.
|
||||
|
||||
#### 4\. Independent Index with No Search Algorithm
|
||||
|
||||
![][7]
|
||||
|
||||
With most of the other search engines, there’s an algorithm in place to make sure that only the high-quality web pages rank above the rest. Brave Search does not have any special algorithm controlling the search rankings.
|
||||
|
||||
And yes, that is a feature in a world where everything depends on algorithms.
|
||||
|
||||
Sometimes that algorithm ends up being biased by ranking plagiarism content first, low-quality web pages, along with a few other issues.
|
||||
|
||||
Without any special search algorithm, Brave search uses its own Index to fetch results as per your queries.
|
||||
|
||||
#### 5\. Private Local and Global Search Results
|
||||
|
||||
![][8]
|
||||
|
||||
No matter what region you choose for the search results, you get an additional option to filter your results based on your locality (IP address).
|
||||
|
||||
Brave explains that the IP address is stored locally on your device and is used to serve you the local feed of results – which sounds useful.
|
||||
|
||||
![][9]
|
||||
|
||||
#### 6\. Transparency in Search Results
|
||||
|
||||
![][10]
|
||||
|
||||
The web is a vast network. Therefore, to keep the search result quality resourceful, Brave Search fetches some search results anonymously from Google and Bing (which is often less than 10% in my tests).
|
||||
|
||||
For the rest of the results, Brave Search relies on its independent index. Brave Search also displays the percent of its independent search index used for your search.
|
||||
|
||||
The more users start using Brave Search, the more independent the search results will become. So that’s a good thing.
|
||||
|
||||
Considering not all search engines reveal a lot about their search results, Transparency, as a principle, can be a feature to compare with when choosing a search engine.
|
||||
|
||||
![][11]
|
||||
|
||||
#### [Brave: Open Source Web Browser That Blocks Ads and Tracking By Default][12]
|
||||
|
||||
An open source web browser that blocks ads and tracking. A good choice if you are looking for a privacy focused web browser. Here’s how to install Brave on Linux.
|
||||
|
||||
#### 7\. A Refreshing User Interface
|
||||
|
||||
While every other Google search alternative tries to offer a familiar experience, Brave Search is actually refreshing to look at (in my opinion).
|
||||
|
||||
![][13]
|
||||
|
||||
The user interface looks well-thought and offers a modern, clean experience. Don’t you think?
|
||||
|
||||
I like how DuckDuckGo simplifies things, but Brave certainly makes it up for a better user experience that looks unique and clean.
|
||||
|
||||
#### 8\. No Anti-Competitive Nature
|
||||
|
||||
Unlike some other search engines (especially, Google) do not suggest anything else explicitly, except their own products and services in their search results.
|
||||
|
||||
That’s fair but potentially also anti-competitive, being the most popular search engine. They do have their reasons which we don’t have to talk about here, but giving a shout-out to your competitors is something new businesses/services are adopting.
|
||||
|
||||
![][14]
|
||||
|
||||
And Brave Search does an excellent jobat that. While you scroll through the search results, you will find a choice to use other search engines for your search query.
|
||||
|
||||
#### 9\. Dark Mode & Tweaks
|
||||
|
||||
Yes, the dark mode is an important feature (sigh).
|
||||
|
||||
![][15]
|
||||
|
||||
And from the settings available in Brave Search, you can **turn on the dark mode**, **set links to open in a new tab,** and **control the language** (soon).
|
||||
|
||||
![][16]
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
Brave Search is an interesting private search engine that aims to tackle the Big Tech by offering something new. It should be seamless user experience when [using Brave Browser][12] along with it, but you can use it on any browser without any limitations.
|
||||
|
||||
I like what I see here, what do you think? Let me know your thoughts in the comments below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/brave-search-features/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.tailcat.com
|
||||
[2]: https://www.reddit.com/r/brave_browser/comments/o5qknc/announcement_brave_search_beta_now_available_in/h2p3q22?utm_source=share&utm_medium=web2x&context=3
|
||||
[3]: https://itsfoss.com/privacy-search-engines/
|
||||
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-search-anonymous.png?resize=800%2C530&ssl=1
|
||||
[5]: https://itsfoss.com/best-vpn-linux/
|
||||
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/paid-no-ads-brave.png?resize=800%2C450&ssl=1
|
||||
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-search-sample.png?resize=800%2C586&ssl=1
|
||||
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-local-global-search.png?resize=800%2C228&ssl=1
|
||||
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-anonymous-local-results.png?resize=800%2C589&ssl=1
|
||||
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-search-transparency.png?resize=800%2C654&ssl=1
|
||||
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/09/brave-browser-1-e1573731875389.jpeg?resize=150%2C150&ssl=1
|
||||
[12]: https://itsfoss.com/brave-web-browser/
|
||||
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-search-ui.png?resize=800%2C590&ssl=1
|
||||
[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-search-competitors.png?resize=800%2C502&ssl=1
|
||||
[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-search-dark-mode.png?resize=800%2C573&ssl=1
|
||||
[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-search-settings.png?resize=483%2C389&ssl=1
|
@ -1,131 +0,0 @@
|
||||
[#]: subject: "Here’s Why Switching to Linux Makes Sense in 2021"
|
||||
[#]: via: "https://news.itsfoss.com/switch-to-linux-in-2021/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "zepoch"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
为什么在2021年我仍然推荐你使用Linux
|
||||
======
|
||||
|
||||
在某些领域,Linux确实要比Windows和macOS要更加优秀。人们也开始意识到这一点,而且Linux也在桌面操作系统应用市场中也在变得愈发流行。
|
||||
|
||||
当然,目前大多数桌面操作系统用户仍然使用的是 Windows 或者 macOS, 但是也有着越来越多的用户开始尝试新的 Linux 发行版本,看看他们是否可以从原来的系统切换到 Linux 系统。
|
||||
|
||||
他们可能已经听过[用 Linux 作为桌面操作系统](https://news.itsfoss.com/linux-foundation-linux-desktop/)的一些优秀案例,又或者是仅仅想要去尝试一些与原先不同的事物,谁知道呢?
|
||||
|
||||
在这里,我将为你解释为什么在2021年我仍然推荐你使用Linux。
|
||||
|
||||
### Linux 是伟大的,但是究竟是什么让其在 2021 年更被推荐呢?
|
||||
|
||||
如果已经知道了[使用 Linux 的优点](https://itsfoss.com/reasons-switch-linux-windows-xp/),你可能就知道接下来我会说些什么。
|
||||
|
||||
#### 1\. 你不需要购买一个许可证
|
||||
|
||||
![][3]
|
||||
|
||||
你必须支付购买才能获得 Windows 10 许可证。
|
||||
|
||||
虽然有更便宜的选择,如获得OEM密钥。但是,如果您不愿意通过一些特别的网站,而是从官方网站获得许可证,那么仅授权使用 1 台 PC 的**家庭版**就至少需要花费 **140 美元**.
|
||||
|
||||
当然,macOS是一个完全不同的模式(你需要购买高级硬件才能使用macOS)——所以我们才会一直使用微软的 Windows。
|
||||
|
||||
关键是——在失业的浪潮中,组件一台新电脑是一个挑战。此外,您还需要花钱购买操作系统的许可证,但是你却可以在多台计算机上免费使用 Linux。
|
||||
|
||||
是的,您不需要为 Linux 获取许可证密钥。您可以轻松下载 [Linux 发行版][4],并根据需要将其安装在尽可能多的设备上。
|
||||
|
||||
不要担心, 如果你不知道 Linux 发行, 你可以看看我们的[最好的 Linux 发行版](https://itsfoss.com/best-linux-distributions/)的列表。
|
||||
|
||||
#### 2\. 恢复现有的PC并节省资金
|
||||
|
||||
[全球芯片短缺](https://www.cnbc.com/2021/05/12/the-global-chip-shortage-could-last-until-2023-.html)已经严重影响了电脑组件的价格,特别是**显卡**。并不是简单的价格上升,而是你不得不支付 **2 到 5 倍**的零售价来购得显卡。
|
||||
|
||||
当然,如果你没有电脑,现在组建一个新的电脑可能是难以置信的挑战,但如果你有一个旧电脑的话,选择在上面运行 Windows 10 将会是十分卡顿的。
|
||||
|
||||
如果你不想要一个 Windows 的系统,那 macOS 呢?入门级 Mac 系统将会花费至少 **1100** 美金,这取决于你住在哪里。对许多人来说,这会是一笔昂贵的开销。
|
||||
|
||||
你肯定需要升级你的系统——但是如果我说 Linux 可以让你的旧电脑重新派上用场,也能为你省钱呢?
|
||||
|
||||
您将能够在您认为无法运行最新版本的 Microsoft Windows 的电脑上运行 Linux。是的,这是正确的。
|
||||
|
||||
Linux 是一个资源高效型的操作系统,可在各种较旧的系统配置上运行。
|
||||
|
||||
所有你需要做的只是参考我们的列表 [轻量级 Linux 分布][7], 并选择一个你喜欢的。
|
||||
|
||||
#### 3\. 通过恢复系统减少电子浪费
|
||||
|
||||
![][8]
|
||||
|
||||
考虑到电子废物正在全球不断产生,尤其是矿工,我们可以尽量减少浪费。除非您真正需要新的硬件,否则最好将现有硬件设备重新用于新任务。
|
||||
|
||||
而且,多亏了 Linux,您可以将旧电脑或单片机转到媒体服务器或个人[Nextcloud][9] 服务器。
|
||||
|
||||
您可以在现有硬件上使用 Linux 做更多工作。
|
||||
|
||||
因此,这将显著降低对新硬件的需求,并让您高效地重复使用现有的设备。
|
||||
|
||||
#### 4\. 远离病毒和恶意软件
|
||||
|
||||
![][10]
|
||||
|
||||
在远程工作无处不在的时代,病毒和恶意软件显著增加。因此,即使您想和平地工作,您最终也可能受到恶意软件的影响。
|
||||
|
||||
Windows 和 macOS 都比以往任何时候都更容易受到恶意软件的影响。但是,对于Linux?这是极不可能的。
|
||||
|
||||
Linux 发行版被定期修补,以确保最佳安全性。
|
||||
|
||||
此外,因为用户群很小,攻击者就不会花太多时间制作欺骗 Linux 用户的病毒或软件。因此,在使用 Linux 时遇到某种形式的恶意软件的机会较小。
|
||||
|
||||
#### 5\. 没有强制更新
|
||||
|
||||
![][8]
|
||||
|
||||
在一个人们压力倍增的时代,强制更新和发现计算机无法启动可能是一大烦恼。
|
||||
|
||||
至少,Windows 用户的情况就是这样。
|
||||
|
||||
但是,使用 Linux,您可以继续使用您的系统,而无需在后台强制下载任何更新。
|
||||
|
||||
你的操作系统只有你能决定。
|
||||
|
||||
当你想要更新你的 Linux 发行版本时,你可以选择更新,也可以不更新,它可以一直保持不更新的状态并且不会打扰你,除非你有很长一段时间没有更新。
|
||||
|
||||
### 总结
|
||||
|
||||
这些只是我能想到的几个原因之一, Linux 作为操作系统的选择在 2021 年比以往任何时候都更值得被推荐。
|
||||
|
||||
当然,这也取决于您的要求,这些好处可能不会体现在在您的用例中。但是,如果你确实不了解 Linux,至少,现在你可以评估你的需求,重新作出选择。
|
||||
|
||||
除了上述要点之外,您还能想到什么?请在下面的评论中告诉我。
|
||||
|
||||
### 大型科技网站获得数百万收入,It's FOSS 为您服务!
|
||||
|
||||
如果您喜欢我们在 It's FOSS 所做的工作,请考虑捐款以支持我们的独立出版物。 您的支持将帮助我们继续发布专注于桌面 Linux 和开源软件的内容。
|
||||
|
||||
感谢各位。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/switch-to-linux-in-2021/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[zepoch](https://github.com/zepoch)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://news.itsfoss.com/linux-foundation-linux-desktop/
|
||||
[2]: https://itsfoss.com/reasons-switch-linux-windows-xp/
|
||||
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[4]: https://itsfoss.com/what-is-linux-distribution/
|
||||
[5]: https://itsfoss.com/best-linux-distributions/
|
||||
[6]: https://www.cnbc.com/2021/05/12/the-global-chip-shortage-could-last-until-2023-.html
|
||||
[7]: https://itsfoss.com/lightweight-linux-beginners/
|
||||
[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ5OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[9]: https://itsfoss.com/nextcloud/
|
||||
[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUxNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
@ -0,0 +1,91 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (stevenzdg988)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How key Python projects are maintained)
|
||||
[#]: via: (https://opensource.com/article/20/2/python-maintained)
|
||||
[#]: author: (Moshe Zadka https://opensource.com/users/moshez)
|
||||
|
||||
How key Python projects are maintained
|
||||
如何维护关键的 Python 项目
|
||||
======
|
||||
开源 Python 项目保持平稳运行的社区幕后。
|
||||
![旧款电脑和新款电脑,代表迁移到新的软件或硬件][1]
|
||||
|
||||
Jannis Leidel 是 [Jazzband][2] 社区的一部分。Jazzband 是一个基于 [Python][3] 项目维护责任的共享协作社区。
|
||||
|
||||
Jazzband 的诞生源于长期独自维护一个开源项目的压力。Jannis 是巡回乐队管理员,这意味着他负责管理任务并确保乐队中的人可以在他们想要的时候演奏。
|
||||
|
||||
Jazzband 并不是他的第一个开源志愿者工作——他是前 [Django][4] 核心开发人员,[Django 软件基金会][5] 董事会成员,编写了许多 Django 应用程序和 Python 项目,一直是 [pip][6] 和 [virtualenv][7] 核心开发人员和发布经理,共同创立了 [Python 软件包授权][8],并担任 [PyPI][9] 管理员。在社区方面,他共同创立了德国 Django 协会,担任 [DjangoCon Europe][10] 2010 联合主席,在多个会议上发言,并在去年担任了[Python 软件基金会][11]主管和联席主席
|
||||
|
||||
### Moshe Zadka: 你是如何开始编程的?
|
||||
|
||||
Jannis Leidel:我在高中时作为常规德语计算机科学课程的一部分开始学习编程,在那里我涉猎了 Turbo Pascal 和 Prolog。我很快就进入了 Web 开发的世界,并使用 PHP3、[Perl5][12] 和 [MySQL][13] 编写了小型网站。后来在大学里,我在从事媒体艺术项目时再次学习编程,发现 [Ruby][14]、Perl 和 Python 特别有用。我最终坚持使用 Python,因为它的多功能性和易用性。从那时起,我很高兴能够在我的职业生涯中使用 Python 和开放网络技术(HTML/JS/CSS)。
|
||||
|
||||
### Zadka: 您是如何开始开源的?
|
||||
|
||||
Leidel:作为大学艺术项目的一部分,我需要一种与各种 Web 服务对话并与一些电子设备交互的方法,但发现我之前的 PHP 技能无法胜任这项任务。因此,我参加了有关使用 Python 编程的课程,并对学习更多有关框架如何工作产生兴趣——与库相比——因为它们进一步体现了我想了解的最佳实践。特别是,新生的 Django Web 框架对我很有吸引力,因为它支持务实的方法,并为如何开发 Web 应用程序提供了大量指导。 2007 年,我作为学生参与了 Google Summer of Code for Django,后来为 Django 及其可重用组件生态系统做出了更多贡献——不久我也成为 Django 核心开发人员。在完成学位期间,我能够利用这些技能成为一名自由职业者,并花时间在 Django 社区的许多不同部分工作。在那时,横向移动到更广泛的 Python 社区不过是很自然的。
|
||||
|
||||
### Zadka: 你的日常工作是什么?
|
||||
|
||||
Leidel:我是 Mozilla 的一名高级软件工程师,致力于为 Firefox 数据管道开发数据工具。实际上,这意味着我在更广泛的 Firefox 工程团队中从事各种内部和面向公众的基于 Web 的项目,这些项目帮助 Mozilla 员工和社区成员理解 Firefox Web 浏览器发送的遥测数据。我目前的部分重点是维护我们的数据分析和可视化平台,该平台基于开源项目 [Redash][15],并对其做出贡献。我参与的其他项目是我们的下一代遥测系统 [Glean][16] 和一个允许您在浏览器(包括 Scientific Python 堆栈)中进行数据科学的工具 [Iodide][17]。
|
||||
|
||||
### Zadka: 您是如何参与 Jazzband 的?
|
||||
|
||||
Leidel:早在 2015 年,我就对单独维护很多人所依赖的项目感到沮丧,并看到我的许多社区同行都在为类似的问题苦苦挣扎。我不知道有什么好方法可以接触到社区中更多可能对长期维护感兴趣的人。在某些情况下,我觉得新的“社会编码”范例很少是社会性的,而且常常是孤立的,有时甚至对新老贡献者来说都是创伤。我相信我们社区中我现在无法容忍的不平等在当时更加猖獗,这使得为贡献者提供一个安全的环境变得困难——我们现在知道这对于稳定的项目维护至关重要。我想知道我们是否缺少一种更具协作性和包容性的软件开发方法。
|
||||
|
||||
Jazzband 项目的启动是为了降低进入维护的门槛,并简化其中一些较无聊的方面(例如,围绕 [CI][18] 的最佳实践)。
|
||||
|
||||
### Zadka: 您最喜欢 Jazzband 的什么?
|
||||
|
||||
Leidel:我最喜欢 Jazzband 的一点是,我们确保了许多人所依赖的许多项目的维护,同时还确保任何经验水平的新贡献者都可以加入。
|
||||
|
||||
### Zadka: Jazzband 的“巡回乐队管理员”的工作是什么?
|
||||
|
||||
Leidel:当谈到 Jazzband 幕后的所有事情时,“roadie”是一个寻求协助的人。这意味着,例如,处理新项目的入职、维护处理用户管理和项目发布的 Jazzband 网站、充当安全或行为准则事件的第一响应者等等。“roadies”这个词是从音乐和活动行业借来的,指的是支持人员,他们负责在巡回演出中几乎所有需要做的事情,除了实际的艺术表演。在 Jazzband,他们在那里确保成员可以在项目上工作。这也意味着某些任务是部分或完全自动化的,这是有意义的,并且最佳实践应用于大多数 Jazzband 项目,如打包设置、文档托管或持续集成。
|
||||
|
||||
### Zadka: 作为 Jazzband 的巡回乐队管理员,您工作中最具挑战性的方面是什么?
|
||||
|
||||
Leidel:目前,我作为"巡回乐队管理员"的工作中最具挑战性的方面是实施社区成员提出的 Jazzband 改进,而不会冒他们所依赖的工作流程的风险。换句话说,Jazzband 越大,在概念级别上扩展项目变得越困难。具有讽刺意味的是,我是目前唯一的"巡回乐队管理员",独自处理一些任务,而 Jazzband 试图阻止其项目发生这种情况。这是 Jazzband 未来的一大担忧。
|
||||
|
||||
### Zadka: 对于有兴趣想知道能否加入 Jazzband 的人,您有什么想说的?
|
||||
|
||||
Leidel:如果您有兴趣加入一群相信协作工作比单独工作更好的人,或者如果您一直在为自己的维护负担而苦苦挣扎并且不知道如何继续,请考虑加入 Jazzband。它简化了新贡献者的入职流程,提供了一个争议框架,并自动发布到 [PyPI][19]。有许多最佳实践可以很好地降低项目无法维护的风险。
|
||||
|
||||
### Zadka: 您还有什么想告诉我们的读者的吗?
|
||||
|
||||
Leidel:我鼓励每个从事开源项目的人都考虑屏幕另一边的人。要有同理心,记住你自己的经历可能不是你同龄人的经历。了解您是全球多元化社区的成员,这要求我们始终尊重我们之间的差异。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/python-maintained
|
||||
|
||||
作者:[Moshe Zadka][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[stevenzdg988](https://github.com/stevenzdg988)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/moshez
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/migration_innovation_computer_software.png?itok=VCFLtd0q (and old computer and a new computer, representing migration to new software or hardware)
|
||||
[2]: https://jazzband.co/
|
||||
[3]: https://opensource.com/resources/python
|
||||
[4]: https://opensource.com/article/18/8/django-framework
|
||||
[5]: https://www.djangoproject.com/foundation/
|
||||
[6]: https://opensource.com/article/19/11/python-pip-cheat-sheet
|
||||
[7]: https://virtualenv.pypa.io/en/latest/
|
||||
[8]: https://www.pypa.io/en/latest/
|
||||
[9]: https://pypi.org/
|
||||
[10]: https://djangocon.eu/
|
||||
[11]: https://www.python.org/psf/
|
||||
[12]: http://opensource.com/article/18/1/why-i-love-perl-5
|
||||
[13]: https://opensource.com/life/16/10/all-things-open-interview-dave-stokes
|
||||
[14]: http://opensource.com/business/16/4/save-development-time-and-effort-ruby
|
||||
[15]: https://redash.io/
|
||||
[16]: https://firefox-source-docs.mozilla.org/toolkit/components/telemetry/start/report-gecko-telemetry-in-glean.html
|
||||
[17]: https://alpha.iodide.io/
|
||||
[18]: https://opensource.com/article/19/12/cicd-resources
|
||||
[19]: https://opensource.com/downloads/7-essential-pypi-libraries
|
@ -0,0 +1,59 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (baddate)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Learn Bash with this book of puzzles)
|
||||
[#]: via: (https://opensource.com/article/20/4/bash-it-out-book)
|
||||
[#]: author: (Carlos Aguayo https://opensource.com/users/hwmaster1)
|
||||
|
||||
用这本谜题书学习 Bash
|
||||
======
|
||||
>“Bash it out”使用 16 个谜题,涵盖了基本、中级和高级 Bash 脚本。
|
||||
|
||||
![Puzzle pieces coming together to form a computer screen][1]
|
||||
|
||||
计算机既是我的爱好,也是我的职业。我的公寓里散布着大约 10 个,它们都运行 Linux(包括我的 Mac)。由于我喜欢升级我的电脑和提升我的电脑技能,当我遇到 Sylvain Leroux 的[_Bash it out_][2]时,我抓住了购买它的机会。我在 Debian Linux 上经常使用命令行,这似乎是扩展我的 Bash 知识的好机会。当作者在前言中解释他使用 Debian Linux 时,我笑了,这是我最喜欢的两个发行版之一。
|
||||
|
||||
Bash 可让你自动执行任务,因此它是一种省力、有趣且有用的工具。在阅读本书之前,我已经有相当多的 Unix 和 Linux 上的 Bash 经验。我不是专家,部分原因是脚本语言非常广泛和强大。当我在基于 Arch 的 Linux 发行版[EndeavourOS][3]的欢迎屏幕上看到 Bash 时,我第一次对 Bash 产生了兴趣。
|
||||
|
||||
以下屏幕截图显示了 EndeavourOS 的一些选项。不管你信不信,这些面板只指向 Bash 脚本,每个脚本都完成一些相对复杂的任务。而且因为它都是开源的,所以我可以根据需要修改这些脚本中的任何一个。
|
||||
![EndeavourOS after install][4]
|
||||
|
||||
![EndeavourOS install apps][5]
|
||||
|
||||
### 总有东西要学
|
||||
|
||||
我对这本书的印象非常好。虽然不长,但经过了深思熟虑。作者对 Bash 有非常广泛的了解,并且具有解释如何使用它的不可思议的能力。这本书使用 16 个谜题涵盖了基本、中级和高级 Bash 脚本,他称之为“挑战”。这教会了我将 Bash 脚本视为需要解决的编程难题,这让我玩起来更有趣。
|
||||
|
||||
Bash 一个令人兴奋的方面是它与 Linux 系统深度集成。虽然它的部分能力在于它的语法,但它也很强大,因为它可以访问很多系统资源。你可以编写重复性任务或简单但厌倦了手动执行的任务的脚本。没有什么太大或太小的事,*Bash it out*可以帮助你了解可以做什么以及如何实现它。
|
||||
|
||||
如果我不提及 David Both 的免费资源[_A sysadmin's guide to Bash scripting_][6]on Opensource.com,这篇评论就不会完整。这个 17 页的 PDF 指南与Bash it out不同,但它们共同构成了任何想要了解它的人的成功组合。
|
||||
|
||||
我不是计算机程序员,但*Bash it out*增加了我进入更高级 Bash 脚本水平的欲望——虽然没有这个打算,但我可能最终无意中成为一名计算机程序员。
|
||||
|
||||
我喜欢 Linux 的原因之一是因为它的操作系统功能强大且用途广泛。无论我对 Linux 了解多少,总有一些新东西需要学习,这让我更加欣赏 Linux。
|
||||
|
||||
在竞争激烈且不断变化的就业市场中,我们所有人都应该不断更新我们的技能。这本书帮助我以非常实际的方式学习了 Bash。几乎感觉作者和我在同一个房间里,耐心地指导我学习。
|
||||
|
||||
作者 Leroux 具有不可思议的能力去吸引读者。这是一份难得的天赋,我认为比他的技术专长更有价值。事实上,我写这篇书评是为了感谢作者预见了我自己的学习需求;虽然我们从未见过面,但我从他的天赋中受益匪浅。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/bash-it-out-book
|
||||
|
||||
作者:[Carlos Aguayo][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/baddates)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/hwmaster1
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen)
|
||||
[2]: https://www.amazon.com/Bash-Out-Strengthen-challenges-difficulties/dp/1521773262/
|
||||
[3]: https://endeavouros.com/
|
||||
[4]: https://opensource.com/sites/default/files/uploads/endeavouros-welcome.png (EndeavourOS after install)
|
||||
[5]: https://opensource.com/sites/default/files/uploads/endeavouros-install-apps.png (EndeavourOS install apps)
|
||||
[6]: https://opensource.com/downloads/bash-scripting-ebook
|
82
translated/tech/20210614 What is a CI-CD pipeline.md
Normal file
82
translated/tech/20210614 What is a CI-CD pipeline.md
Normal file
@ -0,0 +1,82 @@
|
||||
[#]: subject: (What is a CI/CD pipeline?)
|
||||
[#]: via: (https://opensource.com/article/21/6/what-cicd-pipeline)
|
||||
[#]: author: (Will Kelly https://opensource.com/users/willkelly)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (baddate)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
CI/CD 管道是什么?
|
||||
======
|
||||
|
||||
你如何定义持续集成/持续部署管道取决于你组织的要求。
|
||||
![Plumbing tubes in many directions][1]
|
||||
|
||||
持续集成/持续部署 (CI/CD) 管道是每个 DevOps 计划的基础。 CI/CD 管道打破了传统的开发孤岛,使开发和运营团队能够在整个软件开发生命周期中进行协作。
|
||||
|
||||
更好的是,转向 DevOps 和 CI/CD 管道可以帮助你的组织以更高的速度更安全地[交付软件][2]。
|
||||
### Breaking down the CI/CD pipeline
|
||||
|
||||
CI/CD 管道有很多定义,所以我总是建议组织定义自己的 CI/CD 管道版本和其他 DevOps 概念,而不是使用其他人的。开源 CI/CD 工具为你提供构建满足组织要求的 CI/CD 管道的自由和选择。
|
||||
|
||||
形成 CI/CD 管道的阶段是将不同的任务子集分组为 _管道阶段_。典型的管道阶段包括:
|
||||
|
||||
* **构建**:开发人员编译应用程序代码。
|
||||
* **测试**:质量保证 (QA) 团队使用自动化测试工具和策略测试应用程序代码。
|
||||
* **发布**:开发团队将应用程序代码交付到代码库。
|
||||
* **部署**:DevOps 团队将应用程序代码分阶段投入生产。
|
||||
* **安全性和合规性**:QA 团队根据项目要求验证构建。这是组织部署容器扫描工具的阶段,这些工具根据常见漏洞和暴露 (CVE) 检查图像的质量。
|
||||
|
||||
|
||||
|
||||
|
||||
这些是 CI/CD 管道的标准阶段,但一些组织调整 CI/CD 管道模型以满足他们的要求。例如,为医疗保健市场构建应用程序的组织,具有严格的合规性标准,可以在整个工具链中分发测试、验证和合规性门。
|
||||
|
||||
其他示例可能是依赖于具有开源软件 (OSS) 的复杂软件供应链的组织。商业组件可能会设立一个门槛,开发团队成员可以在其中为 OSS 包生成[软件物料清单][3] (SBOM),或者外部商业软件供应商必须将 SBOM 作为其合同可交付成果的一部分进行交付。
|
||||
### CI/CD 管道的障碍
|
||||
|
||||
实施 CI/CD 管道会改变团队的流程和文化。尽管许多开发人员愿意接受某些任务和测试的自动化,但人员可能成为采用 CI/CD 的障碍。
|
||||
|
||||
从瀑布式流程转向 CI/CD 可能会动摇某些组织中基本的和隐含的权力结构。由于 CI/CD 管道提高了软件交付速度,旧手动流程的“守门人”可能会受到这种变化的威胁。
|
||||
|
||||
### 整合机会
|
||||
|
||||
随着你在文化、流程和工具中达到更高的 DevOps 成熟度水平,包含 CI/CD 工具链的工具的开源根源为一些激动人心的集成创造了机会。
|
||||
|
||||
分析公司 Forrester 在 2020 年预测,即时学习将加入 CI/CD 管道。如果你考虑一下,会发现这是有道理的。在当前远程工作的时代,甚至对于新员工的远程入职,这更有意义。例如,组织可以将文档 wiki 与内部流程文档集成到其管道中。
|
||||
|
||||
更雄心勃勃的组织可以将学习管理系统 (LMS)(例如 [Moodle][4])集成到其 CI/CD 管道中。它可以使用 LMS 发布有关新 DevOps 工具链功能的简短视频,开发人员在加入时或在整个管道中更新工具时需要学习这些功能。
|
||||
|
||||
一些组织正在将群聊和其他协作工具直接集成到他们的 CI/CD 管道中。聊天平台提供警报并支持团队之间的协作和沟通。将 Mattermost、Rocket.Chat 或其他[企业聊天][5]平台集成到你的 CI/CD 管道中需要预先规划和分析,以确保管道用户不会被警报淹没。
|
||||
|
||||
另一个需要探索的集成机会是将分析和高级报告构建到你的 CI/CD 管道中。这有助于你利用通过管道传输的数据。
|
||||
|
||||
### 最后的想法
|
||||
|
||||
CI/CD 管道是 DevOps 的基础。开源使其能够适应并灵活地满足你在 DevOps 之旅中实施的运营变更所产生的新需求。
|
||||
|
||||
我希望看到对统一 DevOps 平台趋势的开源响应,在这种趋势中,组织寻求端到端的 CI/CD 解决方案。这种解决方案的要素就在那里。毕竟,GitLab 和 GitHub 将他们的平台追溯到开源根源。
|
||||
|
||||
最后,不要忘记每一个成功的 CI/CD 工具链背后的教育和外展。记录你的工具链和相关流程将改善开发人员入职和持续的 DevOps 团队培训。
|
||||
|
||||
你和你的组织如何定义你的 CI/CD 工具链?请在评论中分享你的反馈。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/6/what-cicd-pipeline
|
||||
|
||||
作者:[Will Kelly][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/baddate)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/willkelly
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions)
|
||||
[2]: https://techbeacon.com/devops/5-reasons-why-cicd-vital-your-organizations-value-stream
|
||||
[3]: https://www.ntia.gov/SBOM
|
||||
[4]: https://moodle.org/
|
||||
[5]: https://opensource.com/alternatives/slack
|
@ -1,227 +0,0 @@
|
||||
[#]: subject: (Systemd Timers for Scheduling Tasks)
|
||||
[#]: via: (https://fedoramagazine.org/systemd-timers-for-scheduling-tasks/)
|
||||
[#]: author: (Richard England https://fedoramagazine.org/author/rlengland/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (dcoliversun)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
用于调度任务的 Systemd 定时器
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
Systemd 提供定时器有一段时间了,定时器替代了 _cron_ 功能,这一特性值得看看。本文将向你介绍在系统启动后如何使用 _systemd_ 中的定时器来运行任务,此后重复运行。这不是对 _systemd_ 的全面讨论,只是介绍这一特性。
|
||||
|
||||
### Cron、anacron 与 systemd:快速回顾
|
||||
|
||||
_Cron_ 可以将任务调度以几分钟到几个月或更长时间的粒度运行。设置起来相对简单,只需要一个配置文件。虽然配置过程有些深奥,但一般用户也可以使用。
|
||||
|
||||
|
||||
然而,如果您的系统在需要执行的时间没有运行,那么 _Cron_ 会失败。
|
||||
|
||||
_Anacron_ 克服了“系统不运行”问题。它确保你的系统再次启动时,任务将执行。虽然它旨在管理员使用,但有些系统允许普通用户访问 _Anacron_。
|
||||
|
||||
但是,_anacron_ 的执行频率不能低于每天一次。
|
||||
|
||||
_cron_ 和 _anacron_ 都存在执行上下文一致性的问题。必须注意任务运行时有效的环境与测试时使用的环境完全相同。必须提供相同的 shell、环境变量和路径。这意味着测试和调试有时会很困难。
|
||||
|
||||
_Systemd_ 定时器提供了 _cron_ 和 _anacron_ 的优点,允许调度到分钟粒度。确保在系统再次运行时执行任务,即使在预期的执行时间内任务处于关闭状态。对所有用户都可用。你可以在它将要运行的环境中测试和调试执行。
|
||||
|
||||
但是,配置更加复杂,至少需要两个配置文件。
|
||||
|
||||
如果你的 _cron_ and _anacron_ 配置很好地为你服务,那么可能没有理由改变。但是 _systemd_ 至少值得研究,因为它可以简化任何当前的 _cron_/_anacron_ 工作方式。
|
||||
|
||||
### 配置
|
||||
|
||||
_Systemd_ 定时器执行的函数至少需要两个文件。这两个是“<ruby>定时器<rt>timer unit</rt></ruby>”和“<ruby>系统服务<rt>service unit</rt></ruby>”。动作不仅仅是简单的命令,你还需要一个“作业”文件或脚本来执行必要的功能。
|
||||
|
||||
定时器文件定义调度表,而系统服务文件定义执行的任务。有关的更多详细信息参考 “man systemd.timer” 中提供的 .timer unit。服务单元的详细信息可在 “man systemd.service” 中找到。
|
||||
|
||||
There are several locations where unit files exist (listed in the man page). Perhaps the easiest location for the general user, however, is “~/.config/systemd/user”. Note that “user” here, is the literal string “user”.
|
||||
单元文件存在于几个位置(在 man page 中列出)。然而,对于普通用户来说,最容易找到的位置可能是 “~/.config/systemd/user”。请注意,这里的“用户”是字符串“用户”。
|
||||
|
||||
### 示例
|
||||
|
||||
此示例是一个创建用户调度作业而不是系统调度作业(以root用户身份运行)的简单示例。它将消息、日期和时间打印到文件中。
|
||||
|
||||
|
||||
1. 首先创建一个执行任务的 shell 脚本。在你的本地 “bin” 目录中创建它,例如在 “~/bin/schedule-test.sh” 中。
|
||||
|
||||
创建文件:
|
||||
|
||||
```
|
||||
touch ~/bin/schedule-test.sh
|
||||
```
|
||||
|
||||
然后将以下内容添加到你刚刚创建的文件中。
|
||||
|
||||
```
|
||||
#!/bin/sh
|
||||
echo "This is only a test: $(date)" >> "$HOME/schedule-test-output.txt"
|
||||
```
|
||||
|
||||
记住赋予你的 shell 脚本执行权限。
|
||||
|
||||
2. 创建 .service 调用上面的脚本。在以下位置创建目录与文件:“~/.config/systemd/user/schedule-test.service
|
||||
|
||||
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=A job to test the systemd scheduler
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/home/<user>/bin/schedule-test.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
```
|
||||
|
||||
请注意<用户>应该是你的 @HOME 地址,但是资源文件路径名中的“用户”实际上是字符串“用户”。
|
||||
|
||||
_ExecStart_ 应该提供一个没有变量的绝对地址。例外情况是,对于 _用户_,您可以用 “%h” 替换 $HOME。换句话说,你可以使用:
|
||||
|
||||
```
|
||||
ExecStart=%h/bin/schedule-test.sh
|
||||
```
|
||||
|
||||
这仅用于用户文件。这不适用于系统服务,因为在系统环境中运行时 “%h” 总是返回 “/root”。其他替换可在“说明符”下的 “man systemd.unit” 中找到。因为它超出了本文的范围,所以这就是我们目前需要了解的关于说明符的全部内容。
|
||||
|
||||
3\. 创建一个 .timer 文件,该文件实际上调度你创建的 .service。在 .service 文件相同位置 “~/.config/systemd/user/schedule-test.timer” 创建它。请注意,文件名仅在拓展名上有所不同,例如一个是 “.service”,一个是 ".timer"。
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=Schedule a message every 1 minute
|
||||
RefuseManualStart=no # Allow manual starts
|
||||
RefuseManualStop=no # Allow manual stops
|
||||
|
||||
[Timer]
|
||||
#Execute job if it missed a run due to machine being off
|
||||
Persistent=true
|
||||
#Run 120 seconds after boot for the first time
|
||||
OnBootSec=120
|
||||
#Run every 1 minute thereafter
|
||||
OnUnitActiveSec=60
|
||||
#File describing job to execute
|
||||
Unit=schedule-test.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
```
|
||||
|
||||
请注意,.timer 文件使用了 “OnUnitActiveSec” 来指定调度表。“OnCalendar” 选项更加灵活。例如:
|
||||
|
||||
|
||||
```
|
||||
# run on the minute of every minute every hour of every day
|
||||
OnCalendar=*-*-* *:*:00
|
||||
# run on the hour of every hour of every day
|
||||
OnCalendar=*-*-* *:00:00
|
||||
# run every day
|
||||
OnCalendar=*-*-* 00:00:00
|
||||
# run 11:12:13 of the first or fifth day of any month of the year
|
||||
# 2012, but only if that day is a Thursday or Friday
|
||||
OnCalendar=Thu,Fri 2012-*-1,5 11:12:13
|
||||
```
|
||||
|
||||
有关 “OnCalendar” 的更多信息参见[这里][2]。
|
||||
|
||||
4\. 所有的部件都已就位,但你应该进行测试,以确保一切正常。首先,启用用户服务:
|
||||
|
||||
```
|
||||
$ systemctl --user enable schedule-test.service
|
||||
```
|
||||
|
||||
这将导致类似如下的输出:
|
||||
|
||||
```
|
||||
Created symlink /home/<user>/.config/systemd/user/default.target.wants/schedule-test.service → /home/<user>/.config/systemd/user/schedule-test.service.
|
||||
```
|
||||
|
||||
现在执行测试工作:
|
||||
|
||||
```
|
||||
$ systemctl --user start schedule-test.service
|
||||
```
|
||||
|
||||
检查你的输出文件($HOME/schedule-test-output.txt),确保你的脚本运行正常。应该只有一个条目,因为我们还没有启动定时器。必要时进行调试。如果你需要更改 .service 文件,而不是更改它调用的 shell 脚本,请不要忘记再次启用该服务。
|
||||
|
||||
5\. 一旦作业正常运行,通过为服务启用、启动用户定时器来实时调度作业:
|
||||
|
||||
```
|
||||
$ systemctl --user enable schedule-test.timer
|
||||
$ systemctl --user start schedule-test.timer
|
||||
```
|
||||
|
||||
请注意,你已经在上面的步骤4中启动、启用了服务,因此只需要为它启用、启动定时器。
|
||||
|
||||
启用命令会产生如下输出:
|
||||
|
||||
```
|
||||
Created symlink /home/<user>/.config/systemd/user/timers.target.wants/schedule-test.timer → /home/<user>/.config/systemd/user/schedule-test.timer.
|
||||
```
|
||||
|
||||
启动命令将返回命令行界面提示。
|
||||
|
||||
|
||||
### 其他操作
|
||||
|
||||
你可以检查和监控服务。如果你从系统服务收到错误,下面的第一个命令特别有用:
|
||||
|
||||
```
|
||||
$ systemctl --user status schedule-test
|
||||
$ systemctl --user list-unit-files
|
||||
```
|
||||
|
||||
手动停止服务:
|
||||
|
||||
```
|
||||
$ systemctl --user stop schedule-test.service
|
||||
```
|
||||
|
||||
永久停止并禁用定时器和服务,重新加载守护程序配置并重置任何失败通知:
|
||||
|
||||
```
|
||||
$ systemctl --user stop schedule-test.timer
|
||||
$ systemctl --user disable schedule-test.timer
|
||||
$ systemctl --user stop schedule-test.service
|
||||
$ systemctl --user disable schedule-test.service
|
||||
$ systemctl --user daemon-reload
|
||||
$ systemctl --user reset-failed
|
||||
```
|
||||
|
||||
### 总结
|
||||
|
||||
本文以 _systemd_ 定时器为出发点,但是 _systemd_ 的内容远不止于此。这篇文章应该为你提供一个基础。你可以从[Fedora Magazine systemd系列][3]开始探索更多。
|
||||
|
||||
参考 —— 更多阅读:
|
||||
|
||||
* man systemd.timer
|
||||
* man systemd.service
|
||||
* [Use systemd timers instead of cronjobs][4]
|
||||
* [Understanding and administering systemd][5]
|
||||
* <https://opensource.com/> 内有 systemd 快捷查询列表
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/systemd-timers-for-scheduling-tasks/
|
||||
|
||||
作者:[Richard England][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[dcoliversun](https://github.com/dcoliversun)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/rlengland/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2021/06/schedule_with_systemd_timer-816x345.jpg
|
||||
[2]: https://www.freedesktop.org/software/systemd/man/systemd.time.html#Calendar%20Events
|
||||
[3]: https://fedoramagazine.org/what-is-an-init-system/
|
||||
[4]: https://opensource.com/article/20/7/systemd-timers
|
||||
[5]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/
|
@ -0,0 +1,110 @@
|
||||
[#]: subject: (KTorrent: An Incredibly Useful BitTorrent Application by KDE)
|
||||
[#]: via: (https://itsfoss.com/ktorrent/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
KTorrent:KDE 的一个非常有用的 BitTorrent 应用
|
||||
======
|
||||
|
||||
Linux 中有各种各样的 BitTorrent 应用。但是,找到一个好的、提供许多功能的应用应该可以为你节省一些时间。
|
||||
|
||||
KDE 的 KTorrent 就是这样一个为 Linux 打造的 BitTorrent 应用。
|
||||
|
||||
虽然有 [Linux 有几个 torrent 客户端][1],但我最近发现 KTorrent 对我而言很有趣。
|
||||
|
||||
### KTorrent: 适用于 Linux 的开源 BitTorrent 客户端
|
||||
|
||||
![][2]
|
||||
|
||||
KTorrent 是一个成熟的 torrent 客户端,主要为 KDE 桌面定制。无论你使用什么桌面环境,它都能很好地工作。
|
||||
|
||||
当然,使用KDE桌面,你可以得到一个无缝的用户体验。
|
||||
|
||||
让我们来看看它的所有功能。
|
||||
|
||||
### KTorrent 的功能
|
||||
|
||||
![][3]
|
||||
|
||||
对于普通的 torrent 用户来说,拥有一套全面的功能使事情变得简单。而 KTorrent 也不例外。在这里,我将列出 KTorrent 的主要亮点:
|
||||
|
||||
* 在一个队列中添加 torrent 下载
|
||||
* 能够控制每次下载(或整体)的速度限制
|
||||
* 视频和音频文件预览选项
|
||||
* 支持导入下载文件(部分/全部)。
|
||||
* 在下载多个文件时,能够对 torrent 下载进行优先排序
|
||||
* 为多文件 torrent 选择要下载的特定文件
|
||||
* IP 过滤器,可选择踢走/禁止 peer。
|
||||
* 支持 UDP 跟踪器
|
||||
* 支持 µTorrent peer
|
||||
* 支持协议加密
|
||||
* 能够创建无 tracker 的 torrent
|
||||
* 脚本支持
|
||||
* 系统托盘集成
|
||||
* 通过代理连接
|
||||
* 增加了插件支持
|
||||
* 支持 IPv6
|
||||
|
||||
|
||||
|
||||
KTorrent 听起来很有用,作为一个 torrent 客户端,你可以日常控制它在一个地方管理所有的 torrent 下载。
|
||||
|
||||
![][4]
|
||||
|
||||
除了上面提到的功能外,它还对客户端的行为提供了很大的控制。例如,调整指示下载/暂停/tracker 服务器的颜色。
|
||||
|
||||
如果你想禁用完成 torrent 下载的声音或得到活动通知,你还可以设置通知。
|
||||
|
||||
![][5]
|
||||
|
||||
虽然像协议加密支持这样的功能可能无法取代一些[最好的 VPN][6] 服务,但它对桌面客户端来说是一个重要的补充。
|
||||
|
||||
### 在 Linux 中安装 KTorrent
|
||||
|
||||
KTorrent 应该可以通过包管理器(如 [Synaptic][7])或默认的仓库获得。你也可以在你的软件中心找到它并轻松安装。
|
||||
|
||||
除此之外,它还在 [Flathub][9] 上提供了一个适用于任何 Linux 发行版的 [Flatpak][8] 官方包。如果你需要帮助,我们有一个 [Flatpak 指南][10]供参考。
|
||||
|
||||
如果你喜欢的话,你也可以尝试可用的 [snap包][11]。
|
||||
|
||||
要探索更多关于它和源码的信息,请前往它的[官方 KDE 应用页面][12]。
|
||||
|
||||
[KTorrent][12]
|
||||
|
||||
### 结束语
|
||||
|
||||
KTorrent 是 Linux 中一个出色的 torrent 客户端。我在我的 Linux Mint 系统的 Cinnamon 桌面上试用了它,它运行得很好。
|
||||
|
||||
我喜欢它的简单和可配置性。尽管我不是每天都在使用 torrent 客户端,但在我短暂的测试中,我没有发现 KTorrent 有什么奇怪的地方。
|
||||
|
||||
你认为 KTorrent 作为 Linux 的 torrent 客户端怎么样?你喜欢用什么呢?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/ktorrent/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/best-torrent-ubuntu/
|
||||
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-download.png?resize=850%2C582&ssl=1
|
||||
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-configure.png?resize=850%2C656&ssl=1
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-speed-limit.png?resize=850%2C585&ssl=1
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-plugins.png?resize=850%2C643&ssl=1
|
||||
[6]: https://itsfoss.com/best-vpn-linux/
|
||||
[7]: https://itsfoss.com/synaptic-package-manager/
|
||||
[8]: https://itsfoss.com/what-is-flatpak/
|
||||
[9]: https://flathub.org/apps/details/org.kde.ktorrent
|
||||
[10]: https://itsfoss.com/flatpak-guide/
|
||||
[11]: https://snapcraft.io/ktorrent
|
||||
[12]: https://apps.kde.org/ktorrent/
|
Loading…
Reference in New Issue
Block a user