mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-29 21:41:00 +08:00
commit
9ab171e0e9
@ -123,7 +123,7 @@ via: https://opensource.com/article/18/7/interactive-fiction-tools
|
||||
[27]:https://github.com/i7/extensions
|
||||
[28]:http://twinery.org/
|
||||
[29]:https://github.com/klembot/twinejs
|
||||
[30]:/article/18/7/twine-vs-renpy-interactive-fiction
|
||||
[30]:https://opensource.com/article/18/7/twine-vs-renpy-interactive-fiction
|
||||
[31]:https://tiddlywiki.com/
|
||||
[32]:https://github.com/idmillington/undum
|
||||
[33]:https://github.com/dfabulich/choicescript
|
||||
|
@ -0,0 +1,81 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (zionfuo)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11275-1.html)
|
||||
[#]: subject: (Blockchain 2.0 – An Introduction To Hyperledger Project (HLP) [Part 8])
|
||||
[#]: via: (https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/)
|
||||
[#]: author: (editor https://www.ostechnix.com/author/editor/)
|
||||
|
||||
区块链 2.0:Hyperledger 项目简介(八)
|
||||
======
|
||||
|
||||
![Introduction To Hyperledger Project][1]
|
||||
|
||||
一旦一个新技术平台在积极发展和商业利益方面达到了一定程度的受欢迎程度,全球的主要公司和小型的初创企业都急于抓住这块蛋糕。在当时 Linux 就是这样的一个平台。一旦实现了其应用程序的普及,个人、公司和机构就开始对其表现出兴趣,到 2000 年,Linux 基金会就成立了。
|
||||
|
||||
Linux 基金会旨在通过赞助他们的开发团队来将 Linux 作为一个平台来标准化和发展。Linux 基金会是一个由软件和 IT 巨头([如微软、甲骨文、三星、思科、 IBM 、英特尔等][7])支持的非营利组织。这不包括为改进该平台而提供服务的数百名个人开发者。多年来,Linux 基金会已经在旗下开展了许多项目。**Hyperledger** 项目是迄今为止发展最快的项目。
|
||||
|
||||
在将技术推进至可用且有用的方面上,这种联合主导的开发具有很多优势。为大型项目提供开发标准、库和所有后端协议既昂贵又耗费资源,而且不会从中产生丝毫收入。因此,对于公司来说,通过支持这些组织来汇集他们的资源来开发常见的那些 “烦人” 部分是有很意义的,以及随后完成这些标准部分的工作以简单地即插即用和定制他们的产品。除了这种模型的经济性之外,这种合作努力还产生了标准,使其容易使用和集成到优秀的产品和服务中。
|
||||
|
||||
上述联盟模式,在曾经或当下的创新包括 WiFi(Wi-Fi 联盟)、移动电话等标准。
|
||||
|
||||
### Hyperledger 项目(HLP)简介
|
||||
|
||||
Hyperledger 项目(HLP)于 2015 年 12 月由 Linux 基金会启动,目前是其孵化的增长最快的项目之一。它是一个<ruby>伞式组织<rt>umbrella organization</rt></ruby>,用于合作开发和推进基于[区块链][2]的分布式账本技术 (DLT) 的工具和标准。支持该项目的主要行业参与者包括 IBM、英特尔 和 SAP Ariba [等][3]。HLP 旨在为个人和公司创建框架,以便根据需要创建共享和封闭的区块链,以满足他们自己的需求。其设计原则是开发一个专注于隐私和未来可审计性的全球可部署、可扩展、强大的区块链平台。[^2] 同样要注意的是大多数提出的区块链及其框架。
|
||||
|
||||
### 开发目标和构造:即插即用
|
||||
|
||||
虽然面向企业的平台有以太坊联盟之类的产品,但根据定义,HLP 是面向企业的,并得到行业巨头的支持,他们在 HLP 旗下的许多模块中做出贡献并进一步发展。HLP 还孵化开发的周边项目,并这些创意项目推向公众。HLP 的成员贡献了他们自己的力量,例如 IBM 为如何协作开发贡献了他们的 Fabric 平台。该代码库由 IBM 在其项目组内部研发,并开源出来供所有成员使用。
|
||||
|
||||
这些过程使得 HLP 中的模块具有高度灵活的插件框架,这将支持企业环境中的快速开发和部署。此外,默认情况下,其他对比的平台是开放的<ruby>免许可链<rt>permission-less blockchain</rt></ruby>或是<ruby>公有链<rt>public blockchain</rt></ruby>,甚至可以将它们应用到特定应用当中。HLP 模块本身支持该功能。
|
||||
|
||||
有关公有链和私有链的差异和用例更多地涵盖在[这篇][4]比较文章当中。
|
||||
|
||||
根据该项目执行董事 Brian Behlendorf 的说法,Hyperledger 项目的使命有四个。
|
||||
|
||||
分别是:
|
||||
|
||||
1. 创建企业级 DLT 框架和标准,任何人都可以移植以满足其特定的行业或个人需求。
|
||||
2. 创建一个强大的开源社区来帮助生态系统发展。
|
||||
3. 促进所述的生态系统的行业成员(如成员公司)的参与。
|
||||
4. 为 HLP 社区提供中立且无偏见的基础设施,以收集和分享相关的更新和发展。
|
||||
|
||||
可以在这里访问[原始文档][5]。
|
||||
|
||||
### HLP 的架构
|
||||
|
||||
HLP 由 12 个项目组成,这些项目被归类为独立的模块,每个项目通常都是结构化的,可以独立开发其模块的。在孵化之前,首先对它们的能力和活力进行研究。该组织的任何成员都可以提出附加建议。在项目孵化后,就会进行积极开发,然后才会推出。这些模块之间的互操作性具有很高的优先级,因此这些组之间的定期通信由社区维护。目前,这些项目中有 4 个被归类为活跃项目。被标为活跃意味着它们已经准备好使用,但还没有准备好发布主要版本。这 4 个模块可以说是推动区块链革命的最重要或相当基本的模块。稍后,我们将详细介绍各个模块及其功能。然而,Hyperledger Fabric 平台的简要描述,可以说是其中最受欢迎的。
|
||||
|
||||
### Hyperledger Fabric
|
||||
|
||||
Hyperledger Fabric 是一个完全开源的、基于区块链的许可 (非公开) DLT 平台,设计时考虑了企业的使用。该平台提供了适合企业环境的功能和结构。它是高度模块化的,允许开发人员在不同的共识协议、链上代码协议([智能合约][6])或身份管理系统等中进行选择。这是一个基于区块链的许可平台,它利用身份管理系统,这意味着参与者将知道彼此在企业环境中的身份。Fabric 允许以各种主流编程语言 (包括 Java、Javascript、Go 等) 开发智能合约(“<ruby>链码<rt>chaincode</rt></ruby>”,是 Hyperledger 团队使用的术语)。这使得机构和企业可以利用他们在该领域的现有人才,而无需雇佣或重新培训开发人员来开发他们自己的智能合约。与标准订单验证系统相比,Fabric 还使用<ruby>执行顺序验证<rt>execute-order-validate</rt></ruby>系统来处理智能合约,以提供更好的可靠性,这些系统由提供智能合约功能的其他平台使用。与标准订单验证系统相比,Fabric还使用执行顺序验证系统来处理智能合约,以提供更好的可靠性,这些系统由提供智能合约功能的其他平台使用。Fabric 的其他功能还有可插拔性能、身份管理系统、数据库管理系统、共识平台等,这些功能使它在竞争中保持领先地位。
|
||||
|
||||
### 结论
|
||||
|
||||
诸如 Hyperledger Fabric 平台这样的项目能够在主流用例中更快地采用区块链技术。Hyperledger 社区结构本身支持开放治理原则,并且由于所有项目都是作为开源平台引导的,因此这提高了团队在履行承诺时表现出来的安全性和责任感。
|
||||
|
||||
由于此类项目的主要应用涉及与企业合作及进一步开发平台和标准,因此 Hyperledger 项目目前在其他类似项目前面处于有利地位。
|
||||
|
||||
[^2]: E. Androulaki et al., “Hyperledger Fabric: A Distributed Operating System for Permissioned Blockchains,” 2018.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/
|
||||
|
||||
作者:[ostechnix][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[zionfuo](https://github.com/zionfuo)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.ostechnix.com/author/editor/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/Introduction-To-Hyperledger-Project-720x340.png
|
||||
[2]: https://linux.cn/article-10650-1.html
|
||||
[3]: https://www.hyperledger.org/members
|
||||
[4]: https://linux.cn/article-11080-1.html
|
||||
[5]: http://www.hitachi.com/rev/archive/2017/r2017_01/expert/index.html
|
||||
[6]: https://linux.cn/article-10956-1.html
|
||||
[7]: https://www.theinquirer.net/inquirer/news/2182438/samsung-takes-seat-intel-ibm-linux-foundation
|
@ -1,26 +1,28 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11274-1.html)
|
||||
[#]: subject: (A guided tour of Linux file system types)
|
||||
[#]: via: (https://www.networkworld.com/article/3432990/a-guided-tour-of-linux-file-system-types.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
Linux 文件系统类型的导览
|
||||
Linux 文件系统类型导览
|
||||
======
|
||||
Linux 文件系统多年来在不断发展,来看一下文件系统类型。
|
||||
![Andreas Lehner / Flickr \(CC BY 2.0\)][1]
|
||||
|
||||
虽然对于普通用户来说可能并不明显,但在过去十年左右的时间里,Linux 文件系统已经发生了显著的变化,这使它们能够更好抵抗损坏和性能问题。。
|
||||
> Linux 文件系统多年来在不断发展,让我们来看一下文件系统类型。
|
||||
|
||||
如今大多数 Linux 系统使用名为 **ext4** 的文件系统。 “ext” 代表“扩展”,4 表示这是此文件系统的第 4 代。随着时间的推移,已经添加的功能包括能够提供越来越大的文件系统(目前大到 1,000,000 TiB)和更大的文件(高达 16 TiB),更能抵抗系统崩溃和更少碎片(将多个文件分散为多个位置的块),这些提高了性能。
|
||||
![](https://img.linux.net.cn/data/attachment/album/201908/27/175516vzrp4j4zevcqr66c.jpg)
|
||||
|
||||
**ext4** 文件系统还带来了对性能、可伸缩性和容量的其他改进。为实现可靠性,实现了元数据和日志校验和。时间戳现在跟踪变化到纳秒,以便更好地进行文件时间戳(例如,文件创建和最后更新)。并且,在时间戳字段中有两个附加位,2038 年的问题(存储日期/时间的字段将从最大值翻到零)已被推迟超过 400 年(到 2446)。
|
||||
虽然对于普通用户来说可能并不明显,但在过去十年左右的时间里,Linux 文件系统已经发生了显著的变化,这使它们能够更好对抗损坏和性能问题。
|
||||
|
||||
如今大多数 Linux 系统使用名为 ext4 的文件系统。 “ext” 代表“<ruby>扩展<rt>extended</rt></ruby>”,“4” 表示这是此文件系统的第 4 代。随着时间的推移添加的功能包括:能够提供越来越大的文件系统(目前大到 1,000,000 TiB)和更大的文件(高达 16 TiB),更抗系统崩溃,更少碎片(将单个文件分散为存在多个位置的块)以提高性能。
|
||||
|
||||
ext4 文件系统还带来了对性能、可伸缩性和容量的其他改进。实现了元数据和日志校验和以增强可靠性。时间戳现在可以跟踪纳秒级变化,以便更好地对文件打戳(例如,文件创建和最后更新时间)。并且,在时间戳字段中增加了两个位,2038 年的问题(存储日期/时间的字段将从最大值翻转到零)已被推迟到了 400 多年之后(到 2446)。
|
||||
|
||||
### 文件系统类型
|
||||
|
||||
要确定 Linux 系统上文件系统的类型,请使用 **df** 命令。下面显示的命令中的 **T** 选项显示文件系统类型。 **h** 使磁盘大小显示“人类可读”。换句话说,调整报告的单位(如 M 和 G),使人们更好地理解。
|
||||
要确定 Linux 系统上文件系统的类型,请使用 `df` 命令。下面显示的命令中的 `-T` 选项显示文件系统类型。 `-h` 显示“易读的”磁盘大小。换句话说,调整报告的单位(如 M 和 G),使人们更好地理解。
|
||||
|
||||
```
|
||||
$ df -hT | head -10
|
||||
@ -36,7 +38,7 @@ tmpfs tmpfs 3.0G 0 3.0G 0% /sys/fs/cgroup
|
||||
/dev/loop2 squashfs 142M 142M 0 100% /snap/hexchat/42
|
||||
```
|
||||
|
||||
请注意,**/**(根)和 **/apps** 的文件系统都是 **ext4**,而 **/dev** 是 **devtmpfs** 文件系统 - 一个由内核填充的自动化设备节点。其他的文件系统显示为 **tmpfs** - 驻留在内存和/或交换分区中的临时文件系统和 **squashfs** - 只读压缩文件系统的文件系统,用于快照包。
|
||||
请注意,`/`(根)和 `/apps` 的文件系统都是 ext4,而 `/dev` 是 devtmpfs 文件系统(一个由内核填充的自动化设备节点)。其他的文件系统显示为 tmpfs(驻留在内存和/或交换分区中的临时文件系统)和 squashfs(只读压缩文件系统的文件系统,用于快照包)。
|
||||
|
||||
还有 proc 文件系统,用于存储正在运行的进程的信息。
|
||||
|
||||
@ -46,7 +48,7 @@ Filesystem Type 1K-blocks Used Available Use% Mounted on
|
||||
proc proc 0 0 0 - /proc
|
||||
```
|
||||
|
||||
当你在整个文件系统中移动时,可能会遇到许多其他文件系统类型。例如,当你移动到目录中并想了解它的文件系统时,可以运行以下命令:
|
||||
当你在整个文件系统中游览时,可能会遇到许多其他文件系统类型。例如,当你移动到目录中并想了解它的文件系统时,可以运行以下命令:
|
||||
|
||||
```
|
||||
$ cd /dev/mqueue; df -T .
|
||||
@ -60,13 +62,11 @@ Filesystem Type 1K-blocks Used Available Use% Mounted on
|
||||
securityfs securityfs 0 0 0 - /sys/kernel/security
|
||||
```
|
||||
|
||||
与其他 Linux 命令一样,这里的 . 代表整个文件系统的当前位置。
|
||||
与其他 Linux 命令一样,这里的 `.` 代表整个文件系统的当前位置。
|
||||
|
||||
这些和其他独特的文件系统提供了一些特殊功能。例如,securityfs 提供支持安全模块的文件系统
|
||||
这些和其他独特的文件系统提供了一些特殊功能。例如,securityfs 提供支持安全模块的文件系统。
|
||||
|
||||
Linux 文件系统需要能够抵抗损坏,能够承受系统崩溃并提供快速可靠的性能。由几代 **ext** 文件系统和新一代专用文件系统提供的改进使 Linux 系统更易于管理和更可靠。
|
||||
|
||||
在 [Facebook][2] 和 [LinkedIn][3] 上加入 Network World 社区,评论最热主题。
|
||||
Linux 文件系统需要能够抵抗损坏,能够承受系统崩溃并提供快速、可靠的性能。由几代 ext 文件系统和新一代专用文件系统提供的改进使 Linux 系统更易于管理和更可靠。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -75,7 +75,7 @@ via: https://www.networkworld.com/article/3432990/a-guided-tour-of-linux-file-sy
|
||||
作者:[Sandra Henry-Stocker][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/) 荣誉推出
|
||||
|
@ -0,0 +1,404 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (hello-wn)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11276-1.html)
|
||||
[#]: subject: (How to Delete Lines from a File Using the sed Command)
|
||||
[#]: via: (https://www.2daygeek.com/linux-remove-delete-lines-in-file-sed-command/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
如何使用 sed 命令删除文件中的行
|
||||
======
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/201908/28/100204ei6v98sa69hdf3zf.jpg)
|
||||
|
||||
Sed 代表<ruby>流编辑器<rt>Stream Editor</rt></ruby>,常用于 Linux 中基本的文本处理。`sed` 命令是 Linux 中的重要命令之一,在文件处理方面有着重要作用。可用于删除或移动与给定模式匹配的特定行。
|
||||
|
||||
它还可以删除文件中的特定行,它能够从文件中删除表达式,文件可以通过指定分隔符(例如逗号、制表符或空格)进行标识。
|
||||
|
||||
本文列出了 15 个使用范例,它们可以帮助你掌握 `sed` 命令。
|
||||
|
||||
如果你能理解并且记住这些命令,在你需要使用 `sed` 时,这些命令就能派上用场,帮你节约很多时间。
|
||||
|
||||
注意:为了方便演示,我在执行 `sed` 命令时,不使用 `-i` 选项(因为这个选项会直接修改文件内容),被移除了行的文件内容将打印到 Linux 终端。
|
||||
|
||||
但是,如果你想在实际环境中从源文件中删除行,请在 `sed` 命令中使用 `-i` 选项。
|
||||
|
||||
演示之前,我创建了 `sed-demo.txt` 文件,并添加了以下内容和相应行号以便更好地理解。
|
||||
|
||||
```
|
||||
# cat sed-demo.txt
|
||||
|
||||
1 Linux Operating System
|
||||
2 Unix Operating System
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 1) 如何删除文件的第一行?
|
||||
|
||||
使用以下语法删除文件首行。
|
||||
|
||||
`N` 表示文件中的第 N 行,`d` 选项在 `sed` 命令中用于删除一行。
|
||||
|
||||
语法:
|
||||
|
||||
```
|
||||
sed 'Nd' file
|
||||
```
|
||||
|
||||
使用以下 `sed` 命令删除 `sed-demo.txt` 中的第一行。
|
||||
|
||||
```
|
||||
# sed '1d' sed-demo.txt
|
||||
|
||||
2 Unix Operating System
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 2) 如何删除文件的最后一行?
|
||||
|
||||
使用以下语法删除文件最后一行。
|
||||
|
||||
`$` 符号表示文件的最后一行。
|
||||
|
||||
使用以下 `sed` 命令删除 `sed-demo.txt` 中的最后一行。
|
||||
|
||||
```
|
||||
# sed '$d' sed-demo.txt
|
||||
|
||||
1 Linux Operating System
|
||||
2 Unix Operating System
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
```
|
||||
|
||||
### 3) 如何删除指定行?
|
||||
|
||||
使用以下 `sed` 命令删除 `sed-demo.txt` 中的第 3 行。
|
||||
|
||||
```
|
||||
# sed '3d' sed-demo.txt
|
||||
|
||||
1 Linux Operating System
|
||||
2 Unix Operating System
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 4) 如何删除指定范围内的行?
|
||||
|
||||
使用以下 `sed` 命令删除 `sed-demo.txt` 中的第 5 到 7 行。
|
||||
|
||||
```
|
||||
# sed '5,7d' sed-demo.txt
|
||||
|
||||
1 Linux Operating System
|
||||
2 Unix Operating System
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 5) 如何删除多行内容?
|
||||
|
||||
`sed` 命令能够删除给定行的集合。
|
||||
|
||||
本例中,下面的 `sed` 命令删除了第 1 行、第 5 行、第 9 行和最后一行。
|
||||
|
||||
```
|
||||
# sed '1d;5d;9d;$d' sed-demo.txt
|
||||
|
||||
2 Unix Operating System
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
```
|
||||
|
||||
### 5a) 如何删除指定范围以外的行?
|
||||
|
||||
使用以下 `sed` 命令删除 `sed-demo.txt` 中第 3 到 6 行范围以外的所有行。
|
||||
|
||||
```
|
||||
# sed '3,6!d' sed-demo.txt
|
||||
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
```
|
||||
|
||||
### 6) 如何删除空行?
|
||||
|
||||
使用以下 `sed` 命令删除 `sed-demo.txt` 中的空行。
|
||||
|
||||
```
|
||||
# sed '/^$/d' sed-demo.txt
|
||||
|
||||
1 Linux Operating System
|
||||
2 Unix Operating System
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 7) 如何删除包含某个模式的行?
|
||||
|
||||
使用以下 `sed` 命令删除 `sed-demo.txt` 中匹配到 `System` 模式的行。
|
||||
|
||||
```
|
||||
# sed '/System/d' sed-demo.txt
|
||||
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 8) 如何删除包含字符串集合中某个字符串的行?
|
||||
|
||||
使用以下 `sed` 命令删除 `sed-demo.txt` 中匹配到 `System` 或 `Linux` 表达式的行。
|
||||
|
||||
```
|
||||
# sed '/System\|Linux/d' sed-demo.txt
|
||||
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 9) 如何删除以指定字符开头的行?
|
||||
|
||||
为了测试,我创建了 `sed-demo-1.txt` 文件,并添加了以下内容。
|
||||
|
||||
```
|
||||
# cat sed-demo-1.txt
|
||||
|
||||
Linux Operating System
|
||||
Unix Operating System
|
||||
RHEL
|
||||
Red Hat
|
||||
Fedora
|
||||
debian
|
||||
ubuntu
|
||||
Arch Linux - 1
|
||||
2 - Manjaro
|
||||
3 4 5 6
|
||||
```
|
||||
|
||||
使用以下 `sed` 命令删除以 `R` 字符开头的所有行。
|
||||
|
||||
```
|
||||
# sed '/^R/d' sed-demo-1.txt
|
||||
|
||||
Linux Operating System
|
||||
Unix Operating System
|
||||
Fedora
|
||||
debian
|
||||
ubuntu
|
||||
Arch Linux - 1
|
||||
2 - Manjaro
|
||||
3 4 5 6
|
||||
```
|
||||
|
||||
使用以下 `sed` 命令删除 `R` 或者 `F` 字符开头的所有行。
|
||||
|
||||
```
|
||||
# sed '/^[RF]/d' sed-demo-1.txt
|
||||
|
||||
Linux Operating System
|
||||
Unix Operating System
|
||||
debian
|
||||
ubuntu
|
||||
Arch Linux - 1
|
||||
2 - Manjaro
|
||||
3 4 5 6
|
||||
```
|
||||
|
||||
### 10) 如何删除以指定字符结尾的行?
|
||||
|
||||
使用以下 `sed` 命令删除 `m` 字符结尾的所有行。
|
||||
|
||||
```
|
||||
# sed '/m$/d' sed-demo.txt
|
||||
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
使用以下 `sed` 命令删除 `x` 或者 `m` 字符结尾的所有行。
|
||||
|
||||
```
|
||||
# sed '/[xm]$/d' sed-demo.txt
|
||||
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 11) 如何删除所有大写字母开头的行?
|
||||
|
||||
使用以下 `sed` 命令删除所有大写字母开头的行。
|
||||
|
||||
```
|
||||
# sed '/^[A-Z]/d' sed-demo-1.txt
|
||||
|
||||
debian
|
||||
ubuntu
|
||||
2 - Manjaro
|
||||
3 4 5 6
|
||||
```
|
||||
|
||||
### 12) 如何删除指定范围内匹配模式的行?
|
||||
|
||||
使用以下 `sed` 命令删除第 1 到 6 行中包含 `Linux` 表达式的行。
|
||||
|
||||
```
|
||||
# sed '1,6{/Linux/d;}' sed-demo.txt
|
||||
|
||||
2 Unix Operating System
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 13) 如何删除匹配模式的行及其下一行?
|
||||
|
||||
使用以下 `sed` 命令删除包含 `System` 表达式的行以及它的下一行。
|
||||
|
||||
```
|
||||
# sed '/System/{N;d;}' sed-demo.txt
|
||||
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 14) 如何删除包含数字的行?
|
||||
|
||||
使用以下 `sed` 命令删除所有包含数字的行。
|
||||
|
||||
```
|
||||
# sed '/[0-9]/d' sed-demo-1.txt
|
||||
|
||||
Linux Operating System
|
||||
Unix Operating System
|
||||
RHEL
|
||||
Red Hat
|
||||
Fedora
|
||||
debian
|
||||
ubuntu
|
||||
```
|
||||
|
||||
使用以下 `sed` 命令删除所有以数字开头的行。
|
||||
|
||||
```
|
||||
# sed '/^[0-9]/d' sed-demo-1.txt
|
||||
|
||||
Linux Operating System
|
||||
Unix Operating System
|
||||
RHEL
|
||||
Red Hat
|
||||
Fedora
|
||||
debian
|
||||
ubuntu
|
||||
Arch Linux - 1
|
||||
```
|
||||
|
||||
使用以下 `sed` 命令删除所有以数字结尾的行。
|
||||
|
||||
```
|
||||
# sed '/[0-9]$/d' sed-demo-1.txt
|
||||
|
||||
Linux Operating System
|
||||
Unix Operating System
|
||||
RHEL
|
||||
Red Hat
|
||||
Fedora
|
||||
debian
|
||||
ubuntu
|
||||
2 - Manjaro
|
||||
```
|
||||
|
||||
### 15) 如何删除包含字母的行?
|
||||
|
||||
使用以下 `sed` 命令删除所有包含字母的行。
|
||||
|
||||
```
|
||||
# sed '/[A-Za-z]/d' sed-demo-1.txt
|
||||
|
||||
3 4 5 6
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/linux-remove-delete-lines-in-file-sed-command/
|
||||
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[hello-wn](https://github.com/hello-wn)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.2daygeek.com/author/magesh/
|
||||
[b]: https://github.com/lujun9972
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,407 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (hello-wn)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Delete Lines from a File Using the sed Command)
|
||||
[#]: via: (https://www.2daygeek.com/linux-remove-delete-lines-in-file-sed-command/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
How to Delete Lines from a File Using the sed Command
|
||||
======
|
||||
|
||||
Sed command stands for Stream Editor, is used to perform basic text transformations in Linux.
|
||||
|
||||
sed is one of the important command, which plays major role for file manipulation. It can be used to delete or remove specific lines which matches a given pattern.
|
||||
|
||||
Also, it’s used to remove a particular line in a file.
|
||||
|
||||
It’s capable to delete expressions as well from a file, which can be identified by a specifying delimiter (such as a comma, tab, or space).
|
||||
|
||||
There are fifteen examples are listed in this article, which helps you to become a master in sed command.
|
||||
|
||||
If you understand and remember all these commands that can be useful in many ways. Also, it saves lot of time when you have some requirements to perform sed command.
|
||||
|
||||
**`Note:`**` ` Since it’s demonstration purpose so, i use sed command without `-i` option which prints the contents of the file on Linux terminal by removing the lines.
|
||||
|
||||
But, if you would like to remove the lines from the source file in real environment then use `-i` option with sed command.
|
||||
|
||||
To test this, i have created the sed-demo.txt file and added the following contents with line number for better understanding.
|
||||
|
||||
```
|
||||
# cat sed-demo.txt
|
||||
|
||||
1 Linux Operating System
|
||||
2 Unix Operating System
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 1) How to Delete First Line from a File?
|
||||
|
||||
If you would like to delete first line from a file, use the following syntax.
|
||||
|
||||
**`N`**` ` denotes Nth line in a file and d option in sed command is used to delete a line.
|
||||
|
||||
**Syntax:**
|
||||
|
||||
```
|
||||
sed 'Nd' file
|
||||
```
|
||||
|
||||
The below sed command removes the first line in sed-demo.txt file.
|
||||
|
||||
```
|
||||
# sed '1d' sed-demo.txt
|
||||
|
||||
2 Unix Operating System
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 2) How to Delete Last Line from a File?
|
||||
|
||||
If you would like to delete first line from a file, use the following syntax.
|
||||
|
||||
The **`$`**` ` denotes the last line of a file.
|
||||
|
||||
The below sed command removes the last line in sed-demo.txt file.
|
||||
|
||||
```
|
||||
# sed '$d' sed-demo.txt
|
||||
|
||||
1 Linux Operating System
|
||||
2 Unix Operating System
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
```
|
||||
|
||||
### 3) How to Delete Particular Line from a File?
|
||||
|
||||
The below sed command removes the third line in sed-demo.txt file.
|
||||
|
||||
```
|
||||
# sed '3d' sed-demo.txt
|
||||
|
||||
1 Linux Operating System
|
||||
2 Unix Operating System
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 4) How to Delete Range of Lines from a File?
|
||||
|
||||
The below sed command removes the lines ranging from 5 to 7.
|
||||
|
||||
```
|
||||
# sed '5,7d' sed-demo.txt
|
||||
|
||||
1 Linux Operating System
|
||||
2 Unix Operating System
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 5) How to Delete Multiple Lines from a File?
|
||||
|
||||
The sed command is capable to removes set of given lines.
|
||||
|
||||
In this example, the following sed command removes 1st line, 5th line, 9th line, and last line.
|
||||
|
||||
```
|
||||
# sed '1d;5d;9d;$d' sed-demo.txt
|
||||
|
||||
2 Unix Operating System
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
```
|
||||
|
||||
### 5a) How to Delete Lines Other Than the Specified Range from a File?
|
||||
|
||||
Use the following sed command to remove all the lines from the file only except specified range.
|
||||
|
||||
```
|
||||
# sed '3,6!d' sed-demo.txt
|
||||
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
```
|
||||
|
||||
### 6) How to Delete Empty or Blank Lines from a File?
|
||||
|
||||
The following sed command removes the empty or blank lines from sed-demo.txt file.
|
||||
|
||||
```
|
||||
# sed '/^$/d' sed-demo.txt
|
||||
|
||||
1 Linux Operating System
|
||||
2 Unix Operating System
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 7) How to Delete Lines That Contain a Pattern from a File?
|
||||
|
||||
The following sed command removes the lines in sed-demo.txt file which match the **`System`**` ` pattern.
|
||||
|
||||
```
|
||||
# sed '/System/d' sed-demo.txt
|
||||
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 8) How to Delete Lines That Containing One of Multiple Strings from a File?
|
||||
|
||||
The following sed command removes the lines in sed-demo.txt file which match the **`System`**` ` or **`Linux`**` ` pattern.
|
||||
|
||||
```
|
||||
# sed '/System\|Linux/d' sed-demo.txt
|
||||
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 9) How to Delete Lines That Begin with Specified Character from a File?
|
||||
|
||||
The following sed command removes all the lines that start with given character.
|
||||
|
||||
To test this, i have created another file called sed-demo-1.txt with following contents.
|
||||
|
||||
```
|
||||
# cat sed-demo-1.txt
|
||||
|
||||
Linux Operating System
|
||||
Unix Operating System
|
||||
RHEL
|
||||
Red Hat
|
||||
Fedora
|
||||
debian
|
||||
ubuntu
|
||||
Arch Linux - 1
|
||||
2 - Manjaro
|
||||
3 4 5 6
|
||||
```
|
||||
|
||||
The following sed command removes all the lines that start with character **`R`**` `.
|
||||
|
||||
```
|
||||
# sed '/^R/d' sed-demo-1.txt
|
||||
|
||||
Linux Operating System
|
||||
Unix Operating System
|
||||
Fedora
|
||||
debian
|
||||
ubuntu
|
||||
Arch Linux - 1
|
||||
2 - Manjaro
|
||||
3 4 5 6
|
||||
```
|
||||
|
||||
The following sed command removes all the lines that start with character either **`R`**` ` or **`F`**` `.
|
||||
|
||||
```
|
||||
# sed '/^[RF]/d' sed-demo-1.txt
|
||||
|
||||
Linux Operating System
|
||||
Unix Operating System
|
||||
debian
|
||||
ubuntu
|
||||
Arch Linux - 1
|
||||
2 - Manjaro
|
||||
3 4 5 6
|
||||
```
|
||||
|
||||
### 10) How to Delete Lines That End with Specified Character from a File?
|
||||
|
||||
The following sed command removes all the lines that end with character **`m`**` `.
|
||||
|
||||
```
|
||||
# sed '/m$/d' sed-demo.txt
|
||||
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
The following sed command removes all the lines that end with character either **`x`**` ` or **`m`**` `.
|
||||
|
||||
```
|
||||
# sed '/[xm]$/d' sed-demo.txt
|
||||
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 11) How to Delete All Lines That Start with Capital Letters
|
||||
|
||||
Use the following sed command to remove all the lines that start with entirely in capital letters.
|
||||
|
||||
```
|
||||
# sed '/^[A-Z]/d' sed-demo-1.txt
|
||||
|
||||
debian
|
||||
ubuntu
|
||||
2 - Manjaro
|
||||
3 4 5 6
|
||||
```
|
||||
|
||||
### 12) How to Delete a Matching Pattern Lines with Specified Range in a File?
|
||||
|
||||
The below sed command removes the pattern **`Linux`**` ` only if it is present in the lines from 1 to 6.
|
||||
|
||||
```
|
||||
# sed '1,6{/Linux/d;}' sed-demo.txt
|
||||
|
||||
2 Unix Operating System
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 13) How to Delete Pattern Matching Line and also the Next Line?
|
||||
|
||||
Use the following sed command to delete the line which containing the pattern ‘System’ and also the next line.
|
||||
|
||||
```
|
||||
# sed '/System/{N;d;}' sed-demo.txt
|
||||
|
||||
3 RHEL
|
||||
4 Red Hat
|
||||
5 Fedora
|
||||
6 Arch Linux
|
||||
7 CentOS
|
||||
8 Debian
|
||||
9 Ubuntu
|
||||
10 openSUSE
|
||||
```
|
||||
|
||||
### 14) How Delete lines that contains Digits from a File?
|
||||
|
||||
The below sed command removes all the lines that contains digits.
|
||||
|
||||
```
|
||||
# sed '/[0-9]/d' sed-demo-1.txt
|
||||
|
||||
Linux Operating System
|
||||
Unix Operating System
|
||||
RHEL
|
||||
Red Hat
|
||||
Fedora
|
||||
debian
|
||||
ubuntu
|
||||
```
|
||||
|
||||
The below sed command removes all the lines Begin with digits.
|
||||
|
||||
```
|
||||
# sed '/^[0-9]/d' sed-demo-1.txt
|
||||
|
||||
Linux Operating System
|
||||
Unix Operating System
|
||||
RHEL
|
||||
Red Hat
|
||||
Fedora
|
||||
debian
|
||||
ubuntu
|
||||
Arch Linux - 1
|
||||
```
|
||||
|
||||
The below sed command removes all the lines End with digits.
|
||||
|
||||
```
|
||||
# sed '/[0-9]$/d' sed-demo-1.txt
|
||||
|
||||
Linux Operating System
|
||||
Unix Operating System
|
||||
RHEL
|
||||
Red Hat
|
||||
Fedora
|
||||
debian
|
||||
ubuntu
|
||||
2 - Manjaro
|
||||
```
|
||||
|
||||
### 15) How Delete lines that contains Alphabetic Characters from a File?
|
||||
|
||||
The below sed command removes all the lines that contains alphabetic characters.
|
||||
|
||||
```
|
||||
# sed '/[A-Za-z]/d' sed-demo-1.txt
|
||||
|
||||
3 4 5 6
|
||||
```
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/linux-remove-delete-lines-in-file-sed-command/
|
||||
|
||||
作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/
|
||||
[b]: https://github.com/lujun9972
|
@ -1,122 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Managing credentials with KeePassXC)
|
||||
[#]: via: (https://fedoramagazine.org/managing-credentials-with-keepassxc/)
|
||||
[#]: author: (Marco Sarti https://fedoramagazine.org/author/msarti/)
|
||||
|
||||
Managing credentials with KeePassXC
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
A [previous article][2] discussed password management tools that use server-side technology. These tools are very interesting and suitable for a cloud installation.
|
||||
In this article we will talk about KeePassXC, a simple multi-platform open source software that uses a local file as a database.
|
||||
The main advantage of this type of password management is simplicity. No server-side technology expertise is required and can therefore be used by any type of user.
|
||||
|
||||
### Introducing KeePassXC
|
||||
|
||||
KeePassXC is an open source cross platform password manager: its development started as a fork of KeePassX, a good product but with a not very active development. It saves the secrets in an encrypted database with AES algorithm using 256 bit key, this makes it reasonably safe to save the database in a cloud drive storage such as pCloud or Dropbox.
|
||||
|
||||
In addition to the passwords, KeePassXC allows you to save various information and attachments in the encrypted wallet. It also has a valid password generator that helps the user to correctly manage his credentials.
|
||||
|
||||
### Installation
|
||||
|
||||
The program is available both in the standard Fedora repository and in the Flathub repository. Unfortunately the integration with the browser does not work with the application running in the sandbox, so I suggest to install the program via dnf:
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
sudo dnf install keepassxc
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
### Creating your wallet
|
||||
|
||||
To create a new database there are two important steps:
|
||||
|
||||
* Choose the encryption settings: the default settings are reasonably safe, increasing the transform rounds also increases the decryption time.
|
||||
* Choose the master key and additional protections: the master key must be easy to remember (if you lose it your wallet is lost!) but strong enough, a passphrase with at least 4 random words can be a good choice. As additional protection you can choose a key file (remember: you must always have it available otherwise you cannot open the wallet) and / or a YubiKey hardware key.
|
||||
|
||||
|
||||
|
||||
![][3]
|
||||
|
||||
![][4]
|
||||
|
||||
The database file will be saved to the file system. If you want to share with other computers / devices you can save it on a USB key or in a cloud storage like pCloud or Dropbox. Of course, if you choose a cloud storage, a particularly strong master password is recommended, better if accompanied by additional protection.
|
||||
|
||||
### Creating your first entry
|
||||
|
||||
Once the database has been created, you can start creating your first entry. For a web login specify a username, password and url in the Entry tab. Optionally you can specify an expiration date for the credentials based on your personal policy: also by pressing the button on the right the favicon of the site is downloaded and associated as an icon of the entry, this is a nice feature.
|
||||
|
||||
![][5]
|
||||
|
||||
![][6]
|
||||
|
||||
KeePassXC also offers a good password / passphrase generator, you can choose length and complexity and check the degree of resistance to a brute force attack:
|
||||
|
||||
![][7]
|
||||
|
||||
### Browser integration
|
||||
|
||||
KeePassXC has an extension available for all major browsers. The extension allows you to fill in the login information for all the entries whose URL is specified.
|
||||
|
||||
Browser integration must be enabled on KeePassXC (Tools menu -> Settings) specifying which browsers you intend to use:
|
||||
|
||||
![][8]
|
||||
|
||||
Once the extension is installed, it is necessary to create a connection with the database. To do this, press the extension button and then the Connect button: if the database is open and unlocked the extension will create an association key and save it in the database, the key is unique to the browser so I suggest naming it appropriately :
|
||||
|
||||
![][9]
|
||||
|
||||
When you reach the login page specified in the Url field and the database is unlocked, the extension will offer you all the credentials you have associated with that page:
|
||||
|
||||
![][10]
|
||||
|
||||
In this way, browsing with KeePassXC running you will have your internet credentials available without necessarily saving them in the browser.
|
||||
|
||||
### SSH agent integration
|
||||
|
||||
Another interesting feature of KeePassXC is the integration with SSH. If you have ssh-agent running KeePassXC is able to interact and add the ssh keys that you have uploaded as attachments to your entries.
|
||||
|
||||
First of all in the general settings (Tools menu -> Settings) you have to enable the ssh agent and restart the program:
|
||||
|
||||
![][11]
|
||||
|
||||
At this point it is required to upload your ssh key pair as an attachment to your entry. Then in the “SSH agent” tab select the private key in the attachment drop-down list, the public key will be populated automatically. Don’t forget to select the two checkboxes above to allow the key to be added to the agent when the database is opened / unlocked and removed when the database is closed / locked:
|
||||
|
||||
![][12]
|
||||
|
||||
Now with the database open and unlocked you can log in ssh using the keys saved in your wallet.
|
||||
|
||||
The only limitation is in the maximum number of keys that can be added to the agent: ssh servers do not accept by default more than 5 login attempts, for security reasons it is not recommended to increase this value.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/managing-credentials-with-keepassxc/
|
||||
|
||||
作者:[Marco Sarti][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/msarti/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2019/08/keepassxc-816x345.png
|
||||
[2]: https://fedoramagazine.org/manage-your-passwords-with-bitwarden-and-podman/
|
||||
[3]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-07-33-27.png
|
||||
[4]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-07-48-21.png
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-08-30-07.png
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-08-43-11.png
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-08-49-22.png
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-09-48-09.png
|
||||
[9]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-09-05-57.png
|
||||
[10]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-09-13-29.png
|
||||
[11]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-09-47-21.png
|
||||
[12]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-09-46-35.png
|
@ -1,86 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (zionfuo)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Blockchain 2.0 – An Introduction To Hyperledger Project (HLP) [Part 8])
|
||||
[#]: via: (https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/)
|
||||
[#]: author: (editor https://www.ostechnix.com/author/editor/)
|
||||
|
||||
区块链2.0:Hyperledger项目简介(八)
|
||||
======
|
||||
|
||||
![Introduction To Hyperledger Project][1]
|
||||
|
||||
一旦,一个新技术平台在积极发展和商业利益方面达到了普及的门槛,全球的主要公司和小型的初创企业都急于抓住这块蛋糕。在当时**Linux**就是这样的平台。一旦实现了其应用程序的普及,个人、公司和机构就开始对其表现出兴趣,到2000年,**Linux基金会**成立了。
|
||||
|
||||
Linux 基金会旨在通过赞助他们的开发团队来制定规范和开发Linux作为平台。Linux基金会是一个由软件和IT巨头(如微软、甲骨文、三星、思科、 IBM 、英特尔等[[1][7]]支持的非营利组织。这不包括为改善平台而提供服务的数百名个人开发者。多年来,Linux基金会已经开展了许多项目。**Hyperledger**项目是迄今为止发展最快的项目。
|
||||
|
||||
在将技术推进至可用且有用的方面上,这种联合主导的开发具有很多优势。为大型项目提供开发标准、库和所有后端协议既昂贵又资源密集型,而且不会从中产生丝毫收入。因此, 对于公司来说,通过支持这些组织来汇集他们的资源来开发常见的那些 “烦人” 部分是有很意义的,以及随后完成这些标准部分的工作以简单地即插即用和定制他们的产品。除了模型的经济性之外,这种合作努力还产生了标准,使其容易使用和集成到优秀的产品和服务中。
|
||||
|
||||
上述联盟模式,在曾经或当下使WiFi (The Wi-Fi alliance) 、移动电话等标准在制定方面得到了创新。
|
||||
|
||||
|
||||
### Hyperledger (HLP) 项目简介
|
||||
|
||||
Hyperledger 项目于 2015年12月由 Linux 基金会启动,目前是其孵化的增长最快的项目之一。它是一个伞式组织(umbrella organization),用于合作开发和推进基于[区块链][2]的分布式账本技术 (DLT) 的工具和标准。支持该项目的主要行业参与者包括**IBM**、**英特尔**和**SAP Ariba**[等][3]。HLP 旨在为个人和公司创建框架,以便根据需要创建共享和封闭的区块链,以满足他们自己的需求。设计原则是开发一个专注于隐私和未来可审计性的全球可部署、可扩展、强大的区块链平台。
|
||||
|
||||
### 开发目标和构造: 即插即用
|
||||
|
||||
虽然面向企业的平台有以太坊联盟之类的产品,但根据定义,HLP是面向企业的,并得到行业巨头的支持,他们在HLP旗下的许多模块中做出贡献并进一步发展。还孵化开发的周边项目,并这些创意项目推向公众。Hyperledger 项目的成员贡献了他们自己的力量,例如IBM如何为协作开发贡献他们的Fabric平台。该代码库由IBM在其内部研究和开发,并开源出来供所有成员使用。
|
||||
|
||||
这些过程使得 HLP 中的模块具有高度灵活的插件框架,这将支持企业设置中的快速开发和推出。此外,默认情况下,其他类似的平台是开放的**无需许可链**(permission-less blockchain)或是**公有链**(public blockchain),HLP模块本身就是支持通过调试可以适应特定的功能。
|
||||
|
||||
在这篇关于[公有链和私有链][4]的比较入门文章中,更多地涵盖了公有链和私有链的差异和用例。
|
||||
|
||||
根据项目执行董事**Brian Behlendorf**的说法,Hyperledger项目的使命有四个。
|
||||
|
||||
分别是:
|
||||
|
||||
1. 创建企业级DLT框架和标准,任何人都可以移植以满足其特定的工业或个人需求。
|
||||
2. 创建一个强大的开源社区来帮助生态系统。
|
||||
3. 促进所述生态系统的行业成员(如成员公司)的参与。
|
||||
4. 为HLP社区提供中立且无偏见的基础设施,以收集和分享相关的更新和发展。
|
||||
|
||||
可以在这里访问[原始文档][5]。
|
||||
|
||||
### HLP的架构
|
||||
|
||||
HLP由12个项目组成,这些项目被归类为独立的模块,每个项目通常都是独立构建和工作的,以开发他们的模块。在孵化之前,首先对它们的能力和生存能力进行研究。组织的任何成员都可以提出增加的建议。在项目孵化后,就会出现积极开发,然后才会推出。这些模块之间的互操作性被赋予了很高的优先级,因此这些组之间的定期通信由社区维护。目前,这些项目中有4个被归类为活动项目。活动标签意味着这些标签已经准备好使用,但还没有准备好发布重大版本。这4个模块可以说是推动区块链革命的最重要或最基本的模块。稍后,我们将详细介绍各个模块及其功能。然而,Hyperledger Fabric平台的简要描述,可以说是其中最受欢迎的。
|
||||
|
||||
### Hyperledger Fabric
|
||||
|
||||
**Hyperledger Fabric**[2]是一个完全开源的、基于区块链的许可 (非公开) DLT 平台,设计时考虑了企业的使用。该平台提供了适合企业环境的功能和结构。它是高度模块化的,允许开发人员在不同的一致协议、**链码协议**([智能合约][6]) 或身份管理系统等中进行选择。这是一个基于区块链的许可平台,利用身份管理系统,这意味着参与者将知道彼此在企业环境中需要的身份。Fabric允许以各种主流编程语言 (包括Java、Javascript、Go等) 开发智能合约(“链码”,是Hyperledger团队使用的术语)。这使得机构和企业可以利用他们在该领域的现有人才,而无需雇佣或重新培训开发人员来开发他们自己的智能合约。与标准订单验证系统相比,Fabric还使用执行顺序验证系统来处理智能合约,以提供更好的可靠性,这些系统由提供智能合约功能的其他平台使用。与标准订单验证系统相比,Fabric还使用执行顺序验证系统来处理智能合约,以提供更好的可靠性,这些系统由提供智能合约功能的其他平台使用。可插拔性能、身份管理系统、数据库管理系统、共识平台等是Fabric的其他功能,这些功能使它在竞争中保持领先地位。
|
||||
|
||||
|
||||
### 结论
|
||||
|
||||
诸如Hyperledger Fabric平台这样的项目能够在主流用例中更快地采用区块链技术。Hyperledger社区结构本身支持开放治理原则,并且由于所有项目都是作为开源平台引导的,因此这提高了团队在履行承诺时表现出来的安全性和责任感。
|
||||
|
||||
由于此类项目的主要应用涉及与企业合作及进一步开发平台和标准,因此Hyperledger项目目前在其他类似项目前面处于有利地位。
|
||||
|
||||
**参考资料**
|
||||
|
||||
* **[1][Samsung takes a seat with Intel and IBM at the Linux Foundation | TheINQUIRER][7]**
|
||||
* **[2] E. Androulaki et al., “Hyperledger Fabric: A Distributed Operating System for Permissioned Blockchains,” 2018.**
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/
|
||||
|
||||
作者:[editor][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[zionfuo](https://github.com/zionfuo)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.ostechnix.com/author/editor/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/Introduction-To-Hyperledger-Project-720x340.png
|
||||
[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction/
|
||||
[3]: https://www.hyperledger.org/members
|
||||
[4]: https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/
|
||||
[5]: http://www.hitachi.com/rev/archive/2017/r2017_01/expert/index.html
|
||||
[6]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/
|
||||
[7]: https://www.theinquirer.net/inquirer/news/2182438/samsung-takes-seat-intel-ibm-linux-foundation
|
122
translated/tech/20190823 Managing credentials with KeePassXC.md
Normal file
122
translated/tech/20190823 Managing credentials with KeePassXC.md
Normal file
@ -0,0 +1,122 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Managing credentials with KeePassXC)
|
||||
[#]: via: (https://fedoramagazine.org/managing-credentials-with-keepassxc/)
|
||||
[#]: author: (Marco Sarti https://fedoramagazine.org/author/msarti/)
|
||||
|
||||
使用 KeePassXC 管理凭据
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
[上一篇文章][2]我们讨论了使用服务器端技术的密码管理工具。这些工具非常有趣而且适合云安装。在本文中,我们将讨论 KeePassXC,这是一个简单的多平台开源软件,它使用本地文件作为数据库。
|
||||
|
||||
这种密码管理软件的主要优点是简单。无需服务器端技术专业知识,因此可供任何类型的用户使用。
|
||||
|
||||
### 介绍 KeePassXC
|
||||
|
||||
KeePassXC是一个开源的跨平台密码管理器:它是作为 KeePassX 的一个分支开始开发的,这是个不错的产品,但开发不是非常活跃。它使用 256 位密钥的 AES 算法将密钥保存在加密数据库中,这使得在云端设备(如 pCloud 或 Dropbox)中保存数据库相当安全。
|
||||
|
||||
除了密码,KeePassXC 还允许你在加密钱包中保存各种信息和附件。它还有一个有效的密码生成器,可以帮助用户正确地管理他的凭据。
|
||||
|
||||
### 安装
|
||||
|
||||
这个程序在标准的 Fedora 仓库和 Flathub 仓库中都有。不幸的是,沙箱程序无法使用浏览器集成,所以我建议通过 dnf 安装程序:
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
sudo dnf install keepassxc
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
### 创建你的钱包
|
||||
|
||||
要创建新数据库,有两个重要步骤:
|
||||
|
||||
* 选择加密设置:默认设置相当安全,增加转换轮次也会增加解密时间。
|
||||
* 选择主密钥和额外保护:主密钥必须易于记忆(如果丢失它,你的钱包就会丢失!)但是足够强大,一个至少有 4 个随机单词的密码可能是一个不错的选择。作为额外保护,你可以选择密钥文件(请记住:你必须始终都有它,否则无法打开钱包)和/或 YubiKey 硬件密钥。
|
||||
|
||||
|
||||
|
||||
![][3]
|
||||
|
||||
![][4]
|
||||
|
||||
数据库文件将保存到文件系统。如果你想与其他计算机/设备共享,可以将它保存在 U 盘或 pCloud 或 Dropbox 等云存储中。当然,如果你选择云存储,建议使用特别强大的主密码,如果有额外保护则更好。
|
||||
|
||||
### 创建你的第一个条目
|
||||
|
||||
创建数据库后,你可以开始创建第一个条目。对于 Web 登录,请在“条目”选项卡中输入用户名、密码和 URL。 你可以根据个人策略指定凭据的到期日期,也可以通过按右侧的按钮下载网站的 favicon 并将其关联为条目的图标,这是一个很好的功能。
|
||||
|
||||
![][5]
|
||||
|
||||
![][6]
|
||||
|
||||
KeePassXC 还提供了一个很好的密码/口令生成器,你可以选择长度和复杂度,并检查对暴力攻击的抵抗程度:
|
||||
|
||||
![][7]
|
||||
|
||||
### 浏览器集成
|
||||
|
||||
KeePassXC 有一个适用于所有主流浏览器的扩展。该扩展允许你填写所有已指定 URL 条目的登录信息。
|
||||
|
||||
必须在 KeePassXC(工具菜单 -> 设置)上启用浏览器集成,指定你要使用的浏览器:
|
||||
|
||||
![][8]
|
||||
|
||||
安装扩展后,必须与数据库建立连接。要执行此操作,请按扩展按钮,然后按“连接”按钮:如果数据库已打开并解锁,那么扩展程序将创建关联密钥并将其保存在数据库中,该密钥对于浏览器是唯一的,因此我建议对它适当命名:
|
||||
|
||||
![][9]
|
||||
|
||||
当你打开 URL 字段中的登录页并且数据库是解锁的,那么这个扩展程序将为你提供与该页面关联的所有凭据:
|
||||
|
||||
![][10]
|
||||
|
||||
通过这种方式,你可以通过 KeePassXC 获取互联网凭据,而无需将其保存在浏览器中。
|
||||
|
||||
### SSH agent integration
|
||||
|
||||
KeePassXC 的另一个有趣功能是与 SSH 集成。如果你使用 ssh 代理,KeePassXC 能够交互并添加你上传的 ssh 密钥到条目中。
|
||||
|
||||
首先,在常规设置(工具菜单 -> 设置)中,你必须启用 ssh 代理并重启程序:
|
||||
|
||||
![][11]
|
||||
|
||||
此时,你需要作为附件上传你的 ssh 密钥对到条目中。然后在 “SSH agent” 选项卡中选择附件下拉列表中的私钥,此时公钥将自动填充。不要忘记选择上面的两个复选框,以便在数据库打开/解锁时将密钥添加到代理,并在数据库关闭/锁定时删除:
|
||||
|
||||
![][12]
|
||||
|
||||
现在打开和解锁数据库,你可以使用钱包中保存的密钥登录 ssh。
|
||||
|
||||
唯一的限制是可以添加到代理的最大密钥数:ssh 服务器默认不接受超过5次登录尝试,出于安全原因,建议不要增加此值。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/managing-credentials-with-keepassxc/
|
||||
|
||||
作者:[Marco Sarti][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/msarti/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2019/08/keepassxc-816x345.png
|
||||
[2]: https://fedoramagazine.org/manage-your-passwords-with-bitwarden-and-podman/
|
||||
[3]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-07-33-27.png
|
||||
[4]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-07-48-21.png
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-08-30-07.png
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-08-43-11.png
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-08-49-22.png
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-09-48-09.png
|
||||
[9]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-09-05-57.png
|
||||
[10]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-09-13-29.png
|
||||
[11]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-09-47-21.png
|
||||
[12]: https://fedoramagazine.org/wp-content/uploads/2019/08/Screenshot-from-2019-08-17-09-46-35.png
|
Loading…
Reference in New Issue
Block a user