Merge branch 'master' of https://github.com/LCTT/TranslateProject into translating

This commit is contained in:
geekpi 2022-06-20 08:56:37 +08:00
commit 563e12794c
40 changed files with 2733 additions and 1386 deletions

View File

@ -3,50 +3,50 @@
[#]: author: (Chris Collins https://opensource.com/users/clcollins)
[#]: collector: (lujun9972)
[#]: translator: (Donkey-Hao)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-14731-1.html)
使用树莓派做一个倒计时闹钟
使用树莓派做一个倒计时
======
使用树莓派和 ePaper 显示器开始倒计时您的下一个假期。
![Alarm clocks with different time][1]
2021年[ Pi Day ][2]来了又走,留下美好的回忆以及[许多树莓派项目][3]等待我们去尝试。在任何令人精神振奋、充满欢乐的假期后回到工作中都很难, Pi Day 也不例外。当我们回望三月的时候,渴望那些天的快乐。但是不用害怕,亲爱的 Pi Day 庆祝者们,我们开始下一个 Pi Day 的漫长倒计时!
> 使用树莓派和电子纸显示屏开始倒计时你的下一个假期。
好了,严肃点。我做了一个 Pi Day 倒计时器,你也可以!
![](https://img.linux.net.cn/data/attachment/album/202206/19/145133beh3yp1s3ky6bi5b.jpg)
不久前,我购买了一个 [树莓派 Zero W][4] 并且用它来 [解决 WiFi 较差的原因][5] 。我也对使用 ePaper 来作为显示器十分感兴趣。而我却没有一个很好的用途,但是那看起来很有趣!我买了一个十分适合放在树莓派的顶部的 2.13 英寸的 [ WaveShare 显示器][6] 。安装很简单:只需要将显示器接到树莓派的 GPIO 上即可。
<ruby>[圆周率日][2]<rt>Pi Day</rt></ruby>3 月 14 日) 来了又走,留下美好的回忆以及 [许多树莓派项目][3] 等待我们去尝试。在任何令人精神振奋、充满欢乐的假期后回到工作中都很难,圆周率日也不例外。当我们回望三月的时候,渴望那些天的快乐。但是不用害怕,亲爱的圆周率日庆祝者们,我们开始下一个节日的漫长倒计时!
我使用 [树莓派系统][7] 来实现该项目,虽然其他的操作系统肯定也能完成。但是下面的 `raspi-config` 指令在树莓派系统上很容易使用。
好了,严肃点。我做了一个圆周率日倒计时器,你也可以!
### 设置树莓派和 ePaper 显示器
不久前,我购买了一个 [树莓派 Zero W][4],并且用它来 [解决 WiFi 信号较差的原因][5] 。我也对使用<ruby>电子纸<rt>ePaper</rt></ruby>来作为它的显示屏十分感兴趣。虽然我不知道该用它来干什么,但是!它看起来真的很有趣!我买了一个十分适合放在树莓派的顶部的 2.13 英寸的 [WaveShare 显示器][6] 。安装很简单:只需要将显示器接到树莓派的 GPIO 上即可。
设置树莓派和 ePaper 显示器一起工作,需要你在树莓派上启用串行外设接口 (SPI) 软件,安装 BCM2835 C 库(来访问树莓派上的 Broadcom BCM 2835 芯片的 GPIO 函数),安装 Python GPIO 库来控制 ePaper 显示器。最后,你需要安装 WaveShare 的库来使用 Python 控制 2.13 英寸的显示器。
我使用 [树莓派操作系统][7] 来实现该项目,虽然其他的操作系统肯定也能完成。但是下面的 `raspi-config` 命令在树莓派系统上很容易使用。
### 设置树莓派和电子纸显示屏
设置树莓派和电子纸显示屏一起工作需要你在树莓派软件中启用串行外设接口SPI安装 BCM2835 C 库(来访问树莓派上的博通 BCM 2835 芯片的 GPIO 功能),安装 Python GPIO 库来控制电子纸显示屏。最后,你需要安装 WaveShare 的库来使用 Python 控制这个 2.13 英寸的显示屏。
下面是完成这些的步骤。
#### 启用 SPI
树莓派上启用 SPI 最简单的方式是使用`raspi-config` 命令。SPI 总线允许串行数据通信与设备一起使用——在本例中ePaper 显示:
树莓派上启用 SPI 最简单的方式是使用 `raspi-config` 命令。SPI 总线允许与设备进行串行数据通信——在本例中,电子纸显示:
```
`$ sudo raspi-config`
$ sudo raspi-config
```
从弹出的菜单中, 选择 **Interfacing Options** -&gt; **SPI** -&gt; **Yes** 来启用 SPI 接口,然后启动。
从弹出的菜单中, 选择 <ruby>接口选项<rt>Interfacing Options</rt> -> SPI -> <ruby><rt>Yes</rt></ruby> 来启用 SPI 接口,然后启动。
#### 安装 BCM2835 库
如上所述BCM2835 库是用在树莓派 Broadcom BCM2385 芯片的软件,它允许访问 GPIO 引脚来控制设备。
在我写这篇文章之时,用于树莓派的最新 Broadcom BCM2385 库版本是 v1.68 。安装此库需要下载软件压缩包然后使用 `make` 来安装:
如上所述BCM2835 库是用于树莓派博通 BCM2385 芯片的软件,它允许访问 GPIO 引脚来控制设备。
在我写这篇文章之时,用于树莓派的最新博通 BCM2385 库版本是 v1.68 。安装此库需要下载软件压缩包然后使用 `make` 来安装:
```
# 下载 BCM2853 库并解压
$ curl -sSL <http://www.airspayce.com/mikem/bcm2835/bcm2835-1.68.tar.gz> -o - | tar -xzf -
$ curl -sSL http://www.airspayce.com/mikem/bcm2835/bcm2835-1.68.tar.g> -o - | tar -xzf -
# 进入解压后的文件夹
$ pushd bcm2835-1.68/
@ -62,8 +62,7 @@ $ popd
#### 安装需要的 Python 库
你用 Python 控制 ePaper 显示器需要安装 Python 库 `RPi.GPIO` ,还需要 `python3-pil` 包画图。显然, PIL 包已经不行了, Pillow 可以作为代替方案。我还没有为该项目测试 Pillow ,但它可行:
你用 Python 控制电子纸显示屏需要安装 Python 库 `RPi.GPIO`,还需要使用 `python3-pil` 包来画图。显然PIL 包已经不行了,但 Pillow 可以作为代替方案。我还没有为该项目测试过 Pillow ,但它可行:
```
# 安装需要的 Python 库
@ -76,45 +75,42 @@ _注意这些是 Python3 的指令。你可以在 WaveShare 网站查到 Pyth
#### 下载 WaveShare 示例和 Python 库
Waveshare 维护一个 Python 和 C 的 Git 库,用于使用其 ePaper 显示器和一些展示如何使用它们的示例。对这个倒计时时钟而言,你需要克隆这个库并用于 2.13 英寸的显示器
Waveshare 维护了一个 Python 和 C 的 Git 库,用于使用其电子纸显示屏和一些展示如何使用它们的示例。对这个倒计时时钟而言,你需要克隆这个库并使用用于 2.13 英寸显示屏的库
```
# 克隆这个 WaveShare e-Paper git 库
$ git clone <https://github.com/waveshare/e-Paper.git>
$ git clone https://github.com/waveshare/e-Paper.gi>
```
如果你用不同的显示器或者其他公司产品,需要使用适配软件。
Waveshare 提供了很多指导:
* [WaveShare ePaper 设置指导][9]
* [WaveShare ePaper 库安装指导][10]
* [WaveShare 电子纸设置指导][9]
* [WaveShare 电子纸库安装指导][10]
#### 获得有趣的字体(选做)
你可以随心所欲的使用显示器,为什么不搞点花样?找一个炫酷的字体!
这有大量 [开放字体许可][11] 的字体可。我十分喜爱 Bangers 字体。如果你看过 YouTube 那你见过这种字体了,它十分流行。你可以下载到本地的共享字体目录文件中,并且所有的应用都可以使用,包括这个项目:
这有大量 [开放字体许可][11] 的字体可供选择。我十分喜爱 Bangers 字体。如果你看过 YouTube 那你见过这种字体了,它十分流行。你可以下载到本地的共享字体目录文件中,并且所有的应用都可以使用,包括这个项目:
```
# “Bangers” 字体是 Vernon Adams 用 Google 字体开放许可授权的字体
# “Bangers” 字体是 Vernon Adams 使用 Google 字体开放许可授权的字体
$ mkdir -p ~/.local/share/fonts
$ curl -sSL <https://github.com/google/fonts/raw/master/ofl/bangers/Bangers-Regular.ttf> -o fonts/Bangers-Regular.ttf
$ curl -sSL https://github.com/google/fonts/raw/master/ofl/bangers/Bangers-Regular.ttf -o fonts/Bangers-Regular.ttf
```
### 创建一个 Pi Day 倒计时器
### 创建一个圆周率日倒计时器
现在你已经安装好了软件,可以使用带有炫酷字体的 ePaper 显示器了。你可以创建一个有趣的项目:倒计时到下一个 Pi Day
现在你已经安装好了软件,可以使用带有炫酷字体的电子纸显示屏了。你可以创建一个有趣的项目:倒计时到下一个圆周率日
如果你想,你可以从该项目的 [GitHub repo][13] 直接下载 [countdown.py][12] 这个 Python 文件并跳到文章结尾。
如果你想,你可以从该项目的 [GitHub 仓库][13] 直接下载 [countdown.py][12] 这个 Python 文件并跳到文章结尾。
为了满足大家的好奇心,我将逐步讲解。
#### 导入一些库
```
#!/usr/bin/python3
# -*- coding:utf-8 -*-
@ -134,11 +130,11 @@ waveshare_base = basedir.joinpath('e-Paper', 'RaspberryPi_JetsonNano', 'python')
libdir = waveshare_base.joinpath('lib')
```
开始先导入一些标准库之后脚本中用。也需要你添加一些 PIL 的包: `Image`, `ImageDraw` ,和 `ImageFont` ,你会 用到这些包来画一些简单的图形。最后,为包含用于 2.13 英寸显示器的 Waveshare Python 库的本地 `lib` 目录设置一些变量,稍后你可以使用这些变量从本地目录加载库。
开始先导入一些标准库之后脚本中用。也需要你从 PIL 添加 `Image`、`ImageDraw` 和 `ImageFont`,你会用到这些来画一些简单的图形。最后,为本地 `lib` 目录设置一些变量,该目录包含了用于 2.13 英寸显示屏的 Waveshare Python 库,稍后你可以使用这些变量从本地目录加载库。
#### 字体大小辅助函数
下一部分是为你选择的字体建立一个修改大小的辅助函数: Bangers-Regular.ttf 。该函数将整型变量作为大小参数并返回一个图形字体对象来用于显示:
下一部分是为你选择的 Bangers-Regular.ttf 字体建立一个修改大小的辅助函数。该函数将整型变量作为大小参数,并返回一个图形字体对象来用于显示:
```
def set_font_size(font_size):
@ -148,15 +144,14 @@ def set_font_size(font_size):
#### 倒计时逻辑
接下来是计算这个项目的一个函数:距下次 Pi Day 还有多久。如果 Pi Day 在一月,那么计算剩余天数将很简单。但是你需要考虑是否今年的 Pi Day 这一天已经过去了。如果是这样的话,那么计算量将会很大:
接下来是计算这个项目的一个函数:距下次圆周率日还有多久。如果是在一月,那么计算剩余天数将很简单。但是你需要考虑是否今年的圆周率日是否已经过去了(允悲)。如果是的话,那么计算在你可以再次庆祝之前还有多少天:
```
def countdown(now):
    piday = datetime(now.year, 3, 14)
    # 如果错过了就增加一年
    if piday &lt; now:
    if piday < now:
        piday = datetime((now.year + 1), 3, 14)
    days = (piday - now).days
@ -167,8 +162,7 @@ def countdown(now):
#### 主函数
最后,到了主函数,需要初始化显示器并向它写数据。这时,你应该写一个欢迎语然后再开始倒计时。但是首先,你需要加载 Waveshare 库:
最后,到了主函数,需要初始化显示屏并向它写数据。这时,你应该写一个欢迎语然后再开始倒计时。但是首先,你需要加载 Waveshare 库:
```
def main():
@ -181,9 +175,9 @@ def main():
        sys.exit(1)
```
上面的代码片段检查以确保该库已下载到倒计时脚本旁边的目录中,然后加载“epd2in13_V2”库。 如果你使用不同的显示器,则需要使用不同的库。 如果你愿意,也可以自己编写。我发现阅读 Waveshare 随显示器提供的 Python 代码很有趣,它比我想象的要简单得多。
上面的代码片段检查以确保该库已下载到倒计时脚本旁边的目录中,然后加载`epd2in13_V2` 库。如果你使用不同的显示屏,则需要使用不同的库。如果你愿意,也可以自己编写。我发现阅读 Waveshare 随显示屏提供的 Python 代码很有趣,它比我想象的要简单得多。
下一段代码创建一个 EPD ePaper 显示器)对象以与显示器交互并初始化硬件:
下一段代码创建一个 EPD电子纸显示屏)对象以与显示器交互并初始化硬件:
```
    logging.info("Starting...")
@ -198,11 +192,10 @@ def main():
        epd.Clear(0xFF)
```
关于 ePaper 的一个有趣之处:它仅在将像素从白色变为黑色或从黑色变为白色时才使用电源。这意味着当设备断电或应用程序因任何原因停止时,屏幕上的任何内容都会保留下来。从功耗的角度来看,这很好,但这也意味着您需要在启动时清除显示,否则您的脚本只会覆盖屏幕上已有的内容。 因此,`epd.Clear(0xFF)` 用于在脚本启动时清除显示。
关于电子纸的一个有趣之处:它仅在将像素从白色变为黑色或从黑色变为白色时才耗电。这意味着当设备断电或应用程序因任何原因停止时,屏幕上的任何内容都会保留下来。从功耗的角度来看,这很好,但这也意味着你需要在启动时清除显示,否则你的脚本只会覆盖屏幕上已有的内容。 因此,`epd.Clear(0xFF)` 用于在脚本启动时清除显示。
接下来,创建一个“画布”来绘制剩余的显示输出:
```
    # 创建一个图形对象
# 注意:"epd.heigh" 是屏幕的长边
@ -217,15 +210,12 @@ def main():
#### 欢迎语
接下来,你将开始画一些画。这涉及在你之前创建的“画布”对象上设置数据。这还没有将它绘制到 ePaper 显示器上——你现在只是在构建你想要的图像。由你为这个项目绘制带有一块馅饼的图像,来创建一个庆祝 Pi Day 的欢迎信息:
接下来,你将开始画一些画。这涉及在你之前创建的“画布”对象上设置数据。这还没有将它绘制到电子纸显示屏上——你现在只是在构建你想要的图像。由你为这个项目绘制带有一块馅饼的图像,来创建一个庆祝圆周率日的欢迎信息:
![画一块馅饼][14]
(Chris Collins, [CC BY-SA 4.0][15])
很可爱,不是吗?
```
    logging.info("Set text text...")
    bangers64 = set_font_size(64)
@ -235,20 +225,20 @@ def main():
    bmp = Image.open(basedir.joinpath("img", "pie.bmp"))
    image.paste(bmp, (150,2))
```
最后_最后_你可以展示你画的图画
最后_真是是最后_你可以展示你画的图画
```
    logging.info("Display text and BMP")
    epd.display(epd.getbuffer(image))
```
That bit above updates the display to show the image you drew.
上面那段话更新了显示屏,以显示你所画的图像。
接下来,准备另一幅图像展示你的倒计时:
#### Pi Day 倒计时
首先,创建一个用来展示倒计时的项目。也需要设置数字的字体大小:
#### 圆周率日倒计时
首先,创建一个用来展示倒计时的图像对象。也需要设置数字的字体大小:
```
    logging.info("Pi Date countdown; press CTRL-C to exit")
@ -262,15 +252,13 @@ That bit above updates the display to show the image you drew.
为了使它显示的时候更像一个倒计时,更新图像的一部分是更加有效的手段,仅更改已经改变的显示数据部分。下面的代码准备以这样方式运行:
```
    # 准备更新显示
    epd.displayPartBaseImage(epd.getbuffer(piday_image))
    epd.init(epd.PART_UPDATE)
```
最后,需要计时,开始一个无限循环来检查据下次 Pi Day 还有多久并显示在 ePaper上。如果到了 Pi Day ,你可以输出一些庆祝短语:
最后,需要计时,开始一个无限循环来检查据下次圆周率日还有多久,并显示在电子纸上。如果到了圆周率日,你可以输出一些庆祝短语:
```
    while (True):
@ -295,7 +283,7 @@ That bit above updates the display to show the image you drew.
        time.sleep(5)
```
脚本最后做了一些错误处理,包括捕获键盘中断,这样你可以使用 **Ctrl**+**C** 来结束无限循环,以及一个根据计数来打印 'day' 或 'days' 的函数:
脚本最后做了一些错误处理,包括捕获键盘中断,这样你可以使用 `Ctrl + C` 来结束无限循环,以及一个根据计数来打印 `day``days` 的函数:
```
    except IOError as e:
@ -319,19 +307,16 @@ if __name__ == "__main__":
    main()
```
现在你已经拥有一个倒计时脚本并显示剩余天数!这是在我的树莓派上的显示(视频经过加速,我没有足够的磁盘空间来保存一整天的视频):
现在你已经拥有一个倒计时并显示剩余天数的脚本!这是在我的树莓派上的显示(视频经过加速,我没有足够的磁盘空间来保存一整天的视频):
![Pi Day Countdown Timer In Action][16]
(Chris Collins, [CC BY-SA 4.0][15])
#### 安装 systemd 服务(选做)
如果你希望在系统打开时运行倒计时显示并且无需登录并运行脚本,您可以将可选的 systemd 单元安装为 [systemd 用户服务][17].
如果你希望在系统打开时运行倒计时显示,并且无需登录并运行脚本,你可以将可选的 systemd 单元安装为 [systemd 用户服务][17]。
将 GitHub 上的 [piday.service][18] 文件复制到 `${HOME}/.config/systemd/user`,如果该目录不存在,请先创建该目录。然后你可以启用该服务并启动它:
```
$ mkdir -p ~/.config/systemd/user
$ cp piday.service ~/.config/systemd/user
@ -345,11 +330,11 @@ $ loginctl enable-linger $USER
该脚本将输出到 systemd 日志,可以使用 `journalctl` 命令查看输出。
### 它开始看起来很像 Pi Day
### 它开始看起来像是圆周率日了
现在你拥有了一个树莓派 Zero W 显示在 ePaper显示器上的 Pi Day 倒计时器!并在系统启动时使用 systemd 单元文件启动!现在只有 350 天左右我们才可以再次相聚庆祝奇妙的设备———树莓派。通过我们的小项目,我们可以一目了然地看到确切的天数。
这就是你的作品!一个显示在电子纸显示屏上的树莓派 Zero W 圆周率日倒计时器!并在系统启动时使用 systemd 单元文件启动!现在距离我们可以再次相聚庆祝圆周率日还有好多天的奇妙设备———树莓派。通过我们的小项目,我们可以一目了然地看到确切的天数。
事实上,任何人都可以全年都在心中举行 Pi Day因此请享受使用自己的树莓派创建一些有趣且具有教育意义的项目吧!
实际上,每个人都可以在每一天在心中庆祝圆周率日,因此请使用自己的树莓派创建一些有趣且具有教育意义的项目吧!
--------------------------------------------------------------------------------
@ -358,7 +343,7 @@ via: https://opensource.com/article/21/3/raspberry-pi-countdown-clock
作者:[Chris Collins][a]
选题:[lujun9972][b]
译者:[Donkey](https://github.com/Donkey-Hao)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -3,27 +3,32 @@
[#]: author: "Dan Whiting https://www.linuxfoundation.org/blog/why-do-enterprises-use-and-contribute-to-open-source-software/"
[#]: collector: "lkxed"
[#]: translator: "aREversez"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14725-1.html"
企业为何使用开源软件,又为何推动开源软件的发展
======
每当人们知道我在 <ruby>Linux 基金会<rt>Linux Foundation</rt></ruby> 工作,他们总是会问我们的工作具体是做什么的。有时候,他们会一直问我是不是开发 Linux 操作系统的。我只能回答说,我们做的是开源软件,并试图在他们失去兴趣之前,将对世界的重大影响赌在短短的 20 秒上。如果他们的兴趣还在,想要进一步了解,我就会给他们深入分析一番:企业为何想参与到开源软件项目之中?它们为何会使用开源软件?没错,企业确实会这样做,无论它们有没有意识到这一点。此外,成千上万的企业会将企业内部代码捐给开源项目,为推动开源软件的进一步开发和优化投入大量的时间和资源。
![](https://img.linux.net.cn/data/attachment/album/202206/18/160635ejcmee273zmmxh72.jpg)
每当人们知道我在 <ruby>Linux 基金会<rt>Linux Foundation</rt></ruby> 工作,他们总是会问我们的工作具体是做什么的。有时候,他们会一直问我是不是开发 Linux 操作系统的。我只能回答说,我们做的是开源软件,并试图在他们失去兴趣之前,在短短的 20 秒钟内介绍它对世界的影响力。如果他们的兴趣还在,想要进一步了解,我就会给他们深入分析一番:企业为何想参与到开源软件项目之中?它们为何会使用开源软件?没错,企业确实会这样做,无论它们有没有意识到这一点。此外,成千上万的企业会将企业内部代码捐给开源项目,为推动开源软件的进一步开发和优化投入大量的时间和资源。
### 开源软件的使用范围有多广
引用我们基金会最近发表的一项报告 <ruby>《企业开源指南》<rt>A Guide to Enterprise Open Source</rt></ruby><ruby>开源软件<rt>open source software</rt></ruby>OSS改变了世界是数字经济的支柱数字世界的基石。从我们日常使用的互联网和移动应用到开拓未来的操作系统和程语言,开源软件无不发挥着重要的作用,可谓是科技行业的命脉。在今天,开源软件驱动数字经济发展,推进科学技术取得突破,不断改善人们的生活水平。手机、汽车和飞机等设备,家庭、企业和政府等群体都在使用着开源软件。但就在 20 年前,开源软件还仅仅为少数人所知,为少数热心爱好者们组成的群体所用。”
引用我们最近发表的一项报告《<ruby>企业开源指南<rt>A Guide to Enterprise Open Source</rt></ruby>》:<ruby>开源软件<rt>open source software</rt></ruby>OSS改变了世界是数字经济的支柱数字世界的基石。从我们日常使用的互联网和移动应用到开拓未来的操作系统和程语言,开源软件无不发挥着重要的作用,可谓是科技行业的命脉。在今天,开源软件驱动数字经济发展,推进科学技术取得突破,不断改善人们的生活水平。手机、汽车和飞机等设备,家庭、企业和政府等群体都在使用着开源软件。但就在 20 年前,开源软件还仅仅为少数人所知,它的使用也仅限于一小部分专门的爱好者。”
如今,情况可大不相同了:
开源软件OSS已经改变了我们的世界成为我们数字经济的支柱和数字世界的基础。
* 在各行业的 <ruby>垂类软件栈<rt>vertical software stacks</rt></ruby> 中,开源软件的占比达到了 20%-85%。
而它实际上:
* 在各行业的 <ruby>垂类软件栈<rt>vertical software stacks</rt></ruby> 中,开源软件的占比达到了 20% - 85%。
* 超过 90% 的网站服务器和联网设备都依靠 Linux 来运行。
* 安卓手机系统也是基于 Linux 内核。
* 用于应用程序开发的 AMP、Appium、Dojo、jQuery、Marko、Node.js 等 [主流的库和工具][1] 均属于开源项目。
* 世界上排名位列前 100 名的超级计算机都在使用 Linux。
* 大型机客户均在使用 Linux。
* AWS、Google 以及 Microsoft 三大云服务供应商都在使用开源软件运行服务,策划并在云端发起开源解决方案。
* 亚马逊、谷歌以及微软三大云服务供应商都在使用开源软件运行服务,并在云端托管开源解决方案。
### 企业为何想参与到开源软件项目之中
@ -35,7 +40,7 @@
人们经常会问,为什么这些企业愿意放弃自家软件的所有权?为什么它们不让员工专攻自家软件的开发呢?
从整体上来看,这一问题的答案就是,企业和组织聚集起来,合力解决共同的难题,如此一来,他们就可以各自专注于在这基础上的各类难题。这些企业明白,将资源聚集在一起,能够更好地解决基础问题。有时,这种现象被叫做“竞合”,大概的意思是企业在一些领域可能互为竞争对手,但是它们在另一些领域则会互相合作。
从整体上来看,这一问题的答案就是,企业和组织聚集起来,合力解决共同的难题,如此一来,他们就可以各自专注于在这基础上的各类难题。这些企业明白,将资源聚集在一起,能够更好地解决基础问题。有时,这种现象被叫做“<ruby>竞合<rt>coopetition</rt></ruby>”,大概的意思是企业在一些领域可能互为竞争对手,但是它们在另一些领域则会互相合作。
“竞合”现象的一些典型例子:
@ -45,25 +50,19 @@
如今,企业、组织以及个体在合力解决难题的同时,也在不断地改进自身的产品与业务。
[<ruby>来此加密<rt>Lets Encrypt</rt></ruby>][2] 是一个免费开放的自动化证书颁发机构,旨在通过简化安装程序,减低安装费用,快速扩大安全网络协议的应用范围。该机构为超过 2.25 亿个网站提供服务,每天平均发放证书约 150 万张。
* <ruby>[来此加密][2]<rt>Lets Encrypt</rt></ruby>LCTT译注Lets Encrypt 官网并没有用“来此加密”这样的称呼,但是在一些场合有这样的译名。我们认为此翻译很贴切。) 是一个免费的、开放的自动化证书颁发机构,旨在通过简化安装程序,减低安装费用,快速扩大安全网络协议的应用范围。该机构为超过 2.25 亿个网站提供服务,每天平均发放证书约 150 万张。
* 好莱坞成立的 <ruby>[学院软件基金会][3]<rt>Academy Software Foundation</rt></ruby> 通过共同开发软件,推动娱乐、游戏和媒体等产业的增长,为产业发展提供开放标准,在电影行业内 [创造了巨大的价值][4]。
* <ruby>超级账本<rt>Hyperledger</rt></ruby> 基金会管理多个企业级区块链软件项目。众所周知,这些项目 [消耗的能源远比其他解决方案要少][5]。
* <ruby>[LF 能源基金会][6]<rt>LF Energy</rt></ruby> 推动 [电网朝着更加模块化、互操作和可拓展的方向发展][7],助力提升可再生能源的利用率。
* <ruby>[无人机代码基金会][8]<rt>Dronecode</rt></ruby> 致力于无人机软件的开发,促进企业在无人机领域进一步开拓创新。
* <ruby>[开源软件软件安全基金会][9]<rt>OpenSSF</rt></ruby> 聚集了顶尖的科技企业,共同强化开源软件的安全与韧性。
* [Kubernetes][10] 是 Google 捐赠给 Linux 基金会下属的云原生计算基金会CNCF的一个项目是管理基于云计算软件的首选方案。
好莱坞成立的 [<ruby>学院软件基金会<rt>Academy Software Foundation</rt></ruby>][3] 通过共同开发软件,推动娱乐、游戏和媒体等产业的增长,为产业发展提供开放标准,在电影行业内 [创造了巨大的价值][4]。
<ruby>超级账本<rt>Hyperledger</rt></ruby> 基金会发起了多个企业级区块链软件项目。众所周知,这些项目 [消耗的能源远比其他解决方案要少][5]。
[LF Energy 基金会][6] 推动 [电网朝着更加模块化、互操作和可拓展的方向发展][7],助力提升可再生能源的利用率。
[Dronecode 基金会][8] 致力于无人机软件的开发,促进企业在无人机领域进一步开拓创新。
[<ruby>开源软件软件安全基金会<rt>OpenSSF</rt></ruby>][9] 聚集了顶尖的科技企业,共同强化开源软件的安全与韧性。
[Kubernetes][10] 是 Google 捐赠给 Linux 基金会下属的云原生计算基金会CNCF的一个项目是管理基于云计算软件的首选方案。
上述只是企业参与的一小部分开源软件项目,点击[此处][11],在 Linux 基金会官网浏览全部项目列表。
上述只是企业参与的一小部分开源软件项目,点击 [此处][11],可以在 Linux 基金会官网浏览全部项目列表。
### 企业如何有效利用和参与开源软件项目?
若想要更好地利用开源项目,更有效地参与开源项目,企业可以向 Linux 基金会寻求帮助。我们最新发布的报告 [《企业开源指南][12] 提供了企业与组织需要了解的大部分信息。这份报告凝聚了来自多家顶级企业、具有几十年丰富经验的开源领袖的知识与智慧,报告主要分为以下六个章节:
若想要更好地利用开源项目,更有效地参与开源项目,企业可以向 Linux 基金会寻求帮助。我们最新发布的报告 《[企业开源指南][12]》 提供了企业与组织需要了解的大部分信息。这份报告凝聚了来自多家顶级企业、具有几十年丰富经验的开源领袖的知识与智慧,报告主要分为以下六个章节:
* 使用开源软件
* 准备参与开源
@ -74,19 +73,16 @@
此外Linux 基金会还提供了许多开源 [培训课程][13]、全年 [活动][14]、[LFX 平台][15],发起开源项目,协助企业与组织利用和参与开源项目,比如:
[TODO 工作组][16] 为开源项目办公室的建立和运作提供资源,包括其自身 [丰富的指导意见][17]。
* [TODO 工作组][16] 为开源项目办公室的建立和运作提供资源,包括其自身 [丰富的指导意见][17]。
* [Openchain 项目][18] 旨在提供和维护国际开源许可标准,包括各种许可规定的相关信息。依赖于此,企业可以确保自身行为符合法律规定。
* [FinOps 基金会][19] 目前正在将自身打造为“不断发展的云财务管理和文化实践平台,通过促进工程、财务、技术以及商业团队之间在数据驱动支出决策方面的合作,确保企业能够最大化实现商业价值”。
* <ruby>[软件数据包交换标准][20]<rt>Software Data Package Exchange</rt></ruby>SPDX是一个用于交流 <ruby>软件物料清单<rt>software bill of materials</rt></ruby>SBOM的开放标准。在该标准下每个用户都能清楚了解整个软件包中包括哪些软件。
[Openchain 项目][18] 旨在提供和维护国际开源许可标准,包括各种许可规定的相关信息。依赖于此,企业可以确保自身行为符合法律规定。
[FinOps 基金会][19] 目前正在将自身打造为“不断发展的云财务管理和文化实践平台,通过促进工程、财务、技术以及商业团队之间在数据驱动支出决策方面的合作,确保企业能够最大化实现商业价值”。
[Software Data Package Exchange (SPDX)][20] 是一个用于交流 <ruby>软件构成清单<rt>software bill of materials</rt></ruby>SBOMs的开放标准。在该标准下每个用户都能清楚了解整个软件包中包括哪些软件。
重复一遍,上述这些只是 Linux 基金会所有项目中的一小部分。所有这些项目都致力于帮助企业接受和使用开源项目,引导企业为开源项目做出贡献、提供捐赠。
同样,上述这些只是 Linux 基金会所有项目中的一小部分。所有这些项目都致力于帮助企业接受和使用开源项目,引导企业为开源项目做出贡献、提供捐赠。
总而言之,目前,企业正在迅速投向开源软件项目,借此解决共同的难题,并探索进一步的创新发展,而 Linux 基金会将为它们提供帮助。
该文 [《企业为何使用开源软件,又为何推动开源软件的发展》][21] 首发于 [Linux 基金会][22] 官网。
*该文 [《企业为何使用开源软件,又为何推动开源软件的发展》][21] 首发于 [Linux 基金会][22] 官网。*
--------------------------------------------------------------------------------
@ -95,7 +91,7 @@ via: https://www.linux.com/news/why-do-enterprises-use-and-contribute-to-open-so
作者:[Dan Whiting][a]
选题:[lkxed][b]
译者:[aREversez](https://github.com/aREversez)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,147 @@
[#]: subject: "Dont Be Afraid of Linux Terminal. Embrace it."
[#]: via: "https://itsfoss.com/love-thy-terminal/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: "duoluoxiaosheng"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14721-1.html"
Linux 终端,它不可怕,拥抱它
======
![](https://img.linux.net.cn/data/attachment/album/202206/17/144213pjobjojcnwbnd4rn.jpg)
至少,对于熟悉图形界面的新用户来说,我们大多时候都在避免使用 Linux 终端。
尽管让事情变得简单和方便是好事,但还是有许多理由说明我们不应该害怕尝试 Linux 终端。
在这里,我将重点介绍其中的几个,以鼓励你在终端中尝试一些最终会对你有所帮助的东西。
### 1、快速熟悉命令
![quick info terminal][1]
有时,你需要使用某个命令在终端中执行一些操作。当然,你可以在不知道它到底有什么用情况下复制粘贴。
但是,如果你想知道这条命令更多的信息,该怎么办呢?
你只需要输入下面的命令就可以了,
```
man <command you intend to learn>
```
例如:`man apt`。
它会直接在屏幕上给出所有重要的细节,不需要网络连接,不需要在网上搜索它是如何工作的。你节约了时间,增长了知识。
而且,这使事情变得简单,使你在使用终端的时候更有信心。
这通常被称为 “<ruby>手册页<rt>man page</rt></ruby>”。 你可以阅读我们的课程《[了解 Linux 上的手册页][2]》。
Linux 终端万岁。
### 2、解决问题
![troubleshoting illustration][3]
当你在互联网上搜索一个问题的解决方法时,通常,解决方案中会包含几个命令。
因此,终端的最佳用例之一,是可以毫不费力地解决几个系统问题。同时,你需要小心,因为如果你不知道你在做什么,你可能最终会破坏你的系统。
虽然图形界面可以调整一些东西,但是大部分简单的修复方法都是通过终端完成的。
我们在网站上提供了几个 [故障诊断指南][4],例如:
* [检查网卡制造商][5]
* [修复关机时间过长][6]
* [修复博通网卡没有 WiFi 信号的问题][7]
### 3、使用远程服务器愉快工作
![remote server illustration][8]
最终,你会通过命令行(或终端)访问一个远程服务器并执行各种操作,包括文件传输。
与使用图形界面访问远程服务器相比,使用 Linux 终端可以让你用最小的带宽,快速的执行任何你想要的操作。
当然,你也可以通过终端在远程服务器上开启图形界面程序。尽管速度十分缓慢,终端还是可以让你轻松的与远程服务器进行交互。
### 4、高效利用资源
不管你使用哪一款 [Linux 发行版][9]Linux 终端永远是高效且消耗内存最小的。
如果你资源不足或硬件驱动和图形界面程序有冲突,那么 Linux 终端永远值得你的信赖。
这将帮你在不占用太多系统资源的情况下完成关键任务。
### 5、快速
![fast illustration][10]
你知道吗?不仅局限于内存使用,使用终端你可以比使用图形界面更快的完成任务。
你可以尝试安装应用、运行程序、执行复杂的文件操作等等。
### 6、稳定可靠的命令行程序
相比于图形界面程序,命令行程序更加稳定和可靠,为什么呢?
在终端中,使程序崩溃的因素很少。
由于终端工具大部分是为服务器构建的,很多时候不够直观。也正是由于这个原因,命令行工具通常不会得到不必要的频繁更新,使它们成为比图形界面程序更可靠的选择。
### 7、更多的命令行工具
没有一个图形界面程序能解决所有问题。但是,对执行各种操作,然而,有几个 [命令行工具][11] 可以执行各种操作,一些有趣和关键的任务也是如此。
你需要完成一些工作,来吧,总有一款命令行工具适合你。
### 8、尝试各种终端模拟器
![variety illustration][12]
尽管使用 Linux 发行版默认安装的终端模拟器对你来说没有任何困难,你仍然有更多的选择。
如果你有特殊的外观和性能需求,或者为某些用途特殊定制,你可以看看这些 [最佳的终端模拟器][13]。
如果你觉得使用终端是一件枯燥的事情,你一定要试试这些终端模拟器。
### 结束语
就我个人来说,当我刚开始接触 Linux 时,我也对终端心存畏惧。但是当我可以熟练的使用它处理一些简单任务的时候,我才开始意识到上面所说的终端的优点。
你没必要放弃图形界面而使用终端处理所有的事情。尽管如此,最好还是使用终端处理一些事情,这可以节省你的时间,让你更快的完成工作,并心情愉悦。
Abhishek 曾经写过一篇很棒的涉及各种小事的 [指南][14],可以让你熟悉 Linux 终端。
*你觉得,相比于图形界面,终端有哪些优点呢?是什么原因让你选择终端呢?快来告诉我们吧。*
--------------------------------------------------------------------------------
via: https://itsfoss.com/love-thy-terminal/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[duoluoxiaosheng](https://github.com/duoluoxiaosheng)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/wp-content/uploads/2022/06/quick-info-terminal.png
[2]: https://itsfoss.com/linux-man-page-guide/
[3]: https://itsfoss.com/wp-content/uploads/2022/06/troubleshoting-illustration.jpg
[4]: https://itsfoss.com/tag/troubleshoot/
[5]: https://itsfoss.com/find-network-adapter-ubuntu-linux/
[6]: https://itsfoss.com/long-shutdown-linux/
[7]: https://itsfoss.com/fix-no-wireless-network-ubuntu/
[8]: https://itsfoss.com/wp-content/uploads/2022/06/remote-server-illustration.jpg
[9]: https://itsfoss.com/best-linux-distributions/
[10]: https://itsfoss.com/wp-content/uploads/2022/06/fast-illustration.jpg
[11]: https://itsfoss.com/tag/cli-tools/
[12]: https://itsfoss.com/wp-content/uploads/2022/06/variety-illustration.jpg
[13]: https://itsfoss.com/linux-terminal-emulators/
[14]: https://itsfoss.com/basic-terminal-tips-ubuntu/

View File

@ -3,19 +3,20 @@
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
[#]: collector: "lkxed"
[#]: translator: "lkxed"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14729-1.html"
Adobe 推出了开源工具包以减少视觉错误信息
为减少视觉错误信息,Adobe 推出了开源工具包
======
![Adobe][1]
Adobe 设想了一个充满照片和视频的网络,照片和视频上标注关于它们来自哪里的信息。该公司的主要目标是减少视觉错误信息的传播,不过,该系统也可以使那些“希望将自己的名字与工作关联起来”的内容创作者受益。
![](https://img.linux.net.cn/data/attachment/album/202206/19/105844yauuhdz1u1189ffr.jpg)
Adobe <ruby>内容真实性计划<rt>Content Authenticity Initiative</rt></ruby> (CAI) 项目于 2019 年首次宣布,此后,它发布了一份关于实现该目标的技术白皮书,将该系统集成了到自己的软件中,并与新闻编辑室和硬件制造商展开了合作,以帮助普及其愿景
Adobe 设想的是为网络上充斥的照片和视频标注关于它们的来源。该公司的主要目标是减少视觉错误信息的传播,不过,该系统也可以使那些“希望将自己的名字与工作关联起来”的内容创作者受益
现在该公司发布了一个由三部分组成的开源工具包从而把该技术交到开发人员手中并投入使用。Adobe 的新开源工具包括用于开发“在浏览器中显示内容凭据”的 JavaScript SDK、命令行实用程序和用于开发桌面应用程序、移动应用程序和其他用于创建、查看和验证嵌入式内容凭据的 Rust SDK。
Adobe 在 2019 年首次宣布了其 <ruby>内容真实性计划<rt>Content Authenticity Initiative</rt></ruby>CAI项目此后它发布了一份关于实现该目标的技术白皮书将该系统集成了到自己的软件中并与新闻编辑室和硬件制造商展开了合作以帮助普及其愿景。
现在该公司发布了一个由三部分组成的开源工具包从而把该技术交到开发人员手中并投入使用。Adobe 的新开源工具包括一个用于开发“在浏览器中显示内容凭据”的 JavaScript SDK、一个命令行实用程序和一个用于开发桌面应用程序、移动应用程序和其他应用的 Rust SDK以创建、查看和验证嵌入式内容凭据。
众所周知,照片的 EXIF 数据中记录了有关光圈和快门速度的信息,这个新标准也采用了这种方式,它还记录有关文件创建的信息,例如文件的创建和编辑方式。如果该公司的共同愿景成真,这些 Adobe 称之为“内容凭证”的元数据,将在社交媒体平台、图像搜索平台、图像编辑器、搜索引擎中广泛可见。
@ -34,7 +35,7 @@ via: https://www.opensourceforu.com/2022/06/adobe-launches-open-source-toolkit-t
作者:[Laveesh Kocher][a]
选题:[lkxed][b]
译者:[lkxed](https://github.com/lkxed)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -3,13 +3,16 @@
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: "lkxed"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14720-1.html"
KDE Plasma 5.25 发布:颜色、主题和其他改进
======
KDE Plasma 5.25 终于来了,它带来了许多视觉更新和有用的改进!
![](https://img.linux.net.cn/data/attachment/album/202206/17/120251jxjpjmmhzcmoq2mx.jpg)
> KDE Plasma 5.25 终于来了,它带来了许多视觉更新和有用的改进!
![Plasma 5.25][1]
@ -17,7 +20,7 @@ KDE Plasma 5.25 一直是最受期待的版本之一,因为它最近的版本
例如,[KDE Plasma 5.24][2] LTS 版本带来了升级的 Breeze 主题和全新的概览效果,改进了工作流程。
终于KDE Plasma 5.25 带来了更多升级!
如今KDE Plasma 5.25 带来了更多升级!
### KDE Plasma 5.25 更新内容
@ -29,9 +32,9 @@ KDE Plasma 5.25 一直是最受期待的版本之一,因为它最近的版本
![][4]
如果你玩过 “[No Man's Sky][5]” 或类似的电子游戏,你可能会有似曾相识的感觉。
如果你玩过 “<ruby>[无人深空][5]<rt>No Man's Sky</rt></ruby>” 或类似的电子游戏,你可能会有似曾相识的感觉。
撇开这一点不谈,默认壁纸旧壁纸进行了更新,具有完全不同的主题颜色。
撇开这一点不谈,默认壁纸旧壁纸进行了更新,具有完全不同的主题颜色。
#### 触摸板和触摸屏手势
@ -45,11 +48,11 @@ Plasma 5.25 包括了一系列手势,以充分利用新功能。例如:四
![KDE Plasma 5.25][6]
当你继续在系统设置应用 <ruby>全局主题<rt>Global Theme</rt></ruby> 时,系统将提示你,是否要将主题应用到任何地方,或是只应用到它的某些部分。
当你在系统设置应用 <ruby>全局主题<rt>Global Theme</rt></ruby> 时,系统将提示你,是否要应用主题的所有部分,或是只应用它的某些部分。
你可以将它应用于特定的外观选项,也可以用它来替换整个配置。
你可以应用它的特定外观选项,也可以用它来替换整个配置。
也就是说,当将全局主题应用于使用 KDE 的系统时,这个更新在自定义方面提供了细粒度的控制。
总的来说,当将全局主题应用于使用 KDE 的系统时,这个更新提供了细粒度的自定义控制。
#### 根据当前壁纸自动生成强调色
@ -59,15 +62,15 @@ Plasma 5.25 包括了一系列手势,以充分利用新功能。例如:四
![][7]
所以,如果你既想要找点东西来匹配你的背景,又不想要自己花力气制作,那么这个选项应该会对你有用。
所以,如果你既让桌面匹配你的背景,又不想要自己花力气定制,那么这个选项应该会对你有用。
![][7a]
这是新功能库的一个小而强大的补充。
这是新功能库的一个小而强大的补充。
#### 带有强调色的配色方案
为了更好地自定义外观/观感KDE Plasma 5.25 将允许部为你选择的强调色定制配色方案。
为了更好地自定义外观/观感KDE Plasma 5.25 可以让你在选择的强调色上定制配色方案。
![KDE Plasma 5.25][8]
@ -77,39 +80,39 @@ Plasma 5.25 包括了一系列手势,以充分利用新功能。例如:四
![][9]
当你在桌面环境中使用触模式时通过支持的设备或手动KDE Plasma 5.25 将增大 KDE 应用程序的任务管理器、系统托盘和标题栏的大小,使它们更易于访问。
当你在桌面环境中使用触模式时通过支持的设备或手动KDE Plasma 5.25 将增大 KDE 应用程序的任务管理器、系统托盘和标题栏的大小,使它们更易于访问。
#### Discover 软件中心的改进
#### “发现” 软件中心的改进
Discover 软件中心有一些细微的变化。以前,你需要单独浏览“应用程序”、“附加组件”和 “Plasma 附加组件”等类别;而现在,你在侧边栏中就可以找到所有应用程序类别。
<ruby>发现<rt>Discover</rt></ruby> 软件中心有一些细微的变化。以前,你需要单独浏览“应用程序”、“附加组件”和 “Plasma 附加组件”等类别;而现在,你在侧边栏中就可以找到所有应用程序类别。
![KDE Plasma 5.24][10]
![KDE Plasma 5.25][11]
此外,对于 Flatpak 应用程序,你可以看到它所需的权限。还有,应用程序页面也获得了一些升级,以显示有关你查看的应用程序的更多信息。
此外,对于 Flatpak 应用程序,你可以看到它所需的权限。还有,应用程序页面也了一些升级,以显示有关你查看的应用程序的更多信息。
#### 其他改进
其他重要的改进包括定制功能的升级和工作流程的修改。其中包括:
* 一个新的混合效果,用于使动画颜色之间的过渡更加平滑,每当你改变主题/颜色,它都会自动改变
* 一个新的混合效果,用于使动画颜色之间的变化具有动画效果,每当你改变主题/颜色或自动改变时,可以平滑过渡
* 强大的容纳管理功能,它允许你在监视器之间移动桌面以及文件夹/小部件,即使你已断开它们的连接。
* Kwin 脚本设置页面已被重写。
* 键盘导航有了自定义快捷方式支持和系统托盘图标。
* 键盘导航支持自定义快捷键和系统托盘图标。
* 新增一个浮动面板,用于在面板周围添加边距。
* 改进了 KRunner 的性能。
* 网络小部件添加了 Wi-Fi 网络的频率和 BSSID 的详细信息。
如果你仍然好奇,可以查看 [公告][12] 以了解更多信息
如果你想了解更多,可以查看 [公告][12]
### 尝试 KDE Plasma 5.25
一旦 KDE Neon 更新可用,你就可以下载它,以获取最新的 KDE Plasma 5.25。如果你等不及了,测试版也是个不错的选择(如果你愿意尝试的话)。
你可以下载 KDE Neon以便在最新的 KDE Plasma 5.25 有更新时马上就可以用上。如果你等不及了,测试版也是个不错的选择(如果你愿意实验的话)。
[KDE Neon][13]
> **[KDE Neon][13]**
对于其他 Linux 发行版,你将不等待开发人员推送更新LTS 版除外)。
对于其他 Linux 发行版你得等待开发人员推送更新LTS 版除外)。
--------------------------------------------------------------------------------
@ -118,7 +121,7 @@ via: https://news.itsfoss.com/kde-plasma-5-25-release/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[lkxed](https://github.com/lkxed)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,104 @@
[#]: subject: "Share your Linux terminal with tmate"
[#]: via: "https://opensource.com/article/22/6/share-linux-terminal-tmate"
[#]: author: "Sumantro Mukherjee https://opensource.com/users/sumantro"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: "turbokernel"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14726-1.html"
用 tmate 分享你的 Linux 终端
======
> tmate 扩展了你分享 Linux 终端会话的方式。
![](https://img.linux.net.cn/data/attachment/album/202206/18/170815hfrcdfd4lltd737z.jpg)
作为 Fedora Linux QA 团队的一员,我有时想将自己执行的一堆命令广而告之给其他开发者。如果你曾经使用过像 [tmux][5] 或 [GNU Screen][6] 这样的 [终端复用器][4],你可能会认为这是一个挺轻松的任务。不是所有看我的示范的人都是从笔记本电脑或台式机连接到我的终端会话的,有些人可能是随手在他们的手机浏览器中打开的,因为我使用了 [tmate][7],所以他们可以很容易地做到这一点。
### 使用 tmate 分享 Linux 终端
观看别人在 Linux 终端的工作是非常有教育意义的。你可以学到新的命令、新的工作流程,或者新的调试和自动化的方法。但要抓住你所看到的东西,以便你以后可以自己尝试,这可能很困难。你可能会借助截图或一个共享终端会话的屏幕记录,这样你就可以在以后打出每个命令。剩下的唯一选择是由演示命令的人使用 [Asciinema][8] 或 [script 和 scriptreplay][9] 等工具来记录会话。
但是通过 `tmate`,用户可以在只读模式下或通过 SSH 分享终端。SSH 和只读会话都可以通过终端或以 HTML 网页的形式访问。
当我为 Fedora QA 团队培训人员时,我使用只读模式,因为我需要运行命令并显示输出,但有了 `tmate`,人们可以通过从他们的浏览器复制和粘贴到文本编辑器来记录笔记。
### Linux tmate 上手
在 Linux 上,你可以用你的包管理器安装 `tmate`。例如,在 Fedora 上:
```
$ sudo dnf install tmate
```
在 Debian 和类似的发行版上:
```
$ sudo apt install tmate
```
在 macOS 上,你可以用 [Homebrew][10] 或 [MacPorts][11] 安装它。如果你需要其他 Linux 发行版的说明,请参考 [安装][12] 指南。
![Screenshot of terminal showing the options for tmate sharing: web session (regular and read-only) and ssh session (regular and read-only)][13]
安装后,启动 `tmate`
```
$ tmate
```
`tmate` 启动时,会生成链接,通过 HTTP 和 SSH 提供对终端会话的访问。每个协议都有一个只读方式,以及一个反向的 SSH 会话。
下面是一个网络会话的样子:
![Screenshot showing tmate terminal window and 2 versions of sharing sessions demonstrating the same code][14]
`tmate` 的网络控制台是 HTML5 的,因此,用户可以复制整个屏幕并粘贴到终端来运行相同的命令。
### 保持会话
你可能想知道如果你不小心关闭了你的终端会发生什么。你也可能想知道如何与不同的控制台应用共享你的终端。毕竟,`tmate` 是一个多路复用器,所以它应该能够保持会话,脱离并重新连接到一个会话,等等。
当然,这正是 `tmate` 所能做到的。如果你曾经使用过 `tmux`,这可能是相当熟悉的。
```
$ tmate -F -n web new-session vi console
```
这个命令在 `vi` 中打开了 `new-session``-F` 选项确保会话在关闭时也能重新产生。
![A screenshot of the terminal showing the output after using the new-session and -F options: connection information for either a web session (regular or read-only) or ssh session (regular or read-only)][15]
### 社交复用
`tmate` 给你带来了 `tmux` 或 GNU Screen 的自由度,以及与他人分享会话的能力。这是一个有价值的工具,可以教其他用户如何使用终端、演示一个新命令的功能,或调试意外的行为。它是开源的,所以请试一试!
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/6/share-linux-terminal-tmate
作者:[Sumantro Mukherjee][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[turbokernel](https://github.com/turbokernel)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/sumantro
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/terminal_command_linux_desktop_code.jpg
[2]: https://pixabay.com/en/users/iradaturrahmat-3964359/
[3]: https://pixabay.com/en/ubuntu-computer-program-interface-3145957/
[4]: https://opensource.com/article/21/5/linux-terminal-multiplexer
[5]: https://opensource.com/downloads/tmux-cheat-sheet
[6]: https://opensource.com/article/17/3/introduction-gnu-screen
[7]: https://tmate.io/
[8]: https://opensource.com/article/22/1/record-your-terminal-session-asciinema
[9]: https://www.redhat.com/sysadmin/record-terminal-script-scriptreplay
[10]: https://opensource.com/article/20/6/homebrew-mac
[11]: https://opensource.com/article/20/11/macports
[12]: https://tmate.io/
[13]: https://opensource.com/sites/default/files/2022-06/install%20tmate_0.png
[14]: https://opensource.com/sites/default/files/2022-06/tmate%20web%20session.png
[15]: https://opensource.com/sites/default/files/2022-06/tmate%20keeping%20session%20alive.png

View File

@ -3,17 +3,18 @@
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: "lkxed"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14723-1.html"
Mozilla 刚刚使 Firefox 成为所有用户最安全的 Web 浏览器
Mozilla 刚刚使 Firefox 成为所有人的最安全的网页浏览器
======
Mozilla 终于启用了一项隐私保护功能,这可能使其成为当下最安全的网络浏览器。你怎么看?
> Mozilla 终于启用了一项隐私保护功能,这可能使其成为当下最安全的网页浏览器。你怎么看?
![Mozilla Firefox][1]
Mozilla Firefox 是市面上最安全的开源 Web 浏览器之一。
Mozilla Firefox 是市面上最安全的开源网页浏览器之一。
毫无疑问,你可以自由定制它来进一步增强安全性,这就是 Tor 浏览器使用 Firefox 作为其核心的原因。
@ -21,39 +22,39 @@ Mozilla Firefox 是市面上最安全的开源 Web 浏览器之一。
现在Mozilla 终于为**所有桌面用户**启用了一项新功能,这使其成为最安全的浏览器(或是他们声称的“最安全”)。
本文中,我讨论的不是任何新功能,而是 Firefox 中的现有功能,即 <ruby>全面的 Cookie 保护<rt>Total Cookie Protection</rt></ruby>。它是在去年与 [Firefox 86][3] 一起引入的,但默认情况下并未对所有用户启用。
本文中,我讨论的不是任何新功能,而是 Firefox 中的现有功能,即 <ruby>Cookie 全面保护<rt>Total Cookie Protection</rt></ruby>。它是在去年与 [Firefox 86][3] 一起引入的,但默认情况下并未对所有用户启用。
### 为所有用户提供的全面的 Cookie 保护
全面的 Cookie 保护”正在向所有人推出,无论你使用的是 Windows、Mac 还是 Linux它将成为默认启用的核心功能之一。
“Cookie 全面保护”正在向所有人推出,无论你使用的是 Windows、Mac 还是 Linux它将成为默认启用的核心功能之一。
最初,要使用该功能,你必须启用严格模式(<ruby>增强跟踪保护<rt>Enhanced Tracking Protection</rt></ruby>)。但现在,你不再需要这样做了。
**它是什么?**
#### 它是什么?
如果你好奇的话,“全面的 Cookie 保护”会隔离每个网站和它们的 cookie。其中Cookie 是网站向你的浏览器发送的少量数据。
如果你好奇的话,“Cookie 全面保护”会隔离每个网站和它们的 Cookie。Cookie 是网站向你的浏览器发送的少量数据。
因此,cookie 不会在网站之间共享,从而防止了<ruby>跨站跟踪<rt>cross-site tracking</rt></ruby>
因此,Cookie 不会在网站之间共享,从而防止了<ruby>跨站跟踪<rt>cross-site tracking</rt></ruby>
浏览器将为你访问的每个网站都创建单独的 cookie 罐。
浏览器将为你访问的每个网站都创建单独的<ruby>饼干罐<rt>Cookie Jar</rt></ruby>”。LCTT 译注Cookie 原意是小饼干。)
![][4]
Mozilla 的博文对此进行了更多解释:
> 在任何时候,网站或嵌入网站的 [第三方内容][5] 在浏览器中存储的 cookie都将仅限于分配给该网站的 cookie 罐。其他网站无法进入不属于它们的 cookie 罐,以得到那些网站的 cookie 对你的了解。这可以让你免受侵入性广告的影响,并减少公司收集的关于你的信息量。
> 在任何时候,网站或嵌入网站的 [第三方内容][5] 在浏览器中存储的 Cookie都将仅限于分配给该网站的 “饼干罐”。其他网站无法进入不属于它们的“饼干罐”,以得到你存储在那些 Cookie 中的信息。这可以让你免受侵入性广告的影响,并减少公司收集的关于你的信息量。
### 那么,这有什么大不了的吗?
即使你配备了所有的隐私跟踪保护和内容拦截器,你也不一定知道,其实还有个问题叫做“跨站跟踪”。
即使你配备了所有的隐私跟踪保护和内容拦截器,你也不一定知道,其实还有个问题叫做“跨站跟踪”。
因此,通过跨站点 cookie 交互,你的许多个人活动和习惯,都可以帮助数字跟踪公司建立你的在线个人资料。
因此,通过跨站点的 Cookie 交互,你的许多个人活动和习惯,都可以帮助数字跟踪公司建立你的在线个人资料。
但是,对于 Mozilla Firefox 来说,它在所有其他隐私措施之上,默认额外启用了该功能,这可确保你获得最私密的体验。
并且,所有这些都不需要你调整任何东西,这应该为那些“以隐私为中心”的用户提供方便。
并且,所有这些都不需要你调整任何东西,这应该为那些“重视隐私”的用户提供方便。
如果你还是好奇的话,你可以查看 Mozilla 的 [官方公告][6]。
想了解进一步信息,你可以查看 Mozilla 的 [官方公告][6]。
--------------------------------------------------------------------------------
@ -62,7 +63,7 @@ via: https://news.itsfoss.com/mozilla-firefox-secure/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[lkxed](https://github.com/lkxed)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,38 @@
[#]: subject: "The Travis CI Vulnerability Exposes Sensitive Open Source Project Credentials"
[#]: via: "https://www.opensourceforu.com/2022/06/the-travis-ci-vulnerability-exposes-sensitive-open-source-project-credentials/"
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
[#]: collector: "lkxed"
[#]: translator: "lkxed"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14724-1.html"
Travis CI 漏洞暴露了敏感的开源项目凭证
======
![Travis CI](https://img.linux.net.cn/data/attachment/album/202206/18/095734heuo8nc7g7n0ibtd.jpg)
Travis CI 持续集成工具中的一个缺陷暴露了来自数千个在线开源项目的敏感数据。这并不是该软件第一次遇到此类安全问题。
Travis CI 是一个持续集成工具它帮助软件开发者实现自动化地测试新代码并将新代码集成到开源项目中。Aqua 研究人员发现,通过该软件的一个 API可以访问来自 Travis CI 免费用户的多达 7.7 亿条“日志”(即使用户的账号已经删除)。
攻击者可以从这些明文存储的日志中,提取出用于登录 GitHub、Docker Hub 和 AWS 等云服务的用户身份验证令牌。研究人员在 800 万份日志样本中,发现了 70000 多个敏感令牌和其他机密凭证。Aqua 团队认为“所有 Travis CI 免费用户都有可能暴露”。根据 2019 年的数据Travis CI 被超过 60 万名独立用户,用于超过 932977 个开源项目。
这种对高级用户凭证的访问,会给使用该产品的软件开发者及其客户带来风险。趋势科技英国和爱尔兰安全技术总监 Bharat Mistry 解释道:“如果攻击者获得了这些凭据,就没有什么能阻止他们将恶意代码引入库或构建过程。这个缺陷无疑会导致数字供应链攻击。”
供应链攻击可能极具破坏性。2020 年的 <ruby>太阳风<rt>Solar Winds</rt></ruby> 攻击使国家资助的俄罗斯黑客能够访问数千家企业和政府组织的系统。2021 年的 Kaseya 供应链攻击,使犯罪分子可以同时加密 1500 多家公司的数据,将它们全部扣为人质。
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/06/the-travis-ci-vulnerability-exposes-sensitive-open-source-project-credentials/
作者:[Laveesh Kocher][a]
选题:[lkxed][b]
译者:[lkxed](https://github.com/lkxed)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/laveesh-kocher/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/travis-c.png

View File

@ -0,0 +1,77 @@
[#]: subject: "Ubuntu Core 22 is Here for IoT and Edge Devices"
[#]: via: "https://news.itsfoss.com/ubuntu-core-22-release/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: "lkxed"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14730-1.html"
Ubuntu Core 22 来了,适用于物联网和边缘设备
======
> Ubuntu Core 22 基于 Ubuntu 22.04 LTS为物联网和嵌入式设备带来了最佳的安全性和性能。
![Ubuntu][1]
Ubuntu Core 22 是一个容器化的 Ubuntu 22.04 LTS 变体,针对嵌入式和物联网设备进行了优化。
对于希望在边缘设备上运行 Canonical 的最新操作系统的开发者来说,这会是一个很棒的产品。
在发布 Ubuntu Core 22 时Canonical 的 CEO **Mark Shuttleworth** 说:
> “Canonical 的目标是在从开发环境到云、再到边缘和设备的任何地方提供安全、可靠的开源技术。”
### Ubuntu Core 22 更新介绍
![什么是 Ubuntu Core 22][2]
Ubuntu Core 22 版本带来了针对安全性和可靠性的改进。其中包括了以下几个改进。
#### 实时计算
正如公告中提到的Ubuntu 22.04 LTS 提供了一个实时内核(测试版可用),它能为那些时间敏感的工业、汽车和机器人用例,提供高性能、超低延迟和工作负载可预测性。
此外,如果你有 Ubuntu 认证的硬件,你还能充分利用先进的实时功能。
#### Snapcraft 框架
整个 Ubuntu 镜像分解为许多个包Snap使得内核、操作系统和应用程序隔离在一个沙箱中。
这可以让你轻松地安装应用程序,而无需担心来自专用 <ruby>物联网应用商店<rt>IoT App Store</rt></ruby> 的依赖。对于企业而言,通过软件商店进行的软件管理解决方案,应该能够带来一系列内部部署的机会。
该框架还可帮助系统确保 OTA 更新按预期工作,即使由于某种原因失败,也不会破坏任何内容。
#### 安全
Ubuntu Core 提供了高级安全功能,包括安全启动、全盘加密以及一些更适合任务关键型环境的功能。
注意,此版本还提供了 10 年的安全更新承诺。
#### 其他关键改进
* 支持从 Ubuntu Core 20 轻松迁移并确保向后兼容性。
* 性能改进。
* 新的“恢复出厂设置”启动模式,以便在“运行/恢复模式”中恢复出厂设置。
如果你想了解更多信息,可以查看 [官方公告][3]。
如果你对 Ubuntu Core 感兴趣,可以访问它的 [主​​页][4] 以了解更多关于它的信息。
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/ubuntu-core-22-release/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[lkxed](https://github.com/lkxed)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/ubuntu-22-core.jpg
[2]: https://youtu.be/6NDWqH1SrGs
[3]: https://ubuntu.com/blog/canonical-ubuntu-core-22-is-now-available-optimised-for-iot-and-embedded-devices
[4]: https://ubuntu.com/core

View File

@ -1,39 +0,0 @@
[#]: subject: "Mattermost Extends workflow platform with 7.0 release"
[#]: via: "https://www.opensourceforu.com/2022/06/mattermost-extends-workflow-platform-with-7-0-release/"
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Mattermost Extends workflow platform with 7.0 release
======
![marttermost][1]
Mattermost has been developing a messaging platform with a growing number of use cases since it began as an open source project in 2016. The company today announced the Mattermost 7.0 platform, which includes new voice calls, workflow templates, and an application framework for open-source technology. The new release expands on capabilities introduced with the 6.0 update in October 2021. Mattermost competes for a piece of the growing market for collaboration tools with several large companies, including Slack, Atlassian, and Asana. Mattermost, on the other hand, focuses on developer enablement, though the platform can also be used for security and IT operations.
Mattermosts software is available in both commercial and open source versions, and both are now at version 7. Tien explained that Mattermosts commercial platform is built on an open-source foundation. In the open-core model, open source software serves as the foundation, or core, while proprietary enterprise features are built into a commercial version. Compliance, scale, and advanced configuration are key enterprise features for Mattermost. Tien claims that the open source version is more than capable for small and mid-sized teams. He anticipates that organisations will need to consider the commercial release for teams of 500 or more users.
Tien believes that open source is also about community contributions. The Mattermost open source project has over 4,000 individual contributors who have contributed over 30,000 lines of code. Mattermost previously relied on integration with third-party call services, such as Zoom, to enable voice call functionality.
Mattermost 7.0 introduces direct integration of calling functionality via the open source WebRTC protocol, which is supported by all modern web browsers. The goal of directly integrating call functionality is to provide a single platform for collaboration, which is in line with Tiens overall vision for Mattermost. Mattermost is now adding workflow templates to help organisations build repeatable processes, in addition to providing integrated tools to enable collaboration.
The workflow concept employs playbooks, which contain a list of actions and operations to perform for a specific type of operation. For example, a company can create a workflow template for incident response in the event of a service failure or a cybersecurity incident.
The checklist can be linked to Mattermost operations such as bringing specific users into a call and assisting with report generation. Tien stated that Mattermost also integrates with common developer tools, and that the capability of the workflow templates will expand over time to enable more automation with third-party tools.
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/06/mattermost-extends-workflow-platform-with-7-0-release/
作者:[Laveesh Kocher][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/laveesh-kocher/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/marttermost-e1655377462300.jpeg

View File

@ -1,35 +0,0 @@
[#]: subject: "The Travis CI Vulnerability Exposes Sensitive Open Source Project Credentials"
[#]: via: "https://www.opensourceforu.com/2022/06/the-travis-ci-vulnerability-exposes-sensitive-open-source-project-credentials/"
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
The Travis CI Vulnerability Exposes Sensitive Open Source Project Credentials
======
![travis c][1]
A flaw in Travis CI continuous integration software exposed sensitive data from thousands of open source projects online. This is not the first time the software has encountered such security issues. Travis is a CI tool that allows software developers to automate the testing and integration of new code into open source projects. Aqua researchers discovered that it is possible to access up to 770 million logs from Travis CI free tier users, even those who have deleted their accounts, via one of the softwares APIs.
Attackers can extract user authentication tokens used to log in to cloud services such as GitHub, Docker Hub, and AWS from these logs, which are stored in clear text format. The researchers discovered more than 70,000 sensitive tokens and other confidential credentials in a sample of eight million logs. “All Travis CI free tier users are potentially exposed,” the Aqua team says. According to 2019 data, Travis CI was used in over 932,977 open source projects by over 600,000 unique users.
Such access to high-level user credentials poses a risk to the software developers who use the product as well as their customers. “If an attacker obtains these credentials, there is nothing stopping them from introducing malicious code into libraries or the build process,” explains Bharat Mistry, security Trend Micros technical director for the UK and Ireland. “This flaw could undoubtedly lead to digital supply chain attacks.”
Supply chain attacks can be extremely damaging. In 2020, the Solar Winds attack gave state-sponsored Russian hackers access to the systems of thousands of businesses and government organisations. The Kaseya supply chain attack in 2021 allowed criminals to encrypt the data of over 1,500 companies at the same time, holding them all hostage.
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/06/the-travis-ci-vulnerability-exposes-sensitive-open-source-project-credentials/
作者:[Laveesh Kocher][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/laveesh-kocher/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/travis-c.png

View File

@ -1,78 +0,0 @@
[#]: subject: "Ubuntu Core 22 is Here for IoT and Edge Devices"
[#]: via: "https://news.itsfoss.com/ubuntu-core-22-release/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Ubuntu Core 22 is Here for IoT and Edge Devices
======
Based on Ubuntu 22.04 LTS, Ubuntu Core 22 brings the best of security and performance for IoT and embedded devices.
![ubuntu][1]
Ubuntu Core 22 is a containerized Ubuntu 22.04 LTS variant optimized for embedded and IoT devices.
It should be a wonderful offering for developers looking to make use of Canonicals latest operating system for edge devices.
To address the Ubuntu Core 22 release, **Mark Shuttleworth**, CEO of Canonical, said:
> “Our goal at Canonical is to provide secure, reliable open-source everywhere from the development environment to the cloud, down to the edge and to devices,”.
### Ubuntu Core 22: Whats New?
![What is Ubuntu Core 22?][2]
With Ubuntu Core 22 release, you get improvements focused on security and reliability. Some of them include:
#### Real-time Compute
As the announcement mentions, Ubuntu 22.04 LTS provides a real-time kernel (which is available in beta), delivering high performance, ultra-low latency, and workload predictability fit for time-sensitive industrial, automotive, and robotics use cases.
Furthermore, if you have Ubuntu-certified hardware, you should be able to fully utilize advanced real-time features.
#### Snapcraft Framework
The entire Ubuntu image breaks down as packages (Snaps), making the kernel, OS, and the applications isolated in a sandbox.
This should let you easily install applications without needing to worry about dependencies from the dedicated IoT App Store. For enterprises, software management solutions through the App Store should enable a range of on-premise opportunities.
The framework also helps the system ensure the OTA updates work as expected, and do not break anything even if it fails for some reason.
#### Security
Out of the box, Ubuntu Core provides advanced security features that include secure boot, full-disk encryption, and more fit for mission-critical environments.
Note that you also get 10 years of security update commitment with this release.
#### Other Key Improvements
* Easy migration from Ubuntu Core 20 and ensuring backward compatibility.
* Performance improvements.
* A new factory reset boot mode, to factory reset from run/recovery modes.
For more information, you can refer to the [official a][3][n][4][nouncement][5].
In case you are curious about Ubuntu Core, you might want to head to its [homepage][6] to explore more about it.
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/ubuntu-core-22-release/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/ubuntu-22-core.jpg
[2]: https://youtu.be/6NDWqH1SrGs
[3]: https://ubuntu.com/blog/canonical-ubuntu-core-22-is-now-available-optimised-for-iot-and-embedded-devices
[4]: https://ubuntu.com/blog/canonical-ubuntu-core-22-is-now-available-optimised-for-iot-and-embedded-devices
[5]: https://ubuntu.com/blog/canonical-ubuntu-core-22-is-now-available-optimised-for-iot-and-embedded-devices
[6]: https://ubuntu.com/core

View File

@ -0,0 +1,87 @@
[#]: subject: "Ubuntu Runs on a Google Nest Hub, Wait, What?"
[#]: via: "https://news.itsfoss.com/ubuntu-google-nest/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Ubuntu Runs on a Google Nest Hub, Wait, What?
======
A hacker successfully managed to run Ubuntu on a Google Nest Hub (2nd Gen), say, what now?
![ubuntu google][1]
I just spotted a story about Ubuntu running on a Google Nest Hub (2nd Gen).
Well, that is certainly exciting!
So, let me share more about it here.
### Hacking Google Nest Hub to Install Ubuntu
Yes, a hacking attempt made this possible.
A cybersecurity professional, **Frédéric Basse**, broke the secure boot on Google Nest Hub (2nd gen) and managed to run Ubuntu.
Of course, Google Nest Hub does not officially support booting a custom OS. But, a security vulnerability allowed Fred to use an exploit and run Ubuntu.
While this is fun, it is also a severe problem for an always-connected smart home display by Google.
As explained in his [blog post][2], the hacker utilized a Raspberry Pi Pico microcontroller to exploit a USB bug in the bootloader to break the secure boot chain.
The security expert concluded:
> As a result, an attacker can execute arbitrary code at early boot stage (before kernel execution) by plugging a malicious USB device and pressing two buttons
He has also made the bootloader exploit available on [GitHub][3], if you want to experiment (suited for security researchers).
### Making Ubuntu Work on Google Nest
![][4]
The exploit allowed the attacker to boot an unsigned OS. However, he had to make some modifications with the preinstalled Ubuntu image tailored for Raspberry Pi (64-bit ARM).
Heres what he mentions about it:
> We build a custom U-Boot bootloader with secure boot disabled and boot flow altered to load environment from USB flash drive. We also build a custom Linux kernel for elaine with [additionnal d][5]r[ivers like USB mouse][6]. The initial ramdisk (initrd) from Ubuntu is repacked to integrate firmware binaries required for the touchscreen. The boot image is created based on the custom Linux kernel and modified initrd.
So, it is evident that you will not get a full-fledged Ubuntu experience, but thanks to the exploit, we now know that Ubuntu can run on a Google Nest as an experiment if youre willing to break your Google Nest for the test (dont do that, really!).
### Smart Home Security Concern + Linux
The cybersecurity expert mentions that the vulnerability has been fixed upstream (twice).
But, the lack of CVE may have influenced the fix not propagating downstream, as the researcher suggests.
Undoubtedly, seeing Linux running on an unsupported device is awesome. Makes me wonder if we should have someone make **commercial smart home devices powered by Linux?**
*Is there something like that already available?*
Nevertheless, it is equally concerning for smart home devices to be vulnerable to easy attacks.
What do you think? Share your thoughts in the comments down below.
**Via**: [Liliputing][7]
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/ubuntu-google-nest/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/hacker-installs-ubuntu-on-google-nest-hub.jpg
[2]: https://fredericb.info/2022/06/breaking-secure-boot-on-google-nest-hub-2nd-gen-to-run-ubuntu.html
[3]: https://github.com/frederic/chipicopwn
[4]: https://news.itsfoss.com/wp-content/uploads/2022/06/ubuntu-google-nest.jpg
[5]: https://github.com/frederic/elaine-linux/commit/11068237d9178e77d79e3a5d27fc4f8f9b923c51
[6]: https://github.com/frederic/elaine-linux/commit/11068237d9178e77d79e3a5d27fc4f8f9b923c51
[7]: https://liliputing.com/2022/06/hacker-installs-ubuntu-on-a-google-nest-hub-2nd-gen-smart-display.html

View File

@ -0,0 +1,63 @@
[#]: subject: "What scrum masters can learn from dancing"
[#]: via: "https://opensource.com/article/22/6/scrum-master-dancing"
[#]: author: "Kelsea Zhang https://opensource.com/users/kelsea-zhang"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
What scrum masters can learn from dancing
======
Like dancing, being a scrum master takes coordination, verbal and nonverbal communication, and cooperation.
![OpenStack Superuser][1]
Image by: Opensource.com
Many scrum masters have an obsession with quickly turning their teams into what they want them to be. Once their expectations are not met within some arbitrary time limit, or someone resists their ideas, then the fight begins.
But the fight takes energy, time, and resources, and most of the time it doesn't solve the problem. In fact, most of the time it worsens the problem. When this happens, it's time for some reflection about the role of the scrum master.
### Priorities of the scrum master and the team
Even when a team agrees that a problem is indeed a problem, the team may not agree on what's most urgent. As the scrum master, if you ask the team to make efforts to what the team perceives as a secondary conflict, the team will likely resist. They may cooperate nominally, but in the best case you're only getting a fraction of their potential.
### Don't be stubborn
Some scrum masters want to make their company look a very specific way, usually in accordance with common models or methods in the industry. Sometimes they openly confront managers who don't align with their vision of how things "should" be.
It might feel like you're "fighting the good fight" when you attempt to do this, but that doesn't mean you're making progress. You have important work to do, and while your entire company might eventually be transformed, you have to start somewhere. The more support you gather from your team, the better chance you have of spreading your agile principles throughout the organization.
### Dancing together
A wise scrum master takes harmonious steps with their team, without stepping on each other's feet or tripping anyone up. Certainly, they could never be thought to be fighting each other. I call this "dancing together" because like dancing, it takes coordination, verbal and nonverbal communication, and cooperation. And when done even moderately well, it renders something elegant and enjoyable.
### Awareness
As a scrum master, you need to reflect on yourself all the time. How are your ideas and actions being received? If there's a sense of resistance or competition, then something is probably wrong, either in how you've been communicating, or how you've been seeking feedback and participation.
As a scrum master, you need to be aware of your environment. There are ebbs and flows within an organization, times when great change is appropriate and times when fundamental groundwork must be laid. Look for that in your organization, starting with your team. Wait for the right person to be in the right place at the right time, wait for an opportunity, wait for a certain policy, and then integrate agile methodology to drive changes.
### Get buy-in from the top
In most organizations, the scrum master ultimately serves the business goals of upper management. Transparency and communication are important. It's your job to understand your organization's objectives. Ask for advice from your managers, and get a clear picture of the intentions and expectations of the rest of the company. A scrum master can help management achieve their goals with expertise and efficiency, but only if you understand the objective.
### Tango over Foxtrot
Most of the actual agile transformation in real enterprises is very slow. It is not a fast and furious battle. The scrum master has to step in rhythm with the pace of the enterprise. You must strike a balance between who leads and who flourishes. You don't want to move too slow, or too fast. You must not pursue perfection in everything. Allow for mistakes and misunderstandings. Don't blame each other, but stay focused on creating something vibrant together.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/6/scrum-master-dancing
作者:[Kelsea Zhang][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/kelsea-zhang
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/LIFE_dance.png

View File

@ -1,94 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (10 ways Ansible is for everyone)
[#]: via: (https://opensource.com/article/21/1/ansible)
[#]: author: (James Farrell https://opensource.com/users/jamesf)
10 ways Ansible is for everyone
======
Expand your knowledge and skills with the top 10 Ansible articles plus
five news summaries from 2020.
![gears and lightbulb to represent innovation][1]
Here we are again at the end of another year with a great set of articles about Ansible from Opensource.com. I thought it would be nice to review them in a series of progressively advancing topics. I hope to help stimulate the interest of people just getting started with Ansible. There were also a series of summary articles, which I've included for your casual follow-up.
### Ansible for beginners
The first five articles on this year's list are a really good place for Ansible neophytes to start. The first three articles were written by Opensource.com editor Seth Kenlon.
* If you don't know much about Ansible, [_7 things you can do with Ansible right now_][2] is a great place to start. This is a nice primer that gathers links for managing hardware, cloud, containers, and more.
* In [_What's the difference between orchestration and automation?_][3] you will learn some of the terms and baseline technologies that will help kick off your interest in Ansible.
* [_How to install software with Ansible_][4] covers a few rudimentary concepts and some good Ansible habits, followed by simple examples on managing software packages on local and remote hosts.
* In [_3 lessons I've learned writing Ansible playbooks_][5], set yourself right with good habits handed down by Jeff Geerling, a real Ansible veteran. Source control, documentation, testing, simplification, and optimization are the keys to automation success.
* [_My first day using Ansible_][6] outlines Correspondent David Both's thought process for solving a repetitive development task. The article starts with a baseline of what Ansible needs and illustrates some simple plays and tasks.
### Ansible projects to try
Once you have the basics and some good habits, it's time to turn to more specific topics with concrete examples.
* [_Manage your Raspberry Pi fleet with Ansible_][7] by Ken Fallon walks through an example of deploying and managing fleets of RPi units. It presents concepts of security and maintenance in constrained environments.
* In _[Integrate your calendar with Ansible to avoid schedule conflicts][8],_ Nicolas Leiva quickly introduces how to use pre-tasks and conditionals to enforce execution blackout windows in your automation schedule.
* Nicolas completes his calendar blackout concept in [_Create an Ansible module for integrating your Google Calendar_][9]. His article dives into writing a custom Ansible module in Go to achieve the desired calendar connection. Nicolas introduces different ways to structure and invoke Go programs and pass the required data to Ansible and receive the desired output.
### Elevate your Ansible skills
Kubernetes is a hot topic these days, and the following articles offer some great examples to learn new skills.
* In [_Automate your container orchestration with Ansible modules for Kubernetes_][10], Seth Kenlon introduces the Ansible Kubernetes module, walks through a basic Minikube installation for testing, and presents some basic examples of the "k8s" module for pod control.
* Jeff Geerling explains the concept of Helm Chart applications, Ansible collections, and executing a fun project to set up your own Minecraft server in a k8s cluster in [_Build a Kubernetes Minecraft server with Ansible's Helm modules_][11].
### Other Ansible news
This year, Mark Phillips delivered a series of "Ansible around the web" news articles covering a wide variety of Ansible topics. They are packed with links to interesting Ansible developments, ranging from basic tutorials, module writing, plugins, Kubernetes, video demonstrations, and Ansible community news. Check them all out—there are valuable nuggets to follow for all interests and skill levels!
* [_Containers, networks, security, and more Ansible news_][12]
* [_Tips for CI/CD pipelines and Windows users, and more Ansible news_][13]
* [_Collections signal major shift in Ansible ecosystem, and more Ansible news_][14]
* [_Ansible 101 videos with Jeff Geerling, and more Ansible news_][15]
* [_Beginner guides, Windows, networking, and more Ansible news_][16]
### Have a happy 2021!
I hope your personal journey with Ansible is already underway and regularly enriched by content from Opensource.com. Tell us in the comments what you might like to learn about Ansible in the coming year, and if you have information to share, please consider [writing an article][17] for Opensource.com.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/1/ansible
作者:[James Farrell][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jamesf
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M (gears and lightbulb to represent innovation)
[2]: https://opensource.com/article/20/9/ansible
[3]: https://opensource.com/article/20/11/orchestration-vs-automation
[4]: https://opensource.com/article/20/9/install-packages-ansible
[5]: https://opensource.com/article/20/1/ansible-playbooks-lessons
[6]: https://opensource.com/article/20/10/first-day-ansible
[7]: https://opensource.com/article/20/9/raspberry-pi-ansible
[8]: https://opensource.com/article/20/10/calendar-ansible
[9]: https://opensource.com/article/20/10/ansible-module-go
[10]: https://opensource.com/article/20/9/ansible-modules-kubernetes
[11]: https://opensource.com/article/20/10/kubernetes-minecraft-ansible
[12]: https://opensource.com/article/20/1/ansible-news-edition-six
[13]: https://opensource.com/article/20/2/ansible-news-edition-seven
[14]: https://opensource.com/article/20/3/ansible-news-edition-eight
[15]: https://opensource.com/article/20/4/ansible-news-edition-nine
[16]: https://opensource.com/article/20/5/ansible-news-edition-ten
[17]: https://opensource.com/how-submit-article

View File

@ -1,249 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (lkxed)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Docker Compose: a nice way to set up a dev environment)
[#]: via: (https://jvns.ca/blog/2021/01/04/docker-compose-is-nice/)
[#]: author: (Julia Evans https://jvns.ca/)
Docker Compose: a nice way to set up a dev environment
======
Hello! Here is another post about [computer tools that Ive appreciated][1]. This one is about Docker Compose!
This post is mostly just about how delighted I was that it does what its supposed to do and it seems to work and to be pretty straightforward to use. Im also only talking about using Docker Compose for a dev environment here, not using it in production.
Ive been thinking about this kind of personal dev environment setup more recently because I now do all my computing with a personal cloud budget of like $20/month instead of spending my time at work thinking about how to manage thousands of AWS servers.
Im very happy about this because previous to trying Docker Compose I spent two days getting frustrated with trying to set up a dev environment with other tools and Docker Compose was a lot easier and simpler. And then I told my sister about my docker-compose experiences and she was like “I KNOW, DOCKER COMPOSE IS GREAT RIGHT?!?!” So I thought Id write a blog post about it, and here we are.
### the problem: setting up a dev environment
Right now Im working on a Ruby on Rails service (the backend for a sort of computer debugging game). On my production server, I have:
* a nginx proxy
* a Rails server
* a Go server (which proxies some SSH connections with [gotty][2])
* a Postgres database
Setting up the Rails server locally was pretty straightforward without resorting to containers (I just had to install Postgres and Ruby, fine, no big deal), but then I wanted send `/proxy/*` to the Go server and everything else to the Rails server, so I needed nginx too. And installing nginx on my laptop felt too messy to me.
So enter `docker-compose`!
### docker-compose lets you run a bunch of Docker containers
Docker Compose basically lets you run a bunch of Docker containers that can communicate with each other.
You configure all your containers in one file called `docker-compose.yml`. Ive pasted my entire `docker-compose.yml` file here for my server because I found it to be really short and straightforward.
```
version: "3.3"
services:
db:
image: postgres
volumes:
- ./tmp/db:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: password # yes I set the password to 'password'
go_server:
# todo: use a smaller image at some point, we don't need all of ubuntu to run a static go binary
image: ubuntu
command: /app/go_proxy/server
volumes:
- .:/app
rails_server:
build: docker/rails
command: bash -c "rm -f tmp/pids/server.pid && source secrets.sh && bundle exec rails s -p 3000 -b '0.0.0.0'"
volumes:
- .:/app
web:
build: docker/nginx
ports:
- "8777:80" # this exposes port 8777 on my laptop
```
There are two kinds of containers here: for some of them Im just using an existing image (`image: postgres` and `image: ubuntu`) without modifying it at all. And for some I needed to build a custom container image `build: docker/rails` says to use `docker/rails/Dockerfile` to build a custom container.
I needed to give my Rails server access to some API keys and things, so `source secrets.sh` puts a bunch of secrets in environment variables. Maybe theres a better way to manage secrets but its just me so this seemed fine.
### how to start everything: `docker-compose build` then `docker-compose up`
Ive been starting my containers just by running `docker-compose build` to build the containers, then `docker-compose up` to run everything.
You can set `depends_on` in the yaml file to get a little more control over when things start in, but for my set of services the start order doesnt matter, so I havent.
### the networking is easy to use
Its important here that the containers be able to connect to each other. Docker Compose makes that super simple! If I have a Rails server running in my `rails_server` container on port 3000, then I can access that with `http://rails_server:3000`. So simple!
Heres a snippet from my nginx configuration file with how Im using that in practice (I removed a bunch of `proxy_set_header` lines to make it more clear)
```
location ~ /proxy.* {
proxy_pass http://go_server:8080;
}
location @app {
proxy_pass http://rails_server:3000;
}
```
Or heres a snippet from my Rails projects database configuration, where I use the name of the database container (`db`):
```
development:
<<: *default
database: myproject_development
host: db # <-------- this "magically" resolves to the database container's IP address
username: postgres
password: password
```
I got a bit curious about how `rails_server` was actually getting resolved to an IP address. It seems like Docker is running a DNS server somewhere on my computer to resolve these names. Here are some DNS queries where we can see that each container has its own IP address:
```
$ dig +short @127.0.0.11 rails_server
172.18.0.2
$ dig +short @127.0.0.11 db
172.18.0.3
$ dig +short @127.0.0.11 web
172.18.0.4
$ dig +short @127.0.0.11 go_server
172.18.0.5
```
### whos running this DNS server?
I dug into how this DNS server is set up a very tiny bit.
I ran all these commands outside the container, because I didnt have a lot of networking tools installed in the container.
**step 1**: find the PID of my Rails server with `ps aux | grep puma`
Its 1837916. Cool.
**step 2**: find a UDP server running in the same network namespace as PID `1837916`
I did this by using `nsenter` to run `netstat` in the same network namespace as the `puma` process. (technically I guess you could run `netstat -tupn` to just show UDP servers, but my fingers only know how to type `netstat -tulpn` at this point)
```
$ sudo nsenter -n -t 1837916 netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.11:32847 0.0.0.0:* LISTEN 1333/dockerd
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN 1837916/puma 4.3.7
udp 0 0 127.0.0.11:59426 0.0.0.0:* 1333/dockerd
```
So theres a UDP server running on port `59426`, run by `dockerd`! Maybe thats the DNS server?
**step 3**: check that its a DNS server
We can use `dig` to make a DNS query to it:
```
$ sudo nsenter -n -t 1837916 dig +short @127.0.0.11 59426 rails_server
172.18.0.2
```
But when we ran `dig` earlier, we werent making a DNS query to port 59426, we were querying port 53! Whats going on?
**step 4**: iptables
My first guess for “this server seems to be running on port X but Im accessing it on port Y, whats going on?” was “iptables”.
So I ran iptables-save in the containers network namespace, and there we go:
```
$ sudo nsenter -n -t 1837916 iptables-save
.... redacted a bunch of output ....
-A DOCKER_POSTROUTING -s 127.0.0.11/32 -p udp -m udp --sport 59426 -j SNAT --to-source :53
COMMIT
```
Theres an iptables rule that sends traffic on port 53 to 59426. Fun!
### it stores the database files in a temp directory
One nice thing about this is: instead of managing a Postgres installation on my laptop, I can just mount the Postgres containers data directory at `./tmp/db`.
I like this because I really do not want to administer a Postgres installation on my laptop (I dont really know how to configure Postgres), and conceptually I like having my dev database literally be in the same directory as the rest of my code.
### I can access the Rails console with `docker-compose exec rails_server rails console`
Managing Ruby versions is always a little tricky and even when I have it working, I always kind of worry Im going to screw up my Ruby installation and have to spend like ten years fixing it.
With this setup, if I need access to the Rails console (a REPL with all my Rails code loaded), I can just run:
```
$ docker-compose exec rails_server rails console
Running via Spring preloader in process 597
Loading development environment (Rails 6.0.3.4)
irb(main):001:0>
```
Nice!
### small problem: no history in my Rails console
I ran into a problem though: I didnt have any history in my Rails console anymore, because I was restarting the container all the time.
I figured out a pretty simple solution to this though: I added a `/root/.irbrc` to my container that changed the IRB history files location to be something that would persist between container restarts. Its just one line:
```
IRB.conf[:HISTORY_FILE] = "/app/tmp/irb_history"
```
### I still dont know how well it works in production
Right now my production setup for this project is still “I made a digitalocean droplet and edited a lot of files by hand”.
I think Ill try to use docker-compose to run this thing in production. My guess is that it should work fine because this service is probably going to have at most like 2 users at a time and I can easily afford to have 60 seconds of downtime during a deploy if I want, but usually something goes wrong that I havent thought of.
A few notes from folks on Twitter about docker-compose in production:
* `docker-compose up` will only restart the containers that need restarting, which makes restarts faster
* theres a small bash script [wait-for-it][3] that you can use to make a container wait for another service to be available
* You can have 2 docker-compose.yaml files: `docker-compose.yaml` for DEV, and `docker-compose-prod.yaml` for prod. I think Ill use this to expose different nginx ports: 8999 in dev and 80 in prod.
* folks seemed to agree that docker-compose is fine in production if you have a small website running on 1 computer
* one person suggested that Docker Swarm might be better for a slightly more complicated production setup, but I havent tried that (or of course Kubernetes, but the whole point of Docker Compose is that its super simple and Kubernetes is certainly not simple :) )
Docker also seems to have a feature to [automatically deploy your docker-compose setup to ECS][4], which sounds cool in theory but I havent tried it.
### when doesnt docker-compose work well?
Ive heard that docker-compose doesnt work well:
* when you have a very large number of microservices (a simple setup is best)
* when youre trying to include data from a very large database (like putting hundreds of gigabytes of data on everyones laptop)
* on Mac computers, Ive heard that Docker can be a lot slower than on Linux (presumably because of the extra VM). I dont have a Mac so I havent run into this.
### thats all!
I spent an entire day before this trying to configure a dev environment by using Puppet to provision a Vagrant virtual machine only to realize that VMs are kind of slow to start and that I dont really like writing Puppet configuration (I know, huge surprise :)).
So it was nice to try Docker Compose and find that it was straightforward to get to work!
--------------------------------------------------------------------------------
via: https://jvns.ca/blog/2021/01/04/docker-compose-is-nice/
作者:[Julia Evans][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://jvns.ca/
[b]: https://github.com/lujun9972
[1]: https://jvns.ca/#cool-computer-tools---features---ideas
[2]: https://github.com/yudai/gotty/
[3]: https://github.com/vishnubob/wait-for-it
[4]: https://docs.docker.com/cloud/ecs-integration/

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: (Starryi)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (Donkey)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,21 +1,21 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Start programming in Racket by writing a "guess the number" game)
[#]: via: (https://opensource.com/article/21/1/racket-guess-number)
[#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana)
[#]: subject: "Start programming in Racket by writing a "guess the number" game"
[#]: via: "https://opensource.com/article/21/1/racket-guess-number"
[#]: author: "Cristiano L. Fontana https://opensource.com/users/cristianofontana"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Start programming in Racket by writing a "guess the number" game
======
Racket is a great way to learn a language from the Scheme and Lisp
families.
Racket is a great way to learn a language from the Scheme and Lisp families.
![Person using a laptop][1]
I am a big advocate of learning multiple programming languages. That's mostly because I tend to get bored with the languages I use the most. It also teaches me new and interesting ways to approach programming.
Writing the same program in multiple languages is a good way to learn their differences and similarities. Previously, I wrote articles showing the same sample data plotting program written in [C &amp; C++][2], JavaScript with [Node.js][3], and [Python and Octave][4].
Writing the same program in multiple languages is a good way to learn their differences and similarities. Previously, I wrote articles showing the same sample data plotting program written in [C & C++][2], JavaScript with [Node.js][3], and [Python and Octave][4].
This article is part of another series about writing a "guess the number" game in different programming languages. In this game, the computer picks a number between one and 100 and asks you to guess it. The program loops until you make a correct guess.
@ -31,7 +31,6 @@ When I start learning a new language, I usually look for a tutorial that introdu
Starting with Racket makes sense because it is very mature and versatile, and the community is very active. Since Racket is a Lisp-like language, a major characteristic is that it uses the [prefix notation][9] and a [lot of parentheses][10]. Functions and operators are applied to a list of operands by prefixing them:
```
(function-name operand operand ...)
@ -58,15 +57,14 @@ The major Linux distributions offer packaged versions of Racket, so [installatio
Here is a version of the "guess the number" program written in Racket:
```
#lang racket
(define (inquire-user number)
  (display "Insert a number: ")
  (define guess (string-&gt;number (read-line)))
  (cond [(&gt; number guess) (displayln "Too low") (inquire-user number)]
        [(&lt; number guess) (displayln "Too high") (inquire-user number)]
  (define guess (string->number (read-line)))
  (cond [(> number guess) (displayln "Too low") (inquire-user number)]
        [(< number guess) (displayln "Too high") (inquire-user number)]
        [else (displayln "Correct!")]))
(displayln "Guess a number between 1 and 100")
@ -75,14 +73,12 @@ Here is a version of the "guess the number" program written in Racket:
Save this listing to a file called `guess.rkt` and run it:
```
`$ racket guess.rkt`
$ racket guess.rkt
```
Here is some example output:
```
Guess a number between 1 and 100
Insert a number: 90
@ -111,9 +107,9 @@ Now for the next line. `(define ...)` is used to declare new variables or functi
This function recursively calls itself to repeat the question until the user guesses the right number. Note that I am not using loops; I feel that Racket programmers do not like loops and only use recursive functions. This approach is idiomatic to Racket, but if you prefer, [loops are an option][18].
The first step of the `inquire-user` function asks the user to insert a number by writing that string to the console. Then it defines a variable called `guess` that contains whatever the user entered. The [`read-line` function][19] returns the user input as a string. The string is then converted to a number with the [`string->number` function][20]. After the variable definition, the [`cond` function][21] accepts a series of conditions. If a condition is satisfied, it executes the code inside that condition. These conditions, `(> number guess)` and `(< number guess)`, are followed by two functions: a `displayln` that gives clues to the user and a `inquire-user` call. The function calls itself again when the user does not guess the right number. The `else` clause executes when the two conditions are not met, i.e., the user enters the correct number. The program's guts are this `inquire-user` function.
The first step of the `inquire-user` function asks the user to insert a number by writing that string to the console. Then it defines a variable called `guess` that contains whatever the user entered. The [read-line function][19] returns the user input as a string. The string is then converted to a number with the [string->number function][20]. After the variable definition, the [cond function][21] accepts a series of conditions. If a condition is satisfied, it executes the code inside that condition. These conditions, `(> number guess)` and `(< number guess)`, are followed by two functions: a `displayln` that gives clues to the user and a `inquire-user` call. The function calls itself again when the user does not guess the right number. The `else` clause executes when the two conditions are not met, i.e., the user enters the correct number. The program's guts are this `inquire-user` function.
However, the function still needs to be called! First, the program asks the user to guess a number between 1 and 100, and then it calls the `inquire-user` function with a random number. The random number is generated with the [`random` function][22]. You need to inform the function that you want to generate a number between 1 and 100, but the `random` function generates integer numbers up to `max-1`, so I used 101.
However, the function still needs to be called! First, the program asks the user to guess a number between 1 and 100, and then it calls the `inquire-user` function with a random number. The random number is generated with the [random function][22]. You need to inform the function that you want to generate a number between 1 and 100, but the `random` function generates integer numbers up to `max-1`, so I used 101.
### Try Racket
@ -124,15 +120,15 @@ Learning new languages is fun! I am a big advocate of programming languages poly
via: https://opensource.com/article/21/1/racket-guess-number
作者:[Cristiano L. Fontana][a]
选题:[lujun9972][b]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/cristianofontana
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop)
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/laptop_screen_desk_work_chat_text.png
[2]: https://opensource.com/article/20/2/c-data-science
[3]: https://opensource.com/article/20/6/data-science-nodejs
[4]: https://opensource.com/article/20/2/python-gnu-octave-data-science

View File

@ -1,98 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (godgithubf)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (3 ways to play video games on Linux)
[#]: via: (https://opensource.com/article/21/2/linux-gaming)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
3 ways to play video games on Linux
======
If you're ready to put down the popcorn and experience games from all
angles, start gaming on Linux.
![Gaming with penguin pawns][1]
In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Today, I'll start with gaming.
I used to think a "gamer" was a very specific kind of creature, carefully cataloged and classified by scientists after years of study and testing. I never classified myself as a gamer because most of the games I played were either on a tabletop (board games and pen-and-paper roleplaying games), NetHack, or Tetris. Now that games are available on everything from mobile devices, consoles, computers, and televisions, it feels like it's a good time to acknowledge that "gamers" come in all different shapes and sizes. If you want to call yourself a gamer, you can! There's no qualification exam. You don't have to know the Konami Code by heart (or even what that reference means); you don't have to buy and play "triple-A" games. If you enjoy a game from time to time, you can rightfully call yourself a gamer. And if you want to be a gamer, there's never been a better time to use Linux.
### Welcome to the underground
Peel back the glossy billboard ads, and underneath, you're sure to find a thriving gaming underground. It's a movement that began with the nascent gaming market before anyone believed money could be made off software that wasn't either a spreadsheet or typing tutor. Indie games have carved out a place in pop culture (believe it or not, [Minecraft, while not open source][2], started out as an indie game) in several ways, proving that in the eyes of players, gameplay comes before production value.
There's a lot of cross-over in the indie and open source developer space. There's nothing quite like kicking back with your Linux laptop and browsing [itch.io][3] or your distribution's software repository for a little-known but precious gem of an open source game.
There are all kinds of open source games available, including plenty of [first person shooters][4], puzzle games like [Nodulus][5], systems management games like [OpenTTD][6], racing games like [Jethook][7], tense escape campaigns like [Sauerbraten][8], and too many more to mention (with more arriving each year, thanks to great initiatives like [Open Jam][9]).
![Jethook game screenshot][10]
Jethook
Overall, the experience of delving into the world of open source games is different than the immediate satisfaction of buying whatever a major game studio releases next. Games by the big studios provide plenty of visual and sonic stimuli, big-name actors, and upwards of 60 hours of gameplay. Independent and open source games aren't likely to match that, but then again, major studios can't match the sense of discovery and personal connection you get when you find a game that you just know nobody else _has ever heard of_. And they can't hope to match the sense of urgency you get when you realize that everybody in the world really, really needs to hear about the great game you've just played.
Take some time to identify the kinds of games you enjoy the most, and then have a browse through your distribution's software repository, [Flathub][11], and open game jams. See what you can uncover and, if you like the game enough, help to promote it!
### Proton and WINE
Gaming on Linux doesn't stop with open source, but it is enabled by it. When Valve Software famously brought Linux back into the gaming market a few years ago by releasing their Steam client for Linux, the hope was that it would compel game studios to write code native to Linux systems. Some did, but Valve failed to push Linux as the primary platform even on their own Valve-branded gaming computers, and it seems that most studios have reverted to their old ways of Windows-only games.
Interestingly, though, the end result has produced more open source code than probably intended. Valve's solution for Linux compatibility has been to create the [Proton][12] project, a compatibility layer to translate Windows games to Linux. At its core, Proton uses [WINE (Wine Is Not an Emulator)][13], the too-good-to-be-true reimplementation of major Windows libraries as open source.
The game market's spoils have turned out to be a treasure trove for the open source world, and today, most games from major studios can be run on Linux as if they were native.
Of course, if you're the type of gamer who has to have the latest title on the day of release, you can certainly expect unpleasant surprises. That's not surprising, though, because few major games are released without bugs requiring large patches a week later. Those bugs can be even worse when a game runs on Proton and WINE, so Linux gamers often benefit by refraining from early adoption. The trade-off may be worth it, though. I've played a few games that run perfectly on Proton, only to discover later from angry forum posts that it's apparently riddled with fatal errors when played on the latest version of Windows. In short, it seems that games from major studios aren't perfect, and so you can expect similar-but-different problems when playing them on Linux as you would on Windows.
### Flatpak
One of the most exciting developments of recent Linux history is [Flatpak][14], a cross between local containers and packaging. It's got nothing to do with gaming (or doesn't it?), but it enables Linux applications to essentially be distributed universally to any Linux distribution. This applies to gaming because there are often lots of fringe technologies used in games, and it can be pretty demanding on distribution maintainers to keep up with all the latest versions required by any given game.
Flatpak abstracts that away from the distribution by establishing a common Flatpak-specific layer for application libraries. Distributors of flatpaks know that if a library isn't in a Flatpak SDK, then it must be included in the flatpak. It's simple and straightforward.
Thanks to Flatpak, the Steam client runs on something obvious like Fedora and on distributions not traditionally geared toward the gaming market, like [RHEL][15] and Slackware!
### Lutris
If you're not eager to sign up on Steam, though, there's my preferred gaming client, [Lutris][16]. On the surface, Lutris is a simple game launcher for your system, a place you can go when you know you want to play a game but just can't decide what to launch yet. With Lutris, you can add [all the games you have on your system][17] to create your own gaming library, and then launch and play them right from the Lutris interface. Better still, Lutris contributors (like me!) regularly publish installer scripts to make it easy for you to install games you own. It's not always necessary, but it can be a nice shortcut to bypass some tedious configuration.
Lutris can also enlist the help of _runners_, or subsystems that run games that wouldn't normally launch straight from your application menu. For instance, if you want to play console games like the open source [Warcraft Tower Defense][18], you must run an emulator, and Lutris can handle that for you (provided you have the emulator installed). Additionally, should you have a GOG.com (Good Old Games) account, Lutris can access it and import games from your library.
There's no easier way to manage your games.
### Play games
Linux gaming is a fulfilling and empowering experience. I used to avoid computer gaming because I didn't feel I had much of a choice. It seemed that there were always expensive games being released, which inevitably got extreme reactions from happy and unhappy gamers alike, and then the focus shifted quickly to the next big thing. On the other hand, open source gaming has introduced me to the _people_ of the gaming world. I've met other players and developers, I've met artists and musicians, fans and promoters, and I've played an assortment of games that I never even realized existed. Some of them were barely long enough to distract me for just one afternoon, while others have provided me hours and hours of obsessive gameplay, modding, level design, and fun.
If you're ready to put down the popcorn and experience games from all angles, start gaming on Linux.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/2/linux-gaming
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gaming_grid_penguin.png?itok=7Fv83mHR (Gaming with penguin pawns)
[2]: https://opensource.com/alternatives/minecraft
[3]: https://itch.io/jam/open-jam-2020
[4]: https://opensource.com/article/20/5/open-source-fps-games
[5]: https://hyperparticle.itch.io/nodulus
[6]: https://www.openttd.org/
[7]: https://rcorre.itch.io/jethook
[8]: http://sauerbraten.org/
[9]: https://opensource.com/article/18/9/open-jam-announcement
[10]: https://opensource.com/sites/default/files/game_0.png
[11]: http://flathub.org
[12]: https://github.com/ValveSoftware/Proton
[13]: http://winehq.org
[14]: https://opensource.com/business/16/8/flatpak
[15]: https://www.redhat.com/en/enterprise-linux-8
[16]: http://lutris.net
[17]: https://opensource.com/article/18/10/lutris-open-gaming-platform
[18]: https://ndswtd.wordpress.com/download

View File

@ -1,75 +0,0 @@
[#]: subject: (Get started with Kubernetes using chaos engineering)
[#]: via: (https://opensource.com/article/21/5/kubernetes-chaos)
[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Get started with Kubernetes using chaos engineering
======
Learn the basics of chaos engineering in this first article in a series
celebrating Kubernetes' 11th birthday.
![Scrabble letters spell out chaos for chaos engineering][1]
Kubernetes is turning 11, so I'll be celebrating its birthday by giving you some open source tools that will help you cause chaos. Chaos engineering is part science, part planning, and part experiments. It's the discipline of experimenting on a system to build confidence in the system's capability to withstand turbulent conditions in production.
Before I start passing out the gifts, in this introductory article, I will explain the basics of how chaos engineering works.
### How do I get started with chaos engineering?
In my experience, the best way to start chaos engineering is by taking an incident that has happened before in production and using it as an experiment. Use your past data, make a plan to break your system in a similar way, create a repair strategy, and confirm the outcome turns out exactly how you want. If your plan fails, you have a new way to experiment and move forward toward a new way to handle issues quickly.
Best of all, you can document everything as you go, which means, over time, your entire system will be fully documented so that anyone can be on call without too many escalations and everyone can have a nice break on weekends.
### What do you do in chaos engineering?
Chaos engineering has some science behind how these experiments work. I've documented some of the steps:
1. **Define a steady state**: Use a monitoring tool to gather data about what your system looks like functionally when there are no problems or incidents.
2. **Come up with a hypothesis or use a previous incident:** Now that you have defined a steady state, come up with a hypothesis about what would happen (or has happened) during an incident or outage. Use this hypothesis to generate a series of theories about what could happen and how to resolve the problems. Then you can start a plan to purposely cause the issue.
3. **Introduce the problem:** Use that plan to break your system and begin real-world testing. Gather your broken metrics' states, use your planned fix, and keep track of how long it takes before you reach a resolution. Make sure you document everything for future outages.
4. **Try to disprove your own hypothesis:** The best part of experimenting is trying to disprove what you think or plan. You want to create a different state, see how far you can take it, and generate a different steady state in the system.
Make sure to create a control system in a steady state before you generate the broken variables in another system. This will make it easier to spot the differences in various steady states before, during, and after your experiment.
### What do I need for chaos engineering?
The best tools for beginning chaos engineering are:
* Good documentation practices
* A monitoring system to capture your system in a steady state and a non-steady state
* Grafana
* Prometheus
* Chaos engineering tools
* Chaos mesh
* Litmus
* And more that I will cover in future articles
* A hypothesis
* A plan
### Go forth and destroy
Now that you have the basics in hand, it's time to go forth and destroy your system safely. I would plan to start causing chaos four times a year and work toward monthly destructions.
Chaos engineering is good practice and a great way to keep your internal documentation up to date. Also, new upgrades or application deployments will be smoother over time, and your daily life will be easier with Kubernetes administration.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/5/kubernetes-chaos
作者:[Jessica Cherry][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/cherrybomb
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brett-jordan-chaos-unsplash.jpg?itok=sApp5dVd (Scrabble letters spell out chaos for chaos engineering)

View File

@ -0,0 +1,299 @@
[#]: subject: "Apache Kafka: Asynchronous Messaging for Seamless Systems"
[#]: via: "https://www.opensourceforu.com/2021/11/apache-kafka-asynchronous-messaging-for-seamless-systems/"
[#]: author: "Krishna Mohan Koyya https://www.opensourceforu.com/author/krishna-mohan-koyya/"
[#]: collector: "lkxed"
[#]: translator: "lkxed"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Apache Kafka: Asynchronous Messaging for Seamless Systems
======
Apache Kafka is one of the most popular open source message brokers. Found in almost all microservices environments, it has become an important component of Big Data manipulation. This article gives a brief description of Apache Kafka, followed by a case study that demonstrates how it is used.
![Digital-backgrund-connecting-in-globe][1]
Have you ever wondered how e-commerce platforms are able to handle immense traffic without getting stuck? Ever thought about how OTT platforms are able to deliver content to millions of users, smoothly and simultaneously? The key lies in their distributed architecture.
A system designed around distributed architecture is made up of multiple functional components. These components are usually spread across several machines, which collaborate with each other by exchanging messages asynchronously over a network. Asynchronous messaging is what enables scalable, non-blocking communication among components, thereby allowing smooth functioning of the overall system.
### Asynchronous messaging
The common features of asynchronous messaging are:
* The producers and consumers of the messages are not aware of each other. They join and leave the system without the knowledge of the others.
* A message broker acts as the intermediary between the producers and consumers.
* The producers associate each of the messages with a type, known as topic. A topic is just a simple string.
* It is possible that producers send messages on multiple topics, and multiple producers send messages on the same topic.
* The consumers register with the broker for messages on one or more topics.
* The producers send the messages only to the broker, and not to the consumers.
* The broker, in turn, delivers the messages to all the consumers that are registered against the topic.
* The producers do not expect any response from the consumers. In other words, the producers and consumers do not block each other.
There are several message brokers available in the market, and Apache Kafka is one of the most popular among them.
### Apache Kafka
Apache Kafka is an open source distributed messaging system with streaming capabilities, developed by the Apache Software Foundation. Architecturally, it is a cluster of several brokers that are coordinated by the Apache Zookeeper service. These brokers share the load on the cluster while receiving, persisting, and delivering the messages.
#### Partitions
Kafka writes messages into buckets known as partitions. A given partition holds messages only on one topic. For example, Kafka writes messages on the topic heartbeats into the partition named *heartbeats-0*, irrespective of the producer of the messages.
![Figure 1: Asynchronous messaging][2]
However, in order to leverage the cluster-wide parallel processing capabilities of Kafka, administrators often create more than one partition for a given topic. For instance, if the administrator creates three partitions for the topic heartbeats, Kafka names them as *heartbeats-0, heartbeats-1,* and *heartbeats-2.* Kafka writes the heartbeat messages across all the three partitions in such a way that the load is evenly distributed.
There is yet another possible scenario in which the producers associate each of the messages with a key. For example, a component uses C1 as the key while another component uses C2 as the key for the messages that they produce on the topic heartbeats. In this scenario, Kafka makes sure that the messages on a topic with a specific key are always found only in one partition. However, it is quite possible that a given partition may hold messages with different keys. Figure 2 presents a possible message distribution among the partitions.
![Figure 2: Message distribution among the partitions][3]
#### Leaders and ISRs
Kafka maintains several partitions across the cluster. The broker on which a partition is maintained is called the leader for the specific partition. Only the leader receives and serves the messages from its partitions.
But what happens to a partition if its leader crashes? To ensure business continuity, every leader replicates its partitions on other brokers. The latter act as the in-sync-replicas (ISRs) for the partition. In case the leader of a partition crashes, Zookeeper conducts an election and names an ISR as the new leader. Thereafter, the new leader takes the responsibility of writing and serving the messages for that partition. Administrators can choose how many ISRs are to be maintained for a topic.
![Figure 3: Command-line producer][4]
#### Message persistence
The brokers map each of the partitions to a specific file on the disk, for persistence. By default, they keep the messages for a week on the disk! The messages and their order cannot be altered once they are written to a partition. Administrators can configure policies like message retention, compaction, etc.
![Figure 4: Command-line consumer][5]
#### Consuming the messages
Unlike most other messaging systems, Apache Kafka does not actively deliver the messages to its consumers. Instead, it is the responsibility of the consumers to listen to the topics and read the messages. A consumer can read messages from more than one partition of a topic. And it is also possible that multiple consumers read messages from a given partition. Kafka guarantees that no message is read more than once by a given consumer.
Kafka also expects that every consumer is identified with a group ID. Consumers with the same group ID form a group. Typically, in order to read messages from N number of topic partitions, an administrator creates a group with N number of consumers. This way, each consumer of the group reads messages from its designated partition. If the group consists of more consumers than the available partitions, the excess consumers remain idle.
In any case, Apache Kafka guarantees that a message is read only once at the group level, irrespective of the number of consumers in the group. This architecture gives consistency, high-performance, high scalability, near-real-time delivery, and message persistence along with zero-message loss.
### Installing and running Kafka
Although, in theory, the Apache Kafka cluster can consist of any number of brokers, most of the clusters in production environments usually consist of three or five of these.
Here, we will set up a single-broker cluster that is good enough for the development environment.
Download the latest version of Kafka from *https://kafka.apache.org/downloads* using a browser. It can also be downloaded with the following command, on a Linux terminal:
```
wget https://www.apache.org/dyn/closer.cgi?path=/kafka/2.8.0/kafka_2.12-2.8.0.tgz
```
We can move the downloaded archive *file kafka_2.12-2.8.0.tgz* to some other folder, if needed. Extracting the archive creates a folder by the name *kafka_2.12-2.8.0*, which will be referred to as *KAFKA_HOME* hereafter.
Open the file server.properties under the *KAFKA_HOME/config* folder and uncomment the line with the following entry:
```
listeners=PLAINTEXT://:9092
```
This configuration enables Apache Kafka to receive plain text messages on port 9092, on the local machine. Kafka can also be configured to receive messages over a secure channel as well, which is recommended in the production environments.
Irrespective of the number of brokers, Apache Zookeeper is required for broker management and coordination. This is true even in the case of single-broker clusters. Since Zookeeper is already bundled with Kafka, we can start it with the following command from *KAFKA_HOME*, on a terminal:
```
./bin/zookeeper-server-start.sh ./config/zookeeper.properties
```
Once Zookeeper starts running, Kafka can be started in another terminal, with the following command:
```
./bin/kafka-server-start.sh ./config/server.properties
```
With this, a single-broker Kafka cluster is up and running.
### Verifying Kafka
Let us publish and receive messages on the topic topic-1. A topic can be created with a chosen number of partitions with the following command:
```
./bin/kafka-topics.sh --create --topic topic-1 --zookeeper localhost:2181 --partitions 3 --replication-factor 1
```
The above command also specifies the replication factor, which should be less than or equal to the number of brokers in the cluster. Since we are working on a single-broker cluster, the replication factor is set to one.
Once the topic is created, producers and consumers can exchange messages on that topic. The Kafka distribution includes a producer and a consumer for test purposes. Both of these are command-line tools.
To invoke the producer, open the third terminal and run the following command:
```
./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic topic-1
```
This command displays a prompt at which we can key in simple text messages. Because of the given options on the command, the producer sends the messages on *topic-1* to the Kafka that is running on port 9092 on the local machine.
Open the fourth terminal and run the following command to start the consumer tool:
```
./bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic topic-1 from-beginning
```
This command starts the consumer that connects to the Kafka on port number 9092 on the local machine. It registers for reading the messages on topic-1. Because of the last option on the command line, the consumer receives all the messages on the chosen topic from the beginning.
Since the producer and consumer are connecting to the same broker and referring the same topic, the consumer receives and displays the messages on its terminal.
Now, lets use Kafka in the context of a practical application.
### Case study
ABC is a hypothetical bus transport company, which has a fleet of passenger buses that ply between different cities across the country. Since ABC wants to track each bus in real-time for improving the quality of its operations, it comes up with a solution around Apache Kafka.
ABC first equips all its buses with devices to track their location. An operations centre is set up with Apache Kafka, to receive the location updates from each of the hundreds of buses. A dashboard is developed to display the current status of all the buses at any point in time. Figure 5 represents this architecture.
![Figure 5: Kafka based architecture][6]
In this architecture, the devices on the buses act as the message producers. They send their current location to Kafka on the topic *abc-bus-location*, periodically. For processing the messages from different buses, ABC chooses to use the trip code as the key. For example, if the bus from Bengaluru to Hubballi runs with the trip code*BLRHBL003*, then *BLRHBL003* becomes the key for all the messages from that specific bus during that specific trip.
The dashboard application acts as the message consumer. It registers with the broker against the same topic *abc-bus-location*. Consequently, the topic becomes the virtual channel between the producers (buses) and the consumer (dashboard).
The devices on the buses never expect any response from the dashboard application. In fact, none of them is even aware of the presence of the others. This architecture enables non-blocking communication between hundreds of buses and the central office.
#### Implementation
Lets assume that ABC wants to create three partitions for maintaining the location updates. Since the development environment has only one broker, the replication factor should be set to one.
The following command creates the topic accordingly:
```
./bin/kafka-topics.sh --create --topic abc-bus-location --zookeeper localhost:2181 --partitions 3 --replication-factor 1
```
The producer and consumer applications can be written in multiple languages like Java, Scala, Python, JavaScript, and a host of others. The code in the following sections provides a peek into the way they are written in Java.
##### Java producer
The Fleet class simulates the Kafka producer applications running on six buses of ABC. It sends location updates on *abc-bus-location* to the specified broker. Please note that the topic name, message keys, message body, and broker address are hard-coded only for simplicity.
```
public class Fleet {
public static void main(String[] args) throws Exception {
String broker = “localhost:9092”;
Properties props = new Properties();
props.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, broker);
props.setProperty(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG,
StringSerializer.class.getName());
props.setProperty(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG,
StringSerializer.class.getName());
Producer<String, String> producer = new KafkaProducer<String, String>(props);
String topic = “abc-bus-location”;
Map<String, String> locations = new HashMap<>();
locations.put(“BLRHBL001”, “13.071362, 77.461906”);
locations.put(“BLRHBL002”, “14.399654, 76.045834”);
locations.put(“BLRHBL003”, “15.183959, 75.137622”);
locations.put(“BLRHBL004”, “13.659576, 76.944675”);
locations.put(“BLRHBL005”, “12.981337, 77.596181”);
locations.put(“BLRHBL006”, “13.024843, 77.546983”);
IntStream.range(0, 10).forEach(i -> {
for (String trip : locations.keySet()) {
ProducerRecord<String, String> record
= new ProducerRecord<String, String>(
topic, trip, locations.get(trip));
producer.send(record);
}
});
producer.flush();
producer.close();
}
}
```
##### Java consumer
The Dashboard class implements the Kafka consumer application and it runs at the ABC Operations Centre. It listens to *abc-bus-location* with the group ID *abc-dashboard* and displays the location details from different buses as soon as messages are available. Here, too, many details are hard coded which are otherwise supposed to be configured:
```
public static void main(String[] args) {
String broker = “127.0.0.1:9092”;
String groupId = “abc-dashboard”;
Properties props = new Properties();
props.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, broker);
props.setProperty(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG,
StringDeserializer.class.getName());
props.setProperty(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG,
StringDeserializer.class.getName());
props.setProperty(ConsumerConfig.GROUP_ID_CONFIG, groupId);
@SuppressWarnings(“resource”)
Consumer<String, String> consumer = new KafkaConsumer<String, String>(props);
consumer.subscribe(Arrays.asList(“abc-bus-location”));
while (true) {
ConsumerRecords<String, String> records
= consumer.poll(Duration.ofMillis(1000));
for (ConsumerRecord<String, String> record : records) {
String topic = record.topic();
int partition = record.partition();
String key = record.key();
String value = record.value();
System.out.println(String.format(
“Topic=%s, Partition=%d, Key=%s, Value=%s”,
topic, partition, key, value));
}
}
}
```
##### Dependencies
A JDK of 8+ version is required to compile and run this code. The following Maven dependencies in the *pom.xml* download and add the required Kafka client libraries to the classpath:
```
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.25</version>
</dependency>
```
#### Deployment
As the topic *abc-bus-location* is created with three partitions, it makes sense to run three consumers to read the location updates quickly. For that, run the Dashboard in three different terminals simultaneously. Since all the three instances of Dashboard register with the same group ID, they form a group. Kafka attaches each Dashboard instance with a specific partition.
Once the Dashboard instances are up and running, start the *Fleet* on a different terminal. Figure 6, Figure 7, and Figure 8 are sample console messages on the Dashboard terminals.
![Figure 6: Dashboard Terminal 1][7]
A closer look at the console messages reveals that the consumers on the first, second and third terminals are reading messages from *partition-2, partition-1,* and *partition-0,* in that order. Also, it can be observed that the messages with the keys BLRHBL002, *BLRHBL004* and *BLRHBL006* are written into *partition-2*, the messages with the key *BLRHBL005* are written into *partition-1*, and the remaining are written into *partition-0*.
![Figure 7: Dashboard Terminal 2][8]
The good thing about Kafka is that it can be scaled horizontally to support a large number of buses and millions of messages as long as the cluster is designed appropriately.
![Figure 8: Dashboard Terminal 3][9]
### Beyond messaging
More than 80 per cent of the Fortune 100 companies are using Kafka, according to its website. It is deployed across many industry verticals like financial services, entertainment, etc. Though Apache Kafka started its journey as a simple messaging service, it has propelled itself into the Big Data ecosystem with industry-level stream processing capabilities. For the enterprises that prefer a managed solution, Confluent offers a cloud based Apache Kafka service for a subscription fee.
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2021/11/apache-kafka-asynchronous-messaging-for-seamless-systems/
作者:[Krishna Mohan Koyya][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/krishna-mohan-koyya/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Digital-backgrund-connecting-in-globe.jpg
[2]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Figure-1-Asynchronous-messaging.jpg
[3]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Figure-2-Message-distribution-among-the-partitions.jpg
[4]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Figure-3-Command-line-producer.jpg
[5]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Figure-4-Command-line-consumer.jpg
[6]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Figure-5-Kafka-based-architecture.jpg
[7]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Figure-6-Dashboard-Terminal-1.jpg
[8]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Figure-7-Dashboard-Terminal-2.jpg
[9]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Figure-8-Dashboard-Terminal-3.jpg

View File

@ -1,191 +0,0 @@
[#]: subject: "Install Specific Package Version With Apt Command in Ubuntu"
[#]: via: "https://itsfoss.com/apt-install-specific-version-2/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lkxed"
[#]: translator: "robsean"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Install Specific Package Version With Apt Command in Ubuntu
======
Want to install a specific version of a package in Ubuntu? You can do that easily in the following manner:
```
sudo apt install package_name=package_version
```
How do you know which versions are available for a certain package? Use this command:
```
apt list --all-versions package_name
```
In the screenshot below, you can see that I have two versions of VLC available and I use the command to install the older version:
![install specific versions apt ubuntu][1]
Sounds like a simple task, right? But things are not as simple as they look. There are several ifs and buts involved here.
This tutorial will cover all the important aspects of installing a specific program version using apt or apt-get commands.
### Things to know about installing a specific version of a program
You need to know a few things about how APT and repositories work in Ubuntu and Debian-based distributions.
#### No older versions from the same source
Ubuntu doesnt keep older versions of packages in the repository. You may see more than one version in specific cases, temporarily. For example, you run the apt update (but not upgrade), and a new version is available. You may see two versions for the same package in the apt cache. But as soon as the package is upgraded to the new version, the older version is removed from the cache as well as the repositories.
#### Use multiple sources for different versions
To get multiple versions of the same package, youll have to add multiple sources. For example, VLC is in version 3.x. Adding the [VLC daily build PPA][2] will give the (unstable) version 4.x.
Similarly, **you can download a DEB file with a different version and install it**.
#### The higher version always gets the priority
If you have the same package available from more than one source, by default, Ubuntu will install the highest available version.
In the previous example, if I install VLC, it will install version 4.x, not 3.x.
#### The older version gets upgraded to the available newer version
Thats another potential problem. Even if you install the older version of a package, it gets upgraded to the newer version (if available). You have to [hold the package and stop it from upgrading][3].
#### Dependencies also need to be installed
If the package has dependencies, youll have to install the required version of the dependent packages as well.
Now that you know a few potential issues lets see how to tackle them.
### Installing specific version of a package
I am taking the example of VLC in this tutorial. VLC version 3.0.16 is available in Ubuntus repositories. I added the daily build PPA and that gives me the release candidate of VLC version 4.0.
As you can see, I have two VLC versions available in the system right now:
![install specific versions apt ubuntu][4]
```
[email protected]:~$ apt list -a vlc
Listing... Done
vlc/jammy 4.0.0~rc1~~git20220516+r92284+296~ubuntu22.04.1 amd64
vlc/jammy 3.0.16-1build7 amd64
vlc/jammy 3.0.16-1build7 i386
```
Since the higher version takes priority, using apt install vlc will result in the installation of VLC 4.0. But I want to install the older version 3.0.16 for the sake of this tutorial.
```
sudo apt install vlc=3.0.16-1build7
```
But heres the thing. The vlc package has several dependencies and those dependencies also need specific versions. However, Ubuntu tries to install the available higher versions for them, and thus, you get the classic [you have held broken packages][5] error.
![problem installing specific version apt ubuntu][6]
To fix this, you have to provide specific versions of all the dependent packages it complains about. So that command becomes something like this:
```
sudo apt install vlc=3.0.16-1build7 \
vlc-bin=3.0.16-1build7 \
vlc-plugin-base=3.0.16-1build7 \
vlc-plugin-qt=3.0.16-1build7 \
vlc-plugin-video-output=3.0.16-1build7 \
vlc-l10n=3.0.16-1build7 \
vlc-plugin-access-extra=3.0.16-1build7 \
vlc-plugin-notify=3.0.16-1build7 \
vlc-plugin-samba=3.0.16-1build7 \
vlc-plugin-skins2=3.0.16-1build7 \
vlc-plugin-video-splitter=3.0.16-1build7 \
vlc-plugin-visualization=3.0.16-1build7
```
In case you are wondering, the trailing \ at the end of each line is just a way to write a single command over multiple lines.
**Does it work? In many cases, it will.** But I have chosen a complicated example of VLC, which has lots of dependencies. Even the mentioned dependencies have dependencies on other packages. It gets messy.
An alternative is to specify the source while installing.
#### Alternatively, specify the repository source
You have added multiple sources, so you should have some idea about the sources the package comes from.
Use the command below and search for the repository:
```
apt-cache policy | less
```
Focus on the lines that come after the repository name:
```
500 http://security.ubuntu.com/ubuntu jammy-security/multiverse i386 Packages
release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=multiverse,b=i386
origin security.ubuntu.com
```
You can specify the o,l,a, etc parameters.
In my original example, I want to install VLC from Ubuntus repository (to get 3.16) instead of the PPA (which gives me 4).
So the command below will install VLC 3.16 along with all the dependencies:
```
sudo apt install -t "o=ubuntu" vlc
```
![install from repository source][7]
Looks good? But the problem comes when you have to update the system. Then it complains about not finding the specified version.
**What else can be done?**
To install an older version, remove the source of the newer version from your system (if possible). It helps get rid of the dependencies hell issues.
If thats not possible, check if you can get it in some other packaging formats like Snap, Flatpak, AppImage, etc. In fact, Snap and Flatpak also allow you to choose and install from available versions. Since the applications are sandboxed, its easier to manage the dependencies for different versions.
#### Hold the package and prevent upgrade
If you manage to install a specific program version, you may want to avoid accidentally upgrading to the newer version. Its not too complicated to achieve this.
```
sudo apt-mark hold package_name
```
You can remove the hold so that it can be upgraded later:
```
sudo apt-mark unhold package_name
```
Note that dependencies of a package are not automatically held. They need to be individually mentioned.
### Conclusion
As you can see, there is a provision to install the selected version of a program. Things only get complicated if the package has dependencies. Then you get into the dependency hell.
I hope you learned a few new things in this tutorial. If you have questions or suggestions to improve it, please let me know in the comment section.
--------------------------------------------------------------------------------
via: https://itsfoss.com/apt-install-specific-version-2/
作者:[Abhishek Prakash][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/wp-content/uploads/2022/05/install-specific-versions-apt-ubuntu.png
[2]: https://launchpad.net/~videolan/+archive/ubuntu/master-daily
[3]: https://itsfoss.com/prevent-package-update-ubuntu/
[4]: https://itsfoss.com/wp-content/uploads/2022/05/install-specific-versions-apt-ubuntu.png
[5]: https://itsfoss.com/held-broken-packages-error/
[6]: https://itsfoss.com/wp-content/uploads/2022/05/problem-installing-specific-version-apt-ubuntu-800x365.png
[7]: https://itsfoss.com/wp-content/uploads/2022/05/install-from-repository-source-800x578.png

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/22/6/static-linking-linux"
[#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: translator: "robsean"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

View File

@ -1,96 +0,0 @@
[#]: subject: "How I gave my old laptop new life with the Linux Xfce desktop"
[#]: via: "https://opensource.com/article/22/6/linux-xfce-old-laptop"
[#]: author: "Jim Hall https://opensource.com/users/jim-hall"
[#]: collector: "lkxed"
[#]: translator: "lightchaserhy"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How I gave my old laptop new life with the Linux Xfce desktop
======
While I installed Linux to use my laptop for a few demos at a conference, I found Linux and the Xfce desktop made this old laptop feel quite snappy.
![Person drinking a hat drink at the computer][1]
Image by: [Jonas Leupe][2] on [Unsplash][3]
A few weeks ago, I needed to give a conference presentation that included a brief demonstration of a small app I'd written for Linux. I needed a Linux laptop to bring to the conference, so I dug out an old laptop and installed Linux on it. I used the [Fedora 36 Xfce spin][4], which worked great.
The laptop I used was purchased in 2012. The 1.70 GHz CPU, 4 GB memory, and 128 GB drive may seem small compared to my current desktop machine, but Linux and the Xfce desktop gave this old machine new life.
### Xfce desktop for Linux
The [Xfce desktop][5] is a lightweight desktop that provides a sleek, modern look. The interface is familiar, with a taskbar or “panel” across the top to launch applications, change between virtual desktops, or access notifications in the system tray. The quick access dock at the bottom of the screen lets you launch frequently used applications like the terminal, file manager, and web browser.
![Image of Xfce desktop][6]
To start a new application, click the Applications button in the upper-left corner. This opens a menu of application launchers, with the most frequently used applications like the terminal and file manager at the top. Other applications are organized into groups, so you can navigate to the one you want.
![Image of desktop applications][7]
### Managing files
Xfce's file manager is called Thunar, and it does a great job of organizing my files. I like that Thunar can also make connections to remote systems. At home, I use a Raspberry Pi using SSH as a [personal file server][8]. Thunar lets me open an SSH file transfer window so I can copy files between my laptop and the Raspberry Pi.
![Image of Thunar remote][9]
Another way to access files and folders is via the quick access dock at the bottom of the screen. Click the folder icon to bring up a menu of common actions such as opening a folder in a terminal window, creating a new folder, or navigating into a specific folder.
![Image of desktop with open folders][10]
### Other applications
I loved exploring the other applications provided in Xfce. The Mousepad text editor looks like a simple text editor, but it contains useful features for editing more than just plain text. Mousepad recognizes many file types that programmers and other power users may appreciate. Check out this partial list of programming languages available in the Document menu.
![Image of Mousepad file types][11]
If you prefer a different look and feel, you can adjust the interface options such as font, color scheme, and line numbers using the View menu.
![Image of Mousepad in color scheme solarized][12]
The disk utility lets you manage storage devices. While I didn't need to modify my system disk, the disk tool is a great way to initialize or reformat a USB flash drive. I found the interface very easy to use.
![Image of disk utility][13]
I was also impressed with the Geany integrated development environment. I was a bit surprised that a full IDE ran so well on an older system. Geany advertises itself as a “powerful, stable and lightweight programmer's text editor that provides tons of useful features without bogging down your workflow.” And that's exactly what Geany provided.
I started a simple “hello world” program to test out Geany, and was pleased to see that the IDE popped up syntax help as I typed each function name. The pop-up message is unobtrusive and provides just enough syntax information where I need it. While the `printf` function is easy for me to remember, I always forget the order of options to other functions like `fputs` and `realloc`. This is where I need the pop-up syntax help.
![Image of Geany workspace][14]
Explore the menus in Xfce to find other applications to make your work easier. You'll find apps to play music, access the terminal, or browse the web.
While I installed Linux to use my laptop for a few demos at a conference, I found Linux and the Xfce desktop made this old laptop feel quite snappy. The system performed so well that when the conference was over, I decided to keep the laptop around as a second machine.
I just love working in Xfce and using the apps. Despite the low overhead and minimal approach, I don't feel underpowered. I can do everything I need to do using Xfce and the included apps. If you have an older machine that needs new life, try installing Linux to bring new life to old hardware.
Image by: (Jim Hall, CC BY-SA 40)
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/6/linux-xfce-old-laptop
作者:[Jim Hall][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jim-hall
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/coffee_tea_laptop_computer_work_desk.png
[2]: https://unsplash.com/@jonasleupe?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[3]: https://unsplash.com/s/photos/tea-cup-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[4]: https://spins.fedoraproject.org/xfce/download/index.html
[5]: https://opensource.com/article/19/12/xfce-linux-desktop
[6]: https://opensource.com/sites/default/files/2022-06/Linuxlaptop1.png
[7]: https://opensource.com/sites/default/files/2022-06/linuxlaptopDesktopApps.png
[8]: https://opensource.com/article/20/3/personal-file-server-ssh
[9]: https://opensource.com/sites/default/files/2022-06/LinuxlaptopThunarremote.png
[10]: https://opensource.com/sites/default/files/2022-06/LinuxlaptopDesk.png
[11]: https://opensource.com/sites/default/files/2022-06/LinuxlaptopMousepadfiletype.png
[12]: https://opensource.com/sites/default/files/2022-06/Linuxlaptopmousepadsolarized.png
[13]: https://opensource.com/sites/default/files/2022-06/linuxlaptopdisks.png
[14]: https://opensource.com/sites/default/files/2022-06/Linuxlaptopgeany.png

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/22/6/container-orchestration-kubernetes"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: translator: "Donkey"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

View File

@ -1,144 +0,0 @@
[#]: subject: "Dont Be Afraid of Linux Terminal. Embrace it."
[#]: via: "https://itsfoss.com/love-thy-terminal/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: "duoluoxiaosheng"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Dont Be Afraid of Linux Terminal. Embrace it.
======
Most of our focus goes into avoiding the Linux terminal, at least, for new users comfortable with Graphical User Interfaces (GUIs).
While it is good to make things easy and convenient, there are a few reasons why you should not be afraid of dipping your toes into the Linux terminal.
Here, I shall highlight some of them to encourage you to try a few things in the terminal that should help you eventually.
### 1. Quick Access to Information on Commands
![quick info terminal][1]
At times, you may need to use a command in the terminal to perform something. Sure, you can just copy-paste without knowing what it actually does.
But, what if you are interested to know a bit more about the command?
Well, you just need to type in:
```
man <command you intend to learn>
```
For instance: man apt
It will give you all the essential details right on the same screen, without needing an internet connection or scouring the web to find out what it does. You save time, you get to know stuff.
And, that makes things convenient, giving you more confidence in using the terminal.
These are often referred to as “man pages”. You can read one of our resources to[learn about man pages on Linux][2].
Thanks to the terminal.
### 2. Troubleshooting Problems
![troubleshoting illustration][3]
When you search for a fix on the internet, most of the solutions provide you with commands to get it fixed.
Hence, one of the best use-cases of the terminal is to resolve several system issues quite easily. You will have to be careful here, because
While there are things that you can tweak around with GUI programs, the majority of the easy fixes go through the terminal.
Considering we have several [troubleshooting guides][4] on our portal, some examples include:
* [Checking network adapter manufacturer][5]
* [Fixing long shutdown time][6]
* [Fix no Wi-Fi with broadcom adapters][7]
### 3. Easily Work With a Remote Server
![remote server illustration][8]
You will end up accessing the command line (or the terminal) to access a remote server and perform various operations, including file transfers.
Compared to a GUI method for a remote server, you minimize bandwidth issues and ensure that you get to perform anything you need faster using the Linux terminal.
There are also options to open a GUI program on the remote server via the terminal. Even if it is slow, the terminal gives you plenty of abilities to interact comfortably with a remote server.
### 4. Resource Efficient
It does not matter whether you use one of the [best Linux distributions][9], a Linux terminal is always resource-efficient and consumes the least amount of memory.
If you are low on resources or may have a graphics driver conflict with a GUI program, you can always rely on the Linux terminal.
This should help you through critical tasks without taking much system resources.
### 5. Fast
![fast illustration][10]
Not just limited to the memory usage, but you can get things done faster with a terminal over a GUI, you know?
Some tasks you can try include installing an application, launching a program, performing complex file operations, and more.
### 6. Stable and Reliable Command-line Programs
Compared to GUI programs, terminal programs are stable and more reliable. Why?
Fewer factors influence the program with crashes/bugs when it comes to a terminal.
While the terminal tools could be unintuitive, they are often built for servers in mind. So, the tools do not receive frequent experience breaking updates and do not quickly fail to work.
### 7. More Tools for CLI
We do not have a GUI program for everything on Linux. However, there are several [CLI tools][11] to perform a wide range of operations, some fun and critical tasks as well.
You need to get something done; chances are, you will find a command-line tool for it.
### 8. Various Terminal Emulators to Try
![variety illustration][12]
While you should not have any trouble with the default terminal emulator installed on your Linux distribution, you have plenty of other options.
If you prefer a different look, more advanced features, or tailored for a specific use, you can look at some of the [best terminal emulators][13] available.
If you thought using the terminal was boring, you must try some of them.
### Wrapping Up
Personally, I feared the terminal when I was a new Linux user. But, as I got comfortable with it for small tasks, I got to realize the perks mentioned above.
You do not need to use the terminal over GUI for everything. Nevertheless, it is good to prefer the terminal for a few things because you might save your time, and get things done faster, and in a hassle-free manner.
Abhishek has written an [excellent guide on various small things that make you get more comfortable with the Linux terminal][14].
*What do you think are the benefits of a terminal over a GUI? What are your reasons to prefer the terminal? Let me know your thoughts in the comments section below.*
--------------------------------------------------------------------------------
via: https://itsfoss.com/love-thy-terminal/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/wp-content/uploads/2022/06/quick-info-terminal.png
[2]: https://itsfoss.com/linux-man-page-guide/
[3]: https://itsfoss.com/wp-content/uploads/2022/06/troubleshoting-illustration.jpg
[4]: https://itsfoss.com/tag/troubleshoot/
[5]: https://itsfoss.com/find-network-adapter-ubuntu-linux/
[6]: https://itsfoss.com/long-shutdown-linux/
[7]: https://itsfoss.com/fix-no-wireless-network-ubuntu/
[8]: https://itsfoss.com/wp-content/uploads/2022/06/remote-server-illustration.jpg
[9]: https://itsfoss.com/best-linux-distributions/
[10]: https://itsfoss.com/wp-content/uploads/2022/06/fast-illustration.jpg
[11]: https://itsfoss.com/tag/cli-tools/
[12]: https://itsfoss.com/wp-content/uploads/2022/06/variety-illustration.jpg
[13]: https://itsfoss.com/linux-terminal-emulators/
[14]: https://itsfoss.com/basic-terminal-tips-ubuntu/

View File

@ -0,0 +1,167 @@
[#]: subject: "Containerisation of Java Microservices"
[#]: via: "https://www.opensourceforu.com/2022/06/containerisation-of-java-microservices/"
[#]: author: "Krishna Mohan Koyya https://www.opensourceforu.com/author/krishna-mohan-koyya/"
[#]: collector: "lkxed"
[#]: translator: "lkxed"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Containerisation of Java Microservices
======
Frequent roll outs of microservices demand self-contained units that ensure safe and successful deployments. Containerisation offers an elegant solution. In this part 7 of the Design Odyssey, we will build and deploy the AddService of UMS as a Docker container.
![Container][1]
In the previous part of this series, it was observed that a packaged Spring Boot application carries an embedded Tomcat Web server along with class files and dependent libraries. However, the JRE was left out of the application package. The deployment engineer is still required to find and install a suitable JRE before deploying the application. How about including the JRE also into the package and distributing it so that the deployment can be automated fully?
Thats exactly what containerisation is!
As depicted in Figure 1, a container is a deployment unit that consists of not only the application code but also the required operating environment, which includes artifacts like JRE, Python runtime, Node runtime, etc, as required.
![Figure 1: Deployment unit with containerisation][2]
#### Docker containers
In theory, the concept of containerisation is not very new. For example, the Linux operating system has already been offering the necessary bits and pieces in that direction. However, credit goes to the Docker containers for the popularity of this approach in the last decade.
The architecture of Docker containers can be summarised as shown in Figure 2. It consists of: (1) a Docker Hub, which is a repository of distributable images of Docker containers, and (2) a Docker Engine, which runs the Docker containers.
![Figure 2: The Docker architecture][3]
The architecture is well supported by the other ecosystem players like Git, Jenkin, Maven, etc.
As part of the development cycle, the engineers write and push the code to Git repositories. As part of the build cycle, build tools like Jenkins pull the code from Git repositories, build the Docker image and push it to the Docker Hub.
As part of the deployment cycle, the Docker runtime pulls the image from Docker Hub and creates Docker containers that bring the applications to life. Any number of images can be pulled and launched on a single instance of Docker runtime. Where is the magic?
Docker containers are language-agnostic. They are capable of running applications on any platform. For example, they can run an Express Web service on Node or a Flask Web service on Python, or a Spring Boot Web service on JRE. The answer is simple. The container just offers a sandbox with a Linux environment. The container image must package everything else that is required for the application. For example, the image of a Flask service must include Python runtime into the container image and similarly, the image of a Spring Boot service must include JRE.
Lets explore the last option a bit more.
#### Spring Boot and Docker container
The Maven build tool packages a Java application. The Docker build tool packages a container. Just like the pom.xml acts as the manifest file for the Maven build tool, Dockerfile acts as the manifest file for the Docker build tool.
A Dockerfile specifies the root container as the prerequisite, and presents directives to be followed in order to create the image. For instance, the following is a manifest for building a Docker image of a Spring Boot Web application.
```
FROM maven:3.5-jdk-8
COPY src /usr/glarimy/src
COPY pom.xml /usr/glarimy
RUN mvn -f /usr/glarimy/pom.xml clean package
EXPOSE 8080
ENTRYPOINT [“java”,”-jar”,”/usr/glarimy/target/ums-add-service.jar”]
```
Lets decipher it line by line.
FROM maven:3.5-jdk-8
The above directive specifies maven:3.5-jdk-8 as the root container. This makes sure that a Docker container is started with a JDK of version 8 and the Maven of version 3.5 is available for the rest of the packaging process. This container is used only for building the image. Lets call this a build-container.
```
COPY src /usr/glarimy/src
COPY pom.xml /usr/glarimy
```
The above directives create /usr/glarimy folder on the build-container and copy the code from a local src folder to a /usr/glarimy/src folder on the build-container. They also copy the local pom.xml file to /usr/glarimy on the build-container.
```
RUN mvn -f /usr/glarimy/pom.xml clean package
```
This directive kicks off the Maven build process to package the Java code as per the referred pom.xml. Note that all this happens on the build-container. Once the process is completed, the container image for the Spring Boot application is ready. This image can be run as a container, which we refer to as deployment-container. However, we still need to specify the directives on how to launch this on the deployment-container.
```
EXPOSE 8080
```
The above directive specifies that port 8080 be opened up for traffic on the deployment-container when this image runs.
```
ENTRYPOINT [“java”,”-jar”,”/usr/glarimy/target/ums-add-service.jar”]
```
This directive specifies the command to launch the application on the deployment-container.
There are several other directives possible, but the approach is more or less similar. Once the Dockerfile is ready, and the Docker is installed on a given machine, the following command on a Docker runtime is sufficient to build the container image.
```
docker build -t glarimy/ums-add-service .
```
Observe that the last token of the above command points to the location of Dockerfile, which is the current folder in this case.
The following command lists all available images on the local Docker Engine:
```
docker images
```
Figure 3 presents a sample output of the above command. This list includes the images that are pulled from the Docker Hub as well as built locally.
![Figure 3: Listing the Docker images][4]
Its not useful if the created Docker image of the application just lies on the local Docker Engine. In order for it to be deployed on the target infrastructure, the image needs to be distributed. The following command publishes the local image on the Docker Hub so that anyone can pull it for deployment. Of course, an account needs to be created on [https://hub.docker.com][5] before pushing the image to the hub.
```
docker push glarimy/ums-add-service
```
The images on the Docker Hub can be searched online at[https://hub.docker.com/][6].
![Figure 4: Listing the containers][7]
Individuals and organisations can create private spaces to ensure the confidentiality of the images. In fact, automated builds can also be set up on Docker Hub in such a way that it listens to the code commits on Git and kicks off building a new version of the image immediately. Organisations may use several other tools like Jenkins and design a CI pipeline.
One way or another, once an image is available in the hub, it can be pulled to any Docker machine with the following command:
```
docker pull glarimy/ums-add-service
```
And the following command launches a new Docker container from the image and exposes it to the clients:
```
docker container run -d --name ums-add-service -p 8080:8080 glarimy/ums-add-service
```
This command may look a bit complicated, but its not really so once it is understood.
* The docker container run is the command that runs the container.
* The -d switch makes it a daemon process so that the prompt is back.
* The -name switch names the container as expected. Without this switch, the Docker Engine generates a name that may not be intuitive.
* The -p switch maps the port 8080 of the container to the port 8080 of the host machine so that the clients outside of the container can also access the service.
* And the last part is the actual name of the image that needs to be run, which is glarimy/ums-add-service in this case.
* The list of containers running currently can be found using the following command:
```
docker container ps
```
Now the service can be accessed from the host machine using the appropriate CURL command or using any REST client, just like it was done in the previous parts of this series.
#### Next steps
Though the Docker containers solve the problem of building ready-to-run self-contained images that can be deployed onto any Docker machine, this is certainly not sufficient. What if microservices running in two different containers want to access each other? What if a microservice wants to access a database server? What if N number of instances of a given service must always be run to handle the load?
The answer lies in networking and orchestrating the containers, which will be covered in the next part of this series.
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/06/containerisation-of-java-microservices/
作者:[Krishna Mohan Koyya][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/krishna-mohan-koyya/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Container.jpg
[2]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-1-Deployment-unit-with-containerisation.jpg
[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-2-The-Docker-architecture.jpg
[4]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-3-Listing-the-Docker-images.jpg
[5]: https://hub.docker.com
[6]: https://hub.docker.com/
[7]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-4-Listing-the-containers.jpg

View File

@ -0,0 +1,221 @@
[#]: subject: "Fedora Workstations State of Gaming A Case Study of Far Cry 5 (2018)"
[#]: via: "https://fedoramagazine.org/fedora-workstation-state-of-gaming-far-cry-5/"
[#]: author: "Akashdeep Dhar https://fedoramagazine.org/author/t0xic0der/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Fedora Workstations State of Gaming A Case Study of Far Cry 5 (2018)
======
![][1]
[Liam Dawe/GamingOnLinux, PNG version by Vulphere][2], [CC BY-SA 4.0][3], via Wikimedia Commons
First-person shooter video games are a great proving ground for strategies that make you finish on the top, reflexes that help you to shoot before getting shot and agility that adjusts you to whatever a situation throws at you. Add the open-ended nature brought in by large intricately-designed worlds into the mix, and it dials the player experience to eleven and, with that, it also becomes great evidence of what a platform is capable of. Needless to say, I have been a great fan of open-world first-person shooter games. And Ubisofts Far Cry series happens to be the one which remains closest to my heart. So I tried the (second) most recent release in the long-running series, Far Cry 5 which came out in 2018, on Fedora Workstation 35 to see how it performs.
Just like in [my previous case study][4], the testing hardware has an AMD RDNA2-based GPU, where the video game was configured to the *highest possible graphical preset* to stress the hardware into performing as much as its limiting factor. To ensure that we have a fair comparison, I set up two environments one with Windows 10 Pro 21H2 and one with Fedora Workstation 35, both having up-to-date drivers and support software such as MSI Afterburner or MangoHUD for monitoring, Steam or Lutris for video game management and OBS Studio for footage recording. Adding to that, the benchmarks were ensured to be both representatives of a common gameplay scenario and variable enough to address resolution scaling and HD textures.
![][5]
Before we get into some actual performance testing and comparison results, I would like to go into detail about the video game that is at the centre of this case study. Far Cry 5 is a first-person action-adventure video game developed by Ubisoft Montreal and Ubisoft Toronto. The player takes the role of an unnamed junior deputy sheriff who is trapped in Hope County, a fictional region based in Montana and has to fight against a doomsday cult to take back the county from the grasp of its charismatic and powerful leader. The video game has been well received for the inclusion of branching storylines, role-playing elements and side quests, and is optimized enough to be a defining showcase of what the underlying hardware and platform are capable of.
### Preliminary
#### Framerate
The first test that was performed had a direct implication on how smooth the playing experience would be across different platforms but on the same hardware configuration.
##### Without HD textures
On a default Far Cry 5 installation, I followed the configuration stated above but opted out of the HD textures pack to warm up the platforms with a comparatively easier test. Following are the results.
![][6]
1. On average, the video game had around a whopping 59.25% more framerate on Fedora Workstation 35 than on Windows 10 Pro 21H2.
2. To ensure an overall consistent performance, both the minimum and maximum framerates were also noted to monitor dips and rises.
3. The minimum framerates on Fedora Workstation 35 were ahead by a big 49.10% margin as compared to those on Windows 10 Pro 21H2.
4. The maximum framerates on Fedora Workstation 35 were ahead by a big 62.52% margin as compared to those on Windows 10 Pro 21H2.
5. The X11 display server had roughly 0.52% more minimum framerate as compared to Wayland, which can be taken as a margin of error.
6. The Wayland display server had roughly 3.87% more maximum framerate as compared to X11, which can be taken as a margin of error.
##### With HD textures
On a default Far Cry 5 installation, I followed the configuration stated above, but this time I enabled the HD textures pack to stress the platforms with a comparatively harder test. Following are the results.
![][7]
1. On average, the video game had around a whopping 65.63% more framerate on Fedora Workstation 35 than on Windows 10 Pro 21H2.
2. To ensure an overall consistent performance, both the minimum and maximum framerates were also noted to monitor dips and rises.
3. The minimum framerates on Fedora Workstation 35 were ahead by a big 59.11% margin as compared to those on Windows 10 Pro 21H2.
4. The maximum framerates on Fedora Workstation 35 were ahead by a big 64.21% margin as compared to those on Windows 10 Pro 21H2.
5. The X11 display server had roughly 9.77% more minimum framerate as compared to Wayland, which is big enough to be considered.
6. The Wayland display server had roughly 1.12% more maximum framerate as compared to X11, which can be taken as a margin of error.
#### Video memory usage
The second test that was performed had less to do with the playing experience and more with the efficiency of graphical resource usage. Following are the results.
##### Without HD textures
On a default Far Cry 5 installation, I followed the configuration stated above but opted out of the HD textures pack to use comparatively lesser video memory across the platforms. Following are the results.
![][8]
1. On average, Fedora Workstation 35 uses around 31.94% lesser video memory as compared to Windows 10 Pro 21H2.
2. The Wayland display server uses roughly 1.78% more video memory as compared to X11, which can be taken as a margin of error.
3. The video game usage estimated is closer to the actual readings on Fedora Workstation 35 than they are those on Windows 10 Pro 21H2.
4. Adding this to the previous results speaks about how Fedora Workstation 35 performs better while using fewer resources.
##### With HD textures
On a default Far Cry 5 installation, I followed the configuration stated above but this time I enabled the HD textures pack to stress the platforms by occupying more video memory. Following are the results.
![][9]
1. On average, Fedora Workstation 35 uses around 22.79% lesser video memory as compared to Windows 10 Pro 21H2.
2. The Wayland display server uses roughly 2.73% more video memory as compared to X11, which can be taken as a margin of error.
3. The video game usage estimated is closer to the actual readings on Fedora Workstation 35 than they are those on Windows 10 Pro 21H2.
4. Adding this to the previous results speaks about how Fedora Workstation 35 performs better while using fewer resources.
#### System memory usage
The third test that was performed had less to do with the playing experience and more with how other applications can fit in the available memory while the video game is running. Following are the results.
##### Without HD textures
On a default Far Cry 5 installation, I followed the configuration stated above but opted out of the HD textures pack to warm up the platforms with a comparatively easier test. Following are the results.
![][10]
1. On average, Fedora Workstation 35 uses around 38.10% lesser system memory as compared to Windows 10 Pro 21H2.
2. The Wayland display server uses roughly 4.17% more system memory as compared to X11, which can be taken as a margin of error.
3. Adding this to the previous results speaks about how Fedora Workstation 35 performs better while using fewer resources.
4. Lesser memory usage by the video game leaves out extra headroom for other applications to run simultaneously with no compromises.
##### With HD textures
On a default Far Cry 5 installation, I followed the configuration stated above, but this time I enabled the HD textures pack to stress the platforms with a comparatively harder test. Following are the results.
![][11]
1. On average, Fedora Workstation 35 uses around 33.58% lesser system memory as compared to Windows 10 Pro 21H2.
2. The Wayland display server uses roughly 7.28% more system memory as compared to X11, which is big enough to be considered.
3. Adding this to the previous results speaks about how Fedora Workstation 35 performs better while using fewer resources.
4. Lesser memory usage by the video game leaves out extra headroom for other applications to run simultaneously with no compromises.
### Advanced
#### Without HD textures
On a default Far Cry 5 installation, I followed the previously stated configuration without the HD textures pack and ran the tests with varied resolution multipliers. Following are the results.
##### Minimum framerates recorded
![][12]
1. A great deal of inconsistent performance is visible on Fedora Workstation 35 with both display servers in lower resolution scales.
2. The inconsistencies seem to normalize for the resolution multipliers on and beyond the 1.1x resolution scale for Fedora Workstation 35.
3. Resolution multipliers do not seem to have a great effect on the framerate on Windows 10 Pro 21H2 as much as on Fedora Workstation 35.
4. Although Windows 10 Pro 21H2 misses out on potential performance advantages in lower resolution multipliers, it has been consistent.
5. Records on Windows 10 Pro 21H2 in the 2.0x resolution multiplier appear to be marginally better than those on Fedora Workstation 35.
##### Maximum framerates recorded
![][13]
1. A small amount of inconsistent performance is visible on Fedora Workstation 35 with both display servers in lower resolution scales.
2. The inconsistencies seem to normalize for the resolution multipliers on and beyond the 1.1x resolution scale for Fedora Workstation 35.
3. Resolution multipliers change starts noticeably affecting performance on Windows 10 Pro 21H2 on a 1.6x scale, beyond which it falls greatly.
4. Although Windows 10 Pro 21H2 misses out on potential performance advantages in lower resolution multipliers, it has been consistent.
5. Records on Windows 10 Pro 21H2 in the 1.6x resolution multiplier and beyond appear to be better than those on Fedora Workstation 35.
##### Average framerates recorded
![][14]
1. A minor amount of inconsistent performance is visible on Fedora Workstation 35 with both display servers in lower resolution scales.
2. The inconsistencies seem to normalize for the resolution multipliers on and beyond the 1.1x resolution scale for Fedora Workstation 35.
3. Resolution multipliers change starts noticeably affecting performance on Windows 10 Pro 21H2 on a 1.6x scale, beyond which it falls greatly.
4. Although Windows 10 Pro 21H2 misses out on potential performance advantages in lower resolution multipliers, it has been consistent.
5. Records on Windows 10 Pro 21H2 in the 1.9x resolution multiplier and beyond appear to be better than those on Fedora Workstation 35.
#### With HD textures
On a default Far Cry 5 installation, I followed the previously stated configuration with the HD textures pack and ran the tests with varied resolution multipliers. Following are the results.
##### Minimum framerates recorded
![][15]
1. A great deal of inconsistent performance is visible on Fedora Workstation 35 with both display servers in lower resolution scales.
2. The inconsistencies seem to normalize for the resolution multipliers on and beyond the 1.5x resolution scale for Fedora Workstation 35.
3. Resolution multipliers do not seem to have a great effect on the framerate on Windows 10 Pro 21H2 as much as on Fedora Workstation 35.
4. Although Windows 10 Pro 21H2 misses out on potential performance advantages in lower resolution multipliers, it has been consistent.
5. Records on Windows 10 Pro 21H2 in the 2.0x resolution multiplier appear to be marginally better than those on Fedora Workstation 35.
##### Maximum framerates recorded
![][16]
1. A great deal of inconsistent performance is visible on Fedora Workstation 35 with both display servers in lower resolution scales.
2. The inconsistencies seem to normalize for the resolution multipliers on and beyond the 1.0x resolution scale for Fedora Workstation 35.
3. Resolution multipliers change starts noticeably affecting performance on Windows 10 Pro 21H2 on a 1.6x scale, beyond which it falls greatly.
4. Although Windows 10 Pro 21H2 misses out on potential performance advantages in lower resolution multipliers, it has been consistent.
5. Records on Windows 10 Pro 21H2 in the 1.6x resolution multiplier and beyond appear to be better than those on Fedora Workstation 35.
##### Average framerates recorded
![][17]
1. A minor amount of inconsistent performance is visible on Fedora Workstation 35 with both display servers in lower resolution scales.
2. The inconsistencies seem to normalize for the resolution multipliers on and beyond the 1.1x resolution scale for Fedora Workstation 35.
3. Resolution multipliers change starts noticeably affecting performance on Windows 10 Pro 21H2 on a 1.6x scale, beyond which it falls greatly.
4. Although Windows 10 Pro 21H2 misses out on potential performance advantages in lower resolution multipliers, it has been consistent.
5. Records on Windows 10 Pro 21H2 in the 1.9x resolution multiplier and beyond appear to be better than those on Fedora Workstation 35.
### Inferences
If the test results and observations baffle you, please allow me to tell you that you are not the only one who feels like that. For a video game that was created to run on Windows, it is hard to imagine how it ends up performing way better on Fedora Workstation 35, all while using a much lesser amount of system resources at all times. Special attention has been given to noting down the highest highs and lowest lows of framerates to ensure that consistent performance is made available.
But wait a minute how is it that Fedora Workstation 35 manages to make this possible? Well, while I do not have a clear idea of what exactly goes on behind the scenes, I do have a certain number of assumptions that I suspect might be the reasons attributing to such brilliant visuals, great framerates and efficient resource usage. These can potentially act as starting points for us to understand the features of Fedora Workstation 35 for compatibility layers to make use of.
1. Effective caching of graphical elements and texture assets in the video memory allows for keeping only those data in the memory which are either actively made use of or regularly referenced. The open-source AMD drivers help Fedora Workstation 35 make efficient use of the available frame buffer.
2. Quick and frequent cycling of data elements from the video memory helps to bring down total occupancy per application at any point in time. The memory clocks and shader clocks are left at the applications disposal by the open-source AMD drivers, and firmware bandwidth limits are all but absent.
3. With AMD Smart Access Memory (SAM) enabled, the CPU is no longer restricted to using only 256MiB of the video memory at a time. A combination of leading-edge kernel and up-to-date drivers makes it available on Fedora Workstation 35 and capable of harnessing the technology to its limits.
4. Extremely low system resource usage by supporting software and background services leaves out a huge majority of them to be used by the applications which need it the most. Fedora Workstation 35 is a lightweight distribution, which does not get in your way and puts the resources on whats important.
5. Faster loading of data elements to and from the physical storage devices to the system memory is greatly enhanced with the use of high-capacity modern copy-on-write file systems like BTRFS and journaling file systems like EXT4, which happens to be the suggested file system for Fedora Workstation 35.
Performance improvements like these only make me want to indulge more in testing and finding out what else Fedora Workstation is capable of. Do let me know what you think in the comments section below.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/fedora-workstation-state-of-gaming-far-cry-5/
作者:[Akashdeep Dhar][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/t0xic0der/
[b]: https://github.com/lkxed
[1]: https://fedoramagazine.org/wp-content/uploads/2022/06/gaming-2-816x345.jpg
[2]: https://commons.wikimedia.org/wiki/File:Steam_Deck_(front).png
[3]: https://creativecommons.org/licenses/by-sa/4.0
[4]: https://fedoramagazine.org/fedora-workstations-state-of-gaming/
[5]: https://user-images.githubusercontent.com/49605954/172998217-ea8b7adf-1f83-4f46-89d1-9406387542c3.png
[6]: https://user-images.githubusercontent.com/49605954/172686721-eb2469c0-a81f-4e32-a4b3-aabbdb0035a4.svg
[7]: https://user-images.githubusercontent.com/49605954/172686709-8c5a17e6-9e91-4a21-8c8e-95fc9606853c.svg
[8]: https://user-images.githubusercontent.com/49605954/172686723-d03b6a2f-7950-416c-9256-cae1e0a15e2f.svg
[9]: https://user-images.githubusercontent.com/49605954/172686713-2b45753b-92ad-4ecf-801f-b8e5e2bd7778.svg
[10]: https://user-images.githubusercontent.com/49605954/172686727-dc6feb71-30ef-4792-90c6-72a3c1f95da7.svg
[11]: https://user-images.githubusercontent.com/49605954/172686719-6c9f621c-a41b-454e-92b3-7cf9a5f79502.svg
[12]: https://user-images.githubusercontent.com/49605954/172686748-bcba2e85-9f3e-4331-9338-238748424081.svg
[13]: https://user-images.githubusercontent.com/49605954/172686758-36422b22-b66c-4ee5-bb74-b7bdf3d4d02a.svg
[14]: https://user-images.githubusercontent.com/49605954/172686753-f20e057d-c631-4aa7-9366-0d84dd227840.svg
[15]: https://user-images.githubusercontent.com/49605954/172686730-450b7d5b-8e13-49a8-8967-cb820514ec28.svg
[16]: https://user-images.githubusercontent.com/49605954/172686745-1b4fd578-91b9-4080-8049-05736774f484.svg
[17]: https://user-images.githubusercontent.com/49605954/172686739-1139158c-0e85-484c-ba42-d3ddac07419a.svg

View File

@ -0,0 +1,85 @@
[#]: subject: "How Wordle inspired me to create a 3D printing wiki the open source way"
[#]: via: "https://opensource.com/article/22/6/3d-printing-wordle-crowdsourcing"
[#]: author: "Adam Bute https://opensource.com/users/buteadam"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How Wordle inspired me to create a 3D printing wiki the open source way
======
3D printing is a lot like a game of Wordle. I aim to solve the puzzle by creating crowdsourced documentation and databases.
![Lots of people in a crowd.][1]
Image by: Opensource.com
You decide to buy a 3D printer. You do your research, and you settle on an open system that uses resin as its material. You spend a nice chunk of money, and after a few weeks of waiting, it finally arrives.
You unbox it. It's gorgeous. You do some small assembly, pour in the liquid resin, and you're ready to go. You fire up the software. It asks you to type in the correct parameters for the material. You check the bottle but you can't see any parameters. You check online, but still can't find anything.
A bit confused, you write an email to the manufacturer, asking if they could point you in the right direction. The manufacturer tells you they also don't know the parameters, but they are pretty sure they exist, and you should try to guess them yourself. Baffled, you start wondering whether this is really what resin printing is like, or if you've been duped by this company.
### A bad game of Wordle
Unfortunately, this is really what resin printing is like. When you buy a new material, you have to do what's called resin validation. It's essentially making a guess for the parameters and adjusting the numbers based on your results. That's if your guess was decent and anything even comes out of the printer.
It's a lot like playing a game of Wordle, except none of the blocks ever turn green. All you can do is eyeball whether the print looks slightly better or worse with each iteration, and then try again. Finally, at one point you say “looks good to me,” and that's that.
![An image of Wordle][2]
If that sounds like a deeply unsatisfying game to you, you'd be correct. It's also way too long, often taking days, and wasting a good amount of resin in the process. Resin is expensive. At least Wordle is free.
### A little help from above?
So why don't these manufacturers, who know their material best, share the print parameters? Well, their arguments are somewhat reasonable. There are millions of possible combinations of printers and resins, and they can't possibly cover all of them. And even between two printers which are the same model, there can be tiny variations, which affect the numbers slightly.
But slightly' is an important word. If users got a good baseline, they could easily adjust the settings if they needed to. At least it would be much quicker than starting from scratch. To be fair, some companies do give recommended settings, but it's hard to trust even these numbers. There are many crafty manufacturers who publish fake, untested settings, just to lure customers in.
The truth is that resin validation is expensive. Resin companies are almost invariably small businesses, strapped for cash, who just can't afford to spend on resin validation. So, they outsource this work to the end user. But this creates a kind of absurd situation in the resin printing world. Instead of one man at one company doing the validation work once, hundreds of people do the same work over and over again just to come to the same conclusion.
### Makers to the rescue
So what does the maker community do? They try to fix the problem themselves. Reddit and Facebook groups are full of people happily sharing screenshots of a new setting they figured out. Nice gesture, but not very useful. Some ingenious community members created live resin setting spreadsheets that are updated based on user submissions. These are fantastic resources, and universally loved, but they too have their limitations.
They are messy, rarely updated, and there's no way to tell whether the settings actually work. And because anonymous users host them, they are sometimes turned into spam, or randomly deleted. Most recently the biggest community spreadsheet was unexpectedly deleted, erasing years' worth of crowdsourced data with it.
![Image of a community spreadsheet][3]
### Making a resin setting database
I'm a bit of an egghead myself and I really enjoy organizing things. I had the idea to collect all these settings from manufacturers and communities, and put it on a nice website. I registered the domain [makertrainer.com][4] and used two awesome open source tools to build the site: [MediaWiki][5] and [DataTables][6].
![Image of Maker Trainer][7]
I made it a wiki so that anyone could contribute, but made certain spam or vandalism could be easily undone. I also added some buttons to allow users to vote on whether a setting worked or not. I posted it in some communities to see if people would find it useful, and the response has been overwhelming. I didn't realize this at the time, but I accidentally created the [biggest resin setting database on the internet][8]. Users kept spreading it on social media, blog posts, YouTube and so on. With so many people submitting new settings, the database grows larger daily.
![Image of resin settings][9]
The fact that people are so enthusiastic shows just how much of a void there is for documentation in 3D printing. There's a lot of practical experience scattered amongst makers, most of which is never written down or shared publicly. Everyone needs to do a better job recording practical knowledge in addition to theory. Otherwise, the next generation of makers will commit the same mistakes again. The database is a small contribution in this regard, but I hope it can continue to grow, and make 3D printing just a little easier for everyone.
Image by: (Adam Bute, CC BY-SA 40)
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/6/3d-printing-wordle-crowdsourcing
作者:[Adam Bute][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/buteadam
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/BUSINESS_community_1.png
[2]: https://opensource.com/sites/default/files/2022-06/bad_wordle.png
[3]: https://opensource.com/sites/default/files/2022-06/community_spreadsheet.png
[4]: http://makertrainer.com/
[5]: https://www.mediawiki.org/wiki/MediaWiki
[6]: https://datatables.net/
[7]: https://opensource.com/sites/default/files/2022-06/Maker_Trainer.png
[8]: https://hackaday.com/2022/05/13/open-database-shares-resin-3d-printing-settings/
[9]: https://opensource.com/sites/default/files/2022-06/resin_settings_table.png

View File

@ -0,0 +1,221 @@
[#]: subject: "Rocket.Chat vs. Slack: Choosing the Perfect Team Collaboration App"
[#]: via: "https://itsfoss.com/rocket-chat-vs-slack/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Rocket.Chat vs. Slack: Choosing the Perfect Team Collaboration App
======
Slack is arguably the most popular team messaging/collaboration application out there.
While it is not an open-source solution, it is available for Linux, Windows, macOS, Android, and iOS.
[Rocket.Chat][1], on the other hand, is one of the [best open-source Slack alternatives][2]. It is also available across all major platforms.
We at Its FOSS use Rocket.Chat (Self-hosted) for internal team communication. But, we have also had a fair share of experiences with Slack.
Is Rocket.Chat better than Slack? What benefits do you get if you use Slack over Rocket.Chat?
If you are on the fence about deciding on a good team communication app, let me compare the offerings to help you explore more about them.
### Free vs. Premium
![free premium illustration][3]
An essential factor for picking a team communication application includes the pricing.
Open-source or not, not everyone wants to invest in getting started. Of course, it depends on your preferences, but most users will prefer something free.
[Slack][4], in this case, is free to get started with limited features. We also have a guide on [installing Slack on Linux][5] to give you a head start.
In comparison, [Rocket.Chat][6] is not entirely free to set up. Technically, you dont need to pay a dime to use it. However, it would help if you had a server to deploy it to.
So, considering you already have an infrastructure in place, it should be free for you without any limit to its available features.
But, if you would rather not invest in a server to host it yourself, Slack gives you the free option.
Furthermore, Slack does present you with some special regional pricing, which is not the case with Rocket.Chat.
Generally, the pricing for premium subscriptions is almost similar, but it will differ per your organizations requirements. You might want to check out [Slacks][7]and [Rocket.Chats][8] pricing page to learn more about it.
### User Experience
Rocket.Chat offers a straightforward interface that is easy to use. It does provide a good user experience, but as per my usage (for a few years now), I wouldnt rate it as the “best experience”.
![rocket chat ux main][9]
Things like searching for a particular message and a few subtle interactions arent the strongest points of Rocket.Chat.
But, if you like a simple and effective user interface that keeps up with the modern standards, Rocket.Chat is your friend. It does not have any significant issues, but it may not be the most engaging experience for some.
With Slack, the user interface takes a modern approach (in other words, a feature-filled user experience).
Considering the mobile and desktop experience of Slack, it works great with its subtle animations and works pretty much flawlessly.
![slack ux][10]
With that being said, I would recommend trying both of them to check your preferences. Just for my opinion, I give Slack a bit of an edge here.
### Self-hosted vs. Hosted (Data Privacy)
![self hosted illustration][11]
While it can be a hassle to self-host it, if you are someone who values data privacy more than the setup convenience, Rocket.Chat can be the perfect fit.
Fret not, we have a [guide to help you self-host Rocket.Chat][12], if you prefer doing that.
Of course, Slack does not wildly steal any of your data, but technically, your data resides on someone elses server. You do not get control of it, but get access to some toggles to manage the workspace.
With Rocket.Chat lets you control the data and any practices that help you secure your communications.
Note that for some users, securing and deploying proper practices to secure their server can be a headache (if you are not experienced). So, you might have to end up hiring an expert to set it up and maintain it for you.
Fortunately, Rocket.Chat also offers you a hosted option like Slack for a premium giving access to certain enterprise-grade features.
Overall, with Rocket.Chat allows you to opt between a self-hosted option and a managed hosted plan. But, with Slack, you only have the option to rely on a managed hosting option.
### Encryption
![encryption illustration][13]
Rocket.Chat supports end-to-end encryption out of the box using the “**Off the record**” feature conversations. So, you can toggle it in every conversation when needed.
The feature is still in its beta phase and does not support sharing files when writing this. Hence, it isnt as pleasant as using some of the [best WhatsApp alternatives][14] for instant messaging.
The enterprise edition, mentions that it offers end-to-end encryption by default. Of course, with the self-hosted option, you get more control, so you get to decide what you want to do with it.
Slack encrypts the data at rest and data in transit for all users. With its enterprise edition, you get an Enterprise Key Management feature to take control of your encryption keys for sensitive conversations.
Overall, both Slack and Rocket.Chat offers options for encryption and security. It all depends on what your organization needs or what you need as an individual.
### Whitelabel
![whitelabel illustration][15]
Numerous brands aim to customize every service/app experience they use by incorporating the companys theme/name/color/logo.
And, Rocket.Chat gives you total freedom to customize the experience.
Ranging from color changes to full CSS customization to help an organization tailor the collaboration/messaging experience for their employees. Just like we have a few things customized in our case.
![rocket chat ux][16]
You can even choose to customize from the source code for advanced tweaks.
Unfortunately, Slack falls short on this. Whether an individual or an enterprise, you must stick to Slacks default themes/color choices.
### Key Features
You should get all the essential messaging features with both of them.
Message reactions, threaded replies, the recipients time zone, notification controls, etc. Several such features can make a difference.
![A Video from YouTube][17]
To make things simpler, here, I highlight some of the key feature differences (and similarities) that could help you decide whats better for you:
**Common Features**
* Two-Factor Authentication support.
* You can edit messages.
* Quote messages and reply to them.
* Create separate channels, and add members for access.
* Pin messages.
* Dark theme.
* Privacy options.
Now that you know some of the fundamental similarities. It would help if you also looked at some of the introductory videos embedded that give you an overview of both.
![A Video from YouTube][18]
In either case, let us take a look at some of the important differences:
##### Rocket.Chat
* Start a discussion for a separate topic
* Toggle end-to-end encryption
* Channel cannot be entirely limited to admins for messages (other users can reply to the new messages).
* No reminder feature for a conversation thread in a channel.
* No separate drafts section.
* No separate section to find all the files you sent.
* Easily export your data. (HTML/JSON)
##### Slack
* No discussion feature
* No user toggle for end-to-end encryption
* Channel can be easily limited to the admins (with no option to reply to other members).
* Ability to set a reminder to get notified of new replies in a conversation thread.
* All drafts get saved and can be accessed from a single place.
* You can find all the sent files quickly.
* Only a workspace admin/owner can export data.
In addition to some key points, you should find many other subtle differences making up the entire user experience.
### Third-Party Integrations and Extras
![decentralize illustration][19]
Regarding third-party integrations, none of the choices should disappoint you.
All the major services like Outlook, Zoom and Google Drive work well with both Rocket.Chat and Slack.
However, Rocket.Chat offers some extras that can have the edge over Slack:
* Ability to integrate Matrix protocol, making Rocket.Chat one of the [best Matrix clients][20]. In other words, you get a decentralized messenger with Rocket.Chat.
* Adding integrations through Zapier.
### Open Source vs. Proprietary
Rocket.Chat already offers some good perks as an open-source solution—for instance, the option to self-host, the freedom to customize the source code, and more.
So, if you prefer an open-source software for its transparency, privacy benefits, and more, Rocket.Chat is the easy pick.
If you do not care about any of the perks that come with an open-source tool, you can pick Slack for some of its convenient features and a slightly better user experience.
### Final Verdict: What Should You Use for Team Communication?
Rocket.Chat gives you more control of your data and the freedom to customize things. So, if you have no issues with a self-hosted solution, Rocket.Chat is a clear choice.
However, if you do not want to set it up yourself and want an enterprise (managed) offering, you might want to try them first to evaluate the user experience and its features per your preferences.
And, if you are just getting started and do not want to invest in a server/premium subscription, Slack should be a good start.
*What would you pick? Let me know your thoughts in the comments below.*
--------------------------------------------------------------------------------
via: https://itsfoss.com/rocket-chat-vs-slack/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/rocket-chat/
[2]: https://itsfoss.com/open-source-slack-alternative/
[3]: https://itsfoss.com/wp-content/uploads/2022/06/free-premium-illustration.jpg
[4]: https://slack.com/
[5]: https://itsfoss.com/slack-use-linux/
[6]: https://rocket.chat/
[7]: https://slack.com/intl/en-in/pricing
[8]: https://rocket.chat/pricing
[9]: https://itsfoss.com/wp-content/uploads/2022/06/rocket-chat-ux-main.png
[10]: https://itsfoss.com/wp-content/uploads/2022/06/slack-ux.jpg
[11]: https://itsfoss.com/wp-content/uploads/2022/06/self-hosted-illustration.jpg
[12]: https://linuxhandbook.com/rocket-chat-docker/
[13]: https://itsfoss.com/wp-content/uploads/2022/06/encryption-illustration.jpg
[14]: https://itsfoss.com/private-whatsapp-alternatives/
[15]: https://itsfoss.com/wp-content/uploads/2022/06/whitelabel-illustration.jpg
[16]: https://itsfoss.com/wp-content/uploads/2022/06/rocket-chat-ux.png
[17]: https://youtu.be/MW_qsbgt1KQ
[18]: https://youtu.be/j9-8UFTHlvk
[19]: https://itsfoss.com/wp-content/uploads/2022/06/decentralize-illustration.jpg
[20]: https://itsfoss.com/best-matrix-clients/

View File

@ -0,0 +1,240 @@
[#]: subject: "Top 10 App Launchers for Ubuntu & GNOME Desktop [With Bonus List]"
[#]: via: "https://www.debugpoint.com/2022/06/top-ubuntu-launcher-2022/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Top 10 App Launchers for Ubuntu & GNOME Desktop [With Bonus List]
======
Heres a list of the 10 best application launcher to boost your productivity and saves time. Try these in Ubuntu, Linux Mint and other distros.
### What is a Launcher
A launcher is an application that performs a search and launches any application in your desktop environment. Usually, it is kicked off by a keyboard combination and gives you available options to start. It can also perform specific actions such as browsing file systems and calculating a formula value.
In other terms, a traditional application menu is also a launcher. Because using a simple menu, you can also search and launch applications.
Most mainstream Linux distributions do not come with a dedicated launcher by default. Some particular ones feature them. For example, the KDE Plasma desktop in Kubuntu and other distros bring the awesome Krunner launcher. Similarly, there are other launchers as well which are exciting to try out.
This [Top 10 list][1] features some of the best App Launchers for Ubuntu and Linux distros.
### Top 10 App Launcher for Ubuntu and Other Linux Distros
#### 1. Ulauncher
Ulauncher is a classy and nice-looking App launcher for Ubuntu, Linux Mint and similar distros. It is written in Python and brings some exciting features. For example, Ulauncher support fuzzy search, i.e. your incorrect spellings also give you the exact result that you are looking for. In addition, it supports searching the file system, files, web browsing history and many such features.
Moreover, you can change the looks of the Ulauncher via several Themes to make it look great in your [desktop theme][2].
![Ulauncher showing fuzzy search][3]
![][4]
You can install Ulauncher via the below methods.
* [Directly download][5] the deb file for Ubuntu, Linux Mint and other similar distros. And then, using the Software, you can install it.
* For Fedora, run the below command from a terminal prompt to install.
```
sudo dnf install ulauncher
```
* After installation, you can press CTRL+space to launch Ulauncher.
* For more information, visit the [official website][6].
#### 2. Kupfer
Kupfer is a little different-looking launcher. Written in Python, it is an old application that brings up the applications icons when it matches the search values. Usually, it does not have a search box. However, you can type, and the possible matches are shown instantly. Moreover, it supports several plugins as well.
![Kupfer][7]
You can easily install Kupfer in Ubuntu and Linux Mint using the below command.
```
sudo apt install kupfer
```
You can find more details about this launcher on its [home page][8].
#### 3. Albert
Perhaps the most exciting app launcher on this list is Albert. Albert is a widely used launcher that brings app, file system and web search from its search box. Also, it shows you the path of the application or the shortcuts in the resulting drop-down so that you can choose the correct application. Other than that, you can also do basic mathematics calculations from the launcher itself.
In addition, Albert comes with several plugins to extend its functionality which is accessible from its settings window. When launched for the first time, you need to choose the Keybinding for the launcher.
![Albert Launcher][9]
Installation of Albert is terminal driven via openSUSE build service.
For Ubuntu and Linux Mint, you can install Albert using the following commands in sequence.
```
sudo apt install curlcurl https://build.opensuse.org/projects/home:manuelschneid3r/public_key | sudo apt-key add -echo 'deb http://download.opensuse.org/repositories/home:/manuelschneid3r/xUbuntu_22.04/ /' | sudo tee /etc/apt/sources.list.d/home:manuelschneid3r.listsudo wget -nv https://download.opensuse.org/repositories/home:manuelschneid3r/xUbuntu_22.04/Release.key -O "/etc/apt/trusted.gpg.d/home:manuelschneid3r.asc"sudo apt updatesudo apt install albert
```
Alternatively, if you want the deb file, you can [get it here][10]. All the above commands are for [Ubuntu 22.04 LTS][11] only.
Similarly, for Fedora Linux, you can use the following command.
```
sudo rpm --import https://build.opensuse.org/projects/home:manuelschneid3r/public_keydnf config-manager --add-repo https://download.opensuse.org/repositories/home:manuelschneid3r/Fedora_36/home:manuelschneid3r.repodnf install albert
```
To learn more about Albert, visit the [official website][12].
#### 4. GNOME Pie
GNOME Pie is a circular application launcher and looks different from the traditional launcher. It gives you a circular icon-based menu. See the below image.
![GNOME Pie circular launcher][13]
The design may not go well with specific users, considering the modern user interface designs, but its very productive if you are familiar with it. GNOME Pie activates itself when you press the default keyboard combination CTRL+ALT+Space. Another interesting behaviour of GNOME Pie is it pops up at your mouse cursor position.
Installing GNOME Pie is easy in Ubuntu and other similar distributions. Open a terminal prompt and run the below command.
```
sudo apt install gnome-pie
```
After installation, press CTRL+ALT+space to activate. For more details, you may visit its official [home page][14].
#### 5. Cerebro
Another attractive launcher which I like to highlight is Cerebro. Cerebro is an electron-based launcher that may act as a single entry point to your “question” or “intent” of search. For example, you want to find out “how often you should wash your car”. Cerebro can show you possible results from Google. Moreover, the usual launcher functions such as finding an app and browsing the file system also work in this launcher.
![Cerebro | Image credit: Cerebro team][15]
Unfortunately, I could not run the AppImage of Cerebro in Ubuntu 22.04 LTS for a demo. It looks like there are some bugs.
But you may download AppImage or deb file from here and try it. **Note**: it has a dependency on `libcanberra-gtk-module` and `libfuse2`. Finally, its also available for Windows and macOS, and you may learn more about Cerebro at its official [homepage][16].
#### 6. Synapse
Synapse is a free and open-source launcher application with which you can quickly start applications and access files using the Zeitgeist engine. Written in Vala, Synapse is similar to the Ulauncher in this list.
In addition, it can search your playlists, give you options to shutdown and gives you a Tabbed view of the preliminary result window. Synapse is an excellent utility to have for your desktop.
![Synapse Launcher][17]
You can download the latest build deb file (amd64) in Launchpad using [this page][18] and install it using GDebi or dpkg or Software.
#### 7. Zazu
Zazu is another excellent launcher which you can try out. It is free and open-source and comes with a variety of features out of the box. For example, you can search and take actions on the system power menu and search in package manager and clipboard history using Zazu. In addition, you can also run the system commands and launch applications using this Ubuntu launcher.
![Zazu launcher | Image credit: Zazu team][19]
Zazu is available for Windows and Linux. You can get the deb file on [this page for Ubuntu Linux and other related distributions.][20] After downloading the deb file, you can install it using the Software or GDebi.
Visit the [official website][21] to learn more about its features.
#### 8. Rofi
If you are a long-time desktop Linux user, I am sure you heard about Rofi. Rofi is a clone of the window switcher “Simpleswitcher”. It is a versatile application launcher or swithers that brings several pre-made modes. For example, it features Window switcher mode, app launcher mode, file browsing mode and a unique SSH launcher mode.
In addition, it is designed to give you results based on your search history, which is sorted based on your search age. Moreover, it supports plugins and themes which you can choose to blend into your desktop design.
![Rofi in file browser more][22]
For more details, visit the Github [page][23].
Installation of Rofi is easy, as the packages are available in significant distribution repo. For Ubuntu Linux, you can run the below command to install.
```
sudo apt install rofi
```
For Fedora Linux, use:
```
sudo dnf install rofi
```
After installation, visit the Quickstart [guide][24] to run this launcher. Because running the Rofi launcher is a little different than others.
#### 9. GNOME Do
The ninth in this Ubuntu launcher list is “GNOME-Do”. [GNOME Do][25] an intelligent desktop launcher which helps you to perform several tasks. For example, you can launch operating system actions such as copy, move, and delete. In addition, you can efficiently perform the usual search of apps and file system data. GNOME Do also support several Themes and Plugins developed by the community for further customization.
![GNOME Do][26]
You can install the GNOME Do launcher in Ubuntu using the following PPA.
```
sudo add-apt-repository ppa:do-core/ppasudo apt updatesudo apt install gnome-do
```
#### 10. LightHouse
The final Ubuntu launcher in this list is LightHouse. Lighthouse is the most simple launcher with a minimal design. It has a single search box that expands based on the input parameter. For example, if you want to execute specific actions, you can type the proper keyword, showing you the available options.
Installing LightHouse is a little tricky in Ubuntu. It requires compilation which you can find on [this page][27]. For Arch Linux, you can [setup Yay AUR helper][28] and run `yay -S lighthouse-git` to install.
Learn more about LightHouse on its official [Github page][29].
### Bonus List
Finally, here are five more launchers which are stunning in their merit. But I have not added them to the above list because they are more like “application menu” than “pop-out launcher”. Semantically all the apps in the below is “launcher”, but I guess its better to term them as the extended application menu.
* [Arc Menu][30]
* [Plank][31]
* [DockBarX][32]
* [Docky][33]
### Closing Notes
I hope this list of best launchers for Ubuntu and Other Linux helps you pick one. In addition, you may try all of them and choose the one that suits best your workflow. Also, as many of them uses similar keyboard combination, try not to use all of them together.
Finally, which one of the Ubuntu launchers above is your favourite? Let me know in the comment box below.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2022/06/top-ubuntu-launcher-2022/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/tag/top-10-list/
[2]: https://www.debugpoint.com/category/themes
[3]: https://www.debugpoint.com/wp-content/uploads/2022/06/Ulauncher-showing-fuzzy-search.jpg
[4]:
[5]: https://github.com/Ulauncher/Ulauncher/releases/
[6]: https://ulauncher.io/
[7]: https://www.debugpoint.com/wp-content/uploads/2022/06/Kupfer.jpg
[8]: https://github.com/kupferlauncher/kupfer
[9]: https://www.debugpoint.com/wp-content/uploads/2022/06/Albert-Launcher.jpg
[10]: http://download.opensuse.org/repositories/home:/manuelschneid3r/xUbuntu_22.04/amd64/
[11]: https://www.debugpoint.com/tag/ubuntu-22-04-lts/
[12]: https://albertlauncher.github.io/
[13]: https://www.debugpoint.com/wp-content/uploads/2022/06/GNOME-Pie.jpg
[14]: http://schneegans.github.io/gnome-pie
[15]: https://www.debugpoint.com/wp-content/uploads/2022/06/Cerebro.jpg
[16]: https://cerebroapp.com/
[17]: https://www.debugpoint.com/wp-content/uploads/2022/06/Synapse-Launcher.jpg
[18]: https://launchpad.net/ubuntu/+source/synapse/0.2.99.4-3build1/+build/23235198
[19]: https://www.debugpoint.com/wp-content/uploads/2022/06/Zazu-launcher.jpg
[20]: https://github.com/bayleeadamoss/zazu/releases
[21]: http://zazuapp.org/
[22]: https://www.debugpoint.com/wp-content/uploads/2022/06/Rofi-in-file-browser-more.jpg
[23]: https://github.com/davatorium/rofi
[24]: https://github.com/davatorium/rofi#quickstart
[25]: http://do.cooperteam.net/
[26]: https://www.debugpoint.com/wp-content/uploads/2022/06/GNOME-Do.jpg
[27]: https://github.com/emgram769/lighthouse#installation
[28]: https://www.debugpoint.com/2021/01/install-yay-arch/
[29]: https://github.com/emgram769/lighthouse
[30]: https://gitlab.com/arcmenu/ArcMenu
[31]: https://launchpad.net/plank
[32]: https://github.com/M7S/dockbarx
[33]: https://launchpad.net/docky/

View File

@ -0,0 +1,39 @@
[#]: subject: "Mattermost Extends workflow platform with 7.0 release"
[#]: via: "https://www.opensourceforu.com/2022/06/mattermost-extends-workflow-platform-with-7-0-release/"
[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/"
[#]: collector: "lkxed"
[#]: translator: "lkxed"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Mattermost 7.0 发布,扩展了工作流平台
======
![Mattermost][1]
自 2016 年开源以来Mattermost 一直在开发一个具有不断增加的用例的消息传递平台。6 月 16 日Mattermost 7.0 平台发布,其中包括了新的语音呼叫、工作流模板和用于开源技术的应用框架。新版本扩展了 2021 年 10 月发布的 6.0 版本引入的功能。一直以来Mattermost 都在与包括 Slack、Atlassian 和 Asana 在内的几家大公司竞争不断增长的协作工具市场。另一方面Mattermost 侧重于对开发者的支持,尽管该平台也可用于安全和 IT 运营。
Mattermost 的软件同时提供有商业版和开源版,目前它们都升级到了 7.0 版。Tien 解释说Mattermost 的商业平台是建立在开源基础上的。在开放核心模型中,开源版作为软件的基础或核心,专有的企业功能则内置于商业版中。合规性、规模性和高级配置是 Mattermost 的关键企业功能。Tien 声称,开源版本对于中小型团队来说已经足够了。他认为,拥有 500 名或更多用户的团队才需要考虑使用商业版。
Tien 认为开源也关乎社区贡献。Mattermost 开源项目有超过 4000 名个人贡献者,他们贡献了超过 30000 行代码。
以前Mattermost 依赖集成第三方呼叫服务(例如 Zoom来启用语音呼叫功能。在 7.0 版本中,它通过开源 WebRTC 协议引入了呼叫功能的直接集成,所有现代 Web 浏览器都支持该协议。直接集成呼叫功能的目标是为写作提供单一平台,这符合 Tien 对该平台的总体愿景。现在,除了提供集成工具以实现协作之外,该平台还会增加“工作流模板”功能,以帮助(用户)组织构建可重复的流程。
工作流概念采用了 <ruby>剧本<rt>playbooks</rt></ruby>,其中包含了为“特定类型的操作”所执行的动作和操作的清单。例如,在发生服务故障或网络安全事件时,公司可以为事件响应创建工作流模板。
这个清单可以链接到 Mattermost 操作例如让特定用户发起呼叫并协助生成报告。Tien 表示Mattermost 还与常见的开发者工具集成,并且工作流模板的功能将随着时间的推移而扩展,以便使用第三方工具来实现更多自动化。
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/06/mattermost-extends-workflow-platform-with-7-0-release/
作者:[Laveesh Kocher][a]
选题:[lkxed][b]
译者:[lkxed](https://github.com/lkxed)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/laveesh-kocher/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/marttermost-e1655377462300.jpeg

View File

@ -0,0 +1,93 @@
[#]: collector: (lujun9972)
[#]: translator: (Donkey)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (10 ways Ansible is for everyone)
[#]: via: (https://opensource.com/article/21/1/ansible)
[#]: author: (James Farrell https://opensource.com/users/jamesf)
Ansible 适合所有人的 10 种方式
======
通过 2020 年的前 10 篇 Ansible 文章和 5 篇新闻摘要扩展你的知识和技能。
![gears and lightbulb to represent innovation][1]
又到了一年的年末,我们再次来到 Opensource.com 上发表了一组关于 Ansible 的精彩文章。我认为在逐步推进一系列主题中回顾它们会很好。我希望能够激励对 Ansible 有兴趣的初学者。还有一系列总结文章,我已将其包括在内,以供你随意后续查阅。
### 适合初学者的 Ansible
今年列表中的前五篇文章对于 Ansible 新手来说是一个非常好的起点。前三篇文章由 Opensource.com 编辑 Seth Kenlon 撰写。
* 如果你不了解 Ansible [_现在可以做这 7 件事_][2] 来入手。这是很好的入门指导,它收集了用于管理硬件、云、容器等的链接。
* 在 [_编排与自动化有何区别_][3] 这篇文章中,你会学到一些术语和技术路线,将会激发你对 Ansible 感兴趣。
* 文章 [_如何用 Ansible 安装软件_][4] 覆盖了一些初级概念和一些 Ansible 的好习惯,给出了一些本地或远程管理软件包的案例。
* 从 [_我在编写 Ansible Playbooks 时学到的 3 堂课_][5] 中,使自己养成 Jeff Geerling 所传授的好习惯,他是一位真正的 Ansible 资深人士。 源代码控制、文档、测试、简化和优化是自动化成功的关键。
* [_我使用 Ansible 的第一天_][6] 介绍了记者 David Both 在解决重复性开发任务时的思考过程。这篇文章从 Ansible 的基础开始,并说明了一些简单的操作和任务。
### 尝试 Ansible 项目
一旦你掌握了基础和并拥有良好习惯,就可以开始一些具体主题和实例了。
* Ken Fallon 在 [_使用 Ansible 管理你的 Raspberry Pi fleet_][7] 一文中介绍了一个部署和管理 RPi 单元的示例。它介绍了受限环境中的安全和维护概念。
* 在 [_将你的日历与 Ansible 融合以避免日程冲突_][8] 文章中, Nicolas Leiva 快速介绍了如何使用前置任务和条件在自动日程安排中中强制执行隔离窗口
* Nicolas 在 [_创建一个融合你的谷歌日历的 Ansible 模块_][9] 中完成了他的日历隔离的理念。他的文章深入探讨了在 Go 中编写自定义 Ansible 模块以实现所需的日历连接。 Nicolas 介绍了构建和调用 Go 程序并将所需数据传递给 Ansible 并接收所需输出的不同方法。
### 提升你的 Ansible 技巧
Kubernetes 是近来的热门话题,以下文章提供了一些很好的示例来学习新技能。
* 在 [_适用于 Kubernets 自动编排你的 Ansible 模块_][10] 文章中, Seth Kenlon 介绍了 Ansible Kubernetes 模块, 介绍了用于测试的基本 Minikube 安装,并提供了一些用于 pod 控制的“k8s”模块的基本示例。
* Jeff Geerling 在 [_使用 Ansible 的 Helm 模块构建 Kubernetes Minecraft 服务器_][11] 中解释了 Helm Chart 应用程序、Ansible 集合以及执行一个有趣的项目以在 k8s 集群中设置您自己的 Minecraft 服务器的概念。
### 其他 Ansible 新闻
几年, Mark Phillips 写了 “网络上的 Ansible” 这一系列文章,覆盖许多 Ansible 主题。它们包含指向有趣的 Ansible 开发的链接,范围从基本指导、模块编写、 Kubernetes 、视频演示到 Ansible 社区新闻。所有有兴趣和任何水平的人都可以查看一下,有很高的参考价值!
* [_容器网络安全以及更多 Ansible 新闻_][12]
* [_CI/CD 管道和 Windows 用户的提示,以及更多 Ansible 新闻_][13]
* [_馆藏标志着Ansible生态系统的重大转变以及更多Ansible新闻_][14]
* [_Jeff Geerling 的 Ansible 101 视频,以及更多 Ansible 新闻_][15]
* [_初学者指南、Windows、网络和更多 Ansible 新闻_][16]
### 2021 快乐!
我希望你的 Ansible 旅程已经开始,并能常从 Opensource.com 中的文章充实自己。在评论中告诉我们接下来你可能从哪方面了解 Ansible ,如果你想分享一些信息,请考虑在 Opensource.com 上 [写一篇文章][17] 。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/1/ansible
作者:[James Farrell][a]
选题:[lujun9972][b]
译者:[Donkey](https://github.comDonkey-Hao)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jamesf
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M (gears and lightbulb to represent innovation)
[2]: https://opensource.com/article/20/9/ansible
[3]: https://opensource.com/article/20/11/orchestration-vs-automation
[4]: https://opensource.com/article/20/9/install-packages-ansible
[5]: https://opensource.com/article/20/1/ansible-playbooks-lessons
[6]: https://opensource.com/article/20/10/first-day-ansible
[7]: https://opensource.com/article/20/9/raspberry-pi-ansible
[8]: https://opensource.com/article/20/10/calendar-ansible
[9]: https://opensource.com/article/20/10/ansible-module-go
[10]: https://opensource.com/article/20/9/ansible-modules-kubernetes
[11]: https://opensource.com/article/20/10/kubernetes-minecraft-ansible
[12]: https://opensource.com/article/20/1/ansible-news-edition-six
[13]: https://opensource.com/article/20/2/ansible-news-edition-seven
[14]: https://opensource.com/article/20/3/ansible-news-edition-eight
[15]: https://opensource.com/article/20/4/ansible-news-edition-nine
[16]: https://opensource.com/article/20/5/ansible-news-edition-ten
[17]: https://opensource.com/how-submit-article

View File

@ -0,0 +1,243 @@
[#]: collector: (lujun9972)
[#]: translator: (lkxed)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Docker Compose: a nice way to set up a dev environment)
[#]: via: (https://jvns.ca/blog/2021/01/04/docker-compose-is-nice/)
[#]: author: (Julia Evans https://jvns.ca/)
Docker Compose搭建开发环境的好办法
======
大家好!我又写了一篇关于 [我最喜欢的电脑工具][1] 的文章。这一篇讲的是 Docker Compose
这篇文章主要就是讲一讲我对 Docker Compose 有多么满意啦(不讨论它的缺点)!咳咳,因为它总能够完成它该做的,并且似乎总能奏效,更棒的是,它使用起来还非常简单。另外,在本文中,我只讨论我是怎么用 Docker Compose 来搭建开发环境的,而不涉及它在生产中的使用。
最近,我考虑了很多关于这种搭建个人开发环境的方式,原因是,我现在把所有的计算工作都搬到了一个私有云上,大概 20 美元/月的样子。这样一来,我就不用在工作的时候花时间去思考应该如何管理几千台 AWS 服务器了。
在此之前我曾花了两天的时间尝试使用其他的工具来尝试搭建一个开发环境搭到后面我实在是心累了。相比起来Docker Compose 就简单易用多了,我非常满意。于是,我和妹妹分享了我的 `docker-compose` 使用经历,她略显惊讶:“是吧!你也觉得 Docker Compose 真棒对吧!” 嗯,我觉得我应该写一篇博文把过程记录下来,于是就有了你们看到的这篇文章。
### 我们的目标是:搭建一个开发环境
目前,我正在编写一个 Ruby on Rails 服务(它是一个计算机“调试”游戏的后端)。在我的生产服务器上,我安装了:
* 一个 Nginx 服务器
* 一个 Rails 服务
* 一个 Go 服务 (使用了 [gotty][2] 来代理一些 SSH 连接)
* 一个 Postgres 数据库
在本地搭建 Rails 服务非常简单,用不着容器(我只需要安装 Postgres 和 Ruby 就行了,小菜一碟)。但是,我还想要把匹配 `/proxy/*` 的请求的发送到 Go 服务,其他所有请求都发送到 Rails 服务,所以我还要用到 Nginx。问题来了在笔记本电脑上安装 Nginx 对我来说太麻烦了。
是时候使用 `docker-compose` 了!
### docker-compose 允许你运行一组 Docker 容器
基本上Docker Compose 的作用就是允许你运行一组可以互相通信 Docker 容器。
你可以在一个叫做 `docker-compose.yml` 的文件中,配置你所有的容器。下面,我将贴上我为这个服务编写的 `docker-compose.yml` 文件(的全部内容),因为我觉得它真的很简洁、直接!
```
version: "3.3"
services:
db:
image: postgres
volumes:
- ./tmp/db:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: password # yes I set the password to 'password'
go_server:
# todo: use a smaller image at some point, we don't need all of ubuntu to run a static go binary
image: ubuntu
command: /app/go_proxy/server
volumes:
- .:/app
rails_server:
build: docker/rails
command: bash -c "rm -f tmp/pids/server.pid && source secrets.sh && bundle exec rails s -p 3000 -b '0.0.0.0'"
volumes:
- .:/app
web:
build: docker/nginx
ports:
- "8777:80" # this exposes port 8777 on my laptop
```
这个配置包含了两种容器。对于前面两个容器,我不加修改地使用了既有的镜像(`image: postgres` 和 `image: ubuntu`)。对于后面两个,我不得不构建一个自定义容器镜像,其中, `build: docker/rails` 的作用就是告诉 Docker Compose它应该使用 `docker/rails/Dockerfile` 来构建一个自定义容器。
我需要允许我的 Rails 服务访问一些 API 密钥和其他东西,因此,我使用了 `source secrets.sh`,它的作用就是在环境变量中预设一组密钥。
### 如何启动所有服务:先 “build” 后 “up”
我一直都是先运行 `docker-compose build` 来构建容器,然后再运行 `docker-compose up` 把所有服务启动起来。
你可以在 yaml 文件中设置 `depends_on`,这样你可以获得更多容器启动时的控制。不过,对于我的这些服务而言,启动顺序并不重要,所以我没有设置它。
### 使用网络通信也非常简单
有件很重要的事容器之间得能够互相连接才行。Docker Compose 让这件事变得超级简单!假设我有一个 Rails 服务正在名为 `rails_server` 的容器中运行,端口是 3000那么我就可以通过 `http://rails_server:3000` 来访问该服务。就是这么简单!
以下代码片段截取自我的 Nginx 配置文件,它是根据我的使用需求配置的(我删除了许多 `proxy_set_headers` 行,让它看起来更清楚):
```
location ~ /proxy.* {
proxy_pass http://go_server:8080;
}
location @app {
proxy_pass http://rails_server:3000;
}
```
或者,你也看下面这个代码片段,它截取自我的 Rails 项目的数据库配置,我在其中使用了数据库容器的名称(`db`
```
development:
<<: *default
database: myproject_development
host: db # <-------- 它会被神奇地解析为数据库容器的 IP 地址
username: postgres
password: password
```
至于 `rails_server` 究竟是如何被解析成一个 IP 地址的,我还真有点儿好奇。貌似是 Docker 在我的计算机上运行了一个 DNS 服务来解析这些名字。下面是一些 DNS 查询记录,我们可以看到,每个容器都有它自己的 IP 地址:
```
$ dig +short @127.0.0.11 rails_server
172.18.0.2
$ dig +short @127.0.0.11 db
172.18.0.3
$ dig +short @127.0.0.11 web
172.18.0.4
$ dig +short @127.0.0.11 go_server
172.18.0.5
```
### 是谁在运行这个 DNS 服务?
我(稍微)研究了一下这个 DNS 服务是怎么搭建起来的。
以下所有命令都是在容器外执行的,因为我没有在容器里安装很多网络工具。
**第一步:**:使用 `ps aux | grep puma`,找到我的 Rails 服务的进程 ID。
找到了,它是 `1837916`!感觉不错哦~
**第二步:**:找到和 `1837916` 运行在同一个网络命名空间的 UDP 服务。
我使用了 `nsenter` 来在 `puma` 进程的网络命令空间内运行 `netstat`(理论上,我猜想你也可以使用 `netstat -tupn` 来只显示 UDP 服务,但此时,我的手指头只会打出 `netstat -tulpn`)。
```
$ sudo nsenter -n -t 1837916 netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.11:32847 0.0.0.0:* LISTEN 1333/dockerd
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN 1837916/puma 4.3.7
udp 0 0 127.0.0.11:59426 0.0.0.0:* 1333/dockerd
```
我们可以看到,此时有一个运行在 `59426` 端口的 UDP 服务,它是由 `dockerd` 运行的!或许它就是我们要找的 DNS 服务?
**第三步**:确定它是不是我们要找的 DNS 服务
我们可以使用 `dig` 工具来向它发送一个 DNS 查询:
```
$ sudo nsenter -n -t 1837916 dig +short @127.0.0.11 59426 rails_server
172.18.0.2
```
奇怪,我们之前运行 `dig` 的时候DNS 查询怎么没有发送到 `59426` 端口,而是发送到了 `53` 端口呢?这到底是怎么回事呀?
**第四步**iptables
对于类似“这个服务似乎正运行在 X 端口上,但我却在 Y 端口上访问到了它,这是什么回事呢?”的问题,我的第一念头都是“一定是 iptables 在作怪”。
于是,我运行了容器的网络命令空间内运行了 `iptables-save`,果不其然,真相大白:
```
$ sudo nsenter -n -t 1837916 iptables-save
.... redacted a bunch of output ....
-A DOCKER_POSTROUTING -s 127.0.0.11/32 -p udp -m udp --sport 59426 -j SNAT --to-source :53
COMMIT
```
在输出中有一条 iptables 规则,它将 `53` 端口的流量发送到了 `59426` 上。哈哈,真有意思!
### 数据库文件储存在一个临时目录中
这样做有一个好处:我可以直接挂载 Postgres 容器的数据目录 `./tmp/db`,而不需要在我的笔记本电脑上管理 Postgres 环境。
我很喜欢这种方式,因为我真的不想在笔记本电脑上,亲自管理一个 Postgres 环境(我也真的不知道该如何配置 Postgres。还有就是出于习惯我更喜欢让开发环境的数据库和代码放在同一个目录下。
### 仅需一行命令,我就可以访问 Rails 控制台
管理 Ruby 的版本总是有点棘手,并且,即使我暂时搞定了它,我也总是有点担心自己会把 Ruby 环境搞坏,然后就要修它修个十年(夸张)。
(使用 Docker Compose搭建好这个开发环境后如果我需要访问 Rails <ruby>控制台<rt>console</rt></ruby>(一个交互式环境,加载了所有我的 Rails 代码),我只需要运行一行代码即可:
```
$ docker-compose exec rails_server rails console
Running via Spring preloader in process 597
Loading development environment (Rails 6.0.3.4)
irb(main):001:0>
```
好耶!
### 小问题Rails 控制台的历史记录丢失了
我碰到了一个问题Rails 控制台的历史记录丢失了,因为我一直在不断地重启它。
不过,我也找到了一个相当简单的解决方案(嘿嘿):我往容器中添加了一个 `/root/.irbrc` 文件,它能够把 IRB 历史记录文件的保存位置,修改到一个不受容器重启影响的地方。只需要一行代码就够啦:
```
IRB.conf[:HISTORY_FILE] = "/app/tmp/irb_history"
```
### 我还是不知道它在生产环境的表现会怎么样
到目前为止,这个项目的生产环境搭建进度,还停留在“我制作了一个 digitalocean dropletLCCT 译注:一种 Linux 虚拟机服务),并手工编辑了很多文件”的阶段。
嗯……我相信我以后会在生产环境中使用 docker-compose 来运行一下它的。我猜它能够会正常工作,因为这个服务很可能最多只有两个用户在使用,并且,如果我愿意,我可以容忍它在部署过程中有 60 秒的不可用时间。不过话又说回来,出错的往往是我想不到的地方。
推特网友提供了一些在生产中使用 docker-compose 的注意事项:
* `docker-compose up` 只会重启那些需要重启的容器,这会让重启速度更快。
* 有一个 Bash 小脚本 [wait-for-it][3],你可以用它来让一个容器保持等待,直到另一个容器的服务可用。
* 你可以准备两份 `docker-compose.yaml` 文件:用于开发环境的 `docker-compose.yaml` 和 用于生产环境的 `docker-compose-prod.yaml`。我想我会在分别为 Nginx 指定不同的端口:开发时使用 `8999`,生产中使用 `80`
* 人们似乎一致认为,如果你的项目是一台计算机上运行的小网站,那么 docker-compose 在生产中不会有问题。
* 有个人建议说如果愿意在生产环境搭建复杂那么一丢丢Docker Swarm 就或许会是更好的选择,不过我还没试过(当然,如果要这么说的话,干嘛不用 Kubernetes 呢Docker Compose 的意义就是它超级简单,而 Kubernetes 肯定不简单 :))。
Docker 似乎还有一个特性,它能够 [把你用 docker-compose 搭建的环境自动推送到弹性容器服务ESC上][4],听上去好酷的样子,但是我还没有试过。
### docker-compose 会有不适用的场景吗
我听说 docker-compose 在以下场景的表现差强人意:
* 当你有很多微服务的时候(还是自己搭建比较好)
* 当你尝试从一个很大的数据库中导入数据时(就像把几百 G 的数据存到每个人的笔记本电脑里一样)
* 当你在 Mac 电脑上运行 Docker 时。我听说 Docker 在 macOS 上比在 Linux 上要慢很多(我猜想是因为它需要做额外的虚拟化)。我没有 Mac 电脑,所以我还没有碰到这个问题。
### 以上就是全部内容啦!
在此之前,我曾花了一整天时间,尝试使用 Puppet 来配置 Vagrant 虚拟机,然后在这个虚拟机里配置开发环境。结果,我发现虚拟机启动起来实在是有点慢啊,还有就是,我也不喜欢编写 Puppet 配置(哈哈,没想到吧)。
幸好,我尝试了 Docker Compose它真好简单马上就可以开始工作啦
--------------------------------------------------------------------------------
via: https://jvns.ca/blog/2021/01/04/docker-compose-is-nice/
作者:[Julia Evans][a]
选题:[lujun9972][b]
译者:[lkxed](https://github.com/lkxed)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://jvns.ca/
[b]: https://github.com/lujun9972
[1]: https://jvns.ca/#cool-computer-tools---features---ideas
[2]: https://github.com/yudai/gotty/
[3]: https://github.com/vishnubob/wait-for-it
[4]: https://docs.docker.com/cloud/ecs-integration/

View File

@ -0,0 +1,94 @@
[#]: collector: (lujun9972)
[#]: translator: (godgithubf)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (3 ways to play video games on Linux)
[#]: via: (https://opensource.com/article/21/2/linux-gaming)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
三种在Linux系统上玩视频游戏的方式
======
如果你准备好下载游戏并且全方位体验游戏的话,那么在 linux 下启动游戏吧!
![Gaming with penguin pawns][1]
从 2021 年以后,人们有更多喜欢 Linux 的理由。在这个系列里,我将分享 21 个使用 Linux 的理由。今天,我将从游戏开始。
我过去认为电脑游戏者是一种特殊的人群要被研究人员在数年的研究和测试之后严谨地认定。我从来没有把我自己归为电脑游戏者因为我所玩过的游戏既不是桌面游戏棋类游戏和纸笔角色扮演游戏也不是探险游戏和俄罗斯方块。现在这些游戏可以在移动设备、控制台、电脑和电视机等各种环境上玩。好像该是时候承认游戏者可以以形形色色的方式参与进来。如果你想自称为游戏者你就可以不需任何资格认定。你不必记得有科乐美等类似的游戏公司。你不必购买和玩3A级的游戏只要你时常玩游戏你就完全可以自称为游戏者。如果你想成为一个游戏者现在使用 Linux 正当其时。
### 欢迎到圈子里
剥除排行榜上闪闪发光的广告及背后的东西,你肯定会发现一个欣欣向荣的游戏世界。在任何人相信既不是电子表格也不是练习打字一类的软件能挣钱以前新兴的游戏市场已经开始发展起来了。非主流的游戏已经在流行文化上以各种方式打上了自己的烙印(信不信由你,《我的世界》尽管不是开源的,作为独立制作的游戏已经发展起来了),这也证实了,在玩家眼里,游戏先于产品价值。
在独立制作和开源开发者之间有很多交叉的地方。
有各种各样的开源游戏可玩,包括大量的第一视角射击游戏,益智游戏像 Nodulus ,策略经营游戏像运输大亨,竞速游戏向 Jethook ,减压游戏像 Sauerbraten ,等等还有很多未提到的(多亏了像 Open Jam 这样伟大的倡议,每年都有新增的游戏)
![Jethook game screenshot][10]
总的来说探索开源游戏的世界的体验和主流游戏工作室的产品带来的即时的满足是很不同的。大的游戏工作室生产的游戏提供大量的视觉和听觉刺激知名演员和多达60小时的游戏。独立和开源游戏不可能和它匹敌。但是主流游戏工作室无法达到的是当你发现一款别人未曾听说过的游戏时的产生的发现和个人连接的感受。主流工作室不希望当你认识到世界上的的每个人都非常需要知道你刚玩过的那个游戏所获取的那种感受。这样翻译真别扭
花点时间找出你最喜欢的游戏,然后浏览下你的发行商的软件仓库,打开开源游戏仓库,看下哪个是发行商没有覆盖到的,如果你足够喜欢的游戏,帮忙推广一下吧。
### Proton and WINE
Linux 上的游戏不止于开源但是从开源开始的。数年前Valve软件公司通过发行 Steam 客户端的 Linux 版把 Linux 带入游戏市场,希望是能够强制游戏工作室能在 Linux 系统上写本地代码。一些工作室这样做了,但 Valve 公司并没有成功的把 Linux 推为主要的平台,即使是 Valve 品牌的游戏电脑。并且大多数游戏工作室又转回仅在 windows 平台上开发游戏的旧方式。
有趣的是,最终的结果是有更多的开源代码被生产出来。 Valve 公司为 Linux 兼容创建了 Proton 工程,一个可以转换 windows 系统游戏到 Linux 的兼容层。在 Proton 的内核层面它使用了WINEWINE不是模拟器好的令人难以置信的是重新实现的主要 windows 库是开源的。
游戏市场的打破结果成为了开源世界的宝藏。今天,来自主流工作室的大多数游戏都可以在 Linux 上运行就好像他们在 windows 上运行一样。
当然如果你是必须要有最新版的游戏的这类玩家你可定会遇到令人不愉快的惊喜。尽管那不是惊喜很少有主流的游戏发行时毫无漏洞那需要一周后大量的补丁。这些漏洞在Proton和WINE上更糟糕因此 Linux 游戏者经常从使用早期版本中获益。这种妥协可能是值得的。我玩过一些游戏,它们在 Proton 平台运行完美,后来从愤怒的论坛邮件中发现它在最新版的 windows 上运行有明显的谜一般的致命错误。总之,似乎来自主流工作室的游戏并不完美,但你可能在 Linux 上遇到相似但不同的问题正如你在 windows 上遇到的。
### Flatpak
最近 Linux 历史上最令人激动的发展就是 Flatpak 了,跨越了本地容器和包,它和游戏无关(或者它和游戏息息相关),它使得 Linux 应用能基本上被分发到任意的 Linux 发行版上。这也适用游戏,因为有相当多次要的技术在游戏中使用。并且它可以很好地对给定的游戏要求发行维护者来保持和所有最新版要求一致
Flapak 从发行中为应用库抽象出一种公共的 Flatpak 特定的层。Flatpak 的发行者知道 如果一个库不在 Flatpak SDK 中,那么它必须要包含在 Flatpak 中,简单而直接。
多亏了 Flatpak Steam 客户端可以运行在一些像 Fedora, RHEL, Slackware 等从传统角度看并不面向游戏市场的操作系统
### Lutris
如果你不渴望注册 steam 账号,那么可以用我比较偏爱的游戏客户端 Lutris 。表面上看Lutris 是一个简单的游戏启动器当你想玩游戏但还没决定玩什么的时候你可以去的地方。有了Lutris你可以添加你系统上的所有游戏到你的游戏库然后从 Lutris 界面启动并立即玩起来。更好的是Lutris 贡献者(像我一样),可以正常的发布安装脚本来使安装你拥有的游戏变得容易。这并不是必须的,但它可以是一个很好的捷径来免除乏味的配置。
Lutris 也可以支持运行者或者子系统来运行那些不能从应用菜单直接启动的游戏。比如你想玩控制台游戏像开源的魔兽争霸,你必须运行模拟器。如果你已经安装过模拟器的话, Lutris 可以帮你处理。除此以外,如果你有一些老旧的游戏账号, Lutris 可以访问它,并可以把游戏导入你的游戏库中。
没有比 Lutris 更容易的方式来管理你的游戏了。
### 玩游戏
Linux 游戏是一个充实且给人力量的体验。我过去避免玩电脑游戏因为我没有觉得我有很多的选择。似乎有很多昂贵的游戏在发行并且不可避免的获得好或者不好的体验,然后很快有转向下一个。另一方面,开源游戏把我引入了游戏的王国。我见到过其他玩家和开发者。我见到过艺术家和音乐家,粉丝以及发起人。我玩过各种各样的游戏但我从来都没认识到他们的确存在过。他们仅仅够我玩一下午,然而其他的却让我长久的着迷于游戏,改进,关卡设计和乐趣。
如果你准备好来从各个角度体验下游戏的话,在 Linux 上开始游戏吧。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/2/linux-gaming
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/godgithubf)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gaming_grid_penguin.png?itok=7Fv83mHR (Gaming with penguin pawns)
[2]: https://opensource.com/alternatives/minecraft
[3]: https://itch.io/jam/open-jam-2020
[4]: https://opensource.com/article/20/5/open-source-fps-games
[5]: https://hyperparticle.itch.io/nodulus
[6]: https://www.openttd.org/
[7]: https://rcorre.itch.io/jethook
[8]: http://sauerbraten.org/
[9]: https://opensource.com/article/18/9/open-jam-announcement
[10]: https://opensource.com/sites/default/files/game_0.png
[11]: http://flathub.org
[12]: https://github.com/ValveSoftware/Proton
[13]: http://winehq.org
[14]: https://opensource.com/business/16/8/flatpak
[15]: https://www.redhat.com/en/enterprise-linux-8
[16]: http://lutris.net
[17]: https://opensource.com/article/18/10/lutris-open-gaming-platform
[18]: https://ndswtd.wordpress.com/download

View File

@ -0,0 +1,71 @@
[#]: subject: (Get started with Kubernetes using chaos engineering)
[#]: via: (https://opensource.com/article/21/5/kubernetes-chaos)
[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb)
[#]: collector: (lujun9972)
[#]: translator: (Donkey)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
在混沌工程中开始使用 Kubernetes
======
在庆祝 Kubernetes 11 岁生日的系列文章中的第一篇文章中学习混沌工程的基础知识。
![Scrabble letters spell out chaos for chaos engineering][1]
Kubernetes 快 11 岁了,我打算通过给你一些会引起混沌的开源工具来庆祝它的生日。混沌工程是科学、规划以及实验的学科。它在系统上进行训练,来建立系统在生产中承受混乱条件能力的信心的学科。
在我给你礼物前,我会在文章导论部分解释混沌系统如何工作。
### 如何开始学习混沌系统呢?
以我的经验,开始学习混沌系统的最好方式是触发一个此前生产中出现的事件来进行实验。使用过去的数据,制定以相同的方式破坏你的系统的计划,然后建立修复策略并确认结果确实是你想要的。如果计划失败,你就有了一种新的实验方式,并朝着快速处理问题的新方式前进。
最重要的是,你可以随时记录所有内容,这意味着,随着时间的推移,整个系统将被完整记录下以便任何人都可以随时待命而无需太多升级,并且每个人都可以在周末好好休息。
### 你在混沌工程中做什么?
混沌系统实验运行背后有一些科学依据。我已经记录了步骤:
1. **定义一个稳定状态:** 使用监控工具来搜集当系统没有问题或事件时,看起来功能正常的数据。
2. **提出假设或使用先前的事件:** 现在你已经定义了一个稳定状态,请提出一个关于在事件或中断期间会发生(或已经发生)的情况的假设。用这个假设来得出一系列将会发生的事件以及如何解决问题的理论。然后你可以指定一个故意引起该问题的计划。
3. **介绍问题:** 用既定计划来破坏你的系统并开始在真实环境中测试。收集损坏的指标状态,按计划修复,并跟踪在你达到解决方案之前需要多长时间。确保你为之后中断记录了任何事情。
4. **试图推翻你的假设:** 实验中最精彩的部分是尝试推翻你的思考或计划。你想创建一个不同的状态,看看你能走多远,并在系统中生成一个不同的稳定状态。
当你在另一个系统中生成破坏的变量前,确保建立一个处于稳定状态的控制系统。这将使你更容易在实验前、期间和之后发现各种稳态的差异。
### 混沌工程需要什么?
这有一些初学混沌工程很好的工具:
* 良好的记录习惯
* 一个捕捉你系统是否处于稳定状态的监控系统
* Grafana
* Prometheus
* 混沌工程工具:
* Chaos mesh
* Litmus
* 之后的文章我会介绍更多
* 一个假设
* 一个计划
### 去搞破坏吧
现在你已经掌握了基础,是时候去安全的摧毁你的系统了。我计划每年造成四次混乱,并努力实现每月的破坏。
混沌工程是一种很好的实践,也是使你的内部文档保持最新的好方法。此外,随着时间的推移,新升级或应用程序部署将更加顺畅,你的日常生活将通过 Kubernetes 管理变得更加轻松。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/5/kubernetes-chaos
作者:[Jessica Cherry][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/Donkey-Hao)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/cherrybomb
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brett-jordan-chaos-unsplash.jpg?itok=sApp5dVd (Scrabble letters spell out chaos for chaos engineering)

View File

@ -0,0 +1,191 @@
[#]: subject: "Install Specific Package Version With Apt Command in Ubuntu"
[#]: via: "https://itsfoss.com/apt-install-specific-version-2/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lkxed"
[#]: translator: "robsean"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
在 Ubuntu 中使用 apt 命令来安装具体指定的软件包版本
======
在 Ubuntu 中想安装一个软件包的一个具体指定的软件包版本?你可以通过下面的方式来轻松地完成:
```
sudo apt install package_name=package_version
```
你如何知道某个软件包有哪些可用的版本?使用这个命令:
```
apt list --all-versions package_name
```
在下面的屏幕截屏中,你可以看到,我有两个可用的 VLC 版本,我使用命令来安装较旧的版本:
![install specific versions apt ubuntu][1]
听起来像一个简单的任务,对吧?但是事情并非看起来那么简单。这里有一些不确定是否会出现,但是可能会涉及的东西。
这篇教程将涵盖使用 apt 或 apt-get 命令来安装一个具体指定的程序的版本的所有的重要的方面。
### 关于安装一个具体指定版本的程序而所需要知道的事
在基于 Ubuntu 和 Debian 发行版中,你需要知道一些关于 APT 和 存储库 是如何工作的知识
#### 同一个的软件包源没有较旧的版本
Ubuntu 在其存储库中不保留较旧版本的软件包。在特殊的情况下,你可以暂时性地看到多个版本。例如,你运行 apt 更新 (但不升级),那么会用一个可用的新的版本。在 apt 缓存中,你可以看到同一个软件包的两个版本。但是,一旦软件包被升级到了新的版本,较旧版本的软件包将从 **apt 缓存** 和 存储库 中移除。
#### 使用多个软件包源来使用不同的版本
为获取同一个的软件包的多个版本你将必需条件多个软件包源。例如VLC 是版本 3.x 系列。添加 [VLC 每日构建 PPA][2] 将会提供 (不稳定是) 版本 4.x 系列。
同样,**你可以下载不同版本的 DEB 文件,并安装它**。
#### 较高版本编号的版本通常获取优先权
如果你有来自多个软件包源的相同名称的软件默认情况下Ubuntu 将安装可用的最高版本编号的版本。
在前面的示例中,如果我安装 VLC ,那么它将会安装 4.x 系列的版本,而不是 3.x 系列的版本。
#### 较旧版本将升级到可用的较新版本
这是另外一个可能存在的问题。即使你安装较旧版本的软件包,它也会升级到较新的版本 (如果存在可用的较新的版本)。你必须 [监禁软件包来防止其升级][3] 。
#### 依赖关系也需要安装
如果软件包有依赖关系,你也需要安装必要的依赖关系软件包版本。
现在,你已经知道一些可能存在的问题,让我们看看如何解决它们。
### 安装一个软件包的具体指定版本
在这篇教程中,我将以 VLC 为例。在 Ubuntu 的存储库中可获得 VLC 版本。我添加了每日构建 PPA ,它将向我提供 VLC 的 4.0 版本的候选版本。
如你所见,在现在的系统中,我有两个可用的 VLC 版本:
![install specific versions apt ubuntu][4]
```
[email protected]:~$ apt list -a vlc
Listing... Done
vlc/jammy 4.0.0~rc1~~git20220516+r92284+296~ubuntu22.04.1 amd64
vlc/jammy 3.0.16-1build7 amd64
vlc/jammy 3.0.16-1build7 i386
```
因为较高版本编号版本获取优先权,使用 apt install vlc 命令将会导致安装 VLC 的 4.0 版本。但是,因为这篇教程的缘由,我想安装较旧的版本 3.0.16 。
```
sudo apt install vlc=3.0.16-1build7
```
但是这里会有这样的事。vlc 软件包有一些依赖关系,并且这些依赖关系也需要具体指定的版本。因此,在 Ubuntu 为其尝试安装最新的版本时,你将会遇到经典的 [<ruby>你已持有残缺软件包<rt>you have held broken packages</rt></ruby>][5] 错误。
![problem installing specific version apt ubuntu][6]
为修复这个错误,你需要为其提供它所投诉的所有依赖关系的软件包的具体指定版本。因此,该命令会变成这样:
```
sudo apt install vlc=3.0.16-1build7 \
vlc-bin=3.0.16-1build7 \
vlc-plugin-base=3.0.16-1build7 \
vlc-plugin-qt=3.0.16-1build7 \
vlc-plugin-video-output=3.0.16-1build7 \
vlc-l10n=3.0.16-1build7 \
vlc-plugin-access-extra=3.0.16-1build7 \
vlc-plugin-notify=3.0.16-1build7 \
vlc-plugin-samba=3.0.16-1build7 \
vlc-plugin-skins2=3.0.16-1build7 \
vlc-plugin-video-splitter=3.0.16-1build7 \
vlc-plugin-visualization=3.0.16-1build7
```
以免你瞎琢磨,每行结尾处的 \ 只是用来将多行命令来写入同一个命令的一种方式。
**它有作用吗?在很多情况下,它是有作用的。** 但是,我选择了一个复杂的 VLC 示例,它有很多依赖关系。甚至这些所涉及的依赖关系也依赖于其它的软件包。所以,它就变得令人难以处理。
一种可选的方法是在安装时指定软件包源。
#### 可选,指定存储库软件包源
你已经添加多个软件包源,因此,你应该对这些软件包的来源有一些了解。
使用下面的命令来搜索存储库:
```
apt-cache policy | less
```
聚焦于存储库名称后面的行:
```
500 http://security.ubuntu.com/ubuntu jammy-security/multiverse i386 Packages
release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=multiverse,b=i386
origin security.ubuntu.com
```
你可以具体指定 o、l、a 等参数。
在我原来的示例中,我想安装来自 Ubuntu 存储库的 VLC (获取版本 3.16) ,而不是安装来 PPA 的版本 (它将向我提供版本 4)。
因此,下面的命令将安装 VLC 版本 3.16 及其所有的依赖关系:
```
sudo apt install -t "o=ubuntu" vlc
```
![install from repository source][7]
看起来令人满意?但是,当你必须更新系统时,问题就来了。它接下来会控诉找不到指定的软件包版本。
**还能做什么?**
为安装较旧的软件包版本,从你的系统中移除较新版本的软件包源 (如果可能的话)。它将有助于逃脱这些依赖关系的地狱。
如果不能这么做,检查你是否可以从其它一些打包软件包的格式来获取,像 Snap、Flatpak、AppImage 等等。事实上Snap 和 Flatpak 也允许你从可用的版本中选择和安装。因为这些应用程序是沙盒模式的,所以它很容易管理不同版本的依赖关系。
#### 保留软件包,防止升级
如果你完成安装一个指定的程序版本,你可能想避免意外地升级到较新的版本。实现这一点并不太复杂。
```
sudo apt-mark hold package_name
```
你可以移除保留软件包,以便它能稍后升级:
```
sudo apt-mark unhold package_name
```
注意,软件包的依赖关系不会自动地保持。它们需要单独地提及。
### 结论
如你所见,这里有一条安装选定软件包版本的条文。只要软件包有依赖关系,那么事情就会变得复杂。接下来,你将进入依赖关系的地狱。
我希望你在这篇教程中学到一些新的东西。如果你有问题或建议来改善它,请在评论区告诉我。
--------------------------------------------------------------------------------
via: https://itsfoss.com/apt-install-specific-version-2/
作者:[Abhishek Prakash][a]
选题:[lkxed][b]
译者:[robsean](https://github.com/robsean)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/wp-content/uploads/2022/05/install-specific-versions-apt-ubuntu.png
[2]: https://launchpad.net/~videolan/+archive/ubuntu/master-daily
[3]: https://itsfoss.com/prevent-package-update-ubuntu/
[4]: https://itsfoss.com/wp-content/uploads/2022/05/install-specific-versions-apt-ubuntu.png
[5]: https://itsfoss.com/held-broken-packages-error/
[6]: https://itsfoss.com/wp-content/uploads/2022/05/problem-installing-specific-version-apt-ubuntu-800x365.png
[7]: https://itsfoss.com/wp-content/uploads/2022/05/install-from-repository-source-800x578.png

View File

@ -0,0 +1,91 @@
[#]: subject: "How I gave my old laptop new life with the Linux Xfce desktop"
[#]: via: "https://opensource.com/article/22/6/linux-xfce-old-laptop"
[#]: author: "Jim Hall https://opensource.com/users/jim-hall"
[#]: collector: "lkxed"
[#]: translator: "lightchaserhy"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
我如何利用 Linux Xface 桌面赋予旧电脑新生命
======
当我为了一场会议的样例演示,用笔记本电脑安装 Linux 系统后,发现旧电脑运行 Linux 系统和 Xfce 桌面非常流畅。
几周前,我要在一个会议上简要演示自己在 Linux 下编写的一款小软件。我需要带一台 Linux 笔记本电脑参会,因此我翻出一台旧笔记本电脑并且安装上 Linux 系统。我使用的是 Fedora 36 Xfce spin使用还不错。
这台我用的笔记本是在 2012 年购买的。1.70 GHZ 的 CPU4 GB 的 内存128 GB 的驱动器,也许和我现在的桌面电脑比性能很弱,但是 Linux 和 Xfce 桌面赋予这台旧电脑新的生命。
### Linux 的 Xfce 桌面
Xfce 桌面是一个轻量级桌面,它提供一个精美、现代的外观。熟悉的界面,有任务栏或者顶部“面板”可以启动应用程序,在系统托盘可以改变虚拟桌面,或者查看通知信息。
![Image of Xfce desktop][6]
要开始一个新应用程序,点击左上角的应用程序按钮。这将打开一个应用程序启动菜单,顶部有常用的应用程序比如终端和文件管理。另外的应用程序会分组排列,这样你可以找到所需要的应用。
![Image of desktop applications][7]
### 管理文件
Xfce 的文件管理器时叫 Thunar它能非常好地管理我的文件。我喜欢 Thunar 可以连接远程系统,在家里,我用一个开启 SSH 的树莓派作为个人文件服务器。Thunar 可以打开一个 SSH 文件传输窗口,这样我可以在笔记本电脑和树莓派之间拷贝文件。
![Image of Thunar remote][9]
另一个访问文件和文件夹的方式是通过屏幕底部的快速访问停靠栏。点击文件夹图标可以打开一个常规操作菜单,如在终端窗口打开一个文件夹、新建一个文件夹或进入指定文件夹等。
![Image of desktop with open folders][10]
### 其它应用程序
我热爱探索 Xfce 提供的其他应用程序。Mousepad 看起来像一个简单的文本编辑器但是比起纯文本编辑它包含更多有用的功能。Mousepad 支持许多文件类型,程序员和其他高级用户也许会非常喜欢。在文档菜单检验一下可用的部分编程语言列表。
![Image of Mousepad file types][11]
如果你更喜欢一个不同的外观和感觉,可以用视图菜单调整界面选项,如字体、配色方案以及行号。
![Image of Mousepad in color scheme solarized][12]
磁盘工具可以让你管理储存设备。虽然我不需要修改我的系统磁盘,磁盘工具是一个初始化或重新格式化 USB 闪存设备的好方式。我认为这个界面非常简单好用。
![Image of disk utility][13]
我非常钦佩带有 Geany 集成开发的环境,我有一点惊讶一个旧系统可以如此流畅地运行一个完整的 IDE 开发软件。
我用一个简单的 “hello world” 程序测试 Geany当我输入每一个函数名称时很高兴地看到 IDE 弹出语法帮助,弹出的信息并不唐突且刚好提供了我需要的信息。同时 printf 函数非常容易记住,我总是忘记其它函数的选项顺序,比如 fputs 和 realloc这就是我需要弹出语法帮助的地方。
![Image of Geany workspace][14]
在 Xfce 里探索菜单寻找其它应用程序让你的工作更简单,你将找到可以播放音乐、访问终端或浏览网页的应用程序。
当我安装 Linux 到笔记本电脑,在会议上演示一些样例后,发现 Linux 和 Xfce 桌面让这台旧电脑变得更时尚。这个系统运行得如此流畅,当会议结束后,我决定把这台笔记本电脑作为备用机。
我喜爱在 Xfce 上使用应用程序工作,尽管它有非常低的系统开销和极简单的方法,但我并没有感觉到不够用,我可以用 Xfce 和上面的应用程序做任何事情。如果你有一台需要翻新的旧电脑,试试安装 Linux给旧硬件带来新的生命。
图片来源: (Jim Hall, CC BY-SA 40)
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/6/linux-xfce-old-laptop
作者:[Jim Hall][a]
选题:[lkxed][b]
译者:[lightchaserhy](https://github.com/lightchaserhy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jim-hall
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/coffee_tea_laptop_computer_work_desk.png
[2]: https://unsplash.com/@jonasleupe?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[3]: https://unsplash.com/s/photos/tea-cup-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[4]: https://spins.fedoraproject.org/xfce/download/index.html
[5]: https://opensource.com/article/19/12/xfce-linux-desktop
[6]: https://opensource.com/sites/default/files/2022-06/Linuxlaptop1.png
[7]: https://opensource.com/sites/default/files/2022-06/linuxlaptopDesktopApps.png
[8]: https://opensource.com/article/20/3/personal-file-server-ssh
[9]: https://opensource.com/sites/default/files/2022-06/LinuxlaptopThunarremote.png
[10]: https://opensource.com/sites/default/files/2022-06/LinuxlaptopDesk.png
[11]: https://opensource.com/sites/default/files/2022-06/LinuxlaptopMousepadfiletype.png
[12]: https://opensource.com/sites/default/files/2022-06/Linuxlaptopmousepadsolarized.png
[13]: https://opensource.com/sites/default/files/2022-06/linuxlaptopdisks.png
[14]: https://opensource.com/sites/default/files/2022-06/Linuxlaptopgeany.png

View File

@ -1,107 +0,0 @@
[#]: subject: "Share your Linux terminal with tmate"
[#]: via: "https://opensource.com/article/22/6/share-linux-terminal-tmate"
[#]: author: "Sumantro Mukherjee https://opensource.com/users/sumantro"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
用 tmate 分享你的 Linux 终端
======
Tmate 扩展了你与 Linux 终端共享会话的选项。
![Terminal command prompt on orange background][1]
图片提供: [iradaturrahmat][2] 通过 [Pixabay][3]CC0
作为 Fedora Linux QA 团队的一员,我有时会发现自己执行了一堆我想广播给其他开发者的命令。如果你曾经使用过像 [tmux][5] 或 [GNU Screen][6] 这样的[终端复用器][4],你可能会认为这是一个相对容易的任务。但并不是所有我想看我的演示的人都是从笔记本电脑或台式机连接到我的终端会话的。有些人可能是随便从他们的手机浏览器中打开的,他们可以很容易地做到这一点,因为我使用了[tmate][7]。
### 使用 tmate 共享 Linux终端
看别人在 Linux 终端工作是非常有教育意义的。你可以学到新的命令,新的工作流程,或者新的调试和自动化的方法。但要捕捉到你所看到的东西,以便你以后可以自己尝试,这可能很困难。你可能会诉诸于截图或共享终端会话的屏幕记录,这样你就可以在以后打出每个命令。唯一的选择是由演示命令的人使用 [Asciinema][8] 或 [script 和 scriptreplay][9] 等工具来记录会话。
但是通过 tmate用户可以在只读模式下或通过 SSH 共享一个终端。SSH 和只读会话都可以通过终端或以 HTML 网页的形式访问。
当我为 Fedora QA 团队培训人员时,我使用只读模式,因为我需要运行命令并显示输出,但有了 tmate人们可以通过从他们的浏览器复制和粘贴到文本编辑器来保持笔记。
### Linux tmate 上手
在 Linux 上,你可以用你的包管理器安装 tmate。例如在 Fedora 上:
```
$ sudo dnf install tmate
```
在 Debian 和类似的发行版上:
```
$ sudo apt install tmate
```
在 macOS 上,你可以用 [Homebrew][10] 或 [MacPorts][11] 安装它。如果你需要其他 Linux 发行版的说明,请参考[安装][12]指南。
![Screenshot of terminal showing the options for tmate sharing: web session (regular and read-only) and ssh session (regular and read-only)][13]
安装后,启动 tmate
```
$ tmate
```
当 tmate 启动时,会产生链接,通过 HTTP 和 SSH 提供对终端会话的访问。每个协议都有一个只读选项以及一个反向的 SSH 会话。
下面是一个网络会话的样子:
![Screenshot showing tmate terminal window and 2 versions of sharing sessions demonstrating the same code][14]
Tmate 的网络控制台是 HTML5 的,因此,用户可以复制整个屏幕并粘贴到终端来运行相同的命令。
### 保持会话活跃
你可能想知道如果你不小心关闭了你的终端会发生什么。你也可能想知道如何与不同的控制台应用共享你的终端。毕竟tmate 是一个多路复用器,所以它应该能够保持会话的活力,脱离并重新连接到一个会话,等等。
当然,这正是 tmate 所能做到的。如果你曾经使用过 tmux这可能是相当熟悉的。
```
$ tmate -F -n web new-session vi console
```
这个命令在 Vi 中打开了 `new-session``-F` 选项确保会话在关闭时也能重新产生。
![A screenshot of the terminal showing the output after using the new-session and -F options: connection information for either a web session (regular or read-only) or ssh session (regular or read-only)][15]
### 社交复用
Tmate 给你带来了 tmux 或 GNU Screen 的自由,以及与他人共享会话的能力。对于教其他用户如何使用终端,演示一个新命令的功能,或调试意外的行为,这是一个有价值的工具。它是开源的,所以请试一试!
图片提供Sumantro MukherjeeCC BY-SA 4.0
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/6/share-linux-terminal-tmate
作者:[Sumantro Mukherjee][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/sumantro
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/terminal_command_linux_desktop_code.jpg
[2]: https://pixabay.com/en/users/iradaturrahmat-3964359/
[3]: https://pixabay.com/en/ubuntu-computer-program-interface-3145957/
[4]: https://opensource.com/article/21/5/linux-terminal-multiplexer
[5]: https://opensource.com/downloads/tmux-cheat-sheet
[6]: https://opensource.com/article/17/3/introduction-gnu-screen
[7]: https://tmate.io/
[8]: https://opensource.com/article/22/1/record-your-terminal-session-asciinema
[9]: https://www.redhat.com/sysadmin/record-terminal-script-scriptreplay
[10]: https://opensource.com/article/20/6/homebrew-mac
[11]: https://opensource.com/article/20/11/macports
[12]: https://tmate.io/
[13]: https://opensource.com/sites/default/files/2022-06/install%20tmate_0.png
[14]: https://opensource.com/sites/default/files/2022-06/tmate%20web%20session.png
[15]: https://opensource.com/sites/default/files/2022-06/tmate%20keeping%20session%20alive.png