mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-01 21:50:13 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
101db69839
@ -1,64 +1,58 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (silentdawn-zz)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12463-1.html)
|
||||
[#]: subject: (Program IoT systems using Python with this VSCode plugin for RTOS)
|
||||
[#]: via: (https://opensource.com/article/20/7/python-rt-thread)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
使用 VSCode RTOS 插件为物联网系统编写 Python 程序
|
||||
通过 VSCode RTOS 插件使用 Python 为物联网系统编写程序
|
||||
======
|
||||
RTOS 之类的实时嵌入式操作系统使嵌入式系统的编程更简单
|
||||
|
||||
![Parts, modules, containers for software][1]
|
||||
> RTOS 之类的实时嵌入式操作系统使嵌入式系统的编程更简单
|
||||
|
||||
物联网( IoT )无处不在,它意味着几乎所有的产品,从冰箱到口袋手表,都可以连网。为了实现这个目标,每个产品都需要拥有一个嵌入式计算机来运行网络栈,有些产品几乎是小的不可思议。这就是嵌入式软件出现的场景:现代科技打造的非常小的计算机,硬编码到硬件芯片,不需要任何板外处理器、内存或者存储盘。
|
||||
![](https://img.linux.net.cn/data/attachment/album/202007/29/001132c37u7u5qp284wef2.jpg)
|
||||
|
||||
物联网(IoT)无处不在,它意味着几乎所有的产品,从冰箱到口袋手表,都可以连网。为了实现这个目标,每个产品都需要拥有一个嵌入式计算机来运行网络栈,有些产品几乎是小的不可思议。这就是嵌入式软件出现的场景:现代科技打造的非常小的计算机,硬编码到硬件芯片,不需要任何板外处理器、内存或者存储盘。
|
||||
|
||||
就传统视角而言,这种场景意味着没有操作系统可用,但是因为种种 [原因][2],开发者发现,类似于 RTOS 之类的实时嵌入式操作系统能让嵌入式系统的编程变得非常简单。
|
||||
|
||||
虽然RT-Thread 嵌入式操作系统致力于鼓励程序员新手进入物联网领域,但并非所有的人都具备使用 C 语言硬编码微芯片的能力。幸运的是,MicroPython 通过让开发者创建运行于嵌入式系统的 Python 代码的方式,逐渐填补了这个鸿沟。为了让整个过程更简单,RT-Thread 有一个可以用于 VSCode 和 [VSCodium][4] 的插件,为开发者提供了物联网方面的开发环境。其部分特性包括:
|
||||
虽然 RT-Thread 嵌入式操作系统致力于鼓励程序员新手进入物联网领域,但并非所有的人都具备使用 C 语言硬编码微芯片的能力。幸运的是,MicroPython 通过让开发者创建运行于嵌入式系统的 Python 代码的方式,逐渐填补了这个鸿沟。为了让整个过程更简单,RT-Thread 有一个可以用于 VSCode 和 [VSCodium][4] 的插件,为开发者提供了物联网方面的开发环境。其部分特性包括:
|
||||
|
||||
* 方便的连接方式,可以很容易的通过串口、网络或者 USB 连接到开发板(如果你使用过 Arduino,肯定会很熟悉这个流程)。
|
||||
* 支持上传文件或目录到开发板。
|
||||
* 支持基于 MicroPython 的代码,而且具有智能的代码补充、语法检查功能。
|
||||
* 支持基于 MicroPython 的代码,而且具有智能的代码补完、语法检查功能。
|
||||
* 支持 MicroPython REPL 交互式环境。
|
||||
* 丰富的示例代码和演示程序。
|
||||
* 完整的工程同步功能。
|
||||
* 快速运行内存中的程序代码。
|
||||
* 函数运行的代码片段。
|
||||
* 运行函数的代码片段。
|
||||
* 支持主流的 MicroPython 开发板。
|
||||
* 支持 Linux 和 Windows 操作系统,并经过充分测试。
|
||||
|
||||
|
||||
|
||||
### 准备
|
||||
|
||||
在开始之前,如果你使用的是 Windows 操作系统,那么必须保证 VSCode 的默认终端是 [PowerShell][5]。运行 VSCodium,从 **Terminal** 菜单项启动一个终端. 在显示在 VSCodium 窗口底部的终端界面,从下拉菜单顶端选择 **PowerShell**。
|
||||
在开始之前,如果你使用的是 Windows 操作系统,那么必须保证 VSCode 的默认终端是 [PowerShell][5]。运行 VSCodium,从 “Terminal” 菜单项启动一个终端. 在显示在 VSCodium 窗口底部的终端界面,从下拉菜单顶端选择 “PowerShell”。
|
||||
不论你是在 [Windows][6] 还是 Linux 系统下工作,必须保证安装了 Python 3(在 Linux 上,它可能已经安装了,否则可以通过软件库安装它)。
|
||||
|
||||
还要安装的是微软提供的 VSCode Python插件。安装方法是点击 **File** 菜单,找到 **Preferences** 子菜单,从中打开 **Extensions** 面板。在 **Extensions** 中,搜索 Python,找到来自微软的 Python 插件。
|
||||
还要安装的是微软提供的通用 VSCode Python 插件。安装方法是点击 “File” 菜单,找到 “Preferences” 子菜单,从中打开 “Extensions” 面板。在扩展中,搜索 “Python”,找到来自微软的 Python 插件。
|
||||
|
||||
![VSCodium Python plugin][7]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
当软,在上述操作之前,你要先正确安装 [VSCodium][9] 或 [VSCode][10]。
|
||||
当然,在上述操作之前,你要先正确安装 [VSCodium][9] 或 [VSCode][10]。
|
||||
|
||||
### 安装插件
|
||||
|
||||
安装 MicroPython 开发插件的方法与安装 Python 插件一样,点击 **File** 菜单,找到 **Preferences** 子菜单,选择 **Extensions**。
|
||||
安装 MicroPython 开发插件的方法与安装 Python 插件一样,点击 “File” 菜单,找到 “Preferences” 子菜单,选择 “Extensions”。
|
||||
|
||||
在 **Extensions** 中,搜索 **MicroPython**,安装 RT-Thread 插件。
|
||||
在扩展中,搜索 “MicroPython”,安装 RT-Thread 插件。
|
||||
|
||||
![MicroPython plugin for RT-Thread][11]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
### 使用插件
|
||||
|
||||
你的开发板必须能访问串口,这需要组策略的允许。你可能需要将自己的账户加入该组,通常在默认情况下你的账户可能并不在该组。首先,确认你的账户不在 “dialout”组:
|
||||
|
||||
你的开发板必须能访问串口,这需要组策略的允许。你可能需要将自己的账户加入该组,通常在默认情况下你的账户可能并不在该组。首先,确认你的账户不在 “dialout” 组:
|
||||
|
||||
```
|
||||
$ groups
|
||||
@ -72,67 +66,59 @@ tux users
|
||||
$ sudo usermod --append --groups dialout tux
|
||||
```
|
||||
|
||||
Log out or reboot to load your new group permissions.
|
||||
退出登录或重启以载入你新的组权限。
|
||||
|
||||
### 创建 MicroPython 工程
|
||||
|
||||
MicroPython 开发的第一步是创建 MicroPython 工程用来编写和运行代码。使用 MicroPython 插件创建工程的方法是,点击左下方的 **Create MicroPython project** 按钮。
|
||||
MicroPython 开发的第一步是创建 MicroPython 工程用来编写和运行代码。使用 MicroPython 插件创建工程的方法是,点击左下方的 “Create MicroPython project” 按钮。
|
||||
|
||||
![Create MicroPython project][12]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
之后会有一些提示,让你选择创建空白工程还是包含例程的工程。
|
||||
|
||||
### 连接到开发板
|
||||
|
||||
点击 VSCodium 左下方的 **Connection** 按钮,进行 VSCodium 与开发板的连接,在弹出的列表中,选择要连接的物理设备。
|
||||
点击 VSCodium 左下方的 “Connection” 按钮,进行 VSCodium 与开发板的连接,在弹出的列表中,选择要连接的物理设备。
|
||||
|
||||
### 查看例程
|
||||
|
||||
MicroPython 插件提供了许多例程和例库,供学习和调用。获取例程的过程是,激活 MicroPython 之后,VSCodium 左侧按钮条会出现“新建”快捷图标,点击该图标就可以了。点击 **Document** 快捷图标,会显示例程文件列表,点击 **Folder** 快捷图标,会显示例库列表。
|
||||
MicroPython 插件提供了许多例程和例库,供学习和调用。获取例程的过程是,激活 MicroPython 之后,VSCodium 左侧按钮条会出现“新建”快捷图标,点击该图标就可以了。点击“文档”快捷图标,会显示例程文件列表;点击“文件夹”快捷图标,会显示例库列表。
|
||||
|
||||
![MicroPython examples][13]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
### 直接在开发板上运行 MicroPython 文件
|
||||
|
||||
在 VSCodium 中可以通过在开发板上运行单个程序文件,很方便快捷的进行程序调试。快捷键 **Alt**+**Q** 会触发一个特定的插件,该插件会将当前的 Python 文件上传到开发板内存中。你还可以在当前 Python 文档界面点击右键,然后选择 **Run the MicroPython file directly on the device** 实现同样的功能。
|
||||
在 VSCodium 中可以通过在开发板上运行单个程序文件,很方便快捷的进行程序调试。快捷键 `Alt+Q` 会触发一个特定的插件,该插件会将当前的 Python 文件上传到开发板内存中。你还可以在当前 Python 文档界面点击右键,然后选择 “Run the MicroPython file directly on the device” 实现同样的功能。
|
||||
|
||||
![Running code on your device][14]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
如果你需要以不上传代码的方式检查一组代码,可以使用“代码片段”功能。要运行 MicroPython REPL 环境中的代码片段,在编辑器中选中要运行的片段,右键菜单中点击 **Execute the selected MicroPython code on the device** (也可以使用 **Alt**+**Q** 快捷键)。
|
||||
如果你需要以不上传代码的方式检查一组代码,可以使用“代码片段”功能。要运行 MicroPython REPL 环境中的代码片段,在编辑器中选中要运行的片段,右键菜单中点击 “Execute the selected MicroPython code on the device” (也可以使用 `Alt+Q` 快捷键)。
|
||||
|
||||
### 加载文件和目录到开发板
|
||||
|
||||
如果需要加载文件或目录到开发板,有现成的方法可用:选中工程中要加载到开发板的文件或目录,在选中的对象上右键,点击右键菜单中的 **Download the file/folder to the device**。
|
||||
如果需要加载文件或目录到开发板,有现成的方法可用:选中工程中要加载到开发板的文件或目录,在选中的对象上右键,点击右键菜单中的 “Download the file/folder to the device”。
|
||||
|
||||
注意,如果开发板中已有与要加载的文件或目录同名者,加载操作将导致开发板原有的内容被覆盖。
|
||||
|
||||
在 REPL 环境中运行“os.listdir()”命令,可以检查文件和目录是否成功加载。当然,也可以通过相应的命令删除 REPL 中的文件或目录。
|
||||
在 REPL 环境中运行 `os.listdir()` 命令,可以检查文件和目录是否成功加载。当然,也可以通过相应的命令删除 REPL 中的文件或目录。
|
||||
|
||||
删除文件的命令如下:
|
||||
|
||||
|
||||
```
|
||||
os.remove('file_to_delete')
|
||||
```
|
||||
|
||||
删除目录的命令如下:
|
||||
|
||||
|
||||
```
|
||||
os.rmdir('folder_to_delete')
|
||||
```
|
||||
|
||||
### 工程的同步
|
||||
|
||||
点击左下角 **Synchronization** 按钮可以启动工程同步,该操作将把本地工程中所有的文件和目录同步到开发板的文件系统。建议在完成程序调试之后进行该操作,调试过程中不需要频繁进行同步操作。
|
||||
点击左下角“同步”按钮可以启动工程同步,该操作将把本地工程中所有的文件和目录同步到开发板的文件系统。建议在完成程序调试之后进行该操作,调试过程中不需要频繁进行同步操作。
|
||||
|
||||
工程的同步操作完成后,开发板上的文件列表可以在 **Device Files List** 列看到。
|
||||
工程的同步操作完成后,开发板上的文件列表可以在 “Device Files List” 列看到。
|
||||
|
||||
### 放手尝试
|
||||
|
||||
@ -144,8 +130,8 @@ via: https://opensource.com/article/20/7/python-rt-thread
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[silentdawn-zz](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[silentdawn-zz](https://github.com/silentdawn-zz)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,73 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (What you need to know about Rust in 2020)
|
||||
[#]: via: (https://opensource.com/article/20/1/rust-resources)
|
||||
[#]: author: (Ryan Levick https://opensource.com/users/ryanlevick)
|
||||
|
||||
What you need to know about Rust in 2020
|
||||
======
|
||||
While many programmers have long used Rust for hobby projects, in 2019,
|
||||
the language attracted support from major technology companies, as the
|
||||
top Rust articles on Opensource.com explain.
|
||||
![Person using a laptop][1]
|
||||
|
||||
[Rust][2] has drawn plenty of attention from programmers on sites like Hacker News for a while. While many have long [loved using the language][3] for hobby projects, it didn't start catching on in industry until 2019, when this really started to change.
|
||||
|
||||
Over the last year, many large companies, including [Microsoft][4], [Facebook][5], and [Intel][6], came out in support of Rust, and many [smaller ones][7] took notice. As the first emcee at [RustFest][8], the largest Rust conference in Europe, in 2016, I didn't meet a single person professionally using Rust who didn't work at Mozilla. Three years later, it seemed like every other person I talked to at RustFest 2019 was using Rust in their day job for another company, whether as a game developer, a backend engineer at a bank, a creator of developer tools, or something else.
|
||||
|
||||
In 2019, Opensource.com also played a role by reporting on the growing interest in Rust. In case you missed them, here are the top articles about Rust on Opensource.com over the last year.
|
||||
|
||||
### Building the virtualization stack of the future with rust-vmm
|
||||
|
||||
Amazon's [Firecracker][9] is the virtualization technology that powers AWS Lambda and Fargate, and it is written completely in Rust. One of the technology's authors, Andreea Florescu, offers insight into Firecracker and its related technologies in [_**Building the virtualization stack of the future with rust-vmm**_][10].
|
||||
|
||||
Firecracker started life as a fork of Google's [CrosVM][11] but quickly diverged due to the differing needs of the two projects. Despite this, there are many common pieces that are best shared across the project and in any other virtual machine manager (VMM) written in Rust. With that in mind, the [rust-vmm][12] project started as a way for Amazon and Google, as well as Intel and Red Hat, to share common Rust "crates" (i.e., packages) with each other and the rest of the open source community. These include interfaces to KVM (Linux virtualization APIs), Virtio device support, and a kernel loader.
|
||||
|
||||
It's truly amazing to see some of the titans of the software industry working together around a common technology stack written in Rust. Given this and other partnerships around [technology stacks written in Rust][13], I wouldn't be surprised to see more of this in 2020.
|
||||
|
||||
### Why to choose Rust as your next programming language
|
||||
|
||||
Adopting a new language, especially at a large company with a long-established technology stack, is no easy task. I had the pleasure of writing [_**Why to choose Rust as your next programming language**_][14] about how Microsoft is looking into adopting Rust when so many other interesting programming languages have not been considered.
|
||||
|
||||
Choosing a programming language involves many different criteria—from technical to organizational to even emotional. Some of these criteria are easier to measure than others. For instance, it's easier to understand the costs of technical changes, like adapting build systems and building new tooling, than it is to understand organizational or emotional issues like how productive or happy developers will be using this new language. What's more, the easy-to-measure criteria are often cost-related, while the hard-to-measure criteria are often benefits-oriented. This often leads to costs getting more weight in the decision-making process, even though it's not necessarily true that the costs outweigh the benefits—it's just that they're easier to measure. This makes it unlikely for a company to adopt a new language.
|
||||
|
||||
However, one of Rust's largest benefits is how easy it is to measure its ability to write secure yet performant systems software. Given that 70% of severe vulnerabilities at Microsoft are due to memory-safety issues that Rust is designed to prevent, and that these issues cost the company billions of dollars per year, it's easy to measure and understand the benefits of adopting the language.
|
||||
|
||||
Whether full-scale adoption of Rust at Microsoft will happen remains to be seen, but Rust's future is bright if only for the fact that is has a clear and measurable benefit over existing technologies.
|
||||
|
||||
### Rust in 2020
|
||||
|
||||
Rust is really starting to gain traction in industry. Although it still has a long way to go to reach the popularity of languages like C++. I expect more companies to start adopting Rust in 2020. The Rust community must now set its sights on welcoming people and companies into the community while ensuring that the things that have driven the language to this point remain in place.
|
||||
|
||||
Rust is more than just a compiler and a set of libraries. It's a group of people who care about making systems programming easy, safe, and fun. The coming year will be critical in Rust's journey from a hobbyist language to one of the main languages used in the software industry.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/1/rust-resources
|
||||
|
||||
作者:[Ryan Levick][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/ryanlevick
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop)
|
||||
[2]: http://rust-lang.org/
|
||||
[3]: https://insights.stackoverflow.com/survey/2019#technology-_-most-loved-dreaded-and-wanted-languages
|
||||
[4]: https://youtu.be/o01QmYVluSw
|
||||
[5]: https://youtu.be/kylqq8pEgRs
|
||||
[6]: https://youtu.be/l9hM0h6IQDo
|
||||
[7]: https://oxide.computer/blog/introducing-the-oxide-computer-company/
|
||||
[8]: https://rustfest.eu
|
||||
[9]: https://firecracker-microvm.github.io/
|
||||
[10]: https://opensource.com/article/19/3/rust-virtual-machine
|
||||
[11]: https://chromium.googlesource.com/chromiumos/platform/crosvm/
|
||||
[12]: https://github.com/rust-vmm
|
||||
[13]: https://bytecodealliance.org/
|
||||
[14]: https://opensource.com/article/19/10/choose-rust-programming-language
|
@ -0,0 +1,62 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Switch turns to Tesla for renewable energy storage)
|
||||
[#]: via: (https://www.networkworld.com/article/3568358/switch-turns-to-tesla-for-renewable-energy-storage.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
Switch turns to Tesla for renewable energy storage
|
||||
======
|
||||
Switch will power its massive data centers with solar energy and use Tesla Megapacks for large-scale energy storage.
|
||||
ipopba / Getty Images
|
||||
|
||||
Data center provider [Switch][1] has selected Tesla as the battery supplier for a massive solar project at its northern Nevada data center facilities.
|
||||
|
||||
It's a geographically easy alliance as Switch's campus is right near Tesla's [Gigafactory Nevada][2] manufacturing facility. While best known for its cars, Tesla has also made quite an entry in the battery space with products such as the Powerwall, Powerpack, and Megapack energy storage products.
|
||||
|
||||
Switch recently broke ground on Gigawatt 1, a huge project that will use solar panels from First Solar to generate a total of 555 megawatts (MWs) of power at three locations and Tesla Megapacks to store the energy.
|
||||
|
||||
**READ MORE:** [Data-center power consumption holds steady][3]
|
||||
|
||||
Data centers are frequently built close to renewable sources of energy, usually hydropower. That's why many Amazon, Google, Facebook and Microsoft data centers are sitting by rivers. Solar is the easiest form of power to collect, but it's also the most fickle. Solar-powered sites are at the mercy of darkness and cloudy days, and users don't care if it's overcast out.
|
||||
|
||||
Adam Kramer, executive vice president of strategy at Switch, says peak solar production is around 1 p.m. when the sun is overhead, but overall peak consumer demand is around 5 p.m. to 6 p.m., when the sun is either setting or has set, depending on the time of year.
|
||||
|
||||
In running a [data center][4], there are no peak hours. "The Internet is 24/7. If they aren't using it in New York, they are using it in L.A. We have a very flat power profile. Our load looks the same at 2 a.m. as it does at 2 p.m.," Kramer told me. **
|
||||
**
|
||||
|
||||
With solar, and especially in Nevada, Switch had "an overabundance of solar generation but nowhere to store it. During the day we generate max power but [have] no need to use it."
|
||||
|
||||
Advances in Tesla battery storage are a key piece of the puzzle. Switch has been running on 100% solar power since 2016 but couldn't store it because "the technology just wasn't there for it," Kramer says.
|
||||
|
||||
Enter Tesla's Megapack. The Megapack is a beefed-up version of the Tesla PowerWall used for individual homes to store solar power and the PowerPack technology Tesla uses in its electric vehicles. Each Megapack can hold up to three megawatt hours (MWhs) of storage and 1.5 MW of inverter capacity.
|
||||
|
||||
So with enough Megapacks, sunlight energy captured at 1 p.m. can be powering the data center at 1 a.m.
|
||||
|
||||
Kramer says this benefits not only Switch but also its customers. "We are able to lock in extremely competitive pricing for switching our clients for the long-term and not be subject to market volatility. When we're able to reduce our cost, it provides cost savings for all our clients," he says.
|
||||
|
||||
So if Switch can power its massive data centers with solar energy even when the sun does not shine, why can't you?
|
||||
|
||||
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/3568358/switch-turns-to-tesla-for-renewable-energy-storage.html
|
||||
|
||||
作者:[Andy Patrizio][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/Andy-Patrizio/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.switch.com/
|
||||
[2]: https://www.tesla.com/gigafactory
|
||||
[3]: https://www.networkworld.com/article/3531316/data-center-power-consumption-holds-steady.html
|
||||
[4]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html
|
||||
[5]: https://www.facebook.com/NetworkWorld/
|
||||
[6]: https://www.linkedin.com/company/network-world
|
@ -1,175 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Use DNS over TLS)
|
||||
[#]: via: (https://fedoramagazine.org/use-dns-over-tls/)
|
||||
[#]: author: (Thomas Bianchi https://fedoramagazine.org/author/thobianchi/)
|
||||
|
||||
Use DNS over TLS
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
The [Domain Name System (DNS)][2] that modern computers use to find resources on the internet was designed [35 years ago][3] without consideration for user privacy. It is exposed to security risks and attacks like [DNS Hijacking][4]. It also allows [ISPs][5] to intercept the queries.
|
||||
|
||||
Luckily, [DNS over TLS][6] and [DNSSEC][7] are available. DNS over TLS and DNSSEC allow safe and encrypted end-to-end tunnels to be created from a computer to its configured DNS servers. On Fedora, the steps to implement these technologies are easy and all the necessary tools are readily available.
|
||||
|
||||
This guide will demonstrate how to configure DNS over TLS on Fedora using systemd-resolved. Refer to the [documentation][8] for further information about the systemd-resolved service.
|
||||
|
||||
### Step 1 : Set-up systemd-resolved
|
||||
|
||||
Modify _/etc/systemd/resolved.conf_ so that it is similar to what is shown below. Be sure to enable DNS over TLS and to configure the IP addresses of the DNS servers you want to use.
|
||||
|
||||
```
|
||||
$ cat /etc/systemd/resolved.conf
|
||||
[Resolve]
|
||||
DNS=1.1.1.1 9.9.9.9
|
||||
DNSOverTLS=yes
|
||||
DNSSEC=yes
|
||||
FallbackDNS=8.8.8.8 1.0.0.1 8.8.4.4
|
||||
#Domains=~.
|
||||
#LLMNR=yes
|
||||
#MulticastDNS=yes
|
||||
#Cache=yes
|
||||
#DNSStubListener=yes
|
||||
#ReadEtcHosts=yes
|
||||
```
|
||||
|
||||
A quick note about the options:
|
||||
|
||||
* **DNS**: A space-separated list of IPv4 and IPv6 addresses to use as system DNS servers
|
||||
* **FallbackDNS**: A space-separated list of IPv4 and IPv6 addresses to use as the fallback DNS servers.
|
||||
* **Domains**: These domains are used as search suffixes when resolving single-label host names, _~._ stand for use the system DNS server defined with DNS= preferably for all domains.
|
||||
* **DNSOverTLS:** If true all connections to the server will be encrypted. Note that this mode requires a DNS server that supports DNS-over-TLS and has a valid certificate for it’s IP.
|
||||
|
||||
|
||||
|
||||
> _NOTE: The DNS servers listed in the above example are my personal choices. You should decide which DNS servers you want to use; being mindful of whom you are asking IPs for internet navigation_.
|
||||
|
||||
### Step 2 : Tell NetworkManager to push info to systemd-resolved
|
||||
|
||||
Create a file in _/etc/NetworkManager/conf.d_ named _10-dns-systemd-resolved.conf_.
|
||||
|
||||
```
|
||||
$ cat /etc/NetworkManager/conf.d/10-dns-systemd-resolved.conf
|
||||
[main]
|
||||
dns=systemd-resolved
|
||||
```
|
||||
|
||||
The setting shown above (_dns=systemd-resolved_) will cause NetworkManager to push DNS information acquired from DHCP to the systemd-resolved service. This will override the DNS settings configured in _Step 1_. This is fine on a trusted network, but feel free to set _dns=none_ instead to use the DNS servers configured in _/etc/systemd/resolved.conf_.
|
||||
|
||||
### Step 3 : start & restart services
|
||||
|
||||
To make the settings configured in the previous steps take effect, start and enable _systemd-resolved_. Then restart _NetworkManager_.
|
||||
|
||||
**CAUTION**: This will lead to a loss of connection for a few seconds while NetworkManager is restarting.
|
||||
|
||||
```
|
||||
$ sudo systemctl start systemd-resolved
|
||||
$ sudo systemctl enable systemd-resolved
|
||||
$ sudo systemctl restart NetworkManager
|
||||
```
|
||||
|
||||
> _NOTE: Currently, the systemd-resolved service is disabled by default and its use is opt-in. [There are plans][9] to enable systemd-resolved by default in Fedora 33._
|
||||
|
||||
### Step 4 : Check if everything is fine
|
||||
|
||||
Now you should be using DNS over TLS. Confirm this by checking DNS resolution status with:
|
||||
|
||||
```
|
||||
$ resolvectl status
|
||||
MulticastDNS setting: yes
|
||||
DNSOverTLS setting: yes
|
||||
DNSSEC setting: yes
|
||||
DNSSEC supported: yes
|
||||
Current DNS Server: 1.1.1.1
|
||||
DNS Servers: 1.1.1.1
|
||||
9.9.9.9
|
||||
Fallback DNS Servers: 8.8.8.8
|
||||
1.0.0.1
|
||||
8.8.4.4
|
||||
```
|
||||
|
||||
/etc/resolv.conf should point to 127.0.0.53
|
||||
|
||||
```
|
||||
$ cat /etc/resolv.conf
|
||||
# Generated by NetworkManager
|
||||
search lan
|
||||
nameserver 127.0.0.53
|
||||
```
|
||||
|
||||
To see the address and port that systemd-resolved is sending and receiving secure queries on, run:
|
||||
|
||||
```
|
||||
$ sudo ss -lntp | grep '\(State\|:53 \)'
|
||||
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
|
||||
LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=10410,fd=18))
|
||||
```
|
||||
|
||||
To make a secure query, run:
|
||||
|
||||
```
|
||||
$ resolvectl query fedoraproject.org
|
||||
fedoraproject.org: 8.43.85.67 -- link: wlp58s0
|
||||
8.43.85.73 -- link: wlp58s0
|
||||
|
||||
[..]
|
||||
|
||||
-- Information acquired via protocol DNS in 36.3ms.
|
||||
-- Data is authenticated: yes
|
||||
```
|
||||
|
||||
### BONUS Step 5 : Use Wireshark to verify the configuration
|
||||
|
||||
First, install and run [Wireshark][10]:
|
||||
|
||||
```
|
||||
$ sudo dnf install wireshark
|
||||
$ sudo wireshark
|
||||
```
|
||||
|
||||
It will ask you which link device it have to begin capturing packets on. In my case, because I use a wireless interface, I will go ahead with _wlp58s0_. Set up a filter in Wireshark like _tcp.port == 853_ (853 is the DNS over TLS protocol port). You need to flush the local DNS caches before you can capture a DNS query:
|
||||
|
||||
```
|
||||
$ sudo resolvectl flush-caches
|
||||
```
|
||||
|
||||
Now run:
|
||||
|
||||
```
|
||||
$ nslookup fedoramagazine.org
|
||||
```
|
||||
|
||||
You should see a TLS-encryped exchange between your computer and your configured DNS server:
|
||||
|
||||
![][11]
|
||||
|
||||
— _Poster in Cover Image Approved for Release by NSA on 04-17-2018, FOIA Case # 83661_ —
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/use-dns-over-tls/
|
||||
|
||||
作者:[Thomas Bianchi][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/thobianchi/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2020/06/use-dns-over-tls-816x345.jpg
|
||||
[2]: https://en.wikipedia.org/wiki/Domain_Name_System
|
||||
[3]: https://tools.ietf.org/html/rfc1035
|
||||
[4]: https://en.wikipedia.org/wiki/DNS_hijacking
|
||||
[5]: https://en.wikipedia.org/wiki/Internet_service_provider
|
||||
[6]: https://en.wikipedia.org/wiki/DNS_over_TLS
|
||||
[7]: https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions
|
||||
[8]: https://www.freedesktop.org/wiki/Software/systemd/resolved/
|
||||
[9]: https://fedoraproject.org/wiki/Changes/systemd-resolved
|
||||
[10]: https://www.wireshark.org/
|
||||
[11]: https://fedoramagazine.org/wp-content/uploads/2020/06/1-1024x651.png
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -0,0 +1,291 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to create a documentation site with Docsify and GitHub Pages)
|
||||
[#]: via: (https://opensource.com/article/20/7/docsify-github-pages)
|
||||
[#]: author: (Bryant Son https://opensource.com/users/brson)
|
||||
|
||||
How to create a documentation site with Docsify and GitHub Pages
|
||||
======
|
||||
Use Docsify to create documentation web pages to publish on GitHub
|
||||
Pages.
|
||||
![Digital creative of a browser on the internet][1]
|
||||
|
||||
Documentation is an essential part of making any open source project useful to users. But it's not always developers' top priority, as they may be more focused on making their application better than on helping people use it. This is why making it easier to publish documentation is so valuable to developers. In this tutorial, I'll show you one option for doing so: combining the [Docsify][2] documentation generator with [GitHub Pages][3].
|
||||
|
||||
If you prefer to learn by video, you can access the YouTube version of this how-to:
|
||||
|
||||
By default, GitHub Pages prompts users to use [Jekyll][4], a static site generator that supports HTML, CSS, and other web technologies. Jekyll generates a static website from documentation files encoded in Markdown format, which GitHub automatically recognizes due to their .md or .markdown extension. While this setup is nice, I wanted to try something else.
|
||||
|
||||
Fortunately, GitHub Pages' HTML file support means you can use other site-generation tools, including Docsify, to create a website on the platform. Docsify is an MIT-Licensed open source project with [features][5] that make it easy to create an attractive advanced documentation site on GitHub Pages.
|
||||
|
||||
![Docsify][6]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][7])
|
||||
|
||||
### Get started with Docsify
|
||||
|
||||
There are two ways to install Docsify:
|
||||
|
||||
1. Docsify's command-line interface (CLI) through NPM
|
||||
2. Manually by writing your own `index.html`
|
||||
|
||||
|
||||
|
||||
Docsify recommends the NPM approach, but I will use the second option. If you want to use NPM, follow the instructions in the [quick-start guide][8].
|
||||
|
||||
### Download the sample content from GitHub
|
||||
|
||||
I've published this example's source code on the [project's GitHub page][9]. You can download the files individually or [clone the repo][10] with:
|
||||
|
||||
|
||||
```
|
||||
`git clone https://github.com/bryantson/OpensourceDotComDemos`
|
||||
```
|
||||
|
||||
Then `cd` into the DocsifyDemo directory.
|
||||
|
||||
I will walk you through the cloned code from my sample repo below, so you can understand how to modify Docsify. If you prefer, you can start from scratch by creating a new `index.html` file, like in the [example][11] in Docsify's docs:
|
||||
|
||||
|
||||
```
|
||||
<!-- index.html -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<[html][12]>
|
||||
<[head][13]>
|
||||
<[meta][14] http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<[meta][14] name="viewport" content="width=device-width,initial-scale=1">
|
||||
<[meta][14] charset="UTF-8">
|
||||
<[link][15] rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/vue.css">
|
||||
</[head][13]>
|
||||
<[body][16]>
|
||||
<[div][17] id="app"></[div][17]>
|
||||
<[script][18]>
|
||||
window.$docsify = {
|
||||
//...
|
||||
}
|
||||
</[script][18]>
|
||||
<[script][18] src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></[script][18]>
|
||||
</[body][16]>
|
||||
</[html][12]>
|
||||
```
|
||||
|
||||
### Explore how Docsify works
|
||||
|
||||
If you cloned my [GitHub repo][10] and changed into the DocsifyDemo directory, you should see a file structure like this:
|
||||
|
||||
![File contents in the cloned GitHub][19]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][7])
|
||||
|
||||
File/Folder Name | What It Is
|
||||
---|---
|
||||
index.html | The main Docsify initiation file (and the most important file)
|
||||
_sidebar.md | Renders the navigation
|
||||
README.md | The default Markdown file at the root of your documentation
|
||||
images | Contains a sample .jpg image from the README.md
|
||||
Other directories and files | Contain navigatable Markdown files
|
||||
|
||||
`Index.html` is the only thing required for Docsify to work. Open the file, so you can explore the contents:
|
||||
|
||||
|
||||
```
|
||||
<!-- index.html -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<[html][12]>
|
||||
<[head][13]>
|
||||
<[meta][14] http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<[meta][14] name="viewport" content="width=device-width,initial-scale=1">
|
||||
<[meta][14] charset="UTF-8">
|
||||
<[link][15] rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/vue.css">
|
||||
<[title][20]>Docsify Demo</[title][20]>
|
||||
</[head][13]>
|
||||
<[body][16]>
|
||||
<[div][17] id="app"></[div][17]>
|
||||
<[script][18]>
|
||||
window.$docsify = {
|
||||
el: "#app",
|
||||
repo: '<https://github.com/bryantson/OpensourceDotComDemos/tree/master/DocsifyDemo>',
|
||||
loadSidebar: true,
|
||||
}
|
||||
</[script][18]>
|
||||
<[script][18] src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></[script][18]>
|
||||
</[body][16]>
|
||||
</[html][12]>
|
||||
```
|
||||
|
||||
This is essentially just a plain HTML file, but take a look at these two lines:
|
||||
|
||||
|
||||
```
|
||||
<[link][15] rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/vue.css">
|
||||
... SOME OTHER STUFFS ...
|
||||
<[script][18] src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></[script][18]>
|
||||
```
|
||||
|
||||
These lines use content delivery network (CDN) URLs to serve the CSS and JavaScript scripts to transform the site into a Docsify site. As long as you include these lines, you can turn your regular GitHub page into a Docsify page.
|
||||
|
||||
The first line after the `body` tag specifies what to render:
|
||||
|
||||
|
||||
```
|
||||
`<div id="app"></div>`
|
||||
```
|
||||
|
||||
Docsify is using the [single page application][21] (SPA) approach to render a requested page instead of refreshing an entirely new page.
|
||||
|
||||
Last, look at the lines inside the `script` block:
|
||||
|
||||
|
||||
```
|
||||
<[script][18]>
|
||||
window.$docsify = {
|
||||
el: "#app",
|
||||
repo: '<https://github.com/bryantson/OpensourceDotComDemos/tree/master/DocsifyDemo>',
|
||||
loadSidebar: true,
|
||||
}
|
||||
</[script][18]>
|
||||
```
|
||||
|
||||
In this block:
|
||||
|
||||
* The `el` property basically says, "Hey, this is the `id` I am looking for, so locate the `id` and render it there."
|
||||
|
||||
* Changing the `repo` value identifies which page users will be redirected to when they click the GitHub icon in the top-right corner.
|
||||
|
||||
![GitHub icon][22]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][7])
|
||||
|
||||
* Setting `loadSideBar` to `true` will make Docsify look for the `_sidebar.md` file that contains your navigation links.
|
||||
|
||||
|
||||
|
||||
|
||||
You can find all the options in the [Configuration][23] section of Docsify's docs.
|
||||
|
||||
Next, look at the `_sidebar.md` file. Because you set the `loadSidebar` property value to `true` in `index.html`, Docsify will look for the `_sidebar.md` file and generate the navigation file from its contents. The `_sidebar.md` contents in the sample repo are:
|
||||
|
||||
|
||||
```
|
||||
<!-- docs/_sidebar.md -->
|
||||
|
||||
* [HOME](./)
|
||||
|
||||
* [Tutorials](./tutorials/index)
|
||||
* [Tomcat](./tutorials/tomcat/index)
|
||||
* [Cloud](./tutorials/cloud/index)
|
||||
* [Java](./tutorials/java/index)
|
||||
|
||||
* [About](./about/index)
|
||||
|
||||
* [Contact](./contact/index)
|
||||
```
|
||||
|
||||
This uses Markdown's link format to create the navigation. Note that the Tomcat, Cloud, and Java links are indented; this causes them to be rendered as sublinks under the parent link.
|
||||
|
||||
Files like `README.md` and `images` pertain to the repository's structure, but all the other Markdown files are related to your Docsify webpage.
|
||||
|
||||
Modify the files you downloaded however you want, based on your needs. In the next step, you will add these files to your GitHub repo, enable GitHub Pages, and finish the project.
|
||||
|
||||
### Enable GitHub Pages
|
||||
|
||||
Create a sample GitHub repo, then use the following GitHub commands to check, commit, and push your code:
|
||||
|
||||
|
||||
```
|
||||
$ git clone LOCATION_TO_YOUR_GITHUB_REPO
|
||||
$ cd LOCATION_TO_YOUR_GITHUB_REPO
|
||||
$ git add .
|
||||
$ git commit -m "My first Docsify!"
|
||||
$ git push
|
||||
```
|
||||
|
||||
Set up your GitHub Pages page. From inside your new GitHub repo, click **Settings**:
|
||||
|
||||
![Settings link in GitHub][24]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][7])
|
||||
|
||||
Scroll down until you see **GitHub Pages**:
|
||||
|
||||
![GitHub Pages settings][25]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][7])
|
||||
|
||||
Look for the **Source** section:
|
||||
|
||||
![GitHub Pages settings][26]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][7])
|
||||
|
||||
Click the drop-down menu under **Source**. Usually, you will set this to the **master branch**, but you can use another branch, if you'd like:
|
||||
|
||||
![Setting Source to master branch][27]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][7])
|
||||
|
||||
That's it! You should now have a link to your GitHub Pages page. Clicking the link will take you there, and it should render with Docsify:
|
||||
|
||||
![Link to GitHub Pages docs site][28]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][7])
|
||||
|
||||
And it should look something like this:
|
||||
|
||||
![Example Docsify site on GitHub Pages][29]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][7])
|
||||
|
||||
### Conclusion
|
||||
|
||||
By editing a single HTML file and some Markdown text, you can create an awesome-looking documentation site with Docsify. What do you think? Please leave a comment and also share any other open source tools that can be used with GitHub Pages.
|
||||
|
||||
See how Jekyll, an open source generator of static HTML files, makes running a blog as easy as...
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/7/docsify-github-pages
|
||||
|
||||
作者:[Bryant Son][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/brson
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet)
|
||||
[2]: https://docsify.js.org
|
||||
[3]: https://pages.github.com/
|
||||
[4]: https://docs.github.com/en/github/working-with-github-pages/about-github-pages-and-jekyll
|
||||
[5]: https://docsify.js.org/#/?id=features
|
||||
[6]: https://opensource.com/sites/default/files/uploads/docsify1_ui.jpg (Docsify)
|
||||
[7]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[8]: https://docsify.js.org/#/quickstart?id=quick-start
|
||||
[9]: https://github.com/bryantson/OpensourceDotComDemos/tree/master/DocsifyDemo
|
||||
[10]: https://github.com/bryantson/OpensourceDotComDemos
|
||||
[11]: https://docsify.js.org/#/quickstart?id=manual-initialization
|
||||
[12]: http://december.com/html/4/element/html.html
|
||||
[13]: http://december.com/html/4/element/head.html
|
||||
[14]: http://december.com/html/4/element/meta.html
|
||||
[15]: http://december.com/html/4/element/link.html
|
||||
[16]: http://december.com/html/4/element/body.html
|
||||
[17]: http://december.com/html/4/element/div.html
|
||||
[18]: http://december.com/html/4/element/script.html
|
||||
[19]: https://opensource.com/sites/default/files/uploads/docsify3_files.jpg (File contents in the cloned GitHub)
|
||||
[20]: http://december.com/html/4/element/title.html
|
||||
[21]: https://en.wikipedia.org/wiki/Single-page_application
|
||||
[22]: https://opensource.com/sites/default/files/uploads/docsify4_github-icon_rev_0.jpg (GitHub icon)
|
||||
[23]: https://docsify.js.org/#/configuration?id=configuration
|
||||
[24]: https://opensource.com/sites/default/files/uploads/docsify5_githubsettings_0.jpg (Settings link in GitHub)
|
||||
[25]: https://opensource.com/sites/default/files/uploads/docsify6_githubpageconfig_rev.jpg (GitHub Pages settings)
|
||||
[26]: https://opensource.com/sites/default/files/uploads/docsify6_githubpageconfig_rev2.jpg (GitHub Pages settings)
|
||||
[27]: https://opensource.com/sites/default/files/uploads/docsify8_setsource_rev.jpg (Setting Source to master branch)
|
||||
[28]: https://opensource.com/sites/default/files/uploads/docsify9_link_rev.jpg (Link to GitHub Pages docs site)
|
||||
[29]: https://opensource.com/sites/default/files/uploads/docsify2_examplesite.jpg (Example Docsify site on GitHub Pages)
|
106
sources/tech/20200728 Why now is the best time to use GNOME.md
Normal file
106
sources/tech/20200728 Why now is the best time to use GNOME.md
Normal file
@ -0,0 +1,106 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Why now is the best time to use GNOME)
|
||||
[#]: via: (https://opensource.com/article/20/7/new-gnome-features)
|
||||
[#]: author: (Jim Hall https://opensource.com/users/jim-hall)
|
||||
|
||||
Why now is the best time to use GNOME
|
||||
======
|
||||
GNOME developer Emmanuele Bassi explains the user experience updates in
|
||||
the GNOME desktop environment.
|
||||
![Take a look at the latest from GNOME 3][1]
|
||||
|
||||
The GNOME desktop environment has been through many changes since its initial release in March 1999. For most of this time, the open source project has issued updates twice a year, which gives users predictability in when they can expect new features to land on their Linux and other Unix-like desktops. Its latest release, GNOME 3.36, came out in March, and the project is preparing to issue its next iteration in September. To learn about what's new in GNOME, I spoke with Emmanuele Bassi.
|
||||
|
||||
Emmanuele has been contributing to GNOME for more than 15 years. He started as the maintainer of language bindings that allow developers to use GNOME libraries in other programming languages, then moved on to contribute to GTK (a cross-platform widget for developing GNOME apps) and other parts of GNOME. In 2018, GNOME hired Emmanuele as a full-time GTK Core Developer, where he works on GTK and the GNOME application development platform.
|
||||
|
||||
**Jim Hall:** **GNOME 3.36 was released in March 2020. What are some of the major features people should know about?**
|
||||
|
||||
**Emmanuele Bassi:** GNOME has followed a release schedule for the last 18 or so years. GNOME doesn't release when a new feature is ready; we release when it's time. That simplifies the new releases. There isn't a "next big thing" in GNOME. Instead, it's just a new release every six months. We always fix bugs, add new features, and polish up what's there.
|
||||
|
||||
This release was really about making sure all the features were nice to use and pleasant to use. In GNOME 3.36, there's a lot that improves the user experience. One thing I like is the ability to turn off notifications. This is a feature that was available in a very old version of GNOME but was removed a while back because the mechanism underneath it wasn't very reliable. But we added it back because this feature is so useful and important to a lot of people.
|
||||
|
||||
You can toggle notifications on and off for everything or set them for each application you use. You can find this setting in the GNOME Settings app, under the Applications menu.
|
||||
|
||||
![GNOME "Do Not Disturb" feature][2]
|
||||
|
||||
Click "Do Not Disturb" to turn off notifications. (GNOME, [CC BY-SA 4.0][3])
|
||||
|
||||
![Notifications options in GNOME Settings][4]
|
||||
|
||||
You can turn off notifications for individual applications in the Settings app. (Jim Hall, [CC BY-SA 4.0][3])
|
||||
|
||||
We also added extra polish to the GNOME lock screen. This updated lock screen has been in the works for ages, and now it's ready. The new GNOME lock screen will blur the background of your current workspace but doesn't show your running applications. It's a great feature for the user experience. We've been working on that for the last three or four cycles, and we fixed a lot of things along the way to make that work well.
|
||||
|
||||
Another thing that's important for user experience is that [there is a new] place to put all the extensions. [It was in] GNOME Software Center, but no one knew to look there. Now there's a separate application to manage it.
|
||||
|
||||
![GNOME Extensions app][5]
|
||||
|
||||
The new Extensions app lets you change extension preferences or turn off those you don't want. (GNOME, [CC BY-SA 4.0][3])
|
||||
|
||||
And there's lots of little polish added to the GNOME Shell itself. For example, the application folders in the GNOME Shell application launcher are a great new feature. It's really easy to create your own application groups or folders in the launcher. A lot of people had asked for this for a long time. Application folders actually landed in an earlier GNOME release, but [the feature] needed extra work to make it really great, and that's what you see in GNOME 3.36.
|
||||
|
||||
**JH: What are some features of GNOME that more people should know about?**
|
||||
|
||||
**EB:** I don't know that there are other features that are really big in GNOME 3.36. If you're already using GNOME, the biggest thing you'll see is the improved user experience. If you aren't using GNOME, then the big thing is the consistent behavior in using GNOME. It's about a smooth experience with your computer, like your computer isn't going to be bothering you.
|
||||
|
||||
Password fields are easier. This used to be in a menu that you had to know existed if you wanted to use it, but now it's right there.
|
||||
|
||||
**JH: This is a great feature if you use long and complex passwords, like me. In any GNOME prompt where you would type in a password, you can click a little icon to expose your password to make sure you typed it correctly.**
|
||||
|
||||
![GNOME lock screen][6]
|
||||
|
||||
The lock screen includes the new "show your password" feature. (GNOME, [CC BY-SA 4.0][3])
|
||||
|
||||
**EB:** The new application folders in the GNOME application launcher is another [feature to know about]. The folders are easier to see, and they look great. GNOME will suggest a name for the application folder, but it's really easy to give that folder a different name.
|
||||
|
||||
And more applications in GNOME are now responsive to being resized. They changed that in the user interface. The Settings app is a good example of that. If you make it too narrow, it changes how it displays things. We've been working on this for a while because of companies like Purism that are putting GNOME on other display sizes like phones or anyone who is using GNOME on other form factors.
|
||||
|
||||
You don't notice some of the changes until you use them. There are lots of great features to see and that allow you to use GNOME in different ways.
|
||||
|
||||
**JH: As a GNOME developer and user, what GNOME features do you find most useful in your daily work?**
|
||||
|
||||
**EB:** I get a lot of use in the keyboard navigation. I use the keyboard all the time, so I live with my hands on the keyboard. When I use the mouse, I sometimes can get RSI (repetitive strain injury) by using it too much. Being able to use the keyboard for everything is great.
|
||||
|
||||
The keyboard shortcuts are part of the GNOME Accessibility. It's also part of a design direction to be able to count on keyboard shortcuts for things. Keyboard accessibility is a core part of the design language; it's not a side feature that will be dropped someday.
|
||||
|
||||
And having multiple windows on the screen and being able to tile them up, so I have two windows side by side. That, and multiple workspaces. I used to micromanage my workspaces back in the 1990s with different virtual desktops. But I'd always create more virtual desktops than I needed. But in GNOME, it's easy enough to create a new workspace if you need it, and when you don't need it, it's gone.
|
||||
|
||||
**JH: We're already in the GNOME 3.37 development cycle, with GNOME 3.38 planned for September 2020. What are some new features showing up that will interest people?**
|
||||
|
||||
**EB:** There are new changes all the time. One thing we're working on is the application grid and making that customizable. Right now, the applications are listed alphabetically, but you will be able to drag them around in any order you want. That will finish a massive change that's been in the works for five years or more. The goal is to be less automated and more user-driven.
|
||||
|
||||
Another thing happening is the GNOME Shell; developers want to do some tests on the Overview layout. Right now, you have a dashboard on the left and one on the right and windows in the center. We're trying to remove the dashboard because it's not helpful. If you want to configure it, you can. This is kind of being driven by the mobile effort. On the desktop, you're in Landscape mode and you have a lot of room to put things on the screen. But on mobile, you're probably in Portrait mode, and you have less space. So we're experimenting with new layouts and new ways to display the content. Some of that will land in GNOME 3.38, but it's been a really long project, so we'll see.
|
||||
|
||||
There are more features in GNOME Settings. A multi-tasking panel is planned in GNOME 3.38. Some of these settings exist already in the GNOME Tweaks app, and some of those will move from Tweaks into the main Settings app. Like being able to disable the hot corner—some people don't like that feature. Or letting you control the user interface when it comes to multiple screens—like if you want workspaces on multiple screens or just want workspaces on your main screen. Lots of these settings are not exposed right now unless you go into GNOME Tweaks, so we're moving those.
|
||||
|
||||
And I should mention that there's lots of work by everyone in GNOME to make things faster, even for people running on more limited systems like the Raspberry Pi. There's been a lot of work to get GNOME to perform better. That's a lot of work that people have been focusing on, because people really care about it.
|
||||
|
||||
* * *
|
||||
|
||||
You can download and learn more about GNOME, including its underlying technologies, getting involved, and more on its [website][7]. If you're curious to learn what else is new in GNOME, check out the [GNOME 3.36 release notes][8].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/7/new-gnome-features
|
||||
|
||||
作者:[Jim Hall][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/jim-hall
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gnome-3-opensourcecom-lead.png?itok=FCw4KaGT (Take a look at the latest from GNOME 3)
|
||||
[2]: https://opensource.com/sites/default/files/uploads/gnome-do-not-disturb.png (GNOME "Do Not Disturb" feature)
|
||||
[3]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[4]: https://opensource.com/sites/default/files/uploads/gnome-settings-rhythmbox-notif.png (Notifications options in GNOME Settings)
|
||||
[5]: https://opensource.com/sites/default/files/uploads/gnome-extensions.png (GNOME Extensions app)
|
||||
[6]: https://opensource.com/sites/default/files/uploads/gnome-lock-screen.png (GNOME lock screen)
|
||||
[7]: https://www.gnome.org/
|
||||
[8]: https://help.gnome.org/misc/release-notes/3.36/
|
@ -0,0 +1,207 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Install Discord Application in Ubuntu and Other Linux Distributions [3 Methods])
|
||||
[#]: via: (https://itsfoss.com/install-discord-linux/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
How to Install Discord Application in Ubuntu and Other Linux Distributions [3 Methods]
|
||||
======
|
||||
|
||||
[Discord][1] is a popular messaging application. It was originally intended for gamers but these days, it is considered a [Slack alternative][2] even for team and community communication. You can use it for text, voice and video messaging.
|
||||
|
||||
Several open source project use it for communicating with project members and users.
|
||||
|
||||
Discord is available on various platforms including desktop Linux. In this tutorial, I’ll show you various ways of installing Discord on Ubuntu, Debian and other Linux distributions.
|
||||
|
||||
* [Installing Discord via DEB file][3] (applicable to Debian, Ubuntu, Linux Mint and other Debian/Ubuntu based distributions)
|
||||
* [Installing Discord via Snap or Flatpak][4] (applicable for distributions with Snap or Flatpak support)
|
||||
* [Installing Discord in traditional way][5] (applicable for all distributions but need good knowledge of Linux commands)
|
||||
|
||||
|
||||
|
||||
Non-FOSS alert!
|
||||
|
||||
Discord application is not open source. But since they provide a Linux client and many Linux users rely on it, it’s been covered here.
|
||||
|
||||
### Method 1: Installing Discord in Ubuntu and Debian-based Linux Distributions
|
||||
|
||||
Go to the [download page of Discord][6] and download the deb file. Keep in mind that, Discord is only available for 64-bit systems.
|
||||
|
||||
![Download Discord for Linux][7]
|
||||
|
||||
[Installing deb file is easy][8]. Just double click on it to open it in the software manager and install it from there. You may also install and [use Gdebi tool][9] for this purpose.
|
||||
|
||||
It will take a few seconds for installing and you should see a log in screen like this:
|
||||
|
||||
![][10]
|
||||
|
||||
The problem with this approach is that though you’ll have the latest Discord version, it won’t be updated to a newer version automatically in the future.
|
||||
|
||||
You can either uninstall it from the software center or use this command in the terminal:
|
||||
|
||||
```
|
||||
sudo apt remove discord
|
||||
```
|
||||
|
||||
### Method 2: Installing Discord on Ubuntu and other Linux distributions using Snap package
|
||||
|
||||
You can easily install Discord using Snap package in Ubuntu and various other Linux distributions with snap package support.
|
||||
|
||||
The advantage is that you’ll always have the latest version of Discord and your installed version gets automatically updated. The downside is that Snap packages take longer to start.
|
||||
|
||||
Ubuntu user can find [Discord snap package][11] in the Software Center and install from there:
|
||||
|
||||
![Discord snap package is available in Ubuntu Software Center][12]
|
||||
|
||||
If you have enabled Snap support on your Linux distribution, you can use the following command to install it:
|
||||
|
||||
```
|
||||
sudo snap install discord
|
||||
```
|
||||
|
||||
If you want to remove it, you can use the snap command to uninstall it:
|
||||
|
||||
```
|
||||
sudo snap remove discord
|
||||
```
|
||||
|
||||
Please note that [Discord is also available in Flatpak package format][13]. You can [use Flatpak][14] to install it in Fedora and other Linux distributions.
|
||||
|
||||
### Method 3: Installing Discord in other Linux Distributions (intermediate to advanced level)
|
||||
|
||||
Discord also provides a generic isntaller for using Discord on Linux. It comes in the traditional tar gz file.
|
||||
|
||||
If you go for this way of installing Discord on Linux, then you should have at least a moderate [understanding of Linux directory structure][15] and Linux commands. You must also be comfortable using the terminal because this method involves using the terminal all the way.
|
||||
|
||||
#### Step 1: Download Discord for Linux
|
||||
|
||||
First [download the tar.gz file from Discord’s website][6].
|
||||
|
||||
I am using Discord version 0.0.10 in the tutorial. Your file name may or may not be different. Pay attention to it.
|
||||
|
||||
#### Step 2: Extract the downloaded file to opt directory
|
||||
|
||||
Go to directory where you have downloaded the file. Use the tar command to extract the .tar.gz file in the /opt directory.
|
||||
|
||||
```
|
||||
sudo tar -xvzf discord-0.0.10.tar.gz -C /opt
|
||||
```
|
||||
|
||||
Traditionally, the /opt directory is used for installing/keeping files of optional or additional Linux software. Since you opted for the traditional way, it only makes sense to use the traditional convention.
|
||||
|
||||
#### Step 3: Create Discord command in bin directory
|
||||
|
||||
Now you should have /opt/Discord directory with files related to Discord. You should have two important files to tackle here. A binary file named Discord and a desktop file named discord.desktop.
|
||||
|
||||
Now, you should [create a symbolic link][16] to this binary file in /usr/bin directory.
|
||||
|
||||
```
|
||||
sudo ln -sf /opt/Discord/Discord /usr/bin/Discord
|
||||
```
|
||||
|
||||
The /usr/bin directory contains the binary executables for commands in your system. This way, any user can run the commands from anywhere in the system.
|
||||
|
||||
#### Step 4: Create desktop icon and menu entry
|
||||
|
||||
You have Discord available as a command for all users on the system. But you cannot find it in the system menu to launch it graphically.
|
||||
|
||||
For that, you’ll have to use the discord.desktop file located in the extracted folder in the opt directory.
|
||||
|
||||
You should pay attention to two lines here: Exec and Icon.
|
||||
|
||||
The exec is for executable file and you can set it to /usr/bin/Discord . The Icon is for the image of Discord that will be displayed when you search for Discord in the menu. You can set it to the /opt/Discord/discord.png. This image is present in the extracted folder.
|
||||
|
||||
You can [use nano editor][17] with sudo for editing this file or whichever [terminal-based text editor][18] you prefer. Your discord.desktop may look something like this:
|
||||
|
||||
![][19]
|
||||
|
||||
Your discord.desktop file is still in the /opt/Discord directory. You need to move it to /usr/share/applications directory so that your system can access this desktop entry.
|
||||
|
||||
```
|
||||
sudo cp -r /opt/Discord/discord.desktop /usr/share/applications
|
||||
```
|
||||
|
||||
Normally, you should see Discord added in the list of available applications in the menu immediately. If not, log out and log in again.
|
||||
|
||||
#### Step 5: Run Discord
|
||||
|
||||
You are done. Now if you search for Discord, you will find it in the menu and when you run it for the first time, it will do some configuration.
|
||||
|
||||
![Running Discord for the first time][20]
|
||||
|
||||
After that, it will bring you to the login screen. It automatically tried to log you in from your default browser.
|
||||
|
||||
![][10]
|
||||
|
||||
Enjoy Discord on Linux. If there is a new version of Discord in the future, you’ll have to remove the already installed version and then repeat the procedure with the new version.
|
||||
|
||||
#### Removing Discord installed in the traditional way
|
||||
|
||||
It would be unfair to just discuss how to install Discord. Let me give you some pointers about removing it as well.
|
||||
|
||||
When you install Discord on Linux, it saves config file in .config/discord folder in your home directory. Delete these files:
|
||||
|
||||
```
|
||||
rm -r ~/.config/discord
|
||||
```
|
||||
|
||||
Next, remove the Discord directory from the /opt directory:
|
||||
|
||||
```
|
||||
sudo rm -rf /usr/bin/Discord
|
||||
```
|
||||
|
||||
Also delete the symbolic link you had created:
|
||||
|
||||
```
|
||||
sudo rm /usr/bin/Discord
|
||||
```
|
||||
|
||||
As the last step, remove the desktop file:
|
||||
|
||||
```
|
||||
sudo rm /usr/share/applications/discord.desktop
|
||||
```
|
||||
|
||||
**Did you manage to install Discord on Linux? Which method did you use?**
|
||||
|
||||
I gave you various ways of installing Discord application on Linux. The traditional Linux way is somewhat complicated but at least this way you can install it on any Linux distribution.
|
||||
|
||||
Did you manage to install it? Which method did you use and prefer?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/install-discord-linux/
|
||||
|
||||
作者:[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://discord.com/
|
||||
[2]: https://itsfoss.com/open-source-slack-alternative/
|
||||
[3]: tmp.ehA52f5sBZ#via-deb
|
||||
[4]: tmp.ehA52f5sBZ#via-snap
|
||||
[5]: tmp.ehA52f5sBZ#traditional-method
|
||||
[6]: https://discord.com/new/download
|
||||
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/07/download-discord-linux.png?ssl=1
|
||||
[8]: https://itsfoss.com/install-deb-files-ubuntu/
|
||||
[9]: https://itsfoss.com/gdebi-default-ubuntu-software-center/
|
||||
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/07/discord-login-screen.jpg?ssl=1
|
||||
[11]: https://snapcraft.io/discord
|
||||
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/07/install-discord-snap.jpg?ssl=1
|
||||
[13]: https://flathub.org/apps/details/com.discordapp.Discord
|
||||
[14]: https://itsfoss.com/flatpak-guide/
|
||||
[15]: https://linuxhandbook.com/linux-directory-structure/
|
||||
[16]: https://linuxhandbook.com/symbolic-link-linux/
|
||||
[17]: https://itsfoss.com/nano-editor-guide/
|
||||
[18]: https://itsfoss.com/command-line-text-editors-linux/
|
||||
[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/07/installing-discord-in-linux-traditional-way.png?ssl=1
|
||||
[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/07/discord-install.jpg?ssl=1
|
@ -0,0 +1,71 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (JonnieWayy)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (What you need to know about Rust in 2020)
|
||||
[#]: via: (https://opensource.com/article/20/1/rust-resources)
|
||||
[#]: author: (Ryan Levick https://opensource.com/users/ryanlevick)
|
||||
|
||||
2020 年关于 Rust 你所需要知道的
|
||||
======
|
||||
尽管许多程序员长期以来一直将 Rust 用于业余爱好项目,但正如 Opensource.com 上许多有关 Rust 的热门文章所解释的那样,该语言在 2019 年吸引了主要技术公司的支持。
|
||||
![用笔记本电脑的人][1]
|
||||
|
||||
一段时间以来, [Rust][2] 在诸如 Hacker News 之类的网站上引起了程序员大量的关注。尽管许多人一直喜欢在业余爱好项目中[使用该语言][3],但直到 2019 年它才开始在工业界流行,直到那会儿情况才真正开始有所转变。
|
||||
|
||||
在过去的一年中,包括 [Microsoft][4]、 [Facebook][5] 和 [Intel][6] 在内的许多大公司都出来支持 Rust,许多[较小的公司][7]也注意到了这一点。2016 年,作为欧洲最大的 Rust 大会 [RustFest][8] 的第一主持人,我没见到任何一个人工作中使用 Rust 但却不在 Mozilla 工作的。三年后,似乎我在 RustFest 2019 有所交流的每个人都将 Rust 用于izard其他公司的日常工作,无论是作为游戏开发人员、银行的后端工程师、开发者工具的创造者或是其他的一些岗位。
|
||||
|
||||
在 2019 年, Opensource.com 也通过报道 Rust 日益增长的受欢迎程度而发挥了作用。万一您错过了它们,这里是过去一年里 Opensource.com 上关于 Rust 的热门文章。
|
||||
|
||||
### 使用 rust-vmm 构建未来的虚拟化堆栈
|
||||
|
||||
Amazon 的 [Firecracker][9] 是支持 AWS Lambda 和 Fargate 的虚拟化技术,完全使用 Rust 编写。这项技术的作者之一 Andreea Florescu 在 [**《使用 rust-vmm 构建未来的虚拟化堆栈》**][10]中提供了对 Firecracker 及其相关技术的深刻见解。
|
||||
|
||||
Firecracker 最初是 Google [CrosVM][11] 的一个分支,但是很快由于两个项目的不同需求而分化。尽管如此,在这个项目与其他用 Rust 所编写的虚拟机管理器(VMM)之间仍有许多得到了很好共享的通用片段。考虑到这一点, [rust-vmm][12] 起初是以一种让 Amazon 和 Google, Intel 和 Red Hat 以及其余开源社区去相互共享通用 Rust “crates” (即程序包)的方式开始的。其中包括 KVM 接口(Linux 虚拟化 API)、 Virtio 设备支持以及内核加载程序。
|
||||
|
||||
看到软件行业的一些巨头围绕用 Rust 编写的通用技术栈协同工作,实在是很神奇。鉴于这种和其他[使用 Rust 编写的技术堆栈][13]之间的伙伴关系,到了 2020 年,看到更多这样的情况我不会感到惊讶。
|
||||
|
||||
### 为何选择 Rust 作为你的下一门编程语言
|
||||
|
||||
采用一门新语言,尤其是在有着建立已久技术栈的大公司,并非易事。我很高兴写了[《为何选择 Rust 作为你的下一门编程语言》][14],书中讲述了 Microsoft 是如何在没有考虑其他这么多有趣的编程语言的情况下选择了采用 Rust。
|
||||
|
||||
选择编程语言涉及许多不同的标准——从技术上到组织上,甚至是情感上。 其中一些标准比其他的更容易衡量。比方说,了解技术变更的成本(例如调整构建系统和构建新工具)要比理解组织或情感问题(例如高效或快乐的开发人员将如何使用这种新语言)容易得多。 此外,易于衡量的标准通常与成本相关,而难以衡量的标准通常以收益为导向。 这通常会导致成本在决策过程中变得越来越重要,即使这不一定就是说成本要比收益更重要——只是成本更容易衡量。 这使得公司不太可能采用新的语言。
|
||||
|
||||
然而,Rust 最大的好处之一是很容易衡量其编写安全且高性能系统软件的能力。鉴于 Microsoft 70% 的安全漏洞是由于 Rust 旨在防止的内存安全问题导致的,而且这些问题每年都使公司付出了几十亿美元的代价,很容易衡量并理解采用这门语言的好处。
|
||||
|
||||
是否会在 Microsoft 全面采用 Rust 尚待观察,但是仅凭着相对于现有技术具有明显且可衡量的好处这一事实, Rust 的未来一片光明。
|
||||
|
||||
### 2020 年的 Rust
|
||||
|
||||
尽管要达到 C++ 等语言的流行度还有很长的路要走。Rust 实际上已经开始在工业界引起关注。我希望更多公司在 2020 年开始采用 Rust。 Rust 社区现在必须着眼于欢迎开发人员和公司加入社区,同时确保将推动该语言发展到现在的一切都保留下来。
|
||||
|
||||
Rust 不仅仅是一个编译器和一组库,而是一群想要使系统编程变得容易、安全而且有趣的人。即将到来的这一年,对于 Rust 从业余爱好语言到软件行业所使用的主要语言之一的转型至关重要。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/1/rust-resources
|
||||
|
||||
作者:[Ryan Levick][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[JonnieWayy](https://github.com/JonnieWayy)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/ryanlevick
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop)
|
||||
[2]: http://rust-lang.org/
|
||||
[3]: https://insights.stackoverflow.com/survey/2019#technology-_-most-loved-dreaded-and-wanted-languages
|
||||
[4]: https://youtu.be/o01QmYVluSw
|
||||
[5]: https://youtu.be/kylqq8pEgRs
|
||||
[6]: https://youtu.be/l9hM0h6IQDo
|
||||
[7]: https://oxide.computer/blog/introducing-the-oxide-computer-company/
|
||||
[8]: https://rustfest.eu
|
||||
[9]: https://firecracker-microvm.github.io/
|
||||
[10]: https://opensource.com/article/19/3/rust-virtual-machine
|
||||
[11]: https://chromium.googlesource.com/chromiumos/platform/crosvm/
|
||||
[12]: https://github.com/rust-vmm
|
||||
[13]: https://bytecodealliance.org/
|
||||
[14]: https://opensource.com/article/19/10/choose-rust-programming-language
|
175
translated/tech/20200710 Use DNS over TLS.md
Normal file
175
translated/tech/20200710 Use DNS over TLS.md
Normal file
@ -0,0 +1,175 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Use DNS over TLS)
|
||||
[#]: via: (https://fedoramagazine.org/use-dns-over-tls/)
|
||||
[#]: author: (Thomas Bianchi https://fedoramagazine.org/author/thobianchi/)
|
||||
|
||||
使用 DNS over TLS
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
现代计算机用来在互联网种查找资源的[域名系统 (DNS)][2] 是在 [35 年前][3]设计的,而没有考虑用户隐私。它会面临安全风险和攻击,例如 [DNS 劫持][4]。它还能让 [ISP][5] 拦截查询。
|
||||
|
||||
幸运的是,现在有 [DNS over TLS][6] 和 [DNSSEC][7] 可用。DNS over TLS 和 DNSSEC 允许创建从计算机到它配置的 DNS 服务器的安全且加密的端到端隧道。在 Fedora 上,部署这些技术的步骤很容易,并且所有必要的工具也很容易获得。
|
||||
|
||||
本指南将演示如何使用 systemd-resolved 在 Fedora 上配置 DNS over TLS。有关 systemd-resolved 服务的更多信息,请参见[文档][8]。
|
||||
|
||||
### 步骤 1:设置 Step 1 : Set-up systemd-resolved
|
||||
|
||||
修改 _/etc/systemd/resolved.conf_,类似于下面所示。确保启用 DNS over TLS 并配置要使用的 DNS 服务器的 IP 地址。
|
||||
|
||||
```
|
||||
$ cat /etc/systemd/resolved.conf
|
||||
[Resolve]
|
||||
DNS=1.1.1.1 9.9.9.9
|
||||
DNSOverTLS=yes
|
||||
DNSSEC=yes
|
||||
FallbackDNS=8.8.8.8 1.0.0.1 8.8.4.4
|
||||
#Domains=~.
|
||||
#LLMNR=yes
|
||||
#MulticastDNS=yes
|
||||
#Cache=yes
|
||||
#DNSStubListener=yes
|
||||
#ReadEtcHosts=yes
|
||||
```
|
||||
|
||||
关于选项的简要说明:
|
||||
|
||||
* **DNS**:以空格分隔的 IPv4 和 IPv6 地址列表,用作系统 DNS 服务器
|
||||
* **FallbackDNS**:以空格分隔的 IPv4 和 IPv6 地址列表,用作后备 DNS 服务器。
|
||||
* **Domains**:在解析单标签主机名时,这些域名用于搜索后缀。 _~._ 代表对于所有域名,优先使用 DNS= 定义的系统 DNS 服务器。
|
||||
* **DNSOverTLS**:如果启用,那么将加密与服务器的所有连接。请注意,此模式要求 DNS 服务器支持 DNS-over-TLS,并具有其 IP 的有效证书。
|
||||
|
||||
|
||||
|
||||
> _注意:上面示例中列出的 DNS 服务器是我个人的选择。你要确定要使用的 DNS 服务器。要注意你要向谁请求 IP_。
|
||||
|
||||
### 步骤 2:告诉 NetworkManager 将信息推给 systemd-resolved
|
||||
|
||||
在 _/etc/NetworkManager/conf.d_ 中创建一个名为 _10-dns-systemd-resolved.conf_ 的文件。
|
||||
|
||||
```
|
||||
$ cat /etc/NetworkManager/conf.d/10-dns-systemd-resolved.conf
|
||||
[main]
|
||||
dns=systemd-resolved
|
||||
```
|
||||
|
||||
上面的设置(_dns=systemd-resolved_)让 NetworkManager 将从 DHCP 获得的 DNS 信息推送到 systemd-resolved 服务。这将覆盖_步骤 1_ 中配置的 DNS 设置。这在受信任的网络中没问题,但是可以设置 _dns=none_ 从而使用 _/etc/systemd/resolved.conf_ 中配置的 DNS 服务器。
|
||||
|
||||
### 步骤 3: 启动和重启服务
|
||||
|
||||
若要使上述步骤中的配置生效,请启动并启用 _systemd-resolved_。然后重启 _NetworkManager_。
|
||||
|
||||
**注意**:在 NetworkManager 重启时,连接会中断几秒钟。
|
||||
|
||||
```
|
||||
$ sudo systemctl start systemd-resolved
|
||||
$ sudo systemctl enable systemd-resolved
|
||||
$ sudo systemctl restart NetworkManager
|
||||
```
|
||||
|
||||
> _注意:目前,systemd-resolved 服务默认处于禁用状态,并且是计划使用的。[这有个方案][33]可在 Fedora 33 中默认启用systemd-resolved。_
|
||||
|
||||
### 步骤 4:检查是否一切正常
|
||||
|
||||
现在,你应该在使用 DNS over TLS。检查 DNS 解析状态来确认这一点:
|
||||
|
||||
```
|
||||
$ resolvectl status
|
||||
MulticastDNS setting: yes
|
||||
DNSOverTLS setting: yes
|
||||
DNSSEC setting: yes
|
||||
DNSSEC supported: yes
|
||||
Current DNS Server: 1.1.1.1
|
||||
DNS Servers: 1.1.1.1
|
||||
9.9.9.9
|
||||
Fallback DNS Servers: 8.8.8.8
|
||||
1.0.0.1
|
||||
8.8.4.4
|
||||
```
|
||||
|
||||
/etc/resolv.conf 应该指向 127.0.0.53
|
||||
|
||||
```
|
||||
$ cat /etc/resolv.conf
|
||||
# Generated by NetworkManager
|
||||
search lan
|
||||
nameserver 127.0.0.53
|
||||
```
|
||||
|
||||
若要查看 systemd-resolved 发送和接收安全查询的地址和端口,请运行:
|
||||
|
||||
```
|
||||
$ sudo ss -lntp | grep '\(State\|:53 \)'
|
||||
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
|
||||
LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=10410,fd=18))
|
||||
```
|
||||
|
||||
若要进行安全查询,请运行:
|
||||
|
||||
```
|
||||
$ resolvectl query fedoraproject.org
|
||||
fedoraproject.org: 8.43.85.67 -- link: wlp58s0
|
||||
8.43.85.73 -- link: wlp58s0
|
||||
|
||||
[..]
|
||||
|
||||
-- Information acquired via protocol DNS in 36.3ms.
|
||||
-- Data is authenticated: yes
|
||||
```
|
||||
|
||||
### 额外步骤 5:使用 Wireshark 验证配置
|
||||
|
||||
首先,安装并运行 [Wireshark][10]:
|
||||
|
||||
```
|
||||
$ sudo dnf install wireshark
|
||||
$ sudo wireshark
|
||||
```
|
||||
|
||||
它会询问你在哪个设备上捕获数据包。在我这里,因为我使用无线接口,我用的是 _wlp58s0_。在 Wireshark 中设置筛选器,_tcp.port == 853_(853 是 DNS over TLS 协议端口)。在捕获 DNS 查询之前,你需要刷新本地 DNS 缓存:
|
||||
|
||||
```
|
||||
$ sudo resolvectl flush-caches
|
||||
```
|
||||
|
||||
现在运行:
|
||||
|
||||
```
|
||||
$ nslookup fedoramagazine.org
|
||||
```
|
||||
|
||||
你应该会看到你的计算机和配置的 DNS 服务器之间的 TLS 加密交换:
|
||||
|
||||
![][11]
|
||||
|
||||
— _Poster in Cover Image Approved for Release by NSA on 04-17-2018, FOIA Case # 83661_ —
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/use-dns-over-tls/
|
||||
|
||||
作者:[Thomas Bianchi][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/thobianchi/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2020/06/use-dns-over-tls-816x345.jpg
|
||||
[2]: https://en.wikipedia.org/wiki/Domain_Name_System
|
||||
[3]: https://tools.ietf.org/html/rfc1035
|
||||
[4]: https://en.wikipedia.org/wiki/DNS_hijacking
|
||||
[5]: https://en.wikipedia.org/wiki/Internet_service_provider
|
||||
[6]: https://en.wikipedia.org/wiki/DNS_over_TLS
|
||||
[7]: https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions
|
||||
[8]: https://www.freedesktop.org/wiki/Software/systemd/resolved/
|
||||
[9]: https://fedoraproject.org/wiki/Changes/systemd-resolved
|
||||
[10]: https://www.wireshark.org/
|
||||
[11]: https://fedoramagazine.org/wp-content/uploads/2020/06/1-1024x651.png
|
Loading…
Reference in New Issue
Block a user