mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-03 01:10:13 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
5448f14537
@ -1,39 +1,38 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12897-1.html)
|
||||
[#]: subject: (How this open source security tool halted significant DDoS attacks)
|
||||
[#]: via: (https://opensource.com/article/20/12/open-source-vs-ddos-attacks)
|
||||
[#]: author: (Philippe Humeau https://opensource.com/users/philippe-humeau)
|
||||
|
||||
这个开源安全工具是如何阻止重大 DDoS 攻击的
|
||||
如何在 1 分钟内阻止 7000 台机器的僵尸网络
|
||||
======
|
||||
对 CrowdSec 的配置更改在不到一分钟的时间内阻止了一个 7,000 台机器的僵尸网络。
|
||||
![Security monster][1]
|
||||
|
||||
2020 年,我们的生活和工作方式在短短几天内被彻底颠覆。随着 COVID-19 开始在全球范围内蔓延,我们将工作带回家,与同事、朋友和家人保持在线联系成为关键的必需品。这为黑客造成破坏打开了大门。例如,根据 Neustar 的数据,今年上半年全球的分布式拒绝服务 (DDOS) 攻击[增长了 151%][2]。
|
||||
> 对 CrowdSec 的配置更改,在不到一分钟的时间内阻止了一个 7000 台机器的僵尸网络的攻击。
|
||||
|
||||
[CrowdSec][3] 是一个开源的安全引擎,它可以分析访问者的行为,并提供适应各种攻击的响应。它解析来自任何来源的日志,并应用启发式方案来识别攻击性行为,并防范大多数攻击类别。并且,它与其他 CrowdSec 安装共享该情报。每次互联网协议 (IP) 地址被阻止时,它都会通知整个用户社区。这就创建了一个[实时、协作的 IP 信誉数据库][4],利用人群的力量使互联网更加安全。
|
||||

|
||||
|
||||
2020 年,我们的生活和工作方式在短短几天内被彻底颠覆。随着 COVID-19 开始在全球范围内蔓延,我们将工作带回家,与同事、朋友和家人保持在线联系成为关键的必需品。这为黑客造成破坏打开了大门。例如,根据 Neustar 的数据,今年上半年全球的分布式拒绝服务(DDOS) 攻击[增长了 151%][2]。
|
||||
|
||||
[CrowdSec][3] 是一个开源的安全引擎,它可以分析访问者的行为,并提供适应各种攻击的响应。它能解析来自各种来源的日志,并应用启发式方案来识别攻击性行为,并防范大多数攻击类别。并且,它与其它安装的 CrowdSec 系统共享该情报。每次 IP 地址被阻止时,它都会通知整个用户社区。这就创建了一个[实时、协作的 IP 信誉数据库][4],利用人群的力量使互联网更加安全。
|
||||
|
||||
### CrowdSec 如何工作:案例研究
|
||||
|
||||
Sorf Networks 是一家总部位于土耳其的技术公司,为客户提供高配置的托管服务器和 DDoS 防护解决方案,它提供了一个 CrowdSec 工作的例子。Sorf 的一个客户每天都会遇到来自 1 万多台机器僵尸网络的 DDoS 攻击,并努力寻找一种能够满足技术要求的解决方案来及时处理这些攻击。
|
||||
|
||||
虽然客户采取了一般的预防措施来缓解这些攻击,比如引入 JavaScript(JS) 挑战、限速等,但这些措施在整个攻击面并不可行。一些 URL 需要被非常基本的软件使用,而这些软件不支持 JS 挑战。黑客就是黑客,这正是他们每天的目标:链条上最薄弱的环节。
|
||||
虽然客户采取了一般的预防措施来缓解这些攻击,比如引入 JavaScript(JS)<ruby>挑战<rt>challenges</rt></ruby>、限速等,但这些措施在整个攻击面并不可行。一些 URL 需要被非常基本的软件使用,而这些软件不支持 JS 挑战。黑客就是黑客,这正是他们每天的目标:链条上最薄弱的环节。
|
||||
|
||||
Sorf Networks 首先使用 [Fail2ban][5](这启发了 CrowdSec)为其客户建立了一个 DDoS 缓解策略。它在一定程度上帮助了客户,但它太慢了。它需要 50 分钟来处理日志和处理 7000 到 10000 台机器的 DDoS 攻击。这使得它在这种情况下没有效果。另外,因为它没有禁止 IP,日志会持续堆积,它需要每秒处理几千条日志,这是不可能的。
|
||||
|
||||
在使用租用的僵尸网络进行的 DDoS 测试中,一次攻击从 8600 个唯一的 IP 上达到了每秒 6700 个左右的请求。这是对一台服务器流量的捕捉。
|
||||
在使用租用的僵尸网络进行的 DDoS 测试中,一次攻击可以高达每秒 6700 个左右的请求,这些请求来自 8600 个独立 IP。这是对一台服务器流量的捕捉:
|
||||
|
||||
![Server traffic][6]
|
||||
|
||||
(©2020, CrowdSec)
|
||||
|
||||
虽然 CrowdSec 技术可以应对巨大的攻击,但其默认设置每秒只能处理约 1000 个端点。Sorf 需要一个量身定做的配置来处理单台机器上这么多的流量。
|
||||
|
||||
Sorf 的团队对 CrowdSec 的配置进行了修改,以显著提高其吞吐量来处理日志。首先,它去掉了高消耗且非关键的富集解析器,例如 [GeoIP 富集][7]。它还将允许的 goroutine 的默认数量从一个增加到五个。之后,团队又用 8000 到 9000 台主机做了一次实测,平均每秒 6000 到 7000 个请求。这个方案是有代价的,因为 CrowdSec 在运行过程中吃掉了 600% 的 CPU,但其内存消耗却保持在 270MB 左右。
|
||||
Sorf 的团队对 CrowdSec 的配置进行了修改,以显著提高其吞吐量来处理日志。首先,它去掉了高消耗且非关键的<ruby>富集<rt>enrichment</rt></ruby>解析器,例如 [GeoIP 富集][7]。它还将允许的 goroutine 的默认数量从一个增加到五个。之后,团队又用 8000 到 9000 台主机做了一次实测,平均每秒 6000 到 7000 个请求。这个方案是有代价的,因为 CrowdSec 在运行过程中吃掉了 600% 的 CPU,但其内存消耗却保持在 270MB 左右。
|
||||
|
||||
然而,结果却显示出明显的成功:
|
||||
|
||||
@ -41,13 +40,11 @@ Sorf 的团队对 CrowdSec 的配置进行了修改,以显著提高其吞吐
|
||||
* 95% 的僵尸网络被禁止,攻击得到有效缓解
|
||||
* 15 个域现在受到保护,不受 DDoS 攻击
|
||||
|
||||
|
||||
|
||||
根据 Sorf Networks 的总监 Cagdas Aydogdu 的说法,CrowdSec 的平台使团队“能够在令人难以置信的短时间内提供一个世界级的高效防御系统”。
|
||||
|
||||
* * *
|
||||
|
||||
_本文改编自[如何用 CrowdSec 在 1 分钟内阻止 7000 台机器的僵尸网络][8],原载于 CrowdSec 网站。_
|
||||
本文改编自[如何用 CrowdSec 在 1 分钟内阻止 7000 台机器的僵尸网络][8],原载于 CrowdSec 网站。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -56,7 +53,7 @@ via: https://opensource.com/article/20/12/open-source-vs-ddos-attacks
|
||||
作者:[Philippe Humeau][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,45 +1,43 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12898-1.html)
|
||||
[#]: subject: (How to Add Third-Party Repositories in Fedora and Get Access to a Huge Number of Additional Software)
|
||||
[#]: via: (https://itsfoss.com/fedora-third-party-repos/)
|
||||
[#]: author: (John Paul https://itsfoss.com/author/john/)
|
||||
|
||||
如何在 Fedora 中添加第三方存储库并访问大量附加软件
|
||||
如何在 Fedora 中添加第三方存储库以访问大量附加软件
|
||||
======
|
||||
|
||||
在你安装 Fedora 后。你可能会发现你想要安装和使用的一些软件不能在软件商店中获得。出于一些原因,这些软件包不能出现在e Fedora 存储库中。
|
||||

|
||||
|
||||
在你安装 Fedora 后。你可能会发现你想要安装和使用的一些软件在软件商店中找不到。出于一些原因,这些软件包不能出现在 Fedora 存储库中。
|
||||
|
||||
不用担心,我将告诉你如何为 Fedora 添加第三方存储库来使这些软件包可使用。
|
||||
|
||||
### 在 Fedora 中的第三方存储库是什么?
|
||||
|
||||
操作系统开发人员通常会决定哪些软件包可以在其存储库中使用,哪些软件包不可以在其存储库中使用。Fedora 也与它们没有什么不同。依据 [Fedora 文档][1] ,第三方存储库包含有 “拥有更为宽松的许可政策,并提供 Fedora 因各种原因所排除软件包” 的软件包。
|
||||
操作系统开发人员通常会决定哪些软件包可以在其存储库中使用,哪些软件包不可以在其存储库中使用。Fedora 也是如此。依据 [Fedora 文档][1] ,第三方存储库包含有 “拥有更为宽松的许可政策,并提供 Fedora 因各种原因所排除软件包” 的软件包。
|
||||
|
||||
Fedora 强制执行下面的 [准则][2] ,当它打包软件包时:
|
||||
|
||||
* 如果它是专有的,它就不能包含在 Fedora 中
|
||||
* 如果它在法律上被限制,它就不能包含在 Fedora 中
|
||||
* 如果它违反美国法律 (特别是联邦政府或适用于州政府的法律),它就不能包含在 Fedora 中
|
||||
* 如果它违反美国法律(特别是联邦政府或适用于州政府的法律),它就不能包含在 Fedora 中
|
||||
|
||||
|
||||
|
||||
因此,这里存在一组用户可自行添加的存储库。这使得用户能够访问附加的软件包。
|
||||
因此,有一些可以由用户自行添加的存储库。这使得用户能够访问附加的软件包。
|
||||
|
||||
### 在 Fedora 中启用 RPM Fusion 存储库
|
||||
|
||||
[RPM Fusion][3] 是 Fedora 的第三方应用程序的主要来源。RPM Fusion 是三个项目 (Dribble,Freshrpms,和 Livna) 合并的结果。RPM Fusion 提供两种不同的软件存储库。
|
||||
|
||||
* free repo 包含开源软件。
|
||||
* nonfree repo 包含没有开源协议的软件,但是它们的源文件代码却是可以自由使用的。
|
||||
|
||||
[RPM Fusion][3] 是 Fedora 的第三方应用程序的主要来源。RPM Fusion 是由三个项目(Dribble、Freshrpms 和 Livna)合并而成的。RPM Fusion 提供两种不同的软件存储库。
|
||||
|
||||
* free 存储库:包含开源软件。
|
||||
* nonfree 存储库:包含没有开源协议的软件,但是它们的源文件代码却是可以自由使用的。
|
||||
|
||||
这里有两种方法来启动 RPM Fusion:从终端启用,或通过点击几个按钮来启用。我们将逐一查看。
|
||||
|
||||
#### 方法 1: 命令行方法
|
||||
#### 方法 1:命令行方法
|
||||
|
||||
这是启用 RPM Fusion 存储库的最简单的方法。只需要输入下面的命令即可启用两个存储库:
|
||||
|
||||
@ -47,15 +45,15 @@ Fedora 强制执行下面的 [准则][2] ,当它打包软件包时:
|
||||
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
|
||||
```
|
||||
|
||||
你将被要求输入密码。你将被要求验证是否你想要安装这些存储库。在你核准它后,安装过程将在几秒钟或几分钟内完成。
|
||||
会要求你输入密码、确认是否你想要安装这些存储库。在你确认后,安装过程将在几秒钟或几分钟内完成。
|
||||
|
||||
![通过命令行安装 RPM Fusion ][4]
|
||||
![通过命令行安装 RPM Fusion][4]
|
||||
|
||||
#### 方法 2: 图形用户界面方法
|
||||
#### 方法 2:图形用户界面方法
|
||||
|
||||
使用这个方法来启用 RPM Fusion 存储库,你需要访问 [RPM Fusion 网站][5] 。你将看到针对不同 Fedora 版本的两个存储库的链接。
|
||||
|
||||
RPM Fusion 建议先安装 free 存储库。因此,单击针对你 Fedora 版本的 free 存储库的链接。这将打开一个窗口来询问你是否想安装存储库。单击安装。
|
||||
RPM Fusion 建议先安装 free 存储库。因此,单击针对你 Fedora 版本的 free 存储库的链接。然后会打开一个窗口来询问你是否想安装该存储库。单击安装。
|
||||
|
||||
![通过图形用户界面安装 RPM Fusion][6]
|
||||
|
||||
@ -63,11 +61,11 @@ RPM Fusion 建议先安装 free 存储库。因此,单击针对你 Fedora 版
|
||||
|
||||
### 启用 Fedora 的第三方存储库
|
||||
|
||||
Fedora 最近开始提供它自己的 [第三方应用程序存储库][7] 。在这个存储库中 [可使用的应用程序的数量][8] 是非常少的。你可以 [使用它来在 Fedora 上安装 Chrome 浏览器][9] 。除 Chrome 外,它也包含 Adobe Brackets ,Atom ,Steam ,Vivaldi ,Opera 等应用程序。
|
||||
Fedora 最近开始提供它自己的 [第三方应用程序存储库][7] 。在这个存储库中 [可使用的应用程序的数量][8] 是非常少的。你可以 [使用它来在 Fedora 上安装 Chrome 浏览器][9] 。除 Chrome 外,它也包含 Adobe Brackets、Atom、Steam、Vivaldi、Opera 等应用程序。
|
||||
|
||||
就像 RPM Fusion 一样,你可以通过终端或图形用户界面的方法来启用这个存储库。
|
||||
|
||||
#### 方法 1: 命令行方法
|
||||
#### 方法 1:命令行方法
|
||||
|
||||
为启用 Fedora 的第三方存储库,输入下面的命令到你的终端中:
|
||||
|
||||
@ -75,23 +73,23 @@ Fedora 最近开始提供它自己的 [第三方应用程序存储库][7] 。在
|
||||
sudo dnf install fedora-workstation-repositories
|
||||
```
|
||||
|
||||
当被提示时,确保输入你的密码并输入 Y 来核准安装。
|
||||
当被提示时,确保输入你的密码并输入 `Y` 来确认安装。
|
||||
|
||||
#### 方法2 1: 图形用户界面方法
|
||||
#### 方法 2:图形用户界面方法
|
||||
|
||||
如果你不习惯使用终端,你可以使用图形用户界面方法。
|
||||
|
||||
首先,你需要打开 Gnome 软件。接下来,你需要单击右上角的 hamburger 菜单,并从菜单中选择“软件存储库”。
|
||||
首先,你需要打开 Gnome “软件”。接下来,你需要单击右上角的汉堡菜单,并从菜单中选择“软件存储库”。
|
||||
|
||||
![Gnome 软件菜单][10]
|
||||
![Gnome 软件的菜单][10]
|
||||
|
||||
在软件存储库窗口中,你将在其顶部看到写着 “第三方存储库” 字样的部分。单击安装按钮。当你被提示时,输入你的密码。
|
||||
在软件存储库窗口中,你将在其顶部看到写着 “第三方存储库” 字样的部分。单击“安装”按钮。当你被提示时,输入你的密码。
|
||||
|
||||
![Fedora 第三方存储库安装][11]
|
||||
|
||||
随着这些附加存储库的启用,你可以安装软件到你的核心的内容中。你可以从软件中心管理器或使用 DNF 软件包管理器来轻松地安装它们。
|
||||
随着这些附加存储库的启用,你可以安装软件到你的系统当中。你可以从软件中心管理器或使用 DNF 软件包管理器来轻松地安装它们。
|
||||
|
||||
如果你发现这篇文章很有趣,请花费一些时间来在社交媒体,Hacker News ,或 [Re][12][d][12][dit][12] 上分享。
|
||||
如果你发现这篇文章很有趣,请花费一些时间来在社交媒体上分享它。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -100,7 +98,7 @@ via: https://itsfoss.com/fedora-third-party-repos/
|
||||
作者:[John Paul][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[robsean](https://github.com/robsean)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,119 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Try Jed as your Linux terminal text editor)
|
||||
[#]: via: (https://opensource.com/article/20/12/jed)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
Try Jed as your Linux terminal text editor
|
||||
======
|
||||
Jed's handy drop-down menu makes it easy for users who are new to
|
||||
terminal text editors.
|
||||
![Person using a laptop][1]
|
||||
|
||||
You may have heard about Emacs and Vim and Nano, the quintessential Linux text editors, but Linux has an abundance of open source text editors, and it's my goal to spend December giving 31 of them a fair go.
|
||||
|
||||
In this article, I look at [Jed][2], a terminal-based editor featuring a handy drop-down menu, which makes it especially easy for users who are new to terminal editors, as well as those who just don't like remembering keyboard combinations for every function.
|
||||
|
||||
### Install Jed
|
||||
|
||||
On Linux, your distribution's software repository may make Jed available to install through your package manager:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install jed`
|
||||
```
|
||||
|
||||
Not all do, but it's an easy application to compile from source code. First, download [S-Lang][3] (the language Jed is written in) and install it:
|
||||
|
||||
|
||||
```
|
||||
$ wget <https://www.jedsoft.org/releases/slang/slang-x.y.z.tar.bz2>
|
||||
$ tar xvf slang*bz2
|
||||
$ cd slang-x.y.z
|
||||
$ ./configure ; make
|
||||
$ sudo make install
|
||||
```
|
||||
|
||||
Once that's installed, do the same with the [Jed source code][4]:
|
||||
|
||||
|
||||
```
|
||||
$ wget <https://www.jedsoft.org/releases/jed/jed-x.y.z.tar.bz2>
|
||||
$ tar xvf jed*bz2
|
||||
$ cd jed-x.y.z
|
||||
$ ./configure ; make
|
||||
$ sudo make install
|
||||
```
|
||||
|
||||
### Launch Jed
|
||||
|
||||
Jed runs in a terminal, so to start it, just open a terminal and type `jed`:
|
||||
|
||||
|
||||
```
|
||||
F10 key ==> File Edit Search Buffers Windows System Help
|
||||
|
||||
This is a scratch buffer. It is NOT saved when you exit.
|
||||
|
||||
To access the menus, press F10 or ESC-m and the use the arrow
|
||||
keys to navigate.
|
||||
|
||||
Latest version information is available on the web from
|
||||
<[http://www.jedsoft.org/jed/\>][5]. Other sources of JED
|
||||
information include the usenet newsgroups comp.editors and
|
||||
alt.lang.s-lang. To subscribe to the jed-users mailing list, see
|
||||
<[http://www.jedsoft.org/jed/mailinglists.html\>][6].
|
||||
|
||||
Copyright (C) 1994, 2000-2009 John E. Davis
|
||||
Email comments or suggestions to <[jed@jedsoft.org][7]>.
|
||||
|
||||
[ (Jed 0.99.19U) Emacs: *scratch* () 1/16 8:49am ]
|
||||
```
|
||||
|
||||
### How to use Jed
|
||||
|
||||
The instructions that Jed auto-loads are clear and helpful. You can press either the **F10** key or the **Esc** key followed by the letter **M** to enter the top menu. This places your cursor into the menu bar at the top of the Jed screen, but it doesn't open a menu. To open a menu, press **Enter** or **Return** on your keyboard. Use the arrow keys to navigate through each menu.
|
||||
|
||||
The onscreen menu is not only helpful for first-time users, it also provides great reminders of keyboard shortcuts for experienced users. For instance, you can probably guess how to save a file you've been working on: Go to the **File** menu and select **Save**. If you want to speed that process up, you can learn the keyboard combination of **Ctrl**+**X** and then **Ctrl**+**S** (yes, that's two keyboard shortcuts in succession).
|
||||
|
||||
### Explore Jed's features
|
||||
|
||||
For a simple editor, Jed has a surprising list of useful features. It's got a built-in multiplexer, allowing you to have multiple files open at once but "stacked" on top of one another, so you can shuffle through them. You can split your Jed window to have multiple files onscreen at once, change your color theme, or open a shell.
|
||||
|
||||
For anyone experienced with Emacs, many of Jed's "unadvertised" features, such as keyboard combinations for navigation and control, are instantly familiar. Then again, there's a slight learning (or maybe unlearning) curve when a keyboard combination is drastically different from what you expect. For example, **Alt**+**B** in GNU Emacs moves the cursor back a word, but in Jed, by default, it's a shortcut for the **Buffers** menu. This caught me off-guard about once each sentence of this article.
|
||||
|
||||
![Jed][8]
|
||||
|
||||
Jed also has **modes** that allow you to load modules or plugins to help you write specific kinds of text. For instance, I wrote this article using the default `text_mode`, but I was able to switch over to `lua` mode when hacking on a [Lua][9] script. These modes offer syntax highlighting and help with matching parentheses and other delimiting characters. You can see which modes are bundled with Jed by looking in `/usr/share/jed/lib` and because they're written in S-Lang, you can review the code and possibly learn a new language.
|
||||
|
||||
### Try Jed
|
||||
|
||||
Jed is a pleasant and refreshingly clear text editor for your Linux terminal. It's lightweight, easy to use, and relatively uncomplicated in design. As an alternative to Vi for quick edits, you can set Jed as `EDITOR` and `VISUAL` in your `~/.bashrc` file (and in your root user's `~/.bashrc` file if you're root). Try Jed today.
|
||||
|
||||
Want to become a master of text editing in the terminal, and beyond? These tips for getting started...
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/12/jed
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop)
|
||||
[2]: https://www.jedsoft.org/jed
|
||||
[3]: https://www.jedsoft.org/releases/slang/
|
||||
[4]: https://www.jedsoft.org/releases/jed
|
||||
[5]: http://www.jedsoft.org/jed/\>
|
||||
[6]: http://www.jedsoft.org/jed/mailinglists.html\>
|
||||
[7]: mailto:jed@jedsoft.org
|
||||
[8]: https://opensource.com/sites/default/files/jed.png (Jed)
|
||||
[9]: https://opensource.com/article/20/2/lua-cheat-sheet
|
@ -0,0 +1,272 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Add storage to your Fedora system with LVM)
|
||||
[#]: via: (https://fedoramagazine.org/add-storage-to-your-fedora-system-with-lvm/)
|
||||
[#]: author: (Tim Bosse https://fedoramagazine.org/author/maztaim/)
|
||||
|
||||
Add storage to your Fedora system with LVM
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
Sometimes there is a need to add another disk to your system. This is where Logical Volume Management (LVM) comes in handy. The cool thing about LVM is that it’s fairly flexible. There are several ways to add a disk. This article describes one way to do it.
|
||||
|
||||
### Heads up!
|
||||
|
||||
This article does not cover the process of physically installing a new disk drive into your system. Consult your system and disk documentation on how to do that properly.
|
||||
|
||||
**Important:** Always make sure you have backups of important data. The steps described in this article will destroy data if it already exists on the new disk.
|
||||
|
||||
### Good to know
|
||||
|
||||
This article doesn’t cover every LVM feature deeply; the focus is on adding a disk. But basically, LVM has _volume groups_, made up of one or more partitions and/or disks. You add the partitions or disks as _physical volumes_. A volume group can be broken down into many _logical volumes_. Logical volumes can be used as any other storage for filesystems, ramdisks, etc. More information can be found [here][2].
|
||||
|
||||
Think of the _physical volumes_ as forming a pool of storage (a _volume group_) from which you then carve out _logical volumes_ for your system to use directly.
|
||||
|
||||
### Preparation
|
||||
|
||||
Make sure you can see the disk you want to add. Use _lsblk_ prior to adding the disk to see what storage is already available or in use.
|
||||
|
||||
```
|
||||
$ lsblk
|
||||
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
|
||||
zram0 251:0 0 989M 0 disk [SWAP]
|
||||
vda 252:0 0 20G 0 disk
|
||||
├─vda1 252:1 0 1G 0 part /boot
|
||||
└─vda2 252:2 0 19G 0 part
|
||||
└─fedora_fedora-root 253:0 0 19G 0 lvm /
|
||||
```
|
||||
|
||||
This article uses a virtual machine with virtual storage. Therefore the device names start with _vda_ for the first disk, _vdb_ for the second, and so on. The name of your device may be different. Many systems will see physical disks as _sda_ for the first disk, _sdb_ for the second, and so on.
|
||||
|
||||
Once the new disk has been connected and your system is back up and running, use _lsblk_ again to see the new block device.
|
||||
|
||||
```
|
||||
$ lsblk
|
||||
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
|
||||
zram0 251:0 0 989M 0 disk [SWAP]
|
||||
vda 252:0 0 20G 0 disk
|
||||
├─vda1 252:1 0 1G 0 part /boot
|
||||
└─vda2 252:2 0 19G 0 part
|
||||
└─fedora_fedora-root 253:0 0 19G 0 lvm /
|
||||
vdb 252:16 0 10G 0 disk
|
||||
```
|
||||
|
||||
There is now a new device named _vdb_. The location for the device is _/dev/vdb_.
|
||||
|
||||
```
|
||||
$ ls -l /dev/vdb
|
||||
brw-rw----. 1 root disk 252, 16 Nov 24 12:56 /dev/vdb
|
||||
```
|
||||
|
||||
We can see the disk, but we cannot use it with LVM yet. If you run _blkid_ you should not see it listed. For this and following commands, you’ll need to ensure your system is [configured so you can use _sudo_][3]:
|
||||
|
||||
```
|
||||
$ sudo blkid
|
||||
/dev/vda1: UUID="4847cb4d-6666-47e3-9e3b-12d83b2d2448" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="830679b8-01"
|
||||
/dev/vda2: UUID="k5eWpP-6MXw-foh5-Vbgg-JMZ1-VEf9-ARaGNd" TYPE="LVM2_member" PARTUUID="830679b8-02"
|
||||
/dev/mapper/fedora_fedora-root: UUID="f8ab802f-8c5f-4766-af33-90e78573f3cc" BLOCK_SIZE="4096" TYPE="ext4"
|
||||
/dev/zram0: UUID="fc6d7a48-2bd5-4066-9bcf-f062b61f6a60" TYPE="swap"
|
||||
```
|
||||
|
||||
### Add the disk to LVM
|
||||
|
||||
Initialize the disk using _pvcreate_. You need to pass the full path to the device. In this example it is _/dev/vdb_; on your system it may be _/dev/sdb_ or another device name.
|
||||
|
||||
```
|
||||
$ sudo pvcreate /dev/vdb
|
||||
Physical volume "/dev/vdb" successfully created.
|
||||
```
|
||||
|
||||
You should see the disk has been initialized as an LVM2_member when you run _blkid_:
|
||||
|
||||
```
|
||||
$ sudo blkid
|
||||
/dev/vda1: UUID="4847cb4d-6666-47e3-9e3b-12d83b2d2448" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="830679b8-01"
|
||||
/dev/vda2: UUID="k5eWpP-6MXw-foh5-Vbgg-JMZ1-VEf9-ARaGNd" TYPE="LVM2_member" PARTUUID="830679b8-02"
|
||||
/dev/mapper/fedora_fedora-root: UUID="f8ab802f-8c5f-4766-af33-90e78573f3cc" BLOCK_SIZE="4096" TYPE="ext4"
|
||||
/dev/zram0: UUID="fc6d7a48-2bd5-4066-9bcf-f062b61f6a60" TYPE="swap"
|
||||
/dev/vdb: UUID="4uUUuI-lMQY-WyS5-lo0W-lqjW-Qvqw-RqeroE" TYPE="LVM2_member"
|
||||
```
|
||||
|
||||
You can list all physical volumes currently available using _pvs_:
|
||||
|
||||
```
|
||||
$ sudo pvs
|
||||
PV VG Fmt Attr PSize PFree
|
||||
/dev/vda2 fedora_fedora lvm2 a-- <19.00g 0
|
||||
/dev/vdb lvm2 --- 10.00g 10.00g
|
||||
```
|
||||
|
||||
_/dev/vdb_ is listed as a PV (phsyical volume), but it isn’t assigned to a VG (Volume Group) yet.
|
||||
|
||||
### Add the pysical volume to a volume group
|
||||
|
||||
You can find a list of available volume groups using _vgs_:
|
||||
|
||||
```
|
||||
$ sudo vgs
|
||||
VG #PV #LV #SN Attr VSize VFree
|
||||
fedora_fedora 1 1 0 wz--n- 19.00g 0
|
||||
```
|
||||
|
||||
In this example, there is only one volume group available. Next, add the physical volume to _fedora_fedora_:
|
||||
|
||||
```
|
||||
$ sudo vgextend fedora_fedora /dev/vdb
|
||||
Volume group "fedora_fedora" successfully extended
|
||||
```
|
||||
|
||||
You should now see the physical volume is added to the volume group:
|
||||
|
||||
```
|
||||
$ sudo pvs
|
||||
PV VG Fmt Attr PSize PFree
|
||||
/dev/vda2 fedora_fedora lvm2 a– <19.00g 0
|
||||
/dev/vdb fedora_fedora lvm2 a– <10.00g <10.00g
|
||||
```
|
||||
|
||||
Look at the volume groups:
|
||||
|
||||
```
|
||||
$ sudo vgs
|
||||
VG #PV #LV #SN Attr VSize VFree
|
||||
fedora_fedora 2 1 0 wz–n- 28.99g <10.00g
|
||||
```
|
||||
|
||||
You can get a detailed list of the specific volume group and physical volumes as well:
|
||||
|
||||
```
|
||||
$ sudo vgdisplay fedora_fedora
|
||||
--- Volume group ---
|
||||
VG Name fedora_fedora
|
||||
System ID
|
||||
Format lvm2
|
||||
Metadata Areas 2
|
||||
Metadata Sequence No 3
|
||||
VG Access read/write
|
||||
VG Status resizable
|
||||
MAX LV 0
|
||||
Cur LV 1
|
||||
Open LV 1
|
||||
Max PV 0
|
||||
Cur PV 2
|
||||
Act PV 2
|
||||
VG Size 28.99 GiB
|
||||
PE Size 4.00 MiB
|
||||
Total PE 7422
|
||||
Alloc PE / Size 4863 / 19.00 GiB
|
||||
Free PE / Size 2559 / 10.00 GiB
|
||||
VG UUID C5dL2s-dirA-SQ15-TfQU-T3yt-l83E-oI6pkp
|
||||
```
|
||||
|
||||
Look at the PV:
|
||||
|
||||
```
|
||||
$ sudo pvdisplay /dev/vdb
|
||||
--- Physical volume ---
|
||||
PV Name /dev/vdb
|
||||
VG Name fedora_fedora
|
||||
PV Size 10.00 GiB / not usable 4.00 MiB
|
||||
Allocatable yes
|
||||
PE Size 4.00 MiB
|
||||
Total PE 2559
|
||||
Free PE 2559
|
||||
Allocated PE 0
|
||||
PV UUID 4uUUuI-lMQY-WyS5-lo0W-lqjW-Qvqw-RqeroE
|
||||
```
|
||||
|
||||
Now that we have added the disk, we can allocate space to logical volumes (LVs):
|
||||
|
||||
```
|
||||
$ sudo lvs
|
||||
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
|
||||
root fedora_fedora -wi-ao---- 19.00g
|
||||
```
|
||||
|
||||
Look at the logical volumes. Here’s a detailed look at the root LV:
|
||||
|
||||
```
|
||||
$ sudo lvdisplay fedora_fedora/root
|
||||
--- Logical volume ---
|
||||
LV Path /dev/fedora_fedora/root
|
||||
LV Name root
|
||||
VG Name fedora_fedora
|
||||
LV UUID yqc9cw-AvOw-G1Ni-bCT3-3HAa-qnw3-qUSHGM
|
||||
LV Write Access read/write
|
||||
LV Creation host, time fedora, 2020-11-24 11:44:36 -0500
|
||||
LV Status available
|
||||
LV Size 19.00 GiB
|
||||
Current LE 4863
|
||||
Segments 1
|
||||
Allocation inherit
|
||||
Read ahead sectors auto
|
||||
- currently set to 256
|
||||
Block device 253:0
|
||||
```
|
||||
|
||||
Look at the size of the root filesystem and compare it to the logical volume size.
|
||||
|
||||
```
|
||||
$ df -h /
|
||||
Filesystem Size Used Avail Use% Mounted on
|
||||
/dev/mapper/fedora_fedora-root 19G 1.4G 17G 8% /
|
||||
```
|
||||
|
||||
The logical volume and the filesystem both agree the size is 19G. Let’s add 5G to the root logical volume:
|
||||
|
||||
```
|
||||
$ sudo lvresize -L +5G fedora_fedora/root
|
||||
Size of logical volume fedora_fedora/root changed from 19.00 GiB (4863 extents) to 24.00 GiB (6143 extents).
|
||||
Logical volume fedora_fedora/root successfully resized.
|
||||
```
|
||||
|
||||
We now have 24G available to the logical volume. Look at the _/_ filesystem.
|
||||
|
||||
```
|
||||
$ df -h /
|
||||
Filesystem Size Used Avail Use% Mounted on
|
||||
/dev/mapper/fedora_fedora-root 19G 1.4G 17G 8% /
|
||||
```
|
||||
|
||||
We are still showing only 19G free. This is because the logical volume is not the same as the filesytem. To use the new space added to the logical volume, resize the filesystem.
|
||||
|
||||
```
|
||||
$ sudo resize2fs /dev/fedora_fedora/root
|
||||
resize2fs 1.45.6 (20-Mar-2020)
|
||||
Filesystem at /dev/fedora_fedora/root is mounted on /; on-line resizing required
|
||||
old_desc_blocks = 3, new_desc_blocks = 3
|
||||
The filesystem on /dev/fedora_fedora/root is now 6290432 (4k) blocks long.
|
||||
```
|
||||
|
||||
Look at the size of the filesystem.
|
||||
|
||||
```
|
||||
$ df -h /
|
||||
Filesystem Size Used Avail Use% Mounted on
|
||||
/dev/mapper/fedora_fedora-root 24G 1.4G 21G 7% /
|
||||
```
|
||||
|
||||
As you can see, the root file system _(/)_ has taken all of the space available on the logical volume and no reboot was needed.
|
||||
|
||||
You have now initialized a disk as a physical volume, and extended the volume group with the new physical volume. After that you increased the size of the logical volume, and resized the filesystem to use the new space from the logical volume.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/add-storage-to-your-fedora-system-with-lvm/
|
||||
|
||||
作者:[Tim Bosse][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/maztaim/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2020/11/lvm-add-disk-816x345.jpg
|
||||
[2]: https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)
|
||||
[3]: https://fedoramagazine.org/howto-use-sudo/
|
@ -0,0 +1,182 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Manage multiple service instances with systemctl)
|
||||
[#]: via: (https://opensource.com/article/20/12/multiple-service-instances-systemctl)
|
||||
[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss)
|
||||
|
||||
Manage multiple service instances with systemctl
|
||||
======
|
||||
Running several instances of a service on a single host gets easier with
|
||||
a systemd hack.
|
||||
![People work on a computer server with devices][1]
|
||||
|
||||
Services, services, services. A service is a huge part of computing. You're reading this article on a service. Your computer is running services. The internet is filled with them.
|
||||
|
||||
### About systemctl
|
||||
|
||||
On Linux, the standard way of running and managing services is through the systemd utility and the command `systemctl`. Its usage is fairly simple: you just need to know the name of the service you want to manage, then you can use this command to start or stop the service, check its status, or do other functions:
|
||||
|
||||
|
||||
```
|
||||
# systemctl start httpd
|
||||
|
||||
# systemctl stop httpd
|
||||
|
||||
# systemctl status httpd
|
||||
```
|
||||
|
||||
### Unit files
|
||||
|
||||
A service is defined in a file called a unit file. They are generally located in the directory `/usr/lib/systemd/system`. Here's a sample list:
|
||||
|
||||
|
||||
```
|
||||
# ls /usr/lib/systemd/system
|
||||
auditd.service multi-user.target sys-kernel-debug.mount
|
||||
[autovt@.service][2] multi-user.target.wants sys-kernel-tracing.mount
|
||||
basic.target NetworkManager-dispatcher.service syslog.socket
|
||||
basic.target.wants NetworkManager.service syslog.target.wants
|
||||
blk-availability.service NetworkManager-wait-online.service
|
||||
```
|
||||
|
||||
Sometimes you need to run more than one instance of a service on a single host. For example, if you are maintaining websites for several clients, security regulations demand that each client has its own individual instance. This means you need to run a new Apache HTTP service for each, but having a lot of services can be tough to manage. If you have 10 different customers, you would have to create 10 separate unit files to manage them. Fortunately, there is a better way to handle multiple instances of a service.
|
||||
|
||||
### The @ symbol
|
||||
|
||||
Notice that some of the unit files have an @ symbol in their name. This symbol has an interesting significance. As a matter of fact, after installing Apache HTTP Server, you may notice several service unit files, including one that has the @ symbol in its name—`httpd@.service`.
|
||||
|
||||
I will show you how this can make a system administrator's life a little easier, using the Apache HTTP Server for this example:
|
||||
|
||||
|
||||
```
|
||||
# dnf -y install httpd
|
||||
|
||||
# cd /usr/lib/systemd/system
|
||||
# ls -d http*
|
||||
httpd.service [httpd@.service][3] httpd.service.d httpd.socket httpd.socket.d
|
||||
```
|
||||
|
||||
The @ symbol indicates that a substitution will be made. Systemd will take whatever you type after it and replace the variable `%i` inside the service unit file. The variable can be seen in this excerpt of the `httpd@.service` file:
|
||||
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=The Apache HTTP Server
|
||||
After=network.target remote-fs.target nss-lookup.target
|
||||
Documentation=man:[httpd@.service][3](8)
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
Environment=LANG=C
|
||||
Environment=HTTPD_INSTANCE=%i
|
||||
ExecStartPre=/bin/mkdir -m 710 -p /run/httpd/instance-%i
|
||||
ExecStartPre=/bin/chown root.apache /run/httpd/instance-%i
|
||||
ExecStartPre=/bin/mkdir -m 700 -p /var/lib/httpd/instance-%i
|
||||
ExecStartPre=/bin/chown apache.apache /var/lib/httpd/instance-%i
|
||||
ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND -f conf/%i.conf
|
||||
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful -f conf/%i.conf
|
||||
```
|
||||
|
||||
Note that the default httpd unit file, `httpd.service`, does not have the @ symbol in its name and looks different. It is used for a single basic default instance of the Apache HTTP server.
|
||||
|
||||
### Run multiple instances
|
||||
|
||||
To run multiple instances using this special unit file, each one needs a unique name. Suppose you have two clients, The Little Bank and The Big Bank. Name the instances littlebank and bigbank. To manage one, just append its name after the @ symbol. Start each instance with the appropriate command:
|
||||
|
||||
* littlebank: `systemctl start httpd@littlebank`
|
||||
* bigbank: `systemctl start httpd@bigbank`
|
||||
|
||||
|
||||
|
||||
Keep in mind that most services need certain configurations to avoid conflicts between different instances. I will not cover all of them here, but Apache needs several things, including unique listen port numbers, PID files, and document roots.
|
||||
|
||||
I'll demonstrate by trying to start the littlebank instance. I expect it to fail, but it will provide a useful status message:
|
||||
|
||||
|
||||
```
|
||||
# systemctl start httpd@littlebank
|
||||
|
||||
# systemctl status httpd@littlebank
|
||||
● [httpd@littlebank.service][4] \- The Apache HTTP Server
|
||||
Loaded: loaded (/usr/lib/systemd/system/httpd@.service; disabled; vendor preset: disabled)
|
||||
Active: failed (Result: exit-code) since Tue 2020-11-10 11:41:20 EST; 1min 58s ago
|
||||
Docs: man:[httpd@.service][3](8)
|
||||
Process: 2205 ExecStartPre=/bin/mkdir -m 710 -p /run/httpd/instance-littlebank (code=exited, status=0/SUCCESS)
|
||||
Process: 2207 ExecStartPre=/bin/chown root.apache /run/httpd/instance-littlebank (code=exited, status=0/SUCCESS)
|
||||
Process: 2208 ExecStartPre=/bin/mkdir -m 700 -p /var/lib/httpd/instance-littlebank (code=exited, status=0/SUCCESS)
|
||||
Process: 2209 ExecStartPre=/bin/chown apache.apache /var/lib/httpd/instance-littlebank (code=exited, status=0/SUCCESS)
|
||||
Process: 2210 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND -f conf/littlebank.conf (code=exited, status=1/FAILURE)
|
||||
Main PID: 2210 (code=exited, status=1/FAILURE)
|
||||
CPU: 26ms
|
||||
|
||||
Nov 10 11:41:20 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
|
||||
Nov 10 11:41:20 localhost.localdomain httpd[2210]: httpd: Could not open configuration file /etc/httpd/conf/littlebank.conf>
|
||||
Nov 10 11:41:20 localhost.localdomain systemd[1]: [httpd@littlebank.service][4]: Main process exited, code=exited, status=1/FAIL>
|
||||
Nov 10 11:41:20 localhost.localdomain systemd[1]: [httpd@littlebank.service][4]: Failed with result 'exit-code'.
|
||||
Nov 10 11:41:20 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
|
||||
```
|
||||
|
||||
You can see that systemd correctly substitutes the instance name in place of the `%i` variable in the unit file. However, Apache fails to start because it could not open a configuration file. So, now I'll set up the instances to include creating the necessary configuration files (`littlebank.conf` and `bigbank.conf`) in `/etc/httpd/conf/`:
|
||||
|
||||
|
||||
```
|
||||
# ls /etc/httpd/conf
|
||||
bigbank.conf httpd.conf littlebank.conf
|
||||
```
|
||||
|
||||
Now you can manage each instance with `systemctl`. Issue `start` and `status` commands to each. I've shortened the output to the most relevant details:
|
||||
|
||||
|
||||
```
|
||||
# systemctl start httpd@bigbank
|
||||
# systemctl start httpd@littlebank
|
||||
|
||||
# systemctl status httpd@bigbank
|
||||
● [httpd@bigbank.service][5] \- The Apache HTTP Server
|
||||
Loaded: loaded (/usr/lib/systemd/system/httpd@.service; disabled; vendor preset: disabled)
|
||||
Active: active (running) since Tue 2020-11-10 12:26:06 EST; 56min ago
|
||||
|
||||
# systemctl status httpd@littlebank
|
||||
● [httpd@littlebank.service][4] \- The Apache HTTP Server
|
||||
Loaded: loaded (/usr/lib/systemd/system/httpd@.service; disabled; vendor preset: disabled)
|
||||
Active: active (running) since Tue 2020-11-10 12:25:58 EST; 55min ago
|
||||
```
|
||||
|
||||
Here is the process view of these instances. There is more than one because Apache is forking server processes, which it normally does:
|
||||
|
||||
|
||||
```
|
||||
# pgrep -a httpd
|
||||
2834 /usr/sbin/httpd -DFOREGROUND -f conf/littlebank.conf
|
||||
2835 /usr/sbin/httpd -DFOREGROUND -f conf/littlebank.conf
|
||||
2836 /usr/sbin/httpd -DFOREGROUND -f conf/littlebank.conf
|
||||
3061 /usr/sbin/httpd -DFOREGROUND -f conf/bigbank.conf
|
||||
3062 /usr/sbin/httpd -DFOREGROUND -f conf/bigbank.conf
|
||||
3064 /usr/sbin/httpd -DFOREGROUND -f conf/bigbank.conf
|
||||
```
|
||||
|
||||
### Put it to use
|
||||
|
||||
This small systemd feature is very useful when you need many instances of a service. I hope you will be able to put it to good use in your work.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/12/multiple-service-instances-systemctl
|
||||
|
||||
作者:[Alan Formy-Duval][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/alanfdoss
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices)
|
||||
[2]: mailto:autovt@.service
|
||||
[3]: mailto:httpd@.service
|
||||
[4]: mailto:httpd@littlebank.service
|
||||
[5]: mailto:httpd@bigbank.service
|
@ -0,0 +1,71 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Optimize your GNOME experience with the Gedit text editor)
|
||||
[#]: via: (https://opensource.com/article/20/12/gedit)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
Optimize your GNOME experience with the Gedit text editor
|
||||
======
|
||||
It's a minimalistic editor that gets the job done, enhanced with great
|
||||
hidden features to make things easier.
|
||||
![Working from home at a laptop][1]
|
||||
|
||||
Being the default text editor is a thankless job. People usually regard a default text editor almost as a demo app—a slightly elevated "hello world" example of how an application on that platform is meant to run. Users resort to the default text editor in the rare occasions they need to dump some text into a file they’ll probably never look at again. For "serious" work, they turn to a word processor or an IDE, or an editor in the terminal, or at least a different text editor that has to be downloaded and installed like a "real" application.
|
||||
|
||||
It’s strangely difficult for a default text editor to be taken seriously, and yet the GNOME desktop’s editor, Gedit, is widely regarded as a truly valuable text editor beyond its parent desktop. It’s used as the required text editor in web design classes, a recommended tool for new developers and sysadmins, and a favorite reliable companion to many a desktop Linux user.
|
||||
|
||||
### Installing gedit
|
||||
|
||||
If you’re running the GNOME desktop, you probably already have gedit installed, although it may come up only as "Text Editor" in your application menu. If you’re not sure, just type **gedit** into your Activities screen, and then navigate to the **About** menu item in the text editor that opens.
|
||||
|
||||
![gedit terminal box with black background and white letters][2]
|
||||
|
||||
On Windows, you can download and [install gedit from the Microsoft Store][3].
|
||||
|
||||
On Mac, you can install gedit [using Homebrew][4] or [MacPorts][5].
|
||||
|
||||
### Using gedit
|
||||
|
||||
When you first launch gedit, you’ll get a minimalistic interface consisting of a text entry pane, a title bar, and a status panel at the bottom of the window. The bottom status panel provides quick access to a few common settings—what syntax highlighting schema you’d like to use, what tab width you prefer, and a few popular preferences such as line numbering, text wrapping, and so on. Most of these options can also be set globally in the Preferences menu, which is found in the "hamburger" menu in the top right corner of the application.
|
||||
|
||||
### Hidden features of gedit
|
||||
|
||||
On the surface, gedit is exactly what it advertises itself to be: a humble text editor that stays out of your way so you can type letters into a box on your screen. But this simple text editor is hiding several exciting features you may not know about, even if you’ve been using it for years.
|
||||
|
||||
These keyboard functions aren’t documented anywhere within gedit:
|
||||
|
||||
* **Ctrl+D** deletes the current line. This is especially useful for coders or those who write in a markdown format (such as Asciidoc, reST, or CommonMark).
|
||||
* **Ctrl+I** brings up the **Go to Line** drop-down field. Type in a number, and you’re taken immediately to that line number.
|
||||
* **Alt+Up-Arrow** or **Alt+Down-Arrow** grabs the current line and moves it up or down in your document.
|
||||
* **Alt-Left-Arrow** or **Alt+Right-Arrow** grabs the nearest word (to the left of the cursor) and moves it left or right.
|
||||
* To type a special Unicode character, press and release **Shift+Ctrl+U** and then type the Unicode character code. You usually have to look up the character code (unless you have some memorized, but who has available memory for character codes?) For instance, to render a penguin, press, and release **Shift+Ctrl+U**. After you’ve released the keys, you’re left with an underlined U, so type **1F427** followed by a space, and your Unicode entry is transformed into a friendly 🐧. Admittedly, this isn’t entirely unique to gedit, but it’s a useful trick to know, and it does work in gedit.
|
||||
|
||||
|
||||
|
||||
### Robust simplicity
|
||||
|
||||
Gedit is a lot like GNOME itself. It is objectively simpler than many of its peers (such as Kate from KDE), and yet it still manages to meet 80% or 90% of your daily expectations.
|
||||
|
||||
Of course, there probably will be a task for which gedit isn’t the best tool. You might find yourself delving deep into some unique log files or in need of a precise parser or linter, and you’ll move to a specialized application. That’s alright. Gedit isn’t meant to be everything to all users. But it is a great text editor for those in need of one, and sometimes that’s all that's required. Give gedit a try on Linux, or on whatever platform you’re using, because the chances are good that it’s a better choice than the default.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/12/gedit
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop)
|
||||
[2]: https://opensource.com/sites/default/files/uploads/gedit-31_days_gedit-opensource.jpg (gedit terminal box with black background and white letters)
|
||||
[3]: https://www.microsoft.com/en-nz/p/gedit
|
||||
[4]: https://opensource.com/article/20/6/homebrew-mac
|
||||
[5]: https://opensource.com/article/20/11/macports
|
@ -0,0 +1,150 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Set up Home Assistant to manage your open source smart home)
|
||||
[#]: via: (https://opensource.com/article/20/12/home-assistant)
|
||||
[#]: author: (Steve Ovens https://opensource.com/users/stratusss)
|
||||
|
||||
Set up Home Assistant to manage your open source smart home
|
||||
======
|
||||
Learn how to install and configure Home Assistant in the fourth article
|
||||
in this series on home automation.
|
||||
![Working from home at a laptop][1]
|
||||
|
||||
In the [first article][2] in this series, I introduced [Home Assistant][3] and why you might be interested in it. In short, Home Assistant is an automation hub for some of the most common smart devices on the market today. It enables centralized coordination of disparate hardware. By using it, you no longer have to choose suboptimal tech from a single vendor to manage your smart home from a single app. It also means you will no longer struggle with a hundred different apps that all function slightly differently to manage all your devices. One program to rule them all… or at least that's the dream.
|
||||
|
||||
In the second and third articles, I looked at some of the decisions to make when developing home automation, namely [local vs. cloud control][4], and whether to choose [Zigbee, Z-Wave, or WiFi][5], just to hit the high points. This fourth article will be much more hands-on than the previous ones by walking you through setting up a virtual machine (VM) with the Home Assistant-provided image.
|
||||
|
||||
### Set up the VM
|
||||
|
||||
I won't cover all of the methods available for installing Home Assistant (HA). I run HA in a virtualized environment, and the [official installation page][6] provides VMDK, VHDX, VDI, QCOW2, and OVA downloads. I have a [libvirt][7]-based homelab, so I chose the QCOW2 image.
|
||||
|
||||
Regardless of which hypervisor you use, you need to make sure that the boot type is set to UEFI instead of the traditional BIOS. In Arch Linux or Fedora, you need to install the package `edk2-ovmf` to have the option available in [Virt-Manager][8]. In Ubuntu, the package is called `ovmf`. After the package is installed, restart libvirt.
|
||||
|
||||
When you create your VM, select the HA image you downloaded. You can accept the default options that Virt-Manager selects _until the confirmation screen_. Make sure you check the box that says **Customize configuration before install**.
|
||||
|
||||
![Customize configuration before install option][9]
|
||||
|
||||
(Steve Ovens, [CC BY-SA 4.0][10])
|
||||
|
||||
When you do this, make sure to change the firmware to UEFI:
|
||||
|
||||
![Change the firmware to UEFI][11]
|
||||
|
||||
(Steve Ovens, [CC BY-SA 4.0][10])
|
||||
|
||||
**Important note:** You cannot change the firmware type after the VM has been created. If you choose BIOS, the VM will not boot!
|
||||
|
||||
If you need to expand the amount of disk available to HA's VM, shut down the VM and run:
|
||||
|
||||
|
||||
```
|
||||
qemu-img resize hassos_ova-4.13.qcow2 +40G
|
||||
```
|
||||
|
||||
Upon boot, the new space will be automatically allocated to the appropriate partitions.
|
||||
|
||||
The first boot can take a significant amount of time, as HA pulls down the latest versions of software from the internet and prepares them for initial launch and configuration. To be on the safe side, walk away for 10 minutes or so before attempting to pull up the webpage for the first time. In my experience, it often requires less than five minutes, but 10 minutes is a good amount of time for the system to spin up and settle.
|
||||
|
||||
### First-time setup
|
||||
|
||||
You should now be able to access the HA interface by pointing a browser to `http://homeassistant.local:8123`. However, this relies on your router to support automatic DNS registration. You can also access the webpage via its IP. In my case, that's `http://192.168.122.90:8123`.
|
||||
|
||||
![Home Assistant initial setup screen][12]
|
||||
|
||||
(Steve Ovens, [CC BY-SA 4.0][10])
|
||||
|
||||
Enter your username and password for the administrative HA account. Then it will prompt you to select a location.
|
||||
|
||||
![Home Assistant location setup][13]
|
||||
|
||||
(Steve Ovens, [CC BY-SA 4.0][10])
|
||||
|
||||
As you can see, your location is used for "sun-based automations." This means it uses your longitude and latitude to determine sunrise and sunset times and your time zone. If, for example, you have an automation that says, "turn on desk light 20 minutes before sunrise and turn off an hour after sunrise," HA uses this location information to determine what time to activate the lights. Unfortunately, you have to use the graphical map to set this information, and it may not function properly without an active internet connection.
|
||||
|
||||
After you have completed this, you will see a confirmation screen.
|
||||
|
||||
![Home Assistant configuration complete][14]
|
||||
|
||||
(Steve Ovens, [CC BY-SA 4.0][10])
|
||||
|
||||
Rather than setting up devices here, I prefer to click **Finish** and use the full UI to configure my devices. This is optional, of course. This screen may prepopulate some integrations, depending upon whether HA has automatically discovered devices on your network.
|
||||
|
||||
### Initial user settings
|
||||
|
||||
After you finish the initial configuration, you will see the Overview page. HA's default interface is called [Lovelace][15]. It is a powerful [YAML][16]-described interface. This means that even if you can't choose certain user interface (UI) elements in the graphic interface, you can open the built-in YAML editor and add them yourself.
|
||||
|
||||
Lovelace's default view has a single card that displays the weather based on the location you entered. Click your username (_stratus_ in this example) in the bottom-left panel.
|
||||
|
||||
![Home Assistant user profile][17]
|
||||
|
||||
(Steve Ovens, [CC BY-SA 4.0][10])
|
||||
|
||||
This brings up another screen with several options. Find **Advanced Mode** and make sure it is toggled on.
|
||||
|
||||
![Home Assistant user profile options][18]
|
||||
|
||||
(Steve Ovens, [CC BY-SA 4.0][10])
|
||||
|
||||
This setting is toggled _per user_, so if you have other administrative users, only this one (e.g., _stratus_) will have advanced settings turned on. There are quite a few options exposed when toggling **Advanced Mode**, but the one you want is the ability to run a syntax check against the HA configuration files. To see this in action, navigate to **Server Controls** by clicking on the **Configuration** option in the bottom-left panel, and then click on **Server Controls**.
|
||||
|
||||
![Home Assistant server controls][19]
|
||||
|
||||
(Steve Ovens, [CC BY-SA 4.0][10])
|
||||
|
||||
Clicking on the **Check Configuration** button will check all the HA configuration files for syntax errors. If it finds no errors, you will see a message in green that says **Configuration Valid!**
|
||||
|
||||
![Home Assistant configuration valid][20]
|
||||
|
||||
(Steve Ovens, [CC BY-SA 4.0][10])
|
||||
|
||||
### Looking ahead
|
||||
|
||||
Now that HA is set up and configured, you are ready to start really digging into it. In future articles, I will explain how to:
|
||||
|
||||
* Install and configure add-ons
|
||||
* Create snapshots and run HA updates
|
||||
* Install the Home Assistant Community Store (HACS)
|
||||
* Configure entities via the built-in options
|
||||
* Work with MQTT
|
||||
* Create automation flows with NodeRed
|
||||
|
||||
|
||||
|
||||
And much more. If there's something else you want to learn, please share it in the comments. While I am not a Home Assistant expert, I will do my best to answer your questions about it.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/12/home-assistant
|
||||
|
||||
作者:[Steve Ovens][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/stratusss
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop)
|
||||
[2]: https://opensource.com/article/20/11/home-assistant
|
||||
[3]: https://www.home-assistant.io/
|
||||
[4]: https://opensource.com/article/20/11/cloud-vs-local-home-automation
|
||||
[5]: https://opensource.com/article/20/11/home-automation-part-3
|
||||
[6]: https://www.home-assistant.io/hassio/installation/
|
||||
[7]: https://libvirt.org/
|
||||
[8]: https://virt-manager.org/
|
||||
[9]: https://opensource.com/sites/default/files/uploads/libvirt_customize1.png (Customize configuration before install option)
|
||||
[10]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[11]: https://opensource.com/sites/default/files/uploads/libvirt_customize2.png (Change the firmware to UEFI)
|
||||
[12]: https://opensource.com/sites/default/files/uploads/ha-setup1-welcome.png (Home Assistant initial setup screen)
|
||||
[13]: https://opensource.com/sites/default/files/uploads/ha-setup2-location.png (Home Assistant location setup)
|
||||
[14]: https://opensource.com/sites/default/files/uploads/ha-setup3-finish.png (Home Assistant configuration complete)
|
||||
[15]: https://www.home-assistant.io/lovelace/
|
||||
[16]: https://en.wikipedia.org/wiki/YAML
|
||||
[17]: https://opensource.com/sites/default/files/uploads/ha-setup3-user-profile.png (Home Assistant user profile)
|
||||
[18]: https://opensource.com/sites/default/files/uploads/ha-setup4-user-advanced.png (Home Assistant user profile options)
|
||||
[19]: https://opensource.com/sites/default/files/uploads/ha-setup5-server-controls.png (Home Assistant server controls)
|
||||
[20]: https://opensource.com/sites/default/files/uploads/ha-setup6-check_config.png (Home Assistant configuration valid)
|
@ -0,0 +1,123 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Meet Twake, A Modern Open-Source Collaboration Platform [Nextcloud Alternative])
|
||||
[#]: via: (https://itsfoss.com/twake-app/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Meet Twake, A Modern Open-Source Collaboration Platform [Nextcloud Alternative]
|
||||
======
|
||||
|
||||
_**Brief: Twake is a modern looking collaboration platform with focus on Kanban project management methodology. You can use it for free, opt for paid plans, or simply host it yourself.**_
|
||||
|
||||
### Twake: A Modern Open-Source Nextcloud-like Collaboration Platform
|
||||
|
||||
![][1]
|
||||
|
||||
We’ve covered [Nextcloud][2] as one of the finest options to facilitate remote working and collaboration. At It’s FOSS, we use it to store our internal documents, manage tasks via Kanban board and more.
|
||||
|
||||
I’m sure you will find several other options as collaboration platforms. Here, I’m going to give you a brief introduction on something that I stumbled upon i.e. [Twake][3].
|
||||
|
||||
Twake is a modern take on a collaboration platform which aims for a rich user experience along with useful features as well. Unlike [Nextcloud or ownCloud][4], you can opt to use the official hosted instance without any hassle or just self-host it if you want.
|
||||
|
||||
To test how it works and what it offers, I signed up for an account on their official instance with a free account.
|
||||
|
||||
![][5]
|
||||
|
||||
Let’s take a look at some key highlights of Twake.
|
||||
|
||||
### Features of Twake
|
||||
|
||||
![][6]
|
||||
|
||||
You get all the features you’ll find in a standard collaboration platform. You have tools to:
|
||||
|
||||
* Store documents
|
||||
* Manage to-do lists
|
||||
* Create Kanban project boards with tasks deadlines, labels, subtasks and calendar view
|
||||
* Shared calendar
|
||||
* Video conferencing
|
||||
* Slack like discussion boards
|
||||
* Collaboratively edit documents, even MS Office documents
|
||||
* Share documents or invite outsiders to discussions
|
||||
|
||||
|
||||
|
||||
![][7]
|
||||
|
||||
The features that you can make use of will depend on what you’re using. For instance, if you self-host it, you will have no restrictions and can control whatever you need.
|
||||
|
||||
But, if you opt for the free plan on the official instance, you will be limited a single workspace, no guest collaborators, and a few other restrictions.
|
||||
|
||||
Here, I shall list all the key features and leave the rest for you to explore:
|
||||
|
||||
* Collaborative messaging
|
||||
* Ability to create different channels (like Slack, Rocket.chat etc)
|
||||
* Create tasks and manage them
|
||||
* Board view of tasks
|
||||
* Document management support
|
||||
* Calendar view with task as well
|
||||
* Unlimited message history (premium or self-hosted)
|
||||
* Unlimited members (premium or self-hosted)
|
||||
* Direct Messaging support
|
||||
* Invite external members
|
||||
* Guest collaborators (premium or self-hosted)
|
||||
* Application integrations like [Jitsi][8], Giphy
|
||||
* Cross-platform desktop support (Linux, Windows, and macOS)
|
||||
* Mobile apps for Android and iOS
|
||||
* Can be self-hosted
|
||||
|
||||
|
||||
|
||||
### Installing Twake client on Linux Desktop & Server
|
||||
|
||||
![][9]
|
||||
|
||||
For desktop, you just have to head to the download page and get the AppImage file. You might want to read [how to use AppImage files in Linux][10] if you don’t know about it.
|
||||
|
||||
[Twake.app][11]
|
||||
|
||||
If you want to self-host it, you should go through the [official documentation][12] to get the necessary information. Our DevOps team deployed it on our test server using Docker containers and it worked pretty well in our limited testing.
|
||||
|
||||
Can’t self-host? Let us help you
|
||||
|
||||
Deploying open source applications and managing Linux servers takes some expertise and time. If you lack either but still want to have your own instance of open source software like Twake, we can help you out.
|
||||
With our new project, [High on Cloud][13], you can leave the deployment and server management part to us while you work on growing your business and community.
|
||||
|
||||
### Closing Thoughts
|
||||
|
||||
Twake is developed by [LINAGORA][14], a France based open source company. Their servers are hosted in EU and they are GDPR compliant.
|
||||
|
||||
Twake looks to be an incredibly promising collaborative platform while providing a rich user experience. I do find it a bit slow at login page so this is something they could improve. But other than that, it’s a good alternative to platforms like Trello, Sunsama, Asana etc.
|
||||
|
||||
What do you think about Twake? Let me know your thoughts in the comments below!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/twake-app/
|
||||
|
||||
作者:[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://i2.wp.com/itsfoss.com/wp-content/uploads/2020/12/twake-document-storage.jpg?resize=800%2C444&ssl=1
|
||||
[2]: https://itsfoss.com/nextcloud/
|
||||
[3]: https://twake.app/
|
||||
[4]: https://itsfoss.com/nextcloud-vs-owncloud/
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/12/twake-app-sign-in.jpg?resize=800%2C519&ssl=1
|
||||
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/12/twake-app-board.jpg?resize=800%2C514&ssl=1
|
||||
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/12/twake.jpg?resize=800%2C448&ssl=1
|
||||
[8]: https://itsfoss.com/jitsi-meet/
|
||||
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/12/twake-calendar-view.jpg?resize=800%2C527&ssl=1
|
||||
[10]: https://itsfoss.com/use-appimage-linux/
|
||||
[11]: https://twake.app
|
||||
[12]: https://doc.twake.app/
|
||||
[13]: https://highoncloud.com/
|
||||
[14]: https://linagora.com
|
@ -0,0 +1,119 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Try Jed as your Linux terminal text editor)
|
||||
[#]: via: (https://opensource.com/article/20/12/jed)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
尝试将 Jed 作为你的 Linux 终端文本编辑器
|
||||
======
|
||||
Jed 的方便下拉菜单,让新用户可以轻松地使用终端文本编辑器。
|
||||
![Person using a laptop][1]
|
||||
|
||||
你可能听说过 Emacs、Vim 和 Nano 这些典型的 Linux 文本编辑器,但 Linux 有大量的开源文本编辑器,我的目标是在 12 月份对其中的 31 个文本编辑器进行一次公平的测试。
|
||||
|
||||
在这篇文章中,我将介绍 [Jed][2],一个基于终端的编辑器,它的特点是有一个方便的下拉菜单,这让那些刚刚接触终端编辑器的用户,以及那些不喜欢记住每个功能的组合键的用户而言变得特别容易。
|
||||
|
||||
### 安装 Jed
|
||||
|
||||
在 Linux 上,你的发行版软件仓库可能会让 Jed 通过你的软件包管理器安装:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install jed`
|
||||
```
|
||||
|
||||
并不是所有都是如此,但它是一个很容易从源码编译的应用。首先,下载 [S 语言][3](Jed 的编写语言)并安装:
|
||||
|
||||
|
||||
```
|
||||
$ wget <https://www.jedsoft.org/releases/slang/slang-x.y.z.tar.bz2>
|
||||
$ tar xvf slang*bz2
|
||||
$ cd slang-x.y.z
|
||||
$ ./configure ; make
|
||||
$ sudo make install
|
||||
```
|
||||
|
||||
安装好后,对 [Jed 源码][4]也同样操作:
|
||||
|
||||
|
||||
```
|
||||
$ wget <https://www.jedsoft.org/releases/jed/jed-x.y.z.tar.bz2>
|
||||
$ tar xvf jed*bz2
|
||||
$ cd jed-x.y.z
|
||||
$ ./configure ; make
|
||||
$ sudo make install
|
||||
```
|
||||
|
||||
### 启动 Jed
|
||||
|
||||
Jed runs in a terminal, so to start it, just open a terminal and type `jed`:
|
||||
Jed 在终端中运行,所以要启动它,只需打开终端,输入 `jed`:
|
||||
|
||||
|
||||
```
|
||||
F10 key ==> File Edit Search Buffers Windows System Help
|
||||
|
||||
This is a scratch buffer. It is NOT saved when you exit.
|
||||
|
||||
To access the menus, press F10 or ESC-m and the use the arrow
|
||||
keys to navigate.
|
||||
|
||||
Latest version information is available on the web from
|
||||
<[http://www.jedsoft.org/jed/\>][5]. Other sources of JED
|
||||
information include the usenet newsgroups comp.editors and
|
||||
alt.lang.s-lang. To subscribe to the jed-users mailing list, see
|
||||
<[http://www.jedsoft.org/jed/mailinglists.html\>][6].
|
||||
|
||||
Copyright (C) 1994, 2000-2009 John E. Davis
|
||||
Email comments or suggestions to <[jed@jedsoft.org][7]>.
|
||||
|
||||
[ (Jed 0.99.19U) Emacs: *scratch* () 1/16 8:49am ]
|
||||
```
|
||||
|
||||
### 如何使用 Jed
|
||||
|
||||
Jed 自动加载的说明很清晰且很有帮助。你可以按 **F10** 键或 **Esc** 键,然后按字母 **M** 进入顶部菜单。这将使你的光标进入 Jed 顶部的菜单栏,但它不会打开菜单。要打开菜单,请按键盘上的**回车**键。使用方向键来浏览每个菜单。
|
||||
|
||||
屏幕上的菜单不仅对初次使用的用户很有帮助,对有经验的用户来说,它还提供了很好的键盘快捷键提醒。例如,你大概能猜到如何保存在处理的文件。进入**文件**菜单,选择**保存**。如果你想加快这个过程,你可以记住 **Ctrl**+**X**,然后 **Ctrl**+**S** 的组合键(是的,这是连续的两个组合键)。
|
||||
|
||||
### 探索Jed的功能
|
||||
|
||||
对于一个简单的编辑器来说,Jed 拥有一系列令人惊讶的实用功能。它有一个内置的多路复用器,允许你同时打开多个文件,但它会“叠”在另一个文件之上,所以你可以在它们之间切换。你可以分割你的 Jed 窗口,让多个文件同时出现在屏幕上,改变你的颜色主题,或者打开一个 shell。
|
||||
|
||||
对于任何有 Emacs 使用经验的人来说,Jed 的许多“没有宣传”的功能,例如用于导航和控制的组合键,都是一目了然的。然而,当一个组合键与你所期望的大相径庭时,就会有一个轻微的学习(或者说没有学习)曲线。例如,GNU Emacs 中的 **Alt**+**B**可以将光标向后移动一个字,但在 Jed 中,默认情况下,它是 **Buffers** 菜单的快捷键。这让我措手不及,大约本文每句话都有一次。
|
||||
|
||||
![Jed][8]
|
||||
|
||||
Jed 也有**模式**,允许你加载模块或插件来帮助你编写特定种类的文本。例如,我使用默认的 `text_mode` 写了这篇文章,但当我在编写 [Lua][9] 时,我能够切换到 `lua` 模式。这些模式提供语法高亮,并帮助匹配括号和其他分隔符。你可以在 `/usr/share/jed/lib` 中查看哪些模式是与 Jed 捆绑在一起的,而且因为它们是用 S 语言编写的,你可以浏览代码,并可能学习一种新的语言。
|
||||
|
||||
### 尝试 Jed
|
||||
|
||||
Jed 是一个令人愉快且清新的 Linux 终端文本编辑器。它轻量级,易于使用,设计相对简单。作为 Vi 的替代方案,你可以在你的 `~/.bashrc` 文件中(如果你是 root用户,可以在 root 用户的 `~/.bashrc` 文件中)将 Jed 设置为 `EDITOR` 和 `VISUAL`。今天就试试 Jed 吧。
|
||||
|
||||
想成为终端文本编辑的高手吗?以上是入门技巧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/12/jed
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop)
|
||||
[2]: https://www.jedsoft.org/jed
|
||||
[3]: https://www.jedsoft.org/releases/slang/
|
||||
[4]: https://www.jedsoft.org/releases/jed
|
||||
[5]: http://www.jedsoft.org/jed/\>
|
||||
[6]: http://www.jedsoft.org/jed/mailinglists.html\>
|
||||
[7]: mailto:jed@jedsoft.org
|
||||
[8]: https://opensource.com/sites/default/files/jed.png (Jed)
|
||||
[9]: https://opensource.com/article/20/2/lua-cheat-sheet
|
Loading…
Reference in New Issue
Block a user