mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-13 22:30:37 +08:00
commit
1bdd592ab3
@ -0,0 +1,199 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12186-1.html)
|
||||
[#]: subject: (How to Configure SFTP Server with Chroot in Debian 10)
|
||||
[#]: via: (https://www.linuxtechi.com/configure-sftp-chroot-debian10/)
|
||||
[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/)
|
||||
|
||||
如何在 Debian 10 中配置 Chroot 环境的 SFTP 服务
|
||||
======
|
||||
|
||||
SFTP 意思是“<ruby>安全文件传输协议<rt>Secure File Transfer Protocol</rt></ruby>” 或 “<ruby>SSH 文件传输协议<rt>SSH File Transfer Protocol</rt></ruby>”,它是最常用的用于通过 `ssh` 将文件从本地系统安全地传输到远程服务器的方法,反之亦然。`sftp` 的主要优点是,除 `openssh-server` 之外,我们不需要安装任何额外的软件包,在大多数的 Linux 发行版中,`openssh-server` 软件包是默认安装的一部分。`sftp` 的另外一个好处是,我们可以允许用户使用 `sftp` ,而不允许使用 `ssh` 。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202005/05/223518ip4mbdi4nggbdtgu.jpg)
|
||||
|
||||
当前发布的 Debian 10 代号为 ‘Buster’,在这篇文章中,我们将演示如何在 Debian 10 系统中在 “监狱式的” Chroot 环境中配置 `sftp`。在这里,Chroot 监狱式环境意味着,用户不能超出各自的家目录,或者用户不能从各自的家目录更改目录。下面实验的详细情况:
|
||||
|
||||
* OS = Debian 10
|
||||
* IP 地址 = 192.168.56.151
|
||||
|
||||
让我们跳转到 SFTP 配置步骤,
|
||||
|
||||
### 步骤 1、使用 groupadd 命令给 sftp 创建一个组
|
||||
|
||||
打开终端,使用下面的 `groupadd` 命令创建一个名为的 `sftp_users` 组:
|
||||
|
||||
```
|
||||
root@linuxtechi:~# groupadd sftp_users
|
||||
```
|
||||
|
||||
### 步骤 2、添加用户到组 sftp_users 并设置权限
|
||||
|
||||
假设你想创建新的用户,并且想添加该用户到 `sftp_users` 组中,那么运行下面的命令,
|
||||
|
||||
**语法:**
|
||||
|
||||
```
|
||||
# useradd -m -G sftp_users <用户名>
|
||||
```
|
||||
|
||||
让我们假设用户名是 `jonathan`:
|
||||
|
||||
```
|
||||
root@linuxtechi:~# useradd -m -G sftp_users jonathan
|
||||
```
|
||||
|
||||
使用下面的 `chpasswd` 命令设置密码:
|
||||
|
||||
```
|
||||
root@linuxtechi:~# echo "jonathan:<输入密码>" | chpasswd
|
||||
```
|
||||
|
||||
假设你想添加现有的用户到 `sftp_users` 组中,那么运行下面的 `usermod` 命令,让我们假设已经存在的用户名称是 `chris`:
|
||||
|
||||
```
|
||||
root@linuxtechi:~# usermod -G sftp_users chris
|
||||
```
|
||||
|
||||
现在设置用户所需的权限:
|
||||
|
||||
```
|
||||
root@linuxtechi:~# chown root /home/jonathan /home/chris/
|
||||
```
|
||||
|
||||
在各用户的家目录中都创建一个上传目录,并设置正确地所有权:
|
||||
|
||||
```
|
||||
root@linuxtechi:~# mkdir /home/jonathan/upload
|
||||
root@linuxtechi:~# mkdir /home/chris/upload
|
||||
root@linuxtechi:~# chown jonathan /home/jonathan/upload
|
||||
root@linuxtechi:~# chown chris /home/chris/upload
|
||||
```
|
||||
|
||||
**注意:** 像 Jonathan 和 Chris 之类的用户可以从他们的本地系统上传文件和目录。
|
||||
|
||||
### 步骤 3、编辑 sftp 配置文件 /etc/ssh/sshd_config
|
||||
|
||||
正如我们已经陈述的,`sftp` 操作是通过 `ssh` 完成的,所以它的配置文件是 `/etc/ssh/sshd_config`,在做任何更改前,我建议首先备份文件,然后再编辑该文件,接下来添加下面的内容:
|
||||
|
||||
```
|
||||
root@linuxtechi:~# cp /etc/ssh/sshd_config /etc/ssh/sshd_config-org
|
||||
root@linuxtechi:~# vim /etc/ssh/sshd_config
|
||||
......
|
||||
#Subsystem sftp /usr/lib/openssh/sftp-server
|
||||
Subsystem sftp internal-sftp
|
||||
|
||||
Match Group sftp_users
|
||||
X11Forwarding no
|
||||
AllowTcpForwarding no
|
||||
ChrootDirectory %h
|
||||
ForceCommand internal-sftp
|
||||
......
|
||||
```
|
||||
|
||||
保存并退出文件。
|
||||
|
||||
为使上述更改生效,使用下面的 `systemctl` 命令来重新启动 `ssh` 服务:
|
||||
|
||||
```
|
||||
root@linuxtechi:~# systemctl restart sshd
|
||||
```
|
||||
|
||||
在上面的 `sshd_config` 文件中,我们已经注释掉了以 `Subsystem` 开头的行,并添加了新的条目 `Subsystem sftp internal-sftp` 和新的行。而
|
||||
|
||||
`Match Group sftp_users` –> 它意味着如果用户是 `sftp_users` 组中的一员,那么将应用下面提到的规则到这个条目。
|
||||
|
||||
`ChrootDierctory %h` –> 它意味着用户只能在他们自己各自的家目录中更改目录,而不能超出他们各自的家目录。或者换句话说,我们可以说用户是不允许更改目录的。他们将在他们的目录中获得监狱一样的环境,并且不能访问其他用户的目录和系统的目录。
|
||||
|
||||
`ForceCommand internal-sftp` –> 它意味着用户仅被限制到只能使用 `sftp` 命令。
|
||||
|
||||
### 步骤 4、测试和验证 sftp
|
||||
|
||||
登录到你的 `sftp` 服务器的同一个网络上的任何其它的 Linux 系统,然后通过我们放入 `sftp_users` 组中的用户来尝试 ssh 和 sftp 服务。
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# ssh root@linuxtechi
|
||||
root@linuxtechi's password:
|
||||
Write failed: Broken pipe
|
||||
[root@linuxtechi ~]# ssh root@linuxtechi
|
||||
root@linuxtechi's password:
|
||||
Write failed: Broken pipe
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
以上操作证实用户不允许 `ssh` ,现在使用下面的命令尝试 `sftp`:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# sftp root@linuxtechi
|
||||
root@linuxtechi's password:
|
||||
Connected to 192.168.56.151.
|
||||
sftp> ls -l
|
||||
drwxr-xr-x 2 root 1001 4096 Sep 14 07:52 debian10-pkgs
|
||||
-rw-r--r-- 1 root 1001 155 Sep 14 07:52 devops-actions.txt
|
||||
drwxr-xr-x 2 1001 1002 4096 Sep 14 08:29 upload
|
||||
```
|
||||
|
||||
让我们使用 sftp 的 `get` 命令来尝试下载一个文件:
|
||||
|
||||
```
|
||||
sftp> get devops-actions.txt
|
||||
Fetching /devops-actions.txt to devops-actions.txt
|
||||
/devops-actions.txt 100% 155 0.2KB/s 00:00
|
||||
sftp>
|
||||
sftp> cd /etc
|
||||
Couldn't stat remote file: No such file or directory
|
||||
sftp> cd /root
|
||||
Couldn't stat remote file: No such file or directory
|
||||
sftp>
|
||||
```
|
||||
|
||||
上面的输出证实我们能从我们的 sftp 服务器下载文件到本地机器,除此之外,我们也必须测试用户不能更改目录。
|
||||
|
||||
让我们在 `upload` 目录下尝试上传一个文件:
|
||||
|
||||
```
|
||||
sftp> cd upload/
|
||||
sftp> put metricbeat-7.3.1-amd64.deb
|
||||
Uploading metricbeat-7.3.1-amd64.deb to /upload/metricbeat-7.3.1-amd64.deb
|
||||
metricbeat-7.3.1-amd64.deb 100% 38MB 38.4MB/s 00:01
|
||||
sftp> ls -l
|
||||
-rw-r--r-- 1 1001 1002 40275654 Sep 14 09:18 metricbeat-7.3.1-amd64.deb
|
||||
sftp>
|
||||
```
|
||||
|
||||
这证实我们已经成功地从我们的本地系统上传一个文件到 sftp 服务中。
|
||||
|
||||
现在使用 winscp 工具来测试 sftp 服务,输入 sftp 服务器 IP 地址和用户的凭证:
|
||||
|
||||
![][3]
|
||||
|
||||
在 “Login” 上单击,然后尝试下载和上传文件:
|
||||
|
||||
![][4]
|
||||
|
||||
现在,在 `upload` 文件夹中尝试上传文件:
|
||||
|
||||
![][5]
|
||||
|
||||
上面的窗口证实上传是完好地工作的,这就是这篇文章的全部。如果这些步骤能帮助你在 Debian 10 中使用 chroot 环境配置 SFTP 服务器s,那么请分享你的反馈和评论。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxtechi.com/configure-sftp-chroot-debian10/
|
||||
|
||||
作者:[Pradeep Kumar][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[robsean](https://github.com/robsean)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.linuxtechi.com/author/pradeep/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
||||
[2]: https://www.linuxtechi.com/wp-content/uploads/2019/09/Configure-sftp-debian10.jpg
|
||||
[3]: https://www.linuxtechi.com/wp-content/uploads/2019/09/Winscp-sftp-debian10.jpg
|
||||
[4]: https://www.linuxtechi.com/wp-content/uploads/2019/09/Download-file-winscp-debian10-sftp.jpg
|
||||
[5]: https://www.linuxtechi.com/wp-content/uploads/2019/09/Upload-File-using-winscp-Debian10-sftp.jpg
|
@ -0,0 +1,105 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12173-1.html)
|
||||
[#]: subject: (Create Stunning Pixel Art With Free and Open Source Editor Pixelorama)
|
||||
[#]: via: (https://itsfoss.com/pixelorama/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
使用 Pixelorama 创建令人惊叹的像素艺术
|
||||
======
|
||||
|
||||
> Pixelorama 是一个跨平台、自由开源的 2D 精灵编辑器。它在一个整洁的用户界面中提供了创建像素艺术所有必要工具。
|
||||
|
||||
### Pixelorama:开源 Sprite 编辑器
|
||||
|
||||
[Pixelorama][1] 是 [Orama 互动][2]公司的年轻游戏开发人员创建的一个工具。他们已经开发了一些 2D 游戏,其中一些使用了像素艺术。
|
||||
|
||||
虽然 Orama 主要从事于游戏开发,但开发人员也创建实用工具,帮助他们(和其他人)创建这些游戏。
|
||||
|
||||
自由开源的<ruby>精灵<rt>Sprite</rt></ruby>编辑器 Pixelorama 就是这样一个实用工具。它构建在 [Godot 引擎][3]之上,非常适合创作像素艺术。
|
||||
|
||||
![Pixelorama screenshot][4]
|
||||
|
||||
你看到上面截图中的像素艺术了吗?它是使用 Pixelorama 创建的。这段视频展示了制作上述图片的时间推移视频。
|
||||
|
||||
### Pixelorama 的功能
|
||||
|
||||
以下是 Pixelorama 提供的主要功能:
|
||||
|
||||
* 多种工具,如铅笔、橡皮擦、填充桶、取色器等
|
||||
* 多层系统,你可以根据需要添加、删除、上下移动、克隆和合并多个层
|
||||
* 支持 Spritesheets
|
||||
* 导入图像并在 Pixelorama 中编辑它们
|
||||
* 带有 [Onion Skinning][5] 的动画时间线
|
||||
* 自定义画笔
|
||||
* 以 Pixelorama 的自定义文件格式 .pxo 保存并打开你的项目
|
||||
* 水平和垂直镜像绘图
|
||||
* 用于创建图样的磁贴模式
|
||||
* 拆分屏幕模式和迷你画布预览
|
||||
* 使用鼠标滚轮缩放
|
||||
* 无限次撤消和重做
|
||||
* 缩放、裁剪、翻转、旋转、颜色反转和去饱和图像
|
||||
* 键盘快捷键
|
||||
* 提供多种语言
|
||||
* 支持 Linux、Windows 和 macOS
|
||||
|
||||
### 在 Linux 上安装 Pixelorama
|
||||
|
||||
Pixelorama 提供 Snap 应用,如果你使用的是 Ubuntu,那么可以在软件中心找到它。
|
||||
|
||||
![Pixelorama is available in Ubuntu Software Center][6]
|
||||
|
||||
或者,如果你在 [Linux 发行版上启用了 Snap 支持][7],那么可以使用此命令安装它:
|
||||
|
||||
```
|
||||
sudo snap install pixelorama
|
||||
```
|
||||
|
||||
如果你不想使用 Snap,不用担心。你可以从[他们的 GitHub 仓库][8]下载最新版本的 Pixelorama,[解压 zip 文件][9],你会看到一个可执行文件。授予此文件执行权限,并双击它运行应用。
|
||||
|
||||
- [下载 Pixelorama][10]
|
||||
|
||||
### 总结
|
||||
|
||||
![Pixelorama Welcome Screen][11]
|
||||
|
||||
在 Pixeloaram 的功能中,它说你可以导入图像并对其进行编辑。我想,这只是对某些类型的文件,因为当我尝试导入 PNG 或 JPEG 文件,程序崩溃了。
|
||||
|
||||
然而,我可以像一个 3 岁的孩子那样随意涂鸦并制作像素艺术。我对艺术不是很感兴趣,但我认为这[对 Linux 上的数字艺术家是个有用的工具][12]。
|
||||
|
||||
我喜欢这样的想法:尽管是游戏开发人员,但他们创建的工具,可以帮助其他游戏开发人员和艺术家。这就是开源的精神。
|
||||
|
||||
如果你喜欢这个项目,并且会使用它,请考虑通过捐赠来支持他们。[It’s FOSS 捐赠了][13] 25 美元,以感谢他们的努力。
|
||||
|
||||
- [向 Pixelorama 捐赠(主要开发者的个人 Paypal 账户)][14]
|
||||
|
||||
你喜欢 Pixelorama 吗?你是否使用其他开源精灵编辑器?请随时在评论栏分享你的观点。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
via: https://itsfoss.com/pixelorama/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.orama-interactive.com/pixelorama
|
||||
[2]: https://www.orama-interactive.com/
|
||||
[3]: https://godotengine.org/
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/pixelorama-v6.jpg?ssl=1
|
||||
[5]: https://en.wikipedia.org/wiki/Onion_skinning
|
||||
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/pixelorama-ubuntu-software-center.jpg?ssl=1
|
||||
[7]: https://itsfoss.com/install-snap-linux/
|
||||
[8]: https://github.com/Orama-Interactive/Pixelorama
|
||||
[9]: https://itsfoss.com/unzip-linux/
|
||||
[10]: https://github.com/Orama-Interactive/Pixelorama/releases
|
||||
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/pixelorama.jpg?ssl=1
|
||||
[12]: https://itsfoss.com/best-linux-graphic-design-software/
|
||||
[13]: https://itsfoss.com/donations-foss/
|
||||
[14]: https://www.paypal.me/erevos
|
@ -0,0 +1,96 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12171-1.html)
|
||||
[#]: subject: (Rambox is an All-in-one Messenger for Linux)
|
||||
[#]: via: (https://itsfoss.com/rambox/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Rambox:Linux 中多合一的消息收发工具
|
||||
======
|
||||
|
||||
> Rambox 是一个多合一消息收发工具,允许你将多种服务(如 Discord、Slack、Facebook Messenger)和数百个此类服务结合在一起。
|
||||
|
||||
### Rambox:在单个应用中添加多个消息服务
|
||||
|
||||
![][1]
|
||||
|
||||
Rambox 是通过安装单个应用管理多个通信服务的最佳方式之一。你可以在一个界面使用[多个消息服务][2],如 Facebook Messenger、Gmail chats、AOL、Discord、Google Duo、[Viber][3] 等。
|
||||
|
||||
这样,你就不需要安装单独的应用或者在浏览器中一直打开着。你可以使用主密码锁定 Rambox 应用。你还可以使用“请勿打扰”功能。
|
||||
|
||||
Rambox 提供可免费使用的[开源社区版][4]。付费专业版允许你访问 600 多个应用,而社区版则包含 99 多个应用。专业版本具有额外的功能,如主题、休眠、ad-block、拼写检查和高级支持。
|
||||
|
||||
不用担心。开源社区版本身非常有用,你甚至不需要这些专业功能。
|
||||
|
||||
### Rambox 的功能
|
||||
|
||||
![][5]
|
||||
|
||||
虽然你应该在开源版中找到大多数基本功能,但你可能会注意到其中一些功能仅限于专业版。
|
||||
|
||||
此处,我说下所有的基本功能:
|
||||
|
||||
* 在开源版本中,你有大约 100 个应用/服务可供选择
|
||||
* 能够使用单个主密码锁保护应用
|
||||
* 能够锁定加载的每个会话
|
||||
* 请勿打扰模式
|
||||
* 能够跨多个设备同步应用和配置
|
||||
* 你可以创建和添加自定义应用
|
||||
* 支持键盘快捷键
|
||||
* 启用/禁用应用而无需删除它们
|
||||
* JS 和 CSS 注入支持,以调整应用的样式
|
||||
* Ad-block (**专业版**)
|
||||
* 休眠支持 (**专业版**)
|
||||
* 主题支持(**专业版**)
|
||||
* 移动设备视图 (**专业版**)
|
||||
* 拼写检查 (**专业版**)
|
||||
* 工作时间 - 计划传入通知的时间 (**专业版**)
|
||||
* 支持代理 (**专业版**)
|
||||
|
||||
除了我在这里列出的内容外,你还可以在 Rambox Pro 版本中找到更多功能。要了解有关它的更多信息,你可以参考[正式功能列表][6]。
|
||||
|
||||
还值得注意的是,你不能超过 3 个活跃并发设备的连接。
|
||||
|
||||
### 在 Linux 上安装 Rambox
|
||||
|
||||
你可以在[官方下载页][4]获取 .AppImage 文件来运行 Rambox。如果你不清楚,你可以参考我们的指南,了解如何[在 Linux 上使用 AppImage 文件][7]。
|
||||
|
||||
另外,你也可以从 [Snap 商店][8]获取它。此外,请查看其 [GitHub release][9] 部分的 .deb / .rpm 或其他包。
|
||||
|
||||
- [下载 Rambox 社区版][4]
|
||||
|
||||
### 总结
|
||||
|
||||
使用 Rambox 安装大量应用可能会有点让人不知所措。因此,我建议你在添加更多应用并将其用于工作时监视内存使用情况。
|
||||
|
||||
还有一个类似的应用称为 [Franz][10],它也像 Rambox 部分开源、部分高级版。
|
||||
|
||||
尽管像 Rambox 或 Franz 这样的解决方案非常有用,但它们并不总是节约资源,特别是如果你同时使用数十个服务。因此,请留意系统资源(如果你注意到对性能的影响)。
|
||||
|
||||
除此之外,这是一个令人印象深刻的应用。你有试过了么?欢迎随时让我知道你的想法!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/rambox/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/rambox-ce.jpg?ssl=1
|
||||
[2]: https://itsfoss.com/best-messaging-apps-linux/
|
||||
[3]: https://itsfoss.com/viber-linux-client-beta-install/
|
||||
[4]: https://rambox.pro/#ce
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/rambox-preferences.png?ssl=1
|
||||
[6]: https://rambox.pro/#features
|
||||
[7]: https://itsfoss.com/use-appimage-linux/
|
||||
[8]: https://snapcraft.io/rambox
|
||||
[9]: https://github.com/ramboxapp/community-edition/releases
|
||||
[10]: https://itsfoss.com/franz-messaging-app/
|
@ -1,20 +1,22 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12161-1.html)
|
||||
[#]: subject: (The Difference Between DNF and YUM, Why is Yum Replaced by DNF?)
|
||||
[#]: via: (https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
DNF 和 YUM 的区别,为什么 YUM 会被 DNF 取代?
|
||||
DNF 和 Yum 的区别,为什么 Yum 会被 DNF 取代?
|
||||
======
|
||||
|
||||
由于 Yum 中许多长期存在的问题仍未得到解决,因此 [Yum 包管理器][1]已被 [DNF 包管理器][2]取代。这些问题包括性能差、内存占用过多、依赖解析速度变慢等。
|
||||
|
||||
DNF 使用 `libsolv` 进行依赖解析,由 SUSE 开发和维护,旨在提高性能。DNF 主要是用 Python 编写的,它有自己的应对依赖解析的方法。
|
||||
DNF 使用 `libsolv` 进行依赖解析,由 SUSE 开发和维护,旨在提高性能。
|
||||
|
||||
Yum 是 RPM 的前端工具,它管理依赖关系和资源库,然后使用 RPM 来安装、下载和删除包。它的 API 没有完整的文档,它的扩展系统只允许 Python 插件。
|
||||
Yum 主要是用 Python 编写的,它有自己的应对依赖解析的方法。它的 API 没有完整的文档,它的扩展系统只允许 Python 插件。
|
||||
|
||||
Yum 是 RPM 的前端工具,它管理依赖关系和资源库,然后使用 RPM 来安装、下载和删除包。
|
||||
|
||||
为什么他们要建立一个新的工具,而不是修复现有的问题呢?
|
||||
|
||||
@ -33,17 +35,17 @@ Ales Kozamblak 解释说,这个修复在技术上是不可行的,而且 Yum
|
||||
2 | API 有完整的文档 | API 没有完整的文档
|
||||
3 | 由 C、C++、Python 编写的 | 只用 Python 编写
|
||||
4 | DNF 目前在 Fedora、RHEL 8、CentOS 8、OEL 8 和 Mageia 6/7 中使用 | YUM 目前在 RHEL 6/7、CentOS 6/7、OEL 6/7 中使用
|
||||
5 | DNf 支持各种扩展 | Yum 只支持基于 Python 的扩展
|
||||
5 | DNF 支持各种扩展 | Yum 只支持基于 Python 的扩展
|
||||
6 | API 有良好的文档,因此很容易创建新的功能 | 因为 API 没有正确的文档化,所以创建新功能非常困难
|
||||
7 | DNF 在同步存储库的元数据时,使用的内存较少 | 在同步存储库的元数据时,YUM 使用了过多的内存
|
||||
8 | DNF 使用满足性算法来解决依赖关系解析(它是用字典的方法来存储和检索包和依赖信息)| 由于使用公开 API 的原因,Yum 依赖性解析变得迟钝
|
||||
9 | 从内存使用量和版本库元数据的依赖性解析来看,性能都不错 | 总的来说,在很多因素的影响下,表现不佳
|
||||
10 | DNF 更新:在 DNF 更新过程中,如果包中包含不相关的依赖,则不会更新 | YUM 将在没有验证的情况下更新软件包
|
||||
11 | 如果启用的存储库没有响应,DNF 将跳过它,并继续使用可用的存储库出来事务 | 如果有存储库不可用,YUM 会立即停止
|
||||
11 | 如果启用的存储库没有响应,DNF 将跳过它,并继续使用可用的存储库处理事务 | 如果有存储库不可用,YUM 会立即停止
|
||||
12 | `dnf update` 和 `dnf upgrade` 是等价的 | 在 Yum 中则不同
|
||||
13 | 安装包的依赖关系不更新 | Yum 为这种行为提供了一个选项
|
||||
14 | 清理删除的包:当删除一个包时,DNF 会自动删除任何没有被用户明确安装的依赖包 | Yum 不会这样做
|
||||
15 | 存储库缓存更新计划:默认情况下,系统启动后 10 分钟后,DNF 每小时检查一次对配置的存储库的更新。这个动作由系统定时器单元 `/usr/lib/systemd/system/system/dnf-makecache.timer` 控制 | Yum 也会这样做
|
||||
15 | 存储库缓存更新计划:默认情况下,系统启动后 10 分钟后,DNF 每小时会对配置的存储库检查一次更新。这个动作由系统定时器单元 `dnf-makecache.timer` 控制 | Yum 也会这样做
|
||||
16 | 内核包不受 DNF 保护。不像 Yum,你可以删除所有的内核包,包括运行中的内核包 | Yum 不允许你删除运行中的内核
|
||||
17 | libsolv:用于解包和读取资源库。hawkey: 为 libsolv 提供简化的 C 和 Python API 库。librepo: 提供 C 和 Python(类似 libcURL)API 的库,用于下载 Linux 存储库元数据和软件包。libcomps: 是 yum.comps 库的替代品。它是用纯 C 语言编写的库,有 Python 2 和 Python 3 的绑定。| Yum 不使用单独的库来执行这些功能
|
||||
18 | DNF 包含 29000 行代码 | Yum 包含 56000 行代码
|
||||
@ -56,7 +58,7 @@ via: https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,173 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (lxbwolf)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12156-1.html)
|
||||
[#]: subject: (Manage complex Git workspaces with Great Teeming Workspaces)
|
||||
[#]: via: (https://opensource.com/article/20/2/git-great-teeming-workspaces)
|
||||
[#]: author: (Daniel Gryniewicz https://opensource.com/users/dang)
|
||||
|
||||
使用 GTWS 管理复杂的 Git 工作空间
|
||||
======
|
||||
|
||||
> GTWS 是一系列脚本,它使我们在开发环境中管理不同的项目和项目的各个版本变得很容易。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202004/27/182149xh9s7kb5bkf5875b.jpg)
|
||||
|
||||
[Great Teeming Workspaces][2](GTWS)是一个 Git 的复杂工作空间管理工具包,它使我们在开发环境中管理不同的项目和项目的各个版本变得很容易。
|
||||
|
||||
有点像 Python 的 [venv][3],但不是为 Python 语言准备的。GTWS 用来管理多个项目的多个版本的工作空间。你可以很容易地创建、更新、进入和离开工作空间,每个项目或版本的组合(最多)有一个本地的 origin,用来与 upstream 同步 — 其余的所有工作空间都从本地的 origin 更新。
|
||||
|
||||
### 部署
|
||||
|
||||
```
|
||||
${GTWS_ORIGIN}/<project>/<repo>[/<version>]
|
||||
${GTWS_BASE_SRCDIR}/<project>/<version>/<workspacename>/{<repo>[,<repo>...]}
|
||||
```
|
||||
|
||||
源代码目录的每一级(包括全局的家目录)可以包含一个 `.gtwsrc` 文件,这个文件中维护与当前级相关的设置和 bash 代码。每一级的配置会覆盖上一级。
|
||||
|
||||
### 安装
|
||||
|
||||
用下面的命令检出 GTWS:
|
||||
|
||||
```
|
||||
git clone https://github.com/dang/gtws.git
|
||||
```
|
||||
|
||||
配置你的 `${HOME}/.gtwsrc`。它应该包含 `GTWS_ORIGIN`,也可以再包含 `GTWS_SETPROMPT`。
|
||||
|
||||
把仓库目录加到环境变量中:
|
||||
|
||||
```
|
||||
export PATH="${PATH}:/path/to/gtws
|
||||
```
|
||||
|
||||
### 配置
|
||||
|
||||
通过级联 `.gtwsrc` 文件来进行配置。它从根目录向下遍历,会执行在每级目录中找到的 `.gtwsrc` 文件。下级目录的文件会覆盖上一级。
|
||||
|
||||
在你最上层的文件 `~/.gtws/.gtwsrc` 中进行如下设置:
|
||||
|
||||
* `GTWS_BASE_SRCDIR`:所有项目源文件目录树的基目录。默认为 `$HOME/src`。
|
||||
* `GTWS_ORIGIN`: 指定 origin git 目录树的路径。默认为 `$HOME/origin`。
|
||||
* `GTWS_SETPROMPT`: 可选配置。如果配置了这个参数,shell 提示符会有工作空间的名字。
|
||||
* `GTWS_DEFAULT_PROJECT`: 不指定项目或项目未知时默认的项目名。如果不指定,使用命令行时必须指明项目。
|
||||
* `GTWS_DEFAULT_PROJECT_VERSION`: 检出的默认版本。默认为 `master`。
|
||||
|
||||
在每个项目的根目录进行以下设置:
|
||||
|
||||
* `GTWS_PROJECT`: 项目的名字(和基目录)。
|
||||
* `gtws_project_clone`: 这个函数用于克隆一个项目的指定版本。如果未定义,它会假定项目的 origin 对每一个版本都有一个单独的目录,这样会导致克隆一堆 Git 仓库。
|
||||
* `gtws_project_setup`: 在克隆完所有的仓库后,可以选择是否调用这个函数,调用后可以对项目进行必要的配置,如在 IDE 中配置工作空间。
|
||||
|
||||
在项目版本级进行以下设置:
|
||||
|
||||
* `GTWS_PROJECT_VERSION:` 项目的版本。用于正确地从 origin 拉取代码。类似 Git 中的分支名字。
|
||||
|
||||
下面这些参数可以在目录树的任意地方进行配置,如果能生效,它们可以被重写多次:
|
||||
|
||||
* `GTWS_PATH_EXTRA`: 这些是工作空间中加到路径后的额外的路径元素。
|
||||
* `GTWS_FILES_EXTRA`: 这些是不在版本控制内,但应该在工作空间中被检出的额外的文件。这些文件包括 `.git/info/exclude`,每个文件都与仓库的基目录相关联。
|
||||
|
||||
### origin 目录
|
||||
|
||||
`GTWS_ORIGIN` (大部分脚本中)指向拉取和推送的原始 Git 检出目录。
|
||||
|
||||
`${GTWS_ORIGIN}` 部署:
|
||||
|
||||
* `/<project>`
|
||||
* 这是一个项目的仓库的基目录。
|
||||
* 如果指定了 `gtws_project_clone`,你可以配置任意的部署路径。
|
||||
* 如果没有指定 `gtws_project_clone`,这个路径下必须有个名为 `git` 的子目录,且 `git` 目录下有一系列用来克隆的裸 Git 仓库。
|
||||
|
||||
### 工作流示例
|
||||
|
||||
假设你有一个项目名为 `Foo`,它的 upstream 为 `github.com/foo/foo.git`。这个仓库有个名为 `bar` 的子模块,它的 upstream 是 `github.com/bar/bar.git`。Foo 项目在 master 分支开发,使用稳定版本的分支。
|
||||
|
||||
为了能在 Foo 中使用 GTWS,你首先要配置目录结构。本例中假设你使用默认的目录结构。
|
||||
|
||||
* 配置你最上层的 `.gtwsrc`:
|
||||
* `cp ${GTWS_LOC}/examples/gtwsrc.top ~/.gtwsrc`
|
||||
* 根据需要修改 `~/.gtwsrc`。
|
||||
* 创建顶级目录:
|
||||
* `mkdir -p ~/origin ~/src`
|
||||
* 创建并配置项目目录:
|
||||
* `mkdir -p ~/src/foo`
|
||||
|
||||
`cp ${GTWS_LOC}/examples/gtwsrc.project ~/src/foo/.gtwsrc`
|
||||
* 根据需要修改 `~/src/foo/.gtwsrc`。
|
||||
* 创建并配置 master 版本目录:
|
||||
* `mkdir -p ~/src/foo/master`
|
||||
|
||||
`cp ${GTWS_LOC}/examples/gtwsrc.version ~/src/foo/master/.gtwsrc`
|
||||
* 根据需要修改 `~/src/foo/master/.gtwsrc`。
|
||||
* 进入版本目录并创建一个临时工作空间来配置镜像:
|
||||
* `mkdir -p ~/src/foo/master/tmp`
|
||||
|
||||
`cd ~/src/foo/master/tmp`
|
||||
|
||||
`git clone --recurse-submodules git://github.com/foo/foo.git`
|
||||
|
||||
`cd foo`
|
||||
|
||||
`gtws-mirror -o ~/origin -p foo`(译注:这个地方原文有误,不加 `-s` 参数会报错)
|
||||
* 上面命令会创建 `~/origin/foo/git/foo.git` 和 `~/origin/foo/submodule/bar.git`。
|
||||
* 以后的克隆操作会从这些 origin 而不是 upstream 克隆。
|
||||
* 现在可以删除工作空间了。
|
||||
|
||||
到现在为止,Foo 的 master 分支的工作可以结束了。假设你现在想修复一个 bug,名为 `bug1234`。你可以脱离你当前的工作空间为修复这个 bug 单独创建一个工作空间,之后在新创建的工作空间中开发。
|
||||
|
||||
* 进入版本目录,创建一个新的工作空间:
|
||||
* `cd ~/src/foo/master`
|
||||
|
||||
`mkws bug1234`
|
||||
* 上面的命令创建了 `bug1234/`,在这个目录下检出了 Foo(和它的子模块 `bar`),并创建了 `build/foo` 来构建它。
|
||||
* 有两种方式进入工作空间:
|
||||
* `cd ~/src/foo/master/bug1234`
|
||||
|
||||
`startws`
|
||||
|
||||
或者
|
||||
|
||||
`cd ~/src/foo/master/`
|
||||
|
||||
`startws bug1234`
|
||||
* 上面的命令在 `bug1234` 工作空间中开启了一个子 shell。这个 shell 有 GTWS 的环境和你在各级 `.gtwsrc` 文件中设置的环境。它也把你工作空间的基目录加入到了 CD,因此你可以从 base 路径 `cd` 到相关的目录中。
|
||||
* 现在你可以修复 `bug1234` 了,构建、测试、提交你的修改。当你可以把代码推送到 upstream 时,执行下面的命令:
|
||||
|
||||
`cd foo`
|
||||
|
||||
`wspush`
|
||||
* `wspush` 会把代码推送到与你工作空间相关的分支 — 先推送到本地的 origin,再推送到 upstream。
|
||||
* 当 upstream 有修改时,你可以用下面的命令同步到本地:
|
||||
|
||||
`git sync`
|
||||
* 上面的命令调用了 GTWS 的 `git-sync` 脚本,会从本地 origin 更新代码。使用下面的命令来更新本地的 origin:
|
||||
|
||||
`git sync -o`
|
||||
* 上面的命令会更新你本地的 origin 和子模块的镜像,然后用那些命令来更新你的检出仓库的代码。`git-sync` 也有一些其他的很好的工鞥。
|
||||
* 当要结束工作空间中的工作时,直接退出 shell:
|
||||
|
||||
`exit`
|
||||
* 你可以在任何时间重复进入工作空间,也可以在同一时间在相同的工作空间中开多个 shell。
|
||||
* 当你不需要某个工作空间时,你可以使用 `rmws` 来删除它,或者直接删除它的目录树。
|
||||
* 还有一个脚本 `tmws` 使用 tmux 进入工作空间,能创建一系列的窗口/窗格,这完美契合我的工作流。你可以根据你自己的需求来修改它。
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/git-great-teeming-workspaces
|
||||
|
||||
作者:[Daniel Gryniewicz][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[lxbwolf](https://github.com/lxbwolf)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/dang
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer)
|
||||
[2]: https://github.com/dang/gtws
|
||||
[3]: https://docs.python.org/3/library/venv.html
|
@ -1,26 +1,28 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12160-1.html)
|
||||
[#]: subject: (MystiQ: A Free and Open Source Audio/Video Converter)
|
||||
[#]: via: (https://itsfoss.com/mystiq/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
MystiQ:一个免费开源音频/视频转换器
|
||||
MystiQ:一个自由开源的音视频转换器
|
||||
======
|
||||
|
||||
_**简述:MystiQ 是可用于 Linux 和 Windows 的新开源视频转换器工具。它的底层使用 FFMPEG,并为你提供基于 Qt 的整洁干净的图形界面。**_
|
||||
![](https://img.linux.net.cn/data/attachment/album/202004/28/223258cr9rxzyrj344kh68.jpg)
|
||||
|
||||
> MystiQ 是一款全新的开源视频转换工具,适用于 Linux 和 Windows。它的底层使用 FFMPEG,并为你提供了一个基于 Qt 的整洁干净的图形界面。
|
||||
|
||||
### MystiQ,一个基于 QT 的 FFmpeg GUI 前端
|
||||
|
||||
![][1]
|
||||
|
||||
一个音频/视频转换工具可为跨多个平台的每位计算机用户提供方便。
|
||||
音频/视频转换工具可为每位跨多个平台的计算机用户提供方便。
|
||||
|
||||
出于同样的原因,我着重介绍 [MystiQ][2] 是个好主意,这是一个相对较新的视频/音频转换器工具,可用于 Linux 和 Windows。截至目前,它还不支持 macOS,但可能会在不久的将来出现。
|
||||
出于同样的原因,我想着重介绍 [MystiQ][2] 是个好主意,这是一个相对较新的视频/音频转换器工具,适用于 Linux 和 Windows。截至目前,它还不支持 macOS,但可能会在不久的将来支持。
|
||||
|
||||
MystiQ 是基于 [Qt 5 界面][4]的 [FFmpeg][3] 图形前端。 现在,你可以随时[在 Linux 命令行中安装并使用 ffmpeg][5],但这不是很舒服,是吗? 这就是为什么 [Handbrake][6] 和 MystiQ 之类的工具可以使我们的生活更轻松的原因。
|
||||
MystiQ 是基于 [Qt 5 界面][4]的 [FFmpeg][3] 图形前端。现在,你可以随时[在 Linux 命令行中安装并使用 ffmpeg][5],但这不是很舒服,是吗?这就是为什么 [Handbrake][6] 和 MystiQ 之类的工具可以使我们的生活更方便的原因。
|
||||
|
||||
由于 MystiQ 基于 FFmpeg,因此你可以将其用于一些基本的视频编辑,例如修剪、旋转等。
|
||||
|
||||
@ -34,36 +36,31 @@ MystiQ 是基于 [Qt 5 界面][4]的 [FFmpeg][3] 图形前端。 现在,你可
|
||||
|
||||
* 视频转换
|
||||
* 音频转换(也可从视频中提取音频)
|
||||
* 支持格式:MP4、WEBM、MKV、MP3、MOV、OGG、WAV、ASF、FLV、3GP、M4A 等。
|
||||
* 支持的格式:MP4、WEBM、MKV、MP3、MOV、OGG、WAV、ASF、FLV、3GP、M4A 等。
|
||||
* 跨平台(Windows 和 Linux)
|
||||
* 适用于 32 位和 64 位系统的安装包
|
||||
* 能够调整音频质量(采样率、比特率等)进行转换
|
||||
* **基本视频编辑功能**(剪辑视频、插入字幕、旋转视频、缩放视频等)
|
||||
* 基本的视频编辑功能(剪辑视频、插入字幕、旋转视频、缩放视频等)
|
||||
* 将彩色视频转换为黑白
|
||||
* 可轻松转换视频的多个预设以获得最佳质量或获得最佳压缩效果。
|
||||
|
||||
|
||||
#### [在 Linux 中使用 SoundConverter 轻松转换音频文件格式][9]
|
||||
|
||||
如果你想将音频文件格式转换为 wav、mp3、ogg 或任何其他格式,SoundConverter 是你在 Linux 中所需的工具。
|
||||
* 有几个预设方案,可轻松转换视频以获得最佳质量或获得最佳压缩效果。
|
||||
|
||||
### 安装 MystiQ
|
||||
|
||||
你可能没有在软件中心中找到它,但将它安装在 Linux 发行版上非常容易。
|
||||
|
||||
它提供了 **.AppImage** 文件和 **.deb/.rpm** 文件(32 位和 64 位软件包)。如果你好奇想使用的话,可以阅读[如何使用 AppImage 文件][10]。
|
||||
它提供了 .AppImage 文件和 .deb / .rpm 文件(32 位和 64 位软件包)。如果你不清楚如何使用的话,可以阅读[如何使用 AppImage 文件][10]。
|
||||
|
||||
如果你想帮助他们测试软件进行改进,你还可以找到他们的 [GitHub 页面][11],并查看源码或任何近期的预发布软件包。
|
||||
|
||||
你可以在其官方网站下载适用于 Linux 和 Windows 的安装程序文件。
|
||||
|
||||
[下载 MystiQ][2]
|
||||
- [下载 MystiQ][2]
|
||||
|
||||
**总结**
|
||||
### 总结
|
||||
|
||||
在本文中,我使用 [Pop!\_OS][12] 20.04 测试了 MytiQ 转换器,并且在转换视频和音频时没遇到问题。而且,对于像我这样的普通用户来说,它的转换速度足够快。
|
||||
在本文中,我使用 [Pop!_OS][12] 20.04 测试了 MytiQ 转换器,并且在转换视频和音频时没遇到任何问题。而且,对于像我这样的普通用户来说,它的转换速度足够快。
|
||||
|
||||
请尝试一下,让我知道你对它的想法!另外,如果你在 Linux 上一直使用其他工具转换视频和音频,那它是什么?
|
||||
欢迎尝试一下,让我知道你对它的想法!另外,如果你在 Linux 上一直使用其他工具转换视频和音频,那它是什么?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -72,7 +69,7 @@ via: https://itsfoss.com/mystiq/
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,34 +1,30 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12165-1.html)
|
||||
[#]: subject: (How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux)
|
||||
[#]: via: (https://www.2daygeek.com/linux-unix-check-network-interfaces-names-nic-speed-ip-mac-address/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
如何在 Linux 上检查可用的网络接口、关联的 IP 地址、MAC 地址和接口速度
|
||||
如何在 Linux 上检查网卡信息
|
||||
======
|
||||
|
||||
默认在设置服务器时,你将配置主网络接口。
|
||||
![](https://img.linux.net.cn/data/attachment/album/202004/29/214835m1ms3n00s6qbcycz.jpg)
|
||||
|
||||
这是每个人所做的构建工作的一部分。
|
||||
默认情况下,在设置服务器时你会配置主网络接口。这是每个人所做的构建工作的一部分。有时出于各种原因,你可能需要配置额外的网络接口。
|
||||
|
||||
有时出于各种原因,你可能需要配置额外的网络接口。
|
||||
这可以是通过网络<ruby>绑定<rt>bonding</rt><ruby>/<ruby>协作<rt>teaming</rt></ruby>来提供高可用性,也可以是用于应用需求或备份的单独接口。
|
||||
|
||||
这可以是网络绑定/团队合作或高可用性,也可以是用于应用需求或备份的单独接口。
|
||||
为此,你需要知道计算机有多少接口以及它们的速度来配置它们。
|
||||
|
||||
为此,你需要知道计算机有多少接口以及它们的配置速度。
|
||||
|
||||
有许多命令可检查可用的网络接口,但是我们仅使用 IP 命令。
|
||||
|
||||
稍后,我们将使用所有这些工具编写单独的文章。
|
||||
有许多命令可检查可用的网络接口,但是我们仅使用 `ip` 命令。以后,我们会另外写一篇文章来全部介绍这些工具。
|
||||
|
||||
在本教程中,我们将向你显示可用网络网卡(NIC)信息,例如接口名称、关联的 IP 地址、MAC 地址和接口速度。
|
||||
|
||||
### 什么是 IP 命令
|
||||
### 什么是 ip 命令
|
||||
|
||||
**[IP 命令][1]**类似于 ifconfig, 用于分配静态 IP 地址、路由和默认网关等。
|
||||
[ip 命令][1] 类似于 `ifconfig`, 用于分配静态 IP 地址、路由和默认网关等。
|
||||
|
||||
```
|
||||
# ip a
|
||||
@ -47,15 +43,15 @@
|
||||
|
||||
### 什么是 ethtool 命令
|
||||
|
||||
ethtool 用于查询或控制网络驱动或硬件设置。
|
||||
`ethtool` 用于查询或控制网络驱动或硬件设置。
|
||||
|
||||
```
|
||||
# ethtool eth0
|
||||
```
|
||||
|
||||
### 1)如何在 Linux 上使用 IP 命令检查可用的网络接口
|
||||
### 1)如何在 Linux 上使用 ip 命令检查可用的网络接口
|
||||
|
||||
在不带任何参数的情况下运行 IP 命令时,它会提供大量信息,但是,如果仅需要可用的网络接口,请使用以下定制的 IP 命令。
|
||||
在不带任何参数的情况下运行 `ip` 命令时,它会提供大量信息,但是,如果仅需要可用的网络接口,请使用以下定制的 `ip` 命令。
|
||||
|
||||
```
|
||||
# ip a |awk '/state UP/{print $2}'
|
||||
@ -64,13 +60,13 @@ eth0:
|
||||
eth1:
|
||||
```
|
||||
|
||||
### 2)如何在 Linux 上使用 IP 命令检查网络接口的 IP 地址
|
||||
### 2)如何在 Linux 上使用 ip 命令检查网络接口的 IP 地址
|
||||
|
||||
如果只想查看 IP 地址分配给了哪个接口,请使用以下定制的 IP 命令。
|
||||
如果只想查看 IP 地址分配给了哪个接口,请使用以下定制的 `ip` 命令。
|
||||
|
||||
```
|
||||
# ip -o a show | cut -d ' ' -f 2,7
|
||||
or
|
||||
或
|
||||
ip a |grep -i inet | awk '{print $7, $2}'
|
||||
|
||||
lo 127.0.0.1/8
|
||||
@ -78,18 +74,18 @@ lo 127.0.0.1/8
|
||||
192.168.1.102/24
|
||||
```
|
||||
|
||||
### 3)如何在 Linux 上使用 IP 命令检查网卡的 MAC 地址
|
||||
### 3)如何在 Linux 上使用 ip 命令检查网卡的 MAC 地址
|
||||
|
||||
如果只想查看网络接口名称和相应的 MAC 地址,请使用以下格式。
|
||||
|
||||
检查特定的网络接口的 MAC 地址。
|
||||
检查特定的网络接口的 MAC 地址:
|
||||
|
||||
```
|
||||
# ip link show dev eth0 |awk '/link/{print $2}'
|
||||
00:00:00:55:43:5c
|
||||
```
|
||||
|
||||
检查所有网络接口的 MAC 地址。
|
||||
检查所有网络接口的 MAC 地址,创建该脚本:
|
||||
|
||||
```
|
||||
# vi /opt/scripts/mac-addresses.sh
|
||||
@ -97,12 +93,12 @@ lo 127.0.0.1/8
|
||||
#!/bin/sh
|
||||
ip a |awk '/state UP/{print $2}' | sed 's/://' | while read output;
|
||||
do
|
||||
echo $output:
|
||||
ethtool -P $output
|
||||
echo $output:
|
||||
ethtool -P $output
|
||||
done
|
||||
```
|
||||
|
||||
运行下面的 shell 脚本获取多个网络接口的 MAC 地址。
|
||||
运行该脚本获取多个网络接口的 MAC 地址:
|
||||
|
||||
```
|
||||
# sh /opt/scripts/mac-addresses.sh
|
||||
@ -115,9 +111,9 @@ Permanent address: 00:00:00:55:43:5d
|
||||
|
||||
### 4)如何在 Linux 上使用 ethtool 命令检查网络接口速度
|
||||
|
||||
如果要在 Linux 上检查网络接口速度,请使用 ethtool 命令。
|
||||
如果要在 Linux 上检查网络接口速度,请使用 `ethtool` 命令。
|
||||
|
||||
检查特定网络接口的速度。
|
||||
检查特定网络接口的速度:
|
||||
|
||||
```
|
||||
# ethtool eth0 |grep "Speed:"
|
||||
@ -125,7 +121,7 @@ Permanent address: 00:00:00:55:43:5d
|
||||
Speed: 10000Mb/s
|
||||
```
|
||||
|
||||
检查所有网络接口速度。
|
||||
检查所有网络接口速度,创建该脚本:
|
||||
|
||||
```
|
||||
# vi /opt/scripts/port-speed.sh
|
||||
@ -133,12 +129,12 @@ Speed: 10000Mb/s
|
||||
#!/bin/sh
|
||||
ip a |awk '/state UP/{print $2}' | sed 's/://' | while read output;
|
||||
do
|
||||
echo $output:
|
||||
ethtool $output |grep "Speed:"
|
||||
echo $output:
|
||||
ethtool $output |grep "Speed:"
|
||||
done
|
||||
```
|
||||
|
||||
运行以下 shell 脚本获取多个网络接口速度。
|
||||
运行该脚本获取多个网络接口速度:
|
||||
|
||||
```
|
||||
# sh /opt/scripts/port-speed.sh
|
||||
@ -151,7 +147,7 @@ Speed: 10000Mb/s
|
||||
|
||||
### 5)验证网卡信息的 Shell 脚本
|
||||
|
||||
通过此 **[shell 脚本][2]**,你可以收集上述所有信息,例如网络接口名称、网络接口的 IP 地址,网络接口的 MAC 地址以及网络接口的速度。
|
||||
通过此 shell 脚本你可以收集上述所有信息,例如网络接口名称、网络接口的 IP 地址,网络接口的 MAC 地址以及网络接口的速度。创建该脚本:
|
||||
|
||||
```
|
||||
# vi /opt/scripts/nic-info.sh
|
||||
@ -161,14 +157,14 @@ hostname
|
||||
echo "-------------"
|
||||
for iname in $(ip a |awk '/state UP/{print $2}')
|
||||
do
|
||||
echo "$iname"
|
||||
ip a | grep -A2 $iname | awk '/inet/{print $2}'
|
||||
ip a | grep -A2 $iname | awk '/link/{print $2}'
|
||||
ethtool $iname |grep "Speed:"
|
||||
echo "$iname"
|
||||
ip a | grep -A2 $iname | awk '/inet/{print $2}'
|
||||
ip a | grep -A2 $iname | awk '/link/{print $2}'
|
||||
ethtool $iname |grep "Speed:"
|
||||
done
|
||||
```
|
||||
|
||||
运行以下 shell 脚本检查网卡信息。
|
||||
运行该脚本检查网卡信息:
|
||||
|
||||
```
|
||||
# sh /opt/scripts/nic-info.sh
|
||||
@ -192,7 +188,7 @@ via: https://www.2daygeek.com/linux-unix-check-network-interfaces-names-nic-spee
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12158-1.html)
|
||||
[#]: subject: (Things You Should Know About Ubuntu 20.04)
|
||||
[#]: via: (https://itsfoss.com/ubuntu-20-04-faq/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
@ -10,13 +10,11 @@
|
||||
关于 Ubuntu 20.04 你应该了解的事情
|
||||
======
|
||||
|
||||
[Ubuntu 20.04][1] 即将发布,你可能对升级、安装等有一些问题和疑问。
|
||||
[Ubuntu 20.04][1] 已经发布,你可能对升级、安装等有一些问题和疑问。
|
||||
|
||||
我在各种社交媒体渠道上主持了一些问答环节,回答像你这样的读者的疑虑。
|
||||
我在各种社交媒体渠道上主持了一些问答环节,回答像你这样的读者的疑虑。我将列出这些关于 Ubuntu 20.04 的常见问题,并给出答案。我希望它能帮助你消除你的疑虑。如果你仍有问题,请随时在下面的评论栏提问。
|
||||
|
||||
我将列出这些关于Ubuntu 20.04的常见问题,并给出答案。我希望它能帮助你消除你的疑虑。如果你仍有问题,请随时在下面的评论栏提问。
|
||||
|
||||
### Ubuntu 20.04: 已回复的问题
|
||||
### Ubuntu 20.04:已回复的问题
|
||||
|
||||
![][2]
|
||||
|
||||
@ -28,25 +26,25 @@ Ubuntu 20.04 LTS 于 2020 年 4 月 23 日发布。所有变种,如 Kubuntu、
|
||||
|
||||
#### Ubuntu 20.04 的系统要求是什么?
|
||||
|
||||
对于默认的 GNOME 版本,应至少具有 4GB 的内存、2 GHz 双核处理器和至少 25GB 的磁盘空间。
|
||||
对于默认的 GNOME 版本,应至少具有 4GB 的内存、2GHz 双核处理器和至少 25GB 的磁盘空间。
|
||||
|
||||
其他 [Ubuntu 变种][3]可能有不同的系统要求。
|
||||
|
||||
#### 我可以在 32 位系统上使用 Ubuntu 20.04 吗?
|
||||
|
||||
完全不行。你不能在 32 位系统上使用 Ubuntu 20.04。即使你使用的是 32 位 Ubuntu 18.04,也不能升级到 Ubuntu 20.04。过去几年有 32 位的系统 ISO。
|
||||
完全不行。你不能在 32 位系统上使用 Ubuntu 20.04。即使你使用的是 32 位 Ubuntu 18.04,也不能升级到 Ubuntu 20.04。32 位的系统 ISO 是以前用的。
|
||||
|
||||
![Error while upgrading 32-bit Ubuntu 18.04 to Ubuntu 20.04][4]
|
||||
|
||||
#### 我可以在Ubuntu 20.04上使用 Wine 吗?
|
||||
#### 我可以在 Ubuntu 20.04 上使用 Wine 吗?
|
||||
|
||||
是的,你仍然可以在 Ubuntu 20.04 上使用 Wine,因为仍然有 32 位库,来用于 Wine 和 [Steam Play][5] 所需的软件包。
|
||||
是的,你仍然可以在 Ubuntu 20.04 上使用 Wine,因为仍然用于 Wine 和 [Steam Play][5] 软件包所需的 32 位库。
|
||||
|
||||
#### 我需要购买 Ubuntu 20.04 或许可证?
|
||||
|
||||
不,Ubuntu 是完全免费使用的。你不必像在 Windows 中那样购买许可证密钥或激活 Ubuntu。
|
||||
不,Ubuntu 完全可以免费使用。你不必像在 Windows 中那样购买许可证密钥或激活 Ubuntu。
|
||||
|
||||
Ubuntu 的下载页会请求你捐赠一些资金,如果你想捐赠一些钱来帮助开发这个系统,这完全取决于你。
|
||||
Ubuntu 的下载页会请求你捐赠一些资金,如果你想为开发这个强大的操作系统捐钱,由你自己决定。
|
||||
|
||||
#### GNOME 版本是什么?
|
||||
|
||||
@ -54,21 +52,23 @@ Ubuntu 20.04 有 GNOME 3.36。
|
||||
|
||||
#### Ubuntu 20.04 的性能是否优于 Ubuntu 18.04?
|
||||
|
||||
是的,在几个方面。Ubuntu 20.04 安装速度更快,甚至加速更快。我在 4:40 的视频中展示了性能比较。
|
||||
是的,在几个方面。Ubuntu 20.04 系统速度更快,甚至超快。我在下面这个视频的 4:40 处展示了性能对比。
|
||||
|
||||
在 GNOME 3.36 中,滚动、窗口动画和其他 UI 元素更加流畅,并提供了更流畅的体验。
|
||||
- [video](https://img.linux.net.cn/static/video/Top%207%20Best%20Features%20You%27ll%20Love%20in%20Ubuntu%2020.04-lpq8pm_xkSE.mp4)
|
||||
|
||||
在 GNOME 3.36 中,滚动、窗口动画和其他 UI 元素更加流畅,提供了更流畅的体验。
|
||||
|
||||
#### Ubuntu 20.04 将支持多长时间?
|
||||
|
||||
它是一个长期支持 (LTS) 版本,与任何 LTS 版本一样,它将在五年内得到支持。这意味着 Ubuntu 20.04 将在 2025 年 4 月之前获得安全和维护更新。
|
||||
它是一个长期支持(LTS)版本,与任何 LTS 版本一样,它将在五年内得到支持。这意味着 Ubuntu 20.04 将在 2025 年 4 月之前获得安全和维护更新。
|
||||
|
||||
#### 升级到 Ubuntu 20.04 时,是否会丢失数据?
|
||||
|
||||
你可以从 Ubuntu 19.10 或 Ubuntu 18.04 升级到 Ubuntu 20.04。你无需创建 live USB 并从中安装。你所需要的是一个良好的互联网连接,来下载约1.5GB 的数据。
|
||||
你可以从 Ubuntu 19.10 或 Ubuntu 18.04 升级到 Ubuntu 20.04。你无需创建 live USB 并从中安装。你所需要的是一个良好的互联网连接,来下载约 1.5GB 的数据。
|
||||
|
||||
从现有系统升级不会破坏你的文件。你应该会有所有文件,并且大多数现有软件应具有相同的版本或升级后的版本。
|
||||
从现有系统升级不会破坏你的文件。你应该会留有所有文件,并且大多数现有软件应具有相同的版本或升级后的版本。
|
||||
|
||||
如果你使用了某些第三方工具或[其他 PPA][6],升级过程将禁用它们。如果 Ubuntu 20.04 适合这些其他存储库,那么可以再次启用它们。
|
||||
如果你使用了某些第三方工具或[其他 PPA][6],升级过程将禁用它们。如果 Ubuntu 20.04 可以使用这些其他存储库,那么可以再次启用它们。
|
||||
|
||||
升级大约需要一个小时,重启后,你将登录到新版本。
|
||||
|
||||
@ -78,21 +78,21 @@ Ubuntu 20.04 有 GNOME 3.36。
|
||||
|
||||
![][7]
|
||||
|
||||
如果你正在使用 Ubuntu 19.10 并有正确的更新设置(如前面部分所述),那么应在 Ubuntu 18.04 后的几天内通知你升级到 Ubuntu 20.04。
|
||||
如果你正在使用 Ubuntu 19.10 并有正确的更新设置(如前面部分所述),那么应在发布后的几天内通知你升级到 Ubuntu 20.04。
|
||||
|
||||
对于 Ubuntu 18.04 用户,可能需要几周时间才能正式通知他们 Ubuntu 18.04 可用。可能,你可能会在第一个点版本 Ubuntu 20.04.1 后获得提示。
|
||||
对于 Ubuntu 18.04 用户,可能需要几周时间才能正式通知他们 Ubuntu 20.04 可用。可能,你可能会在第一个点版本 Ubuntu 20.04.1 后获得提示。
|
||||
|
||||
#### 如果我升级到 Ubuntu 20.04,我可以降级到 19.10 或 18.04 吗?
|
||||
|
||||
不行。虽然升级到新版本很容易,但无法选择降级。 如果你想回到 Ubuntu 18.04,你将重新[安装 Ubuntu18.04][8]。
|
||||
不行。虽然升级到新版本很容易,但无法选择降级。如果你想回到 Ubuntu 18.04,你需要重新[安装 Ubuntu 18.04][8]。
|
||||
|
||||
#### 我使用的是 Ubuntu 18.04 LTS。我应该升级到 Ubuntu 20.04 LTS 吗?
|
||||
|
||||
这取决于你。如果你对 Ubuntu 20.04 中的新功能印象深刻,并希望上手尝试,那么你应该升级。
|
||||
|
||||
如果你想要一个更稳定的系统,我建议等待第一个点版本 Ubuntu 20.04.1,新版本将有 bug 修复。20.04.1 通常在 Ubuntu 20.04 发布后大约两个月到来。
|
||||
如果你想要一个更稳定的系统,我建议等待第一个点版本 Ubuntu 20.04.1,新版本会有 bug 修复。20.04.1 通常在 Ubuntu 20.04 发布后大约两个月到来。
|
||||
|
||||
其他情况下,我建议尽早升级到 Ubuntu 20.04。Ubuntu 20.04 具有更新的内核、性能改进,尤其是仓库中有更新版本的软件。
|
||||
无论是那种情况,我都建议你或早或晚升级到 Ubuntu 20.04。Ubuntu 20.04 具有更新的内核、性能改进,尤其是仓库中有更新版本的软件。
|
||||
|
||||
在外部磁盘上进行备份,并且有良好的互联网连接,升级不应成为问题。
|
||||
|
||||
@ -113,13 +113,13 @@ via: https://itsfoss.com/ubuntu-20-04-faq/
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/ubuntu-20-04-release-features/
|
||||
[1]: https://linux.cn/article-12142-1.html
|
||||
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu_20_04_faq.jpg?ssl=1
|
||||
[3]: https://itsfoss.com/which-ubuntu-install/
|
||||
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-32-bit.jpg?ssl=1
|
@ -0,0 +1,56 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (CrazyShipOne)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12157-1.html)
|
||||
[#]: subject: (What you need to know about open source ad blockers)
|
||||
[#]: via: (https://opensource.com/article/20/4/ad-blockers)
|
||||
[#]: author: (Joshua Pearce https://opensource.com/users/jmpearce)
|
||||
|
||||
开源的广告拦截器不但节能,而且能拯救生命!
|
||||
======
|
||||
> 三个开源广告拦截器与“无广告拦截器”对照组进行了测试。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202004/27/220109b86sidn56sn6inoh.jpg)
|
||||
|
||||
一项旨在调查自由开源的广告拦截器节能的情况的[研究][2],意外地发现了互联网广告正在浪费你大量的时间。
|
||||
|
||||
更重要的是,研究结果表明了你可以挽救回这些失去的时间。这项研究评估发现,使用 [uBlock Origin][3](一个开源免费的广告拦截器)的情况下平均每个网民一年可以节约超过 100 个小时的时间。uBlock Origin 是测试中最有效的广告拦截器,不过其他的广告拦截器也为网民节省了时间、能源以及金钱。
|
||||
|
||||
![Ad blocker screen comparison][4]
|
||||
|
||||
在研究结果中,[AdBlock+][5] 减少了 11% 的页面加载时间,[Privacy Badger][6] 减少了 22%,[uBlock Origin][3] 减少了 28%。对于单独一个页面来说这个时间並不算多,但是网民们一半以上的浏览时间都是在网站间快速跳转,通常在一个页面停留少于 15 秒。鉴于这种情况,加载广告的额外时间加起来就很多了。
|
||||
|
||||
发布于 Technologies 杂志上的《[用开源的广告拦截器节能][7]》一文最初旨在解决日益增长的能源消耗问题。随着全球网民每日上网时间超过 6.5 小时,与互联网相关的用电量正在快速地增加。以美国人为例,自 2000 年他们的上网时间已经增加了一倍,几乎达到每周 24 小时。开源广告拦截器通过消灭上网和观看视频时产生的广告,潜在地减少了时间,从而减少用电。
|
||||
|
||||
在研究过程中,对三个开源广告拦截器与“无广告拦截器”对照组进行了测试。研究人员记录了浏览全球访问量最大的网站的页面加载时间,其中包括网络搜索(谷歌、雅虎、必应)、信息(Weather.com、维基百科)和新闻网站(CNN、福克斯、纽约时报)。除此之外,研究还分析了观看流行与非流行视频内容时广告所花费的时间。这部分研究由于缺乏 Youtube 上流行和非流行内容观看比例的数据而非常具有挑战性。每个视频浪费在广告观看上的时间可以从 0.06% 到惊人的 21% 不等。而且,这还只是浏览器上记录的加载广告而失去的时间。
|
||||
|
||||
总的来说,研究结果表明加载广告所浪费的能源并不是是小事。由于运行电脑所使用的大量电力仍然来自于煤炭,而煤炭会造成空气污染和过早死亡,因此该研究分析了广告拦截器拯救美国人生命的潜力。(LCTT 译注:由于这项研究是美国人完成的,所以这里仅提及了美国人,但是同理可推至全球。)结果是令人震惊的:如果美国人都使用开源广告拦截器,每年节约的能源将会拯救超过 36 个美国人的生命。
|
||||
|
||||
电能即金钱,所以削减广告也可以为消费者节约钱财。在美国,如果所有的网民都在他们的电脑上开启 [Privacy Badger][8],美国人每年可以节约超过 9100 万美元。在全球范围内,调查研究的结果则更令人吃惊。uBlock Origin 每年可以为全球消费者节约 18 亿美元。
|
||||
|
||||
这项研究始于人们因为新冠肺炎大流行而被迫居家之前,因此所有的数据都可以被认为是保守的估算。整体来说,研究发现了开源广告拦截器是一项潜在的节能技术。
|
||||
|
||||
虽然自由开源的广告拦截器可以节约能源,对自然环境也有好处,但你可能主要是为了拦截恼人的广告和节省自己的时间而使用它们。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/ad-blockers
|
||||
|
||||
作者:[Joshua Pearce][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[CrazyShipOne](https://github.com/CrazyShipOne)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/jmpearce
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things)
|
||||
[2]: https://www.mdpi.com/2227-7080/8/2/18
|
||||
[3]: https://github.com/gorhill/uBlock
|
||||
[4]: https://opensource.com/sites/default/files/uploads/os_ad_blocker_story_.png (Ad blocker screen comparison)
|
||||
[5]: https://adblockplus.org/
|
||||
[6]: https://privacybadger.org/
|
||||
[7]: https://www.academia.edu/42434401/Energy_Conservation_with_Open_Source_Ad_Blockers
|
||||
[8]: https://privacybadger.org/
|
@ -0,0 +1,76 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12168-1.html)
|
||||
[#]: subject: (What Happened to IPv5? Why there is IPv4, IPv6 but no IPv5?)
|
||||
[#]: via: (https://itsfoss.com/what-happened-to-ipv5/)
|
||||
[#]: author: (John Paul https://itsfoss.com/author/john/)
|
||||
|
||||
IPv5 发生了什么?为什么有 IPv4、IPv6 但没有 IPv5?
|
||||
======
|
||||
|
||||
如果你花过很多时间在互联网上,那么你应该已经听说过计算机每天使用的 IPv4 和 IPv6 协议。
|
||||
|
||||
你可能会问的一个问题是:为什么没有 IPv5?为什么 IPv6 在 IPv4 之后而不是 IPv5 之后出现?是否有 IPv5,如果是,那么 IPv5 发生了什么?
|
||||
|
||||
答案是肯定的,曾经有一个 IPv5。让我解释一下这里发生的事。
|
||||
|
||||
### 互联网的早期历史
|
||||
|
||||
![ARPA Logical Map in 1977 | Image courtesy: Wikipedia][1]
|
||||
|
||||
在 1960 年代后期,美国国防部的[高级研究计划局][2](DARPA)发起了一个[项目][3]来连接全国的计算机。最初的目标是创建一个由全国 ARPA 资助的所有计算机组成的网络系统。
|
||||
|
||||
由于这是第一次将如此规模的网络整合在一起,因此他们也在不断发展自己的技术和硬件。他们首先做的工作之一就是开发名为<ruby>[传输控制协议][4]<rt>Transmission Control Protocol</rt></ruby>(TCP)的<ruby>互联网协议<rt>Internet Protocol</rt></ruby>(IP)。该协议“可靠、有序,并会对运行于通过 IP 网络传输的主机上的应用的八进制(字节)流通讯进行错误检测”。简单来说,它可以确保数据安全到达。
|
||||
|
||||
最初,TCP 被设计为[“主机级别的端到端协议以及封装和路由协议”][5]。但是,他们意识到他们需要拆分协议以使其更易于管理。于是决定由 IP 协议处理封装和路由。
|
||||
|
||||
那时,TCP 已经经历了三个版本,因此新协议被称为 IPv4。
|
||||
|
||||
### IPv5 的诞生
|
||||
|
||||
IPv5 开始时有个不同的名字:<ruby>互联网流协议<rt>Internet Stream Protocol</rt></ruby>(ST)。它是[由 Apple、NeXT 和 Sun Microsystems][6] 为试验流式语音和视频而创建的。
|
||||
|
||||
该新协议能够“在保持通信的同时,以特定频率传输数据包”。
|
||||
|
||||
### 那么 IPv5 发生了什么?
|
||||
|
||||
![][7]
|
||||
|
||||
IPv5 从未被接受为正式的互联网协议。这主要是由于 32 位限制。
|
||||
|
||||
IPV5 使用与 IPv4 相同的寻址系统。每个地址由 0 到 255 之间的四组数字组成。这将可能的地址数量限制为 [43 亿][6]个。
|
||||
|
||||
在 1970 年代初,这似乎比全世界所需要的还要多。但是,互联网的爆炸性增长证明了这一想法是错误的。2011 年,世界上的IPv4地址正式用完了。
|
||||
|
||||
在 1990 年代,一个新项目开始致力于研究下一代互联网协议(IPng)。这形成了 128 位的 IPv6。IPv6 地址包含 [“8 组 4 字符的十六进制数字”][6],它可以包含从 0 到 9 的数字和从 A 到 F 的字母。与 IPv4 不同,IPv6 拥有数万亿个可能的地址,因此我们应该能安全一阵子。
|
||||
|
||||
同时,IPv5 奠定了 VoIP 的基础,而该技术已被我们用于当今世界范围内的通信。**因此,我想在某种程度上,你可以说 IPv5 仍然可以保留到了今天**。
|
||||
|
||||
希望你喜欢有关互联网历史的轶事。你可以阅读其他[关于 Linux 和技术的琐事文章][8]。
|
||||
|
||||
如果你觉得这篇文章有趣,请花一点时间在社交媒体、Hacker News 或 [Reddit][9] 上分享它。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/what-happened-to-ipv5/
|
||||
|
||||
作者:[John Paul][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/john/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/Arpa_internet.png?fit=800%2C573&ssl=1
|
||||
[2]: https://en.wikipedia.org/wiki/DARPA
|
||||
[3]: https://en.wikipedia.org/wiki/ARPANET
|
||||
[4]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol
|
||||
[5]: https://fcw.com/articles/2006/07/31/what-ever-happened-to-ipv5.aspx
|
||||
[6]: https://www.lifewire.com/what-happened-to-ipv5-3971327
|
||||
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/what-happened-to-ipv5.png?ssl=1
|
||||
[8]: https://itsfoss.com/category/story/
|
||||
[9]: https://reddit.com/r/linuxusersgroup
|
77
published/202004/20200428 Fedora 32 is officially here.md
Normal file
77
published/202004/20200428 Fedora 32 is officially here.md
Normal file
@ -0,0 +1,77 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12164-1.html)
|
||||
[#]: subject: (Fedora 32 is officially here!)
|
||||
[#]: via: (https://fedoramagazine.org/announcing-fedora-32/)
|
||||
[#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/)
|
||||
|
||||
Fedora 32 正式发布!
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
它来了! 我们很荣幸地宣布 Fedora 32 的发布。感谢成千上万的 Fedora 社区成员和贡献者的辛勤工作,我们又一次准时发布了。
|
||||
|
||||
如果你只想马上就能拿到它,请马上访问 <https://getfedora.org/>。更多详情,请继续阅读本文。
|
||||
|
||||
### Fedora 的全部变种
|
||||
|
||||
Fedora Editions 是针对特定的“展示”用途输出的。
|
||||
|
||||
Fedora Workstation 专注于桌面系统。特别是,它面向的是那些希望获得“可以工作的” Linux 操作系统体验的软件开发者。这个版本采用了 [GNOME 3.36][2],一如既往地有很多很棒的改进。我最喜欢的是新的锁屏!
|
||||
|
||||
Fedora Server 以一种易于部署的方式为系统管理员带来了新锐的开源服务器软件。对于边缘计算用例,[Fedora IoT][3] 为 IoT 生态系统提供了坚实的基础。
|
||||
|
||||
Fedora CoreOS 是一个新兴的 Fedora Edition。它是一个自动更新的、最小化的操作系统,用于安全地大规模运行容器化工作负载。它提供了几个[更新流][4],遵循大约每两周一次的自动更新。目前,next 流是基于 Fedora 32,后续还有 testing 流和 stable 流。你可以从[下载页面][5]中找到关于按 next 流发布的工件的信息,并在 [Fedora CoreOS 文档][6]中找到关于如何使用这些工件的信息。
|
||||
|
||||
当然,我们制作的不仅仅是 Editions。[Fedora Spins][7] 和[实验室][8]针对的是不同的受众和用例,包括[Fedora 天文学实验室][9],它为业余和专业的天文学家带来了完整的开源工具链,还有像 [KDE Plasma][10] 和 [Xfce][11] 这样的桌面环境。Fedora 32 中新增的 [计算神经科学实验室][12] 是由我们的神经科学特别兴趣小组开发的,它可以实现计算神经科学。
|
||||
|
||||
还有,别忘了我们的备用架构,[ARM AArch64、Power 和 S390x][13]。特别值得一提的是,我们改进了对 Rockchip 系统级芯片的支持,包括 Rock960、RockPro64 和 Rock64。
|
||||
|
||||
### 一般性的改进
|
||||
|
||||
无论你使用 Fedora 的哪个变体,你都能获得最新的开源世界。遵循我们的“[First][14]”理念,我们更新了关键的编程语言和系统库包,包括 GCC 10、Ruby 2.7 和 Python 3.8。当然,随着 Python 2 已经过了报废期,我们已经从 Fedora 中删除了大部分 Python 2 包,但我们为仍然需要它的开发者和用户提供了一个遗留的 python27 包。在 Fedora Workstation 中,我们默认启用了 EarlyOOM 服务,以改善低内存情况下的用户体验。
|
||||
|
||||
我们非常期待你能尝试一下新版本的使用体验! 现在就去 <https://getfedora.org/> 下载它。或者如果你已经在运行 Fedora 操作系统,请按照简单的[升级说明][15]进行升级。
|
||||
|
||||
### 万一出现问题……
|
||||
|
||||
如果你遇到问题,请查看[Fedora 32 常见错误][16]页面,如果有问题,请访问我们的 [Askedora][17] 用户支持平台。
|
||||
|
||||
### 谢谢大家
|
||||
|
||||
感谢在这个发布周期中为 Fedora 项目做出贡献的成千上万的人,特别是感谢那些在大流行期间为又一次准时发布而付出额外努力的人。Fedora 是一个社区,很高兴看到我们彼此之间的支持。我邀请大家参加 4 月28-29 日的[红帽峰会虚拟体验][18],了解更多关于 Fedora 和其他社区的信息。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/announcing-fedora-32/
|
||||
|
||||
作者:[Matthew Miller][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/mattdm/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/f32-final-816x345.png
|
||||
[2]: https://www.gnome.org/news/2020/03/gnome-3-36-released/
|
||||
[3]: https://iot.fedoraproject.org/
|
||||
[4]: https://docs.fedoraproject.org/en-US/fedora-coreos/update-streams/
|
||||
[5]: https://getfedora.org/en/coreos/download?stream=next
|
||||
[6]: https://docs.fedoraproject.org/en-US/fedora-coreos/getting-started/
|
||||
[7]: https://spins.fedoraproject.org/
|
||||
[8]: https://labs.fedoraproject.org/
|
||||
[9]: https://labs.fedoraproject.org/en/astronomy/
|
||||
[10]: https://spins.fedoraproject.org/en/kde/
|
||||
[11]: https://spins.fedoraproject.org/en/xfce/
|
||||
[12]: https://labs.fedoraproject.org/en/comp-neuro
|
||||
[13]: https://alt.fedoraproject.org/alt/
|
||||
[14]: https://docs.fedoraproject.org/en-US/project/#_first
|
||||
[15]: https://docs.fedoraproject.org/en-US/quick-docs/upgrading/
|
||||
[16]: https://fedoraproject.org/wiki/Common_F32_bugs
|
||||
[17]: http://ask.fedoraproject.org
|
||||
[18]: https://www.redhat.com/en/summit
|
@ -0,0 +1,110 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12166-1.html)
|
||||
[#]: subject: (Manjaro 20 Lysia Arrives with ZFS and Snap Support)
|
||||
[#]: via: (https://itsfoss.com/manjaro-20-release/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
Manjaro 20 Lysia 到来,支持 ZFS 和 Snap
|
||||
======
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202004/29/232925j8paomvp11pfu12v.jpg)
|
||||
|
||||
> Manjaro Linux 刷新了其 Manjaro 20 “Lysia” 的 ISO。现在在 Pamac 中支持了 Snap 和 Flatpak 软件包。在 Manjaro Architect 安装程序中增加了 ZFS 选项,并使用最新的内核 5.6 作为基础。
|
||||
|
||||
最近新的发行版的发布像下雨一样。在上周发布了 [Ubuntu 20.04 LTS](https://linux.cn/article-12142-1.html) ,紧接着 [Fedora 32](https://linux.cn/article-12164-1.html) 也刚刚发布,而现在 [Manjaro 发布了版本 20][1],代号为 Lysia。
|
||||
|
||||
### Manjaro 20 Lysia 有什么新东西?
|
||||
|
||||
其实有很多。让我给大家介绍一下 Manjaro 20 中的一些主要新功能。
|
||||
|
||||
#### 新的抹茶主题
|
||||
|
||||
Manjaro 20 有一个新的默认主题,名为 Matcha(抹茶)。它让桌面看起来更有质感。
|
||||
|
||||
![][2]
|
||||
|
||||
#### 对 Snap 和 Flatpak 的支持
|
||||
|
||||
Snap 和 Flatpak 软件包的支持得到了改进。如果你愿意,你可以在命令行中使用它们。
|
||||
|
||||
你还可以在 Pamac 图形界面包管理器中启用 Snap 和 Flatpak 支持。
|
||||
|
||||
![Enable Snap support in Pamac Manjaro][3]
|
||||
|
||||
启用后,你可以在 Pamac 软件管理器中找到并安装 Snap/Flatpak 应用程序。
|
||||
|
||||
![Snap applications in Pamac][4]
|
||||
|
||||
#### Pamac 提供了基于搜索安装新软件的方式(在 GNOME 中)
|
||||
|
||||
在 GNOME 变种中,如果你搜索某个东西,Pamac 软件管理器会提供安装符合查询的软件。在其他使用 GNOME 桌面的发行版中,GNOME 软件中心也会这样做。
|
||||
|
||||
#### ZFS 支持登陆了 Manjaro Architect
|
||||
|
||||
现在,你可以在 Manjaro Linux 中轻松地使用 ZFS 作为根文件系统。在 [Manjaro Architect][6] 中提供了对 [ZFS 文件系统][5]的支持。
|
||||
|
||||
请注意,我说的是 Manjaro Architect,即基于终端的安装程序。它和普通的图形化的 [Calamares 安装程序][7]不一样。
|
||||
|
||||
![][8]
|
||||
|
||||
#### Linux kernel 5.6
|
||||
|
||||
最新的稳定版 [Linux 内核 5.6][9] 带来了更多的硬件支持,如 thunderbolt、Nvidia 和 USB4。你也可以使用 [WireGuard VPN][10]。
|
||||
|
||||
![][11]
|
||||
|
||||
#### 其他杂项变化
|
||||
|
||||
* 新的桌面环境版本:Xfce 4.14、GNOME 3.36 和 KDE Plasma 5.18。
|
||||
* 新的默认 shell 是 zsh。
|
||||
* Display-Profiles 允许你存储一个或多个配置文件,用于你的首选显示配置。
|
||||
* 改进后的 Gnome-Layout-Switcher。
|
||||
* 最新的驱动程序。
|
||||
* 改进和完善了 Manjaro 工具。
|
||||
|
||||
### 如何取得 Manjaro 20 Lysia?
|
||||
|
||||
如果你已经在使用 Manjaro,只需更新你的 Manjaro Linux 系统,你就应该已经在使用 Lysia 了。
|
||||
|
||||
Manjaro 采用了滚动发布模式,这意味着你不必手动从一个版本升级到另一个版本。只要有新的版本发布,不需要重新安装就可以使用了。
|
||||
|
||||
既然 Manjaro 是滚动发布的,为什么每隔一段时间就会发布一个新版本呢?这是因为他们要刷新 ISO,这样下载 Manjaro 的新用户就不用再安装过去几年的更新了。这就是为什么 Arch Linux 也会每个月刷新一次 ISO 的原因。
|
||||
|
||||
Manjaro 的“ISO 刷新”是有代号和版本的,因为它可以帮助开发者清楚地标明每个开发阶段的发展方向。
|
||||
|
||||
所以,如果你已经在使用它,只需使用 Pamac 或命令行[更新你的 Manjaro Linux 系统][12]即可。
|
||||
|
||||
如果你想尝试 Manjaro 或者想使用 ZFS,那么你可以通过从它的网站上[下载 ISO][14] 来[安装 Manjaro][13]。
|
||||
|
||||
愿你喜欢新的 Manjaro Linux 发布。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/manjaro-20-release/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://forum.manjaro.org/t/manjaro-20-0-lysia-released/138633
|
||||
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/manjaro-20-lysia.jpeg?resize=800%2C440&ssl=1
|
||||
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/enable-snap-in-pamac-manjaro.jpg?resize=800%2C490&ssl=1
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/snap-app-pacman.jpg?resize=800%2C489&ssl=1
|
||||
[5]: https://itsfoss.com/what-is-zfs/
|
||||
[6]: https://itsfoss.com/manjaro-architect-review/
|
||||
[7]: https://calamares.io/
|
||||
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/pacman-prompts-install-apps.jpg?resize=800%2C331&ssl=1
|
||||
[9]: https://itsfoss.com/linux-kernel-5-6/
|
||||
[10]: https://itsfoss.com/wireguard/
|
||||
[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/manjaro-20-neofetch-screen.jpg?resize=800%2C495&ssl=1
|
||||
[12]: https://itsfoss.com/update-arch-linux/
|
||||
[13]: https://itsfoss.com/install-manjaro-linux/
|
||||
[14]: https://manjaro.org/download/
|
@ -0,0 +1,80 @@
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "tinyeyeser"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-12191-1.html"
|
||||
[#]: subject: "How to avoid man-in-the-middle cyber attacks"
|
||||
[#]: via: "https://opensource.com/article/20/4/mitm-attacks"
|
||||
[#]: author: "Jackie Lam https://opensource.com/users/beenverified"
|
||||
|
||||
如何避免中间人攻击(MITM)
|
||||
======
|
||||
|
||||
> 首先搞明白到底什么是中间人攻击(MITM),才能避免成为此类高科技窃听的受害者。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202005/07/100655i7og1eqsw6o3ww81.jpg)
|
||||
|
||||
当你使用电脑发送数据或与某人在线通话的时候,你一定采取了某种程度的安全隐私手段。
|
||||
|
||||
但如果有第三方在你不知情的情况下窃听,甚至冒充某个你信任的商业伙伴窃取破坏性的信息呢?你的私人数据就这样被放在了危险分子的手中。
|
||||
|
||||
这就是臭名昭著的<ruby>中间人攻击<rt>man-in-the-middle</rt></ruby>(MITM)。
|
||||
|
||||
### 到底什么是中间人攻击?
|
||||
|
||||
黑客潜入到你与受害者或是某个设备间的通信过程中,窃取敏感信息(多数是身份信息)进而从事各种违法行为的过程,就是一次中间人攻击。Scamicide 公司创始人 Steve J. J. Weisman 介绍说:
|
||||
|
||||
> “中间人攻击也可以发生在受害者与某个合法 app 或网页中间。当受害者以为自己面对的是正常 app 或网页时,其实 Ta 正在与一个仿冒的 app 或网页互动,将自己的敏感信息透露给了不法分子。”
|
||||
|
||||
中间人攻击诞生于 1980 年代,是最古老的网络攻击形式之一。但它却更为常见。Weisman 解释道,发生中间人攻击的场景有很多种:
|
||||
|
||||
* **攻陷一个未有效加密的 WiFi 路由器**:该场景多见于人们使用公共 WiFi 的时候。“虽然家用路由器也很脆弱,但黑客攻击公共 WiFi 网络的情况更为常见。”Weisman 说,“黑客的目标就是从毫无戒心的人们那里窃取在线银行账户这样的敏感信息。”
|
||||
* **攻陷银行、金融顾问等机构的电子邮件账户**:“一旦黑客攻陷了这些电子邮件系统,他们就会冒充银行或此类公司给受害者发邮件”,Weisman 说,”他们以紧急情况的名义索要个人信息,诸如用户名和密码。受害者很容易被诱骗交出这些信息。”
|
||||
* **发送钓鱼邮件**:窃贼们还可能冒充成与受害者有合作关系的公司,向其索要个人信息。“在多个案例中,钓鱼邮件会引导受害者访问一个伪造的网页,这个伪造的网页看起来就和受害者常常访问的合法公司网页一模一样。”Weisman 说道。
|
||||
* **在合法网页中嵌入恶意代码**:攻击者还会把恶意代码(通常是 JavaScript)嵌入到一个合法的网页中。“当受害者加载这个合法网页时,恶意代码首先按兵不动,直到用户输入账户登录或是信用卡信息时,恶意代码就会复制这些信息并将其发送至攻击者的服务器。”网络安全专家 Nicholas McBride 介绍说。
|
||||
|
||||
### 有哪些中间人攻击的著名案例?
|
||||
|
||||
联想作为主流的计算机制造厂商,在 2014 到 2015 年售卖的消费级笔记本电脑中预装了一款叫做 VisualDiscovery 的软件,拦截用户的网页浏览行为。当用户的鼠标在某个产品页面经过时,这款软件就会弹出一个来自合作伙伴的类似产品的广告。
|
||||
|
||||
这起中间人攻击事件的关键在于:VisualDiscovery 拥有访问用户所有私人数据的权限,包括身份证号、金融交易信息、医疗信息、登录名和密码等等。所有这些访问行为都是在用户不知情和未获得授权的情况下进行的。联邦交易委员会(FTC)认定此次事件为欺诈与不公平竞争。2019 年,联想同意为此支付 8300 万美元的集体诉讼罚款。
|
||||
|
||||
### 我如何才能避免遭受中间人攻击?
|
||||
|
||||
* **避免使用公共 WiFi**:Weisman 建议,从来都不要使用公开的 WiFi 进行金融交易,除非你安装了可靠的 VPN 客户端并连接至可信任的 VPN 服务器。通过 VPN 连接,你的通信是加密的,信息也就不会失窃。
|
||||
* **时刻注意:**对要求你更新密码或是提供用户名等私人信息的邮件或文本消息要时刻保持警惕。这些手段很可能被用来窃取你的身份信息。
|
||||
|
||||
如果不确定收到的邮件来自于确切哪一方,你可以使用诸如电话反查或是邮件反查等工具。通过电话反查,你可以找出未知发件人的更多身份信息。通过邮件反查,你可以尝试确定谁给你发来了这条消息。
|
||||
|
||||
通常来讲,如果发现某些方面确实有问题,你可以听从公司中某个你认识或是信任的人的意见。或者,你也可以去你的银行、学校或其他某个组织,当面寻求他们的帮助。总之,重要的账户信息绝对不要透露给不认识的“技术人员”。
|
||||
|
||||
* **不要点击邮件中的链接**:如果有人给你发了一封邮件,说你需要登录某个账户,不要点击邮件中的链接。相反,要通过平常习惯的方式自行去访问,并留意是否有告警信息。如果在账户设置中没有看到告警信息,给客服打电话的时候也*不要*联系邮件中留的电话,而是联系站点页面中的联系人信息。
|
||||
* **安装可靠的安全软件**:如果你使用的是 Windows 操作系统,安装开源的杀毒软件,如 [ClamAV][2]。如果使用的是其他平台,要保持你的软件安装有最新的安全补丁。
|
||||
* **认真对待告警信息**:如果你正在访问的页面以 HTTPS 开头,浏览器可能会出现一则告警信息。例如,站点证书的域名与你尝试访问的站点域名不相匹配。千万不要忽视此类告警信息。听从告警建议,迅速关掉页面。确认域名没有输入错误的情况下,如果情况依旧,要立刻联系站点所有者。
|
||||
* **使用广告屏蔽软件**:弹窗广告(也叫广告软件攻击)可被用于窃取个人信息,因此你还可以使用广告屏蔽类软件。对个人用户来说,中间人攻击其实是很难防范的,因为它被设计出来的时候,就是为了让受害者始终蒙在鼓里,意识不到任何异常。有一款不错的开源广告屏蔽软件叫 [uBlock origin][4]。可以同时支持 Firefox 和 Chromium(以及所有基于 Chromium 的浏览器,例如 Chrome、Brave、Vivaldi、Edge 等),甚至还支持 Safari。
|
||||
|
||||
### 保持警惕
|
||||
|
||||
要时刻记住,你并不需要立刻就点击某些链接,你也并不需要听从某个陌生人的建议,无论这些信息看起来有多么紧急。互联网始终都在。你大可以先离开电脑,去证实一下这些人的真实身份,看看这些“无比紧急”的页面到底是真是假。
|
||||
|
||||
尽管任何人都可能遭遇中间人攻击,只要弄明白何为中间人攻击,理解中间人攻击如何发生,并采取有效的防范措施,就可以保护自己避免成为其受害者。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/mitm-attacks
|
||||
|
||||
作者:[Jackie Lam][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[tinyeyeser](https://github.com/tinyeyeser)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/beenverified
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security_password_chaos_engineer_monster.png?itok=J31aRccu "Security monster"
|
||||
[2]: https://www.clamav.net
|
||||
[3]: https://opensource.com/article/20/1/stop-typosquatting-attacks
|
||||
[4]: https://github.com/gorhill/uBlock
|
||||
[5]: https://www.beenverified.com/crime/what-is-a-man-in-the-middle-attack/
|
||||
[6]: https://creativecommons.org/licenses/by-sa/2.0/
|
203
published/20200417 How to compress files on Linux 5 ways.md
Normal file
203
published/20200417 How to compress files on Linux 5 ways.md
Normal file
@ -0,0 +1,203 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12190-1.html)
|
||||
[#]: subject: (How to compress files on Linux 5 ways)
|
||||
[#]: via: (https://www.networkworld.com/article/3538471/how-to-compress-files-on-linux-5-ways.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
在 Linux 上压缩文件的 5 种方法
|
||||
======
|
||||
|
||||
> 在 Linux 系统上有很多可以用于压缩文件的工具,但它们的表现并不都是一样的,也不是所有的压缩效果都是一样的。在这篇文章中,我们比较其中的五个工具。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202005/06/231536tgxma941yb8dgl53.jpg)
|
||||
|
||||
在 Linux 上有不少用于压缩文件的命令。最新最有效的一个方法是 `xz`,但是所有的方法都有节省磁盘空间和维护备份文件供以后使用的优点。在这篇文章中,我们将比较这些压缩命令并指出显著的不同。
|
||||
|
||||
### tar
|
||||
|
||||
`tar` 命令不是专门的压缩命令。它通常用于将多个文件拉入一个单个的文件中,以便容易地传输到另一个系统,或者将文件作为一个相关的组进行备份。它也提供压缩的功能,这就很有意义了,附加一个 `z` 压缩选项能够实现压缩文件。
|
||||
|
||||
当使用 `z` 选项为 `tar` 命令附加压缩过程时,`tar` 使用 `gzip` 来进行压缩。
|
||||
|
||||
就像压缩一组文件一样,你可以使用 `tar` 来压缩单个文件,尽管这种操作与直接使用 `gzip` 相比没有特别的优势。要使用 `tar` 这样做,只需要使用 `tar cfz newtarfile filename` 命令来标识要压缩的文件,就像标识一组文件一样,像这样:
|
||||
|
||||
```
|
||||
$ tar cfz bigfile.tgz bigfile
|
||||
^ ^
|
||||
| |
|
||||
+- 新的文件 +- 将被压缩的文件
|
||||
|
||||
$ ls -l bigfile*
|
||||
-rw-rw-r-- 1 shs shs 103270400 Apr 16 16:09 bigfile
|
||||
-rw-rw-r-- 1 shs shs 21608325 Apr 16 16:08 bigfile.tgz
|
||||
```
|
||||
|
||||
注意,文件的大小显著减少了。
|
||||
|
||||
如果你愿意,你可以使用 `tar.gz` 扩展名,这可能会使文件的特征更加明显,但是大多数的 Linux 用户将很可能会意识到与 `tgz` 的意思是一样的 – `tar` 和 `gz` 的组合来显示文件是一个压缩的 tar 文件。在压缩完成后,你将同时得到原始文件和压缩文件。
|
||||
|
||||
要将很多文件收集在一起并在一个命令中压缩出 “tar ball”,使用相同的语法,但要指定要包含的文件为一组,而不是单个文件。这里有一个示例:
|
||||
|
||||
```
|
||||
$ tar cfz bin.tgz bin/*
|
||||
^ ^
|
||||
| +-- 将被包含的文件
|
||||
+ 新的文件
|
||||
```
|
||||
|
||||
### zip
|
||||
|
||||
`zip` 命令创建一个压缩文件,与此同时保留原始文件的完整性。语法像使用 `tar` 一样简单,只是你必需记住,你的原始文件名称应该是命令行上的最后一个参数。
|
||||
|
||||
```
|
||||
$ zip ./bigfile.zip bigfile
|
||||
updating: bigfile (deflated 79%)
|
||||
$ ls -l bigfile bigfile.zip
|
||||
-rw-rw-r-- 1 shs shs 103270400 Apr 16 11:18 bigfile
|
||||
-rw-rw-r-- 1 shs shs 21606889 Apr 16 11:19 bigfile.zip
|
||||
```
|
||||
|
||||
### gzip
|
||||
|
||||
`gzip` 命令非常容易使用。你只需要键入 `gzip`,紧随其后的是你想要压缩的文件名称。不像上述描述的命令,`gzip` 将“就地”加密文件。换句话说,原始文件将被加密文件替换。
|
||||
|
||||
```
|
||||
$ gzip bigfile
|
||||
$ ls -l bigfile*
|
||||
-rw-rw-r-- 1 shs shs 21606751 Apr 15 17:57 bigfile.gz
|
||||
```
|
||||
|
||||
### bzip2
|
||||
|
||||
像使用 `gzip` 命令一样,`bzip2` 将在你选择的文件“就地”压缩,不留下原始文件。
|
||||
|
||||
```
|
||||
$ bzip bigfile
|
||||
$ ls -l bigfile*
|
||||
-rw-rw-r-- 1 shs shs 18115234 Apr 15 17:57 bigfile.bz2
|
||||
```
|
||||
|
||||
### xz
|
||||
|
||||
`xz` 是压缩命令团队中的一个相对较新的成员,在压缩文件的能力方面,它是一个领跑者。像先前的两个命令一样,你只需要将文件名称提供给命令。再强调一次,原始文件被就地压缩。
|
||||
|
||||
```
|
||||
$ xz bigfile
|
||||
$ ls -l bigfile*
|
||||
-rw-rw-r-- 1 shs shs 13427236 Apr 15 17:30 bigfile.xz
|
||||
```
|
||||
|
||||
对于大文件来说,你可能会注意到 `xz` 将比其它的压缩命令花费更多的运行时间,但是压缩的结果却是非常令人赞叹的。
|
||||
|
||||
### 对比
|
||||
|
||||
大多数人都听说过“大小不是一切”。所以,让我们比较一下文件大小以及一些当你计划如何压缩文件时的问题。
|
||||
|
||||
下面显示的统计数据都与压缩单个文件相关,在上面显示的示例中使用 `bigfile`。这个文件是一个大的且相当随机的文本文件。压缩率在一定程度上取决于文件的内容。
|
||||
|
||||
#### 大小减缩率
|
||||
|
||||
当比较时,上面显示的各种压缩命产生下面的结果。百分比表示压缩文件与原始文件的比较效果。
|
||||
|
||||
```
|
||||
-rw-rw-r-- 1 shs shs 103270400 Apr 16 14:01 bigfile
|
||||
------------------------------------------------------
|
||||
-rw-rw-r-- 1 shs shs 18115234 Apr 16 13:59 bigfile.bz2 ~17%
|
||||
-rw-rw-r-- 1 shs shs 21606751 Apr 16 14:00 bigfile.gz ~21%
|
||||
-rw-rw-r-- 1 shs shs 21608322 Apr 16 13:59 bigfile.tgz ~21%
|
||||
-rw-rw-r-- 1 shs shs 13427236 Apr 16 14:00 bigfile.xz ~13%
|
||||
-rw-rw-r-- 1 shs shs 21606889 Apr 16 13:59 bigfile.zip ~21%
|
||||
```
|
||||
|
||||
`xz` 命令获胜,最终只有压缩文件 13% 的大小,但是所有这些压缩命令都相当显著地减少原始文件的大小。
|
||||
|
||||
#### 是否替换原始文件
|
||||
|
||||
`bzip2`、`gzip` 和 `xz` 命令都用压缩文件替换原始文件。`tar` 和 `zip` 命令不替换。
|
||||
|
||||
#### 运行时间
|
||||
|
||||
`xz` 命令似乎比其它命令需要花费更多的时间来加密文件。对于 `bigfile` 来说,大概的时间是:
|
||||
|
||||
```
|
||||
命令 运行时间
|
||||
tar 4.9 秒
|
||||
zip 5.2 秒
|
||||
bzip2 22.8 秒
|
||||
gzip 4.8 秒
|
||||
xz 50.4 秒
|
||||
```
|
||||
|
||||
解压缩文件很可能比压缩时间要短得多。
|
||||
|
||||
#### 文件权限
|
||||
|
||||
不管你对压缩文件设置什么权限,压缩文件的权限将基于你的 `umask` 设置,但 `bzip2` 除外,它保留了原始文件的权限。
|
||||
|
||||
#### 与 Windows 的兼容性
|
||||
|
||||
`zip` 命令创建的文件可以在 Windows 系统以及 Linux 和其他 Unix 系统上使用(即解压),而无需安装其他工具,无论这些工具可能是可用还是不可用的。
|
||||
|
||||
### 解压缩文件
|
||||
|
||||
解压文件的命令与压缩文件的命令类似。在我们运行上述压缩命令后,这些命令用于解压缩 `bigfile`:
|
||||
|
||||
* tar: `tar xf bigfile.tgz`
|
||||
* zip: `unzip bigfile.zip`
|
||||
* gzip: `gunzip bigfile.gz`
|
||||
* bzip2: `bunzip2 bigfile.gz2`
|
||||
* xz: `xz -d bigfile.xz` 或 `unxz bigfile.xz`
|
||||
|
||||
### 自己运行压缩对比
|
||||
|
||||
如果你想自己运行一些测试,抓取一个大的且可以替换的文件,并使用上面显示的每个命令来压缩它 —— 最好使用一个新的子目录。你可能需要先安装 `xz`,如果你想在测试中包含它的话。这个脚本可能更容易地进行压缩,但是可能需要花费几分钟完成。
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
# 询问用户文件名称
|
||||
echo -n "filename> "
|
||||
read filename
|
||||
|
||||
# 你需要这个,因为一些命令将替换原始文件
|
||||
cp $filename $filename-2
|
||||
|
||||
# 先清理(以免先前的结果仍然可用)
|
||||
rm $filename.*
|
||||
|
||||
tar cvfz ./$filename.tgz $filename > /dev/null
|
||||
zip $filename.zip $filename > /dev/null
|
||||
bzip2 $filename
|
||||
# 恢复原始文件
|
||||
cp $filename-2 $filename
|
||||
gzip $filename
|
||||
# 恢复原始文件
|
||||
cp $filename-2 $filename
|
||||
xz $filename
|
||||
|
||||
# 显示结果
|
||||
ls -l $filename.*
|
||||
|
||||
# 替换原始文件
|
||||
mv $filename-2 $filename
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3538471/how-to-compress-files-on-linux-5-ways.html
|
||||
|
||||
作者:[Sandra Henry-Stocker][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[robsean](https://github.com/robsean)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy)
|
||||
[2]: https://www.facebook.com/NetworkWorld/
|
||||
[3]: https://www.linkedin.com/company/network-world
|
@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12180-1.html)
|
||||
[#]: subject: (4 Git scripts I can't live without)
|
||||
[#]: via: (https://opensource.com/article/20/4/git-extras)
|
||||
[#]: author: (Vince Power https://opensource.com/users/vincepower)
|
||||
@ -12,11 +12,11 @@
|
||||
|
||||
> Git Extras 版本库包含了 60 多个脚本,它们是 Git 基本功能的补充。以下是如何安装、使用和贡献的方法。
|
||||
|
||||
![Person using a laptop][1]
|
||||
![](https://img.linux.net.cn/data/attachment/album/202005/03/211446dshwbzoh235b3gre.jpg)
|
||||
|
||||
2005 年,[Linus Torvalds][2] 创建了 [Git][3],以取代他之前用于维护 Linux 内核的专有的分布式源码控制管理解决方案。从那时起,Git 已经成为开源和云原生开发团队的主流版本控制解决方案。
|
||||
2005 年,[Linus Torvalds][2] 创建了 [Git][3],以取代他之前用于维护 Linux 内核的分布式源码控制管理的专有解决方案。从那时起,Git 已经成为开源和云原生开发团队的主流版本控制解决方案。
|
||||
|
||||
但即使是像 Git 这样功能丰富的应用程序,也没有人们想要或需要的每个功能,所以人们会花大力气去创建这些功能。就 Git 而言,这个人就是 [TJ Holowaychuk][4]。他的 [Git Extras][5] 项目承载了 60 多个“附加功能”,这些功能扩展了 Git 的基本功能。
|
||||
但即使是像 Git 这样功能丰富的应用程序,也没有人们想要或需要的每个功能,所以会有人花大力气去创建这些缺少的功能。就 Git 而言,这个人就是 [TJ Holowaychuk][4]。他的 [Git Extras][5] 项目承载了 60 多个“附加功能”,这些功能扩展了 Git 的基本功能。
|
||||
|
||||
### 使用 Git 附加功能
|
||||
|
||||
@ -24,9 +24,9 @@
|
||||
|
||||
#### git-ignore
|
||||
|
||||
`git ignore` 是一个方便的附加功能,它可以让你手动添加文件类型和注释到 `.git-ignore` 文件中,而不需要打开文本编辑器。它可以操作你的个人用户帐户的全局忽略文件和单独用于你正在工作的版本库的忽略文件。
|
||||
`git ignore` 是一个方便的附加功能,它可以让你手动添加文件类型和注释到 `.git-ignore` 文件中,而不需要打开文本编辑器。它可以操作你的个人用户帐户的全局忽略文件和单独用于你正在工作的版本库中的忽略文件。
|
||||
|
||||
在没有参数的情况下执行 `git ignore` 会先列出全局忽略文件,然后是本地的忽略文件。
|
||||
在不提供参数的情况下执行 `git ignore` 会先列出全局忽略文件,然后是本地的忽略文件。
|
||||
|
||||
```
|
||||
$ git ignore
|
||||
@ -105,7 +105,7 @@ branch.master.merge=refs/heads/master
|
||||
* `git mr` 检出来自 GitLab 的合并请求。
|
||||
* `git pr` 检出来自 GitHub 的拉取请求。
|
||||
|
||||
无论是哪种情况,你只需要合并请求号、拉取请求号或完整的 URL,它就会抓取远程引用,检出分支,并调整配置,这样 Git 就知道要替换哪个分支了。
|
||||
无论是哪种情况,你只需要合并请求号/拉取请求号或完整的 URL,它就会抓取远程引用,检出分支,并调整配置,这样 Git 就知道要替换哪个分支了。
|
||||
|
||||
```
|
||||
$ git mr 51
|
||||
@ -142,7 +142,7 @@ $ git extras --help
|
||||
$ brew install git-extras
|
||||
```
|
||||
|
||||
在 Linux 上,每个平台的原生包管理器中都有 Git Extras。有时,你需要启用一个额外的仓库,比如在 CentOS 上的 [EPEL][10],然后运行一条命令。
|
||||
在 Linux 上,每个平台原生的包管理器中都包含有 Git Extras。有时,你需要启用额外的仓库,比如在 CentOS 上的 [EPEL][10],然后运行一条命令。
|
||||
|
||||
```
|
||||
$ sudo yum install git-extras
|
||||
@ -152,9 +152,9 @@ $ sudo yum install git-extras
|
||||
|
||||
### 贡献
|
||||
|
||||
你是否你认为 Git 中有缺少的功能,并且已经构建了一个脚本来处理它?为什么不把它作为 Git Extras 发布版的一部分,与全世界分享呢?
|
||||
你是否认为 Git 中有缺少的功能,并且已经构建了一个脚本来处理它?为什么不把它作为 Git Extras 发布版的一部分,与全世界分享呢?
|
||||
|
||||
要做到这一点,请将该功能贡献到 Git Extras 仓库中。更多具体细节请参见仓库中的 [CONTRIBUTING.md][12] 文件,但基本的操作方法很简单。
|
||||
要做到这一点,请将该功能贡献到 Git Extras 仓库中。更多具体细节请参见仓库中的 [CONTRIBUTING.md][12] 文件,但基本的操作方法很简单:
|
||||
|
||||
1. 创建一个处理该功能的 Bash 脚本。
|
||||
2. 创建一个基本的 man 文件,让大家知道如何使用它。
|
||||
@ -171,7 +171,7 @@ via: https://opensource.com/article/20/4/git-extras
|
||||
作者:[Vince Power][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,238 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12172-1.html)
|
||||
[#]: subject: (Using Python to visualize COVID-19 projections)
|
||||
[#]: via: (https://opensource.com/article/20/4/python-data-covid-19)
|
||||
[#]: author: (AnuragGupta https://opensource.com/users/999anuraggupta)
|
||||
|
||||
使用 Python 来可视化 COVID-19 预测
|
||||
======
|
||||
|
||||
> 我将演示如何利用提供的全球病毒传播的开放数据,使用开源库来创建两个可视效果。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202005/01/193624a2p2osojyf0yg4go.jpg)
|
||||
|
||||
使用 [Python][2] 和一些图形库,你可以预测 COVID-19 确诊病例总数,也可以显示一个国家(本文以印度为例)在给定日期的死亡总数。人们有时需要帮助解释和处理数据的意义,所以本文还演示了如何为五个国家创建一个动画横条形图,以显示按日期显示病例的变化。
|
||||
|
||||
### 印度的确诊病例和死亡人数预测
|
||||
|
||||
这要分三步来完成。
|
||||
|
||||
#### 1、下载数据
|
||||
|
||||
科学数据并不总是开放的,但幸运的是,许多现代科学和医疗机构都乐于相互之间及与公众共享信息。关于 COVID-19 病例的数据可以在网上查到,并且经常更新。
|
||||
|
||||
要解析这些数据,首先必须先下载。 <https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv>。
|
||||
|
||||
直接将数据加载到 Pandas `DataFrame` 中。Pandas 提供了一个函数 `read_csv()`,它可以获取一个 URL 并返回一个 `DataFrame` 对象,如下所示。
|
||||
|
||||
```
|
||||
import pycountry
|
||||
import plotly.express as px
|
||||
import pandas as pd
|
||||
URL_DATASET = r'https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv'
|
||||
df1 = pd.read_csv(URL_DATASET)
|
||||
print(df1.head(3)) # 获取数据帧中的前 3 项
|
||||
print(df1.tail(3)) # 获取数据帧中的后 3 项
|
||||
```
|
||||
|
||||
数据集的顶行包含列名。
|
||||
|
||||
1. `Date`
|
||||
2. `Country`
|
||||
3. `Confirmed`
|
||||
4. `Recovered`
|
||||
5. `Deaths`
|
||||
|
||||
`head` 查询的输出包括一个唯一的标识符(不作为列列出)和每个列的条目。
|
||||
|
||||
```
|
||||
0 2020-01-22 Afghanistan 0 0 0
|
||||
1 2020-01-22 Albania 0 0 0
|
||||
1 2020-01-22 Algeria 0 0 0
|
||||
```
|
||||
|
||||
`tail` 查询的输出类似,但包含数据集的尾端。
|
||||
|
||||
```
|
||||
12597 2020-03-31 West Bank and Gaza 119 18 1
|
||||
12598 2020-03-31 Zambia 35 0 0
|
||||
12599 2020-03-31 Zimbabwe 8 0 1
|
||||
```
|
||||
|
||||
从输出中,可以看到 DataFrame(`df1`)有以下几个列:
|
||||
|
||||
1. 日期
|
||||
2. 国家
|
||||
3. 确诊
|
||||
4. 康复
|
||||
5. 死亡
|
||||
|
||||
此外,你可以看到 `Date` 栏中的条目从 1 月 22 日开始到 3 月 31 日。这个数据库每天都会更新,所以你会有当前的值。
|
||||
|
||||
#### 2、选择印度的数据
|
||||
|
||||
在这一步中,我们将只选择 DataFrame 中包含印度的那些行。这在下面的脚本中可以看到。
|
||||
|
||||
```
|
||||
#### ----- Step 2 (Select data for India)----
|
||||
df_india = df1[df1['Country'] == 'India']
|
||||
print(df_india.head(3))
|
||||
```
|
||||
|
||||
#### 3、数据绘图
|
||||
|
||||
在这里,我们创建一个条形图。我们将把日期放在 X 轴上,把确诊的病例数和死亡人数放在 Y 轴上。这一部分的脚本有以下几个值得注意的地方。
|
||||
|
||||
* `plt.rcParams["figure.figsize"]=20,20` 这一行代码只适用于 Jupyter。所以如果你使用其他 IDE,请删除它。
|
||||
* 注意这行代码:`ax1 = plt.gca()`。为了确保两个图,即确诊病例和死亡病例的图都被绘制在同一个图上,我们需要给第二个图的 `ax` 对象。所以我们使用 `gca()` 来完成这个任务。(顺便说一下,`gca` 代表 “<ruby>获取当前坐标轴<rt>get current axis</rt></ruby>”)
|
||||
|
||||
完整的脚本如下所示。
|
||||
|
||||
```
|
||||
# Author:- Anurag Gupta # email:- 999.anuraggupta@gmail.com
|
||||
%matplotlib inline
|
||||
import matplotlib.pyplot as plt
|
||||
import pandas as pd
|
||||
|
||||
#### ----- Step 1 (Download data)----
|
||||
URL_DATASET = r'https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv'
|
||||
df1 = pd.read_csv(URL_DATASET)
|
||||
# print(df1.head(3)) # Uncomment to see the dataframe
|
||||
|
||||
#### ----- Step 2 (Select data for India)----
|
||||
df_india = df1[df1['Country'] == 'India']
|
||||
print(df_india.head(3))
|
||||
|
||||
#### ----- Step 3 (Plot data)----
|
||||
# Increase size of plot
|
||||
plt.rcParams["figure.figsize"]=20,20 # Remove if not on Jupyter
|
||||
# Plot column 'Confirmed'
|
||||
df_india.plot(kind = 'bar', x = 'Date', y = 'Confirmed', color = 'blue')
|
||||
|
||||
ax1 = plt.gca()
|
||||
df_india.plot(kind = 'bar', x = 'Date', y = 'Deaths', color = 'red', ax = ax1)
|
||||
plt.show()
|
||||
```
|
||||
|
||||
整个脚本[可在 GitHub 上找到][4]。
|
||||
|
||||
### 为五个国家创建一个动画水平条形图
|
||||
|
||||
关于 Jupyter 的注意事项:要在 Jupyter 中以动态动画的形式运行,而不是静态 png 的形式,你需要在单元格的开头添加一个神奇的命令,即: `%matplotlib notebook`。这将使图形保持动态,而不是显示为静态的 png 文件,因此也可以显示动画。如果你在其他 IDE 上,请删除这一行。
|
||||
|
||||
#### 1、下载数据
|
||||
|
||||
这一步和前面的脚本完全一样,所以不需要重复。
|
||||
|
||||
#### 2、创建一个所有日期的列表
|
||||
|
||||
如果你检查你下载的数据,你会发现它有一列 `Date`。现在,这一列对每个国家都有一个日期值。因此,同一个日期会出现多次。我们需要创建一个只具有唯一值的日期列表。这会用在我们条形图的 X 轴上。我们有一行代码,如 `list_dates = df[‘Date’].unique()`。`unique()` 方法将只提取每个日期的唯一值。
|
||||
|
||||
#### 3、挑选五个国家并创建一个 `ax` 对象。
|
||||
|
||||
做一个五个国家的名单。(你可以选择你喜欢的国家,也可以增加或减少国家的数量。)我也做了一个五个颜色的列表,每个国家的条形图的颜色对应一种。(如果你喜欢的话,也可以改一下。)这里有一行重要的代码是:`fig, ax = plt.subplots(figsize=(15, 8))`。这是创建一个 `ax` 对象所需要的。
|
||||
|
||||
#### 4、编写回调函数
|
||||
|
||||
如果你想在 Matplotlib 中做动画,你需要创建一个名为 `matplotlib.animation.FuncAnimation` 的类的对象。这个类的签名可以在网上查到。这个类的构造函数,除了其他参数外,还需要一个叫 `func` 的参数,你必须给这个参数一个回调函数。所以在这一步中,我们会写个回调函数,这个回调函数会被反复调用,以渲染动画。
|
||||
|
||||
#### 5、创建 `FuncAnimation` 对象
|
||||
|
||||
这一步在上一步中已经部分说明了。
|
||||
|
||||
我们创建这个类的对象的代码是:
|
||||
|
||||
```
|
||||
my_anim = animation.FuncAnimation(fig = fig, func = plot_bar,
|
||||
frames = list_dates, blit = True,
|
||||
interval=20)
|
||||
```
|
||||
|
||||
要给出的三个重要参数是:
|
||||
|
||||
* `fig`,必须给出一个 fig 对象,也就是我们之前创建的 fig 对象。
|
||||
* `func`,必须是回调函数。
|
||||
* `frames`,必须包含要做动画的变量。在我们这里,它是我们之前创建的日期列表。
|
||||
|
||||
#### 6、将动画保存为 mp4 文件
|
||||
|
||||
你可以将创建的动画保存为 mp4 文件。但是,你需要 `ffmpeg`。你可以用 `pip` 下载:`pip install ffmpeg-python`,或者用 conda(在 Jupyter 上):`install -c conda-forge ffmpeg`。
|
||||
|
||||
最后,你可以使用 `plt.show()` 运行动画。请注意,在许多平台上,`ffmpeg` 可能无法正常工作,可能需要进一步“调整”。
|
||||
|
||||
```
|
||||
%matplotlib notebook
|
||||
# Author:- Anurag Gupta # email:- 999.anuraggupta@gmail.com
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib.animation as animation
|
||||
from time import sleep
|
||||
|
||||
#### ---- Step 1:- Download data
|
||||
URL_DATASET = r'https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv'
|
||||
df = pd.read_csv(URL_DATASET, usecols = ['Date', 'Country', 'Confirmed'])
|
||||
# print(df.head(3)) # uncomment this to see output
|
||||
|
||||
#### ---- Step 2:- Create list of all dates
|
||||
list_dates = df['Date'].unique()
|
||||
# print(list_dates) # Uncomment to see the dates
|
||||
|
||||
#### --- Step 3:- Pick 5 countries. Also create ax object
|
||||
fig, ax = plt.subplots(figsize=(15, 8))
|
||||
# We will animate for these 5 countries only
|
||||
list_countries = ['India', 'China', 'US', 'Italy', 'Spain']
|
||||
# colors for the 5 horizontal bars
|
||||
list_colors = ['black', 'red', 'green', 'blue', 'yellow']
|
||||
|
||||
### --- Step 4:- Write the call back function
|
||||
# plot_bar() is the call back function used in FuncAnimation class object
|
||||
def plot_bar(some_date):
|
||||
df2 = df[df['Date'].eq(some_date)]
|
||||
ax.clear()
|
||||
# Only take Confirmed column in descending order
|
||||
df3 = df2.sort_values(by = 'Confirmed', ascending = False)
|
||||
# Select the top 5 Confirmed countries
|
||||
df4 = df3[df3['Country'].isin(list_countries)]
|
||||
# print(df4) # Uncomment to see that dat is only for 5 countries
|
||||
sleep(0.2) # To slow down the animation
|
||||
# ax.barh() makes a horizontal bar plot.
|
||||
return ax.barh(df4['Country'], df4['Confirmed'], color= list_colors)
|
||||
|
||||
###----Step 5:- Create FuncAnimation object---------
|
||||
my_anim = animation.FuncAnimation(fig = fig, func = plot_bar,
|
||||
frames= list_dates, blit=True,
|
||||
interval=20)
|
||||
|
||||
### --- Step 6:- Save the animation to an mp4
|
||||
# Place where to save the mp4. Give your file path instead
|
||||
path_mp4 = r'C:\Python-articles\population_covid2.mp4'
|
||||
# my_anim.save(path_mp4, fps=30, extra_args=['-vcodec', 'libx264'])
|
||||
my_anim.save(filename = path_mp4, writer = 'ffmpeg',
|
||||
fps=30,
|
||||
extra_args= ['-vcodec', 'libx264', '-pix_fmt', 'yuv420p'])
|
||||
plt.show()
|
||||
```
|
||||
|
||||
完整的脚本[可以在 GitHub 上找到][5]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/python-data-covid-19
|
||||
|
||||
作者:[AnuragGupta][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/999anuraggupta
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/colorful_sound_wave.png?itok=jlUJG0bM (Colorful sound wave graph)
|
||||
[2]: https://opensource.com/resources/python
|
||||
[3]: mailto:999.anuraggupta@gmail.com
|
||||
[4]: https://raw.githubusercontent.com/ag999git/jupyter_notebooks/master/corona_bar_india
|
||||
[5]: https://raw.githubusercontent.com/ag999git/jupyter_notebooks/master/corona_bar_animated
|
@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12170-1.html)
|
||||
[#]: subject: (Difference Between YUM and RPM Package Manager)
|
||||
[#]: via: (https://www.2daygeek.com/comparison-difference-between-yum-vs-rpm/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
@ -10,6 +10,8 @@
|
||||
YUM 和 RPM 包管理器的不同之处
|
||||
======
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202004/30/215525o4e88nen85d8dzd7.jpg)
|
||||
|
||||
软件包管理器在 Linux 系统中扮演着重要的角色。它允许你安装、更新、查看、搜索和删除软件包,以满足你的需求。
|
||||
|
||||
每个发行版都有自己的一套包管理器,依据你的 Linux 发行版来分别使用它们。
|
||||
@ -18,7 +20,7 @@ RPM 是最古老的传统软件包管理器之一,它是为基于 Red Hat 的
|
||||
|
||||
> 如果你想知道 [YUM 和 DNF 包管理器的区别][1]请参考该文章。
|
||||
|
||||
这意味着 yum 可以自动下载并安装所有需要的依赖项,但 rpm 会告诉你安装一个依赖项列表,然后你必须手动安装。
|
||||
这意味着 `yum` 可以自动下载并安装所有需要的依赖项,但 `rpm` 会告诉你安装一个依赖项列表,然后你必须手动安装。
|
||||
|
||||
当你想用 [rpm 命令][2] 安装一组包时,这实际上是不可能的,而且很费时间。
|
||||
|
||||
@ -76,13 +78,13 @@ via: https://www.2daygeek.com/comparison-difference-between-yum-vs-rpm/
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.2daygeek.com/author/magesh/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/
|
||||
[1]: https://linux.cn/article-12161-1.html
|
||||
[2]: https://www.2daygeek.com/linux-rpm-command-examples-manage-packages-fedora-centos-rhel-systems/
|
||||
[3]: https://www.2daygeek.com/linux-yum-command-examples-manage-packages-rhel-centos-systems/
|
||||
[4]: https://www.2daygeek.com/list-of-command-line-package-manager-for-linux/
|
@ -0,0 +1,283 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (qfzy1233)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12183-1.html)
|
||||
[#]: subject: (16 Things to do After Installing Ubuntu 20.04)
|
||||
[#]: via: (https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
安装完 Ubuntu 20.04 后要做的 16 件事
|
||||
======
|
||||
|
||||
> 以下是安装 Ubuntu 20.04 之后需要做的一些调整和事项,它将使你获得更流畅、更好的桌面 Linux 体验。
|
||||
|
||||
[Ubuntu 20.04 LTS(长期支持版)带来了许多新的特性][1]和观感上的变化。如果你要安装 Ubuntu 20.04,让我向你展示一些推荐步骤便于你的使用。
|
||||
|
||||
### 安装完 Ubuntu 20.04 LTS “Focal Fossa” 后要做的 16 件事
|
||||
|
||||
![][2]
|
||||
|
||||
我在这里提到的步骤仅是我的建议。如果一些定制或调整不适合你的需要和兴趣,你可以忽略它们。
|
||||
|
||||
同样的,有些步骤看起来很简单,但是对于一个 Ubuntu 新手来说是必要的。
|
||||
|
||||
这里的一些建议适用于启用 GNOME 作为默认桌面 Ubuntu 20.04,所以请检查 [Ubuntu 版本][3]和[桌面环境][4]。
|
||||
|
||||
以下列表便是安装了代号为 Focal Fossa 的 Ubuntu 20.04 LTS 之后要做的事。
|
||||
|
||||
#### 1、通过更新和启用额外的软件仓库来准备你的系统
|
||||
|
||||
安装 Ubuntu 或任何其他 Linux 发行版之后,你应该做的第一件事就是更新它。Linux 的运作是建立在本地的可用软件包数据库上,而这个缓存需要同步以便你能够安装软件。
|
||||
|
||||
升级 Ubuntu 非常简单。你可以运行软件更新从菜单(按 `Super` 键并搜索 “software updater”):
|
||||
|
||||
![Ubuntu 20.04 的软件升级器][5]
|
||||
|
||||
你也可以在终端使用以下命令更新你的系统:
|
||||
|
||||
```
|
||||
sudo apt update && sudo apt upgrade
|
||||
```
|
||||
|
||||
接下来,你应该确保启用了 [universe(宇宙)和 multiverse(多元宇宙)软件仓库][6]。使用这些软件仓库,你可以访问更多的软件。我还推荐阅读关于 [Ubuntu 软件仓库][6]的文章,以了解它背后的基本概念。
|
||||
|
||||
在菜单中搜索 “Software & Updates”:
|
||||
|
||||
![软件及更新设置项][7]
|
||||
|
||||
请务必选中软件仓库前面的勾选框:
|
||||
|
||||
![启用额外的软件仓库][8]
|
||||
|
||||
#### 2、安装媒体解码器来播放 MP3、MPEG4 和其他格式媒体文件
|
||||
|
||||
如果你想播放媒体文件,如 MP3、MPEG4、AVI 等,你需要安装媒体解码器。由于各个国家的版权问题, Ubuntu 在默认情况下不会安装它。
|
||||
|
||||
作为个人,你可以[使用 Ubuntu Restricted Extra 安装包][9]很轻松地安装这些媒体编解码器。这将[在你的 Ubuntu 系统安装][10]媒体编解码器、Adobe Flash 播放器和微软 True Type 字体等。
|
||||
|
||||
你可以通过[点击这个链接][11]来安装它(它会要求在软件中心打开它),或者使用以下命令:
|
||||
|
||||
```
|
||||
sudo apt install ubuntu-restricted-extras
|
||||
```
|
||||
|
||||
如果遇到 EULA 或许可证界面,请记住使用 `tab` 键在选项之间进行选择,然后按回车键确认你的选择。
|
||||
|
||||
![按 tab 键选择 OK 并按回车键][12]
|
||||
|
||||
#### 3、从软件中心或网络上安装软件
|
||||
|
||||
现在已经设置好了软件仓库并更新了软件包缓存,应该开始安装所需的软件了。
|
||||
|
||||
在 Ubuntu 中安装应用程序有几种方法,最简单和正式的方法是使用软件中心。
|
||||
|
||||
![Ubuntu 软件中心][14]
|
||||
|
||||
如果你想要一些关于软件的建议,请参考这个[丰富的各种用途的 Ubuntu 应用程序列表][15]。
|
||||
|
||||
一些软件供应商提供了 .deb 文件来方便地安装他们的应用程序。你可以从他们的网站获得 .deb 文件。例如,要[在 Ubuntu 上安装谷歌 Chrome][16],你可以从它的网站上获得 .deb 文件,双击它开始安装。
|
||||
|
||||
#### 4、享受 Steam Proton 和 GameModeEnjoy 上的游戏
|
||||
|
||||
[在 Linux 上进行游戏][17]已经有了长足的发展。你不再受限于自带的少数游戏。你可以[在 Ubuntu 上安装 Steam][18]并享受许多游戏。
|
||||
|
||||
[Steam 新的 Proton 项目][19]可以让你在 Linux 上玩许多只适用于 Windows 的游戏。除此之外,Ubuntu 20.04 还默认安装了 [Feral Interactive 的 GameMode][20]。
|
||||
|
||||
GameMode 会自动调整 Linux 系统的性能,使游戏具有比其他后台进程更高的优先级。
|
||||
|
||||
这意味着一些支持 GameMode 的游戏(如[古墓丽影·崛起][21])在 Ubuntu 上的性能应该有所提高。
|
||||
|
||||
#### 5、管理自动更新(适用于进阶用户和专家)
|
||||
|
||||
最近,Ubuntu 已经开始自动下载并安装对你的系统至关重要的安全更新。这是一个安全功能,作为一个普通用户,你应该让它保持默认开启。
|
||||
|
||||
但是,如果你喜欢自己进行配置更新,而这个自动更新经常导致你[“无法锁定管理目录”错误][22],也许你可以改变自动更新行为。
|
||||
|
||||
你可以选择“立即显示”,这样一有安全更新就会立即通知你,而不是自动安装。
|
||||
|
||||
![管理自动更新设置][23]
|
||||
|
||||
#### 6、控制电脑的自动挂起和屏幕锁定
|
||||
|
||||
如果你在笔记本电脑上使用 Ubuntu 20.04,那么你可能需要注意一些电源和屏幕锁定设置。
|
||||
|
||||
如果你的笔记本电脑处于电池模式,Ubuntu 会在 20 分钟不活动后休眠系统。这样做是为了节省电池电量。就我个人而言,我不喜欢它,因此我禁用了它。
|
||||
|
||||
类似地,如果你离开系统几分钟,它会自动锁定屏幕。我也不喜欢这种行为,所以我宁愿禁用它。
|
||||
|
||||
![Ubuntu 20.04 的电源设置][24]
|
||||
|
||||
#### 7、享受夜间模式
|
||||
|
||||
[Ubuntu 20.04 中最受关注的特性][25]之一是夜间模式。你可以通过进入设置并在外观部分中选择它来启用夜间模式。
|
||||
|
||||
![开启夜间主题 Ubuntu][26]
|
||||
|
||||
你可能需要做一些[额外的调整来获得完整的 Ubuntu 20.04 夜间模式][27]。
|
||||
|
||||
#### 8、控制桌面图标和启动程序
|
||||
|
||||
如果你想要一个最简的桌面,你可以禁用桌面上的图标。你还可以从左侧禁用启动程序,并在顶部面板中禁用软件状态栏。
|
||||
|
||||
所有这些都可以通过默认的新 GNOME 扩展来控制,该程序默认情况下已经可用。
|
||||
|
||||
![禁用 Ubuntu 20 04 的 Dock][28]
|
||||
|
||||
顺便说一下,你也可以通过“设置”->“外观”来将启动栏的位置改变到底部或者右边。
|
||||
|
||||
#### 9、使用表情符和特殊字符,或从搜索中禁用它
|
||||
|
||||
Ubuntu 提供了一个使用表情符号的简单方法。在默认情况下,有一个专用的应用程序叫做“字符”。它基本上可以为你提供表情符号的 [Unicode][29]。
|
||||
|
||||
不仅是表情符号,你还可以使用它来获得法语、德语、俄语和拉丁语字符的 unicode。单击符号你可以复制 unicode,当你粘贴该代码时,你所选择的符号便被插入。
|
||||
|
||||
![Ubuntu 表情符][30]
|
||||
|
||||
你也能在桌面搜索中找到这些特殊的字符和表情符号。也可以从搜索结果中复制它们。
|
||||
|
||||
![表情符出现在桌面搜索中][31]
|
||||
|
||||
如果你不想在搜索结果中看到它们,你应该禁用搜索功能对它们的访问。下一节将讨论如何做到这一点。
|
||||
|
||||
#### 10、掌握桌面搜索
|
||||
|
||||
GNOME 桌面拥有强大的搜索功能,大多数人使用它来搜索已安装的应用程序,但它不仅限于此。
|
||||
|
||||
按 `Super` 键并搜索一些东西,它将显示与搜索词匹配的任何应用程序,然后是系统设置和软件中心提供的匹配应用程序。
|
||||
|
||||
![桌面搜索][32]
|
||||
|
||||
不仅如此,搜索还可以找到文件中的文本。如果你正在使用日历,它也可以找到你的会议和提醒。你甚至可以在搜索中进行快速计算并复制其结果。
|
||||
|
||||
![Ubuntu搜索的快速计算][33]
|
||||
|
||||
你可以进入“设置”中来控制可以搜索的内容和顺序。
|
||||
|
||||
![][34]
|
||||
|
||||
#### 11、使用夜灯功能,减少夜间眼睛疲劳
|
||||
|
||||
如果你在晚上使用电脑或智能手机,你应该使用夜灯功能来减少眼睛疲劳。我觉得这很有帮助。
|
||||
|
||||
夜灯的特点是在屏幕上增加了一种黄色的色调,比白光少了一些挤压感。
|
||||
|
||||
你可以在“设置”->“显示”切换到夜灯选项卡来开启夜光功能。你可以根据自己的喜好设置“黄度”。
|
||||
|
||||
![夜灯功能][35]
|
||||
|
||||
#### 12、使用 2K/4K 显示器?使用分辨率缩放得到更大的图标和字体
|
||||
|
||||
如果你觉得图标、字体、文件夹在你的高分辨率屏幕上看起来都太小了,你可以利用分辨率缩放。
|
||||
|
||||
启用分辨率缩放可以让你有更多的选项来从 100% 增加到 200%。你可以选择适合自己喜好的缩放尺寸。
|
||||
|
||||
![在设置->显示中启用高分缩放][36]
|
||||
|
||||
#### 13、探索 GNOME 扩展功能以扩展 GNOME 桌面可用性
|
||||
|
||||
GNOME 桌面有称为“扩展”的小插件或附加组件。你应该[学会使用 GNOME 扩展][37]来扩展系统的可用性。
|
||||
|
||||
如下图所示,天气扩展顶部面板中显示了天气信息。不起眼但十分有用。你也可以在这里查看一些[最佳 GNOME 扩展][38]。不需要全部安装,只使用那些对你有用的。
|
||||
|
||||
![天气扩展][39]
|
||||
|
||||
#### 14、启用“勿扰”模式,专注于工作
|
||||
|
||||
如果你想专注于工作,禁用桌面通知会很方便。你可以轻松地启用“勿扰”模式,并静音所有通知。
|
||||
|
||||
![启用“请勿打扰”清除桌面通知][40]
|
||||
|
||||
这些通知仍然会在消息栏中,以便你以后可以阅读它们,但是它们不会在桌面上弹出。
|
||||
|
||||
#### 15、清理你的系统
|
||||
|
||||
这是你安装 Ubuntu 后不需要马上做的事情。但是记住它会对你有帮助。
|
||||
|
||||
随着时间的推移,你的系统将有大量不再需要的包。你可以用这个命令一次性删除它们:
|
||||
|
||||
```
|
||||
sudo apt autoremove
|
||||
```
|
||||
|
||||
还有其他[清理 Ubuntu 以释放磁盘空间的方法][41],但这是最简单和最安全的。
|
||||
|
||||
#### 16、根据你的喜好调整和定制 GNOME 桌面
|
||||
|
||||
我强烈推荐[安装 GNOME 设置工具][42]。这将让你可以通过额外的设置来进行定制。
|
||||
|
||||
![Gnome 设置工具][43]
|
||||
|
||||
比如,你可以[以百分比形式显示电池容量][44]、[修正在触摸板右键问题][45]、改变 Shell 主题、改变鼠标指针速度、显示日期和星期数、改变应用程序窗口行为等。
|
||||
|
||||
定制是没有尽头的,我可能仅使用了它的一小部分功能。这就是为什么我推荐[阅读这些][42]关于[自定义 GNOME 桌面][46]的文章。
|
||||
|
||||
你也可以[在 Ubuntu 中安装新主题][47],不过就我个人而言,我喜欢这个版本的默认主题。这是我第一次在 Ubuntu 发行版中使用默认的图标和主题。
|
||||
|
||||
#### 安装 Ubuntu 之后你会做什么?
|
||||
|
||||
如果你是 Ubuntu 的初学者,我建议你[阅读这一系列 Ubuntu 教程][48]开始学习。
|
||||
|
||||
这就是我的建议。安装 Ubuntu 之后你要做什么?分享你最喜欢的东西,我可能根据你的建议来更新这篇文章。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[qfzy1233](https://github.com/qfzy1233)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://linux.cn/article-12146-1.html
|
||||
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/things-to-do-after-installing-ubuntu-20-04.jpg?ssl=1
|
||||
[3]: https://linux.cn/article-9872-1.html
|
||||
[4]: https://linux.cn/article-12124-1.html
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/software-updater-ubuntu-20-04.jpg?ssl=1
|
||||
[6]: https://itsfoss.com/ubuntu-repositories/
|
||||
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/software-updates-settings-ubuntu-20-04.jpg?ssl=1
|
||||
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/extra-repositories-ubuntu-20.jpg?ssl=1
|
||||
[9]: https://linux.cn/article-11906-1.html
|
||||
[10]: https://linux.cn/article-12074-1.html
|
||||
[11]: //ubuntu-restricted-extras/
|
||||
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/installing_ubuntu_restricted_extras.jpg?ssl=1
|
||||
[13]: https://itsfoss.com/remove-install-software-ubuntu/
|
||||
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/software-center-ubuntu-20.png?resize=800%2C509&ssl=1
|
||||
[15]: https://itsfoss.com/best-ubuntu-apps/
|
||||
[16]: https://itsfoss.com/install-chrome-ubuntu/
|
||||
[17]: https://linux.cn/article-7316-1.html
|
||||
[18]: https://itsfoss.com/install-steam-ubuntu-linux/
|
||||
[19]: https://linux.cn/article-10054-1.html
|
||||
[20]: https://github.com/FeralInteractive/gamemode
|
||||
[21]: https://en.wikipedia.org/wiki/Rise_of_the_Tomb_Raider
|
||||
[22]: https://itsfoss.com/could-not-get-lock-error/
|
||||
[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/auto-updates-ubuntu.png?resize=800%2C361&ssl=1
|
||||
[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/power-settings-ubuntu-20-04.png?fit=800%2C591&ssl=1
|
||||
[25]: https://www.youtube.com/watch?v=lpq8pm_xkSE
|
||||
[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/enable-dark-theme-ubuntu.png?ssl=1
|
||||
[27]: https://linux.cn/article-12098-1.html
|
||||
[28]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/disable-dock-ubuntu-20-04.png?ssl=1
|
||||
[29]: https://en.wikipedia.org/wiki/List_of_Unicode_characters
|
||||
[30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/emoji-ubuntu.jpg?ssl=1
|
||||
[31]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/emojis-desktop-search-ubuntu.jpg?ssl=1
|
||||
[32]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-desktop-search-1.jpg?ssl=1
|
||||
[33]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/quick-calculations-ubuntu-search.jpg?ssl=1
|
||||
[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/search-settings-control-ubuntu.png?resize=800%2C534&ssl=1
|
||||
[35]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/nightlight-ubuntu-20-04.png?ssl=1
|
||||
[36]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/fractional-scaling-ubuntu.jpg?ssl=1
|
||||
[37]: https://itsfoss.com/gnome-shell-extensions/
|
||||
[38]: https://itsfoss.com/best-gnome-extensions/
|
||||
[39]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/weather-extension-ubuntu.jpg?ssl=1
|
||||
[40]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/do-not-distrub-option-ubuntu-20-04.png?ssl=1
|
||||
[41]: https://itsfoss.com/free-up-space-ubuntu-linux/
|
||||
[42]: https://itsfoss.com/gnome-tweak-tool/
|
||||
[43]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/gnome-tweaks-tool-ubuntu-20-04.png?fit=800%2C551&ssl=1
|
||||
[44]: https://itsfoss.com/display-battery-ubuntu/
|
||||
[45]: https://itsfoss.com/fix-right-click-touchpad-ubuntu/
|
||||
[46]: https://itsfoss.com/gnome-tricks-ubuntu/
|
||||
[47]: https://itsfoss.com/install-themes-ubuntu/
|
||||
[48]: https://itsfoss.com/getting-started-with-ubuntu/
|
213
published/20200425 Inlining optimisations in Go.md
Normal file
213
published/20200425 Inlining optimisations in Go.md
Normal file
@ -0,0 +1,213 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (lxbwolf)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12176-1.html)
|
||||
[#]: subject: (Inlining optimisations in Go)
|
||||
[#]: via: (https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go)
|
||||
[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney)
|
||||
|
||||
Go 中的内联优化
|
||||
======
|
||||
|
||||
> 本文讨论 Go 编译器是如何实现内联的,以及这种优化方法如何影响你的 Go 代码。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202005/02/222202e3v3pppkhnndpbpn.jpg)
|
||||
|
||||
*请注意:*本文重点讨论 *gc*,这是来自 [golang.org](https://github.com/golang/go) 的事实标准的 Go 编译器。讨论到的概念可以广泛适用于其它 Go 编译器,如 gccgo 和 llgo,但它们在实现方式和功效上可能有所差异。
|
||||
|
||||
### 内联是什么?
|
||||
|
||||
<ruby>内联<rt>inlining</rt></ruby>就是把简短的函数在调用它的地方展开。在计算机发展历程的早期,这个优化是由程序员手动实现的。现在,内联已经成为编译过程中自动实现的基本优化过程的其中一步。
|
||||
|
||||
### 为什么内联很重要?
|
||||
|
||||
有两个原因。第一个是它消除了函数调用本身的开销。第二个是它使得编译器能更高效地执行其他的优化策略。
|
||||
|
||||
#### 函数调用的开销
|
||||
|
||||
在任何语言中,调用一个函数 [^1] 都会有消耗。把参数编组进寄存器或放入栈中(取决于 ABI),在返回结果时的逆反过程都会有开销。引入一次函数调用会导致程序计数器从指令流的一点跳到另一点,这可能导致管道滞后。函数内部通常有<ruby>前置处理<rt>preamble</rt></ruby>,需要为函数执行准备新的栈帧,还有与前置相似的<ruby>后续处理<rt>epilogue</rt></ruby>,需要在返回给调用方之前释放栈帧空间。
|
||||
|
||||
在 Go 中函数调用会消耗额外的资源来支持栈的动态增长。在进入函数时,goroutine 可用的栈空间与函数需要的空间大小进行比较。如果可用空间不同,前置处理就会跳到<ruby>运行时<rt>runtime</rt></ruby>的逻辑中,通过把数据复制到一块新的、更大的空间的来增长栈空间。当这个复制完成后,运行时就会跳回到原来的函数入口,再执行栈空间检查,现在通过了检查,函数调用继续执行。这种方式下,goroutine 开始时可以申请很小的栈空间,在有需要时再申请更大的空间。[^2]
|
||||
|
||||
这个检查消耗很小,只有几个指令,而且由于 goroutine 的栈是成几何级数增长的,因此这个检查很少失败。这样,现代处理器的分支预测单元可以通过假定检查肯定会成功来隐藏栈空间检查的消耗。当处理器预测错了栈空间检查,不得不放弃它在推测性执行所做的操作时,与为了增加 goroutine 的栈空间运行时所需的操作消耗的资源相比,管道滞后的代价更小。
|
||||
|
||||
虽然现代处理器可以用预测性执行技术优化每次函数调用中的泛型和 Go 特定的元素的开销,但那些开销不能被完全消除,因此在每次函数调用执行必要的工作过程中都会有性能消耗。一次函数调用本身的开销是固定的,与更大的函数相比,调用小函数的代价更大,因为在每次调用过程中它们做的有用的工作更少。
|
||||
|
||||
因此,消除这些开销的方法必须是要消除函数调用本身,Go 的编译器就是这么做的,在某些条件下通过用函数的内容来替换函数调用来实现。这个过程被称为*内联*,因为它在函数调用处把函数体展开了。
|
||||
|
||||
#### 改进的优化机会
|
||||
|
||||
Cliff Click 博士把内联描述为现代编译器做的优化措施,像常量传播(LCTT 译注:此处作者笔误,原文为 constant proportion,修正为 constant propagation)和死代码消除一样,都是编译器的基本优化方法。实际上,内联可以让编译器看得更深,使编译器可以观察调用的特定函数的上下文内容,可以看到能继续简化或彻底消除的逻辑。由于可以递归地执行内联,因此不仅可以在每个独立的函数上下文处进行这种优化决策,也可以在整个函数调用链中进行。
|
||||
|
||||
### 实践中的内联
|
||||
|
||||
下面这个例子可以演示内联的影响:
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import "testing"
|
||||
|
||||
//go:noinline
|
||||
func max(a, b int) int {
|
||||
if a > b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
var Result int
|
||||
|
||||
func BenchmarkMax(b *testing.B) {
|
||||
var r int
|
||||
for i := 0; i < b.N; i++ {
|
||||
r = max(-1, i)
|
||||
}
|
||||
Result = r
|
||||
}
|
||||
```
|
||||
|
||||
运行这个基准,会得到如下结果:[^3]
|
||||
|
||||
```bash
|
||||
% go test -bench=.
|
||||
BenchmarkMax-4 530687617 2.24 ns/op
|
||||
```
|
||||
|
||||
在我的 2015 MacBook Air 上 `max(-1, i)` 的耗时约为 2.24 纳秒。现在去掉 `//go:noinline` 编译指令,再看下结果:
|
||||
|
||||
```bash
|
||||
% go test -bench=.
|
||||
BenchmarkMax-4 1000000000 0.514 ns/op
|
||||
```
|
||||
|
||||
从 2.24 纳秒降到了 0.51 纳秒,或者从 `benchstat` 的结果可以看出,有 78% 的提升。
|
||||
|
||||
```bash
|
||||
% benchstat {old,new}.txt
|
||||
name old time/op new time/op delta
|
||||
Max-4 2.21ns ± 1% 0.49ns ± 6% -77.96% (p=0.000 n=18+19)
|
||||
```
|
||||
|
||||
这个提升是从哪儿来的呢?
|
||||
|
||||
首先,移除掉函数调用以及与之关联的前置处理 [^4] 是主要因素。把 `max` 函数的函数体在调用处展开,减少了处理器执行的指令数量并且消除了一些分支。
|
||||
|
||||
现在由于编译器优化了 `BenchmarkMax`,因此它可以看到 `max` 函数的内容,进而可以做更多的提升。当 `max` 被内联后,`BenchmarkMax` 呈现给编译器的样子,看起来是这样的:
|
||||
|
||||
```go
|
||||
func BenchmarkMax(b *testing.B) {
|
||||
var r int
|
||||
for i := 0; i < b.N; i++ {
|
||||
if -1 > i {
|
||||
r = -1
|
||||
} else {
|
||||
r = i
|
||||
}
|
||||
}
|
||||
Result = r
|
||||
}
|
||||
```
|
||||
|
||||
再运行一次基准,我们看一下手动内联的版本和编译器内联的版本的表现:
|
||||
|
||||
```bash
|
||||
% benchstat {old,new}.txt
|
||||
name old time/op new time/op delta
|
||||
Max-4 2.21ns ± 1% 0.48ns ± 3% -78.14% (p=0.000 n=18+18)
|
||||
```
|
||||
|
||||
现在编译器能看到在 `BenchmarkMax` 里内联 `max` 的结果,可以执行以前不能执行的优化措施。例如,编译器注意到 `i` 初始值为 `0`,仅做自增操作,因此所有与 `i` 的比较都可以假定 `i` 不是负值。这样条件表达式 `-1 > i` 永远不是 `true`。[^5]
|
||||
|
||||
证明了 `-1 > i` 永远不为 true 后,编译器可以把代码简化为:
|
||||
|
||||
```go
|
||||
func BenchmarkMax(b *testing.B) {
|
||||
var r int
|
||||
for i := 0; i < b.N; i++ {
|
||||
if false {
|
||||
r = -1
|
||||
} else {
|
||||
r = i
|
||||
}
|
||||
}
|
||||
Result = r
|
||||
}
|
||||
```
|
||||
|
||||
并且因为分支里是个常量,编译器可以通过下面的方式移除不会走到的分支:
|
||||
|
||||
```go
|
||||
func BenchmarkMax(b *testing.B) {
|
||||
var r int
|
||||
for i := 0; i < b.N; i++ {
|
||||
r = i
|
||||
}
|
||||
Result = r
|
||||
}
|
||||
```
|
||||
|
||||
这样,通过内联和由内联解锁的优化过程,编译器把表达式 `r = max(-1, i))` 简化为 `r = i`。
|
||||
|
||||
### 内联的限制
|
||||
|
||||
本文中我论述的内联称作<ruby>叶子内联<rt>leaf inlining</rt></ruby>:把函数调用栈中最底层的函数在调用它的函数处展开的行为。内联是个递归的过程,当把函数内联到调用它的函数 A 处后,编译器会把内联后的结果代码再内联到 A 的调用方,这样持续内联下去。例如,下面的代码:
|
||||
|
||||
```go
|
||||
func BenchmarkMaxMaxMax(b *testing.B) {
|
||||
var r int
|
||||
for i := 0; i < b.N; i++ {
|
||||
r = max(max(-1, i), max(0, i))
|
||||
}
|
||||
Result = r
|
||||
}
|
||||
```
|
||||
|
||||
与之前的例子中的代码运行速度一样快,因为编译器可以对上面的代码重复地进行内联,也把代码简化到 `r = i` 表达式。
|
||||
|
||||
下一篇文章中,我会论述当 Go 编译器想要内联函数调用栈中间的某个函数时选用的另一种内联策略。最后我会论述编译器为了内联代码准备好要达到的极限,这个极限 Go 现在的能力还达不到。
|
||||
|
||||
[^1]: 在 Go 中,一个方法就是一个有预先定义的形参和接受者的函数。假设这个方法不是通过接口调用的,调用一个无消耗的函数所消耗的代价与引入一个方法是相同的。
|
||||
[^2]: 在 Go 1.14 以前,栈检查的前置处理也被垃圾回收器用于 STW,通过把所有活跃的 goroutine 栈空间设为 0,来强制它们切换为下一次函数调用时的运行时状态。这个机制[最近被替换][8]为一种新机制,新机制下运行时可以不用等 goroutine 进行函数调用就可以暂停 goroutine。
|
||||
[^3]: 我用 `//go:noinline` 编译指令来阻止编译器内联 `max`。这是因为我想把内联 `max` 的影响与其他影响隔离开,而不是用 `-gcflags='-l -N'` 选项在全局范围内禁止优化。关于 `//go:` 注释在[这篇文章][10]中详细论述。
|
||||
[^4]: 你可以自己通过比较 `go test -bench=. -gcflags=-S` 有无 `//go:noinline` 注释时的不同结果来验证一下。
|
||||
[^5]: 你可以用 `-gcflags=-d=ssa/prove/debug=on` 选项来自己验证一下。
|
||||
|
||||
#### 相关文章:
|
||||
|
||||
1. [使 Go 变快的 5 件事](https://dave.cheney.net/2014/06/07/five-things-that-make-go-fast)
|
||||
2. [为什么 Goroutine 的栈空间会无限增长?](https://dave.cheney.net/2013/06/02/why-is-a-goroutines-stack-infinite)
|
||||
3. [Go 中怎么写基准测试](https://dave.cheney.net/2013/06/30/how-to-write-benchmarks-in-go)
|
||||
4. [Go 中隐藏的编译指令](https://dave.cheney.net/2018/01/08/gos-hidden-pragmas)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go
|
||||
|
||||
作者:[Dave Cheney][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[lxbwolf](https://github.com/lxbwolf)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://dave.cheney.net/author/davecheney
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://github.com/golang/go
|
||||
[2]: tmp.gBQ2tEtMHc#easy-footnote-bottom-1-4053 (In Go, a method is just a function with a predefined formal parameter, the receiver. The relative costs of calling a free function vs a invoking a method, assuming that method is not called through an interface, are the same.)
|
||||
[3]: tmp.gBQ2tEtMHc#easy-footnote-bottom-2-4053 (Up until Go 1.14 the stack check preamble was also used by the garbage collector to stop the world by setting all active goroutine’s stacks to zero, forcing them to trap into the runtime the next time they made a function call. This system was <a href="https://github.com/golang/proposal/blob/master/design/24543-non-cooperative-preemption.md">recently replaced</a> with a mechanism which allowed the runtime to pause an goroutine without waiting for it to make a function call.)
|
||||
[4]: tmp.gBQ2tEtMHc#easy-footnote-bottom-3-4053 (I’m using the <code>//go:noinline</code> pragma to prevent the compiler from inlining <code>max</code>. This is because I want to isolate the effects of inlining on <code>max</code> rather than disabling optimisations globally with <code>-gcflags='-l -N'</code>. I go into detail about the <code>//go:</code> comments in <a href="https://dave.cheney.net/2018/01/08/gos-hidden-pragmas">this presentation</a>.)
|
||||
[5]: tmp.gBQ2tEtMHc#easy-footnote-bottom-4-4053 (You can check this for yourself by comparing the output of <code>go test -bench=. -gcflags=-S</code> with and without the <code>//go:noinline</code> annotation.)
|
||||
[6]: tmp.gBQ2tEtMHc#easy-footnote-bottom-5-4053 (You can check this yourself with the <code>-gcflags=-d=ssa/prove/debug=on</code> flag.)
|
||||
[7]: tmp.gBQ2tEtMHc#easy-footnote-1-4053
|
||||
[8]: https://github.com/golang/proposal/blob/master/design/24543-non-cooperative-preemption.md
|
||||
[9]: tmp.gBQ2tEtMHc#easy-footnote-2-4053
|
||||
[10]: https://dave.cheney.net/2018/01/08/gos-hidden-pragmas
|
||||
[11]: tmp.gBQ2tEtMHc#easy-footnote-3-4053
|
||||
[12]: tmp.gBQ2tEtMHc#easy-footnote-4-4053
|
||||
[13]: tmp.gBQ2tEtMHc#easy-footnote-5-4053
|
||||
[14]: https://dave.cheney.net/2014/06/07/five-things-that-make-go-fast (Five things that make Go fast)
|
||||
[15]: https://dave.cheney.net/2013/06/02/why-is-a-goroutines-stack-infinite (Why is a Goroutine’s stack infinite ?)
|
||||
[16]: https://dave.cheney.net/2013/06/30/how-to-write-benchmarks-in-go (How to write benchmarks in Go)
|
||||
[17]: https://dave.cheney.net/2018/01/08/gos-hidden-pragmas (Go’s hidden #pragmas)
|
99
published/20200428 Upgrading Fedora 31 to Fedora 32.md
Normal file
99
published/20200428 Upgrading Fedora 31 to Fedora 32.md
Normal file
@ -0,0 +1,99 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12195-1.html)
|
||||
[#]: subject: (Upgrading Fedora 31 to Fedora 32)
|
||||
[#]: via: (https://fedoramagazine.org/upgrading-fedora-31-to-fedora-32/)
|
||||
[#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/)
|
||||
|
||||
将 Fedora 31 升级到 Fedora 32
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
Fedora 32 [已经发布][2]。你可能想升级系统以获得 Fedora 中的最新功能。Fedora Workstation 有图形化的升级方法。另外,Fedora 提供了命令行方法,用于将 Fedora 31 升级到 Fedora 32。
|
||||
|
||||
升级前,请访问 [Fedora 32 个常见 bug 的维基页面][3],查看是否存在可能影响升级的问题。尽管 Fedora 社区试图确保升级正常进行,但是无法为用户可能使用的每种软硬件组合提供保证。
|
||||
|
||||
### 将 Fedora 31 Workstation 升级到 Fedora 32
|
||||
|
||||
在新版本发布不久之后就会出现通知,告诉你有可用的升级。你可以单击该通知启动 “GNOME 软件”。或者,你可以从 GNOME Shell 中选择“软件”。
|
||||
|
||||
在 “GNOME 软件”中选择<ruby>更新<rt>Updates</rt></ruby>选项卡,你会看到一个页面通知你 Fedora 32 现在可用。
|
||||
|
||||
如果你在此页面看不到任何内容,请尝试使用左上方的重新加载按钮。发布后,所有系统可能都需要一段时间才能看到可用的升级。
|
||||
|
||||
选择<ruby>下载<rt>Download</rt></ruby>获取升级包。你可以继续做事直到下载完成。然后使用 “GNOME 软件”重启系统并应用升级。升级需要时间,因此你可能需要喝杯咖啡,稍后再回来。
|
||||
|
||||
### 使用命令行
|
||||
|
||||
如果你是从 Fedora 的先前版本升级的,那么你可能对 `dnf upgrade` 插件很熟悉。这个方法是推荐和受支持的从 Fedora 31 升级到 Fedora 32 的方法。使用此插件将使你轻松地升级到 Fedora 32。
|
||||
|
||||
#### 1、更新软件并备份系统
|
||||
|
||||
在开始升级过程之前,请确保你有 Fedora 31 的最新软件。如果你安装了<ruby>模块化软件<rt>modular software</rt></ruby>,这尤为重要。`dnf` 和 “GNOME 软件”的最新版本对某些模块化流的升级过程进行了改进。要更新软件,请使用 “GNOME 软件” 或在终端中输入以下命令。
|
||||
|
||||
```
|
||||
sudo dnf upgrade --refresh
|
||||
```
|
||||
|
||||
此外,在继续操作之前,请确保备份系统。有关备份的帮助,请参阅 Fedora Magazine 上的[备份系列][4]。
|
||||
|
||||
#### 2、安装 DNF 插件
|
||||
|
||||
接下来,打开终端并输入以下命令安装插件:
|
||||
|
||||
```
|
||||
sudo dnf install dnf-plugin-system-upgrade
|
||||
```
|
||||
|
||||
#### 3、使用 DNF 开始更新
|
||||
|
||||
现在,你的系统已更新、已备份、并且已安装 DNF 插件,你可以在终端中使用以下命令开始升级:
|
||||
|
||||
```
|
||||
sudo dnf system-upgrade download --releasever=32
|
||||
```
|
||||
|
||||
这个命令将开始在本地下载所有的升级包,为升级做准备。如果你在升级的时候因为没有更新的包、依赖关系破损或退役的包而出现问题,请在输入上述命令时添加 `--allowerasing` 标志。这将允许 DNF 移除可能阻碍系统升级的软件包。
|
||||
|
||||
#### 4、重启并升级
|
||||
|
||||
当上一个命令完成了所有升级包的下载,你的系统就可以重新启动了。要将系统引导至升级过程,请在终端中输入以下命令:
|
||||
|
||||
```
|
||||
sudo dnf system-upgrade reboot
|
||||
```
|
||||
|
||||
此后,系统将重启。在许多版本之前,`fedup` 工具会在内核选择/启动页上创建一个新选项。使用 `dnf-plugin-system-upgrade` 包,你的系统会重启进入 Fedora 31 当前安装的内核;这个是正常的。在选择内核之后,你的系统会立即开始升级过程。
|
||||
|
||||
现在可能是喝杯咖啡休息的好时机!完成后,系统将重启,你将能够登录到新升级的 Fedora 32 系统。
|
||||
|
||||
![][5]
|
||||
|
||||
### 解决升级问题
|
||||
|
||||
有时,升级系统时可能会出现意外问题。如果你遇到任何问题,请访问 [DNF 系统升级文档][6],以获取有关故障排除的更多信息。
|
||||
|
||||
如果升级时遇到问题,并且系统上安装了第三方仓库,那么在升级时可能需要禁用这些仓库。对于 Fedora 不提供的仓库的支持,请联系仓库的提供者。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/upgrading-fedora-31-to-fedora-32/
|
||||
|
||||
作者:[Adam Šamalík][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/asamalik/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2020/04/31-32-816x345.png
|
||||
[2]: https://linux.cn/article-12164-1.html
|
||||
[3]: https://fedoraproject.org/wiki/Common_F32_bugs
|
||||
[4]: https://fedoramagazine.org/taking-smart-backups-duplicity/
|
||||
[5]: https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot_f23-ws-upgrade-test_2016-06-10_110906-1024x768.png
|
||||
[6]: https://docs.fedoraproject.org/en-US/quick-docs/dnf-system-upgrade/#Resolving_post-upgrade_issues
|
@ -0,0 +1,165 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (lxbwolf)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12193-1.html)
|
||||
[#]: subject: (Drop PNG and JPG for your online images: Use WebP)
|
||||
[#]: via: (https://opensource.com/article/20/4/webp-image-compression)
|
||||
[#]: author: (Jeff Macharyas https://opensource.com/users/jeffmacharyas)
|
||||
|
||||
线上图片请抛弃 PNG 和 JPG:使用 WebP
|
||||
======
|
||||
|
||||
> 了解一下这个开源的图片编辑工具来节省时间和空间。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202005/07/143932l22hot7ebhbbqjmm.jpg)
|
||||
|
||||
WebP 是 2010 年 Google 开发的一种图片格式,它为网页上的图片提供了卓越的无损和有损压缩。网站开发者们可以使用 WebP 来创建尺寸更小、细节更丰富的图片,以此来提高网站的速度。更快的加载速度对于网站的用户体验和网站的营销效果是至关重要的。
|
||||
|
||||
为了在所有设备和用户中达到最佳加载效果,你网站上的图片文件大小不应该超过 500 KB。
|
||||
|
||||
与 PNG 图片相比,WebP 无损图片通常至少要比 PNG 图片小 25%。在同等的 SSIM(<ruby>结构相似度<rt>structural similarity</rt></ruby>)质量指标下,WebP 有损图片通常比 JPEG 图片小 25% 到 34%。
|
||||
|
||||
无损 WebP 也支持透明度。而在可接受有损 RGB 压缩的情况下,有损 WebP 也支持透明度,通常其大小比 PNG 文件小三倍。
|
||||
|
||||
Google 报告称,把动画 GIF 文件转换为有损 WebP 后文件大小减少了 64%,转换为无损 WebP 后文件大小减少了 19%。
|
||||
|
||||
WebP 文件格式是一种基于 RIFF(<ruby>资源互换文件格式<rt>resource interchange file format</rt></ruby>)的文档格式。你可以用 [hexdump][2] 看到文件的签名是 `52 49 46 46`(RIFF):
|
||||
|
||||
|
||||
```
|
||||
$ hexdump --canonical pixel.webp
|
||||
00000000 52 49 46 46 26 00 00 00 [...] |RIFF&...WEBPVP8 |
|
||||
00000010 1a 00 00 00 30 01 00 9d [...] |....0....*......|
|
||||
00000020 0e 25 a4 00 03 70 00 fe [...] |.%...p...`....|
|
||||
0000002e
|
||||
```
|
||||
|
||||
独立的 libwebp 库作为 WebP 技术规范的参考实现,可以从 Google 的 [Git 仓库][3] 或 tar 包中获得。
|
||||
|
||||
全球在用的 80% 的 web 浏览器兼容 WebP 格式。本文撰写时,Apple 的 Safari 浏览器还不兼容。解决这个问题的方法是将 JPG/PNG 图片与 WebP 图片一起提供,有一些方法和 Wordpress 插件可以做到这一点。
|
||||
|
||||
### 为什么要这样做?
|
||||
|
||||
我的部分工作是设计和维护我们组织的网站。由于网站是个营销工具,而网站的速度是衡量用户体验的重要指标,我一直致力于提高网站速度,通过把图片转换为 WebP 来减少图片大小是一个很好的解决方案。
|
||||
|
||||
我使用了 web.dev 来检测其中一个网页,该工具是由 Lighthouse 提供服务的,遵循 Apache 2.0 许可证,可以在 <https://github.com/GoogleChrome/lighthouse> 找到。
|
||||
|
||||
据其官方描述,“LIghthouse 是一个开源的,旨在提升网页质量的自动化工具。你可以在任何公共的或需要鉴权的网页上运行它。它有性能、可用性、渐进式 web 应用、SEO 等方面的审计。你可以在 Chrome 浏览器的开发工具中运行 Lighthouse,也可以通过命令行或作为 Node 模块运行。你输入一个 URL 给 Lighthouse,它会对这个网页进行一系列的审计,然后生成这个网页的审计结果报告。从报告的失败审计条目中可以知道应该怎么优化网页。每条审计都有对应的文档解释为什么该项目是重要的,以及如何修复它。”
|
||||
|
||||
### 创建更小的 WebP 图片
|
||||
|
||||
我测试的页面返回了三张图片。在它生成的报告中,它提供了推荐和目标。我选择了它报告有 650 KB 的 `app-graphic` 图片。通过把它转换为 WebP 格式,预计可以把图片大小降到 61 KB,节省 589 KB。我在 Photoshop 中把它转换了,用默认的 WebP 设置参数保存它,它的文件大小为 44.9 KB。比预期的还要好!从下面的 Photoshop 截图中可以看出,两张图在视觉质量上完全一样。
|
||||
|
||||
![WebP vs JPG comparison][4]
|
||||
|
||||
*左图:650 KB(实际大小)。右图: 44.9 KB(转换之后的目标大小)。*
|
||||
|
||||
当然,也可以用开源图片编辑工具 [GIMP][5] 把图片导出为 WebP。它提供了几个质量和压缩的参数:
|
||||
|
||||
![GIMP dialog for exporting webp, as a webp][6]
|
||||
|
||||
另一张图放大后:
|
||||
|
||||
![WebP vs PNG comparison][7]
|
||||
|
||||
PNG(左图)和 WebP(右图),都是从 JPG 转换而来,两图对比可以看出 WebP 不仅在文件大小更小,在视觉质量上也更优秀。
|
||||
|
||||
### 把图片转换为 WebP
|
||||
|
||||
你也可以用 Linux 的命令行工具把图片从 JPG/PNG 转换为 WebP:
|
||||
|
||||
在命令行使用 `cwebp` 把 PNG 或 JPG 图片文件转换为 WebP 格式。你可以用下面的命令把 PNG 图片文件转换为质量参数为 80 的 WebP 图片。
|
||||
|
||||
```
|
||||
cwebp -q 80 image.png -o image.webp
|
||||
```
|
||||
|
||||
你还可以用 [Image Magick][8],这个工具可能在你的发行版本软件仓库中可以找到。转换的子命令是 `convert`,它需要的所有参数就是输入和输出文件:
|
||||
|
||||
```
|
||||
convert pixel.png pixel.webp
|
||||
```
|
||||
|
||||
### 使用编辑器把图片转换为 WebP
|
||||
|
||||
要在图片编辑器中来把图片转换为 WebP,可以使用 [GIMP][9]。从 2.10 版本开始,它原生地支持 WebP。
|
||||
|
||||
如果你是 Photoshop 用户,由于 Photoshop 默认不包含 WebP 支持,因此你需要一个转换插件。遵循 Apache License 2.0 许可证发布的 WebPShop 0.2.1 是一个用于打开和保存包括动画图在内的 WebP 图片的 Photoshop 模块,在 <https://github.com/webmproject/WebPShop> 可以找到。
|
||||
|
||||
为了能正常使用它,你需要把它放进 Photoshop 插件目录下的 `bin` 文件夹:
|
||||
|
||||
Windows x64 :`C:\Program Files\Adobe\Adobe Photoshop\Plug-ins\WebPShop.8bi`
|
||||
|
||||
Mac:`Applications/Adobe Photoshop/Plug-ins/WebPShop.plugin`
|
||||
|
||||
### Wordpress 上的 WebP
|
||||
|
||||
很多网站是用 Wordpress 搭建的(我的网站就是)。因此,Wordpress 怎么上传 WebP 图片?本文撰写时,它还不支持。但是,当然已经有插件来满足这种需求,因此你可以在你的网站上同时准备 WebP 和 PNG/JPG 图片(为 Apple 用户)。
|
||||
|
||||
在 [Marius Hosting][11] 有下面的[说明][10]:
|
||||
|
||||
“直接向 Wordpress 上传 WebP 图片会怎样?这很简单。向你的主题 `functions.php` 文件添加几行内容就可以了。Wordpress 默认不支持展示和上传 WebP 文件,但是我会向你介绍一下怎么通过几个简单的步骤来让它支持。登录进你的 Wordpress 管理员界面,进入‘外观/主题编辑器’找到 `functions.php`。复制下面的代码粘贴到该文件最后并保存:
|
||||
|
||||
```
|
||||
//** *Enable upload for webp image files.*/
|
||||
function webp_upload_mimes($existing_mimes) {
|
||||
$existing_mimes['webp'] = 'image/webp';
|
||||
return $existing_mimes;
|
||||
}
|
||||
add_filter('mime_types', 'webp_upload_mimes');
|
||||
```
|
||||
|
||||
如果你想在‘媒体/媒体库’时看到缩略图预览,那么你需要把下面的代码也添加到 `functions.php` 文件。为了找到 `functions.php` 文件,进入‘外观/主题编辑器’并搜索 `functions.php`,然后复制下面的代码粘贴到文件最后并保存:
|
||||
|
||||
```
|
||||
//** * Enable preview / thumbnail for webp image files.*/
|
||||
function webp_is_displayable($result, $path) {
|
||||
if ($result === false) {
|
||||
$displayable_image_types = array( IMAGETYPE_WEBP );
|
||||
$info = @getimagesize( $path );
|
||||
|
||||
if (empty($info)) {
|
||||
$result = false;
|
||||
} elseif (!in_array($info[2], $displayable_image_types)) {
|
||||
$result = false;
|
||||
} else {
|
||||
$result = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
add_filter('file_is_displayable_image', 'webp_is_displayable', 10, 2);
|
||||
```
|
||||
|
||||
”
|
||||
|
||||
### WebP 和未来
|
||||
|
||||
WebP 是一个健壮而优化的格式。它看起来更好,压缩率更高,并具有其他大部分常见图片格式的所有特性。不必再等了,现在就使用它吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/webp-image-compression
|
||||
|
||||
作者:[Jeff Macharyas][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[lxbwolf](https://github.com/lxbwolf)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/jeffmacharyas
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/painting_computer_screen_art_design_creative.png?itok=LVAeQx3_ (Painting art on a computer screen)
|
||||
[2]: https://opensource.com/article/19/8/dig-binary-files-hexdump
|
||||
[3]: https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html
|
||||
[4]: https://opensource.com/sites/default/files/uploads/webp-vs-jpg-app-graphic.png (WebP vs JPG comparison)
|
||||
[5]: http://gimp.org
|
||||
[6]: https://img.linux.net.cn/data/attachment/album/202005/07/143538plu797s4wmhy9b1p.jpg (GIMP dialog for exporting webp, as a webp)
|
||||
[7]: https://opensource.com/sites/default/files/uploads/xcompare-png-left-webp-right.png (WebP vs PNG comparison)
|
||||
[8]: https://imagemagick.org
|
||||
[9]: https://en.wikipedia.org/wiki/GIMP
|
||||
[10]: https://mariushosting.com/how-to-upload-webp-files-on-wordpress/
|
||||
[11]: https://mariushosting.com/
|
314
published/20200430 10 ways to analyze binary files on Linux.md
Normal file
314
published/20200430 10 ways to analyze binary files on Linux.md
Normal file
@ -0,0 +1,314 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12187-1.html)
|
||||
[#]: subject: (10 ways to analyze binary files on Linux)
|
||||
[#]: via: (https://opensource.com/article/20/4/linux-binary-analysis)
|
||||
[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe)
|
||||
|
||||
在 Linux 上分析二进制文件的 10 种方法
|
||||
======
|
||||
|
||||
> 这些简单的命令和工具可以帮助你轻松完成分析二进制文件的任务。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202005/05/232115nn0oduodo4oztv0a.jpg)
|
||||
|
||||
“这个世界上有 10 种人:懂二进制的人和不懂二进制的人。”
|
||||
|
||||
我们每天都在与二进制文件打交道,但我们对二进制文件却知之甚少。我所说的二进制,是指你每天运行的可执行文件,从命令行工具到成熟的应用程序都是。
|
||||
|
||||
Linux 提供了一套丰富的工具,让分析二进制文件变得轻而易举。无论你的工作角色是什么,如果你在 Linux 上工作,了解这些工具的基本知识将帮助你更好地理解你的系统。
|
||||
|
||||
在这篇文章中,我们将介绍其中一些最流行的 Linux 工具和命令,其中大部分都是 Linux 发行版的一部分。如果没有找到,你可以随时使用你的软件包管理器来安装和探索它们。请记住:学习在正确的场合使用正确的工具需要大量的耐心和练习。
|
||||
|
||||
### file
|
||||
|
||||
它的作用:帮助确定文件类型。
|
||||
|
||||
这将是你进行二进制分析的起点。我们每天都在与文件打交道,并非所有的文件都是可执行类型,除此之外还有各种各样的文件类型。在你开始之前,你需要了解要分析的文件类型。是二进制文件、库文件、ASCII 文本文件、视频文件、图片文件、PDF、数据文件等文件吗?
|
||||
|
||||
`file` 命令将帮助你确定你所处理的文件类型。
|
||||
|
||||
```
|
||||
$ file /bin/ls
|
||||
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=94943a89d17e9d373b2794dcb1f7e38c95b66c86, stripped
|
||||
$
|
||||
$ file /etc/passwd
|
||||
/etc/passwd: ASCII text
|
||||
$
|
||||
```
|
||||
|
||||
### ldd
|
||||
|
||||
它的作用:打印共享对象依赖关系。
|
||||
|
||||
如果你已经在一个可执行的二进制文件上使用了上面的 `file` 命令,你肯定会看到输出中的“<ruby>动态链接<rt>dynamically linked</rt></ruby>”信息。它是什么意思呢?
|
||||
|
||||
在开发软件的时候,我们尽量不要重造轮子。有一组常见的任务是大多数软件程序需要的,比如打印输出或从标准输入/打开的文件中读取等。所有这些常见的任务都被抽象成一组通用的函数,然后每个人都可以使用,而不是写出自己的变体。这些常用的函数被放在一个叫 `libc` 或 `glibc` 的库中。
|
||||
|
||||
如何找到可执行程序所依赖的库?这就是 `ldd` 命令的作用了。对动态链接的二进制文件运行该命令会显示出所有依赖库和它们的路径。
|
||||
|
||||
```
|
||||
$ ldd /bin/ls
|
||||
linux-vdso.so.1 => (0x00007ffef5ba1000)
|
||||
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fea9f854000)
|
||||
libcap.so.2 => /lib64/libcap.so.2 (0x00007fea9f64f000)
|
||||
libacl.so.1 => /lib64/libacl.so.1 (0x00007fea9f446000)
|
||||
libc.so.6 => /lib64/libc.so.6 (0x00007fea9f079000)
|
||||
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fea9ee17000)
|
||||
libdl.so.2 => /lib64/libdl.so.2 (0x00007fea9ec13000)
|
||||
/lib64/ld-linux-x86-64.so.2 (0x00007fea9fa7b000)
|
||||
libattr.so.1 => /lib64/libattr.so.1 (0x00007fea9ea0e000)
|
||||
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fea9e7f2000)
|
||||
$
|
||||
```
|
||||
|
||||
### ltrace
|
||||
|
||||
它的作用:库调用跟踪器。
|
||||
|
||||
我们现在知道如何使用 `ldd` 命令找到一个可执行程序所依赖的库。然而,一个库可以包含数百个函数。在这几百个函数中,哪些是我们的二进制程序正在使用的实际函数?
|
||||
|
||||
`ltrace` 命令可以显示运行时从库中调用的所有函数。在下面的例子中,你可以看到被调用的函数名称,以及传递给该函数的参数。你也可以在输出的最右边看到这些函数返回的内容。
|
||||
|
||||
```
|
||||
$ ltrace ls
|
||||
__libc_start_main(0x4028c0, 1, 0x7ffd94023b88, 0x412950 <unfinished ...>
|
||||
strrchr("ls", '/') = nil
|
||||
setlocale(LC_ALL, "") = "en_US.UTF-8"
|
||||
bindtextdomain("coreutils", "/usr/share/locale") = "/usr/share/locale"
|
||||
textdomain("coreutils") = "coreutils"
|
||||
__cxa_atexit(0x40a930, 0, 0, 0x736c6974756572) = 0
|
||||
isatty(1) = 1
|
||||
getenv("QUOTING_STYLE") = nil
|
||||
getenv("COLUMNS") = nil
|
||||
ioctl(1, 21523, 0x7ffd94023a50) = 0
|
||||
<< snip >>
|
||||
fflush(0x7ff7baae61c0) = 0
|
||||
fclose(0x7ff7baae61c0) = 0
|
||||
+++ exited (status 0) +++
|
||||
$
|
||||
```
|
||||
|
||||
### hexdump
|
||||
|
||||
它的作用:以 ASCII、十进制、十六进制或八进制显示文件内容。
|
||||
|
||||
通常情况下,当你用一个应用程序打开一个文件,而它不知道如何处理该文件时,就会出现这种情况。尝试用 `vim` 打开一个可执行文件或视频文件,你屏幕上会看到的只是抛出的乱码。
|
||||
|
||||
在 `hexdump` 中打开未知文件,可以帮助你看到文件的具体内容。你也可以选择使用一些命令行选项来查看用 ASCII 表示的文件数据。这可能会帮助你了解到它是什么类型的文件。
|
||||
|
||||
```
|
||||
$ hexdump -C /bin/ls | head
|
||||
00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............|
|
||||
00000010 02 00 3e 00 01 00 00 00 d4 42 40 00 00 00 00 00 |..>......B@.....|
|
||||
00000020 40 00 00 00 00 00 00 00 f0 c3 01 00 00 00 00 00 |@...............|
|
||||
00000030 00 00 00 00 40 00 38 00 09 00 40 00 1f 00 1e 00 |....@.8...@.....|
|
||||
00000040 06 00 00 00 05 00 00 00 40 00 00 00 00 00 00 00 |........@.......|
|
||||
00000050 40 00 40 00 00 00 00 00 40 00 40 00 00 00 00 00 |@.@.....@.@.....|
|
||||
00000060 f8 01 00 00 00 00 00 00 f8 01 00 00 00 00 00 00 |................|
|
||||
00000070 08 00 00 00 00 00 00 00 03 00 00 00 04 00 00 00 |................|
|
||||
00000080 38 02 00 00 00 00 00 00 38 02 40 00 00 00 00 00 |8.......8.@.....|
|
||||
00000090 38 02 40 00 00 00 00 00 1c 00 00 00 00 00 00 00 |8.@.............|
|
||||
$
|
||||
```
|
||||
|
||||
### strings
|
||||
|
||||
它的作用:打印文件中的可打印字符的字符串。
|
||||
|
||||
如果你只是在二进制中寻找可打印的字符,那么 `hexdump` 对于你的使用场景来说似乎有点矫枉过正,你可以使用 `strings` 命令。
|
||||
|
||||
在开发软件的时候,各种文本/ASCII 信息会被添加到其中,比如打印信息、调试信息、帮助信息、错误等。只要这些信息都存在于二进制文件中,就可以用 `strings` 命令将其转储到屏幕上。
|
||||
|
||||
```
|
||||
$ strings /bin/ls
|
||||
```
|
||||
|
||||
### readelf
|
||||
|
||||
它的作用:显示有关 ELF 文件的信息。
|
||||
|
||||
ELF(<ruby>可执行和可链接文件格式<rt>Executable and Linkable File Format</rt></ruby>)是可执行文件或二进制文件的主流格式,不仅是 Linux 系统,也是各种 UNIX 系统的主流文件格式。如果你已经使用了像 `file` 命令这样的工具,它告诉你文件是 ELF 格式,那么下一步就是使用 `readelf` 命令和它的各种选项来进一步分析文件。
|
||||
|
||||
在使用 `readelf` 命令时,有一份实际的 ELF 规范的参考是非常有用的。你可以在[这里][2]找到该规范。
|
||||
|
||||
```
|
||||
$ readelf -h /bin/ls
|
||||
ELF Header:
|
||||
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
|
||||
Class: ELF64
|
||||
Data: 2's complement, little endian
|
||||
Version: 1 (current)
|
||||
OS/ABI: UNIX - System V
|
||||
ABI Version: 0
|
||||
Type: EXEC (Executable file)
|
||||
Machine: Advanced Micro Devices X86-64
|
||||
Version: 0x1
|
||||
Entry point address: 0x4042d4
|
||||
Start of program headers: 64 (bytes into file)
|
||||
Start of section headers: 115696 (bytes into file)
|
||||
Flags: 0x0
|
||||
Size of this header: 64 (bytes)
|
||||
Size of program headers: 56 (bytes)
|
||||
Number of program headers: 9
|
||||
Size of section headers: 64 (bytes)
|
||||
Number of section headers: 31
|
||||
Section header string table index: 30
|
||||
$
|
||||
```
|
||||
|
||||
### objdump
|
||||
|
||||
它的作用:从对象文件中显示信息。
|
||||
|
||||
二进制文件是通过你编写的源码创建的,这些源码会通过一个叫做编译器的工具进行编译。这个编译器会生成相对于源代码的机器语言指令,然后由 CPU 执行特定的任务。这些机器语言代码可以通过被称为汇编语言的助记词来解读。汇编语言是一组指令,它可以帮助你理解由程序所进行并最终在 CPU 上执行的操作。
|
||||
|
||||
`objdump` 实用程序读取二进制或可执行文件,并将汇编语言指令转储到屏幕上。汇编语言知识对于理解 `objdump` 命令的输出至关重要。
|
||||
|
||||
请记住:汇编语言是特定于体系结构的。
|
||||
|
||||
```
|
||||
$ objdump -d /bin/ls | head
|
||||
|
||||
/bin/ls: file format elf64-x86-64
|
||||
|
||||
Disassembly of section .init:
|
||||
|
||||
0000000000402150 <_init@@Base>:
|
||||
402150: 48 83 ec 08 sub $0x8,%rsp
|
||||
402154: 48 8b 05 6d 8e 21 00 mov 0x218e6d(%rip),%rax # 61afc8 <__gmon_start__>
|
||||
40215b: 48 85 c0 test %rax,%rax
|
||||
$
|
||||
```
|
||||
|
||||
### strace
|
||||
|
||||
它的作用:跟踪系统调用和信号。
|
||||
|
||||
如果你用过前面提到的 `ltrace`,那就把 `strace` 想成是类似的。唯一的区别是,`strace` 工具不是追踪调用的库,而是追踪系统调用。系统调用是你与内核对接来完成工作的。
|
||||
|
||||
举个例子,如果你想把一些东西打印到屏幕上,你会使用标准库 `libc` 中的 `printf` 或 `puts` 函数;但是,在底层,最终会有一个名为 `write` 的系统调用来实际把东西打印到屏幕上。
|
||||
|
||||
```
|
||||
$ strace -f /bin/ls
|
||||
execve("/bin/ls", ["/bin/ls"], [/* 17 vars */]) = 0
|
||||
brk(NULL) = 0x686000
|
||||
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f967956a000
|
||||
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
|
||||
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
|
||||
fstat(3, {st_mode=S_IFREG|0644, st_size=40661, ...}) = 0
|
||||
mmap(NULL, 40661, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f9679560000
|
||||
close(3) = 0
|
||||
<< snip >>
|
||||
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
|
||||
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9679569000
|
||||
write(1, "R2 RH\n", 7R2 RH
|
||||
) = 7
|
||||
close(1) = 0
|
||||
munmap(0x7f9679569000, 4096) = 0
|
||||
close(2) = 0
|
||||
exit_group(0) = ?
|
||||
+++ exited with 0 +++
|
||||
$
|
||||
```
|
||||
|
||||
### nm
|
||||
|
||||
它的作用:列出对象文件中的符号。
|
||||
|
||||
如果你所使用的二进制文件没有被剥离,`nm` 命令将为你提供在编译过程中嵌入到二进制文件中的有价值的信息。`nm` 可以帮助你从二进制文件中识别变量和函数。你可以想象一下,如果你无法访问二进制文件的源代码时,这将是多么有用。
|
||||
|
||||
为了展示 `nm`,我们快速编写了一个小程序,用 `-g` 选项编译,我们会看到这个二进制文件没有被剥离。
|
||||
|
||||
```
|
||||
$ cat hello.c
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
printf("Hello world!");
|
||||
return 0;
|
||||
}
|
||||
$
|
||||
$ gcc -g hello.c -o hello
|
||||
$
|
||||
$ file hello
|
||||
hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=3de46c8efb98bce4ad525d3328121568ba3d8a5d, not stripped
|
||||
$
|
||||
$ ./hello
|
||||
Hello world!$
|
||||
$
|
||||
|
||||
|
||||
$ nm hello | tail
|
||||
0000000000600e20 d __JCR_END__
|
||||
0000000000600e20 d __JCR_LIST__
|
||||
00000000004005b0 T __libc_csu_fini
|
||||
0000000000400540 T __libc_csu_init
|
||||
U __libc_start_main@@GLIBC_2.2.5
|
||||
000000000040051d T main
|
||||
U printf@@GLIBC_2.2.5
|
||||
0000000000400490 t register_tm_clones
|
||||
0000000000400430 T _start
|
||||
0000000000601030 D __TMC_END__
|
||||
$
|
||||
```
|
||||
|
||||
### gdb
|
||||
|
||||
它的作用:GNU 调试器。
|
||||
|
||||
好吧,不是所有的二进制文件中的东西都可以进行静态分析。我们确实执行了一些运行二进制文件(进行分析)的命令,比如 `ltrace` 和 `strace`;然而,软件由各种条件组成,这些条件可能会导致执行不同的替代路径。
|
||||
|
||||
分析这些路径的唯一方法是在运行时环境,在任何给定的位置停止或暂停程序,并能够分析信息,然后再往下执行。
|
||||
|
||||
这就是调试器的作用,在 Linux 上,`gdb` 就是调试器的事实标准。它可以帮助你加载程序,在特定的地方设置断点,分析内存和 CPU 的寄存器,以及更多的功能。它是对上面提到的其他工具的补充,可以让你做更多的运行时分析。
|
||||
|
||||
有一点需要注意的是,一旦你使用 `gdb` 加载一个程序,你会看到它自己的 `(gdb)` 提示符。所有进一步的命令都将在这个 `gdb` 命令提示符中运行,直到你退出。
|
||||
|
||||
我们将使用我们之前编译的 `hello` 程序,使用 `gdb` 来看看它的工作原理。
|
||||
|
||||
```
|
||||
$ gdb -q ./hello
|
||||
Reading symbols from /home/flash/hello...done.
|
||||
(gdb) break main
|
||||
Breakpoint 1 at 0x400521: file hello.c, line 4.
|
||||
(gdb) info break
|
||||
Num Type Disp Enb Address What
|
||||
1 breakpoint keep y 0x0000000000400521 in main at hello.c:4
|
||||
(gdb) run
|
||||
Starting program: /home/flash/./hello
|
||||
|
||||
Breakpoint 1, main () at hello.c:4
|
||||
4 printf("Hello world!");
|
||||
Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7_6.6.x86_64
|
||||
(gdb) bt
|
||||
#0 main () at hello.c:4
|
||||
(gdb) c
|
||||
Continuing.
|
||||
Hello world![Inferior 1 (process 29620) exited normally]
|
||||
(gdb) q
|
||||
$
|
||||
```
|
||||
|
||||
### 结语
|
||||
|
||||
一旦你习惯了使用这些原生的 Linux 二进制分析工具,并理解了它们提供的输出,你就可以转向更高级和专业的开源二进制分析工具,比如 [radare2][3]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/linux-binary-analysis
|
||||
|
||||
作者:[Gaurav Kamathe][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/gkamathe
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tux_linux_penguin_code_binary.jpg?itok=TxGxW0KY (Tux with binary code background)
|
||||
[2]: http://www.skyfree.org/linux/references/ELF_Format.pdf
|
||||
[3]: https://github.com/radareorg/radare2
|
@ -0,0 +1,165 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (lxbwolf)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12181-1.html)
|
||||
[#]: subject: (Three Methods Boot CentOS/RHEL 7/8 Systems in Single User Mode)
|
||||
[#]: via: (https://www.2daygeek.com/boot-centos-7-8-rhel-7-8-single-user-mode/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
以单用户模式启动 CentOS/RHEL 7/8 的三种方法
|
||||
======
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202005/03/230109uw1f9zvv9upbhwv8.jpg)
|
||||
|
||||
单用户模式,也被称为维护模式,超级用户可以在此模式下恢复/修复系统问题。
|
||||
|
||||
通常情况下,这类问题在多用户环境中修复不了。系统可以启动但功能不能正常运行或者你登录不了系统。
|
||||
|
||||
在基于 [Red Hat][1](RHEL)7/8 的系统中,使用 `runlevel1.target` 或 `rescue.target` 来实现。
|
||||
|
||||
在此模式下,系统会挂载所有的本地文件系统,但不开启网络接口。
|
||||
|
||||
系统仅启动特定的几个服务和修复系统必要的尽可能少的功能。
|
||||
|
||||
当你想运行文件系统一致性检查来修复损坏的文件系统,或忘记 root 密码后重置密码,或要修复系统上的一个挂载点问题时,这个方法会很有用。
|
||||
|
||||
你可以用下面三种方法以单用户模式启动 [CentOS][2]/[RHEL][3] 7/8 系统。
|
||||
|
||||
* 方法 1:通过向内核添加 `rd.break` 参数来以单用户模式启动 CentOS/RHEL 7/8 系统
|
||||
* 方法 2:通过用 `init=/bin/bash` 或 `init=/bin/sh` 替换内核中的 `rhgb quiet` 语句来以单用户模式启动 CentOS/RHEL 7/8 系统
|
||||
* 方法 3:通过用 `rw init=/sysroot/bin/sh` 参数替换内核中的 `ro` 语句以单用户模式启动 CentOS/RHEL 7/8 系统
|
||||
|
||||
### 方法 1
|
||||
|
||||
通过向内核添加 `rd.break` 参数来以单用户模式启动 CentOS/RHEL 7/8 系统。
|
||||
|
||||
重启你的系统,在 GRUB2 启动界面,按下 `e` 键来编辑选中的内核。你需要选中第一行,第一个是最新的内核,然而如果你想用旧的内核启动系统你也可以选择其他的行。
|
||||
|
||||
![](https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-2.png)
|
||||
|
||||
根据你的 RHEL/CentOS 版本,找到 `linux16` 或 `linux` 语句,按下键盘上的 `End` 键,跳到行末,像下面截图中展示的那样添加关键词 `rd.break`,按下 `Ctrl+x` 或 `F10` 来进入单用户模式。
|
||||
|
||||
如果你的系统是 RHEL/CentOS 7,你需要找 `linux16`,如果你的系统是 RHEL/CentOS 8,那么你需要找 `linux`。
|
||||
|
||||
![](https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-3.png)
|
||||
|
||||
这个修改会让你的 root 文件系统以 “只读(`ro`)” 模式挂载。你可以用下面的命令来验证下。下面的输出也明确地告诉你当前是在 “<ruby>紧急模式<rt>Emergency Mode</rt></ruby>”。
|
||||
|
||||
```
|
||||
# mount | grep root
|
||||
```
|
||||
|
||||
![](https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-5.png)
|
||||
|
||||
为了修改 `sysroot` 文件系统,你需要用读写模式(`rw`)重新挂载它。
|
||||
|
||||
```
|
||||
# mount -o remount,rw /sysroot
|
||||
```
|
||||
|
||||
运行下面的命令修改环境,这就是大家熟知的 “监禁目录” 或 “chroot 监狱”。
|
||||
|
||||
```
|
||||
# chroot /sysroot
|
||||
```
|
||||
|
||||
![](https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-8.png)
|
||||
|
||||
现在,单用户模式已经完全准备好了。当你修复了你的问题要退出单用户模式时,执行下面的步骤。
|
||||
|
||||
CentOS/RHEL 7/8 默认使用 SELinux,因此创建下面的隐藏文件,这个文件会在下一次启动时重新标记所有文件。
|
||||
|
||||
```
|
||||
# touch /.autorelabel
|
||||
```
|
||||
|
||||
最后,用下面的命令重启系统。你也可以输入两次 `exit` 命令来重启你的系统。
|
||||
|
||||
```
|
||||
# reboot -f
|
||||
```
|
||||
|
||||
### 方法 2
|
||||
|
||||
通过用 `init=/bin/bash` 或 `init=/bin/sh` 替换内核中的 `rhgb quiet` 语句来以单用户模式启动 CentOS/RHEL 7/8 系统。
|
||||
|
||||
重启你的系统,在 GRUB2 启动界面,按下 `e` 键来编辑选中的内核。
|
||||
|
||||
![](https://www.2daygeek.com/wp-content/uploads/2018/12/reset-forgotten-root-password-on-rhel-7-centos-7-2.png)
|
||||
|
||||
找到语句 `rhgb quiet`,用 `init=/bin/bash` 或 `init=/bin/sh` 替换它,然后按下 `Ctrl+x` 或 `F10` 来进入单用户模式。
|
||||
|
||||
`init=/bin/bash` 的截图。
|
||||
|
||||
![](https://www.2daygeek.com/wp-content/uploads/2018/12/method-reset-forgotten-root-password-on-rhel-7-centos-7-1.png)
|
||||
|
||||
`init=/bin/sh` 的截图。
|
||||
|
||||
![](https://www.2daygeek.com/wp-content/uploads/2018/12/method-reset-forgotten-root-password-on-rhel-7-centos-7-1a.png)
|
||||
|
||||
默认情况下,上面的操作会以只读(`ro`)模式挂载你的 `/` 分区,因此你需要以读写(`rw`)模式重新挂载 `/` 文件系统,这样才能修改它。
|
||||
|
||||
```
|
||||
# mount -o remount,rw /
|
||||
```
|
||||
|
||||
![](https://www.2daygeek.com/wp-content/uploads/2018/12/method-reset-forgotten-root-password-on-rhel-7-centos-7-4.png)
|
||||
|
||||
现在你可以执行你的任务了。当结束时,执行下面的命令来开启重启时的 SELinux 重新标记。
|
||||
|
||||
```
|
||||
# touch /.autorelabel
|
||||
```
|
||||
|
||||
最后,重启系统。
|
||||
|
||||
```
|
||||
# exec /sbin/init 6
|
||||
```
|
||||
|
||||
### 方法 3
|
||||
|
||||
通过用 `rw init=/sysroot/bin/sh` 参数替换内核中的 `ro` 单词,以单用户模式启动 CentOS/RHEL 7/8 系统。
|
||||
|
||||
为了中断自动启动的过程,重启你的系统并在 GRUB2 启动界面按下任意键。
|
||||
|
||||
现在会展示你系统上所有可用的内核,选择最新的内核,按下 `e` 键来编辑选中的内核参数。
|
||||
|
||||
找到以 `linux` 或 `linux16` 开头的语句,用 `rw init=/sysroot/bin/sh` 替换 `ro`。替换完后按下 `Ctrl+x` 或 `F10` 来进入单用户模式。
|
||||
|
||||
运行下面的命令把环境切换为 “chroot 监狱”。
|
||||
|
||||
```
|
||||
# chroot /sysroot
|
||||
```
|
||||
|
||||
如果需要,做出必要的修改。修改完后,执行下面的命令来开启重启时的 SELinux 重新标记。
|
||||
|
||||
```
|
||||
# touch /.autorelabel
|
||||
```
|
||||
|
||||
最后,重启系统。
|
||||
|
||||
```
|
||||
# reboot -f
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/boot-centos-7-8-rhel-7-8-single-user-mode/
|
||||
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[lxbwolf](https://github.com/lxbwolf)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.2daygeek.com/author/magesh/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.2daygeek.com/category/red-hat/
|
||||
[2]: https://www.2daygeek.com/category/centos/
|
||||
[3]: https://www.2daygeek.com/category/rhel/
|
||||
[4]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
208
published/20200502 Mid-stack inlining in Go.md
Normal file
208
published/20200502 Mid-stack inlining in Go.md
Normal file
@ -0,0 +1,208 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (lxbwolf)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12184-1.html)
|
||||
[#]: subject: (Mid-stack inlining in Go)
|
||||
[#]: via: (https://dave.cheney.net/2020/05/02/mid-stack-inlining-in-go)
|
||||
[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney)
|
||||
|
||||
Go 中对栈中函数进行内联
|
||||
======
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202005/04/230304avxkxlyoozbiw1bn.jpg)
|
||||
|
||||
[上一篇文章][1]中我论述了<ruby>叶子内联<rt>leaf inlining</rt></ruby>是怎样让 Go 编译器减少函数调用的开销的,以及延伸出了跨函数边界的优化的机会。本文中,我要论述内联的限制以及叶子内联与<ruby>栈中内联<rt>mid-stack inlining</rt></ruby>的对比。
|
||||
|
||||
### 内联的限制
|
||||
|
||||
把函数内联到它的调用处消除了调用的开销,为编译器进行其他的优化提供了更好的机会,那么问题来了,既然内联这么好,内联得越多开销就越少,*为什么不尽可能多地内联呢?*
|
||||
|
||||
内联可能会以增加程序大小换来更快的执行时间。限制内联的最主要原因是,创建许多函数的内联副本会增加编译时间,并导致生成更大的二进制文件的边际效应。即使把内联带来的进一步的优化机会考虑在内,太激进的内联也可能会增加生成的二进制文件的大小和编译时间。
|
||||
|
||||
内联收益最大的是[小函数][2],相对于调用它们的开销来说,这些函数做很少的工作。随着函数大小的增长,函数内部做的工作与函数调用的开销相比省下的时间越来越少。函数越大通常越复杂,因此优化其内联形式相对于原地优化的好处会减少。
|
||||
|
||||
### 内联预算
|
||||
|
||||
在编译过程中,每个函数的内联能力是用*内联预算*计算的 [^1]。开销的计算过程可以巧妙地内化,像一元和二元等简单操作,在<ruby>抽象语法数<rt>Abstract Syntax Tree</rt></ruby>(AST)中通常是每个节点一个单位,更复杂的操作如 `make` 可能单位更多。考虑下面的例子:
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
func small() string {
|
||||
s := "hello, " + "world!"
|
||||
return s
|
||||
}
|
||||
|
||||
func large() string {
|
||||
s := "a"
|
||||
s += "b"
|
||||
s += "c"
|
||||
s += "d"
|
||||
s += "e"
|
||||
s += "f"
|
||||
s += "g"
|
||||
s += "h"
|
||||
s += "i"
|
||||
s += "j"
|
||||
s += "k"
|
||||
s += "l"
|
||||
s += "m"
|
||||
s += "n"
|
||||
s += "o"
|
||||
s += "p"
|
||||
s += "q"
|
||||
s += "r"
|
||||
s += "s"
|
||||
s += "t"
|
||||
s += "u"
|
||||
s += "v"
|
||||
s += "w"
|
||||
s += "x"
|
||||
s += "y"
|
||||
s += "z"
|
||||
return s
|
||||
}
|
||||
|
||||
func main() {
|
||||
small()
|
||||
large()
|
||||
}
|
||||
```
|
||||
|
||||
使用 `-gcflags=-m=2` 参数编译这个函数能让我们看到编译器分配给每个函数的开销:
|
||||
|
||||
```bash
|
||||
% go build -gcflags=-m=2 inl.go
|
||||
# command-line-arguments
|
||||
./inl.go:3:6: can inline small with cost 7 as: func() string { s := "hello, world!"; return s }
|
||||
./inl.go:8:6: cannot inline large: function too complex: cost 82 exceeds budget 80
|
||||
./inl.go:38:6: can inline main with cost 68 as: func() { small(); large() }
|
||||
./inl.go:39:7: inlining call to small func() string { s := "hello, world!"; return s }
|
||||
```
|
||||
|
||||
编译器根据函数 `func small()` 的开销(7)决定可以对它内联,而 `func large()` 的开销太大,编译器决定不进行内联。`func main()` 被标记为适合内联的,分配了 68 的开销;其中 `small` 占用 7,调用 `small` 函数占用 57,剩余的(4)是它自己的开销。
|
||||
|
||||
可以用 `-gcflag=-l` 参数控制内联预算的等级。下面是可使用的值:
|
||||
|
||||
* `-gcflags=-l=0` 默认的内联等级。
|
||||
* `-gcflags=-l`(或 `-gcflags=-l=1`)取消内联。
|
||||
* `-gcflags=-l=2` 和 `-gcflags=-l=3` 现在已经不使用了。和 `-gcflags=-l=0` 相比没有区别。
|
||||
* `-gcflags=-l=4` 减少非叶子函数和通过接口调用的函数的开销。[^2]
|
||||
|
||||
#### 不确定语句的优化
|
||||
|
||||
一些函数虽然内联的开销很小,但由于太复杂它们仍不适合进行内联。这就是函数的不确定性,因为一些操作的语义在内联后很难去推导,如 `recover`、`break`。其他的操作,如 `select` 和 `go` 涉及运行时的协调,因此内联后引入的额外的开销不能抵消内联带来的收益。
|
||||
|
||||
不确定的语句也包括 `for` 和 `range`,这些语句不一定开销很大,但目前为止还没有对它们进行优化。
|
||||
|
||||
### 栈中函数优化
|
||||
|
||||
在过去,Go 编译器只对叶子函数进行内联 —— 只有那些不调用其他函数的函数才有资格。在上一段不确定的语句的探讨内容中,一次函数调用就会让这个函数失去内联的资格。
|
||||
|
||||
进入栈中进行内联,就像它的名字一样,能内联在函数调用栈中间的函数,不需要先让它下面的所有的函数都被标记为有资格内联的。栈中内联是 David Lazar 在 Go 1.9 中引入的,并在随后的版本中做了改进。[这篇文稿][5]深入探究了保留栈追踪行为和被深度内联后的代码路径里的 `runtime.Callers` 的难点。
|
||||
|
||||
在前面的例子中我们看到了栈中函数内联。内联后,`func main()` 包含了 `func small()` 的函数体和对 `func large()` 的一次调用,因此它被判定为非叶子函数。在过去,这会阻止它被继续内联,虽然它的联合开销小于内联预算。
|
||||
|
||||
栈中内联的最主要的应用案例就是减少贯穿函数调用栈的开销。考虑下面的例子:
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type Rectangle struct {}
|
||||
|
||||
//go:noinline
|
||||
func (r *Rectangle) Height() int {
|
||||
h, _ := strconv.ParseInt("7", 10, 0)
|
||||
return int(h)
|
||||
}
|
||||
|
||||
func (r *Rectangle) Width() int {
|
||||
return 6
|
||||
}
|
||||
|
||||
func (r *Rectangle) Area() int { return r.Height() * r.Width() }
|
||||
|
||||
func main() {
|
||||
var r Rectangle
|
||||
fmt.Println(r.Area())
|
||||
}
|
||||
```
|
||||
|
||||
在这个例子中, `r.Area()` 是个简单的函数,调用了两个函数。`r.Width()` 可以被内联,`r.Height()` 这里用 `//go:noinline` 指令标注了,不能被内联。[^3]
|
||||
|
||||
```bash
|
||||
% go build -gcflags='-m=2' square.go
|
||||
# command-line-arguments
|
||||
./square.go:12:6: cannot inline (*Rectangle).Height: marked go:noinline
|
||||
./square.go:17:6: can inline (*Rectangle).Width with cost 2 as: method(*Rectangle) func() int { return 6 }
|
||||
./square.go:21:6: can inline (*Rectangle).Area with cost 67 as: method(*Rectangle) func() int { return r.Height() * r.Width() }
|
||||
./square.go:21:61: inlining call to (*Rectangle).Width method(*Rectangle) func() int { return 6 }
|
||||
./square.go:23:6: cannot inline main: function too complex: cost 150 exceeds budget 80
|
||||
./square.go:25:20: inlining call to (*Rectangle).Area method(*Rectangle) func() int { return r.Height() * r.Width() }
|
||||
./square.go:25:20: inlining call to (*Rectangle).Width method(*Rectangle) func() int { return 6 }
|
||||
```
|
||||
|
||||
由于 `r.Area()` 中的乘法与调用它的开销相比并不大,因此内联它的表达式是纯收益,即使它的调用的下游 `r.Height()` 仍是没有内联资格的。
|
||||
|
||||
#### 快速路径内联
|
||||
|
||||
关于栈中内联的效果最令人吃惊的例子是 2019 年 [Carlo Alberto Ferraris][7] 通过允许把 `sync.Mutex.Lock()` 的快速路径(非竞争的情况)内联到它的调用方来[提升它的性能][7]。在这个修改之前,`sync.Mutex.Lock()` 是个很大的函数,包含很多难以理解的条件,使得它没有资格被内联。即使锁可用时,调用者也要付出调用 `sync.Mutex.Lock()` 的代价。
|
||||
|
||||
Carlo 把 `sync.Mutex.Lock()` 分成了两个函数(他自己称为<ruby>外联<rt>outlining</rt></ruby>)。外部的 `sync.Mutex.Lock()` 方法现在调用 `sync/atomic.CompareAndSwapInt32()` 且如果 CAS(<ruby>比较并交换<rt>Compare and Swap</rt></ruby>)成功了之后立即返回给调用者。如果 CAS 失败,函数会走到 `sync.Mutex.lockSlow()` 慢速路径,需要对锁进行注册,暂停 goroutine。[^4]
|
||||
|
||||
```bash
|
||||
% go build -gcflags='-m=2 -l=0' sync 2>&1 | grep '(*Mutex).Lock'
|
||||
../go/src/sync/mutex.go:72:6: can inline (*Mutex).Lock with cost 69 as: method(*Mutex) func() { if "sync/atomic".CompareAndSwapInt32(&m.state, 0, mutexLocked) { if race.Enabled { }; return }; m.lockSlow() }
|
||||
```
|
||||
|
||||
通过把函数分割成一个简单的不能再被分割的外部函数,和(如果没走到外部函数就走到的)一个处理慢速路径的复杂的内部函数,Carlo 组合了栈中函数内联和[编译器对基础操作的支持][9],减少了非竞争锁 14% 的开销。之后他在 `sync.RWMutex.Unlock()` 重复这个技巧,节省了另外 9% 的开销。
|
||||
|
||||
[^1]: 不同发布版本中,在考虑该函数是否适合内联时,Go 编译器对同一函数的预算是不同的。
|
||||
[^2]: 时刻记着编译器的作者警告过[“更高的内联等级(比 -l 更高)可能导致错误或不被支持”][11]。 Caveat emptor。
|
||||
[^3]: 编译器有足够的能力来内联像 `strconv.ParseInt` 的复杂函数。作为一个实验,你可以尝试去掉 `//go:noinline` 注释,使用 `-gcflags=-m=2` 编译后观察。
|
||||
[^4]: `race.Enable` 表达式是通过传递给 `go` 工具的 `-race` 参数控制的一个常量。对于普通编译,它的值是 `false`,此时编译器可以完全省略代码路径。
|
||||
|
||||
### 相关文章:
|
||||
|
||||
1. [Go 中的内联优化][15]
|
||||
2. [goroutine 的栈为什么会无限增长?][16]
|
||||
3. [栈追踪和 errors 包][17]
|
||||
4. [零值是什么,为什么它很有用?][18]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://dave.cheney.net/2020/05/02/mid-stack-inlining-in-go
|
||||
|
||||
作者:[Dave Cheney][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[lxbwolf](https://github.com/lxbwolf)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://dave.cheney.net/author/davecheney
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://linux.cn/article-12176-1.html
|
||||
[2]: https://medium.com/@joshsaintjacque/small-functions-considered-awesome-c95b3fd1812f
|
||||
[3]: tmp.FyRthF1bbF#easy-footnote-bottom-1-4076 (The budget the Go compiler applies to each function when considering if it is eligible for inlining changes release to release.)
|
||||
[4]: tmp.FyRthF1bbF#easy-footnote-bottom-2-4076 (Keep in mind that the compiler authors warn that “<a href="https://github.com/golang/go/blob/be08e10b3bc07f3a4e7b27f44d53d582e15fd6c7/src/cmd/compile/internal/gc/inl.go#L11">Additional levels of inlining (beyond -l) may be buggy and are not supported”</a>. Caveat emptor.)
|
||||
[5]: https://docs.google.com/presentation/d/1Wcblp3jpfeKwA0Y4FOmj63PW52M_qmNqlQkNaLj0P5o/edit#slide=id.p
|
||||
[6]: tmp.FyRthF1bbF#easy-footnote-bottom-3-4076 (The compiler is powerful enough that it can inline complex functions like <code>strconv.ParseInt</code>. As a experiment, try removing the <code>//go:noinline</code> annotation and observe the result with <code>-gcflags=-m=2</code>.)
|
||||
[7]: https://go-review.googlesource.com/c/go/+/148959
|
||||
[8]: tmp.FyRthF1bbF#easy-footnote-bottom-4-4076 (The expression <code>race.Enable</code> is a constant controlled by the <code>-race</code> flag passed to the <code>go</code> tool. It is <code>false</code> for normal builds which allows the compiler to elide those code paths entirely.)
|
||||
[9]: https://dave.cheney.net/2019/08/20/go-compiler-intrinsics
|
||||
[10]: tmp.FyRthF1bbF#easy-footnote-1-4076
|
||||
[11]: https://github.com/golang/go/blob/be08e10b3bc07f3a4e7b27f44d53d582e15fd6c7/src/cmd/compile/internal/gc/inl.go#L11
|
||||
[12]: tmp.FyRthF1bbF#easy-footnote-2-4076
|
||||
[13]: tmp.FyRthF1bbF#easy-footnote-3-4076
|
||||
[14]: tmp.FyRthF1bbF#easy-footnote-4-4076
|
||||
[15]: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go (Inlining optimisations in Go)
|
||||
[16]: https://dave.cheney.net/2013/06/02/why-is-a-goroutines-stack-infinite (Why is a Goroutine’s stack infinite ?)
|
||||
[17]: https://dave.cheney.net/2016/06/12/stack-traces-and-the-errors-package (Stack traces and the errors package)
|
||||
[18]: https://dave.cheney.net/2013/01/19/what-is-the-zero-value-and-why-is-it-useful (What is the zero value, and why is it useful?)
|
@ -0,0 +1,228 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12175-1.html)
|
||||
[#]: subject: (Pop OS 20.04 Review: Best Ubuntu-based Distribution Just Got Better)
|
||||
[#]: via: (https://itsfoss.com/pop-os-20-04-review/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Pop!_OS 20.04 点评:最好的基于 Ubuntu 的发行版越来越好了
|
||||
======
|
||||
|
||||
> Pop!_OS 20.04 是一款令人印象深刻的基于 Ubuntu 的 Linux 发行版。我在这篇评论中回顾了其主要的新功能,并分享了我对最新版本的体验。
|
||||
|
||||
现在,Ubuntu 20.04 LTS 及其官方变体版本已经发布了 - 是时候看看 [System76][1] 的 Pop!_OS 20.04 了,这是基于 Ubuntu 的最好的发行版之一。
|
||||
|
||||
老实说,Pop!_OS 是我最喜欢的 Linux 发行版,主要用于我做的所有事情。
|
||||
|
||||
现在,Pop!_OS 20.04 终于来了。是时候来看看它提供了哪些功能,以及你是否应该升级?
|
||||
|
||||
### Pop!_OS 20.04 LTS 中有什么新东西?
|
||||
|
||||
![][2]
|
||||
|
||||
从视觉上看,Pop!\_OS 20.04 LTS 与 Pop!\_OS 19.10 并没有太大的区别。然而,你可以发现几个新功能和改进。
|
||||
|
||||
但是,如果你之前使用的是 Pop!_OS 18.04 LTS,则可以发现有很多东西可以尝试。
|
||||
|
||||
随着 [GNOME 3.36][3] 的到来,及其带来的一些新功能,Pop!_OS 20.04 成为了一个令人激动的版本。
|
||||
|
||||
总的来说,以下是一些主要的亮点。
|
||||
|
||||
* 自动窗口平铺
|
||||
* 新的应用程序切换器和启动器
|
||||
* 在 Pop!_Shop 中增加了对 Flatpack 的支持。
|
||||
* GNOME 3.36
|
||||
* Linux 内核 5.4
|
||||
* 改进的混合图形支持
|
||||
|
||||
虽然听起来很有趣,但我们还是来了解一下详细的变化,以及到目前为止 Pop!_OS 20.04 的体验如何。
|
||||
|
||||
#### Pop!_OS 20.04 中的用户体验提升
|
||||
|
||||
毫无疑问,很多 Linux 发行版都提供了开箱即用的用户体验。同样的,[Ubuntu 20.04 LTS 也有一流的改进和功能][4]。
|
||||
|
||||
而对于 System76 的 Pop!_OS,他们总是试图更进一步。并且,大多数新功能旨在通过提供有用的功能来改善用户体验。
|
||||
|
||||
在这里,我将介绍一些改进,其中包括 [GNOME 3.36][3] 和 Pop!_OS 特有的一些功能。
|
||||
|
||||
#### 支持系统托盘图标
|
||||
|
||||
总算是有了!这可能不是什么大的改变 —— 但 Pop!_OS 以前没有支持系统托盘图标(或小程序图标)。
|
||||
|
||||
![][5]
|
||||
|
||||
随着 20.04 LTS 的发布,默认情况就有了系统托盘,不需要任何扩展。
|
||||
|
||||
依靠系统托盘图标的程序可能并不多 —— 但它仍然是重要的东西。
|
||||
|
||||
就我而言,我以前无法在 Pop!_OS 19.10 上使用 [ActivityWatch][6] —— 但现在可以了。
|
||||
|
||||
#### 自动窗口平铺
|
||||
|
||||
![][7]
|
||||
|
||||
自动窗口平铺是我一直想尝试的东西 —— 但从来没花时间使用过 [i3][9] 这样的[平铺窗口管理器][8]来设置它,更别说是 [Regolith 桌面][10]了。
|
||||
|
||||
在 Pop!_OS 20.04 中,你就不需要这样做了。自动窗口平铺功能已经内置,无需设置。
|
||||
|
||||
它还提供了“显示活动提示”的选项,也就是说,它将高亮显示活动窗口以避免混淆。而且,你还可以调整窗口之间的间隙。
|
||||
|
||||
![][11]
|
||||
|
||||
你可以在他们的官方视频中看到它是如何工作的:
|
||||
|
||||
- [System76 Pop!_OS 20.04 - Auto Tiling](https://youtu.be/-fltwBKsMY0)
|
||||
|
||||
而且,我得说,这是 Pop!_OS 20.04 上最大的新增功能之一,有可能帮助你更有效地进行多任务处理。
|
||||
|
||||
即使每次使用该功能都很方便,但为了最大程度地利用它,最好是使用一个大于 21 英寸的显示屏(至少)! 而且,因为这个原因 —— 我真的很想把我的显示器也升级一下!
|
||||
|
||||
#### 新的扩展应用
|
||||
|
||||
![][13]
|
||||
|
||||
Pop!_OS 内置了一些独特的 GNOME 扩展。但是,你不需要用 GNOME Tweaks 来管理扩展。
|
||||
|
||||
新增加的 “Extensions” 应用可以让你在 Pop!_OS 20.04 上配置和管理扩展程序。
|
||||
|
||||
#### 改进的通知中心
|
||||
|
||||
![][14]
|
||||
|
||||
在新的 GNOME 3.36 中,通知中心的外观经过了改进。这里,我启用了黑暗模式。
|
||||
|
||||
#### 新的应用程序切换器 & 启动器
|
||||
|
||||
![][15]
|
||||
|
||||
你仍然可以用 `ALT+TAB` 或 `Super+TAB` 来浏览正在运行的应用程序。
|
||||
|
||||
但是,当你有很多事情要做的时候,这很耗时。所以,在 Pop!_OS 20.04上,你可以使用 `Super+ /` 激活应用程序切换器和启动器。
|
||||
|
||||
一旦你习惯了这个快捷键,它将是非常方便的东西。
|
||||
|
||||
除此以外,你可能会发现 Pop!_OS 20.04 上的图标/窗口在视觉上有许多其它细微的改进。
|
||||
|
||||
#### 新的登录界面
|
||||
|
||||
嗯,这是 GNOME 3.36 带来的一个明显的变化。但是,它看起来确实很不错!
|
||||
|
||||
![][16]
|
||||
|
||||
#### Pop!_Shop 支持 Flatpak
|
||||
|
||||
通常,Pop!_Shop 已经是一个非常有用的东西了,包括它自有的在内,它带有一个巨大的软件仓库。
|
||||
|
||||
现在,在 Pop!\_OS 20.04 中,你可以用 Pop!_Shop 安装任何可用软件的 Debian 包或 Flatpak(通过 Flathub) —— 当然,前提是某个软件有 Flatpak 软件包。
|
||||
|
||||
如果你没有使用 Pop!_OS 20.04,你可能要看看[如何在 Linux 上使用 Flatpak][18]。
|
||||
|
||||
![][19]
|
||||
|
||||
就我个人而言,我并不是 Flatpak 的粉丝,但有些应用如 GIMP 需要你安装 Flatpak 包才能获得最新版本。所以,在 Pop!_Shop 上直接支持了 Flatpak 绝对是一件好事。
|
||||
|
||||
#### 键盘快捷键更改
|
||||
|
||||
如果你习惯了 Pop!_OS 19.10 或更早的版本上现有的键盘快捷键,这可能会让你很烦。
|
||||
|
||||
不管是哪种情况,有几个重要的键盘快捷键变化可能会改善你的体验,如下:
|
||||
|
||||
* 锁定屏幕:`Super + L` 改为 `Super + Escape`。
|
||||
* 移动工作区:`Super + 上/下箭头键` 改为 `Super + CTRL + 上/下箭头键`。
|
||||
* 关闭窗口:`Super + W` 变更为 `Super + Q`。
|
||||
* 切换最大化:`Super +向上箭头` 改为 `Super + M`。
|
||||
|
||||
#### Linux 内核 5.4
|
||||
|
||||
与其他大多数最新的 Linux 发行版相似,Pop!_OS 20.04 搭载了 [Linux 内核 5.4][20]。
|
||||
|
||||
所以,很明显,你可以期望获得对 [exFAT 支持][21]、改进的 AMD 图形兼容性以及它附带所有其他功能。
|
||||
|
||||
#### 性能提升
|
||||
|
||||
尽管 Pop!_OS 并不称自己是轻量级的 Linux 发行版,但它仍然是一个资源节约型的发行版。而且,有了 GNOME 3.36 的支持,它的速度应该足够快了。
|
||||
|
||||
考虑到我已经将 Pop!\_OS 作为主要发行版使用已经一年多了,我从来没有遇到过性能问题。这就是你安装了 Pop!_OS 20.04 之后的资源使用情况(取决于你的系统配置)。
|
||||
|
||||
![][22]
|
||||
|
||||
给你一个作为参考,我的台式机配置包括 i5-7400 处理器、16GB 内存(2400MHz)、NVIDIA GTX 1050ti 显卡和 SSD。
|
||||
|
||||
我不是一个系统基准测试的忠实拥护者,因为除非你去尝试,否则它并不能让你知道特定的应用或游戏的性能。
|
||||
|
||||
你可以试试 [Phoronix 测试套件][23]来分析你的系统表现。但是,Pop!_OS 20.04 LTS 应该是一个很爽快的体验!
|
||||
|
||||
#### 软件包更新 & 其他改进
|
||||
|
||||
尽管每个基于Ubuntu的发行版都受益于Ubuntu 20.04 LTS的改进,但也有一些 Pop!_OS 特有的错误修复和改进。
|
||||
|
||||
除此之外,一些主要的应用程序/包(如 Firefox 75.0)也已经更新到了最新版本。
|
||||
|
||||
到现在为止,应该没有任何严重的错误,至少对我来说没有。
|
||||
|
||||
你可以在 [GitHub 上查看他们的开发进度][24],以了解他们在测试期间已经修复的问题和发布后即将修复的问题。
|
||||
|
||||
### 下载 & 支持 Pop!_OS 20.04
|
||||
|
||||
![][25]
|
||||
|
||||
在这个版本中,System76 终于增加了一个可选的订阅模式来支持 Pop!_OS 的开发。
|
||||
|
||||
你可以免费下载 Pop!_OS 20.04 —— 但如果你想支持他们,我建议你只需要 \$1/月就可以订阅。
|
||||
|
||||
- [Pop!_OS 20.04][26]
|
||||
|
||||
### 我对 Pop OS 20.04 的看法
|
||||
|
||||
我必须提到的是,我正在为最新的 20.04 版本提供全新的墙纸。但是,这没什么大不了的。
|
||||
|
||||
有了窗口平铺功能、支持 flatpak,以及众多其他改进,到目前为止,我对 Pop!_OS 20.04 的体验是一流的。另外,很高兴看到他们在一些流行软件的开箱即用支持上突出了他们对创意专业人士的关注。
|
||||
|
||||
![][27]
|
||||
|
||||
Ubuntu 20.04 的所有优点,再加上 System76 的一些额外的加料,让我印象深刻!
|
||||
|
||||
你试过 Pop!_OS 20.04 吗?请在下面的评论中告诉我你的想法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/pop-os-20-04-review/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://system76.com
|
||||
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/pop_os_20_04_review.jpg?ssl=1
|
||||
[3]: https://itsfoss.com/gnome-3-36-release/
|
||||
[4]: https://itsfoss.com/ubuntu-20-04-release-features/
|
||||
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/system-tray-icons-pop-os.jpg?ssl=1
|
||||
[6]: https://activitywatch.net/
|
||||
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/pop-os-automatic-screen-tiling.png?ssl=1
|
||||
[8]: https://en.wikipedia.org/wiki/Tiling_window_manager
|
||||
[9]: https://i3wm.org/
|
||||
[10]: https://itsfoss.com/regolith-linux-desktop/
|
||||
[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/tile-feature-options-popos.jpg?ssl=1
|
||||
[12]: https://www.youtube.com/c/itsfoss?sub_confirmation=1
|
||||
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/pop-os-extensions.jpg?ssl=1
|
||||
[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/notification-center-pop-os.jpg?ssl=1
|
||||
[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/pop-os-application-launcher.jpg?ssl=1
|
||||
[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/pop-os-20-04-lock-screen.jpg?ssl=1
|
||||
[17]: https://launchpad.net/~system76/+archive/ubuntu/pop
|
||||
[18]: https://itsfoss.com/flatpak-guide/
|
||||
[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/pop-os-flatpak-deb.jpg?ssl=1
|
||||
[20]: https://itsfoss.com/linux-kernel-5-4/
|
||||
[21]: https://itsfoss.com/mount-exfat/
|
||||
[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/pop-os-20-04-performance.jpg?ssl=1
|
||||
[23]: https://www.phoronix-test-suite.com/
|
||||
[24]: https://github.com/orgs/pop-os/projects/13
|
||||
[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/support-pop-os.jpg?ssl=1
|
||||
[26]: https://pop.system76.com/
|
||||
[27]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/pop-os-stem-focus.jpg?ssl=1
|
@ -0,0 +1,115 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12188-1.html)
|
||||
[#]: subject: (After More Than 3 Years, Inkscape 1.0 is Finally Here With Tons of Feature Improvements)
|
||||
[#]: via: (https://itsfoss.com/inkscape-1-release/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
经过了 3 年,Inkscape 1.0 终于发布了
|
||||
======
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202005/06/094055fvnh9nnnbybwl4jn.jpg)
|
||||
|
||||
虽然我不是这方面的专业人员,但可以肯定地说,Inkscape 是[最好的矢量图形编辑器][1]之一。
|
||||
|
||||
不仅仅因为它是自由开源软件,而且对于数字艺术家来说,它是一个非常有用的应用程序。
|
||||
|
||||
上一次发布(0.92 版本)是在 3 年前。现在,终于,[Inkscape 宣布了它的 1.0 版本][2] —— 增加了很多新的功能和改进。
|
||||
|
||||
### Inkscape 1.0 里的新东西
|
||||
|
||||
![Inkscape 1.0][3]
|
||||
|
||||
在这里,让我重点介绍一下 Inkscape 1.0 版本中重要关键变化。
|
||||
|
||||
#### 首个原生 macOS 应用
|
||||
|
||||
对于像 Inkscape 这样的神奇工具来说,适当的跨平台支持总是好的。在这个最新的版本中,它推出了原生的 macOS 应用。
|
||||
|
||||
请注意,这个 macOS 应用仍然是一个**预览版**,还有很多改进的空间。不过,在无需 [XQuartz][4] 的情况下就做到了更好的系统集成,对于 macOS 用户来说,应该是一个值得期许的进步。
|
||||
|
||||
#### 性能提升
|
||||
|
||||
不管是什么应用程序/工具,都会从显著的性能提升中受益,而 Inkscape 也是如此。
|
||||
|
||||
随着其 1.0 版本的发布,他们提到,当你使用 Inkscape 进行各种创意工作时,你会发现性能更加流畅。
|
||||
|
||||
除了在 macOS 上(仍为“预览版”),Inkscape 在 Linux 和 Windows 上的运行都是很好的。
|
||||
|
||||
#### 改进的 UI 和 HiDPI 支持
|
||||
|
||||
![][5]
|
||||
|
||||
他们在发布说明中提到:
|
||||
|
||||
> ……达成了一个重要的里程碑,使 Inkscape 能够使用最新的软件(即 GTK+3)来构建编辑器的用户界面。拥有 HiDPI(高分辨率)屏幕的用户要感谢 2018 年波士顿黑客节期间的团队合作,让更新后的 GTK 轮子开始运转起来。
|
||||
|
||||
从 GTK+3 的用户界面到高分辨率屏幕的 HiDPI 支持,这都是一次精彩的升级。
|
||||
|
||||
更不要忘了,你还可以获得更多的自定义选项来调整外观和感受。
|
||||
|
||||
#### 新增功能
|
||||
|
||||
![][6]
|
||||
|
||||
即便是从纸面上看,这些列出新功能都看起来不错。根据你的专业知识和你的喜好,这些新增功能应该会派上用场。
|
||||
|
||||
以下是新功能的概述:
|
||||
|
||||
* 新改进过的实时路径效果(LPE)功能。
|
||||
* 新的可搜索的 LPE 选择对话框。
|
||||
* 自由式绘图用户现在可以对画布进行镜像和旋转。
|
||||
* 铅笔工具的新的 PowerPencil 模式提供了压感的宽度,并且终于可以创建封闭路径了。
|
||||
* 包括偏移、PowerClip 和 PowerMask LPE 在内的新路径效果会吸引艺术类用户。
|
||||
* 能够创建复制引导、将网格对齐到页面上、测量工具的路径长度指示器和反向 Y 轴。
|
||||
* 能够导出带有可点击链接和元数据的 PDF 文件。
|
||||
* 新的调色板和网状渐变,可在网页浏览器中使用。
|
||||
|
||||
虽然我已经尝试着整理了这个版本中添加的关键功能列表,但你可以在他们的[发布说明][7]中获得全部细节。
|
||||
|
||||
#### 其他重要变化
|
||||
|
||||
作为重大变化之一,Inkscape 1.0 现在支持 Python 3。而且,随着这一变化,你可能会注意到一些扩展程序无法在最新版本中工作。
|
||||
|
||||
所以,如果你的工作依赖于某个扩展程序的工作流程,我建议你仔细看看他们的[发布说明][7],了解所有的技术细节。
|
||||
|
||||
### 在 Linux 上下载和安装 Inkscape 1.0
|
||||
|
||||
Inkscape 1.0 有用于 Linux 的 AppImage 和 Snap 软件包,你可以从 Inkscape 的网站上下载。
|
||||
|
||||
- [下载 Inkscape 1.0 for Linux][8]
|
||||
|
||||
如果你还不知道,可以查看[如何在 Linux 上使用 AppImage 文件][9]来入门。你也可以参考[这个 Snap 指南][10]。
|
||||
|
||||
Ubuntu 用户可以在 Ubuntu 软件中心找到 Inskcape 1.0 的 Snap 版本。
|
||||
|
||||
我在 [Pop!_OS 20.04][11] 上使用了 AppImage 文件,工作的很好。你可以详细体验所有的功能,看看它的效果如何。
|
||||
|
||||
你试过了吗?请在下面的评论中告诉我你的想法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/inkscape-1-release/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/vector-graphics-editors-linux/
|
||||
[2]: https://inkscape.org/news/2020/05/04/introducing-inkscape-10/
|
||||
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/inkscape-1-0.jpg?ssl=1
|
||||
[4]: https://en.wikipedia.org/wiki/XQuartz
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/inkscape-ui-customization.jpg?ssl=1
|
||||
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/inkscape-live-path-effects.jpg?ssl=1
|
||||
[7]: https://wiki.inkscape.org/wiki/index.php/Release_notes/1.0
|
||||
[8]: https://inkscape.org/release/1.0/gnulinux/
|
||||
[9]: https://itsfoss.com/use-appimage-linux/
|
||||
[10]: https://itsfoss.com/install-snap-linux/
|
||||
[11]: https://itsfoss.com/pop-os-20-04-review/
|
@ -0,0 +1,71 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Java security, mainframes having a moment, and more industry trends)
|
||||
[#]: via: (https://opensource.com/article/20/4/java-mainframes-dev-skills-more-industry-trends)
|
||||
[#]: author: (Tim Hildred https://opensource.com/users/thildred)
|
||||
|
||||
Java security, mainframes having a moment, and more industry trends
|
||||
======
|
||||
A weekly look at open source community and industry trends.
|
||||
![Person standing in front of a giant computer screen with numbers, data][1]
|
||||
|
||||
As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update.
|
||||
|
||||
## [How secure is Java compared to other languages?][2]
|
||||
|
||||
> In this article, we'll look at how the most commonly used programming languages rank in terms of security. I'll explain some factors that make one language less secure than another, and why identified vulnerabilities have increased so much in the past few years. Finally, I'll suggest a few ways Java developers can reduce vulnerabilities in code.
|
||||
|
||||
**The impact**: If software is eating the world, then hackers are... I guess the thrush thriving in the gullet? Hyperbole aside, the more stuff made of software, the more incentive clever people have to try and figure out how to do things they probably shouldn't be able to. This applies to Java too.
|
||||
|
||||
## [Mainframes are having a moment][3]
|
||||
|
||||
> In addition to being abundant, mainframe jobs pay well, and so far, appear not to be as affected by the pandemic as other areas of tech employment. Salaries for entry-level enterprise computing jobs [average US $70,100 a year][4] [PDF], according to a 2019 report from tech analyst [Forrester Research][5] commissioned by IBM. As recently as this week, jobs boards such as [Indeed][6] and [Dice.com][7] listed hundreds or in some cases thousands of openings for mainframe positions at all levels. Advertised pay ranges from $30 to $35 an hour for a junior mainframe developer to well over $150,000 a year for a mainframe database administration manager.
|
||||
|
||||
**The impact**: That is much, much better than a poke in the eye.
|
||||
|
||||
## [The developer skills on the rise, and in decline][8]
|
||||
|
||||
> Indeed.com analysed job postings using a list of 500 key technology skill terms to see which ones employers are looking for more these days and which are falling out of favour. Such research has helped identify cutting-edge skills over the past five years, with some previous years’ risers now well establish, thanks to explosive growth.
|
||||
|
||||
**The impact**: The "on the rise" skills outnumber the "in decline" skills. Bad news for browser developers...
|
||||
|
||||
## [The IT Pro Podcast: Building cloud-native apps][9]
|
||||
|
||||
> The cloud is eating enterprise IT, and while on-premise applications are going to be around for a long time to come, the importance of being able to successfully take advantage of cloud technologies should not be understated. However, it’s one thing to simply port an existing application to the cloud, but developing software to be run in cloud environments is a different matter altogether.
|
||||
|
||||
**The impact**: What is technology if not manifested mindset?
|
||||
|
||||
## [Communication is key to culture change][10]
|
||||
|
||||
> The outcome is staggering. Business teams feel invested in the development of the solution, they feel a sense of excitement and ownership. So much so, they go out into the corridors of the organisation to evangelise and promote the solution. Conversely, this improves the status of the developers within the business. It allows them to integrate with other stakeholders, contribute to new processes and help to achieve common goals.
|
||||
|
||||
**The impact**: As a communications person, I couldn't agree more. Communication is the difference between an organization and a movement.
|
||||
|
||||
_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/java-mainframes-dev-skills-more-industry-trends
|
||||
|
||||
作者:[Tim Hildred][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/thildred
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data)
|
||||
[2]: https://www.javaworld.com/article/3537561/how-secure-is-java-compared-to-other-languages.html
|
||||
[3]: https://spectrum.ieee.org/tech-talk/computing/software/mainframes-programming-language-cobol-news-coronavirus
|
||||
[4]: https://www.ibm.com/downloads/cas/1EPYAP5D
|
||||
[5]: https://go.forrester.com/
|
||||
[6]: https://www.indeed.com/q-Mainframe-jobs.html
|
||||
[7]: https://www.dice.com/jobs/q-Mainframe-jobs
|
||||
[8]: https://www.techcentral.ie/10-developer-skills-on-the-rise-and-five-on-the-decline/
|
||||
[9]: https://www.itpro.co.uk/cloud/355348/the-it-pro-podcast-building-cloud-native-apps
|
||||
[10]: https://www.verdict.co.uk/culture-service-digital-enterprise/
|
@ -0,0 +1,116 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Good News! You Can Now Buy the De-Googled /e/OS Smartphone from Fairphone)
|
||||
[#]: via: (https://itsfoss.com/fairphone-with-e-os/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Good News! You Can Now Buy the De-Googled /e/OS Smartphone from Fairphone
|
||||
======
|
||||
|
||||
Fairphone is known for its ethical (or fair) approach of making a smartphone.
|
||||
|
||||
Normally, the ethical approach involves that the workers get paid well, the smartphone build materials are safer for the planet, and the phone is durable/sustainable. And, they’ve already done a good job with their [Fairphone 1][1] , [Fairphone 2][2], and [Fairphone 3][3] smartphones.
|
||||
|
||||
Now, to take things up a notch, Fairphone has teamed up with [/e/OS][4] which is a de-googled Android fork, to launch a separate edition of [Fairphone 3][3] (its latest smartphone) that comes with **/e/OS** out of the box.
|
||||
|
||||
In case you didn’t know about the mobile operating system, you can read our [interview with Gael Duval (Founder of /e/OS)][5] to know more about it.
|
||||
|
||||
While we already have some privacy-focused smartphones like [Librem 5][6], Fairphone 3 with /e/OS is something different to its core. In this article, I’ll try highlighting the key things that you need to know before ordering a Fairphone 3 with /e/OS loaded.
|
||||
|
||||
### The First Privacy Conscious & Sustainable Phone
|
||||
|
||||
You may have noticed a privacy-focused smartphone manufactured in some corner of the world, like [Librem 5][7].
|
||||
|
||||
But for the most part, it looks like the Fairphone 3 is the first privacy-conscious sustainable phone to get the spotlight.
|
||||
|
||||
![][8]
|
||||
|
||||
The de-googled operating system /e/OS ensures that the smartphone does not rely on Google services to function among other things. Hence, /e/OS should be a great choice for Fairphone 3 for privacy-focused users.
|
||||
|
||||
Also, to support /e/OS out of the box wasn’t just the decision of the manufacturer – but its community.
|
||||
|
||||
As per their announcement, they’ve mentioned:
|
||||
|
||||
> For many, fairer technology isn’t just about the device and its components, it is also about the software that powers the product; and when Fairphone community members were asked what their preferred alternative operating system (OS) was for the next Fairphone, the Fairphone 3, they voted for /e/OS.
|
||||
|
||||
So, it looks like the users do prefer to have /e/OS on their smartphones.
|
||||
|
||||
### Fairphone 3: Overview
|
||||
|
||||
![][9]
|
||||
|
||||
To tell you what I think about it, let me first share the technical specifications of the phone:
|
||||
|
||||
* Dual Nano-SIM (4G LTE/3G/2G support)
|
||||
* **Display:** 5.65-inch LCD (IPS) with Corning Gorilla Glass 5 protection
|
||||
* **Screen Resolution**: 2160 x 1080
|
||||
* **RAM:** 4 GB
|
||||
* **Chipset**: Qualcomm Snapdragon 632
|
||||
* **Internal Storage:** 64 GB
|
||||
* **Rear Camera:** 12 MP (IMX363 sensor)
|
||||
* **Front Camera:** 8 MP
|
||||
* Bluetooth 5.0
|
||||
* WiFi 802.11a/b/g/n/ac
|
||||
* NFC Supported
|
||||
* USB-C
|
||||
* Expandable Storage supported
|
||||
|
||||
|
||||
|
||||
So, on paper, it sounds like a decent budget smartphone. But, the pricing and availability will be an important factor keeping in mind that it’s a one-of-a-kind smartphone and we don’t really have alternatives to compare to.
|
||||
|
||||
Not just how it’s unique for privacy-focused users, but it is potentially the easiest phone to fix (as suggested by [iFixit’s teardown][10]).
|
||||
|
||||
### Fairphone 3 with /e/OS: Pre-Order, Price & Availability
|
||||
|
||||
![][11]
|
||||
|
||||
As for its availability – the Fairphone 3 with /e/OS is available to pre-order through the [online shop of /e/OS][12] for **€479.90** across Europe.
|
||||
|
||||
If you are an existing Fairphone 3 user, you can also install /e/OS from the [available build here][13].
|
||||
|
||||
You get 2 years of warranty along with a 14-day return policy.
|
||||
|
||||
[Pre-Order Fairphone 3 With /e/OS][12]
|
||||
|
||||
### My Thoughts On Fairphone 3 with /e/OS
|
||||
|
||||
It’s important to consider that the smartphone is targeting a particular group of consumers. So, it’s quite obvious that it isn’t meant for everyone. The specifications on paper may look good – but not necessarily the best bang for the buck.
|
||||
|
||||
Also, looking at the smartphone market right now – the specifications and its value for money matter more than what we privacy-focused users want.
|
||||
|
||||
But it’s definitely something impressive and I believe it’s going to get good attention specially among the privacy-aware people who don’t want their smartphone spying on them.
|
||||
|
||||
With Fairphone 3’s launch with /e/OS, the lesser tech savvy people can now get an out of the box privacy-focused smartphone experience.
|
||||
|
||||
What do you think about the Fairphone 3 with /e/OS? Let me know your thoughts in the comments below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/fairphone-with-e-os/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://en.wikipedia.org/wiki/Fairphone_1
|
||||
[2]: https://en.wikipedia.org/wiki/Fairphone_2
|
||||
[3]: https://shop.fairphone.com/en/?ref=header
|
||||
[4]: https://e.foundation/
|
||||
[5]: https://itsfoss.com/gael-duval-interview/
|
||||
[6]: https://itsfoss.com/librem-5-available/
|
||||
[7]: https://itsfoss.com/librem-linux-phone/
|
||||
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/Fairphone-3-battery.png?ssl=1
|
||||
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/fairphone-3.png?ssl=1
|
||||
[10]: https://www.ifixit.com/Teardown/Fairphone+3+Teardown/125573
|
||||
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/fairphone-e-os.png?ssl=1
|
||||
[12]: https://e.foundation/product/e-os-fairphone-3/
|
||||
[13]: https://doc.e.foundation/devices/FP3/
|
@ -1,104 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (messon007)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (The ins and outs of high-performance computing as a service)
|
||||
[#]: via: (https://www.networkworld.com/article/3534725/the-ins-and-outs-of-high-performance-computing-as-a-service.html)
|
||||
[#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/)
|
||||
|
||||
The ins and outs of high-performance computing as a service
|
||||
======
|
||||
HPC services can be a way to meet expanding supercomputing needs, but depending on the use case, they’re not necessarily better than on-premises supercomputers.
|
||||
Dell EMC
|
||||
|
||||
Electronics on missiles and military helicopters need to survive extreme conditions. Before any of that physical hardware can be deployed, defense contractor McCormick Stevenson Corp. simulates the real-world conditions it will endure, relying on finite element analysis software like Ansys, which requires significant computing power.
|
||||
|
||||
Then one day a few years ago, it unexpectedly ran up against its computing limits.
|
||||
|
||||
[10 of the world's fastest supercomputers][1]
|
||||
|
||||
"We had some jobs that would have overwhelmed the computers that we had in office," says Mike Krawczyk, principal engineer at McCormick Stevenson. "It did not make economic or schedule sense to buy a machine and install software." Instead, the company contracted with Rescale, which could sell them cycles on a supercomputer-class system for a tiny fraction of what they would've spent on new hardware.
|
||||
|
||||
McCormick Stevenson had become an early adopter in a market known as supercomputing as a service or high-performance computing (HPC) as a service – two terms that are closely related. HPC is the application of supercomputers to computationally complex problems, while supercomputers are those computers at the cutting edge of processing capacity, according to the National Institute for Computational Sciences.
|
||||
|
||||
Whatever it's called, these services are upending the traditional supercomputing market and bringing HPC power to customers who could never afford it before. But it's no panacea, and it's definitely not plug-and-play – at least not yet.
|
||||
|
||||
### HPC services in practice
|
||||
|
||||
From the end user's perspective, HPC as a service resembles the batch-processing model that dates back to the early mainframe era. "We create an Ansys batch file and send that up, and after it runs, we pull down the result files and import them locally here," Krawczyk says.
|
||||
|
||||
Behind the scenes, cloud providers are running the supercomputing infrastructure in their own data centers – though that doesn't necessarily imply the sort of cutting-edge hardware you might be visualizing when you hear "supercomputer." As Dave Turek, Vice President of Technical Computing at IBM OpenPOWER, explains it, HPC services at their core are "a collection of servers that are strung together with an interconnect. You have the ability to invoke this virtual computing infrastructure that allows you to bring a lot of different servers to work together in a parallel construct to solve the problem when you present it."
|
||||
|
||||
[][2]
|
||||
|
||||
Sounds simple in theory. But making it viable in practice required some chipping away at technical problems, according to Theo Lynn, Professor of Digital Business at Dublin City University. What differentiates ordinary computing from HPC is those interconnects – high-speed, low-latency, and expensive – so those needed to be brought to the world of cloud infrastructure. Storage performance and data transport also needed to be brought up to a level at least in the same ballpark as on-prem HPC before HPC services could be viable.
|
||||
|
||||
But Lynn says that some of the innovations that have helped HPC services take off have been more institutional than technological. In particular, "we are now seeing more and more traditional HPC applications adopting cloud-friendly licensing models – a barrier to adoption in the past."
|
||||
|
||||
And the economics have also shifted the potential customer base, he says. "Cloud service providers have opened up the market more by targeting low-end HPC buyers who couldn’t afford the capex associated with traditional HPC and opening up the market to new users. As the markets open up, the hyperscale economic model becomes more and more feasible, costs start coming down."
|
||||
|
||||
Avoid on-premises CAPEX**
|
||||
**
|
||||
|
||||
HPC services are attractive to private-sector customers in the same fields where traditional supercomputing has long held sway. These include sectors that rely heavily on complex mathematical modeling, including defense contractors like McCormick Stevenson, along with oil and gas companies, financial services firms, and biotech companies. Dublin City University's Lynn adds that loosely coupled workloads are a particularly good use case, which meant that many early adopters used it for 3D image rendering and related applications.
|
||||
|
||||
But when does it make sense to consider HPC services over on-premises HPC? For hhpberlin, a German company that simulates smoke propagation in and fire damage to structural components of buildings, the move came as it outgrew its current resources.
|
||||
|
||||
"For several years, we had run our own small cluster with up to 80 processor cores," says Susanne Kilian, hhpberlin's scientific head of numerical simulation. "With the rise in application complexity, however, this constellation has increasingly proven to be inadequate; the available capacity was not always sufficient to handle projects promptly."
|
||||
|
||||
But just spending money on a new cluster wasn't an ideal solution, she says: "In view of the size and administrative environment of our company, the necessity of constant maintenance of this cluster (regular software and hardware upgrades) turned out to be impractical. Plus, the number of required simulation projects is subject to significant fluctuations, such that the utilization of the cluster was not really predictable. Typically, phases with very intensive use alternate with phases with little to no use." By moving to an HPC service model, hhpberlin shed that excess capacity and the need to pay up front for upgrades.
|
||||
|
||||
IBM's Turek explains the calculus that different companies go through while assessing their needs. For a biosciences startup with 30 people, "you need computing, but you really can't afford to have 15% of your staff dedicated to it. It's just like you might also say you don't want to have on-staff legal representation, so you'll get that as a service as well." For a bigger company, though, it comes down to weighing the operational expense of an HPC service against the capacity expense of buying an in-house supercomputer or HPC cluster.
|
||||
|
||||
So far, those are the same sorts of arguments you'd have over adopting any cloud service. But the opex vs. capex dilemma can be weighted towards the former by some of the specifics of the HPC market. Supercomputers aren't commodity hardware like storage or x86 servers; they're very expensive, and technological advances can swiftly render them obsolete. As McCormick Stevenson's Krawczyk puts it, "It's like buying a car: as soon as you drive off the lot it starts to depreciate." And for many companies –especially larger and less nimble ones – the process of buying a supercomputer can get hopelessly bogged down. "You're caught up in planning issues, building issues, construction issues, training issues, and then you have to execute an RFP," says IBM's Turek. "You have to work through the CIO. You have to work with your internal customers to make sure there's continuity of service. It's a very, very complex process and not something that a lot of institutions are really excellent at executing."
|
||||
|
||||
Once you choose to go down the services route for HPC, you'll find you get many of the advantages you expect from cloud services, particularly the ability to pay only for HPC power when you need it, which results in an efficient use of resources. Chirag Dekate, Senior Director and Analyst at Gartner, says bursty workloads, when you have short-term needs for high-performance computing, are a key use case driving adoption of HPC services.
|
||||
|
||||
"In the manufacturing industry, you tend to have a high peak of HPC activity around the product design stage," he says. "But once the product is designed, HPC resources are less utilized during the rest of the product-development cycle." In contrast, he says, "when you have large, long-running jobs, the economics of the cloud wear down."
|
||||
|
||||
With clever system design, you can integrate those HPC-services bursts of activity with your own in-house conventional computing. Teresa Tung, managing director in Accenture Labs, gives an example: "Accessing HPC via APIs makes it seamless to mix with traditional computing. A traditional AI pipeline might have its training done on a high-end supercomputer at the stage when the model is being developed, but then the resulting trained model that runs predictions over and over would be deployed on other services in the cloud or even devices at the edge."
|
||||
|
||||
### It's not for all use cases**
|
||||
|
||||
**
|
||||
|
||||
Use of HPC services lends itself to batch-processing and loosely-coupled use cases. That ties into a common HPC downside: data transfer issues. High-performance computing by its very nature often involves huge data sets, and sending all that information over the internet to a cloud service provider is no simple thing. "We have clients I talk to in the biotech industry who spend $10 million a month on just the data charges," says IBM's Turek.
|
||||
|
||||
And money isn't the only potential problem. Building a workflow that makes use of your data can challenge you to work around the long times required for data transfer. "When we had our own HPC cluster, local access to the simulation results already produced – and thus an interactive interim evaluation — was of course possible at any time," says hhpberlin's Kilian. "We're currently working on being able to access and evaluate the data produced in the cloud even more efficiently and interactively at any desired time of the simulation without the need to download large amounts of simulation data."
|
||||
|
||||
Mike Krawczyk cites another stumbling block: compliance issues. Any service a defense contractor uses needs to be complaint with the International Traffic in Arms Regulations (ITAR), and McCormick Stevenson went with Rescale in part because it was the only vendor they found that checked that box. While more do today, any company looking to use cloud services should be aware of the legal and data-protection issues involved in living on someone else's infrastructure, and the sensitive nature of many of HPC's use cases makes this doubly true for HPC as a service.
|
||||
|
||||
In addition, the IT governance that HPC services require goes beyond regulatory needs. For instance, you'll need to keep track of whether your software licenses permit cloud use – especially with specialized software packages written to run on an on-premises HPC cluster. And in general, you need to keep track of how you use HPC services, which can be a tempting resource, especially if you've transitioned from in-house systems where staff was used to having idle HPC capabilities available. For instance, Ron Gilpin, senior director and Azure Platform Services global lead at Avanade, suggests dialing back how many processing cores you use for tasks that aren't time sensitive. "If a job only needs to be completed in an hour instead of ten minutes," he says, "that might use 165 processors instead of 1,000, a savings of thousands of dollars."
|
||||
|
||||
### A premium on HPC skills**
|
||||
|
||||
**
|
||||
|
||||
One of the biggest barriers to HPC adoption has always been the unique in-house skills it requires, and HPC services don't magically make that barrier vanish. "Many CIOs have migrated a lot of their workloads into the cloud and they have seen cost savings and increased agility and efficiency, and believe that they can achieve similar results in HPC ecosystems," says Gartner's Dekate. "And a common misperception is that they can somehow optimize human resource cost by essentially moving away from system admins and hiring new cloud experts who can solve their HPC workloads."
|
||||
|
||||
"But HPC is not one of the main enterprise environments," he says. "You're dealing with high-end compute nodes interconnected with high-bandwidth, low-latency networking stacks, along with incredibly complicated application and middleware stacks. Even the filesystem layers in many cases are unique to HPC environments. Not having the right skills can be destabilizing."
|
||||
|
||||
But supercomputing skills are in shortening supply, something Dekate refers to as the workforce "greying," in the wake of a generation of developers going to splashy startups rather than academia or the more staid firms where HPC is in use. As a result, vendors of HPC services are doing what they can to bridge the gap. IBM's Turek says that many HPC vets will always want to roll their own exquisitely fine-tuned code and will need specialized debuggers and other tools to help them do that for the cloud. But even HPC newbies can make calls to code libraries built by vendors to exploit supercomputing's parallel processing. And third-party software providers sell turnkey software packages that abstract away much of HPC's complication.
|
||||
|
||||
Accenture's Tung says the sector needs to lean further into this in order to truly prosper. "HPCaaS has created dramatically impactful new capability, but what needs to happen is making this easy to apply for the data scientist, the enterprise architect, or the software developer," she says. "This includes easy to use APIs, documentation, and sample code. It includes user support to answer questions. It’s not enough to provide an API; that API needs to be fit-for-purpose. For a data scientist this should likely be in Python and easily change out for the frameworks she is already using. The value comes from enabling these users who ultimately will have their jobs improved through new efficiencies and performance, if only they can access the new capabilities." If vendors can pull that off, HPC services might truly bring supercomputing to the masses.
|
||||
|
||||
Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3534725/the-ins-and-outs-of-high-performance-computing-as-a-service.html
|
||||
|
||||
作者:[Josh Fruhlinger][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Josh-Fruhlinger/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html
|
||||
[2]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy)
|
||||
[3]: https://www.facebook.com/NetworkWorld/
|
||||
[4]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,81 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Comparing subscription, pay-per-bug, and consulting software business models)
|
||||
[#]: via: (https://opensource.com/article/20/4/open-source-business)
|
||||
[#]: author: (Jos Poortvliet https://opensource.com/users/jospoortvliet)
|
||||
|
||||
Comparing subscription, pay-per-bug, and consulting software business models
|
||||
======
|
||||
Learn how NextCloud achieves business revenue that is one-third
|
||||
consulting and two-thirds subscription.
|
||||
![A chair in a field.][1]
|
||||
|
||||
At FOSS Backstage this year, I hosted a discussion on open source models and shared why I think subscriptions are a great way to support open source products.
|
||||
|
||||
### Picking a business model
|
||||
|
||||
The company I co-founded, Nextcloud, only offers its services to customers on a (per user) subscription model. Some customers ask us during the sales conversation why they cannot just get access to our engineers on an hourly basis as they get from third party consultants: pay for the bug fix or support case, and be done?
|
||||
|
||||
When we discussed how to build our new company in 2016 during our very first "[hackweek][2]," our business model was an important conversation. The team discussed different approaches, and we decided to go for a subscription model. Such a model felt more in line with our mission and principles to [create a great product and run a trustworthy company.][3]
|
||||
|
||||
Why? While hourly rates seem like an easy way to get a quick fix for a problem, getting paid for fixing issues creates an incentive to create more buggy software, which of course, was not how we want to run our business.
|
||||
|
||||
Let's look a bit deeper at the choices.
|
||||
|
||||
### Subscription
|
||||
|
||||
As a customer, you want the most reliable software. And when (not if, when) things go wrong, you want them fixed as quickly as possible. Our company offers customers a subscription to our services. Such a subscription includes direct and unlimited access to our engineers the moment you run into a problem. These two points are very important. It means that a customer has the certainty of having the very best resources at their fingertips at the moment they need them, and as much as they need them, in a way that only the original software vendor can deliver.
|
||||
|
||||
For that, they pay a fee that scales with the number of users.
|
||||
|
||||
### Pay-per-bug
|
||||
|
||||
What if, instead, you could pay per issue fixed? In a way, this choice is similar to insurance. Indeed, when you need cold medicine once a year, the cost of a health insurance policy with a monthly premium seems prohibitive. But when a car accident crushes your spine and your medical costs skyrocket, not having to sell your house makes up for that premium and then some.
|
||||
|
||||
There is also the bigger picture: The incentives potentially created by a pay-per-bug model. It is a simple, albeit cynical calculation: If we got paid per bug we fix for customers, leaving more bugs in our product would increase our income. Now we're not saying every company offering product consulting by the hour is extorting their customers, merely that this backward incentive exists, even when most moral businesses would not give in to it.
|
||||
|
||||
Conversely, now that we offer insurance, we lower our support costs by building a better product, just like art insurance providers do what they can to ensure the art kept at their customers' exhibition is secure to keep their costs low. Our support team deeply cares about how our customers use our product: a better setup and good security practices not only make happier customers; it saves them time.
|
||||
|
||||
Or, in other words, it helps maximize the ROI or TEI the customer gains from deploying Nextcloud.
|
||||
|
||||
That is what we'd call a win-win and a business model an open source company can be proud of.
|
||||
|
||||
### Consulting
|
||||
|
||||
Now I discuss this business model regularly with others, and I invariably get told: "You might be right, but most of my customers only want to pay for the bugs we fix, or for features. Consulting is our main source of income! And I have no illusions about changing that."
|
||||
|
||||
Yes, that's an issue. We open source folk honestly have a sales and marketing issue. And yes, you might think that, as a marketing guy, I just see everything as a nail I can hit with my communications hammer. But really, communication is core to the issue—how you communicate your value—which, in turn, requires you to be aware of your value.
|
||||
|
||||
Recently, I had some challenging discussions with users on our forums who were upset that our engineers had not fixed their issues quickly enough. These users were clearly business users, and giving free support on GitHub obviously isn't exactly a great advertisement for the need for a subscription. So some abuse was thrown our way, and I took the hit. When complaining about it all to a fellow entrepreneurial friend of mine, he remarked: "Isn't that good news? They were frustrated and angry because clearly, you have something to offer, they need it, and are annoyed that they are forced to pay you for it. A good place to be in if you want to sell something!" Right he was, of course.
|
||||
|
||||
The lesson I want to share with this anecdote is: You have something to offer. Your current customers will certainly be upset if you tell them that, going forward, they can only get your services under a subscription. But the angrier they are, the more you know they _need_ you, and you should persist!
|
||||
|
||||
But moving to subscription from consulting requires a great deal of discipline, including saying "no" often. We have hard, internal rules, and one of these is that sales can only sell consulting valued at up to 50% of the subscription value, and only for deals greater than $10,000.
|
||||
|
||||
But it has worked. The breakdown of our business revenue is now about one-third consulting and two-thirds subscription. Engineering hours for consulting work are not the limiting factor for expanding our customer base; sales and sales engineering is. We doubled our order intake last year and plan to do the same this year.
|
||||
|
||||
### Bottomline: Sustainability
|
||||
|
||||
For us, a better product and more sustainable business follows from the subscription model. It also benefits software engineers, who prefer to build a better product and spend less time on debugging issues with customers. A pay-by-the-hour model, with all the time tracking and incentive to keep customers dependent, does not work for us.
|
||||
|
||||
What has your experience been? Tell us in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/open-source-business
|
||||
|
||||
作者:[Jos Poortvliet][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/jospoortvliet
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BIZ_WorkInPublic_4618517_1110_CS_A.png?itok=RwVrWArk (A chair in a field.)
|
||||
[2]: https://nextcloud.com/blog/invitation-to-our-hackweek-in-stuttgart/
|
||||
[3]: https://nextcloud.com/blog/the-nextcloud-mission-and-principles/
|
@ -0,0 +1,85 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (DevOps vs. Agile: Do they have anything in common?)
|
||||
[#]: via: (https://opensource.com/article/20/4/devops-vs-agile-common)
|
||||
[#]: author: (Taz Brown https://opensource.com/users/heronthecli)
|
||||
|
||||
DevOps vs. Agile: Do they have anything in common?
|
||||
======
|
||||
Agile and DevOps have many differences, yet they both seek to address
|
||||
complexity, improve quality, and innovate around software design.
|
||||
![Women in tech boardroom][1]
|
||||
|
||||
The topic of DevOps vs. Agile is almost like debating iPhone vs. Android—everyone has an opinion, and emotions can become heated, especially if people disagree.
|
||||
|
||||
After writing _[DevOps v. Agile: What's the difference?][2]_ and reading the comments on the article, I wanted to add some more thoughts—including how some of my thinking has changed on the topic.
|
||||
|
||||
My perspective comes from where I am now but also where I have been. I used to be a systems administrator and infrastructure engineer, and now I am a senior scrum master with a major utility company in Missouri. (I actually was a scrum master before I was an admin or engineer, but I digress.)
|
||||
|
||||
My team consists of six frontend software engineers and IT programmer analysts, a business analyst, two product owners, and me. Recently, we learned that management wants our team to become a [DevSecOps][3] team, so our core scrum team is working with a DevSecOps team that is helping us make the transition. No one is naive to the fact that this will not be easy, but the DevSecOps team's experience gives us confidence that we can succeed.
|
||||
|
||||
Our team's manager recently hired a senior software engineer who will drive the DevSecOps goal. As a scrum master, I will continue to focus on continuous improvement. The team is fairly young, so they don't have expansive work experience, but they are smart and driven, and there is much room for greatness. In addition, our entire organization is going through an Agile transformation, so most people are new to all things Agile, including the [Agile Manifesto][4] and the [Five Scrum Values][5].
|
||||
|
||||
![Spray paint on a container][6]
|
||||
|
||||
Kyle Glenn on Unsplash
|
||||
|
||||
### Agile, Scrum, DevOps, and more
|
||||
|
||||
There is a clear relationship between DevOps and Agile. Agile is the methodology, Scrum is the framework, and DevOps falls under the agile [umbrella][7] along with kanban, lean, large-scale Scrum, Extreme Programming, Crystal, and more. For example, our Scrum team is an Agile team that will operate as a DevSecOps team.
|
||||
|
||||
Neither DevOps nor Agile is about the tools. Rather, both are about the [mindset and culture][8]. When it is done right, teams think and act differently and achieve greater results, including faster software delivery, continuous integration (CI), continuous delivery (CD), continuous improvement, working software, faster solutions, more collaboration, and fewer silos. Additional results are seen in quality testing, better automation, and improved systems, processes, and practices.
|
||||
|
||||
#### Common concepts
|
||||
|
||||
Some of the Agile concepts they have in common are associated with the Agile Manifesto; the most familiar of the 12 principles are the first four:
|
||||
|
||||
* Individual and interactions over processes and tools
|
||||
* Working software over comprehensive documentation
|
||||
* Customer collaboration over contract negotiations
|
||||
* Responding to change over following a plan
|
||||
|
||||
|
||||
|
||||
Some of the DevOps concepts they have in common are the CI/CD pipeline, optimizing software delivery and quality, a culture of innovation, service-level objectives and indicators (SLOs and SLIs), collaboration across teams, and automation.
|
||||
|
||||
#### DevOps and Agile benefits
|
||||
|
||||
DevOps speeds up things between developers and operations. Furthermore, even though DevOps isn't about the tools, the fact that the dev and ops teams use the same tech stack creates a shared language and empathy between the two. Our Scrum team uses Jira to track all bugs, enhancements, and team performance. Common DevOps tools are Jenkins, AWS, SonarQube, GitHub, Splunk, and Ansible. While the tools differ from team to team, the mindset and culture should be common across all.
|
||||
|
||||
DevOps also creates less division between dev and ops and a sense of understanding of what it's like to walk in each other's shoes because now they function as one.
|
||||
|
||||
Agile teams continuously deliver often and fast, adapting incrementally along the way. Working in two-week sprints appears to be the sweet spot for most software- or product-delivery teams. Agile teams may utilize DevOps principles in their work (e.g., implementing a CI/CD pipeline), and dev teams that work with ops are likely to work in the same two-week increments.
|
||||
|
||||
DevOps traditionally leads to continuous deployment, delivery, and integration. Teamwork is integrated; problems and failures are jointly owned by development, operations, and other entities, such as quality assurance (QA), testing, automation, etc.
|
||||
|
||||
### Summing up
|
||||
|
||||
I believe that Agile and DevOps breathe the same air, with many concepts and theories crossing between them.
|
||||
|
||||
While I have no doubts that there will be counter opinions and even some sharply worded disagreements with my opinions, I think we would all agree that Agile and DevOps seek to address complexity, improve quality, and innovate around software design.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/devops-vs-agile-common
|
||||
|
||||
作者:[Taz Brown][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/heronthecli
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/christina-wocintechchat-com-rg1y72ekw6o-unsplash_1.jpg?itok=MoIv8HlK (Women in tech boardroom)
|
||||
[2]: https://opensource.com/article/20/2/devops-vs-agile
|
||||
[3]: https://opensource.com/article/19/1/what-devsecops
|
||||
[4]: https://agilemanifesto.org/
|
||||
[5]: https://www.scrumalliance.org/about-scrum/values
|
||||
[6]: https://opensource.com/sites/default/files/uploads/roomtogrow_kyleglenn.jpg (Spray paint on a container)
|
||||
[7]: https://opensource.com/article/20/4/kanban-devops
|
||||
[8]: https://opensource.com/article/19/5/values-devops-mindset
|
@ -0,0 +1,78 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How I empower and reach millions through open source)
|
||||
[#]: via: (https://opensource.com/article/20/4/interview-Netha-Hussain)
|
||||
[#]: author: (Jay Barber https://opensource.com/users/jaybarber)
|
||||
|
||||
How I empower and reach millions through open source
|
||||
======
|
||||
Learn how Netha Hussain, winner of the 2020 Women in Open Source
|
||||
Academic Award, shares knowledge and inspires people.
|
||||
![Lightbulb][1]
|
||||
|
||||
"I wanted to link to a particular Wikipedia article on my blog, but I found there wasn't one on that topic, so I wrote it myself," says Netha Hussain, 2020 [Women in Open Source Academic Award][2] winner. "That's the beauty of open source; anyone can contribute."
|
||||
|
||||
![Photo by Lvova Anastasiya \(Львова Анастасия, Lvova\), CC BY-SA][3]
|
||||
|
||||
Practicality drove Netha's entry into open source culture, and it has continued to be at the center of her work in the ten years since.
|
||||
|
||||
She received her first computer in high school, but it did not immediately spark her passion. She says she mostly used it for games and other diversions, as many teenagers do. It wasn't until she entered medical school and realized that technology could be a powerful tool to help her achieve her goals that Netha truly found her path. Taking stock of her many contributions to [Wikimedia][4], [Mozilla][5], and [TED][6], it's fair to say that once she engaged with open source culture, she never looked back.
|
||||
|
||||
### Finding ways to help
|
||||
|
||||
Growing up in India, Netha was initially drawn to mathematics but soon found herself pulled in other directions. "At the time, I would have expected to continue down that path, mathematics or maybe writing, but the thing that I've always most wanted to do is help people," Netha says. "Medicine seemed to be the most direct path to providing real, tangible assistance to those around me, so I became a doctor."
|
||||
|
||||
That drive to help continues to guide her now as she prepares to defend her doctoral thesis in clinical neuroscience at the University of Gothenburg in Sweden.
|
||||
|
||||
"At a certain point, I decided that rather than limiting myself to what I could do through treating patients, I could also contribute in a research capacity, working to discover new, better ways to help others. I came to all of this via an unexpected route, but I love the idea of exploring and finding my own ways to help. I'm so satisfied and fulfilled by the work I'm doing now. It has been a wonderful journey."
|
||||
|
||||
As she nears the completion of her degree, Netha reflects upon what she's looking forward to next. An infectious smile appears as she remarks, "I'm really excited to have more time to contribute to projects in the open source community."
|
||||
|
||||
Why is she so enamored with open source? It comes back to utility. "In open source practices, I found a philosophy that closely matched my own ideals and a way of doing things that allowed me to help more people. Open source is fueled by collaboration. I've seen the things that can be accomplished by people working together, and it makes me very excited to think where it will take us in the future."
|
||||
|
||||
### Reaching millions, one edit at a time
|
||||
|
||||
Her first article, written to help an international audience understand her blog post, was only the first of many. Netha has now written 300 articles (200 in English and 100 in Malayalam), contributed 13,000 edits for [Wikipedia][7], added 9,000 images to [Wikimedia Commons][8], and provided 120,000 edits to [Wikidata][9]. Her commitment to bringing useful information to others can also be seen in her five years spent volunteering to translate Mozilla projects and TED talks into the Malayalam language.
|
||||
|
||||
Such prolific output was born out of a simple realization. "I had shared so much on my blog but was only reaching a select audience. On Wikipedia and elsewhere, I had access to a potential audience of millions. There's a lot of power in that."
|
||||
|
||||
Many of the articles Netha has written center on issues relevant to women, and that is very much by design. "I find myself writing on topics that are important to women because I feel they are an underserved community, and it is important to me that Wikipedia, as such a vital repository of information, be reflective of all users, all voices. I care deeply about the visibility of women on Wikipedia."
|
||||
|
||||
Netha's commitment to women's issues led her to organize edit-a-thon initiatives and other activities with women's groups. She was also able to leverage similar strategies to assist the LGBTQ+ community in India during the campaign to legalize gay marriage.
|
||||
|
||||
"In India, there are a lot of taboos around homosexuality, and I saw an opportunity to utilize my experience to help another segment of the population. Together, we were able to generate a lot of awareness, whether through raising up biographical articles on famous members of the LGBTQ+ community or shining a spotlight on anti-LGBTQ+ laws. I'm very proud of the opportunities I've had to support such efforts."
|
||||
|
||||
### A path to the future
|
||||
|
||||
It's clear that Netha believes strongly in empowering people, especially other women who may wish to explore open source methodologies as she has. Her advice is simple, but powerful. "Believe in yourself, and know that you have the skills and talent to do whatever you'd like to do," she finds the words easily, as if she's been waiting to be asked the question. "Follow your passion, and do what you want. There will be times of uncertainty but always move forward. Keep studying. Keep learning new things. That's how you grow, both in your field and as a person."
|
||||
|
||||
Having achieved so much already, it's no surprise that Netha is enthusiastic about new challenges on the horizon. "I've put in a lot of effort to get here, but as you learn new strategies and new ways of collaborating, the work gets easier. Now, I don't consider it work at all. It's mostly fun to me."
|
||||
|
||||
_Also read Jay Barber's [interview with Megan Byrd-Sanicki][10], who won the 2020 Women in Open Source Community Award._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/interview-Netha-Hussain
|
||||
|
||||
作者:[Jay Barber][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/jaybarber
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lightbulb-idea-think-yearbook-lead.png?itok=5ZpCm0Jh (Lightbulb)
|
||||
[2]: https://www.redhat.com/en/about/women-in-open-source
|
||||
[3]: https://opensource.com/sites/default/files/uploads/netha_headshot.png (Photo by Lvova Anastasiya (Львова Анастасия, Lvova), CC BY-SA)
|
||||
[4]: https://www.wikimedia.org/
|
||||
[5]: https://www.mozilla.org/en-US/
|
||||
[6]: https://www.ted.com/
|
||||
[7]: https://www.wikipedia.org/
|
||||
[8]: https://commons.wikimedia.org/wiki/Main_Page
|
||||
[9]: https://www.wikidata.org/wiki/Wikidata:Main_Page
|
||||
[10]: https://opensource.com/article/20/4/interview-Megan-Byrd-Sanicki
|
@ -0,0 +1,67 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Industrial robots could 'eat metal' to power themselves)
|
||||
[#]: via: (https://www.networkworld.com/article/3540194/industrial-robots-could-eat-metal-to-power-themselves.html)
|
||||
[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/)
|
||||
|
||||
Industrial robots could 'eat metal' to power themselves
|
||||
======
|
||||
Scavenging energy by foraging for metal could power Internet of Things electronics and robots, suggest researchers at University of Pennsylvania.
|
||||
Jiraroj Praditcharoenkul / Getty Images
|
||||
|
||||
A fundamental manufacturing shift is on the horizon, some say. It's where robots run all elements of our future factories. The machines will operate using brain-copying artificial intelligence and handle not only manufacturing processes, but also supply-chain logistics, planning, and other roles formerly performed by humans.
|
||||
|
||||
This vision of the future anticipates an industrial workplace where Internet-connected machines will mimic humans, yet do the jobs more precisely, faster and cheaper than humans.
|
||||
|
||||
And the human-copying element may not end there. Researchers at the University of Pennsylvania are suggesting that robots could end up eating like humans, too.
|
||||
|
||||
Robots will "eat metal for energy," according to a [news article][1] published in Medium. The researchers' vision for a "metal-air scavenger" could solve one of the quandaries of future IoT-enabled factories. That quandary is how to power a device that moves without adding mass and weight, as one does by adding bulky batteries.
|
||||
|
||||
The answer, according to the University of Pennsylvania researchers, is to try to electromechanically forage for energy from the metal surfaces that a robot or IoT device traverses, thus converting material garnered, using a chemical reaction, into power.
|
||||
|
||||
"Robots and electronics [would] extract energy from large volumes of energy dense material without having to carry the material on-board," the researchers say in a paper they've published in [ACS Energy Letters][2].
|
||||
|
||||
It would be like "eating metal, breaking down its chemical bonds for energy like humans do with food." Batteries work by repeatedly breaking and creating chemical bonds.
|
||||
|
||||
The research references the dichotomy between computing and power storage. Computing is well suited to miniaturization, and processers have been progressively reduced in size while performance has increased, but battery storage hasn't. You need a bigger battery for more energy.
|
||||
|
||||
Even if swarming, industrial robots became the size of insects (I've [written about][3] the possibility), there's an issue powering the nano devices – the required size of the power source would defeat the object of the miniaturization. The battery alone could crush the device, and even if it didn't, the machine would need excessive amounts of energy to move, because of the battery mass. This conundrum is one of the reasons there's an emphasis in IoT development to find ways to harvest energy ambiently.
|
||||
|
||||
However, with ambient power – such as is found in [solar or potentially magnetism][4], for example – power density comes into play. That's where the harvesting technology can't pull enough energy out of the environment, or it does it so slowly that it's not as power-effective as traditional batteries.
|
||||
|
||||
Enter the metal-eating robot. The University of Pennsylvania researchers' form of harvesting efficiently replicates a power-dense battery. Metal is more dense than the battery chemistry.
|
||||
|
||||
The group performs their foraging energy production with a hydrogel electrolyte sponge towed by the robot. It uses a cathode, dragged over the surface, to extract amperages from the metal fuel source, such as steel or aluminum.
|
||||
|
||||
"Our [metal-air scavenger] has a power density that's ten times better than the best harvesters, to the point that we can compete against batteries," said James Pikul, an assistant professor in the University of Pennsylvania's Department of Mechanical Engineering and Applied Mechanics and one of the paper authors, in the Medium post. "It's using battery chemistry, but doesn't have the associated weight, because it's taking those chemicals from the environment."
|
||||
|
||||
This method is also potentially better than existing lithium-ion battery chemistry, according to Pikul.
|
||||
|
||||
"One day, a robot that needs to recharge its batteries will just need to find some aluminum to 'eat,'" Pikul said.
|
||||
|
||||
The robot, although ultimately likely to be a better worker than the human, is a messy eater. As it oxidizes the metal it passes over, it leaves a "microscopic layer of rust in its wake," according to the article.
|
||||
|
||||
Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3540194/industrial-robots-could-eat-metal-to-power-themselves.html
|
||||
|
||||
作者:[Patrick Nelson][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Patrick-Nelson/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://medium.com/penn-engineering/penn-engineerings-new-scavenger-technology-allows-robots-to-eat-metal-for-energy-bd12f3b83893
|
||||
[2]: https://pubs.acs.org/doi/10.1021/acsenergylett.9b02661
|
||||
[3]: https://www.networkworld.com/article/3429200/self-organizing-micro-robots-may-soon-swarm-the-industrial-iot.html
|
||||
[4]: https://www.networkworld.com/article/3536697/harvesting-ambient-energy-will-power-iot-scientists-say.html
|
||||
[5]: https://www.facebook.com/NetworkWorld/
|
||||
[6]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,64 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Red Hat Summit 2020 virtual experience)
|
||||
[#]: via: (https://www.networkworld.com/article/3541289/red-hat-summit-2020-virtual-experience.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
Red Hat Summit 2020 virtual experience
|
||||
======
|
||||
|
||||
[Virginiambe][1] [(CC BY-SA 3.0)][2]
|
||||
|
||||
In the last couple days, Red Hat was able to demonstrate that an online technical conference can succeed. The Summit, normally held in Boston or San Francisco, was held online thanks to the Covid-19 pandemic still gripping the world.
|
||||
|
||||
The fact that 80,000 people attended the online event warrants a huge applause. By comparison, last year’s in-person conference broke the record with only 8,900 attendees.
|
||||
|
||||
[[Get regularly scheduled insights by signing up for Network World newsletters.]][3]
|
||||
|
||||
### **Being “there”**
|
||||
|
||||
The experience of attending the conference was in many ways what you would expect when attending a large conference in person. There were keynotes, general sessions and breakout sessions. There were many opportunities to ask questions. And it was often difficult but necessary to choose between parallel sessions. I attended both days and was very impressed.
|
||||
|
||||
I also enjoyed some nostalgia about how we’ve all arrived at the places we are today with respect to Linux. It was clear that many attendees were overwhelmed by the progress that has been made just since last year. Linux, and [RHEL][4] in particular, is becoming more innovative, more clever in the ways that it can detect and respond to problems and yet in some important ways easier to manage because of the way the tools have evolved.
|
||||
|
||||
Announcements at the conference included Red Hat OpenShift 4.4, OpenShift virtualization and Red Hat Advanced Container Management for Kubernetes.
|
||||
|
||||
What was novel about attending a technical conference online was that we didn’t have to leave our home or office and that we could review sessions that we missed by selecting them later from the session layout pages. In fact, the sessions are still online and may well be for the coming year. If you didn’t participate in Red Hat Summit 2020, you can still sign up and you can still watch the sessions at your convenience. Just go to the [summit site][5]. And, did I mention, that it's free?
|
||||
|
||||
### Catching up
|
||||
|
||||
Once you’re signed up, you can click on the Watch and Learn at the top of the page and choose General Sessions or Sessions and Labs. The presentations will now all be labeled On Demand though they once displayed upcoming time slots. The individuals presenting information are excellent and the material is exciting. Even if you’re not working with Red Hat Enterprise Linux, you will learn a lot about Linux in general and how open source has evolved over the decades and is still evolving in important and critical ways.
|
||||
|
||||
Topics covered at the conference include OpenShift, open hybrid cloud, future technologies, robotics and automation, advances on the edge and the power of open source. Red Hat Summit also includes joint sessions with both Red Hat and technology collaborators such as Ford, Verizon, Intel, Microsoft and Credit Suisse.
|
||||
|
||||
### What’s next?
|
||||
|
||||
Watching the conference online at a time when I can't leave my home was informative, but also encouraging and comforting. Linux has been an important part of my life for decades. It felt good to be connected to the larger community and to sense the currents of progress through my desktop system.
|
||||
|
||||
While there’s no way to know at this point whether future Red Hat Summits or other Linux conferences will be held or made available online, the fact that Red Hat Summit 2020 was available online when so many of us are still huddled up at home wondering when our world will reopen was a testament not just to great technology but to the deep-seated conviction that it is critical that we work together and that open source can make that happen in ways that nothing else can.
|
||||
|
||||
Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3541289/red-hat-summit-2020-virtual-experience.html
|
||||
|
||||
作者:[Sandra Henry-Stocker][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://commons.wikimedia.org/wiki/File:Red_hat_with_bow2.JPG
|
||||
[2]: https://creativecommons.org/licenses/by-sa/3.0/legalcode
|
||||
[3]: https://www.networkworld.com/newsletters/signup.html
|
||||
[4]: https://www.networkworld.com/article/3540189/red-hat-enterprise-linux-82-hits-the-stage.html
|
||||
[5]: https://www.redhat.com/summit
|
||||
[6]: https://www.facebook.com/NetworkWorld/
|
||||
[7]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,129 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (The real impact of canceling PyCon due to COVID-19)
|
||||
[#]: via: (https://opensource.com/article/20/5/pycon-covid-19)
|
||||
[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg)
|
||||
|
||||
The real impact of canceling PyCon due to COVID-19
|
||||
======
|
||||
An interview with Ewa Jodlowska on how the Python Software Foundation is
|
||||
responding to the cancelation of in-person events.
|
||||
![A dollar sign in a network][1]
|
||||
|
||||
The Python Software Foundation (PSF) had to [cancel its popular PyCon US][2] event in response to COVID-19. I interviewed [Ewa Jodlowska][3], Executive Director of the PSF, to talk about the experience and see what we all can learn, and how we can be supportive of the non-profit that supports one of my favorite programming languages.
|
||||
|
||||
### The impact on PSF employees
|
||||
|
||||
I asked Jodlowska "how have you had to adjust your work in light of COVID-19?"
|
||||
|
||||
In her response, the day-to-day didn't sound like much of a change. PSF staff "have always worked remotely." The organization practices a [fully remote work][4] culture and doesn’t have an office. The small staff of seven employees is well versed in collaborating outside of an office.
|
||||
|
||||
Familiarity aside, the emotional impact of needing to cancel an event they put a year’s worth of planning into hurt.
|
||||
|
||||
> **"We all believe in what we do. Which is particularly why we’re such a great small team. So it really impacted us emotionally and mentally. And it continues to."**
|
||||
|
||||
We spoke about how the team is reliving what the days would have looked like if PyCon wasn't interrupted by COVID-19–keynotes would start _now_, the sponsor booths would be in full motion right _now_–and just how emotionally taxing it all was. Throughout the discussion, Jodlowska always came back to recognizing the staff for their resiliency and energy to pivot the event online.
|
||||
|
||||
### The cascading impact of event cancellation
|
||||
|
||||
Jodlowska has been incredibly transparent about the experience. In her March 31st [article on the financial outcome][5], she outlines it clearly: the Python Software Foundation would take a hit from the event cancelation.
|
||||
|
||||
Jodlowska notes that part of the challenge is that PyCon accounts for too much of the organization’s financial health. About 63% of the 2020 revenue was projected to come from the show. While that number is down from the [2017 estimate of 80%][6], it’s still a concern when in-person events will remain limited to keep attendees safe during the COVID-19 outbreak.
|
||||
|
||||
> **"We don’t want to rely on one event**–**or events in general**–**to operate and provide community support."**
|
||||
|
||||
The PSF board of directors is hard at work to look into the diversification of funding. In the meantime, PyCon remains essential to sustainability running the organization.
|
||||
|
||||
### Community support makes all the difference
|
||||
|
||||
It's at this point that Jodlowska again recognizes the incredible work of the PSF staff. They quickly pivoted the vision of the event, and the community of attendees, sponsors, and speakers were all supportive of the move.
|
||||
|
||||
> **"[We] have been brought to tears many times by the generosity of our sponsors and our individual donors."**
|
||||
|
||||
Jodlowska noted that the generosity of so many resulted in reducing the financial impact on the PSF. An incredible amount of Individual attendees are donating their registration costs to the PSF. They are also showing up across social media sites to participate in their own distributed virtual experience of PyCon.
|
||||
|
||||
Another important part of the community, the corporate sponsors of the show, are also showing up to support the non-profit. Many sponsors had already canceled physical presence at the show before the event was officially moved online. Some of them were kind enough, as Jodlowska noted, to donate the cost of sponsorship to the PSF. In a huge turn of events, the list of sponsors **grew** as the online event came together.
|
||||
|
||||
> **[M]any sponsors have opted into participating in PyCon 2020 online. Because of this we have decreased the amount needed from our reserve by 77%! The PSF will now only need $141,713 from its financial reserve to get through 2020.**
|
||||
|
||||
For more on the data side, see Jodlowska’s article _[Thank you to donors & sponsors][7]_.
|
||||
|
||||
Support in all its forms led to the conference feeling like it is well on its way. Some sponsors are even moving to a virtual booth experience.
|
||||
|
||||
> Since our sponsors can’t be with you in person, we’ve created a place to provide their content online - <https://t.co/oGDz3jNZWD>. [#PyCon2020][8] Gold Sponsor Weekly Python Exercise shared this video to introduce you to their offerings: <https://t.co/6VFF8AwMEK>.
|
||||
>
|
||||
> — PyCon US (@pycon) [April 18, 2020][9]
|
||||
|
||||
Maybe most impressively, many speakers and tutorial instructors made the effort of recording their sessions. That’s helped PyCon to [gradually unfold online][10] with incredible educational content. The audience is still able to interact as well: YouTube comments are open for moderation so speakers can interact with their audience.
|
||||
|
||||
Lastly, there remains an army of volunteers who shifted their in-person plans online and continue to help in any way possible.
|
||||
|
||||
### Some of the surprising positives from this difficult change
|
||||
|
||||
While it is without a doubt a challenging time for the organization, Jodlowska noted a number of positives that are unfolding due to this move to virtual.
|
||||
|
||||
To start, the staff of the PSF “have never been closer,” as they bond over the experience and spend more time getting to know each other through weekly video calls and baking competitions.
|
||||
|
||||
Jodlowska was inspired to get involved in another open source effort, [FOSS responders][11], who are helping organizations respond to the cancelation of events due to COVID-19. (If you’ve been affected as well, they are there to help.)
|
||||
|
||||
The generosity mentioned above is a silver lining to the experience and encouraging to the hardworking team that uplifts the popular Python programming language.
|
||||
|
||||
There is also a broader impact on participation in PyCon. While the final numbers are not in yet, an international audience has access to all of PyCon as it unfolds, which gives the entire world a chance to be part of an excellent event [I got to attend][12] last year. On the development side, Jodlowska mentioned that the [core-dev team][13] that maintains Python, who would normally meet in person, shifted to a virtual meeting. As a result of that shift, some participants got to attend that otherwise would not have had the opportunity to join in person.
|
||||
|
||||
### How you can help the Python Software Foundation
|
||||
|
||||
I reached out to Jodlowska because I am impressed with and supportive of their mission to support the Python community. If you want to support them as well, you have options:
|
||||
|
||||
* Become a [free or supporting member][14] of the PSF to get involved in our future.
|
||||
* [Sign up for the PSF’s free newsletter][15] to stay up to date.
|
||||
* [Donate][16] directly to the PSF (and thank you to those that already have).
|
||||
* Ask your employer to [sponsor the PSF][17].
|
||||
* Ask your employer if they match donations to 501(c)(3) non-profits, and ask for your donations to the PSF to be matched.
|
||||
|
||||
|
||||
|
||||
Last but not least, participate in PyCon over the next few weeks. You can learn from all kinds of smart people on a range of topics like [Matt Harrison][18]’s [Hands-on Python for Programmers][19] that guides attendees through analyzing COVID-19 data to [Katie McLaughlin][20]’s thoughtful talk on [What is deployment, anyway?][21]
|
||||
|
||||
Be sure to [review the full][10] list and engage with the amazing lineup of speakers.
|
||||
|
||||
* * *
|
||||
|
||||
_Are you part of a non-profit looking to connect with your open source community at this time of social distancing? Let me know at matt @ opensource.com._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/5/pycon-covid-19
|
||||
|
||||
作者:[Matthew Broberg][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/mbbroberg
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_whitehurst_money.png?itok=ls-SOzM0 (A dollar sign in a network)
|
||||
[2]: https://pycon.blogspot.com/2020/03/pycon-us-2020-in-pittsburgh.html
|
||||
[3]: https://www.python.org/psf/records/staff/
|
||||
[4]: https://opensource.com/tags/wfh
|
||||
[5]: http://pyfound.blogspot.com/2020/03/psfs-projected-2020-financial-outcome.html
|
||||
[6]: https://www.youtube.com/watch?v=79AIzbjLzdk
|
||||
[7]: http://pyfound.blogspot.com/2020/04/thank-you-to-donors-sponsors.html
|
||||
[8]: https://twitter.com/hashtag/PyCon2020?src=hash&ref_src=twsrc%5Etfw
|
||||
[9]: https://twitter.com/pycon/status/1251563142641000455?ref_src=twsrc%5Etfw
|
||||
[10]: https://us.pycon.org/2020/online/
|
||||
[11]: https://fossresponders.com/
|
||||
[12]: https://opensource.com/article/19/5/jupyterlab-python-developers-magic
|
||||
[13]: https://devguide.python.org/coredev/
|
||||
[14]: https://www.python.org/psf/membership/
|
||||
[15]: https://www.python.org/psf/newsletter/
|
||||
[16]: https://www.python.org/psf/donations/
|
||||
[17]: https://www.python.org/psf/sponsorship/
|
||||
[18]: https://us.pycon.org/2020/speaker/profile/454/
|
||||
[19]: https://youtu.be/fuJcSNUMrW0
|
||||
[20]: https://opensource.com/users/glasnt
|
||||
[21]: https://youtu.be/8vstov3Y7uE
|
@ -0,0 +1,96 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (11 DevOps lessons from My Little Pony)
|
||||
[#]: via: (https://opensource.com/article/20/5/devops-lessons)
|
||||
[#]: author: (Moshe Zadka https://opensource.com/users/moshez)
|
||||
|
||||
11 DevOps lessons from My Little Pony
|
||||
======
|
||||
What you never thought you could learn about DevOps for Twilight Sparkle
|
||||
and her friends.
|
||||
![My Little Pony][1]
|
||||
|
||||
In 2010, the My Little Pony franchise was rebooted with the animated show _My Little Pony: Friendship is Magic_. The combination of accessibility to children with the sophisticated themes the show tackled garnered a following that cut across ages. I was swept up in the wave and discovered there is a lot to learn about DevOps from the show.
|
||||
|
||||
### Discovering technical debt
|
||||
|
||||
The show begins with Twilight Sparkle reading obscure documentation, only to realize that Equestria, where the show is set, is due to suffer a calamity. Though someone named Nightmare Moon has been imprisoned for a thousand years, there is a prophecy she will return.
|
||||
|
||||
#### Lesson 1: Technical debt matters.
|
||||
|
||||
Nightmare Moon is a perfect stand-in for technical debt. Document it. Pay attention to the signs of risk no matter how infrequently they occur. Have a plan to resolve it.
|
||||
|
||||
Twilight Sparkle goes to her manager with the news, only to be told that it is not a current priority. She is sent to Ponyville to prepare for the coming celebration, instead.
|
||||
|
||||
#### Lesson 2: Communication with management is key.
|
||||
|
||||
Twilight Sparkle communicated her priority (the risk of technical debt) but did not convince her management that it was more important than the celebration (of the next release or a new customer).
|
||||
|
||||
We all need to make clear what the business case is for resolving critical issues. It is also not straightforward to explain technical debt in business terms. If management does not agree on the severity, find new ways to communicate the risk, and team up with others who speak that language.
|
||||
|
||||
### When technical debt becomes an outage
|
||||
|
||||
As the prophecy has foreseen, Nightmare Moon returns and declares eternal night. (In this DevOps story, this marks the beginning of a catastrophic outage.) Twilight quickly understands that she cannot resolve the issue by herself, and she recruits the ponies who will become, with her, the "Mane Six." They each stand for a different element of harmony—Applejack stands for Honesty, Fluttershy for Kindness, Pinkie Pie for Laughter, Rarity for Generosity, Rainbow Dash for Loyalty, and Twilight Sparkle herself for Magic. This team-building is full of lessons:
|
||||
|
||||
#### Lesson 3: Few are the issues that can be resolved by one person.
|
||||
|
||||
When facing an outage, reach out to other people with complementary skills who can help you. It is best if they are different than you: different backgrounds leads to differing perspectives, and that can lead to better problem-solving.
|
||||
|
||||
#### Lesson 4: When resolving an outage, honest communication is key.
|
||||
|
||||
Throughout the struggle against the eternal night, the Mane Six have to speak openly and honestly about what's not working. Their [blameless communication][2] is part of problem-solving.
|
||||
|
||||
#### Lesson 5: When resolving an outage, kindness to yourself and to others is crucial.
|
||||
|
||||
Though tempers flare hot in the land of Equestria, we all benefit from coming back to working together.
|
||||
|
||||
#### Lesson 6: Laughter is important.
|
||||
|
||||
Even when everything comes crashing down, remember to take a break, drink a glass of water, and take a deep breath. Stressing out does not help anything.
|
||||
|
||||
#### Lesson 7: Be generous.
|
||||
|
||||
Even if you are not on-call right now, if your help is needed to resolve a problem, help out as you hope your colleagues will do for you.
|
||||
|
||||
#### Lesson 8: Be loyal.
|
||||
|
||||
An outage is not a time to settle rivalries between teams. Focus on how to collaborate and resolve the outage as a team.
|
||||
|
||||
#### Lesson 9: Though people skills are important, you have to understand the technology on a deep level.
|
||||
|
||||
Keep your skills sharp. Expertise is not only the ability to learn; it is knowing when that information is needed. Part of being an expert is practice.
|
||||
|
||||
### Growing into a culture of continual improvement
|
||||
|
||||
After the issue is resolved, Princess Celestia realizes that the Mane Six are crucial to the long-term survival of Equestria, and tells Twilight Sparkle to stay in Ponyville and keep researching the magic of friendship.
|
||||
|
||||
#### Lesson 10: After an outage is resolved, conduct a review, take concrete lessons, and act on them.
|
||||
|
||||
I could go on, episode by episode, detailing lessons relevant for DevOps, but I will wrap up with one of my favorite ones. In the "Winter Wrap-Up" episode, all the ponies in Ponyville help in preparing for the spring. As per tradition, they do not use magic, leaving Twilight Sparkle to wonder how she can contribute. Eventually, she realizes that she can help by making a checklist to make sure everything is done in the right order.
|
||||
|
||||
#### Lesson 11: When automation is impossible or inadvisable, write a solid checklist, and follow it. Do not depend on your memory.
|
||||
|
||||
Twilight Sparkle and the Mane Six overcome great obstacles as a team, and now have a system to improve as a team.
|
||||
|
||||
### A story of DevOps
|
||||
|
||||
This story reflects how many organizations slowly adopt DevOps. The transition from recognizing a fear of technical debt toward addressing it is not simple. With courageous leadership, teamwork, and a willingness to improve, all organizations can come out on the other side with a similar story to Twilight Sparkle and her friends.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/5/devops-lessons
|
||||
|
||||
作者:[Moshe Zadka][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/moshez
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/my-little-pony.jpg?itok=X-rwAGuE (My Little Pony)
|
||||
[2]: https://opensource.com/article/19/4/psychology-behind-blameless-retrospective
|
@ -0,0 +1,78 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (IBM rolls Red Hat into edge, AI, hybrid-cloud expansion)
|
||||
[#]: via: (https://www.networkworld.com/article/3542409/ibm-rolls-red-hat-into-edge-ai-hybrid-cloud-expansion.html)
|
||||
[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/)
|
||||
|
||||
IBM rolls Red Hat into edge, AI, hybrid-cloud expansion
|
||||
======
|
||||
Every company will be an AI company new IBM CEO Krishna tells Think! virtual gathering
|
||||
Getty
|
||||
|
||||
Deeply assimilating its Red Hat technology, IBM this week rolled out a set of new platforms and services designed to help customers manage edge-based application workloads and exploit artificial intelligence for infrastructure resiliency.
|
||||
|
||||
The announcements came at IBM’s virtualized Think! 2020 event that also featured the first Big Blue keynote by [the company's new CEO Arvind Krishna][1], during which he told the online audience about challenges of COVID-19: "History will look back on this as the moment when the digital transformation of business and society suddenly accelerated,” but also that [hybrid cloud and AI][2] are the two dominant forces driving digital transformation.
|
||||
|
||||
[Now see how AI can boost data-center availability and efficiency][3]
|
||||
|
||||
“More than 20 years ago, experts predicted every company would become an internet company. I am predicting today that every company will become an AI company, not because they can, but because they must,” he said.
|
||||
|
||||
With that idea in mind the company rolled out [IBM Watson AIOps][4], an application that uses AI to automate how enterprises detect, diagnose and respond to IT anomalies in real time. Watson AIOps works by grouping log anomalies and alerts based on spatial and temporal reasoning as well as similarity to past situations, IBM said. It uses IBM’s natural language processing technology to understand the content in trouble tickets to identify and extract resolution actions automatically.
|
||||
|
||||
Then it provides a pointer to where the problem is and identifies other services that might be affected. “It does this by showing details of the problem based on data from existing tools in the environment, all in the context of the application topology, distilling multiple signals into a succinct report” and eliminating the need for multiple dashboards, IBM stated.
|
||||
|
||||
AI can automate tasks like shifting traffic from one router to another, freeing up space on a drive, or restarting an application. AI systems can also be trained to self-correct, IBM stated.
|
||||
|
||||
“The problem is that many businesses are consumed with fixing problems after they occur, instead of preventing them before they happen. Watson AIOps relies on AI to solve and automate how enterprises self-detect, diagnose and respond to anomalies in real time,” Krishna said.
|
||||
|
||||
AIOps is built on the latest release of Red Hat OpenShift, supports Slack and Box, and can be integrated with IT-monitoring packages from Mattermost and ServiceNow, IBM stated.
|
||||
|
||||
The Kubernetes-based OpenShift Container Platform lets enterprise customers deploy and manage containers on their infrastructure of choice, be it private or public clouds, including AWS, Microsoft Azure, Google Cloud Platform, Alibaba and IBM Cloud. It also integrates with IBM prepackaged Cloud Paks, which include a secured Kubernetes container and containerized IBM middleware designed to let customers quickly spin-up enterprise-ready containers.
|
||||
|
||||
OpenShift is also the underlying package for a new version of its [edge network][5] management application called IBM Edge Application Manager. Based on the open source project [Open Horizon][6], the Edge Application Manager can use AI and analytics to help deploy and manage up to 10,000 edge nodes simultaneously by a single administrator. With the platform customers can remotely add new capabilities to a single-purpose device or automatically direct a device to use a variety of cloud-based resources depending on what resources it needs.
|
||||
|
||||
Cisco said it was working with the IBM Edge Application Manager to deploy apps and analytics models that run on a broad range of Cisco products, such as servers, its industrial portfolio of gateways, routers, switches, SD-WAN, and wireless-connectivity offerings for edge computing.
|
||||
|
||||
“As an example, IBM Edge Application Manager leverages [Cisco HyperFlex Edge][7] and Cisco IC3000 Industrial Compute Gateway servers. The HyperFlex Edge and IC3K platforms are specifically designed to support a number of edge use cases, such as optimizing traffic management, increasing manufacturing productivity, and increasing the safety of oil and gas pipelines,” Cisco [stated][8].
|
||||
|
||||
In addition, Cisco said it has used the capabilities in IBM Edge Application Manager to build an “Edge in a Box proposal,” where customers can deploy remote edge applications that run entirely disconnected from public or private clouds but are also synchronized and managed remotely in controlled connectivity windows. For instance, client edge locations may need to operate in disconnected mode but have the ability to synch up for automated application updates and data exchanges, Cisco stated.
|
||||
|
||||
Other edge-related announcements include:
|
||||
|
||||
* IBM [Edge Ecosystem][9], a group of industry players who will target open technology developments to let customers move data and applications between private data centers, hybrid multicloud environments and the edge. The group includes Cisco, Juniper, Samsung and NVIDIA among others. IBM said a Telco Network Cloud Ecosystem will serve a similar function for their network cloud platforms.
|
||||
* A preview of an upcoming service, called IBM Cloud Satellite. This will extend IBM’s public-cloud service to give customers the ability to use IBM Cloud anywhere – on-premises, in data centers or at the edge – delivered as a service that can be managed from a single pane of glass controlled through the public cloud. It lets customers run applications where it makes sense while utilizing cloud security and ops benefits, IBM stated. Satellite runs on Red Hat OpenShift.
|
||||
* Telco Network Cloud Manager – a telco/service provider offering that runs on Red Hat OpenShift to deliver intelligent automation capabilities to orchestrate virtual and container network functions in minutes. Service providers will have the ability to manage workloads on both Red Hat OpenShift and Red Hat OpenStack platforms, which will be critical as telcos increasingly look to modernize their networks for greater agility and efficiency, and to provide new services as 5G adoption expands, IBM stated.
|
||||
* New capabilities for some of its Cloud Paks including extending the Cloud Pak for Data to include the ability to better automate planning, budgeting and forecasting in [hybrid-cloud][10] environments. IBM upgraded tools for business routing and data capture to the Cloud Pak for Automation as well.
|
||||
|
||||
|
||||
|
||||
Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3542409/ibm-rolls-red-hat-into-edge-ai-hybrid-cloud-expansion.html
|
||||
|
||||
作者:[Michael Cooney][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Michael-Cooney/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.networkworld.com/article/3536654/ibm-taps-new-leaders-for-hybrid-cloud-battles-ahead.html
|
||||
[2]: https://www.infoworld.com/article/3541825/ibms-new-ceo-lays-out-his-roadmap.html
|
||||
[3]: https://www.networkworld.com/article/3274654/ai-boosts-data-center-availability-efficiency.html
|
||||
[4]: https://www.ibm.com/watson/assets/duo/pdf/WDDE814_IBM_Watson_AIOps_Web.pdf
|
||||
[5]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html
|
||||
[6]: https://developer.ibm.com/blogs/open-horizon-joins-linux-foundation-grow-open-edge-computing-platform/
|
||||
[7]: https://www.cisco.com/c/en/us/products/hyperconverged-infrastructure/index.html?dtid=oblgzzz001087
|
||||
[8]: https://blogs.cisco.com/partner/cisco-and-ibm-teaming-at-the-edge
|
||||
[9]: https://www.ibm.com/blogs/business-partners/join-the-edge-ecosystem/
|
||||
[10]: https://www.networkworld.com/article/3268448/what-is-hybrid-cloud-really-and-whats-the-best-strategy.html
|
||||
[11]: https://www.facebook.com/NetworkWorld/
|
||||
[12]: https://www.linkedin.com/company/network-world
|
@ -1,276 +0,0 @@
|
||||
//messon007 translating
|
||||
Systemd Services: Reacting to Change
|
||||
======
|
||||
|
||||
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/webcam.png?itok=zzYUs5VK)
|
||||
|
||||
[I have one of these Compute Sticks][1] (Figure 1) and use it as an all-purpose server. It is inconspicuous and silent and, as it is built around an x86 architecture, I don't have problems getting it to work with drivers for my printer, and that’s what it does most days: it interfaces with the shared printer and scanner in my living room.
|
||||
|
||||
![ComputeStick][3]
|
||||
|
||||
An Intel ComputeStick. Euro coin for size.
|
||||
|
||||
[Used with permission][4]
|
||||
|
||||
Most of the time it is idle, especially when we are out, so I thought it would be good idea to use it as a surveillance system. The device doesn't come with its own camera, and it wouldn't need to be spying all the time. I also didn't want to have to start the image capturing by hand because this would mean having to log into the Stick using SSH and fire up the process by writing commands in the shell before rushing out the door.
|
||||
|
||||
So I thought that the thing to do would be to grab a USB webcam and have the surveillance system fire up automatically just by plugging it in. Bonus points if the surveillance system fired up also after the Stick rebooted, and it found that the camera was connected.
|
||||
|
||||
In prior installments, we saw that [systemd services can be started or stopped by hand][5] or [when certain conditions are met][6]. Those conditions are not limited to when the OS reaches a certain state in the boot up or powerdown sequence but can also be when you plug in new hardware or when things change in the filesystem. You do that by combining a Udev rule with a systemd service.
|
||||
|
||||
### Hotplugging with Udev
|
||||
|
||||
Udev rules live in the _/etc/udev/rules_ directory and are usually a single line containing _conditions_ and _assignments_ that lead to an _action_.
|
||||
|
||||
That was a bit cryptic. Let's try again:
|
||||
|
||||
Typically, in a Udev rule, you tell systemd what to look for when a device is connected. For example, you may want to check if the make and model of a device you just plugged in correspond to the make and model of the device you are telling Udev to wait for. Those are the _conditions_ mentioned earlier.
|
||||
|
||||
Then you may want to change some stuff so you can use the device easily later. An example of that would be to change the read and write permissions to a device: if you plug in a USB printer, you're going to want users to be able to read information from the printer (the user's printing app would want to know the model, make, and whether it is ready to receive print jobs or not) and write to it, that is, send stuff to print. Changing the read and write permissions for a device is done using one of the _assignments_ you read about earlier.
|
||||
|
||||
Finally, you will probably want the system to do something when the conditions mentioned above are met, like start a backup application to copy important files when a certain external hard disk drive is plugged in. That is an example of an _action_ mentioned above.
|
||||
|
||||
With that in mind, ponder this:
|
||||
|
||||
```
|
||||
ACTION=="add", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="e207",
|
||||
SYMLINK+="mywebcam", TAG+="systemd", MODE="0666", ENV{SYSTEMD_WANTS}="webcam.service"
|
||||
```
|
||||
|
||||
The first part of the rule,
|
||||
|
||||
```
|
||||
ACTION=="add", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="03f0",
|
||||
ATTRS{idProduct}=="e207" [etc... ]
|
||||
```
|
||||
|
||||
shows the conditions that the device has to meet before doing any of the other stuff you want the system to do. The device has to be added (`ACTION=="add"`) to the machine, it has to be integrated into the `video4linux` subsystem. To make sure the rule is applied only when the correct device is plugged in, you have to make sure Udev correctly identifies the manufacturer (`ATTRS{idVendor}=="03f0"`) and a model (`ATTRS{idProduct}=="e207"`) of the device.
|
||||
|
||||
In this case, we're talking about this device (Figure 2):
|
||||
|
||||
![webcam][8]
|
||||
|
||||
The HP webcam used in this experiment.
|
||||
|
||||
[Used with permission][4]
|
||||
|
||||
Notice how you use `==` to indicate that these are a logical operation. You would read the above snippet of the rule like this:
|
||||
|
||||
```
|
||||
if the device is added and the device controlled by the video4linux subsystem
|
||||
and the manufacturer of the device is 03f0 and the model is e207, then...
|
||||
```
|
||||
|
||||
But where do you get all this information? Where do you find the action that triggers the event, the manufacturer, model, and so on? You will probably have to use several sources. The `IdVendor` and `idProduct` you can get by plugging the webcam into your machine and running `lsusb`:
|
||||
|
||||
```
|
||||
lsusb
|
||||
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
|
||||
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
|
||||
Bus 003 Device 003: ID 03f0:e207 Hewlett-Packard
|
||||
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||
Bus 001 Device 003: ID 04f2:b1bb Chicony Electronics Co., Ltd
|
||||
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
|
||||
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||
```
|
||||
|
||||
The webcam I’m using is made by HP, and you can only see one HP device in the list above. The `ID` gives you the manufacturer and the model numbers separated by a colon (`:`). If you have more than one device by the same manufacturer and not sure which is which, unplug the webcam, run `lsusb` again and check what's missing.
|
||||
|
||||
OR...
|
||||
|
||||
Unplug the webcam, wait a few seconds, run the command `udevadmin monitor --environment` and then plug the webcam back in again. When you do that with the HP webcam, you get:
|
||||
|
||||
```
|
||||
udevadmin monitor --environment
|
||||
UDEV [35776.495221] add /devices/pci0000:00/0000:00:1c.3/0000:04:00.0
|
||||
/usb3/3-1/3-1:1.0/input/input21/event11 (input)
|
||||
.MM_USBIFNUM=00
|
||||
ACTION=add
|
||||
BACKSPACE=guess
|
||||
DEVLINKS=/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event
|
||||
/dev/input/by-id/usb-Hewlett_Packard_HP_Webcam_HD_2300-event-if00
|
||||
DEVNAME=/dev/input/event11
|
||||
DEVPATH=/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/
|
||||
usb3/3-1/3-1:1.0/input/input21/event11
|
||||
ID_BUS=usb
|
||||
ID_INPUT=1
|
||||
ID_INPUT_KEY=1
|
||||
ID_MODEL=HP_Webcam_HD_2300
|
||||
ID_MODEL_ENC=HP\x20Webcam\x20HD\x202300
|
||||
ID_MODEL_ID=e207
|
||||
ID_PATH=pci-0000:04:00.0-usb-0:1:1.0
|
||||
ID_PATH_TAG=pci-0000_04_00_0-usb-0_1_1_0
|
||||
ID_REVISION=1020
|
||||
ID_SERIAL=Hewlett_Packard_HP_Webcam_HD_2300
|
||||
ID_TYPE=video
|
||||
ID_USB_DRIVER=uvcvideo
|
||||
ID_USB_INTERFACES=:0e0100:0e0200:010100:010200:030000:
|
||||
ID_USB_INTERFACE_NUM=00
|
||||
ID_VENDOR=Hewlett_Packard
|
||||
ID_VENDOR_ENC=Hewlett\x20Packard
|
||||
ID_VENDOR_ID=03f0
|
||||
LIBINPUT_DEVICE_GROUP=3/3f0/e207:usb-0000:04:00.0-1/button
|
||||
MAJOR=13
|
||||
MINOR=75
|
||||
SEQNUM=3162
|
||||
SUBSYSTEM=input
|
||||
USEC_INITIALIZED=35776495065
|
||||
XKBLAYOUT=es
|
||||
XKBMODEL=pc105
|
||||
XKBOPTIONS=
|
||||
XKBVARIANT=
|
||||
```
|
||||
|
||||
That may look like a lot to process, but, check this out: the `ACTION` field early in the list tells you what event just happened, i.e., that a device got added to the system. You can also see the name of the device spelled out on several of the lines, so you can be pretty sure that it is the device you are looking for. The output also shows the manufacturer's ID number (`ID_VENDOR_ID=03f0`) and the model number (`ID_VENDOR_ID=03f0`).
|
||||
|
||||
This gives you three of the four values the condition part of the rule needs. You may be tempted to think that it a gives you the fourth, too, because there is also a line that says:
|
||||
|
||||
```
|
||||
SUBSYSTEM=input
|
||||
```
|
||||
|
||||
Be careful! Although it is true that a USB webcam is a device that provides input (as does a keyboard and a mouse), it is also belongs to the _usb_ subsystem, and several others. This means that your webcam gets added to several subsystems and looks like several devices. If you pick the wrong subsystem, your rule may not work as you want it to, or, indeed, at all.
|
||||
|
||||
So, the third thing you have to check is all the subsystems the webcam has got added to and pick the correct one. To do that, unplug your webcam again and run:
|
||||
|
||||
```
|
||||
ls /dev/video*
|
||||
```
|
||||
|
||||
This will show you all the video devices connected to the machine. If you are using a laptop, most come with a built-in webcam and it will probably show up as `/dev/video0`. Plug your webcam back in and run `ls /dev/video*` again.
|
||||
|
||||
Now you should see one more video device (probably `/dev/video1`).
|
||||
|
||||
Now you can find out all the subsystems it belongs to by running `udevadm info -a /dev/video1`:
|
||||
|
||||
```
|
||||
udevadm info -a /dev/video1
|
||||
|
||||
Udevadm info starts with the device specified by the devpath and then
|
||||
walks up the chain of parent devices. It prints for every device
|
||||
found, all possible attributes in the udev rules key format.
|
||||
A rule to match, can be composed by the attributes of the device
|
||||
and the attributes from one single parent device.
|
||||
|
||||
looking at device '/devices/pci0000:00/0000:00:1c.3/0000:04:00.0
|
||||
/usb3/3-1/3-1:1.0/video4linux/video1':
|
||||
KERNEL=="video1"
|
||||
SUBSYSTEM=="video4linux"
|
||||
DRIVER==""
|
||||
ATTR{dev_debug}=="0"
|
||||
ATTR{index}=="0"
|
||||
ATTR{name}=="HP Webcam HD 2300: HP Webcam HD"
|
||||
|
||||
[etc...]
|
||||
```
|
||||
|
||||
The output goes on for quite a while, but what you're interested is right at the beginning: `SUBSYSTEM=="video4linux"`. This is a line you can literally copy and paste right into your rule. The rest of the output (not shown for brevity) gives you a couple more nuggets, like the manufacturer and mode IDs, again in a format you can copy and paste into your rule.
|
||||
|
||||
Now you have a way of identifying the device and what event should trigger the action univocally, it is time to tinker with the device.
|
||||
|
||||
The next section in the rule, `SYMLINK+="mywebcam", TAG+="systemd", MODE="0666"` tells Udev to do three things: First, you want to create symbolic link from the device to (e.g. _/dev/video1_ ) to _/dev/mywebcam_. This is because you cannot predict what the system is going to call the device by default. When you have an in-built webcam and you hotplug a new one, the in-built webcam will usually be _/dev/video0_ while the external one will become _/dev/video1_. However, if you boot your computer with the external USB webcam plugged in, that could be reversed and the internal webcam can become _/dev/video1_ and the external one _/dev/video0_. What this is telling you is that, although your image-capturing script (which you will see later on) always needs to point to the external webcam device, you can't rely on it being _/dev/video0_ or _/dev/video1_. To solve this problem, you tell Udev to create a symbolic link which will never change in the moment the device is added to the _video4linux_ subsystem and you will make your script point to that.
|
||||
|
||||
The second thing you do is add `"systemd"` to the list of Udev tags associated with this rule. This tells Udev that the action that the rule will trigger will be managed by systemd, that is, it will be some sort of systemd service.
|
||||
|
||||
Notice how in both cases you use `+=` operator. This adds the value to a list, which means you can add more than one value to `SYMLINK` and `TAG`.
|
||||
|
||||
The `MODE` values, on the other hand, can only contain one value (hence you use the simple `=` assignment operator). What `MODE` does is tell Udev who can read from or write to the device. If you are familiar with `chmod` (and, if you are reading this, you should be), you will also be familiar of [how you can express permissions using numbers][9]. That is what this is: `0666` means " _give read and write privileges to the device to everybody_ ".
|
||||
|
||||
At last, `ENV{SYSTEMD_WANTS}="webcam.service"` tells Udev what systemd service to run.
|
||||
|
||||
Save this rule into file called _90-webcam.rules_ (or something like that) in _/etc/udev/rules.d_ and you can load it either by rebooting your machine, or by running:
|
||||
|
||||
```
|
||||
sudo udevadm control --reload-rules && udevadm trigger
|
||||
```
|
||||
|
||||
## Service at Last
|
||||
|
||||
The service the Udev rule triggers is ridiculously simple:
|
||||
|
||||
```
|
||||
# webcam.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/home/[user name]/bin/checkimage.sh
|
||||
```
|
||||
|
||||
Basically, it just runs the _checkimage.sh_ script stored in your personal _bin/_ and pushes it the background. [This is something you saw how to do in prior installments][5]. It may seem something little, but just because it is called by a Udev rule, you have just created a special kind of systemd unit called a _device_ unit. Congratulations.
|
||||
|
||||
As for the _checkimage.sh_ script _webcam.service_ calls, there are several ways of grabbing an image from a webcam and comparing it to a prior one to check for changes (which is what _checkimage.sh_ does), but this is how I did it:
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
# This is the checkimage.sh script
|
||||
|
||||
mplayer -vo png -frames 1 tv:// -tv driver=v4l2:width=640:height=480:device=
|
||||
/dev/mywebcam &>/dev/null
|
||||
mv 00000001.png /home/[user name]/monitor/monitor.png
|
||||
|
||||
while true
|
||||
do
|
||||
mplayer -vo png -frames 1 tv:// -tv driver=v4l2:width=640:height=480:device=/dev/mywebcam &>/dev/null
|
||||
mv 00000001.png /home/[user name]/monitor/temp.png
|
||||
|
||||
imagediff=`compare -metric mae /home/[user name]/monitor/monitor.png /home/[user name]
|
||||
/monitor/temp.png /home/[user name]/monitor/diff.png 2>&1 > /dev/null | cut -f 1 -d " "`
|
||||
if [ `echo "$imagediff > 700.0" | bc` -eq 1 ]
|
||||
then
|
||||
mv /home/[user name]/monitor/temp.png /home/[user name]/monitor/monitor.png
|
||||
fi
|
||||
|
||||
sleep 0.5
|
||||
done
|
||||
```
|
||||
|
||||
Start by using [MPlayer][10] to grab a frame ( _00000001.png_ ) from the webcam. Notice how we point `mplayer` to the `mywebcam` symbolic link we created in our Udev rule, instead of to `video0` or `video1`. Then you transfer the image to the _monitor/_ directory in your home directory. Then run an infinite loop that does the same thing again and again, but also uses [Image Magick's _compare_ tool][11] to see if there any differences between the last image captured and the one that is already in the _monitor/_ directory.
|
||||
|
||||
If the images are different, it means something has moved within the webcam's frame. The script overwrites the original image with the new image and continues comparing waiting for some more movement.
|
||||
|
||||
### Plugged
|
||||
|
||||
With all the bits and pieces in place, when you plug your webcam in, your Udev rule will be triggered and will start the _webcam.service_. The _webcam.service_ will execute _checkimage.sh_ in the background, and _checkimage.sh_ will start taking pictures every half a second. You will know because your webcam's LED will start flashing indicating every time it takes a snap.
|
||||
|
||||
As always, if something goes wrong, run
|
||||
|
||||
```
|
||||
systemctl status webcam.service
|
||||
```
|
||||
|
||||
to check what your service and script are up to.
|
||||
|
||||
### Coming up
|
||||
|
||||
You may be wondering: Why overwrite the original image? Surely you would want to see what's going on if the system detects any movement, right? You would be right, but as you will see in the next installment, leaving things as they are and processing the images using yet another type of systemd unit makes things nice, clean and easy.
|
||||
|
||||
Just wait and see.
|
||||
|
||||
Learn more about Linux through the free ["Introduction to Linux" ][12]course from The Linux Foundation and edX.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/blog/intro-to-linux/2018/6/systemd-services-reacting-change
|
||||
|
||||
作者:[Paul Brown][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.linux.com/users/bro66
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.intel.com/content/www/us/en/products/boards-kits/compute-stick/stk1a32sc.html
|
||||
[2]: https://www.linux.com/files/images/fig01png
|
||||
[3]: https://www.linux.com/sites/lcom/files/styles/floated_images/public/fig01.png?itok=cfEHN5f1 (ComputeStick)
|
||||
[4]: https://www.linux.com/licenses/category/used-permission
|
||||
[5]: https://www.linux.com/blog/learn/intro-to-linux/2018/5/writing-systemd-services-fun-and-profit
|
||||
[6]: https://www.linux.com/blog/learn/2018/5/systemd-services-beyond-starting-and-stopping
|
||||
[7]: https://www.linux.com/files/images/fig02png
|
||||
[8]: https://www.linux.com/sites/lcom/files/styles/floated_images/public/fig02.png?itok=esFv4BdM (webcam)
|
||||
[9]: https://chmod-calculator.com/
|
||||
[10]: https://mplayerhq.hu/design7/news.html
|
||||
[11]: https://www.imagemagick.org/script/compare.php
|
||||
[12]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
|
@ -1,197 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Configure SFTP Server with Chroot in Debian 10)
|
||||
[#]: via: (https://www.linuxtechi.com/configure-sftp-chroot-debian10/)
|
||||
[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/)
|
||||
|
||||
How to Configure SFTP Server with Chroot in Debian 10
|
||||
======
|
||||
|
||||
**SFTP** stands for Secure File Transfer Protocol / SSH File Transfer Protocol, it is one of the most common method which is used to transfer files securely over ssh from our local system to remote server and vice-versa. The main advantage of sftp is that we don’t need to install any additional package except ‘**openssh-server**’, in most of the Linux distributions ‘openssh-server’ package is the part of default installation. Other benefit of sftp is that we can allow user to use sftp only not ssh.
|
||||
|
||||
[![Configure-sftp-debian10][1]][2]
|
||||
|
||||
Recently Debian 10, Code name ‘Buster’ has been released, in this article we will demonstrate how to configure sftp with Chroot ‘Jail’ like environment in Debian 10 System. Here Chroot Jail like environment means that user’s cannot go beyond from their respective home directories or users cannot change directories from their home directories. Following are the lab details:
|
||||
|
||||
* OS = Debian 10
|
||||
* IP Address = 192.168.56.151
|
||||
|
||||
|
||||
|
||||
Let’s jump into SFTP Configuration Steps,
|
||||
|
||||
### Step:1) Create a Group for sftp using groupadd command
|
||||
|
||||
Open the terminal, create a group with a name “**sftp_users**” using below groupadd command,
|
||||
|
||||
```
|
||||
root@linuxtechi:~# groupadd sftp_users
|
||||
```
|
||||
|
||||
### Step:2) Add Users to Group ‘sftp_users’ and set permissions
|
||||
|
||||
In case you want to create new user and want to add that user to ‘sftp_users’ group, then run the following command,
|
||||
|
||||
**Syntax:** # useradd -m -G sftp_users <user_name>
|
||||
|
||||
Let’s suppose user name is ’Jonathan’
|
||||
|
||||
```
|
||||
root@linuxtechi:~# useradd -m -G sftp_users jonathan
|
||||
```
|
||||
|
||||
set the password using following chpasswd command,
|
||||
|
||||
```
|
||||
root@linuxtechi:~# echo "jonathan:<enter_password>" | chpasswd
|
||||
```
|
||||
|
||||
In case you want to add existing users to ‘sftp_users’ group then run beneath usermod command, let’s suppose already existing user name is ‘chris’
|
||||
|
||||
```
|
||||
root@linuxtechi:~# usermod -G sftp_users chris
|
||||
```
|
||||
|
||||
Now set the required permissions on Users,
|
||||
|
||||
```
|
||||
root@linuxtechi:~# chown root /home/jonathan /home/chris/
|
||||
```
|
||||
|
||||
Create an upload folder in both the user’s home directory and set the correct ownership,
|
||||
|
||||
```
|
||||
root@linuxtechi:~# mkdir /home/jonathan/upload
|
||||
root@linuxtechi:~# mkdir /home/chris/upload
|
||||
root@linuxtechi:~# chown jonathan /home/jonathan/upload
|
||||
root@linuxtechi:~# chown chris /home/chris/upload
|
||||
```
|
||||
|
||||
**Note:** User like Jonathan and Chris can upload files and directories to upload folder from their local systems.
|
||||
|
||||
### Step:3) Edit sftp configuration file (/etc/ssh/sshd_config)
|
||||
|
||||
As we have already stated that sftp operations are done over the ssh, so it’s configuration file is “**/etc/ssh/sshd_config**“, Before making any changes I would suggest first take the backup and then edit this file and add the following content,
|
||||
|
||||
```
|
||||
root@linuxtechi:~# cp /etc/ssh/sshd_config /etc/ssh/sshd_config-org
|
||||
root@linuxtechi:~# vim /etc/ssh/sshd_config
|
||||
………
|
||||
#Subsystem sftp /usr/lib/openssh/sftp-server
|
||||
Subsystem sftp internal-sftp
|
||||
|
||||
Match Group sftp_users
|
||||
X11Forwarding no
|
||||
AllowTcpForwarding no
|
||||
ChrootDirectory %h
|
||||
ForceCommand internal-sftp
|
||||
…………
|
||||
```
|
||||
|
||||
Save & exit the file.
|
||||
|
||||
To make above changes into the affect, restart ssh service using following systemctl command
|
||||
|
||||
```
|
||||
root@linuxtechi:~# systemctl restart sshd
|
||||
```
|
||||
|
||||
In above ‘sshd_config’ file we have commented out the line which starts with “Subsystem” and added new entry “Subsystem sftp internal-sftp” and new lines like,
|
||||
|
||||
“**Match Group sftp_users”** –> It means if a user is a part of ‘sftp_users’ group then apply rules which are mentioned below to this entry.
|
||||
|
||||
“**ChrootDierctory %h**” –> It means users can only change directories within their respective home directories, they cannot go beyond their home directories, or in other words we can say users are not permitted to change directories, they will get jai like environment within their directories and can’t access any other user’s and system’s directories.
|
||||
|
||||
“**ForceCommand internal-sftp**” –> It means users are limited to sftp command only.
|
||||
|
||||
### Step:4) Test and Verify sftp
|
||||
|
||||
Login to any other Linux system which is on the same network of your sftp server and then try to ssh sftp server via the users that we have mapped in ‘sftp_users’ group.
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# ssh root@linuxtechi
|
||||
root@linuxtechi's password:
|
||||
Write failed: Broken pipe
|
||||
[root@linuxtechi ~]# ssh root@linuxtechi
|
||||
root@linuxtechi's password:
|
||||
Write failed: Broken pipe
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
Above confirms that users are not allowed to SSH , now try sftp using following commands,
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# sftp root@linuxtechi
|
||||
root@linuxtechi's password:
|
||||
Connected to 192.168.56.151.
|
||||
sftp> ls -l
|
||||
drwxr-xr-x 2 root 1001 4096 Sep 14 07:52 debian10-pkgs
|
||||
-rw-r--r-- 1 root 1001 155 Sep 14 07:52 devops-actions.txt
|
||||
drwxr-xr-x 2 1001 1002 4096 Sep 14 08:29 upload
|
||||
```
|
||||
|
||||
Let’s try to download a file using sftp ‘**get**‘ command
|
||||
|
||||
```
|
||||
sftp> get devops-actions.txt
|
||||
Fetching /devops-actions.txt to devops-actions.txt
|
||||
/devops-actions.txt 100% 155 0.2KB/s 00:00
|
||||
sftp>
|
||||
sftp> cd /etc
|
||||
Couldn't stat remote file: No such file or directory
|
||||
sftp> cd /root
|
||||
Couldn't stat remote file: No such file or directory
|
||||
sftp>
|
||||
```
|
||||
|
||||
Above output confirms that we are able to download file from our sftp server to local machine and apart from this we have also tested that users cannot change directories.
|
||||
|
||||
Let’s try to upload a file under “**upload**” folder,
|
||||
|
||||
```
|
||||
sftp> cd upload/
|
||||
sftp> put metricbeat-7.3.1-amd64.deb
|
||||
Uploading metricbeat-7.3.1-amd64.deb to /upload/metricbeat-7.3.1-amd64.deb
|
||||
metricbeat-7.3.1-amd64.deb 100% 38MB 38.4MB/s 00:01
|
||||
sftp> ls -l
|
||||
-rw-r--r-- 1 1001 1002 40275654 Sep 14 09:18 metricbeat-7.3.1-amd64.deb
|
||||
sftp>
|
||||
```
|
||||
|
||||
This confirms that we have successfully uploaded a file from our local system to sftp server.
|
||||
|
||||
Now test the SFTP server with winscp tool, enter the sftp server ip address along user’s credentials,
|
||||
|
||||
[![Winscp-sftp-debian10][1]][3]
|
||||
|
||||
Click on Login and then try to download and upload files
|
||||
|
||||
[![Download-file-winscp-debian10-sftp][1]][4]
|
||||
|
||||
Now try to upload files in upload folder,
|
||||
|
||||
[![Upload-File-using-winscp-Debian10-sftp][1]][5]
|
||||
|
||||
Above window confirms that uploading is also working fine, that’s all from this article. If these steps help you to configure SFTP server with chroot environment in Debian 10 then please do share your feedback and comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxtechi.com/configure-sftp-chroot-debian10/
|
||||
|
||||
作者:[Pradeep Kumar][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.linuxtechi.com/author/pradeep/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
||||
[2]: https://www.linuxtechi.com/wp-content/uploads/2019/09/Configure-sftp-debian10.jpg
|
||||
[3]: https://www.linuxtechi.com/wp-content/uploads/2019/09/Winscp-sftp-debian10.jpg
|
||||
[4]: https://www.linuxtechi.com/wp-content/uploads/2019/09/Download-file-winscp-debian10-sftp.jpg
|
||||
[5]: https://www.linuxtechi.com/wp-content/uploads/2019/09/Upload-File-using-winscp-Debian10-sftp.jpg
|
@ -1,108 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Create Stunning Pixel Art With Free and Open Source Editor Pixelorama)
|
||||
[#]: via: (https://itsfoss.com/pixelorama/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
Create Stunning Pixel Art With Free and Open Source Editor Pixelorama
|
||||
======
|
||||
|
||||
_**Brief: Pixelorama is a cross-platform, free and open source 2D sprite editor. It provides all the necessary tools to create pixel art in a neat user interface.**_
|
||||
|
||||
### Pixelorama: open source sprite editor
|
||||
|
||||
[Pixelorama][1] is a tool created by young game developers at [Orama Interactive][2]. They have developed a few 2D games and a couple of them use pixel art.
|
||||
|
||||
While Orama is primarily into game development, the developers are also creating utility tools that help them (and others) create those games.
|
||||
|
||||
The free and open source sprite editor, Pixelorama is such a utility tool. It’s built on top of [Godot Engine][3] and is perfect for creating pixel art.
|
||||
|
||||
![Pixelorama screenshot][4]
|
||||
|
||||
You see the pixel art in the screenshot above? It’s been created using Pixelorama. This video shows a timelapse video of creating the above image.
|
||||
|
||||
### Features of Pixelorama
|
||||
|
||||
Here are the main features Pixelorama provides:
|
||||
|
||||
* Multiple tools like penicl, erase, fill bucket color picker etc
|
||||
* Multiple layer system that allows you to add, remove, move up and down, clone and merge as many layers as you like
|
||||
* Support for spritesheets
|
||||
* Import images and edit them inside Pixelorama
|
||||
* Animation timeline with [Onion Skinning][5]
|
||||
* Custom brushes
|
||||
* Save and open your projects in Pixelorama’s custom file format, .pxo
|
||||
* Horizontal & vertical mirrored drawing
|
||||
* Tile Mode for pattern creation
|
||||
* Split screen mode and mini canvas preview
|
||||
* Zoom with mouse scroll wheel
|
||||
* Unlimited undo and redo
|
||||
* Scale, crop, flip, rotate, color invert and desaturate your images
|
||||
* Keyboard shortcuts
|
||||
* Available in several languages
|
||||
* Supports Linux, Windows and macOS
|
||||
|
||||
|
||||
|
||||
### Installing Pixelorama on Linux
|
||||
|
||||
Pixelorama is available as a Snap application and if you are using Ubuntu, you can find it in the software center itself.
|
||||
|
||||
![Pixelorama is available in Ubuntu Software Center][6]
|
||||
|
||||
Alternatively, if you have [Snap support enabled on your Linux distribution][7], you can install it using this command:
|
||||
|
||||
```
|
||||
sudo snap install pixelorama
|
||||
```
|
||||
|
||||
If you don’t want to use Snap, no worries. You can download the latest release of Pixelorama from [their GitHub repository][8], [extract the zip file][9] and you’ll see an executable file. Give this file execute permission and double click on it to run the application.
|
||||
|
||||
[Download Pixelorama][10]
|
||||
|
||||
**Conclusion**
|
||||
|
||||
![Pixelorama Welcome Screen][11]
|
||||
|
||||
In the Pixeloaram features, it says that you can import images and edit them. I guess that’s only true for certain kind of files because when I tried to import PNG or JPEG files, the application crashed.
|
||||
|
||||
However, I could easily doodle like a 3 year old and make random pixel art. I am not that into arts but I think this is a [useful tool for digital artists on Linux][12].
|
||||
|
||||
I liked the idea that despite being game developers, they are creating tools that could help other game developers and artists. That’s the spirit of open source.
|
||||
|
||||
If you like the project and will be using it, consider supporting them by a donation. [It’s FOSS has made a humble donation][13] of $25 to thank their effort.
|
||||
|
||||
[Donate to Pixelorama (personal Paypal account of the lead developer)][14]
|
||||
|
||||
Do you like Pixelorama? Do you use some other open source sprite editor? Feel free to share your views in the comment section.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/pixelorama/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.orama-interactive.com/pixelorama
|
||||
[2]: https://www.orama-interactive.com/
|
||||
[3]: https://godotengine.org/
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/pixelorama-v6.jpg?ssl=1
|
||||
[5]: https://en.wikipedia.org/wiki/Onion_skinning
|
||||
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/pixelorama-ubuntu-software-center.jpg?ssl=1
|
||||
[7]: https://itsfoss.com/install-snap-linux/
|
||||
[8]: https://github.com/Orama-Interactive/Pixelorama
|
||||
[9]: https://itsfoss.com/unzip-linux/
|
||||
[10]: https://github.com/Orama-Interactive/Pixelorama/releases
|
||||
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/pixelorama.jpg?ssl=1
|
||||
[12]: https://itsfoss.com/best-linux-graphic-design-software/
|
||||
[13]: https://itsfoss.com/donations-foss/
|
||||
[14]: https://www.paypal.me/erevos
|
@ -1,98 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Rambox is an All-in-one Messenger for Linux)
|
||||
[#]: via: (https://itsfoss.com/rambox/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Rambox is an All-in-one Messenger for Linux
|
||||
======
|
||||
|
||||
_**Brief: Rambox is an all-in-one messenger that lets you combine multiple services like Discord, Slack, Facebook Messenger and hundreds of more such services in one place.**_
|
||||
|
||||
### Rambox: Add multiple messaging Services in a single app
|
||||
|
||||
![][1]
|
||||
|
||||
Rambox is one of the best ways to manage multiple services for communication through a single app installed. You can use [multiple messaging services][2] like Facebook Messenger, Gmail chats, AOL, Discord, Google Duo, [Viber][3] and a lot more from the same interface.
|
||||
|
||||
This way, you don’t need to install individual apps or keep them opened in browser all the time. You can use a master password to lock the Rambox application. You can also use do not disturb feature.
|
||||
|
||||
Rambox offers an [open source community edition][4] which is free to use. The paid pro version gives you access to 600+ apps while the community addition has 99+ apps. Pro version has additional features like themes, hibernation, ad-block, spell check and premium support.
|
||||
|
||||
Don’t worry. The open source community edition itself is quite useful and you may not even need those pro features.
|
||||
|
||||
### Features of Rambox
|
||||
|
||||
![][5]
|
||||
|
||||
While you should find most of the essential features in the open-source edition, you might notice some of them limited to the pro version.
|
||||
|
||||
Here, I’ve mentioned all the essential features available:
|
||||
|
||||
* You get about 100 apps/services to choose from in the open-source edition
|
||||
* Ability to protect the app with a single Master password lock
|
||||
* Ability to lock each session that you load up
|
||||
* Do Not Disturb mode
|
||||
* Ability to sync apps and configuration across multiple devices.
|
||||
* You can create and add custom apps
|
||||
* Support for keyboard shortcuts
|
||||
* Ability to enable/disable apps without needing to delete them
|
||||
* JS & CSS injection support to tweak the styling of apps
|
||||
* Ad-block (**pro version**)
|
||||
* Hibernation support (**pro version**)
|
||||
* Theme support (**pro version**)
|
||||
* Mobile view **(pro version)**
|
||||
* Spell check **(pro version)**
|
||||
* Work hours – to schedule a time for incoming notifications **(pro version)**
|
||||
* Proxies support **(pro version)**
|
||||
|
||||
|
||||
|
||||
In addition to what I’ve listed here, you might find some more features in the Rambox Pro edition. To know more about it, you can refer to the [official list of features][6].
|
||||
|
||||
It is also worth noting that you cannot have more than 3 active simultaneous device connections.
|
||||
|
||||
### Installing Rambox on Linux
|
||||
|
||||
You can easily get started using Rambox using the **.AppImage** file available on the [official download page][4]. If you’re curious, you can refer our guide on how to [use the AppImage file on Linux][7].
|
||||
|
||||
In either case, you can also get it from the [Snap store][8]. Also, feel free to check their [GitHub releases section][9] for **.deb / .rpm** or other packages.
|
||||
|
||||
[Download Rambox Community Edition][4]
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
It can be a little overwhelming to have a lot of apps installed using Rambox. So, I’d suggest you monitor the RAM usage when adding more apps and using them for work.
|
||||
|
||||
There is also a similar app called [Franz][10] which is also part open source and part premium like Rambox.
|
||||
|
||||
Even though solutions like Rambox or Franz are quite useful, they aren’t always resource-friendly, specially if you start using tens of services at the same time. So, keep an eye on your system resources (if you notice a performance impact).
|
||||
|
||||
Otherwise, it’s an impressive app that does the work that you’d expect. Have you tried it out? Feel free to let me know your thoughts!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/rambox/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/rambox-ce.jpg?ssl=1
|
||||
[2]: https://itsfoss.com/best-messaging-apps-linux/
|
||||
[3]: https://itsfoss.com/viber-linux-client-beta-install/
|
||||
[4]: https://rambox.pro/#ce
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/rambox-preferences.png?ssl=1
|
||||
[6]: https://rambox.pro/#features
|
||||
[7]: https://itsfoss.com/use-appimage-linux/
|
||||
[8]: https://snapcraft.io/rambox
|
||||
[9]: https://github.com/ramboxapp/community-edition/releases
|
||||
[10]: https://itsfoss.com/franz-messaging-app/
|
@ -1,94 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (tinyeyeser )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to avoid man-in-the-middle cyber attacks)
|
||||
[#]: via: (https://opensource.com/article/20/4/mitm-attacks)
|
||||
[#]: author: (Jackie Lam https://opensource.com/users/beenverified)
|
||||
|
||||
How to avoid man-in-the-middle cyber attacks
|
||||
======
|
||||
Understanding MITM attacks is the first step in not being a victim of
|
||||
this high-tech style of eavesdropping.
|
||||
![Security monster][1]
|
||||
|
||||
Whether you're sending data on your computer or talking to someone online, you want to assume some level of security and privacy.
|
||||
|
||||
But what if a third party is eavesdropping online, unbeknownst to you? And worse, what if they're impersonating someone from a business you trust in order to gain damaging information? This could put your personal data into the hands of dangerous, would-be thieves.
|
||||
|
||||
Welcome to what's called a man-in-the-middle (MITM) attack.
|
||||
|
||||
### What are man-in-the-middle attacks?
|
||||
|
||||
A man-in-the-middle attack occurs when a cybercriminal inserts themselves into communications between you, the targeted victim, and a device in order to steal sensitive information that can be used for a variety of criminal purposes—most notably identity theft, says Steve J. J. Weisman, founder of Scamicide.
|
||||
|
||||
"A man-in-the-middle-attack can also occur when the victim believes he or she is communicating with a legitimate app or website," says Weisman, "when the truth is that the victim is communicating with a phony website or app and thereby providing sensitive information to the criminal."
|
||||
|
||||
One of the oldest forms of cyberattacks, MITM attacks have been around since the 1980s. What's more, they're quite common. As Weisman explains, there are a handful of ways a MITM attack can happen:
|
||||
|
||||
* **Attacking a WiFi router that is not properly secured:** This typically occurs when someone is using public WiFi. "While home routers might be vulnerable, it's more common for criminals to attack public WiFi networks," says Weisman. The goal is to spy on unsuspecting people who are handling sensitive information, such as their online bank accounts, he adds.
|
||||
* **Hacking email accounts of banks, financial advisers, and other companies:** "Once [the criminals] have hacked these email systems, they send out emails that appear to come from the legitimate bank or other company," Weisman says. "[They ask] for personal information, such as usernames and passwords, under the guise of an emergency. The targeted victim is lured into providing that information."
|
||||
* **Sending phishing emails:** Thieves might also send emails pretending to be legitimate companies that the targeted victim does business with, asking the recipient for their personal information. "In many instances, the spear-phishing emails will direct the victim to a counterfeit website that appears to be that of a legitimate company with which the victim does business," says Weisman.
|
||||
* **Using malicious code in legitimate websites:** Attackers can also place malicious code—usually JavaScript—into a legitimate website by way of a web application. "When the victim loads the legitimate page, the malicious code just sits in the background until the user enters sensitive information, such as account login or credit card details, which the malicious code then copies and sends to the attackers' servers," says Nicholas McBride, a cybersecurity consultant.
|
||||
|
||||
|
||||
|
||||
### What is an example of an MITM attack?
|
||||
|
||||
The Lenovo case is a well-known example of an MITM attack. In 2014 and 2015, the major computer manufacturer sold consumer laptops with preinstalled software that meddled with how a user's browser communicated with websites. Whenever the user's cursor hovered over a product, this software, called VisualDiscovery, sent pop-up ads from retail partners that sold similar products.
|
||||
|
||||
Here's the kicker: This MITM attack allowed VisualDiscovery to access all of the user's personal data, including social security numbers, info about financial transactions, medical info, and logins and passwords. All without the user knowing or granting permission beforehand. The FTC deemed this a deceptive and unfair online scam. Lenovo agreed to pay $8.3 million in a class-action settlement in 2019.
|
||||
|
||||
### How can I protect myself from an online attack?
|
||||
|
||||
* **Avoid using public WiFi:** Weisman recommends never using public WiFi for financial transactions unless you've installed a reliable virtual private network (VPN) client on your device and have a VPN host you can use and trust. Over a VPN connection, your communications are encrypted, so your information can't be stolen.
|
||||
|
||||
* **Be on the lookout:** Be wary of emails or text messages that ask you to update your password or provide your username or personal information. These methods can be used to steal your identity.
|
||||
|
||||
If you are unsure of the actual identity of the party sending you the email, you can use tools such as a reverse phone or email search. With a reverse phone number lookup, you may be able to find out more about the identity of an unknown texter. And with a reverse email lookup, you can try to determine who might have sent you a message.
|
||||
|
||||
Generally, if something's actually a problem, you'll hear from someone you know and trust within your company, or from someone you can also go and meet, in person, at your bank or school or other organization. Important account information is never the purview of an unknown technician.
|
||||
|
||||
* **Don't click on links contained in emails:** If someone sends you an email telling you that you need to sign into an account, don't click on the link provided in the email. Instead, navigate to the site yourself, log in as you normally would, and look for an alert there. If you don't see an alert message in your account settings, contact a representative by phone using contact information on the site and _not_ from the email.
|
||||
|
||||
* **Install reliable security software:** If you're on Windows, install good open source antivirus like [ClamAV][2]. On all platforms, keep your software up to date with the latest security patches.
|
||||
|
||||
* **Take alerts seriously:** If you're visiting a site that starts with HTTPS, your browser might alert you to an issue, says McBride. For instance, if the domain name on the site's certificate doesn't match the one you're trying to visit. Don't ignore the alert. Heed it and navigate away from the site for now. Verify that you haven't [mistyped it][3], and if the problem persists, contact the site owner if you can.
|
||||
|
||||
* **Use an ad blocker:** Pop-up ads (also known as _adware attacks_) can be used to intercept your personal information, so use an ad blocker. "The truth is, as an individual user, it's hard to protect against a MITM attack," says McBride, "as it is designed to leave the victim in the dark and to prevent them from noticing that there is anything wrong."
|
||||
|
||||
A good open source ad blocker (or "wide-spectrum blocker," in the developer's words) is [uBlock origin][4]. It's available for both Firefox and Chromium (and all Chromium-based browsers, such as Chrome, Brave, Vivaldi, Edge, and so on), and even Safari.
|
||||
|
||||
|
||||
|
||||
|
||||
### Stay alert
|
||||
|
||||
Remember, you don't have to click anything online right away, and you don't have to follow random people's instructions, no matter how urgent they may seem. The internet will still be there after you step away from the computer and verify the identity of a person or site demanding your attention.
|
||||
|
||||
While MITM attacks can happen to anyone, understanding what they are, knowing how they happen, and actively taking steps to prevent them can safeguard you from being a victim.
|
||||
|
||||
* * *
|
||||
|
||||
_This article was originally published on [BeenVerified.com][5] under a [CC BY-SA 2.0][6] license._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/4/mitm-attacks
|
||||
|
||||
作者:[Jackie Lam][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/beenverified
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security_password_chaos_engineer_monster.png?itok=J31aRccu (Security monster)
|
||||
[2]: https://www.clamav.net
|
||||
[3]: https://opensource.com/article/20/1/stop-typosquatting-attacks
|
||||
[4]: https://github.com/gorhill/uBlock
|
||||
[5]: https://www.beenverified.com/crime/what-is-a-man-in-the-middle-attack/
|
||||
[6]: https://creativecommons.org/licenses/by-sa/2.0/
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user