From 506f08712ecc96eb861fe16ceed7f3e2681ccdd9 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Mon, 10 Feb 2020 20:37:04 +0800 Subject: [PATCH 001/315] 'translated' --- ...00206 3 ways to use PostgreSQL commands.md | 230 ------------------ ...00206 3 ways to use PostgreSQL commands.md | 228 +++++++++++++++++ 2 files changed, 228 insertions(+), 230 deletions(-) delete mode 100644 sources/tech/20200206 3 ways to use PostgreSQL commands.md create mode 100644 translated/tech/20200206 3 ways to use PostgreSQL commands.md diff --git a/sources/tech/20200206 3 ways to use PostgreSQL commands.md b/sources/tech/20200206 3 ways to use PostgreSQL commands.md deleted file mode 100644 index 9cfedc8506..0000000000 --- a/sources/tech/20200206 3 ways to use PostgreSQL commands.md +++ /dev/null @@ -1,230 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 ways to use PostgreSQL commands) -[#]: via: (https://opensource.com/article/20/2/postgresql-commands) -[#]: author: (Greg Pittman https://opensource.com/users/greg-p) - -3 ways to use PostgreSQL commands -====== -Whether you need something simple, like a shopping list, or complex, -like a color swatch generator, PostgreSQL commands make it easy. -![Team checklist and to dos][1] - -In _[Getting started with PostgreSQL][2]_, I explained how to install, set up, and begin using the open source database software. But there's a lot more you can do with commands in [PostgreSQL][3]. - -For example, I use Postgres to keep track of my grocery shopping list. I do most of the grocery shopping in our home, and the bulk of it happens once a week. I go to several places to buy the things on my list because each store offers a particular selection or quality or maybe a better price. Initially, I made an HTML form page to manage my shopping list, but it couldn't save my entries. So, I had to wait to make my list all at once, and by then I usually forgot some items we need or I want. - -Instead, with PostgreSQL, I can enter bits when I think of them as the week goes on and print out the whole thing right before I go shopping. Here's how you can do that, too. - -### Create a simple shopping list - -First, enter the database with the **psql **command, then create a table for your list with: - - -``` -`Create table groc (item varchar(20), comment varchar(10));` -``` - -Type commands like the following to add items to your list: - - -``` -insert into groc values ('milk', 'K'); -insert into groc values ('bananas', 'KW'); -``` - -There are two pieces of information (separated by a comma) inside the parentheses: the item you want to buy and letters indicating where you want to buy it and whether it's something you usually buy every week (W). - -Since **psql** has a history, you can press the Up arrow and edit the data between the parentheses instead of having to type the whole line for each item. - -After entering a handful of items, check what you've entered with: - - -``` -Select * from groc order by comment; - -      item      | comment -\----------------+--------- - ground coffee  | H - butter         | K - chips          | K - steak          | K - milk           | K - bananas        | KW - raisin bran    | KW - raclette       | L - goat cheese    | L - onion          | P - oranges        | P - potatoes       | P - spinach        | PW - broccoli       | PW - asparagus      | PW - cucumber       | PW - sugarsnap peas | PW - salmon         | S -(18 rows) -``` - -This command orders the results by the _comment_ column so that the items are grouped by where you buy them to make it easier to shop. - -By using a W to indicate your weekly purchases, you can keep your weekly items on the list when you clear out the table to prepare for the next week's list. To so that, enter: - - -``` -`delete from groc where comment not like '%W';` -``` - -Notice that in PostgreSQL, **%** is the wildcard character (instead of an asterisk). So, to save typing, you might type: - - -``` -`delete from groc where item like 'goat%';` -``` - -You can't use **item = 'goat%'**; it won't work. - -When you're ready to shop, output your list to print it or send it to your phone with: - - -``` -\o groclist.txt -select * from groc order by comment; -\o -``` - -The last command, **\o**, with nothing afterward, resets the output to the command line. Otherwise, all output will continue to go to the groc file you created. - -### Analyze complex tables - -This item-by-item entry may be okay for short tables, but what about really big ones? A couple of years ago, I was helping the team at [FreieFarbe.de][4] to create a swatchbook of the free colors (freieFarbe means "free colors" in German) from its HLC color palette, where virtually any imaginable print color can be specified by its hue, luminosity (brightness), and chroma (saturation). The result was the [HLC Color Atlas][5], and here's how we did it. - -The team sent me files with color specifications so I could write Python scripts that would work with Scribus to generate the swatchbooks of color patches easily. One example started like: - - -``` -HLC, C, M, Y, K -H010_L15_C010, 0.5, 49.1, 0.1, 84.5 -H010_L15_C020, 0.0, 79.7, 15.1, 78.9 -H010_L25_C010, 6.1, 38.3, 0.0, 72.5 -H010_L25_C020, 0.0, 61.8, 10.6, 67.9 -H010_L25_C030, 0.0, 79.5, 18.5, 62.7 -H010_L25_C040, 0.4, 94.2, 17.3, 56.5 -H010_L25_C050, 0.0, 100.0, 15.1, 50.6 -H010_L35_C010, 6.1, 32.1, 0.0, 61.8 -H010_L35_C020, 0.0, 51.7, 8.4, 57.5 -H010_L35_C030, 0.0, 68.5, 17.1, 52.5 -H010_L35_C040, 0.0, 81.2, 22.0, 46.2 -H010_L35_C050, 0.0, 91.9, 20.4, 39.3 -H010_L35_C060, 0.1, 100.0, 17.3, 31.5 -H010_L45_C010, 4.3, 27.4, 0.1, 51.3 -``` - -This is slightly modified from the original, which separated the data with tabs. I transformed it into a CSV (comma-separated value) file, which I prefer to use with Python. (CSV files are also very useful because they can be imported easily into a spreadsheet program.) - -In each line, the first item is the color name, and it's followed by its C, M, Y, and K color values. The file consisted of 1,793 colors, and I wanted a way to analyze the information to get a sense of the range of values. This is where PostgreSQL comes into play. I did not want to enter all of this data manually—I don't think I could without errors (and headaches). Fortunately, PostgreSQL has a command for this. - -My first step was to create the database with: - - -``` -`Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal);` -``` - -Then I brought in the data with: - - -``` -`\copy  hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV);` -``` - -The backslash at the beginning is there because using the plain **copy** command is restricted to root and the Postgres superuser. In the parentheses, **header** means the first line contains headings and should be ignored, and **CSV** means the file format is CSV. Note that parentheses are not required around the color name in this method. - -If the operation is successful, I see a message that says **COPY NNNN**, where the N's refer to the number of rows inserted into the table. - -Finally, I can query the table with: - - -``` -select * from hlc_cmyk; - -     color     |   c   |   m   |   y   |  k   -\---------------+-------+-------+-------+------ - H010_L15_C010 |   0.5 |  49.1 |   0.1 | 84.5 - H010_L15_C020 |   0.0 |  79.7 |  15.1 | 78.9 - H010_L25_C010 |   6.1 |  38.3 |   0.0 | 72.5 - H010_L25_C020 |   0.0 |  61.8 |  10.6 | 67.9 - H010_L25_C030 |   0.0 |  79.5 |  18.5 | 62.7 - H010_L25_C040 |   0.4 |  94.2 |  17.3 | 56.5 - H010_L25_C050 |   0.0 | 100.0 |  15.1 | 50.6 - H010_L35_C010 |   6.1 |  32.1 |   0.0 | 61.8 - H010_L35_C020 |   0.0 |  51.7 |   8.4 | 57.5 - H010_L35_C030 |   0.0 |  68.5 |  17.1 | 52.5 -``` - -It goes on like this for all 1,793 rows of data. In retrospect, I can't say that this query was absolutely necessary for the HLC and Scribus task, but it allayed some of my anxieties about the project. - -To generate the HLC Color Atlas, I automated creating the color charts with Scribus for the 13,000+ colors in those pages of color swatches. - -I could have used the **copy** command to output my data: - - -``` -`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV);` -``` - -I also could restrict the output according to certain values with a **where** clause. - -For example, the following command will only send the table values for the hues that begin with H10. - - -``` -`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%';` -``` - -### Back up or transfer a database or table - -The final command I will mention here is **pg_dump**, which is used to back up a PostgreSQL database and runs outside of the **psql** console. For example: - - -``` -pg_dump gregp -t hlc_cmyk > hlc.out -pg_dump gregp > dball.out -``` - -The first line exports the **hlc_cmyk** table along with its structure. The second line dumps all the tables inside the **gregp** database. This is very useful for backing up or transferring a database or tables.  - -To transfer a database or table to another computer, first, create a database on the other computer (see my "[getting started][2]" article for details), then do the reverse process: - - -``` -`psql -d gregp -f dball.out` -``` - -This creates all the tables and enters the data in one step. - -### Conclusion - -In this article, we have seen how to use the **WHERE** parameter to restrict operations, along with the use of the PostgreSQL wildcard character **%**. We've also seen how to load a large amount of data into a table, then output some or all of the table data to a file, or even your entire database with all its individual tables. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/postgresql-commands - -作者:[Greg Pittman][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/greg-p -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) -[2]: https://opensource.com/article/19/11/getting-started-postgresql -[3]: https://www.postgresql.org/ -[4]: http://freiefarbe.de -[5]: https://www.freiefarbe.de/en/thema-farbe/hlc-colour-atlas/ diff --git a/translated/tech/20200206 3 ways to use PostgreSQL commands.md b/translated/tech/20200206 3 ways to use PostgreSQL commands.md new file mode 100644 index 0000000000..da2671cc2f --- /dev/null +++ b/translated/tech/20200206 3 ways to use PostgreSQL commands.md @@ -0,0 +1,228 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 ways to use PostgreSQL commands) +[#]: via: (https://opensource.com/article/20/2/postgresql-commands) +[#]: author: (Greg Pittman https://opensource.com/users/greg-p) + +3种使用 PostgreSQL 命令的方式 +====== +无论你需要的东西简单(如一个购物清单)亦或复杂(如色卡生成器) + PostgreSQL 命令都能使它变得容易起来。 + +![Team checklist and to dos][1] + +在 _[PostgreSQL 入门][2]_ 一文中, 我解释了如何安装,设置和开始使用开源数据库软件。然而,使用 [PostgreSQL][3] 中的命令可以做更多事情。 + +例如,我使用 Postgres 来跟踪我杂货店的购物清单。我杂货店里的大多数购物是在家里进行的,其中每周进行一次大批量的采购。我去几个不同的地方购买清单上的东西,因为每家商店都提供特定的选择或质量,亦或更好的价格。最初,我制作了一个HTML表单页面来管理我的购物清单,但这样无法保存我的输入内容。因此,在想到要购买的物品时我必须要马上列出清单,因为到采购时我常常会忘记一些我需要或想要的东西。 + +相反,使用 PostgreSQL,当我想到需要的物品时,我可以随时输入,并在购物前打印出来。你也可以这样做。 + + +### 创建一个简单的购物清单 + + +首先,数据库中输入**psql ** 命令,然后用下面的命令创建一个表: +``` +`Create table groc (item varchar(20), comment varchar(10));` +``` + +输入如下命令在清单中加入商品: + +``` +insert into groc values ('milk', 'K'); +insert into groc values ('bananas', 'KW'); +``` + +括号中有两个信息(逗号隔开):前面是你需要买的东西,后面字母代表你要购买的地点以及哪些东西是你每周通常都要买的(W)。 + +因为 **psql** 有历史记录,你可以按向上键在括号内编辑信息,而无需输入商品的整行信息。 + +在输入一小部分商品后,输入下面命令来检查前面的输入内容。 + +``` +Select * from groc order by comment; + + item | comment +\----------------+--------- + ground coffee | H + butter | K + chips | K + steak | K + milk | K + bananas | KW + raisin bran | KW + raclette | L + goat cheese | L + onion | P + oranges | P + potatoes | P + spinach | PW + broccoli | PW + asparagus | PW + cucumber | PW + sugarsnap peas | PW + salmon | S +(18 rows) +``` + +此命令按_comment_ 列对结果进行排序,以便按购买地点对商品进行分组,从而是你的购物更加方便。 + +使用W来指明你每周要买的东西,当你要清除表单为下周的列表做准备时,你可以将每周的商品保留在购物清单上。输入: + +``` +`delete from groc where comment not like '%W';` +``` + +注意,在 PostgreSQL 中 **%** 表示通配符(而非星号)。所以,要保存输入内容,需要输入: + +``` +`delete from groc where item like 'goat%';` +``` + +不能使用**item = 'goat%'**,这样没用。 + + +在购物时,用以下命令输出清单并打印出来发送到你的手机: + +``` +\o groclist.txt +select * from groc order by comment; +\o +``` + +最后一个命令**\o*,重置输出到命令行。否则,所有的输出会继续输出到你创建的杂货店购物文件中。 + +### 分析复杂的表 + +This item-by-item entry may be okay for short tables, but what about really big ones? A couple of years ago, I was helping the team at [FreieFarbe.de][4] to create a swatchbook of the free colors (freieFarbe means "free colors" in German) from its HLC color palette, where virtually any imaginable print color can be specified by its hue, luminosity (brightness), and chroma (saturation). The result was the [HLC Color Atlas][5], and here's how we did it. + +逐个输入对于数据量小的表来说没有问题,但是对于数据量大的表呢?几年前,我帮团队从 HLC 调色板中创建一个自由色的色样册。事实上,任何能想象到的打印色都可按色调、亮度、浓度(饱和度)来规定。最终结果是[HLC Color Atlas][5],下面是我们如何实现的。 + +该团队向我发送了具有颜色规范的文件,因此我可以编写可与 Scribus 配合使用的 Python 脚本,以轻松生成色样册。一个例子像这样开始: + + +``` +HLC, C, M, Y, K +H010_L15_C010, 0.5, 49.1, 0.1, 84.5 +H010_L15_C020, 0.0, 79.7, 15.1, 78.9 +H010_L25_C010, 6.1, 38.3, 0.0, 72.5 +H010_L25_C020, 0.0, 61.8, 10.6, 67.9 +H010_L25_C030, 0.0, 79.5, 18.5, 62.7 +H010_L25_C040, 0.4, 94.2, 17.3, 56.5 +H010_L25_C050, 0.0, 100.0, 15.1, 50.6 +H010_L35_C010, 6.1, 32.1, 0.0, 61.8 +H010_L35_C020, 0.0, 51.7, 8.4, 57.5 +H010_L35_C030, 0.0, 68.5, 17.1, 52.5 +H010_L35_C040, 0.0, 81.2, 22.0, 46.2 +H010_L35_C050, 0.0, 91.9, 20.4, 39.3 +H010_L35_C060, 0.1, 100.0, 17.3, 31.5 +H010_L45_C010, 4.3, 27.4, 0.1, 51.3 +``` + +这与原文件相比,稍有修改,将数据用制表符分隔。我将其转换成 CSV 格式(逗号分割值),我更喜欢其与 Python 一起使用(CSV 文也很有用因为它可轻松导入到电子表格程序中)。 + +在每一行中,第一项是颜色名称,其后是其 C,M,Y 和 K 颜色值。 该文件包含1,793种颜色,我想要一种分析信息的方法,以了解这些值的范围。 这就是 PostgreSQL 发挥作用的地方。 我不想手动输入所有数据-我认为输入过程中我不可能不出错。 幸运的是,PostgreSQL 为此提供了一个命令。 + +首先用以下命令创建数据库: + +``` +`Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal);` +``` + +然后通过以下命令引入数据: + + +``` +`\copy hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV);` +``` + + +开头有反斜杠,是因为使用纯**copy** 命令仅限于 root 用户和 Postgres 的超级用户。 在括号中,**header** 表示第一行包含标题,应忽略,**CSV** 表示文件格式为 CSV。 请注意,在此方法中,颜色名称周围不需要括号。 + +如果操作成功,会看到 **COPY NNNN**,其中 N 表示插入到表中的行号。 + +最后,可以用下列命令查询: + +``` +select * from hlc_cmyk; + + color | c | m | y | k +\---------------+-------+-------+-------+------ + H010_L15_C010 | 0.5 | 49.1 | 0.1 | 84.5 + H010_L15_C020 | 0.0 | 79.7 | 15.1 | 78.9 + H010_L25_C010 | 6.1 | 38.3 | 0.0 | 72.5 + H010_L25_C020 | 0.0 | 61.8 | 10.6 | 67.9 + H010_L25_C030 | 0.0 | 79.5 | 18.5 | 62.7 + H010_L25_C040 | 0.4 | 94.2 | 17.3 | 56.5 + H010_L25_C050 | 0.0 | 100.0 | 15.1 | 50.6 + H010_L35_C010 | 6.1 | 32.1 | 0.0 | 61.8 + H010_L35_C020 | 0.0 | 51.7 | 8.4 | 57.5 + H010_L35_C030 | 0.0 | 68.5 | 17.1 | 52.5 +``` + + +所有1,793行数据都是这样的。 回想起来,我不能说此查询对于HLC和Scribus任务是绝对必要的,但是它减轻了我对该项目的一些担忧。 + +为了生成 HLC 色谱,我使用 Scribus 为色板页面中的13,000多种颜色自动创建了颜色图表。 + +我可以使用 **copy** 命令输出数据: + +``` +`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV);` +``` + + +我还可以使用 ** where ** 子句根据某些值来限制输出。 + +例如,以下命令将仅发送以 H10 开头的色调值。 + + +``` +`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%';` +``` + +### 备份或传输数据库或表 + +我在此要提到的最后一个命令是**pg_dump**,它用于备份 PostgreSQL 数据库,并在 **psql** 控制台之外运行。 例如: + +``` +pg_dump gregp -t hlc_cmyk > hlc.out +pg_dump gregp > dball.out +``` + +第一行是导出 **hlc_cmyk** 表及其结构。第二行将转储 **gregp** 数据库中的所有表。 这对于备份或传输数据库或表非常有用。 + + +要将数据库或表转到另一台电脑( 查看"[ PostgreSQL 入门][2]" 那篇文章获取详细信息),首先在要转入的电脑上创建一个数据库,然后执行相反的操作。 + +``` +`psql -d gregp -f dball.out` +``` + +一步创建所有表并输入数据。 + +### 总结 + +在本文中,我们了解了如何使用 **WHERE** 参数限制操作,以及如何使用 PostgreSQL 通配符 **%**。 我们还了解了如何将大批量数据加载到表中,然后将部分或全部表数据输出到文件,甚至是将整个数据库及其所有单个表输出。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/postgresql-commands + +作者:[Greg Pittman][a] +选题:[lujun9972][b] +译者:[Morisun029](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/greg-p +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) +[2]: https://opensource.com/article/19/11/getting-started-postgresql +[3]: https://www.postgresql.org/ +[4]: http://freiefarbe.de +[5]: https://www.freiefarbe.de/en/thema-farbe/hlc-colour-atlas/ From 9092eb263e85ae9884ad0ef5ae8d055480fb7656 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Mon, 10 Feb 2020 20:46:16 +0800 Subject: [PATCH 002/315] fix issue --- translated/tech/20200206 3 ways to use PostgreSQL commands.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20200206 3 ways to use PostgreSQL commands.md b/translated/tech/20200206 3 ways to use PostgreSQL commands.md index da2671cc2f..9f5890f370 100644 --- a/translated/tech/20200206 3 ways to use PostgreSQL commands.md +++ b/translated/tech/20200206 3 ways to use PostgreSQL commands.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Morisun029) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 52b3dedc4a1df1d6a7fae17b23769902f5ddacfa Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Mon, 10 Feb 2020 21:10:29 +0800 Subject: [PATCH 003/315] Revert "Merge remote-tracking branch 'upstream/master'" This reverts commit 6ad0e2257601265a0fd0f80d665590a0a6d8666a, reversing changes made to 9092eb263e85ae9884ad0ef5ae8d055480fb7656. --- ...-CD resources to set you up for success.md | 57 --------- ... vs. proprietary- What-s the difference.md | 72 ----------- ...190407 Manage multimedia files with Git.md | 2 +- ...ra to your Android phone with GSConnect.md | 118 ++++++++++++++++++ ...ith This Single Command -Beginner-s Tip.md | 114 ----------------- ...-CD resources to set you up for success.md | 64 ++++++++++ ...in one place with this open source tool.md | 27 ++-- ...ra to your Android phone with GSConnect.md | 118 ------------------ 8 files changed, 196 insertions(+), 376 deletions(-) delete mode 100644 published/20191227 Top CI-CD resources to set you up for success.md delete mode 100644 sources/talk/20200209 Open source vs. proprietary- What-s the difference.md create mode 100644 sources/tech/20200207 Connect Fedora to your Android phone with GSConnect.md delete mode 100644 sources/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md create mode 100644 translated/tech/20191227 Top CI-CD resources to set you up for success.md rename {published => translated/tech}/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md (66%) delete mode 100644 translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md diff --git a/published/20191227 Top CI-CD resources to set you up for success.md b/published/20191227 Top CI-CD resources to set you up for success.md deleted file mode 100644 index a19cea5720..0000000000 --- a/published/20191227 Top CI-CD resources to set you up for success.md +++ /dev/null @@ -1,57 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Morisun029) -[#]: reviewer: (wxy) -[#]: publisher: (wxy) -[#]: url: (https://linux.cn/article-11875-1.html) -[#]: subject: (Top CI/CD resources to set you up for success) -[#]: via: (https://opensource.com/article/19/12/cicd-resources) -[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) - -顶级 CI / CD 资源,助你成功 -====== - -> 随着企业期望实现无缝、灵活和可扩展的部署,持续集成和持续部署成为 2019 年的关键主题。 - -![Plumbing tubes in many directions][1] - -对于 CI/CD 和 DevOps 来说,2019 年是非常棒的一年。Opensource.com 的作者分享了他们专注于无缝、灵活和可扩展部署时是如何朝着敏捷和 scrum 方向发展的。以下是我们 2019 年发布的 CI/CD 文章中的一些重要文章。 - -### 学习和提高你的 CI/CD 技能 - -我们最喜欢的一些文章集中在 CI/CD 的实操经验上,并涵盖了许多方面。通常以 [Jenkins][2] 管道开始,Bryant Son 的文章《[用 Jenkins 构建 CI/CD 管道][3]》将为你提供足够的经验,以开始构建你的第一个管道。Daniel Oh 在《[用 DevOps 管道进行自动验收测试][4]》一文中,提供了有关验收测试的重要信息,包括可用于自行测试的各种 CI/CD 应用程序。我写的《[安全扫描 DevOps 管道][5]》非常简短,其中简要介绍了如何使用 Jenkins 平台在管道中设置安全性。 - -### 交付工作流程 - -正如 Jithin Emmanuel 在《[Screwdriver:一个用于持续交付的可扩展构建平台][6]》中分享的,在学习如何使用和提高你的 CI/CD 技能方面,工作流程很重要,特别是当涉及到管道时。Emily Burns 在《[为什么 Spinnaker 对 CI/CD 很重要][7]》中解释了灵活地使用 CI/CD 工作流程准确构建所需内容的原因。Willy-Peter Schaub 还盛赞了为所有产品创建统一管道的想法,以便《[在一个 CI/CD 管道中一致地构建每个产品][8]》。这些文章将让你很好地了解在团队成员加入工作流程后会发生什么情况。 - -### CI/CD 如何影响企业 - -2019 年也是认识到 CI/CD 的业务影响以及它是如何影响日常运营的一年。Agnieszka Gancarczyk 分享了 Red Hat 《[小型 Scrum vs. 大型 Scrum][9]》的调查结果, 包括受访者对 Scrum、敏捷运动及对团队的影响的不同看法。Will Kelly 的《[持续部署如何影响整个组织][10]》,也提及了开放式沟通的重要性。Daniel Oh 也在《[DevOps 团队必备的 3 种指标仪表板][11]》中强调了指标和可观测性的重要性。最后是 Ann Marie Fred 的精彩文章《[不在生产环境中测试?要在生产环境中测试!][12]》详细说明了在验收测试前在生产环境中测试的重要性。 - -感谢许多贡献者在 2019 年与 Opensource 的读者分享他们的见解,我期望在 2020 年里从他们那里了解更多有关 CI/CD 发展的信息。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/cicd-resources - -作者:[Jessica Cherry][a] -选题:[lujun9972][b] -译者:[Morisun029](https://github.com/Morisun029) -校对:[wxy](https://github.com/wxy) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jrepka -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions) -[2]: https://jenkins.io/ -[3]: https://linux.cn/article-11546-1.html -[4]: https://opensource.com/article/19/4/devops-pipeline-acceptance-testing -[5]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline -[6]: https://opensource.com/article/19/3/screwdriver-cicd -[7]: https://opensource.com/article/19/8/why-spinnaker-matters-cicd -[8]: https://opensource.com/article/19/7/cicd-pipeline-rule-them-all -[9]: https://opensource.com/article/19/3/small-scale-scrum-vs-large-scale-scrum -[10]: https://opensource.com/article/19/7/organizational-impact-continuous-deployment -[11]: https://linux.cn/article-11183-1.html -[12]: https://opensource.com/article/19/5/dont-test-production diff --git a/sources/talk/20200209 Open source vs. proprietary- What-s the difference.md b/sources/talk/20200209 Open source vs. proprietary- What-s the difference.md deleted file mode 100644 index 2c6b6fce0b..0000000000 --- a/sources/talk/20200209 Open source vs. proprietary- What-s the difference.md +++ /dev/null @@ -1,72 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Open source vs. proprietary: What's the difference?) -[#]: via: (https://opensource.com/article/20/2/open-source-vs-proprietary) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Open source vs. proprietary: What's the difference? -====== -Need four good reasons to tell your friends to use open source? Here's -how to make your case. -![Doodles of the word open][1] - -There's a lot to be learned from open source projects. After all, managing hundreds of disparate, asynchronous commits and bugs doesn't happen by accident. Someone or something has to coordinate releases, and keep all the code and project roadmaps organized. It's a lot like life. You have lots of tasks demanding your attention, and you have to tend to each in turn. To ensure everything gets done before its deadline, you try to stay organized and focused. - -Fortunately, there are [applications out there][2] designed to help with that sort of thing, and many apply just as well to real life as they do to software. - -Here are some reasons for choosing [open tools][3] when improving personal or project-based organization. - -### Data ownership - -It's rarely profitable for proprietary tools to provide you with [data][4] dumps. Some products, usually after a long battle with their users (and sometimes a lawsuit), provide ways to extract your data from them. But the real issue isn't whether a company lets you extract data; it's the fact that the capability to get to your data isn't guaranteed in the first place. It's your data, and when it's literally what you do each day, it is, in a way, your life. Nobody should have primary access to that but you, so why should you have to petition a company for a copy? - -Using an open source tool ensures you have priority access to your own activities. When you need a copy of something, you already have it. When you need to export it from one application to another, you have complete control of how the data is exchanged. If you need to export your schedule from a calendar into your kanban board, you can manipulate and process the data to fit. You don't have to wait for functionality to be added to the app, because you own the data, the database, and the app. - -### Working for yourself - -When you use open source tools, you often end up improving them, sometimes whether you know it or not. You may not (or you may!) download the source and hack on code, but you probably fall into a way of using the tool that works best for you. You optimize your interaction with the tool. The unique way you interact with your tooling creates a kind of meta-tool: you haven't changed the software, but you've adapted it and yourself in ways that the project author and a dozen other users never imagined. Everyone does this with whatever software they rely upon, and it's why sitting at someone else's computer to use a familiar software (or even just looking over someone's shoulder) often feels foreign, like you're using a different version of the application than you're used to. - -When you do this with proprietary software, you're either contributing to someone else's marketplace for free, or you're adjusting your own behavior based on forces outside your own control. When you optimize an open source tool, both the software and the interaction belong to you. - -### The right to not upgrade - -Tools change. It's the way of things. - -Change can be frustrating, but it can be crippling when a service changes so severely that it breaks your workflow. A proprietary service has and maintains every right to change its product, and you explicitly accept this by using the product. If your favorite accounting software or scheduling web app changes its interface or its output options, you usually have no recourse but to adapt or stop using the service. Proprietary services reserve the right to remove features, arbitrarily and without warning, and it's not uncommon for companies to start out with an open API and strong compatibility with open source, only to drop these conveniences once its customer base has reached critical mass. - -Open source changes, too. Changes in open source can be frustrating, too, and it can even drive users to alternative open source solutions. The difference is that when open source changes, you still own the unchanged code base. More importantly, lots of other people do too, and if there's enough desire for it, the project can be forked. There are several famous examples of this, but admittedly there are just as many examples where the demand was _not_ great enough, and users essentially had to adapt. - -Even so, users are never truly forced to do anything in open source. If you want to hack together an old version of your mission-critical service on an old distro running ancient libraries in a virtual machine, you can do that because you own the code. When a proprietary service changes, you have no choice but to follow. - -With open source, you can choose to forge your own path when necessary or follow the developers when convenient. - -### Open for collaboration - -Proprietary services can affect others in ways you may not realize. Closed source tools are accidentally insidious. If you use a proprietary product to manage your schedule or your recipes or your library, or you use a proprietary font in your graphic design or website, then the moment you need to coordinate with someone else, you are essentially forcing them to sign up for the same proprietary service because proprietary services usually require accounts. Of course, the same is sometimes true for an open source solution, but it's not common for open source products to collect and sell user data the way proprietary vendors do, so the stakes aren't quite the same. - -### Independence - -Ultimately, the open source advantage is one of independence for you and for those you want to collaborate with. Not everyone uses open source, and even if everyone did not everyone would use the exact same tool or the same assets, so there will always be some negotiation when sharing data. However, by keeping your data and projects open, you enable everyone (your future self included) to contribute. - -What steps do you take to ensure your work is open and accessible? Tell us in the comments! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/open-source-vs-proprietary - -作者:[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/EDUCATION_doodles.png?itok=W_0DOMM4 (Doodles of the word open) -[2]: https://opensource.com/article/20/1/open-source-productivity-tools -[3]: https://opensource.com/tags/tools -[4]: https://opensource.com/tags/analytics-and-metrics diff --git a/sources/tech/20190407 Manage multimedia files with Git.md b/sources/tech/20190407 Manage multimedia files with Git.md index 888191344c..340c356aa9 100644 --- a/sources/tech/20190407 Manage multimedia files with Git.md +++ b/sources/tech/20190407 Manage multimedia files with Git.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (svtter) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20200207 Connect Fedora to your Android phone with GSConnect.md b/sources/tech/20200207 Connect Fedora to your Android phone with GSConnect.md new file mode 100644 index 0000000000..528289f3b0 --- /dev/null +++ b/sources/tech/20200207 Connect Fedora to your Android phone with GSConnect.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Connect Fedora to your Android phone with GSConnect) +[#]: via: (https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/) +[#]: author: (Lokesh Krishna https://fedoramagazine.org/author/lowkeyskywalker/) + +Connect Fedora to your Android phone with GSConnect +====== + +![][1] + +Both Apple and Microsoft offer varying levels of integration of their desktop offerings with your mobile devices. Fedora offers a similar if not greater degree of integration with **GSConnect**. It lets you pair your Android phone with your Fedora desktop and opens up a lot of possibilities. Keep reading to discover more about what it is and how it works. + +### What is GSConnect? + +GSConnect is an implementation of the KDE Connect project tailored for the GNOME desktop. KDE Connect makes it possible for your devices to communicate with each other. However, installing it on Fedora’s default GNOME desktop requires pulling in a large number of KDE dependencies. + +GSConnect is a complete implementation of KDE Connect, but in the form of a GNOME shell extension. Once installed, GSConnect lets you do the following and a lot more: + + * Receive phone notifications on your desktop and reply to messages + * Use your phone as a remote control for your desktop + * Share files and links between devices + * Check your phone’s battery level from the desktop + * Ring your phone to help find it + + + +### Setting up the GSConnect extension + +Setting up GSConnect requires installing two components: the GSConnect extension on your desktop and the KDE Connect app on your Android device. + +First, install the GSConnect extension from the GNOME Shell extensions website: [GSConnect][2]. (Fedora Magazine has a handy article on [How to install a GNOME Shell extension][3] to help you with this step.) + +The KDE Connect app is available on Google’s [Play Store][4]. It’s also available on the FOSS Android apps repository, [F-Droid][5]. + +Once you have installed both these components, you can pair your two devices. Installing the extension makes it show up in your system menu as _Mobile Devices_. Clicking on it displays a drop down menu, from which you can access _Mobile Settings_. + +![][6] + +Here’s where you can view your paired devices and manage the features offered by GSConnect. Once you are on this screen, launch the app on your Android device. + +You can initiate pairing from either device, but here you’ll be connecting to your desktop from the Android device. Simply hit refresh on the app, and as long as both devices are on the same wireless network, your desktop shows up in your Android device. You can now send a pair request to the desktop. Accept the pair request on your desktop to complete the pairing. + +![][7] + +### Using GSConnect + +Once paired, you’ll need to grant permissions on your Android device to make use of the many features available on GSConnect. Click on the paired device in the list of devices to see all available functions and enable or disable them according to your preferences. + +![][8] + +Remember that you’ll also need to grant corresponding permissions in the Android app to be able to use these functions. Depending upon the features you’ve enabled and the permissions you’ve granted, you can now access your mobile contacts on your desktop, get notified of messages and reply to them, and even sync the desktop and Android device clipboards. + +### Integration with Files and your web browsers + +GSConnect allows you to directly send files to your Android device from your desktop file explorer’s context menu. + +On Fedora’s default GNOME desktop, you will need to install the _nautilus-python_ package in order to make your paired devices show up in the context menu. Installing this is as straightforward as running the following command from your preferred terminal: + +``` +$ sudo dnf install nautilus-python +``` + +Once done, the _Send to Mobile Device_ entry appears in the context menu of the Files app. + +![][9] + +Similarly, install the corresponding WebExtension for your browser, be it [Firefox][10] or [Chrome][11], to send links to your Android device. You have the option to send the link to launch directly in your browser or to deliver it as SMS. + +### Running Commands + +GSConnect lets you define commands which you can then run on your desktop, from your remote device. This allows you to do things such as take a screenshot of your desktop, or lock and unlock your desktop from your Android device, remotely. + +![][12] + +To make use of this feature, you can use standard shell commands and the CLI exposed by GSConnect. Documentation on this is provided in the project’s GitHub repository: _CLI Scripting_. + +The [KDE UserBase Wiki][13] has a list of example commands. These examples cover controlling the brightness and volume on your desktop, locking the mouse and keyboard, and even changing the desktop theme. Some of the commands are specific for KDE Plasma, and modifications are necessary to make it run on the GNOME desktop. + +### Explore and have fun + +GSConnect makes it possible to enjoy a great degree of convenience and comfort. Dive into the preferences to see all that you can do and get creative with the commands function. Feel free to share all the possibilities this utility unlocked in your workflow in the comments below. + +* * * + +_Photo by [Pathum Danthanarayana][14] on [Unsplash][15]._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/ + +作者:[Lokesh Krishna][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/lowkeyskywalker/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/12/gsconnect-816x345.jpg +[2]: https://extensions.gnome.org/extension/1319/gsconnect/ +[3]: https://fedoramagazine.org/install-gnome-shell-extension/ +[4]: https://play.google.com/store/apps/details?id=org.kde.kdeconnect_tp +[5]: https://f-droid.org/en/packages/org.kde.kdeconnect_tp/ +[6]: https://fedoramagazine.org/wp-content/uploads/2020/01/within-the-menu-1024x576.png +[7]: https://fedoramagazine.org/wp-content/uploads/2020/01/pair-request-1024x576.png +[8]: https://fedoramagazine.org/wp-content/uploads/2020/01/permissions-1024x576.png +[9]: https://fedoramagazine.org/wp-content/uploads/2020/01/send-to-mobile-2-1024x576.png +[10]: https://addons.mozilla.org/en-US/firefox/addon/gsconnect/ +[11]: https://chrome.google.com/webstore/detail/gsconnect/jfnifeihccihocjbfcfhicmmgpjicaec +[12]: https://fedoramagazine.org/wp-content/uploads/2020/01/commands-1024x576.png +[13]: https://userbase.kde.org/KDE_Connect/Tutorials/Useful_commands +[14]: https://unsplash.com/@pathum_danthanarayana?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[15]: https://unsplash.com/s/photos/android?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/sources/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md b/sources/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md deleted file mode 100644 index 1b985e738f..0000000000 --- a/sources/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Install All Essential Media Codecs in Ubuntu With This Single Command [Beginner’s Tip]) -[#]: via: (https://itsfoss.com/install-media-codecs-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Install All Essential Media Codecs in Ubuntu With This Single Command [Beginner’s Tip] -====== - -If you have just installed Ubuntu or some other [Ubuntu flavors][1] like Kubuntu, Lubuntu etc, you’ll notice that your system doesn’t play some audio or video file. - -For video files, you can [install VLC on Ubuntu][2]. [VLC][3] one of the [best video players for Linux][4] and can play almost any video file format. But you’ll still have troubles with audio media files and flash player. - -The good thing is that [Ubuntu][5] provides a single package to install all the essential media codecs: ubuntu-restricted-extras. - -![][6] - -### What is Ubuntu Restricted Extras? - -The ubuntu-restricted-extras is a software package that consists various essential software like flash plugin, [unrar][7], [gstreamer][8], mp4, codecs for [Chromium browser in Ubuntu][9] etc. - -Since these software are not open source and some of them involve software patents, Ubuntu doesn’t install them by default. You’ll have to use multiverse repository, the software repository specifically created by Ubuntu to provide non-open source software to its users. - -Please read this article to [learn more about various Ubuntu repositories][10]. - -### How to install Ubuntu Restricted Extras? - -I find it surprising that the software center doesn’t list Ubuntu Restricted Extras. In any case, you can install the package using command line and it’s very simple. - -Open a terminal by searching for it in the menu or using the [terminal keyboard shortcut Ctrl+Alt+T][11]. - -Since ubuntu-restrcited-extras package is available in the multiverse repository, you should verify that the multiverse repository is enabled on your system: - -``` -sudo add-apt-repository multiverse -``` - -And then you can install it in Ubuntu default edition using this command: - -``` -sudo apt install ubuntu-restricted-extras -``` - -When you enter the command, you’ll be asked to enter your password. When _**you type the password, nothing is displayed on the screen**_. That’s normal. Type your password and press enter. - -It will show a huge list of packages to be installed. Press enter to confirm your selection when it asks. - -You’ll also encounter an [EULA][12] (End User License Agreement) screen like this: - -![Press Tab key to select OK and press Enter key][13] - -It could be overwhelming to navigate this screen but don’t worry. Just press tab and it will highlight the options. When the correct options are highlighted, press enter to confirm your selection. - -![Press Tab key to highlight Yes and press Enter key][14] - -Once the process finishes, you should be able to play MP3 and other media formats thanks to newly installed media codecs. - -##### Installing restricted extra package on Kubuntu, Lubuntu, Xubuntu - -Do keep in mind that Kubuntu, Lubuntu and Xubuntu has this package available with their own respective names. They should have just used the same name but they don’t unfortunately. - -On Kubuntu, use this command: - -``` -sudo apt install kubuntu-restricted-extras -``` - -On Lubuntu, use: - -``` -sudo apt install lubuntu-restricted-extras -``` - -On Xubuntu, you should use: - -``` -sudo apt install xubuntu-restricted-extras -``` - -I always recommend getting ubuntu-restricted-extras as one of the [essential things to do after installing Ubuntu][15]. It’s good to have a single command to install multiple codecs in Ubuntu. - -I hope you like this quick tip in the Ubuntu beginner series. I’ll share more such tips in the future. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-media-codecs-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/which-ubuntu-install/ -[2]: https://itsfoss.com/install-latest-vlc/ -[3]: https://www.videolan.org/index.html -[4]: https://itsfoss.com/video-players-linux/ -[5]: https://ubuntu.com/ -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/Media_Codecs_in_Ubuntu.png?ssl=1 -[7]: https://itsfoss.com/use-rar-ubuntu-linux/ -[8]: https://gstreamer.freedesktop.org/ -[9]: https://itsfoss.com/install-chromium-ubuntu/ -[10]: https://itsfoss.com/ubuntu-repositories/ -[11]: https://itsfoss.com/ubuntu-shortcuts/ -[12]: https://en.wikipedia.org/wiki/End-user_license_agreement -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/installing_ubuntu_restricted_extras.jpg?ssl=1 -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/installing_ubuntu_restricted_extras_1.jpg?ssl=1 -[15]: https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/ diff --git a/translated/tech/20191227 Top CI-CD resources to set you up for success.md b/translated/tech/20191227 Top CI-CD resources to set you up for success.md new file mode 100644 index 0000000000..102e53d153 --- /dev/null +++ b/translated/tech/20191227 Top CI-CD resources to set you up for success.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: (Morisun029) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top CI/CD resources to set you up for success) +[#]: via: (https://opensource.com/article/19/12/cicd-resources) +[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) + +顶级 CI / CD 资源,助您成功 +====== +随着企业期望实现无缝,灵活和可扩展的部署,持续集成和持续部署成为2019年的关键主题。 +![Plumbing tubes in many directions][1] + +对于 CI / CD 和 DevOps 来说,2019年是非常棒的一年。 Opensource 公司的作者分享了他们专注于无缝,灵活和可扩展部署时是如何朝着敏捷方向发展的。以下是我们2019年发布的 CI / CD 文章中的一些重要主题。 + +### 学习和提高您的 CI / CD 技能 + + +我们最喜欢的一些文章集中在 CI / CD 的实操经验上,并涵盖了许多方面。通常以[Jenkins][2]管道开始,布莱恩特的文章[用 Jenkins 构建 CI/CD 管道][4]将为您提供足够的经验,以开始构建您的第一个管道。丹尼尔在 [用DevOps 管道进行自动验收测试][4]一文中,提供了有关验收测试的重要信息,包括可用于独立测试的各种 CI / CD 应用程序。我写的[安全扫描DevOps 管道][5]非常简短,其中的关键点是关于如何使用 Jenkins 平台在管道中设置安全性的教程。 + +### 交付工作流程 + + +威利•彼得•绍布赞扬为所有产品创建统一流水线的想法,以使[每种产品在一个CI / CD 流水线中持续建立起来,以管控所有产品][8]。这些文章将使您更好地了解团队成员加入工作流流程后会发生什么。 + +### CI / CD 如何影响企业 + + +2019年也是认识到 CI / CD 的业务影响以及它如何影响日常运营的一年。 + + + +Agnieszka Gancarczyk 分享了Red Hat[小型Scrum vs.大型Scrum][9] 的调查结果, 包括受访者对srums, + +敏捷运动及其对团队的影响的不同看法。威尔安•凯丽 的[持续部署如何影响企业][10], 包括开放式沟通的重要性,丹尼尔也强调了[DevOps 团队在3 种类型的指表板][11]中指标和可观测性的重要性。最后是安•玛丽•弗雷德的精彩文章: [不要在生产环境中测试?在生产环境中测试!][12] 详细说明了验收测试前在生产环境中测试的重要性。 + +感谢许多贡献者在2019年与 Opensource 的读者分享他们的见解,我期望在2020年里从他们那里了解更多有关 CI / CD 发展的信息。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/cicd-resources + +作者:[Jessica Cherry][a] +选题:[lujun9972][b] +译者:[Morisun029](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jrepka +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions) +[2]: https://jenkins.io/ +[3]: https://opensource.com/article/19/9/intro-building-cicd-pipelines-jenkins +[4]: https://opensource.com/article/19/4/devops-pipeline-acceptance-testing +[5]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline +[6]: https://opensource.com/article/19/3/screwdriver-cicd +[7]: https://opensource.com/article/19/8/why-spinnaker-matters-cicd +[8]: https://opensource.com/article/19/7/cicd-pipeline-rule-them-all +[9]: https://opensource.com/article/19/3/small-scale-scrum-vs-large-scale-scrum +[10]: https://opensource.com/article/19/7/organizational-impact-continuous-deployment +[11]: https://opensource.com/article/19/7/dashboards-devops-teams +[12]: https://opensource.com/article/19/5/dont-test-production diff --git a/published/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md b/translated/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md similarity index 66% rename from published/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md rename to translated/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md index ec53804d3a..e4b2282535 100644 --- a/published/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md +++ b/translated/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md @@ -1,36 +1,35 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: (wxy) -[#]: publisher: (wxy) -[#]: url: (https://linux.cn/article-11876-1.html) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) [#]: subject: (Get your RSS feeds and podcasts in one place with this open source tool) [#]: via: (https://opensource.com/article/20/1/open-source-rss-feed-reader) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) -使用此开源工具在一起收取你的 RSS 订阅源和播客 +使用此开源工具将你的RSS 订阅源和播客放在一起 ====== - -> 在我们的 20 个使用开源提升生产力的系列的第十二篇文章中使用 Newsboat 收取你的新闻 RSS 源和播客。 - -![](https://img.linux.net.cn/data/attachment/album/202002/10/162526wv5jdl0m12sw10md.jpg) +在我们的 20 个使用开源提升生产力的系列的第十二篇文章中使用 Newsboat 跟上你的新闻 RSS 源和播客。 +![Ship captain sailing the Kubernetes seas][1] 去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 ### 使用 Newsboat 访问你的 RSS 源和播客 -RSS 新闻源是了解各个网站最新消息的非常方便的方法。除了 Opensource.com,我还会关注 [SysAdvent][2] sysadmin 年度工具,还有一些我最喜欢的作者以及一些网络漫画。RSS 阅读器可以让我“批处理”阅读内容,因此,我每天不会在不同的网站上花费很多时间。 +RSS 新闻源是了解各个网站最新消息的非常方便的方法。除了 Opensource.com,我还会关注 [SysAdvent][2] 年度 sysadmin 工具,还有一些我最喜欢的作者以及一些网络漫画。RSS 阅读器可以让我“批处理”阅读内容,因此,我每天不会在不同的网站上花费很多时间。 ![Newsboat][3] [Newsboat][4] 是一个基于终端的 RSS 订阅源阅读器,外观感觉很像电子邮件程序 [Mutt][5]。它使阅读新闻变得容易,并有许多不错的功能。 -安装 Newsboat 非常容易,因为它包含在大多数发行版(以及 MacOS 上的 Homebrew)中。安装后,只需在 `~/.newsboat/urls` 中添加订阅源。如果你是从其他阅读器迁移而来,并有导出的 OPML 文件,那么可以使用以下方式导入: +安装 Newsboat 非常容易,因为它包含在大多数发行版(以及 MacOS 上的 Homebrew)中。安装后,只需在 **~/.newsboat/urls** 中添加订阅源。如果你是从其他阅读器迁移而来,并有导出的 OPML 文件,那么可以使用以下方式导入: + ``` -newsboat -i +`newsboat -i ` ``` -添加订阅源后,Newsboat 的界面非常熟悉,特别是如果你使用过 Mutt。你可以使用箭头键上下滚动,使用 `r` 检查某个源中是否有新项目,使用 `R` 检查所有源中是否有新项目,按回车打开订阅源,并选择要阅读的文章。 +添加订阅源后,Newsboat 的界面非常熟悉,特别是如果你使用过 Mutt。你可以使用箭头键上下滚动,使用 **r** 检查某个源中是否有新项目,使用 **R** 检查所有源中是否有新项目,按**回车**打开订阅源,并选择要阅读的文章。 ![Newsboat article list][6] @@ -40,7 +39,7 @@ newsboat -i #### 播客 -Newsboat 还通过 Podboat 提供了[播客支持][10],Podboat 是一个附带的应用,它可帮助下载和排队播客节目。在 Newsboat 中查看播客源时,按下 `e` 将节目添加到你的下载队列中。所有信息将保存在 `~/.newsboat` 目录中的队列文件中。Podboat 读取此队列并将节目下载到本地磁盘。你可以在 Podboat 的用户界面(外观和行为类似于 Newsboat)执行此操作,也可以使用 `podboat -a` 让 Podboat 下载所有内容。作为播客人和播客听众,我认为这*真的*很方便。 +Newsboat 还通过 Podboat 提供了[播客支持][10],podboat 是一个附带的应用,它可帮助下载和排队播客节目。在 Newsboat 中查看播客源时,按下 **e** 将节目添加到你的下载队列中。所有信息将保存在 **~/.newsboat** 目录中的队列文件中。Podboat 读取此队列并将节目下载到本地磁盘。你可以在 Podboat 的用户界面(外观和行为类似于 Newsboat)执行此操作,也可以使用 ** podboat -a ** 让 Podboat 下载所有内容。作为播客人和播客听众,我认为这_真的_很方便。 ![Podboat][11] @@ -53,7 +52,7 @@ via: https://opensource.com/article/20/1/open-source-rss-feed-reader 作者:[Kevin Sonney][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md b/translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md deleted file mode 100644 index 524e72fce0..0000000000 --- a/translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md +++ /dev/null @@ -1,118 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (chai-yuan) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Connect Fedora to your Android phone with GSConnect) -[#]: via: (https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/) -[#]: author: (Lokesh Krishna https://fedoramagazine.org/author/lowkeyskywalker/) - -使用GSConnect将Android手机连接到Fedora系统 -====== - -![][1] - -苹果和微软公司都提供了集成好的与移动设备交互的应用。Fedora提供了类似的工具——**GSConnect**。它可以让你将你的安卓手机和你的Fedora桌面配对并使用。读下去,来了解更多关于它是什么以及它是如何工作的信息。 - -### GSConnect是什么? - -GSConnect是基于KDE Connect项目而为GNOME桌面定制的程序。KDE Connect使你的设备相互之间能够进行通信。但是,在Fedora的默认GNOME桌面上安装它需要安装大量的KDE依赖。 - -GSConnect基于KDE Connect实现,作为GNOME shell的拓展应用。一旦安装,GSConnect允许您执行以下操作: - - * 在电脑上接收电话通知并回复信息 - * 用手机操纵你的桌面 - * 在不同设备之间分享文件与链接 - * 在电脑上查看手机电量 - * 让手机响铃以便你能找到它 - - - -### 设置GSConnect扩展 - -设置GSConnect需要安装两款软件:电脑上的GSConnect扩展和Android设备上的KDE Connect应用。 - -首先,从GNOME Shell扩展网站[GSConnect][2]安装GSConnect扩展。(Fedora Magazine有一篇关于[如何安装GNOMEShell扩展名][3]的文章,可以帮助你完成这一步。) - -KDE Connect应用程序可以在Google的[Play Store][4]上找到。它也可以在FOSS Android应用程序库[F-Droid][5]上找到。 - -一旦安装了这两个组件,就可以配对两个设备。安装扩展后再系统菜单中显示“移动设备(Mobile Devices)”。单击它会出现一个下拉菜单,你可以从中访问“移动设置(Mobile Settings)”。 - -![][6] - -在这里,你可以用GSConnect查看并管理配对的设备。进入此界面后,需要在Android设备上启动应用程序。 - -配对的初始化可以再任意一台设备上进行,在这里我们从Android设备连接到电脑。点击应用程序上的刷新(refresh),只要两个设备都在同一个无线网络环境中,你的Android设备便可以搜索到你的电脑。现在可以向桌面发送配对请求,并在桌面上接受配对请求以完成配对。 - -![][7] - -### 使用 GSConnect - -配对后,你将需要授予对Android设备的权限,才能使用GSConnect上提供的许多功能。单击设备列表中的配对设备,便可以查看所有可用功能,并根据你的偏好和需要启用或禁用它们。 - -![][8] - -请记住,你还需要在Android应用程序中授予相应的权限才能使用这些功能。启用权限后,你现在可以访问桌面上的移动联系人,获得消息通知并回复消息,甚至同步桌面和Android设备剪贴板。 - -### 集成在文件系统与浏览器上 - -GSConnect允许你直接从桌面文件资源管理器向Android设备发送文件。 - -在Fedora的默认GNOME桌面上,你需要安装_nautilus-python_依赖包,以便在菜单中显示配对的设备。安装它只需要再终端中输入: - -``` -$ sudo dnf install nautilus-python -``` - -完成后,将在“文件(Files)”的菜单中显示“发送到移动设备(Send to Mobile Device)”选项。 - -![][9] - -同样,为你的浏览器安装相应的WebExtension,无论是[Firefox][10]还是[Chrome][11]浏览器,都可以将链接发送到你的Android设备。你可以选择直接在浏览器中发送要启动的链接,或将其作为短信息发送。 - -### 运行命令 - -GSConnect允许你定义命令,然后可以从远程设备在电脑上运行这些命令。这使得你可以远程截屏,或者从你的Android设备锁定和解锁你的桌面。 - -![][12] - -要使用此功能,可以使用标准shell命令和GSConnect公开的CLI。项目的GitHub存储库中提供了有关此操作的文档: _CLI Scripting_。 - -[KDE UserBase Wiki][13]有一个命令示例列表。这些例子包括控制桌面的亮度和音量,锁定鼠标和键盘,甚至更改桌面主题。其中一些命令是针对KDE Plasma设计的,需要进行修改才能在GNOME桌面上运行。 - -### 探索并享受乐趣 - -GSConnect使我们能够享受到极大的便利和舒适。深入研究首选项,查看你可以做的所有事情,灵活的使用这些命令功能。并在下面的评论中自由分享你解锁的新方式。 - -* * * - -_Photo by [Pathum Danthanarayana][14] on [Unsplash][15]._ - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/ - -作者:[Lokesh Krishna][a] -选题:[lujun9972][b] -译者:[chai-yuan](https://github.com/chai-yuan) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/lowkeyskywalker/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/12/gsconnect-816x345.jpg -[2]: https://extensions.gnome.org/extension/1319/gsconnect/ -[3]: https://fedoramagazine.org/install-gnome-shell-extension/ -[4]: https://play.google.com/store/apps/details?id=org.kde.kdeconnect_tp -[5]: https://f-droid.org/en/packages/org.kde.kdeconnect_tp/ -[6]: https://fedoramagazine.org/wp-content/uploads/2020/01/within-the-menu-1024x576.png -[7]: https://fedoramagazine.org/wp-content/uploads/2020/01/pair-request-1024x576.png -[8]: https://fedoramagazine.org/wp-content/uploads/2020/01/permissions-1024x576.png -[9]: https://fedoramagazine.org/wp-content/uploads/2020/01/send-to-mobile-2-1024x576.png -[10]: https://addons.mozilla.org/en-US/firefox/addon/gsconnect/ -[11]: https://chrome.google.com/webstore/detail/gsconnect/jfnifeihccihocjbfcfhicmmgpjicaec -[12]: https://fedoramagazine.org/wp-content/uploads/2020/01/commands-1024x576.png -[13]: https://userbase.kde.org/KDE_Connect/Tutorials/Useful_commands -[14]: https://unsplash.com/@pathum_danthanarayana?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[15]: https://unsplash.com/s/photos/android?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 2276a0a8b9ba6a1300c7b686693f2f0bdb557b5f Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Mon, 10 Feb 2020 21:10:35 +0800 Subject: [PATCH 004/315] Revert "fix issue" This reverts commit 9092eb263e85ae9884ad0ef5ae8d055480fb7656. --- translated/tech/20200206 3 ways to use PostgreSQL commands.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20200206 3 ways to use PostgreSQL commands.md b/translated/tech/20200206 3 ways to use PostgreSQL commands.md index 9f5890f370..da2671cc2f 100644 --- a/translated/tech/20200206 3 ways to use PostgreSQL commands.md +++ b/translated/tech/20200206 3 ways to use PostgreSQL commands.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (Morisun029) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 413a702072905f7f2ad639ef6790d2e0d8a98549 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Mon, 10 Feb 2020 21:10:43 +0800 Subject: [PATCH 005/315] Revert "delete useless file" This reverts commit ed1de25914c69afe5effe7c51d3db59415cd2632, reversing changes made to 506f08712ecc96eb861fe16ceed7f3e2681ccdd9. --- ...00206 3 ways to use PostgreSQL commands.md | 230 ------------------ 1 file changed, 230 deletions(-) delete mode 100644 sources/tech/20200206 3 ways to use PostgreSQL commands.md diff --git a/sources/tech/20200206 3 ways to use PostgreSQL commands.md b/sources/tech/20200206 3 ways to use PostgreSQL commands.md deleted file mode 100644 index 645baf65e0..0000000000 --- a/sources/tech/20200206 3 ways to use PostgreSQL commands.md +++ /dev/null @@ -1,230 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Morisun029) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 ways to use PostgreSQL commands) -[#]: via: (https://opensource.com/article/20/2/postgresql-commands) -[#]: author: (Greg Pittman https://opensource.com/users/greg-p) - -3 ways to use PostgreSQL commands -====== -Whether you need something simple, like a shopping list, or complex, -like a color swatch generator, PostgreSQL commands make it easy. -![Team checklist and to dos][1] - -In _[Getting started with PostgreSQL][2]_, I explained how to install, set up, and begin using the open source database software. But there's a lot more you can do with commands in [PostgreSQL][3]. - -For example, I use Postgres to keep track of my grocery shopping list. I do most of the grocery shopping in our home, and the bulk of it happens once a week. I go to several places to buy the things on my list because each store offers a particular selection or quality or maybe a better price. Initially, I made an HTML form page to manage my shopping list, but it couldn't save my entries. So, I had to wait to make my list all at once, and by then I usually forgot some items we need or I want. - -Instead, with PostgreSQL, I can enter bits when I think of them as the week goes on and print out the whole thing right before I go shopping. Here's how you can do that, too. - -### Create a simple shopping list - -First, enter the database with the **psql **command, then create a table for your list with: - - -``` -`Create table groc (item varchar(20), comment varchar(10));` -``` - -Type commands like the following to add items to your list: - - -``` -insert into groc values ('milk', 'K'); -insert into groc values ('bananas', 'KW'); -``` - -There are two pieces of information (separated by a comma) inside the parentheses: the item you want to buy and letters indicating where you want to buy it and whether it's something you usually buy every week (W). - -Since **psql** has a history, you can press the Up arrow and edit the data between the parentheses instead of having to type the whole line for each item. - -After entering a handful of items, check what you've entered with: - - -``` -Select * from groc order by comment; - -      item      | comment -\----------------+--------- - ground coffee  | H - butter         | K - chips          | K - steak          | K - milk           | K - bananas        | KW - raisin bran    | KW - raclette       | L - goat cheese    | L - onion          | P - oranges        | P - potatoes       | P - spinach        | PW - broccoli       | PW - asparagus      | PW - cucumber       | PW - sugarsnap peas | PW - salmon         | S -(18 rows) -``` - -This command orders the results by the _comment_ column so that the items are grouped by where you buy them to make it easier to shop. - -By using a W to indicate your weekly purchases, you can keep your weekly items on the list when you clear out the table to prepare for the next week's list. To so that, enter: - - -``` -`delete from groc where comment not like '%W';` -``` - -Notice that in PostgreSQL, **%** is the wildcard character (instead of an asterisk). So, to save typing, you might type: - - -``` -`delete from groc where item like 'goat%';` -``` - -You can't use **item = 'goat%'**; it won't work. - -When you're ready to shop, output your list to print it or send it to your phone with: - - -``` -\o groclist.txt -select * from groc order by comment; -\o -``` - -The last command, **\o**, with nothing afterward, resets the output to the command line. Otherwise, all output will continue to go to the groc file you created. - -### Analyze complex tables - -This item-by-item entry may be okay for short tables, but what about really big ones? A couple of years ago, I was helping the team at [FreieFarbe.de][4] to create a swatchbook of the free colors (freieFarbe means "free colors" in German) from its HLC color palette, where virtually any imaginable print color can be specified by its hue, luminosity (brightness), and chroma (saturation). The result was the [HLC Color Atlas][5], and here's how we did it. - -The team sent me files with color specifications so I could write Python scripts that would work with Scribus to generate the swatchbooks of color patches easily. One example started like: - - -``` -HLC, C, M, Y, K -H010_L15_C010, 0.5, 49.1, 0.1, 84.5 -H010_L15_C020, 0.0, 79.7, 15.1, 78.9 -H010_L25_C010, 6.1, 38.3, 0.0, 72.5 -H010_L25_C020, 0.0, 61.8, 10.6, 67.9 -H010_L25_C030, 0.0, 79.5, 18.5, 62.7 -H010_L25_C040, 0.4, 94.2, 17.3, 56.5 -H010_L25_C050, 0.0, 100.0, 15.1, 50.6 -H010_L35_C010, 6.1, 32.1, 0.0, 61.8 -H010_L35_C020, 0.0, 51.7, 8.4, 57.5 -H010_L35_C030, 0.0, 68.5, 17.1, 52.5 -H010_L35_C040, 0.0, 81.2, 22.0, 46.2 -H010_L35_C050, 0.0, 91.9, 20.4, 39.3 -H010_L35_C060, 0.1, 100.0, 17.3, 31.5 -H010_L45_C010, 4.3, 27.4, 0.1, 51.3 -``` - -This is slightly modified from the original, which separated the data with tabs. I transformed it into a CSV (comma-separated value) file, which I prefer to use with Python. (CSV files are also very useful because they can be imported easily into a spreadsheet program.) - -In each line, the first item is the color name, and it's followed by its C, M, Y, and K color values. The file consisted of 1,793 colors, and I wanted a way to analyze the information to get a sense of the range of values. This is where PostgreSQL comes into play. I did not want to enter all of this data manually—I don't think I could without errors (and headaches). Fortunately, PostgreSQL has a command for this. - -My first step was to create the database with: - - -``` -`Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal);` -``` - -Then I brought in the data with: - - -``` -`\copy  hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV);` -``` - -The backslash at the beginning is there because using the plain **copy** command is restricted to root and the Postgres superuser. In the parentheses, **header** means the first line contains headings and should be ignored, and **CSV** means the file format is CSV. Note that parentheses are not required around the color name in this method. - -If the operation is successful, I see a message that says **COPY NNNN**, where the N's refer to the number of rows inserted into the table. - -Finally, I can query the table with: - - -``` -select * from hlc_cmyk; - -     color     |   c   |   m   |   y   |  k   -\---------------+-------+-------+-------+------ - H010_L15_C010 |   0.5 |  49.1 |   0.1 | 84.5 - H010_L15_C020 |   0.0 |  79.7 |  15.1 | 78.9 - H010_L25_C010 |   6.1 |  38.3 |   0.0 | 72.5 - H010_L25_C020 |   0.0 |  61.8 |  10.6 | 67.9 - H010_L25_C030 |   0.0 |  79.5 |  18.5 | 62.7 - H010_L25_C040 |   0.4 |  94.2 |  17.3 | 56.5 - H010_L25_C050 |   0.0 | 100.0 |  15.1 | 50.6 - H010_L35_C010 |   6.1 |  32.1 |   0.0 | 61.8 - H010_L35_C020 |   0.0 |  51.7 |   8.4 | 57.5 - H010_L35_C030 |   0.0 |  68.5 |  17.1 | 52.5 -``` - -It goes on like this for all 1,793 rows of data. In retrospect, I can't say that this query was absolutely necessary for the HLC and Scribus task, but it allayed some of my anxieties about the project. - -To generate the HLC Color Atlas, I automated creating the color charts with Scribus for the 13,000+ colors in those pages of color swatches. - -I could have used the **copy** command to output my data: - - -``` -`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV);` -``` - -I also could restrict the output according to certain values with a **where** clause. - -For example, the following command will only send the table values for the hues that begin with H10. - - -``` -`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%';` -``` - -### Back up or transfer a database or table - -The final command I will mention here is **pg_dump**, which is used to back up a PostgreSQL database and runs outside of the **psql** console. For example: - - -``` -pg_dump gregp -t hlc_cmyk > hlc.out -pg_dump gregp > dball.out -``` - -The first line exports the **hlc_cmyk** table along with its structure. The second line dumps all the tables inside the **gregp** database. This is very useful for backing up or transferring a database or tables.  - -To transfer a database or table to another computer, first, create a database on the other computer (see my "[getting started][2]" article for details), then do the reverse process: - - -``` -`psql -d gregp -f dball.out` -``` - -This creates all the tables and enters the data in one step. - -### Conclusion - -In this article, we have seen how to use the **WHERE** parameter to restrict operations, along with the use of the PostgreSQL wildcard character **%**. We've also seen how to load a large amount of data into a table, then output some or all of the table data to a file, or even your entire database with all its individual tables. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/postgresql-commands - -作者:[Greg Pittman][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/greg-p -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) -[2]: https://opensource.com/article/19/11/getting-started-postgresql -[3]: https://www.postgresql.org/ -[4]: http://freiefarbe.de -[5]: https://www.freiefarbe.de/en/thema-farbe/hlc-colour-atlas/ From 0a01ac59d4370799b9fdb086dbef0e84fa22ea7c Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Mon, 10 Feb 2020 21:13:24 +0800 Subject: [PATCH 006/315] Revert "'translated'" This reverts commit 506f08712ecc96eb861fe16ceed7f3e2681ccdd9. --- ...00206 3 ways to use PostgreSQL commands.md | 230 ++++++++++++++++++ ...00206 3 ways to use PostgreSQL commands.md | 228 ----------------- 2 files changed, 230 insertions(+), 228 deletions(-) create mode 100644 sources/tech/20200206 3 ways to use PostgreSQL commands.md delete mode 100644 translated/tech/20200206 3 ways to use PostgreSQL commands.md diff --git a/sources/tech/20200206 3 ways to use PostgreSQL commands.md b/sources/tech/20200206 3 ways to use PostgreSQL commands.md new file mode 100644 index 0000000000..9cfedc8506 --- /dev/null +++ b/sources/tech/20200206 3 ways to use PostgreSQL commands.md @@ -0,0 +1,230 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 ways to use PostgreSQL commands) +[#]: via: (https://opensource.com/article/20/2/postgresql-commands) +[#]: author: (Greg Pittman https://opensource.com/users/greg-p) + +3 ways to use PostgreSQL commands +====== +Whether you need something simple, like a shopping list, or complex, +like a color swatch generator, PostgreSQL commands make it easy. +![Team checklist and to dos][1] + +In _[Getting started with PostgreSQL][2]_, I explained how to install, set up, and begin using the open source database software. But there's a lot more you can do with commands in [PostgreSQL][3]. + +For example, I use Postgres to keep track of my grocery shopping list. I do most of the grocery shopping in our home, and the bulk of it happens once a week. I go to several places to buy the things on my list because each store offers a particular selection or quality or maybe a better price. Initially, I made an HTML form page to manage my shopping list, but it couldn't save my entries. So, I had to wait to make my list all at once, and by then I usually forgot some items we need or I want. + +Instead, with PostgreSQL, I can enter bits when I think of them as the week goes on and print out the whole thing right before I go shopping. Here's how you can do that, too. + +### Create a simple shopping list + +First, enter the database with the **psql **command, then create a table for your list with: + + +``` +`Create table groc (item varchar(20), comment varchar(10));` +``` + +Type commands like the following to add items to your list: + + +``` +insert into groc values ('milk', 'K'); +insert into groc values ('bananas', 'KW'); +``` + +There are two pieces of information (separated by a comma) inside the parentheses: the item you want to buy and letters indicating where you want to buy it and whether it's something you usually buy every week (W). + +Since **psql** has a history, you can press the Up arrow and edit the data between the parentheses instead of having to type the whole line for each item. + +After entering a handful of items, check what you've entered with: + + +``` +Select * from groc order by comment; + +      item      | comment +\----------------+--------- + ground coffee  | H + butter         | K + chips          | K + steak          | K + milk           | K + bananas        | KW + raisin bran    | KW + raclette       | L + goat cheese    | L + onion          | P + oranges        | P + potatoes       | P + spinach        | PW + broccoli       | PW + asparagus      | PW + cucumber       | PW + sugarsnap peas | PW + salmon         | S +(18 rows) +``` + +This command orders the results by the _comment_ column so that the items are grouped by where you buy them to make it easier to shop. + +By using a W to indicate your weekly purchases, you can keep your weekly items on the list when you clear out the table to prepare for the next week's list. To so that, enter: + + +``` +`delete from groc where comment not like '%W';` +``` + +Notice that in PostgreSQL, **%** is the wildcard character (instead of an asterisk). So, to save typing, you might type: + + +``` +`delete from groc where item like 'goat%';` +``` + +You can't use **item = 'goat%'**; it won't work. + +When you're ready to shop, output your list to print it or send it to your phone with: + + +``` +\o groclist.txt +select * from groc order by comment; +\o +``` + +The last command, **\o**, with nothing afterward, resets the output to the command line. Otherwise, all output will continue to go to the groc file you created. + +### Analyze complex tables + +This item-by-item entry may be okay for short tables, but what about really big ones? A couple of years ago, I was helping the team at [FreieFarbe.de][4] to create a swatchbook of the free colors (freieFarbe means "free colors" in German) from its HLC color palette, where virtually any imaginable print color can be specified by its hue, luminosity (brightness), and chroma (saturation). The result was the [HLC Color Atlas][5], and here's how we did it. + +The team sent me files with color specifications so I could write Python scripts that would work with Scribus to generate the swatchbooks of color patches easily. One example started like: + + +``` +HLC, C, M, Y, K +H010_L15_C010, 0.5, 49.1, 0.1, 84.5 +H010_L15_C020, 0.0, 79.7, 15.1, 78.9 +H010_L25_C010, 6.1, 38.3, 0.0, 72.5 +H010_L25_C020, 0.0, 61.8, 10.6, 67.9 +H010_L25_C030, 0.0, 79.5, 18.5, 62.7 +H010_L25_C040, 0.4, 94.2, 17.3, 56.5 +H010_L25_C050, 0.0, 100.0, 15.1, 50.6 +H010_L35_C010, 6.1, 32.1, 0.0, 61.8 +H010_L35_C020, 0.0, 51.7, 8.4, 57.5 +H010_L35_C030, 0.0, 68.5, 17.1, 52.5 +H010_L35_C040, 0.0, 81.2, 22.0, 46.2 +H010_L35_C050, 0.0, 91.9, 20.4, 39.3 +H010_L35_C060, 0.1, 100.0, 17.3, 31.5 +H010_L45_C010, 4.3, 27.4, 0.1, 51.3 +``` + +This is slightly modified from the original, which separated the data with tabs. I transformed it into a CSV (comma-separated value) file, which I prefer to use with Python. (CSV files are also very useful because they can be imported easily into a spreadsheet program.) + +In each line, the first item is the color name, and it's followed by its C, M, Y, and K color values. The file consisted of 1,793 colors, and I wanted a way to analyze the information to get a sense of the range of values. This is where PostgreSQL comes into play. I did not want to enter all of this data manually—I don't think I could without errors (and headaches). Fortunately, PostgreSQL has a command for this. + +My first step was to create the database with: + + +``` +`Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal);` +``` + +Then I brought in the data with: + + +``` +`\copy  hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV);` +``` + +The backslash at the beginning is there because using the plain **copy** command is restricted to root and the Postgres superuser. In the parentheses, **header** means the first line contains headings and should be ignored, and **CSV** means the file format is CSV. Note that parentheses are not required around the color name in this method. + +If the operation is successful, I see a message that says **COPY NNNN**, where the N's refer to the number of rows inserted into the table. + +Finally, I can query the table with: + + +``` +select * from hlc_cmyk; + +     color     |   c   |   m   |   y   |  k   +\---------------+-------+-------+-------+------ + H010_L15_C010 |   0.5 |  49.1 |   0.1 | 84.5 + H010_L15_C020 |   0.0 |  79.7 |  15.1 | 78.9 + H010_L25_C010 |   6.1 |  38.3 |   0.0 | 72.5 + H010_L25_C020 |   0.0 |  61.8 |  10.6 | 67.9 + H010_L25_C030 |   0.0 |  79.5 |  18.5 | 62.7 + H010_L25_C040 |   0.4 |  94.2 |  17.3 | 56.5 + H010_L25_C050 |   0.0 | 100.0 |  15.1 | 50.6 + H010_L35_C010 |   6.1 |  32.1 |   0.0 | 61.8 + H010_L35_C020 |   0.0 |  51.7 |   8.4 | 57.5 + H010_L35_C030 |   0.0 |  68.5 |  17.1 | 52.5 +``` + +It goes on like this for all 1,793 rows of data. In retrospect, I can't say that this query was absolutely necessary for the HLC and Scribus task, but it allayed some of my anxieties about the project. + +To generate the HLC Color Atlas, I automated creating the color charts with Scribus for the 13,000+ colors in those pages of color swatches. + +I could have used the **copy** command to output my data: + + +``` +`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV);` +``` + +I also could restrict the output according to certain values with a **where** clause. + +For example, the following command will only send the table values for the hues that begin with H10. + + +``` +`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%';` +``` + +### Back up or transfer a database or table + +The final command I will mention here is **pg_dump**, which is used to back up a PostgreSQL database and runs outside of the **psql** console. For example: + + +``` +pg_dump gregp -t hlc_cmyk > hlc.out +pg_dump gregp > dball.out +``` + +The first line exports the **hlc_cmyk** table along with its structure. The second line dumps all the tables inside the **gregp** database. This is very useful for backing up or transferring a database or tables.  + +To transfer a database or table to another computer, first, create a database on the other computer (see my "[getting started][2]" article for details), then do the reverse process: + + +``` +`psql -d gregp -f dball.out` +``` + +This creates all the tables and enters the data in one step. + +### Conclusion + +In this article, we have seen how to use the **WHERE** parameter to restrict operations, along with the use of the PostgreSQL wildcard character **%**. We've also seen how to load a large amount of data into a table, then output some or all of the table data to a file, or even your entire database with all its individual tables. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/postgresql-commands + +作者:[Greg Pittman][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/greg-p +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) +[2]: https://opensource.com/article/19/11/getting-started-postgresql +[3]: https://www.postgresql.org/ +[4]: http://freiefarbe.de +[5]: https://www.freiefarbe.de/en/thema-farbe/hlc-colour-atlas/ diff --git a/translated/tech/20200206 3 ways to use PostgreSQL commands.md b/translated/tech/20200206 3 ways to use PostgreSQL commands.md deleted file mode 100644 index da2671cc2f..0000000000 --- a/translated/tech/20200206 3 ways to use PostgreSQL commands.md +++ /dev/null @@ -1,228 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 ways to use PostgreSQL commands) -[#]: via: (https://opensource.com/article/20/2/postgresql-commands) -[#]: author: (Greg Pittman https://opensource.com/users/greg-p) - -3种使用 PostgreSQL 命令的方式 -====== -无论你需要的东西简单(如一个购物清单)亦或复杂(如色卡生成器) - PostgreSQL 命令都能使它变得容易起来。 - -![Team checklist and to dos][1] - -在 _[PostgreSQL 入门][2]_ 一文中, 我解释了如何安装,设置和开始使用开源数据库软件。然而,使用 [PostgreSQL][3] 中的命令可以做更多事情。 - -例如,我使用 Postgres 来跟踪我杂货店的购物清单。我杂货店里的大多数购物是在家里进行的,其中每周进行一次大批量的采购。我去几个不同的地方购买清单上的东西,因为每家商店都提供特定的选择或质量,亦或更好的价格。最初,我制作了一个HTML表单页面来管理我的购物清单,但这样无法保存我的输入内容。因此,在想到要购买的物品时我必须要马上列出清单,因为到采购时我常常会忘记一些我需要或想要的东西。 - -相反,使用 PostgreSQL,当我想到需要的物品时,我可以随时输入,并在购物前打印出来。你也可以这样做。 - - -### 创建一个简单的购物清单 - - -首先,数据库中输入**psql ** 命令,然后用下面的命令创建一个表: -``` -`Create table groc (item varchar(20), comment varchar(10));` -``` - -输入如下命令在清单中加入商品: - -``` -insert into groc values ('milk', 'K'); -insert into groc values ('bananas', 'KW'); -``` - -括号中有两个信息(逗号隔开):前面是你需要买的东西,后面字母代表你要购买的地点以及哪些东西是你每周通常都要买的(W)。 - -因为 **psql** 有历史记录,你可以按向上键在括号内编辑信息,而无需输入商品的整行信息。 - -在输入一小部分商品后,输入下面命令来检查前面的输入内容。 - -``` -Select * from groc order by comment; - - item | comment -\----------------+--------- - ground coffee | H - butter | K - chips | K - steak | K - milk | K - bananas | KW - raisin bran | KW - raclette | L - goat cheese | L - onion | P - oranges | P - potatoes | P - spinach | PW - broccoli | PW - asparagus | PW - cucumber | PW - sugarsnap peas | PW - salmon | S -(18 rows) -``` - -此命令按_comment_ 列对结果进行排序,以便按购买地点对商品进行分组,从而是你的购物更加方便。 - -使用W来指明你每周要买的东西,当你要清除表单为下周的列表做准备时,你可以将每周的商品保留在购物清单上。输入: - -``` -`delete from groc where comment not like '%W';` -``` - -注意,在 PostgreSQL 中 **%** 表示通配符(而非星号)。所以,要保存输入内容,需要输入: - -``` -`delete from groc where item like 'goat%';` -``` - -不能使用**item = 'goat%'**,这样没用。 - - -在购物时,用以下命令输出清单并打印出来发送到你的手机: - -``` -\o groclist.txt -select * from groc order by comment; -\o -``` - -最后一个命令**\o*,重置输出到命令行。否则,所有的输出会继续输出到你创建的杂货店购物文件中。 - -### 分析复杂的表 - -This item-by-item entry may be okay for short tables, but what about really big ones? A couple of years ago, I was helping the team at [FreieFarbe.de][4] to create a swatchbook of the free colors (freieFarbe means "free colors" in German) from its HLC color palette, where virtually any imaginable print color can be specified by its hue, luminosity (brightness), and chroma (saturation). The result was the [HLC Color Atlas][5], and here's how we did it. - -逐个输入对于数据量小的表来说没有问题,但是对于数据量大的表呢?几年前,我帮团队从 HLC 调色板中创建一个自由色的色样册。事实上,任何能想象到的打印色都可按色调、亮度、浓度(饱和度)来规定。最终结果是[HLC Color Atlas][5],下面是我们如何实现的。 - -该团队向我发送了具有颜色规范的文件,因此我可以编写可与 Scribus 配合使用的 Python 脚本,以轻松生成色样册。一个例子像这样开始: - - -``` -HLC, C, M, Y, K -H010_L15_C010, 0.5, 49.1, 0.1, 84.5 -H010_L15_C020, 0.0, 79.7, 15.1, 78.9 -H010_L25_C010, 6.1, 38.3, 0.0, 72.5 -H010_L25_C020, 0.0, 61.8, 10.6, 67.9 -H010_L25_C030, 0.0, 79.5, 18.5, 62.7 -H010_L25_C040, 0.4, 94.2, 17.3, 56.5 -H010_L25_C050, 0.0, 100.0, 15.1, 50.6 -H010_L35_C010, 6.1, 32.1, 0.0, 61.8 -H010_L35_C020, 0.0, 51.7, 8.4, 57.5 -H010_L35_C030, 0.0, 68.5, 17.1, 52.5 -H010_L35_C040, 0.0, 81.2, 22.0, 46.2 -H010_L35_C050, 0.0, 91.9, 20.4, 39.3 -H010_L35_C060, 0.1, 100.0, 17.3, 31.5 -H010_L45_C010, 4.3, 27.4, 0.1, 51.3 -``` - -这与原文件相比,稍有修改,将数据用制表符分隔。我将其转换成 CSV 格式(逗号分割值),我更喜欢其与 Python 一起使用(CSV 文也很有用因为它可轻松导入到电子表格程序中)。 - -在每一行中,第一项是颜色名称,其后是其 C,M,Y 和 K 颜色值。 该文件包含1,793种颜色,我想要一种分析信息的方法,以了解这些值的范围。 这就是 PostgreSQL 发挥作用的地方。 我不想手动输入所有数据-我认为输入过程中我不可能不出错。 幸运的是,PostgreSQL 为此提供了一个命令。 - -首先用以下命令创建数据库: - -``` -`Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal);` -``` - -然后通过以下命令引入数据: - - -``` -`\copy hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV);` -``` - - -开头有反斜杠,是因为使用纯**copy** 命令仅限于 root 用户和 Postgres 的超级用户。 在括号中,**header** 表示第一行包含标题,应忽略,**CSV** 表示文件格式为 CSV。 请注意,在此方法中,颜色名称周围不需要括号。 - -如果操作成功,会看到 **COPY NNNN**,其中 N 表示插入到表中的行号。 - -最后,可以用下列命令查询: - -``` -select * from hlc_cmyk; - - color | c | m | y | k -\---------------+-------+-------+-------+------ - H010_L15_C010 | 0.5 | 49.1 | 0.1 | 84.5 - H010_L15_C020 | 0.0 | 79.7 | 15.1 | 78.9 - H010_L25_C010 | 6.1 | 38.3 | 0.0 | 72.5 - H010_L25_C020 | 0.0 | 61.8 | 10.6 | 67.9 - H010_L25_C030 | 0.0 | 79.5 | 18.5 | 62.7 - H010_L25_C040 | 0.4 | 94.2 | 17.3 | 56.5 - H010_L25_C050 | 0.0 | 100.0 | 15.1 | 50.6 - H010_L35_C010 | 6.1 | 32.1 | 0.0 | 61.8 - H010_L35_C020 | 0.0 | 51.7 | 8.4 | 57.5 - H010_L35_C030 | 0.0 | 68.5 | 17.1 | 52.5 -``` - - -所有1,793行数据都是这样的。 回想起来,我不能说此查询对于HLC和Scribus任务是绝对必要的,但是它减轻了我对该项目的一些担忧。 - -为了生成 HLC 色谱,我使用 Scribus 为色板页面中的13,000多种颜色自动创建了颜色图表。 - -我可以使用 **copy** 命令输出数据: - -``` -`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV);` -``` - - -我还可以使用 ** where ** 子句根据某些值来限制输出。 - -例如,以下命令将仅发送以 H10 开头的色调值。 - - -``` -`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%';` -``` - -### 备份或传输数据库或表 - -我在此要提到的最后一个命令是**pg_dump**,它用于备份 PostgreSQL 数据库,并在 **psql** 控制台之外运行。 例如: - -``` -pg_dump gregp -t hlc_cmyk > hlc.out -pg_dump gregp > dball.out -``` - -第一行是导出 **hlc_cmyk** 表及其结构。第二行将转储 **gregp** 数据库中的所有表。 这对于备份或传输数据库或表非常有用。 - - -要将数据库或表转到另一台电脑( 查看"[ PostgreSQL 入门][2]" 那篇文章获取详细信息),首先在要转入的电脑上创建一个数据库,然后执行相反的操作。 - -``` -`psql -d gregp -f dball.out` -``` - -一步创建所有表并输入数据。 - -### 总结 - -在本文中,我们了解了如何使用 **WHERE** 参数限制操作,以及如何使用 PostgreSQL 通配符 **%**。 我们还了解了如何将大批量数据加载到表中,然后将部分或全部表数据输出到文件,甚至是将整个数据库及其所有单个表输出。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/postgresql-commands - -作者:[Greg Pittman][a] -选题:[lujun9972][b] -译者:[Morisun029](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/greg-p -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) -[2]: https://opensource.com/article/19/11/getting-started-postgresql -[3]: https://www.postgresql.org/ -[4]: http://freiefarbe.de -[5]: https://www.freiefarbe.de/en/thema-farbe/hlc-colour-atlas/ From df896d92db0cdd57aafff9ac16d6317b276d3ab3 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Mon, 10 Feb 2020 21:15:38 +0800 Subject: [PATCH 007/315] translated --- ...00206 3 ways to use PostgreSQL commands.md | 228 ++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 translated/tech/20200206 3 ways to use PostgreSQL commands.md diff --git a/translated/tech/20200206 3 ways to use PostgreSQL commands.md b/translated/tech/20200206 3 ways to use PostgreSQL commands.md new file mode 100644 index 0000000000..9f5890f370 --- /dev/null +++ b/translated/tech/20200206 3 ways to use PostgreSQL commands.md @@ -0,0 +1,228 @@ +[#]: collector: (lujun9972) +[#]: translator: (Morisun029) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 ways to use PostgreSQL commands) +[#]: via: (https://opensource.com/article/20/2/postgresql-commands) +[#]: author: (Greg Pittman https://opensource.com/users/greg-p) + +3种使用 PostgreSQL 命令的方式 +====== +无论你需要的东西简单(如一个购物清单)亦或复杂(如色卡生成器) + PostgreSQL 命令都能使它变得容易起来。 + +![Team checklist and to dos][1] + +在 _[PostgreSQL 入门][2]_ 一文中, 我解释了如何安装,设置和开始使用开源数据库软件。然而,使用 [PostgreSQL][3] 中的命令可以做更多事情。 + +例如,我使用 Postgres 来跟踪我杂货店的购物清单。我杂货店里的大多数购物是在家里进行的,其中每周进行一次大批量的采购。我去几个不同的地方购买清单上的东西,因为每家商店都提供特定的选择或质量,亦或更好的价格。最初,我制作了一个HTML表单页面来管理我的购物清单,但这样无法保存我的输入内容。因此,在想到要购买的物品时我必须要马上列出清单,因为到采购时我常常会忘记一些我需要或想要的东西。 + +相反,使用 PostgreSQL,当我想到需要的物品时,我可以随时输入,并在购物前打印出来。你也可以这样做。 + + +### 创建一个简单的购物清单 + + +首先,数据库中输入**psql ** 命令,然后用下面的命令创建一个表: +``` +`Create table groc (item varchar(20), comment varchar(10));` +``` + +输入如下命令在清单中加入商品: + +``` +insert into groc values ('milk', 'K'); +insert into groc values ('bananas', 'KW'); +``` + +括号中有两个信息(逗号隔开):前面是你需要买的东西,后面字母代表你要购买的地点以及哪些东西是你每周通常都要买的(W)。 + +因为 **psql** 有历史记录,你可以按向上键在括号内编辑信息,而无需输入商品的整行信息。 + +在输入一小部分商品后,输入下面命令来检查前面的输入内容。 + +``` +Select * from groc order by comment; + + item | comment +\----------------+--------- + ground coffee | H + butter | K + chips | K + steak | K + milk | K + bananas | KW + raisin bran | KW + raclette | L + goat cheese | L + onion | P + oranges | P + potatoes | P + spinach | PW + broccoli | PW + asparagus | PW + cucumber | PW + sugarsnap peas | PW + salmon | S +(18 rows) +``` + +此命令按_comment_ 列对结果进行排序,以便按购买地点对商品进行分组,从而是你的购物更加方便。 + +使用W来指明你每周要买的东西,当你要清除表单为下周的列表做准备时,你可以将每周的商品保留在购物清单上。输入: + +``` +`delete from groc where comment not like '%W';` +``` + +注意,在 PostgreSQL 中 **%** 表示通配符(而非星号)。所以,要保存输入内容,需要输入: + +``` +`delete from groc where item like 'goat%';` +``` + +不能使用**item = 'goat%'**,这样没用。 + + +在购物时,用以下命令输出清单并打印出来发送到你的手机: + +``` +\o groclist.txt +select * from groc order by comment; +\o +``` + +最后一个命令**\o*,重置输出到命令行。否则,所有的输出会继续输出到你创建的杂货店购物文件中。 + +### 分析复杂的表 + +This item-by-item entry may be okay for short tables, but what about really big ones? A couple of years ago, I was helping the team at [FreieFarbe.de][4] to create a swatchbook of the free colors (freieFarbe means "free colors" in German) from its HLC color palette, where virtually any imaginable print color can be specified by its hue, luminosity (brightness), and chroma (saturation). The result was the [HLC Color Atlas][5], and here's how we did it. + +逐个输入对于数据量小的表来说没有问题,但是对于数据量大的表呢?几年前,我帮团队从 HLC 调色板中创建一个自由色的色样册。事实上,任何能想象到的打印色都可按色调、亮度、浓度(饱和度)来规定。最终结果是[HLC Color Atlas][5],下面是我们如何实现的。 + +该团队向我发送了具有颜色规范的文件,因此我可以编写可与 Scribus 配合使用的 Python 脚本,以轻松生成色样册。一个例子像这样开始: + + +``` +HLC, C, M, Y, K +H010_L15_C010, 0.5, 49.1, 0.1, 84.5 +H010_L15_C020, 0.0, 79.7, 15.1, 78.9 +H010_L25_C010, 6.1, 38.3, 0.0, 72.5 +H010_L25_C020, 0.0, 61.8, 10.6, 67.9 +H010_L25_C030, 0.0, 79.5, 18.5, 62.7 +H010_L25_C040, 0.4, 94.2, 17.3, 56.5 +H010_L25_C050, 0.0, 100.0, 15.1, 50.6 +H010_L35_C010, 6.1, 32.1, 0.0, 61.8 +H010_L35_C020, 0.0, 51.7, 8.4, 57.5 +H010_L35_C030, 0.0, 68.5, 17.1, 52.5 +H010_L35_C040, 0.0, 81.2, 22.0, 46.2 +H010_L35_C050, 0.0, 91.9, 20.4, 39.3 +H010_L35_C060, 0.1, 100.0, 17.3, 31.5 +H010_L45_C010, 4.3, 27.4, 0.1, 51.3 +``` + +这与原文件相比,稍有修改,将数据用制表符分隔。我将其转换成 CSV 格式(逗号分割值),我更喜欢其与 Python 一起使用(CSV 文也很有用因为它可轻松导入到电子表格程序中)。 + +在每一行中,第一项是颜色名称,其后是其 C,M,Y 和 K 颜色值。 该文件包含1,793种颜色,我想要一种分析信息的方法,以了解这些值的范围。 这就是 PostgreSQL 发挥作用的地方。 我不想手动输入所有数据-我认为输入过程中我不可能不出错。 幸运的是,PostgreSQL 为此提供了一个命令。 + +首先用以下命令创建数据库: + +``` +`Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal);` +``` + +然后通过以下命令引入数据: + + +``` +`\copy hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV);` +``` + + +开头有反斜杠,是因为使用纯**copy** 命令仅限于 root 用户和 Postgres 的超级用户。 在括号中,**header** 表示第一行包含标题,应忽略,**CSV** 表示文件格式为 CSV。 请注意,在此方法中,颜色名称周围不需要括号。 + +如果操作成功,会看到 **COPY NNNN**,其中 N 表示插入到表中的行号。 + +最后,可以用下列命令查询: + +``` +select * from hlc_cmyk; + + color | c | m | y | k +\---------------+-------+-------+-------+------ + H010_L15_C010 | 0.5 | 49.1 | 0.1 | 84.5 + H010_L15_C020 | 0.0 | 79.7 | 15.1 | 78.9 + H010_L25_C010 | 6.1 | 38.3 | 0.0 | 72.5 + H010_L25_C020 | 0.0 | 61.8 | 10.6 | 67.9 + H010_L25_C030 | 0.0 | 79.5 | 18.5 | 62.7 + H010_L25_C040 | 0.4 | 94.2 | 17.3 | 56.5 + H010_L25_C050 | 0.0 | 100.0 | 15.1 | 50.6 + H010_L35_C010 | 6.1 | 32.1 | 0.0 | 61.8 + H010_L35_C020 | 0.0 | 51.7 | 8.4 | 57.5 + H010_L35_C030 | 0.0 | 68.5 | 17.1 | 52.5 +``` + + +所有1,793行数据都是这样的。 回想起来,我不能说此查询对于HLC和Scribus任务是绝对必要的,但是它减轻了我对该项目的一些担忧。 + +为了生成 HLC 色谱,我使用 Scribus 为色板页面中的13,000多种颜色自动创建了颜色图表。 + +我可以使用 **copy** 命令输出数据: + +``` +`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV);` +``` + + +我还可以使用 ** where ** 子句根据某些值来限制输出。 + +例如,以下命令将仅发送以 H10 开头的色调值。 + + +``` +`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%';` +``` + +### 备份或传输数据库或表 + +我在此要提到的最后一个命令是**pg_dump**,它用于备份 PostgreSQL 数据库,并在 **psql** 控制台之外运行。 例如: + +``` +pg_dump gregp -t hlc_cmyk > hlc.out +pg_dump gregp > dball.out +``` + +第一行是导出 **hlc_cmyk** 表及其结构。第二行将转储 **gregp** 数据库中的所有表。 这对于备份或传输数据库或表非常有用。 + + +要将数据库或表转到另一台电脑( 查看"[ PostgreSQL 入门][2]" 那篇文章获取详细信息),首先在要转入的电脑上创建一个数据库,然后执行相反的操作。 + +``` +`psql -d gregp -f dball.out` +``` + +一步创建所有表并输入数据。 + +### 总结 + +在本文中,我们了解了如何使用 **WHERE** 参数限制操作,以及如何使用 PostgreSQL 通配符 **%**。 我们还了解了如何将大批量数据加载到表中,然后将部分或全部表数据输出到文件,甚至是将整个数据库及其所有单个表输出。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/postgresql-commands + +作者:[Greg Pittman][a] +选题:[lujun9972][b] +译者:[Morisun029](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/greg-p +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) +[2]: https://opensource.com/article/19/11/getting-started-postgresql +[3]: https://www.postgresql.org/ +[4]: http://freiefarbe.de +[5]: https://www.freiefarbe.de/en/thema-farbe/hlc-colour-atlas/ From d3ce29bb98f1c69517f4c13c72af02bab659ec39 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Mon, 10 Feb 2020 21:18:02 +0800 Subject: [PATCH 008/315] translated --- ...00206 3 ways to use PostgreSQL commands.md | 230 ------------------ 1 file changed, 230 deletions(-) delete mode 100644 sources/tech/20200206 3 ways to use PostgreSQL commands.md diff --git a/sources/tech/20200206 3 ways to use PostgreSQL commands.md b/sources/tech/20200206 3 ways to use PostgreSQL commands.md deleted file mode 100644 index 9cfedc8506..0000000000 --- a/sources/tech/20200206 3 ways to use PostgreSQL commands.md +++ /dev/null @@ -1,230 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 ways to use PostgreSQL commands) -[#]: via: (https://opensource.com/article/20/2/postgresql-commands) -[#]: author: (Greg Pittman https://opensource.com/users/greg-p) - -3 ways to use PostgreSQL commands -====== -Whether you need something simple, like a shopping list, or complex, -like a color swatch generator, PostgreSQL commands make it easy. -![Team checklist and to dos][1] - -In _[Getting started with PostgreSQL][2]_, I explained how to install, set up, and begin using the open source database software. But there's a lot more you can do with commands in [PostgreSQL][3]. - -For example, I use Postgres to keep track of my grocery shopping list. I do most of the grocery shopping in our home, and the bulk of it happens once a week. I go to several places to buy the things on my list because each store offers a particular selection or quality or maybe a better price. Initially, I made an HTML form page to manage my shopping list, but it couldn't save my entries. So, I had to wait to make my list all at once, and by then I usually forgot some items we need or I want. - -Instead, with PostgreSQL, I can enter bits when I think of them as the week goes on and print out the whole thing right before I go shopping. Here's how you can do that, too. - -### Create a simple shopping list - -First, enter the database with the **psql **command, then create a table for your list with: - - -``` -`Create table groc (item varchar(20), comment varchar(10));` -``` - -Type commands like the following to add items to your list: - - -``` -insert into groc values ('milk', 'K'); -insert into groc values ('bananas', 'KW'); -``` - -There are two pieces of information (separated by a comma) inside the parentheses: the item you want to buy and letters indicating where you want to buy it and whether it's something you usually buy every week (W). - -Since **psql** has a history, you can press the Up arrow and edit the data between the parentheses instead of having to type the whole line for each item. - -After entering a handful of items, check what you've entered with: - - -``` -Select * from groc order by comment; - -      item      | comment -\----------------+--------- - ground coffee  | H - butter         | K - chips          | K - steak          | K - milk           | K - bananas        | KW - raisin bran    | KW - raclette       | L - goat cheese    | L - onion          | P - oranges        | P - potatoes       | P - spinach        | PW - broccoli       | PW - asparagus      | PW - cucumber       | PW - sugarsnap peas | PW - salmon         | S -(18 rows) -``` - -This command orders the results by the _comment_ column so that the items are grouped by where you buy them to make it easier to shop. - -By using a W to indicate your weekly purchases, you can keep your weekly items on the list when you clear out the table to prepare for the next week's list. To so that, enter: - - -``` -`delete from groc where comment not like '%W';` -``` - -Notice that in PostgreSQL, **%** is the wildcard character (instead of an asterisk). So, to save typing, you might type: - - -``` -`delete from groc where item like 'goat%';` -``` - -You can't use **item = 'goat%'**; it won't work. - -When you're ready to shop, output your list to print it or send it to your phone with: - - -``` -\o groclist.txt -select * from groc order by comment; -\o -``` - -The last command, **\o**, with nothing afterward, resets the output to the command line. Otherwise, all output will continue to go to the groc file you created. - -### Analyze complex tables - -This item-by-item entry may be okay for short tables, but what about really big ones? A couple of years ago, I was helping the team at [FreieFarbe.de][4] to create a swatchbook of the free colors (freieFarbe means "free colors" in German) from its HLC color palette, where virtually any imaginable print color can be specified by its hue, luminosity (brightness), and chroma (saturation). The result was the [HLC Color Atlas][5], and here's how we did it. - -The team sent me files with color specifications so I could write Python scripts that would work with Scribus to generate the swatchbooks of color patches easily. One example started like: - - -``` -HLC, C, M, Y, K -H010_L15_C010, 0.5, 49.1, 0.1, 84.5 -H010_L15_C020, 0.0, 79.7, 15.1, 78.9 -H010_L25_C010, 6.1, 38.3, 0.0, 72.5 -H010_L25_C020, 0.0, 61.8, 10.6, 67.9 -H010_L25_C030, 0.0, 79.5, 18.5, 62.7 -H010_L25_C040, 0.4, 94.2, 17.3, 56.5 -H010_L25_C050, 0.0, 100.0, 15.1, 50.6 -H010_L35_C010, 6.1, 32.1, 0.0, 61.8 -H010_L35_C020, 0.0, 51.7, 8.4, 57.5 -H010_L35_C030, 0.0, 68.5, 17.1, 52.5 -H010_L35_C040, 0.0, 81.2, 22.0, 46.2 -H010_L35_C050, 0.0, 91.9, 20.4, 39.3 -H010_L35_C060, 0.1, 100.0, 17.3, 31.5 -H010_L45_C010, 4.3, 27.4, 0.1, 51.3 -``` - -This is slightly modified from the original, which separated the data with tabs. I transformed it into a CSV (comma-separated value) file, which I prefer to use with Python. (CSV files are also very useful because they can be imported easily into a spreadsheet program.) - -In each line, the first item is the color name, and it's followed by its C, M, Y, and K color values. The file consisted of 1,793 colors, and I wanted a way to analyze the information to get a sense of the range of values. This is where PostgreSQL comes into play. I did not want to enter all of this data manually—I don't think I could without errors (and headaches). Fortunately, PostgreSQL has a command for this. - -My first step was to create the database with: - - -``` -`Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal);` -``` - -Then I brought in the data with: - - -``` -`\copy  hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV);` -``` - -The backslash at the beginning is there because using the plain **copy** command is restricted to root and the Postgres superuser. In the parentheses, **header** means the first line contains headings and should be ignored, and **CSV** means the file format is CSV. Note that parentheses are not required around the color name in this method. - -If the operation is successful, I see a message that says **COPY NNNN**, where the N's refer to the number of rows inserted into the table. - -Finally, I can query the table with: - - -``` -select * from hlc_cmyk; - -     color     |   c   |   m   |   y   |  k   -\---------------+-------+-------+-------+------ - H010_L15_C010 |   0.5 |  49.1 |   0.1 | 84.5 - H010_L15_C020 |   0.0 |  79.7 |  15.1 | 78.9 - H010_L25_C010 |   6.1 |  38.3 |   0.0 | 72.5 - H010_L25_C020 |   0.0 |  61.8 |  10.6 | 67.9 - H010_L25_C030 |   0.0 |  79.5 |  18.5 | 62.7 - H010_L25_C040 |   0.4 |  94.2 |  17.3 | 56.5 - H010_L25_C050 |   0.0 | 100.0 |  15.1 | 50.6 - H010_L35_C010 |   6.1 |  32.1 |   0.0 | 61.8 - H010_L35_C020 |   0.0 |  51.7 |   8.4 | 57.5 - H010_L35_C030 |   0.0 |  68.5 |  17.1 | 52.5 -``` - -It goes on like this for all 1,793 rows of data. In retrospect, I can't say that this query was absolutely necessary for the HLC and Scribus task, but it allayed some of my anxieties about the project. - -To generate the HLC Color Atlas, I automated creating the color charts with Scribus for the 13,000+ colors in those pages of color swatches. - -I could have used the **copy** command to output my data: - - -``` -`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV);` -``` - -I also could restrict the output according to certain values with a **where** clause. - -For example, the following command will only send the table values for the hues that begin with H10. - - -``` -`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%';` -``` - -### Back up or transfer a database or table - -The final command I will mention here is **pg_dump**, which is used to back up a PostgreSQL database and runs outside of the **psql** console. For example: - - -``` -pg_dump gregp -t hlc_cmyk > hlc.out -pg_dump gregp > dball.out -``` - -The first line exports the **hlc_cmyk** table along with its structure. The second line dumps all the tables inside the **gregp** database. This is very useful for backing up or transferring a database or tables.  - -To transfer a database or table to another computer, first, create a database on the other computer (see my "[getting started][2]" article for details), then do the reverse process: - - -``` -`psql -d gregp -f dball.out` -``` - -This creates all the tables and enters the data in one step. - -### Conclusion - -In this article, we have seen how to use the **WHERE** parameter to restrict operations, along with the use of the PostgreSQL wildcard character **%**. We've also seen how to load a large amount of data into a table, then output some or all of the table data to a file, or even your entire database with all its individual tables. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/postgresql-commands - -作者:[Greg Pittman][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/greg-p -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) -[2]: https://opensource.com/article/19/11/getting-started-postgresql -[3]: https://www.postgresql.org/ -[4]: http://freiefarbe.de -[5]: https://www.freiefarbe.de/en/thema-farbe/hlc-colour-atlas/ From 675b2df362764774c4e7bae104a9fbd1bc542ebf Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Mon, 10 Feb 2020 21:24:34 +0800 Subject: [PATCH 009/315] fix issue --- ...ra to your Android phone with GSConnect.md | 118 ------------------ ...-CD resources to set you up for success.md | 64 ---------- 2 files changed, 182 deletions(-) delete mode 100644 sources/tech/20200207 Connect Fedora to your Android phone with GSConnect.md delete mode 100644 translated/tech/20191227 Top CI-CD resources to set you up for success.md diff --git a/sources/tech/20200207 Connect Fedora to your Android phone with GSConnect.md b/sources/tech/20200207 Connect Fedora to your Android phone with GSConnect.md deleted file mode 100644 index 528289f3b0..0000000000 --- a/sources/tech/20200207 Connect Fedora to your Android phone with GSConnect.md +++ /dev/null @@ -1,118 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Connect Fedora to your Android phone with GSConnect) -[#]: via: (https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/) -[#]: author: (Lokesh Krishna https://fedoramagazine.org/author/lowkeyskywalker/) - -Connect Fedora to your Android phone with GSConnect -====== - -![][1] - -Both Apple and Microsoft offer varying levels of integration of their desktop offerings with your mobile devices. Fedora offers a similar if not greater degree of integration with **GSConnect**. It lets you pair your Android phone with your Fedora desktop and opens up a lot of possibilities. Keep reading to discover more about what it is and how it works. - -### What is GSConnect? - -GSConnect is an implementation of the KDE Connect project tailored for the GNOME desktop. KDE Connect makes it possible for your devices to communicate with each other. However, installing it on Fedora’s default GNOME desktop requires pulling in a large number of KDE dependencies. - -GSConnect is a complete implementation of KDE Connect, but in the form of a GNOME shell extension. Once installed, GSConnect lets you do the following and a lot more: - - * Receive phone notifications on your desktop and reply to messages - * Use your phone as a remote control for your desktop - * Share files and links between devices - * Check your phone’s battery level from the desktop - * Ring your phone to help find it - - - -### Setting up the GSConnect extension - -Setting up GSConnect requires installing two components: the GSConnect extension on your desktop and the KDE Connect app on your Android device. - -First, install the GSConnect extension from the GNOME Shell extensions website: [GSConnect][2]. (Fedora Magazine has a handy article on [How to install a GNOME Shell extension][3] to help you with this step.) - -The KDE Connect app is available on Google’s [Play Store][4]. It’s also available on the FOSS Android apps repository, [F-Droid][5]. - -Once you have installed both these components, you can pair your two devices. Installing the extension makes it show up in your system menu as _Mobile Devices_. Clicking on it displays a drop down menu, from which you can access _Mobile Settings_. - -![][6] - -Here’s where you can view your paired devices and manage the features offered by GSConnect. Once you are on this screen, launch the app on your Android device. - -You can initiate pairing from either device, but here you’ll be connecting to your desktop from the Android device. Simply hit refresh on the app, and as long as both devices are on the same wireless network, your desktop shows up in your Android device. You can now send a pair request to the desktop. Accept the pair request on your desktop to complete the pairing. - -![][7] - -### Using GSConnect - -Once paired, you’ll need to grant permissions on your Android device to make use of the many features available on GSConnect. Click on the paired device in the list of devices to see all available functions and enable or disable them according to your preferences. - -![][8] - -Remember that you’ll also need to grant corresponding permissions in the Android app to be able to use these functions. Depending upon the features you’ve enabled and the permissions you’ve granted, you can now access your mobile contacts on your desktop, get notified of messages and reply to them, and even sync the desktop and Android device clipboards. - -### Integration with Files and your web browsers - -GSConnect allows you to directly send files to your Android device from your desktop file explorer’s context menu. - -On Fedora’s default GNOME desktop, you will need to install the _nautilus-python_ package in order to make your paired devices show up in the context menu. Installing this is as straightforward as running the following command from your preferred terminal: - -``` -$ sudo dnf install nautilus-python -``` - -Once done, the _Send to Mobile Device_ entry appears in the context menu of the Files app. - -![][9] - -Similarly, install the corresponding WebExtension for your browser, be it [Firefox][10] or [Chrome][11], to send links to your Android device. You have the option to send the link to launch directly in your browser or to deliver it as SMS. - -### Running Commands - -GSConnect lets you define commands which you can then run on your desktop, from your remote device. This allows you to do things such as take a screenshot of your desktop, or lock and unlock your desktop from your Android device, remotely. - -![][12] - -To make use of this feature, you can use standard shell commands and the CLI exposed by GSConnect. Documentation on this is provided in the project’s GitHub repository: _CLI Scripting_. - -The [KDE UserBase Wiki][13] has a list of example commands. These examples cover controlling the brightness and volume on your desktop, locking the mouse and keyboard, and even changing the desktop theme. Some of the commands are specific for KDE Plasma, and modifications are necessary to make it run on the GNOME desktop. - -### Explore and have fun - -GSConnect makes it possible to enjoy a great degree of convenience and comfort. Dive into the preferences to see all that you can do and get creative with the commands function. Feel free to share all the possibilities this utility unlocked in your workflow in the comments below. - -* * * - -_Photo by [Pathum Danthanarayana][14] on [Unsplash][15]._ - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/ - -作者:[Lokesh Krishna][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/lowkeyskywalker/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/12/gsconnect-816x345.jpg -[2]: https://extensions.gnome.org/extension/1319/gsconnect/ -[3]: https://fedoramagazine.org/install-gnome-shell-extension/ -[4]: https://play.google.com/store/apps/details?id=org.kde.kdeconnect_tp -[5]: https://f-droid.org/en/packages/org.kde.kdeconnect_tp/ -[6]: https://fedoramagazine.org/wp-content/uploads/2020/01/within-the-menu-1024x576.png -[7]: https://fedoramagazine.org/wp-content/uploads/2020/01/pair-request-1024x576.png -[8]: https://fedoramagazine.org/wp-content/uploads/2020/01/permissions-1024x576.png -[9]: https://fedoramagazine.org/wp-content/uploads/2020/01/send-to-mobile-2-1024x576.png -[10]: https://addons.mozilla.org/en-US/firefox/addon/gsconnect/ -[11]: https://chrome.google.com/webstore/detail/gsconnect/jfnifeihccihocjbfcfhicmmgpjicaec -[12]: https://fedoramagazine.org/wp-content/uploads/2020/01/commands-1024x576.png -[13]: https://userbase.kde.org/KDE_Connect/Tutorials/Useful_commands -[14]: https://unsplash.com/@pathum_danthanarayana?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[15]: https://unsplash.com/s/photos/android?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/translated/tech/20191227 Top CI-CD resources to set you up for success.md b/translated/tech/20191227 Top CI-CD resources to set you up for success.md deleted file mode 100644 index 102e53d153..0000000000 --- a/translated/tech/20191227 Top CI-CD resources to set you up for success.md +++ /dev/null @@ -1,64 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Morisun029) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Top CI/CD resources to set you up for success) -[#]: via: (https://opensource.com/article/19/12/cicd-resources) -[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) - -顶级 CI / CD 资源,助您成功 -====== -随着企业期望实现无缝,灵活和可扩展的部署,持续集成和持续部署成为2019年的关键主题。 -![Plumbing tubes in many directions][1] - -对于 CI / CD 和 DevOps 来说,2019年是非常棒的一年。 Opensource 公司的作者分享了他们专注于无缝,灵活和可扩展部署时是如何朝着敏捷方向发展的。以下是我们2019年发布的 CI / CD 文章中的一些重要主题。 - -### 学习和提高您的 CI / CD 技能 - - -我们最喜欢的一些文章集中在 CI / CD 的实操经验上,并涵盖了许多方面。通常以[Jenkins][2]管道开始,布莱恩特的文章[用 Jenkins 构建 CI/CD 管道][4]将为您提供足够的经验,以开始构建您的第一个管道。丹尼尔在 [用DevOps 管道进行自动验收测试][4]一文中,提供了有关验收测试的重要信息,包括可用于独立测试的各种 CI / CD 应用程序。我写的[安全扫描DevOps 管道][5]非常简短,其中的关键点是关于如何使用 Jenkins 平台在管道中设置安全性的教程。 - -### 交付工作流程 - - -威利•彼得•绍布赞扬为所有产品创建统一流水线的想法,以使[每种产品在一个CI / CD 流水线中持续建立起来,以管控所有产品][8]。这些文章将使您更好地了解团队成员加入工作流流程后会发生什么。 - -### CI / CD 如何影响企业 - - -2019年也是认识到 CI / CD 的业务影响以及它如何影响日常运营的一年。 - - - -Agnieszka Gancarczyk 分享了Red Hat[小型Scrum vs.大型Scrum][9] 的调查结果, 包括受访者对srums, - -敏捷运动及其对团队的影响的不同看法。威尔安•凯丽 的[持续部署如何影响企业][10], 包括开放式沟通的重要性,丹尼尔也强调了[DevOps 团队在3 种类型的指表板][11]中指标和可观测性的重要性。最后是安•玛丽•弗雷德的精彩文章: [不要在生产环境中测试?在生产环境中测试!][12] 详细说明了验收测试前在生产环境中测试的重要性。 - -感谢许多贡献者在2019年与 Opensource 的读者分享他们的见解,我期望在2020年里从他们那里了解更多有关 CI / CD 发展的信息。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/cicd-resources - -作者:[Jessica Cherry][a] -选题:[lujun9972][b] -译者:[Morisun029](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jrepka -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions) -[2]: https://jenkins.io/ -[3]: https://opensource.com/article/19/9/intro-building-cicd-pipelines-jenkins -[4]: https://opensource.com/article/19/4/devops-pipeline-acceptance-testing -[5]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline -[6]: https://opensource.com/article/19/3/screwdriver-cicd -[7]: https://opensource.com/article/19/8/why-spinnaker-matters-cicd -[8]: https://opensource.com/article/19/7/cicd-pipeline-rule-them-all -[9]: https://opensource.com/article/19/3/small-scale-scrum-vs-large-scale-scrum -[10]: https://opensource.com/article/19/7/organizational-impact-continuous-deployment -[11]: https://opensource.com/article/19/7/dashboards-devops-teams -[12]: https://opensource.com/article/19/5/dont-test-production From 0ebf287464937336c5033cd5afc66a0c35518a22 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Tue, 11 Feb 2020 15:24:34 +0800 Subject: [PATCH 010/315] delete file --- ...00206 3 ways to use PostgreSQL commands.md | 228 ------------------ 1 file changed, 228 deletions(-) delete mode 100644 translated/tech/20200206 3 ways to use PostgreSQL commands.md diff --git a/translated/tech/20200206 3 ways to use PostgreSQL commands.md b/translated/tech/20200206 3 ways to use PostgreSQL commands.md deleted file mode 100644 index 9f5890f370..0000000000 --- a/translated/tech/20200206 3 ways to use PostgreSQL commands.md +++ /dev/null @@ -1,228 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Morisun029) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 ways to use PostgreSQL commands) -[#]: via: (https://opensource.com/article/20/2/postgresql-commands) -[#]: author: (Greg Pittman https://opensource.com/users/greg-p) - -3种使用 PostgreSQL 命令的方式 -====== -无论你需要的东西简单(如一个购物清单)亦或复杂(如色卡生成器) - PostgreSQL 命令都能使它变得容易起来。 - -![Team checklist and to dos][1] - -在 _[PostgreSQL 入门][2]_ 一文中, 我解释了如何安装,设置和开始使用开源数据库软件。然而,使用 [PostgreSQL][3] 中的命令可以做更多事情。 - -例如,我使用 Postgres 来跟踪我杂货店的购物清单。我杂货店里的大多数购物是在家里进行的,其中每周进行一次大批量的采购。我去几个不同的地方购买清单上的东西,因为每家商店都提供特定的选择或质量,亦或更好的价格。最初,我制作了一个HTML表单页面来管理我的购物清单,但这样无法保存我的输入内容。因此,在想到要购买的物品时我必须要马上列出清单,因为到采购时我常常会忘记一些我需要或想要的东西。 - -相反,使用 PostgreSQL,当我想到需要的物品时,我可以随时输入,并在购物前打印出来。你也可以这样做。 - - -### 创建一个简单的购物清单 - - -首先,数据库中输入**psql ** 命令,然后用下面的命令创建一个表: -``` -`Create table groc (item varchar(20), comment varchar(10));` -``` - -输入如下命令在清单中加入商品: - -``` -insert into groc values ('milk', 'K'); -insert into groc values ('bananas', 'KW'); -``` - -括号中有两个信息(逗号隔开):前面是你需要买的东西,后面字母代表你要购买的地点以及哪些东西是你每周通常都要买的(W)。 - -因为 **psql** 有历史记录,你可以按向上键在括号内编辑信息,而无需输入商品的整行信息。 - -在输入一小部分商品后,输入下面命令来检查前面的输入内容。 - -``` -Select * from groc order by comment; - - item | comment -\----------------+--------- - ground coffee | H - butter | K - chips | K - steak | K - milk | K - bananas | KW - raisin bran | KW - raclette | L - goat cheese | L - onion | P - oranges | P - potatoes | P - spinach | PW - broccoli | PW - asparagus | PW - cucumber | PW - sugarsnap peas | PW - salmon | S -(18 rows) -``` - -此命令按_comment_ 列对结果进行排序,以便按购买地点对商品进行分组,从而是你的购物更加方便。 - -使用W来指明你每周要买的东西,当你要清除表单为下周的列表做准备时,你可以将每周的商品保留在购物清单上。输入: - -``` -`delete from groc where comment not like '%W';` -``` - -注意,在 PostgreSQL 中 **%** 表示通配符(而非星号)。所以,要保存输入内容,需要输入: - -``` -`delete from groc where item like 'goat%';` -``` - -不能使用**item = 'goat%'**,这样没用。 - - -在购物时,用以下命令输出清单并打印出来发送到你的手机: - -``` -\o groclist.txt -select * from groc order by comment; -\o -``` - -最后一个命令**\o*,重置输出到命令行。否则,所有的输出会继续输出到你创建的杂货店购物文件中。 - -### 分析复杂的表 - -This item-by-item entry may be okay for short tables, but what about really big ones? A couple of years ago, I was helping the team at [FreieFarbe.de][4] to create a swatchbook of the free colors (freieFarbe means "free colors" in German) from its HLC color palette, where virtually any imaginable print color can be specified by its hue, luminosity (brightness), and chroma (saturation). The result was the [HLC Color Atlas][5], and here's how we did it. - -逐个输入对于数据量小的表来说没有问题,但是对于数据量大的表呢?几年前,我帮团队从 HLC 调色板中创建一个自由色的色样册。事实上,任何能想象到的打印色都可按色调、亮度、浓度(饱和度)来规定。最终结果是[HLC Color Atlas][5],下面是我们如何实现的。 - -该团队向我发送了具有颜色规范的文件,因此我可以编写可与 Scribus 配合使用的 Python 脚本,以轻松生成色样册。一个例子像这样开始: - - -``` -HLC, C, M, Y, K -H010_L15_C010, 0.5, 49.1, 0.1, 84.5 -H010_L15_C020, 0.0, 79.7, 15.1, 78.9 -H010_L25_C010, 6.1, 38.3, 0.0, 72.5 -H010_L25_C020, 0.0, 61.8, 10.6, 67.9 -H010_L25_C030, 0.0, 79.5, 18.5, 62.7 -H010_L25_C040, 0.4, 94.2, 17.3, 56.5 -H010_L25_C050, 0.0, 100.0, 15.1, 50.6 -H010_L35_C010, 6.1, 32.1, 0.0, 61.8 -H010_L35_C020, 0.0, 51.7, 8.4, 57.5 -H010_L35_C030, 0.0, 68.5, 17.1, 52.5 -H010_L35_C040, 0.0, 81.2, 22.0, 46.2 -H010_L35_C050, 0.0, 91.9, 20.4, 39.3 -H010_L35_C060, 0.1, 100.0, 17.3, 31.5 -H010_L45_C010, 4.3, 27.4, 0.1, 51.3 -``` - -这与原文件相比,稍有修改,将数据用制表符分隔。我将其转换成 CSV 格式(逗号分割值),我更喜欢其与 Python 一起使用(CSV 文也很有用因为它可轻松导入到电子表格程序中)。 - -在每一行中,第一项是颜色名称,其后是其 C,M,Y 和 K 颜色值。 该文件包含1,793种颜色,我想要一种分析信息的方法,以了解这些值的范围。 这就是 PostgreSQL 发挥作用的地方。 我不想手动输入所有数据-我认为输入过程中我不可能不出错。 幸运的是,PostgreSQL 为此提供了一个命令。 - -首先用以下命令创建数据库: - -``` -`Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal);` -``` - -然后通过以下命令引入数据: - - -``` -`\copy hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV);` -``` - - -开头有反斜杠,是因为使用纯**copy** 命令仅限于 root 用户和 Postgres 的超级用户。 在括号中,**header** 表示第一行包含标题,应忽略,**CSV** 表示文件格式为 CSV。 请注意,在此方法中,颜色名称周围不需要括号。 - -如果操作成功,会看到 **COPY NNNN**,其中 N 表示插入到表中的行号。 - -最后,可以用下列命令查询: - -``` -select * from hlc_cmyk; - - color | c | m | y | k -\---------------+-------+-------+-------+------ - H010_L15_C010 | 0.5 | 49.1 | 0.1 | 84.5 - H010_L15_C020 | 0.0 | 79.7 | 15.1 | 78.9 - H010_L25_C010 | 6.1 | 38.3 | 0.0 | 72.5 - H010_L25_C020 | 0.0 | 61.8 | 10.6 | 67.9 - H010_L25_C030 | 0.0 | 79.5 | 18.5 | 62.7 - H010_L25_C040 | 0.4 | 94.2 | 17.3 | 56.5 - H010_L25_C050 | 0.0 | 100.0 | 15.1 | 50.6 - H010_L35_C010 | 6.1 | 32.1 | 0.0 | 61.8 - H010_L35_C020 | 0.0 | 51.7 | 8.4 | 57.5 - H010_L35_C030 | 0.0 | 68.5 | 17.1 | 52.5 -``` - - -所有1,793行数据都是这样的。 回想起来,我不能说此查询对于HLC和Scribus任务是绝对必要的,但是它减轻了我对该项目的一些担忧。 - -为了生成 HLC 色谱,我使用 Scribus 为色板页面中的13,000多种颜色自动创建了颜色图表。 - -我可以使用 **copy** 命令输出数据: - -``` -`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV);` -``` - - -我还可以使用 ** where ** 子句根据某些值来限制输出。 - -例如,以下命令将仅发送以 H10 开头的色调值。 - - -``` -`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%';` -``` - -### 备份或传输数据库或表 - -我在此要提到的最后一个命令是**pg_dump**,它用于备份 PostgreSQL 数据库,并在 **psql** 控制台之外运行。 例如: - -``` -pg_dump gregp -t hlc_cmyk > hlc.out -pg_dump gregp > dball.out -``` - -第一行是导出 **hlc_cmyk** 表及其结构。第二行将转储 **gregp** 数据库中的所有表。 这对于备份或传输数据库或表非常有用。 - - -要将数据库或表转到另一台电脑( 查看"[ PostgreSQL 入门][2]" 那篇文章获取详细信息),首先在要转入的电脑上创建一个数据库,然后执行相反的操作。 - -``` -`psql -d gregp -f dball.out` -``` - -一步创建所有表并输入数据。 - -### 总结 - -在本文中,我们了解了如何使用 **WHERE** 参数限制操作,以及如何使用 PostgreSQL 通配符 **%**。 我们还了解了如何将大批量数据加载到表中,然后将部分或全部表数据输出到文件,甚至是将整个数据库及其所有单个表输出。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/postgresql-commands - -作者:[Greg Pittman][a] -选题:[lujun9972][b] -译者:[Morisun029](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/greg-p -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) -[2]: https://opensource.com/article/19/11/getting-started-postgresql -[3]: https://www.postgresql.org/ -[4]: http://freiefarbe.de -[5]: https://www.freiefarbe.de/en/thema-farbe/hlc-colour-atlas/ From a51d14f2583c7f53044dcbeb4a49742edaa5cb45 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Wed, 12 Feb 2020 21:55:30 +0800 Subject: [PATCH 011/315] Revert "fix issue" This reverts commit 675b2df362764774c4e7bae104a9fbd1bc542ebf. --- ...ra to your Android phone with GSConnect.md | 118 ++++++++++++++++++ ...-CD resources to set you up for success.md | 64 ++++++++++ 2 files changed, 182 insertions(+) create mode 100644 sources/tech/20200207 Connect Fedora to your Android phone with GSConnect.md create mode 100644 translated/tech/20191227 Top CI-CD resources to set you up for success.md diff --git a/sources/tech/20200207 Connect Fedora to your Android phone with GSConnect.md b/sources/tech/20200207 Connect Fedora to your Android phone with GSConnect.md new file mode 100644 index 0000000000..528289f3b0 --- /dev/null +++ b/sources/tech/20200207 Connect Fedora to your Android phone with GSConnect.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Connect Fedora to your Android phone with GSConnect) +[#]: via: (https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/) +[#]: author: (Lokesh Krishna https://fedoramagazine.org/author/lowkeyskywalker/) + +Connect Fedora to your Android phone with GSConnect +====== + +![][1] + +Both Apple and Microsoft offer varying levels of integration of their desktop offerings with your mobile devices. Fedora offers a similar if not greater degree of integration with **GSConnect**. It lets you pair your Android phone with your Fedora desktop and opens up a lot of possibilities. Keep reading to discover more about what it is and how it works. + +### What is GSConnect? + +GSConnect is an implementation of the KDE Connect project tailored for the GNOME desktop. KDE Connect makes it possible for your devices to communicate with each other. However, installing it on Fedora’s default GNOME desktop requires pulling in a large number of KDE dependencies. + +GSConnect is a complete implementation of KDE Connect, but in the form of a GNOME shell extension. Once installed, GSConnect lets you do the following and a lot more: + + * Receive phone notifications on your desktop and reply to messages + * Use your phone as a remote control for your desktop + * Share files and links between devices + * Check your phone’s battery level from the desktop + * Ring your phone to help find it + + + +### Setting up the GSConnect extension + +Setting up GSConnect requires installing two components: the GSConnect extension on your desktop and the KDE Connect app on your Android device. + +First, install the GSConnect extension from the GNOME Shell extensions website: [GSConnect][2]. (Fedora Magazine has a handy article on [How to install a GNOME Shell extension][3] to help you with this step.) + +The KDE Connect app is available on Google’s [Play Store][4]. It’s also available on the FOSS Android apps repository, [F-Droid][5]. + +Once you have installed both these components, you can pair your two devices. Installing the extension makes it show up in your system menu as _Mobile Devices_. Clicking on it displays a drop down menu, from which you can access _Mobile Settings_. + +![][6] + +Here’s where you can view your paired devices and manage the features offered by GSConnect. Once you are on this screen, launch the app on your Android device. + +You can initiate pairing from either device, but here you’ll be connecting to your desktop from the Android device. Simply hit refresh on the app, and as long as both devices are on the same wireless network, your desktop shows up in your Android device. You can now send a pair request to the desktop. Accept the pair request on your desktop to complete the pairing. + +![][7] + +### Using GSConnect + +Once paired, you’ll need to grant permissions on your Android device to make use of the many features available on GSConnect. Click on the paired device in the list of devices to see all available functions and enable or disable them according to your preferences. + +![][8] + +Remember that you’ll also need to grant corresponding permissions in the Android app to be able to use these functions. Depending upon the features you’ve enabled and the permissions you’ve granted, you can now access your mobile contacts on your desktop, get notified of messages and reply to them, and even sync the desktop and Android device clipboards. + +### Integration with Files and your web browsers + +GSConnect allows you to directly send files to your Android device from your desktop file explorer’s context menu. + +On Fedora’s default GNOME desktop, you will need to install the _nautilus-python_ package in order to make your paired devices show up in the context menu. Installing this is as straightforward as running the following command from your preferred terminal: + +``` +$ sudo dnf install nautilus-python +``` + +Once done, the _Send to Mobile Device_ entry appears in the context menu of the Files app. + +![][9] + +Similarly, install the corresponding WebExtension for your browser, be it [Firefox][10] or [Chrome][11], to send links to your Android device. You have the option to send the link to launch directly in your browser or to deliver it as SMS. + +### Running Commands + +GSConnect lets you define commands which you can then run on your desktop, from your remote device. This allows you to do things such as take a screenshot of your desktop, or lock and unlock your desktop from your Android device, remotely. + +![][12] + +To make use of this feature, you can use standard shell commands and the CLI exposed by GSConnect. Documentation on this is provided in the project’s GitHub repository: _CLI Scripting_. + +The [KDE UserBase Wiki][13] has a list of example commands. These examples cover controlling the brightness and volume on your desktop, locking the mouse and keyboard, and even changing the desktop theme. Some of the commands are specific for KDE Plasma, and modifications are necessary to make it run on the GNOME desktop. + +### Explore and have fun + +GSConnect makes it possible to enjoy a great degree of convenience and comfort. Dive into the preferences to see all that you can do and get creative with the commands function. Feel free to share all the possibilities this utility unlocked in your workflow in the comments below. + +* * * + +_Photo by [Pathum Danthanarayana][14] on [Unsplash][15]._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/ + +作者:[Lokesh Krishna][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/lowkeyskywalker/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/12/gsconnect-816x345.jpg +[2]: https://extensions.gnome.org/extension/1319/gsconnect/ +[3]: https://fedoramagazine.org/install-gnome-shell-extension/ +[4]: https://play.google.com/store/apps/details?id=org.kde.kdeconnect_tp +[5]: https://f-droid.org/en/packages/org.kde.kdeconnect_tp/ +[6]: https://fedoramagazine.org/wp-content/uploads/2020/01/within-the-menu-1024x576.png +[7]: https://fedoramagazine.org/wp-content/uploads/2020/01/pair-request-1024x576.png +[8]: https://fedoramagazine.org/wp-content/uploads/2020/01/permissions-1024x576.png +[9]: https://fedoramagazine.org/wp-content/uploads/2020/01/send-to-mobile-2-1024x576.png +[10]: https://addons.mozilla.org/en-US/firefox/addon/gsconnect/ +[11]: https://chrome.google.com/webstore/detail/gsconnect/jfnifeihccihocjbfcfhicmmgpjicaec +[12]: https://fedoramagazine.org/wp-content/uploads/2020/01/commands-1024x576.png +[13]: https://userbase.kde.org/KDE_Connect/Tutorials/Useful_commands +[14]: https://unsplash.com/@pathum_danthanarayana?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[15]: https://unsplash.com/s/photos/android?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/translated/tech/20191227 Top CI-CD resources to set you up for success.md b/translated/tech/20191227 Top CI-CD resources to set you up for success.md new file mode 100644 index 0000000000..102e53d153 --- /dev/null +++ b/translated/tech/20191227 Top CI-CD resources to set you up for success.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: (Morisun029) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top CI/CD resources to set you up for success) +[#]: via: (https://opensource.com/article/19/12/cicd-resources) +[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) + +顶级 CI / CD 资源,助您成功 +====== +随着企业期望实现无缝,灵活和可扩展的部署,持续集成和持续部署成为2019年的关键主题。 +![Plumbing tubes in many directions][1] + +对于 CI / CD 和 DevOps 来说,2019年是非常棒的一年。 Opensource 公司的作者分享了他们专注于无缝,灵活和可扩展部署时是如何朝着敏捷方向发展的。以下是我们2019年发布的 CI / CD 文章中的一些重要主题。 + +### 学习和提高您的 CI / CD 技能 + + +我们最喜欢的一些文章集中在 CI / CD 的实操经验上,并涵盖了许多方面。通常以[Jenkins][2]管道开始,布莱恩特的文章[用 Jenkins 构建 CI/CD 管道][4]将为您提供足够的经验,以开始构建您的第一个管道。丹尼尔在 [用DevOps 管道进行自动验收测试][4]一文中,提供了有关验收测试的重要信息,包括可用于独立测试的各种 CI / CD 应用程序。我写的[安全扫描DevOps 管道][5]非常简短,其中的关键点是关于如何使用 Jenkins 平台在管道中设置安全性的教程。 + +### 交付工作流程 + + +威利•彼得•绍布赞扬为所有产品创建统一流水线的想法,以使[每种产品在一个CI / CD 流水线中持续建立起来,以管控所有产品][8]。这些文章将使您更好地了解团队成员加入工作流流程后会发生什么。 + +### CI / CD 如何影响企业 + + +2019年也是认识到 CI / CD 的业务影响以及它如何影响日常运营的一年。 + + + +Agnieszka Gancarczyk 分享了Red Hat[小型Scrum vs.大型Scrum][9] 的调查结果, 包括受访者对srums, + +敏捷运动及其对团队的影响的不同看法。威尔安•凯丽 的[持续部署如何影响企业][10], 包括开放式沟通的重要性,丹尼尔也强调了[DevOps 团队在3 种类型的指表板][11]中指标和可观测性的重要性。最后是安•玛丽•弗雷德的精彩文章: [不要在生产环境中测试?在生产环境中测试!][12] 详细说明了验收测试前在生产环境中测试的重要性。 + +感谢许多贡献者在2019年与 Opensource 的读者分享他们的见解,我期望在2020年里从他们那里了解更多有关 CI / CD 发展的信息。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/cicd-resources + +作者:[Jessica Cherry][a] +选题:[lujun9972][b] +译者:[Morisun029](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jrepka +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions) +[2]: https://jenkins.io/ +[3]: https://opensource.com/article/19/9/intro-building-cicd-pipelines-jenkins +[4]: https://opensource.com/article/19/4/devops-pipeline-acceptance-testing +[5]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline +[6]: https://opensource.com/article/19/3/screwdriver-cicd +[7]: https://opensource.com/article/19/8/why-spinnaker-matters-cicd +[8]: https://opensource.com/article/19/7/cicd-pipeline-rule-them-all +[9]: https://opensource.com/article/19/3/small-scale-scrum-vs-large-scale-scrum +[10]: https://opensource.com/article/19/7/organizational-impact-continuous-deployment +[11]: https://opensource.com/article/19/7/dashboards-devops-teams +[12]: https://opensource.com/article/19/5/dont-test-production From 0f4bbc87a8d8a5c5bf03de758dd7eb8793ae8d44 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Wed, 12 Feb 2020 22:41:10 +0800 Subject: [PATCH 012/315] translated --- ...00206 3 ways to use PostgreSQL commands.md | 228 ++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 translated/tech/20200206 3 ways to use PostgreSQL commands.md diff --git a/translated/tech/20200206 3 ways to use PostgreSQL commands.md b/translated/tech/20200206 3 ways to use PostgreSQL commands.md new file mode 100644 index 0000000000..9f5890f370 --- /dev/null +++ b/translated/tech/20200206 3 ways to use PostgreSQL commands.md @@ -0,0 +1,228 @@ +[#]: collector: (lujun9972) +[#]: translator: (Morisun029) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 ways to use PostgreSQL commands) +[#]: via: (https://opensource.com/article/20/2/postgresql-commands) +[#]: author: (Greg Pittman https://opensource.com/users/greg-p) + +3种使用 PostgreSQL 命令的方式 +====== +无论你需要的东西简单(如一个购物清单)亦或复杂(如色卡生成器) + PostgreSQL 命令都能使它变得容易起来。 + +![Team checklist and to dos][1] + +在 _[PostgreSQL 入门][2]_ 一文中, 我解释了如何安装,设置和开始使用开源数据库软件。然而,使用 [PostgreSQL][3] 中的命令可以做更多事情。 + +例如,我使用 Postgres 来跟踪我杂货店的购物清单。我杂货店里的大多数购物是在家里进行的,其中每周进行一次大批量的采购。我去几个不同的地方购买清单上的东西,因为每家商店都提供特定的选择或质量,亦或更好的价格。最初,我制作了一个HTML表单页面来管理我的购物清单,但这样无法保存我的输入内容。因此,在想到要购买的物品时我必须要马上列出清单,因为到采购时我常常会忘记一些我需要或想要的东西。 + +相反,使用 PostgreSQL,当我想到需要的物品时,我可以随时输入,并在购物前打印出来。你也可以这样做。 + + +### 创建一个简单的购物清单 + + +首先,数据库中输入**psql ** 命令,然后用下面的命令创建一个表: +``` +`Create table groc (item varchar(20), comment varchar(10));` +``` + +输入如下命令在清单中加入商品: + +``` +insert into groc values ('milk', 'K'); +insert into groc values ('bananas', 'KW'); +``` + +括号中有两个信息(逗号隔开):前面是你需要买的东西,后面字母代表你要购买的地点以及哪些东西是你每周通常都要买的(W)。 + +因为 **psql** 有历史记录,你可以按向上键在括号内编辑信息,而无需输入商品的整行信息。 + +在输入一小部分商品后,输入下面命令来检查前面的输入内容。 + +``` +Select * from groc order by comment; + + item | comment +\----------------+--------- + ground coffee | H + butter | K + chips | K + steak | K + milk | K + bananas | KW + raisin bran | KW + raclette | L + goat cheese | L + onion | P + oranges | P + potatoes | P + spinach | PW + broccoli | PW + asparagus | PW + cucumber | PW + sugarsnap peas | PW + salmon | S +(18 rows) +``` + +此命令按_comment_ 列对结果进行排序,以便按购买地点对商品进行分组,从而是你的购物更加方便。 + +使用W来指明你每周要买的东西,当你要清除表单为下周的列表做准备时,你可以将每周的商品保留在购物清单上。输入: + +``` +`delete from groc where comment not like '%W';` +``` + +注意,在 PostgreSQL 中 **%** 表示通配符(而非星号)。所以,要保存输入内容,需要输入: + +``` +`delete from groc where item like 'goat%';` +``` + +不能使用**item = 'goat%'**,这样没用。 + + +在购物时,用以下命令输出清单并打印出来发送到你的手机: + +``` +\o groclist.txt +select * from groc order by comment; +\o +``` + +最后一个命令**\o*,重置输出到命令行。否则,所有的输出会继续输出到你创建的杂货店购物文件中。 + +### 分析复杂的表 + +This item-by-item entry may be okay for short tables, but what about really big ones? A couple of years ago, I was helping the team at [FreieFarbe.de][4] to create a swatchbook of the free colors (freieFarbe means "free colors" in German) from its HLC color palette, where virtually any imaginable print color can be specified by its hue, luminosity (brightness), and chroma (saturation). The result was the [HLC Color Atlas][5], and here's how we did it. + +逐个输入对于数据量小的表来说没有问题,但是对于数据量大的表呢?几年前,我帮团队从 HLC 调色板中创建一个自由色的色样册。事实上,任何能想象到的打印色都可按色调、亮度、浓度(饱和度)来规定。最终结果是[HLC Color Atlas][5],下面是我们如何实现的。 + +该团队向我发送了具有颜色规范的文件,因此我可以编写可与 Scribus 配合使用的 Python 脚本,以轻松生成色样册。一个例子像这样开始: + + +``` +HLC, C, M, Y, K +H010_L15_C010, 0.5, 49.1, 0.1, 84.5 +H010_L15_C020, 0.0, 79.7, 15.1, 78.9 +H010_L25_C010, 6.1, 38.3, 0.0, 72.5 +H010_L25_C020, 0.0, 61.8, 10.6, 67.9 +H010_L25_C030, 0.0, 79.5, 18.5, 62.7 +H010_L25_C040, 0.4, 94.2, 17.3, 56.5 +H010_L25_C050, 0.0, 100.0, 15.1, 50.6 +H010_L35_C010, 6.1, 32.1, 0.0, 61.8 +H010_L35_C020, 0.0, 51.7, 8.4, 57.5 +H010_L35_C030, 0.0, 68.5, 17.1, 52.5 +H010_L35_C040, 0.0, 81.2, 22.0, 46.2 +H010_L35_C050, 0.0, 91.9, 20.4, 39.3 +H010_L35_C060, 0.1, 100.0, 17.3, 31.5 +H010_L45_C010, 4.3, 27.4, 0.1, 51.3 +``` + +这与原文件相比,稍有修改,将数据用制表符分隔。我将其转换成 CSV 格式(逗号分割值),我更喜欢其与 Python 一起使用(CSV 文也很有用因为它可轻松导入到电子表格程序中)。 + +在每一行中,第一项是颜色名称,其后是其 C,M,Y 和 K 颜色值。 该文件包含1,793种颜色,我想要一种分析信息的方法,以了解这些值的范围。 这就是 PostgreSQL 发挥作用的地方。 我不想手动输入所有数据-我认为输入过程中我不可能不出错。 幸运的是,PostgreSQL 为此提供了一个命令。 + +首先用以下命令创建数据库: + +``` +`Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal);` +``` + +然后通过以下命令引入数据: + + +``` +`\copy hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV);` +``` + + +开头有反斜杠,是因为使用纯**copy** 命令仅限于 root 用户和 Postgres 的超级用户。 在括号中,**header** 表示第一行包含标题,应忽略,**CSV** 表示文件格式为 CSV。 请注意,在此方法中,颜色名称周围不需要括号。 + +如果操作成功,会看到 **COPY NNNN**,其中 N 表示插入到表中的行号。 + +最后,可以用下列命令查询: + +``` +select * from hlc_cmyk; + + color | c | m | y | k +\---------------+-------+-------+-------+------ + H010_L15_C010 | 0.5 | 49.1 | 0.1 | 84.5 + H010_L15_C020 | 0.0 | 79.7 | 15.1 | 78.9 + H010_L25_C010 | 6.1 | 38.3 | 0.0 | 72.5 + H010_L25_C020 | 0.0 | 61.8 | 10.6 | 67.9 + H010_L25_C030 | 0.0 | 79.5 | 18.5 | 62.7 + H010_L25_C040 | 0.4 | 94.2 | 17.3 | 56.5 + H010_L25_C050 | 0.0 | 100.0 | 15.1 | 50.6 + H010_L35_C010 | 6.1 | 32.1 | 0.0 | 61.8 + H010_L35_C020 | 0.0 | 51.7 | 8.4 | 57.5 + H010_L35_C030 | 0.0 | 68.5 | 17.1 | 52.5 +``` + + +所有1,793行数据都是这样的。 回想起来,我不能说此查询对于HLC和Scribus任务是绝对必要的,但是它减轻了我对该项目的一些担忧。 + +为了生成 HLC 色谱,我使用 Scribus 为色板页面中的13,000多种颜色自动创建了颜色图表。 + +我可以使用 **copy** 命令输出数据: + +``` +`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV);` +``` + + +我还可以使用 ** where ** 子句根据某些值来限制输出。 + +例如,以下命令将仅发送以 H10 开头的色调值。 + + +``` +`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%';` +``` + +### 备份或传输数据库或表 + +我在此要提到的最后一个命令是**pg_dump**,它用于备份 PostgreSQL 数据库,并在 **psql** 控制台之外运行。 例如: + +``` +pg_dump gregp -t hlc_cmyk > hlc.out +pg_dump gregp > dball.out +``` + +第一行是导出 **hlc_cmyk** 表及其结构。第二行将转储 **gregp** 数据库中的所有表。 这对于备份或传输数据库或表非常有用。 + + +要将数据库或表转到另一台电脑( 查看"[ PostgreSQL 入门][2]" 那篇文章获取详细信息),首先在要转入的电脑上创建一个数据库,然后执行相反的操作。 + +``` +`psql -d gregp -f dball.out` +``` + +一步创建所有表并输入数据。 + +### 总结 + +在本文中,我们了解了如何使用 **WHERE** 参数限制操作,以及如何使用 PostgreSQL 通配符 **%**。 我们还了解了如何将大批量数据加载到表中,然后将部分或全部表数据输出到文件,甚至是将整个数据库及其所有单个表输出。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/postgresql-commands + +作者:[Greg Pittman][a] +选题:[lujun9972][b] +译者:[Morisun029](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/greg-p +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) +[2]: https://opensource.com/article/19/11/getting-started-postgresql +[3]: https://www.postgresql.org/ +[4]: http://freiefarbe.de +[5]: https://www.freiefarbe.de/en/thema-farbe/hlc-colour-atlas/ From 04893309f20faf46cd75addfe2d8f573d098415a Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Wed, 12 Feb 2020 23:13:56 +0800 Subject: [PATCH 013/315] delete useless --- ...190407 Manage multimedia files with Git.md | 247 ------------------ ...ra to your Android phone with GSConnect.md | 118 --------- ...-CD resources to set you up for success.md | 64 ----- ...in one place with this open source tool.md | 71 ----- 4 files changed, 500 deletions(-) delete mode 100644 sources/tech/20190407 Manage multimedia files with Git.md delete mode 100644 sources/tech/20200207 Connect Fedora to your Android phone with GSConnect.md delete mode 100644 translated/tech/20191227 Top CI-CD resources to set you up for success.md delete mode 100644 translated/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md diff --git a/sources/tech/20190407 Manage multimedia files with Git.md b/sources/tech/20190407 Manage multimedia files with Git.md deleted file mode 100644 index 340c356aa9..0000000000 --- a/sources/tech/20190407 Manage multimedia files with Git.md +++ /dev/null @@ -1,247 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Manage multimedia files with Git) -[#]: via: (https://opensource.com/article/19/4/manage-multimedia-files-git) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Manage multimedia files with Git -====== -Learn how to use Git to track large multimedia files in your projects in -the final article in our series on little-known uses of Git. -![video editing dashboard][1] - -Git is very specifically designed for source code version control, so it's rarely embraced by projects and industries that don't primarily work in plaintext. However, the advantages of an asynchronous workflow are appealing, especially in the ever-growing number of industries that combine serious computing with seriously artistic ventures, including web design, visual effects, video games, publishing, currency design (yes, that's a real industry), education… the list goes on and on. - -In this series leading up to Git's 14th anniversary, we've shared six little-known ways to use Git. In this final article, we'll look at software that brings the advantages of Git to managing multimedia files. - -### The problem with managing multimedia files with Git - -It seems to be common knowledge that Git doesn't work well with non-text files, but it never hurts to challenge assumptions. Here's an example of copying a photo file using Git: - - -``` -$ du -hs -108K . -$ cp ~/photos/dandelion.tif . -$ git add dandelion.tif -$ git commit -m 'added a photo' -[master (root-commit) fa6caa7] two photos -1 file changed, 0 insertions(+), 0 deletions(-) -create mode 100644 dandelion.tif -$ du -hs -1.8M . -``` - -Nothing unusual so far; adding a 1.8MB photo to a directory results in a directory 1.8MB in size. So, let's try removing the file: - - -``` -$ git rm dandelion.tif -$ git commit -m 'deleted a photo' -$ du -hs -828K . -``` - -You can see the problem here: Removing a large file after it's been committed increases a repository's size roughly eight times its original, barren state (from 108K to 828K). You can perform tests to get a better average, but this simple demonstration is consistent with my experience. The cost of committing files that aren't text-based is minimal at first, but the longer a project stays active, the more changes people make to static content, and the more those fractions start to add up. When a Git repository becomes very large, the major cost is usually speed. The time to perform pulls and pushes goes from being how long it takes to take a sip of coffee to how long it takes to wonder if your computer got kicked off the network. - -The reason static content causes Git to grow in size is that formats based on text allow Git to pull out just the parts that have changed. Raster images and music files make as much sense to Git as they would to you if you looked at the binary data contained in a .png or .wav file. So Git just takes all the data and makes a new copy of it, even if only one pixel changes from one photo to the next. - -### Git-portal - -In practice, many multimedia projects don't need or want to track the media's history. The media part of a project tends to have a different lifecycle than the text or code part of a project. Media assets generally progress in one direction: a picture starts as a pencil sketch, proceeds toward its destination as a digital painting, and, even if the text is rolled back to an earlier version, the art continues its forward progress. It's rare for media to be bound to a specific version of a project. The exceptions are usually graphics that reflect datasets—usually tables or graphs or charts—that can be done in text-based formats such as SVG. - -So, on many projects that involve both media and text (whether it's narrative prose or code), Git is an acceptable solution to file management, as long as there's a playground outside the version control cycle for artists to play in. - -![Graphic showing relationship between art assets and Git][2] - -A simple way to enable that is [Git-portal][3], a Bash script armed with Git hooks that moves your asset files to a directory outside Git's purview and replaces them with symlinks. Git commits the symlinks (sometimes called aliases or shortcuts), which are trivially small, so all you commit are your text files and whatever symlinks represent your media assets. Because the replacement files are symlinks, your project continues to function as expected because your local machine follows the symlinks to their "real" counterparts. Git-portal maintains a project's directory structure when it swaps out a file with a symlink, so it's easy to reverse the process, should you decide that Git-portal isn't right for your project or you need to build a version of your project without symlinks (for distribution, for instance). - -Git-portal also allows remote synchronization of assets over rsync, so you can set up a remote storage location as a centralized source of authority. - -Git-portal is ideal for multimedia projects, including video game and tabletop game design, virtual reality projects with big 3D model renders and textures, [books][4] with graphics and .odt exports, collaborative [blog websites][5], music projects, and much more. It's not uncommon for an artist to perform versioning in their application—in the form of layers (in the graphics world) and tracks (in the music world)—so Git adds nothing to multimedia project files themselves. The power of Git is leveraged for other parts of artistic projects (prose and narrative, project management, subtitle files, credits, marketing copy, documentation, and so on), and the power of structured remote backups is leveraged by the artists. - -#### Install Git-portal - -There are RPM packages for Git-portal located at , which you can download and install. - -Alternately, you can install Git-portal manually from its home on GitLab. It's just a Bash script and some Git hooks (which are also Bash scripts), but it requires a quick build process so that it knows where to install itself: - - -``` -$ git clone git-portal.clone -$ cd git-portal.clone -$ ./configure -$ make -$ sudo make install -``` - -#### Use Git-portal - -Git-portal is used alongside Git. This means, as with all large-file extensions to Git, there are some added steps to remember. But you only need Git-portal when dealing with your media assets, so it's pretty easy to remember unless you've acclimated yourself to treating large files the same as text files (which is rare for Git users). There's one setup step you must do to use Git-portal in a project: - - -``` -$ mkdir bigproject.git -$ cd !$ -$ git init -$ git-portal init -``` - -Git-portal's **init** function creates a **_portal** directory in your Git repository and adds it to your .gitignore file. - -Using Git-portal in a daily routine integrates smoothly with Git. A good example is a MIDI-based music project: the project files produced by the music workstation are text-based, but the MIDI files are binary data: - - -``` -$ ls -1 -_portal -song.1.qtr -song.qtr -song-Track_1-1.mid -song-Track_1-3.mid -song-Track_2-1.mid -$ git add song*qtr -$ git-portal song-Track*mid -$ git add song-Track*mid -``` - -If you look into the **_portal** directory, you'll find the original MIDI files. The files in their place are symlinks to **_portal** , which keeps the music workstation working as expected: - - -``` -$ ls -lG -[...] _portal/ -[...] song.1.qtr -[...] song.qtr -[...] song-Track_1-1.mid -> _portal/song-Track_1-1.mid* -[...] song-Track_1-3.mid -> _portal/song-Track_1-3.mid* -[...] song-Track_2-1.mid -> _portal/song-Track_2-1.mid* -``` - -As with Git, you can also add a directory of files: - - -``` -$ cp -r ~/synth-presets/yoshimi . -$ git-portal add yoshimi -Directories cannot go through the portal. Sending files instead. -$ ls -lG _portal/yoshimi -[...] yoshimi.stat -> ../_portal/yoshimi/yoshimi.stat* -``` - -Removal works as expected, but when removing something in **_portal** , you should use **git-portal rm** instead of **git rm**. Using Git-portal ensures that the file is removed from **_portal** : - - -``` -$ ls -_portal/ song.qtr song-Track_1-3.mid@ yoshimi/ -song.1.qtr song-Track_1-1.mid@ song-Track_2-1.mid@ -$ git-portal rm song-Track_1-3.mid -rm 'song-Track_1-3.mid' -$ ls _portal/ -song-Track_1-1.mid* song-Track_2-1.mid* yoshimi/ -``` - -If you forget to use Git-portal, then you have to remove the portal file manually: - - -``` -$ git-portal rm song-Track_1-1.mid -rm 'song-Track_1-1.mid' -$ ls _portal/ -song-Track_1-1.mid* song-Track_2-1.mid* yoshimi/ -$ trash _portal/song-Track_1-1.mid -``` - -Git-portal's only other function is to list all current symlinks and find any that may have become broken, which can sometimes happen if files move around in a project directory: - - -``` -$ mkdir foo -$ mv yoshimi foo -$ git-portal status -bigproject.git/song-Track_2-1.mid: symbolic link to _portal/song-Track_2-1.mid -bigproject.git/foo/yoshimi/yoshimi.stat: broken symbolic link to ../_portal/yoshimi/yoshimi.stat -``` - -If you're using Git-portal for a personal project and maintaining your own backups, this is technically all you need to know about Git-portal. If you want to add in collaborators or you want Git-portal to manage backups the way (more or less) Git does, you can a remote. - -#### Add Git-portal remotes - -Adding a remote location for Git-portal is done through Git's existing remote function. Git-portal implements Git hooks, scripts hidden in your repository's .git directory, to look at your remotes for any that begin with **_portal**. If it finds one, it attempts to **rsync** to the remote location and synchronize files. Git-portal performs this action anytime you do a Git push or a Git merge (or pull, which is really just a fetch and an automatic merge). - -If you've only cloned Git repositories, then you may never have added a remote yourself. It's a standard Git procedure: - - -``` -$ git remote add origin [git@gitdawg.com][6]:seth/bigproject.git -$ git remote -v -origin [git@gitdawg.com][6]:seth/bigproject.git (fetch) -origin [git@gitdawg.com][6]:seth/bigproject.git (push) -``` - -The name **origin** is a popular convention for your main Git repository, so it makes sense to use it for your Git data. Your Git-portal data, however, is stored separately, so you must create a second remote to tell Git-portal where to push to and pull from. Depending on your Git host, you may need a separate server because gigabytes of media assets are unlikely to be accepted by a Git host with limited space. Or maybe you're on a server that permits you to access only your Git repository and not external storage directories: - - -``` -$ git remote add _portal [seth@example.com][7]:/home/seth/git/bigproject_portal -$ git remote -v -origin [git@gitdawg.com][6]:seth/bigproject.git (fetch) -origin [git@gitdawg.com][6]:seth/bigproject.git (push) -_portal [seth@example.com][7]:/home/seth/git/bigproject_portal (fetch) -_portal [seth@example.com][7]:/home/seth/git/bigproject_portal (push) -``` - -You may not want to give all of your users individual accounts on your server, and you don't have to. To provide access to the server hosting a repository's large file assets, you can run a Git frontend like **[Gitolite][8]** , or you can use **rrsync** (i.e., restricted rsync). - -Now you can push your Git data to your remote Git repository and your Git-portal data to your remote portal: - - -``` -$ git push origin HEAD -master destination detected -Syncing _portal content... -sending incremental file list -sent 9,305 bytes received 18 bytes 1,695.09 bytes/sec -total size is 60,358,015 speedup is 6,474.10 -Syncing _portal content to example.com:/home/seth/git/bigproject_portal -``` - -If you have Git-portal installed and a **_portal** remote configured, your **_portal** directory will be synchronized, getting new content from the server and sending fresh content with every push. While you don't have to do a Git commit and push to sync with the server (a user could just use rsync directly), I find it useful to require commits for artistic changes. It integrates artists and their digital assets into the rest of the workflow, and it provides useful metadata about project progress and velocity. - -### Other options - -If Git-portal is too simple for you, there are other options for managing large files with Git. [Git Large File Storage][9] (LFS) is a fork of a defunct project called git-media and is maintained and supported by GitHub. It requires special commands (like **git lfs track** to protect large files from being tracked by Git) and requires the user to manage a .gitattributes file to update which files in the repository are tracked by LFS. It supports _only_ HTTP and HTTPS remotes for large files, so your LFS server must be configured so users can authenticate over HTTP rather than SSH or rsync. - -A more flexible option than LFS is [git-annex][10], which you can learn more about in my article about [managing binary blobs in Git][11] (ignore the parts about the deprecated git-media, as its former flexibility doesn't apply to its successor, Git LFS). Git-annex is a flexible and elegant solution with a detailed system for adding, removing, and moving large files within a repository. Because it's flexible and powerful, there are lots of new commands and rules to learn, so take a look at its [documentation][12]. - -If, however, your needs are simple and you like a solution that utilizes existing technology to do simple and obvious tasks, Git-portal might be the tool for the job. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/manage-multimedia-files-git - -作者:[Seth Kenlon (Red Hat, Community Moderator)][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/video_editing_folder_music_wave_play.png?itok=-J9rs-My (video editing dashboard) -[2]: https://opensource.com/sites/default/files/uploads/git-velocity.jpg (Graphic showing relationship between art assets and Git) -[3]: http://gitlab.com/slackermedia/git-portal.git -[4]: https://www.apress.com/gp/book/9781484241691 -[5]: http://mixedsignals.ml -[6]: mailto:git@gitdawg.com -[7]: mailto:seth@example.com -[8]: https://opensource.com/article/19/4/file-sharing-git -[9]: https://git-lfs.github.com/ -[10]: https://git-annex.branchable.com/ -[11]: https://opensource.com/life/16/8/how-manage-binary-blobs-git-part-7 -[12]: https://git-annex.branchable.com/walkthrough/ diff --git a/sources/tech/20200207 Connect Fedora to your Android phone with GSConnect.md b/sources/tech/20200207 Connect Fedora to your Android phone with GSConnect.md deleted file mode 100644 index 528289f3b0..0000000000 --- a/sources/tech/20200207 Connect Fedora to your Android phone with GSConnect.md +++ /dev/null @@ -1,118 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Connect Fedora to your Android phone with GSConnect) -[#]: via: (https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/) -[#]: author: (Lokesh Krishna https://fedoramagazine.org/author/lowkeyskywalker/) - -Connect Fedora to your Android phone with GSConnect -====== - -![][1] - -Both Apple and Microsoft offer varying levels of integration of their desktop offerings with your mobile devices. Fedora offers a similar if not greater degree of integration with **GSConnect**. It lets you pair your Android phone with your Fedora desktop and opens up a lot of possibilities. Keep reading to discover more about what it is and how it works. - -### What is GSConnect? - -GSConnect is an implementation of the KDE Connect project tailored for the GNOME desktop. KDE Connect makes it possible for your devices to communicate with each other. However, installing it on Fedora’s default GNOME desktop requires pulling in a large number of KDE dependencies. - -GSConnect is a complete implementation of KDE Connect, but in the form of a GNOME shell extension. Once installed, GSConnect lets you do the following and a lot more: - - * Receive phone notifications on your desktop and reply to messages - * Use your phone as a remote control for your desktop - * Share files and links between devices - * Check your phone’s battery level from the desktop - * Ring your phone to help find it - - - -### Setting up the GSConnect extension - -Setting up GSConnect requires installing two components: the GSConnect extension on your desktop and the KDE Connect app on your Android device. - -First, install the GSConnect extension from the GNOME Shell extensions website: [GSConnect][2]. (Fedora Magazine has a handy article on [How to install a GNOME Shell extension][3] to help you with this step.) - -The KDE Connect app is available on Google’s [Play Store][4]. It’s also available on the FOSS Android apps repository, [F-Droid][5]. - -Once you have installed both these components, you can pair your two devices. Installing the extension makes it show up in your system menu as _Mobile Devices_. Clicking on it displays a drop down menu, from which you can access _Mobile Settings_. - -![][6] - -Here’s where you can view your paired devices and manage the features offered by GSConnect. Once you are on this screen, launch the app on your Android device. - -You can initiate pairing from either device, but here you’ll be connecting to your desktop from the Android device. Simply hit refresh on the app, and as long as both devices are on the same wireless network, your desktop shows up in your Android device. You can now send a pair request to the desktop. Accept the pair request on your desktop to complete the pairing. - -![][7] - -### Using GSConnect - -Once paired, you’ll need to grant permissions on your Android device to make use of the many features available on GSConnect. Click on the paired device in the list of devices to see all available functions and enable or disable them according to your preferences. - -![][8] - -Remember that you’ll also need to grant corresponding permissions in the Android app to be able to use these functions. Depending upon the features you’ve enabled and the permissions you’ve granted, you can now access your mobile contacts on your desktop, get notified of messages and reply to them, and even sync the desktop and Android device clipboards. - -### Integration with Files and your web browsers - -GSConnect allows you to directly send files to your Android device from your desktop file explorer’s context menu. - -On Fedora’s default GNOME desktop, you will need to install the _nautilus-python_ package in order to make your paired devices show up in the context menu. Installing this is as straightforward as running the following command from your preferred terminal: - -``` -$ sudo dnf install nautilus-python -``` - -Once done, the _Send to Mobile Device_ entry appears in the context menu of the Files app. - -![][9] - -Similarly, install the corresponding WebExtension for your browser, be it [Firefox][10] or [Chrome][11], to send links to your Android device. You have the option to send the link to launch directly in your browser or to deliver it as SMS. - -### Running Commands - -GSConnect lets you define commands which you can then run on your desktop, from your remote device. This allows you to do things such as take a screenshot of your desktop, or lock and unlock your desktop from your Android device, remotely. - -![][12] - -To make use of this feature, you can use standard shell commands and the CLI exposed by GSConnect. Documentation on this is provided in the project’s GitHub repository: _CLI Scripting_. - -The [KDE UserBase Wiki][13] has a list of example commands. These examples cover controlling the brightness and volume on your desktop, locking the mouse and keyboard, and even changing the desktop theme. Some of the commands are specific for KDE Plasma, and modifications are necessary to make it run on the GNOME desktop. - -### Explore and have fun - -GSConnect makes it possible to enjoy a great degree of convenience and comfort. Dive into the preferences to see all that you can do and get creative with the commands function. Feel free to share all the possibilities this utility unlocked in your workflow in the comments below. - -* * * - -_Photo by [Pathum Danthanarayana][14] on [Unsplash][15]._ - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/ - -作者:[Lokesh Krishna][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/lowkeyskywalker/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/12/gsconnect-816x345.jpg -[2]: https://extensions.gnome.org/extension/1319/gsconnect/ -[3]: https://fedoramagazine.org/install-gnome-shell-extension/ -[4]: https://play.google.com/store/apps/details?id=org.kde.kdeconnect_tp -[5]: https://f-droid.org/en/packages/org.kde.kdeconnect_tp/ -[6]: https://fedoramagazine.org/wp-content/uploads/2020/01/within-the-menu-1024x576.png -[7]: https://fedoramagazine.org/wp-content/uploads/2020/01/pair-request-1024x576.png -[8]: https://fedoramagazine.org/wp-content/uploads/2020/01/permissions-1024x576.png -[9]: https://fedoramagazine.org/wp-content/uploads/2020/01/send-to-mobile-2-1024x576.png -[10]: https://addons.mozilla.org/en-US/firefox/addon/gsconnect/ -[11]: https://chrome.google.com/webstore/detail/gsconnect/jfnifeihccihocjbfcfhicmmgpjicaec -[12]: https://fedoramagazine.org/wp-content/uploads/2020/01/commands-1024x576.png -[13]: https://userbase.kde.org/KDE_Connect/Tutorials/Useful_commands -[14]: https://unsplash.com/@pathum_danthanarayana?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[15]: https://unsplash.com/s/photos/android?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/translated/tech/20191227 Top CI-CD resources to set you up for success.md b/translated/tech/20191227 Top CI-CD resources to set you up for success.md deleted file mode 100644 index 102e53d153..0000000000 --- a/translated/tech/20191227 Top CI-CD resources to set you up for success.md +++ /dev/null @@ -1,64 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Morisun029) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Top CI/CD resources to set you up for success) -[#]: via: (https://opensource.com/article/19/12/cicd-resources) -[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) - -顶级 CI / CD 资源,助您成功 -====== -随着企业期望实现无缝,灵活和可扩展的部署,持续集成和持续部署成为2019年的关键主题。 -![Plumbing tubes in many directions][1] - -对于 CI / CD 和 DevOps 来说,2019年是非常棒的一年。 Opensource 公司的作者分享了他们专注于无缝,灵活和可扩展部署时是如何朝着敏捷方向发展的。以下是我们2019年发布的 CI / CD 文章中的一些重要主题。 - -### 学习和提高您的 CI / CD 技能 - - -我们最喜欢的一些文章集中在 CI / CD 的实操经验上,并涵盖了许多方面。通常以[Jenkins][2]管道开始,布莱恩特的文章[用 Jenkins 构建 CI/CD 管道][4]将为您提供足够的经验,以开始构建您的第一个管道。丹尼尔在 [用DevOps 管道进行自动验收测试][4]一文中,提供了有关验收测试的重要信息,包括可用于独立测试的各种 CI / CD 应用程序。我写的[安全扫描DevOps 管道][5]非常简短,其中的关键点是关于如何使用 Jenkins 平台在管道中设置安全性的教程。 - -### 交付工作流程 - - -威利•彼得•绍布赞扬为所有产品创建统一流水线的想法,以使[每种产品在一个CI / CD 流水线中持续建立起来,以管控所有产品][8]。这些文章将使您更好地了解团队成员加入工作流流程后会发生什么。 - -### CI / CD 如何影响企业 - - -2019年也是认识到 CI / CD 的业务影响以及它如何影响日常运营的一年。 - - - -Agnieszka Gancarczyk 分享了Red Hat[小型Scrum vs.大型Scrum][9] 的调查结果, 包括受访者对srums, - -敏捷运动及其对团队的影响的不同看法。威尔安•凯丽 的[持续部署如何影响企业][10], 包括开放式沟通的重要性,丹尼尔也强调了[DevOps 团队在3 种类型的指表板][11]中指标和可观测性的重要性。最后是安•玛丽•弗雷德的精彩文章: [不要在生产环境中测试?在生产环境中测试!][12] 详细说明了验收测试前在生产环境中测试的重要性。 - -感谢许多贡献者在2019年与 Opensource 的读者分享他们的见解,我期望在2020年里从他们那里了解更多有关 CI / CD 发展的信息。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/cicd-resources - -作者:[Jessica Cherry][a] -选题:[lujun9972][b] -译者:[Morisun029](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jrepka -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions) -[2]: https://jenkins.io/ -[3]: https://opensource.com/article/19/9/intro-building-cicd-pipelines-jenkins -[4]: https://opensource.com/article/19/4/devops-pipeline-acceptance-testing -[5]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline -[6]: https://opensource.com/article/19/3/screwdriver-cicd -[7]: https://opensource.com/article/19/8/why-spinnaker-matters-cicd -[8]: https://opensource.com/article/19/7/cicd-pipeline-rule-them-all -[9]: https://opensource.com/article/19/3/small-scale-scrum-vs-large-scale-scrum -[10]: https://opensource.com/article/19/7/organizational-impact-continuous-deployment -[11]: https://opensource.com/article/19/7/dashboards-devops-teams -[12]: https://opensource.com/article/19/5/dont-test-production diff --git a/translated/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md b/translated/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md deleted file mode 100644 index e4b2282535..0000000000 --- a/translated/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Get your RSS feeds and podcasts in one place with this open source tool) -[#]: via: (https://opensource.com/article/20/1/open-source-rss-feed-reader) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -使用此开源工具将你的RSS 订阅源和播客放在一起 -====== -在我们的 20 个使用开源提升生产力的系列的第十二篇文章中使用 Newsboat 跟上你的新闻 RSS 源和播客。 -![Ship captain sailing the Kubernetes seas][1] - -去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 - -### 使用 Newsboat 访问你的 RSS 源和播客 - -RSS 新闻源是了解各个网站最新消息的非常方便的方法。除了 Opensource.com,我还会关注 [SysAdvent][2] 年度 sysadmin 工具,还有一些我最喜欢的作者以及一些网络漫画。RSS 阅读器可以让我“批处理”阅读内容,因此,我每天不会在不同的网站上花费很多时间。 - -![Newsboat][3] - -[Newsboat][4] 是一个基于终端的 RSS 订阅源阅读器,外观感觉很像电子邮件程序 [Mutt][5]。它使阅读新闻变得容易,并有许多不错的功能。 - -安装 Newsboat 非常容易,因为它包含在大多数发行版(以及 MacOS 上的 Homebrew)中。安装后,只需在 **~/.newsboat/urls** 中添加订阅源。如果你是从其他阅读器迁移而来,并有导出的 OPML 文件,那么可以使用以下方式导入: - - -``` -`newsboat -i ` -``` - -添加订阅源后,Newsboat 的界面非常熟悉,特别是如果你使用过 Mutt。你可以使用箭头键上下滚动,使用 **r** 检查某个源中是否有新项目,使用 **R** 检查所有源中是否有新项目,按**回车**打开订阅源,并选择要阅读的文章。 - -![Newsboat article list][6] - -但是,你不仅限于本地 URL 列表。Newsboat 还是 [Tiny Tiny RSS][7]、ownCloud 和 Nextcloud News 等新闻阅读服务以及一些 Google Reader 后续产品的客户端。[Newsboat 的文档][8]中涵盖了有关此的详细信息以及其他许多配置选项。 - -![Reading an article in Newsboat][9] - -#### 播客 - -Newsboat 还通过 Podboat 提供了[播客支持][10],podboat 是一个附带的应用,它可帮助下载和排队播客节目。在 Newsboat 中查看播客源时,按下 **e** 将节目添加到你的下载队列中。所有信息将保存在 **~/.newsboat** 目录中的队列文件中。Podboat 读取此队列并将节目下载到本地磁盘。你可以在 Podboat 的用户界面(外观和行为类似于 Newsboat)执行此操作,也可以使用 ** podboat -a ** 让 Podboat 下载所有内容。作为播客人和播客听众,我认为这_真的_很方便。 - -![Podboat][11] - -总体而言,Newsboat 有一些非常好的功能,并且是一些基于 Web 或桌面应用的不错的轻量级替代方案。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/open-source-rss-feed-reader - -作者:[Kevin Sonney][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/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) -[2]: https://sysadvent.blogspot.com/ -[3]: https://opensource.com/sites/default/files/uploads/productivity_12-1.png (Newsboat) -[4]: https://newsboat.org -[5]: http://mutt.org/ -[6]: https://opensource.com/sites/default/files/uploads/productivity_12-2.png (Newsboat article list) -[7]: https://tt-rss.org/ -[8]: https://newsboat.org/releases/2.18/docs/newsboat.html -[9]: https://opensource.com/sites/default/files/uploads/productivity_12-3.png (Reading an article in Newsboat) -[10]: https://newsboat.org/releases/2.18/docs/newsboat.html#_podcast_support -[11]: https://opensource.com/sites/default/files/uploads/productivity_12-4.png (Podboat) From 8c0e4f16699a3d8ca56646b5fe50a6c602c98c08 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Thu, 13 Feb 2020 00:03:08 +0800 Subject: [PATCH 014/315] add file --- ...-CD resources to set you up for success.md | 57 +++++++++ ...in one place with this open source tool.md | 72 +++++++++++ ... vs. proprietary- What-s the difference.md | 72 +++++++++++ ...ra to your Android phone with GSConnect.md | 118 ++++++++++++++++++ 4 files changed, 319 insertions(+) create mode 100644 sources/tech/20191227 Top CI-CD resources to set you up for success.md create mode 100644 sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md create mode 100644 sources/tech/20200209 Open source vs. proprietary- What-s the difference.md create mode 100644 translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md diff --git a/sources/tech/20191227 Top CI-CD resources to set you up for success.md b/sources/tech/20191227 Top CI-CD resources to set you up for success.md new file mode 100644 index 0000000000..7c4d0db4db --- /dev/null +++ b/sources/tech/20191227 Top CI-CD resources to set you up for success.md @@ -0,0 +1,57 @@ +[#]: collector: (lujun9972) +[#]: translator: (Morisun029) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11875-1.html) +[#]: subject: (Top CI/CD resources to set you up for success) +[#]: via: (https://opensource.com/article/19/12/cicd-resources) +[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) + +顶级 CI / CD 资源,助你成功 +====== + +> 随着企业期望实现无缝、灵活和可扩展的部署,持续集成和持续部署成为 2019 年的关键主题。 + +![Plumbing tubes in many directions][1] + +对于 CI/CD 和 DevOps 来说,2019 年是非常棒的一年。Opensource.com 的作者分享了他们专注于无缝、灵活和可扩展部署时是如何朝着敏捷和 scrum 方向发展的。以下是我们 2019 年发布的 CI/CD 文章中的一些重要文章。 + +### 学习和提高你的 CI/CD 技能 + +我们最喜欢的一些文章集中在 CI/CD 的实操经验上,并涵盖了许多方面。通常以 [Jenkins][2] 管道开始,Bryant Son 的文章《[用 Jenkins 构建 CI/CD 管道][3]》将为你提供足够的经验,以开始构建你的第一个管道。Daniel Oh 在《[用 DevOps 管道进行自动验收测试][4]》一文中,提供了有关验收测试的重要信息,包括可用于自行测试的各种 CI/CD 应用程序。我写的《[安全扫描 DevOps 管道][5]》非常简短,其中简要介绍了如何使用 Jenkins 平台在管道中设置安全性。 + +### 交付工作流程 + +正如 Jithin Emmanuel 在《[Screwdriver:一个用于持续交付的可扩展构建平台][6]》中分享的,在学习如何使用和提高你的 CI/CD 技能方面,工作流程很重要,特别是当涉及到管道时。Emily Burns 在《[为什么 Spinnaker 对 CI/CD 很重要][7]》中解释了灵活地使用 CI/CD 工作流程准确构建所需内容的原因。Willy-Peter Schaub 还盛赞了为所有产品创建统一管道的想法,以便《[在一个 CI/CD 管道中一致地构建每个产品][8]》。这些文章将让你很好地了解在团队成员加入工作流程后会发生什么情况。 + +### CI/CD 如何影响企业 + +2019 年也是认识到 CI/CD 的业务影响以及它是如何影响日常运营的一年。Agnieszka Gancarczyk 分享了 Red Hat 《[小型 Scrum vs. 大型 Scrum][9]》的调查结果, 包括受访者对 Scrum、敏捷运动及对团队的影响的不同看法。Will Kelly 的《[持续部署如何影响整个组织][10]》,也提及了开放式沟通的重要性。Daniel Oh 也在《[DevOps 团队必备的 3 种指标仪表板][11]》中强调了指标和可观测性的重要性。最后是 Ann Marie Fred 的精彩文章《[不在生产环境中测试?要在生产环境中测试!][12]》详细说明了在验收测试前在生产环境中测试的重要性。 + +感谢许多贡献者在 2019 年与 Opensource 的读者分享他们的见解,我期望在 2020 年里从他们那里了解更多有关 CI/CD 发展的信息。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/cicd-resources + +作者:[Jessica Cherry][a] +选题:[lujun9972][b] +译者:[Morisun029](https://github.com/Morisun029) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jrepka +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions) +[2]: https://jenkins.io/ +[3]: https://linux.cn/article-11546-1.html +[4]: https://opensource.com/article/19/4/devops-pipeline-acceptance-testing +[5]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline +[6]: https://opensource.com/article/19/3/screwdriver-cicd +[7]: https://opensource.com/article/19/8/why-spinnaker-matters-cicd +[8]: https://opensource.com/article/19/7/cicd-pipeline-rule-them-all +[9]: https://opensource.com/article/19/3/small-scale-scrum-vs-large-scale-scrum +[10]: https://opensource.com/article/19/7/organizational-impact-continuous-deployment +[11]: https://linux.cn/article-11183-1.html +[12]: https://opensource.com/article/19/5/dont-test-production \ No newline at end of file diff --git a/sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md b/sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md new file mode 100644 index 0000000000..7ff7ca5e30 --- /dev/null +++ b/sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open source vs. proprietary: What's the difference?) +[#]: via: (https://opensource.com/article/20/2/open-source-vs-proprietary) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Open source vs. proprietary: What's the difference? +====== +Need four good reasons to tell your friends to use open source? Here's +how to make your case. +![Doodles of the word open][1] + +There's a lot to be learned from open source projects. After all, managing hundreds of disparate, asynchronous commits and bugs doesn't happen by accident. Someone or something has to coordinate releases, and keep all the code and project roadmaps organized. It's a lot like life. You have lots of tasks demanding your attention, and you have to tend to each in turn. To ensure everything gets done before its deadline, you try to stay organized and focused. + +Fortunately, there are [applications out there][2] designed to help with that sort of thing, and many apply just as well to real life as they do to software. + +Here are some reasons for choosing [open tools][3] when improving personal or project-based organization. + +### Data ownership + +It's rarely profitable for proprietary tools to provide you with [data][4] dumps. Some products, usually after a long battle with their users (and sometimes a lawsuit), provide ways to extract your data from them. But the real issue isn't whether a company lets you extract data; it's the fact that the capability to get to your data isn't guaranteed in the first place. It's your data, and when it's literally what you do each day, it is, in a way, your life. Nobody should have primary access to that but you, so why should you have to petition a company for a copy? + +Using an open source tool ensures you have priority access to your own activities. When you need a copy of something, you already have it. When you need to export it from one application to another, you have complete control of how the data is exchanged. If you need to export your schedule from a calendar into your kanban board, you can manipulate and process the data to fit. You don't have to wait for functionality to be added to the app, because you own the data, the database, and the app. + +### Working for yourself + +When you use open source tools, you often end up improving them, sometimes whether you know it or not. You may not (or you may!) download the source and hack on code, but you probably fall into a way of using the tool that works best for you. You optimize your interaction with the tool. The unique way you interact with your tooling creates a kind of meta-tool: you haven't changed the software, but you've adapted it and yourself in ways that the project author and a dozen other users never imagined. Everyone does this with whatever software they rely upon, and it's why sitting at someone else's computer to use a familiar software (or even just looking over someone's shoulder) often feels foreign, like you're using a different version of the application than you're used to. + +When you do this with proprietary software, you're either contributing to someone else's marketplace for free, or you're adjusting your own behavior based on forces outside your own control. When you optimize an open source tool, both the software and the interaction belong to you. + +### The right to not upgrade + +Tools change. It's the way of things. + +Change can be frustrating, but it can be crippling when a service changes so severely that it breaks your workflow. A proprietary service has and maintains every right to change its product, and you explicitly accept this by using the product. If your favorite accounting software or scheduling web app changes its interface or its output options, you usually have no recourse but to adapt or stop using the service. Proprietary services reserve the right to remove features, arbitrarily and without warning, and it's not uncommon for companies to start out with an open API and strong compatibility with open source, only to drop these conveniences once its customer base has reached critical mass. + +Open source changes, too. Changes in open source can be frustrating, too, and it can even drive users to alternative open source solutions. The difference is that when open source changes, you still own the unchanged code base. More importantly, lots of other people do too, and if there's enough desire for it, the project can be forked. There are several famous examples of this, but admittedly there are just as many examples where the demand was _not_ great enough, and users essentially had to adapt. + +Even so, users are never truly forced to do anything in open source. If you want to hack together an old version of your mission-critical service on an old distro running ancient libraries in a virtual machine, you can do that because you own the code. When a proprietary service changes, you have no choice but to follow. + +With open source, you can choose to forge your own path when necessary or follow the developers when convenient. + +### Open for collaboration + +Proprietary services can affect others in ways you may not realize. Closed source tools are accidentally insidious. If you use a proprietary product to manage your schedule or your recipes or your library, or you use a proprietary font in your graphic design or website, then the moment you need to coordinate with someone else, you are essentially forcing them to sign up for the same proprietary service because proprietary services usually require accounts. Of course, the same is sometimes true for an open source solution, but it's not common for open source products to collect and sell user data the way proprietary vendors do, so the stakes aren't quite the same. + +### Independence + +Ultimately, the open source advantage is one of independence for you and for those you want to collaborate with. Not everyone uses open source, and even if everyone did not everyone would use the exact same tool or the same assets, so there will always be some negotiation when sharing data. However, by keeping your data and projects open, you enable everyone (your future self included) to contribute. + +What steps do you take to ensure your work is open and accessible? Tell us in the comments! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/open-source-vs-proprietary + +作者:[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/EDUCATION_doodles.png?itok=W_0DOMM4 (Doodles of the word open) +[2]: https://opensource.com/article/20/1/open-source-productivity-tools +[3]: https://opensource.com/tags/tools +[4]: https://opensource.com/tags/analytics-and-metrics \ No newline at end of file diff --git a/sources/tech/20200209 Open source vs. proprietary- What-s the difference.md b/sources/tech/20200209 Open source vs. proprietary- What-s the difference.md new file mode 100644 index 0000000000..7ff7ca5e30 --- /dev/null +++ b/sources/tech/20200209 Open source vs. proprietary- What-s the difference.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open source vs. proprietary: What's the difference?) +[#]: via: (https://opensource.com/article/20/2/open-source-vs-proprietary) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Open source vs. proprietary: What's the difference? +====== +Need four good reasons to tell your friends to use open source? Here's +how to make your case. +![Doodles of the word open][1] + +There's a lot to be learned from open source projects. After all, managing hundreds of disparate, asynchronous commits and bugs doesn't happen by accident. Someone or something has to coordinate releases, and keep all the code and project roadmaps organized. It's a lot like life. You have lots of tasks demanding your attention, and you have to tend to each in turn. To ensure everything gets done before its deadline, you try to stay organized and focused. + +Fortunately, there are [applications out there][2] designed to help with that sort of thing, and many apply just as well to real life as they do to software. + +Here are some reasons for choosing [open tools][3] when improving personal or project-based organization. + +### Data ownership + +It's rarely profitable for proprietary tools to provide you with [data][4] dumps. Some products, usually after a long battle with their users (and sometimes a lawsuit), provide ways to extract your data from them. But the real issue isn't whether a company lets you extract data; it's the fact that the capability to get to your data isn't guaranteed in the first place. It's your data, and when it's literally what you do each day, it is, in a way, your life. Nobody should have primary access to that but you, so why should you have to petition a company for a copy? + +Using an open source tool ensures you have priority access to your own activities. When you need a copy of something, you already have it. When you need to export it from one application to another, you have complete control of how the data is exchanged. If you need to export your schedule from a calendar into your kanban board, you can manipulate and process the data to fit. You don't have to wait for functionality to be added to the app, because you own the data, the database, and the app. + +### Working for yourself + +When you use open source tools, you often end up improving them, sometimes whether you know it or not. You may not (or you may!) download the source and hack on code, but you probably fall into a way of using the tool that works best for you. You optimize your interaction with the tool. The unique way you interact with your tooling creates a kind of meta-tool: you haven't changed the software, but you've adapted it and yourself in ways that the project author and a dozen other users never imagined. Everyone does this with whatever software they rely upon, and it's why sitting at someone else's computer to use a familiar software (or even just looking over someone's shoulder) often feels foreign, like you're using a different version of the application than you're used to. + +When you do this with proprietary software, you're either contributing to someone else's marketplace for free, or you're adjusting your own behavior based on forces outside your own control. When you optimize an open source tool, both the software and the interaction belong to you. + +### The right to not upgrade + +Tools change. It's the way of things. + +Change can be frustrating, but it can be crippling when a service changes so severely that it breaks your workflow. A proprietary service has and maintains every right to change its product, and you explicitly accept this by using the product. If your favorite accounting software or scheduling web app changes its interface or its output options, you usually have no recourse but to adapt or stop using the service. Proprietary services reserve the right to remove features, arbitrarily and without warning, and it's not uncommon for companies to start out with an open API and strong compatibility with open source, only to drop these conveniences once its customer base has reached critical mass. + +Open source changes, too. Changes in open source can be frustrating, too, and it can even drive users to alternative open source solutions. The difference is that when open source changes, you still own the unchanged code base. More importantly, lots of other people do too, and if there's enough desire for it, the project can be forked. There are several famous examples of this, but admittedly there are just as many examples where the demand was _not_ great enough, and users essentially had to adapt. + +Even so, users are never truly forced to do anything in open source. If you want to hack together an old version of your mission-critical service on an old distro running ancient libraries in a virtual machine, you can do that because you own the code. When a proprietary service changes, you have no choice but to follow. + +With open source, you can choose to forge your own path when necessary or follow the developers when convenient. + +### Open for collaboration + +Proprietary services can affect others in ways you may not realize. Closed source tools are accidentally insidious. If you use a proprietary product to manage your schedule or your recipes or your library, or you use a proprietary font in your graphic design or website, then the moment you need to coordinate with someone else, you are essentially forcing them to sign up for the same proprietary service because proprietary services usually require accounts. Of course, the same is sometimes true for an open source solution, but it's not common for open source products to collect and sell user data the way proprietary vendors do, so the stakes aren't quite the same. + +### Independence + +Ultimately, the open source advantage is one of independence for you and for those you want to collaborate with. Not everyone uses open source, and even if everyone did not everyone would use the exact same tool or the same assets, so there will always be some negotiation when sharing data. However, by keeping your data and projects open, you enable everyone (your future self included) to contribute. + +What steps do you take to ensure your work is open and accessible? Tell us in the comments! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/open-source-vs-proprietary + +作者:[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/EDUCATION_doodles.png?itok=W_0DOMM4 (Doodles of the word open) +[2]: https://opensource.com/article/20/1/open-source-productivity-tools +[3]: https://opensource.com/tags/tools +[4]: https://opensource.com/tags/analytics-and-metrics \ No newline at end of file diff --git a/translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md b/translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md new file mode 100644 index 0000000000..c044d2c305 --- /dev/null +++ b/translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: (chai-yuan) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Connect Fedora to your Android phone with GSConnect) +[#]: via: (https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/) +[#]: author: (Lokesh Krishna https://fedoramagazine.org/author/lowkeyskywalker/) + +使用GSConnect将Android手机连接到Fedora系统 +====== + +![][1] + +苹果和微软公司都提供了集成好的与移动设备交互的应用。Fedora提供了类似的工具——**GSConnect**。它可以让你将你的安卓手机和你的Fedora桌面配对并使用。读下去,来了解更多关于它是什么以及它是如何工作的信息。 + +### GSConnect是什么? + +GSConnect是基于KDE Connect项目而为GNOME桌面定制的程序。KDE Connect使你的设备相互之间能够进行通信。但是,在Fedora的默认GNOME桌面上安装它需要安装大量的KDE依赖。 + +GSConnect基于KDE Connect实现,作为GNOME shell的拓展应用。一旦安装,GSConnect允许您执行以下操作: + + * 在电脑上接收电话通知并回复信息 + * 用手机操纵你的桌面 + * 在不同设备之间分享文件与链接 + * 在电脑上查看手机电量 + * 让手机响铃以便你能找到它 + + + +### 设置GSConnect扩展 + +设置GSConnect需要安装两款软件:电脑上的GSConnect扩展和Android设备上的KDE Connect应用。 + +首先,从GNOME Shell扩展网站[GSConnect][2]安装GSConnect扩展。(Fedora Magazine有一篇关于[如何安装GNOMEShell扩展名][3]的文章,可以帮助你完成这一步。) + +KDE Connect应用程序可以在Google的[Play Store][4]上找到。它也可以在FOSS Android应用程序库[F-Droid][5]上找到。 + +一旦安装了这两个组件,就可以配对两个设备。安装扩展后再系统菜单中显示“移动设备(Mobile Devices)”。单击它会出现一个下拉菜单,你可以从中访问“移动设置(Mobile Settings)”。 + +![][6] + +在这里,你可以用GSConnect查看并管理配对的设备。进入此界面后,需要在Android设备上启动应用程序。 + +配对的初始化可以再任意一台设备上进行,在这里我们从Android设备连接到电脑。点击应用程序上的刷新(refresh),只要两个设备都在同一个无线网络环境中,你的Android设备便可以搜索到你的电脑。现在可以向桌面发送配对请求,并在桌面上接受配对请求以完成配对。 + +![][7] + +### 使用 GSConnect + +配对后,你将需要授予对Android设备的权限,才能使用GSConnect上提供的许多功能。单击设备列表中的配对设备,便可以查看所有可用功能,并根据你的偏好和需要启用或禁用它们。 + +![][8] + +请记住,你还需要在Android应用程序中授予相应的权限才能使用这些功能。启用权限后,你现在可以访问桌面上的移动联系人,获得消息通知并回复消息,甚至同步桌面和Android设备剪贴板。 + +### 集成在文件系统与浏览器上 + +GSConnect允许你直接从桌面文件资源管理器向Android设备发送文件。 + +在Fedora的默认GNOME桌面上,你需要安装_nautilus-python_依赖包,以便在菜单中显示配对的设备。安装它只需要再终端中输入: + +``` +$ sudo dnf install nautilus-python +``` + +完成后,将在“文件(Files)”的菜单中显示“发送到移动设备(Send to Mobile Device)”选项。 + +![][9] + +同样,为你的浏览器安装相应的WebExtension,无论是[Firefox][10]还是[Chrome][11]浏览器,都可以将链接发送到你的Android设备。你可以选择直接在浏览器中发送要启动的链接,或将其作为短信息发送。 + +### 运行命令 + +GSConnect允许你定义命令,然后可以从远程设备在电脑上运行这些命令。这使得你可以远程截屏,或者从你的Android设备锁定和解锁你的桌面。 + +![][12] + +要使用此功能,可以使用标准shell命令和GSConnect公开的CLI。项目的GitHub存储库中提供了有关此操作的文档: _CLI Scripting_。 + +[KDE UserBase Wiki][13]有一个命令示例列表。这些例子包括控制桌面的亮度和音量,锁定鼠标和键盘,甚至更改桌面主题。其中一些命令是针对KDE Plasma设计的,需要进行修改才能在GNOME桌面上运行。 + +### 探索并享受乐趣 + +GSConnect使我们能够享受到极大的便利和舒适。深入研究首选项,查看你可以做的所有事情,灵活的使用这些命令功能。并在下面的评论中自由分享你解锁的新方式。 + +* * * + +_Photo by [Pathum Danthanarayana][14] on [Unsplash][15]._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/ + +作者:[Lokesh Krishna][a] +选题:[lujun9972][b] +译者:[chai-yuan](https://github.com/chai-yuan) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/lowkeyskywalker/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/12/gsconnect-816x345.jpg +[2]: https://extensions.gnome.org/extension/1319/gsconnect/ +[3]: https://fedoramagazine.org/install-gnome-shell-extension/ +[4]: https://play.google.com/store/apps/details?id=org.kde.kdeconnect_tp +[5]: https://f-droid.org/en/packages/org.kde.kdeconnect_tp/ +[6]: https://fedoramagazine.org/wp-content/uploads/2020/01/within-the-menu-1024x576.png +[7]: https://fedoramagazine.org/wp-content/uploads/2020/01/pair-request-1024x576.png +[8]: https://fedoramagazine.org/wp-content/uploads/2020/01/permissions-1024x576.png +[9]: https://fedoramagazine.org/wp-content/uploads/2020/01/send-to-mobile-2-1024x576.png +[10]: https://addons.mozilla.org/en-US/firefox/addon/gsconnect/ +[11]: https://chrome.google.com/webstore/detail/gsconnect/jfnifeihccihocjbfcfhicmmgpjicaec +[12]: https://fedoramagazine.org/wp-content/uploads/2020/01/commands-1024x576.png +[13]: https://userbase.kde.org/KDE_Connect/Tutorials/Useful_commands +[14]: https://unsplash.com/@pathum_danthanarayana?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[15]: https://unsplash.com/s/photos/android?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText \ No newline at end of file From 06bedea546737972387436593127ebd349c210ee Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 15 Feb 2020 01:10:11 +0800 Subject: [PATCH 015/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200214=20How=20?= =?UTF-8?q?to=20set=20up=20your=20own=20fast,=20private=20open=20source=20?= =?UTF-8?q?mesh=20network?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200214 How to set up your own fast, private open source mesh network.md --- ... fast, private open source mesh network.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/tech/20200214 How to set up your own fast, private open source mesh network.md diff --git a/sources/tech/20200214 How to set up your own fast, private open source mesh network.md b/sources/tech/20200214 How to set up your own fast, private open source mesh network.md new file mode 100644 index 0000000000..b68b57da3d --- /dev/null +++ b/sources/tech/20200214 How to set up your own fast, private open source mesh network.md @@ -0,0 +1,110 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to set up your own fast, private open source mesh network) +[#]: via: (https://opensource.com/article/20/2/mesh-network-freemesh) +[#]: author: (Spencer Thomason https://opensource.com/users/spencerthomason) + +How to set up your own fast, private open source mesh network +====== +FreeMesh is an affordable, performant, privacy-respecting mesh system +that installs in less than 10 minutes. +![people on top of a connected globe][1] + +The [FreeMesh][2] system promises to bring fully open source mesh networking to the masses. I recently had a chance to test it; it installed quickly, and the performance was great—especially for the price. + +### Why mesh and open source? + +The reason to use open source is simple: privacy. With FreeMesh, your data is your own. It doesn't track or collect data. Don't trust it? You can easily check—it's open source, after all! With some other popular mesh solutions, say those provided by very large tech conglomerates, would you trust them with your data? + +Another important factor: updates. FreeMesh says it is committed to pushing out security and performance updates regularly. What about 10 years from now? With an open source solution, you are free to update the product for as long as you want. + +So why mesh? In a mesh network, multiple wireless routers work together to broadcast a single, very large wireless network. Each router in a mesh network intelligently communicates with the other(s) to provide the best "path" for your data. The following images from FreeMesh's website highlight the difference between using a single wireless router and a mesh network. The red network represents a single wireless router, and the green is a mesh network. + +![Single-router network][3] | ![Mesh network][4] +---|--- + +### Get the equipment + +To get started with FreeMesh, [order a kit][5]. Two kits are available: standard and 4G LTE. + +The 4G LTE kit, as the name suggests, supports cellular data connections. This feature is a rarity in the consumer networking space, and it will be _very_ useful to some folks. You can set up a portable mesh network anywhere with power and cell service with full fast-failover capability. + +The FreeMesh kits come with a primary router and two nodes. The router and nodes use 802.11ac, 802.11r, and 802.11s standards. The included firmware runs a customized version of [OpenWrt][6], a Linux distro for embedded devices. + +The FreeMesh router has some really good specs: + + * **CPU:** Dual-core 880MHz MediaTek MT7621AT (two cores/four threads!) + * **RAM:** DDR3 512MB + * **Interfaces:** 1x GbE WAN, 4x GbE LAN, 1x USB 2.0 ports, 1x microSD card slot, 1x SIM slot + * **Antenna:** 2x 5dBi 2.4GHz, 2x 5dBi 5GHz, 2x 3dBi 3G/4G (built-in) + * **4G LTE modem:** LTE category 4 module, 150Mbps downlink and 50Mbps uplink + + + +### Setup + +Setup is easy, and FreeMesh's [README][7] offers simple instructions and diagrams. Start by setting up the primary router first. Then follow these simple steps: + + 1. Connect the first node (blue WAN port) to the primary router (yellow LAN port). +![FreeMesh setup step 1][8] + 2. Wait about 30 to 60 seconds. The node will flash its LEDs when the setup is complete. +![FreeMesh setup step 2][9] + 3. Move the node to another location. + + + +That's it! There is no manual setup required for the nodes; you simply plug them into the primary router, and it does the rest. You can add more nodes the same way; just repeat the steps above. + +### Features + +Out of the box, FreeMesh runs a combination of OpenWRT and LuCI. It has all the features you'd expect from a router. Want to install new features or packages? SSH in and start hacking! + +![Real-time load on FreeMesh network][10] + +![Overview of FreeMesh network][11] + +![OpenWrt status report][12] + +### Performance + +After setting up the FreeMesh system, I moved the nodes to various places around my house. I used [iPerf][13] to test the bandwidth and was getting around 150Mbps. WiFi can be affected by any number of environmental variables, so your mileage may vary. Distance between the nodes and the primary router also plays a large factor in bandwidth. + +However, the real advantage of a mesh network isn't its top-end speed but much better average speed across a space. Even at the far reaches of my home, I was still able to stream videos and work without interruption. I was even able to work in my backyard. I simply repositioned one of the nodes in front of a window before heading outside. + +### Conclusion + +FreeMesh is really compelling; it offers performance, privacy, and price, all in a simple, open source package. + +In my experience, setup is a breeze, and it is more than fast enough. The range is excellent and far exceeds any single-router setup. You are free to hack and customize your FreeMesh setup, but I didn't feel the need to. It has everything I need out of the box. + +If you are looking for an affordable, performant, privacy-respecting mesh system that installs in less than 10 minutes, you might want to consider FreeMesh. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/mesh-network-freemesh + +作者:[Spencer Thomason][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/spencerthomason +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-networking.png?itok=fHmulI9p (people on top of a connected globe) +[2]: https://freemeshwireless.com/ +[3]: https://opensource.com/sites/default/files/uploads/singlerouternetwork.png (Single-router network) +[4]: https://opensource.com/sites/default/files/uploads/meshnetwork.png (Mesh network) +[5]: https://freemeshwireless.com/#pricing +[6]: https://openwrt.org/ +[7]: https://gitlab.com/slthomason/freemesh/-/blob/master/README.md +[8]: https://opensource.com/sites/default/files/uploads/connecttorouter.png (FreeMesh setup step 1) +[9]: https://opensource.com/sites/default/files/uploads/setupcomplete.png (FreeMesh setup step 2) +[10]: https://opensource.com/sites/default/files/uploads/freemeshrealtimeload.png (Real-time load on FreeMesh network) +[11]: https://opensource.com/sites/default/files/uploads/freemeshwirelessoverview.png (Overview of FreeMesh network) +[12]: https://opensource.com/sites/default/files/uploads/openwrt.png (OpenWrt status report) +[13]: https://opensource.com/article/20/1/internet-speed-tests From 61b47efac9b8b15639e3fea9d981081bcefd8510 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 15 Feb 2020 01:10:47 +0800 Subject: [PATCH 016/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200213=20Why=20?= =?UTF-8?q?developers=20like=20to=20code=20at=20night?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200213 Why developers like to code at night.md --- ...13 Why developers like to code at night.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/tech/20200213 Why developers like to code at night.md diff --git a/sources/tech/20200213 Why developers like to code at night.md b/sources/tech/20200213 Why developers like to code at night.md new file mode 100644 index 0000000000..0e7e55fbe5 --- /dev/null +++ b/sources/tech/20200213 Why developers like to code at night.md @@ -0,0 +1,95 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why developers like to code at night) +[#]: via: (https://opensource.com/article/20/2/why-developers-code-night) +[#]: author: (Matt Shealy https://opensource.com/users/mshealy) + +Why developers like to code at night +====== +A nocturnal work schedule is the key to creativity and productivity for +many open source programmers. +![Person programming on a laptop on a building][1] + +If you ask most developers when they prefer to work, many will say their most productive hours are at night. This may be especially true for open source contributors who are contributing to projects outside of their day job (though hopefully within healthy limits to [avoid burnout][2]). + +Some like to start in the evening and work till the early hours while others get up super early—say, 4 a.m.—to get most of the programming work done before the daily grind kicks in. + +This work habit may make many developers seem like oddballs and misfits. However, there are quite a few reasons why so many programmers prefer to work during the odd hours: + +### The maker's schedule + +According to [Paul Graham][3], people who "produce stuff" tend to adhere to the maker's schedule—they prefer to use time in units of a half-day or longer. In fact, most [developers have the same preference][4]. + +For one thing, developers work on large abstract systems and need the mental space to process a model in its entirety. Having their schedules sliced into 15- or 30-minute chunks for emails, meetings, phone calls, and interruptions from co-workers is simply counterproductive. + +For another, it's often not possible to program effectively in units of an hour; that's barely enough time to wrap your head around the task at hand and get started. + +Programming is also adversely affected by context-switching. By working at night, developers can avoid as many distractions as possible. Without the constant barrage of interruptions, they can spend a few solid hours focusing on the task at hand and be as productive as possible. + +### The peaceful quiet + +With the background noise of various activities (e.g., office chatter, traffic on the street) mostly absent at night or in the early hours, many programmers experience a sense of relaxation. This allows them to be more creative and productive—especially when tackling mentally stimulating tasks such as coding. + +The solitude and peacefulness, plus knowing that they'll have a few uninterrupted hours, often take the stress and time pressure associated with a daytime work schedule off their shoulders, allowing them to produce higher quality work. + +Not to mention, there's nothing like indulging in your favorite midnight snacks when you have solved a thorny problem! + +### Communication + +Developers working on open source projects can have a different communication cadence than a programmer working in-house at a company. Most open source communication is done asynchronously through channels like mailing lists or GitHub comments. A lot of times, other programmers are in different countries and time zones, so communicating in real-time often requires developers to be night owls. + +### The sleepy brain + +This may sound counterintuitive, but as the day wears on, the brain gets tired enough so it can only focus on a single task. This essentially eliminates multitasking, which is a major hurdle to staying focused and productive. But with a sleepy brain, you can't afford not to stay focused! + +Also, many developers often make the most significant progress when they go to sleep thinking about the problem they're trying to solve. The subconscious mind goes to work, and the answers often come to them in the early hours when they're still half asleep. + +This is not surprising since [sleep boosts brain functions][5], helping us make sense of new information and think more creatively. When the solutions present themselves in the wee hours, these developers just get up and hit the ground running without missing a beat. + +### Flexible and creative thinking + +Many programmers experience an upswing in creativity at night. The prefrontal cortex, the part of the brain associated with the ability to concentrate, gets tired at the end of the day. This seems to clear the way for more flexible and creative thinking for some people. + +According to [Brant Hasler][6], assistant professor of psychiatry at the University of Pittsburgh School of Medicine, "with less of that top-down control and 'cognitive inhibition,' the brain might be freed up for more divergent thinking, allowing one to make new associations between different concepts more easily." Combined with the positive mood made possible by a more relaxed environment, developers can come up with innovative ideas more easily. + +Also, without distractions and having the space to concentrate for several hours, you can "get in the zone." This helps you better focus on a project and get in the flow without worrying about things happening around you. + +### Bright computer screens + +The sleep cycle of many programmers is delayed because they look at bright screens all day. The blue light from computer screens [disrupts our circadian rhythm][7] by delaying the release of sleep-inducing melatonin, increasing alertness, and resetting the body's internal clock to a later schedule. As a result, developers tend to go to bed later and later. + +### Influence from the past + +In the past, most developers worked at night out of necessity because shared servers didn't have the computing power to support programming work while everyone else in the company is using the servers during the day. Developers needed to wait until late at night to perform tasks that weren't feasible during the day, such as testing projects, running extensive code-compile-run-debug cycles, and deploying new codes. Even though servers are more powerful now and most can support the demand, the trend to work at night continues as part of the culture. + +### Final thoughts + +While there are many reasons why developers prefer to work at night, keep in mind that being a night owl doesn't mean you should skimp on sleep. Lack of sleep leads to stress and anxiety and, ultimately, burnout. + +Getting enough quality sleep is the key to maintaining good physical health and brain functions. For example, it helps you integrate new information, cement memories, think creatively, remove accumulated toxins, regulate your appetite, and prevent premature aging. + +No matter what your schedule is, make sure to give your brain the rest it needs so you can be on your game and as productive as possible—all day, every day! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/why-developers-code-night + +作者:[Matt Shealy][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/mshealy +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV (Person programming on a laptop on a building) +[2]: https://opensource.com/article/19/11/burnout-open-source-communities +[3]: http://www.paulgraham.com/makersschedule.html +[4]: https://www.chamberofcommerce.com/business-advice/software-development-trends-overtaking-the-market +[5]: https://amerisleep.com/blog/sleep-impacts-brain-health/ +[6]: https://www.vice.com/en_us/article/mb58a8/late-night-creativity-spike +[7]: https://www.sleepfoundation.org/articles/how-blue-light-affects-kids-sleep From 5af54c04c033049c00ccdc0aa8b6efb89859b87c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 15 Feb 2020 01:11:29 +0800 Subject: [PATCH 017/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200213=20Manage?= =?UTF-8?q?=20complex=20Git=20workspaces=20with=20Great=20Teeming=20Worksp?= =?UTF-8?q?aces?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md --- ...orkspaces with Great Teeming Workspaces.md | 1169 +++++++++++++++++ 1 file changed, 1169 insertions(+) create mode 100644 sources/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md diff --git a/sources/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md b/sources/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md new file mode 100644 index 0000000000..ef41241e35 --- /dev/null +++ b/sources/tech/20200213 Manage complex Git workspaces with Great Teeming Workspaces.md @@ -0,0 +1,1169 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manage complex Git workspaces with Great Teeming Workspaces) +[#]: via: (https://opensource.com/article/20/2/git-great-teeming-workspaces) +[#]: author: (Daniel Gryniewicz https://opensource.com/users/dang) + +Manage complex Git workspaces with Great Teeming Workspaces +====== +GTWS is a set of scripts that make it easy to have development +environments for different projects and different versions of a project. +![Coding on a computer][1] + +Great Teeming Workspaces ([GTWS][2]) is a complex workspace management package for Git that makes it easy to have development environments for different projects and different versions of a project. + +Somewhat like Python [venv][3], but for languages other than Python, GTWS handles workspaces for multiple versions of multiple projects. You can create, update, enter, and leave workspaces easily, and each project or version combination has (at most) one local origin that syncs to and from the upstream—all other workspaces update from the local origin. + +### Layout + + +``` +${GTWS_ORIGIN}/<project>/<repo>[/<version>] +${GTWS_BASE_SRCDIR}/<project>/<version>/<workspacename>/{<repo>[,<repo>...]} +``` + +Each level in the source tree (plus the homedir for globals) can contain a **.gtwsrc** file that maintains settings and Bash code relevant to that level. Each more specific level overrides the higher levels. + +### Setup + +Check out GTWS with: + + +``` +`git clone https://github.com/dang/gtws.git` +``` + +Set up your **${HOME}/.gtwsrc**. It should include **GTWS_ORIGIN** and optionally **GTWS_SETPROMPT**. + +Add the repo directory to your path: + + +``` +`export PATH="${PATH}:/path/to/gtws` +``` + +### Configuration + +Configuration is via cascading **.gtwsrc** files. It walks the real path down from the root, and each **.gtwsrc** file it finds is sourced in turn. More specific files override less specific files. + +Set the following in your top-level **~/.gtws/.gtwsrc**: + + * **GTWS_BASE_SRCDIR:** This is the base of all the projects' source trees. It defaults to **$HOME/src**. + * **GTWS_ORIGIN:** This sets the location of the origin Git trees. It defaults to **$HOME/origin**. + * **GTWS_SETPROMPT:** This is optional. If it's set, the shell prompt will have the workspace name in it. + * **GTWS_DEFAULT_PROJECT:** This is the project used when no project is given or known. If it is not given, projects must be specified on the command line. + * **GTWS_DEFAULT_PROJECT_VERSION:** This is the default version to check out. It defaults to **master**. + + + +Set the following at the project level of each project: + + * **GTWS_PROJECT:** The name (and base directory) of the project. + * **gtws_project_clone:** This function is used to clone a specific version of a project. If it is not defined, then it is assumed that the origin for the project contains a single directory per version, and that contains a set of Git repos to clone. + * **gtws_project_setup:** This optional function is called after all cloning is done and allows any additional setup necessary for the project, such as setting up workspaces in an IDE. + + + +Set this at the project version level: + + * **GTWS_PROJECT_VERSION:** This is the version of the project. It's used to pull from the origin correctly. In Git, this is likely the branch name. + + + +These things can go anywhere in the tree and can be overridden multiple times, if it makes sense: + + * **GTWS_PATH_EXTRA:** These are extra path elements to be added to the path inside the workspace. + * **GTWS_FILES_EXTRA:** These are extra files not under version control that should be copied into each checkout in the workspace. This includes things like **.git/info/exclude**, and each file is relative to the base of its repo. + + + +### Origin directories + +**GTWS_ORIGIN** (in most scripts) points to the pristine Git checkouts to pull from and push to. + +Layout of **${GTWS_ORIGIN}**: + + * **/<project>** + * This is the base for repos for a project. + * If **gtws_project_clone** is given, this can have any layout you desire. + * If **gtws_project_clone** is not given, this must contain a single subdirectory named **git** that contains a set of bare Git repos to clone. + + + +### Workflow example + +Suppose you have a project named **Foo** that has an upstream repository at **github.com/foo/foo.git**. This repo has a submodule named **bar** with an upstream at **github.com/bar/bar.git**. The Foo project does development in the master branch and uses stable version branches. + +Before you can use GTWS with Foo, first you must set up the directory structure. These examples assume you are using the default directory structure. + + * Set up your top level **.gtwsrc**: + * **cp ${GTWS_LOC}/examples/gtwsrc.top ~/.gtwsrc** + * Edit **~/.gtwsrc** and change as necessary. + * Create top-level directories: + * **mkdir -p ~/origin ~/src** + * Create and set up the project directory: + * **mkdir -p ~/src/foo** +**cp ${GTWS_LOC}/examples/gtwsrc.project ~/src/foo/.gtwsrc** + * Edit **~/src/foo/.gtwsrc** and change as necessary. + * Create and set up the master version directory: + * **mkdir -p ~/src/foo/master** +**cp ${GTWS_LOC}/examples/gtwsrc.version ~/src/foo/master/.gtwsrc** + * Edit **~/src/foo/master/.gtwsrc** and change as necessary. + * Go to the version directory and create a temporary workspace to set up the mirrors: + * **mkdir -p ~/src/foo/master/tmp** +**cd ~/src/foo/master/tmp +git clone --recurse-submodules git://github.com/foo/foo.git +cd foo +gtws-mirror -o ~/origin -p foo** + * This will create **~/origin/foo/git/foo.git** and **~/origin/foo/submodule/bar.git**. + * Future clones will clone from these origins rather than from upstream. + * This workspace can be deleted now. + + + +At this point, work can be done on the master branch of Foo. Suppose you want to fix a bug named **bug1234**. You can create a workspace for this work to keep it isolated from anything else you're working on, and then work within this workspace. + + * Go to the version directory, and create a new workspace: + * **cd ~/src/foo/master +mkws bug1234** + * This creates **bug1234/**, and inside it checks out Foo (and its submodule **bar**) and makes **build/foo** for building it. + * Enter the workspace. There are two ways to do this: + * **cd ~/src/foo/master/bug1234 +startws** +or +**cd ~/src/foo/master/** +**startws bug1234** + * This starts a subshell within the bug1234 workspace. This shell has the GTWS environment plus any environment you set up in your stacked **.gtwsrc** files. It also adds the base of the workspace to your CD path, so you can **cd** into relative paths from that base. + * At this point, you can do work on bug1234, build it, test it, and commit your changes. When you're ready to push to upstream, do this:  +**cd foo +wspush**  + * **wspush** will push the branch associated with your workspace—first to your local origin and then to the upstream. + * If upstream changes. you can sync your local checkout using:  +**git sync** + * This envokes the **git-sync** script in GTWS, which will update your checkout from the local origin. To update the local origin, use:  +**git sync -o**  + * This will update your local origin and submodules' mirrors, then use those to update your checkout. **git-sync** has other nice features. + * When you're done using the workspace, just exit the shell: +**exit** + * You can re-enter the workspace at any time and have multiple shells in the same workspace at the same time. + * When you're done with a workspace, you can remove it using the **rmws** command or just remove its directory tree.  + * There is a script named **tmws** that enters a workspace within tmux, creating a set of windows/panes that are fairly specific to my workflow.  Feel free to modify it to suit your needs. + + + +### The script + + +``` +#!/bin/bash +# Functions for gtws +# + +GTWS_LOC=$(readlink -f $(dirname "${BASH_SOURCE[0]}")) +export GTWS_LOC + +# if is_interactive; then echo "interactive" fi +# +# Check for an interactive shell +is_interactive() { +        case $- in +                *i*) +                        # Don't die in interactive shells +                        return 0 +                        ;; +                *) +                        return 1 +                        ;; +        esac +} + +# if can_die; then exit +# +# Check to see if it's legal to exit during die +can_die() { +        if (( BASH_SUBSHELL > 0 )); then +                debug_print "\t\tbaby shell; exiting" +                return 0 +        fi +        if ! is_interactive; then +                debug_print "\t\tNot interactive; exiting" +                return 0 +        fi +        debug_print "\t\tParent interactive; not exiting" +        return 1 +} + +# In a function: +# command || die "message" || return 1 +# Outside a function: +# command || die "message" +# +# Print a message and exit with failure +die() { +        echo -e "Failed: $1" >&2 +        if [ ! -z "$(declare -F | grep "GTWScleanup")" ]; then +                GTWScleanup +        fi +        if can_die; then +                exit 1 +        fi +        return 1 +} + +# Alternativess for using die properly to handle both interactive and script useage: +# +# Version 1: +# +#testfunc() { +#       command1 || die "${FUNCNAME}: command1 failed" || return 1 +#       command2 || die "${FUNCNAME}: command2 failed" || return 1 +#       command3 || die "${FUNCNAME}: command3 failed" || return 1 +#} +# +# Version 2: +# +#testfunc() { +#       ( +#               command1 || die "${FUNCNAME}: command1 failed" +#               command2 || die "${FUNCNAME}: command2 failed" +#               command3 || die "${FUNCNAME}: command3 failed" +#       ) +#       return $? +#} +# +# Optionally, the return can be replaced with this: +#       local val=$? +#       [[ "${val}" == "0" ]] || die +#       return ${val} +# This will cause the contaning script to abort + +# usage "You need to provide a frobnicator" +# +# Print a message and the usage for the current script and exit with failure. +usage() { +        local myusage; +        if [ -n "${USAGE}" ]; then +                myusage=${USAGE} +        else +                myusage="No usage given" +        fi +        local me; +        if [ -n "${ME}" ]; then +                me=${ME} +        else +                me=$(basename $0) +        fi +        if [ -n "$1" ]; then +                echo "$@" +        fi +        echo "" +        if [ -n "${DESCRIPTION}" ]; then +                echo -e "${me}: ${DESCRIPTION}" +                echo "" +        fi +        echo "Usage:" +        echo "${me} ${myusage}" +        if [ -n "${LONGUSAGE}" ]; then +                echo -e "${LONGUSAGE}" +        fi +        exit 1 +} + +# debug_print "Print debug information" +# +# Print debug information based on GTWS_VERBOSE +debug_print() { +        if [ -n "${GTWS_VERBOSE}" ]; then +                echo -e "${GTWS_INDENT}$@" >&2 +        fi +} + +# debug_trace_start +# +# Start tracing all commands +debug_trace_start() { +        if [ -n "${GTWS_VERBOSE}" ]; then +                set -x +        fi +} + +# debug_trace_stop +# +# Stop tracing all commands +debug_trace_stop() { +        set +x +} + +# cmd_exists ${cmd} +# +# Determine if a command exists on the system +function cmd_exists { +        which $1 > /dev/null 2>&1 +        if [ "$?" == "1" ]; then +                die "You don't have $1 installed, sorry" || return 1 +        fi +} + +# is_git_repo ${dir} +# +# return success if ${dir} is in a git repo, or failure otherwise +is_git_repo() { +        debug_print "is_git_repo $1" +        if [[ $1 == *:* ]]; then +                debug_print "    remote; assume good" +                return 0 +        elif [ ! -d "$1" ]; then +                debug_print "    fail: not dir" +                return 1 +        fi +        cd "$1" +        git rev-parse --git-dir >/dev/null 2>&1 +        local ret=$? +        cd - > /dev/null +        debug_print "    retval: $ret" +        return $ret +} + +# find_git_repo ${basedir} ${repo_name} repo_dir +# +# Find the git repo for ${repo_name} in ${basedir}.  It's one of ${repo_name} +# or ${repo_name}.git +# +# Result will be in the local variable repo_dir  Or: +# +# repo_dir=$(find_git_repo ${basedir} ${repo_name}) +# +function find_git_repo { +        local basedir=$1 +        local repo_name=$2 +        local __resultvar=$3 +        local try="${basedir}/${repo_name}" + +        if ! is_git_repo "${try}" ; then +                try=${try}.git +        fi + +        is_git_repo "${try}" || die "${repo_name} in ${basedir} is not a git repository" || return 1 + +        if [[ "$__resultvar" ]]; then +                eval $__resultvar="'$try'" +        else +                echo "$try" +        fi +} + +# git_top_dir top +# +# Get the top level of the git repo contaning PWD, or return failure; +# +# Result will be in local variable top  Or: +# +# top = $(git_top_dir) +# +# Result will be in local variable top +function git_top_dir { +        local  __resultvar=$1 +        local __top="$(git rev-parse --show-toplevel 2>/dev/null)" + +        if [ -z "${__top}" ]; then +                die "${PWD} is not a git repo" || return 1 +        fi +        if [[ "$__resultvar" ]]; then +                eval $__resultvar="'$__top'" +        else +                echo "$__top" +        fi +} + +# is_git_rebase +# +# return success if git repo is in a rebase +is_git_rebase() { +        debug_print "is_git_rebase $1" +        (test -d "$(git rev-parse --git-path rebase-merge)" || \ +                test -d "$(git rev-parse --git-path rebase-apply)" ) +        local ret=$? +        debug_print "    retval: $ret" +        return $ret +} + +# is_docker +# +# return success if process is running inside docker +is_docker() { +        debug_print "is_docker" +        grep -q docker /proc/self/cgroup +        return $? +} + +# is_gtws +# +# return success if process is running inside a workspace +is_gtws() { +        if [ -n "${GTWS_WS_GUARD}" ]; then +                return 0 +        fi +        return 1 +} + +function gtws_rcp { +        rsync --rsh=ssh -avzS --progress --ignore-missing-args --quiet "$@" +} + +function gtws_cpdot { +        local srcdir=$1 +        local dstdir=$2 + +        debug_print "${FUNCNAME} - ${srcdir} to ${dstdir}" +        if [ -d "${srcdir}" ] && [ -d "${dstdir}" ]; then +                shopt -s dotglob +                cp -a "${srcdir}"/* "${dstdir}"/ +                shopt -u dotglob +        fi +} + +# gtws_find_dockerfile dockerfile +# +# Result will be in local variable dockerfile  Or: +# +# dockerfile = $(gtws_find_dockerfile) +# +# Result will be in local variable dockerfile +# +# Get the path to the most-specific Dockerfile +function gtws_find_dockerfile { +        local  __resultvar=$1 +        local __dir="${GTWS_WSPATH}" +        local __file="Dockerfile" + +        debug_print "${FUNCNAME} - trying ${__dir}/${__file}" +        if [ ! -f "${__dir}/${__file}" ]; then +                # Version dir +                __dir=$(dirname "${__dir}") +                debug_print "${FUNCNAME} - trying ${__dir}/${__file}" +        fi +        if [ ! -f "${__dir}/${__file}" ]; then +                # Project dir +                __dir=$(dirname "${__dir}") +                debug_print "${FUNCNAME} - trying ${__dir}/${__file}" +        fi +        if [ ! -f "${__dir}/${__file}" ]; then +                # Top level, flavor +                __dir="${GTWS_LOC}/dockerfiles" +                __file="Dockerfile-${FLAVOR}" +                debug_print "${FUNCNAME} - trying ${__dir}/${__file}" +        fi +        if [ ! -f "${__dir}/${__file}" ]; then +                # Top level, base +                __dir="${GTWS_LOC}/dockerfiles" +                __file="Dockerfile-base" +                debug_print "${FUNCNAME} - trying ${__dir}/${__file}" +        fi +        if [ ! -f "${__dir}/${__file}" ]; then +                die "Could not find a Dockerfile" || return 1 +        fi + +        debug_print "${FUNCNAME} - found ${__dir}/${__file}" +        if [[ "$__resultvar" ]]; then +                eval $__resultvar="'${__dir}/${__file}'" +        else +                echo "$__dir" +        fi +} + +# gtws_smopvn ${GTWS_SUBMODULE_ORIGIN:-${GTWS_ORIGIN}} ${GTWS_PROJECT} ${GTWS_PROJECT_VERSION} ${GTWS_WSNAME} smopvn +# +# Result will be in local variable smopvn.  Or: +# +# smopvn = $(gtws_smopvn ${GTWS_SUBMODULE_ORIGIN:-${GTWS_ORIGIN}} ${GTWS_PROJECT} ${GTWS_PROJECT_VERSION} ${GTWS_WSNAME}) +# +# Result will be in local variable smovpn +# +# Get the path to submodules for this workspace +function gtws_smopvn { +        local origin=$1 +        local project=$2 +        local version=$3 +        local name=$4 +        local  __resultvar=$5 +        local __smopv="${origin}/${project}/submodule" + +        if [[ "$__resultvar" ]]; then +                eval $__resultvar="'$__smopv'" +        else +                echo "$__smopv" +        fi +} + +# gtws_opvn ${GTWS_ORIGIN} ${GTWS_PROJECT} ${GTWS_PROJECT_VERSION} ${GTWS_WSNAME} opvn +# +# Result will be in local variable opvn.  Or: +# +# opvn = $(gtws_opvn ${GTWS_ORIGIN} ${GTWS_PROJECT} ${GTWS_PROJECT_VERSION} ${GTWS_WSNAME}) +# +# Result will be in local variable opvn. +# +# Get the path to git repos for this workspace +function gtws_opvn { +        local origin=$1 +        local project=$2 +        local version=$3 +        local name=$4 +        local  __resultvar=$5 +        local __opv="${origin}/${project}/${version}" + +        if [[ $__opv == *:* ]]; then +                __opv="${__opv}/${name}" +                debug_print "remote; using opvn $__opv" +        elif [ ! -d "${__opv}" ]; then +                __opv="${origin}/${project}/git" +                if [ ! -d "${__opv}" ]; then +                        die "No opvn for ${origin} ${project} ${version}" || return 1 +                fi +        fi +        if [[ "$__resultvar" ]]; then +                eval $__resultvar="'$__opv'" +        else +                echo "$__opv" +        fi +} + +# gtws_submodule_url ${submodule} url +# +# Result will be in local variable url  Or: +# +# url = $(gtws_submodule_url ${submodule}) +# +# Result will be in local variable url +# +# Get the URL for a submodule +function gtws_submodule_url { +        local sub=$1 +        local  __resultvar=$2 +        local __url=$(git config --list | grep "submodule.*url" | grep "\<${sub}\>" | cut -d = -f 2) + +        if [ -z "${__url}" ]; then +                local rpath=${PWD} +                local subsub=$(basename "${sub}") +                cd "$(dirname "${sub}")" +                debug_print "${FUNCNAME} trying ${PWD}" +                __url=$(git config --list | grep submodule | grep "\<${subsub}\>" | cut -d = -f 2) +                cd "${rpath}" +        fi + +        debug_print "${FUNCNAME} $sub url: $__url" +        if [[ "$__resultvar" ]]; then +                eval $__resultvar="'$__url'" +        else +                echo "$__url" +        fi +} + +# gtws_submodule_mirror ${smopv} ${submodule} ${sub_sub_basename} mloc +# +# Result will be in local variable mloc  Or: +# +# mloc = $(gtws_submodule_mirror ${smopv} ${submodule} ${sub_sub_basename}) +# +# Result will be in local variable mloc +# +# Get the path to a local mirror of the submodule, if it exists +function gtws_submodule_mirror { +        local smopv=$1 +        local sub=$2 +        local sub_sub=$3 +        local  __resultvar=$4 +        local __mloc="" +        local url=$(gtws_submodule_url ${sub}) +        if [ -n "${url}" ]; then +                local urlbase=$(basename ${url}) +                # XXX TODO - handle remote repositories +                #if [[ ${smopv} == *:* ]]; then +                ## Remote SMOPV means clone from that checkout; I don't cm +                #refopt="--reference ${smopv}/${name}/${sub}" +                if [ -d "${smopv}/${urlbase}" ]; then +                        __mloc="${smopv}/${urlbase}" +                fi +        fi + +        if [[ "$__resultvar" ]]; then +                eval $__resultvar="'$__mloc'" +        else +                echo "$__mloc" +        fi +} + +# gtws_submodule_paths subpaths +# +# Result will be in local variable subpaths  Or: +# +# subpaths = $(gtws_submodule_paths) +# +# Result will be in local variable subpaths +# +# Get the paths to submodules in a get repo.  Does not recurse +function gtws_submodule_paths { +        local  __resultvar=$1 +        local __subpaths=$(git submodule status | sed 's/^ *//' | cut -d ' ' -f 2) + +        if [[ "$__resultvar" ]]; then +                eval $__resultvar="'$__subpaths'" +        else +                echo "$__subpaths" +        fi +} + +# gtws_submodule_clone [<base-submodule-path>] [<sub-sub-basename>] +# +# This will set up all the submodules in a repo.  Should be called from inside +# the parent repo +function gtws_submodule_clone { +        local smopv=$1 +        local sub_sub=$2 +        local sub_paths=$(gtws_submodule_paths) +        local rpath="${PWD}" + +        if [ -z "${smopv}" ]; then +                smopv=$(gtws_smopvn "${GTWS_SUBMODULE_ORIGIN:-${GTWS_ORIGIN}}" "${GTWS_PROJECT}" "${GTWS_PROJECT_VERSION}" "${GTWS_WSNAME}") +        fi +        git submodule init || die "${FUNCNAME}: Failed to init submodules" || return 1 +        for sub in ${sub_paths}; do +                local refopt="" +                local mirror=$(gtws_submodule_mirror "${smopv}" "${sub}" "${sub_sub}") +                debug_print "${FUNCNAME} mirror: ${mirror}" +                if [ -n "${mirror}" ]; then +                        refopt="--reference ${mirror}" +                fi +                git submodule update ${refopt} "${sub}" +                # Now see if there are recursive submodules +                cd "${sub}" +                gtws_submodule_clone "${smopv}/${sub}_submodule" "${sub}" || return 1 +                cd "${rpath}" +        done +} + +# gtws_repo_clone <base-repo-path> <repo> <branch> [<base-submodule-path>] [<target-directory>] +function gtws_repo_clone { +        local baserpath=${1%/} +        local repo=$2 +        local branch=$3 +        local basesmpath=$4 +        local rname=${5:-${repo%.git}} +        local rpath="${baserpath}/${repo}" +        local origpath=${PWD} + +        if [[ ${rpath} != *:* ]]; then +                if [ ! -d "${rpath}" ]; then +                        rpath="${rpath}.git" +                fi +        fi +        if [ -z "${basesmpath}" ]; then +                basesmpath="${baserpath}" +        fi +        debug_print "${FUNCNAME}: cloning ${baserpath} - ${repo} : ${branch} into ${GTWS_WSNAME}/${rname} submodules: ${basesmpath}" + +        # Main repo +        #git clone --recurse-submodules -b "${branch}" "${rpath}" || die "failed to clone ${rpath}:${branch}" || return 1 +        git clone -b "${branch}" "${rpath}" ${rname} || die "${FUNCNAME}: failed to clone ${rpath}:${branch}" || return 1 + +        # Update submodules +        cd "${rname}" || die "${FUNCNAME}: failed to cd to ${rpath}" || return 1 +        gtws_submodule_clone "${basesmpath}" || return 1 +        cd "${origpath}" || die "${FUNCNAME}: Failed to cd to ${origpath}" || return 1 + +        # Copy per-repo settings, if they exist +        gtws_cpdot "${baserpath%/git}/extra/repo/${rname}" "${origpath}/${rname}" + +        # Extra files +        for i in ${GTWS_FILES_EXTRA}; do +                local esrc= + +                IFS=':' read -ra ARR <<< "$i" +                if [ -n "${ARR[1]}" ]; then +                        dst="${rname}/${ARR[1]}" +                else +                        dst="${rname}/${ARR[0]}" +                fi + +                if [ -n "${GTWS_REMOTE_IS_WS}" ]; then +                        esrc="${baserpath}/${dst}" +                else +                        esrc="${baserpath%/git}" +                fi + +                gtws_rcp "${esrc}/${ARR[0]}" "${dst}" +        done +} + +# gtws_project_clone_default ${GTWS_ORIGIN} ${GTWS_PROJECT} ${GTWS_PROJECT_VERSION} ${GTWS_WSNAME} [${SUBMODULE_BASE}] +# +# Clone a version of a project into ${GTWS_WSPATH} (which is the current working directory).  This is the default version of this that clones <origin>/<project>/<version>/* +function gtws_project_clone_default { +        local origin=$1 +        local project=$2 +        local version=$3 +        local name=$4 +        local basesmpath=$5 +        local opv=$(gtws_opvn "${origin}" "${project}" "${version}" "${name}") +        local wspath=${PWD} +        local repos= +        local -A branches + +        if [ -z "${GTWS_PROJECT_REPOS}" ]; then +                for i in "${opv}"/*; do +                        repos="$(basename $i) $repos" +                        branches[$i]=${version} +                done +        else +                for i in ${GTWS_PROJECT_REPOS}; do +                        IFS=':' read -ra ARR <<< "$i" +                        repos="${ARR[0]} $repos" +                        if [ -n "${ARR[1]}" ]; then +                                branches[${ARR[0]}]=${ARR[1]} +                        else +                                branches[${ARR[0]}]=${version} +                        fi +                done +        fi + +        if [ -z "${basesmpath}" ] || [ ! -d "${basesmpath}" ]; then +                basesmpath="${opv}" +        fi + +        for repo in ${repos}; do +                gtws_repo_clone "${opv}" "${repo}" "${branches[${repo}]}" "${basesmpath}" +        done + +        # Copy per-WS settings, if they exist +        gtws_cpdot "${opv%/git}/extra/ws" "${wspath}" +} + +# gtws_repo_setup ${wspath} ${repo_path} +# +# The project can define gtws_repo_setup_local taking the same args to do +# project-specific setup.  It will be called last. +# +# Post-clone setup for an individual repo +function gtws_repo_setup { +        local wspath=$1 +        local rpath=$2 +        local savedir="${PWD}" + +        if [ ! -d "${rpath}" ]; then +                return 0 +        fi + +        cd "${rpath}/src" 2>/dev/null \ +                || cd ${rpath} \ +                || die "Couldn't cd to ${rpath}" || return 1 + +        maketags ${GTWS_MAKETAGS_OPTS} > /dev/null 2> /dev/null & + +        cd ${wspath} || die "Couldn't cd to ${wspath}" || return 1 + +        mkdir -p "${wspath}/build/$(basename ${rpath})" + +        cd "${savedir}" + +        if [ -n "$(declare -F | grep "\<gtws_repo_setup_local\>")" ]; then +                gtws_repo_setup_local "${wspath}" "${rpath}" \ +                        || die "local repo setup failed" || return 1 +        fi +} + +# gtws_project_setup${GTWS_WSNAME} ${GTWS_ORIGIN} ${GTWS_PROJECT} ${GTWS_PROJECT_VERSION} +# +# The project can define gtws_project_setup_local taking the same args to do +# project-specific setup.  It will be called last. +# +# Post clone setup of a workspace in ${GTWS_WSPATH} (which is PWD) +function gtws_project_setup { +        local wsname=$1 +        local origin=$2 +        local project=$3 +        local version=$4 +        local wspath=${PWD} +        local opv=$(gtws_opvn "${origin}" "${project}" "${version}" "placeholder") + +        for i in "${wspath}"/*; do +                gtws_repo_setup "${wspath}" "${i}" +        done + +        mkdir "${wspath}"/install +        mkdir "${wspath}"/chroots +        mkdir "${wspath}"/patches + +        if [ -n "$(declare -F | grep "\<gtws_project_setup_local\>")" ]; then +                gtws_project_setup_local "${wsname}" "${origin}" "${project}" \ +                        "${version}" || die "local project setup failed" || return 1 +        fi +} + +# load_rc /path/to/workspace +# +# This should be in the workspace-level gtwsrc file +# Recursively load all RC files, starting at / +function load_rc { +        local BASE=$(readlink -f "${1}") +        # Load base RC first +        debug_print "load_rc: Enter + Top: ${BASE}" +        source "${HOME}"/.gtwsrc +        while [ "${BASE}" !=  "/" ]; do +                if [ -f "${BASE}"/.gtwsrc ]; then +                        load_rc "$(dirname ${BASE})" +                        debug_print "\tLoading ${BASE}/.gtwsrc" +                        source "${BASE}"/.gtwsrc +                        return 0 +                fi +                BASE=$(readlink -f $(dirname "${BASE}")) +        done +        # Stop at / + +        return 1 +} + +# clear_env +# +# Clear the environment of GTWS_* except for the contents of GTWS_SAVEVARS. +# The default values for GTWS_SAVEVARS are below. +function clear_env { +        local savevars=${GTWS_SAVEVARS:-"LOC PROJECT PROJECT_VERSION VERBOSE WSNAME"} +        local verbose="${GTWS_VERBOSE}" +        debug_print "savevars=$savevars" + +        # Reset prompt +        if [ -n "${GTWS_SAVEPS1}" ]; then +                PS1="${GTWS_SAVEPS1}" +        fi +        if [ -n "${GTWS_SAVEPATH}" ]; then +                export PATH=${GTWS_SAVEPATH} +        fi +        unset LD_LIBRARY_PATH +        unset PYTHONPATH +        unset PROMPT_COMMAND +        unset CDPATH +        unset SDIRS + +        # Save variables +        for i in ${savevars}; do +                SRC=GTWS_${i} +                DST=SAVE_${i} +                debug_print "\t $i: ${DST} = ${!SRC}" +                eval ${DST}=${!SRC} +        done + +        # Clear GTWS evironment +        for i in ${!GTWS*} ; do +                if [ -n "${verbose}" ]; then +                        echo -e "unset $i" >&2 +                fi +                unset $i +        done + +        # Restore variables +        for i in ${savevars}; do +                SRC=SAVE_${i} +                DST=GTWS_${i} +                if [ -n "${verbose}" ]; then +                        echo -e "\t $i: ${DST} = ${!SRC}" >&2 +                fi +                if [ -n "${!SRC}" ]; then +                        eval export ${DST}=${!SRC} +                fi +                unset ${SRC} +        done +} + +# save_env ${file} ${nukevars} +# +# Save the environment of GTWS_* to the give file, except for the variables +# given to nuke.  The default values to nuke are given below. +function save_env { +        local fname=${1} +        local nukevars=${2:-"SAVEPATH ORIGIN WS_GUARD LOC SAVEPS1"} +        debug_print "nukevars=$nukevars" + +        for i in ${!GTWS*} ; do +                for j in ${nukevars}; do +                        if [ "${i}" == "GTWS_${j}" ]; then +                                debug_print "skipping $i" +                                continue 2 +                        fi +                done +                debug_print "saving $i" +                echo "export $i=\"${!i}\"" >> "${fname}" +        done +} + +# gtws_tmux_session_name ${PROJECT} ${VERSION} ${WSNAME} sesname +# +# Result will be in local variable sesname  Or: +# +# sesname = $(gtws_tmux_session_name ${PROJECT} ${VERSION} ${WSNAME}) +# +# Result will be in local variable sesname +# +# Get the tmux session name for a given workspace +function gtws_tmux_session_name { +        local project=$1 +        local version=$2 +        local wsname=$3 +        local  __resultvar=$4 +        local sesname="${project//./_}/${version//./_}/${wsname//./_}" + +        if [[ "$__resultvar" ]]; then +                eval $__resultvar="'$sesname'" +        else +                echo "$sesname" +        fi +} + +# gtws_tmux_session_info ${SESSION_NAME} running attached +# +# Determine if a session is running, and if it is attached +# +# Result will be in local variables running and attached +# +# Test with: +# if $running ; then +#       echo "is running" +# fi + +function gtws_tmux_session_info { +        local ses_name=$1 +        local  __result_running=$2 +        local  __result_attached=$3 + +        local __num_ses=$(tmux ls | grep "^${ses_name}" | wc -l) +        local __attached=$(tmux ls | grep "^${ses_name}" | grep attached) + +        echo "$ses_name ses=${__num_ses}" + +        if [[ "$__result_running" ]]; then +                if [ "${__num_ses}" != "0" ]; then +                        eval $__result_running="true" +                else +                        eval $__result_running="false" +                fi +        fi +        if [[ "$__result_attached" ]]; then +                if [ -n "${__attached}" ]; then +                        eval $__result_attached="true" +                else +                        eval $__result_attached="false" +                fi +        fi +} + +# gtws_tmux_kill ${BASENAME} +# +# Kill all sessiont matching a pattern +function gtws_tmux_kill { +        local basename=$1 +        local old_sessions=$(tmux ls 2>/dev/null | fgrep "${basename}" | cut -f 1 -d:) +        for session in ${old_sessions}; do +                tmux kill-session -t "${session}" +        done +} + +# gtws_tmux_cleanup +# +# Clean up defunct tmux sessions +function gtws_tmux_cleanup { +        local old_sessions=$(tmux ls 2>/dev/null | egrep "^[0-9]{14}.*[0-9]+\\)$" | cut -f 1 -d:) +        for session in ${old_sessions}; do +                tmux kill-session -t "${session}" +        done +} + +# gtws_tmux_attach ${SESSION_NAME} +# +# Attach to a primary session.  It will remain after detaching. +function gtws_tmux_attach { +        local ses_name=$1 + +        tmux attach-session -t "${ses_name}" +} + +# gtws_tmux_slave ${SESSION_NAME} +# +# Create a secondary session attached to the primary session.  It will exit it +# is detached. +function gtws_tmux_slave { +        local ses_name=$1 + +        # Session is is date and time to prevent conflict +        local session=`date +%Y%m%d%H%M%S` +        # Create a new session (without attaching it) and link to base session +        # to share windows +        tmux new-session -d -t "${ses_name}" -s "${session}" +        # Attach to the new session +        gtws_tmux_attach "${session}" +        # When we detach from it, kill the session +        tmux kill-session -t "${session}" +} + +function cdorigin() { +        if [ -n "$(declare -F | grep "gtws_project_cdorigin")" ]; then +                gtws_project_cdorigin $@ +        else +                gtws_cdorigin $@ +        fi +} + +function gtws_get_origin { +        local opv=$1 +        local target=$2 +        local __origin= +        local  __resultvar=$3 + +        # If it's a git repo with a local origin, use that. +        __origin=$(git config --get remote.origin.url) +        if [ ! -d "${__origin}" ]; then +                __origin="${__origin}.git" +        fi +        if [ ! -d "${__origin}" ]; then +                # Try to figure it out +                if [ ! -d "${opv}" ]; then +                        die "No opv for $target" || return 1 +                fi +                find_git_repo "${opv}" "${target}" __origin || return 1 +        fi + +        if [[ "$__resultvar" ]]; then +                eval $__resultvar="'$__origin'" +        else +                echo "$__origin" +        fi +} + +function gtws_cdorigin() { +        local opv=$(gtws_opvn "${GTWS_ORIGIN}" "${GTWS_PROJECT}" "${GTWS_PROJECT_VERSION}" "${GTWS_WSNAME}") +        local gitdir="" +        local target="" +        if [ -n "$1" ]; then +                target="$@" +        else +                git_top_dir gitdir || return 1 +                target=$(basename $gitdir) +        fi + +        gtws_get_origin $opv $target origin || return 1 +        cd "${origin}" +} + +# Copy files to another machine in the same workspace +function wsrcp { +        local target="${!#}" +        local length=$(($#-1)) +        local base=${PWD} + +        if [ -z "${1}" -o -z "${2}" ]; then +                echo "usage: ${FUNCNAME} <path> [<path>...] <target>" +                return 1 +        fi + +        for path in "${@:1:$length}"; do +                gtws_rcp "${path}" "${target}:${base}/${path}" +        done +} + +# Override "cd" inside the workspace to go to GTWS_WSPATH by default +function cd { +        if [ -z "$@" ]; then +                cd "${GTWS_WSPATH}" +        else +                builtin cd $@ +        fi +} + +# Generate diffs/interdiffs for changes and ship to WS on other boxes +function gtws_interdiff { +        local targets=$@ +        local target= +        local savedir=${PWD} +        local topdir=$(git_top_dir) +        local repo=$(basename ${topdir}) +        local mainpatch="${GTWS_WSPATH}/patches/${repo}-full.patch" +        local interpatch="${GTWS_WSPATH}/patches/${repo}-incremental.patch" + +        if [ -z "${targets}" ]; then +                echo "Usage: ${FUNCNAME} <targethost>" +                die "Must give targethost" || return 1 +        fi +        cd "${topdir}" +        if [ -f "${mainpatch}" ]; then +                git diff | interdiff "${mainpatch}" - > "${interpatch}" +        fi +        git diff > "${mainpatch}" +        for target in ${targets}; do +                gtws_rcp "${mainpatch}" "${interpatch}" \ +                        "${target}:${GTWS_WSPATH}/patches" +        done +        cd "${savedir}" +} + +function gtws_debug { +        local cmd=$1 +        if [ -z "${cmd}" ]; then +                echo "Must give a command" +                echo +                die "${FUNCNAME} <cmd-path>" || return 1 +        fi +        local cmdbase=$(basename $cmd) +        local pid=$(pgrep "${cmdbase}") + +        ASAN_OPTIONS="abort_on_error=1" cgdb ${cmd} ${pid} +} + +# remote_cmd "${target}" "${command}" output +# +# Result will be in local variable output  Or: +# +# output = $(remote_cmd "${target}" "${command}") +# +# Result will be in local variable output +# +# Run a command remotely and capture sdtout.  Make sure to quote the command +# appropriately. +remote_cmd() { +        local target=$1 +        local cmd=$2 +        local  __resultvar=$3 +        local output= + +        if [ -z "${GTWS_VERBOSE}" ]; then +                output=$(ssh "${target}" "${cmd}" 2>/dev/null) +        else +                output=$(ssh "${target}" "${cmd}") +        fi +        local ret=$? + +        if [[ "$__resultvar" ]]; then +                eval $__resultvar="'$output'" +        else +                echo "${output}" +        fi +        return ${ret} +} +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/git-great-teeming-workspaces + +作者:[Daniel Gryniewicz][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/dang +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer) +[2]: https://github.com/dang/gtws +[3]: https://docs.python.org/3/library/venv.html From 4d7ca2f9a35c8ed6211149bc662ca9c21a86dcbe Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 15 Feb 2020 01:13:48 +0800 Subject: [PATCH 018/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200214=20Diggin?= =?UTF-8?q?g=20up=20IP=20addresses=20with=20the=20Linux=20dig=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200214 Digging up IP addresses with the Linux dig command.md --- ...IP addresses with the Linux dig command.md | 200 ++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 sources/tech/20200214 Digging up IP addresses with the Linux dig command.md diff --git a/sources/tech/20200214 Digging up IP addresses with the Linux dig command.md b/sources/tech/20200214 Digging up IP addresses with the Linux dig command.md new file mode 100644 index 0000000000..1a941f9ff8 --- /dev/null +++ b/sources/tech/20200214 Digging up IP addresses with the Linux dig command.md @@ -0,0 +1,200 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Digging up IP addresses with the Linux dig command) +[#]: via: (https://www.networkworld.com/article/3527430/digging-up-ip-addresses-with-the-dig-command.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Digging up IP addresses with the Linux dig command +====== +The dig command is extremely versatile both for retrieving information from domain name servers and for troubleshooting. +Thinkstock + +Not unlike **nslookup** in function, but with a lot more options, the **dig** command provides information that name servers manage and can be very useful for troubleshooting problems. It’s both simple to use and has lots of useful options. + +The name “dig” stands for “domain information groper” since domain groping is basically what it does. The amount of information that it provides depends on a series of options that you can use to tailor its output to your needs. Dig can provide a lot of detail or be surprisingly terse. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] + +### Just the IP, please + +To get _just_ the IP address for a system, add the **+short** option to your dig command like this: + +``` +$ dig facebook.com +short +31.13.66.35 +``` + +Don't be surprised, however, if some domains are tied to multiple IP addresses to make the sites they support more reliable. + +``` +$ dig networkworld.com +short +151.101.2.165 +151.101.66.165 +151.101.130.165 +151.101.194.165 +``` + +Also, don't be surprised if the order of the IP addresses changes from one query to the next. This is a side effect of load balancing. + +``` +$ dig networkworld.com +short +151.101.130.165 +151.101.194.165 +151.101.2.165 +151.101.66.165 +``` + +### Standard dig output + +The standard dig display provides details on dig itself along with the response from the name server. + +``` +$ dig networkworld.com + +; <<>> DiG 9.11.5-P4-5.1ubuntu2.1-Ubuntu <<>*gt; networkworld.com +;; global options: +cmd +;; Got answer: +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39932 +;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1 + +;; OPT PSEUDOSECTION: +; EDNS: version: 0, flags:; udp: 65494 +;; QUESTION SECTION: +;networkworld.com. IN A + +;; ANSWER SECTION: +networkworld.com. 300 IN A 151.101.194.165 +networkworld.com. 300 IN A 151.101.130.165 +networkworld.com. 300 IN A 151.101.66.165 +networkworld.com. 300 IN A 151.101.2.165 + +;; Query time: 108 msec +;; SERVER: 127.0.0.53#53(127.0.0.53) +;; WHEN: Thu Feb 13 13:49:53 EST 2020 +;; MSG SIZE rcvd: 109 +``` + +Since name servers generally cache collected data for a while, the query time shown at the bottom of dig output might sometimes might say "0 msec": + +[][2] + +``` +;; Query time: 0 msec <== +;; SERVER: 127.0.0.53#53(127.0.0.53) +;; WHEN: Thu Feb 13 15:30:09 EST 2020 +;; MSG SIZE rcvd: 109 +``` + +### Who you gonna ask? + +By default, dig will refer to your **/etc/resolv.conf** file to determine what name server to query, but you can refer queries to other DNS servers by adding an **@** option. + +In the example below, for example, the query is being sent to Google's name server (i.e., 8.8.8.8). + +``` +$ dig @8.8.8.8 networkworld.com + +; <<>> DiG 9.11.5-P4-5.1ubuntu2.1-Ubuntu <<>> @8.8.8.8 networkworld.com +; (1 server found) +;; global options: +cmd +;; Got answer: +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21163 +;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1 + +;; OPT PSEUDOSECTION: +; EDNS: version: 0, flags:; udp: 512 +;; QUESTION SECTION: +;networkworld.com. IN A + +;; ANSWER SECTION: +networkworld.com. 299 IN A 151.101.130.165 +networkworld.com. 299 IN A 151.101.66.165 +networkworld.com. 299 IN A 151.101.194.165 +networkworld.com. 299 IN A 151.101.2.165 + +;; Query time: 48 msec +;; SERVER: 8.8.8.8#53(8.8.8.8) +;; WHEN: Thu Feb 13 14:26:14 EST 2020 +;; MSG SIZE rcvd: 109 +``` + +To determine what version of dig you’re using, use the **-v** option. You should see something like this: + +``` +$ dig -v +DiG 9.11.5-P4-5.1ubuntu2.1-Ubuntu +``` + +or this: + +``` +$ dig -v +DiG 9.11.4-P2-RedHat-9.11.4-22.P2.el8 +``` + +To get just the answer portion of this response, you can omit name server details, but still get the answer you're looking for by using both a **+noall** (don't show everything) and a **+answer** (but show the answer section) like this: + +``` +$ dig networkworld.com +noall +answer + +; <<>> DiG 9.11.5-P4-5.1ubuntu2.1-Ubuntu <<>> networkworld.com +noall +answer +;; global options: +cmd +networkworld.com. 300 IN A 151.101.194.165 +networkworld.com. 300 IN A 151.101.130.165 +networkworld.com. 300 IN A 151.101.66.165 +networkworld.com. 300 IN A 151.101.2.165 +``` + +### Looking up a batch of systems + +If you want to dig for a series of domain names, you can list the domain names in a file and then use a command like this one to have dig run through the list and provide the information. + +``` +$ dig +noall +answer -f domains +networkworld.com. 300 IN A 151.101.66.165 +networkworld.com. 300 IN A 151.101.2.165 +networkworld.com. 300 IN A 151.101.130.165 +networkworld.com. 300 IN A 151.101.194.165 +world.std.com. 77972 IN A 192.74.137.5 +uushenandoah.org. 1982 IN A 162.241.24.209 +amazon.com. 18 IN A 176.32.103.205 +amazon.com. 18 IN A 176.32.98.166 +amazon.com. 18 IN A 205.251.242.103 +``` + +You could add +short to the command above but, with some sites having multiple IP addresses, this might not be very useful. To cut down on the detail but be sure that you can tell which IP belongs to which domain, you could instead pass the output to **awk** to display just the first and last columns of data: + +``` +$ dig +noall +answer -f domains | awk '{print $1,$NF}' +networkworld.com. 151.101.66.165 +networkworld.com. 151.101.130.165 +networkworld.com. 151.101.194.165 +networkworld.com. 151.101.2.165 +world.std.com. 192.74.137.5 +amazon.com. 176.32.98.166 +amazon.com. 205.251.242.103 +amazon.com. 176.32.103.205 +``` + +Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3527430/digging-up-ip-addresses-with-the-dig-command.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/newsletters/signup.html +[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From 2964ac96f1c1ec5e34ba9a05d55815f4f26f0a93 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 15 Feb 2020 01:16:55 +0800 Subject: [PATCH 019/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200213=20Server?= =?UTF-8?q?=20sales=20projected=20to=20decline=2010%=20due=20to=20coronavi?= =?UTF-8?q?rus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200213 Server sales projected to decline 10- due to coronavirus.md --- ...ected to decline 10- due to coronavirus.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/talk/20200213 Server sales projected to decline 10- due to coronavirus.md diff --git a/sources/talk/20200213 Server sales projected to decline 10- due to coronavirus.md b/sources/talk/20200213 Server sales projected to decline 10- due to coronavirus.md new file mode 100644 index 0000000000..32852586e1 --- /dev/null +++ b/sources/talk/20200213 Server sales projected to decline 10- due to coronavirus.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Server sales projected to decline 10% due to coronavirus) +[#]: via: (https://www.networkworld.com/article/3526605/server-sales-projected-to-decline-10-due-to-coronavirus.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Server sales projected to decline 10% due to coronavirus +====== +Demand isn’t tapering off, but China is grinding to a halt under the strain of the pandemic. +Writerfantast / Getty Images + +Global server sales had been projected to grow by 1.2% compared to the most recent quarter, but the chaos wrought by the coronavirus in China will cause sales to decline 9.8% sequentially, according to DigiTimes Research. + +DigiTimes is an IT publication based in Taiwan. Its proximity to Taiwanese and Chinese vendors gives it some good sources, but it can also be way off target. However, the signs are piling up that coronavirus is causing some real mayhem. + +For example, DigiTimes also [reported][1] that less than 20% of Chinese factory employees would return to work after an extended Lunar New Year break due to the coronavirus outbreak, and that many components plants in China have decided not to restart production until February 25. + +**[ Now read: [What is quantum computing (and why enterprises should care)][2] ]** + +The Lunar New Year was January 25, so that means Chinese factories have been idle for a month. That’s a lot of supply not being answered, and DigiTimes notes that server demand from large data centers remained strong in the first quarter of 2020. + +Facebook in particular is interested in buying high-density models from white box vendors like Wiwynn and Quanta Computer, but due to the outbreak, these orders, which were originally scheduled for shipment this quarter, have been postponed. + +So it’s not like an economic crash is causing sales to go off a cliff like in 2008. Demand is there, but China can’t make the product right now. This year was expected to be a good year for the server vendors, with all of them projecting sales increases over last year. AMD is ramping up Epyc production, and Intel is expected to release its next-generation “Ice Lake” Xeon platform in the third or the fourth quarter of 2020. + +The good news here is that Wuhan isn’t a major tech manufacturing hub. It does have five display fabs, both LCD and OLED, but so does Shanhai. However, Wuhan has the most advanced display fabs, producing flexible OLEDs, and has the largest capacity, according to David Hsieh, senior director, displays, at Omdia. + +**[ [Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][3] ]** + +Vladimir Galabov, principal analyst for data-center compute in Omdia’s cloud and data-center research practice, also expects to see server shipments impacted by the coronavirus driving a prolonged holiday period in China. + +“I think the majority of the hit will be in the Chinese market,” he said. “This does impact server shipments globally as China represents about 30% of server shipments worldwide. So, I expect the quarterly decline to be more significant than the seasonal 10%. I expect that China will have a 5% additional downward impact on the growth.” + +He added that Q4 of 2019 did significantly overachieve his expectations due to cloud service providers making massive purchases. Omdia expected servers shipped in 2019 to be flat compared to 2018 based on data from 1Q19-3Q19. Instead, it was up 2% to 3% for the year, thanks to the fourth-quarter spurt. + +And servers aren’t the only products taking a hit. DigiTimes says that should the outbreak of the coronavirus last until June, sales of smartphones in the country would be slashed by about 30%, from a projected 400 million units to 280 million units in 2020. + +Also, Mobile World Congress in Barcelona is cancelled due to concerns about the global coronavirus outbreak. The [official cancellation][4] came after a number of big-name companies, including Intel, Cisco, Amazon, Sony, NTT Docomo LG, ZTE, Nvidia, and Ericsson, bowed out of various events that were set for the show.  + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3526605/server-sales-projected-to-decline-10-due-to-coronavirus.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://www.digitimes.com/news/a20200210VL202.html +[2]: https://www.networkworld.com/article/3275367/what-s-quantum-computing-and-why-enterprises-need-to-care.html +[3]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[4]: https://www.mwcbarcelona.com/attend/safety-security/gsma-statement-on-mwc-2020/ +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From e79b0945728ab53b8f03aadddeb5162584860b1f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 15 Feb 2020 01:17:58 +0800 Subject: [PATCH 020/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200212=20A=20SA?= =?UTF-8?q?SE=20Crash=20Course?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200212 A SASE Crash Course.md --- sources/talk/20200212 A SASE Crash Course.md | 67 ++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/talk/20200212 A SASE Crash Course.md diff --git a/sources/talk/20200212 A SASE Crash Course.md b/sources/talk/20200212 A SASE Crash Course.md new file mode 100644 index 0000000000..88e85a9c15 --- /dev/null +++ b/sources/talk/20200212 A SASE Crash Course.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A SASE Crash Course) +[#]: via: (https://www.networkworld.com/article/3526455/a-sase-crash-course.html) +[#]: author: (Cato Networks https://www.networkworld.com/author/Matt-Conran/) + +A SASE Crash Course +====== +Get up to speed fast on the Secure Access Service Edge, an emerging converged networking and security category that Gartner has labelled transformational. +peshkov + +2020! What could better motivate you to push ahead with your resolutions and organization’s digital transformation than a new year AND a new decade. As you put together your digital strategy, check out a new transformation-empowering (and transformational) technology category Gartner coined the [Secure Access Service Edge][1] or SASE (pronounced “Sassy”). SASE converges wide area networking and identity-based security into a cloud service targeted directly to your branch offices, mobile users, cloud services, and even IoT devices, wherever they happen to be. The result: consistently high WAN performance, security, productivity, agility, and flexibility across the global, mobile, cloud-enabled enterprise. + +To jumpstart your research into one of the few networking categories Gartner has labelled “transformational,” we’ve put together a very workable SASE crash course and reading list. Each lesson helps you dig a little deeper into SASE, so you can develop a good grasp of its components and transformational potential. + +**Lesson 1: SASE as Defined by Gartner** + +So, what is SASE exactly and why should you care? SASE was coined by [Gartner][2] analysts Neil McDonald and Joe Skorupa in a [July 29, 2019 Networking Hype Cycle][3] [Market Trends Report, How to Win as WAN Edge and Security Converge into the Secure Access Service Edge][4] and an August 30, 2019 [Gartner][2] report, The Future of Network Security is in the Cloud. If you don’t have access to these reports, Cato quotes the highlights of the former word for word in this short blog: [The Secure Access Service Edge (SASE), as Described in Gartner’s Hype Cycle for Enterprise Networking, 2019][5]. It’s a great place to get started on exactly what Gartner has to say about SASE and its drivers, likely development, and place in the digitally transforming enterprise. There are also some valuable links to more information on SASE and exactly how the Cato cloud fits into the SASE trend. + +**Lesson 2: What SASE _Is_ and What It _Isn’t_** + +After Gartner piques your interest, get some valuable insight from Cato in this blog: [The Secure Access Service Edge (SASE): Here’s Where Your Digital Business Network Starts][6]. Here you can learn why convergence of wide area networking and security is absolutely vital for the agile, digitally transforming enterprise and why legacy data center-centric solutions can’t deliver any more in a world of user mobility and the cloud. This blog breaks down the four essential attributes of SASE—identity driven, cloud native, support for all edges, and globally distributed—in detail. It also explains why SASE is _not_ anything like telco-managed services and summarizes how Cato delivers SASE effectively. + +**Lesson 3: How Cato Delivers SASE** + +Sometimes visual/audio-based learning can bring things into better focus than straight text, and few people are better at explaining WAN and security concepts than Yishay Yovel, Cato Network’s Chief Marketing Officer. In this short, 17-minute video presentation, [Intro to SASE by Yishay][7], Yishay digs into Gartner’s take on SASE, why WAN and security need to converge, and why SASE is one of only three (out of 29) Networking Hype Cycle categories that Gartner has labeled “transformational.” Yishay gets into a lot of nitty-gritty SASE details and offers valuable perspective on how Cato Networks delivers a complete cloud-native SASE software stack that supports all edges and is identity-driven, scalable, flexible, and easy to deploy and manage. Yishay also explains clearly why some of the other WAN and security solutions out there don’t fulfill some essential requirements of SASE, such as processing traffic close to the source. For visual learners, there are also some great architectural diagrams. + +**Lesson 4: Gartner Webinar Breaks Down SASE and its Implications** + +You’ve heard it from Yishay, now hear it from Gartner’s VP Distinguished Analyst Neil MacDonald _and_ Yishay in this 37-minute [Gartner Webinar: Is SASE the Future of SD-WAN and Network Security][8]? MacDonald explains SASE elements and drivers in depth, why SASE belongs in the cloud, how enterprises will adopt SASE, and how organizations should evaluate SASE offerings. There’s some good detail here on how SASE works in different contexts and scenarios, such as a mobile employee connecting to Salesforce securely from the airport, a contractor accessing a Web application from an unmanaged device, and even wind turbines collecting and aggregating data and sending it to the cloud for processing. Neil digs into core SASE requirements and recommends additional services and some other useful options. Yishay then takes over with why Cato is the world’s first true SASE platform. + +**Lesson 5: The White Paper** + +But wait, there’s more. Here’s a clear and concise white paper from Cato, [The Network for the Digital Business Starts with the Secure Access Service Edge][9]. This is a good piece to give out to the other digital transformation stakeholders in your business if you want them to get up to speed on SASE fast. It’s a quick read that explains why the digital, mobile, cloud-enabled business needs a new converged network/security model. It also covers the four elements of SASE, core SASE capabilities, SASE benefits, and clear examples of what SASE _isn’t_ and why. It describes the features that make Cato one of the most comprehensive SASE offerings on the market. It’s a clear, concise presentation broken into short paragraphs and bullet points to provide a fast introduction to SASE and the Cato Cloud. + +**Lesson 6: Icing on the Cake: The Short and Sweet Video** + +[SASE (Secure Access Service Edge)][10] is a short YouTube video to go along with the white paper, combining perspective and information from Gartner and Cato on why you need SASE simplicity for your digital transforming business. + +We hope you have a happy, healthy, transforming New Year. To accelerate your organization’s digital transformation over the next decade, get up to speed on SASE with these useful blogs, videos, and white papers and find out how SASE can help you make that transformation happen quickly and more easily. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3526455/a-sase-crash-course.html + +作者:[Cato Networks][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Matt-Conran/ +[b]: https://github.com/lujun9972 +[1]: http://www.catonetworks.com/sase?utm_source=idg +[2]: https://en.wikipedia.org/wiki/Gartner +[3]: https://www.gartner.com/en/documents/3947237 +[4]: https://www.gartner.com/en/documents/3953690/market-trends-how-to-win-as-wan-edge-and-security-conver +[5]: https://www.catonetworks.com/blog/the-secure-access-service-edge-sase-as-described-in-gartners-hype-cycle-for-enterprise-networking-2019/ +[6]: https://www.catonetworks.com/blog/the-secure-access-service-edge-sase?utm_source=idg +[7]: https://catonetworks.wistia.com/medias/kn86smj7q4 +[8]: https://go.catonetworks.com/VOD-REG-Gartner-SASE?utm_source=idg +[9]: https://go.catonetworks.com/The-Network-Starts-with-SASE?utm_source=idg +[10]: https://www.youtube.com/watch?v=gLN4NUbjml8 From e30e70dd50749668d0a5644a4600f179ee7300a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E6=96=B0=E9=98=BF=E5=B2=A9?= <31788564+mengxinayan@users.noreply.github.com> Date: Sat, 15 Feb 2020 02:28:34 -0800 Subject: [PATCH 021/315] Translated (mengxinayan) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit File Name: 20190729 How to structure a multi-file C program- Part 1.md Translator: 萌新阿岩 - mengxinayan --- ...tructure a multi-file C program- Part 1.md | 197 ------------------ ...tructure a multi-file C program- Part 1.md | 189 +++++++++++++++++ 2 files changed, 189 insertions(+), 197 deletions(-) delete mode 100644 sources/tech/20190729 How to structure a multi-file C program- Part 1.md create mode 100644 translated/tech/20190729 How to structure a multi-file C program- Part 1.md diff --git a/sources/tech/20190729 How to structure a multi-file C program- Part 1.md b/sources/tech/20190729 How to structure a multi-file C program- Part 1.md deleted file mode 100644 index b9e026ca4b..0000000000 --- a/sources/tech/20190729 How to structure a multi-file C program- Part 1.md +++ /dev/null @@ -1,197 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (mengxinayan) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to structure a multi-file C program: Part 1) -[#]: via: (https://opensource.com/article/19/7/structure-multi-file-c-part-1) -[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjnyhttps://opensource.com/users/jnyjnyhttps://opensource.com/users/jim-salterhttps://opensource.com/users/cldxsolutions) - -How to structure a multi-file C program: Part 1 -====== -Grab your favorite beverage, editor, and compiler, crank up some tunes, -and start structuring a C program composed of multiple files. -![Programming keyboard.][1] - -It has often been said that the art of computer programming is part managing complexity and part naming things. I contend that this is largely true with the addition of "and sometimes it requires drawing boxes." - -In this article, I'll name some things and manage some complexity while writing a small C program that is loosely based on the program structure I discussed in "[How to write a good C main function][2]"—but different. This one will do something. Grab your favorite beverage, editor, and compiler, crank up some tunes, and let's write a mildly interesting C program together. - -### Philosophy of a good Unix program - -The first thing to know about this C program is that it's a [Unix][3] command-line tool. This means that it runs on (or can be ported to) operating systems that provide a Unix C runtime environment. When Unix was invented at Bell Labs, it was imbued from the beginning with a [design philosophy][4]. In my own words: _programs do one thing, do it well, and act on files_. While it makes sense to do one thing and do it well, the part about "acting on files" seems a little out of place. - -It turns out that the Unix abstraction of a "file" is very powerful. A Unix file is a stream of bytes that ends with an end-of-file (EOF) marker. That's it. Any other structure in a file is imposed by the application and not the operating system. The operating system provides system calls that allow a program to perform a set of standard operations on files: open, read, write, seek, and close (there are others, but those are the biggies). Standardizing access to files allows different programs to share a common abstraction and work together even when different people implement them in different programming languages. - -Having a shared file interface makes it possible to build programs that are _composable_. The output of one program can be the input of another program. The Unix family of operating systems provides three files by default whenever a program is executed: standard in (**stdin**), standard out (**stdout**), and standard error (**stderr**). Two of these files are opened in write-only mode: **stdout** and **stderr**, while **stdin** is opened read-only. We see this in action whenever we use file redirection in a command shell like Bash: - - -``` -`$ ls | grep foo | sed -e 's/bar/baz/g' > ack` -``` - -This construction can be described briefly as: the output of **ls** is written to stdout, which is redirected to the stdin of **grep**, whose stdout is redirected to **sed**, whose stdout is redirected to write to a file called **ack** in the current directory. - -We want our program to play well in this ecosystem of equally flexible and awesome programs, so let's write a program that reads and writes files. - -### MeowMeow: A stream encoder/decoder concept - -When I was a dewy-eyed kid studying computer science in the <mumbles>s, there were a plethora of encoding schemes. Some of them were for compressing files, some were for packaging files together, and others had no purpose but to be excruciatingly silly. An example of the last is the [MooMoo encoding scheme][5]. - -To give our program a purpose, I'll update this concept for the [2000s][6] and implement a concept called MeowMeow encoding (since the internet loves cats). The basic idea here is to take files and encode each nibble (half of a byte) with the text "meow." A lower-case letter indicates a zero, and an upper-case indicates a one. Yes, it will balloon the size of a file since we are trading 4 bits for 32 bits. Yes, it's pointless. But imagine the surprise on someone's face when this happens: - - -``` -$ cat /home/your_sibling/.super_secret_journal_of_my_innermost_thoughts -MeOWmeOWmeowMEoW... -``` - -This is going to be awesome. - -### Implementation, finally - -The full source for this can be found on [GitHub][7], but I'll talk through my thought process while writing it. The object is to illustrate how to structure a C program composed of multiple files. - -Having already established that I want to write a program that encodes and decodes files in MeowMeow format, I fired up a shell and issued the following commands: - - -``` -$ mkdir meowmeow -$ cd meowmeow -$ git init -$ touch Makefile     # recipes for compiling the program -$ touch main.c       # handles command-line options -$ touch main.h       # "global" constants and definitions -$ touch mmencode.c   # implements encoding a MeowMeow file -$ touch mmencode.h   # describes the encoding API -$ touch mmdecode.c   # implements decoding a MeowMeow file -$ touch mmdecode.h   # describes the decoding API -$ touch table.h      # defines encoding lookup table values -$ touch .gitignore   # names in this file are ignored by git -$ git add . -$ git commit -m "initial commit of empty files" -``` - -In short, I created a directory full of empty files and committed them to git. - -Even though the files are empty, you can infer the purpose of each from its name. Just in case you can't, I annotated each **touch** with a brief description. - -Usually, a program starts as a single, simple **main.c** file, with only two or three functions that solve the problem. And then the programmer rashly shows that program to a friend or her boss, and suddenly the number of functions in the file balloons to support all the new "features" and "requirements" that pop up. The first rule of "Program Club" is don't talk about "Program Club." The second rule is to minimize the number of functions in one file. - -To be honest, the C compiler does not care one little bit if every function in your program is in one file. But we don't write programs for computers or compilers; we write them for other people (who are sometimes us). I know that is probably a surprise, but it's true. A program embodies a set of algorithms that solve a problem with a computer, and it's important that people understand it when the parameters of the problem change in unanticipated ways. People will have to modify the program, and they will curse your name if you have all 2,049 functions in one file. - -So we good and true programmers break functions out, grouping similar functions into separate files. Here I've got files **main.c**, **mmencode.c**, and **mmdecode.c**. For small programs like this, it may seem like overkill. But small programs rarely stay small, so planning for expansion is a "Good Idea." - -But what about those **.h** files? I'll explain them in general terms later, but in brief, those are called _header_ files, and they can contain C language type definitions and C preprocessor directives. Header files should _not_ have any functions in them. You can think of headers as a definition of the application programming interface (API) offered by the **.c** flavored file that is used by other **.c** files. - -### But what the heck is a Makefile? - -I know all you cool kids are using the "Ultra CodeShredder 3000" integrated development environment to write the next blockbuster app, and building your project consists of mashing on Ctrl-Meta-Shift-Alt-Super-B. But back in my day (and also today), lots of useful work got done by C programs built with Makefiles. A Makefile is a text file that contains recipes for working with files, and programmers use it to automate building their program binaries from source (and other stuff too!). - -Take, for instance, this little gem: - - -``` -00 # Makefile -01 TARGET= my_sweet_program -02 $(TARGET): main.c -03    cc -o my_sweet_program main.c -``` - -Text after an octothorpe/pound/hash is a comment, like in line 00. - -Line 01 is a variable assignment where the variable **TARGET** takes on the string value **my_sweet_program**. By convention, OK, my preference, all Makefile variables are capitalized and use underscores to separate words. - -Line 02 consists of the name of the file that the recipe creates and the files it depends on. In this case, the target is **my_sweet_program**, ****and the dependency is **main.c**. - -The final line, 03, is indented with a tab and not four spaces. This is the command that will be executed to create the target. In this case, we call **cc** the C compiler frontend to compile and link **my_sweet_program**. - -Using a Makefile is simple: - - -``` -$ make -cc -o my_sweet_program main.c -$ ls -Makefile  main.c  my_sweet_program -``` - -The [Makefile][8] that will build our MeowMeow encoder/decoder is considerably more sophisticated than this example, but the basic structure is the same. I'll break it down Barney-style in another article. - -### Form follows function - -My idea here is to write a program that reads a file, transforms it, and writes the transformed data to another file. The following fabricated command-line interaction is how I imagine using the program: - - -``` -        $ meow < clear.txt > clear.meow -        $ unmeow < clear.meow > meow.tx -        $ diff clear.txt meow.tx -        $ -``` - -We need to write code to handle command-line parsing and managing the input and output streams. We need a function to encode a stream and write it to another stream. And finally, we need a function to decode a stream and write it to another stream. Wait a second, I've only been talking about writing one program, but in the example above, I invoke two commands: **meow** and **unmeow**? I know you are probably thinking that this is getting complex as heck. - -### Minor sidetrack: argv[0] and the ln command - -If you recall, the signature of a C main function is: - - -``` -`int main(int argc, char *argv[])` -``` - -where **argc** is the number of command-line arguments, and **argv** is a list of character pointers (strings). The value of **argv[0]** is the path of the file containing the program being executed. Many Unix utility programs with complementary functions (e.g., compress and uncompress) look like two programs, but in fact, they are one program with two names in the filesystem. The two-name trick is accomplished by creating a filesystem "link" using the **ln** command. - -An example from **/usr/bin** on my laptop is: - - -``` -   $ ls -li /usr/bin/git* -3376 -rwxr-xr-x. 113 root root     1.5M Aug 30  2018 /usr/bin/git -3376 -rwxr-xr-x. 113 root root     1.5M Aug 30  2018 /usr/bin/git-receive-pack -... -``` - -Here **git** and **git-receive-pack** are the same file with different names. We can tell it's the same file because they have the same inode number (the first column). An inode is a feature of the Unix filesystem and is super outside the scope of this article. - -Good and/or lazy programmers can use this feature of the Unix filesystem to write less code but double the number of programs they deliver. First, we write a program that changes its behavior based on the value of **argv[0]**, then we make sure to create links with the names that cause the behavior. - -In our Makefile, the **unmeow** link is created using this recipe: - - -``` - # Makefile - ... - $(DECODER): $(ENCODER) -         $(LN) -f $< $@ -        ... -``` - -I tend to parameterize everything in my Makefiles, rarely using a "bare" string. I group all the definitions at the top of the Makefile, which makes it easy to find and change them. This makes a big difference when you are trying to port software to a new platform and you need to change all your rules to use **xcc** instead of **cc**. - -The recipe should appear relatively straightforward except for the two built-in variables **$@** and **$<**. The first is a shortcut for the target of the recipe; in this case, **$(DECODER)**. (I remember this because the at-sign looks like a target to me.) The second, **$<** is the rule dependency; in this case, it resolves to **$(ENCODER)**. - -Things are getting complex for sure, but it's managed. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/7/structure-multi-file-c-part-1 - -作者:[Erik O'Shaughnessy][a] -选题:[lujun9972][b] -译者:[萌新阿岩](https://github.com/mengxinayan) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jnyjnyhttps://opensource.com/users/jnyjnyhttps://opensource.com/users/jim-salterhttps://opensource.com/users/cldxsolutions -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_keyboard_coding.png?itok=E0Vvam7A (Programming keyboard.) -[2]: https://opensource.com/article/19/5/how-write-good-c-main-function -[3]: https://en.wikipedia.org/wiki/Unix -[4]: http://harmful.cat-v.org/cat-v/ -[5]: http://www.jabberwocky.com/software/moomooencode.html -[6]: https://giphy.com/gifs/nyan-cat-sIIhZliB2McAo -[7]: https://github.com/JnyJny/meowmeow -[8]: https://github.com/JnyJny/meowmeow/blob/master/Makefile diff --git a/translated/tech/20190729 How to structure a multi-file C program- Part 1.md b/translated/tech/20190729 How to structure a multi-file C program- Part 1.md new file mode 100644 index 0000000000..92166f2895 --- /dev/null +++ b/translated/tech/20190729 How to structure a multi-file C program- Part 1.md @@ -0,0 +1,189 @@ +[#]: collector: (lujun9972) +[#]: translator: (mengxinayan) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to structure a multi-file C program: Part 1) +[#]: via: (https://opensource.com/article/19/7/structure-multi-file-c-part-1) +[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjnyhttps://opensource.com/users/jnyjnyhttps://opensource.com/users/jim-salterhttps://opensource.com/users/cldxsolutions) + +如何组织构建多文件 C 语言程序:第一部分 +====== + +准备好你喜欢的饮料,编辑器和编译器,放一些音乐,然后开始构建一个由多个文件组成的 C 语言程序。 +![Programming keyboard.][1] + +大家常说计算机编程的艺术是管理复杂性和命名某些事物中的一部分。此外,我认为“有时需要添加绘图”是很正确的。 + +在这篇文章里,我会在编写一个小型 C 程序时命名一些东西同时管理一些复杂性。程序的结构基于我所在 “[如何写一个好的 C 语言 main 函数][2]” 文中讨论的。但是,这次做一些不同的事。准备好你喜欢的饮料,编辑器和编译器,放一些音乐,让我们一起编写一个有趣的 C 语言程序。 + +### 好的 Unix 程序中的哲学 + +首先你要知道这个 C 程序是一个 [Unix][3] 命令行工具。这意味着它运行在那些提供(或者可被移植) Unix C 运行环境的操作系统中。当 Unix 在贝尔实验室被发明后,它从一开始便充满了 [设计哲学][4]。用我的话来说:程序只做一件事,并做好它,然后对文件进行一些操作。虽然只做一件事并做好它是有意义的,但是“对文件进行一些操作”在这儿有一点儿不合适。 + +“文件” 在 Unix 中的抽象非常强大。一个 Unix 文件是以 end-of-file (EOF) 标志为结尾的字节流。文件中其他结构均由应用添加而非操作系统。操作系统提供了系统调用,使得程序能够对文件执行标准操作:打开,读取,写入,寻找和关闭(还有其他,但那是庞大的额外内容)。对于文件的标准化访问使得不同人用不同语言编写的程序能共用相同的抽象同时一起工作。 + +具有共享文件接口可以构建 _可组合的_ 的程序。一个程序的输出可以作为另一个程序的输入。Unix 系操作系统默认为每个运行中程序提供了三个文件:标准输入(`stdin`),标准输出(`stdout`),和标准错误(`stderr`)。其中两个文件是只写的:`stdout` 和 `stderr`。而 `stdin` 是只读的。当我们在常见的 Shell 比如 Bash 中使用文件重定向时,可以看到其效果。 + +``` +`$ ls | grep foo | sed -e 's/bar/baz/g' > ack` +``` + +这条指令可以被简要地描述为:`ls` 的结果被写入标准输出,它重定向到 `grep` 的标准输入,`grep` 的标准输出重定向到 `sed`的标准输入,`sed` 的标准输出重定向到当前目录下文件名为 `ack` 的文件中。 + +我们希望我们的程序在系统中灵活而又出色,因此让我们编写一个可以读写文件的程序。 + +### MeowMeow: 流编码器/解码器概念 + +当我还是一个孩子在 ltmumblesgts 里学习计算机科学时,有许多编码方案。他们中的有些用于压缩文件,有些用于打包文件,另一些毫无用处因此显得十分愚蠢。列举一个最后一种情况例子:[MooMoo 编码方式][5]。 + +为了给我们程序一个目的,我将在 [2000s][6] 更新该概念并且完成一个名为 “MeowMeow” 的编码方式(因为在互联网上大家都喜欢猫)。这里的基本的想法获取文件并且使用文本 “meow” 对每半个字节进行编码。小写字母代表 0,大写字母代表 1。因为它会将 4 比特替换为 32 比特,因此会扩大文件的大小。这毫无实际意义。但想象一下人们看到经过这样编码后的结果。 + +``` +$ cat /home/your_sibling/.super_secret_journal_of_my_innermost_thoughts +MeOWmeOWmeowMEoW... +``` + +这非常棒。 + +### 最后完成 + +完整的源代码可以在 [GitHub][7] 上面找到,但是我会写下我在编写程序时的思考。目的是说明如何组织构建多文件 C 语言程序。 + +当我已经确定要编写一个 MeowMeow 编码和解码的程序时,我在 Shell 中执行了以下的命令 : + +``` +$ mkdir meowmeow +$ cd meowmeow +$ git init +$ touch Makefile     # recipes for compiling the program +$ touch main.c       # handles command-line options +$ touch main.h       # "global" constants and definitions +$ touch mmencode.c   # implements encoding a MeowMeow file +$ touch mmencode.h   # describes the encoding API +$ touch mmdecode.c   # implements decoding a MeowMeow file +$ touch mmdecode.h   # describes the decoding API +$ touch table.h      # defines encoding lookup table values +$ touch .gitignore   # names in this file are ignored by git +$ git add . +$ git commit -m "initial commit of empty files" +``` + +简单的说,我创建了一个空文件并且使用 git 提交。 +In short, I created a directory full of empty files and committed them to git. + +即使文件中没有内容,你依旧可以从它的文件名推断功能。为了避免万一你无法理解,我在每条 `touch` 命令后面进行了简单描述。 + +通常,一个程序从一个简单 `main.c` 文件开始,只需要两三个函数便可以解决问题。然后程序员便可以向自己的朋友或者老板展示该程序,同时突然显示了文件提示框支持所有新的“功能”和“需求”。“程序俱乐部”的第一条规则便是不谈论“程序俱乐部”。第二条规则是最小化单个文件的功能。 + +坦率地说,C 编译器并不关心程序中的所有函数是否都在一个文件中。但是我们并不是为计算机或编译器写程序,我们是为其他人(有时也包括我们)而去写程序的。我知道这有些奇怪,但这就是事实。程序是计算机解决问题所采用的一系列算法,保证人们可以理解它们是非常重要的,即使问题的参数发生了意料之外的变化。当在人们修改程序时,发现一个文件中有 2049 函数时会诅咒你的。 + +因此,好的程序员会将函数分隔开,将相似的函数分组到不同的文件中。这里我用了三个文件 `main.c`,`mmencode.c` 和 `mmdecode.c`。对于这样的小程序,也许看起来有些过头了。但是小程序很难保证一直小下去,因此计划拓展是一个好主意。 + +但是那些 `.h` 文件呢?我会在后面解释一般的术语,简单地说,它们被称为头文件,同时它们可以包含 C 语言类型 和 C 预处理指令。头文件中不应该包含任何函数。你可以认为头文件和对应 `.c` 文件提供了用户编程接口(API)的定义,以便其他 `.c` 文件使用。 + +### 但是 Makefile 是什么呢? + +我知道所有的酷小孩都使用 “Ultra CodeShredder 3000” 集成开发环境来编写下一个轰动一时的应用,同时构建你的项目包括在 Ctrl-Meta-Shift-Alt-Super-B 上进行混搭。但是回到今天,使用 Makefile 文件可以帮助做很多有用的工作在构建 C 程序时。Makefile 是一个包含如何处理文件的方式的文本文件,程序员可以使用其自动地从源代码构建二进制程序(包括其他东西!) + +以下面这个小程序为例: + +``` +00 # Makefile +01 TARGET= my_sweet_program +02 $(TARGET): main.c +03    cc -o my_sweet_program main.c +``` + +‘#’ 符号后面的文本是注释,例如 00 行 + +01 行是一个变量赋值,将 `TARGET` 变量赋值为字符串 `my_sweet_program`。按照惯例我的习惯是,所有 Makefile 变量均使用大写字母并用下划线分隔单词。 + +02 行包含要创建的文件名和其依赖的文件。在本例中,构建目标是 `my_sweet_program`,其依赖是 `main.c`。 + +03 行是最后一行使用了一个制表符号(tab)而不是四个空格。这是将执行创建目标的命令。在本例中,我们使用 C 编译器前端 `cc` 以编译链接到 `my_sweet_program`。 + +使用 Makefile 是非常简单的。 + +``` +$ make +cc -o my_sweet_program main.c +$ ls +Makefile  main.c  my_sweet_program +``` + +将构建我们 MeowMeow 编码和解码器的 [Makefile][8] 比上面的例子要复杂,但其基本结构是相同的。我将在另一篇文章中将其分解为 Barney 风格。 + +### 形式伴随着功能 + +我的想法是程序从一个文件中读取,转换它,并将转换后的结果存储到另一个文件中。以下是我想象使用程序命令行交互时的情况: + +``` +        $ meow < clear.txt > clear.meow +        $ unmeow < clear.meow > meow.tx +        $ diff clear.txt meow.tx +        $ +``` + +我们需要编写命令行解析和处理输入/输出流的代码。我们需要一个函数对流进行编码并将结果写到另一个流中。最后,我们需要一个函数对流进行解码并将结果写到另一个流中。等一下,我们在讨论如何写一个程序,但是在上面的例子中,我调用了两个指令:`meow` 和 `unmeow`?我知道你可能会认为这会导致越变越复杂。 + +### 次要内容:argv[0] 和 ln 指令 + +回想一下,C 语言 main 函数的结构如下: + +``` +`int main(int argc, char *argv[])` +``` + +其中 `argc` 是命令行参数数量,`argv` 是字符指针列表(字符串)。`argv[0]` 是正在运行中的文件的路径。在 Unix 系统中许多互补功能的程序(比如:压缩和解压缩)看起来像两个命令,但事实上,它们在文件系统中是拥有两个名称的一个程序。使用 `ln` 命令通过创建文件系统链接来实现两个名称的功能。 + +一个在我笔记本中 `/usr/bin` 的例子如下: + +``` +   $ ls -li /usr/bin/git* +3376 -rwxr-xr-x. 113 root root     1.5M Aug 30  2018 /usr/bin/git +3376 -rwxr-xr-x. 113 root root     1.5M Aug 30  2018 /usr/bin/git-receive-pack +... +``` + +这里 `git` 和 `git-receive-pack` 是同一个文件但是拥有不同的名字。我们说它们是相同的文件因为它们具有相同的 inode 值(第一列)。inode 是一个 Unix 文件系统的特点,其超越了本文的内容。 + +优秀或懒惰的程序可以通过 Unix 文件系统此特点已达到写更少的代码但是交付双倍的程序。首先,我们编写一个基于其 `argv[0]` 的值而作出相应改变的程序,然后我们确保为该行为的名称创建链接。 + +在我们的 Makefile 中,`unmeow` 链接通过以下的方式来创建: + +``` + # Makefile + ... + $(DECODER): $(ENCODER) +         $(LN) -f $< $@ +        ... +``` + +我喜欢在 Makefile 中将所有内容参数化,很少使用 “裸” 字符串。我将所有的定义都放置在 Makefile 文件顶部,以便可以简单地找到并改变它们。当您尝试将程序移植到新的平台上时,需要将 `cc` 改变为 `xcc`时,这会产生很大影响。 + +除了两个内置变量 `$@` 和 `$<` 之外,其余的变量显得很简单的。第一个便是创建目标的快捷方式,在本例中,`$(DECODER)` (我记忆它因为它看起来像一个目标)。第二个,`$<` 是规则依赖项,在本例中,它解析为 `$(ENCODER)`。 + +事情当然在变得复杂,但是它易于管理。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/7/structure-multi-file-c-part-1 + +作者:[Erik O'Shaughnessy][a] +选题:[lujun9972][b] +译者:[萌新阿岩](https://github.com/mengxinayan) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jnyjnyhttps://opensource.com/users/jnyjnyhttps://opensource.com/users/jim-salterhttps://opensource.com/users/cldxsolutions +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_keyboard_coding.png?itok=E0Vvam7A (Programming keyboard.) +[2]: https://opensource.com/article/19/5/how-write-good-c-main-function +[3]: https://en.wikipedia.org/wiki/Unix +[4]: http://harmful.cat-v.org/cat-v/ +[5]: http://www.jabberwocky.com/software/moomooencode.html +[6]: https://giphy.com/gifs/nyan-cat-sIIhZliB2McAo +[7]: https://github.com/JnyJny/meowmeow +[8]: https://github.com/JnyJny/meowmeow/blob/master/Makefile From e97024fc175b0aa3be187f6c53d60d8af0d17b93 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Sat, 15 Feb 2020 18:44:21 +0800 Subject: [PATCH 022/315] fix issue --- ...wered by Ceph, and more industry trends.md | 66 ++ ...sma 5.18 LTS Released With New Features.md | 121 ++++ ... vs. proprietary- What-s the difference.md | 4 +- .../20200214 Linux is our love language.md | 83 +++ ...Background Story of AppImage -Interview.md | 128 ++++ ...-CD resources to set you up for success.md | 57 -- ...in one place with this open source tool.md | 72 -- ...ith this open source window environment.md | 115 --- ...Give an old MacBook new life with Linux.md | 81 --- ...00206 3 ways to use PostgreSQL commands.md | 230 ++++++ ...rd- Why Linux Users Going Crazy Over it.md | 2 +- ...ith This Single Command -Beginner-s Tip.md | 114 --- ... for the YaCy open source search engine.md | 100 --- ... Modern Looking Open Source XMPP Client.md | 2 +- ... the life of your SSD drive with fstrim.md | 161 ++++ ...o Change the Default Terminal in Ubuntu.md | 86 --- ... to use byobu to multiplex SSH sessions.md | 86 +++ ...tificates with the ssl-on-demand script.md | 685 ++++++++++++++++++ ...store a single-core computer with Linux.md | 270 +++++++ ... PHP Development on Fedora with Eclipse.md | 89 +++ ...190407 Manage multimedia files with Git.md | 246 ------- ...t I learned going from prison to Python.md | 102 --- ...Give an old MacBook new life with Linux.md | 83 +++ .../20200205 Getting started with GnuCash.md | 96 --- ...00206 3 ways to use PostgreSQL commands.md | 228 ------ ...ra to your Android phone with GSConnect.md | 2 +- ...e GeForce NOW Shamelessly Ignores Linux.md | 82 --- ...ith This Single Command -Beginner-s Tip.md | 114 +++ ... for the YaCy open source search engine.md | 99 +++ ...o Change the Default Terminal in Ubuntu.md | 86 +++ 30 files changed, 2306 insertions(+), 1384 deletions(-) create mode 100644 sources/news/20200211 Building a Linux desktop, CERN powered by Ceph, and more industry trends.md create mode 100644 sources/news/20200213 KDE Plasma 5.18 LTS Released With New Features.md rename sources/{tech => talk}/20200209 Open source vs. proprietary- What-s the difference.md (98%) create mode 100644 sources/talk/20200214 Linux is our love language.md create mode 100644 sources/talk/20200215 The Background Story of AppImage -Interview.md delete mode 100644 sources/tech/20191227 Top CI-CD resources to set you up for success.md delete mode 100644 sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md delete mode 100644 sources/tech/20200124 Run multiple consoles at once with this open source window environment.md delete mode 100644 sources/tech/20200203 Give an old MacBook new life with Linux.md create mode 100644 sources/tech/20200206 3 ways to use PostgreSQL commands.md delete mode 100644 sources/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md delete mode 100644 sources/tech/20200210 Top hacks for the YaCy open source search engine.md create mode 100644 sources/tech/20200212 Extend the life of your SSD drive with fstrim.md delete mode 100644 sources/tech/20200212 How to Change the Default Terminal in Ubuntu.md create mode 100644 sources/tech/20200212 How to use byobu to multiplex SSH sessions.md create mode 100644 sources/tech/20200212 Manage your SSL certificates with the ssl-on-demand script.md create mode 100644 sources/tech/20200214 How to restore a single-core computer with Linux.md create mode 100644 sources/tech/20200214 PHP Development on Fedora with Eclipse.md delete mode 100644 translated/tech/20190407 Manage multimedia files with Git.md delete mode 100644 translated/tech/20200112 What I learned going from prison to Python.md create mode 100644 translated/tech/20200203 Give an old MacBook new life with Linux.md delete mode 100644 translated/tech/20200205 Getting started with GnuCash.md delete mode 100644 translated/tech/20200206 3 ways to use PostgreSQL commands.md delete mode 100644 translated/tech/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md create mode 100644 translated/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md create mode 100644 translated/tech/20200210 Top hacks for the YaCy open source search engine.md create mode 100644 translated/tech/20200212 How to Change the Default Terminal in Ubuntu.md diff --git a/sources/news/20200211 Building a Linux desktop, CERN powered by Ceph, and more industry trends.md b/sources/news/20200211 Building a Linux desktop, CERN powered by Ceph, and more industry trends.md new file mode 100644 index 0000000000..424f69bcc2 --- /dev/null +++ b/sources/news/20200211 Building a Linux desktop, CERN powered by Ceph, and more industry trends.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Building a Linux desktop, CERN powered by Ceph, and more industry trends) +[#]: via: (https://opensource.com/article/20/2/linux-desktop-cern-more-industry-trends) +[#]: author: (Tim Hildred https://opensource.com/users/thildred) + +Building a Linux desktop, CERN powered by Ceph, and more industry trends +====== +A weekly look at open source community and industry trends. +![Person standing in front of a giant computer screen with numbers, data][1] + +As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. + +## [Building a Linux desktop for cloud-native development][2] + +> This post covers the building of my Linux Desktop PC for Cloud Native Development. I'll be covering everything from parts, to peripherals, to CLIs, to SaaS software with as many links and snippets as I can manage. I hope that you enjoy reading about my experience, learn something, and possibly go on to build your own Linux Desktop. + +**The impact**: I hope the irony is not lost on anyone that step 1, when doing cloud-native software development, is to install Linux on a physical computer. + +## [Enabling CERN’s particle physics research with open source][3] + +> Ceph is an open-source software-defined storage platform. While it’s not often in the spotlight, it’s working hard behind the scenes, playing a crucial role in enabling ambitious, world-renowned projects such as CERN’s particle physics research, Immunity Bio’s cancer research, The Human Brain Project, MeerKat radio telescope, and more. These ventures are propelling the collective understanding of our planet and the human race beyond imaginable realms, and the outcomes will forever change how we perceive our existence and potential.  + +**The impact**: It is not often that you get to see a straight line drawn between storage and the perception of human existence. Thanks for that, CERN! + +## [2020 cloud predictions][4] + +> "Serverless" as a concept provides a simplified developer experience that will become a platform feature. More platform-as-a-service providers will incorporate serverless traits into the daily activities developers perform when building cloud-native applications, becoming the default computing paradigm for the cloud. + +**The impact:** All of the trends in the predictions in this post are basically about maturation as ideas like serverless, edge computing, DevOps, and other cloud-adjacent buzz words move from the early adopters into the early majority phase of the adoption curve. + +## [End-of-life announcement for CoreOS Container Linux][5] + +> As we've [previously announced][6], [Fedora CoreOS][7] is the official successor to CoreOS Container Linux. Fedora CoreOS is a [new Fedora Edition][8] built specifically for running containerized workloads securely and at scale. It combines the provisioning tools and automatic update model of Container Linux with the packaging technology, OCI support, and SELinux security of Atomic Host. For more on the Fedora CoreOS philosophy, goals, and design, see the [announcement of the preview release][9] and the [Fedora CoreOS documentation][10]. + +**The impact**: Milestones like this are often bittersweet for both creators and users. The CoreOS team built something that their community loved to use, which is something to be celebrated. Hopefully, that community can find a [new home][11] in the wider [Fedora ecosystem][8]. + +_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/linux-desktop-cern-more-industry-trends + +作者:[Tim Hildred][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/thildred +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) +[2]: https://blog.alexellis.io/building-a-linux-desktop-for-cloud-native-development/ +[3]: https://insidehpc.com/2020/02/how-ceph-powers-exciting-research-with-open-source/ +[4]: https://www.devopsdigest.com/2020-cloud-predictions-2 +[5]: https://coreos.com/os/eol/ +[6]: https://groups.google.com/d/msg/coreos-user/zgqkG88DS3U/PFP9yrKbAgAJ +[7]: https://getfedora.org/coreos/ +[8]: https://fedoramagazine.org/fedora-coreos-out-of-preview/ +[9]: https://fedoramagazine.org/introducing-fedora-coreos/ +[10]: https://docs.fedoraproject.org/en-US/fedora-coreos/ +[11]: https://getfedora.org/en/coreos/ diff --git a/sources/news/20200213 KDE Plasma 5.18 LTS Released With New Features.md b/sources/news/20200213 KDE Plasma 5.18 LTS Released With New Features.md new file mode 100644 index 0000000000..8100290280 --- /dev/null +++ b/sources/news/20200213 KDE Plasma 5.18 LTS Released With New Features.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (KDE Plasma 5.18 LTS Released With New Features) +[#]: via: (https://itsfoss.com/kde-plasma-5-18-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +KDE Plasma 5.18 LTS Released With New Features +====== + +[KDE plasma][1] desktop is undoubtedly one of the most impressive [Linux desktop environments][2] available out there right now. + +Now, with the latest release, the KDE Plasma desktop just got more awesome! + +KDE Plasma 5.18 marks itself as an LTS (Long Term Support) release i.e it will be maintained by the KDE contributors for the next 2 years while the regular versions are maintained for just 4 months. + +![KDE Plasma 5.18 on KDE Neon][3] + +So, if you want more stability on your KDE-powered Linux system, it would be a good idea to upgrade to KDE’s Plasma 5.18 LTS release. + +### KDE Plasma 5.18 LTS Features + +Here are the main new features added in this release: + +#### Emoji Selector + +![Emoji Selector in KDE][4] + +Normally, you would Google an emoji to copy it to your clipboard or simply use the good-old emoticons to express yourself. + +Now, with the latest update, you get an emoji selector in Plasma Desktop. You can simply find it by searching for it in the application launcher or by just pressing (Windows key/Meta/Super Key) + . (**period/dot)**. + +The shortcut should come in handy when you need to use an emoji while sending an email or any other sort of messages. + +#### Global Edit Mode + +![Global Edit Mode][5] + +You probably would have used the old desktop toolbox on the top-right corner of the screen in the Plasma desktop, but the new release gets rid of that and instead – provides you with a global edit mode when you right-click on the desktop and click on “**Customize Layout**“. + +#### Night Color Control + +![Night Color Control][6] + +Now, you can easily toggle the night color mode right from the system tray. In addition to that, you can even choose to set a keyboard shortcut for both night color and the do not disturb mode. + +#### Privacy Improvements For User Feedback + +![Improved Privacy][7] + +It is worth noting that KDE Plasma lets you control the user feedback information that you share with them. + +You can either choose to disable sharing any information at all or control the level of information you share (basic, intermediate, and detailed). + +#### Global Themes + +![Themes][8] + +You can either choose from the default global themes available or download community-crafted themes to set up on your system. + +#### UI Improvements + +There are several subtle improvements and changes. For instance, the look and feel of the notifications have improved. + +You can also notice a couple of differences in the software center (Discover) to help you easily install apps. + +Not just limited to that, but you also get the ability to mute the volume of a window from the taskbar (just like you normally do on your browser’s tab). Similarly, there are a couple of changes here and there to improve the KDE Plasma experience. + +#### Other Changes + +In addition to the visual changes and customization ability, the performance of KDE Plasma has improved when coupled with a graphics hardware. + +To know more about the changes, you can refer the [official announcement post][9] for KDE Plasma 5.18 LTS. + +[Subscribe to our YouTube channel for more Linux videos][10] + +### How To Get KDE Plasma 5.18 LTS? + +If you are using a rolling release distribution like Arch Linux, you might have got it with the system updates. If you haven’t performed an update yet, simply check for updates from the system settings. + +If you are using Kubuntu, you can add the Kubuntu backports PPA to update the Plasma desktop with the following commands: + +``` +sudo add-apt-repository ppa:kubuntu-ppa/backports +sudo apt update && sudo apt full-upgrade +``` + +If you do not have KDE as your desktop environment, you can refer our article on [how to install KDE on Ubuntu][11] to get started. + +**Wrapping Up** + +KDE Plasma 5.18 may not involve a whole lot of changes – but being an LTS release, the key new features seem helpful and should come in handy to improve the Plasma desktop experience for everyone. + +What do you think about the latest Plasma desktop release? Feel free to let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/kde-plasma-5-18-release/ + +作者:[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://kde.org/plasma-desktop/ +[2]: https://itsfoss.com/best-linux-desktop-environments/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-plasma-5-18-info.jpg?ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-plasma-emoji-pick.jpg?ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-plasma-global-editor.jpg?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-plasma-night-color.jpg?ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/user-feedback-kde-plasma.png?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-plasma-global-themes.jpg?ssl=1 +[9]: https://kde.org/announcements/plasma-5.18.0.php +[10]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[11]: https://itsfoss.com/install-kde-on-ubuntu/ diff --git a/sources/tech/20200209 Open source vs. proprietary- What-s the difference.md b/sources/talk/20200209 Open source vs. proprietary- What-s the difference.md similarity index 98% rename from sources/tech/20200209 Open source vs. proprietary- What-s the difference.md rename to sources/talk/20200209 Open source vs. proprietary- What-s the difference.md index 7ff7ca5e30..2c6b6fce0b 100644 --- a/sources/tech/20200209 Open source vs. proprietary- What-s the difference.md +++ b/sources/talk/20200209 Open source vs. proprietary- What-s the difference.md @@ -37,7 +37,7 @@ Tools change. It's the way of things. Change can be frustrating, but it can be crippling when a service changes so severely that it breaks your workflow. A proprietary service has and maintains every right to change its product, and you explicitly accept this by using the product. If your favorite accounting software or scheduling web app changes its interface or its output options, you usually have no recourse but to adapt or stop using the service. Proprietary services reserve the right to remove features, arbitrarily and without warning, and it's not uncommon for companies to start out with an open API and strong compatibility with open source, only to drop these conveniences once its customer base has reached critical mass. -Open source changes, too. Changes in open source can be frustrating, too, and it can even drive users to alternative open source solutions. The difference is that when open source changes, you still own the unchanged code base. More importantly, lots of other people do too, and if there's enough desire for it, the project can be forked. There are several famous examples of this, but admittedly there are just as many examples where the demand was _not_ great enough, and users essentially had to adapt. +Open source changes, too. Changes in open source can be frustrating, too, and it can even drive users to alternative open source solutions. The difference is that when open source changes, you still own the unchanged code base. More importantly, lots of other people do too, and if there's enough desire for it, the project can be forked. There are several famous examples of this, but admittedly there are just as many examples where the demand was _not_ great enough, and users essentially had to adapt. Even so, users are never truly forced to do anything in open source. If you want to hack together an old version of your mission-critical service on an old distro running ancient libraries in a virtual machine, you can do that because you own the code. When a proprietary service changes, you have no choice but to follow. @@ -69,4 +69,4 @@ via: https://opensource.com/article/20/2/open-source-vs-proprietary [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_doodles.png?itok=W_0DOMM4 (Doodles of the word open) [2]: https://opensource.com/article/20/1/open-source-productivity-tools [3]: https://opensource.com/tags/tools -[4]: https://opensource.com/tags/analytics-and-metrics \ No newline at end of file +[4]: https://opensource.com/tags/analytics-and-metrics diff --git a/sources/talk/20200214 Linux is our love language.md b/sources/talk/20200214 Linux is our love language.md new file mode 100644 index 0000000000..397ddee4d3 --- /dev/null +++ b/sources/talk/20200214 Linux is our love language.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux is our love language) +[#]: via: (https://opensource.com/article/20/2/linux-love-language) +[#]: author: (Christopher Cherry https://opensource.com/users/chcherry) + +Linux is our love language +====== +When a wife teaches a husband some new tech skills, they both learn a +lot more than they expect. +![Red heart with text "you are not alone"][1] + +2019 was a year of learning in the Cherry household. I am a senior software engineer who set out to learn new skills and, along the way, I taught my husband, Chris. By teaching him some of the things I learned and asking him to work through my technology walkthrough articles, I helped Chris learn new skills that enabled him to pivot his career deeper into the technology field. And I learned new ways to make my walkthroughs and training materials more accessible for readers to digest. + +In this article, we talk about what we learned individually and from each other, then we explore what it means for their future. + +### Questions for the student + +**Jess:** Chris, what made you want to learn more about my field? + +**Chris:** It was primarily to further my career. Being in network engineering has shown me that being an expert only on networks is not as valuable as it once was, and I have to know a little bit of everything. Since the network is often blamed for outages or application challenges these days, I wanted to understand more from a developer's perspective on writing applications so I could see how they depend on the network as a resource. + +**Jess:** What did I teach you first, and what did you learn from it? + +**Chris:** It all started with installing Linux for the first time, then adding [Ansible][2]. Each Linux distribution I worked with was easy enough to install, as long as the hardware was compatible, but compatibility wasn't always clear. That meant sometimes I learned first-hand how to troubleshoot Linux within the first five minutes of running an installation (and I liked it). Ansible gave me a reason to learn Linux package managers to install the software. Once it was installed, I quickly learned how package management handles dependencies as I looked at the files that yum installed, so Ansible, which is written in Python, can run on my system. From there, I started to install all kinds of applications with Ansible. + +**Jessica:** Do you like the way I taught you? + +**Chris:** We had our struggles at first, until we ironed out how I like to learn and how you should present the best way for me to learn. In the beginning, it was hard to follow what you meant. For instance, when you said things like "a Docker container," I had no reference to what you were talking about. Early on, the response was, "well, it's a container," which meant nothing to me at the time. Once I got you to explain it in more detail, it became a lot more fun to learn. + +**Jess:** To be fair, this was a big lesson for me as well. I hadn't trained anyone with less knowledge on this technology than me before you, so you helped me realize that I needed to be clearer with my explanations. Thanks for that. + +How did you feel about testing my articles, the ones where I had you run through the steps? + +**Chris:** Personally, I thought it would be easy, and boy, was I wrong. One of the main things I learned from these, like your [introduction to Vagrant][3], was how each Linux distribution varies more than I realized. The operating system (OS) changes how you set it up, the requirements to run, and the specific commands. It seems like a lot more variability than there is with the network gear I've worked on. So I started to pay a lot more attention to the instructions and whether they were written for my OS or another one (and how difficult it can be to know sometimes). I seemed to break a lot of things along the way. + +**Jess:** I break stuff all day, so different paths for different problems are daily occurrences for me. + +### Questions for the teacher + +**Chris:** Jess, would you change anything with the way you taught me so far? + +**Jess:** I'd have liked to make you read more, as I do. Learning new technology has me churning through books. I read a book and a half, if not two books, a week, and that's with spending one hour in the morning and one hour before bed every day. I also pick one project to run through for two weeks for about an hour a day to reinforce the book skills. And that's in addition to the tech articles I read for the first hour of my day while taking in an immense amount of coffee. When I think about your goal to grow your career, I think books are an important element alongside the great blog posts and articles we talk about. I feel my reading regiment has kept me up to speed, and if you did the same, you would catch up to me pretty quickly. + +**Chris:** So did the student teach the teacher in any way? + +**Jess:** I learned a great deal about being patient from you. For instance, after walking through an installation of Ansible, I asked what you wanted to do next. Your first answer was, "I don't know," which was hard for me because I want you to learn what you want to learn. So I changed my approach, and now we talk more about what you want to achieve before walking through installing anything. When we moved on to the Vagrant article we worked on together, I created it with an end goal in mind, so we had something to achieve right away. + +This actually made a massive change in how I do training at work. Now I ask more questions on how people learn and work hand-in-hand more often than I did before. I am more likely to sit and go through and make sure someone understands what I'm saying and what we're doing. I wasn't really before. + +### What we learned together + +As a couple, we both grew from collaborating on technology over the last year. + +**Chris:** I'm blown away at how much I learned. Over the course of a year, I understand new operating systems, how to use an API, web application deployment with Ansible, and standing up virtual machines with Vagrant. I also learned how documentation makes life better, so it's worth the time it takes to write some. In this field of work, however, behavior isn't always documented, so I've learned to be ready to work through tough issues and document how I fix them. + +**Jess:** Beyond what I learned from teaching you, I've focused on learning a good deal about Kubernetes in cloud environments. That includes deployment strategies, the complexity of the Kubernetes API, building my own containers, and securing these environments. I've also saved time to dabble: toying around with serverless code, AI models, Python, and graphically displaying heat maps. It's been a good year. + +What's next for us? It's yet to be seen, but I can assure you that we're going to share it here on Opensource.com. + +**Who did you mentor in 2019, or who are you mentoring in 2020? Tell us about it in the comments.** + +I can see the brightness of curiosity in my six year old niece Shuchi's eyes when she explores a... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/linux-love-language + +作者:[Christopher Cherry][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/chcherry +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/red-love-heart-alone-stone-path.jpg?itok=O3q1nEVz (Red heart with text "you are not alone") +[2]: https://opensource.com/resources/what-ansible +[3]: https://opensource.com/resources/vagrant diff --git a/sources/talk/20200215 The Background Story of AppImage -Interview.md b/sources/talk/20200215 The Background Story of AppImage -Interview.md new file mode 100644 index 0000000000..d3e95a1a0f --- /dev/null +++ b/sources/talk/20200215 The Background Story of AppImage -Interview.md @@ -0,0 +1,128 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Background Story of AppImage [Interview]) +[#]: via: (https://itsfoss.com/appimage-interview/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +The Background Story of AppImage [Interview] +====== + +As a Linux user, you might have come across [AppImages][1]. This is a portable packaging format that allows you to run an application on any Linux distribution. + +[Using AppImage][2] is really simple. You just need to give it execute permission and double click to run it, like the .exe files in Windows. This solves a major problem in Linux as different kind of distributions have different kind of packaging formats. You cannot [install .deb files][3] (of Debian/Ubuntu) on [Fedora][4] and vice versa. + +We talked to Simon, the developer of AppImage, about how and why he created this project. Read some of the interesting background story and insights Simon shares about AppImage. + +### Interacting with Simon Peter, the creator of AppImage + +![][5] + +_**It’s FOSS: Few people know about the person behind AppImage. How about sharing a little background information about yourself?**_ + +**Simon:** Hi, I’m Simon Peter, based near Frankfurt in Germany. My background is in Economics and Business Administration, but I’ve always been a tinkerer and hacker in my free time, and been working in tech ever since I graduated. + +AppImage, though, is strictly a hobby which I enjoy working on in my spare time. I do a lot of my AppImage work while I’m on a train going from here to there. Somehow I seem to be on the move all the time. Professionally, I work in the product management of a large telecommunications company. + +_**It’s FOSS: Why did you create AppImage?**_ + +**Simon:** The first computer I could get my hands on was a [Macintosh][6] in the late 80s. For me, this is the benchmark when it comes to simplicity and usability. When I started to experiment with Linux on the desktop, I always wished it was as elegant and simple to operate and gave me as much flexibility as the early Macs. + +When I tried Linux for the first time in the late 90s, I had to go through a cumbersome process formatting and partitioning hard disks, installing stuff – it took a lot of time and was really cumbersome. A couple of years later, I tried out a Linux Live CD-ROM. It was a complete game changer. You popped in the CD, booted the computer, and everything just worked, right out of the box. No installation, no configuration. The system was always in factory-new state whenever you rebooted the machine. Exactly how I liked it. + +There was only one downside: You could not install additional applications on a read-only CD. Packages always insisted on writing in /usr, where the Live CD was not writeable. Thus, I asked myself: Why can’t I just put applications wherever I want, like on a USB drive or a network share, as I am used from the Mac? How cool would it be if every application was just one single file that I could put wherever I want? And thus the idea for AppImage was born (back then under the name of “klik”). + +Turns out that over time Live systems have become more capable, but I still like the simplicity and freedom that comes with the “one app = one file” idea. For example, I want to be in control of where stuff resides on my hard disks. I want to decide what to update or not to update and when. For most tasks I need a stable, rarely-changing operating system with the latest applications. To this day all I ever run are Live systems, because the operating system “just works” out of the box without any installation or configuration on my side, and every time I reboot the machine I have a “factory new”, known-good state. + +_**It’s FOSS: What challenges did you face in the past and what challenges are you facing right now?**_ + +**Simon:** People told me that the idea was nuts, and I had no clue how “things are done on Linux”. Just about when I was beginning to give in, I came across a video of [Linus Torvalds][7] of all people who I noticed was complaining about many of the same things that I always had felt were too complicated when it came to distributing applications for Linux. While I was watching his rant, I also noticed, hey, AppImage actually solves many of those issues. Some time later, Linus came across AppImage, and he apparently liked the idea. That made me think, maybe it’s not that stupid an idea as people had made me believe all the time up to that point. + +Today, people tend to mention AppImage as “one of the new package formats” together with [Snap][8] and [Flatpak][9]. I think that’s comparing apples to oranges. Not only is AppImage not “new” (it’s been around since well over a decade by now), but also it has very different objectives and design principles than the other systems. AppImage is all about single-file application bundles that can be “managed” by nothing else than a web browser and a file manager. It’s meant for “mere morals”, end users, not system administrators. It needs no package manager, it needs no root rights, it needs nothing to be installed on the system. It gives complete freedom to application developers and users. + +_**It’s FOSS: AppImage is a “universal packaging system” and there you compete with Snap (backed by Ubuntu) and Flatpak (backed by Fedora). How do you plan to ‘fight’ against these big corporates?**_ + +**Simon:** See? That’s what I mean. AppImage plays in an entirely different playing field. + +AppImage wants to be what exe files or PortableApps are for Windows and what apps inside dmg files are on the Mac – but better. + +Besides, Snap (backed by [Canonical][10]) does not work out-of-the-box on Fedora, and Flatpak (backed by [Red Hat][11]) does not work out-of-the-box on Ubuntu. AppImages can run on either system, and many more, without the need to install anything. + +_**It’s FOSS: How do you see the adoption of AppImage? Are you happy with its growth?**_ + +**Simon:** As of early 2020, there are now around 1,000 official AppImages made by the respective application authors that are passing my compatibility tests and can run on the oldest still-supported Ubuntu LTS release, and hundreds more are being worked on as we speak. “Household name” applications like Inkscape, Kdenlive, KDevelop, LibreOffice, PrusaSlicer, Scribus, Slic3r, Ultimaker Cura (too many to name them all) are being distributed in AppImage format. This makes me very happy and I am always excited when I read about a new version being released on Twitter, and then am able to download and run the AppImage instantly, without having to wait for my Linux distribution to carry that new version, and without having to throw away the old (known-good) version just because I want to try out the new (bleeding edge) one. + +The adoption of AppImage is especially strong for nightly and continuous builds. This is because the “one app = one file” concept of AppImage lends itself especially well to try-out software, where you keep multiple versions around for testing purposes, and never have to install anything into the running system. Worst thing that can happen with AppImage is that an application does not launch. In that case, file a bug, delete the file, done. Worst thing that can happen with distribution packages: complete system breakage… + +_**It’s FOSS: One major issue with AppImage is that not all the developers provide an easy way of updating the AppImage versions. Any suggestions for handling it?**_ + +**Simon:** AppImage has this concept of “binary delta updates”. Think of it as “diff for applications”. A new version of an application comes out, you download only the parts that have changed, and apply them to the old version. As a result, you get both the old and the new version and can keep them in parallel until you have determined that you don’t need the old version any longer, and throw it away. + +In general, I don’t want to enforce anything with AppImage. Application authors are at liberty to control the whole experience. Up to now, application authors have to do some setup work to make AppImages with this update capability. That being said, I am convinced that if we make it easy enough for developers to get working binary delta updates “for free”, then many will offer them. To this end, I am currently working on a new set of tools written in Go that will set up updates almost automatically, and I hope this will significantly increase the percentage of AppImages that come with this capability. + +_**It’s FOSS: [Nitrux][12] is one of the rare distributions that relies heavily on AppImage. Or there any other such distributions? What can be done make AppImage more popular?**_ + +**Simon:** Linux distributions traditionally have thought of themselves as more than just the base operating system itself – they also wanted to control application distribution. Now, as Apple and Microsoft are trying to get more control over application distribution on their desktop platforms, the trend is slowly reversing in Linux land where people are slowly beginning to understand that distributions could be much more polished if they focused on the base operating system and left the packaging of applications to the application authors. + +To make AppImage more popular, I think users and application authors should continue to spread the word that upstream-provided AppImages are in many cases working better than distribution packages. With AppImage, you get a software stack where the application author had a chance to cherry-pick which versions of libraries work together, test and tune both functionality and performance. Who is surprised that the result tends to work better than a “random” combination of whatever versions happened to be in a Linux distribution at a certain, random point in time when a distribution release was put together? + +[Desktop environments][13] could greatly increase usability, not only for AppImages, but also for any other kind of “side-loaded” applications that are not being installed. Just see how a desktop environments handles double-clicking on an executable file that is missing the executable bit. Some are doing a great job in this regard, like [Deepin Linux][14]. Stuff tends to “just work” there as it should. + +Finally, I am currently working on a new set of tools written in Go which I hope will greatly simplify, and make yet more enjoyable, the production and consumption of AppImages. My goal here is to make things less complex for users, remove the need for configuration, make things “just work”, like on the early Macintoshes. Are there any Go developers out here interested to join the effort? + +_**It’s FOSS: I can see there is a website that lists available AppImage applications. Do you have plans to integrate it with other software managers on Linux or create a software manager for AppImage?**_ + +**Simon:** [appimage.github.io][15] lists AppImages that have passed my compatibility tests on the oldest still-supported Ubuntu LTS release. Projects creating app stores or software managers are free to use this data. Myself, I am not much interested in those things as I always download AppImages right from the respective project’s download pages. My typical AppImage discovery goes like this: + + 1. Read on Twitter that PrusaSlicer has this cool new feature + 2. Go to the PrusaSlicer GitHub project and read the release notes there + 3. While there, download the AppImage and have it running a few seconds later + + + +So for me personally, I have no need for app centers and app stores, but if people like them, they are free to put AppImages in there. I just never felt the need… + +_**It’s FOSS: What plans do you have for AppImage in future (new features that you plan to add)?**_ + +**Simon:** Simplify things even more, remove configuration options, make things “just work”. Reduce the number of GitHub projects needed to get the core AppImage experience for producing and consuming AppImages, including aspects like binary delta updates, sandboxing, etc. Improve usability. + +_**It’s FOSS: Does AppImage project makes money? What kind of support (if any) do you seek from the end users?**_ + +**Simon:** No, AppImage makes no money whatsoever. + +I’ll just request the readers to spread the word. Tell your favorite application’s authors that you’d like to see an AppImage, and why. + +* * * + +Team It’s FOSS congratulates Simon for his hard work. Please feel free to convey any message and queries to him in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/appimage-interview/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://appimage.org/ +[2]: https://itsfoss.com/use-appimage-linux/ +[3]: https://itsfoss.com/install-deb-files-ubuntu/ +[4]: https://getfedora.org/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/appimage_simon_interview.jpg?ssl=1 +[6]: https://en.wikipedia.org/wiki/Macintosh +[7]: https://itsfoss.com/linus-torvalds-facts/ +[8]: https://itsfoss.com/install-snap-linux/ +[9]: https://flatpak.org/ +[10]: https://canonical.com/ +[11]: https://www.redhat.com/en +[12]: https://itsfoss.com/nitrux-linux-overview/ +[13]: https://itsfoss.com/best-linux-desktop-environments/ +[14]: https://www.deepin.org/en/ +[15]: https://appimage.github.io/ diff --git a/sources/tech/20191227 Top CI-CD resources to set you up for success.md b/sources/tech/20191227 Top CI-CD resources to set you up for success.md deleted file mode 100644 index 7c4d0db4db..0000000000 --- a/sources/tech/20191227 Top CI-CD resources to set you up for success.md +++ /dev/null @@ -1,57 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Morisun029) -[#]: reviewer: (wxy) -[#]: publisher: (wxy) -[#]: url: (https://linux.cn/article-11875-1.html) -[#]: subject: (Top CI/CD resources to set you up for success) -[#]: via: (https://opensource.com/article/19/12/cicd-resources) -[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) - -顶级 CI / CD 资源,助你成功 -====== - -> 随着企业期望实现无缝、灵活和可扩展的部署,持续集成和持续部署成为 2019 年的关键主题。 - -![Plumbing tubes in many directions][1] - -对于 CI/CD 和 DevOps 来说,2019 年是非常棒的一年。Opensource.com 的作者分享了他们专注于无缝、灵活和可扩展部署时是如何朝着敏捷和 scrum 方向发展的。以下是我们 2019 年发布的 CI/CD 文章中的一些重要文章。 - -### 学习和提高你的 CI/CD 技能 - -我们最喜欢的一些文章集中在 CI/CD 的实操经验上,并涵盖了许多方面。通常以 [Jenkins][2] 管道开始,Bryant Son 的文章《[用 Jenkins 构建 CI/CD 管道][3]》将为你提供足够的经验,以开始构建你的第一个管道。Daniel Oh 在《[用 DevOps 管道进行自动验收测试][4]》一文中,提供了有关验收测试的重要信息,包括可用于自行测试的各种 CI/CD 应用程序。我写的《[安全扫描 DevOps 管道][5]》非常简短,其中简要介绍了如何使用 Jenkins 平台在管道中设置安全性。 - -### 交付工作流程 - -正如 Jithin Emmanuel 在《[Screwdriver:一个用于持续交付的可扩展构建平台][6]》中分享的,在学习如何使用和提高你的 CI/CD 技能方面,工作流程很重要,特别是当涉及到管道时。Emily Burns 在《[为什么 Spinnaker 对 CI/CD 很重要][7]》中解释了灵活地使用 CI/CD 工作流程准确构建所需内容的原因。Willy-Peter Schaub 还盛赞了为所有产品创建统一管道的想法,以便《[在一个 CI/CD 管道中一致地构建每个产品][8]》。这些文章将让你很好地了解在团队成员加入工作流程后会发生什么情况。 - -### CI/CD 如何影响企业 - -2019 年也是认识到 CI/CD 的业务影响以及它是如何影响日常运营的一年。Agnieszka Gancarczyk 分享了 Red Hat 《[小型 Scrum vs. 大型 Scrum][9]》的调查结果, 包括受访者对 Scrum、敏捷运动及对团队的影响的不同看法。Will Kelly 的《[持续部署如何影响整个组织][10]》,也提及了开放式沟通的重要性。Daniel Oh 也在《[DevOps 团队必备的 3 种指标仪表板][11]》中强调了指标和可观测性的重要性。最后是 Ann Marie Fred 的精彩文章《[不在生产环境中测试?要在生产环境中测试!][12]》详细说明了在验收测试前在生产环境中测试的重要性。 - -感谢许多贡献者在 2019 年与 Opensource 的读者分享他们的见解,我期望在 2020 年里从他们那里了解更多有关 CI/CD 发展的信息。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/cicd-resources - -作者:[Jessica Cherry][a] -选题:[lujun9972][b] -译者:[Morisun029](https://github.com/Morisun029) -校对:[wxy](https://github.com/wxy) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jrepka -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions) -[2]: https://jenkins.io/ -[3]: https://linux.cn/article-11546-1.html -[4]: https://opensource.com/article/19/4/devops-pipeline-acceptance-testing -[5]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline -[6]: https://opensource.com/article/19/3/screwdriver-cicd -[7]: https://opensource.com/article/19/8/why-spinnaker-matters-cicd -[8]: https://opensource.com/article/19/7/cicd-pipeline-rule-them-all -[9]: https://opensource.com/article/19/3/small-scale-scrum-vs-large-scale-scrum -[10]: https://opensource.com/article/19/7/organizational-impact-continuous-deployment -[11]: https://linux.cn/article-11183-1.html -[12]: https://opensource.com/article/19/5/dont-test-production \ No newline at end of file diff --git a/sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md b/sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md deleted file mode 100644 index 7ff7ca5e30..0000000000 --- a/sources/tech/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md +++ /dev/null @@ -1,72 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Open source vs. proprietary: What's the difference?) -[#]: via: (https://opensource.com/article/20/2/open-source-vs-proprietary) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Open source vs. proprietary: What's the difference? -====== -Need four good reasons to tell your friends to use open source? Here's -how to make your case. -![Doodles of the word open][1] - -There's a lot to be learned from open source projects. After all, managing hundreds of disparate, asynchronous commits and bugs doesn't happen by accident. Someone or something has to coordinate releases, and keep all the code and project roadmaps organized. It's a lot like life. You have lots of tasks demanding your attention, and you have to tend to each in turn. To ensure everything gets done before its deadline, you try to stay organized and focused. - -Fortunately, there are [applications out there][2] designed to help with that sort of thing, and many apply just as well to real life as they do to software. - -Here are some reasons for choosing [open tools][3] when improving personal or project-based organization. - -### Data ownership - -It's rarely profitable for proprietary tools to provide you with [data][4] dumps. Some products, usually after a long battle with their users (and sometimes a lawsuit), provide ways to extract your data from them. But the real issue isn't whether a company lets you extract data; it's the fact that the capability to get to your data isn't guaranteed in the first place. It's your data, and when it's literally what you do each day, it is, in a way, your life. Nobody should have primary access to that but you, so why should you have to petition a company for a copy? - -Using an open source tool ensures you have priority access to your own activities. When you need a copy of something, you already have it. When you need to export it from one application to another, you have complete control of how the data is exchanged. If you need to export your schedule from a calendar into your kanban board, you can manipulate and process the data to fit. You don't have to wait for functionality to be added to the app, because you own the data, the database, and the app. - -### Working for yourself - -When you use open source tools, you often end up improving them, sometimes whether you know it or not. You may not (or you may!) download the source and hack on code, but you probably fall into a way of using the tool that works best for you. You optimize your interaction with the tool. The unique way you interact with your tooling creates a kind of meta-tool: you haven't changed the software, but you've adapted it and yourself in ways that the project author and a dozen other users never imagined. Everyone does this with whatever software they rely upon, and it's why sitting at someone else's computer to use a familiar software (or even just looking over someone's shoulder) often feels foreign, like you're using a different version of the application than you're used to. - -When you do this with proprietary software, you're either contributing to someone else's marketplace for free, or you're adjusting your own behavior based on forces outside your own control. When you optimize an open source tool, both the software and the interaction belong to you. - -### The right to not upgrade - -Tools change. It's the way of things. - -Change can be frustrating, but it can be crippling when a service changes so severely that it breaks your workflow. A proprietary service has and maintains every right to change its product, and you explicitly accept this by using the product. If your favorite accounting software or scheduling web app changes its interface or its output options, you usually have no recourse but to adapt or stop using the service. Proprietary services reserve the right to remove features, arbitrarily and without warning, and it's not uncommon for companies to start out with an open API and strong compatibility with open source, only to drop these conveniences once its customer base has reached critical mass. - -Open source changes, too. Changes in open source can be frustrating, too, and it can even drive users to alternative open source solutions. The difference is that when open source changes, you still own the unchanged code base. More importantly, lots of other people do too, and if there's enough desire for it, the project can be forked. There are several famous examples of this, but admittedly there are just as many examples where the demand was _not_ great enough, and users essentially had to adapt. - -Even so, users are never truly forced to do anything in open source. If you want to hack together an old version of your mission-critical service on an old distro running ancient libraries in a virtual machine, you can do that because you own the code. When a proprietary service changes, you have no choice but to follow. - -With open source, you can choose to forge your own path when necessary or follow the developers when convenient. - -### Open for collaboration - -Proprietary services can affect others in ways you may not realize. Closed source tools are accidentally insidious. If you use a proprietary product to manage your schedule or your recipes or your library, or you use a proprietary font in your graphic design or website, then the moment you need to coordinate with someone else, you are essentially forcing them to sign up for the same proprietary service because proprietary services usually require accounts. Of course, the same is sometimes true for an open source solution, but it's not common for open source products to collect and sell user data the way proprietary vendors do, so the stakes aren't quite the same. - -### Independence - -Ultimately, the open source advantage is one of independence for you and for those you want to collaborate with. Not everyone uses open source, and even if everyone did not everyone would use the exact same tool or the same assets, so there will always be some negotiation when sharing data. However, by keeping your data and projects open, you enable everyone (your future self included) to contribute. - -What steps do you take to ensure your work is open and accessible? Tell us in the comments! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/open-source-vs-proprietary - -作者:[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/EDUCATION_doodles.png?itok=W_0DOMM4 (Doodles of the word open) -[2]: https://opensource.com/article/20/1/open-source-productivity-tools -[3]: https://opensource.com/tags/tools -[4]: https://opensource.com/tags/analytics-and-metrics \ No newline at end of file diff --git a/sources/tech/20200124 Run multiple consoles at once with this open source window environment.md b/sources/tech/20200124 Run multiple consoles at once with this open source window environment.md deleted file mode 100644 index 97c2849b60..0000000000 --- a/sources/tech/20200124 Run multiple consoles at once with this open source window environment.md +++ /dev/null @@ -1,115 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Run multiple consoles at once with this open source window environment) -[#]: via: (https://opensource.com/article/20/1/multiple-consoles-twin) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Run multiple consoles at once with this open source window environment -====== -Simulate the old-school DESQview experience with twin in the fourteenth -in our series on 20 ways to be more productive with open source in 2020. -![Digital creative of a browser on the internet][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### Overcome "one screen, one app" limits with twin - -Who remembers [DESQview][2]? It allowed for things in DOS we take for granted now in Windows, Linux, and MacOS—namely the ability to run and have multiple programs running onscreen at once. In my early days running a dial-up BBS, DESQview was a necessity—it enabled me to have the BBS running in the background while doing other things in the foreground. For example, I could be working on new features or setting up new external programs while someone was dialed in without impacting their experience. Later, in my early days in support, I could have my work email ([DaVinci email on MHS][3]), the support ticket system, and other DOS programs running all at once. It was amazing! - -![twin][4] - -Running multiple console applications has come a long way since then. But applications like [tmux][5] and [Screen][6] still follow the "one screen, one app" kind of display. OK, yes, tmux has screen splitting and panes, but not like DESQview, with the ability to "float" windows over others, and I, for one, miss that. - -Enter [twin][7], the text-mode window environment. This relatively young project is, in my opinion, a spiritual successor to DESQview. It supports console and graphical environments, as well as the ability to detach from and reattach to sessions. It's not as easy to set up as some things, but it will run on most modern operating systems. - -Twin is installed from source (for now). But first, you need to install the required development libraries. The library names will vary by operating system. The following example shows it for my Ubuntu 19.10 installation. Once the libraries are installed, check out the twin source from Git and run **./configure** and **make**, which should auto-detect everything and build twin: - - -``` -sudo apt install libx11-dev libxpm-dev libncurses-dev zlib1g-dev libgpm-dev -git clone [git@github.com][8]:cosmos72/twin.git -cd twin -./configure -make -sudo make install -``` - -Note: If you are compiling this on MacOS or BSD, you will need to comment out **#define socklen_t int** in the files **include/Tw/autoconf.h** and **include/twautoconf.h** before running **make**. This should be addressed by [twin issue number 57][9]. - -![twin text mode][10] - -Invoking twin for the first time can be a bit of a challenge. You need to tell it what kind of display it is using with the **\--hw** parameter. For example, to launch a text-mode version of twin, you would enter **twin --hw=tty,TERM=linux**. The **TERM** variable specifies an override to the current terminal variable in your shell. To launch a graphical version, run **twin --hw=X@$DISPLAY**. On Linux, twin mostly "just works," and on MacOS, it mostly only works in terminals. - -The _real_ fun comes with the ability to attach to running sessions with the **twattach** and **twdisplay** commands. They allow you to attach to a running twin session somewhere else. For example, on my Mac, I can run the following command to connect to the twin session running on my demo box: - - -``` -`twdisplay --twin@20days2020.local:0 --hw=tty,TERM=linux` -``` - -![remote twin session][11] - -With some extra work, you can also use it as a login shell in place of [getty][12] on consoles. This requires the gdm mouse daemon, the twdm application (included), and a little extra configuration. On systems that use systemd, start by installing and enabling gdm (if it isn't already installed). Then use systemctl to create an override for a console (I used tty6). The commands must be run as the root user; on Ubuntu, they look something like this: - - -``` -apt install gdm -systemctl enable gdm -systemctl start gdm -systemctl edit getty@tty6 -``` - -The **systemctl edit getty@tty6** command will open an empty file named **override.conf**. This defines systemd service settings to override the default for console 6. Update the contents to: - - -``` -[service] -ExecStart= -ExecStart=-/usr/local/sbin/twdm --hw=tty@/dev/tty6,TERM=linux -StandardInput=tty -StandardOutput=tty -``` - -Now, reload systemd and restart tty6 to get a twin login prompt: - - -``` -systemctl daemon-reload -systemctl restart getty@tty6 -``` - -![twin][13] - -This will launch a twin session for the user who logs in. I do not recommend this for a multi-user system, but it is pretty cool for a personal desktop. And, by using **twattach** and **twdisplay**, you can access that session from the local GUI or remote desktops. - -I think twin is pretty darn cool. It has some rough edges, but the basic functionality is there, and it has some pretty good documentation. Also, it scratches the itch I have for a DESQview-like experience on modern operating systems. I look forward to improvements over time, and I hope you like it as much as I do. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/multiple-consoles-twin - -作者:[Kevin Sonney][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/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) -[2]: https://en.wikipedia.org/wiki/DESQview -[3]: https://en.wikipedia.org/wiki/Message_Handling_System -[4]: https://opensource.com/sites/default/files/uploads/productivity_14-1.png (twin) -[5]: https://github.com/tmux/tmux/wiki -[6]: https://www.gnu.org/software/screen/ -[7]: https://github.com/cosmos72/twin -[8]: mailto:git@github.com -[9]: https://github.com/cosmos72/twin/issues/57 -[10]: https://opensource.com/sites/default/files/uploads/productivity_14-2.png (twin text mode) -[11]: https://opensource.com/sites/default/files/uploads/productivity_14-3.png (remote twin session) -[12]: https://en.wikipedia.org/wiki/Getty_(Unix) -[13]: https://opensource.com/sites/default/files/uploads/productivity_14-4.png (twin) diff --git a/sources/tech/20200203 Give an old MacBook new life with Linux.md b/sources/tech/20200203 Give an old MacBook new life with Linux.md deleted file mode 100644 index 99bddf8fab..0000000000 --- a/sources/tech/20200203 Give an old MacBook new life with Linux.md +++ /dev/null @@ -1,81 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (qianmingtian) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Give an old MacBook new life with Linux) -[#]: via: (https://opensource.com/article/20/2/macbook-linux-elementary) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) - -Give an old MacBook new life with Linux -====== -Elementary OS's latest release, Hera, is an impressive platform for -resurrecting an outdated MacBook. -![Coffee and laptop][1] - -When I installed Apple's [MacOS Mojave][2], it slowed my formerly reliable MacBook Air to a crawl. My computer, released in 2015, has 4GB RAM, an i5 processor, and a Broadcom 4360 wireless card, but Mojave proved too much for my daily driver—it made working with [GnuCash][3] impossible, and it whetted my appetite to return to Linux. I am glad I did, but I felt bad that I had this perfectly good MacBook lying around unused. - -I tried several Linux distributions on my MacBook Air, but there was always a gotcha. Sometimes it was the wireless card; another time, it was a lack of support for the touchpad. After reading some good reviews, I decided to try [Elementary OS][4] 5.0 (Juno). I [made a boot drive][5] with my USB creator and inserted it into the MacBook Air. I got to a live desktop, and the operating system recognized my Broadcom wireless chipset—I thought this just might work! - -I liked what I saw in Elementary OS; its [Pantheon][6] desktop is really great, and its look and feel are familiar to Apple users—it has a dock at the bottom of the display and icons that lead to useful applications. I liked the preview of what I could expect, so I decided to install it—and then my wireless disappeared. That was disappointing. I really liked Elementary OS, but no wireless is a non-starter. - -Fast-forward to December 2019, when I heard a review on the [Linux4Everyone][7] podcast about Elementary's latest release, v.5.1 (Hera) bringing a MacBook back to life. So, I decided to try again with Hera. I downloaded the ISO, created the bootable drive, plugged it in, and this time the operating system recognized my wireless card. I was in business! - -![MacBook Air with Hera][8] - -I was overjoyed that my very light, yet powerful MacBook Air was getting a new life with Linux. I have been exploring Elementary OS in greater detail, and I can tell you that I am impressed. - -### Elementary OS's features - -According to [Elementary's blog][9], "The newly redesigned login and lock screen greeter looks sharper, works better, and fixes many reported issues with the previous greeter including focus issues, HiDPI issues, and better localization. The new design in Hera was in response to user feedback from Juno, and enables some nice new features." - -"Nice new features" in an understatement—Elementary OS easily has one of the best-designed Linux user interfaces I have ever seen. A System Settings icon is on the dock by default; it is easy to change the settings, and soon I had the system configured to my liking. I need larger text sizes than the defaults, and the Universal Access controls are easy to use and allow me to set large text and high contrast. I can also adjust the dock with larger icons and other options. - -![Elementary OS's Settings screen][10] - -Pressing the Mac's Command key brings up a list of keyboard shortcuts, which is very helpful to new users. - -![Elementary OS's Keyboard shortcuts][11] - -Elementary OS ships with the [Epiphany][12] web browser, which I find quite easy to use. It's a bit different than Chrome, Chromium, or Firefox, but it is more than adequate. - -For security-conscious users (as we should all be), Elementary OS's Security and Privacy settings provide multiple options, including a firewall, history, locking, automatic deletion of temporary and trash files, and an on/off switch for location services. - -![Elementary OS's Privacy and Security screen][13] - -### More on Elementary OS - -Elementary OS was originally released in 2011, and its latest version, Hera, was released on December 3, 2019. [Cassidy James Blaede][14], Elementary's co-founder and CXO, is the operating system's UX architect. Cassidy loves to design and build useful, usable, and delightful digital products using open technologies. - -Elementary OS has excellent user [documentation][15], and its code (licensed under GPL 3.0) is available on [GitHub][16]. Elementary OS encourages involvement in the project, so be sure to reach out and [join the community][17]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/macbook-linux-elementary - -作者:[Don Watkins][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/don-watkins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_cafe_brew_laptop_desktop.jpg?itok=G-n1o1-o (Coffee and laptop) -[2]: https://en.wikipedia.org/wiki/MacOS_Mojave -[3]: https://www.gnucash.org/ -[4]: https://elementary.io/ -[5]: https://opensource.com/life/14/10/test-drive-linux-nothing-flash-drive -[6]: https://opensource.com/article/19/12/pantheon-linux-desktop -[7]: https://www.linux4everyone.com/20-macbook-pro-elementary-os -[8]: https://opensource.com/sites/default/files/uploads/macbookair_hera.png (MacBook Air with Hera) -[9]: https://blog.elementary.io/introducing-elementary-os-5-1-hera/ -[10]: https://opensource.com/sites/default/files/uploads/elementaryos_settings.png (Elementary OS's Settings screen) -[11]: https://opensource.com/sites/default/files/uploads/elementaryos_keyboardshortcuts.png (Elementary OS's Keyboard shortcuts) -[12]: https://en.wikipedia.org/wiki/GNOME_Web -[13]: https://opensource.com/sites/default/files/uploads/elementaryos_privacy-security.png (Elementary OS's Privacy and Security screen) -[14]: https://github.com/cassidyjames -[15]: https://elementary.io/docs/learning-the-basics#learning-the-basics -[16]: https://github.com/elementary -[17]: https://elementary.io/get-involved diff --git a/sources/tech/20200206 3 ways to use PostgreSQL commands.md b/sources/tech/20200206 3 ways to use PostgreSQL commands.md new file mode 100644 index 0000000000..645baf65e0 --- /dev/null +++ b/sources/tech/20200206 3 ways to use PostgreSQL commands.md @@ -0,0 +1,230 @@ +[#]: collector: (lujun9972) +[#]: translator: (Morisun029) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 ways to use PostgreSQL commands) +[#]: via: (https://opensource.com/article/20/2/postgresql-commands) +[#]: author: (Greg Pittman https://opensource.com/users/greg-p) + +3 ways to use PostgreSQL commands +====== +Whether you need something simple, like a shopping list, or complex, +like a color swatch generator, PostgreSQL commands make it easy. +![Team checklist and to dos][1] + +In _[Getting started with PostgreSQL][2]_, I explained how to install, set up, and begin using the open source database software. But there's a lot more you can do with commands in [PostgreSQL][3]. + +For example, I use Postgres to keep track of my grocery shopping list. I do most of the grocery shopping in our home, and the bulk of it happens once a week. I go to several places to buy the things on my list because each store offers a particular selection or quality or maybe a better price. Initially, I made an HTML form page to manage my shopping list, but it couldn't save my entries. So, I had to wait to make my list all at once, and by then I usually forgot some items we need or I want. + +Instead, with PostgreSQL, I can enter bits when I think of them as the week goes on and print out the whole thing right before I go shopping. Here's how you can do that, too. + +### Create a simple shopping list + +First, enter the database with the **psql **command, then create a table for your list with: + + +``` +`Create table groc (item varchar(20), comment varchar(10));` +``` + +Type commands like the following to add items to your list: + + +``` +insert into groc values ('milk', 'K'); +insert into groc values ('bananas', 'KW'); +``` + +There are two pieces of information (separated by a comma) inside the parentheses: the item you want to buy and letters indicating where you want to buy it and whether it's something you usually buy every week (W). + +Since **psql** has a history, you can press the Up arrow and edit the data between the parentheses instead of having to type the whole line for each item. + +After entering a handful of items, check what you've entered with: + + +``` +Select * from groc order by comment; + +      item      | comment +\----------------+--------- + ground coffee  | H + butter         | K + chips          | K + steak          | K + milk           | K + bananas        | KW + raisin bran    | KW + raclette       | L + goat cheese    | L + onion          | P + oranges        | P + potatoes       | P + spinach        | PW + broccoli       | PW + asparagus      | PW + cucumber       | PW + sugarsnap peas | PW + salmon         | S +(18 rows) +``` + +This command orders the results by the _comment_ column so that the items are grouped by where you buy them to make it easier to shop. + +By using a W to indicate your weekly purchases, you can keep your weekly items on the list when you clear out the table to prepare for the next week's list. To so that, enter: + + +``` +`delete from groc where comment not like '%W';` +``` + +Notice that in PostgreSQL, **%** is the wildcard character (instead of an asterisk). So, to save typing, you might type: + + +``` +`delete from groc where item like 'goat%';` +``` + +You can't use **item = 'goat%'**; it won't work. + +When you're ready to shop, output your list to print it or send it to your phone with: + + +``` +\o groclist.txt +select * from groc order by comment; +\o +``` + +The last command, **\o**, with nothing afterward, resets the output to the command line. Otherwise, all output will continue to go to the groc file you created. + +### Analyze complex tables + +This item-by-item entry may be okay for short tables, but what about really big ones? A couple of years ago, I was helping the team at [FreieFarbe.de][4] to create a swatchbook of the free colors (freieFarbe means "free colors" in German) from its HLC color palette, where virtually any imaginable print color can be specified by its hue, luminosity (brightness), and chroma (saturation). The result was the [HLC Color Atlas][5], and here's how we did it. + +The team sent me files with color specifications so I could write Python scripts that would work with Scribus to generate the swatchbooks of color patches easily. One example started like: + + +``` +HLC, C, M, Y, K +H010_L15_C010, 0.5, 49.1, 0.1, 84.5 +H010_L15_C020, 0.0, 79.7, 15.1, 78.9 +H010_L25_C010, 6.1, 38.3, 0.0, 72.5 +H010_L25_C020, 0.0, 61.8, 10.6, 67.9 +H010_L25_C030, 0.0, 79.5, 18.5, 62.7 +H010_L25_C040, 0.4, 94.2, 17.3, 56.5 +H010_L25_C050, 0.0, 100.0, 15.1, 50.6 +H010_L35_C010, 6.1, 32.1, 0.0, 61.8 +H010_L35_C020, 0.0, 51.7, 8.4, 57.5 +H010_L35_C030, 0.0, 68.5, 17.1, 52.5 +H010_L35_C040, 0.0, 81.2, 22.0, 46.2 +H010_L35_C050, 0.0, 91.9, 20.4, 39.3 +H010_L35_C060, 0.1, 100.0, 17.3, 31.5 +H010_L45_C010, 4.3, 27.4, 0.1, 51.3 +``` + +This is slightly modified from the original, which separated the data with tabs. I transformed it into a CSV (comma-separated value) file, which I prefer to use with Python. (CSV files are also very useful because they can be imported easily into a spreadsheet program.) + +In each line, the first item is the color name, and it's followed by its C, M, Y, and K color values. The file consisted of 1,793 colors, and I wanted a way to analyze the information to get a sense of the range of values. This is where PostgreSQL comes into play. I did not want to enter all of this data manually—I don't think I could without errors (and headaches). Fortunately, PostgreSQL has a command for this. + +My first step was to create the database with: + + +``` +`Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal);` +``` + +Then I brought in the data with: + + +``` +`\copy  hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV);` +``` + +The backslash at the beginning is there because using the plain **copy** command is restricted to root and the Postgres superuser. In the parentheses, **header** means the first line contains headings and should be ignored, and **CSV** means the file format is CSV. Note that parentheses are not required around the color name in this method. + +If the operation is successful, I see a message that says **COPY NNNN**, where the N's refer to the number of rows inserted into the table. + +Finally, I can query the table with: + + +``` +select * from hlc_cmyk; + +     color     |   c   |   m   |   y   |  k   +\---------------+-------+-------+-------+------ + H010_L15_C010 |   0.5 |  49.1 |   0.1 | 84.5 + H010_L15_C020 |   0.0 |  79.7 |  15.1 | 78.9 + H010_L25_C010 |   6.1 |  38.3 |   0.0 | 72.5 + H010_L25_C020 |   0.0 |  61.8 |  10.6 | 67.9 + H010_L25_C030 |   0.0 |  79.5 |  18.5 | 62.7 + H010_L25_C040 |   0.4 |  94.2 |  17.3 | 56.5 + H010_L25_C050 |   0.0 | 100.0 |  15.1 | 50.6 + H010_L35_C010 |   6.1 |  32.1 |   0.0 | 61.8 + H010_L35_C020 |   0.0 |  51.7 |   8.4 | 57.5 + H010_L35_C030 |   0.0 |  68.5 |  17.1 | 52.5 +``` + +It goes on like this for all 1,793 rows of data. In retrospect, I can't say that this query was absolutely necessary for the HLC and Scribus task, but it allayed some of my anxieties about the project. + +To generate the HLC Color Atlas, I automated creating the color charts with Scribus for the 13,000+ colors in those pages of color swatches. + +I could have used the **copy** command to output my data: + + +``` +`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV);` +``` + +I also could restrict the output according to certain values with a **where** clause. + +For example, the following command will only send the table values for the hues that begin with H10. + + +``` +`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%';` +``` + +### Back up or transfer a database or table + +The final command I will mention here is **pg_dump**, which is used to back up a PostgreSQL database and runs outside of the **psql** console. For example: + + +``` +pg_dump gregp -t hlc_cmyk > hlc.out +pg_dump gregp > dball.out +``` + +The first line exports the **hlc_cmyk** table along with its structure. The second line dumps all the tables inside the **gregp** database. This is very useful for backing up or transferring a database or tables.  + +To transfer a database or table to another computer, first, create a database on the other computer (see my "[getting started][2]" article for details), then do the reverse process: + + +``` +`psql -d gregp -f dball.out` +``` + +This creates all the tables and enters the data in one step. + +### Conclusion + +In this article, we have seen how to use the **WHERE** parameter to restrict operations, along with the use of the PostgreSQL wildcard character **%**. We've also seen how to load a large amount of data into a table, then output some or all of the table data to a file, or even your entire database with all its individual tables. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/postgresql-commands + +作者:[Greg Pittman][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/greg-p +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) +[2]: https://opensource.com/article/19/11/getting-started-postgresql +[3]: https://www.postgresql.org/ +[4]: http://freiefarbe.de +[5]: https://www.freiefarbe.de/en/thema-farbe/hlc-colour-atlas/ diff --git a/sources/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md b/sources/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md index f80298dbb7..42da66203b 100644 --- a/sources/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md +++ b/sources/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md b/sources/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md deleted file mode 100644 index ecbe1dabe3..0000000000 --- a/sources/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Install All Essential Media Codecs in Ubuntu With This Single Command [Beginner’s Tip]) -[#]: via: (https://itsfoss.com/install-media-codecs-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Install All Essential Media Codecs in Ubuntu With This Single Command [Beginner’s Tip] -====== - -If you have just installed Ubuntu or some other [Ubuntu flavors][1] like Kubuntu, Lubuntu etc, you’ll notice that your system doesn’t play some audio or video file. - -For video files, you can [install VLC on Ubuntu][2]. [VLC][3] one of the [best video players for Linux][4] and can play almost any video file format. But you’ll still have troubles with audio media files and flash player. - -The good thing is that [Ubuntu][5] provides a single package to install all the essential media codecs: ubuntu-restricted-extras. - -![][6] - -### What is Ubuntu Restricted Extras? - -The ubuntu-restricted-extras is a software package that consists various essential software like flash plugin, [unrar][7], [gstreamer][8], mp4, codecs for [Chromium browser in Ubuntu][9] etc. - -Since these software are not open source and some of them involve software patents, Ubuntu doesn’t install them by default. You’ll have to use multiverse repository, the software repository specifically created by Ubuntu to provide non-open source software to its users. - -Please read this article to [learn more about various Ubuntu repositories][10]. - -### How to install Ubuntu Restricted Extras? - -I find it surprising that the software center doesn’t list Ubuntu Restricted Extras. In any case, you can install the package using command line and it’s very simple. - -Open a terminal by searching for it in the menu or using the [terminal keyboard shortcut Ctrl+Alt+T][11]. - -Since ubuntu-restrcited-extras package is available in the multiverse repository, you should verify that the multiverse repository is enabled on your system: - -``` -sudo add-apt-repository multiverse -``` - -And then you can install it in Ubuntu default edition using this command: - -``` -sudo apt install ubuntu-restricted-extras -``` - -When you enter the command, you’ll be asked to enter your password. When _**you type the password, nothing is displayed on the screen**_. That’s normal. Type your password and press enter. - -It will show a huge list of packages to be installed. Press enter to confirm your selection when it asks. - -You’ll also encounter an [EULA][12] (End User License Agreement) screen like this: - -![Press Tab key to select OK and press Enter key][13] - -It could be overwhelming to navigate this screen but don’t worry. Just press tab and it will highlight the options. When the correct options are highlighted, press enter to confirm your selection. - -![Press Tab key to highlight Yes and press Enter key][14] - -Once the process finishes, you should be able to play MP3 and other media formats thanks to newly installed media codecs. - -##### Installing restricted extra package on Kubuntu, Lubuntu, Xubuntu - -Do keep in mind that Kubuntu, Lubuntu and Xubuntu has this package available with their own respective names. They should have just used the same name but they don’t unfortunately. - -On Kubuntu, use this command: - -``` -sudo apt install kubuntu-restricted-extras -``` - -On Lubuntu, use: - -``` -sudo apt install lubuntu-restricted-extras -``` - -On Xubuntu, you should use: - -``` -sudo apt install xubuntu-restricted-extras -``` - -I always recommend getting ubuntu-restricted-extras as one of the [essential things to do after installing Ubuntu][15]. It’s good to have a single command to install multiple codecs in Ubuntu. - -I hope you like this quick tip in the Ubuntu beginner series. I’ll share more such tips in the future. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-media-codecs-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/which-ubuntu-install/ -[2]: https://itsfoss.com/install-latest-vlc/ -[3]: https://www.videolan.org/index.html -[4]: https://itsfoss.com/video-players-linux/ -[5]: https://ubuntu.com/ -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/Media_Codecs_in_Ubuntu.png?ssl=1 -[7]: https://itsfoss.com/use-rar-ubuntu-linux/ -[8]: https://gstreamer.freedesktop.org/ -[9]: https://itsfoss.com/install-chromium-ubuntu/ -[10]: https://itsfoss.com/ubuntu-repositories/ -[11]: https://itsfoss.com/ubuntu-shortcuts/ -[12]: https://en.wikipedia.org/wiki/End-user_license_agreement -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/installing_ubuntu_restricted_extras.jpg?ssl=1 -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/installing_ubuntu_restricted_extras_1.jpg?ssl=1 -[15]: https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/ diff --git a/sources/tech/20200210 Top hacks for the YaCy open source search engine.md b/sources/tech/20200210 Top hacks for the YaCy open source search engine.md deleted file mode 100644 index 7b559e9c5e..0000000000 --- a/sources/tech/20200210 Top hacks for the YaCy open source search engine.md +++ /dev/null @@ -1,100 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Top hacks for the YaCy open source search engine) -[#]: via: (https://opensource.com/article/20/2/yacy-search-engine-hacks) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Top hacks for the YaCy open source search engine -====== -Rather than adapting to someone else's vision, customize you search -engine for the internet you want with YaCY. -![Browser of things][1] - -In my article about [getting started with YaCy][2], I explained how to install and start using the [YaCy][3] peer-to-peer search engine. One of the most exciting things about YaCy, however, is the fact that it's a local client. Each user owns and operates a node in a globally distributed search engine infrastructure, which means each user is in full control of how they navigate and experience the World Wide Web. - -For instance, Google used to provide the URL google.com/linux as a shortcut to filter searches for Linux-related topics. It was a small feature that many people found useful, but [topical shortcuts were dropped][4] in 2011.  - -YaCy makes it possible to customize your search experience. - -### Customize YaCy - -Once you've installed YaCy, navigate to your search page at **localhost:8090**. To customize your search engine, click the **Administration** button in the top-right corner (it may be concealed in a menu icon on small screens). - -The admin panel allows you to configure how YaCy uses your system resources and how it interacts with other YaCy clients. - -![YaCy profile selector][5] - -For instance, to configure an alternative port and set RAM and disk usage, use the **First steps** menu in the sidebar. To monitor YaCy activity, use the **Monitoring** panel. Most features are discoverable by clicking through the panels, but here are some of my favorites. - -### Search appliance - -Several companies have offered [intranet search appliances][6], but with YaCy, you can implement it for free. Whether you want to search through your own data or to implement a search system for local file shares at your business, you can choose to run YaCy as an internal indexer for files accessible over HTTP, FTP, and SMB (Samba). People in your local network can use your personalized instance of YaCy to find shared files, and none of the data is shared with users outside your network. - -### Network configuration - -YaCy favors isolation and privacy by default. You can adjust how you connect to the peer-to-peer network in the **Network Configuration** panel, which is revealed by clicking the link located at the top of the **Use Case & Account** configuration screen. - -![YaCy network configuration][7] - -### Crawl a site - -Peer-to-peer indexing is user-driven. There's no mega-corporation initiating searches on every accessible page on the internet, so a site isn't indexed until someone deliberately crawls it with YaCy. - -The YaCy client provides two options to help you help crawl the web: you can perform a manual crawl, and you can make YaCy available for suggested crawls. - -![YaCy advanced crawler][8] - -#### Start a manual crawling job - -A manual crawl is when you enter the URL of a site you want to index and start a YaCy crawl job. To do this, click the **Advanced Crawler** link in the **Production** sidebar. Enter one or more URLs, then scroll to the bottom of the page and enable the **Do remote indexing** option. This enables your client to broadcast the URLs it is indexing, so clients that have opted to accept requests can help you perform the crawl. - -To start the crawl, click the **Start New Crawl Job** button at the bottom of the page. I use this method to index sites I use frequently or find useful. - -Once the crawl job starts, YaCy indexes the URLs you enter and stores the index on your local machine. As long as you are running in senior mode (meaning your firewall permits incoming and outgoing traffic on port 8090), your index is available to YaCy users all over the globe. - -#### Join in on a crawl - -While some very dedicated YaCy senior users may crawl the internet compulsively, there are a _lot_ of sites out there in the world. It might seem impossible to match the resources of popular spiders and bots, but because YaCy has so many users, they can band together as a community to index more of the internet than any one user could do alone. If you activate YaCy to broadcast requests for site crawls, participating clients can work together to crawl sites you might not otherwise think to crawl manually. - -To configure your client to accept jobs from others, click the **Advanced Crawler** link in the left sidebar menu. In the **Advanced Crawler** panel, click the **Remote Crawling** link under the **Network Harvesting** heading at the top of the page. Enable remote crawls by placing a tick in the checkbox next to the **Load** setting. - -![YaCy remote crawling][9] - -### YaCy monitoring and more - -YaCy is a surprisingly robust search engine, providing you with the opportunity to theme and refine your experience in nearly any way you could want. You can monitor the activity of your YaCy client in the **Monitoring** panel, so you can get an idea of how many people are benefiting from the work of the YaCy community and also see what kind of activity it's generating for your computer and network. - -![YaCy monitoring screen][10] - -### Search engines make a difference - -The more time you spend with the Administration screen, the more fun it becomes to ponder how the search engine you use can change your perspective. Your experience of the internet is shaped by the results you get back for even the simplest of queries. You might notice, in fact, how different one person's "internet" is from another person's when you talk to computer users from a different industry. For some people, the web is littered with ads and promoted searches and suffers from the tunnel vision of learned responses to queries. For instance, if someone consistently searches for answers about X, most commercial search engines will give weight to query responses that concern X. That's a useful feature on the one hand, but it occludes answers that require Y, even though that might be the better solution for a specific task. - -As in real life, stepping outside a manufactured view of the world can be healthy and enlightening. Try YaCy, and see what you discover. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/yacy-search-engine-hacks - -作者:[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/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) -[2]: https://opensource.com/article/20/2/open-source-search-engine -[3]: https://yacy.net/ -[4]: https://www.linuxquestions.org/questions/linux-news-59/is-there-no-more-linux-google-884306/ -[5]: https://opensource.com/sites/default/files/uploads/yacy-profiles.jpg (YaCy profile selector) -[6]: https://en.wikipedia.org/wiki/Vivisimo -[7]: https://opensource.com/sites/default/files/uploads/yacy-network-config.jpg (YaCy network configuration) -[8]: https://opensource.com/sites/default/files/uploads/yacy-advanced-crawler.jpg (YaCy advanced crawler) -[9]: https://opensource.com/sites/default/files/uploads/yacy-remote-crawl-accept.jpg (YaCy remote crawling) -[10]: https://opensource.com/sites/default/files/uploads/yacy-monitor.jpg (YaCy monitoring screen) diff --git a/sources/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md b/sources/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md index 78135c9f9b..8d8ad04a69 100644 --- a/sources/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md +++ b/sources/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md b/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md new file mode 100644 index 0000000000..c8108d68c9 --- /dev/null +++ b/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md @@ -0,0 +1,161 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Extend the life of your SSD drive with fstrim) +[#]: via: (https://opensource.com/article/20/2/trim-solid-state-storage-linux) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +Extend the life of your SSD drive with fstrim +====== +A new systemd service to make your life easier. +![Linux keys on the keyboard for a desktop computer][1] + +Over the past decade, solid-state drives (SSD) have brought about a new way of managing storage. SSDs have benefits like silent and cooler operation and a faster interface spec, compared to their elder spinning ancestors. Of course, new technology brings with it new methods of maintenance and management. SSDs have a feature called TRIM. This is essentially a method for reclaiming unused blocks on the device, which may have been previously written, but no longer contain valid data and therefore, can be returned to the general storage pool for reuse. Opensource.com’s Don Watkins first wrote about TRIM in his 2017 article ["Solid-state drives in Linux: Enabling TRIM for SSDs."][2] + +If you have been using this feature on your Linux system, then you are probably familiar with the two methods described below. + +### The old ways + +#### Discard + +I initially enabled this with the discard option to the mount command. The configuration is placed into the **/etc/fstab** file for each file system. + + +``` +# cat /etc/fstab +UUID=3453g54-6628-2346-8123435f  /home  xfs  defaults,discard   0 0 +``` + +The discard option enables automatic online TRIM. There has recently been debate on whether this is the best method due to possible negative performance impacts. Using this option causes a TRIM to be initiated every time new data is written to the drive. This may introduce additional activity that interferes with storage performance. + +#### Cron + +I removed the discard option from the **fstab** file. Then I created a cron job to call the command on a scheduled basis. + + +``` +# crontab -l +@midnight /usr/bin/trim +``` + +This is the method I used most recently on my Ubuntu Linux systems until I learned about another way. + +### A new TRIM service + +I recently discovered that a systemd service for TRIM exists. Fedora [introduced][3] this into their distribution in version 30, and, although it is not enabled by default in versions 30 and 31, it is planned to be in version 32. If you’re working on Fedora Workstation 31 and you want to begin using this feature, you can enable it very easily. I’ll also show you how to test it below. This service is not unique to Fedora. The existence and status will depend on an individual distribution basis. + +#### Test + +I like to test first, to better understand what is happening behind the scenes. I do this by opening a terminal and issuing the command that the service is configured to call. + + +``` +`/usr/sbin/fstrim --fstab --verbose --quiet` +``` + +The **–help** argument to **fstrim** will describe these and other arguments. + + +``` +$ sudo /usr/sbin/fstrim --help + +Usage: + fstrim [options] <mount point> + +Discard unused blocks on a mounted filesystem. + +Options: + -a, --all           trim all supported mounted filesystems + -A, --fstab         trim all supported mounted filesystems from /etc/fstab + -o, --offset <num>  the offset in bytes to start discarding from + -l, --length <num>  the number of bytes to discard + -m, --minimum <num> the minimum extent length to discard + -v, --verbose       print number of discarded bytes +     --quiet         suppress error messages + -n, --dry-run       does everything, but trim + + -h, --help          display this help + -V, --version       display version +``` + +So, now I can see that the systemd service is configured to run the trim on all supported mounted filesystems in my **/etc/fstab** file **–fstab** and print the number of discarded bytes **–verbose** but suppress any error messages that might occur **–quiet**. Knowing these options is helpful for testing. For instance, I can start with the safest one, which is the dry run. I’ll also leave off the quiet argument so I can determine if any errors will occur with my drive setup. + + +``` +`$ sudo /usr/sbin/fstrim --fstab --verbose --dry-run` +``` + +This will simply show what the **fstrim** command will do based on the file systems that it finds configured in your **/etc/fstab** file. + + +``` +`$ sudo /usr/sbin/fstrim --fstab --verbose` +``` + +This will now send the TRIM operation to the drive and report on the number of discarded bytes from each file system. Below is an example after my recent fresh install of Fedora on a new NVME SSD. + + +``` +/home: 291.5 GiB (313011310592 bytes) trimmed on /dev/mapper/wkst-home +/boot/efi: 579.2 MiB (607301632 bytes) trimmed on /dev/nvme0n1p1 +/boot: 787.5 MiB (825778176 bytes) trimmed on /dev/nvme0n1p2 +/: 60.7 GiB (65154805760 bytes) trimmed on /dev/mapper/wkst-root +``` + +#### Enable + +Fedora Linux implements systemd timer service, scheduled to run on a weekly basis. To check the existence and current status, run **systemctl status**. + + +``` +`$ sudo systemctl status fstrim.timer` +``` + +Now, enable the service. + + +``` +`$ sudo systemctl enable fstrim.timer` +``` + +#### Verify + +Then you can verify that the timer is enabled by listing all of the timers. + + +``` +`$ sudo systemctl list-timers --all` +``` + +The following line referring to the **fstrim.timer** will appear. Notice that the timer actually activates **fstrim.service**. This is from where the actual **fstrim** is called. The time-related fields show **n/a** because the service has just been enabled and has not run yet. + + +``` +NEXT   LEFT    LAST   PASSED   UNIT           ACTIVATES +n/a    n/a     n/a    n/a      fstrim.timer   fstrim.service +``` + +### Conclusion + +This service seems like the best way to run TRIM on your drives. It is much simpler than having to create your own crontab entry to call the **fstrim** command. It is also safer not having to edit the **fstab** file. It has been interesting to watch the evolution of solid-state storage technology and nice to know that it appears Linux is moving toward a standard and safe way to implement it. + +In this article, learn how solid state drives differ from traditional hard drives and what it means... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/trim-solid-state-storage-linux + +作者:[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/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://opensource.com/article/17/1/solid-state-drives-linux-enabling-trim-ssds +[3]: https://fedoraproject.org/wiki/Changes/EnableFSTrimTimer (Fedora Project WIKI: Changes/EnableFSTrimTimer) diff --git a/sources/tech/20200212 How to Change the Default Terminal in Ubuntu.md b/sources/tech/20200212 How to Change the Default Terminal in Ubuntu.md deleted file mode 100644 index 7460bf669f..0000000000 --- a/sources/tech/20200212 How to Change the Default Terminal in Ubuntu.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Change the Default Terminal in Ubuntu) -[#]: via: (https://itsfoss.com/change-default-terminal-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Change the Default Terminal in Ubuntu -====== - -Terminal is a crucial part of any Linux system. It allows you to access your Linux systems through a shell. There are several terminal applications (technically called terminal emulators) on Linux. - -Most of the [desktop environments][1] have their own implementation of the terminal. It may look different and may have different keyboard shortcuts. - -For example, [Guake Terminal][2] is extremely useful for power users and provides several features you might not get in your distribution’s terminal by default. - -You can install other terminals on your system and use it as default that opens up with the usual [keyboard shortcut of Ctrl+Alt+T][3]. - -Now the question comes, how do you change the default terminal in Ubuntu. It doesn’t follow the standard way of [changing default applications in Ubuntu][4] then how to do it? - -### Change the default terminal in Ubuntu - -![][5] - -On Debian-based distributions, there is a handy command line utility called [update-alternatives][6] that allows you to handle the default applications. - -You can use it to change the default command line text editor, terminal and more. To do that, run the following command: - -``` -sudo update-alternatives --config x-terminal-emulator -``` - -It will show all the terminal emulators present on your system that can be used as default. The current default terminal is marked with the asterisk. - -``` -[email protected]:~$ sudo update-alternatives --config x-terminal-emulator -There are 2 choices for the alternative x-terminal-emulator (providing /usr/bin/x-terminal-emulator). - - Selection Path Priority Status ------------------------------------------------------------- - 0 /usr/bin/gnome-terminal.wrapper 40 auto mode - 1 /usr/bin/gnome-terminal.wrapper 40 manual mode -* 2 /usr/bin/st 15 manual mode - -Press to keep the current choice[*], or type selection number: -``` - -All you have to do is to enter the selection number. In my case, I want to use the GNOME terminal instead of the one from [Regolith desktop][7]. - -``` -Press to keep the current choice[*], or type selection number: 1 -update-alternatives: using /usr/bin/gnome-terminal.wrapper to provide /usr/bin/x-terminal-emulator (x-terminal-emulator) in manual mode -``` - -##### Auto mode vs manual mode - -You might have noticed the auto mode and manual mode in the output of update-alternatives command. - -If you choose auto mode, your system may automatically decide on the default application as the packages are installed or removed. The decision is influenced by the priority number (as seen in the output of the command in the previous section). - -Suppose you have 5 terminal emulators installed on your system and you delete the default one. Now, your system will check which of the emulators are in auto mode. If there are more than one, it will choose the one with the highest priority as the default emulator. - -I hope you find this quick little tip useful. Your questions and suggestions are always welcome. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/change-default-terminal-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/best-linux-desktop-environments/ -[2]: http://guake-project.org/ -[3]: https://itsfoss.com/ubuntu-shortcuts/ -[4]: https://itsfoss.com/change-default-applications-ubuntu/ -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/switch_default_terminal_ubuntu.png?ssl=1 -[6]: https://manpages.ubuntu.com/manpages/trusty/man8/update-alternatives.8.html -[7]: https://itsfoss.com/regolith-linux-desktop/ diff --git a/sources/tech/20200212 How to use byobu to multiplex SSH sessions.md b/sources/tech/20200212 How to use byobu to multiplex SSH sessions.md new file mode 100644 index 0000000000..bd36764af1 --- /dev/null +++ b/sources/tech/20200212 How to use byobu to multiplex SSH sessions.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use byobu to multiplex SSH sessions) +[#]: via: (https://opensource.com/article/20/2/byobu-ssh) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +How to use byobu to multiplex SSH sessions +====== +Byobu allows you to maintain multiple terminal windows, connect via SSH, +disconnect, reconnect, and share access, all while keeping the session +alive. +![Person drinking a hat drink at the computer][1] + +[Byobu][2] is a text-based window manager and terminal multiplexer. It's similar to [GNU Screen][3] but more modern and more intuitive. It also works on most Linux, BSD, and Mac distributions. + +Byobu allows you to maintain multiple terminal windows, connect via SSH (secure shell), disconnect, reconnect, and even let other people access it, all while keeping the session alive. + +For example, if you are SSH'd into a Raspberry Pi or server and run (for example) **sudo apt update && sudo apt upgrade**—and lose your internet connection while it is running, your command will be lost to the void. However, if you start a byobu session first, it will continue running and, when you reconnect, you will find it's been running happily without your eyes on it. + +![The byobu logo is a fun play on screens.][4] + +Byobu is named for a Japanese term for decorative, multi-panel screens that serve as folding room dividers, which I think is quite fitting. + +To install byobu on Debian/Raspbian/Ubuntu: + +**sudo apt install byobu** + +Then enable it: + +**byobu-enable** + +Now drop out of your SSH session and log back in—you'll land in a byobu session. Run a command like **sudo apt update** and close the window (or enter the escape sequence ([**Enter**+**~**+**.**][5]) and log back in. You'll see the update running just as you left it. + +There are a _lot_ of features I don't use regularly or at all. The most common ones I use are: + + * **F2** – New window + * **F3/F4** – Navigate between windows + * **Ctrl**+**F2** – Split pane vertically + * **Shift**+**F2** – Split pane horizontally + * **Shift**+**Left arrow/Shift**+**Right arrow** – Navigate between splits + * **Shift**+**F11** – Zoom in (or out) on a split + + + +You can learn more by watching this video: + +### How we're using byobu + +Byobu has been great for the maintenance of [piwheels][6], the convenient, pre-compiled Python packages for Raspberry Pi. We have a horizontal split showing the piwheels monitor in the top half and the syslog entries scrolled in real time on the bottom half. Then, if we want to do something else, we switch to another window. It's particularly handy when we're investigating something collaboratively, as I can see what my colleague Dave types (and correct his typos) while we chat in IRC. + +I have byobu enabled on my home and work servers, so when I log into either machine, everything is as I left it—multiple jobs running, a window left in a particular directory, running a process as another user, that kind of thing. + +![byobu screenshot][7] + +Byobu is handy for development on Raspberry Pis, too. You can launch it on the desktop, run a command, then SSH in and attach yourself to the session where that command is running. Just note that enabling byobu won't change what the terminal launcher does. Just run **byobu** to launch it. + +* * * + +_This article originally appeared on Ben Nuttall's [Tooling blog][8] and is reused with permission._ + +Enter the black raspberry. Rubus occidentalis . It's an ominous name for an ominous fruit: the... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/byobu-ssh + +作者:[Ben Nuttall][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/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) +[2]: https://byobu.org/ +[3]: http://www.gnu.org/software/screen/ +[4]: https://opensource.com/sites/default/files/uploads/byobu.png (byobu screen) +[5]: https://www.google.com/search?client=ubuntu&channel=fs&q=Enter-tilde-dot&ie=utf-8&oe=utf-8 +[6]: https://opensource.com/article/20/1/piwheels +[7]: https://opensource.com/sites/default/files/uploads/byobu-screenshot.png (byobu screenshot) +[8]: https://tooling.bennuttall.com/byobu/ diff --git a/sources/tech/20200212 Manage your SSL certificates with the ssl-on-demand script.md b/sources/tech/20200212 Manage your SSL certificates with the ssl-on-demand script.md new file mode 100644 index 0000000000..e4be89e4f5 --- /dev/null +++ b/sources/tech/20200212 Manage your SSL certificates with the ssl-on-demand script.md @@ -0,0 +1,685 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manage your SSL certificates with the ssl-on-demand script) +[#]: via: (https://opensource.com/article/20/2/ssl-demand) +[#]: author: (Abhishek Tamrakar https://opensource.com/users/tamrakar) + +Manage your SSL certificates with the ssl-on-demand script +====== +Keep track of certificate expirations to prevent problems with the +ssl-on-demand script. +![Lock][1] + +It happens all the time, to the largest of companies. An important certificate doesn't get renewed, and services become inaccessible. It happened to Microsoft Teams in early February 2020, awkwardly timed just after the launch of a major television campaign promoting it as a [Slack competitor][2]. Embarrassing as that may be, it's sure to happen to someone else in the future. + +On the modern web, expired [certificates][3] can create major problems for websites, ranging from unhappy users who can't connect to a site to security threats from bad actors who take advantage of the failure to renew a certificate. + +[Ssl-on-demand][4] is a set of SSL scripts to help site owners manage certificates. It is used for on-demand certificate generation and validation and it can create certificate signing requests ([CSRs][5]) and predict the expiration of existing certificates. + +### Automate SSL expiry checks + + +``` + USAGE: SSLexpiryPredictions.sh -[cdewh] + +  DESCRIPTION: This script predicts the expiring SSL certificates based on the end date. + +  OPTIONS: + +  -c|   sets the value for configuration file which has server:port or host:port details. +        +  -d|   sets the value of directory containing the certificate files in crt or pem format. + +  -e|   sets the value of certificate extention, e.g crt, pem, cert. +        crt: default [to be used with -d, if certificate file extention is other than .crt] + +  -w|   sets the value for writing the script output to a file. + +  -h|   prints this help and exit. +``` + +**Examples:** + +To create a file with a list of all servers and their port numbers to make an SSL handshake, use: + + +``` +cat > servers.list +         server1:port1 +         server2:port2 +         server3:port3 +        (ctrl+d) +        +$ ./SSLexpiryPredictions.sh -c server.list +``` + +Run the script by providing the certificate location and extension (in case it is not .crt): + + +``` +`$ ./SSLexpiryPredictions.sh -d /path/to/certificates/dir -e pem` +``` + +### Automate CSR and private key creation + + +``` +Usage:  genSSLcsr.sh [options] -[cdmshx] +  [-c (common name)] +  [-d (domain name)] +  [-s (SSL certificate subject)] +  [-p (password)] +  [-m (email address)] *(Experimental) +  [-r (remove pasphrase) default:true] +  [-h (help)] +  [-x (optional)] + +[OPTIONS] +  -c|   Sets the value for common name. +        A valid common name is something that ends with 'xyz.com' + +  -d|   Sets the domain name. + +  -s|   Sets the subject to be applied to the certificates. +        '/C=country/ST=state/L=locality/O=organization/OU=organizationalunit/emailAddress=email' + +  -p|   Sets the password for private key. + +  -r|   Sets the value of remove passphrase. +        true:[default] passphrase will be removed from key. +        false: passphrase will not be removed and key wont get printed. + +  -m|   Sets the mailing capability to the script. +        (Experimental at this time and requires a lot of work) + +  -x|   Creates the certificate request and key but do not print on screen. +        To be used when script is used just to create the key and CSR with no need +        + to generate the certficate on the go. + +  -h|   Displays the usage. No further functions are performed. + +  Example: genSSLcsr.sh -c mywebsite.xyz.com -m [myemail@mydomain.com][6] +``` + +### The scripts + +#### 1. SSLexpiryPredictions.sh + + +``` +#!/bin/bash +############################################## +# +#       PURPOSE: The script to predict expiring SSL certificates. +# +#       AUTHOR: 'Abhishek.Tamrakar' +# +#       VERSION: 0.0.1 +# +#       COMPANY: Self +# +#       EMAIL: [abhishek.tamrakar08@gmail.com][7] +# +#       GENERATED: on 2018-05-20 +# +#       LICENSE: Copyright (C) 2018 Abhishek Tamrakar +# +#  Licensed under the Apache License, Version 2.0 (the "License"); +#  you may not use this file except in compliance with the License. +#  You may obtain a copy of the License at +# +#       +# +#   Unless required by applicable law or agreed to in writing, software +#   distributed under the License is distributed on an "AS IS" BASIS, +#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +#   See the License for the specific language governing permissions and +#   limitations under the License. +############################################## + +#your Variables go here +script=${0##/} +exitcode='' +WRITEFILE=0 +CONFIG=0 +DIR=0 +# functions here +usage() +{ +cat <<EOF + +  USAGE: $script -[cdewh]" + +  DESCRIPTION: This script predicts the expiring SSL certificates based on the end date. + +  OPTIONS: + +  -c|   sets the value for configuration file which has server:port or host:port details. + +  -d|   sets the value of directory containing the certificate files in crt or pem format. + +  -e|   sets the value of certificate extention, e.g crt, pem, cert. +        crt: default + +  -w|   sets the value for writing the script output to a file. + +  -h|   prints this help and exit. + +EOF +exit 1 +} +# print info messages +info() +{ +  printf '\n%s: %6s\n' "INFO" "$@" +} +# print error messages +error() +{ +  printf '\n%s: %6s\n' "ERROR" "$@" +  exit 1 +} +# print warning messages +warn() +{ +  printf '\n%s: %6s\n' "WARN" "$@" +} +# get expiry for the certificates +getExpiry() +{ +  local expdate=$1 +  local certname=$2 +  today=$(date +%s) +  timetoexpire=$(( ($expdate - $today)/(60*60*24) )) + +  expcerts=( ${expcerts[@]} "${certname}:$timetoexpire" ) +} + +# print all expiry that was found, typically if there is any. +printExpiry() +{ +  local args=$# +  i=0 +  if [[ $args -ne 0 ]]; then +    #statements +    printf '%s\n' "---------------------------------------------" +    printf '%s\n' "List of expiring SSL certificates" +    printf '%s\n' "---------------------------------------------" +    printf '%s\n' "$@"  | \ +      sort -t':' -g -k2 | \ +      column -s: -t     | \ +      awk '{printf "%d.\t%s\n", NR, $0}' +    printf '%s\n' "---------------------------------------------" +  fi +} + +# calculate the end date for the certificates first, finally to compare and predict when they are going to expire. +calcEndDate() +{ +  sslcmd=$(which openssl) +  if [[ x$sslcmd = x ]]; then +    #statements +    error "$sslcmd command not found!" +  fi +  # when cert dir is given +  if [[ $DIR -eq 1 ]]; then +    #statements +    checkcertexists=$(ls -A $TARGETDIR| egrep "*.$EXT$") +    if [[ -z ${checkcertexists} ]]; then +      #statements +      error "no certificate files at $TARGETDIR with extention $EXT" +    fi +    for file in $TARGETDIR/*.${EXT:-crt} +    do +      expdate=$($sslcmd x509 -in $file -noout -enddate) +      expepoch=$(date -d "${expdate##*=}" +%s) +      certificatename=${file##*/} +      getExpiry $expepoch ${certificatename%.*} +    done +  elif [[ $CONFIG -eq 1 ]]; then +    #statements +    while read line +    do +      if echo "$line" | \ +      egrep -q '^[a-zA-Z0-9.]+:[0-9]+|^[a-zA-Z0-9]+_.*:[0-9]+'; +      then +        expdate=$(echo | \ +        openssl s_client -connect $line 2>/dev/null | \ +        openssl x509 -noout -enddate 2>/dev/null); +        if [[ $expdate = '' ]]; then +          #statements +          warn "[error:0906D06C] Cannot fetch certificates for $line" +        else +          expepoch=$(date -d "${expdate##*=}" +%s); +          certificatename=${line%:*}; +          getExpiry $expepoch ${certificatename}; +        fi +      else +        warn "[format error] $line is not in required format!" +      fi +    done < $CONFIGFILE +  fi +} +# your script goes here +while getopts ":c:d:w:e:h" options +do +case $options in +c ) +  CONFIG=1 +  CONFIGFILE="$OPTARG" +  if [[ ! -e $CONFIGFILE ]] || [[ ! -s $CONFIGFILE ]]; then +    #statements +    error "$CONFIGFILE does not exist or empty!" +  fi +        ;; +e ) +  EXT="$OPTARG" +  case $EXT in +    crt|pem|cert ) +    info "Extention check complete." +    ;; +    * ) +    error "invalid certificate extention $EXT!" +    ;; +  esac +  ;; +d ) +  DIR=1 +  TARGETDIR="$OPTARG" +  [ $TARGETDIR = '' ] && error "$TARGETDIR empty variable!" +  ;; +w ) +  WRITEFILE=1 +  OUTFILE="$OPTARG" +  ;; +h ) +        usage +        ;; +\? ) +        usage +        ;; +: ) +        fatal "Argument required !!! see \'-h\' for help" +        ;; +esac +done +shift $(($OPTIND - 1)) +# +calcEndDate +#finally print the list +if [[ $WRITEFILE -eq 0 ]]; then +  #statements +  printExpiry ${expcerts[@]} +else +  printExpiry ${expcerts[@]} > $OUTFILE +fi +``` + +#### 2. genSSLcsr.sh + + +``` +#!/bin/bash - +#=============================================================================== +# +#          FILE: genSSLcsr.sh +# +#         USAGE: ./genSSLcsr.sh [options] +# +#   DESCRIPTION: ++++version 1.0.2 +#               Fixed few bugs from previous script +#               +Removing passphrase after CSR generation +#               Extended use of functions +#               Checks for valid common name +#               ++++1.0.3 +#               Fixed line breaks +#               Work directory to be created at the start +#               Used getopts for better code arrangements +#   ++++1.0.4 +#     Added mail feature (experimental at this time and needs +#     a mail server running locally.) +#     Added domain input and certificate subject inputs +# +#       OPTIONS: --- +#  REQUIREMENTS: openssl, mailx +#          BUGS: --- +#         NOTES: --- +#        AUTHOR: Abhishek Tamrakar (), [abhishek.tamrakar08@gmail.com][7] +#  ORGANIZATION: Self +#       CREATED: 6/24/2016 +#      REVISION: 4 +# COPYRIGHT AND +#       LICENSE: Copyright (C) 2016 Abhishek Tamrakar +# +#  Licensed under the Apache License, Version 2.0 (the "License"); +#  you may not use this file except in compliance with the License. +#  You may obtain a copy of the License at +# +#       +# +#   Unless required by applicable law or agreed to in writing, software +#   distributed under the License is distributed on an "AS IS" BASIS, +#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +#   See the License for the specific language governing permissions and +#   limitations under the License. +#=============================================================================== + +#variables ges here +#set basename to scriptname +SCRIPT=${0##*/} + +#set flags +TFOUND=0 +CFOUND=0 +MFOUND=0 +XFOUND=0 +SFOUND=0 +logdir=/var/log +# edit these below values to replace with yours +homedir='' +yourdomain='' +country=IN +state=Maharashtra +locality=Pune +organization="your_organization" +organizationalunit="your_organizational_unit" +email=your_email@your_domain +password=your_ssl_password +# OS is declared and will be used in its next version +OS=$(egrep -io 'Redhat|centos|fedora|ubuntu' /etc/issue) + +### function declarations ### + +info() +{ +  printf '\n%s\t%s\t' "INFO" "$@" +} + +#exit on error with a custom error message +#the extra function was removed and replaced withonly one. +#using FAILED\n\e<message> is a way but not necessarily required. +# + +fatal() +{ + printf '\n%s\t%s\n' "ERROR" "$@" + exit 1 +} + +checkperms() +{ +if [[ -z ${homedir} ]]; then +homedir=$(pwd) +fi +if [[ -w ${homedir} ]]; then +info "Permissions acquired for ${SCRIPT} on ${homedir}." +else +fatal "InSufficient permissions to run the ${SCRIPT}." +fi +} + +checkDomain() +{ +info "Initializing Domain ${cn} check ? " +if [[ ! -z ${yourdomain} ]]; then +workdir=${homedir}/${yourdomain} +echo -e "${cn}"|grep -E -i -q "${yourdomain}$" && echo -n "[OK]" || fatal "InValid domain in ${cn}" +else +workdir=${homedir}/${cn#*.} +echo -n "[NULL]" +info "WARNING: No domain declared to check." +confirmUserAction +fi +}       # end function checkDomain + +usage() +{ +cat << EOF + +Usage:  $SCRIPT [options] -[cdmshx] +  [-c (common name)] +  [-d (domain name)] +  [-s (SSL certificate subject)] +  [-p (password)] +  [-m (email address)] *(Experimental) +  [-r (remove pasphrase) default:true] +  [-h (help)] +  [-x (optional)] + +[OPTIONS] +  -c|   Sets the value for common name. +        A valid common name is something that ends with 'xyz.com' + +  -d|   Sets the domain name. + +  -s|   Sets the subject to be applied to the certificates. +        '/C=country/ST=state/L=locality/O=organization/OU=organizationalunit/emailAddress=email' + +  -p|   Sets the password for private key. + +  -r|   Sets the value of remove passphrase. +        true:[default] passphrase will be removed from key. +        false: passphrase will not be removed and key wont get printed. + +  -m|   Sets the mailing capability to the script. +        (Experimental at this time and requires a lot of work) + +  -x|   Creates the certificate request and key but do not print on screen. +        To be used when script is used just to create the key and CSR with no need +        + to generate the certficate on the go. + +  -h|   Displays the usage. No further functions are performed. + +  Example: $SCRIPT -c mywebsite.xyz.com -m [myemail@mydomain.com][6] + +EOF +exit 1 +}       # end usage + +confirmUserAction() { +while true; do +read -p "Do you wish to continue? ans: " yn +case $yn in +[Yy]* ) info "Initiating the process"; +break;; +[Nn]* ) exit 1;; +* ) info "Please answer yes or no.";; +esac +done +}       # end function confirmUserAction + +parseSubject() +{ +  local subject="$1" +  parsedsubject=$(echo $subject|sed 's/\// /g;s/^ //g') +  for i in ${parsedsubject}; do +      case ${i%=*} in +        'C' ) +        country=${i##*=} +        ;; +        'ST' ) +        state=${i##*=} +        ;; +        'L' ) +        locality=${i##*=} +        ;; +        'O' ) +        organization=${i##*=} +        ;; +        'OU' ) +        organizationalunit=${i##*=} +        ;; +        'emailAddress' ) +        email=${i##*=} +      ;; +    esac +  done +} + +sendMail() +{ + mailcmd=$(which mailx) + if [[ x"$mailcmd" = "x" ]]; then +   fatal "Cannot send email! please install mailutils for linux" + else +   echo "SSL CSR attached." | $mailcmd -s "SSL certificate request" \ +   -t $email $ccemail -A ${workdir}/${cn}.csr \ +   && info "mail sent" \ +   || fatal "error in sending mail." + fi +} + +genCSRfile() +{ +info "Creating signed key request for ${cn}" +#Generate a key +openssl genrsa -des3 -passout pass:$password -out ${workdir}/${cn}.key 4096 -noout 2>/dev/null && echo -n "[DONE]" || fatal "unable to generate key" + +#Create the request +info "Creating Certificate request for ${cn}" +openssl req -new -key ${workdir}/${cn}.key -passin pass:$password -sha1 -nodes \ +        -subj "/C=$country/ST=$state/L=$locality/O=$organization/OU=$organizationalunit/CN=$cn/emailAddress=$email" \ +        -out ${workdir}/${cn}.csr && echo -n "[DONE]" || fatal "unable to create request" + +if [[ "${REMOVEPASSPHRASE:-true}" = 'true' ]]; then +  #statements +  #Remove passphrase from the key. Comment the line out to keep the passphrase +  info "Removing passphrase from ${cn}.key" +  openssl rsa -in ${workdir}/${cn}.key \ +  -passin pass:$password \ +  -out ${workdir}/${cn}.insecure 2>/dev/null \ +  && echo -n "[DONE]" || fatal "unable to remove passphrase" +  #swap the filenames +  info "Swapping the ${cn}.key to secure" +  mv ${workdir}/${cn}.key ${workdir}/${cn}.secure \ +  && echo -n "[DONE]" || fatal "unable to perfom move" +  info "Swapping insecure key to ${cn}.key" +  mv ${workdir}/${cn}.insecure ${workdir}/${cn}.key \ +  && echo -n "[DONE]" || fatal "unable to perform move" +else +  info "Flag '-r' is set, passphrase will not be removed." +fi +} + +printCSR() +{ +if [[ -e ${workdir}/${cn}.csr ]] && [[ -e ${workdir}/${cn}.key ]] +then +echo -e "\n\n----------------------------CSR-----------------------------" +cat ${workdir}/${cn}.csr +echo -e "\n----------------------------KEY-----------------------------" +cat ${workdir}/${cn}.key +echo -e "------------------------------------------------------------\n" +else +fatal "CSR or KEY generation failed !!" +fi +} + +### END Functions ### + +#Check the number of arguments. If none are passed, print help and exit. +NUMARGS=$# +if [ $NUMARGS -eq 0 ]; then +fatal "$NUMARGS Arguments provided !!!! See usage with '-h'" +fi + +#Organisational details + +while getopts ":c:d:sⓂ️p:rhx" atype +do +case $atype in +c ) +        CFOUND=1 +        cn="$OPTARG" +        ;; +d ) +  yourdomain="$OPTARG" +  ;; +s ) +  SFOUND=1 +  subj="$OPTARG" +  ;; +p ) +  password="$OPTARG" +  ;; +r ) +  REMOVEPASSPHRASE='false' +  ;; +m ) +  MFOUND=1 +  ccemail="$OPTARG" +  ;; +x ) +        XFOUND=1 +  ;; +h ) +        usage +        ;; +\? ) +        usage +        ;; +: ) +        fatal "Argument required !!! see \'-h\' for help" +        ;; +esac +done +shift $(($OPTIND - 1)) + +#### END CASE #### START MAIN #### + +if [ $CFOUND -eq 1 ] +then +# take current dir as homedir by default. +checkperms ${homedir} +checkDomain + +  if [[ ! -d ${workdir} ]] +  then +    mkdir ${workdir:-${cn#*.}} 2>/dev/null && info "${workdir} created." +  else +    info "${workdir} exists." +  fi # end workdir check +  parseSubject "$subj" +  genCSRfile +  if [ $XFOUND -eq 0 ] +  then +    sleep 2 +    printCSR +  fi    # end x check +  if [[ $MFOUND -eq 1 ]]; then +    sendMail +  fi +else +        fatal "Nothing to do!" +fi      # end common name check + +##### END MAIN ##### +``` + +* * * + +_This was originally published as the README in [ssl-on-demand's GitHub repository][4] and is reused with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/ssl-demand + +作者:[Abhishek Tamrakar][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/tamrakar +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security-lock-password.jpg?itok=KJMdkKum (Lock) +[2]: https://opensource.com/alternatives/slack +[3]: https://opensource.com/article/19/1/what-certificate +[4]: https://github.com/abhiTamrakar/ssl-on-demand +[5]: https://en.wikipedia.org/wiki/Certificate_signing_request +[6]: mailto:myemail@mydomain.com +[7]: mailto:abhishek.tamrakar08@gmail.com diff --git a/sources/tech/20200214 How to restore a single-core computer with Linux.md b/sources/tech/20200214 How to restore a single-core computer with Linux.md new file mode 100644 index 0000000000..a88a2c157d --- /dev/null +++ b/sources/tech/20200214 How to restore a single-core computer with Linux.md @@ -0,0 +1,270 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to restore a single-core computer with Linux) +[#]: via: (https://opensource.com/article/20/2/restore-old-computer-linux) +[#]: author: (Howard Fosdick https://opensource.com/users/howtech) + +How to restore a single-core computer with Linux +====== +Let's have some geeky fun refurbishing your prehistoric Pentium with +Linux and open source. +![Two animated computers waving one missing an arm][1] + +In a [previous article][2], I explained how I refurbish old dual-core computers ranging from roughly five to 15 years old. Properly restored, these machines can host a fully capable lightweight Linux distribution like [Mint/Xfce][3], [Xubuntu][4], or [Lubuntu][5] and perform everyday tasks. But what if you have a really old computer gathering dust in your attic or basement? Like a Pentium 4 desktop or Pentium M laptop? Yikes! Can you even do anything with a relic like that? + +### Why restore a relic? + +For starters, you might learn a bit about hardware and open source software by refurbishing it. And you could have some fun along the way. Whether you can make much use of it depends on your expectations. + +A single-core computer can perform well for a specific purpose. For example, my friend created a dandy retro gaming box (like I describe below) that runs hundreds of Linux and old Windows and DOS games. His kids love it! + +Another friend uses his Pentium 4 for running design spreadsheets in his workshop. He finds it convenient to have a dedicated machine tucked into a corner of his shop. He likes that he doesn't have to worry about heat or dust ruining an expensive modern computer. + +My romance author acquaintance employs her Pentium M as a "novelist's workstation" lodged in her cozy attic hideaway. The laptop functions as her private word processor. + +I've used old computers to teach beginners how to build and repair hardware. Old equipment makes the best testbed because it's expendable. If someone makes a mistake and fries a board, it doesn't much matter. (Contrast this to how you would feel if you wrecked your main computer!) + +The web suggests many [other potential uses][6] for old Pentiums: security cam monitors, network-attached storage (NAS) servers, [SETI][7] boxes, torrent servers, anonymous [Tails][8] servers, Bitcoin miners, programming workstations, thin clients, terminal emulators, routers, file servers, and more. To me, many of these applications sound more like fun projects than practical uses for single-core computers. That doesn't mean they aren't worth your while; it's just that you want to be clear-eyed about any project you take on. + +By current standards, P-4s and Ms are terribly [weak processors][9]. For example, using them for web surfing is problematic because webpage size and programming complexity have [grown exponentially][10]. And the open web is closing—increasingly, sites won't allow you access unless you let them run all those ads that can overwhelm old processors. (I'll discuss web surfing performance tricks later in this article.) Another shortcoming of old computers is their energy consumption. Better electricity-to-performance ratios often make newer computers more sensible. This especially true when a [tablet or smartphone][11] can fulfill your needs. + +Nevertheless, you can still have fun and learn a lot by tinkering with an old P-4 or M. They're great educational tools, they're expendable, and they can be useful in dedicated roles. Best of all, you can get them for free. I'll tell you how. + +Still reading? Okay, let's have some geeky fun refurbishing your prehistoric Pentium. + +### Understand hardware evolution + +As a quick level-set, here are the common names for the P-4 and M class processors and their rough dates of manufacture: + +**Desktops (2000-2008)** + + * Pentium 4 + * Pentium 4 HT (Hyper-Threading) + * Pentium 4 EE (Extreme Edition) + + + +**Desktops (2005-2008)** + + * Pentium D (early dual-core) + + + +**Mobile (2002-2008)** + + * Pentium M + * Pentium 4-M + * Mobile Pentium 4 + * Mobile Pentium 4 HT + + + +Sources: Wikipedia (for the [P-4][12], [P-M][13], and [processor][14] lists), [CPU World,][15] [Revolvy][16]. + +Machines hosting these processors typically use either DDR2 or DDR memory. Dual-core processors entered the market in 2005 and displaced single-core CPUs within a few years. I'll assume you have some version of what's in the above table. Or you might have an equivalent [AMD][17] or [Celeron][18] processor from the same era. + +The big draw of this old hardware is that you can get it for free. People consider it junk. They'll be only too glad to give you their castoffs. If you don't have a machine on hand, just ask your friends or family. Or drop by the local recycling center. Unless they have strict rules, they'll be happy to give you this old equipment. You can even advertise on [Craigslist][19], [Freecycle,][20] or [other reuse websites][21]. + +**A quick tip:** Grab more than one machine. With old hardware, you often need to cannibalize parts from several computers to build one good working one. + +### Prepare the hardware + +Before you can use your old computer, you must refurbish it. The steps to fixing it up are: + + 1. Clean it + 2. Identify what hardware you have + 3. Verify the hardware works + + + +Start by opening up the box and cleaning out the dirt. Dust causes the heat that kills electronics. A can of compressed air helps. + +Always keep yourself grounded when touching things so that you don't harm the electronics. And don't rub anything with a cleaning rag! Even a shock you can't feel can damage computer circuitry. + +While you've got the box open, learn everything you can about your hardware. Write it all down, so you remember it later: + + * Count the open memory slots, if any. Is the RAM DDR or DDR2 (or something else)? + * Read the hard drive label to learn its capacity and age. (It'll probably be an old IDE drive. You can identify IDE drives by their wide connector ribbons.) + * Check the optical drive label to see what kinds of discs it reads and/or writes, at what speed, and to what standard(s). + * Note other peripherals, add-in cards, or anything unusual. + + + +Close and boot the machine into its boot-time [BIOS][22] panels. [This list][23] tells you what program function (PF) key to press to access those startup panels for your specific computer. Now you can complete your hardware identification by rounding out the details on your processor, memory, video memory, and more. + +### Verify the hardware + +Once you know what you've got, verify that it all works. Test: + + * Memory + * Disk + * Motherboard + * Peripherals (optical drive, USB ports, sound, etc.) + + + +Run any diagnostic tests in the computer's boot or BIOS panels. Free resource kits like [Hiren's BootCD][24] or the [Ultimate Boot CD][25] can round out your testing with any diagnostics your boot panels lack. These kits offer dozens of testing programs: all are free, but not all are open source. You can boot them off a live USB or DVD so that you don't have to install anything on the computer. + +Be sure to run the "extended" or long tests for the memory and disk drive. Run tests overnight if you have to. Do this job right! If you miss a problem now, it could cause you big headaches later. + +If you find a problem, refer to my _[Quick guide to fixing hardware][26]_ to solve common issues. + +### Essential hardware upgrades + +You'll want to make two key hardware upgrades. First, increase memory to the computer's maximum. (You can find the maximum for your computer with a quick web search for its specs.) The practical minimum to run many lightweight Linux distros is 1GB RAM; 2GB or more is ideal. While the maximum allowable memory varies by the machine, the great majority of these computers will upgrade to at least 2GB. + +Second—if the desktop doesn't already have one—add a video card. This offloads graphics processing from the motherboard to the video card and increases the computer's video memory. Bumping up the VRAM from 32 or 64MB to 256GB or more greatly increases the range of applications an old computer can run. Especially if you want to run games. + +Be sure the video card fits your computer's [video slot][27] (AGP, PCI, or PCI-Express) and has the right [cable connector][28] (VGA or DVI). You can issue a couple of [Linux line commands][29] to see how much VRAM your system has, or look in the BIOS boot panels. + +These two simple upgrade hacks—increasing memory and video power—take a marginal machine and make it _way_ more functional. Your goal is to build the most powerful P-4 or M ever. That way, you can squeeze the most performance from this aging design. + +The good news is that with the old computers we're talking about, you can get any parts you need for free. Just cannibalize them from other discarded PC's. + +### Select the software + +Choosing the right software for a P-4 or M is critical. [Don't][30] use an [unsupported][31] Windows version just because it's already on the PC; malware might plague you if you do. A fresh install is mandatory. + +Open source software is the way to go. [Many][32] Linux [distributions][33] are specifically designed for older computers. And with Linux, you can install, move, copy, and clone the operating system and its apps at will. This makes your job easier: You won't run into activation or licensing issues, and it's all free. + +Which distribution should you pick? Assuming you have at least 2GB of memory, start your search by trying a _lightweight distribution_—these feature resource-stingy [desktop environments][34]. Xfce or LXQt are excellent desktop environment choices. Products that [consume more resources][35] or produce fancier graphics—like Unity, GNOME, KDE, MATE, and Cinnamon—won't perform well. + +The lightweight Linux distros I've enjoyed success with are Mint/Xfce, Xubuntu, and Lubuntu. The first two use Xfce while Lubuntu employs LXQt. You can find [many other][36] excellent candidate distros beyond these three choices that I can vouch for. + +Be sure to download the 32-bit versions of the operating systems; 64-bit versions don't make much sense unless a computer has at least 4GB of memory. + +The lightweight Linux distros I've cited offer friendly menus and feature huge software repositories backed by active forums. They'll enable your old computer to do everything it's capable of. However, they won't run on every computer from the P-4 era. If one of these products runs on your computer and you like it, great! You've found your distro. + +If your computer doesn't perform well with these selections, won't boot, or you have less than 2GB of memory, try an _ultralight distribution_. Ultralights reduce resource use by replacing desktop environments with [window managers][37] like Fluxbox, FLWM, IceWM, JWM, or Openbox. Window managers use fewer resources than desktop environments. The trade-off is that they're less flexible. As an example, you may have to dip into code to alter your desktop or taskbar icons. + +My go-to ultralight distro is [Puppy Linux][38]. It comes in several variants that run well on Pentium 4's and M's with only 1GB of memory. Puppy's big draw is that it has versions designed specifically for older computers. This means you'll avoid the hassles you might run into with other distros. For example, Puppy versions run on old CPUs that don't support features like PAE or SSE3. They'll even help you run an older kernel or obsolete bootstrap program if your hardware requires it. + +And Puppy runs _fast_ on limited-resource computers! It optimizes performance by loading the operating system entirely into memory to avoid slow disk access. It bundles a full range of apps that have been carefully selected to use minimal hardware resources. + +Puppy is also user-friendly. Even a naive end user can use its simple menus and attractive desktop. But be advised—it takes expertise to install and configure the product. You might have to spend some time on Puppy's [forum][39] to get oriented. The forum is especially useful because many who post there work with old computers. + +A fun alternative to Puppy is [Tiny Core][40] Linux. With Tiny Core, you install only the software components you want. So you build up your environment from the absolute minimum. This takes time but results in a lean, mean system. Tiny Core is perfect for creating a dedicated server. It's a great learning tool, too, so check out its [free eBook][41]. + +If you want a quick, no-hassles install, you might try [antiX][42]. It's Debian-based, offers a selection of lightweight interfaces, and runs well on machines with only a gigabyte of memory. I've had excellent results installing antiX on a variety of old PCs. + +_**Caution:**_ Many distros casually claim that they run on "old computers" when they really mean that they run on _limited-resource computers_. There's a big difference. Old computers sometimes do not support all the CPU features required by newer operating systems. Avoid problems by selecting a Linux proven to run on your hardware. + +Don't know if a distro will run on your box? Save yourself some time by posting a message on the distro's forum and asking for responses from folks using hardware like yours. You should receive some success stories. If nobody can say they've done what you're trying to do, I'd avoid that product. + +### How to use your refurbished computer + +Will you be happy using your restored PC? It depends on what you expect. + +People who use aging systems learn to leverage minimal resources. For example, they run resource-stingy programs like GNOME Office in place of LibreOffice. They forgo CPU-intense programs like emulators, graphics-heavy apps, video processing, and virtual machine hosting. They focus on one task at a time and don't expect much concurrency. And they know how to manage machine resources proactively. + +Old hardware can perform well in dedicated situations. Earlier, I mentioned my friends who use their old computers for design spreadsheets and as a writer's workbench. And I wrote this article on my personal retro box—a Dell GX280 desktop with a Pentium 4 at 3.2GHz, with 2GB DDR-2 RAM and two 40GB IDE disks, dual-booting Puppy and antiX. + +#### Create a retro game box + +You can also create a fantastic retro game box. First, install an appropriate distro. Then install [Wine][43], a program designed to run Windows software on Linux. Now you'll be able to run nearly all your old Windows XP, ME/98/95, and 3.1 games. [DOSBox][44] supports tons more [free DOS games][45]. And Linux offers over a thousand more. + +I've enjoyed nostalgic fun on a P-4 running antiX and all the old games I remember from years ago. Just be sure you've maxed out system memory and added a good video card for the best results. + +#### Access the web + +The big challenge with old computers is web surfing. [This study][46] claims that average website size has increased 100% over a three-year period, while [this article][47] tells how bloated news sites have become. Videos, animation, images, trackers, ad requests—they all make websites slower than just a few years ago. + +Worse, websites increasingly refuse you access unless you allow them to run their ads. This is a problem because the ads can overwhelm old CPUs. In fact, for most websites, the resources required to run ads and trackers are _way_ greater than that required for the actual website content. + +Here are the performance tricks you need to know if you web surf with an older computer: + + * Run the fastest, lightest browser possible. Chrome, Firefox, and Opera are probably the top mainstream offerings. + * Try alternative [minimalist browsers][48] to see if they can meet your needs: [Dillo][49], [NetSurf][50], [Dooble][51], [Lynx][52], [Links][53], or others. + * Actively manage your browser. + * Don't open many browser tabs. + * Manually start and stop processing in specific tabs. + * Block ads and trackers: + * Offload this chore to your virtual private network (VPN) if at all possible. + * Otherwise, use a browser extension. + * Don't slow down your browser by installing add-ons or extensions beyond the minimum required. + * Disable autoplay for videos and Flash. + * Toggle JavaScript off and on. + * Ensure the browser renders text before graphics. + * Don't run background tasks while web surfing. + * Manually clear cookies to avoid page-access limits on some websites. + * Linux means you don't have to run real-time anti-malware (which consumes a CPU core on many Windows PCs). + + + +Employing some of these tricks, I happily use refurbished dual-core computers for all my web surfing. But with today's internet, I find single-core processors inadequate for anything beyond the occasional web lookup. In other words, they're acceptable for _web access_ but insufficient for _web surfing_. That's just my opinion. Yours may vary depending on your expectations and the nature of your web activity. + +### Enjoy free educational fun + +However you use your refurbished P-4 or M, you'll know a lot more about computer hardware and open source software than when you started. It won't cost you a penny, and you'll have some fun along the way! + +Please share your own refurbishing experiences in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/restore-old-computer-linux + +作者:[Howard Fosdick][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/howtech +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_other11x_cc.png?itok=I_kCDYj0 (Two animated computers waving one missing an arm) +[2]: http://opensource.com/article/19/7/how-make-old-computer-useful-again +[3]: http://linuxmint.com/ +[4]: https://xubuntu.org/ +[5]: http://lubuntu.me/ +[6]: http://www.google.com/search?q=uses+for+a+pentium+IV +[7]: https://en.wikipedia.org/wiki/Search_for_extraterrestrial_intelligence +[8]: https://en.wikipedia.org/wiki/Tails_(operating_system) +[9]: http://www.cpubenchmark.net/low_end_cpus.html +[10]: http://www.digitaltrends.com/web/internet-is-getting-slower/ +[11]: https://www.forbes.com/sites/christopherhelman/2013/09/07/how-much-energy-does-your-iphone-and-other-devices-use-and-what-to-do-about-it/#ba4918e2f702 +[12]: https://en.wikipedia.org/wiki/Pentium_4 +[13]: https://en.wikipedia.org/wiki/Pentium_M +[14]: https://en.wikipedia.org/wiki/List_of_Intel_Pentium_4_microprocessors +[15]: http://www.cpu-world.com/CPUs/Pentium_4/index.html +[16]: https://www.revolvy.com/page/List-of-Intel-Pentium-4-microprocessors?cr=1 +[17]: https://en.wikipedia.org/wiki/List_of_AMD_microprocessors +[18]: https://en.wikipedia.org/wiki/Celeron +[19]: https://www.craigslist.org/about/sites +[20]: https://www.freecycle.org/ +[21]: https://alternativeto.net/software/freecycle/ +[22]: http://en.wikipedia.org/wiki/BIOS +[23]: http://www.disk-image.com/faq-bootmenu.htm +[24]: http://www.hirensbootcd.org/download/ +[25]: http://www.ultimatebootcd.com/ +[26]: http://www.rexxinfo.org/Quick_Guide/Quick_Guide_To_Fixing_Computer_Hardware +[27]: http://www.playtool.com/pages/vidslots/slots.html +[28]: https://silentpc.com/articles/video-connectors +[29]: https://www.cyberciti.biz/faq/howto-find-linux-vga-video-card-ram/ +[30]: https://fusetg.com/dangers-running-unsupported-operating-system/ +[31]: http://home.bt.com/tech-gadgets/computing/windows-7/windows-7-support-end-11364081315419 +[32]: https://itsfoss.com/lightweight-linux-beginners/ +[33]: https://fossbytes.com/best-lightweight-linux-distros/ +[34]: https://en.wikipedia.org/wiki/Desktop_environment +[35]: http://www.phoronix.com/scan.php?page=article&item=ubu-1704-desktops&num=3 +[36]: https://www.google.com/search?ei=TfIoXtG5OYmytAbl04z4Cw&q=best+lightweight+linux+distros+for+old+computers&oq=best+lightweight+linux+distros+for+old&gs_l=psy-ab.1.0.0i22i30l8j0i333.6806.8527..10541...2.2..0.159.1119.2j8......0....1..gws-wiz.......0i71j0.a6LTmaIXan0 +[37]: https://en.wikipedia.org/wiki/X_window_manager +[38]: http://puppylinux.com/ +[39]: http://murga-linux.com/puppy/ +[40]: http://tinycorelinux.net/ +[41]: http://tinycorelinux.net/book.html +[42]: http://antixlinux.com/ +[43]: https://www.winehq.org/ +[44]: https://en.wikipedia.org/wiki/DOSBox +[45]: https://www.dosgamesarchive.com/ +[46]: https://www.digitaltrends.com/web/internet-is-getting-slower/ +[47]: https://www.forbes.com/sites/kalevleetaru/2016/02/06/why-the-web-is-so-slow-and-what-it-tells-us-about-the-future-of-online-journalism/#34475c2072f4 +[48]: http://en.wikipedia.org/wiki/Comparison_of_lightweight_web_browsers +[49]: http://www.dillo.org/ +[50]: http://www.netsurf-browser.org/ +[51]: http://textbrowser.github.io/dooble/ +[52]: http://lynx.browser.org/ +[53]: http://en.wikipedia.org/wiki/Links_%28web_browser%29 diff --git a/sources/tech/20200214 PHP Development on Fedora with Eclipse.md b/sources/tech/20200214 PHP Development on Fedora with Eclipse.md new file mode 100644 index 0000000000..a682381686 --- /dev/null +++ b/sources/tech/20200214 PHP Development on Fedora with Eclipse.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (PHP Development on Fedora with Eclipse) +[#]: via: (https://fedoramagazine.org/php-development-on-fedora-with-eclipse/) +[#]: author: (Mehdi Haghgoo https://fedoramagazine.org/author/powergame/) + +PHP Development on Fedora with Eclipse +====== + +![][1] + +[Eclipse][2] is a full-featured free and open source IDE developed by the Eclipse Foundation. It has been around since 2001. You can write anything from C/C++ and Java to PHP, Python, HTML, JavaScript, Kotlin, and more in this IDE. + +### Installation + +The software is available from Fedora’s official repository. To install it, invoke: + +``` +sudo dnf install eclipse +``` + +This will install the base IDE and Eclipse platform, which enables you to develop Java applications. In order to add PHP development support to the IDE, run this command: + +``` +sudo dnf install eclipse-pdt +``` + +This will install PHP development tools like PHP project wizard, PHP server configurations, composer support, etc. + +### Features + +This IDE has many features that make PHP development easier. For example, it has a comprehensive project wizard (where you can configure many options for your new projects). It also has built-in features like composer support, debugging support, a browser,a terminal, and more. + +### Sample project + +Now that the IDE is installed, let’s create a simple PHP project. Go to _File →New → Project_. From the resulting dialog, select _PHP project_. Enter a name for your project. There are some other options you might want to change, like changing the project’s default location, enabling JavaScript, and changing PHP version. See the following screenshot. + +![Create A New PHP Project in Eclipse][3] + +You can click the _Finish_ button to create the project or press _Next_ to configure other options like adding include and build paths. You don’t need to change those in most cases. + +Once the project is created, right click on the project folder and select _New → PHP File_ to add a new PHP file to the project. For this tutorial I named it _index.php_, the conventionally-recognized default file in every PHP project. + +![][4] + +Then add the your code to the new file. + +![Demo PHP code][5] + +In the example above, I used CSS, JavaScript, and PHP tags on the same page mainly to show that the IDE is capable of supporting all of them together. + +Once your page is ready, you can see the result output by moving the file to your web server document root or by creating a development PHP server in the project directory. + +Thanks to the built-in terminal in Eclipse, we can launch a PHP development server right from within the IDE. Simply click the terminal icon on the toolbar (![Terminal Icon][6]) and click _OK_. In the new terminal, change to the project directory and run the following command: + +``` +php -S localhost:8080 -t . index.php +``` + +![Terminal output][7] + +Now, open a browser and head over to . If everything has been done correctly per instructions and your code is error-free, you will see the output of your PHP script in the browser. + +![PHP output in Fedora][8] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/php-development-on-fedora-with-eclipse/ + +作者:[Mehdi Haghgoo][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/powergame/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/php-eclipse-816x346.png +[2]: https://projects.eclipse.org/projects/eclipse +[3]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-01-58-39.png +[4]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-02-02-05-1024x576.png +[5]: https://fedoramagazine.org/wp-content/uploads/2020/02/code-1024x916.png +[6]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-03-50-05.png +[7]: https://fedoramagazine.org/wp-content/uploads/2020/02/terminal-1024x239.png +[8]: https://fedoramagazine.org/wp-content/uploads/2020/02/output.png diff --git a/translated/tech/20190407 Manage multimedia files with Git.md b/translated/tech/20190407 Manage multimedia files with Git.md deleted file mode 100644 index e0f8372d14..0000000000 --- a/translated/tech/20190407 Manage multimedia files with Git.md +++ /dev/null @@ -1,246 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (svtter) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Manage multimedia files with Git) -[#]: via: (https://opensource.com/article/19/4/manage-multimedia-files-git) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - - -通过 Git 来管理多媒体文件 -====== - -学习如何使用 Git 来追踪项目中的大型多媒体文件。 -在系列中的最后一篇文章中描述了如何使用 Git。 - -![video editing dashboard][1] - -Git 是专用于源代码版本控制的工具。因此,Git 很少被用于非纯文本的项目以及行业。然而,异步工作流的优点是十分诱人的,尤其是在一些日益增长的行业中,这种类型的行业把重要的计算和重要的艺术冒险结合起来。其中,包括网页设计、视觉效果、视频游戏、出版、货币设计(是的,这是一个真实的行业),教育 ... 等等。还有许多行业属于这个类型。 - -在这个系列正要谈到 Git 14周年纪念日之际,我们分享了六个少为人知的方式来使用 Git。在文章的末尾,我们将会介绍一下那些利用 Git 优点来管理多媒体文件的软件。 - -### Git 管理多媒体文件的问题 - -众所周知,Git 用于处理非文本文件不是很好,但是这并不妨碍我们进行尝试。下面是一个使用 Git 来复制照片文件的例子: - -``` -$ du -hs -108K . -$ cp ~/photos/dandelion.tif . -$ git add dandelion.tif -$ git commit -m 'added a photo' -[master (root-commit) fa6caa7] two photos -1 file changed, 0 insertions(+), 0 deletions(-) -create mode 100644 dandelion.tif -$ du -hs -1.8M . -``` - -目前为止没有什么异常。增加一个 1.8MB 的照片到一个目录下,使得目录变成了 1.8 MB 的大小。所以下一步,我们尝试删除文件。 - -``` -$ git rm dandelion.tif -$ git commit -m 'deleted a photo' -$ du -hs -828K . -``` - -在这里我们可以看到有些问题:删除一个已经被提交的文件,还是会使得仓库的大小扩大到原来的8倍(从 108K 到 828K)。我们可以测试多次来得到一个更好的平均值,但是这个简单的演示与我的假设一直。提交非文本文件,在一开始花费空间比较少,但是一个工厂活跃地时间越长,人们可能对静态内容修改的会更多,更多的零碎文件会被加和到一起。当一个 Git 仓库变的越来越大,主要的成本往往是速度。拉取和推送的时间,从最初抿一口咖啡的时间到你觉得你可能踢掉了 - -导致 Git 中静态内容的体积不断扩大的原因是什么呢?那些通过文本的构成的文件,允许 Git 只拉取那些修改的部分。光栅图以及音乐文件对 Git 文件而言与文本不同,你可以查看一下 .png 和 .wav 文件中的二进制数据。所以,Git 只不过是获取了全部的数据,并且创建了一个新的副本,哪怕是一张图仅仅修改了一个像素。 - -### Git-portal - -在实践中,许多多媒体项目不需要或者不想追踪媒体的历史记录。相对于文本后者代码的部分,项目的媒体部分一般有一个不同的生命周期。媒体资源一般通过一个方向产生:一张图片从铅笔草稿开始,以数绘的形式抵达它的目的地。然后,尽管文本能够回滚到早起的版本,但是艺术只会一直向前。工程中的媒体很少被绑定到一个特定的版本。例外情况通常是反映数据集的图形,通常是可以用基于文本的格式(如SVG)完成的表、图形或图表。 - -所以,在许多同时包含文本(无论是叙事散文还是代码)和媒体的工程中,Git 是一个用于文件管理的,可接受的解决方案,只要有一个在版本控制循环之外的游乐场来给艺术家游玩。 - -![Graphic showing relationship between art assets and Git][2] - -一个简单的方法来启用这个特性是 [Git-portal][3],一个通过武装 Git hooks 的 Bash 脚本,它将静态文件从文件夹中移出 Git 的范围,通过链接来取代。Git 提交链接文件(有时候称作快捷方式),这种链接文件比较小,所以所有的提交都是文本文件和那些代表媒体文件的链接。替身文件是链接,所以工程还会像预期的运行,因为本地机器会处理他们,转换成“真的”。当链接文件发生变动时,Git-portal 维护了一个项目的结构,因此逆转这个过程很简单。用户需要考虑的,仅仅是 Git-portal 是否适用于工程,或者需要构建一个没有链接的工程版本(例如需要分发的时候)。 - -Git-portal 也允许通过 rsync 来远程同步静态资源,所以用户可以设置一个远程存储位置,来做为一个中心的授权源。 - -Git-portal 对于多媒体的工程是一个理想的解决方案。类似的多媒体工程包括视频游戏,桌面游戏,需要进行大型3D模型渲染和纹理的虚拟现实工程,[带图的书籍][4]以及 .odt 输出,协作型的[博客站点][5],音乐项目,等等。艺术家在应用程序中以图层(在图形世界中)和曲目(在音乐世界中)的形式执行版本控制并不少见——因此,Git 不会向多媒体项目文件本身添加任何内容。Git 的功能可用于艺术项目的其他部分(例如散文和叙述、项目管理、字幕文件、信贷、营销副本、文档等),而结构化远程备份的功能则由艺术家使用。 - -#### 安装 Git-portal - -Git-portal 的RPM 安装包位于 ,可用于下载和安装。 - -此外,用户可以从 Git-portal 的 Gitlab 主页手动安装。这仅仅是一个 Bash 脚本以及一些 Git hooks(也是 Bash 脚本),但是需要一个快速的构建过程来让它知道安装的位置。 - - -``` -$ git clone git-portal.clone -$ cd git-portal.clone -$ ./configure -$ make -$ sudo make install -``` - -#### 使用 Git-portal - -Git-portal 与 Git 一起使用。这意味着,对于 Git 的所有大型文件扩展名,都需要记住一些额外的步骤。但是,你仅仅需要在处理你的媒体资源的时候使用 Git-portal,所以很容易记住,除非你把大文件都当做文本文件来进行处理(对于 Git 用户很少见)。使用 Git-portal 必须做的一个安装步骤是: - - -``` -$ mkdir bigproject.git -$ cd !$ -$ git init -$ git-portal init -``` - -Git-portal 的 **init** 函数在 Git 仓库中创建了一个 **_portal** 文件夹并且添加到 .gitignore 文件中。 - -在平日里使用 Git-portal 和 Git 协同十分平滑。一个较好的例子是基于 MIDI 的音乐项目:音乐工作站产生的项目文件是基于文本的,但是 MIDI 文件是二进制数据: - - -``` -$ ls -1 -_portal -song.1.qtr -song.qtr -song-Track_1-1.mid -song-Track_1-3.mid -song-Track_2-1.mid -$ git add song*qtr -$ git-portal song-Track*mid -$ git add song-Track*mid -``` - -如果你查看一下 **_portal** 文件夹,你会发现那里有原始的MIDI文件。这些文件在原本的位置被替换成了指向 **_portal** 的链接文件,使得音乐工作站像预期一样运行。 - - -``` -$ ls -lG -[...] _portal/ -[...] song.1.qtr -[...] song.qtr -[...] song-Track_1-1.mid -> _portal/song-Track_1-1.mid* -[...] song-Track_1-3.mid -> _portal/song-Track_1-3.mid* -[...] song-Track_2-1.mid -> _portal/song-Track_2-1.mid* -``` - -与 Git 相同,你也可以添加一个文件下的文件。 - - -``` -$ cp -r ~/synth-presets/yoshimi . -$ git-portal add yoshimi -Directories cannot go through the portal. Sending files instead. -$ ls -lG _portal/yoshimi -[...] yoshimi.stat -> ../_portal/yoshimi/yoshimi.stat* -``` - -删除功能也想预期一样工作,但是从 **_portal**中删除了一些东西。你应该使用 **git-portal rm** 而不是 **git rm**。使用 Git-portal 可以确保文件从 **_portal** 中删除: - - -``` -$ ls -_portal/ song.qtr song-Track_1-3.mid@ yoshimi/ -song.1.qtr song-Track_1-1.mid@ song-Track_2-1.mid@ -$ git-portal rm song-Track_1-3.mid -rm 'song-Track_1-3.mid' -$ ls _portal/ -song-Track_1-1.mid* song-Track_2-1.mid* yoshimi/ -``` - -如果你忘记使用 Git-portal,那么你需要手动删除 portal 文件: - - -``` -$ git-portal rm song-Track_1-1.mid -rm 'song-Track_1-1.mid' -$ ls _portal/ -song-Track_1-1.mid* song-Track_2-1.mid* yoshimi/ -$ trash _portal/song-Track_1-1.mid -``` - -Git-portal 仅有的其他工程,是列出当前所有的链接并且找到里面已经损坏的部分。有时这种情况会因为项目文件夹中的文件被移动而发生: - - -``` -$ mkdir foo -$ mv yoshimi foo -$ git-portal status -bigproject.git/song-Track_2-1.mid: symbolic link to _portal/song-Track_2-1.mid -bigproject.git/foo/yoshimi/yoshimi.stat: broken symbolic link to ../_portal/yoshimi/yoshimi.stat -``` - -如果你使用 Git-portal 用于私人项目并且维护自己的备份,以上就是技术方面所有你需要知道关于 Git-portal 的事情了。如果你想要添加一个协作者或者你希望 Git-portal 来像 Git 的方式来管理备份,你可以创建一个远程。 - -#### 增加 Git-portal remotes - -为 Git-portal 增加一个远程位置是通过 Git 已经存在的功能来实现的。Git-portal 实现了 Git hooks,隐藏在仓库 .git 文件夹中的脚本,来寻找你的远程主机上是否存在以 **_portal** 开头的文件夹。如果它找到一个,它会尝试使用 **rsync** 来与远程位置同步文件。Git-portal 在用户进行 Git push 以及 Git 合并的时候(或者在进行 git pull的时候,实际上是进行一次 fetch 和自动合并)会处理这项任务。 - -如果你近克隆了 Git 仓库,那么你可能永远不会自己添加一个 remote。这是一个标准的 Git 过程: - -``` -$ git remote add origin [git@gitdawg.com][6]:seth/bigproject.git -$ git remote -v -origin [git@gitdawg.com][6]:seth/bigproject.git (fetch) -origin [git@gitdawg.com][6]:seth/bigproject.git (push) -``` - -**origin** 这个名字对你的主要 Git 仓库是一个流行的惯例,为 Git 数据使用它是有意义的。然而,你的 Git-portal 数据是分开存储的,所以你必须创建第二个远程机器来让 Git-portal 了解向哪里 push 和从哪里 pull。取决于你的 Git 主机。你可能需要一个分离的服务器,因为媒体资源可能有GB的大小,使得一个 Git 主机由于空间限制无法承担。或者,可能你的服务器仅允许你访问你的 Git 仓库而不允许一个额外的存储文件夹: - -``` -$ git remote add _portal [seth@example.com][7]:/home/seth/git/bigproject_portal -$ git remote -v -origin [git@gitdawg.com][6]:seth/bigproject.git (fetch) -origin [git@gitdawg.com][6]:seth/bigproject.git (push) -_portal [seth@example.com][7]:/home/seth/git/bigproject_portal (fetch) -_portal [seth@example.com][7]:/home/seth/git/bigproject_portal (push) -``` - -你可能不想把你的所有私人账户放在你的服务器上,而且你不需要这样做。为了提供服务器上仓库的大文件资源权限,你可以运行一个 Git 前端,比如 **[Gitolite][8]** 或者你可以使用 **rrsync** (restricted rsync)。 - -现在你可以推送你的 Git 数据到你的远程 Git 仓库和你的 Git-portal 数据到你的远程 portal: - - -``` -$ git push origin HEAD -master destination detected -Syncing _portal content... -sending incremental file list -sent 9,305 bytes received 18 bytes 1,695.09 bytes/sec -total size is 60,358,015 speedup is 6,474.10 -Syncing _portal content to example.com:/home/seth/git/bigproject_portal -``` - -如果你已经安装了 Git-portal,并且配置了一个远程的 **_portal**,你的 **_portal** 文件夹将会被同步,并且从服务器获取新的内容,以及在每一次 push 的时候发送新的内容。但是,你不需要进行 Git commit 或者 push 来和服务器同步(用户可以使用直接使用 rsync),我发现对于艺术性内容的改变,提交是有用的。这将会把艺术家及其数字资源集成到工作流的其余部分中,并提供有关项目进度和速度的有用元数据。 - -### 其他选项 - -如果 Git-portal 对你而言太过简单,还有一些其他的选择用于 Git 管理大型文件。[Git Large File Storage][9] (LFS) 是一个失效项目的分支,称作 git-media。这个分支由 Github 维护和支持。它需要特殊的命令(例如 **git lfs track** 来保护大型文件不被 Git 追踪)并且需要用户维护一个 .gitattributes 文件来更新哪些仓库中的文件被 LFS 追踪。对于大文件而言,它 _仅_ 支持 HTTP 和 HTTPS 主机。所以你的 LFS 服务器必须进行配置,才能使得用户可以通过 HTTP 而不是 SSH 或 rsync 来进行鉴权。 - -另一个相对 LFS 更灵活的选项是 [git-annex][10]。你可以在我的文章 [managing binary blobs in Git][11] (忽略 git-media 这个已经废弃的项目,它的继任者 Git LFS 没有将它延续下来)中了解更多。Git-annex 是一个灵活且优雅的解决方案。它拥有一个细腻的系统来用于添加,删除,移动仓库中的大型文件。因为它灵活且强大,有很多新的命令和规则需要进行学习,所以建议看一下它的 [文档][12]。 - -然而,如果你的需求很简单,你可能更加喜欢整合已有技术来进行简单且明显任务的解决方案,Git-portal 可能是对于工作而言比较合适的工具。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/manage-multimedia-files-git - -作者:[Seth Kenlon (Red Hat, Community Moderator)][a] -选题:[lujun9972][b] -译者:[svtter](https://github.com/svtter) -校对:[校对者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/video_editing_folder_music_wave_play.png?itok=-J9rs-My (video editing dashboard) -[2]: https://opensource.com/sites/default/files/uploads/git-velocity.jpg (Graphic showing relationship between art assets and Git) -[3]: http://gitlab.com/slackermedia/git-portal.git -[4]: https://www.apress.com/gp/book/9781484241691 -[5]: http://mixedsignals.ml -[6]: mailto:git@gitdawg.com -[7]: mailto:seth@example.com -[8]: https://opensource.com/article/19/4/file-sharing-git -[9]: https://git-lfs.github.com/ -[10]: https://git-annex.branchable.com/ -[11]: https://opensource.com/life/16/8/how-manage-binary-blobs-git-part-7 -[12]: https://git-annex.branchable.com/walkthrough/ diff --git a/translated/tech/20200112 What I learned going from prison to Python.md b/translated/tech/20200112 What I learned going from prison to Python.md deleted file mode 100644 index 83f78c55aa..0000000000 --- a/translated/tech/20200112 What I learned going from prison to Python.md +++ /dev/null @@ -1,102 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (heguangzhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What I learned going from prison to Python) -[#]: via: (https://opensource.com/article/20/1/prison-to-python) -[#]: author: (Shadeed "Sha" Wallace-Stepter https://opensource.com/users/shastepter) - -我在监狱从 Python 中学到了什么 -====== - -开源编程是如何在入监狱中提供机会的![书架上的编程书籍][1] - -不到一年前,我还在圣昆廷州立监狱服刑,我是无期徒刑。 - -我高三的时候,我抢劫了一个人并向他开了枪。现在,我经过一段时间才意识到并承认自己做错了,这是在经历了陪审团审判并看到我的行为带来的恶果后,我知道需要改变自己,我也确实做到了。尽管我对我的行为表示懊悔,但我毕竟开枪打了一个人,并差点杀了他。做这样的事是有后果的,这是理所当然的。所以在我18岁的时候,我被判了终身监禁。 - -监狱是一个非常可怕的地方;我是也不向你推荐的。但是我必须去,所以我去了。我不告诉你具体的细节,但你可以放心,这是一个不可能有太多想法的的地方,许多人在这里养成的坏习惯比他们过去在别处养成的更多。 - -我是幸运儿。当我在服刑的时候,发生了一些不同的事情。我开始想象自己出狱后的的未来,虽然在这之前,我还是已经度过了我所有的成年生活。 - -现在你想想:我是黑人,只受过高中教育。我没有工作经历,如果我离开监狱,在被释放前,我还是一个被定罪的重罪犯。当每个雇主看到我的简历,都不会有“我需要雇用这个人” -想法,我认为是正常的。 - -我不知道我的选择是什么,但我已经下定决心了。我需要做些活下去的事情,并且这和我入狱前的生活一点也不像。 - -### Python 之路 - -最终,我被关在了圣昆廷州立监狱,我不知道我在那里有多幸运。圣昆廷提供了几个自助教育编程项目。这些[改造机会][2]帮助囚犯使他们拥有在获释后避免再次犯罪的技能。 - -作为其中一个编程项目的一部分,2017年我通过圣昆廷媒体项目认识了[杰西卡·麦凯拉]。杰西卡是编程语言[Pythone][4]的爱好者,她开始向我推荐 Python 有多棒,以及它是刚起步的人学习的完美语言。这就是故事变得比小说更精彩的地方。 - - -> 感谢[@northbaypython][5]让[@ShaStepter][6]和我重复[@pycon][7]的主题演讲,让他们被录制下来。我很荣幸与大家分享: -> -> 从监狱到 Pythone: https://t.co/rcumoAgZHm -> -> 大规模裁员:如果我们不雇佣被判重罪的人,谁会呢? https://t.co/fENDUFdxfX [pic.Twitter.com/kpjo8d3ul6][8] -> -> —杰西卡·麦凯拉(@ jessicamckellar)[2019年11月5日][9] - -杰西卡告诉我一些 Python 视频教程,这些教程是她为一家名叫[O’Reilly Media][10]的公司做的,课程是在线的,如果我能接触到它们,那该有多好呀。不幸的是,在监狱里上网是不可能的。但是,我遇到了一个叫 Tim O’Reilly 的人,他最近刚来到圣昆廷。在他访问之后,Tim 从他的公司 O’Reilly Media 公司向监狱的编程班捐赠了大量内容。最终,我拿到了一款平板电脑,上面有杰西卡的 Python 教程,并学会了如何使用这些Python教程进行编码。 - -真是难以置信。背景和生活与我完全不同的陌生人把这些联系在一起,让我学会了编码。 - - -### 对 Python 社区的热爱 - -在这之后,我开始经常和杰西卡见面,她开始告诉我关于开源社区的情况。从根本上说,开源社区就是关于伙伴关系和协作的社区。因为没有人被排除在外,所以效果很好。 - -对我来说,一个努力寻找我自己的定位的人,我所看到的是一种非常基本的爱——通过合作和接受的爱,通过接触的爱,通过包容的爱。我渴望成为其中的一部分。所以我继续学习Python,不幸的是,我无法获得更多的教程,但是我能够从开源社区编译的大量书面知识中获益。我读过任何提到 Python 的东西,从平装本到晦涩难懂的杂志文章,我使用平板电脑来解决我读到的 Python 问题。 - -我对 Python 和编程的热情不是我的许多同龄人所共有的。除了监狱编程课上的极少数人之外,我认识的其他人都没有提到过编程;一般囚犯都不知道。我认为这是因为有过监禁经历的人无法接触编程,尤其是如果你是有色人种。 -` -### 监狱外的 Python 生活 - -然而,在2018年8月17日,我得到了生命中的惊喜。杰里·布朗州长将我27年的刑期减为无期徒刑,在服刑近19年后,我被释放出狱了。 - -但现实情况是,这也是为什么我认为编程和开源社区如此有价值。我是一名37岁的黑人罪犯,没有工作经历,刚刚在监狱服刑18年。我有犯罪史,并且现存偏见导致没有多少职业适合我。但是编程是少数例外之一。 - -监禁后重返社会的人们迫切需要包容,但当谈话转向工作场所的多样性以及对多样性的需求时,你真的听不到这个群体被提及或包容。 -  - -> 还有什么: -> -> 1\. 背景调查:询问他们在你的公司是如何使用的。 -> -> 2\. 初级角色:删除虚假的、不必要的先决条件,这些条件将排除有记录的合格人员。 -> -> 3\. 积极拓展:与当地再就业项目合作,创建招聘渠道。[11] -> -> —杰西卡·麦凯拉(@ jessicamckellar)[2019年5月12日][12] -  - -因此,我想谦卑地挑战开源社区的所有程序员和成员,让他们围绕包容和多样性展开思考。今天,我自豪地站在你们面前,代表一个大多数人都没有想到的群体——以前被监禁的人。但是我们存在,我们渴望证明我们的价值,最重要的是,我们期待被接受。当我们重返社会时,许多挑战等待着我们,我请求你们允许我们有机会展示我们的价值。欢迎我们,接受我们,最重要的是,包容我们。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/prison-to-python - -作者:[Shadeed "Sha" Wallace-Stepter][a] -选题:[lujun9972][b] -译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/shastepter -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/books_programming_languages.jpg?itok=KJcdnXM2 (Programming books on a shelf) -[2]: https://www.dailycal.org/2019/02/27/san-quentin-rehabilitation-programs-offer-inmates-education-a-voice/ -[3]: https://twitter.com/jessicamckellar?lang=en -[4]: https://www.python.org/ -[5]: https://twitter.com/northbaypython?ref_src=twsrc%5Etfw -[6]: https://twitter.com/ShaStepter?ref_src=twsrc%5Etfw -[7]: https://twitter.com/pycon?ref_src=twsrc%5Etfw -[8]: https://t.co/Kpjo8d3ul6 -[9]: https://twitter.com/jessicamckellar/status/1191601209917837312?ref_src=twsrc%5Etfw -[10]: http://shop.oreilly.com/product/110000448.do -[11]: https://t.co/WnzdEUTuxr -[12]: https://twitter.com/jessicamckellar/status/1127640222504636416?ref_src=twsrc%5Etfw diff --git a/translated/tech/20200203 Give an old MacBook new life with Linux.md b/translated/tech/20200203 Give an old MacBook new life with Linux.md new file mode 100644 index 0000000000..043a5ce7fc --- /dev/null +++ b/translated/tech/20200203 Give an old MacBook new life with Linux.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: (qianmingtian) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Give an old MacBook new life with Linux) +[#]: via: (https://opensource.com/article/20/2/macbook-linux-elementary) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +用 Linux 给旧 MacBook 以新生 +====== + +Elementary OS 的最新版本 Hera 是一个令人印象深刻的平台,它让过时的 MacBook 得以重生。 + +![Coffee and laptop][1] + +当我安装苹果的 [MacOS Mojave][2] 时,它使我以前可靠的 MacBook Air 运行变慢了。我的计算机于 2015 年发布,具有 4 GB 内存, i5 处理器和 Broadcom 4360 无线卡,但是 Mojava 提供的日常驱动程序使 [GnuCash][3] 不可用,这激起了我重返 Linux 的欲望。我很高兴能做到这一点,但是我感到非常遗憾的是,我的这台 MacBook 被闲置了。 + +我在 MacBook Air 上尝试了几种 Linux 发行版,但总是会有陷阱。有时是无线网卡;还有一次,它缺少对触摸板的支持。看了一些不错的评论后,我决定尝试 [Elementary OS][4] 5.0(Juno)。我用 USB [制作了启动盘][5],并将其插入 MacBook Air 。我来到了一个实时桌面,并且操作系统识别了我的 Broadcom 无线芯片组-我认为这可能已经正常工作了! + +我喜欢在 Elementary OS 中看到的内容。它的 [Pantheon][6] 桌面真的很棒,并且其外观和使用起来的感觉对 Apple 用户来说很熟悉-它的显示屏底部有一个底座,并带有可引导常用应用程序的图标。我喜欢我之前期待的预览,所以我决定安装它,然后我的无线设备消失了。真的很令人失望。我真的很喜欢 Elementary OS ,但是没有无线是不行的。 + +时间快进到 2019 年 12 月,当我在 [Linux4Everyone][7] 播客上听到有关 Elementary 最新版本 v.5.1(Hera) 使MacBook复活的评论时,我决定用 Hera 再试一次。我下载了 ISO ,创建了可启动驱动器,将其插入电脑,这次操作系统识别了我的无线网卡。我可以在上面工作了。 + +![MacBook Air with Hera][8] + +我非常高兴我轻巧又功能强大的 MacBook Air 通过 Linux 焕然一新。我一直在更详细地研究 Elementary OS ,我可以告诉你我印象深刻的东西。 + +### Elementary OS 的功能 + +根据 [Elementary 的博客][9],“新设计的登录和锁定屏幕问候语看起来更清晰,效果更好,并且修复了以前问候语中报告的许多问题,包括焦点问题, HiDPI 问题和更好的本地化。 Hera 的新设计是为了响应来自 Juno 的用户反馈,并启用了一些不错的新功能。” + +轻描淡写的“不错的新功能” — Elementary OS 拥有我见过的最佳设计的 Linux 用户界面之一。默认情况下,系统上的“系统设置”图标位于扩展坞上。更改设置很容易,很快我就按照自己的喜好配置了系统。我需要的文字大小比默认值大,辅助功能要易于使用并且允许我设置大文字和高对比度。我还可以使用较大的图标和其他选项来调整底座。 + +![Elementary OS 的设置界面][10] + +按下 Mac 的 Command 键将弹出一个键盘快捷键列表,这对新用户非常有帮助。 + +![Elementary OS' 的键盘快捷键][11] + +Elementary OS 附带的 [Epiphany][12] Web 浏览器,我发现它非常易于使用。 它与 Chrome , Chromium 或 Firefox 略有不同,但它已经绰绰有余。 + +对于注重安全的用户(我们应该都是), Elementary OS 的安全和隐私设置提供了多个选项,包括防火墙,历史记录,锁定,临时和垃圾文件的自动删除以及用于位置服务开/关的开关。 + +![Elementary OS 的隐私与安全][13] + +### 有关 Elementray OS 的更多信息 + +Elementary OS 最初于 2011 年发布,其最新版本 Hera 于 2019 年 12 月 3 日发布。 Elementary 的联合创始人兼 CXO 的 [Cassidy James Blaede][14] 是操作系统的 UX 架构师。 Cassidy 喜欢使用开放技术来设计和构建有用,可用和令人愉悦的数字产品。 + +Elementary OS 具有出色的用户[文档][15],其代码(在 GPL 3.0 下许可)可在 [GitHub][16] 上获得。 Elementary OS 鼓励参与该项目,因此请务必伸出援手并[加入社区][17]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/macbook-linux-elementary + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[qianmingtian][c] +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[c]: https://github.com/qianmingtian +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_cafe_brew_laptop_desktop.jpg?itok=G-n1o1-o (Coffee and laptop) +[2]: https://en.wikipedia.org/wiki/MacOS_Mojave +[3]: https://www.gnucash.org/ +[4]: https://elementary.io/ +[5]: https://opensource.com/life/14/10/test-drive-linux-nothing-flash-drive +[6]: https://opensource.com/article/19/12/pantheon-linux-desktop +[7]: https://www.linux4everyone.com/20-macbook-pro-elementary-os +[8]: https://opensource.com/sites/default/files/uploads/macbookair_hera.png (MacBook Air with Hera) +[9]: https://blog.elementary.io/introducing-elementary-os-5-1-hera/ +[10]: https://opensource.com/sites/default/files/uploads/elementaryos_settings.png (Elementary OS's Settings screen) +[11]: https://opensource.com/sites/default/files/uploads/elementaryos_keyboardshortcuts.png (Elementary OS's Keyboard shortcuts) +[12]: https://en.wikipedia.org/wiki/GNOME_Web +[13]: https://opensource.com/sites/default/files/uploads/elementaryos_privacy-security.png (Elementary OS's Privacy and Security screen) +[14]: https://github.com/cassidyjames +[15]: https://elementary.io/docs/learning-the-basics#learning-the-basics +[16]: https://github.com/elementary +[17]: https://elementary.io/get-involved diff --git a/translated/tech/20200205 Getting started with GnuCash.md b/translated/tech/20200205 Getting started with GnuCash.md deleted file mode 100644 index 69ef66261d..0000000000 --- a/translated/tech/20200205 Getting started with GnuCash.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting started with GnuCash) -[#]: via: (https://opensource.com/article/20/2/gnucash) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) - -开始使用 GnuCash -====== -使用 GnuCash 管理你的个人或小型企业会计。 -![A dollar sign in a network][1] - -在过去的四年里,我一直在用 [GnuCash][2] 来管理我的个人财务,我对此非常满意。这个开源 (GPL v3) 项目自 1998 年首次发布以来一直成长和改进,2019 年 12 月发布的最新版本 3.8 增加了许多改进和 bug 修复。 - -GnuCash 可在 Windows、MacOS 和 Linux 中使用。它实现了一个复式记账系统,并可以导入各种流行的开放和专有文件格式,包括 QIF、QFX、OFX、CSV 等。这使得从其他财务应用转换(包括 Quicken)而来很容易,它是为取代这些而出现的。 - -借助 GnuCash,你可以跟踪个人财务状况以及小型企业会计和开票。它没有一个集成的工资系统。根据文档,你可以在 GnuCash 中跟踪工资支出,但你必须在软件外部计算税金和扣减。 - -### 安装 - -要在 Linux 上安装 GnuCash: - - * 在 Red Hat、CentOS 或 Fedora 中: **$ sudo dnf install gnucash** - * 在 Debian、Ubuntu 或 Pop_OS 中: **$ sudo apt install gnucash** - - - -你也可以从 [Flathub][3] 安装它,我在运行 Elementary OS 的笔记本上使用它。(本文中的所有截图都来自此次安装)。 - -### 设置 - -安装并启动程序后,你将看到一个欢迎屏幕,该页面提供了创建新账户集、导入 QIF 文件或打开新用户教程的选项。 - -![GnuCash Welcome screen][4] - -#### 个人账户 - -如果你选择第一个选项(正如我所做的那样),GnuCash 会打开一个页面给你向导。它收集初始数据并设置账户首选项,例如账户类型和名称、商业数据(例如,税号)和首选货币。 - -![GnuCash new account setup][5] - -GnuCash 支持个人银行账户、商业账户、汽车贷款、CD 和货币市场账户、儿童保育账户等。 - -例如,首先创建一个简单的支票簿。你可以输入账户的初始余额或以多种格式导入现有账户数据。 - -![GnuCash import data][6] - -#### 开票 - -GnuCash 还支持小型企业功能,包括客户、供应商和开票。要创建发票,请在 **Business ->Invoice** 中输入数据。 - -![GnuCash create invoice][7] - -然后,你可以将发票打印在纸上,也可以将其导出到 PDF 并通过电子邮件发送给你的客户。 - -![GnuCash invoice][8] - -### 获取帮助 - -如果你有任何疑问,它有一个优秀的帮助,你可在菜单栏的右侧获取指导。 - -![GnuCash help][9] - -项目的网站包含许多有用的信息的链接,例如 GnuCash [功能][10]的概述。GnuCash 还提供了[详细的文档][11],可供下载和离线阅读,它还有一个 [wiki][12],为用户和开发人员提供了有用的信息。 - -你可以在项目的 [GitHub][13] 仓库中找到其他文件和文档。GnuCash 项目由志愿者驱动。如果你想参与,请查看项目的 wiki 上的 [Getting involved][14] 部分。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/gnucash - -作者:[Don Watkins][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/don-watkins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_whitehurst_money.png?itok=ls-SOzM0 (A dollar sign in a network) -[2]: https://www.gnucash.org/ -[3]: https://flathub.org/apps/details/org.gnucash.GnuCash -[4]: https://opensource.com/sites/default/files/images/gnucash_welcome.png (GnuCash Welcome screen) -[5]: https://opensource.com/sites/default/files/uploads/gnucash_newaccountsetup.png (GnuCash new account setup) -[6]: https://opensource.com/sites/default/files/uploads/gnucash_importdata.png (GnuCash import data) -[7]: https://opensource.com/sites/default/files/uploads/gnucash_enter-invoice.png (GnuCash create invoice) -[8]: https://opensource.com/sites/default/files/uploads/gnucash_invoice.png (GnuCash invoice) -[9]: https://opensource.com/sites/default/files/uploads/gnucash_help.png (GnuCash help) -[10]: https://www.gnucash.org/features.phtml -[11]: https://www.gnucash.org/docs/v3/C/gnucash-help.pdf -[12]: https://wiki.gnucash.org/wiki/GnuCash -[13]: https://github.com/Gnucash -[14]: https://wiki.gnucash.org/wiki/GnuCash#Getting_involved_in_the_GnuCash_project diff --git a/translated/tech/20200206 3 ways to use PostgreSQL commands.md b/translated/tech/20200206 3 ways to use PostgreSQL commands.md deleted file mode 100644 index 9f5890f370..0000000000 --- a/translated/tech/20200206 3 ways to use PostgreSQL commands.md +++ /dev/null @@ -1,228 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Morisun029) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 ways to use PostgreSQL commands) -[#]: via: (https://opensource.com/article/20/2/postgresql-commands) -[#]: author: (Greg Pittman https://opensource.com/users/greg-p) - -3种使用 PostgreSQL 命令的方式 -====== -无论你需要的东西简单(如一个购物清单)亦或复杂(如色卡生成器) - PostgreSQL 命令都能使它变得容易起来。 - -![Team checklist and to dos][1] - -在 _[PostgreSQL 入门][2]_ 一文中, 我解释了如何安装,设置和开始使用开源数据库软件。然而,使用 [PostgreSQL][3] 中的命令可以做更多事情。 - -例如,我使用 Postgres 来跟踪我杂货店的购物清单。我杂货店里的大多数购物是在家里进行的,其中每周进行一次大批量的采购。我去几个不同的地方购买清单上的东西,因为每家商店都提供特定的选择或质量,亦或更好的价格。最初,我制作了一个HTML表单页面来管理我的购物清单,但这样无法保存我的输入内容。因此,在想到要购买的物品时我必须要马上列出清单,因为到采购时我常常会忘记一些我需要或想要的东西。 - -相反,使用 PostgreSQL,当我想到需要的物品时,我可以随时输入,并在购物前打印出来。你也可以这样做。 - - -### 创建一个简单的购物清单 - - -首先,数据库中输入**psql ** 命令,然后用下面的命令创建一个表: -``` -`Create table groc (item varchar(20), comment varchar(10));` -``` - -输入如下命令在清单中加入商品: - -``` -insert into groc values ('milk', 'K'); -insert into groc values ('bananas', 'KW'); -``` - -括号中有两个信息(逗号隔开):前面是你需要买的东西,后面字母代表你要购买的地点以及哪些东西是你每周通常都要买的(W)。 - -因为 **psql** 有历史记录,你可以按向上键在括号内编辑信息,而无需输入商品的整行信息。 - -在输入一小部分商品后,输入下面命令来检查前面的输入内容。 - -``` -Select * from groc order by comment; - - item | comment -\----------------+--------- - ground coffee | H - butter | K - chips | K - steak | K - milk | K - bananas | KW - raisin bran | KW - raclette | L - goat cheese | L - onion | P - oranges | P - potatoes | P - spinach | PW - broccoli | PW - asparagus | PW - cucumber | PW - sugarsnap peas | PW - salmon | S -(18 rows) -``` - -此命令按_comment_ 列对结果进行排序,以便按购买地点对商品进行分组,从而是你的购物更加方便。 - -使用W来指明你每周要买的东西,当你要清除表单为下周的列表做准备时,你可以将每周的商品保留在购物清单上。输入: - -``` -`delete from groc where comment not like '%W';` -``` - -注意,在 PostgreSQL 中 **%** 表示通配符(而非星号)。所以,要保存输入内容,需要输入: - -``` -`delete from groc where item like 'goat%';` -``` - -不能使用**item = 'goat%'**,这样没用。 - - -在购物时,用以下命令输出清单并打印出来发送到你的手机: - -``` -\o groclist.txt -select * from groc order by comment; -\o -``` - -最后一个命令**\o*,重置输出到命令行。否则,所有的输出会继续输出到你创建的杂货店购物文件中。 - -### 分析复杂的表 - -This item-by-item entry may be okay for short tables, but what about really big ones? A couple of years ago, I was helping the team at [FreieFarbe.de][4] to create a swatchbook of the free colors (freieFarbe means "free colors" in German) from its HLC color palette, where virtually any imaginable print color can be specified by its hue, luminosity (brightness), and chroma (saturation). The result was the [HLC Color Atlas][5], and here's how we did it. - -逐个输入对于数据量小的表来说没有问题,但是对于数据量大的表呢?几年前,我帮团队从 HLC 调色板中创建一个自由色的色样册。事实上,任何能想象到的打印色都可按色调、亮度、浓度(饱和度)来规定。最终结果是[HLC Color Atlas][5],下面是我们如何实现的。 - -该团队向我发送了具有颜色规范的文件,因此我可以编写可与 Scribus 配合使用的 Python 脚本,以轻松生成色样册。一个例子像这样开始: - - -``` -HLC, C, M, Y, K -H010_L15_C010, 0.5, 49.1, 0.1, 84.5 -H010_L15_C020, 0.0, 79.7, 15.1, 78.9 -H010_L25_C010, 6.1, 38.3, 0.0, 72.5 -H010_L25_C020, 0.0, 61.8, 10.6, 67.9 -H010_L25_C030, 0.0, 79.5, 18.5, 62.7 -H010_L25_C040, 0.4, 94.2, 17.3, 56.5 -H010_L25_C050, 0.0, 100.0, 15.1, 50.6 -H010_L35_C010, 6.1, 32.1, 0.0, 61.8 -H010_L35_C020, 0.0, 51.7, 8.4, 57.5 -H010_L35_C030, 0.0, 68.5, 17.1, 52.5 -H010_L35_C040, 0.0, 81.2, 22.0, 46.2 -H010_L35_C050, 0.0, 91.9, 20.4, 39.3 -H010_L35_C060, 0.1, 100.0, 17.3, 31.5 -H010_L45_C010, 4.3, 27.4, 0.1, 51.3 -``` - -这与原文件相比,稍有修改,将数据用制表符分隔。我将其转换成 CSV 格式(逗号分割值),我更喜欢其与 Python 一起使用(CSV 文也很有用因为它可轻松导入到电子表格程序中)。 - -在每一行中,第一项是颜色名称,其后是其 C,M,Y 和 K 颜色值。 该文件包含1,793种颜色,我想要一种分析信息的方法,以了解这些值的范围。 这就是 PostgreSQL 发挥作用的地方。 我不想手动输入所有数据-我认为输入过程中我不可能不出错。 幸运的是,PostgreSQL 为此提供了一个命令。 - -首先用以下命令创建数据库: - -``` -`Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal);` -``` - -然后通过以下命令引入数据: - - -``` -`\copy hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV);` -``` - - -开头有反斜杠,是因为使用纯**copy** 命令仅限于 root 用户和 Postgres 的超级用户。 在括号中,**header** 表示第一行包含标题,应忽略,**CSV** 表示文件格式为 CSV。 请注意,在此方法中,颜色名称周围不需要括号。 - -如果操作成功,会看到 **COPY NNNN**,其中 N 表示插入到表中的行号。 - -最后,可以用下列命令查询: - -``` -select * from hlc_cmyk; - - color | c | m | y | k -\---------------+-------+-------+-------+------ - H010_L15_C010 | 0.5 | 49.1 | 0.1 | 84.5 - H010_L15_C020 | 0.0 | 79.7 | 15.1 | 78.9 - H010_L25_C010 | 6.1 | 38.3 | 0.0 | 72.5 - H010_L25_C020 | 0.0 | 61.8 | 10.6 | 67.9 - H010_L25_C030 | 0.0 | 79.5 | 18.5 | 62.7 - H010_L25_C040 | 0.4 | 94.2 | 17.3 | 56.5 - H010_L25_C050 | 0.0 | 100.0 | 15.1 | 50.6 - H010_L35_C010 | 6.1 | 32.1 | 0.0 | 61.8 - H010_L35_C020 | 0.0 | 51.7 | 8.4 | 57.5 - H010_L35_C030 | 0.0 | 68.5 | 17.1 | 52.5 -``` - - -所有1,793行数据都是这样的。 回想起来,我不能说此查询对于HLC和Scribus任务是绝对必要的,但是它减轻了我对该项目的一些担忧。 - -为了生成 HLC 色谱,我使用 Scribus 为色板页面中的13,000多种颜色自动创建了颜色图表。 - -我可以使用 **copy** 命令输出数据: - -``` -`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV);` -``` - - -我还可以使用 ** where ** 子句根据某些值来限制输出。 - -例如,以下命令将仅发送以 H10 开头的色调值。 - - -``` -`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%';` -``` - -### 备份或传输数据库或表 - -我在此要提到的最后一个命令是**pg_dump**,它用于备份 PostgreSQL 数据库,并在 **psql** 控制台之外运行。 例如: - -``` -pg_dump gregp -t hlc_cmyk > hlc.out -pg_dump gregp > dball.out -``` - -第一行是导出 **hlc_cmyk** 表及其结构。第二行将转储 **gregp** 数据库中的所有表。 这对于备份或传输数据库或表非常有用。 - - -要将数据库或表转到另一台电脑( 查看"[ PostgreSQL 入门][2]" 那篇文章获取详细信息),首先在要转入的电脑上创建一个数据库,然后执行相反的操作。 - -``` -`psql -d gregp -f dball.out` -``` - -一步创建所有表并输入数据。 - -### 总结 - -在本文中,我们了解了如何使用 **WHERE** 参数限制操作,以及如何使用 PostgreSQL 通配符 **%**。 我们还了解了如何将大批量数据加载到表中,然后将部分或全部表数据输出到文件,甚至是将整个数据库及其所有单个表输出。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/postgresql-commands - -作者:[Greg Pittman][a] -选题:[lujun9972][b] -译者:[Morisun029](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/greg-p -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) -[2]: https://opensource.com/article/19/11/getting-started-postgresql -[3]: https://www.postgresql.org/ -[4]: http://freiefarbe.de -[5]: https://www.freiefarbe.de/en/thema-farbe/hlc-colour-atlas/ diff --git a/translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md b/translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md index c044d2c305..524e72fce0 100644 --- a/translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md +++ b/translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md @@ -115,4 +115,4 @@ via: https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconn [12]: https://fedoramagazine.org/wp-content/uploads/2020/01/commands-1024x576.png [13]: https://userbase.kde.org/KDE_Connect/Tutorials/Useful_commands [14]: https://unsplash.com/@pathum_danthanarayana?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[15]: https://unsplash.com/s/photos/android?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText \ No newline at end of file +[15]: https://unsplash.com/s/photos/android?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/translated/tech/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md b/translated/tech/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md deleted file mode 100644 index 0d08f5f51f..0000000000 --- a/translated/tech/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md +++ /dev/null @@ -1,82 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (NVIDIA’s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux) -[#]: via: (https://itsfoss.com/geforce-now-linux/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -NVIDIA 的云游戏服务 GeForce NOW 无耻地忽略了Linux -====== - -NVIDIA的 [GeForce NOW][1] 云游戏服务对于那些可能没有硬件但想使用 GeForce NOW 在最新的最好的游戏上获得尽可能好的游戏体验玩家来说是充满前景的(在线推流游戏,并在任何设备上玩)。 - -该服务仅限于一些用户(以等待列表的形式)使用。然而,他们最近宣布 [GeForce NOW 面向所有人开放][2]。但实际上并不是。 - -有趣的是,它**并不是面向全球所有区域**。而且,更糟的是 **GeForce NOW 不支持 Linux**。 - -![][3] - -### GeForce NOW 并不是向“所有人开放” - -制作一个基于订阅的云服务来玩游戏的目的是消除平台依赖性。 - -就像你通常使用浏览器访问网站一样,你应该能够在每个平台上玩游戏。是这个概念吧? - -![][4] - -好吧,这绝对不是火箭科学,但是 NVIDIA 仍然不支持 Linux(和iOS)? - -### 是因为没有人使用 Linux 吗? - -我非常不同意这一点,即使这是某些不支持 Linux 的原因。如果真是这样,我不会在使用 Linux 作为主要桌面操作系统时为 “It’s FOSS” 写文章。 - -不仅如此,如果 Linux 不值一提,你认为为何一个 Twitter 用户会提到缺少 Linux 支持? - -![][5] - -是的,也许用户群不够大,但是在考虑将其作为基于云的服务时,**不支持 Linux** 显得没有意义。 - -从技术上讲,如果 Linux 上没有游戏,那么 **Valve** 就不会在 Linux 上改进 [Steam Play][6] 来帮助更多用户在 Linux 上玩纯 Windows 的游戏。 - -我不想说不正确的说法,但台式机 Linux 游戏的发展比以往任何时候都要快(即使统计上要比 Mac 和 Windows 要低)。 - -### 云游戏不应该像这样 - -![][7] - -如上所述,找到使用 Steam Play 的 Linux 玩家不难。只是你会发现 Linux 上游戏玩家的整体“市场份额”低于其他平台。 - -即使这是事实,云游戏也不应该依赖于特定平台。而且,考虑到 GeForce NOW 本质上是一种基于浏览器的可以玩游戏的流媒体服务,所以对于像 NVIDIA 这样的大公司来说,支持 Linux 并不困难 - -来吧,Nvidia,_你想要我们相信在技术上支持 Linux 有困难?_或者,你只是想说_不值得支持 Linux 平台?_ - -**总结** - -不管我为 GeForce NOW 服务发布而感到多么兴奋,当看到它根本不支持 Linux,我感到非常失望。 - -如果像 GeForce NOW 这样的云游戏服务在不久的将来开始支持 Linux,**你可能没有理由使用 Windows 了**(*咳嗽*)。 - -你怎么看待这件事?在下面的评论中让我知道你的想法。 - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/geforce-now-linux/ - -作者:[Ankush Das][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://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://www.nvidia.com/en-us/geforce-now/ -[2]: https://blogs.nvidia.com/blog/2020/02/04/geforce-now-pc-gaming/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/nvidia-geforce-now-linux.jpg?ssl=1 -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/nvidia-geforce-now.png?ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/geforce-now-twitter-1.jpg?ssl=1 -[6]: https://itsfoss.com/steam-play/ -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/ge-force-now.jpg?ssl=1 diff --git a/translated/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md b/translated/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md new file mode 100644 index 0000000000..048c0493ab --- /dev/null +++ b/translated/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md @@ -0,0 +1,114 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Install All Essential Media Codecs in Ubuntu With This Single Command [Beginner’s Tip]) +[#]: via: (https://itsfoss.com/install-media-codecs-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +使用此单条命令在 Ubuntu 中安装所有基本媒体编解码器(初学者技巧) +====== + +如果你刚刚安装了 Ubuntu 或其他 [Ubuntu 特色版本][1] 如 Kubuntu、Lubuntu 等,你会注意到系统无法播放某些音频或视频文件。 + +对于视频文件,你可以[在 Ubuntu 上安装 VLC][2]。 [VLC][3] 是 [Linux 上的最佳视频播放器][4]之一,它几乎可以播放任何视频文件格式。但你仍然会遇到无法播放音频和 flash 的麻烦。 + +好消息是 [Ubuntu][5] 提供了一个软件包来安装所有基本的媒体编解码器:ubuntu-restricted-extras。 + +![][6] + +### 什么是 Ubuntu Restricted Extras? + +ubuntu-restricted-extras 是一个包含各种基本软件,如 Flash 插件、[unrar][7]、[gstreamer][8]、mp4、[Ubuntu 中的 Chromium 浏览器][9]的编解码器等的软件包。 + +由于这些软件不是开源软件,并且其中一些涉及软件专利,因此 Ubuntu 默认情况下不会安装它们。你必须使用 multiverse 仓库,它是 Ubuntu 专门为用户提供非开源软件而创建的仓库。 + +请阅读本文以[了解有关各种 Ubuntu 仓库的更多信息][10]。 + +### 如何安装 Ubuntu Restricted Extras? + +令我惊讶的是,我发现软件中心未列出 Ubuntu Restricted Extras。不管怎样,你都可以使用命令行安装该软件包,这非常简单。 + +在菜单中搜索或使用[终端键盘快捷键 Ctrl+Alt+T][11] 打开终端。 + +由于 ubuntu-restrcited-extras 软件包在 multiverse 仓库中,因此你应验证系统上已启用 multiverse 仓库: + +``` +sudo add-apt-repository multiverse +``` + +然后你可以使用以下命令安装: + +``` +sudo apt install ubuntu-restricted-extras +``` + +输入回车后,你会被要求输入密码,_**当你输入密码时,屏幕不会有显示**_。这是正常的。输入你的密码并回车。 + +它将显示大量要安装的包。按回车确认选择。 + +你会看到 [EULA][12](最终用户许可协议),如下所示: + +![Press Tab key to select OK and press Enter key][13] + +浏览此页面可能会很麻烦,但是请放心。只需按 Tab 键,它将高亮选项。当高亮在正确的选项上,按下回车确认你的选择。 + +![Press Tab key to highlight Yes and press Enter key][14] + +安装完成后,由于新安装的媒体编解码器,你应该可以播放 MP3 和其他媒体格式了。 + +##### 在 Kubuntu、Lubuntu、Xubuntu 上安装受限制的额外软件包 + +请记住,Kubuntu、Lubuntu 和 Xubuntu 都有此软件包,并有各自的名称。它们本应使用相同的名字,但不幸的是并不是。 + +在 Kubuntu 上,使用以下命令: + +``` +sudo apt install kubuntu-restricted-extras +``` + +在 Lubuntu 上,使用: + +``` +sudo apt install lubuntu-restricted-extras +``` + +在 Xubuntu 上,你应该使用: + +``` +sudo apt install xubuntu-restricted-extras +``` + +我一直建议将 ubuntu-restricted-extras 作为[安装 Ubuntu 后要做的基本事情][15]之一。只需一个命令即可在 Ubuntu 中安装多个编解码器。 + +希望你喜欢 Ubuntu 初学者系列中这一技巧。以后,我将分享更多此类技巧。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-media-codecs-ubuntu/ + +作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/which-ubuntu-install/ +[2]: https://itsfoss.com/install-latest-vlc/ +[3]: https://www.videolan.org/index.html +[4]: https://itsfoss.com/video-players-linux/ +[5]: https://ubuntu.com/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/Media_Codecs_in_Ubuntu.png?ssl=1 +[7]: https://itsfoss.com/use-rar-ubuntu-linux/ +[8]: https://gstreamer.freedesktop.org/ +[9]: https://itsfoss.com/install-chromium-ubuntu/ +[10]: https://itsfoss.com/ubuntu-repositories/ +[11]: https://itsfoss.com/ubuntu-shortcuts/ +[12]: https://en.wikipedia.org/wiki/End-user_license_agreement +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/installing_ubuntu_restricted_extras.jpg?ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/installing_ubuntu_restricted_extras_1.jpg?ssl=1 +[15]: https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/ diff --git a/translated/tech/20200210 Top hacks for the YaCy open source search engine.md b/translated/tech/20200210 Top hacks for the YaCy open source search engine.md new file mode 100644 index 0000000000..54c4b2f869 --- /dev/null +++ b/translated/tech/20200210 Top hacks for the YaCy open source search engine.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top hacks for the YaCy open source search engine) +[#]: via: (https://opensource.com/article/20/2/yacy-search-engine-hacks) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +使用开源搜索引擎 YaCy 的技巧 +====== +> 不想再受制于各种版本的搜索引擎?使用 YaCy 自定义一款吧。 +![Browser of things][1] + +在我以前介绍 [YaCy 入门][2]的文章中讲述过 [YaCy][3] 这个点对点peer-to-peer式的搜索引擎是如何安装和使用的。YaCy 最大的一个特点就是可以在本地部署,全球范围内的每一个 YaCy 用户都是构成整个分布式搜索引擎架构的其中一个节点,因此每个用户都可以掌控自己的互联网搜索体验。 + +Google 曾经提供过 `google.com/linux` 这样的简便方式以便快速筛选出和 Linux 相关的搜索内容,这个功能受到了很多人的青睐,但 Google 最终还是在 2011 年的时候把它[下线][4]了。 + +而 YaCy 则让自定义搜索引擎变得可能。 + +### 自定义 YaCy + +YaCy 安装好之后,只需要访问 `localhost:8090` 就可以使用了。要开始自定义搜索引擎,只需要点击右上角的“管理Administration”按钮,如果没有找到,需要点击菜单图标打开菜单。 + +你可以在管理面板中配置 YaCy 对系统资源的使用策略,以及如何跟其它的 YaCy 客户端进行交互。 + +![YaCy profile selector][5] + +例如,点击侧栏中的“初步First steps”按钮可以配置备用端口,以及设置 YaCy 对内存和硬盘的使用量;而“监控Monitoring”面板则可以监控 YaCy 的运行状况。大多数功能都只需要在面板上点击几下就可以完成了,例如以下几个常用的功能。 + +### 搜索应用 + +目前市面上也有不少公司推出了[内网搜索应用][6],而 YaCy 的优势是免费使用。对于能够通过 HTTP、FTP、Samba 等协议访问的文件,YaCy 都可以进行索引,因此无论是作为私人的文件搜索还是企业内部的本地共享文件搜索,YaCy 都可以实现。它可以让内部网络中的用户使用自定义配置的 YaCy 查找共享文件,于此同时保持对内部网络以外的用户不可见。 + +### 网络配置 + +YaCy 在默认情况下就对隐私隔离有比较好的支持。点击“用例与账号Use Case & Account”页面顶部的“网络配置Network Configuration”链接,即可进入网络配置面板设置点对点网络。 + +![YaCy network configuration][7] + +### 爬取站点 + +YaCy 点对点的分布式运作方式决定了它对页面的爬取是由用户驱动的。任何一个公司的爬虫都不可能完全访问到整个互联网上的所有页面,对于 YaCy 来说也是这样,一个站点只有在被用户指定爬取的前提下,才会被 YaCy 爬取并进入索引。 + +YaCy 客户端提供了两种爬取页面的方式:一是自定义爬虫,二是使用 YaCy 推荐的爬虫。 + +![YaCy advanced crawler][8] + +#### 自定义爬虫任务 + +自定义爬虫是指由用户输入指定的网站 URL 并启动 YaCy 的爬虫任务。只需要点击“高级爬虫Advanced Crawler”并输入计划爬取的 URL,然后选择页面底部的“进行远程索引Do Remote indexing”选项,这个选项会让客户端将上面输入的 URL 向互联网广播,接收到广播的其它远程客户端就会开始爬取这些 URL 所指向的页面。 + +点击页面底部的“开始新爬虫任务Start New Crawl Job”按钮就可以开始进行爬取了,我就是这样对一些常用和有用站点进行爬取和索引的。 + +爬虫任务启动之后,YaCy 会将这些 URL 对应的页面在本地生成和存储索引。在高级模式下,也就是本地计算机允许 8090 端口流量进出时,全网的 YaCy 用户都可以使用到这一份索引。 + +#### 加入爬虫任务 + +尽管 YaCy 用户已经在互联网上爬取了很多页面,但对于全网浩如烟海的页面而言也只是沧海一粟。单个用户所拥有的资源远不及很多大公司的网络爬虫,但大量 YaCy 用户如果联合起来成为一个社区,能产生的力量就大得多了。只要开启了 YaCy 的爬虫请求广播功能,就可以让其它客户端参与进来爬取更多页面。 + +只需要在“高级爬虫Advanced Crawler”面板中点击页面顶部的“远程爬取Remote Crawling”,勾选“加载Load”复选框,就可以让你的客户端接受其它人发来的爬虫任务请求了。 + +![YaCy remote crawling][9] + +### YaCy 监控相关 + +YaCy 除了作为一个非常强大的搜索引擎,还提供了很丰富的用户体验。你可以在“监控Monitor”面板中监控 YaCy 客户端的网络运行状况,甚至还可以了解到有多少人从 YaCy 社区中获取到了自己所需要的东西。 + +![YaCy monitoring screen][10] + +### 搜索引擎发挥了作用 + +你使用 YaCy 的时间越长,就越会思考搜索引擎如何改变自己的视野,因为你对互联网的体验很大一部分来自于你在搜索引擎中一次次简单查询的结果。实际上,当你和不同行业的人交流时,可能会注意到每个人对“互联网”的理解都有所不同。有些人会认为,互联网的搜索引擎中充斥着各种广告和推广,同时也仅仅能从搜索结果中获取到有限的信息。例如,假设有人不断搜索关于关键词 X 的内容,那么大部分商业搜索引擎都会在搜索结果中提高关键词 X 的权重,但与此同时,另一个关键词 Y 的权重则会相对降低,从而让关键词 Y 被淹没在搜索结果当中。 + +就像在现实生活中一样,走出舒适圈会让你看到一个更广阔的世界。尝试使用 YaCy,看看你会不会有所收获。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/yacy-search-engine-hacks + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者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/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) +[2]: https://opensource.com/article/20/2/open-source-search-engine +[3]: https://yacy.net/ +[4]: https://www.linuxquestions.org/questions/linux-news-59/is-there-no-more-linux-google-884306/ +[5]: https://opensource.com/sites/default/files/uploads/yacy-profiles.jpg (YaCy profile selector) +[6]: https://en.wikipedia.org/wiki/Vivisimo +[7]: https://opensource.com/sites/default/files/uploads/yacy-network-config.jpg (YaCy network configuration) +[8]: https://opensource.com/sites/default/files/uploads/yacy-advanced-crawler.jpg (YaCy advanced crawler) +[9]: https://opensource.com/sites/default/files/uploads/yacy-remote-crawl-accept.jpg (YaCy remote crawling) +[10]: https://opensource.com/sites/default/files/uploads/yacy-monitor.jpg (YaCy monitoring screen) diff --git a/translated/tech/20200212 How to Change the Default Terminal in Ubuntu.md b/translated/tech/20200212 How to Change the Default Terminal in Ubuntu.md new file mode 100644 index 0000000000..f47ff7832d --- /dev/null +++ b/translated/tech/20200212 How to Change the Default Terminal in Ubuntu.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Change the Default Terminal in Ubuntu) +[#]: via: (https://itsfoss.com/change-default-terminal-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何在 Ubuntu 中更改默认终端 +====== + +终端是 Linux 系统的关键部分。它能让你通过 shell 访问 Linux 系统。Linux 上有多个终端应用(技术上称为终端仿真器)。 + +大多数[桌面环境][1]都有自己的终端实现。它们的外观可能有所不同,并且可能有不同的快捷键。 + +例如,[Guake 终端][2]对高级用户非常有用,它提供了一些可能无法在发行版默认终端中使用的功能。 + +你可以在系统上安装其他终端,并将其设为默认,并能通过[快捷键 Ctrl+Alt+T][3] 打开。 + +现在的问题来了,如何在 Ubuntu 中更改默认终端。它没有遵循[更改 Ubuntu 中的默认应用][4]的标准方式,要怎么做? + +### 更改 Ubuntu 中的默认终端 + +![][5] + +在基于 Debian 的发行版中,有一个方便的命令行程序,称为 [update-alternatives][6],可用于处理默认应用。 + +你可以使用它来更改默认的命令行文本编辑器、终端等。为此,请运行以下命令: + +``` +sudo update-alternatives --config x-terminal-emulator +``` + +它将显示系统上存在的所有可作为默认值的终端仿真器。当前的默认终端标有星号。 + +``` +[email protected]:~$ sudo update-alternatives --config x-terminal-emulator +There are 2 choices for the alternative x-terminal-emulator (providing /usr/bin/x-terminal-emulator). + + Selection Path Priority Status +------------------------------------------------------------ + 0 /usr/bin/gnome-terminal.wrapper 40 auto mode + 1 /usr/bin/gnome-terminal.wrapper 40 manual mode +* 2 /usr/bin/st 15 manual mode + +Press to keep the current choice[*], or type selection number: +``` + +你要做的就是输入选择编号。对我而言,我想使用 GNOME 终端,而不是来自 [Regolith 桌面][7]的终端。 + +``` +Press to keep the current choice[*], or type selection number: 1 +update-alternatives: using /usr/bin/gnome-terminal.wrapper to provide /usr/bin/x-terminal-emulator (x-terminal-emulator) in manual mode +``` + +##### 自动模式 vs 手动模式 + +你可能已经在 update-alternatives 命令的输出中注意到了自动模式和手动模式。 + +如果选择自动模式,那么在安装或删除软件包时,系统可能会自动决定默认应用。该决定受优先级数字的影响(如上一节中的命令输出所示)。 + +假设你的系统上安装了 5 个终端仿真器,并删除了默认的仿真器。现在,你的系统将检查哪些仿真器处于自动模式。如果有多个,它将​​选择优先级最高的一个作为默认仿真器。 + +我希望你觉得这个小技巧有用。随时欢迎提出问题和建议。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/change-default-terminal-ubuntu/ + +作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-linux-desktop-environments/ +[2]: http://guake-project.org/ +[3]: https://itsfoss.com/ubuntu-shortcuts/ +[4]: https://itsfoss.com/change-default-applications-ubuntu/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/switch_default_terminal_ubuntu.png?ssl=1 +[6]: https://manpages.ubuntu.com/manpages/trusty/man8/update-alternatives.8.html +[7]: https://itsfoss.com/regolith-linux-desktop/ From 493ecc3f7314370764d795d10a7c1af13d8da984 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Sat, 15 Feb 2020 18:45:13 +0800 Subject: [PATCH 023/315] fix issue --- ...00206 3 ways to use PostgreSQL commands.md | 228 ++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 translated/tech/20200206 3 ways to use PostgreSQL commands.md diff --git a/translated/tech/20200206 3 ways to use PostgreSQL commands.md b/translated/tech/20200206 3 ways to use PostgreSQL commands.md new file mode 100644 index 0000000000..9f5890f370 --- /dev/null +++ b/translated/tech/20200206 3 ways to use PostgreSQL commands.md @@ -0,0 +1,228 @@ +[#]: collector: (lujun9972) +[#]: translator: (Morisun029) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 ways to use PostgreSQL commands) +[#]: via: (https://opensource.com/article/20/2/postgresql-commands) +[#]: author: (Greg Pittman https://opensource.com/users/greg-p) + +3种使用 PostgreSQL 命令的方式 +====== +无论你需要的东西简单(如一个购物清单)亦或复杂(如色卡生成器) + PostgreSQL 命令都能使它变得容易起来。 + +![Team checklist and to dos][1] + +在 _[PostgreSQL 入门][2]_ 一文中, 我解释了如何安装,设置和开始使用开源数据库软件。然而,使用 [PostgreSQL][3] 中的命令可以做更多事情。 + +例如,我使用 Postgres 来跟踪我杂货店的购物清单。我杂货店里的大多数购物是在家里进行的,其中每周进行一次大批量的采购。我去几个不同的地方购买清单上的东西,因为每家商店都提供特定的选择或质量,亦或更好的价格。最初,我制作了一个HTML表单页面来管理我的购物清单,但这样无法保存我的输入内容。因此,在想到要购买的物品时我必须要马上列出清单,因为到采购时我常常会忘记一些我需要或想要的东西。 + +相反,使用 PostgreSQL,当我想到需要的物品时,我可以随时输入,并在购物前打印出来。你也可以这样做。 + + +### 创建一个简单的购物清单 + + +首先,数据库中输入**psql ** 命令,然后用下面的命令创建一个表: +``` +`Create table groc (item varchar(20), comment varchar(10));` +``` + +输入如下命令在清单中加入商品: + +``` +insert into groc values ('milk', 'K'); +insert into groc values ('bananas', 'KW'); +``` + +括号中有两个信息(逗号隔开):前面是你需要买的东西,后面字母代表你要购买的地点以及哪些东西是你每周通常都要买的(W)。 + +因为 **psql** 有历史记录,你可以按向上键在括号内编辑信息,而无需输入商品的整行信息。 + +在输入一小部分商品后,输入下面命令来检查前面的输入内容。 + +``` +Select * from groc order by comment; + + item | comment +\----------------+--------- + ground coffee | H + butter | K + chips | K + steak | K + milk | K + bananas | KW + raisin bran | KW + raclette | L + goat cheese | L + onion | P + oranges | P + potatoes | P + spinach | PW + broccoli | PW + asparagus | PW + cucumber | PW + sugarsnap peas | PW + salmon | S +(18 rows) +``` + +此命令按_comment_ 列对结果进行排序,以便按购买地点对商品进行分组,从而是你的购物更加方便。 + +使用W来指明你每周要买的东西,当你要清除表单为下周的列表做准备时,你可以将每周的商品保留在购物清单上。输入: + +``` +`delete from groc where comment not like '%W';` +``` + +注意,在 PostgreSQL 中 **%** 表示通配符(而非星号)。所以,要保存输入内容,需要输入: + +``` +`delete from groc where item like 'goat%';` +``` + +不能使用**item = 'goat%'**,这样没用。 + + +在购物时,用以下命令输出清单并打印出来发送到你的手机: + +``` +\o groclist.txt +select * from groc order by comment; +\o +``` + +最后一个命令**\o*,重置输出到命令行。否则,所有的输出会继续输出到你创建的杂货店购物文件中。 + +### 分析复杂的表 + +This item-by-item entry may be okay for short tables, but what about really big ones? A couple of years ago, I was helping the team at [FreieFarbe.de][4] to create a swatchbook of the free colors (freieFarbe means "free colors" in German) from its HLC color palette, where virtually any imaginable print color can be specified by its hue, luminosity (brightness), and chroma (saturation). The result was the [HLC Color Atlas][5], and here's how we did it. + +逐个输入对于数据量小的表来说没有问题,但是对于数据量大的表呢?几年前,我帮团队从 HLC 调色板中创建一个自由色的色样册。事实上,任何能想象到的打印色都可按色调、亮度、浓度(饱和度)来规定。最终结果是[HLC Color Atlas][5],下面是我们如何实现的。 + +该团队向我发送了具有颜色规范的文件,因此我可以编写可与 Scribus 配合使用的 Python 脚本,以轻松生成色样册。一个例子像这样开始: + + +``` +HLC, C, M, Y, K +H010_L15_C010, 0.5, 49.1, 0.1, 84.5 +H010_L15_C020, 0.0, 79.7, 15.1, 78.9 +H010_L25_C010, 6.1, 38.3, 0.0, 72.5 +H010_L25_C020, 0.0, 61.8, 10.6, 67.9 +H010_L25_C030, 0.0, 79.5, 18.5, 62.7 +H010_L25_C040, 0.4, 94.2, 17.3, 56.5 +H010_L25_C050, 0.0, 100.0, 15.1, 50.6 +H010_L35_C010, 6.1, 32.1, 0.0, 61.8 +H010_L35_C020, 0.0, 51.7, 8.4, 57.5 +H010_L35_C030, 0.0, 68.5, 17.1, 52.5 +H010_L35_C040, 0.0, 81.2, 22.0, 46.2 +H010_L35_C050, 0.0, 91.9, 20.4, 39.3 +H010_L35_C060, 0.1, 100.0, 17.3, 31.5 +H010_L45_C010, 4.3, 27.4, 0.1, 51.3 +``` + +这与原文件相比,稍有修改,将数据用制表符分隔。我将其转换成 CSV 格式(逗号分割值),我更喜欢其与 Python 一起使用(CSV 文也很有用因为它可轻松导入到电子表格程序中)。 + +在每一行中,第一项是颜色名称,其后是其 C,M,Y 和 K 颜色值。 该文件包含1,793种颜色,我想要一种分析信息的方法,以了解这些值的范围。 这就是 PostgreSQL 发挥作用的地方。 我不想手动输入所有数据-我认为输入过程中我不可能不出错。 幸运的是,PostgreSQL 为此提供了一个命令。 + +首先用以下命令创建数据库: + +``` +`Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal);` +``` + +然后通过以下命令引入数据: + + +``` +`\copy hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV);` +``` + + +开头有反斜杠,是因为使用纯**copy** 命令仅限于 root 用户和 Postgres 的超级用户。 在括号中,**header** 表示第一行包含标题,应忽略,**CSV** 表示文件格式为 CSV。 请注意,在此方法中,颜色名称周围不需要括号。 + +如果操作成功,会看到 **COPY NNNN**,其中 N 表示插入到表中的行号。 + +最后,可以用下列命令查询: + +``` +select * from hlc_cmyk; + + color | c | m | y | k +\---------------+-------+-------+-------+------ + H010_L15_C010 | 0.5 | 49.1 | 0.1 | 84.5 + H010_L15_C020 | 0.0 | 79.7 | 15.1 | 78.9 + H010_L25_C010 | 6.1 | 38.3 | 0.0 | 72.5 + H010_L25_C020 | 0.0 | 61.8 | 10.6 | 67.9 + H010_L25_C030 | 0.0 | 79.5 | 18.5 | 62.7 + H010_L25_C040 | 0.4 | 94.2 | 17.3 | 56.5 + H010_L25_C050 | 0.0 | 100.0 | 15.1 | 50.6 + H010_L35_C010 | 6.1 | 32.1 | 0.0 | 61.8 + H010_L35_C020 | 0.0 | 51.7 | 8.4 | 57.5 + H010_L35_C030 | 0.0 | 68.5 | 17.1 | 52.5 +``` + + +所有1,793行数据都是这样的。 回想起来,我不能说此查询对于HLC和Scribus任务是绝对必要的,但是它减轻了我对该项目的一些担忧。 + +为了生成 HLC 色谱,我使用 Scribus 为色板页面中的13,000多种颜色自动创建了颜色图表。 + +我可以使用 **copy** 命令输出数据: + +``` +`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV);` +``` + + +我还可以使用 ** where ** 子句根据某些值来限制输出。 + +例如,以下命令将仅发送以 H10 开头的色调值。 + + +``` +`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%';` +``` + +### 备份或传输数据库或表 + +我在此要提到的最后一个命令是**pg_dump**,它用于备份 PostgreSQL 数据库,并在 **psql** 控制台之外运行。 例如: + +``` +pg_dump gregp -t hlc_cmyk > hlc.out +pg_dump gregp > dball.out +``` + +第一行是导出 **hlc_cmyk** 表及其结构。第二行将转储 **gregp** 数据库中的所有表。 这对于备份或传输数据库或表非常有用。 + + +要将数据库或表转到另一台电脑( 查看"[ PostgreSQL 入门][2]" 那篇文章获取详细信息),首先在要转入的电脑上创建一个数据库,然后执行相反的操作。 + +``` +`psql -d gregp -f dball.out` +``` + +一步创建所有表并输入数据。 + +### 总结 + +在本文中,我们了解了如何使用 **WHERE** 参数限制操作,以及如何使用 PostgreSQL 通配符 **%**。 我们还了解了如何将大批量数据加载到表中,然后将部分或全部表数据输出到文件,甚至是将整个数据库及其所有单个表输出。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/postgresql-commands + +作者:[Greg Pittman][a] +选题:[lujun9972][b] +译者:[Morisun029](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/greg-p +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) +[2]: https://opensource.com/article/19/11/getting-started-postgresql +[3]: https://www.postgresql.org/ +[4]: http://freiefarbe.de +[5]: https://www.freiefarbe.de/en/thema-farbe/hlc-colour-atlas/ From 2f095f2d0363d73620a275592762e5ceff759b57 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Sat, 15 Feb 2020 18:50:01 +0800 Subject: [PATCH 024/315] update --- ...190407 Manage multimedia files with Git.md | 236 ++++++++++++++++++ ...-CD resources to set you up for success.md | 57 +++++ ...t I learned going from prison to Python.md | 104 ++++++++ ...in one place with this open source tool.md | 72 ++++++ ...ith this open source window environment.md | 111 ++++++++ .../20200205 Getting started with GnuCash.md | 96 +++++++ ...e GeForce NOW Shamelessly Ignores Linux.md | 82 ++++++ 7 files changed, 758 insertions(+) create mode 100644 published/20190407 Manage multimedia files with Git.md create mode 100644 published/20191227 Top CI-CD resources to set you up for success.md create mode 100644 published/20200112 What I learned going from prison to Python.md create mode 100644 published/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md create mode 100644 published/20200124 Run multiple consoles at once with this open source window environment.md create mode 100644 published/20200205 Getting started with GnuCash.md create mode 100644 published/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md diff --git a/published/20190407 Manage multimedia files with Git.md b/published/20190407 Manage multimedia files with Git.md new file mode 100644 index 0000000000..befd819d4f --- /dev/null +++ b/published/20190407 Manage multimedia files with Git.md @@ -0,0 +1,236 @@ +[#]: collector: (lujun9972) +[#]: translator: (svtter) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11889-1.html) +[#]: subject: (Manage multimedia files with Git) +[#]: via: (https://opensource.com/article/19/4/manage-multimedia-files-git) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + + +通过 Git 来管理多媒体文件 +====== + +> 在我们有关 Git 鲜为人知的用法系列的最后一篇文章中,了解如何使用 Git 跟踪项目中的大型多媒体文件。 + +![](https://img.linux.net.cn/data/attachment/album/202002/13/235436mhub12qhxzmbw11p.png) + +Git 是专用于源代码版本控制的工具。因此,Git 很少被用于非纯文本的项目以及行业。然而,异步工作流的优点是十分诱人的,尤其是在一些日益增长的行业中,这种类型的行业把重要的计算和重要的艺术创作结合起来,这包括网页设计、视觉效果、视频游戏、出版、货币设计(是的,这是一个真实的行业)、教育……等等。还有许多行业属于这个类型。 + +在这个 Git 系列文章中,我们分享了六种鲜为人知的 Git 使用方法。在最后一篇文章中,我们将介绍将 Git 的优点带到管理多媒体文件的软件。 + +### Git 管理多媒体文件的问题 + +众所周知,Git 用于处理非文本文件不是很好,但是这并不妨碍我们进行尝试。下面是一个使用 Git 来复制照片文件的例子: + +``` +$ du -hs +108K . +$ cp ~/photos/dandelion.tif . +$ git add dandelion.tif +$ git commit -m 'added a photo' +[master (root-commit) fa6caa7] two photos + 1 file changed, 0 insertions(+), 0 deletions(-) + create mode 100644 dandelion.tif +$ du -hs +1.8M . +``` + +目前为止没有什么异常。增加一个 1.8MB 的照片到一个目录下,使得目录变成了 1.8 MB 的大小。所以下一步,我们尝试删除文件。 + +``` +$ git rm dandelion.tif +$ git commit -m 'deleted a photo' +$ du -hs +828K . +``` + +在这里我们可以看到有些问题:删除一个已经被提交的文件,还是会使得存储库的大小扩大到原来的 8 倍(从 108K 到 828K)。我们可以测试多次来得到一个更好的平均值,但是这个简单的演示与我的经验一致。提交非文本文件,在一开始花费空间比较少,但是一个工程活跃地时间越长,人们可能对静态内容修改的会更多,更多的零碎文件会被加和到一起。当一个 Git 存储库变的越来越大,主要的成本往往是速度。拉取和推送的时间,从最初抿一口咖啡的时间到你觉得你可能断网了。 + +静态内容导致 Git 存储库的体积不断扩大的原因是什么呢?那些通过文本的构成的文件,允许 Git 只拉取那些修改的部分。光栅图以及音乐文件对 Git 文件而言与文本不同,你可以查看一下 .png 和 .wav 文件中的二进制数据。所以,Git 只不过是获取了全部的数据,并且创建了一个新的副本,哪怕是一张图仅仅修改了一个像素。 + +### Git-portal + +在实践中,许多多媒体项目不需要或者不想追踪媒体的历史记录。相对于文本或者代码的部分,项目的媒体部分一般有一个不同的生命周期。媒体资源一般按一个方向产生:一张图片从铅笔草稿开始,以数字绘画的形式抵达它的目的地。然后,尽管文本能够回滚到早起的版本,但是艺术制品只会一直向前发展。工程中的媒体很少被绑定到一个特定的版本。例外情况通常是反映数据集的图形,通常是可以用基于文本的格式(如 SVG)完成的表、图形或图表。 + +所以,在许多同时包含文本(无论是叙事散文还是代码)和媒体的工程中,Git 是一个用于文件管理的,可接受的解决方案,只要有一个在版本控制循环之外的游乐场来给艺术家游玩就行。 + +![Graphic showing relationship between art assets and Git][2] + +一个启用这个特性的简单方法是 [Git-portal][3],这是一个通过带有 Git 钩子的 Bash 脚本,它可将静态文件从文件夹中移出 Git 的范围,并通过符号链接来取代它们。Git 提交链接文件(有时候称作别名或快捷方式),这种符号链接文件比较小,所以所有的提交都是文本文件和那些代表媒体文件的链接。因为替身文件是符号链接,所以工程还会像预期的运行,因为本地机器会处理他们,转换成“真实的”副本。当用符号链接替换出文件时,Git-portal 维护了项目的结构,因此,如果你认为 Git-portal 不适合你的项目,或者你需要构建项目的一个没有符号链接的版本(比如用于分发),则可以轻松地逆转该过程。 + +Git-portal 也允许通过 `rsync` 来远程同步静态资源,所以用户可以设置一个远程存储位置,来做为一个中心的授权源。 + +Git-portal 对于多媒体的工程是一个理想的解决方案。类似的多媒体工程包括视频游戏、桌面游戏、需要进行大型 3D 模型渲染和纹理的虚拟现实工程、[带图][4]以及 .odt 输出的书籍、协作型的[博客站点][5]、音乐项目,等等。艺术家在应用程序中以图层(在图形世界中)和曲目(在音乐世界中)的形式执行版本控制并不少见——因此,Git 不会向多媒体项目文件本身添加任何内容。Git 的功能可用于艺术项目的其他部分(例如散文和叙述、项目管理、字幕文件、致谢、营销副本、文档等),而结构化远程备份的功能则由艺术家使用。 + +#### 安装 Git-portal + +Git-portal 的 RPM 安装包位于 ,可用于下载和安装。 + +此外,用户可以从 Git-portal 的 Gitlab 主页手动安装。这仅仅是一个 Bash 脚本以及一些 Git 钩子(也是 Bash 脚本),但是需要一个快速的构建过程来让它知道安装的位置。 + +``` +$ git clone https://gitlab.com/slackermedia/git-portal.git git-portal.clone +$ cd git-portal.clone +$ ./configure +$ make +$ sudo make install +``` + +#### 使用 Git-portal + +Git-portal 与 Git 一起使用。这意味着,如同 Git 的所有大型文件扩展一样,都需要记住一些额外的步骤。但是,你仅仅需要在处理你的媒体资源的时候使用 Git-portal,所以很容易记住,除非你把大文件都当做文本文件来进行处理(对于 Git 用户很少见)。使用 Git-portal 必须做的一个安装步骤是: + +``` +$ mkdir bigproject.git +$ cd !$ +$ git init +$ git-portal init +``` + +Git-portal 的 `init` 函数在 Git 存储库中创建了一个 `_portal` 文件夹并且添加到 `.gitignore` 文件中。 + +在平日里使用 Git-portal 和 Git 协同十分平滑。一个较好的例子是基于 MIDI 的音乐项目:音乐工作站产生的项目文件是基于文本的,但是 MIDI 文件是二进制数据: + +``` +$ ls -1 +_portal +song.1.qtr +song.qtr +song-Track_1-1.mid +song-Track_1-3.mid +song-Track_2-1.mid +$ git add song*qtr +$ git-portal song-Track*mid +$ git add song-Track*mid +``` + +如果你查看一下 `_portal` 文件夹,你会发现那里有最初的 MIDI 文件。这些文件在原本的位置被替换成了指向 `_portal` 的链接文件,使得音乐工作站像预期一样运行。 + +``` +$ ls -lG +[...] _portal/ +[...] song.1.qtr +[...] song.qtr +[...] song-Track_1-1.mid -> _portal/song-Track_1-1.mid* +[...] song-Track_1-3.mid -> _portal/song-Track_1-3.mid* +[...] song-Track_2-1.mid -> _portal/song-Track_2-1.mid* +``` + +与 Git 相同,你也可以添加一个目录下的文件。 + +``` +$ cp -r ~/synth-presets/yoshimi . +$ git-portal add yoshimi +Directories cannot go through the portal. Sending files instead. +$ ls -lG _portal/yoshimi +[...] yoshimi.stat -> ../_portal/yoshimi/yoshimi.stat* +``` + +删除功能也像预期一样工作,但是当从 `_portal` 中删除一些东西时,你应该使用 `git-portal rm` 而不是 `git rm`。使用 Git-portal 可以确保文件从 `_portal` 中删除: + +``` +$ ls +_portal/ song.qtr song-Track_1-3.mid@ yoshimi/ +song.1.qtr song-Track_1-1.mid@ song-Track_2-1.mid@ +$ git-portal rm song-Track_1-3.mid +rm 'song-Track_1-3.mid' +$ ls _portal/ +song-Track_1-1.mid* song-Track_2-1.mid* yoshimi/ +``` + +如果你忘记使用 Git-portal,那么你需要手动删除 `_portal` 下的文件: + +``` +$ git-portal rm song-Track_1-1.mid +rm 'song-Track_1-1.mid' +$ ls _portal/ +song-Track_1-1.mid* song-Track_2-1.mid* yoshimi/ +$ trash _portal/song-Track_1-1.mid +``` + +Git-portal 其它的唯一功能,是列出当前所有的链接并且找到里面可能已经损坏的符号链接。有时这种情况会因为项目文件夹中的文件被移动而发生: + +``` +$ mkdir foo +$ mv yoshimi foo +$ git-portal status +bigproject.git/song-Track_2-1.mid: symbolic link to _portal/song-Track_2-1.mid +bigproject.git/foo/yoshimi/yoshimi.stat: broken symbolic link to ../_portal/yoshimi/yoshimi.stat +``` + +如果你使用 Git-portal 用于私人项目并且维护自己的备份,以上就是技术方面所有你需要知道关于 Git-portal 的事情了。如果你想要添加一个协作者或者你希望 Git-portal 来像 Git 的方式来管理备份,你可以创建一个远程位置。 + +#### 增加 Git-portal 远程位置 + +为 Git-portal 增加一个远程位置是通过 Git 已有的远程功能来实现的。Git-portal 实现了 Git 钩子(隐藏在存储库 `.git` 文件夹中的脚本),来寻找你的远程位置上是否存在以 `_portal` 开头的文件夹。如果它找到一个,它会尝试使用 `rsync` 来与远程位置同步文件。Git-portal 在用户进行 Git 推送以及 Git 合并的时候(或者在进行 Git 拉取的时候,实际上是进行一次获取和自动合并),都会执行此操作。 + +如果你仅克隆了 Git 存储库,那么你可能永远不会自己添加一个远程位置。这是一个标准的 Git 过程: + +``` +$ git remote add origin git@gitdawg.com:seth/bigproject.git +$ git remote -v +origin git@gitdawg.com:seth/bigproject.git (fetch) +origin git@gitdawg.com:seth/bigproject.git (push) +``` + +对你的主要 Git 存储库来说,`origin` 这个名字是一个流行的惯例,将其用于 Git 数据是有意义的。然而,你的 Git-portal 数据是分开存储的,所以你必须创建第二个远程位置来让 Git-portal 了解向哪里推送和从哪里拉取。取决于你的 Git 主机,你可能需要一个单独的服务器,因为空间有限的 Git 主机不太可能接受 GB 级的媒体资产。或者,可能你的服务器仅允许你访问你的 Git 存储库而不允许访问外部的存储文件夹: + +``` +$ git remote add _portal seth@example.com:/home/seth/git/bigproject_portal +$ git remote -v +origin git@gitdawg.com:seth/bigproject.git (fetch) +origin git@gitdawg.com:seth/bigproject.git (push) +_portal seth@example.com:/home/seth/git/bigproject_portal (fetch) +_portal seth@example.com:/home/seth/git/bigproject_portal (push) +``` + +你可能不想为所有用户提供服务器上的个人帐户,也不必这样做。为了提供对托管资源库大文件资产的服务器的访问权限,你可以运行一个 Git 前端,比如 [Gitolite][8] 或者你可以使用 `rrsync` (受限的 rsync)。 + +现在你可以推送你的 Git 数据到你的远程 Git 存储库,并将你的 Git-portal 数据到你的远程的门户: + +``` +$ git push origin HEAD +master destination detected +Syncing _portal content... +sending incremental file list +sent 9,305 bytes received 18 bytes 1,695.09 bytes/sec +total size is 60,358,015 speedup is 6,474.10 +Syncing _portal content to example.com:/home/seth/git/bigproject_portal +``` + +如果你已经安装了 Git-portal,并且配置了 `_portal` 的远程位置,你的 `_portal` 文件夹将会被同步,并且从服务器获取新的内容,以及在每一次推送的时候发送新的内容。尽管你不需要进行 Git 提交或者推送来和服务器同步(用户可以使用直接使用 `rsync`),但是我发现对于艺术性内容的改变,提交是有用的。这将会把艺术家及其数字资产集成到工作流的其余部分中,并提供有关项目进度和速度的有用元数据。 + +### 其他选择 + +如果 Git-portal 对你而言太过简单,还有一些用于 Git 管理大型文件的其他选择。[Git 大文件存储][9](LFS)是一个名为 git-media 的停工项目的分支,这个分支由 GitHub 维护和支持。它需要特殊的命令(例如 `git lfs track` 来保护大型文件不被 Git 追踪)并且需要用户维护一个 `.gitattributes` 文件来更新哪些存储库中的文件被 LFS 追踪。对于大文件而言,它**仅**支持 HTTP 和 HTTPS 远程主机。所以你必须配置 LFS 服务器,才能使得用户可以通过 HTTP 而不是 SSH 或 `rsync` 来进行鉴权。 + +另一个相对 LFS 更灵活的选择是 [git-annex][10]。你可以在我的文章 [管理 Git 中大二进制 blob][11] 中了解更多(忽略其中 git-media 这个已经废弃项目的章节,因为其灵活性没有被它的继任者 Git LFS 延续下来)。Git-annex 是一个灵活且优雅的解决方案。它拥有一个细腻的系统来用于添加、删除、移动存储库中的大型文件。因为它灵活且强大,有很多新的命令和规则需要进行学习,所以建议看一下它的[文档][12]。 + +然而,如果你的需求很简单,你可能更加喜欢整合已有技术来进行简单且明显任务的解决方案,则 Git-portal 可能是对于工作而言比较合适的工具。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/manage-multimedia-files-git + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[svtter](https://github.com/svtter) +校对:[wxy](https://github.com/wxy) + +本文由 [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/video_editing_folder_music_wave_play.png?itok=-J9rs-My (video editing dashboard) +[2]: https://opensource.com/sites/default/files/uploads/git-velocity.jpg (Graphic showing relationship between art assets and Git) +[3]: http://gitlab.com/slackermedia/git-portal.git +[4]: https://www.apress.com/gp/book/9781484241691 +[5]: http://mixedsignals.ml +[6]: mailto:git@gitdawg.com +[7]: mailto:seth@example.com +[8]: https://opensource.com/article/19/4/file-sharing-git +[9]: https://git-lfs.github.com/ +[10]: https://git-annex.branchable.com/ +[11]: https://opensource.com/life/16/8/how-manage-binary-blobs-git-part-7 +[12]: https://git-annex.branchable.com/walkthrough/ diff --git a/published/20191227 Top CI-CD resources to set you up for success.md b/published/20191227 Top CI-CD resources to set you up for success.md new file mode 100644 index 0000000000..a19cea5720 --- /dev/null +++ b/published/20191227 Top CI-CD resources to set you up for success.md @@ -0,0 +1,57 @@ +[#]: collector: (lujun9972) +[#]: translator: (Morisun029) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11875-1.html) +[#]: subject: (Top CI/CD resources to set you up for success) +[#]: via: (https://opensource.com/article/19/12/cicd-resources) +[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) + +顶级 CI / CD 资源,助你成功 +====== + +> 随着企业期望实现无缝、灵活和可扩展的部署,持续集成和持续部署成为 2019 年的关键主题。 + +![Plumbing tubes in many directions][1] + +对于 CI/CD 和 DevOps 来说,2019 年是非常棒的一年。Opensource.com 的作者分享了他们专注于无缝、灵活和可扩展部署时是如何朝着敏捷和 scrum 方向发展的。以下是我们 2019 年发布的 CI/CD 文章中的一些重要文章。 + +### 学习和提高你的 CI/CD 技能 + +我们最喜欢的一些文章集中在 CI/CD 的实操经验上,并涵盖了许多方面。通常以 [Jenkins][2] 管道开始,Bryant Son 的文章《[用 Jenkins 构建 CI/CD 管道][3]》将为你提供足够的经验,以开始构建你的第一个管道。Daniel Oh 在《[用 DevOps 管道进行自动验收测试][4]》一文中,提供了有关验收测试的重要信息,包括可用于自行测试的各种 CI/CD 应用程序。我写的《[安全扫描 DevOps 管道][5]》非常简短,其中简要介绍了如何使用 Jenkins 平台在管道中设置安全性。 + +### 交付工作流程 + +正如 Jithin Emmanuel 在《[Screwdriver:一个用于持续交付的可扩展构建平台][6]》中分享的,在学习如何使用和提高你的 CI/CD 技能方面,工作流程很重要,特别是当涉及到管道时。Emily Burns 在《[为什么 Spinnaker 对 CI/CD 很重要][7]》中解释了灵活地使用 CI/CD 工作流程准确构建所需内容的原因。Willy-Peter Schaub 还盛赞了为所有产品创建统一管道的想法,以便《[在一个 CI/CD 管道中一致地构建每个产品][8]》。这些文章将让你很好地了解在团队成员加入工作流程后会发生什么情况。 + +### CI/CD 如何影响企业 + +2019 年也是认识到 CI/CD 的业务影响以及它是如何影响日常运营的一年。Agnieszka Gancarczyk 分享了 Red Hat 《[小型 Scrum vs. 大型 Scrum][9]》的调查结果, 包括受访者对 Scrum、敏捷运动及对团队的影响的不同看法。Will Kelly 的《[持续部署如何影响整个组织][10]》,也提及了开放式沟通的重要性。Daniel Oh 也在《[DevOps 团队必备的 3 种指标仪表板][11]》中强调了指标和可观测性的重要性。最后是 Ann Marie Fred 的精彩文章《[不在生产环境中测试?要在生产环境中测试!][12]》详细说明了在验收测试前在生产环境中测试的重要性。 + +感谢许多贡献者在 2019 年与 Opensource 的读者分享他们的见解,我期望在 2020 年里从他们那里了解更多有关 CI/CD 发展的信息。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/cicd-resources + +作者:[Jessica Cherry][a] +选题:[lujun9972][b] +译者:[Morisun029](https://github.com/Morisun029) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jrepka +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions) +[2]: https://jenkins.io/ +[3]: https://linux.cn/article-11546-1.html +[4]: https://opensource.com/article/19/4/devops-pipeline-acceptance-testing +[5]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline +[6]: https://opensource.com/article/19/3/screwdriver-cicd +[7]: https://opensource.com/article/19/8/why-spinnaker-matters-cicd +[8]: https://opensource.com/article/19/7/cicd-pipeline-rule-them-all +[9]: https://opensource.com/article/19/3/small-scale-scrum-vs-large-scale-scrum +[10]: https://opensource.com/article/19/7/organizational-impact-continuous-deployment +[11]: https://linux.cn/article-11183-1.html +[12]: https://opensource.com/article/19/5/dont-test-production diff --git a/published/20200112 What I learned going from prison to Python.md b/published/20200112 What I learned going from prison to Python.md new file mode 100644 index 0000000000..283212f4b4 --- /dev/null +++ b/published/20200112 What I learned going from prison to Python.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: (heguangzhi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11893-1.html) +[#]: subject: (What I learned going from prison to Python) +[#]: via: (https://opensource.com/article/20/1/prison-to-python) +[#]: author: (Shadeed "Sha" Wallace-Stepter https://opensource.com/users/shastepter) + +从监狱到 Python +====== + +> 入狱后,开源编程是如何提供机会的。 + +![书架上的编程书籍][1] + +不到一年前,我还在圣昆廷州立监狱服刑,我是无期徒刑。 + +我高三的时候,我抢劫了一个人并向他开了枪。现在,我经过一段时间才意识到并承认自己做错了,这是在经历了陪审团审判并看到我的行为带来的恶果后,我知道需要改变自己,我也确实做到了。尽管我对我的行为表示懊悔,但我毕竟开枪打了一个人,并差点杀了他。做这样的事是有后果的,这是理所当然的。所以在我 18 岁的时候,我被判了终身监禁。 + +监狱是一个非常可怕的地方;我是不推荐你去的。但是我必须去,所以我去了。我不告诉你具体的细节,但你可以放心,这是一个没有太多动机去改变的地方,许多人在这里养成的坏习惯比他们过去在别处养成的更多。 + +我是幸运儿之一。当我在服刑的时候,发生了一些不同寻常的事情。我开始想象自己出狱后的的未来,虽然在这之前,我还是已经在那里度过了我整个成年生活。 + +现在你想想:我是黑人,只受过高中教育。我没有工作经历,如果我离开监狱,在被释放前,我还是一个被定罪的重罪犯。当每个雇主看到我的简历,都不会有“我需要雇用这个人”想法,我认为是正常的。 + +我不知道我的选择是什么,但我已经下定决心了。我需要做些活下去的事情,并且这和我入狱前的生活一点也不像。 + +### Python 之路 + +最终,我被关在了圣昆廷州立监狱,我不知道我为何幸运地被关在那里。圣昆廷提供了几个自助和教育编程项目。这些[改造机会][2]帮助囚犯使他们拥有在获释后避免再次犯罪的技能。 + +作为其中一个编程项目的一部分,2017 年我通过圣昆廷媒体项目认识了[杰西卡·麦凯拉][3]。杰西卡是编程语言 [Python][4] 的爱好者,她开始向我推荐 Python 有多棒,以及它是刚起步的人学习的完美语言。这就是故事变得比小说更精彩的地方。 + +> 感谢 [@northbaypython][5] 让 [@ShaStepter][6] 和我重复 [@pycon][7] 的主题演讲,让他们被录制下来。我很荣幸与大家分享: +> +> 从监狱到 Pythone: https://t.co/rcumoAgZHm +> +> 大规模裁员:如果我们不雇佣被判重罪的人,谁会呢? https://t.co/fENDUFdxfX +> +> [pic.Twitter.com/kpjo8d3ul6][8] +> +> —杰西卡·麦凯拉(@jessicamckellar)[2019 年 11 月 5 日][9] + +杰西卡向我介绍了一些 Python 视频教程,这些教程是她为一家名叫 [O’Reilly Media][10] 的公司做的,课程是在线的,如果我能接触到它们,那该有多好呀。不幸的是,在监狱里上网是不可能的。但是,我遇到了一个叫 Tim O’Reilly 的人,他最近刚来到圣昆廷。在他访问之后,Tim 从他的公司 O’Reilly Media 公司向监狱的编程班捐赠了大量内容。最终,我拿到了一款平板电脑,上面有杰西卡的 Python 教程,并学会了如何使用这些 Python 教程进行编码。 + +真是难以置信。背景和生活与我完全不同的陌生人把这些联系在一起,让我学会了编码。 + +### 对 Python 社区的热爱 + +在这之后,我开始经常和杰西卡见面,她开始告诉我关于开源社区的情况。我了解到,从根本上说,开源社区就是关于伙伴关系和协作的社区。之所以如此有效,是因为没有人被排除在外。 + +对我来说,一个努力寻找自己定位的人,我所看到的是一种非常基本的爱——通过合作和接受的爱,通过接触的爱,通过包容的爱。我渴望成为其中的一部分。所以我继续学习 Python,不幸的是,我无法获得更多的教程,但是我能够从开源社区收集的大量书面知识中获益。我读一切提到 Python 的东西,从平装本到晦涩难懂的杂志文章,我使用平板电脑来解决我读到的 Python 问题。 + +我对 Python 和编程的热情不是我的许多同龄人所共有的。除了监狱编程课上的极少数人之外,我认识的其他人都没有提到过编程;一般囚犯都不知道。我认为这是因为有过监禁经历的人无法接触编程,尤其是如果你是有色人种。 + +### 监狱外的 Python 生活 + +然而,在 2018 年 8 月 17 日,我得到了生命中的惊喜。时任州长的杰里·布朗将我 27 年的刑期减刑,在服刑将近 19 年后,我被释放出狱了。 + +但现实情况是,这也是为什么我认为编程和开源社区如此有价值。我是一名 37 岁的黑人罪犯,没有工作经历,刚刚在监狱服刑 18 年。我有犯罪史,并且现存偏见导致没有多少职业适合我。但是编程是少数例外之一。 + +现在,监禁后重返社会的人们迫切需要包容,但当谈及工作场所的多样性以及对多样性的需求时,你真的听不到这个群体被提及或包容。 + +> 还有什么: +> +> 1、背景调查:询问他们在你的公司是如何使用的。 +> +> 2、初级角色:删除虚假的、不必要的先决条件,这些条件将排除有记录的合格人员。 +> +> 3、积极拓展:与当地再就业项目合作,创建招聘渠道。 +> +> [pic.twitter.com/WnzdEUTuxr][11] +> +> —杰西卡·麦凯拉(@jessicamckellar)[2019 年 5 月 12 日][12] +  + +因此,我想谦卑地挑战开源社区的所有程序员和成员,让他们围绕包容和多样性展开思考。今天,我自豪地站在你们面前,代表一个大多数人都没有想到的群体——以前被监禁的人。但是我们存在,我们渴望证明我们的价值,最重要的是,我们期待被接受。当我们重返社会时,许多挑战等待着我们,我请求你们允许我们有机会展示我们的价值。欢迎我们,接受我们,最重要的是,包容我们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/prison-to-python + +作者:[Shadeed "Sha" Wallace-Stepter][a] +选题:[lujun9972][b] +译者:[heguangzhi](https://github.com/heguangzhi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/shastepter +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/books_programming_languages.jpg?itok=KJcdnXM2 (Programming books on a shelf) +[2]: https://www.dailycal.org/2019/02/27/san-quentin-rehabilitation-programs-offer-inmates-education-a-voice/ +[3]: https://twitter.com/jessicamckellar?lang=en +[4]: https://www.python.org/ +[5]: https://twitter.com/northbaypython?ref_src=twsrc%5Etfw +[6]: https://twitter.com/ShaStepter?ref_src=twsrc%5Etfw +[7]: https://twitter.com/pycon?ref_src=twsrc%5Etfw +[8]: https://t.co/Kpjo8d3ul6 +[9]: https://twitter.com/jessicamckellar/status/1191601209917837312?ref_src=twsrc%5Etfw +[10]: http://shop.oreilly.com/product/110000448.do +[11]: https://t.co/WnzdEUTuxr +[12]: https://twitter.com/jessicamckellar/status/1127640222504636416?ref_src=twsrc%5Etfw diff --git a/published/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md b/published/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md new file mode 100644 index 0000000000..ec53804d3a --- /dev/null +++ b/published/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11876-1.html) +[#]: subject: (Get your RSS feeds and podcasts in one place with this open source tool) +[#]: via: (https://opensource.com/article/20/1/open-source-rss-feed-reader) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +使用此开源工具在一起收取你的 RSS 订阅源和播客 +====== + +> 在我们的 20 个使用开源提升生产力的系列的第十二篇文章中使用 Newsboat 收取你的新闻 RSS 源和播客。 + +![](https://img.linux.net.cn/data/attachment/album/202002/10/162526wv5jdl0m12sw10md.jpg) + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 使用 Newsboat 访问你的 RSS 源和播客 + +RSS 新闻源是了解各个网站最新消息的非常方便的方法。除了 Opensource.com,我还会关注 [SysAdvent][2] sysadmin 年度工具,还有一些我最喜欢的作者以及一些网络漫画。RSS 阅读器可以让我“批处理”阅读内容,因此,我每天不会在不同的网站上花费很多时间。 + +![Newsboat][3] + +[Newsboat][4] 是一个基于终端的 RSS 订阅源阅读器,外观感觉很像电子邮件程序 [Mutt][5]。它使阅读新闻变得容易,并有许多不错的功能。 + +安装 Newsboat 非常容易,因为它包含在大多数发行版(以及 MacOS 上的 Homebrew)中。安装后,只需在 `~/.newsboat/urls` 中添加订阅源。如果你是从其他阅读器迁移而来,并有导出的 OPML 文件,那么可以使用以下方式导入: + +``` +newsboat -i +``` + +添加订阅源后,Newsboat 的界面非常熟悉,特别是如果你使用过 Mutt。你可以使用箭头键上下滚动,使用 `r` 检查某个源中是否有新项目,使用 `R` 检查所有源中是否有新项目,按回车打开订阅源,并选择要阅读的文章。 + +![Newsboat article list][6] + +但是,你不仅限于本地 URL 列表。Newsboat 还是 [Tiny Tiny RSS][7]、ownCloud 和 Nextcloud News 等新闻阅读服务以及一些 Google Reader 后续产品的客户端。[Newsboat 的文档][8]中涵盖了有关此的详细信息以及其他许多配置选项。 + +![Reading an article in Newsboat][9] + +#### 播客 + +Newsboat 还通过 Podboat 提供了[播客支持][10],Podboat 是一个附带的应用,它可帮助下载和排队播客节目。在 Newsboat 中查看播客源时,按下 `e` 将节目添加到你的下载队列中。所有信息将保存在 `~/.newsboat` 目录中的队列文件中。Podboat 读取此队列并将节目下载到本地磁盘。你可以在 Podboat 的用户界面(外观和行为类似于 Newsboat)执行此操作,也可以使用 `podboat -a` 让 Podboat 下载所有内容。作为播客人和播客听众,我认为这*真的*很方便。 + +![Podboat][11] + +总体而言,Newsboat 有一些非常好的功能,并且是一些基于 Web 或桌面应用的不错的轻量级替代方案。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-rss-feed-reader + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) +[2]: https://sysadvent.blogspot.com/ +[3]: https://opensource.com/sites/default/files/uploads/productivity_12-1.png (Newsboat) +[4]: https://newsboat.org +[5]: http://mutt.org/ +[6]: https://opensource.com/sites/default/files/uploads/productivity_12-2.png (Newsboat article list) +[7]: https://tt-rss.org/ +[8]: https://newsboat.org/releases/2.18/docs/newsboat.html +[9]: https://opensource.com/sites/default/files/uploads/productivity_12-3.png (Reading an article in Newsboat) +[10]: https://newsboat.org/releases/2.18/docs/newsboat.html#_podcast_support +[11]: https://opensource.com/sites/default/files/uploads/productivity_12-4.png (Podboat) diff --git a/published/20200124 Run multiple consoles at once with this open source window environment.md b/published/20200124 Run multiple consoles at once with this open source window environment.md new file mode 100644 index 0000000000..33593eb788 --- /dev/null +++ b/published/20200124 Run multiple consoles at once with this open source window environment.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11892-1.html) +[#]: subject: (Run multiple consoles at once with this open source window environment) +[#]: via: (https://opensource.com/article/20/1/multiple-consoles-twin) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +使用开源窗口环境 twin 一次运行多个控制台 +====== + +> 在我们的 20 个使用开源提升生产力的系列的第十四篇文章中用 twin 模拟了老式的 DESQview 体验。 + +![](https://img.linux.net.cn/data/attachment/album/202002/14/193658tlbyft0lbu44f0s3.jpg) + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 通过 twin 克服“一个屏幕,一个应用程序”的限制 + +还有人记得 [DESQview][2] 吗?我们在 Windows、Linux 和 MacOS 中理所当然地可以在屏幕上同时运行多个程序,而 DESQview 赋予了 DOS 同样的功能。在我运营拨号 BBS 服务的初期,DESQview 是必需的,它使我能够让 BBS 在后台运行,同时在前台进行其他操作。例如,当有人拨打电话时,我可能正在开发新功能或设置新的外部程序而不会影响他们的体验。后来,在我早期做支持工作的时候,我可以同时运行我的工作电子邮件([MHS 上的 DaVinci 电子邮件][3])、支持单据系统和其他 DOS 程序。这是令人吃惊的! + +![twin][4] + +从那时起,运行多个控制台应用程序的功能已经发展了很多。但是 [tmux][5] 和 [Screen][6] 等应用仍然遵循“一个屏幕,一个应用”的显示方式。好吧,是的,tmux 具有屏幕拆分和窗格,但是不像 DESQview 那样具有将窗口“浮动”在其他窗口上的功能,就我个人而言,我怀念那个功能。 + +让我们来看看 [twin][7](文本模式窗口环境)。我认为,这个相对年轻的项目是 DESQview 的精神继任者。它支持控制台和图形环境,并具有与会话脱离和重新接驳的功能。设置起来并不是那么容易,但是它可以在大多数现代操作系统上运行。 + +Twin 是从源代码安装的(现在是这样)。但是首先,你需要安装所需的开发库。库名称将因操作系统而异。 以下示例显示了在我的 Ubuntu 19.10 系统中的情况。一旦安装了依赖库,请从 Git 中检出 twin 源代码,并运行 `./configure` 和 `make`,它们应自动检测所有内容并构建 twin: + +``` +sudo apt install libx11-dev libxpm-dev libncurses-dev zlib1g-dev libgpm-dev +git clone git@github.com:cosmos72/twin.git +cd twin +./configure +make +sudo make install +``` + +注意:如果要在 MacOS 或 BSD 上进行编译,则需要在运行 `make` 之前在文件 `include/Tw/autoconf.h` 和 `include/twautoconf.h` 中注释掉 `#define socklen_t int`。这个问题应该在 [twin #57][9] 解决了。 + +![twin text mode][10] + +第一次调用 twin 是一个挑战。你需要通过 `--hw` 参数告诉它正在使用哪种显示。例如,要启动文本模式的 twin,请输入 `twin --hw=tty,TERM=linux`。这里指定的 `TERM` 变量替代了你当前 Shell 中终端变量。要启动图形版本,运行 `twin --hw=X@$DISPLAY`。在 Linux 上,twin 一般都“可以正常工作”,而在 MacOS 上,Twin 基本是只能在终端上使用。 + +*真正*的乐趣是可以通过 `twattach` 和 `twdisplay` 命令接驳到正在运行的会话的功能。它们使你可以接驳到其他正在运行的 twin 会话。例如,在 Mac 上,我可以运行以下命令以接驳到演示机器上运行的 twin 会话: + +``` +twdisplay --twin@20days2020.local:0 --hw=tty,TERM=linux +``` + +![remote twin session][11] + +通过多做一些工作,你还可以将其用作登录外壳,以代替控制台上的 [getty][12]。这需要 gdm 鼠标守护程序、twdm 应用程序(包括)和一些额外的配置。在使用 systemd 的系统上,首先安装并启用 gdm(如果尚未安装),然后使用 `systemctl` 为控制台(我使用 tty6)创建一个覆盖。这些命令必须以 root 用户身份运行;在 Ubuntu 上,它们看起来像这样: + +``` +apt install gdm +systemctl enable gdm +systemctl start gdm +systemctl edit getty@tty6 +``` + +`systemctl edit getty@tty6` 命令将打开一个名为 `override.conf` 的空文件。它可以定义 systemd 服务设置以覆盖 tty6 的默认设置。将内容更新为: + +``` +[service] +ExecStart= +ExecStart=-/usr/local/sbin/twdm --hw=tty@/dev/tty6,TERM=linux +StandardInput=tty +StandardOutput=tty +``` + +现在,重新加载 systemd 并重新启动 tty6 以获得 twin 登录提示界面: + +``` +systemctl daemon-reload +systemctl restart getty@tty6 +``` + +![twin][13] + +这将为登录的用户启动一个 twin 会话。我不建议在多用户系统中使用此会话,但是对于个人桌面来说,这是很酷的。并且,通过使用 `twattach` 和 `twdisplay`,你可以从本地 GUI 或远程桌面访问该会话。 + +我认为 twin 真是太酷了。它还有一些细节不够完善,但是基本功能都已经有了,并且有一些非常好的文档。另外,它也使我可以在现代操作系统上稍解对 DESQview 式的体验的渴望。我希望随着时间的推移它会有所改进,希望你和我一样喜欢它。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/multiple-consoles-twin + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://en.wikipedia.org/wiki/DESQview +[3]: https://en.wikipedia.org/wiki/Message_Handling_System +[4]: https://opensource.com/sites/default/files/uploads/productivity_14-1.png (twin) +[5]: https://github.com/tmux/tmux/wiki +[6]: https://www.gnu.org/software/screen/ +[7]: https://github.com/cosmos72/twin +[8]: mailto:git@github.com +[9]: https://github.com/cosmos72/twin/issues/57 +[10]: https://opensource.com/sites/default/files/uploads/productivity_14-2.png (twin text mode) +[11]: https://opensource.com/sites/default/files/uploads/productivity_14-3.png (remote twin session) +[12]: https://en.wikipedia.org/wiki/Getty_(Unix) +[13]: https://opensource.com/sites/default/files/uploads/productivity_14-4.png (twin) diff --git a/published/20200205 Getting started with GnuCash.md b/published/20200205 Getting started with GnuCash.md new file mode 100644 index 0000000000..00dc0465c5 --- /dev/null +++ b/published/20200205 Getting started with GnuCash.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11895-1.html) +[#]: subject: (Getting started with GnuCash) +[#]: via: (https://opensource.com/article/20/2/gnucash) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +开始使用 GnuCash +====== + +> 使用 GnuCash 管理你的个人或小型企业会计。 + +![](https://img.linux.net.cn/data/attachment/album/202002/15/124236wz5e0z5vq7571qby.jpg) + +在过去的四年里,我一直在用 [GnuCash][2] 来管理我的个人财务,我对此非常满意。这个开源(GPL v3)项目自 1998 年首次发布以来一直成长和改进,2019 年 12 月发布的最新版本 3.8 增加了许多改进和 bug 修复。 + +GnuCash 可在 Windows、MacOS 和 Linux 中使用。它实现了一个复式记账系统,并可以导入各种流行的开放和专有文件格式,包括 QIF、QFX、OFX、CSV 等。这使得从其他财务应用转换(包括 Quicken)而来很容易,它是为取代这些而出现的。 + +借助 GnuCash,你可以跟踪个人财务状况以及小型企业会计和开票。它没有集成的工资系统。根据文档,你可以在 GnuCash 中跟踪工资支出,但你必须在该软件外计算税金和扣减。 + +### 安装 + +要在 Linux 上安装 GnuCash: + + * 在 Red Hat、CentOS 或 Fedora 中: `$ sudo dnf install gnucash` + * 在 Debian、Ubuntu 或 Pop_OS 中: `$ sudo apt install gnucash` + +你也可以从 [Flathub][3] 安装它,我在运行 Elementary OS 的笔记本上使用它。(本文中的所有截图都来自此次安装)。 + +### 设置 + +安装并启动程序后,你将看到一个欢迎屏幕,该页面提供了创建新账户集、导入 QIF 文件或打开新用户教程的选项。 + +![GnuCash Welcome screen][4] + +#### 个人账户 + +如果你选择第一个选项(正如我所做的那样),GnuCash 会打开一个页面帮你起步。它收集初始数据并设置账户首选项,例如账户类型和名称、商业数据(例如,税号)和首选货币。 + +![GnuCash new account setup][5] + +GnuCash 支持个人银行账户、商业账户、汽车贷款、CD 和货币市场账户、儿童保育账户等。 + +例如,首先创建一个简单的支票簿。你可以输入账户的初始余额或以多种格式导入现有账户数据。 + +![GnuCash import data][6] + +#### 开票 + +GnuCash 还支持小型企业功能,包括客户、供应商和开票。要创建发票,请在 “Business -> Invoice” 中输入数据。 + +![GnuCash create invoice][7] + +然后,你可以将发票打印在纸上,也可以将其导出到 PDF 并通过电子邮件发送给你的客户。 + +![GnuCash invoice][8] + +### 获取帮助 + +如果你有任何疑问,它有一个优秀的帮助,你可在菜单栏的右侧获取指导。 + +![GnuCash help][9] + +该项目的网站包含许多有用的信息的链接,例如 GnuCash [功能][10]的概述。GnuCash 还提供了[详细的文档][11],可供下载和离线阅读,它还有一个 [wiki][12],为用户和开发人员提供了有用的信息。 + +你可以在项目的 [GitHub][13] 仓库中找到其他文件和文档。GnuCash 项目由志愿者驱动。如果你想参与,请查看项目的 wiki 上的 [Getting involved][14] 部分。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/gnucash + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_whitehurst_money.png?itok=ls-SOzM0 (A dollar sign in a network) +[2]: https://www.gnucash.org/ +[3]: https://flathub.org/apps/details/org.gnucash.GnuCash +[4]: https://opensource.com/sites/default/files/images/gnucash_welcome.png (GnuCash Welcome screen) +[5]: https://opensource.com/sites/default/files/uploads/gnucash_newaccountsetup.png (GnuCash new account setup) +[6]: https://opensource.com/sites/default/files/uploads/gnucash_importdata.png (GnuCash import data) +[7]: https://opensource.com/sites/default/files/uploads/gnucash_enter-invoice.png (GnuCash create invoice) +[8]: https://opensource.com/sites/default/files/uploads/gnucash_invoice.png (GnuCash invoice) +[9]: https://opensource.com/sites/default/files/uploads/gnucash_help.png (GnuCash help) +[10]: https://www.gnucash.org/features.phtml +[11]: https://www.gnucash.org/docs/v3/C/gnucash-help.pdf +[12]: https://wiki.gnucash.org/wiki/GnuCash +[13]: https://github.com/Gnucash +[14]: https://wiki.gnucash.org/wiki/GnuCash#Getting_involved_in_the_GnuCash_project diff --git a/published/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md b/published/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md new file mode 100644 index 0000000000..4a6e9f660f --- /dev/null +++ b/published/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11888-1.html) +[#]: subject: (NVIDIA’s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux) +[#]: via: (https://itsfoss.com/geforce-now-linux/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +NVIDIA 的云游戏服务 GeForce NOW 无耻地忽略了Linux +====== + +NVIDIA 的 [GeForce NOW][1] 云游戏服务对于那些可能没有硬件但想使用 GeForce NOW 在最新的最好的游戏上获得尽可能好的游戏体验玩家来说是充满前景的(在线推流游戏,并可以在任何设备上玩)。 + +该服务仅限于一些用户(以等待列表的形式)使用。然而,他们最近宣布 [GeForce NOW 面向所有人开放][2]。但实际上并不是。 + +有趣的是,它**并不是面向全球所有区域**。而且,更糟的是 **GeForce NOW 不支持 Linux**。 + +![][3] + +### GeForce NOW 并不是向“所有人开放” + +制作一个基于订阅的云服务来玩游戏的目的是消除平台依赖性。 + +就像你通常使用浏览器访问网站一样,你应该能够在每个平台上玩游戏。是这个概念吧? + +![][4] + +好吧,这绝对不是火箭科学,但是 NVIDIA 仍然不支持 Linux(和 iOS)? + +### 是因为没有人使用 Linux 吗? + +我非常不同意这一点,即使这是某些不支持 Linux 的原因。如果真是这样,我不会使用 Linux 作为主要桌面操作系统来为 “It’s FOSS” 写文章。 + +不仅如此,如果 Linux 不值一提,你认为为何一个 Twitter 用户会提到缺少 Linux 支持? + +![][5] + +是的,也许用户群不够大,但是在考虑将其作为基于云的服务时,**不支持 Linux** 显得没有意义。 + +从技术上讲,如果 Linux 上没有游戏,那么 **Valve** 就不会在 Linux 上改进 [Steam Play][6] 来帮助更多用户在 Linux 上玩纯 Windows 的游戏。 + +我不想说任何不正确的说法,但台式机 Linux 游戏的发展比以往任何时候都要快(即使统计上要比 Mac 和 Windows 要低)。 + +### 云游戏不应该像这样 + +![][7] + +如上所述,找到使用 Steam Play 的 Linux 玩家不难。只是你会发现 Linux 上游戏玩家的整体“市场份额”低于其他平台。 + +即使这是事实,云游戏也不应该依赖于特定平台。而且,考虑到 GeForce NOW 本质上是一种基于浏览器的可以玩游戏的流媒体服务,所以对于像 NVIDIA 这样的大公司来说,支持 Linux 并不困难。 + +来吧,Nvidia,*你想要我们相信在技术上支持 Linux 有困难?或者,你只是想说不值得支持 Linux 平台?* + +### 结语 + +不管我为 GeForce NOW 服务发布而感到多么兴奋,当看到它根本不支持 Linux,我感到非常失望。 + +如果像 GeForce NOW 这样的云游戏服务在不久的将来开始支持 Linux,**你可能没有理由使用 Windows 了**(*咳嗽*)。 + +你怎么看待这件事?在下面的评论中让我知道你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/geforce-now-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.nvidia.com/en-us/geforce-now/ +[2]: https://blogs.nvidia.com/blog/2020/02/04/geforce-now-pc-gaming/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/nvidia-geforce-now-linux.jpg?ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/nvidia-geforce-now.png?ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/geforce-now-twitter-1.jpg?ssl=1 +[6]: https://itsfoss.com/steam-play/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/ge-force-now.jpg?ssl=1 From f6a9197056699c4be1bdcd8041485a66cf47f350 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Sat, 15 Feb 2020 18:54:27 +0800 Subject: [PATCH 025/315] update --- ...00206 3 ways to use PostgreSQL commands.md | 230 ------------------ 1 file changed, 230 deletions(-) delete mode 100644 sources/tech/20200206 3 ways to use PostgreSQL commands.md diff --git a/sources/tech/20200206 3 ways to use PostgreSQL commands.md b/sources/tech/20200206 3 ways to use PostgreSQL commands.md deleted file mode 100644 index 645baf65e0..0000000000 --- a/sources/tech/20200206 3 ways to use PostgreSQL commands.md +++ /dev/null @@ -1,230 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Morisun029) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 ways to use PostgreSQL commands) -[#]: via: (https://opensource.com/article/20/2/postgresql-commands) -[#]: author: (Greg Pittman https://opensource.com/users/greg-p) - -3 ways to use PostgreSQL commands -====== -Whether you need something simple, like a shopping list, or complex, -like a color swatch generator, PostgreSQL commands make it easy. -![Team checklist and to dos][1] - -In _[Getting started with PostgreSQL][2]_, I explained how to install, set up, and begin using the open source database software. But there's a lot more you can do with commands in [PostgreSQL][3]. - -For example, I use Postgres to keep track of my grocery shopping list. I do most of the grocery shopping in our home, and the bulk of it happens once a week. I go to several places to buy the things on my list because each store offers a particular selection or quality or maybe a better price. Initially, I made an HTML form page to manage my shopping list, but it couldn't save my entries. So, I had to wait to make my list all at once, and by then I usually forgot some items we need or I want. - -Instead, with PostgreSQL, I can enter bits when I think of them as the week goes on and print out the whole thing right before I go shopping. Here's how you can do that, too. - -### Create a simple shopping list - -First, enter the database with the **psql **command, then create a table for your list with: - - -``` -`Create table groc (item varchar(20), comment varchar(10));` -``` - -Type commands like the following to add items to your list: - - -``` -insert into groc values ('milk', 'K'); -insert into groc values ('bananas', 'KW'); -``` - -There are two pieces of information (separated by a comma) inside the parentheses: the item you want to buy and letters indicating where you want to buy it and whether it's something you usually buy every week (W). - -Since **psql** has a history, you can press the Up arrow and edit the data between the parentheses instead of having to type the whole line for each item. - -After entering a handful of items, check what you've entered with: - - -``` -Select * from groc order by comment; - -      item      | comment -\----------------+--------- - ground coffee  | H - butter         | K - chips          | K - steak          | K - milk           | K - bananas        | KW - raisin bran    | KW - raclette       | L - goat cheese    | L - onion          | P - oranges        | P - potatoes       | P - spinach        | PW - broccoli       | PW - asparagus      | PW - cucumber       | PW - sugarsnap peas | PW - salmon         | S -(18 rows) -``` - -This command orders the results by the _comment_ column so that the items are grouped by where you buy them to make it easier to shop. - -By using a W to indicate your weekly purchases, you can keep your weekly items on the list when you clear out the table to prepare for the next week's list. To so that, enter: - - -``` -`delete from groc where comment not like '%W';` -``` - -Notice that in PostgreSQL, **%** is the wildcard character (instead of an asterisk). So, to save typing, you might type: - - -``` -`delete from groc where item like 'goat%';` -``` - -You can't use **item = 'goat%'**; it won't work. - -When you're ready to shop, output your list to print it or send it to your phone with: - - -``` -\o groclist.txt -select * from groc order by comment; -\o -``` - -The last command, **\o**, with nothing afterward, resets the output to the command line. Otherwise, all output will continue to go to the groc file you created. - -### Analyze complex tables - -This item-by-item entry may be okay for short tables, but what about really big ones? A couple of years ago, I was helping the team at [FreieFarbe.de][4] to create a swatchbook of the free colors (freieFarbe means "free colors" in German) from its HLC color palette, where virtually any imaginable print color can be specified by its hue, luminosity (brightness), and chroma (saturation). The result was the [HLC Color Atlas][5], and here's how we did it. - -The team sent me files with color specifications so I could write Python scripts that would work with Scribus to generate the swatchbooks of color patches easily. One example started like: - - -``` -HLC, C, M, Y, K -H010_L15_C010, 0.5, 49.1, 0.1, 84.5 -H010_L15_C020, 0.0, 79.7, 15.1, 78.9 -H010_L25_C010, 6.1, 38.3, 0.0, 72.5 -H010_L25_C020, 0.0, 61.8, 10.6, 67.9 -H010_L25_C030, 0.0, 79.5, 18.5, 62.7 -H010_L25_C040, 0.4, 94.2, 17.3, 56.5 -H010_L25_C050, 0.0, 100.0, 15.1, 50.6 -H010_L35_C010, 6.1, 32.1, 0.0, 61.8 -H010_L35_C020, 0.0, 51.7, 8.4, 57.5 -H010_L35_C030, 0.0, 68.5, 17.1, 52.5 -H010_L35_C040, 0.0, 81.2, 22.0, 46.2 -H010_L35_C050, 0.0, 91.9, 20.4, 39.3 -H010_L35_C060, 0.1, 100.0, 17.3, 31.5 -H010_L45_C010, 4.3, 27.4, 0.1, 51.3 -``` - -This is slightly modified from the original, which separated the data with tabs. I transformed it into a CSV (comma-separated value) file, which I prefer to use with Python. (CSV files are also very useful because they can be imported easily into a spreadsheet program.) - -In each line, the first item is the color name, and it's followed by its C, M, Y, and K color values. The file consisted of 1,793 colors, and I wanted a way to analyze the information to get a sense of the range of values. This is where PostgreSQL comes into play. I did not want to enter all of this data manually—I don't think I could without errors (and headaches). Fortunately, PostgreSQL has a command for this. - -My first step was to create the database with: - - -``` -`Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal);` -``` - -Then I brought in the data with: - - -``` -`\copy  hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV);` -``` - -The backslash at the beginning is there because using the plain **copy** command is restricted to root and the Postgres superuser. In the parentheses, **header** means the first line contains headings and should be ignored, and **CSV** means the file format is CSV. Note that parentheses are not required around the color name in this method. - -If the operation is successful, I see a message that says **COPY NNNN**, where the N's refer to the number of rows inserted into the table. - -Finally, I can query the table with: - - -``` -select * from hlc_cmyk; - -     color     |   c   |   m   |   y   |  k   -\---------------+-------+-------+-------+------ - H010_L15_C010 |   0.5 |  49.1 |   0.1 | 84.5 - H010_L15_C020 |   0.0 |  79.7 |  15.1 | 78.9 - H010_L25_C010 |   6.1 |  38.3 |   0.0 | 72.5 - H010_L25_C020 |   0.0 |  61.8 |  10.6 | 67.9 - H010_L25_C030 |   0.0 |  79.5 |  18.5 | 62.7 - H010_L25_C040 |   0.4 |  94.2 |  17.3 | 56.5 - H010_L25_C050 |   0.0 | 100.0 |  15.1 | 50.6 - H010_L35_C010 |   6.1 |  32.1 |   0.0 | 61.8 - H010_L35_C020 |   0.0 |  51.7 |   8.4 | 57.5 - H010_L35_C030 |   0.0 |  68.5 |  17.1 | 52.5 -``` - -It goes on like this for all 1,793 rows of data. In retrospect, I can't say that this query was absolutely necessary for the HLC and Scribus task, but it allayed some of my anxieties about the project. - -To generate the HLC Color Atlas, I automated creating the color charts with Scribus for the 13,000+ colors in those pages of color swatches. - -I could have used the **copy** command to output my data: - - -``` -`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV);` -``` - -I also could restrict the output according to certain values with a **where** clause. - -For example, the following command will only send the table values for the hues that begin with H10. - - -``` -`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%';` -``` - -### Back up or transfer a database or table - -The final command I will mention here is **pg_dump**, which is used to back up a PostgreSQL database and runs outside of the **psql** console. For example: - - -``` -pg_dump gregp -t hlc_cmyk > hlc.out -pg_dump gregp > dball.out -``` - -The first line exports the **hlc_cmyk** table along with its structure. The second line dumps all the tables inside the **gregp** database. This is very useful for backing up or transferring a database or tables.  - -To transfer a database or table to another computer, first, create a database on the other computer (see my "[getting started][2]" article for details), then do the reverse process: - - -``` -`psql -d gregp -f dball.out` -``` - -This creates all the tables and enters the data in one step. - -### Conclusion - -In this article, we have seen how to use the **WHERE** parameter to restrict operations, along with the use of the PostgreSQL wildcard character **%**. We've also seen how to load a large amount of data into a table, then output some or all of the table data to a file, or even your entire database with all its individual tables. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/postgresql-commands - -作者:[Greg Pittman][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/greg-p -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) -[2]: https://opensource.com/article/19/11/getting-started-postgresql -[3]: https://www.postgresql.org/ -[4]: http://freiefarbe.de -[5]: https://www.freiefarbe.de/en/thema-farbe/hlc-colour-atlas/ From b948e778b4d09de4e744d6f20d8d856d8435b6c3 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Sat, 15 Feb 2020 19:58:17 +0800 Subject: [PATCH 026/315] transalting --- sources/tech/20200213 Why developers like to code at night.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200213 Why developers like to code at night.md b/sources/tech/20200213 Why developers like to code at night.md index 0e7e55fbe5..b01246d62a 100644 --- a/sources/tech/20200213 Why developers like to code at night.md +++ b/sources/tech/20200213 Why developers like to code at night.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Morisun029) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8922202d3ccbd2607251797ac711b71581d48567 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 15 Feb 2020 21:01:53 +0800 Subject: [PATCH 027/315] PRF @geekpi --- ...e True Open Source Evernote Alternative.md | 77 +++++++++---------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/translated/tech/20200129 Joplin- The True Open Source Evernote Alternative.md b/translated/tech/20200129 Joplin- The True Open Source Evernote Alternative.md index a4ce65d52b..f48b22c401 100644 --- a/translated/tech/20200129 Joplin- The True Open Source Evernote Alternative.md +++ b/translated/tech/20200129 Joplin- The True Open Source Evernote Alternative.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Joplin: The True Open Source Evernote Alternative) @@ -10,53 +10,50 @@ Joplin:真正的 Evernote 开源替代品 ====== -_**简介:Joplin 是一个开源笔记记录和待办应用。你可以将笔记组织到笔记本中并标记它们。Joplin 还提供网络剪贴板来保存来自互联网的文章。**_ - +> Joplin 是一个开源笔记记录和待办应用。你可以将笔记组织到笔记本中并标记它们。Joplin 还提供网络剪贴板来保存来自互联网的文章。 ### Joplin:开源笔记管理器 -![][1] +![][4] -如果你喜欢[Evernote][2],那么你不会不太适应开源软件 [Joplin][3]。 +如果你喜欢 [Evernote][2],那么你不会不太适应这个开源软件 [Joplin][3]。 -Joplin 是一个优秀的开源笔记应用,拥有丰富的功能。你可以记笔记、写待办事项并且通过和 Dropbox 和 NextCloud 等云服务链接来跨设备同步笔记。同步通过端到端加密保护。 +Joplin 是一个优秀的开源笔记应用,拥有丰富的功能。你可以记笔记、记录待办事项并且通过和 Dropbox 和 NextCloud 等云服务链接来跨设备同步笔记。同步过程通过端到端加密保护。 -Joplin 还有一个 Web 剪贴板,能让你将网页另存为笔记。网络剪贴板可用于 Firefox 和 Chrome/Chromium 浏览器。 +Joplin 还有一个 Web 剪贴板,能让你将网页另存为笔记。这个网络剪贴板可用于 Firefox 和 Chrome/Chromium 浏览器。 -Joplin 可以导入 enex 格式的 Evernote 文件, 这让从 Evernote 切换变得容易。 +Joplin 可以导入 enex 格式的 Evernote 文件,这让从 Evernote 切换变得容易。 -因为自己保存数据,你可以用 Joplin 格式或者原始格式导出所有文件。 +因为数据自行保存,所以你可以用 Joplin 格式或者原始格式导出所有文件。 ### Joplin 的功能 -![][4] +![][1] 以下是 Joplin 的所有功能列表: +* 将笔记保存到笔记本和子笔记本中,以便更好地组织 +* 创建待办事项清单 +* 可以标记和搜索笔记 +* 离线优先,因此即使没有互联网连接,所有数据始终在设备上可用 +* Markdown 笔记支持图片、数学符号和复选框 +* 支持附件 +* 可在桌面、移动设备和终端(CLI)使用 +* 可在 Firefox 和 Chrome 使用[网页剪切板][5] +* 端到端加密 +* 保留笔记历史 +* 根据名称、时间等对笔记进行排序 +* 可与 [Nextcloud][7]、Dropbox、WebDAV 和 OneDrive 等各种[云服务][6]同步 +* 从 Evernote 导入文件 +* 导出 JEX 文件(Joplin 导出格式)和原始文件 +* 支持笔记、待办事项、标签和笔记本 +* 任意跳转功能 +* 支持移动设备和桌面应用通知 +* 地理位置支持 +* 支持多种语言 +* 外部编辑器支持:在 Joplin 中一键用你最喜欢的编辑器打开笔记 - * 将笔记保存到笔记本和子笔记本中,以便更好地组织 -  * 创建待办事项清单 -  * 笔记可以被标记和搜索 -  * 离线优先,因此即使没有互联网连接,所有数据始终在设备上可用 -  * Markdown 笔记支持图片、数学符号和复选框 -  * 支持附件 -  * 应用可在桌面、移动设备和终端(CLI)使用 -  * 可在 Firefox 和 Chrome 使用[网页剪切板][5] -  * 端到端加密 -  * 保留笔记历史 -  * 根据名称,时间等对笔记进行排序 -  * 与 [Nextcloud][7]、Dropbox、WebDAV 和 OneDrive 等各种[云服务][6]同步 -  * 从 Evernote 导入文件 -  * 导出 JEX 文件(Joplin 导出格式)和原始文件。 -  * 支持笔记、待办事项、标签和笔记本。 -  * 任意跳转功能。 -  * 支持移动设备和桌面应用通知。 -  * 地理位置支持。 -  * 支持多种语言 -  * 外部编辑器支持–在 Joplin 中一键用你最喜欢的编辑器打开笔记。 - - -### Installing Joplin on Linux and other platforms +### 在 Linux 和其它平台上安装 Joplin ![][10] @@ -64,23 +61,23 @@ Joplin 可以导入 enex 格式的 Evernote 文件, 这让从 Evernote 切换 在 Linux 中,你可以获取 Joplin 的 [AppImage][14] 文件,并作为可执行文件运行。你需要为下载的文件授予执行权限。 -[Download Joplin][15] +- [下载 Joplin][15] ### 体验 Joplin -Joplin 中的笔记使用 markdown,但你不需要了解它。编辑器的顶部面板能让你以图形方式选择项目符号、标题、图像、链接等。 +Joplin 中的笔记使用 Markdown,但你不需要了解它。编辑器的顶部面板能让你以图形方式选择项目符号、标题、图像、链接等。 虽然 Joplin 提供了许多有趣的功能,但你需要自己去尝试。例如,默认情况下未启用 Web 剪切板,我需要发现如何打开它。 -你需要从桌面应用启用剪切板。在顶部菜单中,进入 “Tools->Options”。你可以在此处找到 Web 剪切板选项: +你需要从桌面应用启用剪切板。在顶部菜单中,进入 “Tools->Options”。你可以在此处找到 Web 剪切板选项: ![Enable Web Clipper from the desktop application first][16] -它的 Web 剪切板不如 Evernote 的 Web 剪切板聪明,后者可以以图形方式剪辑网页文章的一部分。但是,它也足够了。 +它的 Web 剪切板不如 Evernote 的 Web 剪切板聪明,后者可以以图形方式剪辑网页文章的一部分。但是,也足够了。 -这是一个在积极开发中的开源软件,我希望它随着时间的推移得到更多的改进。 +这是一个在活跃开发中的开源软件,我希望它随着时间的推移得到更多的改进。 -**总结** +### 总结 如果你正在寻找一个不错的拥有 Web 剪切板的笔记应用,你可以试试 Joplin。如果你喜欢它,并将继续使用,尝试通过捐赠或改进代码和文档来帮助 Joplin 开发。我以 FOSS 的名义[捐赠][17]了 25 欧。 @@ -93,7 +90,7 @@ via: https://itsfoss.com/joplin/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 23fbb9d703ecf44107ac97f8a49b4dfdfc55459c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 15 Feb 2020 21:03:59 +0800 Subject: [PATCH 028/315] PUB @geekpi https://linux.cn/article-11896-1.html --- ...00129 Joplin- The True Open Source Evernote Alternative.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200129 Joplin- The True Open Source Evernote Alternative.md (98%) diff --git a/translated/tech/20200129 Joplin- The True Open Source Evernote Alternative.md b/published/20200129 Joplin- The True Open Source Evernote Alternative.md similarity index 98% rename from translated/tech/20200129 Joplin- The True Open Source Evernote Alternative.md rename to published/20200129 Joplin- The True Open Source Evernote Alternative.md index f48b22c401..106d670f11 100644 --- a/translated/tech/20200129 Joplin- The True Open Source Evernote Alternative.md +++ b/published/20200129 Joplin- The True Open Source Evernote Alternative.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11896-1.html) [#]: subject: (Joplin: The True Open Source Evernote Alternative) [#]: via: (https://itsfoss.com/joplin/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 697d6346df728b3c3a150af1dfa8325971305afd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 15 Feb 2020 22:27:47 +0800 Subject: [PATCH 029/315] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chai-yuan 恭喜你完成了第一篇翻译贡献! --- ...ra to your Android phone with GSConnect.md | 66 +++++++++---------- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md b/translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md index 524e72fce0..aee5eb7c77 100644 --- a/translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md +++ b/translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md @@ -1,92 +1,86 @@ [#]: collector: (lujun9972) [#]: translator: (chai-yuan) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Connect Fedora to your Android phone with GSConnect) [#]: via: (https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/) [#]: author: (Lokesh Krishna https://fedoramagazine.org/author/lowkeyskywalker/) -使用GSConnect将Android手机连接到Fedora系统 +使用 GSConnect 将 Android 手机连接到 Fedora 系统 ====== ![][1] -苹果和微软公司都提供了集成好的与移动设备交互的应用。Fedora提供了类似的工具——**GSConnect**。它可以让你将你的安卓手机和你的Fedora桌面配对并使用。读下去,来了解更多关于它是什么以及它是如何工作的信息。 +苹果和微软公司都不同程度的提供了桌面产品与移动设备集成。Fedora 提供了类似甚至更高集成度的工具——GSConnect。它可以让你将安卓手机和你的 Fedora 桌面配对并使用。请继续阅读,以了解更多关于它的情况以及它是如何工作的信息。 -### GSConnect是什么? +### GSConnect 是什么? -GSConnect是基于KDE Connect项目而为GNOME桌面定制的程序。KDE Connect使你的设备相互之间能够进行通信。但是,在Fedora的默认GNOME桌面上安装它需要安装大量的KDE依赖。 +GSConnect 是针对 GNOME 桌面定制的 KDE Connect 程序。KDE Connect 可以使你的设备能够互相通信。但是,在 Fedora 默认的 GNOME 桌面上安装它需要安装大量的 KDE 依赖。 -GSConnect基于KDE Connect实现,作为GNOME shell的拓展应用。一旦安装,GSConnect允许您执行以下操作: +GSConnect 是一个 KDE Connect 的完整实现,其以 GNOME shell 的拓展形式出现。安装后,GSConnect 允许你执行以下操作及更多: - * 在电脑上接收电话通知并回复信息 - * 用手机操纵你的桌面 - * 在不同设备之间分享文件与链接 - * 在电脑上查看手机电量 - * 让手机响铃以便你能找到它 +* 在计算机上接收电话通知并回复信息 +* 用手机操纵你的桌面 +* 在不同设备之间分享文件与链接 +* 在计算机上查看手机电量 +* 让手机响铃以便你能找到它 +### 设置 GSConnect 扩展 +设置 GSConnect 需要安装两个组件:计算机上的 GSConnect 扩展和 Android 设备上的 KDE Connect 应用。 -### 设置GSConnect扩展 +首先,从 GNOME Shell 扩展网站上安装 [GSConnect][2] 扩展。(Fedora Magazine 有一篇关于[如何安装 GNOME Shell 扩展][3]的文章,可以帮助你完成这一步。) -设置GSConnect需要安装两款软件:电脑上的GSConnect扩展和Android设备上的KDE Connect应用。 +KDE Connect 应用程序可以在 Google 的 [Play 商店][4]上找到。它也可以在 FOSS Android 应用程序库 [F-Droid][5] 上找到。 -首先,从GNOME Shell扩展网站[GSConnect][2]安装GSConnect扩展。(Fedora Magazine有一篇关于[如何安装GNOMEShell扩展名][3]的文章,可以帮助你完成这一步。) - -KDE Connect应用程序可以在Google的[Play Store][4]上找到。它也可以在FOSS Android应用程序库[F-Droid][5]上找到。 - -一旦安装了这两个组件,就可以配对两个设备。安装扩展后再系统菜单中显示“移动设备(Mobile Devices)”。单击它会出现一个下拉菜单,你可以从中访问“移动设置(Mobile Settings)”。 +一旦安装了这两个组件,就可以配对两个设备。安装扩展后它在你的系统菜单中显示为“移动设备Mobile Devices”。单击它会出现一个下拉菜单,你可以从中访问“移动设置Mobile Settings”。 ![][6] -在这里,你可以用GSConnect查看并管理配对的设备。进入此界面后,需要在Android设备上启动应用程序。 +你可以在这里用 GSConnect 查看并管理已配对的设备。进入此界面后,需要在 Android 设备上启动应用程序。 -配对的初始化可以再任意一台设备上进行,在这里我们从Android设备连接到电脑。点击应用程序上的刷新(refresh),只要两个设备都在同一个无线网络环境中,你的Android设备便可以搜索到你的电脑。现在可以向桌面发送配对请求,并在桌面上接受配对请求以完成配对。 +你可以在任意一台设备上进行配对初始化,在这里我们从 Android 设备连接到计算机。点击应用程序上的“刷新”,只要两个设备都在同一个无线网络环境中,你的 Android 设备便可以搜索到你的计算机。现在可以向桌面发送配对请求,并在桌面上接受配对请求以完成配对。 ![][7] ### 使用 GSConnect -配对后,你将需要授予对Android设备的权限,才能使用GSConnect上提供的许多功能。单击设备列表中的配对设备,便可以查看所有可用功能,并根据你的偏好和需要启用或禁用它们。 +配对后,你将需要在 Android 设备授予权限,才能使用 GSConnect 上提供的许多功能。单击设备列表中的已配对设备,便可以查看所有可用功能,并根据你的偏好和需要启用或禁用它们。 ![][8] -请记住,你还需要在Android应用程序中授予相应的权限才能使用这些功能。启用权限后,你现在可以访问桌面上的移动联系人,获得消息通知并回复消息,甚至同步桌面和Android设备剪贴板。 +请记住,你还需要在这个 Android 应用程序中授予相应的权限才能使用这些功能。启用权限后,你现在可以访问桌面上的移动联系人,获得消息通知并回复消息,甚至同步桌面和 Android 设备的剪贴板。 -### 集成在文件系统与浏览器上 +### 将你的浏览器与“文件”应用集成 -GSConnect允许你直接从桌面文件资源管理器向Android设备发送文件。 +GSConnect 允许你直接从计算机上的文件资源管理器的关联菜单向 Android 设备发送文件。 -在Fedora的默认GNOME桌面上,你需要安装_nautilus-python_依赖包,以便在菜单中显示配对的设备。安装它只需要再终端中输入: +在 Fedora 的默认 GNOME 桌面上,你需要安装 `nautilus-python` 依赖包,以便在关联菜单中显示配对的设备。安装此命令非常简单,只需要在你的首选终端运行以下命令: ``` $ sudo dnf install nautilus-python ``` -完成后,将在“文件(Files)”的菜单中显示“发送到移动设备(Send to Mobile Device)”选项。 +完成后,将在“文件Files”应用的关联菜单中显示“发送到移动设备Send to Mobile Device”选项。 ![][9] -同样,为你的浏览器安装相应的WebExtension,无论是[Firefox][10]还是[Chrome][11]浏览器,都可以将链接发送到你的Android设备。你可以选择直接在浏览器中发送要启动的链接,或将其作为短信息发送。 +同样,为你的浏览器安装相应的 WebExtension,无论是 [Firefox][10] 还是 [Chrome][11] 浏览器,都可以将链接发送到你的 Android 设备。你可以选择直接发送链接以在浏览器中直接打开,或将其作为短信息发送。 ### 运行命令 -GSConnect允许你定义命令,然后可以从远程设备在电脑上运行这些命令。这使得你可以远程截屏,或者从你的Android设备锁定和解锁你的桌面。 +GSConnect 允许你定义命令,然后可以从远程设备在计算机上运行这些命令。这使得你可以远程截屏,或者从你的 Android 设备锁定和解锁你的桌面。 ![][12] -要使用此功能,可以使用标准shell命令和GSConnect公开的CLI。项目的GitHub存储库中提供了有关此操作的文档: _CLI Scripting_。 +要使用此功能,可以使用标准的 shell 命令和 GSConnect 提供的 CLI。该项目的 GitHub 存储库(CLI Scripting)中提供了有关此操作的文档。 -[KDE UserBase Wiki][13]有一个命令示例列表。这些例子包括控制桌面的亮度和音量,锁定鼠标和键盘,甚至更改桌面主题。其中一些命令是针对KDE Plasma设计的,需要进行修改才能在GNOME桌面上运行。 +[KDE UserBase Wiki][13] 有一个命令示例列表。这些例子包括控制桌面的亮度和音量、锁定鼠标和键盘,甚至更改桌面主题。其中一些命令是针对 KDE Plasma 设计的,需要进行修改才能在 GNOME 桌面上运行。 ### 探索并享受乐趣 -GSConnect使我们能够享受到极大的便利和舒适。深入研究首选项,查看你可以做的所有事情,灵活的使用这些命令功能。并在下面的评论中自由分享你解锁的新方式。 - -* * * - -_Photo by [Pathum Danthanarayana][14] on [Unsplash][15]._ +GSConnect 使我们能够享受到极大的便利和舒适。深入研究首选项,查看你可以做的所有事情,灵活的使用这些命令功能发挥创意,并在下面的评论中自由分享你解锁的新方式。 -------------------------------------------------------------------------------- @@ -95,7 +89,7 @@ via: https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconn 作者:[Lokesh Krishna][a] 选题:[lujun9972][b] 译者:[chai-yuan](https://github.com/chai-yuan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 627b429abb9043c481ec9a35e4eb82148c4d2868 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 15 Feb 2020 22:28:48 +0800 Subject: [PATCH 030/315] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chai-yuan 本文首发地址: https://linux.cn/article-11897-1.html 您的 LCTT 专页:https://linux.cn/lctt/chai-yuan 请注册以领取你的 LCCN: https://lctt.linux.cn/ --- ...207 Connect Fedora to your Android phone with GSConnect.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200207 Connect Fedora to your Android phone with GSConnect.md (98%) diff --git a/translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md b/published/20200207 Connect Fedora to your Android phone with GSConnect.md similarity index 98% rename from translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md rename to published/20200207 Connect Fedora to your Android phone with GSConnect.md index aee5eb7c77..80a2884a6f 100644 --- a/translated/tech/20200207 Connect Fedora to your Android phone with GSConnect.md +++ b/published/20200207 Connect Fedora to your Android phone with GSConnect.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (chai-yuan) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11897-1.html) [#]: subject: (Connect Fedora to your Android phone with GSConnect) [#]: via: (https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/) [#]: author: (Lokesh Krishna https://fedoramagazine.org/author/lowkeyskywalker/) From 384b94bbf8a509a5c88705e8c53cb906b8180256 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 16 Feb 2020 01:01:05 +0800 Subject: [PATCH 031/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200215=203=20st?= =?UTF-8?q?eps=20for=20product=20marketing=20your=20open=20source=20projec?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200215 3 steps for product marketing your open source project.md --- ...duct marketing your open source project.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/tech/20200215 3 steps for product marketing your open source project.md diff --git a/sources/tech/20200215 3 steps for product marketing your open source project.md b/sources/tech/20200215 3 steps for product marketing your open source project.md new file mode 100644 index 0000000000..5f73f72bb2 --- /dev/null +++ b/sources/tech/20200215 3 steps for product marketing your open source project.md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 steps for product marketing your open source project) +[#]: via: (https://opensource.com/article/20/2/product-marketing-open-source-project) +[#]: author: (Kevin Xu https://opensource.com/users/kevin-xu) + +3 steps for product marketing your open source project +====== +Marketing an open source project is mainly about education, and +traditional marketing techniques do not apply. +![People meeting][1] + +I frequently get questions from open source project creators or new founders of commercial open source software (COSS) companies about the best way to market their product. Implicit in that inquiry lies more foundational questions: "What the hell is product marketing? How much time should I spend on it?" + +This article aims to share some knowledge and specific action items to help open source creators understand product marketing as a concept and how to bootstrap it on their own until a project reaches the next level of traction. + +### What is product marketing? + +Product marketing for COSS is materially different from product marketing for proprietary software and from general marketing practices like ads, lead generation, sponsorships, booths at conferences and trade shows, etc. Because the source code is open for all to see and the project's evolutionary history is completely transparent, you need to articulate—from a technical level to a technical audience—how and why your project works. + +Using the word "marketing" in this context is, in fact, misleading. It's really about product _education_. Your role is more like a coach, mentor, or teaching assistant in a computer science class or a code bootcamp than a "marketing person." + +Proprietary software products rarely need this level of technical education because no one can see the source code anyway. Therefore, these companies focus on educating their audience about the product's business value, not its technical advantages. + +To build a successful open source project (and any commercial product that may be derived from it), you must educate your audience on _both_ its technical details and business value. + +While this may sound like extra work, it's an advantage inherent to COSS because so much buying power for technology products is shifting to developers. They care deeply about technical details and want to see and understand the source code. Being able to learn, appreciate, and have confidence in a project's technical design, architecture, and future roadmap are key to its adoption. + +Also, developers often treat open source technology as a way to scratch their technical itch and stay sharp in a fast-moving technology landscape. It's an audience that yearns for education, above all. + +Being able to speak to an audience that has these goals and desires is what product marketing and education in the COSS context is all about. + +### How to bootstrap product marketing + +So you (or maybe one or two other engineers) are laboring away to create your open source project, likely in the evening after your day job or on the weekends. How do you bootstrap some effective product marketing on your own? + +I recommend a three-step process to yield the best return for your time: + + 1. Peruse online forums + 2. Write content + 3. Do in-person meetups + + + +#### Online forums + +Rummaging through forums—from general ones like HackerNews and Reddit to ones like Discourse or Slack channels geared to projects that are closely related to what you are building—is a great way to figure out what questions developers have in your space. Starting with this step is less about inserting your project into the discussion and more about gathering ideas on what you should focus on when putting together educational materials about your project. + +Effectively, what you are doing is akin to "listening to your customer." + +Let's be honest; you already spend a lot of time on these forums anyway. The only change is one of mindset, not behavior: Have more focus, jot ideas down actively, practice absorbing critiques (you may see threads critical of your project), and develop some intuition about what developers are thinking about. + +This step assumes you don't already have an active community where developers are asking questions directly. The long-term goal is to build your own community, and good product marketing directly helps with this. + +#### Write + +Now that you have gathered some ideas, it's time to produce some content. Compared to formats like videos and podcasts, _writing_ is the highest-leveraged medium. It has the best long-tail benefits, is most suited for ongoing reference material, and can be most easily repackaged into other mediums. Another factor: open source has a global audience, many of whom might speak English as a second (third, or fourth) language, and written content is easily consumable at a person's own pace. + +Focus your writing on three categories that answer three fundamental questions: + + * What problem does your project solve? In other words: _Why should it exist?_ + * How is the project architected, and why is it done that way? _Is this a technically well-designed solution that has potential, thus worth investing time in?_ + * How do I get a taste of it? _How quickly can I get some value out of it?_ This is crucial to reducing your time-to-value metric to the shortest amount possible. For more on this topic, please read my article [_A framework for building products from open source projects_][2]. + + + +A smart way to begin is by writing three blog posts, each addressing one of the three points. The posts should be canonical to your specific project so that repackaging them into different formats (e.g., slide decks, Quora answers, Twitter threads, podcast interviews, etc.) for different channels should be straightforward. + +After you publish the posts, work the materials into your GitHub, GitLab, Bitbucket, or other repository along with the project's documentation. This is important because your public repo will likely be the face of your project for a long time, even if also you have a dedicated website. A repo with strong educational content will go a long way in building your social proof in the form of stars, forks, and downloads and may even yield some contributions. + +One note on writing: Be patient! Your words likely won't go viral overnight (unless you are a celebrity developer). But if the material is educational, useful, and accessible (no need for fancy language), it will draw attention to your project in time. You do your part, and let Google's SEO algorithm do its part. + +#### In-person meetups + +With a few posts out in the wild, the next step is to find an in-person meetup where you can give a presentation about your project using your writing as foundational material to build a compelling talk. + +You may wonder: "Why? Isn't doing something in-person the biggest time suck? I'd rather code!" + +True. You are not wrong. I recommend this step _specifically_ at this moment, not earlier or later, because you'll get feedback on your output more quickly than what the internet can give. Comments and feedback on your posts will trickle in, but giving a talk at a meetup, taking questions, and chatting with attendees afterward over pizza is valuable and immediate. + +The goal is not to shamelessly pitch your project (reminder: you are an educator, not a marketer), but to listen for the kinds of questions you get when you put your project (and yourself) out there. Another benefit is that it gives you practice delivering presentations, which will become important as your project grows, and you need to present in higher-stakes situations, including large conferences, demos with prospective users, etc. + +I know this may not be practical if you don't live in a tech hub where meetups are aplenty. You may want to look for groups that are open to doing virtual meetups via video or work this into your existing travel plans. (But don't fly across the world to talk at one meetup.) + +In-person meetups can feel scary. Public speaking is not for everyone, and it's a legitimate source of fear. My main tips: Just think of yourself as free entertainment, lower your expectations, don't overthink it, and offer yourself up to meetup organizers proactively because they will love you! Having been both a presenter and a meetup organizer, I know developer-focused meetups are very hungry for good technical education. + +### Final words + +There's a lot more nuance, strategy, and sheer work to effective product marketing, but I hope this post gives you enough guidance and specific action items to bootstrap it. Ultimately, you should still spend the bulk of your time building your technology. And if you have some revenue or funding, it's worth hiring someone who has deep expertise in product marketing, even as a part-time adviser. + +Frankly, product marketing talent is hard to find. You need someone with both the technical chops and curiosity to learn about your project on a deep level and the communication skills to compellingly tell the world about it. + +* * * + +_This article originally appeared on [COSS Media][3] and is republished with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/product-marketing-open-source-project + +作者:[Kevin Xu][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/kevin-xu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/people_team_community_group.png?itok=Nc_lTsUK (People meeting) +[2]: https://opensource.com/article/19/11/products-open-source-projects +[3]: https://coss.media/open-source-creator-product-marketing/ From a0dde8666298b552edcfbc900aaa663d5f010e87 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 16 Feb 2020 09:45:10 +0800 Subject: [PATCH 032/315] Rename sources/tech/20200215 3 steps for product marketing your open source project.md to sources/talk/20200215 3 steps for product marketing your open source project.md --- ...0215 3 steps for product marketing your open source project.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200215 3 steps for product marketing your open source project.md (100%) diff --git a/sources/tech/20200215 3 steps for product marketing your open source project.md b/sources/talk/20200215 3 steps for product marketing your open source project.md similarity index 100% rename from sources/tech/20200215 3 steps for product marketing your open source project.md rename to sources/talk/20200215 3 steps for product marketing your open source project.md From ee1e855120000ea96c9daa3a8b6696d7f431bd15 Mon Sep 17 00:00:00 2001 From: charain <42235952+chai-yuan@users.noreply.github.com> Date: Sun, 16 Feb 2020 09:47:42 +0800 Subject: [PATCH 033/315] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ur Fedora Terminal with MPD and ncmpcpp.md | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/sources/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md b/sources/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md index 13fd723393..4940c656a1 100644 --- a/sources/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md +++ b/sources/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md @@ -7,99 +7,99 @@ [#]: via: (https://fedoramagazine.org/playing-music-on-your-fedora-terminal-with-mpd-and-ncmpcpp/) [#]: author: (Carmine Zaccagnino https://fedoramagazine.org/author/carzacc/) -Playing Music on your Fedora Terminal with MPD and ncmpcpp +使用MPD和ncmpcpp在你的Fedora终端上播放音乐 ====== ![][1] -MPD, as the name implies, is a Music Playing Daemon. It can play music but, being a daemon, any piece of software can interface with it and play sounds, including some CLI clients. +MPD(Music Playing Daemon),顾名思义,是一个音乐(Music)播放(Playing)程序(Daemon)。它可以播放音乐,并且作为一个守护进程,任何软件都可以与之交互并播放声音,包括一些CLI客户端。 -One of them is called _ncmpcpp_, which is an improvement over the pre-existing _ncmpc_ tool. The name change doesn’t have much to do with the language they’re written in: they’re both C++, but _ncmpcpp_ is called that because it’s the _NCurses Music Playing Client_ _Plus Plus_. +其中一个被称为 _ncmpcpp_ ,它是对之前NNCMPCI工具的改进。名字的变化与他们所写的语言没有太大关系:都是C++,但称为 _ncmpcpp_ ,因为它是 _NCurses Music Playing Client_ _Plus Plus_ . -### Installing MPD and ncmpcpp +### 安装 MPD 和 ncmpcpp -The _ncmpmpcc_ client can be installed from the official Fedora repositories with DNF directly with + _ncmpmpcc_ 的客户端可以从官方Fedora库中通过dnf命令直接安装. ``` $ sudo dnf install ncmpcpp ``` -On the other hand, MPD has to be installed from the RPMFusion _free_ repositories, which you can enable, [as per the official installation instructions][2], by running +另一方面,MPD必须从RPMFusion free库安装,你可以通过运行: ``` $ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm ``` -and then you can install MPD by running +然后你可以运行下面的命令安装它: ``` $ sudo dnf install mpd ``` -### Configuring and Starting MPD +### 配置并启用 MPD -The most painless way to set up MPD is to run it as a regular user. The default is to run it as the dedicated _mpd_ user, but that causes all sorts of issues with permissions. +设置MPD最简单的方法是以普通用户的身份运行它。默认情况是以专用 _mpd_ 用户的身份运行它,但这会导致各种权限问题。 + +在运行它之前,我们需要创建一个本地配置文件,允许我们作为普通用户运行。 -Before we can run it, we need to create a local config file that will allow it to run as a regular user. - -To do that, create a subdirectory called _mpd_ in _~/.config_: +首先创建一个名叫 _mpd_ 的目录在 _~/.config_ 里: ``` $ mkdir ~/.config/mpd ``` -copy the default config file into this directory: +将配置文件拷贝到此目录下: ``` $ cp /etc/mpd.conf ~/.config/mpd ``` -and then edit it with a text editor like _vim_, _nano_ or _gedit_: +然后用 _vim_, _nano_ 或 _gedit_之类的软件编辑它: ``` $ nano ~/.config/mpd/mpd.conf ``` -I recommend you read through all of it to check if there’s anything you need to do, but for most setups you can delete everything and just leave the following: - +我建议您通读所有内容,检查是否有任何需要做的事情,但对于大多数设置,您可以删除所有内容,只需保留以下内容: + ``` db_file "~/.config/mpd/mpd.db" log_file "syslog" ``` -At this point you should be able to just run +现在你可以运行它了: ``` $ mpd ``` -with no errors, which will start the MPD daemon in the background. +没有报错,这将在后台启动MPD守护进程。 -### Using ncmpcpp +### 使用 ncmpcpp -Simply run +只需运行: ``` $ ncmpcpp ``` -and you’ll see a ncurses-powered graphical user interface in your terminal. +您将在终端中看到一个由ncurses所支持的图形用户界面。 -Press _4_ and you should see your local music library, be able to change the selection using the arrow keys and press _Enter_ to play a song. +按下 _4_ 键,然后就可以看到本地的音乐目录,用方向键进行选择并按下 _Enter_ 进行播放。 -Doing this multiple times will create a _playlist_, which allows you to move to the next track using the _>_ button (not the right arrow, the _>_ closing angle bracket character) and go back to the previous track with _<_. The + and – buttons increase and decrease volume. The _Q_ button quits ncmpcpp but it doesn’t stop the music. You can play and pause with _P_. +多播放几次就会创建一个 _playlist_, 让你可以使用 _>_ 键(不是右箭头, _>_ 是右尖括号) 移动到下一首,并使用 _<_ 返回上一首. + 和 – 键可以调节音量. _Q_ 键可以让你退出 ncmpcpp 但不停止播放音乐. 你可以按下 _P_ 来控制暂停和播放. -You can see the current playlist by pressing the _1_ button (this is the default view). From this view you can press _i_ to look at the information (tags) about the current song. You can change the tags of the currently playing (or paused) song by pressing _6_. +你可以按下 _1_ 键来查看当前播放列表 (这是默认的视图). 从这个视图中,您可以按 _i_ 查看有关当前歌曲的信息(标记)。按 _6_ 可更改当前歌曲的标记。 -Pressing the \ button will add (or remove) an informative panel at the top of the view. In the top left, you should see something that looks like this: +按 _\_ 按钮将在视图顶部添加(或删除)信息面板。在左上角,你可以看到如下的内容: ``` [------] ``` -Pressing the _r_, _z_, _y_, _R_, _x_ buttons will respectively toggle the _repeat_, _random_, _single_, _consume_ and _crossfade_ playback modes and will replace one of the _–_ characters in that little indicator to the initial of the selected mode. +按下 _r_, _z_, _y_, _R_, _x_ 将会分别切换到 _repeat_, _random_, _single_, _consume_ 和 _crossfade_ 播放模式并将小指示器中的 _–_ 字符替换为选定模式. -Pressing the _F1_ button will display some help text, which contains a list of keybindings, so there’s no need to write a complete list here. So now go on, be geeky, and play all your music from your terminal! +按下 _F1_ 键将会显示一些帮助文档,包含一系列的键绑定列表, 因此无需在此处编写完整列表。所以继续吧!做一个极客, 在你的终端上播放音乐! -------------------------------------------------------------------------------- @@ -107,7 +107,7 @@ via: https://fedoramagazine.org/playing-music-on-your-fedora-terminal-with-mpd-a 作者:[Carmine Zaccagnino][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[chai-yuan](https://github.com/chai-yuan) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2ae1b8daf88ba957dff2d8d05baa646e3fdbc2b4 Mon Sep 17 00:00:00 2001 From: charain <42235952+chai-yuan@users.noreply.github.com> Date: Sun, 16 Feb 2020 09:51:32 +0800 Subject: [PATCH 034/315] Rename sources/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md to translated/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md --- ... Playing Music on your Fedora Terminal with MPD and ncmpcpp.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md (100%) diff --git a/sources/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md b/translated/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md similarity index 100% rename from sources/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md rename to translated/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md From bd2383e6dd6332df9ef5b3a3ed540cb1791ae97a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Feb 2020 10:36:22 +0800 Subject: [PATCH 035/315] APL --- ...Customize your internet with an open source search engine.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200207 Customize your internet with an open source search engine.md b/sources/tech/20200207 Customize your internet with an open source search engine.md index 7974fdbfa8..040d262d62 100644 --- a/sources/tech/20200207 Customize your internet with an open source search engine.md +++ b/sources/tech/20200207 Customize your internet with an open source search engine.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 12a9c859e2b7f27160cb3039490e49482403b6b7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Feb 2020 16:28:41 +0800 Subject: [PATCH 036/315] TSL --- ...ernet with an open source search engine.md | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/sources/tech/20200207 Customize your internet with an open source search engine.md b/sources/tech/20200207 Customize your internet with an open source search engine.md index 040d262d62..86b929a3ef 100644 --- a/sources/tech/20200207 Customize your internet with an open source search engine.md +++ b/sources/tech/20200207 Customize your internet with an open source search engine.md @@ -7,90 +7,90 @@ [#]: via: (https://opensource.com/article/20/2/open-source-search-engine) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -Customize your internet with an open source search engine +用开源搜索引擎定制你的互联网 ====== -Get started with YaCy, an open source, P2P web indexer. + +> 上手开源的对等 Web 索引器 YaCy。 + ![Person using a laptop][1] -A long time ago, the internet was small enough to be indexed by a few people who gathered the names and locations of all websites and listed them each by topic on a page or in a printed book. As the World Wide Web network grew, the "web rings" convention developed, in which sites with a similar theme or topic or sensibility banded together to form a circular path to each member. A visitor to any site in the ring could click a button to proceed to the next or previous site in the ring to discover new sites relevant to their interest. +很久以前,互联网很小,小到几个人就可以索引它们,这些人收集了所有网站的名称和链接,并按主题将它们分别列在页面或印刷书籍中。随着万维网网络的发展,“网络环”惯例得到了发展,在该惯例中,具有类似的内容、主题或敏感性的站点捆绑在一起,形成了通往每个成员的循环路径。环中任何站点的访问者都可以单击按钮以转到环中的下一个或上一个站点,以发现与其兴趣相关的新站点。 -Then for a while, it seemed the internet outgrew itself. Everyone was online, there was a lot of redundancy and spam, and there was no way to find anything. Yahoo and AOL and CompuServe and similar services had unique approaches, but it wasn't until Google came along that the modern model took hold. According to Google, the internet was meant to be indexed, sorted, and ranked through a search engine. +过了一段时间,互联网似乎变得臃肿不堪了。每个人都在线上,有很多冗余和垃圾邮件,多到让你无法找到任何东西。Yahoo 和 AOL、CompuServe 以及类似的服务各自采用了不同的方法来解决这个问题,但是直到谷歌出现后,现代的搜索模型才得以普及。按谷歌的做法,互联网应该通过搜索引擎进行索引、排序和排名。 -### Why choose an open source alternative? +### 为什么选择开源替代品? -Search engines like Google and DuckDuckGo are demonstrably effective. You may have reached this site through a search engine. While there's a debate to be had about content falling through the cracks because a host chooses not to follow best practices for search engine optimization, the modern solution for managing the wealth of culture and knowledge and frivolity that is the internet is relentless indexing. +像谷歌和 DuckDuckGo 这样的搜索引擎显然是卓有成效的。你可能是通过搜索引擎访问的本站。尽管对于因主机选择不遵循最佳实践来优化搜索引擎从而使内容陷入困境仍存在争论,但用于管理丰富的文化、知识和轻率的信息(即互联网)的现代解决方案是无情的索引。 -But maybe you prefer not to use Google or DuckDuckGo because of privacy concerns or because you're looking to contribute to an effort to make the internet more independent. If that appeals to you, then consider participating in [YaCy][2], the peer-to-peer internet indexer and search engine. +但是也许出于隐私方面的考虑,或者你希望为使互联网更加独立而做出的贡献,你或许不愿意使用谷歌或 DuckDuckGo。如果你对此感兴趣,那么可以考虑参加 [YaCy] [2],这是一个对等互联网索引器和搜索引擎。 -### Install YaCy +### 安装 YaCy -To install and try YaCy, first ensure you have Java installed. If you're on Linux, you can follow the instructions in my [_How to install Java on Linux_][3] article. If you're on Windows or MacOS, obtain an installer from [AdoptOpenJDK.net][4]. +要安装并尝试 YaCy,请首先确保已安装 Java。如果你使用的是 Linux,则可以按照我的《[如何在 Linux 上安装 Java][3]》中的说明进行操作。如果你使用 Windows 或 MacOS,请从 [AdoptOpenJDK.net][4] 获取安装程序。 -Once you have Java installed, [download the installer][5] for your platform. - -If you're on Linux, unarchive the tarball and move it to the **/opt** directory: +安装 Java 后,请根据你的平台[下载安装程序][5]。 +如果你使用的是 Linux,请解压缩 tarball 并将其移至 `/opt` 目录: ``` -`$ sudo tar --extract --file  yacy_*z --directory /opt` +$ sudo tar --extract --file  yacy_*z --directory /opt ``` -Start YaCy according to instructions for the installer you downloaded. - -On Linux, start YaCy running in the background: +根据下载的安装程序的说明启动 YaCy。 +在 Linux 上,启动在后台运行的 YaCy: ``` -`$ /opt/startYACY.sh &` +$ /opt/startYACY.sh & ``` -In a web browser, navigate to **localhost:8090** and search. +在 Web 浏览器中,导航到 `localhost:8090` 并进行搜索。 ![YaCy start page][6] -### Add YaCy to your URL bar +### 将 YaCy 添加到你的地址栏 -If you're using the Firefox web browser, you can make YaCy your default search engine in the Awesome Bar (that's Mozilla's name for the URL field) with just a few clicks. +如果你使用的是 Firefox Web 浏览器,则只需单击几下,即可在 Awesome Bar(Mozilla 给 URL 栏起的名称)中将 YaCy 设置为默认搜索引擎。 -First, make the dedicated search bar visible in the Firefox toolbar, if it's not already (you don't have to keep the search bar visible; you only need it active long enough to add a custom search engine). The search bar is available in the hamburger menu in the upper-right corner of Firefox in the **Customize** menu. Once the search bar is visible in your Firefox toolbar, navigate to **localhost:8090**, and click the magnifying glass icon in the Firefox search bar you just added. Click the option to add YaCy to your Firefox search engines. +首先,如果尚未显示,在 Firefox 工具栏中使专用搜索栏显示出来(你不必使搜索栏保持一直可见;只需要激活它足够长的时间即可添加自定义搜索引擎)。Firefox 右上角的“汉堡”菜单中的“自定义”菜单中提供了搜索栏。在 Firefox 工具栏上的搜索栏可见后,导航至 `localhost:8090`,然后单击刚添加的 Firefox 搜索栏中的放大镜图标。单击选项将 YaCy 添加到你的 Firefox 搜索引擎。 ![Adding YaCy to Firefox][7] -Once this is done, you can mark it as your default in Firefox preferences, or just use it selectively in searches performed in the Firefox search bar. If you set it as your default search engine, then you may have no need for the dedicated search bar because the default engine is also used by the Awesome Bar, so you can remove it from your toolbar. +完成此操作后,你可以在 Firefox 首选项中将其标记为默认值,或者仅在 Firefox 搜索栏中执行的搜索中选择性地使用它。如果将其设置为默认搜索引擎,则可能不需要专用的搜索栏,因为 Awesome Bar 也使用默认引擎,因此可以将其从工具栏中删除。 -### How to a P2P search engine works +### 对等搜索引擎如何工作 -YaCy is an open source and distributed search engine. It's written in [Java][8], so it runs on any platform, and it performs web crawls, indexing, and searching. It's a peer-to-peer (P2P) network, so every user running YaCy joins in the effort to track the internet as it changes from day to day. Of course, no single user possesses a full index of the entire internet because that would take a data center to house, but the index is distributed and redundant across all YaCy users. It's a lot like BitTorrent (as it uses distributed hash tables, or DHT, to reference index entries), except the data you're sharing is a matrix of words and URL associations. By mixing the results returned by the hash tables, no one can tell who has searched for what words, so all searches are functionally anonymous. It's an effective system for unbiased, ad-free, untracked, and anonymous searches, and you can join in just by using it. +YaCy 是一个开源的分布式搜索引擎。它是用 [Java][8] 编写的,因此可以在任何平台上运行,并且可以执行 Web 爬网、索引和搜索。这是一个对等(P2P)网络,因此每个运行 YaCy 的用户都将努力地不断跟踪互联网的变化情况。当然,没有单个用户能拥有整个互联网的完整索引,因为这将需要一个数据中心来容纳,但是该索引分布在所有 YaCy 用户中且是冗余的。它与 BitTorrent 非常相似(因为它使用分布式哈希表 DHT 来引用索引条目),只不过你所共享的数据是单词和 URL 关联的矩阵。通过混合哈希表返回的结果,没人能告诉谁搜索了哪些单词,因此所有搜索在功能上都是匿名的。这是用于无偏见、无广告、未跟踪和匿名搜索的有效系统,你只需要使用它就加入了它。 -### Search engines and algorithms +### 搜索引擎和算法 -The act of indexing the internet refers to separating a web page into the singular words on it, then associating the page's URL with each word. Searching for one or more words in a search engine fetches all URLs associated with the query. That's one thing the YaCy client does while running. +索引互联网的行为是指将网页分成单个单词,然后将页面的 URL 与每个单词相关联。在搜索引擎中搜索一个或多个单词将获取与该查询关联的所有 URL。YaCy 客户端在运行时也是如此。 -The other thing the client does is provide a search interface for your browser. Instead of navigating to Google when you want to search, you can point your web browser to **localhost:8090** to search YaCy. You may even be able to add it to your browser's search bar (depending on your browser's extensibility), so you can search from the URL bar. +客户端要做的另一件事是为你的浏览器提供搜索界面。你可以将网络浏览器指向 `localhost:8090` 来搜索 YaCy,而不是在要搜索时导航到谷歌。你甚至可以将其添加到浏览器的搜索栏中(取决于浏览器的可扩展性),因此可以从 URL 栏中进行搜索。 -### Firewall settings for YaCy +### YaCy 的防火墙设置 -When you first start using YaCy, it's probably running in "junior" mode. This means that the sites your client crawls are available only to you because no other YaCy client can reach your index entries. To join the P2P experience, you must open port 8090 in your router's firewall and possibly your software firewall if you're running one. This is called "senior" mode. +首次开始使用 YaCy 时,它可能运行在“初级”模式下。这意味着你的客户端爬网的站点仅对你可用,因为其他 YaCy 客户端无法访问你的索引条目。要加入对等环境,必须在路由器的防火墙(或者你正在运行的软件防火墙)中打开端口 8090, 这称为“高级”模式。 -If you're on Linux, you can find out more about your computer's firewall in [_Make Linux stronger with firewalls_][9]. On other platforms, refer to your operating system's documentation. +如果你使用的是 Linux,则可以在《[使用防火墙让你的 Linux 更加强大][9]》中找到有关计算机防火墙的更多信息。 在其他平台上,请参考操作系统的文档。 -A firewall is almost always active on the router provided by your internet service provider (ISP), and there are far too many varieties of them to document accurately here. Most routers provide the option to "poke a hole" in your firewall because many popular networked games require two-way traffic. +互联网服务提供商(ISP)提供的路由器上几乎总是启用防火墙,并且这里有太多种类的防火墙无法准确说明。大多数路由器都提供了在防火墙中“打洞”的选项,因为许多流行的联网游戏都需要双向流量。 -If you know how to log into your router (it's often either 192.168.0.1 or 10.1.0.1, but can vary depending on the manufacturer's settings), then log in and look for a configuration panel controlling the _firewall_ or _port forwarding_ or _applications_. +如果你知道如何登录路由器(通常为 192.168.0.1 或 10.1.0.1,但可能因制造商的设置而异),则登录并查找配置面板来控制“防火墙”或“端口转发”或“应用”。 -Once you find the preferences for your router's firewall, add port 8090 to the whitelist. For example: +找到路由器防火墙的首选项后,将端口 8090 添加到白名单。例如: ![Adding YaCy to an ISP router][10] -If your router is doing port forwarding, then you must forward the incoming traffic to your computer's IP address, using the same port. For example: +如果路由器正在进行端口转发,则必须使用相同的端口将传入的流量转发到计算机的 IP 地址。例如: ![Adding YaCy to an ISP router][11] -If you can't adjust your firewall settings for any reason, that's OK. YaCy will continue to run and operate as a client of the P2P search network in junior mode. +如果由于某种原因无法调整防火墙设置,那也没事。YaCy 将继续以初级模式运行并作为对等搜索网络的客户端运行。 -### An internet of your own +### 你的互联网 -There's much more you can do with the YaCy search engine than just search passively. You can force crawls of underrepresented websites, you can request the network crawl a site, you can choose to use YaCy for just on-premises searches, and much more. You have better control over what _your_ internet looks like. The more senior users there are, the more sites indexed. The more sites indexed, the better the experience for all users. Join in! +使用 YaCy 搜索引擎可以做的不仅仅是被动搜索。你可以强制抓取不太显眼的网站,可以请求对网站进行网络抓取,可以选择使用 YaCy 进行本地搜索,等等。你可以更好地控制*你的*互联网的外观。高级用户越多,索引的网站就越多。索引的网站越多,所有用户的体验就越好。加入吧! -------------------------------------------------------------------------------- @@ -98,7 +98,7 @@ via: https://opensource.com/article/20/2/open-source-search-engine 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -107,7 +107,7 @@ via: https://opensource.com/article/20/2/open-source-search-engine [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://yacy.net/ -[3]: https://opensource.com/article/19/11/install-java-linux +[3]: https://linux.cn/article-11614-1.html [4]: https://adoptopenjdk.net/releases.html [5]: https://yacy.net/download_installation/ [6]: https://opensource.com/sites/default/files/uploads/yacy-startpage.jpg (YaCy start page) From dcf291dbf12c81b681e9734b7ede5a99f275faee Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Feb 2020 16:29:47 +0800 Subject: [PATCH 037/315] TSL --- ...7 Customize your internet with an open source search engine.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20200207 Customize your internet with an open source search engine.md (100%) diff --git a/sources/tech/20200207 Customize your internet with an open source search engine.md b/translated/tech/20200207 Customize your internet with an open source search engine.md similarity index 100% rename from sources/tech/20200207 Customize your internet with an open source search engine.md rename to translated/tech/20200207 Customize your internet with an open source search engine.md From a68b3ddfc136aa9f5396c0480342835623df834d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Feb 2020 16:44:26 +0800 Subject: [PATCH 038/315] APL --- .../20200125 Use tmux to create the console of your dreams.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200125 Use tmux to create the console of your dreams.md b/sources/tech/20200125 Use tmux to create the console of your dreams.md index adab130489..8643fc1e58 100644 --- a/sources/tech/20200125 Use tmux to create the console of your dreams.md +++ b/sources/tech/20200125 Use tmux to create the console of your dreams.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6fda2af04b0b0da109ae882fc62cb8866fe60ef8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Feb 2020 17:29:54 +0800 Subject: [PATCH 039/315] TSL --- ...ux to create the console of your dreams.md | 120 ------------------ ...ux to create the console of your dreams.md | 117 +++++++++++++++++ 2 files changed, 117 insertions(+), 120 deletions(-) delete mode 100644 sources/tech/20200125 Use tmux to create the console of your dreams.md create mode 100644 translated/tech/20200125 Use tmux to create the console of your dreams.md diff --git a/sources/tech/20200125 Use tmux to create the console of your dreams.md b/sources/tech/20200125 Use tmux to create the console of your dreams.md deleted file mode 100644 index 8643fc1e58..0000000000 --- a/sources/tech/20200125 Use tmux to create the console of your dreams.md +++ /dev/null @@ -1,120 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use tmux to create the console of your dreams) -[#]: via: (https://opensource.com/article/20/1/tmux-console) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Use tmux to create the console of your dreams -====== -You can do a lot with tmux, especially when you add tmuxinator to the -mix. Check them out in the fifteenth in our series on 20 ways to be more -productive with open source in 2020. -![Person drinking a hat drink at the computer][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### Do it all on the console with tmux and tmuxinator - -In this series so far, I've written about individual apps and tools. Starting today, I'll put them together into comprehensive setups to streamline things. Starting at the command line. Why the command line? Simply put, working at the command line allows me to access a lot of these tools and functions from anywhere I can run SSH. I can SSH into one of my personal machines and run the same setup on my work machine as I use on my personal one. And the primary tool I'm going to use for that is [tmux][2]. - -Most people use tmux for very basic functions, such as opening it on a remote server then starting a process, maybe opening a second session to watch log files or debug information, then disconnecting and coming back later. But you can do so much work with tmux. - -![tmux][3] - -First things first—if you have an existing tmux configuration file, back it up. The configuration file for tmux is **~/.tmux.conf**. Move it to another directory, like **~/tmp**. Now, clone the [Oh My Tmux][4] project with Git. Link to **.tmux.conf** from that and copy in the **.tmux.conf.local** file to make adjustments: - - -``` -cd ~ -mkdir ~/tmp -mv ~/.tmux.conf ~/tmp/ -git clone -ln -s ~/.tmux/.tmux.conf ./ -cp ~/.tmux.conf.local ./ -``` - -The **.tmux.conf.local** file contains local settings and overrides. For example, I changed the default colors a bit and turned on the [Powerline][5] dividers. This snippet shows only the things I changed: - - -``` -tmux_conf_theme_24b_colour=true -tmux_conf_theme_focused_pane_bg='default' -tmux_conf_theme_pane_border_style=fat -tmux_conf_theme_left_separator_main='\uE0B0' -tmux_conf_theme_left_separator_sub='\uE0B1' -tmux_conf_theme_right_separator_main='\uE0B2' -tmux_conf_theme_right_separator_sub='\uE0B3' -#tmux_conf_battery_bar_symbol_full='◼' -#tmux_conf_battery_bar_symbol_empty='◻' -tmux_conf_battery_bar_symbol_full='♥' -tmux_conf_battery_bar_symbol_empty='·' -tmux_conf_copy_to_os_clipboard=true -set -g mouse on -``` - -Note that you do not need to have Powerline installed—you just need a font that supports the Powerline symbols. I use [Hack Nerd Font][6] for almost everything console-related since it is easy for me to read and has many, many useful extra symbols. You'll also note that I turn on operating system clipboard support and mouse support. - -Now, when tmux starts up, the status bar at the bottom provides a bit more information—and in exciting colors. **Ctrl**+**b** is still the "leader" key for entering commands, but some others have changed. Splitting panes horizontally (top/bottom) is now **Ctrl**+**b**+**-** and vertically is now **Ctrl**+**b**+**_**. With mouse mode turned on, you can click to switch between the panes and drag the dividers to resize them. Opening a new window is still **Ctrl**+**b**+**n**, and you can now click on the window name on the bottom bar to switch between them. Also, **Ctrl**+**b**+**e** will open up the **.tmux.conf.local** file for editing. When you exit the editor, tmux will reload the configuration without reloading anything else. Very useful. - -So far, I've only made some simple changes to functionality and visual display and added mouse support. Now I'll set it up to launch the apps I want in a way that makes sense and without having to reposition and resize them every time. For that, I'll use [tmuxinator][7]. Tmuxinator is a launcher for tmux that allows you to specify and manage layouts and autostart applications with a YAML file. To use it, start tmux and create panes with the things you want running in them. Then, open a new window with **Ctrl**+**b**+**n**, and execute **tmux list-windows**. You will get detailed information about the layout. - -![tmux layout information][8] - -Note the first line in the code above where I set up four panes with an application in each one.** **Save the output from when you run it for later. Now, run **tmuxinator new 20days** to create a layout named **20days**. This will bring up a text editor with the default layout file. It has a lot of useful stuff in it, and I encourage you to read up on all the options. Start by putting in the layout information above and what apps you want where: - - -``` -# /Users/ksonney/.config/tmuxinator/20days.yml -name: 20days -root: ~/ -windows: -   - mail: -      layout: d9da,208x60,0,0[208x26,0,0{104x26,0,0,0,103x26,105,0,5},208x33,0,27{104x33,0,27,1,103x33,105,27,4}]] @0 -      panes: -        - alot -        - abook -        - ikhal -        - todo.sh ls +20days -``` - -Be careful with the spaces! Like Python code, the spaces and indentation matter to how the file is interpreted. Save the file and then run **tmuxinator 20days**. You should get four panes with the [alot][9] mail program, [abook][10], ikhal (a shortcut to [khal][11] interactive), and anything in [todo.txt][12] with the tag **+20days**. - -![sample layout launched by tmuxinator][13] - -You'll also notice that the window on the bottom bar is labeled Mail. You can click on the name (along with other named windows) to jump to that view. Nifty, right? I set up a second window named Social with [Tuir][14], [Newsboat][15], an IRC client connected to [BitlBee][16], and [Rainbow Stream][17] in the same file. - -Tmux is my productivity powerhouse for keeping track of all the things, and with tmuxinator, I don't have to worry about constantly resizing, placing, and launching my applications. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/tmux-console - -作者:[Kevin Sonney][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/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) -[2]: https://github.com/tmux/tmux -[3]: https://opensource.com/sites/default/files/uploads/productivity_15-1.png (tumux) -[4]: https://github.com/gpakosz/.tmux -[5]: https://github.com/powerline/powerline -[6]: https://www.nerdfonts.com/ -[7]: https://github.com/tmuxinator/tmuxinator -[8]: https://opensource.com/sites/default/files/uploads/productivity_15-2.png (tmux layout information) -[9]: https://opensource.com/article/20/1/organize-email-notmuch -[10]: https://opensource.com/article/20/1/sync-contacts-locally -[11]: https://opensource.com/article/20/1/open-source-calendar -[12]: https://opensource.com/article/20/1/open-source-to-do-list -[13]: https://opensource.com/sites/default/files/uploads/productivity_15-3.png (sample layout launched by tmuxinator) -[14]: https://opensource.com/article/20/1/open-source-reddit-client -[15]: https://opensource.com/article/20/1/open-source-rss-feed-reader -[16]: https://opensource.com/article/20/1/open-source-chat-tool -[17]: https://opensource.com/article/20/1/tweet-terminal-rainbow-stream diff --git a/translated/tech/20200125 Use tmux to create the console of your dreams.md b/translated/tech/20200125 Use tmux to create the console of your dreams.md new file mode 100644 index 0000000000..921067c583 --- /dev/null +++ b/translated/tech/20200125 Use tmux to create the console of your dreams.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use tmux to create the console of your dreams) +[#]: via: (https://opensource.com/article/20/1/tmux-console) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +使用 tmux 创建你的梦想主控台 +====== + +> 使用 tmux 可以做很多事情,尤其是在将 tmuxinator 添加到其中时。在我们的二十篇系列文章的第十五期中查看它们,以在 2020 年实现开源生产力的提高。 + +![Person drinking a hat drink at the computer][1] + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 使用 tmux 和 tmuxinator 全部放到主控台上 + +到目前为止,在本系列文章中,我已经撰写了有关单个应用程序和工具的文章。从今天开始,我将把它们放在一起进行全面设置以简化操作。让我们从命令行开始。为什么使用命令行?简而言之,在命令行上工作可以使我从能够运行 SSH 的任何位置访问许多这些工具和功能。我可以 SSH 进入我的一台个人计算机,并在工作计算机上运行与在我的个人计算机上使用的相同设置。我要使用的主要工具是 [tmux][2]。 + +大多数人都只使用了 tmux 非常基本的功能,例如在远程服务器上打开 tmux,然后启动进程,也许还会打开第二个会话以查看日志文件或调试信息,然后断开连接并在稍后返回。但是其实你可以使用 tmux 做很多工作。 + +![tmux][3] + +首先,如果你有一个现成的 tmux 配置文件,请对其进行备份。tmux 的配置文件是 `~/.tmux.conf`。将其移动到另一个目录,例如 `~/tmp`。 现在,用 Git 克隆 [Oh My Tmux][4] 项目。从该克隆中将 `.tmux.conf` 符号链接到家目录,并复制该克隆中的 `.tmux.conf.local` 文件到家目录以进行调整: + +``` +cd ~ +mkdir ~/tmp +mv ~/.tmux.conf ~/tmp/ +git clone https://github.com/gpakosz/.tmux.git +ln -s ~/.tmux/.tmux.conf ./ +cp ~/.tmux/.tmux.conf.local ./ +``` + +`.tmux.conf.local` 文件包含了本地设置和覆盖设置。例如,我稍微更改了默认颜色,然后启用了 [Powerline][5] 分隔线。下面的代码段仅显示我更改的内容: + +``` +tmux_conf_theme_24b_colour=true +tmux_conf_theme_focused_pane_bg='default' +tmux_conf_theme_pane_border_style=fat +tmux_conf_theme_left_separator_main='\uE0B0' +tmux_conf_theme_left_separator_sub='\uE0B1' +tmux_conf_theme_right_separator_main='\uE0B2' +tmux_conf_theme_right_separator_sub='\uE0B3' +#tmux_conf_battery_bar_symbol_full='◼' +#tmux_conf_battery_bar_symbol_empty='◻' +tmux_conf_battery_bar_symbol_full='♥' +tmux_conf_battery_bar_symbol_empty='·' +tmux_conf_copy_to_os_clipboard=true +set -g mouse on +``` + +请注意,你不需要安装 Powerline,你只需要支持 Powerline 符号的字体即可。我在与控制台相关的所有内容几乎都使用 [Hack Nerd Font][6],因为它易于阅读并且具有许多有用的额外符号。你还会注意到,我打开了操作系统剪贴板支持和鼠标支持。 + +现在,当 tmux 启动时,底部的状态栏会以吸引人的颜色提供更多信息。`Ctrl` + `b` 仍然是输入命令的 “引导” 键,但其他一些已更改。现在水平拆分(顶部/底部)窗格为 `Ctrl` + `b` + `-`,垂直拆分为 `Ctrl` + `b` + `_`。启用鼠标模式后,你可以单击以在窗格之间切换,并拖动分隔线以调整其大小。打开新窗口仍然是 `Ctrl` + `b` + `n`,你现在可以单击底部栏上的窗口名称在它们之间进行切换。同样,`Ctrl` + `b` + `e` 将打开 `.tmux.conf.local` 文件以进行编辑。退出编辑器时,tmux 将重新加载配置,而不重新加载其他任何内容。这很有用。 + +到目前为止,我仅对功能和视觉显示进行了一些简单的更改,并增加了鼠标支持。现在,我将它设置为以一种有意义的方式启动我想要的应用程序,而不必每次都重新定位和调整它们的大小。为此,我将使用 [tmuxinator][7]。tmuxinator 是 tmux 的启动器,它允许你指定和管理布局以及使用 YAML 文件自动启动应用程序。要使用它,请启动 tmux 并创建要在其中运行的东西的窗格。然后,使用 `Ctrl` + `b` + `n` 打开一个新窗口,并执行 `tmux list-windows`。你将获得有关布局的详细信息。 + +![tmux layout information][8] + +请注意上面代码中的第一行,我在其中设置了四个窗格,每个窗格中都有一个应用程序。保存运行时的输出以供以后使用。现在,运行 `tmuxinator new 20days` 以创建名为 “20days” 的布局。这将显示一个带有默认布局文件的文本编辑器。它包含很多有用的内容,我鼓励你阅读所有选项。首先输入上方的布局信息以及所需的应用程序: + +``` +# /Users/ksonney/.config/tmuxinator/20days.yml +name: 20days +root: ~/ +windows: + - mail: + layout: d9da,208x60,0,0[208x26,0,0{104x26,0,0,0,103x26,105,0,5},208x33,0,27{104x33,0,27,1,103x33,105,27,4}]] @0 + panes: + - alot + - abook + - ikhal + - todo.sh ls +20days +``` + +注意空格缩进!与 Python 代码一样,空格和缩进关系到文件的解释方式。保存该文件,然后运行 `tmuxinator 20days`。你应该会得到四个窗格,分别是 [alot][9] 邮件程序、[abook][10]、ikhal(交互式 [khal][11] 的快捷方式)以及 [todo.txt][12] 中带有 “+20days” 标签的任何内容。 + +![sample layout launched by tmuxinator][13] + +你还会注意到,底部栏上的窗口标记为 “Mail”。你可以单击名称(以及其他命名的窗口)以跳到该视图。漂亮吧?我在同一个文件中还设置了名为 “Social” 的第二个窗口,包括 [Tuir][14]、[Newsboat][15]、连接到 [BitlBee][16] 的 IRC 客户端和 [Rainbow Stream][17]。 + +tmux 是我跟踪所有事情的生产力动力之源,有了 tmuxinator,我不必在不断调整大小、放置和启动我的应用程序上费心。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/tmux-console + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[wxyD](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) +[2]: https://github.com/tmux/tmux +[3]: https://opensource.com/sites/default/files/uploads/productivity_15-1.png (tumux) +[4]: https://github.com/gpakosz/.tmux +[5]: https://github.com/powerline/powerline +[6]: https://www.nerdfonts.com/ +[7]: https://github.com/tmuxinator/tmuxinator +[8]: https://opensource.com/sites/default/files/uploads/productivity_15-2.png (tmux layout information) +[9]: https://opensource.com/article/20/1/organize-email-notmuch +[10]: https://opensource.com/article/20/1/sync-contacts-locally +[11]: https://opensource.com/article/20/1/open-source-calendar +[12]: https://opensource.com/article/20/1/open-source-to-do-list +[13]: https://opensource.com/sites/default/files/uploads/productivity_15-3.png (sample layout launched by tmuxinator) +[14]: https://opensource.com/article/20/1/open-source-reddit-client +[15]: https://opensource.com/article/20/1/open-source-rss-feed-reader +[16]: https://opensource.com/article/20/1/open-source-chat-tool +[17]: https://opensource.com/article/20/1/tweet-terminal-rainbow-stream From 353fbc6195c405af713615b95c1de56064232b3a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Feb 2020 21:32:52 +0800 Subject: [PATCH 040/315] PRF @HankChow --- ...00123 How to stop typosquatting attacks.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/translated/tech/20200123 How to stop typosquatting attacks.md b/translated/tech/20200123 How to stop typosquatting attacks.md index 4f51c8ec3b..953a0f6213 100644 --- a/translated/tech/20200123 How to stop typosquatting attacks.md +++ b/translated/tech/20200123 How to stop typosquatting attacks.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to stop typosquatting attacks) @@ -9,12 +9,14 @@ 如何防范误植攻击 ====== + > 误植Typosquatting是一种引诱用户将敏感数据泄露给不法分子的方式,针对这种攻击方式,我们很有必要了解如何保护我们的组织、我们的开源项目以及我们自己。 + ![Gears above purple clouds][1] -除了常规手段以外,不法分子还会利用社会工程的方式,试图让安全意识较弱的人泄露私人信息或是有价值的证书。很多[网络钓鱼骗局][2]的实质都是攻击者伪装成信誉良好的公司或组织,然后借此大规模分发病毒或恶意软件。 +除了常规手段以外,网络罪犯还会利用社会工程的方式,试图让安全意识较弱的人泄露私人信息或是有价值的证书。很多[网络钓鱼骗局][2]的实质都是攻击者伪装成信誉良好的公司或组织,然后借此大规模传播病毒或恶意软件。 -[误植][3]就是其中一个常用的手法。它是一种社会工程学的攻击方式,通过使用一些合法网站的错误拼写 URL 以引诱用户访问恶意网站,这样的做法既使真正的原网站遭受声誉上的损害,又诱使用户向这些恶意网站提交个人敏感信息。因此,网站的管理人员和用户双方都应该意识到这个问题带来的风险,并采取措施加以保护。 +[误植][3]Typosquatting就是其中一个常用的手法。它是一种社会工程学的攻击方式,通过使用一些合法网站的错误拼写的 URL 以引诱用户访问恶意网站,这样的做法既使真正的原网站遭受声誉上的损害,又诱使用户向这些恶意网站提交个人敏感信息。因此,网站的管理人员和用户双方都应该意识到这个问题带来的风险,并采取措施加以保护。 一些由广大开发者在公共代码库中维护的开源软件通常都被认为具有安全上的优势,但当面临社会工程学攻击或恶意软件植入时,开源软件也需要注意以免受到伤害。 @@ -22,9 +24,9 @@ ### 什么是误植? -误植是一种具体的网络犯罪手段,其背后通常是一个网络钓鱼骗局。不法分子首先会购买注册域名,而他们注册的域名通常是一个常用网站的错误拼写形式,例如在正确拼写的基础上添加一个额外的元音字母,又或者是将字母“i”替换成字母“l”。对于同一个正常域名,不法分子通常会注册数十个拼写错误的变体域名。 +误植是一种非常特殊的网络犯罪形式,其背后通常是一个更大的网络钓鱼骗局。不法分子首先会购买和注册域名,而他们注册的域名通常是一个常用网站的错误拼写形式,例如在正确拼写的基础上添加一个额外的元音字母,又或者是将字母“i”替换成字母“l”。对于同一个正常域名,不法分子通常会注册数十个拼写错误的变体域名。 -用户一旦访问这样的域名,不法分子的目的就已经成功了一半。为此,他们会通过电子邮件的方式,诱导用户访问这样的伪造域名。伪造域名指向的页面中,通常都带有一个简单的登录界面,还会附上被模仿的网站的 logo,尽可能让用户认为自己访问的是正确的网站。 +用户一旦访问这样的域名,不法分子的目的就已经成功了一半。为此,他们会通过电子邮件的方式,诱导用户访问这样的伪造域名。伪造域名指向的页面中,通常都带有一个简单的登录界面,还会附上熟悉的被模仿网站的徽标,尽可能让用户认为自己访问的是真实的网站。 如果用户没有识破这一个骗局,在页面中提交了诸如银行卡号、用户名、密码等敏感信息,这些数据就会被不法分子所完全掌控。进一步来看,如果这个用户在其它网站也使用了相同的用户名和密码,那就有同样受到波及的风险。受害者最终可能会面临身份被盗、信用记录被破坏等危险。 @@ -34,11 +36,11 @@ 在几年之前就发生过[一起案件][4],很多健康保险客户收到了一封指向 we11point.com 的钓鱼电子邮件,其中 URL 里正确的字母“l”被换成了数字“1”,从而导致一批用户成为了这一次攻击的受害者。 -最初,特定国家的顶级域名是不允许随意注册的。但后来国际域名规则中放开这一限制之后,又兴起了一波新的误植攻击。例如最常见的一种手法就是注册一个与 .com 域名类似的 .om 域名,一旦在输入 URL 时不慎遗漏了字母 c 就会给不法分子带来可乘之机。 +最初,与特定国家/地区相关的顶级域名是不允许随意注册的。但后来国际域名规则中放开这一限制之后,又兴起了一波新的误植攻击。例如最常见的一种手法就是注册一个与 .com 域名类似的 .om 域名,一旦在输入 URL 时不慎遗漏了字母 c 就会给不法分子带来可乘之机。 ### 网站如何防范误植攻击 -对于一个公司来说,最好的策略就是永远比误植攻击采取早一手的行动。 +对于一个公司来说,最好的策略就是永远比误植攻击采取早一步的行动。 也就是说,在注册域名的时候,不仅要注册自己商标名称的域名,最好还要同时注册可能由于拼写错误产生的其它域名。当然,没有太大必要把可能导致错误的所有顶级域名都注册掉,但至少要把可能导致错误的一些一级域名抢注下来。 @@ -46,7 +48,7 @@ 你可以使用类似 [DNS Twist][5] 的开源工具来扫描公司正在使用的域名,它可以确定是否有相似的域名已被注册,从而暴露潜在的误植攻击。DNS Twist 可以在 Linux 系统上通过一系列的 shell 命令来运行。 -还有一些网络提供商会将防护误植攻击作为他们网络产品的一部分。这就相当于一层额外的保护,如果用户不慎输入了带有拼写错误的 URL,就会被提示该页面已经被阻止并重定向到正确的域名。 +还有一些网络提供商(ISP)会将防护误植攻击作为他们网络产品的一部分。这就相当于一层额外的保护,如果用户不慎输入了带有拼写错误的 URL,就会被提示该页面已经被阻止并重定向到正确的域名。 如果你是系统管理员,还可以考虑运行一个自建的 [DNS 服务器][6],以便通过黑名单的机制禁止对某些域名的访问。 @@ -58,29 +60,27 @@ 因为开源项目的源代码是公开的,所以其中大部分项目都会进行安全和渗透测试。但错误是不可能完全避免的,如果你参与了开源项目,还是有需要注意的地方。 -当你收到一个不明来源的合并请求Merge Request或补丁时,必须在合并之前仔细检查,尤其是相关代码涉及到网络层面的时候。一定要进行严格的检查和测试,以确保没有恶意代码混入正常的代码当中。 +当你收到一个不明来源的合并请求Merge Request或补丁时,必须在合并之前仔细检查,尤其是相关代码涉及到网络层面的时候。不要屈服于只测试构建的诱惑; 一定要进行严格的检查和测试,以确保没有恶意代码混入正常的代码当中。 同时,还要严格按照正确的方法使用域名,避免不法分子创建仿冒的下载站点并提供带有恶意代码的软件。可以通过如下所示的方法使用数字签名来确保你的软件没有被篡改: - ``` gpg --armor --detach-sig \ -\--output advent-gnome.sig \ -example-0.0.1.tar.xz + --output advent-gnome.sig \ + example-0.0.1.tar.xz ``` 同时给出你提供的文件的校验和: - ``` -`sha256sum example-0.0.1.tar.xz > example-0.0.1.txt` +sha256sum example-0.0.1.tar.xz > example-0.0.1.txt ``` 无论你的用户会不会去用上这些安全措施,你也应该提供这些必要的信息。因为只要有那么一个人留意到签名有异样,就能为你敲响警钟。 ### 总结 -人类犯错在所难免。世界上数百万人输入同一个,总会有人出现拼写的错误。不法分子也正是抓住了这个漏洞才得以实施误植攻击。 +人类犯错在所难免。世界上数百万人输入同一个网址时,总会有人出现拼写的错误。不法分子也正是抓住了这个漏洞才得以实施误植攻击。 用抢注域名的方式去完全根治误植攻击也是不太现实的,我们更应该关注这种攻击的传播方式以减轻它对我们的影响。最好的保护就是和用户之间建立信任,并积极检测误植攻击的潜在风险。作为开源社区,我们更应该团结起来一起应对误植攻击。 @@ -91,7 +91,7 @@ via: https://opensource.com/article/20/1/stop-typosquatting-attacks 作者:[Sam Bocetta][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5caf652c9fd43da98209276e4eb227b336a53477 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Feb 2020 21:33:30 +0800 Subject: [PATCH 041/315] PUB @HankChow https://linux.cn/article-11899-1.html --- .../20200123 How to stop typosquatting attacks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200123 How to stop typosquatting attacks.md (99%) diff --git a/translated/tech/20200123 How to stop typosquatting attacks.md b/published/20200123 How to stop typosquatting attacks.md similarity index 99% rename from translated/tech/20200123 How to stop typosquatting attacks.md rename to published/20200123 How to stop typosquatting attacks.md index 953a0f6213..728bf29f50 100644 --- a/translated/tech/20200123 How to stop typosquatting attacks.md +++ b/published/20200123 How to stop typosquatting attacks.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11899-1.html) [#]: subject: (How to stop typosquatting attacks) [#]: via: (https://opensource.com/article/20/1/stop-typosquatting-attacks) [#]: author: (Sam Bocetta https://opensource.com/users/sambocetta) From ccdfbb1cc55a921545a1f60fade0e4766acca741 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Feb 2020 22:08:48 +0800 Subject: [PATCH 042/315] PRF @wxy --- ...ux to create the console of your dreams.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/tech/20200125 Use tmux to create the console of your dreams.md b/translated/tech/20200125 Use tmux to create the console of your dreams.md index 921067c583..065abac118 100644 --- a/translated/tech/20200125 Use tmux to create the console of your dreams.md +++ b/translated/tech/20200125 Use tmux to create the console of your dreams.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Use tmux to create the console of your dreams) @@ -12,19 +12,19 @@ > 使用 tmux 可以做很多事情,尤其是在将 tmuxinator 添加到其中时。在我们的二十篇系列文章的第十五期中查看它们,以在 2020 年实现开源生产力的提高。 -![Person drinking a hat drink at the computer][1] +![](https://img.linux.net.cn/data/attachment/album/202002/16/220832bd4l1ag4tlqxlpr4.jpg) 去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 ### 使用 tmux 和 tmuxinator 全部放到主控台上 -到目前为止,在本系列文章中,我已经撰写了有关单个应用程序和工具的文章。从今天开始,我将把它们放在一起进行全面设置以简化操作。让我们从命令行开始。为什么使用命令行?简而言之,在命令行上工作可以使我从能够运行 SSH 的任何位置访问许多这些工具和功能。我可以 SSH 进入我的一台个人计算机,并在工作计算机上运行与在我的个人计算机上使用的相同设置。我要使用的主要工具是 [tmux][2]。 +到目前为止,在本系列文章中,我已经撰写了有关单个应用程序和工具的文章。从今天开始,我将把它们放在一起进行全面设置以简化操作。让我们从命令行开始。为什么使用命令行?简而言之,在命令行上工作可以使我能够从运行 SSH 的任何位置访问许多这些工具和功能。我可以 SSH 进入我的一台个人计算机,并在工作计算机上运行与我的个人计算机上所使用的相同设置。我要使用的主要工具是 [tmux][2]。 -大多数人都只使用了 tmux 非常基本的功能,例如在远程服务器上打开 tmux,然后启动进程,也许还会打开第二个会话以查看日志文件或调试信息,然后断开连接并在稍后返回。但是其实你可以使用 tmux 做很多工作。 +大多数人都只使用了 tmux 非常基础的功能,比如说在远程服务器上打开 tmux,然后启动进程,也许还会打开第二个会话以查看日志文件或调试信息,然后断开连接并在稍后返回。但是其实你可以使用 tmux 做很多工作。 ![tmux][3] -首先,如果你有一个现成的 tmux 配置文件,请对其进行备份。tmux 的配置文件是 `~/.tmux.conf`。将其移动到另一个目录,例如 `~/tmp`。 现在,用 Git 克隆 [Oh My Tmux][4] 项目。从该克隆中将 `.tmux.conf` 符号链接到家目录,并复制该克隆中的 `.tmux.conf.local` 文件到家目录以进行调整: +首先,如果你有一个已有的 tmux 配置文件,请对其进行备份。tmux 的配置文件是 `~/.tmux.conf`。将其移动到另一个目录,例如 `~/tmp`。现在,用 Git 克隆 [Oh My Tmux][4] 项目。从该克隆目录中将 `.tmux.conf` 符号链接到你的家目录,并复制该克隆目录中的 `.tmux.conf.local` 文件到家目录中以进行调整: ``` cd ~ @@ -35,7 +35,7 @@ ln -s ~/.tmux/.tmux.conf ./ cp ~/.tmux/.tmux.conf.local ./ ``` -`.tmux.conf.local` 文件包含了本地设置和覆盖设置。例如,我稍微更改了默认颜色,然后启用了 [Powerline][5] 分隔线。下面的代码段仅显示我更改的内容: +`.tmux.conf.local` 文件包含了本地设置和覆盖的设置。例如,我稍微更改了默认颜色,然后启用了 [Powerline][5] 分隔线。下面的代码段仅显示了我更改过的内容: ``` tmux_conf_theme_24b_colour=true @@ -53,15 +53,15 @@ tmux_conf_copy_to_os_clipboard=true set -g mouse on ``` -请注意,你不需要安装 Powerline,你只需要支持 Powerline 符号的字体即可。我在与控制台相关的所有内容几乎都使用 [Hack Nerd Font][6],因为它易于阅读并且具有许多有用的额外符号。你还会注意到,我打开了操作系统剪贴板支持和鼠标支持。 +请注意,你不需要安装 Powerline,你只需要支持 Powerline 符号的字体即可。我在与控制台相关的所有内容中几乎都使用 [Hack Nerd Font][6],因为它易于阅读并且具有许多有用的额外符号。你还会注意到,我打开了操作系统剪贴板支持和鼠标支持。 -现在,当 tmux 启动时,底部的状态栏会以吸引人的颜色提供更多信息。`Ctrl` + `b` 仍然是输入命令的 “引导” 键,但其他一些已更改。现在水平拆分(顶部/底部)窗格为 `Ctrl` + `b` + `-`,垂直拆分为 `Ctrl` + `b` + `_`。启用鼠标模式后,你可以单击以在窗格之间切换,并拖动分隔线以调整其大小。打开新窗口仍然是 `Ctrl` + `b` + `n`,你现在可以单击底部栏上的窗口名称在它们之间进行切换。同样,`Ctrl` + `b` + `e` 将打开 `.tmux.conf.local` 文件以进行编辑。退出编辑器时,tmux 将重新加载配置,而不重新加载其他任何内容。这很有用。 +现在,当 tmux 启动时,底部的状态栏会以吸引人的颜色提供更多信息。`Ctrl` + `b` 仍然是输入命令的 “引导” 键,但其他一些进行了更改。现在水平拆分(顶部/底部)窗格为 `Ctrl` + `b` + `-`,垂直拆分为 `Ctrl` + `b` + `_`。启用鼠标模式后,你可以单击以在窗格之间切换,并拖动分隔线以调整其大小。打开新窗口仍然是 `Ctrl` + `b` + `n`,你现在可以单击底部栏上的窗口名称在它们之间进行切换。同样,`Ctrl` + `b` + `e` 将打开 `.tmux.conf.local` 文件以进行编辑。退出编辑器时,tmux 将重新加载配置,而不会重新加载其他任何内容。这很有用。 -到目前为止,我仅对功能和视觉显示进行了一些简单的更改,并增加了鼠标支持。现在,我将它设置为以一种有意义的方式启动我想要的应用程序,而不必每次都重新定位和调整它们的大小。为此,我将使用 [tmuxinator][7]。tmuxinator 是 tmux 的启动器,它允许你指定和管理布局以及使用 YAML 文件自动启动应用程序。要使用它,请启动 tmux 并创建要在其中运行的东西的窗格。然后,使用 `Ctrl` + `b` + `n` 打开一个新窗口,并执行 `tmux list-windows`。你将获得有关布局的详细信息。 +到目前为止,我仅对功能和视觉显示进行了一些简单的更改,并增加了鼠标支持。现在,我将它设置为以一种有意义的方式启动我想要的应用程序,而不必每次都重新定位和调整它们的大小。为此,我将使用 [tmuxinator][7]。tmuxinator 是 tmux 的启动器,它允许你指定和管理布局以及使用 YAML 文件自动启动应用程序。要使用它,请启动 tmux 并创建要在其中运行程序的窗格。然后,使用 `Ctrl` + `b` + `n` 打开一个新窗口,并执行 `tmux list-windows`。你将获得有关布局的详细信息。 ![tmux layout information][8] -请注意上面代码中的第一行,我在其中设置了四个窗格,每个窗格中都有一个应用程序。保存运行时的输出以供以后使用。现在,运行 `tmuxinator new 20days` 以创建名为 “20days” 的布局。这将显示一个带有默认布局文件的文本编辑器。它包含很多有用的内容,我鼓励你阅读所有选项。首先输入上方的布局信息以及所需的应用程序: +请注意上面代码中的第一行,我在其中设置了四个窗格,每个窗格中都有一个应用程序。保存运行时的输出以供以后使用。现在,运行 `tmuxinator new 20days` 以创建名为 “20days” 的布局。这将显示一个带有默认布局文件的文本编辑器。它包含很多有用的内容,我建议你阅读所有选项。首先输入上方的布局信息以及所需的应用程序: ``` # /Users/ksonney/.config/tmuxinator/20days.yml @@ -81,7 +81,7 @@ windows: ![sample layout launched by tmuxinator][13] -你还会注意到,底部栏上的窗口标记为 “Mail”。你可以单击名称(以及其他命名的窗口)以跳到该视图。漂亮吧?我在同一个文件中还设置了名为 “Social” 的第二个窗口,包括 [Tuir][14]、[Newsboat][15]、连接到 [BitlBee][16] 的 IRC 客户端和 [Rainbow Stream][17]。 +你还会注意到,底部栏上的窗口标记为 “Mail”。你可以单击该名称(以及其他命名的窗口)以跳到该视图。漂亮吧?我在同一个文件中还设置了名为 “Social” 的第二个窗口,包括 [Tuir][14]、[Newsboat][15]、连接到 [BitlBee][16] 的 IRC 客户端和 [Rainbow Stream][17]。 tmux 是我跟踪所有事情的生产力动力之源,有了 tmuxinator,我不必在不断调整大小、放置和启动我的应用程序上费心。 @@ -91,8 +91,8 @@ via: https://opensource.com/article/20/1/tmux-console 作者:[Kevin Sonney][a] 选题:[lujun9972][b] -译者:[wxyD](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9ec1229299171343e90b8fc62fba8f9cdc2b07cf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 16 Feb 2020 22:10:07 +0800 Subject: [PATCH 043/315] PUB @wxy https://linux.cn/article-11900-1.html --- .../20200125 Use tmux to create the console of your dreams.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200125 Use tmux to create the console of your dreams.md (99%) diff --git a/translated/tech/20200125 Use tmux to create the console of your dreams.md b/published/20200125 Use tmux to create the console of your dreams.md similarity index 99% rename from translated/tech/20200125 Use tmux to create the console of your dreams.md rename to published/20200125 Use tmux to create the console of your dreams.md index 065abac118..9e1d32dbd3 100644 --- a/translated/tech/20200125 Use tmux to create the console of your dreams.md +++ b/published/20200125 Use tmux to create the console of your dreams.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11900-1.html) [#]: subject: (Use tmux to create the console of your dreams) [#]: via: (https://opensource.com/article/20/1/tmux-console) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From 32e20fd78f222c39a32b89164b657cc3c7f32f23 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 17 Feb 2020 09:03:21 +0800 Subject: [PATCH 044/315] translating --- ... Modern Looking Open Source XMPP Client.md | 104 ----------------- ... Modern Looking Open Source XMPP Client.md | 105 ++++++++++++++++++ 2 files changed, 105 insertions(+), 104 deletions(-) delete mode 100644 sources/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md create mode 100644 translated/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md diff --git a/sources/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md b/sources/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md deleted file mode 100644 index 8d8ad04a69..0000000000 --- a/sources/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md +++ /dev/null @@ -1,104 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Dino is a Modern Looking Open Source XMPP Client) -[#]: via: (https://itsfoss.com/dino-xmpp-client/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Dino is a Modern Looking Open Source XMPP Client -====== - -_**Brief: Dino is a relatively new open-source XMPP client that tries to offer a good user experience while encouraging privacy-focused users to utilize XMPP for messaging.**_ - -### Dino: An Open Source XMPP Client - -![][1] - -[XMPP][2] (Extensible Messaging Presence Protocol) is a decentralized model of network to facilitate instant messaging and collaboration. Decentralize means there is no central server that has access to your data. The communication is directly between the end-points. - -Some of us might call it an “old school” tech probably because the XMPP clients usually have a very bad user experience or simply just because it takes time to get used to (or set it up). - -That’s when [Dino][3] comes to the rescue as a modern XMPP client to provide a clean and snappy user experience without compromising your privacy. - -### The User Experience - -![][4] - -Dino does try to improve the user experience as an XMPP client but it is worth noting that the look and feel of it will depend on your Linux distribution to some extent. Your icon theme or the gnome theme might make it look better or worse for your personal experience. - -Technically, the user interface is quite simple and easy to use. So, I suggest you take a look at some of the [best icon themes][5] and [GNOME themes][6] for Ubuntu to tweak the look of Dino. - -### Features of Dino - -![Dino Screenshot][7] - -You can expect to use Dino as an alternative to Slack, [Signal][8] or [Wire][9] for your business or personal usage. - -It offers all of the essential features you would need in a messaging application, let us take a look at a list of things that you can expect from it: - - * Decentralized Communication - * Public XMPP Servers supported if you cannot setup your own server - * Similar to UI to other popular messengers – so it’s easy to use - * Image & File sharing - * Multiple accounts supported - * Advanced message search - * [OpenPGP][10] & [OMEMO][11] encryption supported - * Lightweight native desktop application - - - -### Installing Dino on Linux - -You may or may not find it listed in your software center. Dino does provide ready to use binaries for Debian (deb) and Fedora (rpm) based distributions. - -**For Ubuntu:** - -Dino is available in the universe repository on Ubuntu and you can install it using this command: - -``` -sudo apt install dino-im -``` - -Similarly, you can find packages for other Linux distributions on their [GitHub distribution packages page][12]. - -If you want the latest and greatest, you can also find both **.deb** and .**rpm** files for Dino to install on your Linux distribution (nightly builds) from [OpenSUSE’s software webpage][13]. - -In either case, head to their [GitHub page][14] or click on the link below to visit the official site. - -[Download Dino][3] - -**Wrapping Up** - -It works quite well without any issues (at the time of writing this and quick testing it). I’ll try exploring more about it and hopefully cover more XMPP-centric articles to encourage users to use XMPP clients and servers for communication. - -What do you think about Dino? Would you recommend another open-source XMPP client that’s potentially better than Dino? Let me know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/dino-xmpp-client/ - -作者:[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://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/dino-main.png?ssl=1 -[2]: https://xmpp.org/about/ -[3]: https://dino.im/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/dino-xmpp-client.jpg?ssl=1 -[5]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ -[6]: https://itsfoss.com/best-gtk-themes/ -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/dino-screenshot.png?ssl=1 -[8]: https://itsfoss.com/signal-messaging-app/ -[9]: https://itsfoss.com/wire-messaging-linux/ -[10]: https://www.openpgp.org/ -[11]: https://en.wikipedia.org/wiki/OMEMO -[12]: https://github.com/dino/dino/wiki/Distribution-Packages -[13]: https://software.opensuse.org/download.html?project=network:messaging:xmpp:dino&package=dino -[14]: https://github.com/dino/dino diff --git a/translated/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md b/translated/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md new file mode 100644 index 0000000000..3985d1a415 --- /dev/null +++ b/translated/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Dino is a Modern Looking Open Source XMPP Client) +[#]: via: (https://itsfoss.com/dino-xmpp-client/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Dino 是一个有着现代外观的开源 XMPP 客户端 +====== + +_**简介:Dino 是一个相对较新的开源 XMPP 客户端,它尝试提供良好的用户体验,同时鼓励注重隐私的用户使用 XMPP 发送消息。**_ + +### Dino:一个开源 XMPP 客户端 + +![][1] + +[XMPP][2] (可扩展通讯和表示协议) 是一个去中心化的网络模型,可促进即时消息传递和协作。去中心化意味着没有中央服务器可以访问你的数据。通信直接点对点。 + +我们中的一些人可能会称它为"老派"技术,可能是因为 XMPP 客户端通常有着非常糟糕的用户体验,或者仅仅是因为它需要时间来适应(或设置它)。 + +这时候 [Dino[3] 作为现代 XMPP 客户端出现了,在不损害你的隐私的情况下提供干净清爽的用户体验。 + +### 用户体验 + +![][4] + +Dino 有试图改善 XMPP 客户端的用户体验,但值得注意的是,它的外观和感受将在一定程度上取决于你的 Linux 发行版。你的图标主题或 Gnome 主题会让你的个人体验更好或更糟。 + +从技术上讲,它的用户界面非常简单,易于使用。所以,我建议你看下 Ubuntu 中的[最佳图标主题][5]和 [GNOME 主题][6]来调整 Dino 的外观。 + +### Dino 的特性 + +![Dino Screenshot][7] + +你可以期望将 Dino 用作 Slack、[Signal][8] 或 [Wire][9] 的替代产品,来用于你的业务或个人用途。 + +它提供了消息应用所需的所有基本特性,让我们看下你可以从中得到的: + +* 去中心化通信 +* 如果无法设置自己的服务器,它支持公共 XMPP 的服务器 +* 和其他流行消息应用相似的 UI,因此易于使用 +* 图像和文件共享 +* 支持多个帐户 +* 高级消息搜索 +* 支持 [OpenPGP][10] 和 [OMEMO][11] 加密 +* 轻量级原生桌面应用 + + + +### 在 Linux 上安装 Dino + +你可能会发现它列在你的软件中心中,也可能未找到。Dino 为基于 Debian(deb)和 Fedora(rpm)的发行版提供了可用的二进制文件。 + +**对于 Ubuntu:** + +Dino 在 Ubuntu 的 universe 仓库中,你可以使用以下命令安装它: + +``` +sudo apt install dino-im +``` + +类似地,你可以在 [GitHub 分发包页面][12]上找到其他 Linux 发行版的包。 + +如果你想要获取最新的,你可以在 [OpenSUSE 的软件页面][13]找到 Dino 的 **.deb** 和 .**rpm** (每日构建版)安装在 Linux 中。 + +在任何一种情况下,前往它的 [Github 页面][14]或点击下面的链接访问官方网站。 + +[下载 Dino][3] + +**总结** + +它工作良好没有出过任何问题(在我编写这篇文章时快速测试过它)。我将尝试探索更多,并希望能涵盖更多有关 XMPP 的文章来鼓励用户使用 XMPP 的客户端和服务器用于通信。 + +你觉得 Dino 怎么样?你会推荐另一个可能好于 Dino 的开源 XMPP 客户端吗?在下面的评论中让我知道你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/dino-xmpp-client/ + +作者:[Ankush Das][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://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/dino-main.png?ssl=1 +[2]: https://xmpp.org/about/ +[3]: https://dino.im/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/dino-xmpp-client.jpg?ssl=1 +[5]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ +[6]: https://itsfoss.com/best-gtk-themes/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/dino-screenshot.png?ssl=1 +[8]: https://itsfoss.com/signal-messaging-app/ +[9]: https://itsfoss.com/wire-messaging-linux/ +[10]: https://www.openpgp.org/ +[11]: https://en.wikipedia.org/wiki/OMEMO +[12]: https://github.com/dino/dino/wiki/Distribution-Packages +[13]: https://software.opensuse.org/download.html?project=network:messaging:xmpp:dino&package=dino +[14]: https://github.com/dino/dino + From 961a3696e7a9980c563622a0a5d19397f37c56d2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 17 Feb 2020 09:15:24 +0800 Subject: [PATCH 045/315] translating --- ...creenshot your Linux system configuration with Bash tools.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200122 Screenshot your Linux system configuration with Bash tools.md b/sources/tech/20200122 Screenshot your Linux system configuration with Bash tools.md index 325b3aa019..f1e1c29029 100644 --- a/sources/tech/20200122 Screenshot your Linux system configuration with Bash tools.md +++ b/sources/tech/20200122 Screenshot your Linux system configuration with Bash tools.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3ee44fde210e7c60cb147020e5de5a765da09c5c Mon Sep 17 00:00:00 2001 From: guevaraya Date: Mon, 17 Feb 2020 10:15:53 +0800 Subject: [PATCH 046/315] Update and rename sources/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md to translated/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md --- ...etes with the power of tmux and kubectl.md | 169 ------------------ ...etes with the power of tmux and kubectl.md | 161 +++++++++++++++++ 2 files changed, 161 insertions(+), 169 deletions(-) delete mode 100644 sources/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md create mode 100644 translated/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md diff --git a/sources/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md b/sources/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md deleted file mode 100644 index b9480960e6..0000000000 --- a/sources/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md +++ /dev/null @@ -1,169 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( guevaraya) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Troubleshoot Kubernetes with the power of tmux and kubectl) -[#]: via: (https://opensource.com/article/20/2/kubernetes-tmux-kubectl) -[#]: author: (Abhishek Tamrakar https://opensource.com/users/tamrakar) - -Troubleshoot Kubernetes with the power of tmux and kubectl -====== -A kubectl plugin that uses tmux to make troubleshooting Kubernetes much -simpler. -![Woman sitting in front of her laptop][1] - -[Kubernetes][2] is a thriving open source container orchestration platform that offers scalability, high availability, robustness, and resiliency for applications. One of its many features is support for running custom scripts or binaries through its primary client binary, [kubectl][3]. Kubectl is very powerful and allows users to do anything with it that they could do directly on a Kubernetes cluster. - -### Troubleshooting Kubernetes with aliases - -Anyone who uses Kubernetes for container orchestration is aware of its features—as well as the complexity it brings because of its design. For example, there is an urgent need to simplify troubleshooting in Kubernetes with something that is quicker and has little need for manual intervention (except in critical situations). - -There are many scenarios to consider when it comes to troubleshooting functionality. In one scenario, you know what you need to run, but the command's syntax—even when it can run as a single command—is excessively complex, or it may need one or two inputs to work. - -For example, if you frequently need to jump into a running container in the System namespace, you may find yourself repeatedly writing: - - -``` -`kubectl --namespace=kube-system exec -i -t ` -``` - -To simplify troubleshooting, you could use command-line aliases of these commands. For example, you could add the following to your dotfiles (.bashrc or .zshrc): - - -``` -`alias ksysex='kubectl --namespace=kube-system exec -i -t'` -``` - -This is one of many examples from a [repository of common Kubernetes aliases][4] that shows one way to simplify functions in kubectl. For something simple like this scenario, an alias is sufficient. - -### Switching to a kubectl plugin - -A more complex troubleshooting scenario involves the need to run many commands, one after the other, to investigate an environment and come to a conclusion. Aliases alone are not sufficient for this use - -case; you need repeatable logic and correlations between the many parts of your Kubernetes deployment. What you really need is automation to deliver the desired output in less time. - -Consider 10 to 20—or even 50 to 100—namespaces holding different microservices on your cluster. What would be helpful for you to start troubleshooting this scenario? - - * You would need something that can quickly tell which pod in which namespace is throwing errors. - * You would need something that can watch logs of all the pods in a namespace. - * You might also need to watch logs of certain pods in a specific namespace that have shown errors. - - - -Any solution that covers these points would be very useful in investigating production issues as well as during development and testing cycles. - -To create something more powerful than a simple alias, you can use [kubectl plugins][5]. Plugins are like standalone scripts written in any scripting language but are designed to extend the functionality of your main command when serving as a Kubernetes admin. - -To create a plugin, you must use the proper syntax of **kubectl-<your-plugin-name>** to copy the script to one of the exported pathways in your **$PATH** and give it executable permissions (**chmod +x**). - -After creating a plugin and moving it into your path, you can run it immediately. For example, I have kubectl-krawl and kubectl-kmux in my path: - - -``` -$ kubectl plugin list -The following compatible plugins are available: - -/usr/local/bin/kubectl-krawl -/usr/local/bin/kubectl-kmux - -$ kubectl kmux -``` - -Now let's explore what this looks like when you power Kubernetes with tmux. - -### Harnessing the power of tmux - -[Tmux][6] is a very powerful tool that many sysadmins and ops teams rely on to troubleshoot issues related to ease of operability—from splitting windows into panes for running parallel debugging on multiple machines to monitoring logs. One of its major advantages is that it can be used on the command line or in automation scripts. - -I created [a kubectl plugin][7] that uses tmux to make troubleshooting much simpler. I will use annotations to walk through the logic behind the plugin (and leave it for you to go through the plugin's full code): - - -``` -#NAMESPACE is namespace to monitor. -#POD is pod name -#Containers is container names - -# initialize a counter n to count the number of loop counts, later be used by tmux to split panes. -n=0; - -# start a loop on a list of pod and containers -while IFS=' ' read -r POD CONTAINERS -do - -           # tmux create the new window for each pod -            tmux neww $COMMAND -n $POD 2>/dev/null - -           # start a loop for all containers inside a running pod -        for CONTAINER in ${CONTAINERS//,/ } -        do - -        if [ x$POD = x -o x$CONTAINER = x ]; then -        # if any of the values is null, exit. -        warn "Looks like there is a problem getting pods data." -        break -        fi -            -            # set the command to execute -        COMMAND=”kubectl logs -f $POD -c $CONTAINER -n $NAMESPACE” -        # check tmux session -        if tmux has-session -t <session name> 2>/dev/null; -        then -        <set session exists> -        else -        <create session> -        fi - -           # split planes in the current window for each containers -        tmux selectp -t $n \; \ -        splitw $COMMAND \; \ -        select-layout tiled \; - -           # end loop for containers -        done - -           # rename the window to identify by pod name -        tmux renamew $POD 2>/dev/null -        -            # increment the counter -        ((n+=1)) - -# end loop for pods -done< <(<fetch list of pod and containers from kubernetes cluster>) - -# finally select the window and attach session - tmux selectw -t <session name>:1 \; \ -  attach-session -t <session name>\; -``` - -After the plugin script runs, it will produce output similar to the image below. Each pod has its own window, and each container (if there is more than one) is split by the panes in its pod window, streaming logs as they arrive. The beauty of tmux can be seen below; with the proper configuration, you can even see which window has activity going on (see the white tabs). - -![Output of kmux plugin][8] - -### Conclusion - -Aliases are always helpful for simple troubleshooting in Kubernetes environments. When the environment gets more complex, a kubectl plugin is a powerful option for using more advanced scripting. There are no limits on which programming language you can use to write kubectl plugins. The only requirements are that the naming convention in the path is executable, and it doesn't have the same name as an existing kubectl command. - -To read the complete code or try the plugins I created, check my [kube-plugins-github][7] repository. Issues and pull requests are welcome. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/kubernetes-tmux-kubectl - -作者:[Abhishek Tamrakar][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/tamrakar -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_4.png?itok=VGZO8CxT (Woman sitting in front of her laptop) -[2]: https://opensource.com/resources/what-is-kubernetes -[3]: https://kubernetes.io/docs/reference/kubectl/overview/ -[4]: https://github.com/ahmetb/kubectl-aliases/blob/master/.kubectl_aliases -[5]: https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/ -[6]: https://opensource.com/article/19/6/tmux-terminal-joy -[7]: https://github.com/abhiTamrakar/kube-plugins -[8]: https://opensource.com/sites/default/files/uploads/kmux-output.png (Output of kmux plugin) diff --git a/translated/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md b/translated/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md new file mode 100644 index 0000000000..b807e99fb1 --- /dev/null +++ b/translated/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md @@ -0,0 +1,161 @@ +[#]: collector: (lujun9972) +[#]: translator: ( guevaraya) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Troubleshoot Kubernetes with the power of tmux and kubectl) +[#]: via: (https://opensource.com/article/20/2/kubernetes-tmux-kubectl) +[#]: author: (Abhishek Tamrakar https://opensource.com/users/tamrakar) + +解决 Kubernetes 问题的利器 Tmux 和 kubectl +====== +一个 kubectl 插件 用 tmux 使 Kubernetes 疑难问题变得更简单。 + +![一个坐在笔记本面前的妇女][1] + +[Kubernetes][2] 是一个活跃的开源容器管理平台,它提供了可扩展性,高可用性,健壮性和富有弹性的应用程序管理。它的众多特性之一是支持通过原生的客户端程序 [kubectl][3] 运行定制脚本或可执行程序,Kubectl 很强大的,允许用户在 Kubernetes 集群上用它直接做很多事情。 + +### 使用别名进行 Kubernetes 的故障排查 + +使用 Kubernetes 的容器管理的人都知道由于设计上原因带来了其复杂性。因此迫切的需要快速的以及几乎不需要人工干预方式简化故障排查(除过特殊情况)。 + +在故障排查功能方面,这有很多场景需要考虑。有一个场景,你知道你需要运行什么,但是这个命令的语法(即使作为一个单独的命令运行)过于复杂,或需要一、两次交互才能起作用。 + +例如,如果你频繁的需要调整一个系统命名空间里正在运行的容器,你可能发现自己在重复的写入: + +``` +`kubectl --namespace=kube-system exec -i -t ` +``` +为了简化故障排查,你可以用这些指令的命令行补全功能。比如,你可以增加下面命令到你的隐藏配置文件(.bashrc 或 .zshrc): + +``` +`alias ksysex='kubectl --namespace=kube-system exec -i -t'` +``` + +这是来自于常见的 [Kubernetes 别名仓][4]的一个例子,它展示了一个 kubectl 简化的功能的方法。像这个场景的简化情况,使用别名很有用。 + +### 切换到 kubectl 插件 + +更复杂的故障排查场景是需要执行很多命令,一个一个的执行,然后去调查环境,最后得出结论。单用别名方法是不能解决这种情况的;你需要知道你所部署的Kubernetes 之间逻辑和和相关性,你真是需要的是自动化来短时间输出你想要的。 + +考虑到你的集群有10到20或50到100个命名空间来提供不同的微服务。一般在进行故障排查时,做什么事情对你有帮助? + + * 你需要某个东西可快速的告知哪个 Pod 哪个 命名空间抛的错误。 + * 你需要某个东西可监视一个命名空间的所有 pod 的日志。 + * 你可能也需要监视出现错误的指定命名空间的特定 pod 的日志。 + + +只要包含以上任意的解决方案将对定位产品问题很大的帮助,包含对开发和测试周期过程。 + +你可以用 [kubectl 插件][5] 创建比简易别名更强大的方法。插件类似于其他用任何语言编写的独立脚本,被设计为 Kubernetes 管理员的主要命令扩展。 + +创建一个插件,你必须用正确的语法 **kubectl-<your-plugin-name>** 来拷贝这个脚本到导出目录 **$PATH** ,需要赋予可执行权限(**chmod +x**)。 + +创建插件之后把他移动到你的目录,你需要立即运行。例如,你的目录下有一个 kubectl-krawl 和 kubectl-kmux: + + +``` +$ kubectl plugin list +The following compatible plugins are available: + +/usr/local/bin/kubectl-krawl +/usr/local/bin/kubectl-kmux + +$ kubectl kmux +``` +现在让我们见识下带有 tmux 的 Kubernetes 的有多强大。 + +### 驾驭强大的 tmux + +[Tmux][6] 是一个非常强大的工具,许多管理员和操作团队通过它来反馈问题故障,通过易于分屏的方式到窗口上并行调试多个机器以及管理日志。他的主要的优点是可基于命令行或自动化的脚本。 + +我创建[一个 kubectl 插件][7] 用 tmux 使故障排查更加简单。我将通过注释来了解插件背后的逻辑(我们来瞅一瞅插件的整个源码): + +``` +#NAMESPACE is namespace to monitor. +#POD is pod name +#Containers is container names + +# initialize a counter n to count the number of loop counts, later be used by tmux to split panes. +n=0; + +# start a loop on a list of pod and containers +while IFS=' ' read -r POD CONTAINERS +do + +           # tmux create the new window for each pod +            tmux neww $COMMAND -n $POD 2>/dev/null + +           # start a loop for all containers inside a running pod +        for CONTAINER in ${CONTAINERS//,/ } +        do + +        if [ x$POD = x -o x$CONTAINER = x ]; then +        # if any of the values is null, exit. +        warn "Looks like there is a problem getting pods data." +        break +        fi +            +            # set the command to execute +        COMMAND=”kubectl logs -f $POD -c $CONTAINER -n $NAMESPACE” +        # check tmux session +        if tmux has-session -t <session name> 2>/dev/null; +        then +        <set session exists> +        else +        <create session> +        fi + +           # split planes in the current window for each containers +        tmux selectp -t $n \; \ +        splitw $COMMAND \; \ +        select-layout tiled \; + +           # end loop for containers +        done + +           # rename the window to identify by pod name +        tmux renamew $POD 2>/dev/null +        +            # increment the counter +        ((n+=1)) + +# end loop for pods +done< <(<fetch list of pod and containers from kubernetes cluster>) + +# finally select the window and attach session + tmux selectw -t <session name>:1 \; \ +  attach-session -t <session name>\; +``` + +运行插件脚本后,它将在当前目录会生成一个同名的镜像。每个 pod 有一个窗口,每个容器(如果有多个)被分割成不同 pos 窗口,日志以数据流形式输出。 漂亮的tmux 如下;如果配置正确,你将会看到哪个窗口是否处于激活运行状态(可看到标签是白色的)。 + +![kmux 插件的输出][8] + +### 总结 + +别名是在 Kubernetes 环境下常见的也有用的简易故障排查方法。当环境变得复杂,用高级脚本生成的kubectl 插件是一个很强大的方法。至于用哪个编程语言来编写 kubectl 插件是没有限制。唯一的要求是路径命名是可执行的,并且不能与已知的 kubectl 命令重复。 + +为了阅读完整的插件源码,我们尝试创建了一个插件,请查看我的 [kube-plugins-github][7] 仓。欢迎提交问题和补丁。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/kubernetes-tmux-kubectl + +作者:[Abhishek Tamrakar][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/guevaraya) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/tamrakar +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_4.png?itok=VGZO8CxT (一个坐在笔记本面前的妇女) +[2]: https://opensource.com/resources/what-is-kubernetes +[3]: https://kubernetes.io/docs/reference/kubectl/overview/ +[4]: https://github.com/ahmetb/kubectl-aliases/blob/master/.kubectl_aliases +[5]: https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/ +[6]: https://opensource.com/article/19/6/tmux-terminal-joy +[7]: https://github.com/abhiTamrakar/kube-plugins +[8]: https://opensource.com/sites/default/files/uploads/kmux-output.png (Output of kmux plugin) From 5c3c47277a765a0b7e35273b1f407fb56bd4dad3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 18 Feb 2020 08:25:06 +0800 Subject: [PATCH 047/315] translating --- ...rd- Why Linux Users Going Crazy Over it.md | 98 ------------------ ...rd- Why Linux Users Going Crazy Over it.md | 99 +++++++++++++++++++ 2 files changed, 99 insertions(+), 98 deletions(-) delete mode 100644 sources/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md create mode 100644 translated/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md diff --git a/sources/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md b/sources/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md deleted file mode 100644 index 42da66203b..0000000000 --- a/sources/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md +++ /dev/null @@ -1,98 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What is WireGuard? Why Linux Users Going Crazy Over it?) -[#]: via: (https://itsfoss.com/wireguard/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -What is WireGuard? Why Linux Users Going Crazy Over it? -====== - -From normal Linux users to Linux creator [Linus Torvalds][1], everyone is in awe of WireGuard. What is WireGuard and what makes it so special? - -### What is WireGuard? - -![][2] - -[WireGuard][3] is an easy to configure, fast, and secure open source [VPN][4] that utilizes state-of-the-art cryptography. It’s aim is to provide a faster, simpler and leaner general purpose VPN that can be easily deployed on low-end devices like Raspberry Pi to high-end servers. - -Most of the other solutions like [IPsec][5] and OpenVPN were developed decades ago. Security researcher and kernel developer Jason Donenfeld realized that they were slow and difficult to configure and manage properly. - -This made him create a new open source VPN protocol and solution which is faster, secure easier to deploy and manage. - -WireGuard was originally developed for Linux but it is now available for Windows, macOS, BSD, iOS and Android. It is still under heavy development. - -### Why is WireGuard so popular? - -![][6] - -Apart from being a cross-platform, one of the biggest plus point for WireGuard is the ease of deployment. Configuring and deploying WireGuard is as easy as configuring and using SSH. - -Look at [WireGuard set up guide][7]. You install WireGuard, generate public and private keys (like SSH), set up firewall rules and start the service. Now compare it to the [OpenVPN set up guide][8]. There are way too many things to do here. - -Another good thing about WireGuard is that it has a lean codebase with just 4000 lines of code. Compare it to 100,000 lines of code of [OpenVPN][9] (another popular open source VPN). It is clearly easier to debug WireGuard. - -Don’t go by its simplicity. WireGuard supports all the state-of-the-art cryptography like like the [Noise protocol framework][10], [Curve25519][11], [ChaCha20][12], [Poly1305][13], [BLAKE2][14], [SipHash24][15], [HKDF][16], and secure trusted constructions. - -Since WireGuard runs in the [kernel space][17], it provides secure networking at a high speed. - -These are some of the reasons why WireGuard has become increasingly popular. Linux creator Linus Torvalds loves WireGuard so much that he is merging it in the [Linux Kernel 5.6][18]: - -> Can I just once again state my love for it and hope it gets merged soon? Maybe the code isn’t perfect, but I’ve skimmed it, and compared to the horrors that are OpenVPN and IPSec, it’s a work of art. -> -> Linus Torvalds - -### If WireGuard is already available, then what’s the fuss about including it in Linux kernel? - -This could be confusing to new Linux users. You know that you can install and configure a WireGuard VPN server on Linux but then you also read the news that Linux Kernel 5.6 is going to include WireGuard. Let me explain it to you. - -At present, you can install WireGuard on Linux as a [kernel module][19]. Regular applications like VLC, GIMP etc are installed on top of the Linux kernel (in [user space][20]), not inside it. - -When you install WireGuard as a kernel module, you are basically modifying the Linux kernel on your own and add some code to it. Starting kernel 5.6, you won’t need manually add the kernel module. It will be included in the kernel by default. - -The inclusion of WireGuard in Kernel 5.6 will most likely [extend the adoption of WireGuard and thus change the current VPN scene][21]. - -**Conclusion** - -WireGuard is gaining popularity for the good reasons. Some of the popular [privacy focused VPNs][22] like [Mullvad VPN][23] are already using WireGuard and the adoption is likely to grow in the near future. - -I hope you have a slightly better understanding of WireGuard. Your feedback is welcome, as always. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/wireguard/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/linus-torvalds-facts/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/wireguard.png?ssl=1 -[3]: https://www.wireguard.com/ -[4]: https://en.wikipedia.org/wiki/Virtual_private_network -[5]: https://en.wikipedia.org/wiki/IPsec -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/wireguard-logo.png?ssl=1 -[7]: https://www.linode.com/docs/networking/vpn/set-up-wireguard-vpn-on-ubuntu/ -[8]: https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04 -[9]: https://openvpn.net/ -[10]: https://noiseprotocol.org/ -[11]: https://cr.yp.to/ecdh.html -[12]: https://cr.yp.to/chacha.html -[13]: https://cr.yp.to/mac.html -[14]: https://blake2.net/ -[15]: https://131002.net/siphash/ -[16]: https://eprint.iacr.org/2010/264 -[17]: http://www.linfo.org/kernel_space.html -[18]: https://itsfoss.com/linux-kernel-5-6/ -[19]: https://wiki.archlinux.org/index.php/Kernel_module -[20]: http://www.linfo.org/user_space.html -[21]: https://www.zdnet.com/article/vpns-will-change-forever-with-the-arrival-of-wireguard-into-linux/ -[22]: https://itsfoss.com/best-vpn-linux/ -[23]: https://mullvad.net/en/ diff --git a/translated/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md b/translated/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md new file mode 100644 index 0000000000..c3f781ac47 --- /dev/null +++ b/translated/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is WireGuard? Why Linux Users Going Crazy Over it?) +[#]: via: (https://itsfoss.com/wireguard/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +什么是 WireGuard?为什么 Linux 用户对它疯狂? +====== + +从普通的 Linux 用户到 Linux 创建者 [Linus Torvalds][1],每个人都对 WireGuard 很感兴趣。什么是 WireGuard,它为何如此特别? + +### 什么是 WireGuard? + +![][2] + +[WireGuard][3] 是一个易于配置、快速且安全的开源 [VPN][4],它利用了最新的加密技术。目的是提供一种更快、更简单、更精简的通用 VPN,它可以轻松地在树莓派这类低端设备到高端服务器上部署。 + + +[IPsec][5] 和 OpenVPN 等大多数其他解决方案是几十年前开发的。安全研究人员和内核开发人员 Jason Donenfeld 意识到它们速度慢且难以正确配置和管理。 + +这让他创建了一个新的开源 VPN 协议和解决方案,它更加快速、安全、易于部署和管理。 + +WireGuard 最初是为 Linux 开发的,但现在可用于 Windows、macOS、BSD、iOS 和 Android。它仍在活跃开发中。 + +### 为什么 WireGuard 如此受欢迎? + +![][6] + +除了可以跨平台之外,WireGuard 的最大优点之一就是易于部署。配置和部署 WireGuard 就像配置和使用 SSH 一样容易。 + +看看 [WireGuard 设置指南][7]。安装 WireGuard、生成公钥和私钥(像 SSH 一样),设置防火墙规则并启动服务。现在将它和 [OpenVPN 设置指南][8]进行比较。它有太多要做的了。 + +WireGuard 的另一个好处是它有一个仅 4000 行代码的精简代码库。将它与 [OpenVPN][9](另一个流行的开源 VPN)的 100,000 行代码相比。显然,调试W ireGuard 更加容易。 + +不要小看它的简单。WireGuard 支持所有最新的加密技术,例如 [Noise协议框架][10]、[Curve25519][11]、[ChaCha20][12]、[Poly1305][13]、[BLAKE2][14]、[SipHash24][15]、[HKDF][16] 和安全受信任结构。 + +由于 WireGuard 运行在[内核空间][17],因此可以高速提供安全的网络。 + +这些是 WireGuard 越来越受欢迎的一些原因。Linux 创造者 Linus Torvalds 非常喜欢 WireGuard,以至于将其合并到 [Linux Kernel 5.6][18] 中: + +> 我能否再次声明对它的爱,并希望它能很快合并?也许代码不是完美的,但我已经忽略,与 OpenVPN 和 IPSec 的恐怖相比,这是一件艺术品。 +> +> Linus Torvalds + +### 如果 WireGuard 已经可用,那么将其包含在 Linux 内核中有什么大惊小怪的? + +这可能会让新的 Linux 用户感到困惑。你知道可以在 Linux 上安装和配置 WireGuard VPN 服务器,但同时会看到 Linux Kernel 5.6 将包含 WireGuard 的消息。让我向您解释。 + +目前,你可以将 WireGuard 作为[内核模块][19]安装在 Linux 中。诸如 VLC、GIMP 等常规应用安装在 Linux 内核之上(在 [用户空间][20]中),而不是内部。 + +当将 WireGuard 安装为内核模块时,基本上是自行修改 Linux 内核并向其添加代码。从 5.6 内核开始,你无需手动添加内核模块。默认情况下它将包含在内核中。 + +在 5.6 内核中包含 WireGuard 很有可能[扩展 WireGuard 的采用,从而改变当前的 VPN 场景][21]。 + +**总结** + +WireGuard 之所以受欢迎是有充分理由的。诸如 [Mullvad VPN][23] 之类的一些流行的[关注隐私的 VPN][22] 已经在使用 WireGuard,并且在不久的将来,采用率可能还会增长。 + +希望你对 WireGuard 有所了解。与往常一样,欢迎提供反馈。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/wireguard/ + +作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/linus-torvalds-facts/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/wireguard.png?ssl=1 +[3]: https://www.wireguard.com/ +[4]: https://en.wikipedia.org/wiki/Virtual_private_network +[5]: https://en.wikipedia.org/wiki/IPsec +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/wireguard-logo.png?ssl=1 +[7]: https://www.linode.com/docs/networking/vpn/set-up-wireguard-vpn-on-ubuntu/ +[8]: https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04 +[9]: https://openvpn.net/ +[10]: https://noiseprotocol.org/ +[11]: https://cr.yp.to/ecdh.html +[12]: https://cr.yp.to/chacha.html +[13]: https://cr.yp.to/mac.html +[14]: https://blake2.net/ +[15]: https://131002.net/siphash/ +[16]: https://eprint.iacr.org/2010/264 +[17]: http://www.linfo.org/kernel_space.html +[18]: https://itsfoss.com/linux-kernel-5-6/ +[19]: https://wiki.archlinux.org/index.php/Kernel_module +[20]: http://www.linfo.org/user_space.html +[21]: https://www.zdnet.com/article/vpns-will-change-forever-with-the-arrival-of-wireguard-into-linux/ +[22]: https://itsfoss.com/best-vpn-linux/ +[23]: https://mullvad.net/en/ \ No newline at end of file From fdc0733571d83abe555c1f7829c6c8cc517941c0 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 18 Feb 2020 08:31:00 +0800 Subject: [PATCH 048/315] translating --- .../20200130 Meet FuryBSD- A New Desktop BSD Distribution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md b/sources/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md index eee1d27f9c..d5f4f5da89 100644 --- a/sources/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md +++ b/sources/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 838ad5acbf35bcd06668438c27c76b74069ba97d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 18 Feb 2020 11:37:34 +0800 Subject: [PATCH 049/315] PRF @qianmingtian --- ...Give an old MacBook new life with Linux.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/translated/tech/20200203 Give an old MacBook new life with Linux.md b/translated/tech/20200203 Give an old MacBook new life with Linux.md index 043a5ce7fc..041e60160e 100644 --- a/translated/tech/20200203 Give an old MacBook new life with Linux.md +++ b/translated/tech/20200203 Give an old MacBook new life with Linux.md @@ -1,36 +1,36 @@ [#]: collector: (lujun9972) [#]: translator: (qianmingtian) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Give an old MacBook new life with Linux) [#]: via: (https://opensource.com/article/20/2/macbook-linux-elementary) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) -用 Linux 给旧 MacBook 以新生 +用 Linux 让旧 MacBook 焕发新生 ====== -Elementary OS 的最新版本 Hera 是一个令人印象深刻的平台,它让过时的 MacBook 得以重生。 +> Elementary OS 的最新版本 Hera 是一个令人印象深刻的平台,它可以让过时的 MacBook 得以重生。 -![Coffee and laptop][1] +![](https://img.linux.net.cn/data/attachment/album/202002/18/113614k2jx6ju7uuu0alhk.png) -当我安装苹果的 [MacOS Mojave][2] 时,它使我以前可靠的 MacBook Air 运行变慢了。我的计算机于 2015 年发布,具有 4 GB 内存, i5 处理器和 Broadcom 4360 无线卡,但是 Mojava 提供的日常驱动程序使 [GnuCash][3] 不可用,这激起了我重返 Linux 的欲望。我很高兴能做到这一点,但是我感到非常遗憾的是,我的这台 MacBook 被闲置了。 +当我安装苹果的 [MacOS Mojave][2] 时,它使我以前可靠的 MacBook Air 慢得像爬一样。我的计算机发售于 2015 年,具有 4 GB 内存、i5 处理器和 Broadcom 4360 无线卡,但是对于我的日常使用来说,Mojava 有点过分了,它不能和 [GnuCash][3] 一起工作,这激起了我重返 Linux 的欲望。我很高兴能重返,但是我深感遗憾的是,我的这台出色的 MacBook 被闲置了。 -我在 MacBook Air 上尝试了几种 Linux 发行版,但总是会有陷阱。有时是无线网卡;还有一次,它缺少对触摸板的支持。看了一些不错的评论后,我决定尝试 [Elementary OS][4] 5.0(Juno)。我用 USB [制作了启动盘][5],并将其插入 MacBook Air 。我来到了一个实时桌面,并且操作系统识别了我的 Broadcom 无线芯片组-我认为这可能已经正常工作了! +我在 MacBook Air 上尝试了几种 Linux 发行版,但总会有缺陷。有时是无线网卡;还有一次,它缺少对触摸板的支持。看了一些不错的评论后,我决定尝试 [Elementary OS][4] 5.0(Juno)。我用 USB [制作了启动盘][5],并将其插入 MacBook Air 。我来到了一个现场live桌面,并且操作系统识别出了我的 Broadcom 无线芯片组 —— 我认为这可能行得通! -我喜欢在 Elementary OS 中看到的内容。它的 [Pantheon][6] 桌面真的很棒,并且其外观和使用起来的感觉对 Apple 用户来说很熟悉-它的显示屏底部有一个底座,并带有可引导常用应用程序的图标。我喜欢我之前期待的预览,所以我决定安装它,然后我的无线设备消失了。真的很令人失望。我真的很喜欢 Elementary OS ,但是没有无线是不行的。 +我喜欢在 Elementary OS 中看到的内容。它的 [Pantheon][6] 桌面真的很棒,并且其外观和使用起来的感觉对 Apple 用户来说很熟悉 —— 它的显示屏底部有一个扩展坞,并带有一些指向常用应用程序的图标。我对我之前期待的预览感到满意,所以我决定安装它,然后我的无线设备消失了。真的很令人失望。我真的很喜欢 Elementary OS ,但是没有无线网络是不行的。 -时间快进到 2019 年 12 月,当我在 [Linux4Everyone][7] 播客上听到有关 Elementary 最新版本 v.5.1(Hera) 使MacBook复活的评论时,我决定用 Hera 再试一次。我下载了 ISO ,创建了可启动驱动器,将其插入电脑,这次操作系统识别了我的无线网卡。我可以在上面工作了。 +时间快进到 2019 年 12 月,当我在 [Linux4Everyone][7] 播客上听到有关 Elementary 最新版本 v.5.1(Hera) 使 MacBook 复活的评论时,我决定用 Hera 再试一次。我下载了 ISO ,创建了可启动驱动器,将其插入电脑,这次操作系统识别了我的无线网卡。我可以在上面工作了。 ![MacBook Air with Hera][8] -我非常高兴我轻巧又功能强大的 MacBook Air 通过 Linux 焕然一新。我一直在更详细地研究 Elementary OS ,我可以告诉你我印象深刻的东西。 +我非常高兴我轻巧又功能强大的 MacBook Air 通过 Linux 焕然一新。我一直在更详细地研究 Elementary OS,我可以告诉你我印象深刻的东西。 ### Elementary OS 的功能 -根据 [Elementary 的博客][9],“新设计的登录和锁定屏幕问候语看起来更清晰,效果更好,并且修复了以前问候语中报告的许多问题,包括焦点问题, HiDPI 问题和更好的本地化。 Hera 的新设计是为了响应来自 Juno 的用户反馈,并启用了一些不错的新功能。” +根据 [Elementary 的博客][9],“新设计的登录和锁定屏幕问候语看起来更清晰、效果更好,并且修复了以前问候语中报告的许多问题,包括输入焦点问题,HiDPI 问题和更好的本地化。Hera 的新设计是为了响应来自 Juno 的用户反馈,并启用了一些不错的新功能。” -轻描淡写的“不错的新功能” — Elementary OS 拥有我见过的最佳设计的 Linux 用户界面之一。默认情况下,系统上的“系统设置”图标位于扩展坞上。更改设置很容易,很快我就按照自己的喜好配置了系统。我需要的文字大小比默认值大,辅助功能要易于使用并且允许我设置大文字和高对比度。我还可以使用较大的图标和其他选项来调整底座。 +“不错的新功能”是在轻描淡写 —— Elementary OS 拥有我见过的最佳设计的 Linux 用户界面之一。默认情况下,系统上的“系统设置”图标位于扩展坞上。更改设置很容易,很快我就按照自己的喜好配置了系统。我需要的文字大小比默认值大,辅助功能是易于使用的,允许我设置大文字和高对比度。我还可以使用较大的图标和其他选项来调整扩展坞。 ![Elementary OS 的设置界面][10] @@ -38,17 +38,17 @@ Elementary OS 的最新版本 Hera 是一个令人印象深刻的平台,它让 ![Elementary OS' 的键盘快捷键][11] -Elementary OS 附带的 [Epiphany][12] Web 浏览器,我发现它非常易于使用。 它与 Chrome , Chromium 或 Firefox 略有不同,但它已经绰绰有余。 +Elementary OS 附带的 [Epiphany][12] Web 浏览器,我发现它非常易于使用。它与 Chrome、Chromium 或 Firefox 略有不同,但它已经绰绰有余。 -对于注重安全的用户(我们应该都是), Elementary OS 的安全和隐私设置提供了多个选项,包括防火墙,历史记录,锁定,临时和垃圾文件的自动删除以及用于位置服务开/关的开关。 +对于注重安全的用户(我们应该都是),Elementary OS 的安全和隐私设置提供了多个选项,包括防火墙、历史记录、锁定,临时和垃圾文件的自动删除以及用于位置服务开/关的开关。 ![Elementary OS 的隐私与安全][13] ### 有关 Elementray OS 的更多信息 -Elementary OS 最初于 2011 年发布,其最新版本 Hera 于 2019 年 12 月 3 日发布。 Elementary 的联合创始人兼 CXO 的 [Cassidy James Blaede][14] 是操作系统的 UX 架构师。 Cassidy 喜欢使用开放技术来设计和构建有用,可用和令人愉悦的数字产品。 +Elementary OS 最初于 2011 年发布,其最新版本 Hera 于 2019 年 12 月 3 日发布。 Elementary 的联合创始人兼 CXO 的 [Cassidy James Blaede][14] 是操作系统的 UX 架构师。 Cassidy 喜欢使用开放技术来设计和构建有用、可用和令人愉悦的数字产品。 -Elementary OS 具有出色的用户[文档][15],其代码(在 GPL 3.0 下许可)可在 [GitHub][16] 上获得。 Elementary OS 鼓励参与该项目,因此请务必伸出援手并[加入社区][17]。 +Elementary OS 具有出色的用户[文档][15],其代码(在 GPL 3.0 下许可)可在 [GitHub][16] 上获得。Elementary OS 鼓励参与该项目,因此请务必伸出援手并[加入社区][17]。 -------------------------------------------------------------------------------- @@ -57,7 +57,7 @@ via: https://opensource.com/article/20/2/macbook-linux-elementary 作者:[Don Watkins][a] 选题:[lujun9972][b] 译者:[qianmingtian][c] -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0ca988987701d4c02173f9b56113e38f15e7a226 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 18 Feb 2020 11:38:56 +0800 Subject: [PATCH 050/315] PUB @qianmingtian https://linux.cn/article-11902-1.html --- .../20200203 Give an old MacBook new life with Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200203 Give an old MacBook new life with Linux.md (98%) diff --git a/translated/tech/20200203 Give an old MacBook new life with Linux.md b/published/20200203 Give an old MacBook new life with Linux.md similarity index 98% rename from translated/tech/20200203 Give an old MacBook new life with Linux.md rename to published/20200203 Give an old MacBook new life with Linux.md index 041e60160e..768b3dc6ca 100644 --- a/translated/tech/20200203 Give an old MacBook new life with Linux.md +++ b/published/20200203 Give an old MacBook new life with Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (qianmingtian) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11902-1.html) [#]: subject: (Give an old MacBook new life with Linux) [#]: via: (https://opensource.com/article/20/2/macbook-linux-elementary) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) From f497ef390d95c14fb7dc66555aa4c5db05f6d59e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 18 Feb 2020 11:40:40 +0800 Subject: [PATCH 051/315] PRF --- published/20200203 Give an old MacBook new life with Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/published/20200203 Give an old MacBook new life with Linux.md b/published/20200203 Give an old MacBook new life with Linux.md index 768b3dc6ca..4a2ec03b17 100644 --- a/published/20200203 Give an old MacBook new life with Linux.md +++ b/published/20200203 Give an old MacBook new life with Linux.md @@ -22,7 +22,7 @@ 时间快进到 2019 年 12 月,当我在 [Linux4Everyone][7] 播客上听到有关 Elementary 最新版本 v.5.1(Hera) 使 MacBook 复活的评论时,我决定用 Hera 再试一次。我下载了 ISO ,创建了可启动驱动器,将其插入电脑,这次操作系统识别了我的无线网卡。我可以在上面工作了。 -![MacBook Air with Hera][8] +![运行 Hera 的 MacBook Air][8] 我非常高兴我轻巧又功能强大的 MacBook Air 通过 Linux 焕然一新。我一直在更详细地研究 Elementary OS,我可以告诉你我印象深刻的东西。 @@ -36,7 +36,7 @@ 按下 Mac 的 Command 键将弹出一个键盘快捷键列表,这对新用户非常有帮助。 -![Elementary OS' 的键盘快捷键][11] +![Elementary OS 的键盘快捷键][11] Elementary OS 附带的 [Epiphany][12] Web 浏览器,我发现它非常易于使用。它与 Chrome、Chromium 或 Firefox 略有不同,但它已经绰绰有余。 From fdba5a582d40071bd68423339071985d8fec0755 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 18 Feb 2020 11:49:50 +0800 Subject: [PATCH 052/315] PRF @geekpi --- ...o Change the Default Terminal in Ubuntu.md | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/translated/tech/20200212 How to Change the Default Terminal in Ubuntu.md b/translated/tech/20200212 How to Change the Default Terminal in Ubuntu.md index f47ff7832d..8d69536676 100644 --- a/translated/tech/20200212 How to Change the Default Terminal in Ubuntu.md +++ b/translated/tech/20200212 How to Change the Default Terminal in Ubuntu.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Change the Default Terminal in Ubuntu) @@ -10,15 +10,13 @@ 如何在 Ubuntu 中更改默认终端 ====== -终端是 Linux 系统的关键部分。它能让你通过 shell 访问 Linux 系统。Linux 上有多个终端应用(技术上称为终端仿真器)。 +终端Terminal是 Linux 系统的关键部分。它能让你通过 shell 访问 Linux 系统。Linux 上有多个终端应用(技术上称为终端仿真器)。 -大多数[桌面环境][1]都有自己的终端实现。它们的外观可能有所不同,并且可能有不同的快捷键。 - -例如,[Guake 终端][2]对高级用户非常有用,它提供了一些可能无法在发行版默认终端中使用的功能。 +大多数[桌面环境][1]都有自己的终端实现。它们的外观可能有所不同,并且可能有不同的快捷键。例如,[Guake 终端][2]对高级用户非常有用,它提供了一些可能无法在发行版默认终端中使用的功能。 你可以在系统上安装其他终端,并将其设为默认,并能通过[快捷键 Ctrl+Alt+T][3] 打开。 -现在的问题来了,如何在 Ubuntu 中更改默认终端。它没有遵循[更改 Ubuntu 中的默认应用][4]的标准方式,要怎么做? +现在问题来了,如何在 Ubuntu 中更改默认终端。它没有遵循[更改 Ubuntu 中的默认应用][4]的标准方式,要怎么做? ### 更改 Ubuntu 中的默认终端 @@ -35,7 +33,7 @@ sudo update-alternatives --config x-terminal-emulator 它将显示系统上存在的所有可作为默认值的终端仿真器。当前的默认终端标有星号。 ``` -[email protected]:~$ sudo update-alternatives --config x-terminal-emulator +abhishek@nuc:~$ sudo update-alternatives --config x-terminal-emulator There are 2 choices for the alternative x-terminal-emulator (providing /usr/bin/x-terminal-emulator). Selection Path Priority Status @@ -54,13 +52,13 @@ Press to keep the current choice[*], or type selection number: 1 update-alternatives: using /usr/bin/gnome-terminal.wrapper to provide /usr/bin/x-terminal-emulator (x-terminal-emulator) in manual mode ``` -##### 自动模式 vs 手动模式 - -你可能已经在 update-alternatives 命令的输出中注意到了自动模式和手动模式。 - -如果选择自动模式,那么在安装或删除软件包时,系统可能会自动决定默认应用。该决定受优先级数字的影响(如上一节中的命令输出所示)。 - -假设你的系统上安装了 5 个终端仿真器,并删除了默认的仿真器。现在,你的系统将检查哪些仿真器处于自动模式。如果有多个,它将​​选择优先级最高的一个作为默认仿真器。 +> **自动模式 vs 手动模式** +> +> 你可能已经在 `update-alternatives` 命令的输出中注意到了自动模式和手动模式。 +> +> 如果选择自动模式,那么在安装或删除软件包时,系统可能会自动决定默认应用。该决定受优先级数字的影响(如上一节中的命令输出所示)。 +> +> 假设你的系统上安装了 5 个终端仿真器,并删除了默认的仿真器。现在,你的系统将检查哪些仿真器处于自动模式。如果有多个,它将​​选择优先级最高的一个作为默认仿真器。 我希望你觉得这个小技巧有用。随时欢迎提出问题和建议。 @@ -71,7 +69,7 @@ via: https://itsfoss.com/change-default-terminal-ubuntu/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5aef3d5b6cfc6cee036e7a70dffbb761b97dd31a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 18 Feb 2020 11:50:24 +0800 Subject: [PATCH 053/315] PUB @geekpi https://linux.cn/article-11903-1.html --- .../20200212 How to Change the Default Terminal in Ubuntu.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200212 How to Change the Default Terminal in Ubuntu.md (98%) diff --git a/translated/tech/20200212 How to Change the Default Terminal in Ubuntu.md b/published/20200212 How to Change the Default Terminal in Ubuntu.md similarity index 98% rename from translated/tech/20200212 How to Change the Default Terminal in Ubuntu.md rename to published/20200212 How to Change the Default Terminal in Ubuntu.md index 8d69536676..b90a79887f 100644 --- a/translated/tech/20200212 How to Change the Default Terminal in Ubuntu.md +++ b/published/20200212 How to Change the Default Terminal in Ubuntu.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11903-1.html) [#]: subject: (How to Change the Default Terminal in Ubuntu) [#]: via: (https://itsfoss.com/change-default-terminal-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 2308fe483071361b8049d5eee39050183917e282 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 18 Feb 2020 12:40:29 +0800 Subject: [PATCH 054/315] PRF @Morisun029 --- ...00206 3 ways to use PostgreSQL commands.md | 100 ++++++++---------- 1 file changed, 45 insertions(+), 55 deletions(-) diff --git a/translated/tech/20200206 3 ways to use PostgreSQL commands.md b/translated/tech/20200206 3 ways to use PostgreSQL commands.md index 9f5890f370..571b7a959a 100644 --- a/translated/tech/20200206 3 ways to use PostgreSQL commands.md +++ b/translated/tech/20200206 3 ways to use PostgreSQL commands.md @@ -1,32 +1,31 @@ [#]: collector: (lujun9972) [#]: translator: (Morisun029) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (3 ways to use PostgreSQL commands) [#]: via: (https://opensource.com/article/20/2/postgresql-commands) [#]: author: (Greg Pittman https://opensource.com/users/greg-p) -3种使用 PostgreSQL 命令的方式 +3 种使用 PostgreSQL 命令的方式 ====== -无论你需要的东西简单(如一个购物清单)亦或复杂(如色卡生成器) - PostgreSQL 命令都能使它变得容易起来。 -![Team checklist and to dos][1] +> 无论你需要的东西简单(如一个购物清单)亦或复杂(如色卡生成器) ,PostgreSQL 命令都能使它变得容易起来。 -在 _[PostgreSQL 入门][2]_ 一文中, 我解释了如何安装,设置和开始使用开源数据库软件。然而,使用 [PostgreSQL][3] 中的命令可以做更多事情。 +![](https://img.linux.net.cn/data/attachment/album/202002/18/124003twk7fryz2krw2r39.jpg) -例如,我使用 Postgres 来跟踪我杂货店的购物清单。我杂货店里的大多数购物是在家里进行的,其中每周进行一次大批量的采购。我去几个不同的地方购买清单上的东西,因为每家商店都提供特定的选择或质量,亦或更好的价格。最初,我制作了一个HTML表单页面来管理我的购物清单,但这样无法保存我的输入内容。因此,在想到要购买的物品时我必须要马上列出清单,因为到采购时我常常会忘记一些我需要或想要的东西。 +在 [PostgreSQL 入门][2]一文中, 我解释了如何安装、设置和开始使用这个开源数据库软件。不过,使用 [PostgreSQL][3] 中的命令可以做更多事情。 + +例如,我使用 Postgres 来跟踪我的杂货店购物清单。我的大多数杂货店购物是在家里进行的,而且每周进行一次大批量的采购。我去几个不同的地方购买清单上的东西,因为每家商店都提供特定的选品或质量,亦或更好的价格。最初,我制作了一个 HTML 表单页面来管理我的购物清单,但这样无法保存我的输入内容。因此,在想到要购买的物品时我必须马上列出全部清单,然后到采购时我常常会忘记一些我需要或想要的东西。 相反,使用 PostgreSQL,当我想到需要的物品时,我可以随时输入,并在购物前打印出来。你也可以这样做。 - ### 创建一个简单的购物清单 +首先,输入 `psql` 命令进入数据库,然后用下面的命令创建一个表: -首先,数据库中输入**psql ** 命令,然后用下面的命令创建一个表: ``` -`Create table groc (item varchar(20), comment varchar(10));` +Create table groc (item varchar(20), comment varchar(10)); ``` 输入如下命令在清单中加入商品: @@ -36,9 +35,9 @@ insert into groc values ('milk', 'K'); insert into groc values ('bananas', 'KW'); ``` -括号中有两个信息(逗号隔开):前面是你需要买的东西,后面字母代表你要购买的地点以及哪些东西是你每周通常都要买的(W)。 +括号中有两个信息(逗号隔开):前面是你需要买的东西,后面字母代表你要购买的地点以及哪些东西是你每周通常都要买的(`W`)。 -因为 **psql** 有历史记录,你可以按向上键在括号内编辑信息,而无需输入商品的整行信息。 +因为 `psql` 有历史记录,你可以按向上键在括号内编辑信息,而无需输入商品的整行信息。 在输入一小部分商品后,输入下面命令来检查前面的输入内容。 @@ -46,7 +45,7 @@ insert into groc values ('bananas', 'KW'); Select * from groc order by comment; item | comment -\----------------+--------- +----------------+--------- ground coffee | H butter | K chips | K @@ -68,24 +67,23 @@ Select * from groc order by comment; (18 rows) ``` -此命令按_comment_ 列对结果进行排序,以便按购买地点对商品进行分组,从而是你的购物更加方便。 +此命令按 `comment` 列对结果进行排序,以便按购买地点对商品进行分组,从而使你的购物更加方便。 -使用W来指明你每周要买的东西,当你要清除表单为下周的列表做准备时,你可以将每周的商品保留在购物清单上。输入: +使用 `W` 来指明你每周要买的东西,当你要清除表单为下周的列表做准备时,你可以将每周的商品保留在购物清单上。输入: ``` -`delete from groc where comment not like '%W';` +delete from groc where comment not like '%W'; ``` -注意,在 PostgreSQL 中 **%** 表示通配符(而非星号)。所以,要保存输入内容,需要输入: +注意,在 PostgreSQL 中 `%` 表示通配符(而非星号)。所以,要保存输入内容,需要输入: ``` -`delete from groc where item like 'goat%';` +delete from groc where item like 'goat%'; ``` -不能使用**item = 'goat%'**,这样没用。 +不能使用 `item = 'goat%'`,这样没用。 - -在购物时,用以下命令输出清单并打印出来发送到你的手机: +在购物时,用以下命令输出清单并打印或发送到你的手机: ``` \o groclist.txt @@ -93,17 +91,14 @@ select * from groc order by comment; \o ``` -最后一个命令**\o*,重置输出到命令行。否则,所有的输出会继续输出到你创建的杂货店购物文件中。 +最后一个命令 `\o` 后面没有任何内容,将重置输出到命令行。否则,所有的输出会继续输出到你创建的杂货店购物文件 `groclist.txt` 中。 ### 分析复杂的表 -This item-by-item entry may be okay for short tables, but what about really big ones? A couple of years ago, I was helping the team at [FreieFarbe.de][4] to create a swatchbook of the free colors (freieFarbe means "free colors" in German) from its HLC color palette, where virtually any imaginable print color can be specified by its hue, luminosity (brightness), and chroma (saturation). The result was the [HLC Color Atlas][5], and here's how we did it. - -逐个输入对于数据量小的表来说没有问题,但是对于数据量大的表呢?几年前,我帮团队从 HLC 调色板中创建一个自由色的色样册。事实上,任何能想象到的打印色都可按色调、亮度、浓度(饱和度)来规定。最终结果是[HLC Color Atlas][5],下面是我们如何实现的。 +这个逐项列表对于数据量小的表来说没有问题,但是对于数据量大的表呢?几年前,我帮 [FreieFarbe.de][4] 的团队从 HLC 调色板中创建一个自由色的色样册。事实上,任何能想象到的打印色都可按色调、亮度、浓度(饱和度)来规定。最终结果是 [HLC Color Atlas][5],下面是我们如何实现的。 该团队向我发送了具有颜色规范的文件,因此我可以编写可与 Scribus 配合使用的 Python 脚本,以轻松生成色样册。一个例子像这样开始: - ``` HLC, C, M, Y, K H010_L15_C010, 0.5, 49.1, 0.1, 84.5 @@ -122,27 +117,25 @@ H010_L35_C060, 0.1, 100.0, 17.3, 31.5 H010_L45_C010, 4.3, 27.4, 0.1, 51.3 ``` -这与原文件相比,稍有修改,将数据用制表符分隔。我将其转换成 CSV 格式(逗号分割值),我更喜欢其与 Python 一起使用(CSV 文也很有用因为它可轻松导入到电子表格程序中)。 +这与原始数据相比,稍有修改,原始数据用制表符分隔。我将其转换成 CSV 格式(用逗号分割值),我更喜欢其与 Python 一起使用(CSV 文也很有用,因为它可轻松导入到电子表格程序中)。 -在每一行中,第一项是颜色名称,其后是其 C,M,Y 和 K 颜色值。 该文件包含1,793种颜色,我想要一种分析信息的方法,以了解这些值的范围。 这就是 PostgreSQL 发挥作用的地方。 我不想手动输入所有数据-我认为输入过程中我不可能不出错。 幸运的是,PostgreSQL 为此提供了一个命令。 +在每一行中,第一项是颜色名称,其后是其 C、M、Y 和 K 颜色值。 该文件包含 1,793 种颜色,我想要一种分析信息的方法,以了解这些值的范围。这就是 PostgreSQL 发挥作用的地方。我不想手动输入所有数据 —— 我认为输入过程中我不可能不出错,而且令人头痛。幸运的是,PostgreSQL 为此提供了一个命令。 首先用以下命令创建数据库: ``` -`Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal);` +Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal); ``` 然后通过以下命令引入数据: - ``` -`\copy hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV);` +\copy hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV); ``` +开头有反斜杠,是因为使用纯 `copy` 命令的权限仅限于 root 用户和 Postgres 的超级用户。在括号中,`header` 表示第一行包含标题,应忽略,`CSV` 表示文件格式为 CSV。请注意,在此方法中,颜色名称不需要用括号括起来。 -开头有反斜杠,是因为使用纯**copy** 命令仅限于 root 用户和 Postgres 的超级用户。 在括号中,**header** 表示第一行包含标题,应忽略,**CSV** 表示文件格式为 CSV。 请注意,在此方法中,颜色名称周围不需要括号。 - -如果操作成功,会看到 **COPY NNNN**,其中 N 表示插入到表中的行号。 +如果操作成功,会看到 `COPY NNNN`,其中 N 表示插入到表中的行数。 最后,可以用下列命令查询: @@ -150,7 +143,7 @@ H010_L45_C010, 4.3, 27.4, 0.1, 51.3 select * from hlc_cmyk; color | c | m | y | k -\---------------+-------+-------+-------+------ +---------------+-------+-------+-------+------ H010_L15_C010 | 0.5 | 49.1 | 0.1 | 84.5 H010_L15_C020 | 0.0 | 79.7 | 15.1 | 78.9 H010_L25_C010 | 6.1 | 38.3 | 0.0 | 72.5 @@ -164,49 +157,46 @@ select * from hlc_cmyk; ``` -所有1,793行数据都是这样的。 回想起来,我不能说此查询对于HLC和Scribus任务是绝对必要的,但是它减轻了我对该项目的一些担忧。 +所有的 1,793 行数据都是这样的。回想起来,我不能说此查询对于 HLC 和 Scribus 任务是绝对必要的,但是它减轻了我对该项目的一些担忧。 -为了生成 HLC 色谱,我使用 Scribus 为色板页面中的13,000多种颜色自动创建了颜色图表。 +为了生成 HLC 色谱,我使用 Scribus 为色板页面中的 13,000 多种颜色自动创建了颜色图表。 -我可以使用 **copy** 命令输出数据: +我可以使用 `copy` 命令输出数据: ``` -`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV);` +\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV); ``` +我还可以使用 `where` 子句根据某些值来限制输出。 -我还可以使用 ** where ** 子句根据某些值来限制输出。 - -例如,以下命令将仅发送以 H10 开头的色调值。 - +例如,以下命令将仅发送以 `H10` 开头的色调值。 ``` -`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%';` +\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%'; ``` ### 备份或传输数据库或表 -我在此要提到的最后一个命令是**pg_dump**,它用于备份 PostgreSQL 数据库,并在 **psql** 控制台之外运行。 例如: +我在此要提到的最后一个命令是 `pg_dump`,它用于备份 PostgreSQL 数据库,并在 `psql` 控制台之外运行。 例如: ``` -pg_dump gregp -t hlc_cmyk > hlc.out -pg_dump gregp > dball.out +pg_dump gregp -t hlc_cmyk > hlc.out +pg_dump gregp > dball.out ``` -第一行是导出 **hlc_cmyk** 表及其结构。第二行将转储 **gregp** 数据库中的所有表。 这对于备份或传输数据库或表非常有用。 +第一行是导出 `hlc_cmyk` 表及其结构。第二行将转储 `gregp` 数据库中的所有表。这对于备份或传输数据库或表非常有用。 - -要将数据库或表转到另一台电脑( 查看"[ PostgreSQL 入门][2]" 那篇文章获取详细信息),首先在要转入的电脑上创建一个数据库,然后执行相反的操作。 +要将数据库或表传输到另一台电脑(查看 [PostgreSQL 入门][2]那篇文章获取详细信息),首先在要转入的电脑上创建一个数据库,然后执行相反的操作。 ``` -`psql -d gregp -f dball.out` +psql -d gregp -f dball.out ``` 一步创建所有表并输入数据。 ### 总结 -在本文中,我们了解了如何使用 **WHERE** 参数限制操作,以及如何使用 PostgreSQL 通配符 **%**。 我们还了解了如何将大批量数据加载到表中,然后将部分或全部表数据输出到文件,甚至是将整个数据库及其所有单个表输出。 +在本文中,我们了解了如何使用 `WHERE` 参数限制操作,以及如何使用 PostgreSQL 通配符 `%`。我们还了解了如何将大批量数据加载到表中,然后将部分或全部表数据输出到文件,甚至是将整个数据库及其所有单个表输出。 -------------------------------------------------------------------------------- @@ -214,15 +204,15 @@ via: https://opensource.com/article/20/2/postgresql-commands 作者:[Greg Pittman][a] 选题:[lujun9972][b] -译者:[Morisun029](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[Morisun029](https://github.com/Morisun029) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/greg-p [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) -[2]: https://opensource.com/article/19/11/getting-started-postgresql +[2]: https://linux.cn/article-11593-1.html [3]: https://www.postgresql.org/ [4]: http://freiefarbe.de [5]: https://www.freiefarbe.de/en/thema-farbe/hlc-colour-atlas/ From 2fe5257157d547e10462b5913b864cd60ec12df8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 18 Feb 2020 12:41:10 +0800 Subject: [PATCH 055/315] PUB @Morisun029 https://linux.cn/article-11904-1.html --- .../20200206 3 ways to use PostgreSQL commands.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200206 3 ways to use PostgreSQL commands.md (99%) diff --git a/translated/tech/20200206 3 ways to use PostgreSQL commands.md b/published/20200206 3 ways to use PostgreSQL commands.md similarity index 99% rename from translated/tech/20200206 3 ways to use PostgreSQL commands.md rename to published/20200206 3 ways to use PostgreSQL commands.md index 571b7a959a..edb92e9144 100644 --- a/translated/tech/20200206 3 ways to use PostgreSQL commands.md +++ b/published/20200206 3 ways to use PostgreSQL commands.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Morisun029) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11904-1.html) [#]: subject: (3 ways to use PostgreSQL commands) [#]: via: (https://opensource.com/article/20/2/postgresql-commands) [#]: author: (Greg Pittman https://opensource.com/users/greg-p) From 86d63f7287f10f2b9ee5d5e662091baa25b7b781 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Tue, 18 Feb 2020 20:23:26 +0800 Subject: [PATCH 056/315] translated --- ...13 Why developers like to code at night.md | 95 ---------------- ...13 Why developers like to code at night.md | 101 ++++++++++++++++++ 2 files changed, 101 insertions(+), 95 deletions(-) delete mode 100644 sources/tech/20200213 Why developers like to code at night.md create mode 100644 translated/tech/20200213 Why developers like to code at night.md diff --git a/sources/tech/20200213 Why developers like to code at night.md b/sources/tech/20200213 Why developers like to code at night.md deleted file mode 100644 index b01246d62a..0000000000 --- a/sources/tech/20200213 Why developers like to code at night.md +++ /dev/null @@ -1,95 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Morisun029) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why developers like to code at night) -[#]: via: (https://opensource.com/article/20/2/why-developers-code-night) -[#]: author: (Matt Shealy https://opensource.com/users/mshealy) - -Why developers like to code at night -====== -A nocturnal work schedule is the key to creativity and productivity for -many open source programmers. -![Person programming on a laptop on a building][1] - -If you ask most developers when they prefer to work, many will say their most productive hours are at night. This may be especially true for open source contributors who are contributing to projects outside of their day job (though hopefully within healthy limits to [avoid burnout][2]). - -Some like to start in the evening and work till the early hours while others get up super early—say, 4 a.m.—to get most of the programming work done before the daily grind kicks in. - -This work habit may make many developers seem like oddballs and misfits. However, there are quite a few reasons why so many programmers prefer to work during the odd hours: - -### The maker's schedule - -According to [Paul Graham][3], people who "produce stuff" tend to adhere to the maker's schedule—they prefer to use time in units of a half-day or longer. In fact, most [developers have the same preference][4]. - -For one thing, developers work on large abstract systems and need the mental space to process a model in its entirety. Having their schedules sliced into 15- or 30-minute chunks for emails, meetings, phone calls, and interruptions from co-workers is simply counterproductive. - -For another, it's often not possible to program effectively in units of an hour; that's barely enough time to wrap your head around the task at hand and get started. - -Programming is also adversely affected by context-switching. By working at night, developers can avoid as many distractions as possible. Without the constant barrage of interruptions, they can spend a few solid hours focusing on the task at hand and be as productive as possible. - -### The peaceful quiet - -With the background noise of various activities (e.g., office chatter, traffic on the street) mostly absent at night or in the early hours, many programmers experience a sense of relaxation. This allows them to be more creative and productive—especially when tackling mentally stimulating tasks such as coding. - -The solitude and peacefulness, plus knowing that they'll have a few uninterrupted hours, often take the stress and time pressure associated with a daytime work schedule off their shoulders, allowing them to produce higher quality work. - -Not to mention, there's nothing like indulging in your favorite midnight snacks when you have solved a thorny problem! - -### Communication - -Developers working on open source projects can have a different communication cadence than a programmer working in-house at a company. Most open source communication is done asynchronously through channels like mailing lists or GitHub comments. A lot of times, other programmers are in different countries and time zones, so communicating in real-time often requires developers to be night owls. - -### The sleepy brain - -This may sound counterintuitive, but as the day wears on, the brain gets tired enough so it can only focus on a single task. This essentially eliminates multitasking, which is a major hurdle to staying focused and productive. But with a sleepy brain, you can't afford not to stay focused! - -Also, many developers often make the most significant progress when they go to sleep thinking about the problem they're trying to solve. The subconscious mind goes to work, and the answers often come to them in the early hours when they're still half asleep. - -This is not surprising since [sleep boosts brain functions][5], helping us make sense of new information and think more creatively. When the solutions present themselves in the wee hours, these developers just get up and hit the ground running without missing a beat. - -### Flexible and creative thinking - -Many programmers experience an upswing in creativity at night. The prefrontal cortex, the part of the brain associated with the ability to concentrate, gets tired at the end of the day. This seems to clear the way for more flexible and creative thinking for some people. - -According to [Brant Hasler][6], assistant professor of psychiatry at the University of Pittsburgh School of Medicine, "with less of that top-down control and 'cognitive inhibition,' the brain might be freed up for more divergent thinking, allowing one to make new associations between different concepts more easily." Combined with the positive mood made possible by a more relaxed environment, developers can come up with innovative ideas more easily. - -Also, without distractions and having the space to concentrate for several hours, you can "get in the zone." This helps you better focus on a project and get in the flow without worrying about things happening around you. - -### Bright computer screens - -The sleep cycle of many programmers is delayed because they look at bright screens all day. The blue light from computer screens [disrupts our circadian rhythm][7] by delaying the release of sleep-inducing melatonin, increasing alertness, and resetting the body's internal clock to a later schedule. As a result, developers tend to go to bed later and later. - -### Influence from the past - -In the past, most developers worked at night out of necessity because shared servers didn't have the computing power to support programming work while everyone else in the company is using the servers during the day. Developers needed to wait until late at night to perform tasks that weren't feasible during the day, such as testing projects, running extensive code-compile-run-debug cycles, and deploying new codes. Even though servers are more powerful now and most can support the demand, the trend to work at night continues as part of the culture. - -### Final thoughts - -While there are many reasons why developers prefer to work at night, keep in mind that being a night owl doesn't mean you should skimp on sleep. Lack of sleep leads to stress and anxiety and, ultimately, burnout. - -Getting enough quality sleep is the key to maintaining good physical health and brain functions. For example, it helps you integrate new information, cement memories, think creatively, remove accumulated toxins, regulate your appetite, and prevent premature aging. - -No matter what your schedule is, make sure to give your brain the rest it needs so you can be on your game and as productive as possible—all day, every day! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/why-developers-code-night - -作者:[Matt Shealy][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/mshealy -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV (Person programming on a laptop on a building) -[2]: https://opensource.com/article/19/11/burnout-open-source-communities -[3]: http://www.paulgraham.com/makersschedule.html -[4]: https://www.chamberofcommerce.com/business-advice/software-development-trends-overtaking-the-market -[5]: https://amerisleep.com/blog/sleep-impacts-brain-health/ -[6]: https://www.vice.com/en_us/article/mb58a8/late-night-creativity-spike -[7]: https://www.sleepfoundation.org/articles/how-blue-light-affects-kids-sleep diff --git a/translated/tech/20200213 Why developers like to code at night.md b/translated/tech/20200213 Why developers like to code at night.md new file mode 100644 index 0000000000..9221f322cf --- /dev/null +++ b/translated/tech/20200213 Why developers like to code at night.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: (Morisun029) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why developers like to code at night) +[#]: via: (https://opensource.com/article/20/2/why-developers-code-night) +[#]: author: (Matt Shealy https://opensource.com/users/mshealy) + +开发人员为什么喜欢在晚上编码 +====== +对许多开源程序员来说,夜间工作计划是创造力和生产力来源的关键。 +![Person programming on a laptop on a building][1] + + +如果你问大多数开发人员更喜欢在什么时候工作,大部人会说他们最高效的时间在晚上。这对于那些在工作之余为开源项目做贡献的人来说更是如此(尽管如此,希望在他们的健康范围内[避免透支][2])。 + +有些人喜欢从晚上开始,一直工作到凌晨,而另一些人则很早就起床(例如,凌晨4点),以便在开始日常工作之前完成大部分编程工作。 + +这种工作习惯可能会使许多开发人员看起来像个怪胎和不称职。 但是,为什么有这么多的程序员喜欢在非正常时间工作,这其中有很多原因: + +### maker 日程 + +根据[Paul Graham][3]的观点, "生产东西" 的人倾向于遵守 maker's schedule—他们更愿意以半天或更长时间为单位使用时间。事实上,大多数 [开发人员也有相同的偏好][4]. + +一方面,开发人员从事大型抽象系统工作,需要思维空间来处理整个模型。 将他们的日程分割成15分钟或30分钟的时间段来处理电子邮件,会议,电话以及来自同事的打断,工作效果只会适得其反。 + +另一方面,通常不可能以一个小时为单位进行有效编程。 因为这么短的时间几乎不够来处理当前的任务并开始工作。 + +上下文切换也会对编程产生不利影响。 在晚上工作,开发人员可以避免尽可能多的干扰。 在没有持续中断的情况下,他们可以花几个小时专注于手头任务,并尽可能提高工作效率。 + +### 平和安静的环境 + +由于晚上或凌晨不太会有来自各种活动的噪音(例如,办公室闲谈,街道上的交通),这使许多程序员感到放松,促使他们更具创造力和生产力,特别是在处理诸如编码之类的精神刺激任务时。 + +独处与平和,加上知道自己将有几个小时不被中断的工作时间,通常会使他们摆脱白天工作计划相关的时间压力,从而产出高质量的工作。 + +更不用说了,当解决了一个棘手的问题后,没有什么比尽情享受自己最喜欢的午夜小吃更美好的事情了! + + +### 沟通 + +与在公司内里工作的程序员相比,从事开源项目的开发人员可以拥有不同的沟通节奏。 大多数开源项目的沟通都是通过邮件或 GitHub 上的评论等渠道异步完成。 很多时候,其他程序员在不同的国家和时区,因此实时交流通常需要开发人员变成一个夜猫子。 + +### 昏昏欲睡的大脑 + + +这听起来可能违反直觉,但是随着时间的推移,大脑会变得非常疲倦,因此只能专注于一项任务。 晚上工作从根本上消除了多任务处理,多任务处理是保持专注和高效的主要障碍。 当大脑处于昏昏欲睡的状态时,你是无法保持专注的! + +许多开发人员在入睡时思考要解决的问题通常会取得重大进展。 潜意识开始工作,答案通常在他们半睡半醒的早些时候就出现了。 + +这不足为奇,因为[睡眠可增强大脑功能][5],可帮助我们理解新信息并进行更有创造性的思考。当解决方案在凌晨出现时,这些开发人员便会起来并开始工作,不错过任何机会。 + + + +### 灵活和创造性思考 + +许多程序员体会到晚上创造力会提升。 前额叶皮层,即与集中能力有关的大脑部分,在一天结束时会感到疲倦。 这似乎为某些人提供了更灵活和更具创造性的思考。 + +匹兹堡大学医学院精神病学助理教授[Brant Hasler][6] 表示:“由于自上而下的控制和'认知抑制'功能较少,大脑可能会解放出来进行更多样化的思考,从而使人们更容易地将不同概念之间的联系建立起来。” 结合轻松环境所带来的积极情绪,开发人员可以更轻松地产生创新想法。 + +此外,在没有干扰的情况下集中精力几个小时,“沉浸在你做的事情中”。 这可以帮助你更好地专注于项目并参与其中,而不必担心周围发生的事情。 + +### 明亮的电脑屏幕 + + +因为整天看着明亮的屏幕, 许多程序员的睡眠周期被延迟。电脑屏幕发出的蓝光[扰乱我们的昼夜节律][7]通过延迟释放诱发睡眠的褪黑激素和提高人的机敏性将人体生物钟重置到更晚的时间。从而导致,开发人员往往睡得越来越晚。 + +### 过去的影响 + +过去,大多数开发人员是出于必要在晚上工作,因为在白天当公司其他人都在使用服务器时,共享服务器的计算能力支撑不了编程工作,所以开发人员需要等到深夜才能执行白天无法进行的任务,例如测试项目,运行大量的代码编译运行调试周期以及部署新代码。现在尽管服务器功能变强大了,大多数可以满足需求,但夜间工作的趋势仍是这种文化的一部分。 + +### 结语 + +尽管开发人员喜欢在晚上工作出于多种原因,但请记住,成为夜猫子并不意味着你应该克扣睡眠时间。 睡眠不足会导致压力和焦虑,并最终导致倦怠。 + +获得足够质量的睡眠是维持良好身体健康和大脑功能的关键。 例如,它可以帮助你整合新信息,巩固记忆,创造性思考,清除身体积聚的毒素,调节食欲并防止过早衰老。 + +无论你是哪种日程,请确保让你的大脑得到充分的休息,这样你就可以在一整天及每天的工作中发挥最大的作用! + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/why-developers-code-night + +作者:[Matt Shealy][a] +选题:[lujun9972][b] +译者:[Morisun029](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mshealy +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV (Person programming on a laptop on a building) +[2]: https://opensource.com/article/19/11/burnout-open-source-communities +[3]: http://www.paulgraham.com/makersschedule.html +[4]: https://www.chamberofcommerce.com/business-advice/software-development-trends-overtaking-the-market +[5]: https://amerisleep.com/blog/sleep-impacts-brain-health/ +[6]: https://www.vice.com/en_us/article/mb58a8/late-night-creativity-spike +[7]: https://www.sleepfoundation.org/articles/how-blue-light-affects-kids-sleep From 2794e22267eb858b933fb0607be38930726be331 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Tue, 18 Feb 2020 20:48:01 +0800 Subject: [PATCH 057/315] translating --- .../20200215 The Background Story of AppImage -Interview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20200215 The Background Story of AppImage -Interview.md b/sources/talk/20200215 The Background Story of AppImage -Interview.md index d3e95a1a0f..bccde9edaa 100644 --- a/sources/talk/20200215 The Background Story of AppImage -Interview.md +++ b/sources/talk/20200215 The Background Story of AppImage -Interview.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Morisun029) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7624e0be715de170460f97b511a7930c0d3dccf4 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Tue, 18 Feb 2020 23:50:25 +0800 Subject: [PATCH 058/315] Revert "translating" This reverts commit 2794e22267eb858b933fb0607be38930726be331. --- .../20200215 The Background Story of AppImage -Interview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20200215 The Background Story of AppImage -Interview.md b/sources/talk/20200215 The Background Story of AppImage -Interview.md index bccde9edaa..d3e95a1a0f 100644 --- a/sources/talk/20200215 The Background Story of AppImage -Interview.md +++ b/sources/talk/20200215 The Background Story of AppImage -Interview.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (Morisun029) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7010c718c178aae93e910afa83d6d8b47564819c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 Feb 2020 00:59:45 +0800 Subject: [PATCH 059/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200219=20Basic?= =?UTF-8?q?=20Vim=20Commands=20You=20Need=20to=20Know=20to=20Work=20in=20V?= =?UTF-8?q?im=20Editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md --- ... You Need to Know to Work in Vim Editor.md | 168 ++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md diff --git a/sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md b/sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md new file mode 100644 index 0000000000..657fb6a93b --- /dev/null +++ b/sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md @@ -0,0 +1,168 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Basic Vim Commands You Need to Know to Work in Vim Editor) +[#]: via: (https://www.2daygeek.com/basic-vim-commands-cheat-sheet-quick-start-guide/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Basic Vim Commands You Need to Know to Work in Vim Editor +====== + +If you are a system administrator or developer, you may need to edit a file while working on the Linux terminal. + +There are several file editors on Linux, and how to choose the right one for your needs. + +I would like to recommend Vim editor. + +### You may ask, why? + +You may spend more time in the editor to modify an existing file than writing new text. + +In this case, Vim Keyboard shortcuts allow you to efficiently meet your needs. + +The following articles may help you learn about file and directory manipulation. + + * [**L**][1]**[inux Basic – Linux and Unix Commands for File and Directory Manipulation][1]** + * **[10 Methods to View Different File Formats in Linux][2]** + + + +### What’s vim? + +Vim is one of the most popular and powerful text editor that widely used by Linux administrators and developers. + +It’s highly configurable text editor which enables efficient text editing. This is an updated version of the vi editor, which is already installed on most Unix systems. + +Vim is often called a “programmer’s editor,” but it is not limited to it, and is suitable for all types of text editing. + +It comes with many features like multi level undo, multi windows and buffers, syntax highlighting, command line editing, file name completion, visual selection. + +You can easily obtain online help with the “:help” command. + +### Understanding Vim Modes + +Vim has two modes, the details are below: + +**Command Mode:** When you launch Vim Editor, you will default to Command Mode. You can move around the file, and modify some parts of the text, cut, copy, and paste parts of the text and issue commands to do more (press ESC for Command Mode). + +**Insert Mode:** The nsert mode is used to type text in a given given document (Press i for insert mode). + +### How do I know which Vim mode I am on? + +If you are in insert mode, you will see **“INSERT”** at the bottom of the editor. If nothing is shown, or if it shows the file name at the bottom of the editor, you are in “Command Mode”. + +### Cursor Movement in Normal Mode + +These Vim keyboard shortcuts allow you to move your cursor around a file in different ways. + + * `G` – Go to the last line of the file + * `gg` – Go to the first line of the file + * `$` – Go to the end of line. + * `0` (zero) – Go to the beginning of line. + + + * `w` – Jump by start of words + * `W` – Jump by words (spaces separate words) + * `b` – Jump backward by words + * `B` – Jump backward by words (spaces separate words) + + + * `PgDn` Key – Move down page-wise + * `PgUp` Key – Move up page-wise + * `Ctrl+d` – Move half-page down + * `Ctrl+u` – Move half-page up + + + +### Insert mode – insert a text + +These vim keyboard shortcuts allows you to insert a cursor in varies position based on your needs. + + * `i` – Insert before the cursor + * `a` – Insert after the cursor + * `I` – Insert at the beginning of the line, this is useful when you are in the middle of the line. + * `A` – Insert at the end of the line + * `o` – Open a new line below the current line + * `O` – Append a new line above the current line + * `ea` – Insert at the end of the word + + + +### Copy, Paste and Delete a Line + + * `yy` – yank (copy) a line + * `p/P` – Paste after cursor/ put before cursor + * `dd` – delete a line + * `dw` – delete the word + + + +### Search and Replace Pattern in Vim + + * `/pattern` – To search a given pattern + * `?pattern` – To search backward a given pattern + * `n` – To repeat search + * `N` – To repeat backward search + + + * `:%s/old-pattern/new-pattern/g` – Replace all old formats with the new format across the file. + * `:s/old-pattern/new-pattern/g` – Replace all old formats with the new format in the current line. + * `:%s/old-pattern/new-pattern/gc` – Replace all old formats with the new format across the file with confirmations. + + + +### How do I go to a particular line in Vim Editor + +You can do this in two ways, depending on your need. If you don’t know the line number I suggest you go with the first method. + +Add line number by opening a file and running the command below. + +``` +:set number +``` + +Once you have set the line number, press **“: n”** to go to the corresponding line number. For example, if you want to go to **line 15**, enter. + +``` +:15 +``` + +If you already know the line number, use the following method to go directly to the corresponding line. For example, if you want to move to line 20, enter the command below. + +``` +$ vim +20 [File_Name] +``` + +### Undo/Redo/Repeat Operation + + * `u` – Undo the changes + * `Ctrl+r` – Redo the changes + * `.` – Repeat last command + + + +### Saving and Exiting Vim + + * `:w` – Save the changes but don’t exit + * `:wq` – Write and quit + * `:q!` – Force quit + + + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/basic-vim-commands-cheat-sheet-quick-start-guide/ + +作者:[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]: https://www.2daygeek.com/linux-basic-commands-file-directory-manipulation/ +[2]: https://www.2daygeek.com/unix-linux-command-to-view-file/ From b6844a227e1a4c3bbae459f13952b8dc68317e71 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 Feb 2020 01:00:50 +0800 Subject: [PATCH 060/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200217=20How=20?= =?UTF-8?q?to=20get=20MongoDB=20Server=20on=20Fedora?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200217 How to get MongoDB Server on Fedora.md --- ...217 How to get MongoDB Server on Fedora.md | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 sources/tech/20200217 How to get MongoDB Server on Fedora.md diff --git a/sources/tech/20200217 How to get MongoDB Server on Fedora.md b/sources/tech/20200217 How to get MongoDB Server on Fedora.md new file mode 100644 index 0000000000..6f85674c67 --- /dev/null +++ b/sources/tech/20200217 How to get MongoDB Server on Fedora.md @@ -0,0 +1,132 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to get MongoDB Server on Fedora) +[#]: via: (https://fedoramagazine.org/how-to-get-mongodb-server-on-fedora/) +[#]: author: (Honza Horak https://fedoramagazine.org/author/hhorak/) + +How to get MongoDB Server on Fedora +====== + +![][1] + +Mongo (from “humongous”) is a high-performance, open source, schema-free document-oriented database, which is one of the most favorite so-called [NoSQL][2] databases. It uses JSON as a document format, and it is designed to be scalable and replicable across multiple server nodes. + +### Story about license change + +It’s been more than a year when the upstream MongoDB decided to change the license of the Server code. The previous license was GNU Affero General Public License v3 (AGPLv3). However, upstream wrote a new license designed to make companies running MongoDB as a service contribute back to the community. The new license is called Server Side Public License (SSPLv1) and more about this step and its rationale can be found at [MongoDB SSPL FAQ][3]. + +Fedora has always included only free (as in “freedom”) software. When SSPL was released, Fedora [determined][4] that it is not a free software license in this meaning. All versions of MongoDB released before the license change date (October 2018) could be potentially kept in Fedora, but never updating the packages in the future would bring security issues. Hence the Fedora community decided to [remove the MongoDB server][5] entirely, starting Fedora 30. + +### What options are left to developers? + +Well, alternatives exist, for example PostgreSQL also supports JSON in the recent versions, and it can be used in cases when MongoDB cannot be used any more. With JSONB type, indexing works very well in PostgreSQL with performance comparable with MongoDB, and even without any compromises from ACID. + +The technical reasons that a developer may have chosen MongoDB did not change with the license, so many still want to use it. What is important to realize is that the SSPL license was only changed to the MongoDB server. There are other projects that MongoDB upstream develops, like MongoDB tools, C and C++ client libraries and connectors for various dynamic languages, that are used on the client side (in applications that want to communicate with the server over the network). Since the license is kept free (Apache License mostly) for those packages, they are staying in Fedora repositories, so users can use them for the application development. + +The only change is really the server package itself, which was removed entirely from Fedora repos. Let’s see what a Fedora user can do to get the non-free packages. + +### How to install MongoDB server from the upstream + +When Fedora users want to install a MongoDB server, they need to approach MongoDB upstream directly. However, the upstream does not ship RPM packages for Fedora itself. Instead, the MongoDB server is either available as the source tarball, that users need to compile themselves (which requires some developer knowledge), or Fedora user can use some compatible packages. From the compatible options, the best choice is the RHEL-8 RPMs at this point. The following steps describe, how to install them and how to start the daemon. + +#### 1\. Create a repository with upstream RPMs (RHEL-8 builds) +``` + +``` + +$ sudo cat > /etc/yum.repos.d/mongodb.repo &lt;&lt;EOF +[mongodb-upstream] +name=MongoDB Upstream Repository +baseurl= +gpgcheck=1 +enabled=1 +gpgkey= +EOF +``` + +``` + +#### 2\. Install the meta-package, that pulls the server and tools packages +``` + +``` + +$ sudo dnf install mongodb-org +&lt;snipped> +Installed: +  mongodb-org-4.2.3-1.el8.x86_64           mongodb-org-mongos-4.2.3-1.el8.x86_64   +  mongodb-org-server-4.2.3-1.el8.x86_64    mongodb-org-shell-4.2.3-1.el8.x86_64 +  mongodb-org-tools-4.2.3-1.el8.x86_64           + +Complete! +``` + +``` + +#### 3\. Start the MongoDB daemon +``` + +``` + +$ sudo systemctl status mongod +● mongod.service - MongoDB Database Server +   Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled) +   Active: active (running) since Sat 2020-02-08 12:33:45 EST; 2s ago +     Docs: +  Process: 15768 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS) +  Process: 15769 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS) +  Process: 15770 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS) +  Process: 15771 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS) + Main PID: 15773 (mongod) +   Memory: 70.4M +      CPU: 611ms +   CGroup: /system.slice/mongod.service +           └─15773 /usr/bin/mongod -f /etc/mongod.conf +``` + +``` + +#### 4\. Verify that the server runs by connecting to it from the mongo shell +``` + +``` + +$ mongo +MongoDB shell version v4.2.3 +connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&amp;gssapiServiceName=mongodb +Implicit session: session { "id" : UUID("20b6e61f-c7cc-4e9b-a25e-5e306d60482f") } +MongoDB server version: 4.2.3 +Welcome to the MongoDB shell. +For interactive help, type "help". +For more comprehensive documentation, see +    +\--- + +> _ +``` + +``` + +That’s all. As you see, the RHEL-8 packages are pretty compatible and it should stay that way for as long as the Fedora packages remain compatible with what’s in RHEL-8. Just be careful that you comply with the SSPLv1 license in your use. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-to-get-mongodb-server-on-fedora/ + +作者:[Honza Horak][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/hhorak/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/mongodb-816x348.png +[2]: https://en.wikipedia.org/wiki/NoSQL +[3]: https://www.mongodb.com/licensing/server-side-public-license/faq +[4]: https://lists.fedoraproject.org/archives/list/legal@lists.fedoraproject.org/thread/IQIOBOGWJ247JGKX2WD6N27TZNZZNM6C/ +[5]: https://fedoraproject.org/wiki/Changes/MongoDB_Removal From 031fc29834aa69b5be463a5430d93768699c2707 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 Feb 2020 01:10:24 +0800 Subject: [PATCH 061/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200219=20How=20?= =?UTF-8?q?to=20Install=20Latest=20Git=20Version=20on=20Ubuntu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200219 How to Install Latest Git Version on Ubuntu.md --- ...to Install Latest Git Version on Ubuntu.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 sources/tech/20200219 How to Install Latest Git Version on Ubuntu.md diff --git a/sources/tech/20200219 How to Install Latest Git Version on Ubuntu.md b/sources/tech/20200219 How to Install Latest Git Version on Ubuntu.md new file mode 100644 index 0000000000..ef76a58b66 --- /dev/null +++ b/sources/tech/20200219 How to Install Latest Git Version on Ubuntu.md @@ -0,0 +1,135 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Install Latest Git Version on Ubuntu) +[#]: via: (https://itsfoss.com/install-git-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Install Latest Git Version on Ubuntu +====== + +Installing Git on Ubuntu is very easy. It is available in the [main repository of Ubuntu][1] and you can install it [using the apt command][2] like this: + +``` +sudo apt install git +``` + +Easy? Isn’t it? + +There is only a slight little problem (which might not be a problem at all) and that is the version of [Git][3] it installs. + +On an LTS system, the software stability is of upmost importance this is why Ubuntu 18.04 and other distributions often provide older but stable version of a software that is well tested with the distribution release. + +This is why when you check the Git version, you’ll see that it installs a version which is older than the [current Git version available on Git project’s website][4]: + +``` +[email protected]:~$ git --version +git version 2.17.1 +``` + +At the time of writing this tutorial, the version available on its website is 2.25. So how do you install the latest Git on Ubuntu then? + +### Install latest Git on Ubuntu-based Linux distributions + +![][5] + +One way would be to [install from source code][6]. That cool, old school method is not everyone’s cup of tea. Thankfully, there is a [PPA available from Ubuntu Git Maintainers team][7] that you can use to easily install the latest stable Git version. + +``` +sudo add-apt-repository ppa:git-core/ppa +sudo apt update +sudo apt install git +``` + +Even if you had installed Git using apt previously, it will get updated to the latest stable version. + +``` +[email protected]:~$ git --version +git version 2.25.0 +``` + +The beauty of [using PPA][8] is that if there is a new stable version of Git released, you’ll get it with the system updates. [Just update Ubuntu][9] to get the latest Git stable version. + +Trivia + +Did you know that Git version control system was created by none other than [Linux creator Linus Torvalds][10]? + +### Configure Git [Recommended for developers] + +If you have installed Git for development purposes, you’ll soon start cloning repos, make your changes and commit your change. + +If you try to commit your code, you may see a ‘Please tell me who you are’ error like this: + +``` +[email protected]:~/compress-pdf$ git commit -m "update readme" + +*** Please tell me who you are. + +Run + + git config --global user.email "[email protected]" + git config --global user.name "Your Name" + +to set your account's default identity. +Omit --global to set the identity only in this repository. + +fatal: unable to auto-detect email address (got '[email protected](none)') +``` + +This is because you haven’t configured Git with your personal information which is mandatory. + +As the error already hints, you can set up global Git configuration like this: + +``` +git config --global user.name "Your Name" +git config --global user.email "[email protected]" +``` + +You can check the Git configuration with this command: + +``` +git config --list +``` + +It should show an output like this: + +``` +[email protected] +user.name=abhishek +``` + +This configuration is stored in ~/.gitconfig file. You may also change it manually to change the configuration. + +* * * + +**In the end…** + +I hope this quick little tutorial helped you to install Git on Ubuntu. With the PPA, you easily get the latest Git version. + +If you have any questions or suggestions, please feel free to ask in the comment section. A quick ‘thank you’ is also welcomed :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-git-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-repositories/ +[2]: https://itsfoss.com/apt-command-guide/ +[3]: https://git-scm.com/ +[4]: https://git-scm.com/downloads +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/install_git_ubuntu.png?ssl=1 +[6]: https://itsfoss.com/install-software-from-source-code/ +[7]: https://launchpad.net/~git-core/+archive/ubuntu/ppa +[8]: https://itsfoss.com/ppa-guide/ +[9]: https://itsfoss.com/update-ubuntu/ +[10]: https://itsfoss.com/linus-torvalds-facts/ From 4add74d7d546dbd309d6f139ee2553eac6ea3e90 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 Feb 2020 01:11:02 +0800 Subject: [PATCH 062/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200219=20Waterf?= =?UTF-8?q?ox:=20Firefox=20Fork=20With=20Legacy=20Add-ons=20Options?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md --- ...irefox Fork With Legacy Add-ons Options.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/tech/20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md diff --git a/sources/tech/20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md b/sources/tech/20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md new file mode 100644 index 0000000000..8593b5a981 --- /dev/null +++ b/sources/tech/20200219 Waterfox- Firefox Fork With Legacy Add-ons Options.md @@ -0,0 +1,110 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Waterfox: Firefox Fork With Legacy Add-ons Options) +[#]: via: (https://itsfoss.com/waterfox-browser/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Waterfox: Firefox Fork With Legacy Add-ons Options +====== + +_**Brief: In this week’s open source software highlight, we take a look at a Firefox-based browser that supports legacy extensions that Firefox no longer supports while potentially providing fast user experience.**_ + +When it comes to web browsers, Google Chrome leads the market share. [Mozilla Firefox is there still providing hopes for a mainstream web browser that respects your privacy][1]. + +Firefox has improved a lot lately and one of the side-effects of the improvements is removal of add-ons. If your favorite add-on disappeared in last few months/years, you have a good new in the form of Witerfox. + +Attention! + +It’s been brought to our notice that Waterfox has been acquired by System1. This company also acquired privacy focused search engine Startpage. +While System1 claims that they are providing privacy focused products because ‘there is a demand’, we cannot vouch for their claim. +In other words, it’s up to you to trust System1 and Waterfox. + +### Waterfox: A Firefox-based Browser + +![Waterfox Classic][2] + +[Waterfox][3] is a useful open-source browser built on top of Firefox that focuses on privacy and supports legacy extensions. It doesn’t pitch itself as a privacy-paranoid browser but it does respect the basics. + +You get two separate Waterfox browser versions. The current edition aims to provide a modern experience and the classic version focuses to support [NPAPI plugins][4] and [bootstrap extensions][5]. + +![Waterfox Classic][6] + +If you do not need to utilize bootstrap extensions but rely on [WebExtensions][7], Waterfox Current is the one you should go for. + +And, if you need to set up a browser that needs NPAPI plugins or bootstrap extensions extensively, Waterfox Classic version will be suitable for you. + +So, if you like Firefox, but want to try something different on the same line, this is a Firefox alternative for the job. + +### Features of Waterfox + +![Waterfox Current][8] + +Of course, technically, you should be able to do a lot of things that Mozilla Firefox supports. + +So, I’ll just highlight all the important features of Waterfox in a list here. + + * Supports NPAPI Plugins + * Supports Bootstrap Extensions + * Offers separate editions for legacy extension support and modern WebExtension support. + * Cross-platform support (Windows, Linux, and macOS) + * Theme customization + * Archived Add-ons supported + + + +### Installing Waterfox on Ubuntu/Linux + +Unlike other popular browsers, you don’t get a package to install. So, you will have to download the archived package from its [official download page][9]. + +![][10] + +Depending on what edition (Current/Classic) you want – just download the file, which will be **.tar.bz2** extension file. + +Once downloaded, simply extract the file. + +Next, head on to the extracted folder and look for the “**Waterfox**” file. You can simply double-click on it to run start up the browser. + +If that doesn’t work, you can utilize the terminal and navigate to the extracted **Waterfox** folder. Once there, you can simply run it with a single command. Here’s how it looks like: + +``` +cd waterfox-classic +./waterfox +``` + +In either case, you can also head to its [GitHub page][11] and explore more options to get it installed on your system. + +[Download Waterfox][3] + +**Wrapping up** + +I fired it up on my Pop!_OS 19.10 installation and it worked really well for me. Though I don’t think I could switch from Firefox to Waterfox because I am not using any legacy add-on. It could still be an impressive option for certain users. + +You could give it a try and let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/waterfox-browser/ + +作者:[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://itsfoss.com/why-firefox/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/waterfox-classic.png?fit=800%2C423&ssl=1 +[3]: https://www.waterfox.net/ +[4]: https://en.wikipedia.org/wiki/NPAPI +[5]: https://wiki.mozilla.org/Extension_Manager:Bootstrapped_Extensions +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/waterfox-classic-screenshot.jpg?ssl=1 +[7]: https://wiki.mozilla.org/WebExtensions +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/waterfox-screenshot.jpg?ssl=1 +[9]: https://www.waterfox.net/download/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/waterfox-download-page.jpg?ssl=1 +[11]: https://github.com/MrAlex94/Waterfox From 38cb05a52b842a688af4b82bcc9d695050bb5f2c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 Feb 2020 01:12:45 +0800 Subject: [PATCH 063/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200219=20Here?= =?UTF-8?q?=20Are=20The=20Most=20Beautiful=20Linux=20Distributions=20in=20?= =?UTF-8?q?2020?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md --- ...t Beautiful Linux Distributions in 2020.md | 182 ++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 sources/tech/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md diff --git a/sources/tech/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md b/sources/tech/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md new file mode 100644 index 0000000000..3188c97fa7 --- /dev/null +++ b/sources/tech/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md @@ -0,0 +1,182 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Here Are The Most Beautiful Linux Distributions in 2020) +[#]: via: (https://itsfoss.com/beautiful-linux-distributions/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Here Are The Most Beautiful Linux Distributions in 2020 +====== + +It’s a no-brainer that there’s a Linux distribution for every user – no matter what they prefer or what they want to do. + +Starting out with Linux? You can go with the [Linux distributions for beginners][1]. Switching from Windows? You have [Windows-like Linux distributions][2]. Have an old computer? You can [use lightweight Linux distros][3]. + +In this list, I’m going to focus only on the most beautiful Linux distros out there. + +### Top 7 Most Beautiful Linux Distributions + +![][4] + +Wait! Is there a thing called a beautiful Linux distribution? Is it not redundant considering the fact that you can customize the looks of any distribution and make it look better with [themes][5] and [icons][6]? + +You are right about that. But here, I am talking about the distributions that look great without any tweaks and customization effort from the user’s end. These distros provide a seamless, pleasant desktop experience right out of the box. + +**Note:** _The list is in no particular order of ranking._ + +#### 1\. elementary OS + +![][7] + +elementary OS is one of the most beautiful Linux distros out there. It leans on a macOS-ish look while providing a great user experience for Linux users. If you’re already comfortable macOS – you will have no problem using the elementary OS. + +Also, elementary OS is based on Ubuntu – so you can easily find plenty of applications to get things done. + +Not just limited to the look and feel – but the elementary OS is always hard at work to introduce meaningful changes. So, you can expect the user experience to improve with every update you get. + +[elementary OS][8] + +#### 2\. Deepin + +![][9] + +Deepin is yet another beautiful Linux distro originally based on Debian’s stable branch. The animations (look and feel) could be too overwhelming for some – but it looks pretty. + +It features its own Deepin Desktop Environment that involves a mix of essential features for the best user experience possible. It may not exactly resemble the UI of any other distribution but it’s quite easy to get used to. + +My personal attention would go to the control center and the color scheme featured in Deepin OS. You can give it a try – it’s worth taking a look. + +[Deepin][10] + +#### 3\. Pop!_OS + +![][11] + +Pop!_OS manages to offer a great UI on top of Ubuntu while offering a pure [GNOME][12] experience. + +It also happens to be my personal favorite which I utilize as my primary desktop OS. Pop!_OS isn’t flashy – nor involves any fancy animations. However, they’ve managed to get things right by having a perfect combo of icon/themes – while polishing the user experience from a technical point of view. + +I don’t want to initiate a [Ubuntu vs Pop OS][13] debate but if you’re used to Ubuntu, Pop!_OS can be a great alternative for potentially better user experience. + +[Pop!_OS][14] + +#### 4\. Manjaro Linux + +![][15] + +Manjaro Linux is an [Arch][16]-based Linux distribution. While [installing Arch Linux][17] is a slightly complicated job, Manjaro provides an easier and smoother Arch experience. + +It offers a variety of [desktop environment editions][18] to choose from while downloading. No matter what you choose, you still get enough options to customize the look and feel or the layout. + +To me, it looks quite fantastic for an Arch-based distribution that works out of the box – you can give it a try! + +[Manjaro Linux][19] + +#### 5\. KDE Neon + +![][20] + +[KDE Neon][21] is for the users who want a simplified approach to the design language but still get a great user experience. + +It is a lightweight Linux distro which is based on Ubuntu. As the name suggests, it features the KDE Plasma desktop and looks absolutely beautiful. + +KDE Neon gives you the latest and greatest KDE Plasma desktop and KDE applications. Unlike [Kubuntu][22] or other KDE-based distributions, you don’t have to wait for months to get the new [KDE software][23]. + +You get a lot of customization options built-in with the KDE desktop – so feel free to try it out! + +[KDE Neon][24] + +#### 6\. Zorin OS + +![][25] + +Without a doubt, Zorin OS is an impressive Linux distro that manages to provide a good user experience – even with its lite edition. + +You can try either the full version or the lite edition (with [Xfce desktop][26]). The UI is tailored for Windows and macOS users to get used to. While based on Ubuntu, it provides a great user experience with what it has to offer. + +If you start like its user interface – you can also try [Zorin Grid][27] to manage multiple computers running Zorin OS at your workplace/home. With the ultimate edition, you can also control the layout of your desktop (as shown in the image above). + +[Zorin OS][28] + +#### 7\. Nitrux OS + +![][29] + +[Nitrux OS][30] is a unique take on a Linux distribution which is somewhat based on Ubuntu – but not completely. + +It focuses on providing a good user experience to the users who are looking for a unique design language with a fresh take on a Linux distro. It uses Nomad desktop which is based on KDE. + +Nitrux encourages to use of [AppImage][31] for applications. But you can also use Arch Linux’s pacman package manager in Nitrux which is based on Ubuntu. Awesome, isn’t it? + +Even if it’s not the perfect OS to have installed (yet), it sure looks pretty and good enough for most of the basic tasks. You can also know more about it when you read our [interview with Nitrux’s founder][32]. + +Here’s a slightly old video of Nitrux but it still looks good: + +[Nitrux OS][33] + +#### Bonus: eXtern OS (in ‘stagnated’ development) + +![][34] + +If you want to try an experimental Linux distro, extern OS is going to be beautiful. + +It isn’t actively maintained and should not be used for production systems. Yet, it provides unique user experience (thought not polished enough). + +Just for the sake of trying a good-looking Linux distro, you can give it a try to experience it. + +[eXtern OS][35] + +**Wrapping Up** + +Now, as the saying goes, beauty lies in the eyes of the beholder. So this list of beautiful Linux distributions is from my point of view. Feel free to disagree (politely of course) and mention your favorites. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/beautiful-linux-distributions/ + +作者:[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://itsfoss.com/best-linux-beginners/ +[2]: https://itsfoss.com/windows-like-linux-distributions/ +[3]: https://itsfoss.com/lightweight-linux-beginners/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/beautiful-linux-distros.png?ssl=1 +[5]: https://itsfoss.com/best-gtk-themes/ +[6]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/elementary-os-hera.png?ssl=1 +[8]: https://elementary.io/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/deepin-screenshot.jpg?ssl=1 +[10]: https://www.deepin.org/en/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/pop-os-stock.jpg?ssl=1 +[12]: https://www.gnome.org/ +[13]: https://itsfoss.com/pop-os-vs-ubuntu/ +[14]: https://system76.com/pop +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/manjaro_kde.jpg?ssl=1 +[16]: https://en.wikipedia.org/wiki/Arch +[17]: https://itsfoss.com/install-arch-linux/ +[18]: https://itsfoss.com/best-linux-desktop-environments/ +[19]: https://manjaro.org/download/ +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-neon-screenshot.jpg?ssl=1 +[21]: https://itsfoss.com/kde-neon-unveiled/ +[22]: https://kubuntu.org/ +[23]: https://kde.org/ +[24]: https://neon.kde.org/ +[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/11/zorin-lite-ultimate-appearance.jpg?ssl=1 +[26]: https://www.xfce.org/ +[27]: https://itsfoss.com/zorin-grid/ +[28]: https://zorinos.com/ +[29]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/nitrux-screenshot.jpg?ssl=1 +[30]: https://itsfoss.com/nitrux-linux-overview/ +[31]: https://itsfoss.com/use-appimage-linux/ +[32]: https://itsfoss.com/nitrux-linux/ +[33]: https://nxos.org/ +[34]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/extern-os.png?ssl=1 +[35]: https://externos.io/ From 5c01dcd6de8d90d457e2b21b72245906f3f4b9da Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 Feb 2020 01:14:08 +0800 Subject: [PATCH 064/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200218=2010=20G?= =?UTF-8?q?rafana=20features=20you=20need=20to=20know=20for=20effective=20?= =?UTF-8?q?monitoring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200218 10 Grafana features you need to know for effective monitoring.md --- ...u need to know for effective monitoring.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/tech/20200218 10 Grafana features you need to know for effective monitoring.md diff --git a/sources/tech/20200218 10 Grafana features you need to know for effective monitoring.md b/sources/tech/20200218 10 Grafana features you need to know for effective monitoring.md new file mode 100644 index 0000000000..92f1cc3455 --- /dev/null +++ b/sources/tech/20200218 10 Grafana features you need to know for effective monitoring.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 Grafana features you need to know for effective monitoring) +[#]: via: (https://opensource.com/article/20/2/grafana-features) +[#]: author: (Daniel Lee https://opensource.com/users/daniellee) + +10 Grafana features you need to know for effective monitoring +====== +Learn how to make the most of this open source dashboard tool. +![metrics and data shown on a computer screen][1] + +The [Grafana][2] project [started in 2013][3] when [Torkel Ödegaard][4] decided to fork Kibana and turn it into a time-series and graph-focused dashboarding tool. His guiding vision: to make everything look more clean and elegant, with fewer things distracting you from the data. + +More than 500,000 active installations later, Grafana dashboards are ubiquitous and instantly recognizable. (Even during a [SpaceX launch][5]!) + +Whether you're a recent adopter or an experienced power user, you may not be familiar with all of the features that [Grafana Labs][6]—the company formed to accelerate the adoption of the Grafana project and to build a sustainable business around it—and the Grafana community at large have developed over the past 6+ years. + +Here's a look at some of the most impactful: + + 1. **Dashboard templating**: One of the key features in Grafana, templating allows you to create dashboards that can be reused for lots of different use cases. Values aren't hard-coded with these templates, so for instance, if you have a production server and a test server, you can use the same dashboard for both. Templating allows you to drill down into your data, say, from all data to North America data, down to Texas data, and beyond. You can also share these dashboards across teams within your organization—or if you create a great dashboard template for a popular data source, you can contribute it to the whole community to customize and use. + 2. **Provisioning**: While it's easy to click, drag, and drop to create a single dashboard, power users in need of many dashboards will want to automate the setup with a script. You can script anything in Grafana. For example, if you're spinning up a new Kubernetes cluster, you can also spin up a Grafana automatically with a script that would have the right server, IP address, and data sources preset and locked. It's also a way of getting control over a lot of dashboards. + 3. **Annotations:** This feature, which shows up as a graph marker in Grafana, is useful for correlating data in case something goes wrong. You can create the annotations manually—just control-click on a graph and input some text—or you can fetch data from any data source. (Check out how Wikimedia uses annotations on its [public Grafana dashboard][7], and here is [another example][8] from the OpenHAB community.) A good example is if you automatically create annotations around releases, and a few hours after a new release, you start seeing a lot of errors, then you can go back to your annotation and correlate whether the errors started at the same time as the release. This automation can be achieved using the Grafana HTTP API (see examples [here][9] and [here][10]). Many of Grafana's largest customers use the HTTP API for a variety of tasks, particularly setting up databases and adding users. It's an alternative to provisioning for automation, and you can do more with it. For instance, the team at DigitalOcean used the API to integrate a [snapshot feature for reviewing dashboards][11]. + 4. **Kiosk mode and playlists:** If you want to display your Grafana dashboards on a TV monitor, you can use the playlist feature to pick the dashboards that you or your team need to look at through the course of the day and have them cycle through on the screen. The [kiosk mode][12] hides all the user interface elements that you don't need in view-only mode. Helpful hint: The [Grafana Kiosk][13] utility handles logging in, switching to kiosk mode, and opening a playlist—eliminating the pain of logging in on a TV that has no keyboard. + 5. **Custom plugins:** Plugins allow you to extend Grafana with integrations with other tools, different visualizations, and more. Some of the most popular in the community are [Worldmap Panel][14] (for visualizing data on top of a map), [Zabbix][15] (an integration with Zabbix metrics), and [Influx Admin Panel][16] (which offers other functionality like creating databases or adding users). But they're only the tip of the iceberg. Just by writing a bit of code, you can get anything that produces a timestamp and a value visualized in Grafana. Plus, Grafana Enterprise customers have access to more plugins for integrations with Splunk, Datadog, New Relic, and others. + 6. **Alerting and alert hooks:** If you're using Grafana alerting, you can have alerts sent through a number of different notifiers, including PagerDuty, SMS, email, or Slack. Alert hooks allow you to create different notifiers with a bit of code if you prefer some other channels of communication. + 7. **Permissions and teams**: When organizations have one Grafana and multiple teams, they often want the ability to both keep things separate and share dashboards. Early on, the default in Grafana was that everybody could see everyone else's dashboards, and that was it. Later, Grafana introduced multi-tenant mode, in which you can switch organizations but can't share dashboards. Some people were using huge hacks to enable both, so Grafana decided to officially create an easier way to do this. Now you can create a team of users and then set permissions on folders, dashboards, and down to the data source level if you're using Grafana Enterprise. + 8. **SQL data sources:** Grafana's native support for SQL helps you turn anything—not just metrics—in an SQL database into metric data that you can graph. Power users are using SQL data sources to do a whole bunch of interesting things, like creating business dashboards that "make sense for your boss's boss," as the team at Percona put it. Check out their [presentation at GrafanaCon][17]. + 9. **Monitoring your monitoring**: If you're serious about monitoring and you want to monitor your own monitoring, Grafana has its own Prometheus HTTP endpoint that Prometheus can scrape. It's quite simple to get dashboards and statics. There's also an enterprise version in development that will offer Google Analytics-style easy access to data, such as how much CPU your Grafana is using or how long alerting is taking. + 10. **Authentication**: Grafana supports different authentication styles, such as LDAP and OAuth, and allows you to map users to organizations. In Grafana Enterprise, you can also map users to teams: If your company has its own authentication system, Grafana allows you to map the teams in your internal systems to teams in Grafana. That way, you can automatically give people access to the dashboards designated for their teams. + + + +Want to take a deeper dive? Join the [Grafana community][18], check out the [how-to section][19], and share what you think. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/grafana-features + +作者:[Daniel Lee][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/daniellee +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://github.com/grafana/grafana +[3]: https://grafana.com/blog/2019/09/03/the-mostly-complete-history-of-grafana-ux/ +[4]: https://grafana.com/author/torkel +[5]: https://youtu.be/ANv5UfZsvZQ?t=29 +[6]: https://grafana.com/ +[7]: https://grafana.wikimedia.org/d/000000143/navigation-timing?orgId=1&refresh=5m +[8]: https://community.openhab.org/t/howto-create-annotations-in-grafana-via-rules/48929 +[9]: https://docs.microsoft.com/en-us/azure/devops/service-hooks/services/grafana?view=azure-devops +[10]: https://medium.com/contentsquare-engineering-blog/from-events-to-grafana-annotation-f35aafe8bd3d +[11]: https://youtu.be/kV3Ua6guynI +[12]: https://play.grafana.org/d/vmie2cmWz/bar-gauge?orgId=1&refresh=10s&kiosk +[13]: https://github.com/grafana/grafana-kiosk +[14]: https://grafana.com/grafana/plugins/grafana-worldmap-panel +[15]: https://grafana.com/grafana/plugins/alexanderzobnin-zabbix-app +[16]: https://grafana.com/grafana/plugins/natel-influx-admin-panel +[17]: https://www.youtube.com/watch?v=-xlchgoqkqY +[18]: https://community.grafana.com/ +[19]: https://community.grafana.com/c/howto/6 From 4be14bc3adad2c1e4412c46c7eaba15ad7893002 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 Feb 2020 01:14:39 +0800 Subject: [PATCH 065/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200218=20Gettin?= =?UTF-8?q?g=20started=20with=20OpenTaxSolver?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200218 Getting started with OpenTaxSolver.md --- ...0218 Getting started with OpenTaxSolver.md | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 sources/tech/20200218 Getting started with OpenTaxSolver.md diff --git a/sources/tech/20200218 Getting started with OpenTaxSolver.md b/sources/tech/20200218 Getting started with OpenTaxSolver.md new file mode 100644 index 0000000000..b0b1ba1677 --- /dev/null +++ b/sources/tech/20200218 Getting started with OpenTaxSolver.md @@ -0,0 +1,124 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with OpenTaxSolver) +[#]: via: (https://opensource.com/article/20/2/do-your-taxes-open-source-way) +[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) + +Getting started with OpenTaxSolver +====== +If you're a United States citizen, learn how to do your own state tax +returns with OpenTaxSolver. +![A document flying away][1] + +OpenTaxSolver is an open source application for US taxpayers to calculate their state and federal income tax returns. Before I get into the software, I want to share some of the information I learned when researching this article. I spent about five hours a day for a week looking into open source options for doing your taxes, and I learned about a lot more than just tax software. + +The Internal Revenue Service's (IRS's) [Use of federal tax information (FTI) in open source software][2] webpage offers a large amount of information, and it's especially relevant to anyone who may want to start their own open source tax software project. To hit the finer points: + + * Federal tax information (FTI) can be used in any open source software + * Software creators mush follow all security laws and compliance requirements + * Any such software must be supported either by a vendor or a community + * The software must be approved by the federal government + + + +One other reason researching this topic was rather difficult (but ultimately rewarding) is that, by federal law, the major tax software companies are required to provide their services for free to any person earning under $69,000 per year. About 70% of Americans fit into this category, and if you are one of them, you can check the IRS's [Free File][3] webpage for links to free filing software from well-known companies. (The IRS reminds you that "you are responsible for determining your eligibility for one of the Free File Online offers.") + +Please share this information broadly—knowledge is power, and not everyone can (or wants to) use open source software to do their taxes for reasons including: + + * Lack of computer or software access + * Low computer competence + * Age or disability + * Discomfort with doing taxes + + + +If you don't fall into any of these categories and want to do your taxes the open source way, continue reading to learn about OpenTaxSolver. + +### About OpenTaxSolver + +[OpenTaxSolver][4] is meant to be used with the IRS's [tax booklet][5], which is published yearly. This booklet provides detailed information for doing your taxes, such as rules around tax credits and write-offs. + +OpenTaxSolver cuts down on tax calculations when you fill out your tax forms and simplifies the hardest part of doing your taxes: the math. You still have to fill in your data and turn the paperwork in, but using the software means you can do it in about half of the time. Since OpenTaxSolver is running in beta, you have to double-check all of your number entries and information against the official IRS tax booklet after you use the software. + +### Download and install OpenTaxSolver + +First, [download the software][6]. There are versions for Linux, Windows, and macOS. If you're using one of the latter two, refer to the download page for installation instructions. I'm using my go-to operating system, Ubuntu Linux, which I installed by: + + 1. Downloading the TGZ file from the website + 2. Extracting it to my desktop (but you can choose any location on your computer) + 3. Clicking on **Run_taxsolve_GUI** + + + +![OpenTaxSolver installation][7] + +### Enter your tax data + +I'll walk through this example using random numbers (for obvious reasons). This walkthrough will explain how do federal taxes with OpenTaxSolver, but if you have to pay state taxes, do that before you begin your federal return. + +To do the common Federal 1040 tax return, select **US 1040**, click **Start New Return**, and start answering some basic questions about your tax situation. For this example, I selected the following itemized deductions: mortgage interest, donations, and some random itemizable write-offs. If you don't know what these are or what may apply to you, head over to the IRS website or google "itemizable write-offs." + +Next, begin entering the data from your tax documents. + +![OpenTaxSolver][8] + +![OpenTaxSolver][9] + +After you finish entering all your data and filling out the entire form, save it by clicking the **Save** button, and then click **Compute Tax** on the bottom of the screen. + +![OpenTaxSolver][10] + +### Check your return and file your taxes + +If you made any mistakes (such as mistyping something or putting an incorrect value in any field), it will show an error on the bottom of the preview after the computation finishes. + +![OpenTaxSolver preview][11] + +The preview also reports your marginal tax rate and what percentage of your income you are paying in taxes. + +![OpenTaxSolver preview][12] + +After you review the information in the preview, make any corrections, and finish your return, click **Fill-out PDF Forms**, and it will provide printable tax forms with all of your information filled in. + +![Tax return][13] + +If you entered your name, address, and social security number when entering your data, all of that information will also appear in the right places on the form. Double-check everything, print it, and mail your tax return to the IRS. + +### Final notes + +OpenTaxSolver gives you the opportunity to file your own federal and state taxes. As always, with any federal related tax information (or federal anything, for that matter), always double-check and use due diligence. I found this software very useful for expanding my knowledge about my taxes. + +The OpenTaxSolver website includes a request for contributors, so if you want to start contributing to an open source project that helps everyone, this is one I'd definitely suggest. + +And if you're someone who likes to wait until the last minute to pay your taxes, this [clock][14] tells you how much time you have until your taxes are due. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/do-your-taxes-open-source-way + +作者:[Jessica Cherry][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jrepka +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_odf_1109ay.png?itok=4CqrPAjt (A document flying away) +[2]: https://www.irs.gov/privacy-disclosure/use-of-federal-tax-information-fti-in-open-source-software +[3]: https://apps.irs.gov/app/freeFile/ +[4]: http://opentaxsolver.sourceforge.net/index.html +[5]: https://www.irs.gov/pub/irs-pdf/i1040gi.pdf +[6]: http://opentaxsolver.sourceforge.net/download2019.html?button=+Download+OTS+ +[7]: https://opensource.com/sites/default/files/uploads/tax2.png (OpenTaxSolver installation) +[8]: https://opensource.com/sites/default/files/uploads/tax1.png (OpenTaxSolver) +[9]: https://opensource.com/sites/default/files/uploads/tax7.png (OpenTaxSolver) +[10]: https://opensource.com/sites/default/files/uploads/tax6.png (OpenTaxSolver) +[11]: https://opensource.com/sites/default/files/uploads/tax3.png (OpenTaxSolver preview) +[12]: https://opensource.com/sites/default/files/uploads/tax4.png (OpenTaxSolver preview) +[13]: https://opensource.com/sites/default/files/uploads/tax5.png (Tax return) +[14]: https://countdown.onlineclock.net/countdowns/taxes/ From faf005b41a7f95728d0fd8b3173690cbb985ce34 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 Feb 2020 01:15:45 +0800 Subject: [PATCH 066/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200218=20Buildi?= =?UTF-8?q?ng=20a=20community=20of=20practice=20in=205=20steps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200218 Building a community of practice in 5 steps.md --- ...ding a community of practice in 5 steps.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20200218 Building a community of practice in 5 steps.md diff --git a/sources/tech/20200218 Building a community of practice in 5 steps.md b/sources/tech/20200218 Building a community of practice in 5 steps.md new file mode 100644 index 0000000000..c763a78660 --- /dev/null +++ b/sources/tech/20200218 Building a community of practice in 5 steps.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Building a community of practice in 5 steps) +[#]: via: (https://opensource.com/article/20/2/building-community-practice-5-steps) +[#]: author: (Tracy Buckner https://opensource.com/users/tracyb) + +Building a community of practice in 5 steps +====== +A community of practice can kickstart innovation in your organization. +Here's how to build one—and ensure it thrives. +![Blocks for building][1] + +In the [first part of this series][2], we defined community as a fundamental principle in open organizations, where people often define their roles, responsibilities, and affiliations through shared interests and passions, [not title, role, or position on an organizational chart][3]. Then, in the [second part of the series][4], we explored the many benefits communities of practice bring to open organizations—including fostering learning, encouraging collaboration, and offering an opportunity for creative problem-solving and innovation. + +Now you know you'd like to _start_ a community of practice, but you may still be unsure _where_ to start. This article will help define your roadmap and build a plan for a successful community of practice—in five simple steps (summarized in Figure 1). + +![][5] + +### Step 1: Obtain executive sponsorship + +While having a community manager focused on the day-to-day execution of community matters is important, an executive sponsor is also integral to the success of the community of practice. Typically, an executive sponsor will shoulder higher-level responsibilities, such as focusing on strategy and creating conditions for success (rather than implementation). + +An executive sponsor can help ensure the community's goals are aligned with the overall strategy of the organization. This person can also communicate those goals and gather support for the community from other senior executives (potentially instrumental in securing financial support and resources for the community!). + +Finding the right sponsor is important for the success of the program. An executive leader committed to fostering open culture, transparency, and collaboration will be very successful. Alternatively, you may wish to tap an executive focused on finding new ways to grow and reskill high-potential employees. + +### Step 2: Determine mission and goals + +Once you've established a vision for the community, you'll need to develop its mission statement. This is critical to your success because the mission begins explaining _how you'll achieve that vision_. Primarily, your community's mission should be to share knowledge, promote learning in a particular area, and align that work with organizational strategy. However, the mission statement may also include references to the audience that the community will serve. + +Here's one example mission statement: + +> _To identify and address needs within the cloud infrastructure space in support of the organization’s mission of defining the next generation of open hybrid cloud._ + +After articulating a mission like this, you'll need to set specific goals for achieving it. The goals can be long- or short-term, but in either case, you'll need to provide a clear roadmap explaining to community members what the community is trying to achieve. + +### Step 3: Build a core team + +Building a core team is essential to the success of a community. In a typical community of practice—or "CoP," for short—you'll notice four main roles: + + * CoP program manager + * CoP manager + * Core team members + * Members + + + +The **CoP program manager** is the face of the community. This person is primarily responsible for supporting the managers and core teams by resolving questions, issues, and concerns. The program manager also guides new communities and evangelizes the communities of practice program inside the organization. + +The **CoP manager** determines community strategy based on business and community needs. This person makes the latest news, content, and events available to community members and ensures that the CoP remains focused on its goals. This person also schedules regular meetings for members and shares other events that may be of interest to them. + +The **CoP core team** is responsible for managing community collateral and best practices to meet the community's goals. The core team supports CoP manager(s) and assists with preparing and leading community meetings. + +**Members** of a community attend meetings, share relevant content and best practices, and support the core team and manager(s) in reaching community goals. + +### Step 4: Promote knowledge management + +Communities of practice produce information—and members must be able to easily access and share that information. So it's important to develop a knowledge-management system for storing that information in a way that keeps it relevant and timely. + +Communities of practice produce information—and members must be able to easily access and share that information. So it's important to develop a knowledge-management system for storing that information in a way that keeps it relevant and timely. + +Over time, your community of practice will likely generate a lot of content. Some of that content may be duplicated, outdated or simply no longer relevant to the community. So it's important to periodically conduct a ROT Analysis of the content validating that the content is not **R**edundant, **O**utdated, or **T**rivial. Consider conducting a ROT analysis every six months or so, in order to keep the content fresh and relevant. + +A number of different content management tools can assist with maintaining and displaying the content for community members. Some organizations use an intranet, while others prefer more robust content management such as [AO Docs][6] or [Drupal][7]. + +### Step 5: Engage in regular communication + +The secret to success in maintaining a community of practice is regular communication and collaboration. Communities that speak with each other frequently and share knowledge, ideas, and best practices are most likely to remain intact. CoP managers should schedule regular meetings, meet-ups, and content creation sessions to ensure that members are engaged in the community. It is recommended to have at least a monthly meeting to maintain communication with the community members. + +Chat/messaging apps are also a great tool for facilitating regular communication in communities of practice. These apps offer teams across the globe the ability to communicate in real-time, removing some collaboration boundaries. Members can pose questions and receive answers immediately, without the delay of sending and receiving emails. And should the questions arise again, most messaging apps also provide an easy search mechanism that can help members discover answers. + +### Building your community + +Remember: A community of practice is a cost-effective way to foster learning, encourage collaboration, and promote innovation in an organization. In [_The Open Organization_][8], Jim Whitehurst argues that "the beauty of an open organization is that it is not about pedaling harder, but about tapping into new sources of power both inside and outside to keep pace with all the fast-moving changes in your environment." Building communities of practice are the perfect way to do just that: stop pedaling harder and to tap into new sources of power within your organization. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/building-community-practice-5-steps + +作者:[Tracy Buckner][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/tracyb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/blocks_building.png?itok=eMOT-ire (Blocks for building) +[2]: https://opensource.com/open-organization/19/11/what-is-community-practice +[3]: https://opensource.com/open-organization/resources/open-org-definition +[4]: https://opensource.com/open-organization/20/1/why-build-community-of-practice +[5]: https://opensource.com/sites/default/files/resize/images/open-org/comm_practice_5_steps-700x440.png +[6]: https://www.aodocs.com/ +[7]: https://www.drupal.org/ +[8]: https://opensource.com/open-organization/resources/what-open-organization From 9c25669c3cb3d20908385bfe0bc8b11d43d346fb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 Feb 2020 01:17:01 +0800 Subject: [PATCH 067/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200218=20How=20?= =?UTF-8?q?to=20embed=20Twine=20stories=20in=20WordPress?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200218 How to embed Twine stories in WordPress.md --- ...How to embed Twine stories in WordPress.md | 229 ++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100644 sources/tech/20200218 How to embed Twine stories in WordPress.md diff --git a/sources/tech/20200218 How to embed Twine stories in WordPress.md b/sources/tech/20200218 How to embed Twine stories in WordPress.md new file mode 100644 index 0000000000..5f2419aa5e --- /dev/null +++ b/sources/tech/20200218 How to embed Twine stories in WordPress.md @@ -0,0 +1,229 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to embed Twine stories in WordPress) +[#]: via: (https://opensource.com/article/20/2/embed-twine-wordpress) +[#]: author: (Roman Lukš https://opensource.com/users/romanluks) + +How to embed Twine stories in WordPress +====== +Share your Twine 2 interactive stories on your WordPress site with the +Embed Twine plugin. +![Person drinking a hat drink at the computer][1] + +From the very beginning, I wanted the "About me" page on my WordPress website [romanluks.eu][2] to be interactive. + +At first, I experimented with Dart, a programming language developed by Google that transcompiles into JavaScript. I killed the project when I realized I was making a game instead of an "About me" page. + +A bit later, I discovered [Twine][3], an open source tool for creating interactive stories. It reminded me of the gamebooks I loved as a kid. It's so easy to create interconnected pieces of text in Twine, and it's ideal for the interview-like format I was aiming for. Because Twine publishes directly to HTML, you can do a lot of interesting things with it—including creating [interactive fiction][4] and [adventure games][5] or publishing stories on a blog or website. + +### Early struggles + +I created my "About me" page in Twine and tried to paste it into my WordPress page. + +"No, can do," said WordPress and Twine. + +You see, a Twine story exported from Twine is just a webpage (i.e., a file in HTML format). However, it not only includes HTML but JavaScript code, as well. And somehow it doesn't work when you simply try to copy-paste the contents. I tried copy-pasting just the body of the Twine story page without success. + +I thought, "I guess I need to add that JavaScript code separately," and I tried custom fields. + +Nope. + +I took a break from my investigation. I just uploaded my "About me" Twine story via FTP and linked to it from my website's menu. People could visit it and interact with the story, however, there was no menu, and it didn't feel like a part of my website. I had made a trap for myself. It made me realize I really _really_ wanted my "About me" included directly on my website. + +### DIY embed + +I took a stab at the problem and came up with [this solution][6]. + +It worked. It wasn't perfect, but it worked. + +But it wasn't _perfect_. Is there a better way? There is bound to be a better way… + +It cost me a couple of pulled hairs, but I managed to get a [responsive iframe and autoscroll][7]. + +It was way better. I was proud of myself and shared it on [Reddit][8]. + +### The road to Embed Twine + +Suddenly, an idea! What if, instead of following my tutorial, people could use a WordPress plugin? + +They would only have to give the plugin a Twine story, and it would take care of the rest. Hassle-free. No need to copy-paste any JavaScript code. + +Wouldn't that be glorious?!? + +I had no idea how WordPress plugins work. I only knew they are written in PHP. A while back, I had part-time work as a PHP developer, and I remembered the basics. + +### Containers and WordPress + +I mentioned my idea to a friend, and he suggested I could use containers as my WordPress development environment. + +In the past, I'd always used [XAMPP][9], but I wanted to try containers for a while. + +No problem, I thought! I'll learn containers while I learn how to make a WordPress plugin and revive my PHP skills. That should be sufficiently stimulating. + +And it was. + +I can't recall how many times I stopped, removed, and rebuilt my containers. I had to use the command line. And the file permissions are painful. + +Oh boy! It was like playing a game that you enjoy playing even though it makes you fairly angry. It was challenging but rewarding. + +I found out that it's very easy to create a simple WordPress plugin: + + * Write the source code + * Save it in the WP plugin directory + * Test it + * Repeat + + + +Containers make it easy to use a specific environment and are easy to clean up when you screw up and need to start over. + +Using Git saved me from accidentally wiping out my entire codebase. I used [Sourcetree][10] as my Git user interface. Initially, I wrote my code in [Notepad++][11], but when I divided my code into multiple files, I switched to [Atom][12]. It's such a cool editor for geeks. Using it feels like the code writes itself. + +### Intermission + +So what do we know so far? + + * I wanted an interactive "About me" page + * I created an "About me" story in Twine + * Twine exports webpages (as HTML files with JavaScript included) + * WP plugins are easy to make + * Containers are awesome + + + +### Embed Twine is born + +I wanted an easy way to embed Twine stories into WordPress. So, I used the power of software development, fooled around with containers, wrote a bit of PHP code, and published the result as a WordPress plugin called [Embed Twine][13]. + +### Install the plugin + + 1. Upload the plugin [files][14] to the **/wp-content/plugins/plugin-name** directory, or install the plugin through the WordPress Plugins screen. + 2. Activate the plugin through the Plugins screen in WordPress. + + + +### Use the plugin + +After you've installed the Embed Twine plugin and created a Twine 2 story, embed it in your WordPress site: + + 1. Export your Twine 2 story into an HTML file. + 2. Upload it via the plugin's interface. + 3. Insert the shortcode into the page or post. + 4. Enjoy your embedded story. + + + +The plugin also provides autoscroll functionality to make it easy for users to navigate through your stories. + +### Configure the plugin + +The plugin is configurable via shortcode parameters. To use the shortcode, simply put **[embed_twine]** into your post. + +You can use additional parameters in the format **[embed_twine story="Story" aheight=112 autoscroll=true ascroll=100]** as follows: + + * **story:** Specify the story name (the filename without an extension). + * If the story parameter is omitted, it defaults to "Story." This means there is no need to use this parameter if your Twine filename is Story.html. + * If you upload a Twine story called MyFooBar.html, use the shortcode: **[embed_twine story="MyFooBar"]**. + * **aheight:** Use this parameter to adjust the iframe's height. You might need to tweak **aheight** to get rid of an iframe scrollbar. The default value is 112; this value is added to the iframe height and used to set the iframe's **style.height**. + * **autoscroll:** Autoscroll is enabled by default. You can turn it off with shortcode parameter **[embed_twine autoscroll=false]**. + * **ascroll:** Use this to adjust the default position for autoscroll. The default value is 100; this value is subtracted from the iframe's top position and fed into JavaScript method **window.scrollTo()**. + + + +### Known bugs + +Currently, Twine passages that include images might report their height incorrectly, and the scrollbar might show up for these passages. Tweak the shortcode parameter **aheight** to get rid of them. + +### The script + + +``` +1       <?php +2       +3       /** +4       * Plugin Name: Embed Twine +5       * Description: Insert Twine stories into WordPress +6       * Version: 0.0.6 +7       * Author: Roman Luks +8       * Author URI: +9       * License: GPLv2 or later +10      */ +11      +12      require_once('include/embed-twine-load-file.php'); +13      require_once('include/embed-twine-parent-page.php'); +14      require_once('include/embed-twine-process-story.php'); +15      +16      // Add plugin to WP menu +17      function embed_twine_customplugin_menu() { +18      +19          add_menu_page("Embed Twine", "Embed Twine","manage_options", __FILE__, "embed_twine_uploadfile"); +20      } +21      +22      add_action("admin_menu", "embed_twine_customplugin_menu"); +23      +24      function embed_twine_uploadfile(){ +25          include "include/embed-twine-upload-file.php"; +26      } +27      +28      // Add shortcode +29      function embed_twine_shortcodes_init() +30      { +31          function embed_twine_shortcode($atts = [], $content = null) +32          { +33              // Attributes +34              $atts = shortcode_atts( +35                  [array][15]( +36                      'story' => 'Story', +37                      'aheight' => 112,       //adjust for style.height (30) and margins of tw-story (2x41) +38                      'autoscroll' => true,   //autoscroll enabled by default +39                      'ascroll' => 100,       //adjust for autoscroll +40                  ), +41                  $atts, +42                  'embed_twine' +43              ); +44      +45              $content = embed_twine_buildParentPage($atts['story'], $atts['aheight'], $atts['autoscroll'], $atts['ascroll']); +46      +47              return $content; +48          } +49          add_shortcode('embed_twine', 'embed_twine_shortcode'); +50      } +51      add_action('init', 'embed_twine_shortcodes_init'); +``` + +* * * + +_This article is adapted from [Roman Luks' blog][16] and [Embed Twine][13] page on WordPress plugins._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/embed-twine-wordpress + +作者:[Roman Lukš][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/romanluks +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) +[2]: https://romanluks.eu/ +[3]: https://twinery.org/ +[4]: https://opensource.com/article/18/7/twine-vs-renpy-interactive-fiction +[5]: https://opensource.com/article/18/2/twine-gaming +[6]: https://romanluks.eu/blog/how-to-embed-twine-on-your-wordpress-website/ +[7]: https://romanluks.eu/blog/how-to-embed-twine-on-your-wordpress-website-with-responsive-iframe-and-autoscroll/ +[8]: https://www.reddit.com/r/twinegames/comments/dtln4z/how_to_embed_twine_on_your_wordpress_website_with/ +[9]: https://en.wikipedia.org/wiki/XAMPP +[10]: https://www.sourcetreeapp.com/ +[11]: https://notepad-plus-plus.org/ +[12]: https://atom.io/ +[13]: https://wordpress.org/plugins/embed-twine/ +[14]: https://plugins.trac.wordpress.org/browser/embed-twine/ +[15]: http://www.php.net/array +[16]: https://romanluks.eu/blog/embed-twine-wordpress-plugin/ From a6209e511f81fbfa4258fa2d8bebc49b042208fd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 Feb 2020 01:18:06 +0800 Subject: [PATCH 068/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200217=20Create?= =?UTF-8?q?=20web=20user=20interfaces=20with=20Qt=20WebAssembly=20instead?= =?UTF-8?q?=20of=20JavaScript?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200217 Create web user interfaces with Qt WebAssembly instead of JavaScript.md --- ...th Qt WebAssembly instead of JavaScript.md | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 sources/tech/20200217 Create web user interfaces with Qt WebAssembly instead of JavaScript.md diff --git a/sources/tech/20200217 Create web user interfaces with Qt WebAssembly instead of JavaScript.md b/sources/tech/20200217 Create web user interfaces with Qt WebAssembly instead of JavaScript.md new file mode 100644 index 0000000000..bc61dab48d --- /dev/null +++ b/sources/tech/20200217 Create web user interfaces with Qt WebAssembly instead of JavaScript.md @@ -0,0 +1,133 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create web user interfaces with Qt WebAssembly instead of JavaScript) +[#]: via: (https://opensource.com/article/20/2/wasm-python-webassembly) +[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) + +Create web user interfaces with Qt WebAssembly instead of JavaScript +====== +Get hands-on with Wasm, PyQt, and Qt WebAssembly. +![Digital creative of a browser on the internet][1] + +When I first heard about [WebAssembly][2] and the possibility of creating web user interfaces with Qt, just like I would in ordinary C++, I decided to take a deeper look at the technology. + +My open source project [Pythonic][3] is completely Python-based (PyQt), and I use C++ at work; therefore, this minimal, straightforward WebAssembly tutorial uses Python on the backend and C++ Qt WebAssembly for the frontend. It is aimed at programmers who, like me, are not familiar with web development. + +![Header Qt C++ frontend][4] + +### TL;DR + + +``` +git clone  + +cd wasm_qt_example + +python mysite.py +``` + +Then visit with your favorite browser. + +### What is WebAssembly? + +WebAssembly (often shortened to Wasm) is designed primarily to execute portable binary code in web applications to achieve high-execution performance. It is intended to coexist with JavaScript, and both frameworks are executed in the same sandbox. [Recent performance benchmarks][5] showed that WebAssembly executes roughly 10–40% faster,  depending on the browser, and given its novelty, we can still expect improvements. The downside of this great execution performance is its widespread adoption as the preferred malware language. Crypto miners especially benefit from its performance and harder detection of evidence due to its binary format. + +### Toolchain + +There is a [getting started guide][6] on the Qt wiki. I recommend sticking exactly to the steps and versions mentioned in this guide. You may need to select your Qt version carefully, as different versions have different features (such as multi-threading), with improvements happening with each release. + +To get executable WebAssembly code, simply pass your Qt C++ application through [Emscripten][7]. Emscripten provides the complete toolchain, and the build script couldn't be simpler: + + +``` +#!/bin/sh +source ~/emsdk/emsdk_env.sh +~/Qt/5.13.1/wasm_32/bin/qmake +make +``` + +Building takes roughly 10 times longer than with a standard C++ compiler like Clang or g++. The build script will output the following files: + + * WASM_Client.js + * WASM_Client.wasm + * qtlogo.svg + * qtloader.js + * WASM_Client.html + * Makefile (intermediate) + + + +The versions on my (Fedora 30) build system are: + + * emsdk: 1.38.27 + * Qt: 5.13.1 + + + +### Frontend + +The frontend provides some functionalities based on [WebSocket][8]. + +![Qt-made frontend in browser][9] + + * **Send message to server:** Send a simple string message to the server with a WebSocket. You could have done this also with a simple HTTP POST request. + * **Start/stop timer:** Create a WebSocket and start a timer on the server to send messages to the client at a regular interval. + * **Upload file:** Upload a file to the server, where the file is saved to the home directory (**~/**) of the user who runs the server. + + + +If you adapt the code and face a compiling error like this: + + +``` +error: static_assert failed due to + requirement ‘bool(-1 == 1)’ “Required feature http for file + ../../Qt/5.13.1/wasm_32/include/QtNetwork/qhttpmultipart.h not available.” +QT_REQUIRE_CONFIG(http); +``` + +it means that the requested feature is not available for Qt Wasm. + +### Backend + +The server work is done by [Eventlet][10]. I chose Eventlet because it is lightweight and easy to use. Eventlet provides WebSocket functionality and supports threading. + +![Decorated functions for WebSocket handling][11] + +Inside the repository under **mysite/template**, there is a symbolic link to **WASM_Client.html** in the root path. The static content under **mysite/static** is also linked to the root path of the repository. If you adapt the code and do a recompile, you just have to restart Eventlet to update the content to the client. + +Eventlet uses the Web Server Gateway Interface for Python (WSGI). The functions that provide the specific functionality are extended with decorators. + +Please note that this is an absolute minimum server implementation. It doesn't implement any multi-user capabilities — every client is able to start/stop the timer, even for other clients. + +### Conclusion + +Take this example code as a starting point to get familiar with WebAssembly without wasting time on minor issues. I don't make any claims for completeness nor best-practice integration. I walked through a long learning curve until I got it running to my satisfaction, and I hope this gives you a brief look into this promising technology. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/wasm-python-webassembly + +作者:[Stephan Avenwedde][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/hansic99 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://webassembly.org/ +[3]: https://github.com/hANSIc99/Pythonic +[4]: https://opensource.com/sites/default/files/uploads/cpp_qt.png (Header Qt C++ frontend) +[5]: https://pspdfkit.com/blog/2018/a-real-world-webassembly-benchmark/ +[6]: https://wiki.qt.io/Qt_for_WebAssembly#Getting_Started +[7]: https://emscripten.org/docs/introducing_emscripten/index.html +[8]: https://en.wikipedia.org/wiki/WebSocket +[9]: https://opensource.com/sites/default/files/uploads/wasm_frontend.png (Qt-made frontend in browser) +[10]: https://eventlet.net/ +[11]: https://opensource.com/sites/default/files/uploads/python_backend.png (Decorated functions for WebSocket handling) From 485de978a47842c20adbefb82ac135f5571e3e76 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 Feb 2020 01:19:25 +0800 Subject: [PATCH 069/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200217=20How=20?= =?UTF-8?q?to=20install=20Vim=20plugins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200217 How to install Vim plugins.md --- .../20200217 How to install Vim plugins.md | 177 ++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 sources/tech/20200217 How to install Vim plugins.md diff --git a/sources/tech/20200217 How to install Vim plugins.md b/sources/tech/20200217 How to install Vim plugins.md new file mode 100644 index 0000000000..e947b18607 --- /dev/null +++ b/sources/tech/20200217 How to install Vim plugins.md @@ -0,0 +1,177 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to install Vim plugins) +[#]: via: (https://opensource.com/article/20/2/how-install-vim-plugins) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +How to install Vim plugins +====== +Whether you install them manually or with a package manager, plugins can +help you create the perfect Vim for your workflow. +![Team checklist and to dos][1] + +While [Vim][2] is fast and efficient, by default, it is but a mere text editor. At least, that's what it would be without plugins, which build upon Vim and add extra features to make it so much more than just a window for typing text. With the right mix of plugins, you can take control of your life and forge your own unique Vim experience. You can [customize your theme][3], and you can add syntax highlighting, code linting, version trackers, and much much more. + +### How to install Vim plugins + +Vim is extensible through plugins, but for a long time, there was no official method for installing them. As of the Vim 8.x series, however, there's a structure around how plugins are intended to be installed and loaded. You may encounter old instructions online or in project README files, but as long as you're running Vim 8 or greater, you should install according to Vim's [official plugin install method][4] or with a Vim package manager. You can use a package manager regardless of what version you run (including releases older than 8.x), which makes the install process easier than maintaining updates yourself. + +Both the manual and automated methods are worth knowing, so keep reading to learn about both. + +### Install plugins manually (Vim 8 and above) + +A Vim package is a directory containing one or more plugins. By default, your Vim settings are contained in **~/.vim**, so that's where Vim looks for plugins when you launch it. (The examples below use the generic name **vendor** to indicate that the plugins are obtained from an entity that is not you.) + +When you start Vim, it first processes your **.vimrc** file, and then it scans all directories in **~/.vim** for plugins contained in **pack/*/start**. + +By default, your **~/.vim** directory (if you even have one) has no such file structure, so set that up with: + + +``` +`$ mkdir -p ~/.vim/pack/vendor/start` +``` + +Now you can place Vim plugins in **~/.vim/pack/vendor/start**, and they'll automatically load when you launch Vim. + +For example, try installing [NERDTree][5], a text-based file manager for Vim. First, use Git to clone a snapshot of the NERDTree repository: + + +``` +$ git clone --depth 1 \ +  \ +  ~/.vim/pack/vendor/start/nerdtree +``` + +Launch Vim or gvim, and type this command: + + +``` +`:NERDTree` +``` + +A file tree will open along the left side of your Vim window. + +![NERDTree plugin][6] + +If you don't want a plugin to load automatically every time you launch Vim, you can create an **opt** directory within your **~/.vim/pack/vendor** directory: + + +``` +`$ mkdir ~/.vim/pack/vendor/opt` +``` + +Any plugins installed into **opt** are available to Vim but not loaded into memory until you add them to a session with the **packadd** command, e.g., for an imaginary plugin called foo: + + +``` +`:packadd foo` +``` + +Officially, Vim recommends that each plugin project gets its own directory within **~/.vim/pack**. For example, if you were to install the NERDTree plugin and the imaginary foo plugin, you would create this structure: + + +``` +$ mkdir -p ~/.vim/pack/NERDTree/start/ +$ git clone --depth 1 \ +  \ +  ~/.vim/pack/NERDTree/start/NERDTree +$ mkdir -p ~/.vim/pack/foo/start/ +$ git clone --depth 1 \ +  \ +  ~/.vim/pack/foo/start/foo +``` + +Whether that's convenient is up to you. + +### Using a Vim package manager (any Vim version) + +Since Vim series 8, package managers have become less useful, but some users still prefer them because of their ability to auto-update several plugins. There are several package managers to choose from, and they're each different, but [vim-plug][7] has some great features and the best documentation of them all, which makes it easy to start with and to explore in depth later. + +#### Installing plugins with vim-plug + +Install vim-plug so that it auto-loads at launch with: + + +``` +$ curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ +  +``` + +Create a **~/.vimrc** file (if you don't have one already), and enter this text: + + +``` +call plug#begin() +Plug 'preservim/NERDTree' +call plug#end() +``` + +Each time you want to install a plugin, you must enter the name and location of the plugin between the **plug#begin()** and **plug#end** lines. (The NERDTree file manager is used above as an example.) If the plugin you want isn't hosted on GitHub, then you can provide the full URL instead of just the GitHub username and project ID. You can even "install" local plugins outside of your **~/.vim** directory. + +Finally, start Vim and prompt vim-plug to install the plugins listed in **~/.vimrc**: + + +``` +`:PlugInstall` +``` + +Wait for the plugins to be downloaded. + +#### Update plugins with vim-plug + +Editing **~/.vimrc** and issuing a command to do the installation probably doesn't seem like much of a savings over the manual install process, but the real benefit to vim-plug is in updates. To update all installed plugins, issue this Vim command: + + +``` +`:PlugUpdate` +``` + +If you don't want to update all plugins, you can update any subset by adding the plugin's name: + + +``` +`:PlugUpdate NERDTree` +``` + +#### Restore plugins + +Another vim-plug benefit is its export and recovery function. As any Vim user knows, the way Vim works is often unique to each user—in part because of plugins. Once you get the right blend of plugins installed and configured, the last thing you want is to lose track of them. + +Vim-plug has this command to generate a script for restoring all current plugins: + + +``` +`:PlugSnapshot ~/vim-plug.list` +``` + +There are many other functions for vim-plug, so refer to its [project page][7] for the full documentation. + +### Create the perfect Vim + +When you spend all day in a program, you want every little detail to serve you the best it possibly can. Get to know Vim and its many plugins until you build the perfect application for what you do. + +Got a favorite Vim plugin? Tell us all about it in the comments! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/how-install-vim-plugins + +作者:[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/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) +[2]: https://www.vim.org/ +[3]: https://opensource.com/article/19/12/colors-themes-vim +[4]: https://github.com/vim/vim/blob/03c3bd9fd094c1aede2e8fe3ad8fd25b9f033053/runtime/doc/repeat.txt#L515 +[5]: https://github.com/preservim/nerdtree +[6]: https://opensource.com/sites/default/files/uploads/vim-nerdtree.jpg (NERDTree plugin) +[7]: https://github.com/junegunn/vim-plug From 8b225db4d3fa08865b0174c766aab46cd9c50951 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 Feb 2020 01:20:02 +0800 Subject: [PATCH 070/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200217=20Automa?= =?UTF-8?q?ting=20unit=20tests=20in=20test-driven=20development?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200217 Automating unit tests in test-driven development.md --- ...g unit tests in test-driven development.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/tech/20200217 Automating unit tests in test-driven development.md diff --git a/sources/tech/20200217 Automating unit tests in test-driven development.md b/sources/tech/20200217 Automating unit tests in test-driven development.md new file mode 100644 index 0000000000..fc3971effe --- /dev/null +++ b/sources/tech/20200217 Automating unit tests in test-driven development.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Automating unit tests in test-driven development) +[#]: via: (https://opensource.com/article/20/2/automate-unit-tests) +[#]: author: (Alex Bunardzic https://opensource.com/users/alex-bunardzic) + +Automating unit tests in test-driven development +====== +What unit tests have in common with carpentry. +![gears and lightbulb to represent innovation][1] + +DevOps is a software engineering discipline focused on minimizing the lead time to achieve a desired business impact. While business stakeholders and sponsors have ideas on how to optimize business operations, those ideas need to be validated in the field. This means business automation (i.e., software products) must be placed in front of end users and paying customers. Only then will the business confirm whether the initial idea for improvement was fruitful or not. + +Software engineering is a budding discipline, and it can get difficult to ship products that are defect-free. For that reason, DevOps resorts to maximizing automation. Any repeatable chore, such as testing implemented changes to the source code, should be automated by DevOps engineers. + +This article looks at how to automate unit tests. These tests are focused on what I like to call "programming in the small." Much more important test automation (the so-called "programming in the large") must use a different discipline—integration testing. But that's a topic for another article. + +### What is a unit? + +When I'm teaching approaches to unit testing, often, my students cannot clearly determine what a testable unit is. Which is to say, the granularity of the processing is not always clear. + +I like to point out that the easiest way to spot a valid unit is to think of it as a _unit of behavior_. For example (albeit a trivial one), when an authenticated customer begins online shopping, the unit of behavior is a cart that has zero items in it. Once we all agree that an empty shopping cart has zero items in it, we can focus on automating the unit test that will ensure that such a shopping cart always returns zero items. + +### What is not a unit? + +Any processing that involves more than a single behavior should not be viewed as a unit. For example, if shopping cart processing results in tallying up the number of items in the cart AND calculating the order total AND calculating sales tax AND calculating the suggested shipping method, that behavior is not a good candidate for unit testing. Such behavior is a good candidate for integration testing. + +### When to write a unit test + +There is a lot of debate about when to write a unit test. Received wisdom states that once the code has been written, it is a good idea to write automated scripts that will assert whether the implemented unit of behavior delivers functionality as expected. Not only does such a unit test (or a few unit tests) document the expected behavior, the collection of all unit tests ensures that future changes will not degrade quality. If a future change adversely affects the already implemented behavior, one or more unit tests will complain, which will alert developers that regression has occurred. + +There is another way to look at software engineering. It is based on the traditional adage "measure twice, cut once." In that light, writing code before writing tests would be equivalent to cutting a part of some product (say, a chair leg) and measuring it only after it's cut. If the craftsperson doing the cutting is very skilled, that approach may work (kind of). But more likely than not, the chair legs cut this way would end up with unequal lengths. So, it is advisable to measure before cutting. What that means for the practice of software engineering is that the measurements are expressed in the unit tests. Once we measure the required values, we create a blueprint (a unit test). That blueprint is then used to guide the cutting of the code. + +Common sense would suggest that it is more reasonable to measure first and, only then, do the cutting. According to that line of reasoning, writing unit tests before writing code is a recommended way to do proper software engineering. Technically speaking, this "measure twice, cut once" approach is called a "test-first" approach. The opposite approach, where we write the code first, is called "test-later." The test-first approach is the approach advocated by [test-driven development][2] (TDD) methodology. Writing tests later is called test-later development (TLD). + +### Why is TLD harmful? + +Cutting before measuring is not recommended. Even the most talented craftspeople will eventually make mistakes by cutting without doing so. A lack of measurement will eventually catch up with even the most experienced of us as we continue in our craft. So it's best to produce a blueprint (i.e., measurements) before cutting. + +But that's not the only reason why the TLD approach is considered harmful. When we write code, we're simultaneously considering two separate concerns: the expected behavior of the code and the optimal structure of the code. These two concerns are very dissimilar. That fact makes it very challenging to do a proper job satisfying the expectations regarding both the desired behavior and the optimal (or at the very least, decent) code structure. + +The TDD approach solves this conundrum by focusing undivided attention first on the expected desired behavior. We start by writing the unit test. In that test, we focus on _what_ we expect to happen. At this point, we don't care, in the least, _how_ the expected behavior is going to materialize. + +Once we're done describing the _what_ (i.e., what manifest behavior are we expecting from the unit we are about to build?), we watch that expectation fail. It fails because the code that is concerned with _how_ the expected behavior is going to happen hasn't materialized yet. Now we are compelled to write the code that's going to take care of the _how_. + +After we write the code responsible for how, we run the unit test(s) and see if the code we just wrote fulfills the expected behavior. If it does, we're done. Time to move on to fulfilling the next expectation. If it doesn't, we continue transforming the code until it succeeds in passing the test. + +If we choose not to do TDD, but write code first and later write the unit test, we miss the opportunity to separate _what_ from _how_. In other words, we write the code while simultaneously taking care of what we expect the code to do _and_ how to structure the code to do it correctly. + +As such, writing unit tests after we write code is considered harmful. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/automate-unit-tests + +作者:[Alex Bunardzic][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/alex-bunardzic +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M (gears and lightbulb to represent innovation) +[2]: https://opensource.com/article/20/1/test-driven-development From 1b8fccb1d66b9fc57f5f4fdb6f3a08498d9419de Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 19 Feb 2020 01:20:42 +0800 Subject: [PATCH 071/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200216=20Minico?= =?UTF-8?q?mputers=20and=20The=20Soul=20of=20a=20New=20Machine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200216 Minicomputers and The Soul of a New Machine.md --- ...computers and The Soul of a New Machine.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/tech/20200216 Minicomputers and The Soul of a New Machine.md diff --git a/sources/tech/20200216 Minicomputers and The Soul of a New Machine.md b/sources/tech/20200216 Minicomputers and The Soul of a New Machine.md new file mode 100644 index 0000000000..c1e68b1a8d --- /dev/null +++ b/sources/tech/20200216 Minicomputers and The Soul of a New Machine.md @@ -0,0 +1,95 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Minicomputers and The Soul of a New Machine) +[#]: via: (https://opensource.com/article/20/2/minicomputers-and-soul-new-machine) +[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg) + +Minicomputers and The Soul of a New Machine +====== +The new season of Command Line Heroes begins with a story of increases +in memory, company politics, and a forgotten technology at the heart of +our computing history. +![Command Line Heroes season 4 episode 1 covers the rise of minicomputers][1] + +The [Command Line Heroes podcast][2] is back, and this season it covers the machines that run all the programming languages [I covered last season][3]. As the podcast staff puts it: + +"This season, we'll look at what happens when idealistic teams come together to build visionary machines. Machines made with leaps of faith and a lot of hard, often unrecognized, work in basements and stifling cubicles. Machines that brought teams together and changed us as a society in ways we could only dream of." + +This first episode looks at the non-fiction book (and engineering classic), [_The Soul of a New Machine_][4], to look at a critical moment in computing history. It covers the transition from large, hulking mainframes to the intermediate step of the minicomputer, which will eventually lead us to the PC revolution that we're still living in the wake of. + +### The rise of minicomputers + +One of the most important machines on the path to modern machines, most of us have since forgotten: the minicomputer. + +It was a crucial link in the evolution from mainframe to PC (aka microcomputer). It was also extremely important in the development of software that would fuel the PC revolution, chiefly the operating system. The PDP-7 and PDP-11—on which [UNIX was developed][5]—were examples of minicomputers. So was the machine at the heart of _The Soul of the New Machine_. + +This episode takes us back to this important time in computing and explores this forgotten machine—both in terms of its hardware and software. + +From 1963 to 1977, minicomputers were 12 to 16-bit machines from computing giants DEC ([PDP][6]) and rival upstart [Data General][7] ([Nova][8], [Eclipse][9]). But in October 1977, DEC unveiled the VAX 11/780, a 32-bit CPU built from transistor-transistor logic with a five megahertz cycle-time and 2 megabytes of memory. The VAX launched DEC [into second place][10] in the largest computer company in the world. + +The jump from a 12-bit to a 32-bit CPU is a jump from 4,096 bytes to 4,294,967,296 bytes of data. That increase massively increased the potential for software to do complex tasks while drastically shrinking the size of the computer. And with a 32-bit CPU, the VAX was nearly as powerful as an IBM/360 mainframe—but much smaller and much, much less expensive. + +[The episode][11] goes into the drama that unfolds as teams within Data General race to have the most marketable minicomputer while working through company politics and strong personalities. + +### Revisiting _The Soul of a New Machine_ + +_The Soul of a New Machine_ was written in 1981 by Tracy Kidder, and chronicles a small group of engineers at the now-former tech company, Data General, as they attempt to compete with a rival internal group and create a 32-bit minicomputer as a skunkworks project known as "Eagle." For those okay with spoilers, the computer would eventually be known as the [Eclipse MV/8000][12]. + +Earlier this year, [Jessie Frazelle][13], of Docker, Go, and Kubernetes fame, and [Bryan Cantrill][14], known for [DTrace][15], Joyent, and many other technologies, publicly wrote about reading the non-fiction classic. As it's written, Cantrill mentioned the book to Frazelle, who read it and then wrote an enthusiastic [blog post][16] about the book. As Frazelle put it: + +"Personally, I look back on the golden age of computers as the time when people were building the first personal computers in their garage. There is a certain whimsy of that time fueled with a mix of hard work and passion for building something crazy with a very small team. In today's age, at large companies, most engineers take jobs where they work on one teeny aspect of a machine or website or app. Sometimes they are not even aware of the larger goal or vision but just their own little world. + +In the book, a small team built an entire machine… The team wasn't driven by power or greed, but by accomplishment and self-fulfillment. They put a part of themselves in the machine, therefore, producing a machine with a soul…The team was made up of programmers with the utmost expertise and experience and also with new programmers." + +Inspired by Frazelle's reaction, Cantrill re-read it and wrote [a blog article][17] about it and writes this beautiful note: + +"…_The Soul of a New Machine_ serves to remind us that the soul of what we build is, above all, shared — that we do not endeavor alone but rather with a group of like-minded individuals." + +Frazelle's and Cantrill's reading of the book and blog [sparked a wave of people][18] exploring and talking about this text. While it remains on my book list, this dialogue-by-book-review is at the heart of the CLH season 4 as it explores the entire machine. + +### Why did the minicomputer go the way of the Neanderthal? + +As we all know, minicomputers are not a popular purchase in today's technology market. Minicomputers ended up being great technology for timesharing. The irony is that they unwittingly sealed their own fate. The Internet, which started off as ARPANET, was basically a new kind of timesharing. They were so good at timesharing that at one point, the DEC PDP 11 accounted for over 30% of the nodes on ARPANET. Minicomputers were powering their own demise.* + +Minicomputers paved the way for smaller computers and for more and more people to have access to these powerful, society-changing machines. But I'm getting ahead of myself. Keep listening to the [new season of Command Line Heroes][2] to continue the story of machines in computing history. + +* * * + +What's your minicomputer story? I'd love to read them in the comments. + +(There were, of course, other factors leading to the end of this era. Minicomputers were fighting at the low end of the market with the rise of microcomputers, while Unix systems continued to push into the midrange market. The rise of the Internet was perhaps its final blow.) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/minicomputers-and-soul-new-machine + +作者:[Matthew Broberg][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mbbroberg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command-line-heroes-minicomputers-s4-e1.png?itok=FRaff5i6 (Command Line Heroes season 4 episode 1 covers the rise of minicomputers) +[2]: https://www.redhat.com/en/command-line-heroes +[3]: https://opensource.com/article/19/6/command-line-heroes-python +[4]: https://en.wikipedia.org/wiki/The_Soul_of_a_New_Machine +[5]: https://opensource.com/19/9/command-line-heroes-bash +[6]: https://en.wikipedia.org/wiki/PDP +[7]: https://en.wikipedia.org/wiki/Data_General +[8]: https://en.wikipedia.org/wiki/Data_General_Nova +[9]: https://en.wikipedia.org/wiki/Data_General_Eclipse +[10]: http://www.old-computers.com/history/detail.asp?n=20&t=3 +[11]: https://www.redhat.com/en/command-line-heroes/season-4/minicomputers +[12]: https://en.wikipedia.org/wiki/Data_General_Eclipse_MV/8000 +[13]: https://twitter.com/jessfraz?lang=en +[14]: https://en.wikipedia.org/wiki/Bryan_Cantrill +[15]: https://en.wikipedia.org/wiki/DTrace +[16]: https://blog.jessfraz.com/post/new-golden-age-of-building-with-soul/ +[17]: http://dtrace.org/blogs/bmc/2019/02/10/reflecting-on-the-soul-of-a-new-machine/ +[18]: https://twitter.com/search?q=jessfraz%20soul%20new%20machine&src=typed_query&f=live From acc8483501a9fd6c9be2d90063cde36609fed8de Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 19 Feb 2020 08:21:43 +0800 Subject: [PATCH 072/315] translated --- ...ux system configuration with Bash tools.md | 110 ------------------ ...ux system configuration with Bash tools.md | 109 +++++++++++++++++ 2 files changed, 109 insertions(+), 110 deletions(-) delete mode 100644 sources/tech/20200122 Screenshot your Linux system configuration with Bash tools.md create mode 100644 translated/tech/20200122 Screenshot your Linux system configuration with Bash tools.md diff --git a/sources/tech/20200122 Screenshot your Linux system configuration with Bash tools.md b/sources/tech/20200122 Screenshot your Linux system configuration with Bash tools.md deleted file mode 100644 index f1e1c29029..0000000000 --- a/sources/tech/20200122 Screenshot your Linux system configuration with Bash tools.md +++ /dev/null @@ -1,110 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Screenshot your Linux system configuration with Bash tools) -[#]: via: (https://opensource.com/article/20/1/screenfetch-neofetch) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) - -Screenshot your Linux system configuration with Bash tools -====== -ScreenFetch and Neofetch make it easy to share your Linux environment -with others. -![metrics and data shown on a computer screen][1] - -There are many reasons you might want to share your Linux configuration with other people. You might be looking for help troubleshooting a problem on your system, or maybe you're so proud of the environment you've created that you want to showcase it to fellow open source enthusiasts. - -You could get some of that information with a **cat /proc/cpuinfo** or **lscpu** command at the Bash prompt. But if you want to share more details, such as your operating system, kernel, uptime, shell environment, screen resolution, etc., you have two great tools to choose: screenFetch and Neofetch. - -### ScreenFetch - -[ScreenFetch][2] is a Bash command-line utility that can produce a very nice screenshot of your system configuration and uptime. It is an easy way to share your system's configuration with others in a colorful way. - -It's simple to install screenFetch for many Linux distributions.  - -On Fedora, enter: - - -``` -`$ sudo dnf install screenfetch` -``` - -On Ubuntu, enter: - - -``` -`$ sudo apt install screenfetch` -``` - -For other operating systems, including FreeBSD, MacOS, and more, consult the screenFetch wiki's [installation page][3]. Once screenFetch is installed, it can produce a detailed and colorful screenshot like this: - -![screenFetch][4] - -ScreenFetch also provides various command-line options to fine-tune your results. For example, **screenfetch -v** returns verbose output that presents each option line-by-line along with the display shown above. - -And **screenfetch -n** eliminates the operating system icon when it displays your system information. - -![screenfetch -n option][5] - -Other options include **screenfetch -N**, which strips all color from the output; **screenfetch -t**, which truncates the output depending on the size of the terminal; and **screenFetch -E**, which suppresses errors. - -Be sure to check the man page on your system for other options. ScreenFetch is open source under the GPLv3, and you can learn more about the project in its [GitHub repository][6]. - -### Neofetch - -[Neofetch][7] is another tool to create a screenshot with your system information. It is written in Bash 3.2 and is open source under the [MIT License][8]. - -According to the project's website, "Neofetch supports almost 150 different operating systems. From Linux to Windows, all the way to more obscure operating systems like Minix, AIX, and Haiku." - -![Neofetch][9] - -The project maintains a wiki with excellent [installation documentation][10] for a variety of distributions and operating systems. - -If you are on Fedora, RHEL, or CentOS, you can install Neofetch at the Bash prompt with: - - -``` -`$ sudo dnf install neofetch` -``` - -On Ubuntu 17.10 and greater, you can use: - - -``` -`$ sudo apt install neofetch` -``` - -On its first run, Neofetch writes a **~/.config/neofetch/config.conf** file to your home directory (**.config/config.conf**), which enables you to [customize and control][11] every aspect of Neofetch's output. For example, you can configure Neofetch to use the image, ASCII file, or wallpaper of your choice—or nothing at all. The config.conf file also makes it easy to share your customization with others. - -If Neofetch doesn't support your operating system or provide all the options you are looking for, be sure to open up an issue in the project's [GitHub repo][12]. - -### Conclusion - -No matter why you want to share your system configuration, screenFetch or Neofetch should enable you to do so. Do you know of another open source tool that provides this functionality on Linux? Please share your favorite in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/screenfetch-neofetch - -作者:[Don Watkins][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/don-watkins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) -[2]: https://github.com/KittyKatt/screenFetch -[3]: https://github.com/KittyKatt/screenFetch/wiki/Installation -[4]: https://opensource.com/sites/default/files/uploads/screenfetch.png (screenFetch) -[5]: https://opensource.com/sites/default/files/uploads/screenfetch-n.png (screenfetch -n option) -[6]: http://github.com/KittyKatt/screenFetch -[7]: https://github.com/dylanaraps/neofetch -[8]: https://github.com/dylanaraps/neofetch/blob/master/LICENSE.md -[9]: https://opensource.com/sites/default/files/uploads/neofetch.png (Neofetch) -[10]: https://github.com/dylanaraps/neofetch/wiki/Installation -[11]: https://github.com/dylanaraps/neofetch/wiki/Customizing-Info -[12]: https://github.com/dylanaraps/neofetch/issues diff --git a/translated/tech/20200122 Screenshot your Linux system configuration with Bash tools.md b/translated/tech/20200122 Screenshot your Linux system configuration with Bash tools.md new file mode 100644 index 0000000000..f7e2bb10aa --- /dev/null +++ b/translated/tech/20200122 Screenshot your Linux system configuration with Bash tools.md @@ -0,0 +1,109 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Screenshot your Linux system configuration with Bash tools) +[#]: via: (https://opensource.com/article/20/1/screenfetch-neofetch) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +使用 Bash 工具截屏 Linux 系统配置 +====== +使用 ScreenFetch 和 Neofetch 与其他人轻松分享 Linux 环境。 +![metrics and data shown on a computer screen][1] + +你可能有很多原因想要与他人分享 Linux 配置。你可能正在寻求帮助来对系统上的问题进行故障排除,或者你对所创建的环境感到非常自豪,因此想向其他开源爱好者展示。 + +你可以在 Bash 提示符下使用 **cat /proc/cpuinfo** 或 **lscpu** 命令获取某些信息。但是,如果你想共享更多详细信息,例如你的操作系统、内核、运行时间、shell 环境,屏幕分辨率等,那么可以选择两个很棒的工具:screenFetch 和 Neofetch。 + +### ScreenFetch + +[ScreenFetch][2] 是 Bash 命令行程序,它可以产生非常漂亮的系统配置和运行时间的截图。这是方便的与它人共享系统配置的方法。 + +在许多 Linux 发行版上安装 screenFetch 很简单。 + +在 Fedora 上,输入: + + +``` +`$ sudo dnf install screenfetch` +``` + +在 Ubuntu 上,输入: + + +``` +`$ sudo apt install screenfetch` +``` + +对于其他操作系统,包括 FreeBSD、MacOS 等,请查阅 screenFetch 的 wiki [安装页面][3]。安装 screenFetch 后,它可以生成详细而彩色的截图,如下所示: + +![screenFetch][4] + +ScreenFetch 还提供各种命令行选项来调整你的结果。例如, **screenfetch -v** 返回详细输出,逐行显示每个选项以及上面的显示。 + +**screenfetch -n** 在显示系统信息时消除了操作系统图标。 + +![screenfetch -n option][5] + +其他选项包括 **screenfetch -N**,它去除所有输出的颜色。**screenfetch -t**,它根据终端的大小截断输出。**screenFetch -E**,它可抑制错误输出。 + +请检查手册页来了解其他选项。ScreenFetch 在 GPLv3 许可证下的开源,你可以在它的 [GitHub 仓库][6]中了解有关该项目的更多信息。 + +### Neofetch + +[Neofetch][7] 是创建系统信息截图的另一个工具。它是用 Bash 3.2 编写的,在 [MIT 许可证][8]下开源。 + +根据项目网站,“Neofetch 支持近 150 种不同的操作系统。从 Linux 到 Windows,一直到 Minix、AIX 和 Haiku 等更晦涩的操作系统。” + +![Neofetch][9] + +该项目维护了一个 wiki,其中包含用于各种发行版和操作系统的出色的[安装文档] [10]。 + +如果你使用的是 Fedora、RHEL 或 CentOS,那么可以在 Bash 提示符下使用以下命令安装 Neofetch: + + +``` +`$ sudo dnf install neofetch` +``` + +在 Ubuntu 17.10 及更高版本上,你可以使用: + + +``` +`$ sudo apt install neofetch` +``` + +首次运行时,Neofetch 将 **~/.config/neofetch/config.conf** 文件写入主目录(**.config/config.conf**),它让你可以[自定义和控制] [ 11] Neofetch 输出的各个方面。例如,你可以配置 Neofetch 使用图像、ASCII 文件、你选择的壁纸,或者完全不使用。config.conf 文件还让与它人分享配置变得容易。 + +如果 Neofetch 不支持你的操作系统或不提供所需选项,请在项目的 [GitHub 仓库] [12]中打开一个问题。 + +### 总结 + +无论为什么要共享系统配置,screenFetch 或 Neofetch 都应该能做到。你是否知道在 Linux 上提供此功能的另一个开源工具?请在评论中分享你的最爱。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/screenfetch-neofetch + +作者:[Don Watkins][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/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://github.com/KittyKatt/screenFetch +[3]: https://github.com/KittyKatt/screenFetch/wiki/Installation +[4]: https://opensource.com/sites/default/files/uploads/screenfetch.png (screenFetch) +[5]: https://opensource.com/sites/default/files/uploads/screenfetch-n.png (screenfetch -n option) +[6]: http://github.com/KittyKatt/screenFetch +[7]: https://github.com/dylanaraps/neofetch +[8]: https://github.com/dylanaraps/neofetch/blob/master/LICENSE.md +[9]: https://opensource.com/sites/default/files/uploads/neofetch.png (Neofetch) +[10]: https://github.com/dylanaraps/neofetch/wiki/Installation +[11]: https://github.com/dylanaraps/neofetch/wiki/Customizing-Info +[12]: https://github.com/dylanaraps/neofetch/issues From 9ff8c76888e83e80faa181e394fec40d17df6f02 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 19 Feb 2020 08:26:49 +0800 Subject: [PATCH 073/315] translating --- sources/tech/20200210 Scan Kubernetes for errors with KRAWL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200210 Scan Kubernetes for errors with KRAWL.md b/sources/tech/20200210 Scan Kubernetes for errors with KRAWL.md index 1c7d36183d..5417ba630a 100644 --- a/sources/tech/20200210 Scan Kubernetes for errors with KRAWL.md +++ b/sources/tech/20200210 Scan Kubernetes for errors with KRAWL.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b45cd84dea637570b2b87df49e31e551b1e7800b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Feb 2020 10:05:18 +0800 Subject: [PATCH 074/315] Rename sources/tech/20200218 Building a community of practice in 5 steps.md to sources/talk/20200218 Building a community of practice in 5 steps.md --- .../20200218 Building a community of practice in 5 steps.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200218 Building a community of practice in 5 steps.md (100%) diff --git a/sources/tech/20200218 Building a community of practice in 5 steps.md b/sources/talk/20200218 Building a community of practice in 5 steps.md similarity index 100% rename from sources/tech/20200218 Building a community of practice in 5 steps.md rename to sources/talk/20200218 Building a community of practice in 5 steps.md From ce75b901c3fff416a6424982a5cef49dd6065f0f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Feb 2020 10:32:16 +0800 Subject: [PATCH 075/315] Rename sources/tech/20200216 Minicomputers and The Soul of a New Machine.md to sources/talk/20200216 Minicomputers and The Soul of a New Machine.md --- .../20200216 Minicomputers and The Soul of a New Machine.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200216 Minicomputers and The Soul of a New Machine.md (100%) diff --git a/sources/tech/20200216 Minicomputers and The Soul of a New Machine.md b/sources/talk/20200216 Minicomputers and The Soul of a New Machine.md similarity index 100% rename from sources/tech/20200216 Minicomputers and The Soul of a New Machine.md rename to sources/talk/20200216 Minicomputers and The Soul of a New Machine.md From 946682882e2d94777a5239626eac44357dc42543 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Feb 2020 10:35:58 +0800 Subject: [PATCH 076/315] PRF @wxy --- ...ernet with an open source search engine.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/translated/tech/20200207 Customize your internet with an open source search engine.md b/translated/tech/20200207 Customize your internet with an open source search engine.md index 86b929a3ef..ed19ed35ea 100644 --- a/translated/tech/20200207 Customize your internet with an open source search engine.md +++ b/translated/tech/20200207 Customize your internet with an open source search engine.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Customize your internet with an open source search engine) @@ -12,17 +12,17 @@ > 上手开源的对等 Web 索引器 YaCy。 -![Person using a laptop][1] +![](https://img.linux.net.cn/data/attachment/album/202002/19/103541la7erglz7oloa4ye.jpg) -很久以前,互联网很小,小到几个人就可以索引它们,这些人收集了所有网站的名称和链接,并按主题将它们分别列在页面或印刷书籍中。随着万维网网络的发展,“网络环”惯例得到了发展,在该惯例中,具有类似的内容、主题或敏感性的站点捆绑在一起,形成了通往每个成员的循环路径。环中任何站点的访问者都可以单击按钮以转到环中的下一个或上一个站点,以发现与其兴趣相关的新站点。 +很久以前,互联网很小,小到几个人就可以索引它们,这些人收集了所有网站的名称和链接,并按主题将它们分别列在页面或印刷书籍中。随着万维网网络的发展,形成了“网站环”形式,具有类似的内容、主题或敏感性的站点捆绑在一起,形成了通往每个成员的循环路径。环中任何站点的访问者都可以单击按钮以转到环中的下一个或上一个站点,以发现与其兴趣相关的新站点。 -过了一段时间,互联网似乎变得臃肿不堪了。每个人都在线上,有很多冗余和垃圾邮件,多到让你无法找到任何东西。Yahoo 和 AOL、CompuServe 以及类似的服务各自采用了不同的方法来解决这个问题,但是直到谷歌出现后,现代的搜索模型才得以普及。按谷歌的做法,互联网应该通过搜索引擎进行索引、排序和排名。 +又过了一段时间,互联网似乎变得臃肿不堪了。每个人都在网络上,有很多冗余信息和垃圾邮件,多到让你无法找到任何东西。Yahoo 和 AOL、CompuServe 以及类似的服务各自采用了不同的方法来解决这个问题,但是直到谷歌出现后,现代的搜索模型才得以普及。按谷歌的做法,互联网应该通过搜索引擎进行索引、排序和排名。 ### 为什么选择开源替代品? -像谷歌和 DuckDuckGo 这样的搜索引擎显然是卓有成效的。你可能是通过搜索引擎访问的本站。尽管对于因主机选择不遵循最佳实践来优化搜索引擎从而使内容陷入困境仍存在争论,但用于管理丰富的文化、知识和轻率的信息(即互联网)的现代解决方案是无情的索引。 +像谷歌和 DuckDuckGo 这样的搜索引擎显然是卓有成效的。你可能是通过搜索引擎访问的本站。尽管对于因主机没有选择遵循优化搜索引擎的最佳实践从而导致会内容陷入困境这件事仍存在争论,但用于管理丰富的文化、知识和轻率的信息(即互联网)的现代解决方案是冷冰冰的索引。 -但是也许出于隐私方面的考虑,或者你希望为使互联网更加独立而做出的贡献,你或许不愿意使用谷歌或 DuckDuckGo。如果你对此感兴趣,那么可以考虑参加 [YaCy] [2],这是一个对等互联网索引器和搜索引擎。 +但是也许出于隐私方面的考虑,或者你希望为使互联网更加独立而做出贡献,你或许不愿意使用谷歌或 DuckDuckGo。如果你对此感兴趣,那么可以考虑参加 [YaCy][2],这是一个对等互联网索引器和搜索引擎。 ### 安装 YaCy @@ -52,29 +52,29 @@ $ /opt/startYACY.sh & 如果你使用的是 Firefox Web 浏览器,则只需单击几下,即可在 Awesome Bar(Mozilla 给 URL 栏起的名称)中将 YaCy 设置为默认搜索引擎。 -首先,如果尚未显示,在 Firefox 工具栏中使专用搜索栏显示出来(你不必使搜索栏保持一直可见;只需要激活它足够长的时间即可添加自定义搜索引擎)。Firefox 右上角的“汉堡”菜单中的“自定义”菜单中提供了搜索栏。在 Firefox 工具栏上的搜索栏可见后,导航至 `localhost:8090`,然后单击刚添加的 Firefox 搜索栏中的放大镜图标。单击选项将 YaCy 添加到你的 Firefox 搜索引擎。 +首先,如果尚未显示,在 Firefox 工具栏中使专用搜索栏显示出来(你不必使搜索栏保持一直可见;只需要激活它足够长的时间即可添加自定义搜索引擎)。Firefox 右上角的“汉堡”菜单中的“自定义”菜单中提供了搜索栏。在 Firefox 工具栏上的搜索栏可见后,导航至 `localhost:8090`,然后单击刚添加的 Firefox 搜索栏中的放大镜图标。单击选项将 YaCy 添加到你的 Firefox 的搜索引擎中。 ![Adding YaCy to Firefox][7] -完成此操作后,你可以在 Firefox 首选项中将其标记为默认值,或者仅在 Firefox 搜索栏中执行的搜索中选择性地使用它。如果将其设置为默认搜索引擎,则可能不需要专用的搜索栏,因为 Awesome Bar 也使用默认引擎,因此可以将其从工具栏中删除。 +完成此操作后,你可以在 Firefox 首选项中将其标记为默认值,或者仅在 Firefox 搜索栏中执行的搜索中选择性地使用它。如果将其设置为默认搜索引擎,则可能不需要专用搜索栏,因为 Awesome Bar 也使用默认引擎,因此可以将其从工具栏中删除。 ### 对等搜索引擎如何工作 -YaCy 是一个开源的分布式搜索引擎。它是用 [Java][8] 编写的,因此可以在任何平台上运行,并且可以执行 Web 爬网、索引和搜索。这是一个对等(P2P)网络,因此每个运行 YaCy 的用户都将努力地不断跟踪互联网的变化情况。当然,没有单个用户能拥有整个互联网的完整索引,因为这将需要一个数据中心来容纳,但是该索引分布在所有 YaCy 用户中且是冗余的。它与 BitTorrent 非常相似(因为它使用分布式哈希表 DHT 来引用索引条目),只不过你所共享的数据是单词和 URL 关联的矩阵。通过混合哈希表返回的结果,没人能告诉谁搜索了哪些单词,因此所有搜索在功能上都是匿名的。这是用于无偏见、无广告、未跟踪和匿名搜索的有效系统,你只需要使用它就加入了它。 +YaCy 是一个开源的分布式搜索引擎。它是用 [Java][8] 编写的,因此可以在任何平台上运行,并且可以执行 Web 爬网、索引和搜索。这是一个对等(P2P)网络,因此每个运行 YaCy 的用户都将努力地不断跟踪互联网的变化情况。当然,没有单个用户能拥有整个互联网的完整索引,因为这将需要一个数据中心来容纳,但是该索引分布在所有 YaCy 用户中且是冗余的。它与 BitTorrent 非常相似(因为它使用分布式哈希表 DHT 来引用索引条目),只不过你所共享的数据是单词和 URL 关联的矩阵。通过混合哈希表返回的结果,没人能说出谁搜索了哪些单词,因此所有搜索在功能上都是匿名的。这是用于无偏见、无广告、未跟踪和匿名搜索的有效系统,你只需要使用它就加入了它。 ### 搜索引擎和算法 索引互联网的行为是指将网页分成单个单词,然后将页面的 URL 与每个单词相关联。在搜索引擎中搜索一个或多个单词将获取与该查询关联的所有 URL。YaCy 客户端在运行时也是如此。 -客户端要做的另一件事是为你的浏览器提供搜索界面。你可以将网络浏览器指向 `localhost:8090` 来搜索 YaCy,而不是在要搜索时导航到谷歌。你甚至可以将其添加到浏览器的搜索栏中(取决于浏览器的可扩展性),因此可以从 URL 栏中进行搜索。 +客户端要做的另一件事是为你的浏览器提供搜索界面。你可以将 Web 浏览器指向 `localhost:8090` 来搜索 YaCy,而不是在要搜索时导航到谷歌。你甚至可以将其添加到浏览器的搜索栏中(取决于浏览器的可扩展性),因此可以从 URL 栏中进行搜索。 ### YaCy 的防火墙设置 -首次开始使用 YaCy 时,它可能运行在“初级”模式下。这意味着你的客户端爬网的站点仅对你可用,因为其他 YaCy 客户端无法访问你的索引条目。要加入对等环境,必须在路由器的防火墙(或者你正在运行的软件防火墙)中打开端口 8090, 这称为“高级”模式。 +首次开始使用 YaCy 时,它可能运行在“初级”模式下。这意味着你的客户端爬网的站点仅对你可用,因为其他 YaCy 客户端无法访问你的索引条目。要加入对等环境,必须在路由器的防火墙(或者你正在运行的软件防火墙)中打开端口 8090,这称为“高级”模式。 -如果你使用的是 Linux,则可以在《[使用防火墙让你的 Linux 更加强大][9]》中找到有关计算机防火墙的更多信息。 在其他平台上,请参考操作系统的文档。 +如果你使用的是 Linux,则可以在《[使用防火墙让你的 Linux 更加强大][9]》中找到有关计算机防火墙的更多信息。在其他平台上,请参考操作系统的文档。 -互联网服务提供商(ISP)提供的路由器上几乎总是启用防火墙,并且这里有太多种类的防火墙无法准确说明。大多数路由器都提供了在防火墙中“打洞”的选项,因为许多流行的联网游戏都需要双向流量。 +互联网服务提供商(ISP)提供的路由器上几乎总是启用了防火墙,并且有太多种类的防火墙无法准确说明。大多数路由器都提供了在防火墙上“打洞”的选项,因为许多流行的联网游戏都需要双向流量。 如果你知道如何登录路由器(通常为 192.168.0.1 或 10.1.0.1,但可能因制造商的设置而异),则登录并查找配置面板来控制“防火墙”或“端口转发”或“应用”。 @@ -90,7 +90,7 @@ YaCy 是一个开源的分布式搜索引擎。它是用 [Java][8] 编写的, ### 你的互联网 -使用 YaCy 搜索引擎可以做的不仅仅是被动搜索。你可以强制抓取不太显眼的网站,可以请求对网站进行网络抓取,可以选择使用 YaCy 进行本地搜索,等等。你可以更好地控制*你的*互联网的外观。高级用户越多,索引的网站就越多。索引的网站越多,所有用户的体验就越好。加入吧! +使用 YaCy 搜索引擎可以做的不仅仅是被动搜索。你可以强制抓取不太显眼的网站,可以请求对网站进行网络抓取,可以选择使用 YaCy 进行本地搜索等等。你可以更好地控制*你的*互联网的所呈现的一切。高级用户越多,索引的网站就越多。索引的网站越多,所有用户的体验就越好。加入吧! -------------------------------------------------------------------------------- @@ -99,7 +99,7 @@ via: https://opensource.com/article/20/2/open-source-search-engine 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7b39f1ec1b57e0594158f69b91d1f59023e53254 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Feb 2020 10:36:28 +0800 Subject: [PATCH 077/315] PUB @wxy https://linux.cn/article-11905-1.html --- ...stomize your internet with an open source search engine.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200207 Customize your internet with an open source search engine.md (99%) diff --git a/translated/tech/20200207 Customize your internet with an open source search engine.md b/published/20200207 Customize your internet with an open source search engine.md similarity index 99% rename from translated/tech/20200207 Customize your internet with an open source search engine.md rename to published/20200207 Customize your internet with an open source search engine.md index ed19ed35ea..ed102d2f0e 100644 --- a/translated/tech/20200207 Customize your internet with an open source search engine.md +++ b/published/20200207 Customize your internet with an open source search engine.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11905-1.html) [#]: subject: (Customize your internet with an open source search engine) [#]: via: (https://opensource.com/article/20/2/open-source-search-engine) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 62e18ebfe8953874c5f3d6500ffe62546cba8144 Mon Sep 17 00:00:00 2001 From: qianmingtian <40565099+qianmingtian@users.noreply.github.com> Date: Wed, 19 Feb 2020 10:42:33 +0800 Subject: [PATCH 078/315] Translating by qianmingtian --- sources/tech/20200217 How to install Vim plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200217 How to install Vim plugins.md b/sources/tech/20200217 How to install Vim plugins.md index e947b18607..3b9f77a8c3 100644 --- a/sources/tech/20200217 How to install Vim plugins.md +++ b/sources/tech/20200217 How to install Vim plugins.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qianmingtian) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e7d178b4a570b68655baa71b31b188cd4480151e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Feb 2020 11:14:48 +0800 Subject: [PATCH 079/315] PRF @geekpi --- ...buntu With This Single Command -Beginner-s Tip.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/translated/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md b/translated/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md index 048c0493ab..267033736e 100644 --- a/translated/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md +++ b/translated/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md @@ -1,18 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Install All Essential Media Codecs in Ubuntu With This Single Command [Beginner’s Tip]) [#]: via: (https://itsfoss.com/install-media-codecs-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -使用此单条命令在 Ubuntu 中安装所有基本媒体编解码器(初学者技巧) +一条命令在 Ubuntu 中安装所有基本的媒体编解码器 ====== 如果你刚刚安装了 Ubuntu 或其他 [Ubuntu 特色版本][1] 如 Kubuntu、Lubuntu 等,你会注意到系统无法播放某些音频或视频文件。 -对于视频文件,你可以[在 Ubuntu 上安装 VLC][2]。 [VLC][3] 是 [Linux 上的最佳视频播放器][4]之一,它几乎可以播放任何视频文件格式。但你仍然会遇到无法播放音频和 flash 的麻烦。 +对于视频文件,你可以[在 Ubuntu 上安装 VLC][2]。[VLC][3] 是 [Linux 上的最佳视频播放器][4]之一,它几乎可以播放任何视频文件格式。但你仍然会遇到无法播放音频和 flash 的麻烦。 好消息是 [Ubuntu][5] 提供了一个软件包来安装所有基本的媒体编解码器:ubuntu-restricted-extras。 @@ -44,7 +44,7 @@ sudo add-apt-repository multiverse sudo apt install ubuntu-restricted-extras ``` -输入回车后,你会被要求输入密码,_**当你输入密码时,屏幕不会有显示**_。这是正常的。输入你的密码并回车。 +输入回车后,你会被要求输入密码,**当你输入密码时,屏幕不会有显示**。这是正常的。输入你的密码并回车。 它将显示大量要安装的包。按回车确认选择。 @@ -60,7 +60,7 @@ sudo apt install ubuntu-restricted-extras ##### 在 Kubuntu、Lubuntu、Xubuntu 上安装受限制的额外软件包 -请记住,Kubuntu、Lubuntu 和 Xubuntu 都有此软件包,并有各自的名称。它们本应使用相同的名字,但不幸的是并不是。 +请记住,Kubuntu、Lubuntu 和 Xubuntu 都有此软件包,并有各自不同的名称。它们本应使用相同的名字,但不幸的是并不是。 在 Kubuntu 上,使用以下命令: @@ -91,7 +91,7 @@ via: https://itsfoss.com/install-media-codecs-ubuntu/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7612a7dd3801b65b566a970f2b2716d24225fa0c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Feb 2020 11:15:28 +0800 Subject: [PATCH 080/315] PUB @geekpi https://linux.cn/article-11906-1.html --- ...decs in Ubuntu With This Single Command -Beginner-s Tip.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md (98%) diff --git a/translated/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md b/published/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md similarity index 98% rename from translated/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md rename to published/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md index 267033736e..5c6d5e90ea 100644 --- a/translated/tech/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md +++ b/published/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11906-1.html) [#]: subject: (Install All Essential Media Codecs in Ubuntu With This Single Command [Beginner’s Tip]) [#]: via: (https://itsfoss.com/install-media-codecs-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 401cb123c02afd240f55f8dfa6d467e8c4ab4985 Mon Sep 17 00:00:00 2001 From: qianmigntian Date: Wed, 19 Feb 2020 15:50:43 +0800 Subject: [PATCH 081/315] Translated by qianmingtian --- .../20200217 How to install Vim plugins.md | 177 ------------------ .../20200217 How to install Vim plugins.md | 167 +++++++++++++++++ 2 files changed, 167 insertions(+), 177 deletions(-) delete mode 100644 sources/tech/20200217 How to install Vim plugins.md create mode 100644 translated/tech/20200217 How to install Vim plugins.md diff --git a/sources/tech/20200217 How to install Vim plugins.md b/sources/tech/20200217 How to install Vim plugins.md deleted file mode 100644 index 3b9f77a8c3..0000000000 --- a/sources/tech/20200217 How to install Vim plugins.md +++ /dev/null @@ -1,177 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (qianmingtian) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to install Vim plugins) -[#]: via: (https://opensource.com/article/20/2/how-install-vim-plugins) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -How to install Vim plugins -====== -Whether you install them manually or with a package manager, plugins can -help you create the perfect Vim for your workflow. -![Team checklist and to dos][1] - -While [Vim][2] is fast and efficient, by default, it is but a mere text editor. At least, that's what it would be without plugins, which build upon Vim and add extra features to make it so much more than just a window for typing text. With the right mix of plugins, you can take control of your life and forge your own unique Vim experience. You can [customize your theme][3], and you can add syntax highlighting, code linting, version trackers, and much much more. - -### How to install Vim plugins - -Vim is extensible through plugins, but for a long time, there was no official method for installing them. As of the Vim 8.x series, however, there's a structure around how plugins are intended to be installed and loaded. You may encounter old instructions online or in project README files, but as long as you're running Vim 8 or greater, you should install according to Vim's [official plugin install method][4] or with a Vim package manager. You can use a package manager regardless of what version you run (including releases older than 8.x), which makes the install process easier than maintaining updates yourself. - -Both the manual and automated methods are worth knowing, so keep reading to learn about both. - -### Install plugins manually (Vim 8 and above) - -A Vim package is a directory containing one or more plugins. By default, your Vim settings are contained in **~/.vim**, so that's where Vim looks for plugins when you launch it. (The examples below use the generic name **vendor** to indicate that the plugins are obtained from an entity that is not you.) - -When you start Vim, it first processes your **.vimrc** file, and then it scans all directories in **~/.vim** for plugins contained in **pack/*/start**. - -By default, your **~/.vim** directory (if you even have one) has no such file structure, so set that up with: - - -``` -`$ mkdir -p ~/.vim/pack/vendor/start` -``` - -Now you can place Vim plugins in **~/.vim/pack/vendor/start**, and they'll automatically load when you launch Vim. - -For example, try installing [NERDTree][5], a text-based file manager for Vim. First, use Git to clone a snapshot of the NERDTree repository: - - -``` -$ git clone --depth 1 \ -  \ -  ~/.vim/pack/vendor/start/nerdtree -``` - -Launch Vim or gvim, and type this command: - - -``` -`:NERDTree` -``` - -A file tree will open along the left side of your Vim window. - -![NERDTree plugin][6] - -If you don't want a plugin to load automatically every time you launch Vim, you can create an **opt** directory within your **~/.vim/pack/vendor** directory: - - -``` -`$ mkdir ~/.vim/pack/vendor/opt` -``` - -Any plugins installed into **opt** are available to Vim but not loaded into memory until you add them to a session with the **packadd** command, e.g., for an imaginary plugin called foo: - - -``` -`:packadd foo` -``` - -Officially, Vim recommends that each plugin project gets its own directory within **~/.vim/pack**. For example, if you were to install the NERDTree plugin and the imaginary foo plugin, you would create this structure: - - -``` -$ mkdir -p ~/.vim/pack/NERDTree/start/ -$ git clone --depth 1 \ -  \ -  ~/.vim/pack/NERDTree/start/NERDTree -$ mkdir -p ~/.vim/pack/foo/start/ -$ git clone --depth 1 \ -  \ -  ~/.vim/pack/foo/start/foo -``` - -Whether that's convenient is up to you. - -### Using a Vim package manager (any Vim version) - -Since Vim series 8, package managers have become less useful, but some users still prefer them because of their ability to auto-update several plugins. There are several package managers to choose from, and they're each different, but [vim-plug][7] has some great features and the best documentation of them all, which makes it easy to start with and to explore in depth later. - -#### Installing plugins with vim-plug - -Install vim-plug so that it auto-loads at launch with: - - -``` -$ curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ -  -``` - -Create a **~/.vimrc** file (if you don't have one already), and enter this text: - - -``` -call plug#begin() -Plug 'preservim/NERDTree' -call plug#end() -``` - -Each time you want to install a plugin, you must enter the name and location of the plugin between the **plug#begin()** and **plug#end** lines. (The NERDTree file manager is used above as an example.) If the plugin you want isn't hosted on GitHub, then you can provide the full URL instead of just the GitHub username and project ID. You can even "install" local plugins outside of your **~/.vim** directory. - -Finally, start Vim and prompt vim-plug to install the plugins listed in **~/.vimrc**: - - -``` -`:PlugInstall` -``` - -Wait for the plugins to be downloaded. - -#### Update plugins with vim-plug - -Editing **~/.vimrc** and issuing a command to do the installation probably doesn't seem like much of a savings over the manual install process, but the real benefit to vim-plug is in updates. To update all installed plugins, issue this Vim command: - - -``` -`:PlugUpdate` -``` - -If you don't want to update all plugins, you can update any subset by adding the plugin's name: - - -``` -`:PlugUpdate NERDTree` -``` - -#### Restore plugins - -Another vim-plug benefit is its export and recovery function. As any Vim user knows, the way Vim works is often unique to each user—in part because of plugins. Once you get the right blend of plugins installed and configured, the last thing you want is to lose track of them. - -Vim-plug has this command to generate a script for restoring all current plugins: - - -``` -`:PlugSnapshot ~/vim-plug.list` -``` - -There are many other functions for vim-plug, so refer to its [project page][7] for the full documentation. - -### Create the perfect Vim - -When you spend all day in a program, you want every little detail to serve you the best it possibly can. Get to know Vim and its many plugins until you build the perfect application for what you do. - -Got a favorite Vim plugin? Tell us all about it in the comments! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/how-install-vim-plugins - -作者:[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/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) -[2]: https://www.vim.org/ -[3]: https://opensource.com/article/19/12/colors-themes-vim -[4]: https://github.com/vim/vim/blob/03c3bd9fd094c1aede2e8fe3ad8fd25b9f033053/runtime/doc/repeat.txt#L515 -[5]: https://github.com/preservim/nerdtree -[6]: https://opensource.com/sites/default/files/uploads/vim-nerdtree.jpg (NERDTree plugin) -[7]: https://github.com/junegunn/vim-plug diff --git a/translated/tech/20200217 How to install Vim plugins.md b/translated/tech/20200217 How to install Vim plugins.md new file mode 100644 index 0000000000..88b5779b0f --- /dev/null +++ b/translated/tech/20200217 How to install Vim plugins.md @@ -0,0 +1,167 @@ +[#]: collector: (lujun9972) +[#]: translator: (qianmingtian) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to install Vim plugins) +[#]: via: (https://opensource.com/article/20/2/how-install-vim-plugins) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +如何安装 Vim 插件 +====== + +无论你是手动安装还是通过包管理器安装,插件都可以帮你为你的工作流中打造一个完美的 Vim 。 +![Team checklist and to dos][1] + +虽然 [Vim][2] 是快速且高效的,但在默认情况下,它仅仅只是一个文本编辑器。至少,这就是没有插件的情况 Vim 应当具备的样子,插件构建在 Vim 之上,并添加额外的功能,使 Vim 不仅仅是一个输入文本的窗口。有了合适的插件组合,你可以控制你的生活,形成你自己独特的 Vim 体验。你可以[自定义你的主题][3],你可以添加语法高亮,代码 linting ,版本跟踪器等等。 + +### 怎么安装 Vim 插件 + +Vim 可以通过插件进行扩展,但很长一段时间以来,并没有官方的安装方式去安装这些插件。从 Vim 8 开始,有一个关于插件如何安装和加载的结构。你可能会在网上或项目自述文件中遇到旧的说明,但只要你运行 Vim 8 或更高版本,你应该根据 Vim 的[官方插件安装方法][4]安装或使用 Vim 包管理器。您可以使用包管理器,无论你运行的是什么版本(包括比 8.x 更老的版本),这使得安装过程比您自己维护更新更容易。 + +手动和自动安装方法都值得了解,所以请继续阅读以了解这两种方法。 + +### 手动安装插件( Vim 8 及以上版本) + +Vim 包是一个包含一个或多个插件的目录。默认情况下,你的 Vim 设置包含在 **~/vim** 中,这是 vim 在启动时寻找插件的地方。(下面的示例使用了通用名称 **vendor** 来表示插件是从一个不是你的实体获得的。) + +当你启动 Vim 时,它首先处理你的 **.vimrc**文件,然后扫描 **~/.vim** 中的所有目录查找包含在 **pack/*/start** 中的插件。 + +默认情况下,你的 **~/.vim** 目录(如果你有一个)没有这样的文件结构,所以设置为: + +``` +`$ mkdir -p ~/.vim/pack/vendor/start` +``` + +现在,你可以将 Vim 插件放在 **~/.vim/pack/vendor/start** 中,它们会在你启动 Vim 时自动加载。 + +例如,尝试安装一下 [NERDTree][5] ,一个基于文本的 Vim 文件管理器。首先,使用 Git 克隆 NERDTree 存储库的快照: + + +``` +$ git clone --depth 1 \ +  \ +  ~/.vim/pack/vendor/start/nerdtree +``` + +启动 Vim 或者 gvim ,然后键入如下命令: + + +``` +`:NERDTree` +``` + +Vim 窗口左侧将打开一个文件树。 + +![NERDTree plugin][6] + +如果你不想每次启动 Vim 时自动加载插件,你可以在 **~/.vim/pack/vendor** 中创建 **opt** 文件夹: + +``` +`$ mkdir ~/.vim/pack/vendor/opt` +``` + +任何安装到 **opt** 的插件都可被 Vim 使用,但是只有当你使用 **packadd** 命令将它们添加到一个会话中时,它们才会被加载到内存中。例如,一个虚构的叫 foo 的插件: + +``` +`:packadd foo` +``` + +Vim 官方建议每个插件项目在 **~/.Vim /pack** 中有自己的目录。例如,如果你要安装 NERDTree 插件和假想的 foo 插件,你需要创建这样的目录结构: + +``` +$ mkdir -p ~/.vim/pack/NERDTree/start/ +$ git clone --depth 1 \ +  \ +  ~/.vim/pack/NERDTree/start/NERDTree +$ mkdir -p ~/.vim/pack/foo/start/ +$ git clone --depth 1 \ +  \ +  ~/.vim/pack/foo/start/foo +``` + +这样做是否方便取决于你。 + +### 使用 Vim 包管理器(任何 Vim 版本) + +自从 Vim 8 以后,包管理器变得不那么有用了,但是一些用户仍然喜欢它们,因为它们能够自动更新一些插件。有几个包管理器可供选择,并且它们各不相同,但是 [vim-plug][7] 有一些很棒的特性和最好的文档,这使我们很容易开始并在以后深入研究。 + +#### 使用 vim-plug 安装插件 + +安装 vim-plug ,以便它在启动时自动加载: + +``` +$ curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ +  +``` + +创建一个 **~/.vimrc** 文件(如果你还没有文件),然后输入以下文本: + +``` +call plug#begin() +Plug 'preservim/NERDTree' +call plug#end() +``` + +每次要安装插件时,都必须在 **plug#begin()** 和 **plug#end()** 之间输入插件的名称和位置(上面以 NERDTree 文件管理器为例。)。如果你所需的插件未托管在 GitHub 上,你可以提供完整的URL,而不仅仅是 GitHub 用户名和项目 ID 。你甚至可以在 **~/.vim** 目录之外“安装”本地插件。 + +最后,启动 Vim 并提示 vim-plug 安装 **~/.vimrc** 中列出的插件: + +``` +`:PlugInstall` +``` + +等待插件下载。 + +#### 通过 vim-plug 更新插件 + +与手动安装过程相比,编辑 **~/.vimrc** 并使用命令来进行安装可能看起来并没有多省事,但是 vim-plug 的真正优势在更新。更新所有安装的插件,使用这个 Vim 命令: + +``` +`:PlugUpdate` +``` + +如果你不想更新所有的插件,你可以通过添加插件的名字来更新任何插件: + +``` +`:PlugUpdate NERDTree` +``` + +#### 恢复插件 + +vim-plug 的另一个优点是它的导出和恢复功能。 Vim 用户都知道,正是插件的缘故,通常每个用户使用 Vim 的工作方式都是独一无二的。一旦你安装和配置了正确的插件组合,你最不想要的就是再也找不到它们。 + +Vim-plug 有这个命令来生成一个脚本来恢复所有当前的插件: + +``` +`:PlugSnapshot ~/vim-plug.list` +``` +vim-plug 还有许多其他的功能,所以请参考它的[项目页面][7]以获得完整的文档。 + +### 打造一个完美的 Vim + +当你整天都在做一个项目时,你希望每一个小细节都能为你提供最好的服务。了解 Vim 和它的许多插件,直到你为你所做的事情构建出一个完美的应用程序。 + +有喜欢的 Vim 插件吗?请在评论中告诉我们吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/how-install-vim-plugins + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[qianmingtian][c] +校对:[校对者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 +[c]: https://github.com/qianmingtian +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) +[2]: https://www.vim.org/ +[3]: https://opensource.com/article/19/12/colors-themes-vim +[4]: https://github.com/vim/vim/blob/03c3bd9fd094c1aede2e8fe3ad8fd25b9f033053/runtime/doc/repeat.txt#L515 +[5]: https://github.com/preservim/nerdtree +[6]: https://opensource.com/sites/default/files/uploads/vim-nerdtree.jpg (NERDTree plugin) +[7]: https://github.com/junegunn/vim-plug From 7d2a980c2839832687ef3d2670bd3e4e99c913b9 Mon Sep 17 00:00:00 2001 From: qianmigntian Date: Wed, 19 Feb 2020 15:58:43 +0800 Subject: [PATCH 082/315] Translated by qianmigntian and fix some error --- translated/tech/20200217 How to install Vim plugins.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/tech/20200217 How to install Vim plugins.md b/translated/tech/20200217 How to install Vim plugins.md index 88b5779b0f..b21da86139 100644 --- a/translated/tech/20200217 How to install Vim plugins.md +++ b/translated/tech/20200217 How to install Vim plugins.md @@ -23,7 +23,7 @@ Vim 可以通过插件进行扩展,但很长一段时间以来,并没有官 ### 手动安装插件( Vim 8 及以上版本) -Vim 包是一个包含一个或多个插件的目录。默认情况下,你的 Vim 设置包含在 **~/vim** 中,这是 vim 在启动时寻找插件的地方。(下面的示例使用了通用名称 **vendor** 来表示插件是从一个不是你的实体获得的。) +Vim 包是一个包含一个或多个插件的目录。默认情况下,你的 Vim 设置包含在 **~/.vim** 中,这是 vim 在启动时寻找插件的地方。(下面的示例使用了通用名称 **vendor** 来表示插件是从一个不是你的实体获得的。) 当你启动 Vim 时,它首先处理你的 **.vimrc**文件,然后扫描 **~/.vim** 中的所有目录查找包含在 **pack/*/start** 中的插件。 @@ -103,7 +103,7 @@ Plug 'preservim/NERDTree' call plug#end() ``` -每次要安装插件时,都必须在 **plug#begin()** 和 **plug#end()** 之间输入插件的名称和位置(上面以 NERDTree 文件管理器为例。)。如果你所需的插件未托管在 GitHub 上,你可以提供完整的URL,而不仅仅是 GitHub 用户名和项目 ID 。你甚至可以在 **~/.vim** 目录之外“安装”本地插件。 +每次要安装插件时,都必须在 **plug#begin()** 和 **plug#end()** 之间输入插件的名称和位置(上面以 NERDTree 文件管理器为例。)。如果你所需的插件未托管在 GitHub 上,你可以提供完整的 URL ,而不仅仅是 GitHub 用户名和项目 ID 。你甚至可以在 **~/.vim** 目录之外“安装”本地插件。 最后,启动 Vim 并提示 vim-plug 安装 **~/.vimrc** 中列出的插件: From c75478ddb1efab63b451c2b1ef31050a2de6d8c0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Feb 2020 16:46:17 +0800 Subject: [PATCH 083/315] APL --- .../20200126 Use Vim to send email and check your calendar.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200126 Use Vim to send email and check your calendar.md b/sources/tech/20200126 Use Vim to send email and check your calendar.md index fdb709aaef..e8df90f319 100644 --- a/sources/tech/20200126 Use Vim to send email and check your calendar.md +++ b/sources/tech/20200126 Use Vim to send email and check your calendar.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4dba1925d9220967b27f5764ab7c2b5a636c3bf7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Feb 2020 18:35:43 +0800 Subject: [PATCH 084/315] TSL --- ...m to send email and check your calendar.md | 117 ------------------ ...m to send email and check your calendar.md | 113 +++++++++++++++++ 2 files changed, 113 insertions(+), 117 deletions(-) delete mode 100644 sources/tech/20200126 Use Vim to send email and check your calendar.md create mode 100644 translated/tech/20200126 Use Vim to send email and check your calendar.md diff --git a/sources/tech/20200126 Use Vim to send email and check your calendar.md b/sources/tech/20200126 Use Vim to send email and check your calendar.md deleted file mode 100644 index e8df90f319..0000000000 --- a/sources/tech/20200126 Use Vim to send email and check your calendar.md +++ /dev/null @@ -1,117 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use Vim to send email and check your calendar) -[#]: via: (https://opensource.com/article/20/1/vim-email-calendar) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Use Vim to send email and check your calendar -====== -Manage your email and calendar right from your text editor in the -sixteenth in our series on 20 ways to be more productive with open -source in 2020. -![Calendar close up snapshot][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### Doing (almost) all the things with Vim, part 1 - -I use two text editors regularly—[Vim][2] and [Emacs][3]. Why both? They have different use cases, and I'll talk about some of them in the next few articles in this series. - -![][4] - -OK, so why do everything in Vim? Because if there is one application that is on every machine I have access to, it's Vim. And if you are like me, you probably already spend a lot of time in Vim. So why not use it for _all the things_? - -Before that, though, you need to do some things. The first is to make sure you have Ruby support in Vim. You can check that with **vim --version | grep ruby**. If the result is not **+ruby**, that needs to be fixed. This can be tricky, and you should check your distribution's documentation for the right package to install. On MacOS, this is the official MacVim (not from Brew), and on most Linux distributions, this is either vim-nox or vim-gtk—NOT vim-gtk3. - -I use [Pathogen][5] to autoload my plugins and bundles. If you use [Vundle][6] or another Vim package manager, you'll need to adjust the commands below to work with it. - -#### Do your email in Vim - -A good starting place for making Vim a bigger part of your productivity plan is using it to send and receive email with [Notmuch][7] using [abook][8] to access your contact list. You need to install some things for this. All the sample code below is on Ubuntu, so you'll need to adjust for that if you are using a different distribution. Do the setup with: - - -``` -sudo apt install notmuch-vim ruby-mail -curl -o ~/.vim/plugin/abook --create-dirs -``` - -So far, so good. Now start Vim and execute **:NotMuch**. There may be some warnings due to the older version of the mail library **notmuch-vim** was written for, but in general, Vim will now be a full-featured Notmuch mail client. - -![Reading Mail in Vim][9] - -If you want to perform a search for a specific tag, type **\t**, enter the name of the tag, and press Enter. This will pull up a list of all messages with that tag. The **\s** key combination brings up a **Search:** prompt that will do a full search of the Notmuch database. Navigate the message list with the arrow keys, press Enter to display the selected item, and enter **\q** to exit the current view. - -To compose mail, use the **\c** keystroke. You will see a blank message. This is where the **abook.vim** plugin comes in. Hit **Esc** and enter **:AbookQuery <SomeName>**, where <SomeName> is a part of the name or email address you want to look for. You will get a list of entries in the abook database that match your search. Select the address you want by typing its number to add it to the email's address line. Finish typing and editing the email, press **Esc** to exit edit mode, and enter **,s** to send. - -If you want to change the default folder view when **:NotMuch** starts up, you can add the variable **g:notmuch_folders** to your **.vimrc** file: - - -``` -let g:notmuch_folders = [ -      \ [ 'new', 'tag:inbox and tag:unread' ], -      \ [ 'inbox', 'tag:inbox' ], -      \ [ 'unread', 'tag:unread' ], -      \ [ 'News', 'tag:@sanenews' ], -      \ [ 'Later', 'tag:@sanelater' ], -      \ [ 'Patreon', 'tag:@patreon' ], -      \ [ 'LivestockConservancy', 'tag:livestock-conservancy' ], -    \ ] -``` - -There are many more settings covered in the Notmuch plugin's documentation, including setting up keys for tags and using alternate mail programs. - -#### Consult your calendar in Vim - -![][10] - -Sadly, there do not appear to be any calendar programs for Vim that use the vCalendar or iCalendar formats. There is [Calendar.vim][11], which is very well done. Set up Vim to access your calendar with: - - -``` -cd ~/.vim/bundle -git clone [git@github.com][12]:itchyny/calendar.vim.git -``` - -Now, you can see your calendar in Vim by entering **:Calendar**. You can switch between year, month, week, day, and clock views with the **<** and **>** keys. If you want to start with a particular view, use the **-view=** flag to tell it which one you wish to see. You can also add a date to any of the views. For example, if I want to see what is going on the week of July 4, 2020, I would enter **:Calendar -view week 7 4 2020**. The help is pretty good and can be accessed with the **?** key. - -![][13] - -Calendar.vim also supports Google Calendar (which I need), but in December 2019 Google disabled the access for it. The author has posted a workaround in [the issue on -GitHub][14]. - -So there you have it, your mail, addresses, and calendars in Vim. But you aren't done yet; you'll do even more with Vim tomorrow! - -Vim offers great benefits to writers, regardless of whether they are technically minded or not. - -Need to keep your schedule straight? Learn how to do it using open source with these free... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/vim-email-calendar - -作者:[Kevin Sonney][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/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/calendar.jpg?itok=jEKbhvDT (Calendar close up snapshot) -[2]: https://www.vim.org/ -[3]: https://www.gnu.org/software/emacs/ -[4]: https://opensource.com/sites/default/files/uploads/day16-image1.png -[5]: https://github.com/tpope/vim-pathogen -[6]: https://github.com/VundleVim/Vundle.vim -[7]: https://opensource.com/article/20/1/organize-email-notmuch -[8]: https://opensource.com/article/20/1/sync-contacts-locally -[9]: https://opensource.com/sites/default/files/uploads/productivity_16-2.png (Reading Mail in Vim) -[10]: https://opensource.com/sites/default/files/uploads/day16-image3.png -[11]: https://github.com/itchyny/calendar.vim -[12]: mailto:git@github.com -[13]: https://opensource.com/sites/default/files/uploads/day16-image4.png -[14]: https://github.com/itchyny/calendar.vim/issues/156 diff --git a/translated/tech/20200126 Use Vim to send email and check your calendar.md b/translated/tech/20200126 Use Vim to send email and check your calendar.md new file mode 100644 index 0000000000..d19de3dfef --- /dev/null +++ b/translated/tech/20200126 Use Vim to send email and check your calendar.md @@ -0,0 +1,113 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Vim to send email and check your calendar) +[#]: via: (https://opensource.com/article/20/1/vim-email-calendar) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +使用 Vim 发送邮件和检查日历 +====== + +> 在我们的在 2020 年用开源实现更高生产力的二十种方式的第十六篇中,直接通过文本编辑器管理你的电子邮件和日历。 + +![Calendar close up snapshot][1] + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 用 Vim 做(几乎)所有事情,第一部分 + +我经常使用两个文本编辑器 —— [Vim][2] 和 [Emacs][3]。为什么两者都用呢?它们有不同的使用场景,在本系列的后续几篇文章中,我将讨论其中的一些用例。 + +![][4] + +好吧,为什么要在 Vim 中执行所有操作?因为如果有一个应用程序是我可以访问的每台计算机上都有,那就是 Vim。如果你像我一样,可能已经在 Vim 中打发了很多时光。那么,为什么不将其用于**所有事情**呢? + +但是,在此之前,你需要做一些事情。首先是确保你在 Vim 中具有 Ruby 支持。你可以使用 `vim --version | grep ruby`。 如果结果不是 `+ruby`,则需要解决。这可能很棘手,你应该查看发行版的文档以获取正确的软件包。在 MacOS 上,是官方的 MacVim(不是 Brew 发行的),在大多数 Linux 发行版中,是 vim-nox 或 vim-gtk,而不是 vim-gtk3。 + +我使用 [Pathogen][5] 自动加载插件和捆绑软件。如果你使用 [Vundle][6] 或其他 Vim 软件包管理器,则需要调整以下命令才能使用它。 + +#### 在 Vim 中管理你的邮件 + +使 Vim 在你的生产力计划中发挥更大作用的一个很好的起点是使用它通过 [abook] [8] 发送和接收电子邮件,和使用 [Notmuch] [7] 访问你的联系人列表。你需要为此安装一些东西。下面的所有示例代码都运行在 Ubuntu 上,因此如果你使用其他发行版,则需要对此进行调整。通过以下步骤进行设置: + +``` +sudo apt install notmuch-vim ruby-mail +curl -o ~/.vim/plugin/abook --create-dirs https://raw.githubusercontent.com/dcbaker/vim-abook/master/plugin/abook.vim +``` + +到目前为止,一切都很好。现在启动 Vim 并执行 `:NotMuch`。由于是用较旧版本的邮件库 `notmuch-vim` 编写的,可能会出现一些警告,但总的来说,Vim 现在将成为功能齐全的 Notmuch 邮件客户端。 + +![Reading Mail in Vim][9] + +如果要搜索特定标签,请输入 `\t`,输入标签名称,然后按回车。这将拉出一个带有该标签的所有消息的列表。`\s` 组合键会弹出 `Search:` 提示符,可以对 Notmuch 数据库进行全面搜索。使用箭头键浏览消息列表,按回车键显示所选项目,然后输入 `\q` 退出当前视图。 + +要撰写邮件,请使用 `\c` 按键。你将看到一条空白消息。这是 `abook.vim` 插件发挥作用的位置。按下 `Esc` 并输入 `:AbookQuery `,其中 `` 是你要查找的名称或电子邮件地址的一部分。你将在 abook 数据库中找到与你的搜索匹配的条目列表。通过键入你想要的地址的编号,将其添加到电子邮件的地址行中。完成电子邮件的键入和编辑,按 `Esc` 退出编辑模式,然后输入 `,s` 发送。 + +如果要在 `:NotMuch` 启动时更改默认文件夹视图,则可以将变量 `g:notmuch_folders` 添加到你的 `.vimrc` 文件中: + +``` +let g:notmuch_folders = [ + \ [ 'new', 'tag:inbox and tag:unread' ], + \ [ 'inbox', 'tag:inbox' ], + \ [ 'unread', 'tag:unread' ], + \ [ 'News', 'tag:@sanenews' ], + \ [ 'Later', 'tag:@sanelater' ], + \ [ 'Patreon', 'tag:@patreon' ], + \ [ 'LivestockConservancy', 'tag:livestock-conservancy' ], + \ ] +``` + +Notmuch 插件的文档中涵盖了更多设置,包括设置标签键和使用其它的邮件程序。 + +#### 在 Vim 中查询日历 + +![][10] + +遗憾的是,似乎没有使用 vCalendar 或 iCalendar 格式的 Vim 日历程序。有个 [Calendar.vim][11],做得很好。设置 Vim 通过以下方式访问你的日历: + +``` +cd ~/.vim/bundle +git clone [git@github.com][12]:itchyny/calendar.vim.git +``` + +现在,你可以通过输入 `:Calendar` 在 Vim 中查看日历。你可以使用 `<` 和 `>` 键在年、月、周、日和时钟视图之间切换。如果要从一个特定的视图开始,请使用 `-view=` 标志告诉它你希望看到哪个视图。你也可以在任何视图中添加日期。例如,如果我想查看 2020 年 7 月 4 日这一周的情况,请输入 `:Calendar -view week 7 4 2020`。它的帮助信息非常好,可以使用 `?` 键进行访问。 + +![][13] + +Calendar.vim 还支持 Google Calendar(我需要),但是在 2019 年 12 月,Google 禁用了它的访问权限。作者已在 [GitHub 上这个提案][14]中发布了一种变通方法。 + +这样你就在 Vim 中有了这些:你的邮件、地址和日历。 但是这些还没有完成; 下一篇你将在 Vim 上做更多的事情! + +Vim 为作家提供了很多好处,无论他们是否具有技术意识。 + +需要保持时间表正确吗?了解如何使用这些免费的开源软件来做到这一点。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/vim-email-calendar + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/calendar.jpg?itok=jEKbhvDT (Calendar close up snapshot) +[2]: https://www.vim.org/ +[3]: https://www.gnu.org/software/emacs/ +[4]: https://opensource.com/sites/default/files/uploads/day16-image1.png +[5]: https://github.com/tpope/vim-pathogen +[6]: https://github.com/VundleVim/Vundle.vim +[7]: https://opensource.com/article/20/1/organize-email-notmuch +[8]: https://opensource.com/article/20/1/sync-contacts-locally +[9]: https://opensource.com/sites/default/files/uploads/productivity_16-2.png (Reading Mail in Vim) +[10]: https://opensource.com/sites/default/files/uploads/day16-image3.png +[11]: https://github.com/itchyny/calendar.vim +[12]: mailto:git@github.com +[13]: https://opensource.com/sites/default/files/uploads/day16-image4.png +[14]: https://github.com/itchyny/calendar.vim/issues/156 From 15cd29ac36ff0762f837e743105c529ada961b3a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Feb 2020 18:59:03 +0800 Subject: [PATCH 085/315] PRF @wxy --- ...m to send email and check your calendar.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translated/tech/20200126 Use Vim to send email and check your calendar.md b/translated/tech/20200126 Use Vim to send email and check your calendar.md index d19de3dfef..ab81c8b4cb 100644 --- a/translated/tech/20200126 Use Vim to send email and check your calendar.md +++ b/translated/tech/20200126 Use Vim to send email and check your calendar.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Use Vim to send email and check your calendar) @@ -10,9 +10,9 @@ 使用 Vim 发送邮件和检查日历 ====== -> 在我们的在 2020 年用开源实现更高生产力的二十种方式的第十六篇中,直接通过文本编辑器管理你的电子邮件和日历。 +> 在 2020 年用开源实现更高生产力的二十种方式的第十六篇文章中,直接通过文本编辑器管理你的电子邮件和日历。 -![Calendar close up snapshot][1] +![](https://img.linux.net.cn/data/attachment/album/202002/19/185842eyz2znxx1yc2ctnc.jpg) 去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 @@ -22,22 +22,22 @@ ![][4] -好吧,为什么要在 Vim 中执行所有操作?因为如果有一个应用程序是我可以访问的每台计算机上都有,那就是 Vim。如果你像我一样,可能已经在 Vim 中打发了很多时光。那么,为什么不将其用于**所有事情**呢? +好吧,为什么要在 Vim 中执行所有操作?因为如果有一个应用程序是我可以访问的每台计算机上都有的,那就是 Vim。如果你像我一样,可能已经在 Vim 中打发了很多时光。那么,为什么不将其用于**所有事情**呢? -但是,在此之前,你需要做一些事情。首先是确保你在 Vim 中具有 Ruby 支持。你可以使用 `vim --version | grep ruby`。 如果结果不是 `+ruby`,则需要解决。这可能很棘手,你应该查看发行版的文档以获取正确的软件包。在 MacOS 上,是官方的 MacVim(不是 Brew 发行的),在大多数 Linux 发行版中,是 vim-nox 或 vim-gtk,而不是 vim-gtk3。 +但是,在此之前,你需要做一些事情。首先是确保你的 Vim 具有 Ruby 支持。你可以使用 `vim --version | grep ruby`。如果结果不是 `+ruby`,则需要解决这个问题。这可能有点麻烦,你应该查看发行版的文档以获取正确的软件包。在 MacOS 上,用的是官方的 MacVim(不是 Brew 发行的),在大多数 Linux 发行版中,用的是 vim-nox 或 vim-gtk,而不是 vim-gtk3。 我使用 [Pathogen][5] 自动加载插件和捆绑软件。如果你使用 [Vundle][6] 或其他 Vim 软件包管理器,则需要调整以下命令才能使用它。 #### 在 Vim 中管理你的邮件 -使 Vim 在你的生产力计划中发挥更大作用的一个很好的起点是使用它通过 [abook] [8] 发送和接收电子邮件,和使用 [Notmuch] [7] 访问你的联系人列表。你需要为此安装一些东西。下面的所有示例代码都运行在 Ubuntu 上,因此如果你使用其他发行版,则需要对此进行调整。通过以下步骤进行设置: +使 Vim 在你的生产力计划中发挥更大作用的一个很好的起点是使用它通过 [Notmuch] [7] 发送和接收电子邮件,和使用 [abook] [8] 访问你的联系人列表。你需要为此安装一些东西。下面的所有示例代码都运行在 Ubuntu 上,因此如果你使用其他发行版,则需要对此进行调整。通过以下步骤进行设置: ``` sudo apt install notmuch-vim ruby-mail curl -o ~/.vim/plugin/abook --create-dirs https://raw.githubusercontent.com/dcbaker/vim-abook/master/plugin/abook.vim ``` -到目前为止,一切都很好。现在启动 Vim 并执行 `:NotMuch`。由于是用较旧版本的邮件库 `notmuch-vim` 编写的,可能会出现一些警告,但总的来说,Vim 现在将成为功能齐全的 Notmuch 邮件客户端。 +到目前为止,一切都很顺利。现在启动 Vim 并执行 `:NotMuch`。由于是用较旧版本的邮件库 `notmuch-vim` 编写的,可能会出现一些警告,但总的来说,Vim 现在将成为功能齐全的 Notmuch 邮件客户端。 ![Reading Mail in Vim][9] @@ -69,16 +69,16 @@ Notmuch 插件的文档中涵盖了更多设置,包括设置标签键和使用 ``` cd ~/.vim/bundle -git clone [git@github.com][12]:itchyny/calendar.vim.git +git clone git@github.com:itchyny/calendar.vim.git ``` -现在,你可以通过输入 `:Calendar` 在 Vim 中查看日历。你可以使用 `<` 和 `>` 键在年、月、周、日和时钟视图之间切换。如果要从一个特定的视图开始,请使用 `-view=` 标志告诉它你希望看到哪个视图。你也可以在任何视图中添加日期。例如,如果我想查看 2020 年 7 月 4 日这一周的情况,请输入 `:Calendar -view week 7 4 2020`。它的帮助信息非常好,可以使用 `?` 键进行访问。 +现在,你可以通过输入 `:Calendar` 在 Vim 中查看日历。你可以使用 `<` 和 `>` 键在年、月、周、日和时钟视图之间切换。如果要从一个特定的视图开始,请使用 `-view=` 标志告诉它你希望看到哪个视图。你也可以在任何视图中定位日期。例如,如果我想查看 2020 年 7 月 4 日这一周的情况,请输入 `:Calendar -view week 7 4 2020`。它的帮助信息非常好,可以使用 `?` 键参看。 ![][13] -Calendar.vim 还支持 Google Calendar(我需要),但是在 2019 年 12 月,Google 禁用了它的访问权限。作者已在 [GitHub 上这个提案][14]中发布了一种变通方法。 +Calendar.vim 还支持 Google Calendar(我需要),但是在 2019 年 12 月,Google 禁用了它的访问权限。作者已在 [GitHub 上的这个提案][14]中发布了一种变通方法。 -这样你就在 Vim 中有了这些:你的邮件、地址和日历。 但是这些还没有完成; 下一篇你将在 Vim 上做更多的事情! +这样你就在 Vim 中有了这些:你的邮件、地址簿和日历。但是这些还没有完成; 下一篇你将在 Vim 上做更多的事情! Vim 为作家提供了很多好处,无论他们是否具有技术意识。 @@ -91,7 +91,7 @@ via: https://opensource.com/article/20/1/vim-email-calendar 作者:[Kevin Sonney][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6f33213b8cd5df8d3624dc2dd8d7c70ac37cbee7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 19 Feb 2020 19:02:11 +0800 Subject: [PATCH 086/315] PUB @wxy https://linux.cn/article-11908-1.html --- .../20200126 Use Vim to send email and check your calendar.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200126 Use Vim to send email and check your calendar.md (98%) diff --git a/translated/tech/20200126 Use Vim to send email and check your calendar.md b/published/20200126 Use Vim to send email and check your calendar.md similarity index 98% rename from translated/tech/20200126 Use Vim to send email and check your calendar.md rename to published/20200126 Use Vim to send email and check your calendar.md index ab81c8b4cb..032329e76e 100644 --- a/translated/tech/20200126 Use Vim to send email and check your calendar.md +++ b/published/20200126 Use Vim to send email and check your calendar.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11908-1.html) [#]: subject: (Use Vim to send email and check your calendar) [#]: via: (https://opensource.com/article/20/1/vim-email-calendar) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From 59e4f03fd8a5675f70c08bfa85831df019333459 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 20 Feb 2020 00:55:06 +0800 Subject: [PATCH 087/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200219=20Fedora?= =?UTF-8?q?=20at=20the=20Czech=20National=20Library=20of=20Technology?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200219 Fedora at the Czech National Library of Technology.md --- ...he Czech National Library of Technology.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sources/tech/20200219 Fedora at the Czech National Library of Technology.md diff --git a/sources/tech/20200219 Fedora at the Czech National Library of Technology.md b/sources/tech/20200219 Fedora at the Czech National Library of Technology.md new file mode 100644 index 0000000000..d1354b99ff --- /dev/null +++ b/sources/tech/20200219 Fedora at the Czech National Library of Technology.md @@ -0,0 +1,54 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fedora at the Czech National Library of Technology) +[#]: via: (https://fedoramagazine.org/fedora-at-the-national-library-of-technology/) +[#]: author: (Ben Cotton https://fedoramagazine.org/author/bcotton/) + +Fedora at the Czech National Library of Technology +====== + +![][1] + +Where do you turn when you have a fleet of public workstations to manage? If you’re the Czech [National Library of Technology][2] (NTK), you turn to Fedora. Located in Prague, the NTK is the Czech Republic’s largest science and technology library. As part of its public service mission, the NTK provides 150 workstations for public use. + +In 2018, the NTK moved these workstations from Microsoft Windows to Fedora. In the [press release][3] announcing this change, Director Martin Svoboda said switching to Fedora will “reduce operating system support costs by about two-thirds.” The choice to use Fedora was easy, according to NTK Linux Engineer Miroslav Brabenec. “Our entire Linux infrastructure runs on RHEL or CentOS. So for desktop systems, Fedora was the obvious choice,” he told Fedora Magazine. + +### User reception + +Changing an operating system is always a little bit risky—it requires user training and outreach. Brabenec said that non-IT staff asked for training on the new system. Once they learned that the same (or compatible) software was available, they were fine. + +The Library’s customers were on board right away. The Windows environment was based on thin client terminals, which were slow for intensive tasks like video playback and handling large office suite files. The only end-user education that the NTK needed to create was a [basic usage guide][4] and a desktop wallpaper that pointed to important UI elements. + +![User guidance desktop wallpaper from the National Technology Library.][5] + +Although Fedora provides development tools used by the Faculty of Information Technology at the Czech Technical University—and many of the NTK’s workstation users are CTU students—most of the application usage is what you might expect of a general-purpose workstation. Firefox dominates the application usage, followed by the Evince PDF viewer,  and the LibreOffice suite. + +### Updates + +NTK first deployed the workstations with Fedora 28. They decided to skip Fedora 29 and upgraded to Fedora 30 in early June 2019. The process was simple, according to Brabenec. “We prepared configuration, put it into Ansible. Via AWX I restarted all systems to netboot, image with kickstart, after first boot called provisioning callback on AWX, everything automatically set up via Ansible.” + +Initially, they had difficulties applying updates. Now they have a process for installing security updates daily. Each system is rebooted approximately every two weeks to make sure all of the updates get applied. + +Although he isn’t aware of any concrete plans for the future, Brabenec expects the NTK to continue using Fedora for public workstations. “Everyone is happy with it and I think that no one has a good reason to change it.” + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedora-at-the-national-library-of-technology/ + +作者:[Ben Cotton][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/bcotton/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/czech-techlib-816x345.png +[2]: https://www.techlib.cz/en/ +[3]: https://www.techlib.cz/default/files/download/id/86431/tiskova-zprava-z-31-7-2018.pdf +[4]: https://www.techlib.cz/en/82993-public-computers +[5]: https://fedoramagazine.org/wp-content/uploads/2020/02/ntk-wallpaper-1024x576.jpeg From 08061a2b6e5cb6c19c240c01f1b8defbca9fb4b0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 20 Feb 2020 01:00:05 +0800 Subject: [PATCH 088/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200219=20Don't?= =?UTF-8?q?=20like=20IDEs=3F=20Try=20grepgitvi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200219 Don-t like IDEs- Try grepgitvi.md --- ...20200219 Don-t like IDEs- Try grepgitvi.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20200219 Don-t like IDEs- Try grepgitvi.md diff --git a/sources/tech/20200219 Don-t like IDEs- Try grepgitvi.md b/sources/tech/20200219 Don-t like IDEs- Try grepgitvi.md new file mode 100644 index 0000000000..34caf67f71 --- /dev/null +++ b/sources/tech/20200219 Don-t like IDEs- Try grepgitvi.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Don't like IDEs? Try grepgitvi) +[#]: via: (https://opensource.com/article/20/2/no-ide-script) +[#]: author: (Yedidyah Bar David https://opensource.com/users/didib) + +Don't like IDEs? Try grepgitvi +====== +A simple and primitive script to open Vim with your file of choice. +![Files in a folder][1] + +Like most developers, I search and read source code all day long. Personally, I've never gotten used to integrated development environments (IDEs), and for years, I mainly used **grep** and copy/pasted file names to open Vi(m). + +Eventually, I came up with this script, slowly refining it as needed. + +Its dependencies are [Vim][2] and [rlwrap][3], and it is open source under the Apache 2.0 license. To use the script, [put it in your PATH][4], and run it inside a directory of text files with: + + +``` +`grepgitvi ` +``` + +It will return a numbered list of search results, prompt you for the number of the result you want to use, and open Vim with that result. After you exit Vim, it will show the list again in a loop until you enter anything other than a result number. You can also use the Up and Down arrow keys to select a file; this makes it easier (for me) to find which results I've already looked at. + +It's simple and primitive compared to modern IDEs, or even to more sophisticated uses of Vim, but that's what does the job for me. + +### The script + + +``` +#!/bin/bash + +# grepgitvi - grep source files, interactively open vim on results +# Doesn't really have to do much with git, other than ignoring .git +# +# Copyright Yedidyah Bar David 2019 +# +# SPDX-License-Identifier: Apache-2.0 +# +# Requires vim and rlwrap +# +# Usage: grepgitvi <grep options> <grep/vim pattern> +# + +TMPD=$(mktemp -d /tmp/grepgitvi.XXXXXX) +UNCOLORED=${TMPD}/uncolored +COLORED=${TMPD}/colored + +RLHIST=${TMPD}/readline-history + +[ -z "${DIRS}" ] && DIRS=. + +cleanup() { +        rm -rf "${TMPD}" +} + +trap cleanup 0 + +find ${DIRS} -iname .git -prune -o \\! -iname "*.min.css*" -type f -print0 > ${TMPD}/allfiles + +cat ${TMPD}/allfiles | xargs -0 grep --color=always -n -H "$@" > $COLORED +cat ${TMPD}/allfiles | xargs -0 grep -n -H "$@" > $UNCOLORED + +max=`cat $UNCOLORED | wc -l` +pat="${@: -1}" + +inp='' +while true; do +        echo "============================ grep results ===============================" +        cat $COLORED | nl +        echo "============================ grep results ===============================" +        prompt="Enter a number between 1 and $max or anything else to quit: " +        inp=$(rlwrap -H $RLHIST bash -c "read -p \"$prompt\" inp; echo \$inp") +        if ! echo "$inp" | grep -q '^[0-9][0-9]*$' || [ "$inp" -gt "$max" ]; then +                break +        fi + +        filename=$(cat $UNCOLORED | awk -F: "NR==$inp"' {print $1}') +        linenum=$(cat $UNCOLORED | awk -F: "NR==$inp"' {print $2-1}') +        vim +:"$linenum" +"norm zz" +/"${pat}" "$filename" +done +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/no-ide-script + +作者:[Yedidyah Bar David][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/didib +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_paper_folder.png?itok=eIJWac15 (Files in a folder) +[2]: https://www.vim.org/ +[3]: https://linux.die.net/man/1/rlwrap +[4]: https://opensource.com/article/17/6/set-path-linux From 218746e29d2f53897129bb0d1ca2cd35fb0e008a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 20 Feb 2020 01:01:00 +0800 Subject: [PATCH 089/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200219=20Try=20?= =?UTF-8?q?this=20Bash=20script=20for=C2=A0large=20filesystems?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200219 Try this Bash script for-large filesystems.md --- ... this Bash script for-large filesystems.md | 335 ++++++++++++++++++ 1 file changed, 335 insertions(+) create mode 100644 sources/tech/20200219 Try this Bash script for-large filesystems.md diff --git a/sources/tech/20200219 Try this Bash script for-large filesystems.md b/sources/tech/20200219 Try this Bash script for-large filesystems.md new file mode 100644 index 0000000000..f0f0a88f2f --- /dev/null +++ b/sources/tech/20200219 Try this Bash script for-large filesystems.md @@ -0,0 +1,335 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Try this Bash script for large filesystems) +[#]: via: (https://opensource.com/article/20/2/script-large-files) +[#]: author: (Nick Clifton https://opensource.com/users/nickclifton) + +Try this Bash script for large filesystems +====== +A simple script to list files, directories, executables, and links. +![bash logo on green background][1] + +Have you ever wanted to list all the files in a directory, but just the files, nothing else? How about just the directories? If you have, then the following script, which is open source under GPLv3, could be what you have been looking for. + +Of course, you could use the **find** command: + + +``` +`find . -maxdepth 1 -type f -print` +``` + +But this is cumbersome to type, produces unfriendly output, and lacks some of the refinement of the **ls** command. You could also combine **ls** and **grep** to achieve the same result: + + +``` +`ls -F . | grep -v /` +``` + +But again, this is clunky. This script provides a simple alternative. + +### Usage + +The script provides four main functions, which depend upon which name you call: **lsf** lists files, **lsd** lists directories, **lsx** lists executables, and **lsl** lists links. + +There is no need to install multiple copies of the script, as symbolic links work. This saves space and makes updating the script easier. + +The script works by using the **find** command to do the searching, and then it runs **ls** on each item it finds. The nice thing about this is that any arguments given to the script are passed to the **ls** command. So, for example, this lists all files, even those that start with a dot: + + +``` +`lsf -a` +``` + +To list directories in long format, use the **lsd** command: + + +``` +`lsd -l` +``` + +You can provide multiple arguments, and also file and directory paths. + +This provides a long classified listing of all of files in the current directory's parent directory, and in the **/usr/bin** directory: + + +``` +`lsf -F -l .. /usr/bin` +``` + +One thing that the script does not currently handle, however, is recursion. This command lists only the files in the current directory. + + +``` +`lsf -R` +``` + +The script does not descend into any subdirectories. This is something that may be fixed one day. + +### Internals + +The script is written in a top-down fashion with the initial functions at the start of the script and the body of the work performed near the end. There are only two functions that really matter in the script. The **parse_args()** function peruses the command line, separates options from pathnames, and scripts specific options from the **ls** command-line options. + +The **list_things_in_dir()** function  takes a directory name as an argument and runs the **find** command on it. Each item found is passed to the **ls** command for display. + +### Conclusion + +This is a simple script to accomplish a simple function. It is a time saver and can be surprisingly useful when working with large filesystems. + +### The script + + +``` +#!/bin/bash + +# Script to list: +#      directories (if called "lsd") +#      files       (if called "lsf") +#      links       (if called "lsl") +#  or  executables (if called "lsx") +# but not any other type of filesystem object. +# FIXME: add lsp   (list pipes) +# +# Usage: +#   <command_name> [switches valid for ls command] [dirname...] +# +# Works with names that includes spaces and that start with a hyphen. +# +# Created by Nick Clifton. +# Version 1.4 +# Copyright (c) 2006, 2007 Red Hat. +# +# This is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published +# by the Free Software Foundation; either version 3, or (at your +# option) any later version. + +# It is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the +# GNU General Public License for more details. + +# ToDo: +#  Handle recursion, eg:  lsl -R +#  Handle switches that take arguments, eg --block-size +#  Handle --almost-all, --ignore-backups, --format and --ignore + +main () +{ +  init +  +  parse_args ${1+"$@"} + +  list_objects + +  exit 0 +} + +report () +{ +  echo $prog": " ${1+"$@"} +} + +fail () +{ +  report " Internal error: " ${1+"$@"} +  exit 1 +} + +# Initialise global variables. +init () +{ +  # Default to listing things in the current directory. +  dirs[0]="."; +  +  # num_dirs is the number of directories to be listed minus one. +  # This is because we are indexing the dirs[] array from zero. +  num_dirs=0; +  +  # Default to ignoring things that start with a period. +  no_dots=1 +  +  # Note - the global variables 'type' and 'opts' are initialised in +  # parse_args function. +} + +# Parse our command line +parse_args () +{ +  local no_more_args + +  no_more_args=0 ; + +  prog=`basename $0` ; + +  # Decide if we are listing files or directories. +  case $prog in +    lsf | lsf.sh) +      type=f +      opts=""; +      ;; +    lsd | lsd.sh) +      type=d +      # The -d switch to "ls" is presumed when listing directories. +      opts="-d"; +      ;; +    lsl | lsl.sh) +      type=l +      # Use -d to prevent the listed links from being followed. +      opts="-d"; +      ;; +    lsx | lsx.sh) +      type=f +      find_extras="-perm /111" +      ;;     +    *) +      fail "Unrecognised program name: '$prog', expected either 'lsd', 'lsf', 'lsl' or 'lsx'" +      ;; +  esac + +  # Locate any additional command line switches for ls and accumulate them. +  # Likewise accumulate non-switches to the directories list. +  while [ $# -gt 0 ] +  do +    case "$1" in +      # FIXME: Handle switches that take arguments, eg --block-size +      # FIXME: Properly handle --almost-all, --ignore-backups, --format +      # FIXME:   and --ignore +      # FIXME: Properly handle --recursive +      -a | -A | --all | --almost-all) +        no_dots=0; +        ;; +      --version) +        report "version 1.2" +        exit 0 +        ;; +      --help) +        case $type in +          d) report "a version of 'ls' that lists only directories" ;; +          l) report "a version of 'ls' that lists only links" ;; +          f) if [ "x$find_extras" = "x" ] ; then +               report "a version of 'ls' that lists only files" ; +             else +              report "a version of 'ls' that lists only executables"; +             fi ;; +        esac +        exit 0 +        ;; +      --) +        # A switch to say that all further items on the command line are +        # arguments and not switches. +        no_more_args=1 ; +        ;; +      -*) +        if [ "x$no_more_args" = "x1" ] ; +        then +          dirs[$num_dirs]="$1"; +          let "num_dirs++" +        else +          # Check for a switch that just uses a single dash, not a double +          # dash.  This could actually be multiple switches combined into +          # one word, eg "lsd -alF".  In this case, scan for the -a switch. +          # XXX: FIXME: The use of =~ requires bash v3.0+. +          if [[ "x${1:1:1}" != "x-" && "x$1" =~ "x-.*a.*" ]] ; +          then +            no_dots=0; +          fi +          opts="$opts $1"; +        fi +        ;; +      *) +        dirs[$num_dirs]="$1"; +        let "num_dirs++" +        ;; +    esac +    shift +  done + +  # Remember that we are counting from zero not one. +  if [ $num_dirs -gt 0 ] ; +  then +    let "num_dirs--" +  fi +} + +list_things_in_dir () +{ +  local dir + +  # Paranoia checks - the user should never encounter these. +  if test "x$1" = "x" ; +  then +    fail "list_things_in_dir called without an argument" +  fi + +  if test "x$2" != "x" ; +  then +    fail "list_things_in_dir called with too many arguments" +  fi + +  # Use quotes when accessing $dir in order to preserve +  # any spaces that might be in the directory name. +  dir="${dirs[$1]}"; + +  # Catch directory names that start with a dash - they +  # confuse pushd. +  if test "x${dir:0:1}" = "x-" ; +  then +    dir="./$dir" +  fi +  +  if [ -d "$dir" ] +  then +    if [ $num_dirs -gt 0 ] +    then +      echo "  $dir:" +    fi + +    # Use pushd rather passing the directory name to find so that the +    # names that find passes on to xargs do not have any paths prepended. +    pushd "$dir" > /dev/null +    if [ $no_dots -ne 0 ] ; then +      find . -maxdepth 1 -type $type $find_extras -not -name ".*" -printf "%f\000" \ +        | xargs --null --no-run-if-empty ls $opts -- ; +    else +      find . -maxdepth 1 -type $type $find_extras -printf "%f\000" \ +        | xargs --null --no-run-if-empty ls $opts -- ; +    fi +    popd > /dev/null +  else +    report "directory '$dir' could not be found" +  fi +} + +list_objects () +{ +  local i + +  i=0; +  while [ $i -le $num_dirs ] +  do +    list_things_in_dir i +    let "i++" +  done +} + +# Invoke main +main ${1+"$@"} +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/script-large-files + +作者:[Nick Clifton][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/nickclifton +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background) From b9d1c924e35fe6ad1158fd052afbf448eb3d3de5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 20 Feb 2020 01:03:24 +0800 Subject: [PATCH 090/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200219=20How=20?= =?UTF-8?q?to=20conveniently=20unsubscribe=20from=20a=20mailing=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200219 How to conveniently unsubscribe from a mailing list.md --- ...niently unsubscribe from a mailing list.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20200219 How to conveniently unsubscribe from a mailing list.md diff --git a/sources/tech/20200219 How to conveniently unsubscribe from a mailing list.md b/sources/tech/20200219 How to conveniently unsubscribe from a mailing list.md new file mode 100644 index 0000000000..ab0a962efa --- /dev/null +++ b/sources/tech/20200219 How to conveniently unsubscribe from a mailing list.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to conveniently unsubscribe from a mailing list) +[#]: via: (https://opensource.com/article/20/2/how-unsubscribe-mailing-list) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +How to conveniently unsubscribe from a mailing list +====== +Cut down on your email clutter by removing yourself from email lists you +no longer need. +![Photo by Anthony Intraversato on Unsplash][1] + +If you're on an email discussion group long enough, at some point, you'll see an email from a list member asking to be unsubscribed. Typically, at least 10 other people on the list will respond with instructions on how to unsubscribe, and those 10 responses will be answered by 10 more people confirming or commenting on the instructions. That's a _lot_ of traffic to a mailing list just so one person can unsubscribe. + +But unsubscribing from a list can be confusing, especially if you've gotten on the list by accident. It's frustrating to discover that you've been added to a list, and it's annoying that you have to take time out of your day to extricate yourself. This article is here to help make unsubscribing fast, easy, and graceful. + +Never send an unsubscribe email to the same email address you use to post messages + +### Unsubscribe by email + +Mailing lists are controlled by mailing list software (like [GNU Mailman][2]) on a server. You probably aren't aware of the software controlling a mailing list you're on, because they're usually designed to stay out of the way and just deliver mail. But as a member of a mailing list, you actually have some user control over the software. + +Some mailing lists allow you to unsubscribe using an automated email address. It can be a little confusing because the email address you use to unsubscribe is NOT the email address you use to send messages to the list. Essentially, you're sending a special command to the email server, telling it to take you off the list. This is a convenient method of unsubscribing because it means you don't have to compose a message or wait for anyone to take action. You speak directly to the computer sending the email, and it does exactly as it's told. + +To unsubscribe from a list, take the email address of the list, add **-leave** just before the **@** symbol, and send a message. You can email a blank message; the computer doesn't care. The fact that you're emailing the list with the **-leave** command in front of the **@** symbol is all it needs. + +Here's an example. + +Say you've joined the mailing list Funny Squirrels. You send a few messages to [funnysquirrels@example.com][3] but soon find that squirrels are not as amusing as you'd hoped. To unsubscribe, you can send an email to: + + +``` +`funnysquirrels-leave@example.com` +``` + +You may get a final confirmation email back, and then you'll hear from the mailing list no more. + +#### Custom email commands + +Sometimes the administrator of a mail server changes the command for unsubscribing. Ideally, they'll include the unsubscribe email address in the footer of emails sent to the mailing list, so check for that before sending your parting email. + +The thing to keep in mind is that an unsubscribe email _never_ goes to the actual list, meaning you should never send an unsubscribe email to the same email address you use to post messages. There's a special, separate email address reserved for the unsubscribe command. + +### Unsubscribing by webform + +Some mailing lists have a webform for unsubscribing, and ideally, it can be found in the footer of each mailing list message. You can navigate to the webform and opt out of your subscription. + +This method is common for commercial mailing lists, and it's sometimes a way for them to capture any feedback you have about the list, why you're leaving, and so on. Like the automated email method, the intent is for you to maintain full control of your own subscription. You never have to wait for a human to take you off of a list; instead, you can issue commands directly to a computer. + +![Example unsubscribe web form][4] + +A webform may send you a final confirmation email, and after that, you should hear nothing from that mailing list ever again. + +### Unsubscribing like a pro + +Leaving a mailing list is a guilt-free and nonaggressive act. When you want to leave a mailing list, you should be able to find an unsubscribe email address or webform to make it automated and final. + +If, in spite of using the methods above, you can't leave a mailing list, don't email the list. Very few people on the mailing list have control over who is subscribed, and sometimes the people who have access to the list of subscribers are not monitoring the list—they're only maintaining the server. Instead, find out what server hosts the mailing list, and contact the hosting provider to alert them of the abuse. + +You can find the host of a mailing list by searching for the server name (the part of the email address to the _right_ of the **@** symbol) on a **whois** service. If you're running Linux, you can do this from a terminal: + + +``` +`$ whois ` +``` + +Otherwise, use the [Whois.net][5] website. + +Whois provides the internet hosting provider of any email server plus the abuse and support contact information. + +Remember: you are always free to leave a mailing list for any reason, without getting permission from anyone else. And now that you know how, you'll be able to unsubscribe like a pro! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/how-unsubscribe-mailing-list + +作者:[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/anthony-intraversato-pt_wqgzaiu8-unsplash.jpg?itok=5bbMlgt8 (Photo by Anthony Intraversato on Unsplash) +[2]: https://www.list.org/ +[3]: mailto:funnysquirrels@example.com +[4]: https://opensource.com/sites/default/files/uploads/mail-webform.jpg (Example unsubscribe web form) +[5]: http://whois.net From 45ca629fac051fdbae9ad991bb0bb66a26dd305a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 20 Feb 2020 01:04:56 +0800 Subject: [PATCH 091/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200219=20How=20?= =?UTF-8?q?to=20find=20what=20you=E2=80=99re=20looking=20for=20on=20Linux?= =?UTF-8?q?=20with=20find?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200219 How to find what you-re looking for on Linux with find.md --- ...t you-re looking for on Linux with find.md | 240 ++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 sources/tech/20200219 How to find what you-re looking for on Linux with find.md diff --git a/sources/tech/20200219 How to find what you-re looking for on Linux with find.md b/sources/tech/20200219 How to find what you-re looking for on Linux with find.md new file mode 100644 index 0000000000..3b0aa3ed68 --- /dev/null +++ b/sources/tech/20200219 How to find what you-re looking for on Linux with find.md @@ -0,0 +1,240 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to find what you’re looking for on Linux with find) +[#]: via: (https://www.networkworld.com/article/3527420/how-to-find-what-you-re-looking-for-on-linux-with-find.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +How to find what you’re looking for on Linux with find +====== +The find command has a huge array of options to help you locate exactly the files you're looking for on a Linux system. This post explores a series of extremely useful commands. +CSA Images / Getty Images + +There are a number of commands for finding files on Linux systems, but there are also a huge number of options that you can deploy when looking for them. + +For example, you can find files not just by their names, but by their owners and/or groups, their age, their size, the assigned permissions, the last time they were accessed, the associated inodes and even whether the files belong to an account or group that no longer exists on the system and so on. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] + +You can also specify where a search should start, how deeply into the file system the search should reach and how much the search result will tell you about the files it finds. + +And all these criteria can be handled by the **find** command. + +Examples of finding files by these criteria are provided below. In some commands, errors (such as trying to list files that you don’t have read access to), error output will be sent to **/dev/null** so that we don’t have to look at it. In others, we’ll simply run as root to avoid this problem. + +Keep in mind that additional options exist. This post covers a lot of ground, but not all of the ways that the **find** command can help locate files for you. + +### Picking a starting point + +With **find**, you can either select a point or start where you are. To select a starting spot, enter it following the word “find”. For example, “find /usr” or “find ./bin” would search starting the **/usr** directory or the **bin** directory in the current location while “find ~” would start in your home directory even if you’re currently located in some other location in the file system. + +[][2] + +### Picking what you want to see + +One of the most commonly used search strategies is to search for files by name. This requires using the **-name** option. + +By default, **find** will show you the full path to the files it finds. This is the same thing you would see if you add **-print** to your command. If you want to see the details associated with a file – its length, permissions, etc., you would need to add **-ls** to the end of your **find** command. + +``` +$ find ~/bin -name tryme +/home/shs/bin/tryme +$ find ~/bin -name tryme -print +/home/shs/bin/tryme +$ find ~/bin -name tryme -ls + 917528 4 -rwx------ 1 shs shs 139 Apr 8 2019 /home/shs/bin/tryme +``` + +You can also find files using substrings. For example, if you replace "tryme" in the example above with "try*", you'll find all the files with names that begin with "try". + +Finding files by name is probably the most typical use of the **find** command, but there are so many other ways to look for files and good reasons to want to. The sections below show how to use many of the other criteria available. + +In addition, when searching for files by size, group, inode etc., you probably will want some confirmation that the files found match what you were looking for. Using the **-ls** option to display the details is often very helpful. + +### Finding files by size + +Finding files by size requires use of the **-size** option and a little finesse with the specifications. If you specify **-size 189b**, for you example, you’re going to find files that are 189 blocks long, not 189 bytes. For bytes, you would need to use **-size 189c** (characters). And, if you specify **-size 200w**, you’re going to find files that are 200 words – words as in "two-byte increments", not words as in "those things we all say to each other". You can also look for file by providing sizes in kilobytes (k), megabytes (M) and gigabytes (G). + +Most of the time, Linux users will be searching for files that are larger than some selected size. For example, to find files that are larger than a gigabyte, you might use a command like this where the +1G means "larger than a gigabyte": + +``` +$ find -size +1G -ls 2>/dev/null + 787715 1053976 -rw-rw-r-- 1 shs shs 1079263432 Dec 21 2018 ./backup.zip + 801834 1052556 -rw-rw-r-- 1 shs shs 1077809525 Dec 21 2018 ./2019/hold.zip +``` + +### Finding files by inode # + +You can find files by the inode that is used to maintain the file’s metadata (i.e., everything but the file content and file name). + +``` +$ find -inum 919674 -ls 2>/dev/null + 919674 4 -rw-rw-r-- 1 shs shs 512 Dec 27 15:25 ./bin/my.log +``` + +### Finding files with a specific file owner or group + +Finding files by owner or group is also very straightforward. Here we use sudo to overcome permission issues. + +``` +$ sudo find /home -user nemo -name "*.png"-ls + 1705219 4 drwxr-xr-x 2 nemo nemo 4096 Jan 28 08:50 /home/nemo/Pictures/me.png +``` + +In this command, we look for a file that is owned by a multi-user group called “admins”. + +``` +# find /tmp -group admins -ls + 262199 4 -rwxr-x--- 1 dory admins 27 Feb 16 18:57 /tmp/testscript +``` + +### Finding files with no owners or groups + +You can look for files that don't belong to any users currently set up on the system by using the **-nouser** option as shown in the command below. + +``` +# find /tmp -nouser -ls +262204 4 -rwx------ 1 1016 1016 17 Feb 17 16:42 /tmp/hello +``` + +Notice that the listing shows the old user's UID and GID – a clear indication that this user is not defined on the system. This kind of command will find files that were likely created in other-than-home directories by users whose accounts have since been removed from the system or in home directories that were not removed after the user account was removed. Similarly, the **-nogroup** option would find such files – especially when these users were the only members of the associated groups. + +### Finding files by last update time + +In this command, we look for files that have been updated in the last 24 hours in a particular user's home directory. The **sudo** is being used to allow searching another user’s home directory. + +``` +$ sudo find /home/nemo -mtime -1 +/home/nemo +/home/nemo/snap/cheat +/home/nemo/tryme +``` + +### Finding files by when permissions were last changed + +The **-ctime** option can help you find files that have had their status (e.g., permissions) changed within some referenced time frame. Here’s an example of looking for files that had permission changes within the last day: + +``` +$ find . -ctime -1 -ls + 787987 4 -rwxr-xr-x 1 shs shs 189 Feb 11 07:31 ./tryme +``` + +Keep in mind that the date and time displayed reflect the last updates to the file contents. You will have to use a command like **stat** to see all three times associated with a file (file creation, modification and status changes) . + +### Finding files based on last access times + +In this command, we look for local pdf files that were accessed within the last two days using the **-atime** option. + +``` +$ find -name "*.pdf" -atime -2 +./Wingding_Invites.pdf +``` + +### Finding files based on their age relative to another file + +You can use the -newer option to find files that are newer than some other file. + +``` +$ find . -newer dig1 -ls + 786434 68 drwxr-xr-x 67 shs shs 69632 Feb 16 19:05 . + 1064442 4 drwxr-xr-x 5 shs shs 4096 Feb 16 11:06 ./snap/cheat + 791846 4 -rw-rw-r-- 1 shs shs 649 Feb 13 14:26 ./dig +``` + +There is no corresponding **-older** option, but you can get a similar result with **! -newer** (i.e., not newer), which means almost the same thing. + +### Finding files by type + +Finding a file by file type, you get a lot of choices – regular files, directories, block and character files, etc. Here’s a list of the file type options: + +``` +b block (buffered) special +c character (unbuffered) special +d directory +p named pipe (FIFO) +f regular file +l symbolic link +s socket +``` + +Here’s an example looking for symbolic links: + +``` +$ find . -type l -ls + 805717 0 lrwxrwxrwx 1 shs shs 11 Apr 10 2019 ./volcano -> volcano.pdf + 918552 0 lrwxrwxrwx 1 shs shs 1 Jun 16 2018 ./letter -> pers/letter2mom +``` + +### Limiting how deeply find should look + +The **-mindepth** and **-maxdepth** options control how deeply into the file system (from the current location or starting point) your searches will look. + +``` +$ find -maxdepth 3 -name "*loop" +./bin/save/oldloop +./bin/long-loop +./private/loop +``` + +### Finding files only if empty + +In this command, we look for empty files, but no further than directories and their subdirectories. + +``` +$ find . -maxdepth 2 -empty -type f -ls + 917517 0 -rw-rw-r-- 1 shs shs 0 Sep 23 11:00 ./complaints/newfile + 792050 0 -rw-rw-r-- 1 shs shs 0 Oct 4 19:02 ./junk +``` + +### Finding files by permissions + +You can find files that have specific permissions set using the **-perm** option. In the example below, we are looking only for regular files (**-type f**) to avoid seeing symbolic links that are given these permissions by default even if the file they refer to is restricted. + +``` +$ find -perm 777 -type f -ls +find: ‘./.dbus’: Permission denied + 798748 4 -rwxrwxrwx 1 shs shs 15 Mar 28 2019 ./runme +``` + +### Using find to help you get rid of files + +You can use the find command to both locate and then remove files if you use a command like this one: + +``` +$ find . -name runme -exec rm {} \; +``` + +The {} represents the name of each of the files located by the search criteria. + +One very useful option is to replace **-exec** with **-ok**. When you do this, **find** will ask for a confirmation before it removes any file. + +``` +$ find . -name runme -ok rm -rf {} \; +< rm ... ./bin/runme > ? +``` + +Removing a file isn't the only thing that **-ok** and **-rm** can do for you. For example, you could copy, rename or move files. + +There are really a lot of options for using the find command effectively and undoubtedly some that haven’t been covered in this post. I hope you’ve found some that are new and especially promising. + +Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3527420/how-to-find-what-you-re-looking-for-on-linux-with-find.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/newsletters/signup.html +[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From 6a1108c5129c33e8f80014cfc222317f8ef3f291 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 20 Feb 2020 01:05:57 +0800 Subject: [PATCH 092/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200219=20A=20$3?= =?UTF-8?q?99=20device=20that=20translates=20brain=20signals=20into=20digi?= =?UTF-8?q?tal=20commands?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200219 A -399 device that translates brain signals into digital commands.md --- ...tes brain signals into digital commands.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/talk/20200219 A -399 device that translates brain signals into digital commands.md diff --git a/sources/talk/20200219 A -399 device that translates brain signals into digital commands.md b/sources/talk/20200219 A -399 device that translates brain signals into digital commands.md new file mode 100644 index 0000000000..e9c13ff8d2 --- /dev/null +++ b/sources/talk/20200219 A -399 device that translates brain signals into digital commands.md @@ -0,0 +1,62 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A $399 device that translates brain signals into digital commands) +[#]: via: (https://www.networkworld.com/article/3526446/nextmind-wearable-device-translates-brain-signals-into-digital-commands.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +A $399 device that translates brain signals into digital commands +====== +Startup NextMind is readying a $399 development kit for its brain-computer interface technology that enables users to interact, hands-free, with computers and VR/AR headsets. +MetamorWorks / Getty Images + +Scientists have long envisioned brain-sensing technology that can translate thoughts into digital commands, eliminating the need for computer-input devices like a keyboard and mouse. One company is preparing to ship its latest contribution to the effort: a $399 development package for a noninvasive, AI-based, brain-computer interface. + +The kit will let "users control anything in their digital world by using just their thoughts," [NextMind][1], a commercial spinoff of a cognitive neuroscience lab claims in a [press release][2]. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] + +The company says that its puck-like device inserts into a cap or headband and rests on the back of the head. The dry electrode-based receiver then grabs data from the electrical signals generated through neuron activity. It uses machine learning algorithms to convert that signal output into computer controls. The interaction could be with a computer, artificial-reality or virtual-reality headset, or [IoT][4] module. + +"Imagine taking your phone to send a text message without ever touching the screen, without using Siri, just by using the speed and power of your thoughts," said NextMind founder Sid Kouider in a [video presentation][5] at Helsinki startup conference Slush in late 2019. + +Advances in neuroscience are enabling real-time consciousness-decoding, without surgery or a doctor visit, according to Kouider. + +One obstacle that has thwarted previous efforts is the human skull, which can act as a barrier to sensors. It’s been difficult for scientists to differentiate indicators from noise, and some past efforts have only been able to discern basic things, such as whether or not a person is in a state of sleep or relaxation. New materials, better sensors, and more sophisticated algorithms and modeling have overcome some of those limitations. NextMind’s noninvasive technology "translates the data in real time," Kouider says. + +Essentially, what happens is that a person’s eyes project an image of what they see onto the visual cortex in the back of the head, a bit like a projector. The NextMind device decodes the neural activity created as the object is viewed and sends that information, via an SDK, back as an input to a computer. So, by fixing one’s gaze on an object, one selects that object. For example, a user could select a screen icon by glancing at it. + +[][6] + +"The demos were by no means perfect, but there was no doubt in my mind that the technology worked," [wrote VentureBeat writer Emil Protalinski][7], who tested a pre-release device in January. + +Kouider has stated it’s the "intent" aspect of the technology that’s most interesting; if a person focuses on one thing more than something else, the technology can decode the neural signals to capture that user’s intent. + +"It really gives you a kind of sixth sense, where you can feel your brain in action, thanks to the feedback loop between your brain and a display," Kouider says in the Slush presentation. + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3526446/nextmind-wearable-device-translates-brain-signals-into-digital-commands.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://www.next-mind.com/ +[2]: https://www.businesswire.com/news/home/20200105005107/en/CES-2020-It%E2%80%99s-Mind-Matter +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: http://www.networkworld.com/cms/article/3207535 +[5]: https://youtu.be/RHuaNDSxH0o +[6]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[7]: https://venturebeat.com/2020/01/05/nextmind-is-building-a-real-time-brain-computer-interface-unveils-dev-kit-for-399/ +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From ef333a1dc97cbd690d72650795b16fee1aaf641b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 20 Feb 2020 01:06:36 +0800 Subject: [PATCH 093/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200219=20Multic?= =?UTF-8?q?loud,=20security=20integration=20drive=20massive=20SD-WAN=20ado?= =?UTF-8?q?ption?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200219 Multicloud, security integration drive massive SD-WAN adoption.md --- ...tegration drive massive SD-WAN adoption.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/talk/20200219 Multicloud, security integration drive massive SD-WAN adoption.md diff --git a/sources/talk/20200219 Multicloud, security integration drive massive SD-WAN adoption.md b/sources/talk/20200219 Multicloud, security integration drive massive SD-WAN adoption.md new file mode 100644 index 0000000000..3d690bdc3a --- /dev/null +++ b/sources/talk/20200219 Multicloud, security integration drive massive SD-WAN adoption.md @@ -0,0 +1,84 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Multicloud, security integration drive massive SD-WAN adoption) +[#]: via: (https://www.networkworld.com/article/3527194/multicloud-security-integration-drive-massive-sd-wan-adoption.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Multicloud, security integration drive massive SD-WAN adoption +====== +40% year-over year SD-WAN growth through 2022 is being fueled by relationships built between vendors including Cisco, VMware, Juniper, and Arista and service provders AWS, Microsoft Azure, Google Anthos, and IBM RedHat. +[Gratisography][1] [(CC0)][2] + +Increasing cloud adoption as well as improved network security, visibility and manageability are driving enterprise software-defined WAN ([SD-WAN][3]) deployments at a breakneck pace. + +According to research from IDC, software- and infrastructure-as-a-service (SaaS and IaaS) offerings in particular have been driving SD-WAN implementations in the past year, said Rohit Mehra, vice president, network infrastructure at  IDC. + +**Read about edge networking** + + * [How edge networking and IoT will reshape data centers][4] + * [Edge computing best practices][5] + * [How edge computing can help secure the IoT][6] + + + +For example, IDC says that its recent surveys of customers show that 95% will be using [SD-WAN][7] technology within two years, and that 42% have already deployed it. IDC also says the SD-WAN infrastructure market will hit $4.5 billion by 2022, growing at a more than 40% yearly clip between now and then. + +“The growth of SD-WAN is a broad-based trend that is driven largely by the enterprise desire to optimize cloud connectivity for remote sites,” Mehra said. + +Indeed the growth of multicloud networking is prompting many businesses to re-tool their networks in favor of SD-WAN technology, Cisco wrote recently. SD-WAN is critical for businesses adopting cloud services, acting as a connective tissue between the campus, branch, [IoT][8], [data center][9] and cloud.  The company said surveys show Cisco customers have, on average, 30 paid SaaS applications each. And that they are actually using many more – over 100 in several cases, the company said. + +Part of this trend is driven by the relationships that networking vendors such as Cisco, VMware, Juniper, Arista and others have been building with the likes of Amazon Web Services, Microsoft Azure, Google Anthos and IBM RedHat.  + +An indicator of the growing importance of the SD-WAN and multicloud relationship came last December when AWS announced key services for its cloud offering that included new integration technologies such as [AWS Transit Gateway][10], which lets customers connect their Amazon Virtual Private Clouds and their on-premises networks to a single gateway. Aruba, Aviatrix Cisco, Citrix Systems, Silver Peak and Versa already announced support for the technology which promises to simplify and enhance the performance of SD-WAN integration with AWS cloud resources. + +[][11] + +Going forward the addition of features such as cloud-based application insights and performance monitoring will be a key part of SD-WAN rollouts, Mehra said. + +While the SD-WAN and cloud relationship is growing, so, too, is the need for integrated security features. + +“The way SD-WAN offerings integrate security is so much better than traditional ways of securing WAN traffic which usually involved separate packages and services," Mehra said. "SD-WAN is a much more agile security environment.” Security, analytics and WAN optimization are viewed as top SD-WAN component, with integrated security being the top requirement for next-generation SD-WAN solutions, Mehra said.  + +Increasingly, enterprises will look less at point SD-WAN solutions and instead will favor platforms that solve a wider range of network management and security needs, Mehra said. They will look for SD-WAN platforms that integrate with other aspects of their IT infrastructure including corporate data-center networks, enterprise campus LANs, or [public-cloud][12] resources, he said. They will look for security services to be baked in, as well as support for a variety of additional functions such as visibility, analytics, and unified communications, he said. + +“As customers continue to integrate their infrastructure components with software they can do things like implement consistent management and security policies based on user, device or application requirements across their LANs and WANs and ultimately achieve a better overall application experience,” Mehra said. + +An emerging trend is the need for SD-WAN packages to support [SD-branch][13] technology. More than 70% of IDC's surveyed customers expect to use SD-Branch within next year, Mehra said.  In recent weeks [Juniper][14] and [Aruba][15] have enhanced SD-Branch offerings, a trend that is expected to continue this year.  + +SD-Branch builds on the concepts and support of SD-WAN but is more specific to the networking and management needs of LANs in the branch. Going forward, how SD-Branch integrates other technologies such as analytics, voice, unified communications and video will be key drivers of that technology.   + +Join the Network World communities on [Facebook][16] and [LinkedIn][17] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3527194/multicloud-security-integration-drive-massive-sd-wan-adoption.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://www.pexels.com/photo/black-and-white-branches-tree-high-279/ +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[4]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[5]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[6]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[7]: https://www.networkworld.com/article/3489938/what-s-hot-at-the-edge-for-2020-everything.html +[8]: https://www.networkworld.com/article/3207535/what-is-iot-the-internet-of-things-explained.html +[9]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[10]: https://aws.amazon.com/transit-gateway/ +[11]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[12]: https://www.networkworld.com/article/2159885/cloud-computing-gartner-5-things-a-private-cloud-is-not.html +[13]: https://www.networkworld.com/article/3250664/sd-branch-what-it-is-and-why-youll-need-it.html +[14]: https://www.networkworld.com/article/3487801/juniper-broadens-sd-branch-management-switch-options.html +[15]: https://www.networkworld.com/article/3513357/aruba-reinforces-sd-branch-with-security-management-upgrades.html +[16]: https://www.facebook.com/NetworkWorld/ +[17]: https://www.linkedin.com/company/network-world From d9e88ac7375b596228f832d979b6313507f90e41 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 20 Feb 2020 08:30:43 +0800 Subject: [PATCH 094/315] translating --- ...FuryBSD- A New Desktop BSD Distribution.md | 94 ------------------- ...FuryBSD- A New Desktop BSD Distribution.md | 94 +++++++++++++++++++ 2 files changed, 94 insertions(+), 94 deletions(-) delete mode 100644 sources/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md create mode 100644 translated/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md diff --git a/sources/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md b/sources/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md deleted file mode 100644 index d5f4f5da89..0000000000 --- a/sources/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md +++ /dev/null @@ -1,94 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Meet FuryBSD: A New Desktop BSD Distribution) -[#]: via: (https://itsfoss.com/furybsd/) -[#]: author: (John Paul https://itsfoss.com/author/john/) - -Meet FuryBSD: A New Desktop BSD Distribution -====== - -In the last couple of months, a few new desktop BSD have been announced. There is [HyperbolaBSD which was Hyperbola GNU/Linux][1] previously. Another new entry in the [BSD][2] world is [FuryBSD][3]. - -### FuryBSD: A new BSD distribution - -![][4] - -At its heart, FuryBSD is a very simple beast. According to [the site][5], “FuryBSD is a back to basics lightweight desktop distribution based on stock FreeBSD.” It is basically FreeBSD with a desktop environment pre-configured and several apps preinstalled. The goal is to quickly get a FreeBSD-based system running on your computer. - -You might be thinking that this sounds a lot like a couple of other BSDs that are available, such as [NomadBSD][6] and [GhostBSD][7]. The major difference between those BSDs and FuryBSD is that FuryBSD is much closer to stock FreeBSD. For example, FuryBSD uses the FreeBSD installer, while others have created their own installers and utilities. - -As it states on the [site][8], “Although FuryBSD may resemble past graphical BSD projects like PC-BSD and TrueOS, FuryBSD is created by a different team and takes a different approach focusing on tight integration with FreeBSD. This keeps overhead low and maintains compatibility with upstream.” The lead dev also told me that “One key focus for FuryBSD is for it to be a small live media with a few assistive tools to test drivers for hardware.” - -Currently, you can go to the [FuryBSD homepage][3] and download either an XFCE or KDE LiveCD. A GNOME version is in the works. - -### Who’s is Behind FuryBSD? - -The lead dev behind FuryBSD is [Joe Maloney][9]. Joe has been a FreeBSD user for many years. He contributed to other BSD projects, such as PC-BSD. He also worked with Eric Turgeon, the creator of GhostBSD, to rewrite the GhostBSD LiveCD. Along the way, he picked up a better understanding of BSD and started to form an idea of how he would make a distribution on his own. - -Joe is joined by several other devs who have also spent many years in the BSD world, such as Jaron Parsons, Josh Smith, and Damian Szidiropulosz. - -### The Future for FuryBSD - -At the moment, FuryBSD is nothing more than a pre-configured FreeBSD setup. However, the devs have a [list of improvements][5] that they want to make going forward. These include: - - * A sane framework for loading, 3rd party proprietary drivers graphics, wireless - * Cleanup up the LiveCD experience a bit more to continue to make it more friendly - * Printing support out of box - * A few more default applications included to provide a complete desktop experience - * Integrated [ZFS][10] replication tools for backup and restore - * Live image persistence options - * A custom pkg repo with sane defaults - * Continuous integration for applications updates - * Quality assurance for FreeBSD on the desktop - * Tailored artwork, color scheming, and theming - * Directory services integration - * Security hardening - - - -The devs make it quite clear that any changes they make will have a lot of thought and research behind them. They don’t want to compliment a feature, only to have to remove it or change it when it breaks something. - -![FuryBSD desktop][11] - -### How You Can Help FuryBSD? - -At this moment the project is still very young. Since all projects need help to survive, I asked Joe what kind of help they were looking for. He said, “We could use help [answering questions on the forums][12], [GitHub][13] tickets, help with documentation are all needed.” He also said that if people wanted to add support for other desktop environments, pull requests are welcome. - -### Final Thoughts - -Although I have not tried it yet, I have a good feeling about FuryBSD. It sounds like the project is in capable hands. Joe Maloney has been thinking about how to make the best BSD desktop experience for over a decade. Unlike majority of Linux distros that are basically a rethemed Ubuntu, the devs behind FuryBSD know what they are doing and they are choosing quality over the fancy bells and whistles. - -What are your thoughts on this new entry into the every growing desktop BSD market? Have you tried out FuryBSD or will you give it a try? Please let us know in the comments below. - -If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][14]. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/furybsd/ - -作者:[John Paul][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/john/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/hyperbola-linux-bsd/ -[2]: https://itsfoss.com/bsd/ -[3]: https://www.furybsd.org/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/fury-bsd.jpg?ssl=1 -[5]: https://www.furybsd.org/manifesto/ -[6]: https://itsfoss.com/nomadbsd/ -[7]: https://ghostbsd.org/ -[8]: https://www.furybsd.org/furybsd-video-overview-at-knoxbug/ -[9]: https://github.com/pkgdemon -[10]: https://itsfoss.com/what-is-zfs/ -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/FuryBSDS-desktop.jpg?resize=800%2C450&ssl=1 -[12]: https://forums.furybsd.org/ -[13]: https://github.com/furybsd -[14]: https://reddit.com/r/linuxusersgroup diff --git a/translated/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md b/translated/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md new file mode 100644 index 0000000000..f2ea410bf7 --- /dev/null +++ b/translated/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Meet FuryBSD: A New Desktop BSD Distribution) +[#]: via: (https://itsfoss.com/furybsd/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +认识 FuryBSD:一个新的桌面 BSD 发行版 +====== + +在过去的几个月中,出现了一些新的桌面 BSD。之前有 [HyperbolaBSD,它是 Hyperbola GNU/Linux][1]。[BSD][2] 世界中的另一个新入者是 [FuryBSD][3]。 + +### FuryBSD:一个新的BSD发行版 + +![][4] + +从本质上讲,FuryBSD 是一个非常简单的发行版。根据[它的网站][5]:“FuryBSD 一个是基于 FreeBSD 的轻量级桌面发行版。” 它基本上是预配置了桌面环境,并预安装了多个应用的 FreeBSD。目标是在快速地你的计算机上运行基于 FreeBSD 的系统。 + +你可能会认为这听起来很像其他几个已有的 BSD,例如 [NomadBSD][6] 和 [GhostBSD][7]。这些 BSD 与 FuryBSD 之间的主要区别在于 FuryBSD 与现有的 FreeBSD 更加接近。例如,FuryBSD 使用 FreeBSD 安装程序,而其他发行版则用了自己的安装程序和工具。 + +正如[[它的网站][8]所说:“尽管 FuryBSD 可能类似于 PC-BSD 和 TrueOS 等图形化 BSD 项目,但 FuryBSD 是由不同的团队创建的,并且采用了与 FreeBSD 紧密集成的不同方法。这样可以降低开销,并保持与上游的兼容性。”开发领导还告诉我:“FuryBSD 的一个主要重点是使其成为一种小型 Live 媒体,并带有一些辅助工具来测试硬件驱动程序。” + +当前,你可以进入 [FuryBSD 主页][3]并下载 XFCE 或 KDE LiveCD。GNOME 版本正在开发中。 + +### FuryBSD 的背后是谁 + +FuryBSD 的主要开发者是 [Joe Maloney][9]。Joe 多年来一直是 FreeBSD 的用户。他为 PC-BSD 等其他 BSD 项目做出了贡献。他还与 GhostBSD 的创建者 Eric Turgeon 一起重写了 GhostBSD LiveCD。在此过程中,他对 BSD 有了更好的了解,并开始形成自己如何进行发行的想法。 + +Joe 与其他参与 BSD 世界多年的开发者一起加入了开发,例如 Jaron Parsons、Josh Smith 和 Damian Szidiropulosz。 + +### FuryBSD 的未来 + +目前,FuryBSD 仅仅是预配置的 FreeBSD。但是,开发者有一份[要改进的清单][5]。包括: + +* 可靠的加载框架、第三方专有图形驱动、无线 +* 进一步整理 LiveCD 体验,以使其更加友好 +* 开箱即用的打印支持 +* 包含更多默认应用,以提供完整的桌面体验 +* 集成的 [ZFS][10] 复制工具,用于备份和还原 +* Live 镜像持久化选项 +* 默认自定义 pkg 仓库 +* 用于应用更新的持续集成 +* 桌面 FreeBSD 的质量保证 +* 自定义、色彩方案和主题 +* 目录服务集成 +* 安全加固 + + + +开发者非常清楚地表明,他们所做的任何更改都需要大量的思考和研究。他们不会赞美某个功能,只会在它破坏一些东西时删除或者修改它。 + +![FuryBSD desktop][11] + +### 你可以如何帮助 FuryBSD? + +目前,该项目还很年轻。由于所有项目都需要帮助才能生存,所以我问 Joe 他们正在寻求什么样的帮助。他说:“我们可以帮助[在论坛上回答问题][12]、回答 [GitHub][13] 上的问题,完善文档。”他还说如果人们想增加对其他桌面环境的支持,欢迎发起拉取请求。 + +### 最后的想法 + +尽管我还没有尝试过,但是我对 FuryBSD 感觉不错。听起来项目在掌握中。十多年来,Joe Maloney 一直在思考如何达到最佳的 BSD 桌面体验。与大多数 Linux 发行版基本上都是经过重新设计的 Ubuntu 不同,FuryBSD 背后的开发者知道他们在做什么,并且他们在更看重质量而不是花哨的功能。 + +你对这个在不断增长的桌面 BSD 市场的新入者怎么看?你尝试过 FuryBSD 或者会尝试一下吗?请在下面的评论中告诉我们。 + +如果你觉得这篇文章有趣,请在 Hacker News 或 [Reddit][14] 等社交媒体上分享它。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/furybsd/ + +作者:[John Paul][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://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/hyperbola-linux-bsd/ +[2]: https://itsfoss.com/bsd/ +[3]: https://www.furybsd.org/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/fury-bsd.jpg?ssl=1 +[5]: https://www.furybsd.org/manifesto/ +[6]: https://itsfoss.com/nomadbsd/ +[7]: https://ghostbsd.org/ +[8]: https://www.furybsd.org/furybsd-video-overview-at-knoxbug/ +[9]: https://github.com/pkgdemon +[10]: https://itsfoss.com/what-is-zfs/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/FuryBSDS-desktop.jpg?resize=800%2C450&ssl=1 +[12]: https://forums.furybsd.org/ +[13]: https://github.com/furybsd +[14]: https://reddit.com/r/linuxusersgroup \ No newline at end of file From 31d59909bbc61e496f2b90d80e1ec81e3e1c7a14 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 20 Feb 2020 08:32:13 +0800 Subject: [PATCH 095/315] translating --- .../20200219 How to Install Latest Git Version on Ubuntu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200219 How to Install Latest Git Version on Ubuntu.md b/sources/tech/20200219 How to Install Latest Git Version on Ubuntu.md index ef76a58b66..55ab72d565 100644 --- a/sources/tech/20200219 How to Install Latest Git Version on Ubuntu.md +++ b/sources/tech/20200219 How to Install Latest Git Version on Ubuntu.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5d1b62251fa1588ccf1519e53be17c2e4c01ff22 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 20 Feb 2020 09:40:17 +0800 Subject: [PATCH 096/315] Rename sources/tech/20200219 Fedora at the Czech National Library of Technology.md to sources/talk/20200219 Fedora at the Czech National Library of Technology.md --- ...20200219 Fedora at the Czech National Library of Technology.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200219 Fedora at the Czech National Library of Technology.md (100%) diff --git a/sources/tech/20200219 Fedora at the Czech National Library of Technology.md b/sources/talk/20200219 Fedora at the Czech National Library of Technology.md similarity index 100% rename from sources/tech/20200219 Fedora at the Czech National Library of Technology.md rename to sources/talk/20200219 Fedora at the Czech National Library of Technology.md From bbe69234d94a9ac61827c7fd7ae9c9b198f12a86 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 20 Feb 2020 10:21:39 +0800 Subject: [PATCH 097/315] PRF @chai-yuan --- ...ur Fedora Terminal with MPD and ncmpcpp.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/translated/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md b/translated/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md index 4940c656a1..df5c5c96fe 100644 --- a/translated/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md +++ b/translated/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md @@ -1,30 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (chai-yuan) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Playing Music on your Fedora Terminal with MPD and ncmpcpp) [#]: via: (https://fedoramagazine.org/playing-music-on-your-fedora-terminal-with-mpd-and-ncmpcpp/) [#]: author: (Carmine Zaccagnino https://fedoramagazine.org/author/carzacc/) -使用MPD和ncmpcpp在你的Fedora终端上播放音乐 +在你的 Fedora 终端上播放音乐 ====== ![][1] -MPD(Music Playing Daemon),顾名思义,是一个音乐(Music)播放(Playing)程序(Daemon)。它可以播放音乐,并且作为一个守护进程,任何软件都可以与之交互并播放声音,包括一些CLI客户端。 +MPD(Music Playing Daemon),顾名思义,是一个音乐(Music)播放(Playing)守护进程(Daemon)。它可以播放音乐,并且作为一个守护进程,任何软件都可以与之交互并播放声音,包括一些 CLI 客户端。 -其中一个被称为 _ncmpcpp_ ,它是对之前NNCMPCI工具的改进。名字的变化与他们所写的语言没有太大关系:都是C++,但称为 _ncmpcpp_ ,因为它是 _NCurses Music Playing Client_ _Plus Plus_ . +其中一个被称为 `ncmpcpp`,它是对之前 `ncmpc` 工具的改进。名字的变化与编写它们的语言没有太大关系:都是 C++,而之所以被称为 `ncmpcpp`,因为它是 “NCurses Music Playing Client Plus Plus”。 缘故 ### 安装 MPD 和 ncmpcpp - _ncmpmpcc_ 的客户端可以从官方Fedora库中通过dnf命令直接安装. +`ncmpmpcc` 的客户端可以从官方 Fedora 库中通过 `dnf` 命令直接安装。 ``` $ sudo dnf install ncmpcpp ``` -另一方面,MPD必须从RPMFusion free库安装,你可以通过运行: +另一方面,MPD 必须从 RPMFusion free 库安装,你可以通过运行: ``` $ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm @@ -38,11 +38,11 @@ $ sudo dnf install mpd ### 配置并启用 MPD -设置MPD最简单的方法是以普通用户的身份运行它。默认情况是以专用 _mpd_ 用户的身份运行它,但这会导致各种权限问题。 +设置 MPD 最简单的方法是以普通用户的身份运行它。默认情况是以专用 `mpd` 用户的身份运行它,但这会导致各种权限问题。 在运行它之前,我们需要创建一个本地配置文件,允许我们作为普通用户运行。 -首先创建一个名叫 _mpd_ 的目录在 _~/.config_ 里: +首先在 `~/.config` 里创建一个名叫 `mpd` 的目录: ``` $ mkdir ~/.config/mpd @@ -54,13 +54,13 @@ $ mkdir ~/.config/mpd $ cp /etc/mpd.conf ~/.config/mpd ``` -然后用 _vim_, _nano_ 或 _gedit_之类的软件编辑它: +然后用 `vim`、`nano` 或 `gedit` 之类的软件编辑它: ``` $ nano ~/.config/mpd/mpd.conf ``` -我建议您通读所有内容,检查是否有任何需要做的事情,但对于大多数设置,您可以删除所有内容,只需保留以下内容: +我建议你通读所有内容,检查是否有任何需要做的事情,但对于大多数设置你都可以删除,只需保留以下内容: ``` db_file "~/.config/mpd/mpd.db" @@ -73,7 +73,7 @@ log_file "syslog" $ mpd ``` -没有报错,这将在后台启动MPD守护进程。 +没有报错,这将在后台启动 MPD 守护进程。 ### 使用 ncmpcpp @@ -83,23 +83,23 @@ $ mpd $ ncmpcpp ``` -您将在终端中看到一个由ncurses所支持的图形用户界面。 +你将在终端中看到一个由 ncurses 所支持的图形用户界面。 -按下 _4_ 键,然后就可以看到本地的音乐目录,用方向键进行选择并按下 _Enter_ 进行播放。 +按下 `4` 键,然后就可以看到本地的音乐目录,用方向键进行选择并按下回车进行播放。 -多播放几次就会创建一个 _playlist_, 让你可以使用 _>_ 键(不是右箭头, _>_ 是右尖括号) 移动到下一首,并使用 _<_ 返回上一首. + 和 – 键可以调节音量. _Q_ 键可以让你退出 ncmpcpp 但不停止播放音乐. 你可以按下 _P_ 来控制暂停和播放. +多播放几个歌曲就会创建一个*播放列表*,让你可以使用 `>` 键(不是右箭头, 是右尖括号)移动到下一首,并使用 `<` 返回上一首。`+` 和 `–` 键可以调节音量。`Q` 键可以让你退出 `ncmpcpp` 但不停止播放音乐。你可以按下 `P` 来控制暂停和播放。 -你可以按下 _1_ 键来查看当前播放列表 (这是默认的视图). 从这个视图中,您可以按 _i_ 查看有关当前歌曲的信息(标记)。按 _6_ 可更改当前歌曲的标记。 +你可以按下 `1` 键来查看当前播放列表(这是默认的视图)。从这个视图中,你可以按 `i` 查看有关当前歌曲的信息(标签)。按 `6` 可更改当前歌曲的标签。 -按 _\_ 按钮将在视图顶部添加(或删除)信息面板。在左上角,你可以看到如下的内容: +按 `\` 按钮将在视图顶部添加(或删除)信息面板。在左上角,你可以看到如下的内容: ``` [------] ``` -按下 _r_, _z_, _y_, _R_, _x_ 将会分别切换到 _repeat_, _random_, _single_, _consume_ 和 _crossfade_ 播放模式并将小指示器中的 _–_ 字符替换为选定模式. +按下 `r`、`z`、`y`、`R`、`x` 将会分别切换到 `repeat`、`random`、`single`、`consume` 和 `crossfade` 等播放模式,并将这个小指示器中的 `–` 字符替换为选定模式。 -按下 _F1_ 键将会显示一些帮助文档,包含一系列的键绑定列表, 因此无需在此处编写完整列表。所以继续吧!做一个极客, 在你的终端上播放音乐! +按下 `F1` 键将会显示一些帮助文档,包含一系列的键绑定列表,因此无需在此处列出完整列表。所以继续吧!做一个极客,在你的终端上播放音乐! -------------------------------------------------------------------------------- @@ -108,7 +108,7 @@ via: https://fedoramagazine.org/playing-music-on-your-fedora-terminal-with-mpd-a 作者:[Carmine Zaccagnino][a] 选题:[lujun9972][b] 译者:[chai-yuan](https://github.com/chai-yuan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3f31024a9a7f32a781782ca85e8f27a8eb1c575d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 20 Feb 2020 10:22:25 +0800 Subject: [PATCH 098/315] PUB @chai-yuan https://linux.cn/article-11909-1.html --- ...ying Music on your Fedora Terminal with MPD and ncmpcpp.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md (98%) diff --git a/translated/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md b/published/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md similarity index 98% rename from translated/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md rename to published/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md index df5c5c96fe..b78452578b 100644 --- a/translated/tech/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md +++ b/published/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (chai-yuan) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11909-1.html) [#]: subject: (Playing Music on your Fedora Terminal with MPD and ncmpcpp) [#]: via: (https://fedoramagazine.org/playing-music-on-your-fedora-terminal-with-mpd-and-ncmpcpp/) [#]: author: (Carmine Zaccagnino https://fedoramagazine.org/author/carzacc/) From a18ce8946274da821cffe503122c26b73c9d5aa6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 21 Feb 2020 01:04:22 +0800 Subject: [PATCH 099/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200219=20How=20?= =?UTF-8?q?Kubernetes=20Became=20the=20Standard=20for=20Compute=20Resource?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md --- ...came the Standard for Compute Resources.md | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 sources/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md diff --git a/sources/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md b/sources/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md new file mode 100644 index 0000000000..9e12b778c6 --- /dev/null +++ b/sources/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md @@ -0,0 +1,49 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How Kubernetes Became the Standard for Compute Resources) +[#]: via: (https://www.linux.com/articles/how-kubernetes-became-the-standard-for-compute-resources/) +[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) + +How Kubernetes Became the Standard for Compute Resources +====== + + + +2019 has been a game-changing year for the cloud-native ecosystem. There were [consolidations][1], acquisitions of powerhouses like Red Hat Docker and Pivotal, and the emergence of players like Rancher Labs and Mirantis. + +“All these consolidation and M&A in this space is an indicator of how fast the market has matured,” said Sheng Liang, co-founder and CEO of Rancher Labs, a company that offers a complete software stack for teams adopting containers. + +Traditionally, emerging technologies like Kubernetes and Docker appeal to tinkerers and mega-scalers such as Facebook and Google. There was very little interest outside of that group. However, both of these technologies experienced massive adoption at the enterprise level. Suddenly, there was a massive market with huge opportunities. Almost everyone jumped in. There were players who were bringing innovative solutions and then there were players who were trying to catch up with the rest. It became very crowded very quickly. + +It also changed the way innovation was happening. [Early adopters were usually tech-savvy companies.][2] Now, almost everyone is using it, even in areas that were not considered turf for Kubernetes. It changed the market dynamics as companies like Rancher Labs were witnessing unique use cases. + +Liang adds, “I’ve never been in a market or technology evolution that’s happened as quickly and as dynamically as Kubernetes. When we started some five years ago, it was a very crowded space. Over time, most of our peers disappeared for one reason or the other. Either they weren’t able to adjust to the change or they chose not to adjust to some of the changes.” + +In the early days of Kubernetes, the most obvious opportunity was to build Kubernetes distro and Kubernetes operations. It’s new technology. It’s known to be reasonably complex to install, upgrade, and operate. + +It all changed when Google, AWS, and Microsoft entered the market. At that point, there was a stampede of vendors rushing in to provide solutions for the platform. “As soon as cloud providers like Google decided to make Kubernetes as a service and offered it for free as loss-leader to drive infrastructure consumption, we knew that the business of actually operating and supporting Kubernetes, the upside of that would be very limited,” said Liang. + +Not everything was bad for non-Google players. Since cloud vendors removed all the complexity that came with Kubernetes by offering it as a service, it meant wider adoption of the technology, even by those who refrained from using it due to the overhead of operating it. It meant that Kubernetes would become ubiquitous and would become an industry standard. + +“Rancher Labs was one of the very few companies that saw this as an opportunity and looked one step further than everyone else. We realized that Kubernetes was going to become the new computing standard, just the way TCP/IP became the networking standard,” said Liang. + +CNCF plays a critical role in building a vibrant ecosystem around Kubernetes, creating a massive community to build, nurture and commercialize cloud-native open source technologies. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/articles/how-kubernetes-became-the-standard-for-compute-resources/ + +作者:[Swapnil Bhartiya][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/author/swapnil/ +[b]: https://github.com/lujun9972 +[1]: https://www.cloudfoundry.org/blog/2019-is-the-year-of-consolidation-why-ibms-deal-with-red-hat-is-a-harbinger-of-things-to-come/ +[2]: https://www.packet.com/blog/open-source-season-on-the-kubernetes-highway/ From 7f1750d5c8b26c6adf1f12b37059fb01122cc89f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 21 Feb 2020 01:05:34 +0800 Subject: [PATCH 100/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200220=20Using?= =?UTF-8?q?=20Python=20and=20GNU=20Octave=20to=20plot=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200220 Using Python and GNU Octave to plot data.md --- ...sing Python and GNU Octave to plot data.md | 720 ++++++++++++++++++ 1 file changed, 720 insertions(+) create mode 100644 sources/tech/20200220 Using Python and GNU Octave to plot data.md diff --git a/sources/tech/20200220 Using Python and GNU Octave to plot data.md b/sources/tech/20200220 Using Python and GNU Octave to plot data.md new file mode 100644 index 0000000000..6c59d38eda --- /dev/null +++ b/sources/tech/20200220 Using Python and GNU Octave to plot data.md @@ -0,0 +1,720 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using Python and GNU Octave to plot data) +[#]: via: (https://opensource.com/article/20/2/python-gnu-octave-data-science) +[#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) + +Using Python and GNU Octave to plot data +====== +Learn how to do a common data science task with Python and GNU Octave. +![Analytics: Charts and Graphs][1] + +Data science is a domain of knowledge that spans programming languages. Some are well-known for solving problems in this space, while others are lesser-known. This article will help you become familiar with doing data science with some popular languages. + +### Choosing Python and GNU Octave for data science + +Every so often, I try to learn a new programming language. Why? It is mostly a combination of boredom with the old ways and curiosity about the new ways. When I started programming, the only language I knew was C. Life was hard and dangerous in those years, as I had to manually allocate memory, manage pointers, and remember to free memory. + +Then a friend suggested I try Python, and life became much easier. Programs became much slower, but I did not have to suffer through writing analysis software. However, I soon realized that each language was more suitable than others for some applications. I later studied some other languages, and each one brought some new bit of enlightenment. Discovering new programming styles let me backport some solutions to other languages, and everything became much more interesting. + +To get a feeling for a new programming language (and its documentation), I always start by writing some example programs that perform a task I know well. To that ends, I will explain how to write a program in Python and GNU Octave for a particular task you could classify as data science. If you are already familiar with one of the languages, start with that one and go through the others to look for similarities and differences. It is not intended to be an exhaustive comparison of the languages, just a little showcase. + +All of the programs are meant to be run on the [command line][2], not with a [graphical user interface][3] (GUI). The full examples are available in the [polyglot_fit repository][4]. + +### The programming task + +The program you will write in this series: + + * Reads data from a [CSV file][5] + * Interpolates the data with a straight line (i.e., _f(x)=m ⋅ x + q_) + * Plots the result to an image file + + + +This is a common situation that many data scientists have encountered. The example data is the first set of [Anscombe's quartet][6], shown in the table below. This is a set of artificially constructed data that gives the same results when fitted with a straight line, but their plots are very different. The data file is a text file with tabs as column separators and a few lines as a header. This task will use only the first set (i.e., the first two columns). + +[**Anscombe's quartet**][6] + +I + +II + +III + +IV + +x + +y + +x + +y + +x + +y + +x + +y + +10.0 + +8.04 + +10.0 + +9.14 + +10.0 + +7.46 + +8.0 + +6.58 + +8.0 + +6.95 + +8.0 + +8.14 + +8.0 + +6.77 + +8.0 + +5.76 + +13.0 + +7.58 + +13.0 + +8.74 + +13.0 + +12.74 + +8.0 + +7.71 + +9.0 + +8.81 + +9.0 + +8.77 + +9.0 + +7.11 + +8.0 + +8.84 + +11.0 + +8.33 + +11.0 + +9.26 + +11.0 + +7.81 + +8.0 + +8.47 + +14.0 + +9.96 + +14.0 + +8.10 + +14.0 + +8.84 + +8.0 + +7.04 + +6.0 + +7.24 + +6.0 + +6.13 + +6.0 + +6.08 + +8.0 + +5.25 + +4.0 + +4.26 + +4.0 + +3.10 + +4.0 + +5.39 + +19.0 + +12.50 + +12.0 + +10.84 + +12.0 + +9.13 + +12.0 + +8.15 + +8.0 + +5.56 + +7.0 + +4.82 + +7.0 + +7.26 + +7.0 + +6.42 + +8.0 + +7.91 + +5.0 + +5.68 + +5.0 + +4.74 + +5.0 + +5.73 + +8.0 + +6.89 + +### The Python way + +[Python][7] is a general-purpose programming language that is among the most popular languages in use today (as evidenced by findings from the [TIOBE index][8], [RedMonk Programming Language Rankings][9], [Popularity of Programming Language Index][10], [State of the Octoverse of GitHub][11], and other sources). It is an [interpreted language][12]; therefore, the source code is read and evaluated by a program that executes the instructions. It has a comprehensive [standard library][13] and is generally very pleasant to use (I have no reference for this last statement; it is just my humble opinion). + +#### Installation + +To develop with Python, you need the interpreter and a few libraries. The minimum requirements are: + + * [NumPy][14] for convenient array and matrices manipulation + * [SciPy][15] for scientific calculations + * [Matplotlib][16] for plotting + + + +Installing them in [Fedora][17] is easy: + + +``` +`sudo dnf install python3 python3-numpy python3-scipy python3-matplotlib` +``` + +#### Commenting code + +In Python, [comments][18] are achieved by putting a **#** at the beginning of the line, and the rest of the line will be discarded by the interpreter: + + +``` +`# This is a comment ignored by the interpreter.` +``` + +The [fitting_python.py][19] example uses comments to insert licensing information in the source code, and the first line is a [special comment][20] that enables the script to be executed on the command line: + + +``` +`#! /usr/bin/env python3` +``` + +This line informs the command-line interpreter that the script needs to be executed by the program **python3**. + +#### Required libraries + +Libraries and modules can be imported in Python as an object (as in the first line in the example) with all the functions and members of the library. There is a convenient option to rename them with a custom label by using the **as** specification: + + +``` +import numpy as np +from scipy import stats +import matplotlib.pyplot as plt +``` + +You may also decide to import only a submodule (as in the second and third lines). The syntax has two (more or less) equivalent options: **import module.submodule** and **from module import submodule**. + +#### Defining variables + +Python's variables are declared the first time a value is assigned to them: + + +``` +input_file_name = "anscombe.csv" +delimiter = "\t" +skip_header = 3 +column_x = 0 +column_y = 1 +``` + +The variable types are inferred by the value that is assigned to the variable. There are no variables with constant values unless they are declared in a module and can only be read. Idiomatically, variables that should not be modified should be named in uppercase. + +#### Printing output + +Running the programs through the command line means that the output is just printed on the terminal. Python has the [**print()**][21] function that, by default, prints its argument and adds a newline at the end of the output: + + +``` +`print("#### Anscombe's first set with Python ####")` +``` + +It is possible to combine the **print()** function with the [formatting power][22] of the [string class][23] in Python. Strings have the **format** method that can be used to add some formatted text to the string itself. For instance, it is possible to add a formatted float number, e.g.: + + +``` +`print("Slope: {:f}".format(slope))` +``` + +#### Reading data + +Reading CSV files is very easy with NumPy and the function [**genfromtxt()**][24], which generates a [NumPy array][25]: + + +``` +`data = np.genfromtxt(input_file_name, delimiter = delimiter, skip_header = skip_header)` +``` + +In Python, a function can have a variable number of arguments, and you can have it pass a subset by specifying the desired ones. Arrays are very powerful matrix-like objects that can be easily sliced into smaller arrays: + + +``` +x = data[:, column_x] +y = data[:, column_y] +``` + +The colons select the whole range, and they can also be used to select a subrange. For instance, to select the first two rows of the array, you would use: + + +``` +`first_two_rows = data[0:1, :]` +``` + +#### Fitting data + +SciPy provides convenient functions for data fitting, such as the [**linregress()**][26] function. This function provides some significant values related to the fit, such as the slope, intercept, and the correlation coefficient of the two datasets: + + +``` +slope, intercept, r_value, p_value, std_err = stats.linregress(x, y) + +print("Slope: {:f}".format(slope)) +print("Intercept: {:f}".format(intercept)) +print("Correlation coefficient: {:f}".format(r_value)) +``` + +Since **linregress()** provides several pieces of information, the result can be saved to several variables at the same time. + +#### Plotting + +The Matplotlib library plots only data points; therefore, you should define the points you want to plot. The **x** and **y** arrays were already defined, so you can directly plot them, but you also need data points that will represent the straight line. + + +``` +`fit_x = np.linspace(x.min() - 1, x.max() + 1, 100)` +``` + +The [**linspace()**][27] function conveniently generates a set of equally spaced values between two values. The ordinates can be easily calculated by exploiting the powerful NumPy arrays, which can be used in a formula as if they were ordinary numeric variables: + + +``` +`fit_y = slope * fit_x + intercept` +``` + +The formula is applied element-by-element on the array; therefore, the result has the same number of entries in the initial array. + +To create the plot, first, define a [figure object][28] that will contain all the graphics: + + +``` +fig_width = 7 #inch +fig_height = fig_width / 16 * 9 #inch +fig_dpi = 100 + +fig = plt.figure(figsize = (fig_width, fig_height), dpi = fig_dpi) +``` + +Several plots can be drawn on a figure; in Matplotlib, the plots are called [axes][29]. This example defines a single axis object to plot the data points: + + +``` +ax = fig.add_subplot(111) + +ax.plot(fit_x, fit_y, label = "Fit", linestyle = '-') +ax.plot(x, y, label = "Data", marker = '.', linestyle = '') + +ax.legend() +ax.set_xlim(min(x) - 1, max(x) + 1) +ax.set_ylim(min(y) - 1, max(y) + 1) +ax.set_xlabel('x') +ax.set_ylabel('y') +``` + +Save the figure to a [PNG image file][30] with: + + +``` +`fig.savefig('fit_python.png')` +``` + +If you want to display (instead of saving) the plot, call: + + +``` +`plt.show()` +``` + +This example references all the objects used in the plotting section: it defines the object **fig** and the object **ax**. This technicality is not necessary, as the **plt** object can be used directly to plot the datasets. The [Matplotlib tutorial][31] shows an interface such as: + + +``` +`plt.plot(fit_x, fit_y)` +``` + +Frankly, I do not like this approach because it hides the non-trivial interactions that happen between the various objects. Unfortunately, sometimes the [official examples][32] are a bit confusing because they tend to use different approaches. Referencing graphical objects is not necessary in this simple example, but it becomes important in more complex ones (such as when embedding plots in GUIs). + +#### Results + +The output on the command line is: + + +``` +#### Anscombe's first set with Python #### +Slope: 0.500091 +Intercept: 3.000091 +Correlation coefficient: 0.816421 +``` + +Here is the image Matplotlib generates. + +![Plot and fit of the dataset obtained with Python][33] + +### The GNU Octave way + +The [GNU Octave][34] language is primarily intended for numerical computations. It offers a simple syntax for manipulating vectors and matrices and has some powerful plotting facilities. It is an interpreted language like Python. Since Octave's syntax is [mostly compatible][35] with [MATLAB][36], it is often described as a free alternative to MATLAB. Octave is not listed among the most popular programming languages, but MATLAB is, so Octave is rather popular in a sense. MATLAB predates NumPy, and I have the feeling that it was inspired by the former. While you go through the example, you will see the analogies. + +#### Installation + +The [fitting_octave.m][37] example only needs the basic Octave package, making the installation in Fedora rather simple: + + +``` +`sudo dnf install octave` +``` + +#### Commenting code + +In Octave, you can add comments to code with the percent symbol (**%**), and you can also use **#** if MATLAB compatibility is not needed. The option to use **#** allows you to write the same special comment line from the Python example to execute the script directly on the command line. + +#### Necessary libraries + +Everything used in this example is contained in the basic package, so you do not need to load any new libraries. If you need a library, the [syntax][38] is **pkg load module**. This command adds the module's functions to the list of available functions. In this regard, Python has more flexibility. + +#### Defining variables + +Variables are defined with pretty much the same syntax as Python: + + +``` +input_file_name = "anscombe.csv"; +delimiter = "\t"; +skip_header = 3; +column_x = 1; +column_y = 2; +``` + +Note that the end of the line has a semicolon; this is not necessary, but it suppresses the output of the results of the line. Without a semicolon, the interpreter would print the result of the expression: + + +``` +octave:1> input_file_name = "anscombe.csv" +input_file_name = anscombe.csv +octave:2> sqrt(2) +ans =  1.4142 +``` + +#### Printing output + +The powerful function [**printf()**][39] is used to print on the terminal. Unlike in Python, the **printf()** function does not automatically add a newline at the end of the printed string, so you have to add it. The first argument is a string that can contain format information for the other arguments to be passed to the function, such as: + + +``` +`printf("Slope: %f\n", slope);` +``` + +In Python, the formatting is built into the string itself, but in Octave, it is specific to the **printf()** function. + +#### Reading data + +The [**dlmread()**][40] function can read text files structured like CSV files: + + +``` +`data = dlmread(input_file_name, delimiter, skip_header, 0);` +``` + +The result is a [matrix][41] object, which is one of the fundamental data types in Octave. Matrices may be sliced with a syntax similar to Python: + + +``` +x = data(:, column_x); +y = data(:, column_y); +``` + +The fundamental difference is that the indexes start at one instead of zero. Therefore, in the example, the __x__ column is column number one. + +#### Fitting data + +To fit the data with a straight line, you can use the [**polyfit()**][42] function. It fits the input data with a polynomial, so you just need to use a polynomial of order one: + + +``` +p = polyfit(x, y, 1); + +slope = p(1); +intercept = p(2); +``` + +The result is a matrix with the polynomial coefficients; therefore, it selects the first two indexes. To determine the correlation coefficient, use the [**corr()**][43] function: + + +``` +`r_value = corr(x, y);` +``` + +Finally, print the results with the **printf()** function: + + +``` +printf("Slope: %f\n", slope); +printf("Intercept: %f\n", intercept); +printf("Correlation coefficient: %f\n", r_value); +``` + +#### Plotting + +As in the Matplotlib example, you first need to create a dataset that represents the fitted line: + + +``` +fit_x = linspace(min(x) - 1, max(x) + 1, 100); +fit_y = slope * fit_x + intercept; +``` + +The analogy with NumPy is also evident here, as it uses the [**linspace()**][44] function that behaves just like the Python's equivalent version. + +Again, as with Matplotlib, create a [figure][45] object first, then create an [axes][46] object to hold the plots: + + +``` +fig_width = 7; %inch +fig_height = fig_width / 16 * 9; %inch +fig_dpi = 100; + +fig = figure("units", "inches", +             "position", [1, 1, fig_width, fig_height]); + +ax = axes("parent", fig); + +set(ax, "fontsize", 14); +set(ax, "linewidth", 2); +``` + +To set properties of the axes object, use the [**set()**][47] function. The interface is rather confusing, though, as the function expects a comma-separated list of property and value pairs. These pairs are just a succession of a string representing the property name and a second object representing the value for that property. There are also other functions to set various properties: + + +``` +xlim(ax, [min(x) - 1, max(x) + 1]); +ylim(ax, [min(y) - 1, max(y) + 1]); +xlabel(ax, 'x'); +ylabel(ax, 'y'); +``` + +Plotting is achieved with the [**plot()**][48] function. The default behavior is that each call resets the axes, so you need to use the function [**hold()**][49]. + + +``` +hold(ax, "on"); + +plot(ax, fit_x, fit_y, +     "marker", "none", +     "linestyle", "-", +     "linewidth", 2); +plot(ax, x, y, +     "marker", ".", +     "markersize", 20, +     "linestyle", "none"); + +hold(ax, "off"); +``` + +Also, it is possible in the **plot()** function to add the property and value pairs. The [legend][50] must be created separately, and the labels should be stated manually: + + +``` +lg = legend(ax, "Fit", "Data"); +set(lg, "location", "northwest"); +``` + +Finally, save the output to a PNG image: + + +``` +image_size = sprintf("-S%f,%f", fig_width * fig_dpi, fig_height * fig_dpi); +image_resolution = sprintf("-r%f,%f", fig_dpi); + +print(fig, 'fit_octave.png', +      '-dpng', +      image_size, +      image_resolution); +``` + +Confusingly, in this case, the options are passed as a single string with the property name and the value. Since in Octave strings do not have the formatting facilities of Python, you must use the [**sprintf()**][51] function. It behaves just like the **printf()** function, but its result is not printed, rather it is returned as a string. + +In this example, as in the Python one, the graphical objects are referenced to keep their interactions evident. If Python's documentation in this regard is a little bit confusing, [Octave's documentation][52] is even worse. Most of the examples I found did not care about referencing the objects; instead, they rely on the fact that the plotting commands act on the currently active figure. A global [root graphics object][53] keeps track of the existing figures and axes. + +#### Results + +The resulting output on the command line is: + + +``` +#### Anscombe's first set with Octave #### +Slope: 0.500091 +Intercept: 3.000091 +Correlation coefficient: 0.816421 +``` + +And this shows the resulting image generated with Octave. + +![Plot and fit of the dataset obtained with Octave][54] + +### Next up + +Both Python and GNU Octave can plot the same information, though they differ in how they get there. If you're looking to explore other languages to complete similar tasks, I highly recommend looking at [Rosetta Code][55]. It's a marvelous resource to see how to solve the same problems in many languages.  + +What language do you like to plot data in? Share your thoughts in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/python-gnu-octave-data-science + +作者:[Cristiano L. Fontana][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/cristianofontana +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/analytics-graphs-charts.png?itok=sersoqbV (Analytics: Charts and Graphs) +[2]: https://en.wikipedia.org/wiki/Command-line_interface +[3]: https://en.wikipedia.org/wiki/Graphical_user_interface +[4]: https://gitlab.com/cristiano.fontana/polyglot_fit +[5]: https://en.wikipedia.org/wiki/Comma-separated_values +[6]: https://en.wikipedia.org/wiki/Anscombe%27s_quartet +[7]: https://www.python.org/ +[8]: https://www.tiobe.com/tiobe-index/ +[9]: https://redmonk.com/sogrady/2019/07/18/language-rankings-6-19/ +[10]: http://pypl.github.io/PYPL.html +[11]: https://octoverse.github.com/ +[12]: https://en.wikipedia.org/wiki/Interpreted_language +[13]: https://docs.python.org/3/library/ +[14]: https://numpy.org/ +[15]: https://www.scipy.org/ +[16]: https://matplotlib.org/ +[17]: https://getfedora.org/ +[18]: https://en.wikipedia.org/wiki/Comment_(computer_programming) +[19]: https://gitlab.com/cristiano.fontana/polyglot_fit/-/blob/master/fitting_python.py +[20]: https://en.wikipedia.org/wiki/Shebang_(Unix) +[21]: https://docs.python.org/3/library/functions.html#print +[22]: https://docs.python.org/3/library/string.html#string-formatting +[23]: https://docs.python.org/3/library/string.html +[24]: https://docs.scipy.org/doc/numpy/reference/generated/numpy.genfromtxt.html +[25]: https://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html +[26]: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.linregress.html +[27]: https://docs.scipy.org/doc/numpy/reference/generated/numpy.linspace.html +[28]: https://matplotlib.org/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure +[29]: https://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes +[30]: https://en.wikipedia.org/wiki/Portable_Network_Graphics +[31]: https://matplotlib.org/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py +[32]: https://matplotlib.org/gallery/index.html +[33]: https://opensource.com/sites/default/files/uploads/fit_python.png (Plot and fit of the dataset obtained with Python) +[34]: https://www.gnu.org/software/octave/ +[35]: https://wiki.octave.org/FAQ#Differences_between_Octave_and_Matlab +[36]: https://en.wikipedia.org/wiki/MATLAB +[37]: https://gitlab.com/cristiano.fontana/polyglot_fit/-/blob/master/fitting_octave.m +[38]: https://octave.org/doc/v5.1.0/Using-Packages.html#Using-Packages +[39]: https://octave.org/doc/v5.1.0/Formatted-Output.html#XREFprintf +[40]: https://octave.org/doc/v5.1.0/Simple-File-I_002fO.html#XREFdlmread +[41]: https://octave.org/doc/v5.1.0/Matrices.html +[42]: https://octave.org/doc/v5.1.0/Polynomial-Interpolation.html +[43]: https://octave.org/doc/v5.1.0/Correlation-and-Regression-Analysis.html#XREFcorr +[44]: https://octave.sourceforge.io/octave/function/linspace.html +[45]: https://octave.org/doc/v5.1.0/Multiple-Plot-Windows.html +[46]: https://octave.org/doc/v5.1.0/Graphics-Objects.html#XREFaxes +[47]: https://octave.org/doc/v5.1.0/Graphics-Objects.html#XREFset +[48]: https://octave.org/doc/v5.1.0/Two_002dDimensional-Plots.html#XREFplot +[49]: https://octave.org/doc/v5.1.0/Manipulation-of-Plot-Windows.html#XREFhold +[50]: https://octave.org/doc/v5.1.0/Plot-Annotations.html#XREFlegend +[51]: https://octave.org/doc/v5.1.0/Formatted-Output.html#XREFsprintf +[52]: https://octave.org/doc/v5.1.0/Two_002dDimensional-Plots.html#Two_002dDimensional-Plots +[53]: https://octave.org/doc/v5.1.0/Graphics-Objects.html#XREFgroot +[54]: https://opensource.com/sites/default/files/uploads/fit_octave.png (Plot and fit of the dataset obtained with Octave) +[55]: http://www.rosettacode.org/ From b00530b2c005139eafe957e0bbd2f236316f0b39 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 21 Feb 2020 01:06:14 +0800 Subject: [PATCH 101/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200220=20Tools?= =?UTF-8?q?=20for=20SSH=20key=20management?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200220 Tools for SSH key management.md --- .../20200220 Tools for SSH key management.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/tech/20200220 Tools for SSH key management.md diff --git a/sources/tech/20200220 Tools for SSH key management.md b/sources/tech/20200220 Tools for SSH key management.md new file mode 100644 index 0000000000..816993315c --- /dev/null +++ b/sources/tech/20200220 Tools for SSH key management.md @@ -0,0 +1,110 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tools for SSH key management) +[#]: via: (https://opensource.com/article/20/2/ssh-tools) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +Tools for SSH key management +====== +Time-saving shortcuts for a commonly used open source tool. +![collection of hardware on blue backround][1] + +I use SSH constantly. Every day I find myself logged in to multiple servers and Pis (both in the same room as me and over the internet). I have many devices I need access to, and different requirements for gaining access, so in addition to using various SSH/SCP command options, I have to maintain a config file with all the connection details. + +Over time I’ve come up with a few time-saving tips and tools that you might find useful, too. + +### SSH keys + +SSH keys are a way to authenticate SSH connections without using a password, either to speed up your access or as a security measure, if you turn password access off and ensure only authorized keys are permitted. To create an SSH key, run the command: + + +``` +`$ ssh-keygen` +``` + +This will create a key-pair (a public and private key) in **~/.ssh/**. Keep the private key (id_rsa) on the PC and never share it. You can share the public key (id_rsa.pub) with others or place it on other servers. + +### ssh-copy-id + +If I’m working on a Pi at home or work, I tend to leave SSH settings at their default, as I’m not concerned with security on an internal trusted network, and I usually copy my SSH key to the Pi to avoid having to authenticate with a password every time. To do this, I use the **ssh-copy-id** command to copy it to the Pi. This automatically adds your key to the Pi: + + +``` +`$ ssh-copy-id pi@192.168.1.20` +``` + +On production servers, I tend to turn off password authentication and only allow authorized SSH keys. + +### ssh-import-id + +Another similar tool is ssh-import-id. You can use this to give yourself (or others) access to a computer or server by importing their keys from GitHub. For example, I have registered my various SSH keys with my GitHub account, so I can push to GitHub without a password. These public keys are made available, so ssh-import-id can use them to authorize me from any of my computers: + + +``` +`$ ssh-import-id gh:bennuttall` +``` + +I can also use this to give someone else access to a server without asking them for their keys: + + +``` +`$ ssh-import-id gh:waveform80` +``` + +### storm + +I also use a tool called Storm, which helps you add SSH connections to your SSH config, so you don’t have to remember them all. You can install it with pip: + + +``` +`$ sudo pip3 install stormssh` +``` + +Then you can add an SSH connection to your config with the following command: + + +``` +`$ storm add pi3 pi@192.168.1.20` +``` + +Then you can just use **ssh pi3** to gain access. Similarly, **scp file.txt pi3:** or **sshfs pi pi3:** + +You can also use more SSH options, such as the port number: + + +``` +$ storm add pi3 pi@192.168.1.20:2000 +``` + +You can list, search, and edit saved connections easily using Storm’s [documentation][2]. All Storm actually does is manage items in your ssh config file at **~/.ssh/config**. Once you see how these are stored, you might choose to edit them manually. An example connection in config looks like this: + + +``` +Host pi3 +   user pi +   hostname 192.168.1.20 +   port 22 +``` + +### Conclusion + +SSH is an important tool for system administration, from Raspberry Pi to the largest cloud infrastructures. Familiarizing yourself with key management will forever be handy. Do you have other SSH tricks to add? I would love to have you share them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/ssh-tools + +作者:[Ben Nuttall][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/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_BUS_Apple_520.png?itok=ZJu-hBV1 (collection of hardware on blue backround) +[2]: https://stormssh.readthedocs.io/en/stable/usage.html From 95ae0cafc4d57a9a217ac552500f80771a886517 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 21 Feb 2020 08:37:44 +0800 Subject: [PATCH 102/315] translated --- ...0 Scan Kubernetes for errors with KRAWL.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) rename {sources => translated}/tech/20200210 Scan Kubernetes for errors with KRAWL.md (80%) diff --git a/sources/tech/20200210 Scan Kubernetes for errors with KRAWL.md b/translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md similarity index 80% rename from sources/tech/20200210 Scan Kubernetes for errors with KRAWL.md rename to translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md index 5417ba630a..dae3043217 100644 --- a/sources/tech/20200210 Scan Kubernetes for errors with KRAWL.md +++ b/translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md @@ -7,23 +7,23 @@ [#]: via: (https://opensource.com/article/20/2/kubernetes-scanner) [#]: author: (Abhishek Tamrakar https://opensource.com/users/tamrakar) -Scan Kubernetes for errors with KRAWL +使用 KRAWL 扫描 Kubernetes 错误 ====== -The KRAWL script identifies errors in Kubernetes pods and containers. +用 KRAWL 脚本来标识 Kubernetes pod 和容器中的错误。 ![Ship captain sailing the Kubernetes seas][1] -When you're running containers with Kubernetes, you often find that they pile up. This is by design. It's one of the advantages of containers: they're cheap to start whenever a new one is needed. You can use a front-end like OpenShift or OKD to manage pods and containers. Those make it easy to visualize what you have set up, and have a rich set of commands for quick interactions. +当你使用 Kubernetes 运行容器时,你通常会发现它们堆积。这是设计使然。它是容器的优点之一:每当需要新的容器时,它们启动成本都很低。你可以使用前端(如 OpenShift 或 OKD)来管理 pod 和容器。这些工具使可视化设置变得容易,并且它具有一组丰富的用于快速交互的命令。 -If a platform to manage containers doesn't fit your requirements, though, you can also get that information using only a Kubernetes toolchain, but there are a lot of commands you need for a full overview of a complex environment. For that reason, I wrote [KRAWL][2], a simple script that scans pods and containers under the namespaces on Kubernetes clusters and displays the output of events, if any are found. It can also be used as Kubernetes plugin for the same purpose. It's a quick and easy way to get a lot of useful information. +如果管理容器的平台不符合你的要求,你也可以仅使用 Kubernetes 工具链获取这些信息,但这需要大量命令才能全面了解复杂环境。出于这个原因,我编写了 [KRAWL][2],这是一个简单的脚本,可用于扫描 Kubernetes 集群命名空间下的 pod 和容器,并在发现任何事件时,显示事件的输出。它也可用作为 Kubernetes 插件使用。这是获取大量有用信息的快速简便方法。 -### Prerequisites +### 预先条件 - * You must have kubectl installed. - * Your cluster's kubeconfig must be either in its default location ($HOME/.kube/config) or exported (KUBECONFIG=/path/to/kubeconfig). + * 必须安装 kubectl。 + * 集群的 kubeconfig 配置必须在它的默认位置 ($HOME/.kube/config) 或已被导出。 -### Usage +### 使用 ``` @@ -32,7 +32,7 @@ If a platform to manage containers doesn't fit your requirements, though, you ca ![KRAWL script][3] -### The script +### 脚本 ``` @@ -201,7 +201,7 @@ get_pod_events * * * -_This was originally published as the README in [KRAWL's GitHub repository][2] and is reused with permission._ +_此文最初发布在 [KRAWL 的 GitHub 仓库][2]下的 README 中,并被或许重用。_ -------------------------------------------------------------------------------- @@ -209,7 +209,7 @@ via: https://opensource.com/article/20/2/kubernetes-scanner 作者:[Abhishek Tamrakar][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 81db10b8b5ec982cd367aa7bbab8be8b5a1799dd Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 21 Feb 2020 08:43:32 +0800 Subject: [PATCH 103/315] translating --- sources/tech/20200219 Don-t like IDEs- Try grepgitvi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200219 Don-t like IDEs- Try grepgitvi.md b/sources/tech/20200219 Don-t like IDEs- Try grepgitvi.md index 34caf67f71..0b3d10a279 100644 --- a/sources/tech/20200219 Don-t like IDEs- Try grepgitvi.md +++ b/sources/tech/20200219 Don-t like IDEs- Try grepgitvi.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From aedb3dddde7954912416ac68e513c775b01ee5e2 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Feb 2020 11:07:12 +0800 Subject: [PATCH 104/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020170918=20Fun=20?= =?UTF-8?q?and=20Games=20in=20Emacs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20170918 Fun and Games in Emacs.md --- .../tech/20170918 Fun and Games in Emacs.md | 234 ++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 sources/tech/20170918 Fun and Games in Emacs.md diff --git a/sources/tech/20170918 Fun and Games in Emacs.md b/sources/tech/20170918 Fun and Games in Emacs.md new file mode 100644 index 0000000000..64123ff680 --- /dev/null +++ b/sources/tech/20170918 Fun and Games in Emacs.md @@ -0,0 +1,234 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fun and Games in Emacs) +[#]: via: (https://www.masteringemacs.org/article/fun-games-in-emacs) +[#]: author: (Mickey Petersen https://www.masteringemacs.org/about) + +Fun and Games in Emacs +====== + +It’s yet another Monday and you’re hard at work on those [TPS reports][1] for your boss, Lumbergh. Why not play Emacs’s Zork-like text adventure game to take your mind off the tedium of work? + +But seriously, yes, there are both games and quirky playthings in Emacs. Some you have probably heard of or played before. The only thing they have in common is that most of them were added a long time ago: some are rather odd inclusions (as you’ll see below) and others were clearly written by bored employees or graduate students. What they all have in common is a whimsy and a casualness that I rarely see in Emacs today. Emacs is Serious Business now in a way that it probably wasn’t back in the 1980s when some of these games were written. + +### Tower of Hanoi + +The [Tower of Hanoi][2] is an ancient mathematical puzzle game and one that is probably familiar to some of us as it is often used in Computer Science as a teaching aid because of its recursive and iterative solutions. + +![Tower of Hanoi Screenshot](https://www.masteringemacs.org/static/uploads/hanoi.png) + +In Emacs there are three commands you can run to trigger the Tower of Hanoi puzzle: M-x hanoi with a default of 3 discs; M-x hanoi-unix and M-x hanoi-unix-64 uses the unix timestamp, making a move each second in line with the clock, and with the latter pretending it uses a 64-bit clock. + +The Tower of Hanoi implementation in Emacs dates from the mid 1980s — an awful long time ago indeed. There are a few Customize options (M-x customize-group RET hanoi RET) such as enabling colorized discs. And when you exit the Hanoi buffer or type a character you are treated to a sarcastic goodbye message (see above.) + +### 5x5 + +![5x5 game grid](https://www.masteringemacs.org/static/uploads/5x5.png) + The 5x5 game is a logic puzzle: you are given a 5x5 grid with a central cross already filled-in; your goal is to fill all the cells by toggling them on and off in the right order to win. It’s not as easy as it sounds! + +To play, type M-x 5x5, and with an optional digit argument you can change the size of the grid. What makes this game interesting is its rather complex ability to suggest the next move and attempt to solve the game grid. It uses Emacs’s very own, and very cool, symbolic RPN calculator M-x calc (and in [Fun with Emacs Calc][3] I use it to solve a simple problem.) + +So what I like about this game is that it comes with a very complex solver – really, you should read the source code with M-x find-library RET 5x5 – and a “cracker” that attempts to brute force solutions to the game. + +Try creating a bigger game grid, such as M-10 M-x 5x5, and then run one of the crack commands below. The crackers will attempt to iterate their way to the best solution. This runs in real time and is fun to watch: + + + +`M-x 5x5-crack-mutating-best` + Attempt to crack 5x5 by mutating the best solution. + +`M-x 5x5-crack-mutating-current` + Attempt to crack 5x5 by mutating the current solution. + +`M-x 5x5-crack-randomly` + Attempt to crack 5x5 using random solutions. + +`M-x 5x5-crack-xor-mutate` + Attempt to crack 5x5 by xoring the current and best solution. + +### Text Animation + +You can display a fancy birthday present animation by running M-x animate-birthday-present and giving it your name. It looks rather cool! + +![xkcd](https://imgs.xkcd.com/comics/real_programmers.png) + +The animate package is also used by M-x butterfly command, a command added to Emacs as an homage to the [XKCD][4] strip above. Of course the Emacs command in the strip is teeechnically not valid but the humor more than makes up for it. + +### Blackbox + +The objective of this game I am going to quote literally: + +> The object of the game is to find four hidden balls by shooting rays into the black box. There are four possibilities: 1) the ray will pass thru the box undisturbed, 2) it will hit a ball and be absorbed, 3) it will be deflected and exit the box, or 4) be deflected immediately, not even being allowed entry into the box. + +So, it’s a bit like the [Battleship][5] most of us played as kids but… for people with advanced degrees in physics? + +It’s another game that was added back in the 1980s. I suggest you read the extensive documentation on how to play by typing C-h f blackbox. + +### Bubbles + +![Bubbles game](https://www.masteringemacs.org/static/uploads/bubbles.png) + +The M-x bubbles game is rather simple: you must clear out as many “bubbles” as you can in as few moves as possible. When you remove bubbles the other bubbles drop and stick together. It’s a fun game that, as an added bonus, comes with graphics if you use Emacs’s GUI. It also works with your mouse. + +You can configure the difficulty of the game by calling M-x bubbles-set-game- where is one of: easy, medium, difficult, hard, or userdefined. Furthermore, you can alter the graphics, grid size and colors using Customize: M-x customize-group bubbles. + +For its simplicity and fun factor, this ranks as one of my favorite games in Emacs. + +### Fortune & Cookie + +I like the fortune command. Snarky, unhelpful and often sarcastic “advice” mixed in with literature and riddles brightens up my day whenever I launch a new shell. + +Rather confusingly there are two packages in Emacs that does more-or-less the same thing: fortune and cookie1. The former is geared towards putting fortune cookie messages in email signatures and the latter is just a simple reader for the fortune format. + +Anyway, to use Emacs’s cookie1 package you must first tell it where to find the file by customizing the variable cookie-file with customize-option RET cookie RET. + +If you’re on Ubuntu you will have to install the fortune package first. The files are found in the /usr/share/games/fortunes/ directory. + +You can then call M-x cookie or, should you want to do this, find all matching cookies with M-x cookie-apropos. + +### Decipher + +This package perfectly captures the utilitarian nature of Emacs: it’s a package to help you break simple substitution ciphers (like cryptogram puzzles) using a helpful user interface. You just know that – more than twenty years ago – someone really had a dire need to break a lot of basic ciphers. It’s little things like this module that makes me overjoyed to use Emacs: a module of scant importance to all but a few people and, yet, should you need it – there it is. + +So how do you use it then? Well, let’s consider the “rot13” cipher: rotating characters by 13 places in a 26-character alphabet. It’s an easy thing to try out in Emacs with M-x ielm, Emacs’s REPL for [Evaluating Elisp][6]: + +``` +*** Welcome to IELM *** Type (describe-mode) for help. +ELISP> (rot13 "Hello, World") +"Uryyb, Jbeyq" +ELISP> (rot13 "Uryyb, Jbeyq") +"Hello, World" +ELISP> +``` + +So how can the decipher module help us here? Well, create a new buffer test-cipher and type in your cipher text (in my case Uryyb, Jbeyq) + +![cipher](https://www.masteringemacs.org/static/uploads/cipher.png) + +You’re now presented with a rather complex interface. You can now place the point on any of the characters in the ciphertext on the purple line and guess what the character might be: Emacs will update the rest of the plaintext guess with your choices and tell you how the characters in the alphabet have been allocated thus far. + +You can then start winnowing down the options using various helper commands to help infer which cipher characters might correspond to which plaintext character: + + + +`D` + Shows a list of digrams (two-character combinations from the cipher) and their frequency + +`F` + Shows the frequency of each ciphertext letter + +`N` + Shows adjacency of characters. I am not entirely sure how this works. + +`M` and `R` + Save and restore a checkpoint, allowing you to branch your work and explore different ways of cracking the cipher. + +All in all, for such an esoteric task, this package is rather impressive! If you regularly solve cryptograms maybe this package can help? + +### Doctor + +![doctor](https://www.masteringemacs.org/static/uploads/doctor.png) + +Ah, the Emacs doctor. Based on the original [ELIZA][7] the “Doctor” tries to psychoanalyze what you say and attempts to repeat the question back to you. Rather fun, for a few minutes, and one of the more famous Emacs oddities. You can run it with M-x doctor. + +### Dunnet + +Emacs’s very own Zork-like text adventure game. To play it, type M-x dunnet. It’s rather good, if short, but it’s another rather famous Emacs game that too few have actually played through to the end. + +If you find yourself with time to kill between your TPS reports then it’s a great game with a built-in “boss screen” as it’s text-only. + +Oh, and, don’t try to eat the CPU card :) + +### Gomoku + +![gomoku](https://www.masteringemacs.org/static/uploads/gomoku.png) + +Another game written in the 1980s. You have to connect 5 squares, tic-tac-toe style. You can play against Emacs with M-x gomoku. The game also supports the mouse, which is rather handy. You can customize the group gomoku to adjust the size of the grid. + +### Game of Life + +[Conway’s Game of Life][8] is a famous example of cellular automata. The Emacs version comes with a handful of starting patterns that you can (programmatically with elisp) alter by adjusting the life-patterns variable. + +You can trigger a game of life with M-x life. The fact that the whole thing, display code, comments and all, come in at less than 300 characters is also rather impressive. + +### Pong, Snake and Tetris + +![tetris](https://www.masteringemacs.org/static/uploads/tetris.png) + +These classic games are all implemented using the Emacs package gamegrid, a generic framework for building grid-based games like Tetris and Snake. The great thing about the gamegrid package is its compatibility with both graphical and terminal Emacs: if you run Emacs in a GUI you get fancy graphics; if you don’t, you get simple ASCII art. + +You can run the games by typing M-x pong, M-x snake, or M-x tetris. + +The Tetris game in particular is rather faithfully implemented, having both gradual speed increase and the ability to slide blocks into place. And given you have the code to it, you can finally remove that annoying Z-shaped piece no one likes! + +### Solitaire + +![solitaire image](https://www.masteringemacs.org/static/uploads/solitaire.png) + +This is not the card game, unfortunately. But a peg-based game where you have to end up with just one stone on the board, by taking a stone (the o) and “jumping” over an adjacent stone into the hole (the .), removing the stone you jumped over in the process. Rinse and repeat until the board is empty. + +There is a handy solver built in called M-x solitaire-solve if you get stuck. + +### Zone + +Another of my favorites. This time’s it’s a screensaver – or rather, a series of screensavers. + +Type M-x zone and watch what happens to your screen! + +You can configure a screensaver idle time by running M-x zone-when-idle (or calling it from elisp) with an idle time in seconds. You can turn it off with M-x zone-leave-me-alone. + +This one’s guaranteed to make your coworkers freak out if it kicks off while they are looking. + +### Multiplication Puzzle + +![mpuz](https://www.masteringemacs.org/static/uploads/mpuz.png) + +This is another brain-twisting puzzle game. When you run M-x mpuz you are given a multiplication puzzle where you have to replace the letters with numbers and ensure the numbers add (multiply?) up. + +You can run M-x mpuz-show-solution to solve the puzzle if you get stuck. + +### Miscellaneous + +There are more, but they’re not the most useful or interesting: + +* You can translate a region into morse code with M-x morse-region and M-x unmorse-region. + +* The Dissociated Press is a very simple command that applies something like a random walk markov-chain generator to a body of text in a buffer and generates nonsensical text from the source body. Try it with M-x dissociated-press. + +* The Gamegrid package is a generic framework for building grid-based games. So far only Tetris, Pong and Snake use it. It’s called gamegrid. + +* The gametree package is a complex way of notating and tracking chess games played via email. + +* The M-x spook command inserts random words (usually into emails) designed to confuse/overload the “NSA trunk trawler” – and keep in mind this module dates from the 1980s and 1990s – with various words the spooks are supposedly listening for. Of course, even ten years ago that would’ve seemed awfully paranoid and quaint but not so much any more… + +### Conclusion + +I love the games and playthings that ship with Emacs. A lot of them date from, well, let’s just call a different era: an era where whimsy was allowed or perhaps even encouraged. Some are known classics (like Tetris and Tower of Hanoi) and some of the others are fun variations on classics (like blackbox) — and yet I love that they ship with Emacs after all these years. I wonder if any of these would make it into Emacs’s codebase today; well, they probably wouldn’t — they’d be relegated to the package manager where, in a clean and sterile world, they no doubt belong. + +There’s a mandate in Emacs to move things not essential to the Emacs experience to ELPA, the package manager. I mean, as a developer myself, that does make sense, but… surely for every package removed and exiled to ELPA we chip away the essence of what defines Emacs? + +-------------------------------------------------------------------------------- + + +via: https://www.masteringemacs.org/article/fun-games-in-emacs + +作者:[Mickey Petersen][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.masteringemacs.org/about +[b]:https://github.com/lujun9972 +[1]:https://en.wikipedia.org/wiki/Office_Space +[2]:https://en.wikipedia.org/wiki/Tower_of_Hanoi +[3]:https://www.masteringemacs.org/article/fun-emacs-calc +[4]:http://www.xkcd.com +[5]:https://en.wikipedia.org/wiki/Battleship_(game) +[6]:https://www.masteringemacs.org/article/evaluating-elisp-emacs +[7]:https://en.wikipedia.org/wiki/ELIZA +[8]:https://en.wikipedia.org/wiki/Conway's_Game_of_Life From 82fc982806d191924988b1bacb508bba5d43922b Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Fri, 21 Feb 2020 11:17:42 +0800 Subject: [PATCH 105/315] Update 20200219 How Kubernetes Became the Standard for Compute Resources.md --- ...ow Kubernetes Became the Standard for Compute Resources.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md b/sources/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md index 9e12b778c6..2ae6e33edd 100644 --- a/sources/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md +++ b/sources/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (heguangzhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -38,7 +38,7 @@ via: https://www.linux.com/articles/how-kubernetes-became-the-standard-for-compu 作者:[Swapnil Bhartiya][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[heguangzhi](https://github.com/heguangzhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8abbbfb3515005322672dc9534c6e50a9a4878ab Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 Feb 2020 11:27:28 +0800 Subject: [PATCH 106/315] PRF @geekpi --- ...task list and access Reddit and Twitter.md | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/translated/tech/20200127 Use Vim to manage your task list and access Reddit and Twitter.md b/translated/tech/20200127 Use Vim to manage your task list and access Reddit and Twitter.md index 8a50dd6f14..c7c9be76c6 100644 --- a/translated/tech/20200127 Use Vim to manage your task list and access Reddit and Twitter.md +++ b/translated/tech/20200127 Use Vim to manage your task list and access Reddit and Twitter.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Use Vim to manage your task list and access Reddit and Twitter) @@ -9,12 +9,14 @@ 使用 Vim 管理任务列表和访问 Reddit 和 Twitter ====== -在我们的 20 个使用开源提升生产力的系列的第十七篇文章中了解在编辑器中处理待办列表以及获取社交信息。 -![Chat via email][1] + +> 在 2020 年用开源实现更高生产力的二十种方式的第十七篇文章中,了解在编辑器中处理待办列表以及获取社交信息。 + +![](https://img.linux.net.cn/data/attachment/album/202002/21/112633yf3mx8qlssltugzm.jpg) 去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 -### 使用 Vim 执行(几乎)所有操作,第 2 部分 +### 用 Vim 做(几乎)所有事情,第 2 部分 在[昨天的文章][2]中,你开始用 Vim 检查邮件和日历。今天,你可以做的更多。首先,你会在 Vim 编辑器中跟踪任务,然后获取社交信息。 @@ -24,13 +26,12 @@ 使用 Vim 编辑一个文本待办事件是一件自然的事,而 [todo.txt-vim][4] 包使其更加简单。首先安装 todo.txt-vim 包: - ``` -git clone ~/.vim/bundle/todo.txt-vim +git clone https://github.com/freitass/todo.txt-vim ~/.vim/bundle/todo.txt-vim vim ~/path/to/your/todo.txt ``` -todo.txt-vim 自动识别以 todo.txt 和 done.txt 结尾的文件作为 [todo.txt][5] 文件。它添加特定于 todo.txt 格式的键绑定。你可以使用 **\x** 标记“已完成”的内容,使用 **\d** 将其设置为当前日期,然后使用 **\a**、**\b** 和 **\c** 更改优先级。你可以提升(**\k**)或降低(**\j**)优先级,并根据项目(**\s+**)、上下文(**\s@**)或日期(**\sd**)排序(**\s**)。完成后,你可以和平常一样关闭和保存文件。 +todo.txt-vim 自动识别以 `todo.txt` 和 `done.txt` 结尾的文件作为 [todo.txt][5] 文件。它添加特定于 todo.txt 格式的键绑定。你可以使用 `\x` 标记“已完成”的内容,使用 `\d` 将其设置为当前日期,然后使用 `\a`、`\b` 和 `\c` 更改优先级。你可以提升(`\k`)或降低(`\j`)优先级,并根据项目(`\s+`)、上下文(`\s@`)或日期(`\sd`)排序(`\s`)。完成后,你可以和平常一样关闭和保存文件。 todo.txt-vim 包是我几天前写的 [todo.sh 程序][6]的一个很好的补充,使用 [todo edit][7] 加载项,它可以增强的你待办事项列表跟踪。 @@ -40,13 +41,12 @@ todo.txt-vim 包是我几天前写的 [todo.sh 程序][6]的一个很好的补 Vim 还有一个不错的用于 [Reddit][9] 的加载项,叫 [vim-reddit][10]。它不如 [Tuir][11] 好,但是用于快速查看最新的文章,它还是不错的。首先安装捆绑包: - ``` -git clone ~/.vim/bundle/vim-reddit +git clone https://github.com/DougBeney/vim-reddit.git ~/.vim/bundle/vim-reddit vim ``` -现在输入 **:Reddit** 将加载 Reddit 首页。你可以使用 **:Reddit name** 加载特定子板。打开文章列表后,使用箭头键导航或使用鼠标滚动。按 **o** 将在 Vim 中打开文章(除非它多媒体文章,它会打开浏览器),然后按 **c** 打开评论。如果要直接转到页面,请按 **O** 而不是 **o**。只需按 **u** 就能返回。当你 Reddit 看完后,输入 **:bd** 就行。vim-reddit 唯一的缺点是无法登录或发布新文章和评论。话又说回来,有时这是一件好事。 +现在输入 `:Reddit` 将加载 Reddit 首页。你可以使用 `:Reddit name` 加载特定子板。打开文章列表后,使用箭头键导航或使用鼠标滚动。按 `o` 将在 Vim 中打开文章(除非它多媒体文章,它会打开浏览器),然后按 `c` 打开评论。如果要直接转到页面,请按 `O` 而不是 `o`。只需按 `u` 就能返回。当你 Reddit 看完后,输入 `:bd` 就行。vim-reddit 唯一的缺点是无法登录或发布新文章和评论。话又说回来,有时这是一件好事。 #### 使用 twitvim 在 Vim 中发推 @@ -54,17 +54,15 @@ vim 最后,我们有 [twitvim][13],这是一个于阅读和发布 Twitter 的 Vim 软件包。它需要更多设置。首先从 GitHub 安装 twitvim: - ``` -`git clone https://github.com/twitvim/twitvim.git ~/.vim/bundle/twitvim` +git clone https://github.com/twitvim/twitvim.git ~/.vim/bundle/twitvim ``` -现在你需要编辑 **.vimrc** 文件并设置一些选项。它帮助插件知道使用哪些库与 Twitter 交互。运行 **vim --version** 并查看哪些语言的前面有 **+** 就代表你的 Vim 支持它。 +现在你需要编辑 `.vimrc` 文件并设置一些选项。它帮助插件知道使用哪些库与 Twitter 交互。运行 `vim --version` 并查看哪些语言的前面有 `+` 就代表你的 Vim 支持它。 ![Enabled and Disabled things in vim][14] -因为我的是 **+perl -python +python3**,所以我知道我可以启用 Perl 和 Python 3 但不是 Python 2 (python)。 - +因为我的是 `+perl -python +python3`,所以我知道我可以启用 Perl 和 Python 3 但不是 Python 2 (python)。 ``` " TwitVim Settings @@ -73,9 +71,9 @@ let twitvim_enable_perl = 1 let twitvim_enable_python3 = 1 ``` -现在,你可以通过运行 **:SetLoginTwitter** 启动浏览器窗口,它会打开一个浏览器窗口要求你授权 VimTwit 访问你的帐户。在 Vim 中输入提供的 PIN 后就可以了。 +现在,你可以通过运行 `:SetLoginTwitter` 启动浏览器窗口,它会打开一个浏览器窗口要求你授权 VimTwit 访问你的帐户。在 Vim 中输入提供的 PIN 后就可以了。 -Twitvim 的命令不像其他包中一样简单。要加载好友和关注者的时间线,请输入 **:FriendsTwitter**。要列出提及你的和回复,请使用 **:MentionsTwitter**。发布新推文是 **:PosttoTwitter <Your message>**。你可以滚动列表并输入 **\r** 回复特定推文,你可以用 **\d** 直接给某人发消息。 +Twitvim 的命令不像其他包中一样简单。要加载好友和关注者的时间线,请输入 `:FriendsTwitter`。要列出提及你的和回复,请使用 `:MentionsTwitter`。发布新推文是 `:PosttoTwitter `。你可以滚动列表并输入 `\r` 回复特定推文,你可以用 `\d` 直接给某人发消息。 就是这些了。你现在可以在 Vim 中做(几乎)所有事了! @@ -86,14 +84,14 @@ via: https://opensource.com/article/20/1/vim-task-list-reddit-twitter 作者:[Kevin Sonney][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/ksonney [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_chat_communication_message.png?itok=LKjiLnQu (Chat via email) -[2]: https://opensource.com/article/20/1/send-email-and-check-your-calendar-vim +[2]: https://linux.cn/article-11908-1.html [3]: https://opensource.com/sites/default/files/uploads/productivity_17-1.png (to-dos and Twitter with Vim) [4]: https://github.com/freitass/todo.txt-vim [5]: http://todotxt.org From 23d5f755591124b06f12411f494f9615a4118d13 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 Feb 2020 11:29:56 +0800 Subject: [PATCH 107/315] PUB @geekpi https://linux.cn/article-11912-1.html --- ... to manage your task list and access Reddit and Twitter.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200127 Use Vim to manage your task list and access Reddit and Twitter.md (98%) diff --git a/translated/tech/20200127 Use Vim to manage your task list and access Reddit and Twitter.md b/published/20200127 Use Vim to manage your task list and access Reddit and Twitter.md similarity index 98% rename from translated/tech/20200127 Use Vim to manage your task list and access Reddit and Twitter.md rename to published/20200127 Use Vim to manage your task list and access Reddit and Twitter.md index c7c9be76c6..dcf7ef9dd8 100644 --- a/translated/tech/20200127 Use Vim to manage your task list and access Reddit and Twitter.md +++ b/published/20200127 Use Vim to manage your task list and access Reddit and Twitter.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11912-1.html) [#]: subject: (Use Vim to manage your task list and access Reddit and Twitter) [#]: via: (https://opensource.com/article/20/1/vim-task-list-reddit-twitter) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From 30d61701de45839f73b83cddc26039ffb47399ea Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 Feb 2020 12:08:47 +0800 Subject: [PATCH 108/315] PRF @wxy --- ... the many variations and how to use them.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translated/tech/20190116 Zipping files on Linux- the many variations and how to use them.md b/translated/tech/20190116 Zipping files on Linux- the many variations and how to use them.md index 81731f464c..3580cfb925 100644 --- a/translated/tech/20190116 Zipping files on Linux- the many variations and how to use them.md +++ b/translated/tech/20190116 Zipping files on Linux- the many variations and how to use them.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Zipping files on Linux: the many variations and how to use them) @@ -12,13 +12,13 @@ > 除了压缩和解压缩文件外,你还可以使用 zip 命令执行许多有趣的操作。这是一些其他的 zip 选项以及它们如何提供帮助。 -![](https://images.idgesg.net/images/article/2019/01/zipper-100785364-large.jpg) +![](https://img.linux.net.cn/data/attachment/album/202002/21/120507ox11ak23f9x2hxaq.jpg) 为了节省一些磁盘空间并将文件打包在一起进行归档,我们中的一些人已经在 Unix 和 Linux 系统上压缩文件数十年了。即使这样,并不是所有人都尝试过一些有趣的压缩工具的变体。因此,在本文中,我们将介绍标准的压缩和解压缩以及其他一些有趣的压缩选项。 ### 基本的 zip 命令 -首先,让我们看一下基本的 `zip` 命令。它使用了与 `gzip` 基本上相同的压缩算法,但是有一些重要的区别。一方面,`gzip` 命令仅用于压缩单个文件,而 `zip` 既可以压缩文件,也可以将多个文件结合在一起成为归档文件。另外,`gzip` 命令是“就地”压缩。换句话说,它会留下一个压缩文件,而不是原始文件。 这是工作中的 `gzip` 示例: +首先,让我们看一下基本的 `zip` 命令。它使用了与 `gzip` 基本上相同的压缩算法,但是有一些重要的区别。一方面,`gzip` 命令仅用于压缩单个文件,而 `zip` 既可以压缩文件,也可以将多个文件结合在一起成为归档文件。另外,`gzip` 命令是“就地”压缩。换句话说,它会只留下一个压缩文件,而原始文件则没有了。 这是工作中的 `gzip` 示例: ``` $ gzip onefile @@ -26,7 +26,7 @@ $ ls -l -rw-rw-r-- 1 shs shs 10514 Jan 15 13:13 onefile.gz ``` -而这是 `zip`。请注意,此命令要求为压缩存档提供名称,其中 `gzip`(执行压缩操作后)仅使用原始文件名并添加 `.gz` 扩展名。 +而下面是 `zip`。请注意,此命令要求为压缩存档提供名称,其中 `gzip`(执行压缩操作后)仅使用原始文件名并添加 `.gz` 扩展名。 ``` $ zip twofiles.zip file* @@ -61,7 +61,7 @@ $ zip mybin.zip ~/bin/* ### unzip 命令 -`unzip` 命令将从一个 zip 文件中恢复内容,并且,如你所料,原来的 zip 文件还保留在那里,而类似的`gunzip` 命令将仅保留未压缩的文件。 +`unzip` 命令将从一个 zip 文件中恢复内容,并且,如你所料,原来的 zip 文件还保留在那里,而类似的 `gunzip` 命令将仅保留未压缩的文件。 ``` $ unzip twofiles.zip @@ -272,13 +272,13 @@ $ zipnote twofiles.zip @ (zip file comment below this line) ``` -如果要添加注释,请先将 `zipnote` 命令的输出写入文件: +如果要添加注释,请先将 `zipnote` 命令的输出写入到文件: ``` $ zipnote twofiles.zip > comments ``` -接下来,编辑你刚刚创建的文件,将注释插入到 `(comment above this line)` 行上方。然后使用像这样的`zipnote` 命令添加注释: +接下来,编辑你刚刚创建的文件,将注释插入到 `(comment above this line)` 行上方。然后使用像这样的 `zipnote` 命令添加注释: ``` $ zipnote -w twofiles.zip < comments @@ -286,7 +286,7 @@ $ zipnote -w twofiles.zip < comments ### zipsplit 命令 -当归档文件太大时,可以使用 `zipsplit` 命令将一个 zip 归档文件分解为多个 zip 归档文件,这样你就可以将其中某一个文件放到小型 U 盘中。最简单的方法似乎是为每个部分的压缩文件指定最大大小,此大小必须足够大以容纳最大的包含文件。 +当归档文件太大时,可以使用 `zipsplit` 命令将一个 zip 归档文件分解为多个 zip 归档文件,这样你就可以将其中某一个文件放到小型 U 盘中。最简单的方法似乎是为每个部分的压缩文件指定最大大小,此大小必须足够大以容纳最大的所包含的文件。 ``` $ zipsplit -n 12000 twofiles.zip @@ -312,7 +312,7 @@ via: https://www.networkworld.com/article/3333640/linux/zipping-files-on-linux-t 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7a93253bf582026e0c6aa0d26e0f7e81c3c6bfbb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 Feb 2020 12:09:16 +0800 Subject: [PATCH 109/315] PUB @wxy https://linux.cn/article-11913-1.html --- ...files on Linux- the many variations and how to use them.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190116 Zipping files on Linux- the many variations and how to use them.md (99%) diff --git a/translated/tech/20190116 Zipping files on Linux- the many variations and how to use them.md b/published/20190116 Zipping files on Linux- the many variations and how to use them.md similarity index 99% rename from translated/tech/20190116 Zipping files on Linux- the many variations and how to use them.md rename to published/20190116 Zipping files on Linux- the many variations and how to use them.md index 3580cfb925..fbd32f20ca 100644 --- a/translated/tech/20190116 Zipping files on Linux- the many variations and how to use them.md +++ b/published/20190116 Zipping files on Linux- the many variations and how to use them.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11913-1.html) [#]: subject: (Zipping files on Linux: the many variations and how to use them) [#]: via: (https://www.networkworld.com/article/3333640/linux/zipping-files-on-linux-the-many-variations-and-how-to-use-them.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From 0165dbf4ccb5889060275c0fb43c8bfc82bb438e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 Feb 2020 13:29:19 +0800 Subject: [PATCH 110/315] PRF @geekpi --- ...FuryBSD- A New Desktop BSD Distribution.md | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/translated/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md b/translated/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md index f2ea410bf7..e3ab1c35cf 100644 --- a/translated/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md +++ b/translated/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Meet FuryBSD: A New Desktop BSD Distribution) @@ -10,23 +10,23 @@ 认识 FuryBSD:一个新的桌面 BSD 发行版 ====== -在过去的几个月中,出现了一些新的桌面 BSD。之前有 [HyperbolaBSD,它是 Hyperbola GNU/Linux][1]。[BSD][2] 世界中的另一个新入者是 [FuryBSD][3]。 +在过去的几个月中,出现了一些新的桌面 BSD。之前有 [HyperbolaBSD,它之前是 Hyperbola GNU/Linux][1]。[BSD][2] 世界中的另一个新入者是 [FuryBSD][3]。 -### FuryBSD:一个新的BSD发行版 +### FuryBSD:一个新的 BSD 发行版 ![][4] -从本质上讲,FuryBSD 是一个非常简单的发行版。根据[它的网站][5]:“FuryBSD 一个是基于 FreeBSD 的轻量级桌面发行版。” 它基本上是预配置了桌面环境,并预安装了多个应用的 FreeBSD。目标是在快速地你的计算机上运行基于 FreeBSD 的系统。 +从本质上讲,FuryBSD 是一个非常简单的小东西。根据[它的网站][5]:“FuryBSD 一个是基于 FreeBSD 的轻量级桌面发行版。” 它基本上是预配置了桌面环境,并预安装了多个应用的 FreeBSD。目地是快速地在你的计算机上运行基于 FreeBSD 的系统。 你可能会认为这听起来很像其他几个已有的 BSD,例如 [NomadBSD][6] 和 [GhostBSD][7]。这些 BSD 与 FuryBSD 之间的主要区别在于 FuryBSD 与现有的 FreeBSD 更加接近。例如,FuryBSD 使用 FreeBSD 安装程序,而其他发行版则用了自己的安装程序和工具。 -正如[[它的网站][8]所说:“尽管 FuryBSD 可能类似于 PC-BSD 和 TrueOS 等图形化 BSD 项目,但 FuryBSD 是由不同的团队创建的,并且采用了与 FreeBSD 紧密集成的不同方法。这样可以降低开销,并保持与上游的兼容性。”开发领导还告诉我:“FuryBSD 的一个主要重点是使其成为一种小型 Live 媒体,并带有一些辅助工具来测试硬件驱动程序。” +正如[它的网站][8]所说:“尽管 FuryBSD 可能类似于 PC-BSD 和 TrueOS 等图形化 BSD 项目,但 FuryBSD 是由不同的团队创建的,并且采用了不同与 FreeBSD 着重于紧密集成的方法。这样可以降低开销,并保持与上游的兼容性。”开发负责人还告诉我:“FuryBSD 的一个主要重点是使其成为一种小型现场版介质,并带有一些测试硬件驱动程序的辅助工具。” -当前,你可以进入 [FuryBSD 主页][3]并下载 XFCE 或 KDE LiveCD。GNOME 版本正在开发中。 +当前,你可以进入 [FuryBSD 主页][3]并下载 XFCE 或 KDE 的 LiveCD。GNOME 版本正在开发中。 ### FuryBSD 的背后是谁 -FuryBSD 的主要开发者是 [Joe Maloney][9]。Joe 多年来一直是 FreeBSD 的用户。他为 PC-BSD 等其他 BSD 项目做出了贡献。他还与 GhostBSD 的创建者 Eric Turgeon 一起重写了 GhostBSD LiveCD。在此过程中,他对 BSD 有了更好的了解,并开始形成自己如何进行发行的想法。 +FuryBSD 的主要开发者是 [Joe Maloney][9]。Joe 多年来一直是 FreeBSD 的用户。他为 PC-BSD 等其他 BSD 项目做过贡献。他还与 GhostBSD 的创建者 Eric Turgeon 一起重写了 GhostBSD LiveCD。在此过程中,他对 BSD 有了更好的了解,并开始形成自己如何做一个发行版的想法。 Joe 与其他参与 BSD 世界多年的开发者一起加入了开发,例如 Jaron Parsons、Josh Smith 和 Damian Szidiropulosz。 @@ -34,7 +34,7 @@ Joe 与其他参与 BSD 世界多年的开发者一起加入了开发,例如 J 目前,FuryBSD 仅仅是预配置的 FreeBSD。但是,开发者有一份[要改进的清单][5]。包括: -* 可靠的加载框架、第三方专有图形驱动、无线 +* 可靠的加载框架、第三方专有图形驱动、无线网络 * 进一步整理 LiveCD 体验,以使其更加友好 * 开箱即用的打印支持 * 包含更多默认应用,以提供完整的桌面体验 @@ -47,9 +47,7 @@ Joe 与其他参与 BSD 世界多年的开发者一起加入了开发,例如 J * 目录服务集成 * 安全加固 - - -开发者非常清楚地表明,他们所做的任何更改都需要大量的思考和研究。他们不会赞美某个功能,只会在它破坏一些东西时删除或者修改它。 +开发者非常清楚地表明,他们所做的任何更改都需要大量的思考和研究。他们不会改进某个功能,只会在它破坏一些东西时删除或者修改它。 ![FuryBSD desktop][11] @@ -72,7 +70,7 @@ via: https://itsfoss.com/furybsd/ 作者:[John Paul][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/) 荣誉推出 @@ -91,4 +89,4 @@ via: https://itsfoss.com/furybsd/ [11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/FuryBSDS-desktop.jpg?resize=800%2C450&ssl=1 [12]: https://forums.furybsd.org/ [13]: https://github.com/furybsd -[14]: https://reddit.com/r/linuxusersgroup \ No newline at end of file +[14]: https://reddit.com/r/linuxusersgroup From 7ca0296ce0b8f448e273e5fffae32999e7d9aa62 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 Feb 2020 13:30:54 +0800 Subject: [PATCH 111/315] PUB @geekpi https://linux.cn/article-11915-1.html --- .../20200130 Meet FuryBSD- A New Desktop BSD Distribution.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md (98%) diff --git a/translated/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md b/published/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md similarity index 98% rename from translated/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md rename to published/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md index e3ab1c35cf..611ed7c315 100644 --- a/translated/tech/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md +++ b/published/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11915-1.html) [#]: subject: (Meet FuryBSD: A New Desktop BSD Distribution) [#]: via: (https://itsfoss.com/furybsd/) [#]: author: (John Paul https://itsfoss.com/author/john/) From c01758e1f0a65b9d2dd44b9d1b1235644b0aca3c Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Fri, 21 Feb 2020 20:31:39 +0800 Subject: [PATCH 112/315] translated --- ...came the Standard for Compute Resources.md | 49 ------------------ ...came the Standard for Compute Resources.md | 50 +++++++++++++++++++ 2 files changed, 50 insertions(+), 49 deletions(-) delete mode 100644 sources/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md create mode 100644 translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md diff --git a/sources/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md b/sources/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md deleted file mode 100644 index 2ae6e33edd..0000000000 --- a/sources/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md +++ /dev/null @@ -1,49 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (heguangzhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How Kubernetes Became the Standard for Compute Resources) -[#]: via: (https://www.linux.com/articles/how-kubernetes-became-the-standard-for-compute-resources/) -[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) - -How Kubernetes Became the Standard for Compute Resources -====== - - - -2019 has been a game-changing year for the cloud-native ecosystem. There were [consolidations][1], acquisitions of powerhouses like Red Hat Docker and Pivotal, and the emergence of players like Rancher Labs and Mirantis. - -“All these consolidation and M&A in this space is an indicator of how fast the market has matured,” said Sheng Liang, co-founder and CEO of Rancher Labs, a company that offers a complete software stack for teams adopting containers. - -Traditionally, emerging technologies like Kubernetes and Docker appeal to tinkerers and mega-scalers such as Facebook and Google. There was very little interest outside of that group. However, both of these technologies experienced massive adoption at the enterprise level. Suddenly, there was a massive market with huge opportunities. Almost everyone jumped in. There were players who were bringing innovative solutions and then there were players who were trying to catch up with the rest. It became very crowded very quickly. - -It also changed the way innovation was happening. [Early adopters were usually tech-savvy companies.][2] Now, almost everyone is using it, even in areas that were not considered turf for Kubernetes. It changed the market dynamics as companies like Rancher Labs were witnessing unique use cases. - -Liang adds, “I’ve never been in a market or technology evolution that’s happened as quickly and as dynamically as Kubernetes. When we started some five years ago, it was a very crowded space. Over time, most of our peers disappeared for one reason or the other. Either they weren’t able to adjust to the change or they chose not to adjust to some of the changes.” - -In the early days of Kubernetes, the most obvious opportunity was to build Kubernetes distro and Kubernetes operations. It’s new technology. It’s known to be reasonably complex to install, upgrade, and operate. - -It all changed when Google, AWS, and Microsoft entered the market. At that point, there was a stampede of vendors rushing in to provide solutions for the platform. “As soon as cloud providers like Google decided to make Kubernetes as a service and offered it for free as loss-leader to drive infrastructure consumption, we knew that the business of actually operating and supporting Kubernetes, the upside of that would be very limited,” said Liang. - -Not everything was bad for non-Google players. Since cloud vendors removed all the complexity that came with Kubernetes by offering it as a service, it meant wider adoption of the technology, even by those who refrained from using it due to the overhead of operating it. It meant that Kubernetes would become ubiquitous and would become an industry standard. - -“Rancher Labs was one of the very few companies that saw this as an opportunity and looked one step further than everyone else. We realized that Kubernetes was going to become the new computing standard, just the way TCP/IP became the networking standard,” said Liang. - -CNCF plays a critical role in building a vibrant ecosystem around Kubernetes, creating a massive community to build, nurture and commercialize cloud-native open source technologies. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/articles/how-kubernetes-became-the-standard-for-compute-resources/ - -作者:[Swapnil Bhartiya][a] -选题:[lujun9972][b] -译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/author/swapnil/ -[b]: https://github.com/lujun9972 -[1]: https://www.cloudfoundry.org/blog/2019-is-the-year-of-consolidation-why-ibms-deal-with-red-hat-is-a-harbinger-of-things-to-come/ -[2]: https://www.packet.com/blog/open-source-season-on-the-kubernetes-highway/ diff --git a/translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md b/translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md new file mode 100644 index 0000000000..901635d6a5 --- /dev/null +++ b/translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md @@ -0,0 +1,50 @@ +[#]: collector: (lujun9972) +[#]: translator: (heguangzhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How Kubernetes Became the Standard for Compute Resources) +[#]: via: (https://www.linux.com/articles/how-kubernetes-became-the-standard-for-compute-resources/) +[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) + +Kubernetes 如何成为计算资源的标准 +====== + + + + +对于原生云生态系统来说,2019年是改变游戏规则的一年。有大的[并购][1),如 Red Hat Docker 和 Pivotal,并出现其他的玩家 如Rancher Labs 和 Mirantis 。 + +“所有这些并购",Rancher Labs (一家为采用容器的团队提供完整软件栈的公司) 的联合创始人兼首席执行官盛亮表示:“这一领域的成功表明市场成熟的速度很快。”。 + +传统上,像 Kubernetes 和 Docker 这样的新兴技术吸引着开发者和像脸书和谷歌这样的超级用户。这群人之外没什么其他的兴趣。然而,这两种技术都在企业层面得到了广泛采用。突然间,有了一个巨大的市场,有了巨大的机会。几乎每个人都跳了进去。有人带来了创新的解决方案,也有人试图赶上其他人。它很快变得非常拥挤和热闹起来。 + +它也改变了创新的方式。[早期采用者通常是精通技术的公司。][2]现在,几乎每个人都在使用它,即使是在不被认为是 Kubernetes 地盘的地方。它改变了市场动态,像 Rancher Labs 这样的公司见证了独特的用例。 + +梁补充道,“我从来没有经历过像 Kubernete 这样快速、动态的市场或这样的技术进化。当我们五年前开始的时候,这是一个非常拥挤的空间。随着时间的推移,我们大多数的同龄人因为这样或那样的原因消失了。他们要么无法适应变化,要么选择不适应某些变化。” + +在 Kubernetes 的早期,最明显的机会是建立 Kubernetes 发行版本和 Kubernetes 业务。这是新技术。众所周知,它的安装、升级和操作相当的复杂。 + +当谷歌、AWS 和微软进入市场时,一切都变了。当时,有一群供应商蜂拥而至,为平台提供解决方案。梁表示:“一旦像谷歌这样的云提供商决定将Kubernetes 作为一项服务,并亏本出售的商品免费提供,以推动基础设施消费;我们就知道,运营和支持 Kubernetes 业务的优势将非常有限了。”。 + +对非谷歌玩家来说,并非一切都不好。由于云供应商通过将它作为服务来提供,消除了 Kubernetes 带来的所有复杂性,这意味着更广泛地采用该技术,即使是那些由于运营成本而不愿使用该技术的人也是如此。这意味着 Kubernetes 将变得无处不在,并将成为一个行业标准。 + +“Rancher Labs 是极少数将此视为机遇并比其他公司看得更远的公司之一。我们意识到 Kubernetes 将成为新的计算标准,就像TCP/IP成为网络标准一样,”梁说。 + +CNCF围绕 Kubernetes 构建一个充满活力的生态系统方面发挥着至关重要的作用,创建了一个庞大的社区来构建、培育和商业化原生云开源技术。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/articles/how-kubernetes-became-the-standard-for-compute-resources/ + +作者:[Swapnil Bhartiya][a] +选题:[lujun9972][b] +译者:[heguangzhi](https://github.com/heguangzhi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/author/swapnil/ +[b]: https://github.com/lujun9972 +[1]: https://www.cloudfoundry.org/blog/2019-is-the-year-of-consolidation-why-ibms-deal-with-red-hat-is-a-harbinger-of-things-to-come/ +[2]: https://www.packet.com/blog/open-source-season-on-the-kubernetes-highway/ From 83bbcc70c422f266b31e83ceb3d2361615a27c94 Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Fri, 21 Feb 2020 20:43:59 +0800 Subject: [PATCH 113/315] Update 20200220 Using Python and GNU Octave to plot data.md --- .../tech/20200220 Using Python and GNU Octave to plot data.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200220 Using Python and GNU Octave to plot data.md b/sources/tech/20200220 Using Python and GNU Octave to plot data.md index 6c59d38eda..5c9bd4facd 100644 --- a/sources/tech/20200220 Using Python and GNU Octave to plot data.md +++ b/sources/tech/20200220 Using Python and GNU Octave to plot data.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (heguangzhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -656,7 +656,7 @@ via: https://opensource.com/article/20/2/python-gnu-octave-data-science 作者:[Cristiano L. Fontana][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[heguangzhi](https://github.com/heguangzhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8b69cb9c05ecc91716ebc95c00fccafe3d780523 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 Feb 2020 21:59:31 +0800 Subject: [PATCH 114/315] PRF @geekpi --- ...rd- Why Linux Users Going Crazy Over it.md | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/translated/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md b/translated/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md index c3f781ac47..f9b3bde050 100644 --- a/translated/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md +++ b/translated/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md @@ -1,13 +1,13 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (What is WireGuard? Why Linux Users Going Crazy Over it?) [#]: via: (https://itsfoss.com/wireguard/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -什么是 WireGuard?为什么 Linux 用户对它疯狂? +什么是 WireGuard?为什么 Linux 用户为它疯狂? ====== 从普通的 Linux 用户到 Linux 创建者 [Linus Torvalds][1],每个人都对 WireGuard 很感兴趣。什么是 WireGuard,它为何如此特别? @@ -18,7 +18,6 @@ [WireGuard][3] 是一个易于配置、快速且安全的开源 [VPN][4],它利用了最新的加密技术。目的是提供一种更快、更简单、更精简的通用 VPN,它可以轻松地在树莓派这类低端设备到高端服务器上部署。 - [IPsec][5] 和 OpenVPN 等大多数其他解决方案是几十年前开发的。安全研究人员和内核开发人员 Jason Donenfeld 意识到它们速度慢且难以正确配置和管理。 这让他创建了一个新的开源 VPN 协议和解决方案,它更加快速、安全、易于部署和管理。 @@ -31,31 +30,31 @@ WireGuard 最初是为 Linux 开发的,但现在可用于 Windows、macOS、BS 除了可以跨平台之外,WireGuard 的最大优点之一就是易于部署。配置和部署 WireGuard 就像配置和使用 SSH 一样容易。 -看看 [WireGuard 设置指南][7]。安装 WireGuard、生成公钥和私钥(像 SSH 一样),设置防火墙规则并启动服务。现在将它和 [OpenVPN 设置指南][8]进行比较。它有太多要做的了。 +看看 [WireGuard 设置指南][7]。安装 WireGuard、生成公钥和私钥(像 SSH 一样),设置防火墙规则并启动服务。现在将它和 [OpenVPN 设置指南][8]进行比较——有太多要做的了。 -WireGuard 的另一个好处是它有一个仅 4000 行代码的精简代码库。将它与 [OpenVPN][9](另一个流行的开源 VPN)的 100,000 行代码相比。显然,调试W ireGuard 更加容易。 +WireGuard 的另一个好处是它有一个仅 4000 行代码的精简代码库。将它与 [OpenVPN][9](另一个流行的开源 VPN)的 100,000 行代码相比。显然,调试 WireGuard 更加容易。 -不要小看它的简单。WireGuard 支持所有最新的加密技术,例如 [Noise协议框架][10]、[Curve25519][11]、[ChaCha20][12]、[Poly1305][13]、[BLAKE2][14]、[SipHash24][15]、[HKDF][16] 和安全受信任结构。 +不要因其简单而小看它。WireGuard 支持所有最新的加密技术,例如 [Noise 协议框架][10]、[Curve25519][11]、[ChaCha20][12]、[Poly1305][13]、[BLAKE2][14]、[SipHash24][15]、[HKDF][16] 和安全受信任结构。 由于 WireGuard 运行在[内核空间][17],因此可以高速提供安全的网络。 这些是 WireGuard 越来越受欢迎的一些原因。Linux 创造者 Linus Torvalds 非常喜欢 WireGuard,以至于将其合并到 [Linux Kernel 5.6][18] 中: -> 我能否再次声明对它的爱,并希望它能很快合并?也许代码不是完美的,但我已经忽略,与 OpenVPN 和 IPSec 的恐怖相比,这是一件艺术品。 +> 我能否再次声明对它的爱,并希望它能很快合并?也许代码不是完美的,但我不在乎,与 OpenVPN 和 IPSec 的恐怖相比,这是一件艺术品。 > > Linus Torvalds ### 如果 WireGuard 已经可用,那么将其包含在 Linux 内核中有什么大惊小怪的? -这可能会让新的 Linux 用户感到困惑。你知道可以在 Linux 上安装和配置 WireGuard VPN 服务器,但同时会看到 Linux Kernel 5.6 将包含 WireGuard 的消息。让我向您解释。 +这可能会让新的 Linux 用户感到困惑。你知道可以在 Linux 上安装和配置 WireGuard VPN 服务器,但同时也会看到 Linux Kernel 5.6 将包含 WireGuard 的消息。让我向您解释。 -目前,你可以将 WireGuard 作为[内核模块][19]安装在 Linux 中。诸如 VLC、GIMP 等常规应用安装在 Linux 内核之上(在 [用户空间][20]中),而不是内部。 +目前,你可以将 WireGuard 作为[内核模块][19]安装在 Linux 中。而诸如 VLC、GIMP 等常规应用安装在 Linux 内核之上(在 [用户空间][20]中),而不是内部。 -当将 WireGuard 安装为内核模块时,基本上是自行修改 Linux 内核并向其添加代码。从 5.6 内核开始,你无需手动添加内核模块。默认情况下它将包含在内核中。 +当将 WireGuard 安装为内核模块时,基本上需要你自行修改 Linux 内核并向其添加代码。从 5.6 内核开始,你无需手动添加内核模块。默认情况下它将包含在内核中。 在 5.6 内核中包含 WireGuard 很有可能[扩展 WireGuard 的采用,从而改变当前的 VPN 场景][21]。 -**总结** +### 总结 WireGuard 之所以受欢迎是有充分理由的。诸如 [Mullvad VPN][23] 之类的一些流行的[关注隐私的 VPN][22] 已经在使用 WireGuard,并且在不久的将来,采用率可能还会增长。 @@ -68,7 +67,7 @@ via: https://itsfoss.com/wireguard/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -96,4 +95,4 @@ via: https://itsfoss.com/wireguard/ [20]: http://www.linfo.org/user_space.html [21]: https://www.zdnet.com/article/vpns-will-change-forever-with-the-arrival-of-wireguard-into-linux/ [22]: https://itsfoss.com/best-vpn-linux/ -[23]: https://mullvad.net/en/ \ No newline at end of file +[23]: https://mullvad.net/en/ From 98721cdbd793d6f306ac77ebcf9f356d3eedcf72 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 21 Feb 2020 22:00:09 +0800 Subject: [PATCH 115/315] PUB @geekpi https://linux.cn/article-11916-1.html --- ... What is WireGuard- Why Linux Users Going Crazy Over it.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md (98%) diff --git a/translated/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md b/published/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md similarity index 98% rename from translated/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md rename to published/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md index f9b3bde050..56b1584ee1 100644 --- a/translated/tech/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md +++ b/published/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11916-1.html) [#]: subject: (What is WireGuard? Why Linux Users Going Crazy Over it?) [#]: via: (https://itsfoss.com/wireguard/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 9cdf01ba5086607010e9f498b70dab43890ab5d8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 22 Feb 2020 10:29:09 +0800 Subject: [PATCH 116/315] PRF @geekpi --- ... Modern Looking Open Source XMPP Client.md | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/translated/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md b/translated/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md index 3985d1a415..31c35e0211 100644 --- a/translated/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md +++ b/translated/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md @@ -1,32 +1,34 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Dino is a Modern Looking Open Source XMPP Client) [#]: via: (https://itsfoss.com/dino-xmpp-client/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -Dino 是一个有着现代外观的开源 XMPP 客户端 +Dino:一个有着现代外观的开源 XMPP 客户端 ====== -_**简介:Dino 是一个相对较新的开源 XMPP 客户端,它尝试提供良好的用户体验,同时鼓励注重隐私的用户使用 XMPP 发送消息。**_ +> Dino 是一个相对较新的开源 XMPP 客户端,它试图提供良好的用户体验,鼓励注重隐私的用户使用 XMPP 发送消息。 + +![](https://img.linux.net.cn/data/attachment/album/202002/22/102844mhzgzb3533xgq6d8.jpg) ### Dino:一个开源 XMPP 客户端 ![][1] -[XMPP][2] (可扩展通讯和表示协议) 是一个去中心化的网络模型,可促进即时消息传递和协作。去中心化意味着没有中央服务器可以访问你的数据。通信直接点对点。 +[XMPP][2](可扩展通讯和表示协议eXtensible Messaging Presence Protocol) 是一个去中心化的网络模型,可促进即时消息传递和协作。去中心化意味着没有中央服务器可以访问你的数据。通信直接点对点。 -我们中的一些人可能会称它为"老派"技术,可能是因为 XMPP 客户端通常有着非常糟糕的用户体验,或者仅仅是因为它需要时间来适应(或设置它)。 +我们中的一些人可能会称它为“老派”技术,可能是因为 XMPP 客户端通常用户体验非常糟糕,或者仅仅是因为它需要时间来适应(或设置它)。 -这时候 [Dino[3] 作为现代 XMPP 客户端出现了,在不损害你的隐私的情况下提供干净清爽的用户体验。 +这时候 [Dino][3] 作为现代 XMPP 客户端出现了,在不损害你的隐私的情况下提供干净清爽的用户体验。 ### 用户体验 ![][4] -Dino 有试图改善 XMPP 客户端的用户体验,但值得注意的是,它的外观和感受将在一定程度上取决于你的 Linux 发行版。你的图标主题或 Gnome 主题会让你的个人体验更好或更糟。 +Dino 试图改善 XMPP 客户端的用户体验,但值得注意的是,它的外观和感受将在一定程度上取决于你的 Linux 发行版。你的图标主题或 Gnome 主题会让你的个人体验更好或更糟。 从技术上讲,它的用户界面非常简单,易于使用。所以,我建议你看下 Ubuntu 中的[最佳图标主题][5]和 [GNOME 主题][6]来调整 Dino 的外观。 @@ -34,7 +36,7 @@ Dino 有试图改善 XMPP 客户端的用户体验,但值得注意的是,它 ![Dino Screenshot][7] -你可以期望将 Dino 用作 Slack、[Signal][8] 或 [Wire][9] 的替代产品,来用于你的业务或个人用途。 +你可以将 Dino 用作 Slack、[Signal][8] 或 [Wire][9] 的替代产品,来用于你的业务或个人用途。 它提供了消息应用所需的所有基本特性,让我们看下你可以从中得到的: @@ -47,14 +49,10 @@ Dino 有试图改善 XMPP 客户端的用户体验,但值得注意的是,它 * 支持 [OpenPGP][10] 和 [OMEMO][11] 加密 * 轻量级原生桌面应用 - - ### 在 Linux 上安装 Dino 你可能会发现它列在你的软件中心中,也可能未找到。Dino 为基于 Debian(deb)和 Fedora(rpm)的发行版提供了可用的二进制文件。 -**对于 Ubuntu:** - Dino 在 Ubuntu 的 universe 仓库中,你可以使用以下命令安装它: ``` @@ -63,15 +61,15 @@ sudo apt install dino-im 类似地,你可以在 [GitHub 分发包页面][12]上找到其他 Linux 发行版的包。 -如果你想要获取最新的,你可以在 [OpenSUSE 的软件页面][13]找到 Dino 的 **.deb** 和 .**rpm** (每日构建版)安装在 Linux 中。 +如果你想要获取最新的,你可以在 [OpenSUSE 的软件页面][13]找到 Dino 的 **.deb** 和 .**rpm** (每日构建版)安装在 Linux 中。 在任何一种情况下,前往它的 [Github 页面][14]或点击下面的链接访问官方网站。 -[下载 Dino][3] +- [下载 Dino][3] -**总结** +### 总结 -它工作良好没有出过任何问题(在我编写这篇文章时快速测试过它)。我将尝试探索更多,并希望能涵盖更多有关 XMPP 的文章来鼓励用户使用 XMPP 的客户端和服务器用于通信。 +在我编写这篇文章时快速测试过它,它工作良好,没有出过问题。我将尝试探索更多,并希望能涵盖更多有关 XMPP 的文章来鼓励用户使用 XMPP 的客户端和服务器用于通信。 你觉得 Dino 怎么样?你会推荐另一个可能好于 Dino 的开源 XMPP 客户端吗?在下面的评论中让我知道你的想法。 @@ -82,7 +80,7 @@ via: https://itsfoss.com/dino-xmpp-client/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 26d840f3c576d397266e5b443ac27fed38049cd5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 22 Feb 2020 10:29:42 +0800 Subject: [PATCH 117/315] PUB @geekpi https://linux.cn/article-11917-1.html --- ...200211 Dino is a Modern Looking Open Source XMPP Client.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200211 Dino is a Modern Looking Open Source XMPP Client.md (98%) diff --git a/translated/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md b/published/20200211 Dino is a Modern Looking Open Source XMPP Client.md similarity index 98% rename from translated/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md rename to published/20200211 Dino is a Modern Looking Open Source XMPP Client.md index 31c35e0211..82b969948c 100644 --- a/translated/tech/20200211 Dino is a Modern Looking Open Source XMPP Client.md +++ b/published/20200211 Dino is a Modern Looking Open Source XMPP Client.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11917-1.html) [#]: subject: (Dino is a Modern Looking Open Source XMPP Client) [#]: via: (https://itsfoss.com/dino-xmpp-client/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 693470bbfe5a9579bda123f9d6df6a780f9db774 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 22 Feb 2020 18:01:59 +0800 Subject: [PATCH 118/315] translate done: 20170918 Fun and Games in Emacs.md --- .../tech/20170918 Fun and Games in Emacs.md | 234 ----------------- .../tech/20170918 Fun and Games in Emacs.md | 243 ++++++++++++++++++ 2 files changed, 243 insertions(+), 234 deletions(-) delete mode 100644 sources/tech/20170918 Fun and Games in Emacs.md create mode 100644 translated/tech/20170918 Fun and Games in Emacs.md diff --git a/sources/tech/20170918 Fun and Games in Emacs.md b/sources/tech/20170918 Fun and Games in Emacs.md deleted file mode 100644 index 64123ff680..0000000000 --- a/sources/tech/20170918 Fun and Games in Emacs.md +++ /dev/null @@ -1,234 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lujun9972) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Fun and Games in Emacs) -[#]: via: (https://www.masteringemacs.org/article/fun-games-in-emacs) -[#]: author: (Mickey Petersen https://www.masteringemacs.org/about) - -Fun and Games in Emacs -====== - -It’s yet another Monday and you’re hard at work on those [TPS reports][1] for your boss, Lumbergh. Why not play Emacs’s Zork-like text adventure game to take your mind off the tedium of work? - -But seriously, yes, there are both games and quirky playthings in Emacs. Some you have probably heard of or played before. The only thing they have in common is that most of them were added a long time ago: some are rather odd inclusions (as you’ll see below) and others were clearly written by bored employees or graduate students. What they all have in common is a whimsy and a casualness that I rarely see in Emacs today. Emacs is Serious Business now in a way that it probably wasn’t back in the 1980s when some of these games were written. - -### Tower of Hanoi - -The [Tower of Hanoi][2] is an ancient mathematical puzzle game and one that is probably familiar to some of us as it is often used in Computer Science as a teaching aid because of its recursive and iterative solutions. - -![Tower of Hanoi Screenshot](https://www.masteringemacs.org/static/uploads/hanoi.png) - -In Emacs there are three commands you can run to trigger the Tower of Hanoi puzzle: M-x hanoi with a default of 3 discs; M-x hanoi-unix and M-x hanoi-unix-64 uses the unix timestamp, making a move each second in line with the clock, and with the latter pretending it uses a 64-bit clock. - -The Tower of Hanoi implementation in Emacs dates from the mid 1980s — an awful long time ago indeed. There are a few Customize options (M-x customize-group RET hanoi RET) such as enabling colorized discs. And when you exit the Hanoi buffer or type a character you are treated to a sarcastic goodbye message (see above.) - -### 5x5 - -![5x5 game grid](https://www.masteringemacs.org/static/uploads/5x5.png) - The 5x5 game is a logic puzzle: you are given a 5x5 grid with a central cross already filled-in; your goal is to fill all the cells by toggling them on and off in the right order to win. It’s not as easy as it sounds! - -To play, type M-x 5x5, and with an optional digit argument you can change the size of the grid. What makes this game interesting is its rather complex ability to suggest the next move and attempt to solve the game grid. It uses Emacs’s very own, and very cool, symbolic RPN calculator M-x calc (and in [Fun with Emacs Calc][3] I use it to solve a simple problem.) - -So what I like about this game is that it comes with a very complex solver – really, you should read the source code with M-x find-library RET 5x5 – and a “cracker” that attempts to brute force solutions to the game. - -Try creating a bigger game grid, such as M-10 M-x 5x5, and then run one of the crack commands below. The crackers will attempt to iterate their way to the best solution. This runs in real time and is fun to watch: - - - -`M-x 5x5-crack-mutating-best` - Attempt to crack 5x5 by mutating the best solution. - -`M-x 5x5-crack-mutating-current` - Attempt to crack 5x5 by mutating the current solution. - -`M-x 5x5-crack-randomly` - Attempt to crack 5x5 using random solutions. - -`M-x 5x5-crack-xor-mutate` - Attempt to crack 5x5 by xoring the current and best solution. - -### Text Animation - -You can display a fancy birthday present animation by running M-x animate-birthday-present and giving it your name. It looks rather cool! - -![xkcd](https://imgs.xkcd.com/comics/real_programmers.png) - -The animate package is also used by M-x butterfly command, a command added to Emacs as an homage to the [XKCD][4] strip above. Of course the Emacs command in the strip is teeechnically not valid but the humor more than makes up for it. - -### Blackbox - -The objective of this game I am going to quote literally: - -> The object of the game is to find four hidden balls by shooting rays into the black box. There are four possibilities: 1) the ray will pass thru the box undisturbed, 2) it will hit a ball and be absorbed, 3) it will be deflected and exit the box, or 4) be deflected immediately, not even being allowed entry into the box. - -So, it’s a bit like the [Battleship][5] most of us played as kids but… for people with advanced degrees in physics? - -It’s another game that was added back in the 1980s. I suggest you read the extensive documentation on how to play by typing C-h f blackbox. - -### Bubbles - -![Bubbles game](https://www.masteringemacs.org/static/uploads/bubbles.png) - -The M-x bubbles game is rather simple: you must clear out as many “bubbles” as you can in as few moves as possible. When you remove bubbles the other bubbles drop and stick together. It’s a fun game that, as an added bonus, comes with graphics if you use Emacs’s GUI. It also works with your mouse. - -You can configure the difficulty of the game by calling M-x bubbles-set-game- where is one of: easy, medium, difficult, hard, or userdefined. Furthermore, you can alter the graphics, grid size and colors using Customize: M-x customize-group bubbles. - -For its simplicity and fun factor, this ranks as one of my favorite games in Emacs. - -### Fortune & Cookie - -I like the fortune command. Snarky, unhelpful and often sarcastic “advice” mixed in with literature and riddles brightens up my day whenever I launch a new shell. - -Rather confusingly there are two packages in Emacs that does more-or-less the same thing: fortune and cookie1. The former is geared towards putting fortune cookie messages in email signatures and the latter is just a simple reader for the fortune format. - -Anyway, to use Emacs’s cookie1 package you must first tell it where to find the file by customizing the variable cookie-file with customize-option RET cookie RET. - -If you’re on Ubuntu you will have to install the fortune package first. The files are found in the /usr/share/games/fortunes/ directory. - -You can then call M-x cookie or, should you want to do this, find all matching cookies with M-x cookie-apropos. - -### Decipher - -This package perfectly captures the utilitarian nature of Emacs: it’s a package to help you break simple substitution ciphers (like cryptogram puzzles) using a helpful user interface. You just know that – more than twenty years ago – someone really had a dire need to break a lot of basic ciphers. It’s little things like this module that makes me overjoyed to use Emacs: a module of scant importance to all but a few people and, yet, should you need it – there it is. - -So how do you use it then? Well, let’s consider the “rot13” cipher: rotating characters by 13 places in a 26-character alphabet. It’s an easy thing to try out in Emacs with M-x ielm, Emacs’s REPL for [Evaluating Elisp][6]: - -``` -*** Welcome to IELM *** Type (describe-mode) for help. -ELISP> (rot13 "Hello, World") -"Uryyb, Jbeyq" -ELISP> (rot13 "Uryyb, Jbeyq") -"Hello, World" -ELISP> -``` - -So how can the decipher module help us here? Well, create a new buffer test-cipher and type in your cipher text (in my case Uryyb, Jbeyq) - -![cipher](https://www.masteringemacs.org/static/uploads/cipher.png) - -You’re now presented with a rather complex interface. You can now place the point on any of the characters in the ciphertext on the purple line and guess what the character might be: Emacs will update the rest of the plaintext guess with your choices and tell you how the characters in the alphabet have been allocated thus far. - -You can then start winnowing down the options using various helper commands to help infer which cipher characters might correspond to which plaintext character: - - - -`D` - Shows a list of digrams (two-character combinations from the cipher) and their frequency - -`F` - Shows the frequency of each ciphertext letter - -`N` - Shows adjacency of characters. I am not entirely sure how this works. - -`M` and `R` - Save and restore a checkpoint, allowing you to branch your work and explore different ways of cracking the cipher. - -All in all, for such an esoteric task, this package is rather impressive! If you regularly solve cryptograms maybe this package can help? - -### Doctor - -![doctor](https://www.masteringemacs.org/static/uploads/doctor.png) - -Ah, the Emacs doctor. Based on the original [ELIZA][7] the “Doctor” tries to psychoanalyze what you say and attempts to repeat the question back to you. Rather fun, for a few minutes, and one of the more famous Emacs oddities. You can run it with M-x doctor. - -### Dunnet - -Emacs’s very own Zork-like text adventure game. To play it, type M-x dunnet. It’s rather good, if short, but it’s another rather famous Emacs game that too few have actually played through to the end. - -If you find yourself with time to kill between your TPS reports then it’s a great game with a built-in “boss screen” as it’s text-only. - -Oh, and, don’t try to eat the CPU card :) - -### Gomoku - -![gomoku](https://www.masteringemacs.org/static/uploads/gomoku.png) - -Another game written in the 1980s. You have to connect 5 squares, tic-tac-toe style. You can play against Emacs with M-x gomoku. The game also supports the mouse, which is rather handy. You can customize the group gomoku to adjust the size of the grid. - -### Game of Life - -[Conway’s Game of Life][8] is a famous example of cellular automata. The Emacs version comes with a handful of starting patterns that you can (programmatically with elisp) alter by adjusting the life-patterns variable. - -You can trigger a game of life with M-x life. The fact that the whole thing, display code, comments and all, come in at less than 300 characters is also rather impressive. - -### Pong, Snake and Tetris - -![tetris](https://www.masteringemacs.org/static/uploads/tetris.png) - -These classic games are all implemented using the Emacs package gamegrid, a generic framework for building grid-based games like Tetris and Snake. The great thing about the gamegrid package is its compatibility with both graphical and terminal Emacs: if you run Emacs in a GUI you get fancy graphics; if you don’t, you get simple ASCII art. - -You can run the games by typing M-x pong, M-x snake, or M-x tetris. - -The Tetris game in particular is rather faithfully implemented, having both gradual speed increase and the ability to slide blocks into place. And given you have the code to it, you can finally remove that annoying Z-shaped piece no one likes! - -### Solitaire - -![solitaire image](https://www.masteringemacs.org/static/uploads/solitaire.png) - -This is not the card game, unfortunately. But a peg-based game where you have to end up with just one stone on the board, by taking a stone (the o) and “jumping” over an adjacent stone into the hole (the .), removing the stone you jumped over in the process. Rinse and repeat until the board is empty. - -There is a handy solver built in called M-x solitaire-solve if you get stuck. - -### Zone - -Another of my favorites. This time’s it’s a screensaver – or rather, a series of screensavers. - -Type M-x zone and watch what happens to your screen! - -You can configure a screensaver idle time by running M-x zone-when-idle (or calling it from elisp) with an idle time in seconds. You can turn it off with M-x zone-leave-me-alone. - -This one’s guaranteed to make your coworkers freak out if it kicks off while they are looking. - -### Multiplication Puzzle - -![mpuz](https://www.masteringemacs.org/static/uploads/mpuz.png) - -This is another brain-twisting puzzle game. When you run M-x mpuz you are given a multiplication puzzle where you have to replace the letters with numbers and ensure the numbers add (multiply?) up. - -You can run M-x mpuz-show-solution to solve the puzzle if you get stuck. - -### Miscellaneous - -There are more, but they’re not the most useful or interesting: - -* You can translate a region into morse code with M-x morse-region and M-x unmorse-region. - -* The Dissociated Press is a very simple command that applies something like a random walk markov-chain generator to a body of text in a buffer and generates nonsensical text from the source body. Try it with M-x dissociated-press. - -* The Gamegrid package is a generic framework for building grid-based games. So far only Tetris, Pong and Snake use it. It’s called gamegrid. - -* The gametree package is a complex way of notating and tracking chess games played via email. - -* The M-x spook command inserts random words (usually into emails) designed to confuse/overload the “NSA trunk trawler” – and keep in mind this module dates from the 1980s and 1990s – with various words the spooks are supposedly listening for. Of course, even ten years ago that would’ve seemed awfully paranoid and quaint but not so much any more… - -### Conclusion - -I love the games and playthings that ship with Emacs. A lot of them date from, well, let’s just call a different era: an era where whimsy was allowed or perhaps even encouraged. Some are known classics (like Tetris and Tower of Hanoi) and some of the others are fun variations on classics (like blackbox) — and yet I love that they ship with Emacs after all these years. I wonder if any of these would make it into Emacs’s codebase today; well, they probably wouldn’t — they’d be relegated to the package manager where, in a clean and sterile world, they no doubt belong. - -There’s a mandate in Emacs to move things not essential to the Emacs experience to ELPA, the package manager. I mean, as a developer myself, that does make sense, but… surely for every package removed and exiled to ELPA we chip away the essence of what defines Emacs? - --------------------------------------------------------------------------------- - - -via: https://www.masteringemacs.org/article/fun-games-in-emacs - -作者:[Mickey Petersen][a] -选题:[lujun9972][b] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.masteringemacs.org/about -[b]:https://github.com/lujun9972 -[1]:https://en.wikipedia.org/wiki/Office_Space -[2]:https://en.wikipedia.org/wiki/Tower_of_Hanoi -[3]:https://www.masteringemacs.org/article/fun-emacs-calc -[4]:http://www.xkcd.com -[5]:https://en.wikipedia.org/wiki/Battleship_(game) -[6]:https://www.masteringemacs.org/article/evaluating-elisp-emacs -[7]:https://en.wikipedia.org/wiki/ELIZA -[8]:https://en.wikipedia.org/wiki/Conway's_Game_of_Life diff --git a/translated/tech/20170918 Fun and Games in Emacs.md b/translated/tech/20170918 Fun and Games in Emacs.md new file mode 100644 index 0000000000..b4baee63b4 --- /dev/null +++ b/translated/tech/20170918 Fun and Games in Emacs.md @@ -0,0 +1,243 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fun and Games in Emacs) +[#]: via: (https://www.masteringemacs.org/article/fun-games-in-emacs) +[#]: author: (Mickey Petersen https://www.masteringemacs.org/about) + +Emacs 中的游戏与乐趣 +====== + +又是周一,你正在为你的老板 Lumbergh 努力倒腾那些 [无聊之极的文档 ][1]。为什么不玩玩 Emacs 中类似 zork 的文本冒险游戏来让你的大脑从单调的工作中解脱出来呢? + +但说真的,Emacs 中既有游戏,也有古怪的玩物。有些你可能有所耳闻。这些玩意唯一的共同点就是,它们大多是很久以前就添加到 Emacs 中的:有些东西真的是相当古怪(如您将在下面看到的),而另一些则显然是由无聊的员工或毕业生编写的。 +它们中都带着一种奇思妙想和随意性,这在今天的 Emacs 中很少见。 +Emacs 现在变得十分严肃,在某种程度上,它已经与 20 世纪 80 年代那些玩意被编写出来的时候大不一样。 + + +### 汉诺塔 + +[汉诺塔 ][2] 是一款古老的数学解密游戏,有些人可能对它很熟悉,因为它的递归和迭代解决方案经常被用与计算机科学教学辅助。 + + +![Tower of Hanoi Screenshot](https://www.masteringemacs.org/static/uploads/hanoi.png) + +Emacs 中有三个命令可以运行汉诺塔:`M-x hanoi` 默认为 3 个碟子; `M-x hanoi-unix` 和 `M-x hanoi-unix-64` 使用 unix 时间戳的位数 (32bit 或 64bit) 作为默认盘子的个数,并且每秒钟自动移动一次,两者不同之处在于后者假装使用 64 位时钟(因此有 64 个碟子)。 + +Emacs 中汉诺塔的实现可以追溯到 20 世纪 80 年代中期——确实是久得可怕。它有一些自定义选项 (`M-x customize-group RET hanoi RET`),如启用彩色光盘等。 +当你离开汉诺塔缓冲区或输入一个字符,你会收到一个讽刺的告别信息(见上文)。 + +### 5x5 + +![5x5 game grid](https://www.masteringemacs.org/static/uploads/5x5.png) + + +5x5 的游戏是一个逻辑解密游戏:你有一个 5x5 的网格,中间的十字被填满;你的目标是通过按正确的顺序切换它们的空满状态来填充所有的单元格,从而获得胜利。这并不像听起来那么容易! + +输入 `M-x 5x5` 就可以开始玩了,使用可选的数字参数可以改变网格的大小。 +这款游戏的有趣之处在于它能向你建议下一步行动并尝试解决该游戏网格。它用到了了 Emacs 自己的一款非常酷的符号 RPN 计算器 `M-x calc` (在 [Fun with Emacs Calc][3] 这篇文章中,我使用它来解决了一个简单的问题。) + +所以我喜欢这个游戏的原因是它提供了一个非常复杂的解决器——真的,你应该通过 `M-x find-library RET 5x5` 来阅读其源代码——和一个试图通过强力破解游戏的“破解器”。 + +创建一个更大的游戏网格,例如输入 `M-10 M-x 5x5`,然后运行下面某个 `crack` 命令。破坏者将尝试通过迭代获得最佳解决方案。它会实时运行该游戏,观看起来非常有趣: + +- `M-x 5x5-crack-mutating-best`: 试图通过修改最佳解决方案来破解 5x5。 + +- `M-x 5x5-crack-mutating-current`: 试图通过修改当前解决方案来破解 5x5。 + +- `M-x 5x5-crack-random`: 尝试使用随机方案解破解 5x5。 + +- `M-x 5x5-crack-xor-mutate`: 尝试通过将当前方案和最佳方案进行异或运算来破解 5x5。 + +### 文本动画 + +您可以通过运行 `M-x animation-birthday-present` 并给出名字来显示一个奇特的生日礼物动画。它看起来很酷! + +![xkcd](https://imgs.xkcd.com/comics/real_programmers.png) + +`M-x butterfly` 命令中也使用了 `animate` 包,butterfly 命令被添加到 Emacs 中,以向上面的 [XKCD][4] 漫画致敬。当然,漫画中的 Emacs 命令在技术上是无效的,但它的幽默足以弥补这一点。 + +### 黑箱 + +我将逐字引用这款游戏的目标: + +> 游戏的目标是通过向黑盒子发射光线来找到四个隐藏的球。有四种可能: +> 1) 射线将通过盒子不受干扰, +> 2) 它将击中一个球并被吸收, +> 3) 它将偏转并退出盒子,或 +> 4) 立即偏转,甚至不被允许进入盒子。 + +所以,这有点像我们小时候玩的 [Battleship][5],但是……是专为物理专业高学历的人准备的? + +这是另一款添加于 20 世纪 80 年代的游戏。我建议你输入 `C-h f blackbox` 来阅读玩法说明(文档巨大)。 + + +### 泡泡 + +![Bubbles game](https://www.masteringemacs.org/static/uploads/bubbles.png) + + +`M-x bubble` 游戏相当简单:你必须用尽可能少移动清除尽可能多的“泡泡”。当你移除气泡时,其他气泡会掉落并粘在一起。 +这是一款有趣的游戏,此外如果你使用 Emacs 的图形用户界面,它还支持图像现实。而且它还支持鼠标。 + +您可以通过调用 `M-x bubbles-set-game-< 难度>` 来设置难度,其中嗯 `<难度>` 可以是其中之一:`easy`,`medium=,=difficult`,`hard`,或 `userdefined`。 +此外,您可以使用:`M-x custom-group bubbles` 来更改图形、网格大小和颜色。 + +由于它即简单又有趣,这是 Emacs 中我最喜欢的游戏之一。 + +### 幸运饼干 + +我喜欢 `fortune` 命令。每当我启动一个新 shell 时,就会有刻薄、无益、常常带有讽刺意味的“建议(以及文学摘要,谜语)”就会点亮我的一天。 + +令人困惑的是,Emacs 中有两个包做了类似的事情:`fortune` 和 `cookie`。前者主要用于在电子邮件签名中添加幸运饼干消息,而后者只是一个简单的 fortune 格式阅读器。 + +不管怎样,使用 Emacs 的 `cookie` 包前,你首先需要通过 `customize-option RET cookie RET` 来自定义变量 `cookie-file` 告诉它从哪找到 fortune 文件。 + +如果你的操作系统是 Ubuntu,那么你先安装 `fortune` 软件包,然后就能在 `/usr/share/games/fortune/` 目录中找到这些文件了。 + +之后你就可以调用 `M-x cookie` 随机显示 fortune 内容,或者,如果你想的话,也可以调用 `M-x cookie-apropos` 查找所有匹配的 cookie。 + +### Decipher + +这个包完美地抓住了 Emacs 的实用本质:这个包为你破解简单的替换密码(如密码谜题)提供了一个很有用的界面。 +你知道,二十多年前,某人确实迫切需要破解很多基础密码。正是像这个模块这样的小玩意让我非常高兴地用起 Emacs 来:这个模块只对少数人有用,但是,如果你突然需要它了,那么它就在那里等着你。 + +那么如何使用它呢?让我们假设使用 “rot13” 密码:在 26 个字符的字母表中,将字符旋转 13 个位置。 +通过 `M-x ielm` (Emacs 用于 [运行 Elisp][6] 的 REPL 环境)可以很容易在 Emacs 中进行尝试: + + +``` +*** Welcome to IELM *** Type (describe-mode) for help. +ELISP> (rot13 "Hello, World") +"Uryyb, Jbeyq" +ELISP> (rot13 "Uryyb, Jbeyq") +"Hello, World" +ELISP> +``` + +那么,decipher 模块又是如何帮助我们的呢?让我们创建一个新的缓冲区 `test-cipher` 并输入您的密码文本(在我的例子中是 `Uryyb,Jbeyq`) + +![cipher](https://www.masteringemacs.org/static/uploads/cipher.png) + +您现在面对的是一个相当复杂的接口。现在把光标放在紫行秘文中的任意字符上,猜猜这个字符可能是什么:Emacs 将根据你的选择更新其他明文的猜测结果,并告诉你字母表中的字符是如何分配的。 + +您现在可以下面各种 helper 命令来帮助推断密码字符可能对应的明文字符: + +- **`D`:** 显示数字符号(密码中两个字符组合)及其频率的列表 + +- **`F`:** 表示每个密文字母的频率 + +- **`N`:** 显示字符的邻接信息。我不确定这是干啥的。 + +- **`M` 和 `R`:** 保存和恢复一个检查点,允许你对工作进行分支以探索破解密码的不同方法。 + +总而言之,对于这样一个深奥的任务,这个包是相当令人印象深刻的!如果你经常破解密码,也许这个程序包能帮上忙? + +### 医生 + +![doctor](https://www.masteringemacs.org/static/uploads/doctor.png) + +啊,Emacs 医生。其基于最初的 [ELIZA][7],“ 医生”试图对你说的话进行心理分析,并试图把问题复述给你。体验它的那几分钟相当有趣,它也是 Emacs 中最著名的古怪玩意之一。你可以使用 `M-x doctor` 来运行它。 + +### Dunnet + +Emacs 自己特有的类 Zork 文本冒险游戏。输入 `M-x dunnet` 就能玩了。 +这是一款相当不错的游戏,虽然时间不长,但非常著名,很少有人真正玩到最后。 + +如果你发现自己能在无聊的文档工作之间空出时间来,那么这是一个超级棒的游戏,内置“老板屏幕”,因为它是纯文本的。 + +哦,还有,不要吃掉那块 CPU 卡 :) + +### 五子棋 + +![gomoku](https://www.masteringemacs.org/static/uploads/gomoku.png) + +另一款写于 20 世纪 80 年代的游戏。你必须连接 5 个方块,井字游戏风格。你可以运行 `M-x gomoku` 来与 Emacs 对抗。游戏还支持鼠标,非常方便。您也可以自定义 `gomoku` 组来调整网格的大小。 + +### 生命游戏 + +[Conway 的生命游戏 ][8] 是细胞自动机的一个著名例子。Emacs 版本提供了一些启动模式,你可以(通过 elisp 编程)通过调整 `life-patterns` 变量来更改这些模式。 + +你可以用 `M-x life` 触发生命游戏。事实上,所有的东西,包括代码,注释和所有的东西,总共不到 300 行,这也让人印象深刻。 + +### 乒乓,贪吃蛇和俄罗斯方块 + +![tetris](https://www.masteringemacs.org/static/uploads/tetris.png) + +这些经典游戏都是使用 Emacs 包 `gamegrid` 实现的,这是一个用于构建网格游戏(如俄罗斯方块和贪吃蛇)的通用框架。gamegrid 包的伟大之处在于它同时兼容图形化和终端 Emacs: 如果你在 GUI 中运行 Emacs,你会得到精美的图形;如果你没有,你得到简单的 ASCII 艺术。 + +你可以通过输入 `M-x pong`,`M-x snake`,`M-x tetris` 来运行这些游戏。 + +特别是俄罗斯方块游戏实现的非常到位,会逐渐增加速度并且能够滑块。而且既然你已经有了源代码,你完全可以移除那个讨厌的 Z 形块,没人喜欢它! + +### Solitaire + +![solitaire image](https://www.masteringemacs.org/static/uploads/solitaire.png) + +可惜,这不是纸牌游戏,而是一个基于 peg 的游戏,你可以选择一块石头 (`o`) 并“跳过”相邻的石头进入洞中(`。`),并在这个过程中去掉你跳过的那些石头,最终只能在棋盘上留下一块石头, +重复该过程直到板子被请空(只保留一个石头)。 + +如果你卡住了,有一个内置的解题器名为 `M-x solitire-solve`。 + +### Zone + +我的另一个最爱。这是一个屏幕保护程序——或者更确切地说,是一系列的屏幕保护程序。 + +输入 `M-x zone`,然后看看屏幕上发生了什么! + +您可以通过运行 `M-x zone-when-idle` (或从 elisp 调用它)来配置屏幕保护程序的空闲时间,时间以秒为单位。 +您也可以通过 `M-x zone-leave-me-alone` 来关闭它。 + +如果它在你的同事看着的时候被启动,你的同事肯定会抓狂的。 + +### 乘法解谜 + +![mpuz](https://www.masteringemacs.org/static/uploads/mpuz.png) + +这是另一个脑筋急转弯的益智游戏。当您运行 `M-x mpuz` 时,将看到一个乘法解谜题,你必须将字母替换为对应的数字,并确保数字相加(相乘?)符合结果 + +如果遇到难题,可以运行 `M-x mpuz-show-solution` 来解决。 + +### 杂项 + +还有更多好玩的东西,但它们就不如刚才那些那么好玩好用了: + +- 你可以通过 `M-x morse-region` 和 `M-x unmorse-region` 将一个区域翻译成莫尔斯电码。 +- Dissociated Press 是一个非常简单的命令,它将类似随机游动 markov 链生成器应用到 buffer 中的文本中,并以此生成无意义的文本。试一下 `M-x dissociated-press`。 +- Gamegrid 包是构建网格游戏的通用框架。到目前为止,只有俄罗斯方块,乒乓和贪吃蛇使用了它。其名为 `gamegrid`。 +- `gametree` 软件包是一个通过电子邮件记录和跟踪国际象棋游戏的复杂方法。 +- `M-x spook` 命令插入随机单词(通常是在电子邮件中),目的是混淆/超载 “NSA trukn trawler”—— 记住,这个模块可以追溯到 20 世纪 80 年代和 90 年代——那时应该有间谍们在监听各种单词。当然,即使是在十年前,这样做也会显得非常偏执和古怪,不过现在看来已经不那么奇怪了…… + + +### 结论 + +我喜欢 Emacs 附带的游戏和玩具。它们大多来自于,嗯,我们姑且称之为一个不同的时代:一个允许或甚至鼓励奇思妙想的时代。 +有些玩意非常经典(如俄罗斯方块和汉诺塔),有些对经典游戏进行了有趣的变种(如黑盒)——但我很高兴这么多年后他们依然在 Emacs 中。 +我想知道时至今日,这些玩意是否还会纳入 Emacs 的代码库中;嗯,它们很可能不会——它们将被归入包管理仓库中,而在这个干净而贫瘠的世界中,它们无疑属于包管理仓库。 + +Emacs 要求将对 Emacs 体验不重要的内容转移到包管理仓库 ELPA 中。我的意思是,作为一个开发者,这是有道理的,但是……对于每一个被移出并流放到 ELPA 的包,我们都在蚕食 Emacs 的精髓。 + +-------------------------------------------------------------------------------- + + +via: https://www.masteringemacs.org/article/fun-games-in-emacs + +作者:[Mickey Petersen][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.masteringemacs.org/about +[b]:https://github.com/lujun9972 +[1]:https://en.wikipedia.org/wiki/Office_Space +[2]:https://en.wikipedia.org/wiki/Tower_of_Hanoi +[3]:https://www.masteringemacs.org/article/fun-emacs-calc +[4]:http://www.xkcd.com +[5]:https://en.wikipedia.org/wiki/Battleship_(game) +[6]:https://www.masteringemacs.org/article/evaluating-elisp-emacs +[7]:https://en.wikipedia.org/wiki/ELIZA +[8]:https://en.wikipedia.org/wiki/Conway's_Game_of_Life From e489106ae61814084bd69d6f40b31b9fb975f480 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 22 Feb 2020 19:39:37 +0800 Subject: [PATCH 119/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190114=20Some?= =?UTF-8?q?=20Advice=20for=20How=20to=20Make=20Emacs=20Tetris=20Harder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md --- ...ice for How to Make Emacs Tetris Harder.md | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 sources/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md diff --git a/sources/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md b/sources/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md new file mode 100644 index 0000000000..829dd3703f --- /dev/null +++ b/sources/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md @@ -0,0 +1,157 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Some Advice for How to Make Emacs Tetris Harder) +[#]: via: (https://nickdrozd.github.io/2019/01/14/tetris.html) +[#]: author: (nickdrozd https://nickdrozd.github.io) + +Some Advice for How to Make Emacs Tetris Harder +====== + +Did you know that Emacs comes bundled with an implementation of Tetris? Just hit M-x tetris and there it is: + +![img](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-normal.png) + +This is often mentioned by Emacs advocates in text editor discussions. “Yeah, but can that other editor run Tetris?” I wonder, is that supposed to convince anyone that Emacs is superior? Like, why would anyone care that they could play games in their text editor? “Yeah, but can that other vacuum play mp3s?” + +That said, Tetris is always fun. Like everything in Emacs, the source code is open for easy inspection and modifcation, so it’s possible to make it even more fun. And by more fun, I mean harder. + +One of the simplest ways to make the game harder is to get rid of the next-block preview. No more sitting that S/Z block in a precarious position knowing that you can fill in the space with the next piece – you have to chance it and hope for the best. Here’s what it looks like with no preview (as you can see, without the preview I made some choices that turned out to have dire consequences): + +![img](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-no-preview.png) + +The preview box is set with a function called tetris-draw-next-shape[1][2]: + +``` +(defun tetris-draw-next-shape () + (dotimes (x 4) + (dotimes (y 4) + (gamegrid-set-cell (+ tetris-next-x x) + (+ tetris-next-y y) + tetris-blank))) + (dotimes (i 4) + (let ((tetris-shape tetris-next-shape) + (tetris-rot 0)) + (gamegrid-set-cell (+ tetris-next-x + (aref (tetris-get-shape-cell i) 0)) + (+ tetris-next-y + (aref (tetris-get-shape-cell i) 1)) + tetris-shape)))) +``` + +First, we’ll introduce a flag to allow configuring next-preview[2][3]: + +``` +(defvar tetris-preview-next-shape nil + "When non-nil, show the next block the preview box.") +``` + +Now the question is, how can we make tetris-draw-next-shape obey this flag? The obvious way would be to redefine it: + +``` +(defun tetris-draw-next-shape () + (when tetris-preview-next-shape + ;; existing tetris-draw-next-shape logic + )) +``` + +This is not an ideal solution. There will be two definitions of the same function floating around, which is confusing, and we’ll have to maintain our modified definition in case the upstream version changes. + +A better approach is to use advice. Emacs advice is like a Python decorator, but even more flexible, since advice can be added to a function from anywhere. This means that we can modify the function without disturbing the original source file at all. + +There are a lot of different ways to use Emacs advice ([check the manual][4]), but for now we’ll just stick with the advice-add function with the :around flag. The advising function takes the original function as an argument, and it might or might not execute it. In this case, we’ll say that the original should be executed only if the preview flag is non-nil: + +``` +(defun tetris-maybe-draw-next-shape (tetris-draw-next-shape) + (when tetris-preview-next-shape + (funcall tetris-draw-next-shape))) + +(advice-add 'tetris-draw-next-shape :around #'tetris-maybe-draw-next-shape) +``` + +This code will modify the behavior of tetris-draw-next-shape, but it can be stored in your config files, safely away from the actual Tetris code. + +Getting rid of the preview box is a simple change. A more drastic change is to make it so that blocks randomly stop in the air: + +![img](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-air.png) + +In that picture, the red I and green T pieces are not falling, they’re set in place. This can make the game almost unplayably hard, but it’s easy to implement. + +As before, we’ll first define a flag: + +``` +(defvar tetris-stop-midair t + "If non-nil, pieces will sometimes stop in the air.") +``` + +Now, the way Emacs Tetris works is something like this. The active piece has x- and y-coordinates. On each clock tick, the y-coordinate is incremented (the piece moves down one row), and then a check is made for collisions. If a collision is detected, the piece is backed out (its y-coordinate is decremented) and set in place. In order to make a piece stop in the air, all we have to do is hack the detection function, tetris-test-shape. + +It doesn’t matter what this function does internally – what matters is that it’s a function of no arguments that returns a boolean value. We need it to return true whenever it normally would (otherwise we risk weird collisions) but also at other times. I’m sure there are a variety of ways this could be done, but here is what I came up with: + +``` +(defun tetris-test-shape-random (tetris-test-shape) + (or (and + tetris-stop-midair + ;; Don't stop on the first shape. + (< 1 tetris-n-shapes ) + ;; Stop every INTERVAL pieces. + (let ((interval 7)) + (zerop (mod tetris-n-shapes interval))) + ;; Don't stop too early (it makes the game unplayable). + (let ((upper-limit 8)) + (< upper-limit tetris-pos-y)) + ;; Don't stop at the same place every time. + (zerop (mod (random 7) 10))) + (funcall tetris-test-shape))) + +(advice-add 'tetris-test-shape :around #'tetris-test-shape-random) +``` + +The hardcoded parameters here were chosen to make the game harder but still playable. I was drunk on an airplane when I decided on them though, so they might need some further tweaking. + +By the way, according to my tetris-scores file, my top score is + +``` +01389 Wed Dec 5 15:32:19 2018 +``` + +The scores in that file are listed up to five digits by default, so that doesn’t seem very good. + +Exercises for the reader + +1. Using advice, modify Emacs Tetris so that it flashes the messsage “OH SHIT” under the scoreboard every time the block moves down. Make the size of the message proportional to the height of the block stack (when there are no blocks, the message should be small or nonexistent, and when the highest block is close to the ceiling, the message should be large). + +2. The version of tetris-test-shape-random given here has every seventh piece stop midair. A player could potentially figure out the interval and use it to their advantage. Modify it to make the interval random in some reasonable range (say, every five to ten pieces). + +3. For a different take on advising Tetris, try out [autotetris-mode][1]. + +4. Come up with an interesting way to mess with the piece-rotation mechanics and then implement it with advice. + +Footnotes +============================================================ + +[1][5] Emacs has just one big global namespace, so function and variable names are typically prefixed with their package name in order to avoid collisions. + +[2][6] A lot of people will tell you that you shouldn’t use an existing namespace prefix and that you should reserve a namespace prefix for anything you define yourself, e.g. my/tetris-preview-next-shape. This is ugly and usually pointless, so I don’t do it. + +-------------------------------------------------------------------------------- + +via: https://nickdrozd.github.io/2019/01/14/tetris.html + +作者:[nickdrozd][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://nickdrozd.github.io +[b]: https://github.com/lujun9972 +[1]: https://nullprogram.com/blog/2014/10/19/ +[2]: https://nickdrozd.github.io/2019/01/14/tetris.html#fn.1 +[3]: https://nickdrozd.github.io/2019/01/14/tetris.html#fn.2 +[4]: https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html +[5]: https://nickdrozd.github.io/2019/01/14/tetris.html#fnr.1 +[6]: https://nickdrozd.github.io/2019/01/14/tetris.html#fnr.2 From f0b8a0dda256494e894a094a48dfd79fd133bc39 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 22 Feb 2020 20:06:47 +0800 Subject: [PATCH 120/315] translate done: 20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md --- ...romium - Firefox sessions with org-mode.md | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) rename {sources => translated}/tech/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md (57%) diff --git a/sources/tech/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md b/translated/tech/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md similarity index 57% rename from sources/tech/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md rename to translated/tech/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md index 7b71e21ff3..7c1bf841df 100644 --- a/sources/tech/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md +++ b/translated/tech/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md @@ -7,16 +7,16 @@ [#]: via: (https://acidwords.com/posts/2019-12-04-handle-chromium-and-firefox-sessions-with-org-mode.html) [#]: author: (Sanel Z https://acidwords.com/) -Handle Chromium & Firefox sessions with org-mode +通过 org-mode 管理 Chromium 和 Firefox 会话 ====== -I was big fan of [Session Manager][1], small addon for Chrome and Chromium that will save all open tabs, assign the name to session and, when is needed, restore it. +我是 [Session Manager][1] 的大粉丝,它是 Chrome 和 Chromium 的小插件,可以保存所有打开的选项卡,为会话命名,并在需要时恢复会话。 -Very useful, especially if you are like me, switching between multiple "mind sessions" during the day - research, development or maybe news reading. Or simply, you'd like to remember workflow (and tabs) you had few days ago. +它非常有用,特别是如果你像我一样,白天的时候需要在多个“思维活动”之间切换——研究、开发或者新闻阅读。或者您只是单纯地希望记住几天前的工作流(和选项卡)。 -After I decided to ditch all extensions from Chromium except [uBlock Origin][2], it was time to look for alternative. My main goal was it to be browser agnostic and session links had to be stored in text file, so I can enjoy all the goodies of plain text file. What would be better for that than good old [org-mode][3] ;) +在我决定放弃 chromium 上除了 [uBlock Origin][2] 之外的所有扩展后,也到了寻找替代品的时候了。我的主要目标是使之与浏览器无关同时会话链接需要保存在文本文件中,这样我就可以享受所有纯文本的好处了。还有什么比 [org-mode][3] 更好呢 ;) -Long time ago I found this trick: [Get the currently open tabs in Google Chrome via the command line][4] and with some elisp sugar and coffee, here is the code: +很久以前我就发现了这个小诀窍:[通过命令行获取当前在谷歌 Chrome 中打开的标签 ][4] 再加上些 elisp 代码: ``` (require 'cl-lib) @@ -57,9 +57,9 @@ Make sure to put cursor on date heading that contains list of urls." (forward-line 1))))) ``` -So, how does it work? +那么,它的工作原理是什么呢? -Evaluate above code, open new org-mode file and call `M-x save-chromium-session`. It will create something like this: +运行上述代码,打开一个新 org-mode 文件并调用 `M-x save-chromium-session`。它会创建类似这样的东西: ``` * [2019-12-04 12:14:02] @@ -68,9 +68,9 @@ Evaluate above code, open new org-mode file and call `M-x save-chromium-session` - https://news.ycombinator.com ``` -or whatever urls are running in Chromium instance. To restore it back, put cursor on desired date and run `M-x restore-chromium-session`. All tabs should be back. +也就是任何在 chromium 实例中运行着的 URL。要还原的话,则将光标置于所需日期上然后运行 `M-x restore-chromium-session`。所有标签都应该恢复了。 -Here is how I use it, with randomly generated data for the purpose of this text: +以下是我的使用案例,其中的数据是随机生成的: ``` #+TITLE: Browser sessions @@ -88,27 +88,28 @@ Here is how I use it, with randomly generated data for the purpose of this text: - https://news.ycombinator.com ``` -Note that hack for reading Chromium session isn't perfect: `strings` will read whatever looks like string and url from binary database and sometimes that will yield small artifacts in urls. But, you can easily edit those and keep session file lean and clean. +请注意,用于读取 Chromium 会话的方法并不完美:`strings` 将从二进制数据库中读取任何类似 URL 字符串的内容,有时这将产生不完整的 url。不过,您可以很方便地地编辑它们,从而保持会话文件简洁。 -To actually open tabs, elisp code will use [browse-url][5] and it can be further customized to run Chromium, Firefox or any other browser with `browse-url-browser-function` variable. Make sure to read documentation for this variable. +为了真正打开标签,elisp 代码中使用到了 [browse-url][5],它可以通过 `browse-url-browser-function` 变量进一步定制成运行 Chromium,Firefox 或任何其他浏览器。请务必阅读该变量的相关文档。 -Don't forget to put session file in git, mercurial or svn and enjoy the fact that you will never loose your session history again :) +别忘了把会话文件放在 git、mercurial 或 svn 中,这样你就再也不会丢失会话历史记录了 :) -### What about Firefox? +### 那么 Firefox 呢? -If you are using Firefox (recent versions) and would like to pull session urls, here is how to do it. +如果您正在使用 Firefox( 最近的版本),并且想要获取会话 url,下面是操作方法。 -First, download and compile [lz4json][6], small tool that will decompress Mozilla lz4json format, where Firefox stores session data. Session data (at the time of writing this post) is stored in `$HOME/.mozilla/firefox//sessionstore-backups/recovery.jsonlz4`. +首先,下载并编译 [lz4json][6],这是一个可以解压缩 Mozilla lz4json 格式的小工具,Firefox 以这种格式来存储会话数据。会话数据(在撰写本文时)存储在 `$HOME/.mozilla/firefox//sessionstore-backup /recovery.jsonlz4` 中。 -If Firefox is not running, `recovery.jsonlz4` will not be present, but use `previous.jsonlz4` instead. +如果 Firefox 没有运行,则没有 `recovery.jsonlz4`,这种情况下用 `previous.jsonlz4` 代替。 +=恢复。jsonlz4= 将不存在,但使用=先前。jsonlz4 =。 -To extract urls, try this in terminal: +要提取网址,尝试在终端运行: ``` $ lz4jsoncat recovery.jsonlz4 | grep -oP '"(http.+?)"' | sed 's/"//g' | sort | uniq ``` -and update `save-chromium-session` with: +然后更新 `save-chromium-session` 为: ``` (defun save-chromium-session () @@ -122,7 +123,7 @@ and update `save-chromium-session` with: ;; rest of the code is unchanged ``` -Updating documentation strings, function name and any further refactoring is left for exercise. +更新本函数的文档字符串、函数名以及进一步的重构都留作练习。 -------------------------------------------------------------------------------- From 5990054324fe2ab73fa271d258c8ffd1b257050c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 23 Feb 2020 00:58:53 +0800 Subject: [PATCH 121/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200222=20How=20?= =?UTF-8?q?to=20install=20TT-RSS=20on=20a=20Raspberry=20Pi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200222 How to install TT-RSS on a Raspberry Pi.md --- ...How to install TT-RSS on a Raspberry Pi.md | 245 ++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 sources/tech/20200222 How to install TT-RSS on a Raspberry Pi.md diff --git a/sources/tech/20200222 How to install TT-RSS on a Raspberry Pi.md b/sources/tech/20200222 How to install TT-RSS on a Raspberry Pi.md new file mode 100644 index 0000000000..ec5a177314 --- /dev/null +++ b/sources/tech/20200222 How to install TT-RSS on a Raspberry Pi.md @@ -0,0 +1,245 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to install TT-RSS on a Raspberry Pi) +[#]: via: (https://opensource.com/article/20/2/ttrss-raspberry-pi) +[#]: author: (Patrick H. Mullins https://opensource.com/users/pmullins) + +How to install TT-RSS on a Raspberry Pi +====== +Read your news feeds while keeping your privacy intact with Tiny Tiny +RSS. +![Raspberries with pi symbol overlay][1] + +[Tiny Tiny RSS][2] (TT-RSS) is a free and open source web-based news feed (RSS/Atom) reader and aggregator. It's ideally suited to those who are privacy-focused and still rely on RSS for their daily news. Tiny Tiny RSS is self-hosted software, so you have 100% control of the server, your data, and your overall privacy. It also supports a wide range of plugins, add-ons, and themes, Want a dark mode interface? No problem. Want to filter your incoming news based on keywords? TT-RSS has you covered there, as well. + +![Tiny Tiny RSS screenshot][3] + +Now that you know what TT-RSS is and why you may want to use it, I'll explain everything you need to know about installing it on a Raspberry Pi or a Debian 10 server. + +### Install and configure TT-RSS + +To install TT-RSS on a Raspberry Pi, you must also install and configure the latest version of PHP (7.3 as of this writing), PostgreSQL for the database backend, the Nginx web server, Git, and finally, TT-RSS. + +#### 1\. Install PHP 7 + +Installing PHP 7 is, by far, the most involved part of this process. Thankfully, it's not as difficult as it might appear. Start by installing the following support packages: + + +``` +`$ sudo apt install -y ca-certificates apt-transport-https` +``` + +Now, add the repository PGP key: + + +``` +`$ wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -` +``` + +Next, add the PHP repository to your apt sources: + + +``` +`$ echo "deb https://packages.sury.org/php/ buster main" | sudo tee /etc/apt/sources.list.d/php.list` +``` + +Then update your repository index: + + +``` +`$ sudo apt update` +``` + +Finally, install PHP 7.3 (or the latest version) and some common components: + + +``` +`$ sudo apt install -y php7.3 php7.3-cli php7.3-fpm php7.3-opcache php7.3-curl php7.3-mbstring php7.3-pgsql php7.3-zip php7.3-xml php7.3-gd php7.3-intl` +``` + +The command above assumes you're using PostgreSQL as your database backend and installs **php7.3-pgsql**. If you'd rather use MySQL or MariaDB, you can easily change this to **php7.3-mysql**. + +Next, verify that PHP is installed and running on your Raspberry Pi: + + +``` +`$ php -v` +``` + +Now it's time to install and configure the webserver. + +#### 2\. Install Nginx + +Nginx can be installed via apt with: + + +``` +`$ sudo apt install -y nginx` +``` + +Modify the default Nginx virtual host configuration so that the webserver will recognize PHP files and know what to do with them: + + +``` +`$ sudo nano /etc/nginx/sites-available/default` +``` + +You can safely delete everything in the original file and replace it with: + + +``` +server { +        listen 80 default_server; +        listen [::]:80 default_server; + +        root /var/www/html; +        index index.html index.htm index.php; +        server_name _; + +        location / { +                try_files $uri $uri/ =404; +        } + +        location ~ \\.php$ { +          include snippets/fastcgi-php.conf; +          fastcgi_pass unix:/run/php/php7.3-fpm.sock; +        } + +} +``` + +Use **Ctrl+O** to save your new configuration file and then **Ctrl+X** to exit Nano. You can test your new configuration with: + + +``` +`$ nginx -t` +``` + +If there are no errors, restart the Nginx service: + + +``` +`$ systemctl restart nginx` +``` + +#### 3\. Install PostgreSQL + +Next up is installing the database server. Installing PostgreSQL on the Raspberry Pi is super easy: + + +``` +`$ sudo apt install -y postgresql postgresql-client postgis` +``` + +Check to see if the database server was successfully installed by entering: + + +``` +`$ psql --version` +``` + +#### 4\. Create the Tiny Tiny RSS database + +Before you can do anything else, you need to create a database that the TT-RSS software will use to store data. First, log into the PostgreSQL server: + + +``` +`sudo -u postgres psql` +``` + +Next, create a new user and assign a password: + + +``` +`CREATE USER username WITH PASSWORD 'your_password' VALID UNTIL 'infinity';` +``` + +Then create the database that will be used by TT-RSS: + + +``` +`CREATE DATABASE tinyrss;` +``` + +Finally, grant full permissions to the new user: + + +``` +`GRANT ALL PRIVILEGES ON DATABASE tinyrss to user_name;` +``` + +That's it for the database. You can exit the **psql** app by typing **\q**. + +#### 5\. Install Git + +Installing TT-RSS requires Git, so install Git with: + + +``` +`$ sudo apt install git -y` +``` + +Now, change directory to wherever Nginx serves web pages: + + +``` +`$ cd /var/www/html` +``` + +Then download the latest source for TT-RSS: + + +``` +`$ git clone https://git.tt-rss.org/fox/tt-rss.git tt-rss` +``` + +Note that this process creates a new **tt-rss** folder. + +#### 6\. Install and configure Tiny Tiny RSS + +It's finally time to install and configure your new TT-RSS server. First, verify that you can open **** in a web browser. If you get a **403 Forbidden** error, your permissions are not set properly on the **/var/www/html** folder. The following will usually fix this issue: + + +``` +`$ chmod 755 /var/www/html/ -v` +``` + +If everything goes as planned, you'll see the TT-RSS Installer page, and it will ask you for some database information. Just tell it the database username and password that you created earlier; the database name; **localhost** for the hostname; and **5432** for the port. + +Click **Test Configuration** to continue. If all went well, you should see a red button labeled **Initialize Database.** Click on it to begin the installation. Once finished, you'll have a configuration file that you can copy and save as **config.php** in the TT-RSS directory. + +After finishing with the installer, open your TT-RSS installation at **** and log in with the default credentials (username: **admin**, password: **password**). The system will recommend that you change the admin password as soon as you log in. I highly recommend that you follow that advice and change it as soon as possible. + +### Set up TT-RSS + +If all went well, you can start using TT-RSS right away. It's recommended that you create a new non-admin user, log in as the new user, and start importing your feeds, subscribing, and configuring it as you see fit. + +Finally, and this is super important, don't forget to read the [Updating Feeds][4] section on TT-RSS's wiki. It describes how to create a simple systemd service that will update your feeds. If you skip this step, your RSS feeds will not update automatically. + +### Conclusion + +Whew! That was a lot of work, but you did it! You now have your very own RSS aggregation server. Want to learn more about TT-RSS? I recommend checking out the official [FAQ][5], the [support][6] forum, and the detailed [installation][7] notes. Feel free to comment below if you have any questions or issues. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/ttrss-raspberry-pi + +作者:[Patrick H. Mullins][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/pmullins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-raspberrypi_0.png?itok=Kczz87J2 (Raspberries with pi symbol overlay) +[2]: https://tt-rss.org/ +[3]: https://opensource.com/sites/default/files/uploads/tt-rss.jpeg (Tiny Tiny RSS screenshot) +[4]: https://tt-rss.org/wiki/UpdatingFeeds +[5]: https://tt-rss.org/wiki/FAQ +[6]: https://community.tt-rss.org/c/tiny-tiny-rss/support +[7]: https://tt-rss.org/wiki/InstallationNotes From 86c34d6f8d7a5ebed0024e1f246f5b505034c46f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 23 Feb 2020 00:59:46 +0800 Subject: [PATCH 122/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200221=20Live?= =?UTF-8?q?=20video=20streaming=20with=20open=20source=20Video.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200221 Live video streaming with open source Video.js.md --- ...deo streaming with open source Video.js.md | 171 ++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 sources/tech/20200221 Live video streaming with open source Video.js.md diff --git a/sources/tech/20200221 Live video streaming with open source Video.js.md b/sources/tech/20200221 Live video streaming with open source Video.js.md new file mode 100644 index 0000000000..178466a443 --- /dev/null +++ b/sources/tech/20200221 Live video streaming with open source Video.js.md @@ -0,0 +1,171 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Live video streaming with open source Video.js) +[#]: via: (https://opensource.com/article/20/2/video-streaming-tools) +[#]: author: (Aaron J. Prisk https://opensource.com/users/ricepriskytreat) + +Live video streaming with open source Video.js +====== +Video.js is a widely used protocol that will serve your live video +stream to a wide range of devices. +![video editing dashboard][1] + +Last year, I wrote about [creating a video streaming server with Linux][2]. That project uses the Real-Time Messaging Protocol (RMTP), Nginx web server, Open Broadcast Studio (OBS), and VLC media player. + +I used VLC to play our video stream, which may be fine for a small local deployment but isn't very practical on a large scale. First, your viewers have to use VLC, and RTMP streams can provide inconsistent playback. This is where [Video.js][3] comes into play! Video.js is an open source JavaScript framework for creating custom HTML5 video players. Video.js is incredibly powerful, and it's used by a host of very popular websites—largely due to its open nature and how easy it is to get up and running. + +### Get started with Video.js + +This project is based off of the video streaming project I wrote about last year. Since that project was set to serve RMTP streams, to use Video.js, you'll need to make some adjustments to that Nginx configuration. HTTP Live Streaming ([HLS][4]) is a widely used protocol developed by Apple that will serve your stream better to a multitude of devices. HLS will take your stream, break it into chunks, and serve it via a specialized playlist. This allows for a more fault-tolerant stream that can play on more devices. + +First, create a directory that will house the HLS stream and give Nginx permission to write to it: + + +``` +mkdir /mnt/hls +chown www:www /mnt/hls +``` + +Next, fire up your text editor, open the Nginx.conf file, and add the following under the **application live** section: + + +``` +       application live { +            live on; +            # Turn on HLS +            hls on; +            hls_path /mnt/hls/; +            hls_fragment 3; +            hls_playlist_length 60; +            # disable consuming the stream from nginx as rtmp +            deny play all; +} +``` + +Take note of the HLS fragment and playlist length settings. You may want to adjust them later, depending on your streaming needs, but this is a good baseline to start with. Next, we need to ensure that Nginx is able to listen for requests from our player and understand how to present it to the user. So, we'll want to add a new section at the bottom of our nginx.conf file. + + +``` +server { +        listen 8080; + +        location / { +            # Disable cache +            add_header 'Cache-Control' 'no-cache'; + +            # CORS setup +            add_header 'Access-Control-Allow-Origin' '*' always; +            add_header 'Access-Control-Expose-Headers' 'Content-Length'; + +            # allow CORS preflight requests +            if ($request_method = 'OPTIONS') { +                add_header 'Access-Control-Allow-Origin' '*'; +                add_header 'Access-Control-Max-Age' 1728000; +                add_header 'Content-Type' 'text/plain charset=UTF-8'; +                add_header 'Content-Length' 0; +                return 204; +            } + +            types { +                application/dash+xml mpd; +                application/vnd.apple.mpegurl m3u8; +                video/mp2t ts; +            } + +            root /mnt/; +        } +    } +``` + +Visit Video.js's [Getting started][5] page to download the latest release and check out the release notes. Also on that page, Video.js has a great introductory template you can use to create a very basic web player. I'll break down the important bits of that template and insert the pieces you need to get your new HTML player to use your stream. + +The **head** links in the Video.js library from a content-delivery network (CDN). You can also opt to download and store Video.js locally on your web server if you want. + + +``` +<head> +  <link href="" rel="stylesheet" /> + +  <!-- If you'd like to support IE8 (for Video.js versions prior to v7) --> +  <script src="[https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"\>\][6]</script> +</head> +``` + +Now to the real meat of the player. The **body** section sets the parameters of how the video player will be displayed. Within the **video** element, you need to define the properties of your player. How big do you want it to be? Do you want it to have a poster (i.e., a thumbnail)? Does it need any special player controls? This example defines a simple 600x600 pixel player with an appropriate (to me) thumbnail featuring Beastie (the BSD Demon) and Tux (the Linux penguin). + + +``` +<body> +  <video +    id="my-video" +    class="video-js" +    controls +    preload="auto" +    width="600" +    height="600" +    poster="BEASTIE-TUX.jpg" +    data-setup="{}" +  > +``` + +Now that you've set how you want your player to look, you need to tell it what to play. Video.js can handle a large number of different formats, including HLS streams. + + +``` +    <source src="" type="application/x-mpegURL" /> +    <p class="vjs-no-js"> +      To view this video please enable JavaScript, and consider upgrading to a +      web browser that +      <a href="" target="_blank" +        >supports HTML5 video</a +      > +    </p> +  </video> +``` + +### Record your streams + +Keeping a copy of your streams is super easy. Just add the following at the bottom of your **application live** section in the nginx.conf file: + + +``` +# Enable stream recording +record all; +record_path /mnt/recordings/; +record_unique on; +``` + +Make sure that **record_path** exists and that Nginx has permissions to write to it: + + +``` +`chown -R www:www /mnt/recordings` +``` + +### Down the stream + +That's it! You should now have a spiffy new HTML5-friendly live video player. There are lots of great resources out there on how to expand all your video-making adventures. If you have any questions or suggestions, feel free to reach out to me on [Twitter][7] or leave a comment below. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/video-streaming-tools + +作者:[Aaron J. Prisk][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/ricepriskytreat +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/video_editing_folder_music_wave_play.png?itok=-J9rs-My (video editing dashboard) +[2]: https://opensource.com/article/19/1/basic-live-video-streaming-server +[3]: https://videojs.com/ +[4]: https://en.wikipedia.org/wiki/HTTP_Live_Streaming +[5]: https://videojs.com/getting-started +[6]: https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"\>\ +[7]: https://twitter.com/AKernelPanic From 3298cd109b9c84b6723976c1201f73ffbb01ad51 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 23 Feb 2020 01:01:50 +0800 Subject: [PATCH 123/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200221=20Don't?= =?UTF-8?q?=20like=20loops=3F=20Try=20Java=20Streams?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200221 Don-t like loops- Try Java Streams.md --- ...0221 Don-t like loops- Try Java Streams.md | 427 ++++++++++++++++++ 1 file changed, 427 insertions(+) create mode 100644 sources/tech/20200221 Don-t like loops- Try Java Streams.md diff --git a/sources/tech/20200221 Don-t like loops- Try Java Streams.md b/sources/tech/20200221 Don-t like loops- Try Java Streams.md new file mode 100644 index 0000000000..e327d045a3 --- /dev/null +++ b/sources/tech/20200221 Don-t like loops- Try Java Streams.md @@ -0,0 +1,427 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Don't like loops? Try Java Streams) +[#]: via: (https://opensource.com/article/20/2/java-streams) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) + +Don't like loops? Try Java Streams +====== +It's 2020 and time to learn about Java Streams. +![Person drinking a hat drink at the computer][1] + +In this article, I will explain how to not write loops anymore. + +What? Whaddaya mean, no more loops? + +Yep, that's my 2020 resolution—no more loops in Java. Understand that it's not that loops have failed me, nor have they led me astray (well, at least, I can argue that point). Really, it is that I, a Java programmer of modest abilities since 1997 or so, must finally learn about all this new [Streams][2] stuff, saying "what" I want to do and not "how" I want to do it, maybe being able to parallelize some of my computations, and all that other good stuff. + +I'm guessing that there are other Java programmers out there who also have been programming in Java for a decent amount of time and are in the same boat. Therefore, I'm offering my experiences as a guide to "how to not write loops in Java anymore." + +### Find a problem worth solving + +If you're like me, then the first show-stopper you run into is "right, cool stuff, but what am I solving for, and how do I apply this?" I realized that I can spot the perfect opportunity camouflaged as _Something I've Done Before_. + +In my case, it's sampling land cover within a specific area and coming up with an estimate and a confidence interval around that estimate for the land cover across the whole area. The specific problem involves deciding whether an area is "forested" or not, given a specific legal definition: if at least 10% of the soil is covered over by tree crowns, then the area is considered to be forested; otherwise, it's something else. + +![Image of land cover in an area][3] + +It's a pretty esoteric example of a recurring problem; I'll grant you. But there it is. For the ecologists and foresters out there who are accustomed to cool temperate or tropical forests, 10% might sound kind of low, but in the case of dry areas with low-growing shrubs and trees, that's a reasonable number. + +So the basic idea is: use images to stratify the area (i.e., areas completely devoid of trees, areas of predominantly small trees spaced quite far apart, areas of predominantly small trees spaced closer together, areas of somewhat larger trees), locate some samples in those strata, send the crew out to measure the samples, analyze the results, and calculate the proportion of soil covered by tree crowns across the area. Simple, right? + +![Survey team assessing land cover][4] + +### What the field data looks like + +In the current project, the samples are rectangular areas 20 meters wide by 25 meters long, so 500 square meters each. On each patch, the field crew measured each tree: its species, its height, the maximum and minimum width of its crown, and the diameter of its trunk at trunk height (nominally 30cm above the ground). This information was collected, entered into a spreadsheet, and exported to a bar separated value (BSV) file for me to analyze. It looks like this: + +Stratum# | Sample# | Tree# | Species | Trunk diameter (cm) | Crown diameter 1 (m) | Crown diameter 2 (m) | Height (m) +---|---|---|---|---|---|---|--- +1 | 1 | 1 | Ac | 6 | 3.6 | 4.6 | 2.4 +1 | 1 | 2 | Ac | 6 | 2.2 | 2.3 | 2.5 +1 | 1 | 3 | Ac | 16 | 2.5 | 1.7 | 2.4 +1 | 1 | 4 | Ac | 6 | 1.5 | 2.1 | 1.8 +1 | 1 | 5 | Ac | 5 | 0.9 | 1.7 | 1.7 +1 | 1 | 6 | Ac | 6 | 1.7 | 1.3 | 1.6 +1 | 1 | 7 | Ac | 5 | 1.82 | 1.32 | 1.8 +1 | 1 | 1 | Ac | 1 | 0.3 | 0.25 | 0.9 +1 | 1 | 2 | Ac | 2 | 1.2 | 1.2 | 1.7 + +The first column is the stratum number (where 1 is "predominantly small trees spaced quite far apart," 2 is "predominantly small trees spaced closer together," and 3 is "somewhat larger trees"; we didn't sample the areas "completely devoid of trees"). The second column is the sample number (there are 73 samples altogether, located in the three strata in proportion to the area of each stratum). The third column is the tree number within the sample. The fourth is the two-letter species code, the fifth the trunk diameter (in this case, 10cm above ground or exposed roots), the sixth the smallest distance across the crown, the seventh the largest distance, and the eighth the height of the tree. + +For the purposes of this exercise, I'm only concerned with the total amount of ground covered by the tree crowns—not the species, nor the height, nor the diameter of the trunk. + +In addition to the measurement information above, I also have the areas of the three strata, also in a BSV: + +stratum | hectares +---|--- +1 | 114.89 +2 | 207.72 +3 | 29.77 + +### What I want to do (not how I want to do it) + +In keeping with one of the main design goals of Java Streams, here is "what" I want to do: + + 1. Read the stratum area BSV and save the data as a lookup table. + 2. Read the measurements from the measurement BSV file. + 3. Accumulate each measurement (tree) to calculate the total area of the sample covered by tree crowns. + 4. Accumulate the sample tree crown area values and count the number of samples to estimate the mean tree crown area coverage and standard error of the mean for each stratum. + 5. Summarize the stratum figures. + 6. Weigh the stratum means and standard errors by the stratum areas (looked up from the table created in step 1) and accumulate them to estimate the mean tree crown area coverage and standard error of the mean for the total area. + 7. Summarize the weighted figures. + + + +Generally speaking, the way to define "what" with Java Streams is by creating a stream processing pipeline of function calls that pass over the data. So, yes, there is actually a bit of "how" that ends up creeping in… in fact, quite a bit of "how." But, it needs a very different knowledge base than the good, old fashioned loop. + +I'll go through each of these steps in detail. + +#### Build the stratum area table + +The first job is to convert the stratum areas BSV file to a lookup table: + + +``` +[String][5] fileName = "stratum_areas.bsv"; +Stream<String> inputLineStream = Files.lines(Paths.get(fileName));  // (1) + +final Map<[Integer][6],Double> stratumAreas =   // (2) +    inputLineStream     // (3) +        .skip(1)                   // (4) +        .map(l -> l.split("\\\|"))  // (5) +        .collect(                  // (6) +            Collectors.toMap(      // (7) +                a -> [Integer][6].parseInt(a[0]),  // (8) +                a -> [Double][7].parseDouble(a[1]) // (9) +            ) +        ); +inputLineStream.close();   // (10) + +[System][8].out.println("stratumAreas = " + stratumAreas);  // (11) +``` + +I'll take this a line or two at a time, where the numbers in comments following the lines above—e.g., _// (3)_— correspond to the numbers below: + + 1. java.nio.Files.lines() gives a stream of strings corresponding to lines in the file. + 2. The goal is to create the lookup table, **stratumAreas**, which is a **Map<Integer,Double>**. Therefore, I can get the **double** value area for stratum 2 as **stratumAreas.get(2)**. + 3. This is the beginning of the stream "pipeline." + 4. Skip the first line in the pipeline since it's the header line containing the column names. + 5. Use **map()** to split the **String** input line into an array of **String** fields, with the first field being the stratum # and the second being the stratum area. + 6. Use **collect()** to [materialize the results][9]. + 7. The materialized result will be produced as a sequence of **Map** entries. + 8. The key of each map entry is the first element of the array in the pipeline—the **int** stratum number. By the way, this is a _Java lambda_ expression—[an anonymous function][10] that takes an argument and returns that argument converted to an **int**. + 9. The value of each map entry is the second element of the array in the pipeline—the **double** stratum area. + 10. Don't forget to close the stream (file). + 11. Print out the result, which looks like: [code]`stratumAreas = {1=114.89, 2=207.72, 3=29.77}` +``` +### Build the measurements table and accumulate the measurements into the sample totals + +Now that I have the stratum areas, I can start processing the main body of data—the measurements. I combine the two tasks of building the measurements table and accumulating the measurements into the sample totals since I don't have any interest in the measurement data per se. +``` + + +fileName = "sample_data_for_testing.bsv"; +inputLineStream = Files.lines(Paths.get(fileName)); + + final Map<[Integer][6],Map<[Integer][6],Double>> sampleValues = +    inputLineStream +        .skip(1) +        .map(l -> l.split("\\\|")) +        .collect(                  // (1) +            Collectors.groupingBy(a -> [Integer][6].parseInt(a[0]),     // (2) +                Collectors.groupingBy(b -> [Integer][6].parseInt(b[1]), // (3) +                    Collectors.summingDouble(                      // (4) +                        c -> {                                     // (5) +                            double rm = ([Double][7].parseDouble(c[5]) + +                                [Double][7].parseDouble(c[6]))/4d;      // (6) +                            return rm*rm * [Math][11].PI / 500d;         // (7) +                        }) +                ) +            ) +        ); +inputLineStream.close(); + +[System][8].out.println("sampleValues = " + sampleValues);  // (8) + +``` +Again, a line or two or so at a time: + + 1. The first seven lines are the same in this task and the previous, except the name of this lookup table is **sampleValues**; and it is a **Map** of **Map**s. + 2. The measurement data is grouped into samples (by sample #), which are, in turn, grouped into strata (by stratum #), so I use **Collectors.groupingBy()** at the topmost level [to separate data][12] into strata, with **a[0]** here being the stratum number. + 3. I use **Collectors.groupingBy()** once more to separate data into samples, with **b[1]** here being the sample number. + 4. I use the handy **Collectors.summingDouble()** [to accumulate the data][13] for each measurement within the sample within the stratum. + 5. Again, a Java lambda or anonymous function whose argument **c** is the array of fields, where this lambda has several lines of code that are surrounded by **{** and **}** with a **return** statement just before the **}**. + 6. Calculate the mean crown radius of the measurement. + 7. Calculate the crown area of the measurement as a proportion of the total sample area and return that value as the result of the lambda. + 8. Again, similar to the previous task. The result looks like (with some numbers elided): [code]`sampleValues = {1={1=0.09083231861452731, 66=0.06088002082602869, ... 28=0.0837823490804228}, 2={65=0.14738326403381743, 2=0.16961183847374103, ... 63=0.25083064794883453}, 3={64=0.3306323635177101, 32=0.25911911184680053, ... 30=0.2642668470291564}}` +``` + + + +This output shows the **Map** of **Map**s structure clearly—there are three entries in the top level corresponding to the strata 1, 2, and 3, and each stratum has subentries corresponding to the proportional area of the sample covered by tree crowns. + +#### Accumulate the sample totals into the stratum means and standard errors + +At this point, the task becomes more complex; I need to count the number of samples, sum up the sample values in preparation for calculating the sample mean, and sum up the squares of the sample values in preparation for calculating the standard error of the mean. I may as well incorporate the stratum area into this grouping of data as well, as I'll need it shortly to weigh the stratum results together. + +So the first thing to do is create a class, **StratumAccumulator**, to handle the accumulation and provide the calculation of the interesting results. This class implements **java.util.function.DoubleConsumer**, which can be passed to **collect()** to handle accumulation: + + +``` +class StratumAccumulator implements DoubleConsumer { +    private double ha; +    private int n; +    private double sum; +    private double ssq; +    public StratumAccumulator(double ha) { // (1) +        this.ha = ha; +        this.n = 0; +        this.sum = 0d; +        this.ssq = 0d; +    } +    public void accept(double d) { // (2) +        this.sum += d; +        this.ssq += d*d; +        this.n++; +    } +    public void combine(StratumAccumulator other) { // (3) +        this.sum += other.sum; +        this.ssq += other.ssq; +        this.n += other.n; +    } +    public double getHa() {  // (4) +        return this.ha; +    } +    public int getN() {  // (5) +        return this.n; +    } +    public double getMean() {  // (6) +        return this.n > 0 ? this.sum / this.n : 0d; +    } +    public double getStandardError() {  // (7) +        double mean = this.getMean(); +        double variance = this.n > 1 ? (this.ssq - mean*mean*n)/(this.n - 1) : 0d; +        return this.n > 0 ? [Math][11].sqrt(variance/this.n) : 0d; +    } +} +``` + +Line-by-line: + + 1. The constructor **StratumAccumulator(double ha)** takes an argument, the area of the stratum in hectares, which allows me to merge the stratum area lookup table into instances of this class. + 2. The **accept(double d)** method is used to accumulate the stream of double values, and I use it to: +a. Count the number of values. +b. Sum the values in preparation for computing the sample mean. +c. Sum the squares of the values in preparation for computing the standard error of the mean. + 3. The **combine()** method is used to merge substreams of **StratumAccumulator**s (in case I want to process in parallel). + 4. The getter for the area of the stratum + 5. The getter for the number of samples in the stratum + 6. The getter for the mean sample value in the stratum + 7. The getter for the standard error of the mean in the stratum + + + +Once I have this accumulator, I can use it to accumulate the sample values pertaining to each stratum: + + +``` +final Map<[Integer][6],StratumAccumulator> stratumValues =   // (1) +    sampleValues.entrySet().stream()   // (2) +        .collect(                      // (3) +            Collectors.toMap(          // (4) +                e -> e.getKey(),       // (5) +                e -> e.getValue().entrySet().stream()   // (6) +                    .map([Map.Entry][14]::getValue)           // (7) +                    .collect(          // (8) +                        () -> new StratumAccumulator(stratumAreas.get(e.getKey())),   // (9) +                        StratumAccumulator::accept,     // (10) +                        StratumAccumulator::combine)    // (11) +            ) +        ); +``` + +Line-by-line: + + 1. This time, I'm using the pipeline to build **stratumValues**, which is a **Map<Integer,StratumAccumulator>**, so **stratumValues.get(3)** will return the **StratumAccumulator** instance for stratum 3. + 2. Here, I'm using the **entrySet().stream()** method provided by **Map** to get a stream of (key, value) pairs; recall these are **Map**s of sample values by stratum. + 3. Again, I'm using **collect()** to gather the pipeline results by stratum… + 4. using **Collectors.toMap()** to generate a stream of **Map** entries… + 5. whose keys are the key of the incoming stream (that is, the stratum #)… + 6. and whose values are the Map of sample values, and I again use **entrySet().stream()** to convert to a stream of Map entries, one for each sample. + 7. Using **map()** to get the value of the sample **Map** entry; I'm not interested in the key by this point. + 8. Yet again, using **collect()** to accumulate the sample results into the **StratumAccumulator** instances. + 9. Telling **collect()** how to create a new **StratumAccumulator**—I need to pass the stratum area into the constructor here, so I can't just use **StratumAccumulator::new**. + 10. Telling **collect()** to use the **accept()** method of **StratumAccumulator** to accumulate the stream of sample values. + 11. Telling **collect()** to use the **combine()** method of **StratumAccumulator** to merge **StratumAccumulator** instances. + + + +#### Summarize the stratum figures + +Whew! After all of that, printing out the stratum figures is pretty straightforward: + + +``` +stratumValues.entrySet().stream() +    .forEach(e -> { +        StratumAccumulator sa = e.getValue(); +        int n = sa.getN(); +        double se66 = sa.getStandardError(); +        double t = new TDistribution(n - 1).inverseCumulativeProbability(0.975d); +        [System][8].out.printf("stratum %d n %d mean %g se66 %g t %g se95 %g ha %g\n", +            e.getKey(), n, sa.getMean(), se66, t, se66 * t, sa.getHa()); +    }); +``` + +In the above, once again, I use **entrySet().stream()** to transform the **stratumValues** Map to a stream, and then apply the **forEach()** method to the stream. **ForEach()** is pretty much what it sounds like—a loop! But the business of finding the head of the stream, finding the next element, and checking to see if hits the end is all handled by Java Streams. So, I just get to say what I want to do for each record, which is basically to print it out. + +My code looks a bit more complicated because I declare some local variables to hold some intermediate results that I use more than once—**n**, the number of samples, and **se66**, the standard error of the mean. I also calculate the inverse T value to [convert my standard error of the mean to a 95% confidence interval][15]. + +The result looks like this: + + +``` +stratum 1 n 24 mean 0.0903355 se66 0.0107786 t 2.06866 se95 0.0222973 ha 114.890 +stratum 2 n 38 mean 0.154612 se66 0.00880498 t 2.02619 se95 0.0178406 ha 207.720 +stratum 3 n 11 mean 0.223634 se66 0.0261662 t 2.22814 se95 0.0583020 ha 29.7700 +``` + +#### Accumulate the stratum means and standard errors into the total + +Once again, the task becomes more complex, so I create a class, **TotalAccumulator**, to handle the accumulation and provide the calculation of the interesting results. This class implements **java.util.function.Consumer<T>**, which can be passed to **collect()** to handle accumulation: + + +``` +class TotalAccumulator implements Consumer<StratumAccumulator> { +    private double ha; +    private int n; +    private double sumWtdMeans; +    private double ssqWtdStandardErrors; +    public TotalAccumulator() { +        this.ha = 0d; +        this.n = 0; +        this.sumWtdMeans = 0d; +        this.ssqWtdStandardErrors = 0d; +    } +    public void accept(StratumAccumulator sa) { +        double saha = sa.getHa(); +        double sase = sa.getStandardError(); +        this.ha += saha; +        this.n += sa.getN(); +        this.sumWtdMeans += saha * sa.getMean(); +        this.ssqWtdStandardErrors += saha * saha * sase * sase; +    } +    public void combine(TotalAccumulator other) { +        this.ha += other.ha; +        this.n += other.n; +        this.sumWtdMeans += other.sumWtdMeans; +        this.ssqWtdStandardErrors += other.ssqWtdStandardErrors; +    } +    public double getHa() { +        return this.ha; +    } +    public int getN() { +        return this.n; +    } +    public double getMean() { +        return this.ha > 0 ? this.sumWtdMeans / this.ha : 0d; +    } +    public double getStandardError() { +        return this.ha > 0 ? [Math][11].sqrt(this.ssqWtdStandardErrors) / this.ha : 0; +    } +} +``` + +I'm not going to go into much detail on this, since it's structurally pretty similar to **StratumAccumulator**. Of main interest: + + 1. The constructor takes no arguments, which simplifies its use. + 2. The **accept()** method accumulates instances of **StratumAccumulator**, not **double** values, hence the use of the **Consumer<T>** interface. + 3. As for the calculations, they are assembling a weighted average of the **StratumAccumulator** instances, so they make use of the stratum areas, and the formulas might look a bit strange to anyone who's not used to stratified sampling. + + + +As for actually carrying out the work, it's easy-peasy: + + +``` +final TotalAccumulator totalValues = +    stratumValues.entrySet().stream() +        .map([Map.Entry][14]::getValue) +        .collect(TotalAccumulator::new, TotalAccumulator::accept, TotalAccumulator::combine); +``` + +Same old stuff as before: + + 1. Use **entrySet().stream()** to convert the **stratumValue Map** entries to a stream. + 2. Use **map()** to replace the **Map** entries with their values—the instances of **StratumAccumulator**. + 3. Use **collect()** to apply the **TotalAccumulator** to the instances of **StratumAccumulator**. + + + +#### Summarize the total figures + +Getting the interesting bits out of the **TotalAccumulator** instance is also pretty straightforward: + + +``` +int nT = totalValues.getN(); +double se66T = totalValues.getStandardError(); +double tT = new TDistribution(nT - stratumValues.size()).inverseCumulativeProbability(0.975d); +[System][8].out.printf("total n %d mean %g se66 %g t %g se95 %g ha %g\n", +    nT, totalValues.getMean(), se66T, tT, se66T * tT, totalValues.getHa()); +``` + +Similar to the **StratumAccumulator**, I just call the relevant getters to pick out the number of samples **nT** and the standard error **se66T**. I calculate the T value **tT** (using "n – 3" here since there are three strata), and then I print the result, which looks like this: + + +``` +`total n 73 mean 0.139487 se66 0.00664653 t 1.99444 se95 0.0132561 ha 352.380` +``` + +### In conclusion + +Wow, that looks like a bit of a marathon. It feels like it, too. As is often the case, there is a great deal of information about how to use Java Streams, all illustrated with toy examples, which kind of help, but not really. I found that getting this to work with a real-world (albeit very simple) example was difficult. + +Because I've been working in [Groovy][16] a lot lately, I kept finding myself wanting to accumulate into "maps of maps of maps" rather than creating accumulator classes, but I was never able to pull that off except in the case of totaling up the measurements in the sample. So, I worked with accumulator classes instead of maps of maps, and maps of accumulator classes instead of maps of maps of maps. + +I don't feel like any kind of master of Java Streams at this point, but I do feel I have a pretty solid understanding of **collect()**, which is deeply important, along with various methods to reformat data structures into streams and to reformat stream elements themselves. So yeah, more to learn! + +Speaking of collect(), in the examples I presented above, we can see moving from a very simple use of this fundamental method - using the Collectors.summingDouble() accumulation method - through defining an accumulator class that extends one of the pre-defined interfaces - in this case DoubleConsumer - to defining a full-blown accumulator of our own, used to accumulate the intermediate stratum class. I was tempted - sort of - to work backward and implement fully custom accumulators for the stratum and sample accumulators, but the point of this exercise was to learn more about Java Streams, not to become an expert in one single part of it all. + +What's your experience with Java Streams? Done anything big and complicated yet? Please share it in the comments. + +Optimizing your Java code requires an understanding of how the different elements in Java interact... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/java-streams + +作者:[Chris Hermansen][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/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) +[2]: https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html +[3]: https://opensource.com/sites/default/files/uploads/landcover.png (Image of land cover in an area) +[4]: https://opensource.com/sites/default/files/uploads/foresters.jpg (Survey team assessing land cover) +[5]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+integer +[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+double +[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system +[9]: https://www.baeldung.com/java-8-collectors +[10]: https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html +[11]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+math +[12]: https://www.baeldung.com/java-groupingby-collector +[13]: http://www.java2s.com/Tutorials/Java/java.util.stream/Collectors/Collectors.summingDouble_ToDoubleFunction_super_T_mapper_.htm +[14]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+map.entry +[15]: https://en.wikipedia.org/wiki/Standard_error +[16]: http://groovy-lang.org/ From 4f381a31514eb438d4e805ba2d11fde24bbbdcd1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 23 Feb 2020 01:13:18 +0800 Subject: [PATCH 124/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200221=20Google?= =?UTF-8?q?=20Cloud=20moves=20to=20aid=20mainframe=20migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200221 Google Cloud moves to aid mainframe migration.md --- ... Cloud moves to aid mainframe migration.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/talk/20200221 Google Cloud moves to aid mainframe migration.md diff --git a/sources/talk/20200221 Google Cloud moves to aid mainframe migration.md b/sources/talk/20200221 Google Cloud moves to aid mainframe migration.md new file mode 100644 index 0000000000..64b3565109 --- /dev/null +++ b/sources/talk/20200221 Google Cloud moves to aid mainframe migration.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Google Cloud moves to aid mainframe migration) +[#]: via: (https://www.networkworld.com/article/3528451/google-cloud-moves-to-aid-mainframe-migration.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Google Cloud moves to aid mainframe migration +====== +Google bought Cornerstone Technology, whose technology facilitates moving mainframe applications to the cloud. +Thinkstock + +Google Cloud this week bought a mainframe cloud-migration service firm Cornerstone Technology with an eye toward helping Big Iron customers move workloads to the private and public cloud.  + +Google said the Cornerstone technology – found in its [G4 platform][1] – will shape the foundation of its future mainframe-to-Google Cloud offerings and help mainframe customers modernize applications and infrastructure. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][2] + +“Through the use of automated processes, Cornerstone’s tools can break down your Cobol, PL/1, or Assembler programs into services and then make them cloud native, such as within a managed, containerized environment” wrote Howard Weale, Google’s director, Transformation Practice, in a [blog][3] about the buy. + +“As the industry increasingly builds applications as a set of services, many customers want to break their mainframe monolith programs into either Java monoliths or Java microservices,” Weale stated.  + +Google Cloud’s Cornerstone service will: + + * Develop a migration roadmap where Google will assess a customer’s mainframe environment and create a roadmap to a modern services architecture. + * Convert any language to any other language and any database to any other database to prepare applications for modern environments. + * Automate the migration of workloads to the Google Cloud. + + + +“Easy mainframe migration will go a long way as Google attracts large enterprises to its cloud,” said Matt Eastwood, senior vice president, Enterprise Infrastructure, Cloud, Developers and Alliances, IDC wrote in a statement. + +The Cornerstone move is also part of Google’s effort stay competitive in the face of mainframe-migration offerings from [Amazon Web Services][4], [IBM/RedHat][5] and [Microsoft][6]. + +While the idea of moving legacy applications off the mainframe might indeed be beneficial to a business, Gartner last year warned that such decisions should be taken very deliberately. + +“The value gained by moving applications from the traditional enterprise platform onto the next ‘bright, shiny thing’ rarely provides an improvement in the business process or the company’s bottom line. A great deal of analysis must be performed and each cost accounted for,” Gartner stated in a report entitled *[_Considering Leaving Legacy IBM Platforms? Beware, as Cost Savings May Disappoint, While Risking Quality_][7]. * “Legacy platforms may seem old, outdated and due for replacement. Yet IBM and other vendors are continually integrating open-source tools to appeal to more developers while updating the hardware. Application leaders should reassess the capabilities and quality of these platforms before leaving them.” + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3528451/google-cloud-moves-to-aid-mainframe-migration.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Michael-Cooney/ +[b]: https://github.com/lujun9972 +[1]: https://www.cornerstone.nl/solutions/modernization +[2]: https://www.networkworld.com/newsletters/signup.html +[3]: https://cloud.google.com/blog/topics/inside-google-cloud/helping-customers-migrate-their-mainframe-workloads-to-google-cloud +[4]: https://aws.amazon.com/blogs/enterprise-strategy/yes-you-should-modernize-your-mainframe-with-the-cloud/ +[5]: https://www.networkworld.com/article/3438542/ibm-z15-mainframe-amps-up-cloud-security-features.html +[6]: https://azure.microsoft.com/en-us/migration/mainframe/ +[7]: https://www.gartner.com/doc/reprints?id=1-6L80XQJ&ct=190429&st=sb +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From c64fa696d6e3089be5a437efc480643147ab1b60 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 23 Feb 2020 01:24:29 +0800 Subject: [PATCH 125/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200221=20Japane?= =?UTF-8?q?se=20firm=20announces=20potential=2080TB=20hard=20drives?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200221 Japanese firm announces potential 80TB hard drives.md --- ...rm announces potential 80TB hard drives.md | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 sources/talk/20200221 Japanese firm announces potential 80TB hard drives.md diff --git a/sources/talk/20200221 Japanese firm announces potential 80TB hard drives.md b/sources/talk/20200221 Japanese firm announces potential 80TB hard drives.md new file mode 100644 index 0000000000..c44e9ded6e --- /dev/null +++ b/sources/talk/20200221 Japanese firm announces potential 80TB hard drives.md @@ -0,0 +1,57 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Japanese firm announces potential 80TB hard drives) +[#]: via: (https://www.networkworld.com/article/3528211/japanese-firm-announces-potential-80tb-hard-drives.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Japanese firm announces potential 80TB hard drives +====== +Using some very fancy physics for stacking electrons, Showa Denko K.K. plans to quadruple the top end of proposed capacity. +[geralt][1] [(CC0)][2] + +Hard drive makers are staving off obsolescence to solid-state drives (SSDs) by offering capacities that are simply not feasible in an SSD. Seagate and Western Digital are both pushing to release 20TB hard disks in the next few years. A 20TB SSD might be doable but also cost more than a new car. + +But Showa Denko K.K. of Japan has gone one further with the announcement of its next-generation of heat-assisted magnetic recording (HAMR) media for hard drives. The platters use all-new magnetic thin films to maximize their data density, with the goal of eventually enabling 70TB to 80TB hard drives in a 3.5-inch form factor. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] + +Showa Denko is the world’s largest independent maker of platters for hard drives, selling them to basically anyone left making hard drives not named Seagate and Western Digital. Those two make their own platters and are working on their own next-generation drives for release in the coming years. + +While similar in concept, Seagate and Western Digital have chosen different solutions to the same problem. HAMR, championed by Seagate and Showa, works by temporarily heating the disk material during the write process so data can be written to a much smaller space, thus increasing capacity. + +Western Digital supports a different technology called microwave-assisted magnetic recording (MAMR). It operates under a similar concept as HAMR but uses microwaves instead of heat to alter the drive platter. Seagate hopes to get to 48TB by 2023, while Western Digital is planning on releasing 18TB and 20TB drives this year. + +Heat is never good for a piece of electrical equipment, and Showa Denko’s platters for HAMR HDDs are made of a special composite alloy to tolerate temperature and reduce wear, not to mention increase density. A standard hard disk has a density of about 1.1TB per square inch. Showa’s drive platters have a density of 5-6TB per square inch. + +The question is when they will be for sale, and who will use them. Fellow Japanese electronics giant Toshiba is expected to ship drives with Showa platters later this year. Seagate will be the first American company to adopt HAMR, with 20TB drives scheduled to ship in late 2020. + +[][4] + +Know what’s scary? That still may not be enough. IDC predicts that our global datasphere – the total of all of the digital data we create, consume, or capture – will grow from a total of approximately 40 zettabytes of data in 2019 to 175 zettabytes total by 2025. + +So even with the growth in hard-drive density, the growth in the global data pool – everything from Oracle databases to Instagram photos – may still mean deploying thousands upon thousands of hard drives across data centers. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3528211/japanese-firm-announces-potential-80tb-hard-drives.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://pixabay.com/en/data-data-loss-missing-data-process-2764823/ +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From c49b180863c10285a8d28ee5fab072ddeb29be16 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Feb 2020 12:00:11 +0800 Subject: [PATCH 126/315] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @HankChow 翻译得很好,对原文融会贯通后用自己的语言来描述很好。不过我认为原文的一些意思有所损失,所以我修改了这些部分,可能修改上不够完善。 --- ... for the YaCy open source search engine.md | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/translated/tech/20200210 Top hacks for the YaCy open source search engine.md b/translated/tech/20200210 Top hacks for the YaCy open source search engine.md index 54c4b2f869..c7255e0425 100644 --- a/translated/tech/20200210 Top hacks for the YaCy open source search engine.md +++ b/translated/tech/20200210 Top hacks for the YaCy open source search engine.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Top hacks for the YaCy open source search engine) @@ -9,70 +9,72 @@ 使用开源搜索引擎 YaCy 的技巧 ====== -> 不想再受制于各种版本的搜索引擎?使用 YaCy 自定义一款吧。 -![Browser of things][1] -在我以前介绍 [YaCy 入门][2]的文章中讲述过 [YaCy][3] 这个点对点peer-to-peer式的搜索引擎是如何安装和使用的。YaCy 最大的一个特点就是可以在本地部署,全球范围内的每一个 YaCy 用户都是构成整个分布式搜索引擎架构的其中一个节点,因此每个用户都可以掌控自己的互联网搜索体验。 +> 无需适应其他人的眼光,而是使用 YaCY 搜索引擎定义你想要的互联网。 -Google 曾经提供过 `google.com/linux` 这样的简便方式以便快速筛选出和 Linux 相关的搜索内容,这个功能受到了很多人的青睐,但 Google 最终还是在 2011 年的时候把它[下线][4]了。 +![](https://img.linux.net.cn/data/attachment/album/202002/23/115822jqkdyjwzdqwdad0y.jpg) + +在我以前介绍 [YaCy 入门][2]的文章中讲述过 [YaCy][3] 这个对等peer-to-peer式的搜索引擎是如何安装和使用的。YaCy 最令人兴奋的一点就是它事实上是一个本地客户端,全球范围内的每一个 YaCy 用户都是构成整个这个分布式搜索引擎架构的一个节点,这意味着每个用户都可以掌控自己的互联网搜索体验。 + +Google 曾经提供过 google.com/linux 这样的主题简便方式以便快速筛选出和 Linux 相关的搜索内容,这个小功能受到了很多人的青睐,但 Google 最终还是在 2011 年的时候把它[下线][4]了。 而 YaCy 则让自定义搜索引擎变得可能。 ### 自定义 YaCy -YaCy 安装好之后,只需要访问 `localhost:8090` 就可以使用了。要开始自定义搜索引擎,只需要点击右上角的“管理Administration”按钮,如果没有找到,需要点击菜单图标打开菜单。 +YaCy 安装好之后,只需要访问 `localhost:8090` 就可以使用了。要自定义搜索引擎,只需要点击右上角的“管理Administration”按钮(它可能隐藏在小屏幕的菜单图标中)。 你可以在管理面板中配置 YaCy 对系统资源的使用策略,以及如何跟其它的 YaCy 客户端进行交互。 ![YaCy profile selector][5] -例如,点击侧栏中的“初步First steps”按钮可以配置备用端口,以及设置 YaCy 对内存和硬盘的使用量;而“监控Monitoring”面板则可以监控 YaCy 的运行状况。大多数功能都只需要在面板上点击几下就可以完成了,例如以下几个常用的功能。 +例如,点击侧栏中的“第一步First steps”按钮可以配置备用端口,以及设置 YaCy 对内存和硬盘的使用量;而“监控Monitoring”面板则可以监控 YaCy 的运行状况。大多数功能都只需要在面板上点击几下就可以完成了,例如以下几个常用的功能。 -### 搜索应用 +### 内网搜索应用 -目前市面上也有不少公司推出了[内网搜索应用][6],而 YaCy 的优势是免费使用。对于能够通过 HTTP、FTP、Samba 等协议访问的文件,YaCy 都可以进行索引,因此无论是作为私人的文件搜索还是企业内部的本地共享文件搜索,YaCy 都可以实现。它可以让内部网络中的用户使用自定义配置的 YaCy 查找共享文件,于此同时保持对内部网络以外的用户不可见。 +目前市面上也有不少公司推出了[内网搜索应用][6],而 YaCy 可以免费为你提供一个。对于能够通过 HTTP、FTP、Samba 等协议访问的文件,YaCy 都可以进行索引,因此无论是作为私人的文件搜索还是企业内部的本地共享文件搜索,YaCy 都可以实现。它可以让内部网络中的用户使用你个人的 YaCy 实例来查找共享文件,于此同时保持对内部网络以外的用户不可见。 ### 网络配置 -YaCy 在默认情况下就对隐私隔离有比较好的支持。点击“用例与账号Use Case & Account”页面顶部的“网络配置Network Configuration”链接,即可进入网络配置面板设置点对点网络。 +YaCy 在默认情况下就支持隐私和隔离。点击“用例与账号Use Case & Account”页面顶部的“网络配置Network Configuration”链接,即可进入网络配置面板设置对等网络。 ![YaCy network configuration][7] ### 爬取站点 -YaCy 点对点的分布式运作方式决定了它对页面的爬取是由用户驱动的。任何一个公司的爬虫都不可能完全访问到整个互联网上的所有页面,对于 YaCy 来说也是这样,一个站点只有在被用户指定爬取的前提下,才会被 YaCy 爬取并进入索引。 +YaCy 的分布式运作方式决定了它对页面的爬取是由用户驱动的。并没有一个大型公司对整个互联网上的所有可访问页面都进行搜索,对于 YaCy 来说也是这样,一个站点只有在被用户指定爬取的前提下,才会被 YaCy 爬取并进入索引。 -YaCy 客户端提供了两种爬取页面的方式:一是自定义爬虫,二是使用 YaCy 推荐的爬虫。 +YaCy 客户端提供了两种爬取页面的方式:你可以手动爬取,并让 YaCy 根据建议去爬取。 ![YaCy advanced crawler][8] -#### 自定义爬虫任务 +#### 手动爬取 -自定义爬虫是指由用户输入指定的网站 URL 并启动 YaCy 的爬虫任务。只需要点击“高级爬虫Advanced Crawler”并输入计划爬取的 URL,然后选择页面底部的“进行远程索引Do Remote indexing”选项,这个选项会让客户端将上面输入的 URL 向互联网广播,接收到广播的其它远程客户端就会开始爬取这些 URL 所指向的页面。 +手动爬取是指由用户输入指定的网站 URL 并启动 YaCy 的爬虫任务。只需要点击“高级爬虫Advanced Crawler”并输入计划爬取的若干 URL,然后选择页面底部的“进行远程索引Do Remote indexing”选项,这个选项会让客户端向互联网广播它要索引的 URL,可选地接受这些请求的客户端可以帮助你爬取这些 URL。 点击页面底部的“开始新爬虫任务Start New Crawl Job”按钮就可以开始进行爬取了,我就是这样对一些常用和有用站点进行爬取和索引的。 爬虫任务启动之后,YaCy 会将这些 URL 对应的页面在本地生成和存储索引。在高级模式下,也就是本地计算机允许 8090 端口流量进出时,全网的 YaCy 用户都可以使用到这一份索引。 -#### 加入爬虫任务 +#### 加入爬虫网络 -尽管 YaCy 用户已经在互联网上爬取了很多页面,但对于全网浩如烟海的页面而言也只是沧海一粟。单个用户所拥有的资源远不及很多大公司的网络爬虫,但大量 YaCy 用户如果联合起来成为一个社区,能产生的力量就大得多了。只要开启了 YaCy 的爬虫请求广播功能,就可以让其它客户端参与进来爬取更多页面。 +尽管一些非常敬业的 YaCy 高级用户已经强迫症般地在互联网上爬取了很多页面,但对于全网浩如烟海的页面而言也只是沧海一粟。单个用户所拥有的资源远不及很多大公司的网络爬虫,但大量 YaCy 用户如果联合起来成为一个社区,能产生的力量就大得多了。只要开启了 YaCy 的爬虫请求广播功能,就可以让其它客户端参与进来爬取更多页面。 -只需要在“高级爬虫Advanced Crawler”面板中点击页面顶部的“远程爬取Remote Crawling”,勾选“加载Load”复选框,就可以让你的客户端接受其它人发来的爬虫任务请求了。 +只需要在“高级爬虫Advanced Crawler”面板中点击页面顶部的“远程爬取Remote Crawling”,勾选“加载Load”旁边的复选框,就可以让你的客户端接受其它人发来的爬虫任务请求了。 ![YaCy remote crawling][9] ### YaCy 监控相关 -YaCy 除了作为一个非常强大的搜索引擎,还提供了很丰富的用户体验。你可以在“监控Monitor”面板中监控 YaCy 客户端的网络运行状况,甚至还可以了解到有多少人从 YaCy 社区中获取到了自己所需要的东西。 +YaCy 除了作为一个非常强大的搜索引擎,还提供了很丰富的主题和用户体验。你可以在“监控Monitor”面板中监控 YaCy 客户端的网络运行状况,甚至还可以了解到有多少人从 YaCy 社区中获取到了自己所需要的东西。 ![YaCy monitoring screen][10] ### 搜索引擎发挥了作用 -你使用 YaCy 的时间越长,就越会思考搜索引擎如何改变自己的视野,因为你对互联网的体验很大一部分来自于你在搜索引擎中一次次简单查询的结果。实际上,当你和不同行业的人交流时,可能会注意到每个人对“互联网”的理解都有所不同。有些人会认为,互联网的搜索引擎中充斥着各种广告和推广,同时也仅仅能从搜索结果中获取到有限的信息。例如,假设有人不断搜索关于关键词 X 的内容,那么大部分商业搜索引擎都会在搜索结果中提高关键词 X 的权重,但与此同时,另一个关键词 Y 的权重则会相对降低,从而让关键词 Y 被淹没在搜索结果当中。 +你使用 YaCy 的时间越长,就越会思考搜索引擎如何改变自己的视野,因为你对互联网的体验很大一部分来自于你在搜索引擎中一次次简单查询的结果。实际上,当你和不同行业的人交流时,可能会注意到每个人对“互联网”的理解都有所不同。有些人会认为,互联网的搜索引擎中充斥着各种广告和推广,同时也仅仅能从搜索结果中获取到有限的信息。例如,假设有人不断搜索关于关键词 X 的内容,那么大部分商业搜索引擎都会在搜索结果中提高关键词 X 的权重,但与此同时,另一个关键词 Y 的权重则会相对降低,从而让关键词 Y 被淹没在搜索结果当中,即使这样对完成特定任务更好。 -就像在现实生活中一样,走出舒适圈会让你看到一个更广阔的世界。尝试使用 YaCy,看看你会不会有所收获。 +就像在现实生活中一样,走出虚拟的世界视野会让你看到一个更广阔的世界。尝试使用 YaCy,看看你发现了什么。 -------------------------------------------------------------------------------- @@ -81,14 +83,14 @@ via: https://opensource.com/article/20/2/yacy-search-engine-hacks 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [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/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) -[2]: https://opensource.com/article/20/2/open-source-search-engine +[2]: https://linux.cn/article-11905-1.html [3]: https://yacy.net/ [4]: https://www.linuxquestions.org/questions/linux-news-59/is-there-no-more-linux-google-884306/ [5]: https://opensource.com/sites/default/files/uploads/yacy-profiles.jpg (YaCy profile selector) From c63de0476f87c0df5cefc4a100e4040a91de2cfb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Feb 2020 12:00:38 +0800 Subject: [PATCH 127/315] PUB @HankChow https://linux.cn/article-11919-1.html --- ...200210 Top hacks for the YaCy open source search engine.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200210 Top hacks for the YaCy open source search engine.md (99%) diff --git a/translated/tech/20200210 Top hacks for the YaCy open source search engine.md b/published/20200210 Top hacks for the YaCy open source search engine.md similarity index 99% rename from translated/tech/20200210 Top hacks for the YaCy open source search engine.md rename to published/20200210 Top hacks for the YaCy open source search engine.md index c7255e0425..aaa71c4f0e 100644 --- a/translated/tech/20200210 Top hacks for the YaCy open source search engine.md +++ b/published/20200210 Top hacks for the YaCy open source search engine.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11919-1.html) [#]: subject: (Top hacks for the YaCy open source search engine) [#]: via: (https://opensource.com/article/20/2/yacy-search-engine-hacks) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 69cf5a15ef05120cb08ac736107042bda9a7a5a5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Feb 2020 12:45:41 +0800 Subject: [PATCH 128/315] PRF @geekpi --- ...ux system configuration with Bash tools.md | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/translated/tech/20200122 Screenshot your Linux system configuration with Bash tools.md b/translated/tech/20200122 Screenshot your Linux system configuration with Bash tools.md index f7e2bb10aa..50c1b30d0e 100644 --- a/translated/tech/20200122 Screenshot your Linux system configuration with Bash tools.md +++ b/translated/tech/20200122 Screenshot your Linux system configuration with Bash tools.md @@ -9,74 +9,72 @@ 使用 Bash 工具截屏 Linux 系统配置 ====== -使用 ScreenFetch 和 Neofetch 与其他人轻松分享 Linux 环境。 -![metrics and data shown on a computer screen][1] -你可能有很多原因想要与他人分享 Linux 配置。你可能正在寻求帮助来对系统上的问题进行故障排除,或者你对所创建的环境感到非常自豪,因此想向其他开源爱好者展示。 +> 使用 ScreenFetch 和 Neofetch 与其他人轻松分享你的 Linux 环境。 -你可以在 Bash 提示符下使用 **cat /proc/cpuinfo** 或 **lscpu** 命令获取某些信息。但是,如果你想共享更多详细信息,例如你的操作系统、内核、运行时间、shell 环境,屏幕分辨率等,那么可以选择两个很棒的工具:screenFetch 和 Neofetch。 +![](https://img.linux.net.cn/data/attachment/album/202002/23/124525yiiqs18ll736oro8.jpg) -### ScreenFetch +你可能有很多原因想要与他人分享你的 Linux 配置。你可能正在寻求帮助来对系统上的问题进行故障排除,或者你对所创建的环境感到非常自豪,因此想向其他开源爱好者展示。 -[ScreenFetch][2] 是 Bash 命令行程序,它可以产生非常漂亮的系统配置和运行时间的截图。这是方便的与它人共享系统配置的方法。 +你可以在 Bash 提示符下使用 `cat /proc/cpuinfo` 或 `lscpu` 命令获取某些信息。但是,如果你想共享更多详细信息,例如你的操作系统、内核、运行时间、shell 环境,屏幕分辨率等,那么可以选择两个很棒的工具:screenFetch 和 Neofetch。 + +### screenFetch + +[screenFetch][2] 是 Bash 命令行程序,它可以产生非常漂亮的系统配置和运行时间的截图。这是方便的与它人共享系统配置的方法。 在许多 Linux 发行版上安装 screenFetch 很简单。 在 Fedora 上,输入: - ``` -`$ sudo dnf install screenfetch` +$ sudo dnf install screenfetch ``` 在 Ubuntu 上,输入: - ``` -`$ sudo apt install screenfetch` +$ sudo apt install screenfetch ``` 对于其他操作系统,包括 FreeBSD、MacOS 等,请查阅 screenFetch 的 wiki [安装页面][3]。安装 screenFetch 后,它可以生成详细而彩色的截图,如下所示: ![screenFetch][4] -ScreenFetch 还提供各种命令行选项来调整你的结果。例如, **screenfetch -v** 返回详细输出,逐行显示每个选项以及上面的显示。 +ScreenFetch 还提供各种命令行选项来调整你的结果。例如,`screenfetch -v` 返回详细输出,逐行显示每个选项以及上面的显示。 -**screenfetch -n** 在显示系统信息时消除了操作系统图标。 +`screenfetch -n` 在显示系统信息时消除了操作系统图标。 ![screenfetch -n option][5] -其他选项包括 **screenfetch -N**,它去除所有输出的颜色。**screenfetch -t**,它根据终端的大小截断输出。**screenFetch -E**,它可抑制错误输出。 +其他选项包括 `screenfetch -N`,它去除所有输出的颜色。`screenfetch -t`,它根据终端的大小截断输出。`screenFetch -E`,它可抑制错误输出。 -请检查手册页来了解其他选项。ScreenFetch 在 GPLv3 许可证下的开源,你可以在它的 [GitHub 仓库][6]中了解有关该项目的更多信息。 +请检查手册页来了解其他选项。screenFetch 在 GPLv3 许可证下的开源,你可以在它的 [GitHub 仓库][6]中了解有关该项目的更多信息。 ### Neofetch [Neofetch][7] 是创建系统信息截图的另一个工具。它是用 Bash 3.2 编写的,在 [MIT 许可证][8]下开源。 -根据项目网站,“Neofetch 支持近 150 种不同的操作系统。从 Linux 到 Windows,一直到 Minix、AIX 和 Haiku 等更晦涩的操作系统。” +根据项目网站所述,“Neofetch 支持近 150 种不同的操作系统。从 Linux 到 Windows,一直到 Minix、AIX 和 Haiku 等更晦涩的操作系统。” ![Neofetch][9] -该项目维护了一个 wiki,其中包含用于各种发行版和操作系统的出色的[安装文档] [10]。 +该项目维护了一个 wiki,其中包含用于各种发行版和操作系统的出色的[安装文档][10]。 如果你使用的是 Fedora、RHEL 或 CentOS,那么可以在 Bash 提示符下使用以下命令安装 Neofetch: - ``` -`$ sudo dnf install neofetch` +$ sudo dnf install neofetch ``` 在 Ubuntu 17.10 及更高版本上,你可以使用: - ``` -`$ sudo apt install neofetch` +$ sudo apt install neofetch ``` -首次运行时,Neofetch 将 **~/.config/neofetch/config.conf** 文件写入主目录(**.config/config.conf**),它让你可以[自定义和控制] [ 11] Neofetch 输出的各个方面。例如,你可以配置 Neofetch 使用图像、ASCII 文件、你选择的壁纸,或者完全不使用。config.conf 文件还让与它人分享配置变得容易。 +首次运行时,Neofetch 将 `~/.config/neofetch/config.conf` 文件写入主目录(`.config/config.conf`),它让你可以[自定义和控制][11] Neofetch 输出的各个方面。例如,你可以配置 Neofetch 使用图像、ASCII 文件、你选择的壁纸,或者完全不使用。config.conf 文件还让与它人分享配置变得容易。 -如果 Neofetch 不支持你的操作系统或不提供所需选项,请在项目的 [GitHub 仓库] [12]中打开一个问题。 +如果 Neofetch 不支持你的操作系统或不提供所需选项,请在项目的 [GitHub 仓库][12]中打开一个问题。 ### 总结 @@ -89,7 +87,7 @@ via: https://opensource.com/article/20/1/screenfetch-neofetch 作者:[Don Watkins][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/) 荣誉推出 From a84b8b565eccc9414d96226e04a0ce3bda43bbf5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Feb 2020 12:46:38 +0800 Subject: [PATCH 129/315] PUB @geekpi https://linux.cn/article-11920-1.html --- ...nshot your Linux system configuration with Bash tools.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20200122 Screenshot your Linux system configuration with Bash tools.md (98%) diff --git a/translated/tech/20200122 Screenshot your Linux system configuration with Bash tools.md b/published/20200122 Screenshot your Linux system configuration with Bash tools.md similarity index 98% rename from translated/tech/20200122 Screenshot your Linux system configuration with Bash tools.md rename to published/20200122 Screenshot your Linux system configuration with Bash tools.md index 50c1b30d0e..e8507162f9 100644 --- a/translated/tech/20200122 Screenshot your Linux system configuration with Bash tools.md +++ b/published/20200122 Screenshot your Linux system configuration with Bash tools.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11920-1.html) [#]: subject: (Screenshot your Linux system configuration with Bash tools) [#]: via: (https://opensource.com/article/20/1/screenfetch-neofetch) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) From 25361b4f30ce68f88f1c4d493d7c9867911233f6 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 23 Feb 2020 20:48:46 +0800 Subject: [PATCH 130/315] translate done: 20190114 Some Advice for How to Make Emacs Tetris Harder.md --- ...ice for How to Make Emacs Tetris Harder.md | 157 ----------------- ...ice for How to Make Emacs Tetris Harder.md | 161 ++++++++++++++++++ 2 files changed, 161 insertions(+), 157 deletions(-) delete mode 100644 sources/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md create mode 100644 translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md diff --git a/sources/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md b/sources/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md deleted file mode 100644 index 829dd3703f..0000000000 --- a/sources/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md +++ /dev/null @@ -1,157 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lujun9972) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Some Advice for How to Make Emacs Tetris Harder) -[#]: via: (https://nickdrozd.github.io/2019/01/14/tetris.html) -[#]: author: (nickdrozd https://nickdrozd.github.io) - -Some Advice for How to Make Emacs Tetris Harder -====== - -Did you know that Emacs comes bundled with an implementation of Tetris? Just hit M-x tetris and there it is: - -![img](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-normal.png) - -This is often mentioned by Emacs advocates in text editor discussions. “Yeah, but can that other editor run Tetris?” I wonder, is that supposed to convince anyone that Emacs is superior? Like, why would anyone care that they could play games in their text editor? “Yeah, but can that other vacuum play mp3s?” - -That said, Tetris is always fun. Like everything in Emacs, the source code is open for easy inspection and modifcation, so it’s possible to make it even more fun. And by more fun, I mean harder. - -One of the simplest ways to make the game harder is to get rid of the next-block preview. No more sitting that S/Z block in a precarious position knowing that you can fill in the space with the next piece – you have to chance it and hope for the best. Here’s what it looks like with no preview (as you can see, without the preview I made some choices that turned out to have dire consequences): - -![img](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-no-preview.png) - -The preview box is set with a function called tetris-draw-next-shape[1][2]: - -``` -(defun tetris-draw-next-shape () - (dotimes (x 4) - (dotimes (y 4) - (gamegrid-set-cell (+ tetris-next-x x) - (+ tetris-next-y y) - tetris-blank))) - (dotimes (i 4) - (let ((tetris-shape tetris-next-shape) - (tetris-rot 0)) - (gamegrid-set-cell (+ tetris-next-x - (aref (tetris-get-shape-cell i) 0)) - (+ tetris-next-y - (aref (tetris-get-shape-cell i) 1)) - tetris-shape)))) -``` - -First, we’ll introduce a flag to allow configuring next-preview[2][3]: - -``` -(defvar tetris-preview-next-shape nil - "When non-nil, show the next block the preview box.") -``` - -Now the question is, how can we make tetris-draw-next-shape obey this flag? The obvious way would be to redefine it: - -``` -(defun tetris-draw-next-shape () - (when tetris-preview-next-shape - ;; existing tetris-draw-next-shape logic - )) -``` - -This is not an ideal solution. There will be two definitions of the same function floating around, which is confusing, and we’ll have to maintain our modified definition in case the upstream version changes. - -A better approach is to use advice. Emacs advice is like a Python decorator, but even more flexible, since advice can be added to a function from anywhere. This means that we can modify the function without disturbing the original source file at all. - -There are a lot of different ways to use Emacs advice ([check the manual][4]), but for now we’ll just stick with the advice-add function with the :around flag. The advising function takes the original function as an argument, and it might or might not execute it. In this case, we’ll say that the original should be executed only if the preview flag is non-nil: - -``` -(defun tetris-maybe-draw-next-shape (tetris-draw-next-shape) - (when tetris-preview-next-shape - (funcall tetris-draw-next-shape))) - -(advice-add 'tetris-draw-next-shape :around #'tetris-maybe-draw-next-shape) -``` - -This code will modify the behavior of tetris-draw-next-shape, but it can be stored in your config files, safely away from the actual Tetris code. - -Getting rid of the preview box is a simple change. A more drastic change is to make it so that blocks randomly stop in the air: - -![img](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-air.png) - -In that picture, the red I and green T pieces are not falling, they’re set in place. This can make the game almost unplayably hard, but it’s easy to implement. - -As before, we’ll first define a flag: - -``` -(defvar tetris-stop-midair t - "If non-nil, pieces will sometimes stop in the air.") -``` - -Now, the way Emacs Tetris works is something like this. The active piece has x- and y-coordinates. On each clock tick, the y-coordinate is incremented (the piece moves down one row), and then a check is made for collisions. If a collision is detected, the piece is backed out (its y-coordinate is decremented) and set in place. In order to make a piece stop in the air, all we have to do is hack the detection function, tetris-test-shape. - -It doesn’t matter what this function does internally – what matters is that it’s a function of no arguments that returns a boolean value. We need it to return true whenever it normally would (otherwise we risk weird collisions) but also at other times. I’m sure there are a variety of ways this could be done, but here is what I came up with: - -``` -(defun tetris-test-shape-random (tetris-test-shape) - (or (and - tetris-stop-midair - ;; Don't stop on the first shape. - (< 1 tetris-n-shapes ) - ;; Stop every INTERVAL pieces. - (let ((interval 7)) - (zerop (mod tetris-n-shapes interval))) - ;; Don't stop too early (it makes the game unplayable). - (let ((upper-limit 8)) - (< upper-limit tetris-pos-y)) - ;; Don't stop at the same place every time. - (zerop (mod (random 7) 10))) - (funcall tetris-test-shape))) - -(advice-add 'tetris-test-shape :around #'tetris-test-shape-random) -``` - -The hardcoded parameters here were chosen to make the game harder but still playable. I was drunk on an airplane when I decided on them though, so they might need some further tweaking. - -By the way, according to my tetris-scores file, my top score is - -``` -01389 Wed Dec 5 15:32:19 2018 -``` - -The scores in that file are listed up to five digits by default, so that doesn’t seem very good. - -Exercises for the reader - -1. Using advice, modify Emacs Tetris so that it flashes the messsage “OH SHIT” under the scoreboard every time the block moves down. Make the size of the message proportional to the height of the block stack (when there are no blocks, the message should be small or nonexistent, and when the highest block is close to the ceiling, the message should be large). - -2. The version of tetris-test-shape-random given here has every seventh piece stop midair. A player could potentially figure out the interval and use it to their advantage. Modify it to make the interval random in some reasonable range (say, every five to ten pieces). - -3. For a different take on advising Tetris, try out [autotetris-mode][1]. - -4. Come up with an interesting way to mess with the piece-rotation mechanics and then implement it with advice. - -Footnotes -============================================================ - -[1][5] Emacs has just one big global namespace, so function and variable names are typically prefixed with their package name in order to avoid collisions. - -[2][6] A lot of people will tell you that you shouldn’t use an existing namespace prefix and that you should reserve a namespace prefix for anything you define yourself, e.g. my/tetris-preview-next-shape. This is ugly and usually pointless, so I don’t do it. - --------------------------------------------------------------------------------- - -via: https://nickdrozd.github.io/2019/01/14/tetris.html - -作者:[nickdrozd][a] -选题:[lujun9972][b] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://nickdrozd.github.io -[b]: https://github.com/lujun9972 -[1]: https://nullprogram.com/blog/2014/10/19/ -[2]: https://nickdrozd.github.io/2019/01/14/tetris.html#fn.1 -[3]: https://nickdrozd.github.io/2019/01/14/tetris.html#fn.2 -[4]: https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html -[5]: https://nickdrozd.github.io/2019/01/14/tetris.html#fnr.1 -[6]: https://nickdrozd.github.io/2019/01/14/tetris.html#fnr.2 diff --git a/translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md b/translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md new file mode 100644 index 0000000000..81d107ec69 --- /dev/null +++ b/translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md @@ -0,0 +1,161 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Some Advice for How to Make Emacs Tetris Harder) +[#]: via: (https://nickdrozd.github.io/2019/01/14/tetris.html) +[#]: author: (nickdrozd https://nickdrozd.github.io) + +让 Emacs 俄罗斯方块变得更难的一些建议 (Advice) +====== + +你知道吗,**Emacs** 与 **俄罗斯方块** 的实现捆绑在一起了?只需要输入 `M-x tetris` 就行了。 + +![img](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-normal.png) + +在文本编辑器讨论中,Emacs 倡导者经常提到这一点。“没错,但是那个编辑器能运行俄罗斯方块吗?” +我很好奇,这会让大家相信 Emacs 更优秀吗?比如,为什么有人会关心他们是否可以在文本编辑器中玩游戏呢?“是的,但是那台吸尘器能播放 mp3 吗?” + +有人说,俄罗斯方块总是很有趣的。像 Emacs 中的所有东西一样,它的源代码是开放的,易于检查和修改,因此 **我们可以使它变得更加有趣**。所谓更多的乐趣,我意思是更难。 + +让游戏变得更困难的一个最简单的方法就是“不要下一个块预览”。你无法再在知道下一个块会填满空间的情况下有意地将 S/Z 块放在一个危险的位置——你必须碰碰运气,希望出现最好的情况。 +下面是没有预览的情况(如你所见,没有预览,我做出的某些选择带来了“可怕的后果”): + +![img](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-no-preview.png) + +预览框由一个名为 `tetris-draw-next-shape` 的函数设置: + +``` +(defun tetris-draw-next-shape () + (dotimes (x 4) + (dotimes (y 4) + (gamegrid-set-cell (+ tetris-next-x x) + (+ tetris-next-y y) + tetris-blank))) + (dotimes (i 4) + (let ((tetris-shape tetris-next-shape) + (tetris-rot 0)) + (gamegrid-set-cell (+ tetris-next-x + (aref (tetris-get-shape-cell i) 0)) + (+ tetris-next-y + (aref (tetris-get-shape-cell i) 1)) + tetris-shape)))) +``` + +首先,我们引入一个标志,决定是否允许显示下一个预览块: + +``` +(defvar tetris-preview-next-shape nil + "When non-nil, show the next block the preview box.") +``` + +现在的问题是,我们如何才能让 `tetris-draw-next-shape` 遵从这个标志?最明显的方法是重新定义它: + +``` +(defun tetris-draw-next-shape () + (when tetris-preview-next-shape + ;; existing tetris-draw-next-shape logic + )) +``` + +但这不是理想的解决方案。同一个函数有两个定义,这很容易引起混淆,如果上游版本发生变化,我们必须维护修改后的定义。 + +一个更好的方法是使用 **advice**。Emacs 的 advice 类似于 **Python 装饰器**,但是更加灵活,因为 advice 可以从任何地方添加到函数中。这意味着我们可以修改函数而不影响原始的源文件。 + +有很多不同的方法使用 Emacs advice([ 查看手册 ][4]),但是这里我们只使用 `advice-add` 函数和 `:around` 标志。advise 函数将原始函数作为参数,原始函数可能执行也可能不执行。我们这里,我们让原始函数只有在预览标志是非空的情况下才能执行: + +``` +(defun tetris-maybe-draw-next-shape (tetris-draw-next-shape) + (when tetris-preview-next-shape + (funcall tetris-draw-next-shape))) + +(advice-add 'tetris-draw-next-shape :around #'tetris-maybe-draw-next-shape) +``` + +这段代码将修改 `tetris-draw-next-shape` 的行为,而且它可以存储在配置文件中,与实际的俄罗斯方块代码分离。 + +去掉预览框是一个简单的改变。一个更激烈的变化是,**让块随机停止在空中**: + +![img](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-air.png) + +本图中,红色的 I 和绿色的 T 部分没有掉下来,它们被固定下来了。这会让游戏变得 **及其难玩**,但却很容易实现。 + +和前面一样,我们首先定义一个标志: + +``` +(defvar tetris-stop-midair t + "If non-nil, pieces will sometimes stop in the air.") +``` + +目前,**Emacs 俄罗斯方块的工作方式** 类似这样子:活动部件有 x 和 y 坐标。在每个时钟滴答声中,y 坐标递增(块向下移动一行),然后检查是否有与现存的块重叠。 +如果检测到重叠,则将该块回退(其 y 坐标递减)并设置该活动块到位。为了让一个块在半空中停下来,我们所要做的就是破解检测函数 `tetris-test-shape`。 + +**这个函数内部做什么并不重要** —— 重要的是它是一个返回布尔值的无参数函数。我们需要它在正常情况下返回布尔值 true( 否则我们将出现奇怪的重叠情况),但在其他时候也需要它返回 true。我相信有很多方法可以做到这一点,以下是我的方法的: + +``` +(defun tetris-test-shape-random (tetris-test-shape) + (or (and + tetris-stop-midair + ;; Don't stop on the first shape. + (< 1 tetris-n-shapes ) + ;; Stop every INTERVAL pieces. + (let ((interval 7)) + (zerop (mod tetris-n-shapes interval))) + ;; Don't stop too early (it makes the game unplayable). + (let ((upper-limit 8)) + (< upper-limit tetris-pos-y)) + ;; Don't stop at the same place every time. + (zerop (mod (random 7) 10))) + (funcall tetris-test-shape))) + +(advice-add 'tetris-test-shape :around #'tetris-test-shape-random) +``` + +这里的硬编码参数使游戏变得更困难,但仍然可玩。当时我在飞机上喝醉了,所以它们可能需要进一步调整。 + +顺便说一下,根据我的 `tetris-scores` 文件,我的 **最高分** 是 + +``` +01389 Wed Dec 5 15:32:19 2018 +``` + +该文件中列出的分数默认最多为五位数,因此这个分数看起来不是很好。 + +**给读者的练习** + +1。使用 advice 修改 Emacs 俄罗斯方块,使得每当方块下移动时就闪烁显示讯息 “OH SHIT”。消息的大小与块堆的高度成比例(当没有块时,消息应该很小的或不存在的,当最高块接近天花板时,消息应该很大)。 + +2。在这里给出的 `tetris-test-shape-random` 版本中,每隔七格就有一个半空中停止。一个玩家有可能能计算出时间间隔,并利用它来获得优势。修改它,使间隔随机在一些合理的范围内(例如,每 5 到 10 格)。 + +3。另一个对使用 Tetris 使用 advise 的场景,你可以试试 [`autotetris-mode`][1]。 + +4。想出一个有趣的方法来打乱块的旋转机制,然后使用 advice 来实现它。 + + +附注 +============================================================ + +[1][5] Emacs 只有一个巨大的全局命名空间,因此函数和变量名一般以包名做前缀以避免冲突。 + +[2][6] 很多人会说你不应该使用已有的命名空间前缀而且应该将自己定义的所有东西都放在一个预留的命名空间中,比如像这样 `my/tetris-preview-next-shape`,然而这样很难看而且没什么意义,因此我不会这么干。 + +-------------------------------------------------------------------------------- + +via: https://nickdrozd.github.io/2019/01/14/tetris.html + +作者:[nickdrozd][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://nickdrozd.github.io +[b]: https://github.com/lujun9972 +[1]: https://nullprogram.com/blog/2014/10/19/ +[2]: https://nickdrozd.github.io/2019/01/14/tetris.html#fn.1 +[3]: https://nickdrozd.github.io/2019/01/14/tetris.html#fn.2 +[4]: https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html +[5]: https://nickdrozd.github.io/2019/01/14/tetris.html#fnr.1 +[6]: https://nickdrozd.github.io/2019/01/14/tetris.html#fnr.2 From ce2f820078dac5191a4262ab7e42e7ed2fa96d39 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Feb 2020 21:57:49 +0800 Subject: [PATCH 131/315] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @qianmingtian 这篇用心了! --- .../20200217 How to install Vim plugins.md | 75 +++++++++---------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/translated/tech/20200217 How to install Vim plugins.md b/translated/tech/20200217 How to install Vim plugins.md index b21da86139..ebf48b1c4f 100644 --- a/translated/tech/20200217 How to install Vim plugins.md +++ b/translated/tech/20200217 How to install Vim plugins.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (qianmingtian) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to install Vim plugins) @@ -10,74 +10,73 @@ 如何安装 Vim 插件 ====== -无论你是手动安装还是通过包管理器安装,插件都可以帮你为你的工作流中打造一个完美的 Vim 。 -![Team checklist and to dos][1] +> 无论你是手动安装还是通过包管理器安装,插件都可以帮助你在工作流中打造一个完美的 Vim 。 -虽然 [Vim][2] 是快速且高效的,但在默认情况下,它仅仅只是一个文本编辑器。至少,这就是没有插件的情况 Vim 应当具备的样子,插件构建在 Vim 之上,并添加额外的功能,使 Vim 不仅仅是一个输入文本的窗口。有了合适的插件组合,你可以控制你的生活,形成你自己独特的 Vim 体验。你可以[自定义你的主题][3],你可以添加语法高亮,代码 linting ,版本跟踪器等等。 +![](https://img.linux.net.cn/data/attachment/album/202002/23/215719kwhqzwwj1ezoen6o.jpg) + +虽然 [Vim][2] 是快速且高效的,但在默认情况下,它仅仅只是一个文本编辑器。至少,这就是没有插件的情况 Vim 应当具备的样子,插件构建在 Vim 之上,并添加额外的功能,使 Vim 不仅仅是一个输入文本的窗口。有了合适的插件组合,你可以控制你的生活,形成你自己独特的 Vim 体验。你可以[自定义你的主题][3],你可以添加语法高亮,代码 linting,版本跟踪器等等。 ### 怎么安装 Vim 插件 -Vim 可以通过插件进行扩展,但很长一段时间以来,并没有官方的安装方式去安装这些插件。从 Vim 8 开始,有一个关于插件如何安装和加载的结构。你可能会在网上或项目自述文件中遇到旧的说明,但只要你运行 Vim 8 或更高版本,你应该根据 Vim 的[官方插件安装方法][4]安装或使用 Vim 包管理器。您可以使用包管理器,无论你运行的是什么版本(包括比 8.x 更老的版本),这使得安装过程比您自己维护更新更容易。 +Vim 可以通过插件进行扩展,但很长一段时间以来,并没有官方的安装方式去安装这些插件。从 Vim 8 开始,有一个关于插件如何安装和加载的结构。你可能会在网上或项目自述文件中遇到旧的说明,但只要你运行 Vim 8 或更高版本,你应该根据 Vim 的[官方插件安装方法][4]安装或使用 Vim 包管理器。你可以使用包管理器,无论你运行的是什么版本(包括比 8.x 更老的版本),这使得安装过程比你自己维护更新更容易。 手动和自动安装方法都值得了解,所以请继续阅读以了解这两种方法。 -### 手动安装插件( Vim 8 及以上版本) +### 手动安装插件(Vim 8 及以上版本) -Vim 包是一个包含一个或多个插件的目录。默认情况下,你的 Vim 设置包含在 **~/.vim** 中,这是 vim 在启动时寻找插件的地方。(下面的示例使用了通用名称 **vendor** 来表示插件是从一个不是你的实体获得的。) +所谓的 “Vim 包”是一个包含一个或多个插件的目录。默认情况下,你的 Vim 设置包含在 `~/.vim` 中,这是 Vim 在启动时寻找插件的地方。(下面的示例使用了通用名称 `vendor` 来表示插件是从其它地方获得的。) -当你启动 Vim 时,它首先处理你的 **.vimrc**文件,然后扫描 **~/.vim** 中的所有目录查找包含在 **pack/*/start** 中的插件。 +当你启动 Vim 时,它首先处理你的 `.vimrc`文件,然后扫描 `~/.vim` 中的所有目录,查找包含在 `pack/*/start` 中的插件。 -默认情况下,你的 **~/.vim** 目录(如果你有一个)没有这样的文件结构,所以设置为: +默认情况下,你的 `~/.vim` 目录(如果你有的话)中没有这样的文件结构,所以设置为: ``` -`$ mkdir -p ~/.vim/pack/vendor/start` +$ mkdir -p ~/.vim/pack/vendor/start ``` -现在,你可以将 Vim 插件放在 **~/.vim/pack/vendor/start** 中,它们会在你启动 Vim 时自动加载。 - -例如,尝试安装一下 [NERDTree][5] ,一个基于文本的 Vim 文件管理器。首先,使用 Git 克隆 NERDTree 存储库的快照: +现在,你可以将 Vim 插件放在 `~/.vim/pack/vendor/start` 中,它们会在你启动 Vim 时自动加载。 +例如,尝试安装一下 [NERDTree][5],这是一个基于文本的 Vim 文件管理器。首先,使用 Git 克隆 NERDTree 存储库的快照: ``` $ git clone --depth 1 \ -  \ +  https://github.com/preservim/nerdtree.git \   ~/.vim/pack/vendor/start/nerdtree ``` -启动 Vim 或者 gvim ,然后键入如下命令: - +启动 Vim 或者 gvim,然后键入如下命令: ``` -`:NERDTree` +:NERDTree ``` Vim 窗口左侧将打开一个文件树。 ![NERDTree plugin][6] -如果你不想每次启动 Vim 时自动加载插件,你可以在 **~/.vim/pack/vendor** 中创建 **opt** 文件夹: +如果你不想让一个插件每次启动 Vim 时都自动加载,你可以在 `~/.vim/pack/vendor` 中创建 `opt` 文件夹: ``` -`$ mkdir ~/.vim/pack/vendor/opt` +$ mkdir ~/.vim/pack/vendor/opt ``` -任何安装到 **opt** 的插件都可被 Vim 使用,但是只有当你使用 **packadd** 命令将它们添加到一个会话中时,它们才会被加载到内存中。例如,一个虚构的叫 foo 的插件: +任何安装到 `opt` 的插件都可被 Vim 使用,但是只有当你使用 `packadd` 命令将它们添加到一个会话中时,它们才会被加载到内存中。例如,一个虚构的叫 foo 的插件: ``` -`:packadd foo` +:packadd foo ``` -Vim 官方建议每个插件项目在 **~/.Vim /pack** 中有自己的目录。例如,如果你要安装 NERDTree 插件和假想的 foo 插件,你需要创建这样的目录结构: +Vim 官方建议每个插件项目在 `~/.Vim/pack` 中创建自己的目录。例如,如果你要安装 NERDTree 插件和假想的 foo 插件,你需要创建这样的目录结构: ``` $ mkdir -p ~/.vim/pack/NERDTree/start/ $ git clone --depth 1 \ -  \ -  ~/.vim/pack/NERDTree/start/NERDTree + https://github.com/preservim/nerdtree.git \ + ~/.vim/pack/NERDTree/start/NERDTree $ mkdir -p ~/.vim/pack/foo/start/ $ git clone --depth 1 \ -  \ -  ~/.vim/pack/foo/start/foo + https://notabug.org/foo/foo.git \ + ~/.vim/pack/foo/start/foo ``` 这样做是否方便取决于你。 @@ -88,14 +87,14 @@ $ git clone --depth 1 \ #### 使用 vim-plug 安装插件 -安装 vim-plug ,以便它在启动时自动加载: +安装 vim-plug,以便它在启动时自动加载: ``` $ curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ -  +  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim ``` -创建一个 **~/.vimrc** 文件(如果你还没有文件),然后输入以下文本: +创建一个 `~/.vimrc` 文件(如果你还没有这个文件),然后输入以下文本: ``` call plug#begin() @@ -103,38 +102,38 @@ Plug 'preservim/NERDTree' call plug#end() ``` -每次要安装插件时,都必须在 **plug#begin()** 和 **plug#end()** 之间输入插件的名称和位置(上面以 NERDTree 文件管理器为例。)。如果你所需的插件未托管在 GitHub 上,你可以提供完整的 URL ,而不仅仅是 GitHub 用户名和项目 ID 。你甚至可以在 **~/.vim** 目录之外“安装”本地插件。 +每次要安装插件时,都必须在 `plug#begin()` 和 `plug#end()` 之间输入插件的名称和位置(上面以 NERDTree 文件管理器为例)。如果你所需的插件未托管在 GitHub 上,你可以提供完整的 URL,而不仅仅是 GitHub 的用户名和项目 ID。你甚至可以在 `~/.vim` 目录之外“安装”本地插件。 -最后,启动 Vim 并提示 vim-plug 安装 **~/.vimrc** 中列出的插件: +最后,启动 Vim 并提示 vim-plug 安装 `~/.vimrc` 中列出的插件: ``` -`:PlugInstall` +:PlugInstall ``` 等待插件下载。 #### 通过 vim-plug 更新插件 -与手动安装过程相比,编辑 **~/.vimrc** 并使用命令来进行安装可能看起来并没有多省事,但是 vim-plug 的真正优势在更新。更新所有安装的插件,使用这个 Vim 命令: +与手动安装过程相比,编辑 `~/.vimrc` 并使用命令来进行安装可能看起来并没有多省事,但是 vim-plug 的真正优势在更新。更新所有安装的插件,使用这个 Vim 命令: ``` -`:PlugUpdate` +:PlugUpdate ``` 如果你不想更新所有的插件,你可以通过添加插件的名字来更新任何插件: ``` -`:PlugUpdate NERDTree` +:PlugUpdate NERDTree ``` #### 恢复插件 -vim-plug 的另一个优点是它的导出和恢复功能。 Vim 用户都知道,正是插件的缘故,通常每个用户使用 Vim 的工作方式都是独一无二的。一旦你安装和配置了正确的插件组合,你最不想要的就是再也找不到它们。 +vim-plug 的另一个优点是它的导出和恢复功能。Vim 用户都知道,正是插件的缘故,通常每个用户使用 Vim 的工作方式都是独一无二的。一旦你安装和配置了正确的插件组合,你最不想要的局面就是再也找不到它们。 Vim-plug 有这个命令来生成一个脚本来恢复所有当前的插件: ``` -`:PlugSnapshot ~/vim-plug.list` +:PlugSnapshot ~/vim-plug.list ``` vim-plug 还有许多其他的功能,所以请参考它的[项目页面][7]以获得完整的文档。 @@ -151,7 +150,7 @@ via: https://opensource.com/article/20/2/how-install-vim-plugins 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[qianmingtian][c] -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3842f6d12347623771c5f4f807e346222647ac06 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 23 Feb 2020 21:58:21 +0800 Subject: [PATCH 132/315] PUB @qianmingtian https://linux.cn/article-11923-1.html --- .../tech => published}/20200217 How to install Vim plugins.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200217 How to install Vim plugins.md (99%) diff --git a/translated/tech/20200217 How to install Vim plugins.md b/published/20200217 How to install Vim plugins.md similarity index 99% rename from translated/tech/20200217 How to install Vim plugins.md rename to published/20200217 How to install Vim plugins.md index ebf48b1c4f..f3ce601e53 100644 --- a/translated/tech/20200217 How to install Vim plugins.md +++ b/published/20200217 How to install Vim plugins.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (qianmingtian) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11923-1.html) [#]: subject: (How to install Vim plugins) [#]: via: (https://opensource.com/article/20/2/how-install-vim-plugins) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From e42379b313a5d3823c4a0a1da31547714114f8fa Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 24 Feb 2020 00:55:54 +0800 Subject: [PATCH 133/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200224=2017=20C?= =?UTF-8?q?ool=20Arduino=20Project=20Ideas=20for=20DIY=20Enthusiasts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200224 17 Cool Arduino Project Ideas for DIY Enthusiasts.md --- ...duino Project Ideas for DIY Enthusiasts.md | 272 ++++++++++++++++++ 1 file changed, 272 insertions(+) create mode 100644 sources/tech/20200224 17 Cool Arduino Project Ideas for DIY Enthusiasts.md diff --git a/sources/tech/20200224 17 Cool Arduino Project Ideas for DIY Enthusiasts.md b/sources/tech/20200224 17 Cool Arduino Project Ideas for DIY Enthusiasts.md new file mode 100644 index 0000000000..2cfe9c1872 --- /dev/null +++ b/sources/tech/20200224 17 Cool Arduino Project Ideas for DIY Enthusiasts.md @@ -0,0 +1,272 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (17 Cool Arduino Project Ideas for DIY Enthusiasts) +[#]: via: (https://itsfoss.com/cool-arduino-projects/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +17 Cool Arduino Project Ideas for DIY Enthusiasts +====== + +[Arduino][1] is an open-source electronics platform that combines both open source software and hardware to let people make interactive projects with ease. You can get Arduino-compatible [single board computers][2] and use them to make something useful. + +In addition to the hardware, you will also need to know the [Arduino language][3] to use the [Arduino IDE][4] to successfully create something. + +You can code using the web editor or use the Arduino IDE offline. Nevertheless, you can always refer to the [official resources][5] available to learn about Arduino. + +Considering that you know the essentials, I will be mentioning some of the best (or interesting) Arduino projects. You can try to make them for yourself or modify them to come up with something of your own. + +### Interesting Arduino project ideas for beginners, experts, everyone + +![][6] + +The following projects need a variety of additional hardware – so make sure to check out the official link to the projects (_originally featured on the [official Arduino Project Hub][7]_) to learn more about them. + +Also, it is worth noting that they aren’t particularly in any ranking order – so feel free to try what sounds best to you. + +#### 1\. LED Controller + +Looking for simple Arduino projects? Here’s one for you. + +One of the easiest projects that let you control LED lights. Yes, you do not have to opt for expensive LED products just to decorate your room (or for any other use-case), you can simply make an LED controller and customize it to use it however you want. + +It requires using the [Arduino UNO board][8] and a couple more things (which also includes an Android phone). You can learn more about it in the link to the project below. + +[LED Controller][9] + +#### 2\. Hot Glue LED Matrix Lamp + +![][10] + +Another Arduino LED project for you. Since we are talking about using LEDs to decorate, you can also make an LED lamp that looks beautiful. + +For this, you might want to make sure that you have a 3D printer. Next, you need an LED strip and **Arduino Nano R3** as the primary materials. + +Once you’ve printed the case and assembled the lamp section, all you need to do is to add the glue sticks and figure out the wiring. It does sound very simple to mention – you can learn more about it on the official Arduino project feature site. + +[LED Matrix Lamp][11] + +#### 3\. Arduino Mega Chess + +![][12] + +Want to have a personal digital chessboard? Why not? + +You’ll need a TFT LCD touch screen display and an [Arduino Mega 2560][13] board as the primary materials. If you have a 3D printer, you can create a pretty case for it and make changes accordingly. + +Take a look at the original project for inspiration. + +[Arduino Mega Chess][14] + +#### 4\. Enough Already: Mute My TV + +A very interesting project. I wouldn’t argue the usefulness of it – but if you’re annoyed by certain celebrities (or personalities) on TV, you can simply mute their voice whenever they’re about to speak something on TV. + +Technically, it was tested with the old tech back then (when you didn’t really stream anything). You can watch the video above to get an idea and try to recreate it or simply head to the link to read more about it. + +[Mute My TV][15] + +#### 5\. Robot Arm with Controller + +![][16] + +If you want to do something with the help of your robot and still have manual control over it, the robot arm with a controller is one of the most useful Arduino projects. It uses the [Arduino UNO board][8] if you’re wondering. + +You will have a robot arm -for which you can make a case using the 3D printer to enhance its usage and you can use it for a variety of use-cases. For instance, to clean the carbage using the robot arm or anything similar where you don’t want to directly intervene. + +[Robotic Arm With Controller][17] + +#### 6\. Make Musical Instrument Using Arduino + +I’ve seen a variety of musical instruments made using Arduino. You can explore the Internet if you want something different than this. + +You would need a [Pi supply flick charge][18] and an **Arduino UNO** to make it happen. It is indeed a cool Arduino project where you get to simply tap and your hand waves will be converted to music. Also, it isn’t tough to make this – so you should have a lot of fun making this. + +[Musical Instrument using Arduino][19] + +#### 7\. Pet Trainer: The MuttMentor + +An Arduino-based device that assists you to help train your pet – sounds exciting! + +For this, they’re using the [Arduino Nano 33 BLE Sense][20] while utilizing TensorFlow to train a small neural network for all the common actions that your pet does. Accordingly, the buzzer will offer a reinforcing notification when your pet obeys your command. + +This can have wide applications when tweaked as per your requirements. Check out the details below. + +[The MuttMentor][21] + +#### 8\. Basic Earthquake Detector + +Normally, you depend on the government officials to announce/inform about the earthquake stats (or the warning for it). + +But with Arduino boards, you can simply build a basic earthquake detector and have transparent results for yourself without depending on the authorities. Click on the button below to know about the relevant details to help make it. + +[Basic Earthquake Detector][22] + +#### 9\. Security Access Using RFID Reader + +![][23] + +As the project describes – “_RFID tagging is an ID system that uses small radio frequency identification_ “. + +So, in this project, you will be making an RFID reader using Arduino while pairing it with an [Adafruit NFC card][24] for security access. Check out the full details using the button below and let me know how it works for you. + +[Security Access using RFID reader][25] + +#### 10\. Smoke Detection using MQ-2 Gas Sensor + +![][26] + +This could be potentially one of the best Arduino projects out there. You don’t need to spend a lot of money to equip smoke detectors for your home, you can manage with a DIY solution to some extent. + +Of course, unless you want a complex failsafe set up along with your smoke detector, a basic inexpensive solution should do the trick. In either case, you can also find other applications for the smoke detector. + +[Smoke Detector][27] + +#### 11\. Arduino Based Amazon Echo using 1Sheeld + +![][28] + +In case you didn’t know [1Sheeld][29] basically replaces the need for an add-on Arduino board. You just need a smartphone and add Arduino shields to it so that you can do a lot of things with it. + +Using 5 such shields, the original creator of this project made himself a DIY Amazon Echo. You can find all the relevant details, schematics, and code to make it happen. + +[DIY Amazon Echo][30] + +#### 12\. Audio Spectrum Visualizer + +![][31] + +Just want to make something cool? Well, here’s an idea for an audio spectrum visualizer. + +For this, you will need an Arduino Nano R3 and an LED display as primary materials to get started with. You can tweak the display as required. You can connect it with your headphone output or simply a line-out amplifier. + +Easily one of the cheapest Arduino projects that you can try for fun. + +[Audio Spectrum Visualizer][32] + +#### 13\. Motion Following Motorized Camera + +![][33] + +Up for a challenge? If you are – this will be one of the coolest Arduino Projects in our list. + +Basically, this is meant to replace your home security camera which is limited to an angle of video recording. You can turn the same camera into a motorized camera that follows the motion. + +So, whenever it detects a movement, it will change its angle to try to follow the object. You can read more about it to find out how to make it. + +[Motion Following Motorized Camera][34] + +#### 14\. Water Quality Monitoring System + +![][35] + +If you’re concerned about your health in connection to the water you drink, you can try making this. + +It requires an Arduino UNO and the water quality sensors as the primary materials. To be honest, a useful Arduino project to go for. You can find everything you need to make this in the link below. + +[Water Quality Monitoring System][36] + +#### 15\. Punch Activated Arm Flamethrower + +I would be very cautious about this – but seriously, one of the best (and coolest) Arduino projects I’ve ever come across. + +Of course, this counts as a fun project to try out to see what bigger projects you can pull off using Arduino and here it is. In the project, he originally used the [SparkFun Arduino Pro Mini 328][37] along with an accelerometer as the primary materials. + +[Punch Activated Flamethrower][38] + +#### 16\. Polar Drawing Machine + +![][39] + +This isn’t any ordinary plotter machine that you might’ve seen people creating using Arduino boards. + +With this, you can draw some cool vector graphics images or bitmap. It might sound like bit of overkill but then it could also be fun to do something like this. + +This could be a tricky project, so you can refer to the details on the link to go through it thoroughly. + +[Polar Drawing Machine][40] + +#### 17\. Home Automation + +Technically, this is just a broad project idea because you can utilize the Arduino board to automate almost anything you want at your home. + +Just like I mentioned, you can go for a security access device, maybe create something that automatically waters the plants or simply make an alarm system. + +Countless possibilities of what you can do to automate things at your home. For reference, I’ve linked to an interesting home automation project below. + +[Home Automation][41] + +#### Bonus: Robot Cat (OpenCat) + +![][42] + +A programmable robotic cat for AI-enhanced services and STEM education. In this project, both Arduino and Raspberry Pi boards have been utilized. + +You can also look at the [Raspberry Pi alternatives][2] if you want. This project needs a lot of work, so you would want to invest a good amount of time to make it work. + +[OpenCat][43] + +**Wrapping Up** + +With the help of Arduino boards (coupled with other sensors and materials), you can do a lot of projects with ease. Some of the projects that I’ve listed above are suitable for beginners and some are not. Feel free to take your time to analyze what you need and the cost of the project before proceeding. + +Did I miss listing an interesting Arduino project that deserves the mention here? Let me know your thoughts in the comments. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/cool-arduino-projects/ + +作者:[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://www.arduino.cc/ +[2]: https://itsfoss.com/raspberry-pi-alternatives/ +[3]: https://www.arduino.cc/reference/en/ +[4]: https://www.arduino.cc/en/main/software +[5]: https://www.arduino.cc/en/Guide/HomePage +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/arduino-project-ideas.jpg?ssl=1 +[7]: https://create.arduino.cc/projecthub +[8]: https://store.arduino.cc/usa/arduino-uno-rev3 +[9]: https://create.arduino.cc/projecthub/mayooghgirish/arduino-bluetooth-basic-tutorial-d8b737?ref=platform&ref_id=424_trending___&offset=89 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/led-matrix-lamp.jpg?ssl=1 +[11]: https://create.arduino.cc/projecthub/john-bradnam/hot-glue-led-matrix-lamp-42322b?ref=platform&ref_id=424_trending___&offset=42 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/arduino-chess-board.jpg?ssl=1 +[13]: https://store.arduino.cc/usa/mega-2560-r3 +[14]: https://create.arduino.cc/projecthub/Sergey_Urusov/arduino-mega-chess-d54383?ref=platform&ref_id=424_trending___&offset=95 +[15]: https://makezine.com/2011/08/16/enough-already-the-arduino-solution-to-overexposed-celebs/ +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/robotic-arm-controller.jpg?ssl=1 +[17]: https://create.arduino.cc/projecthub/H0meMadeGarbage/robot-arm-with-controller-2038df?ref=platform&ref_id=424_trending___&offset=13 +[18]: https://uk.pi-supply.com/products/flick-hat-3d-tracking-gesture-hat-raspberry-pi +[19]: https://create.arduino.cc/projecthub/lanmiLab/make-musical-instrument-using-arduino-and-flick-large-e2890b?ref=platform&ref_id=424_trending___&offset=24 +[20]: https://store.arduino.cc/usa/nano-33-ble-sense +[21]: https://create.arduino.cc/projecthub/whatsupdog/the-muttmentor-9d9753?ref=platform&ref_id=424_trending___&offset=44 +[22]: https://www.instructables.com/id/Basic-Arduino-Earthquake-Detector/ +[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/security-access-arduino.jpg?ssl=1 +[24]: https://www.adafruit.com/product/359 +[25]: https://create.arduino.cc/projecthub/Aritro/security-access-using-rfid-reader-f7c746?ref=platform&ref_id=424_trending___&offset=85 +[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/smoke-detection-arduino.jpg?ssl=1 +[27]: https://create.arduino.cc/projecthub/Aritro/smoke-detection-using-mq-2-gas-sensor-79c54a?ref=platform&ref_id=424_trending___&offset=89 +[28]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/diy-amazon-echo.jpg?ssl=1 +[29]: https://1sheeld.com/ +[30]: https://create.arduino.cc/projecthub/ahmedismail3115/arduino-based-amazon-echo-using-1sheeld-84fa6f?ref=platform&ref_id=424_trending___&offset=91 +[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/audio-spectrum-visualizer.jpg?ssl=1 +[32]: https://create.arduino.cc/projecthub/Shajeeb/32-band-audio-spectrum-visualizer-analyzer-902f51?ref=platform&ref_id=424_trending___&offset=87 +[33]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/motion-following-camera.jpg?ssl=1 +[34]: https://create.arduino.cc/projecthub/lindsi8784/motion-following-motorized-camera-base-61afeb?ref=platform&ref_id=424_trending___&offset=86 +[35]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/water-quality-monitoring.jpg?ssl=1 +[36]: https://create.arduino.cc/projecthub/chanhj/water-quality-monitoring-system-ddcb43?ref=platform&ref_id=424_trending___&offset=93 +[37]: https://www.sparkfun.com/products/11113 +[38]: https://create.arduino.cc/projecthub/Advanced/punch-activated-arm-flamethrowers-real-firebending-95bb80 +[39]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/polar-drawing-machine.jpg?ssl=1 +[40]: https://create.arduino.cc/projecthub/ArduinoFT/polar-drawing-machine-f7a05c?ref=search&ref_id=drawing&offset=2 +[41]: https://create.arduino.cc/projecthub/ahmedel-hinidy2014/home-management-system-control-your-home-from-a-website-076846?ref=search&ref_id=home%20automation&offset=4 +[42]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/opencat.jpg?ssl=1 +[43]: https://create.arduino.cc/projecthub/petoi/opencat-845129?ref=platform&ref_id=424_popular___&offset=8 From 065112e562fb5c16bcdde4b06b17e4bca0b2fd19 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 24 Feb 2020 00:56:31 +0800 Subject: [PATCH 134/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200224=20Discus?= =?UTF-8?q?sing=20Past,=20Present=20and=20Future=20of=20FreeBSD=20Project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200224 Discussing Past, Present and Future of FreeBSD Project.md --- ..., Present and Future of FreeBSD Project.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20200224 Discussing Past, Present and Future of FreeBSD Project.md diff --git a/sources/tech/20200224 Discussing Past, Present and Future of FreeBSD Project.md b/sources/tech/20200224 Discussing Past, Present and Future of FreeBSD Project.md new file mode 100644 index 0000000000..4a02a80f20 --- /dev/null +++ b/sources/tech/20200224 Discussing Past, Present and Future of FreeBSD Project.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Discussing Past, Present and Future of FreeBSD Project) +[#]: via: (https://itsfoss.com/freebsd-interview-deb-goodkin/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Discussing Past, Present and Future of FreeBSD Project +====== + +[FreeBSD][1] is one of the most popular BSD distributions. It is used on desktop, servers and embedded devices for more than two decades. + +We talked to Deb Goodkin, executive director, [FreeBSD Foundation][2] and discussed the past, present and future of FreeBSD project. + +![][3] + +**It’s FOSS: FreeBSD has been in the scene for more than 25 years. How do you see the journey of FreeBSD? ** + +Over the years, we’ve seen a lot of innovation happening on and with FreeBSD. When the Foundation came into play 20 years ago, we were able to step in and help accelerate changes in the operating system. Over the years, we’ve increased our marketing support, to provide more advocacy and educational material, and to increase the awareness and use of FreeBSD. + +In addition, we’ve increased our staff of software developers to allow us to quickly step in to fix bugs, review patches, implement workarounds to hardware issues, and implement new features and functionality. We have also increased the number of development projects we are funding to improve various areas of FreeBSD. + +The history of stability and reliability, along with all the improvements and growth with FreeBSD, is making it a compelling choice for companies, universities, and individuals. + +**It’s FOSS: We know that Netflix uses FreeBSD extensively. What other companies or groups rely on FreeBSD? How do they contribute to BSD/FreeBSD (if they do at all)?** + +Sony’s Playstation 4 uses a modified version of FreeBSD as their operating system, Apple with their MacOS and iOS, NetApp in their ONTAP product, Juniper Networks  in [JunOS][4], Trivago in their backend infrastructure, University of Cambridge in security research including the Capability Hardware Enhanced RISC Instruction (CHERI) project, University of Notre Dame in their Engineering Department, Groupon in their datacenter, LA Times in their data center, as well as, other notable companies like Panasonic, and Nintendo. + +I listed a variety of organizations to highlight the different FreeBSD use cases. Companies like [Netflix support FreeBSD][5] by supporting the Project financially, as well as, by upstreaming their code. Some of the companies, like Sony, take advantage of the BSD license and don’t give back at all.  + +![Deb Goodkin And Friend Promoting FreeBSD At Oscon][6] + +**It’s FOSS: Linux is ruling the servers and cloud computing. It seems that BSD is lagging in that field?** + +I wouldn’t characterize it as lagging, per se. Linux distributions do have a much higher market share than FreeBSD, but our strength falls in those two markets. FreeBSD does extremely well in these markets, because it provides a consistent and reliable foundation, and tends to just work. Known for having long term API stability, the user will integrate once and upgrade on their terms as both FreeBSD and their product evolves.  + +**It’s FOSS: Do you see the emergence of Linux as a threat to BSD? ** + +Sure, [there are so many Linux distributions][7] already, and most of them are supported by for profit companies. In fact, companies like Intel have many Linux developers on staff, so Linux is easily supported on their hardware. + +However, thanks to the continuing education efforts and as our market share continues to grow, more developers will be available to support companies’ various FreeBSD use cases.  + +**It’s FOSS: Let’s talk about desktop. Recently, the devs of Project Trident announced that they were moving away from FreeBSD as a base. They said that they made this decision because FreeBSD is slow to review updates and support for new hardware. For example, the most recent version of Telegram on FreeBSD is 9 releases behind the version available on Linux. How would you respond to their comments?** + +There are quite a few FreeBSD distros for the desktop, with various focuses. The latest, is [FuryBSD][8], which coincidentally was started by iXsystems employees, but is independent of iXsystems, just like Project Trident is. In addition to FuryBSD, you may want to check out [NomadBSD][9] and [MidnightBSD][10]. + +Regarding supporting new hardware, we’ve stepped up our efforts to get FreeBSD working on more popular newer laptops. For example, the Foundation recently purchased a couple of the latest generation Lenovo X1 Carbon laptops and sponsored work to make sure that peripherals are supported out-of-the-box. + +**It’s FOSS: Why should a desktop user consider choosing FreeBSD?** + +There are many reasons people should consider using FreeBSD on their desktop! Just to highlight a few, it has rock solid stability; high performance; supports [ZFS][11] to protect your data; a community that is friendly, helpful, and approachable; excellent documentation to easily find answers; over 30,000 open source software packages that are easy to install, allowing you to easily set up your environment without a lot of extras, and that includes many choices of popular GUIs, and it follows the POLA philosophy ([Principle of Least Astonishment][12]) which means, don’t break things that work and upgrades are generally painless (even across major releases).  + +**It’s FOSS: Are there any plans to make it easier to install FreeBSD as a desktop system? The current focus seems to be on servers.** + +The Foundation is supporting efforts to make sure FreeBSD works on the latest hardware and peripherals that appear in desktop systems, and will continue to support making FreeBSD easy to deploy, monitor, and configure to provide a great toolbox for building a desktop on top of it. That allows others to take as much or as little of FreeBSD to build a desktop version to produce a specific user experience they desire. + +Like I mentioned above, there are other FreeBSD distributions that have taken these FreeBSD components and created their own desktop versions. + +**It’s FOSS: What are your plans/roadmap for FreeBSD in the coming years?** + +The FreeBSD Foundation’s purpose is to support the FreeBSD Project. While we’re an entirely separate entity, we work closely with the Core Team and the community to help move the Project forward. The Foundation identifies key areas we should support in the coming years, based on input from users and what we are seeing in the industry.  + +In 2019, we embarked on an even broader spectrum advocacy project to recruit new members throughout the world, while raising awareness about the benefits of learning FreeBSD. We are funding development projects including WiFi improvements, supporting OpenJDK, ZFS RAID-Z expansion, security, toolchain, performance improvements, and other features to keep FreeBSD innovative. + +The FreeBSD Foundation will continue to host workshops and expand the amount of training opportunities and materials we provide. Finally, the [BSD Certification program][13] recently launched through Linux Professional Institute with greater availability.  + +**It’s FOSS: How can we bring more people to the BSD hold?** + +We need more PR for FreeBSD and get more tech journalists like yourself to write about FreeBSD. We also need more trainings and classes that include FreeBSD in universities, trainings/workshops at technical conferences, more FreeBSD contributors giving talks at those conferences, more technical journalists, as well as, users writing about FreeBSD, and finally we need case studies from companies and organizations successfully using FreeBSD. It all takes having more resources! We’re working on all of the above.  + +**It’s FOSS: Any message you would like to convey to our readers?** + +Readers should consider getting involved with the largest and oldest democratically run open source project! + +Whether you want to learn systems programming or how an operating system works, the small size of the operating system makes it a great platform to learn from. The size of the Project makes it easier for anyone to make a notable contribution, and there is a strong mentorship culture to support new contributors. + +Being a democratically run project, allows your voice to be heard and work in the areas you are interested in. I hope your readers will go to [freebsd.org][1] and try it out themselves. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/freebsd-interview-deb-goodkin/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.freebsd.org/ +[2]: https://www.freebsdfoundation.org/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/deb-goodkin-interview.png?ssl=1 +[4]: https://www.juniper.net/us/en/products-services/nos/junos/ +[5]: https://itsfoss.com/netflix-freebsd-cdn/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/FreeBSDFoundation_Deb_Goodkin_and_friend_promoting_FreeBSD_at_OSCON.jpg?ssl=1 +[7]: https://itsfoss.com/best-linux-distributions/ +[8]: https://itsfoss.com/furybsd/ +[9]: https://itsfoss.com/nomadbsd/ +[10]: https://itsfoss.com/midnightbsd-1-0-release/ +[11]: https://itsfoss.com/what-is-zfs/ +[12]: https://en.wikipedia.org/wiki/Principle_of_least_astonishment +[13]: https://www.lpi.org/our-certifications/bsd-overview From 706496e649a22df4a8c85e5c4b5e3a92bfc2543e Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 24 Feb 2020 08:26:36 +0800 Subject: [PATCH 135/315] translated --- ...to Install Latest Git Version on Ubuntu.md | 135 ------------------ ...to Install Latest Git Version on Ubuntu.md | 130 +++++++++++++++++ 2 files changed, 130 insertions(+), 135 deletions(-) delete mode 100644 sources/tech/20200219 How to Install Latest Git Version on Ubuntu.md create mode 100644 translated/tech/20200219 How to Install Latest Git Version on Ubuntu.md diff --git a/sources/tech/20200219 How to Install Latest Git Version on Ubuntu.md b/sources/tech/20200219 How to Install Latest Git Version on Ubuntu.md deleted file mode 100644 index 55ab72d565..0000000000 --- a/sources/tech/20200219 How to Install Latest Git Version on Ubuntu.md +++ /dev/null @@ -1,135 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Install Latest Git Version on Ubuntu) -[#]: via: (https://itsfoss.com/install-git-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Install Latest Git Version on Ubuntu -====== - -Installing Git on Ubuntu is very easy. It is available in the [main repository of Ubuntu][1] and you can install it [using the apt command][2] like this: - -``` -sudo apt install git -``` - -Easy? Isn’t it? - -There is only a slight little problem (which might not be a problem at all) and that is the version of [Git][3] it installs. - -On an LTS system, the software stability is of upmost importance this is why Ubuntu 18.04 and other distributions often provide older but stable version of a software that is well tested with the distribution release. - -This is why when you check the Git version, you’ll see that it installs a version which is older than the [current Git version available on Git project’s website][4]: - -``` -[email protected]:~$ git --version -git version 2.17.1 -``` - -At the time of writing this tutorial, the version available on its website is 2.25. So how do you install the latest Git on Ubuntu then? - -### Install latest Git on Ubuntu-based Linux distributions - -![][5] - -One way would be to [install from source code][6]. That cool, old school method is not everyone’s cup of tea. Thankfully, there is a [PPA available from Ubuntu Git Maintainers team][7] that you can use to easily install the latest stable Git version. - -``` -sudo add-apt-repository ppa:git-core/ppa -sudo apt update -sudo apt install git -``` - -Even if you had installed Git using apt previously, it will get updated to the latest stable version. - -``` -[email protected]:~$ git --version -git version 2.25.0 -``` - -The beauty of [using PPA][8] is that if there is a new stable version of Git released, you’ll get it with the system updates. [Just update Ubuntu][9] to get the latest Git stable version. - -Trivia - -Did you know that Git version control system was created by none other than [Linux creator Linus Torvalds][10]? - -### Configure Git [Recommended for developers] - -If you have installed Git for development purposes, you’ll soon start cloning repos, make your changes and commit your change. - -If you try to commit your code, you may see a ‘Please tell me who you are’ error like this: - -``` -[email protected]:~/compress-pdf$ git commit -m "update readme" - -*** Please tell me who you are. - -Run - - git config --global user.email "[email protected]" - git config --global user.name "Your Name" - -to set your account's default identity. -Omit --global to set the identity only in this repository. - -fatal: unable to auto-detect email address (got '[email protected](none)') -``` - -This is because you haven’t configured Git with your personal information which is mandatory. - -As the error already hints, you can set up global Git configuration like this: - -``` -git config --global user.name "Your Name" -git config --global user.email "[email protected]" -``` - -You can check the Git configuration with this command: - -``` -git config --list -``` - -It should show an output like this: - -``` -[email protected] -user.name=abhishek -``` - -This configuration is stored in ~/.gitconfig file. You may also change it manually to change the configuration. - -* * * - -**In the end…** - -I hope this quick little tutorial helped you to install Git on Ubuntu. With the PPA, you easily get the latest Git version. - -If you have any questions or suggestions, please feel free to ask in the comment section. A quick ‘thank you’ is also welcomed :) - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-git-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/ubuntu-repositories/ -[2]: https://itsfoss.com/apt-command-guide/ -[3]: https://git-scm.com/ -[4]: https://git-scm.com/downloads -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/install_git_ubuntu.png?ssl=1 -[6]: https://itsfoss.com/install-software-from-source-code/ -[7]: https://launchpad.net/~git-core/+archive/ubuntu/ppa -[8]: https://itsfoss.com/ppa-guide/ -[9]: https://itsfoss.com/update-ubuntu/ -[10]: https://itsfoss.com/linus-torvalds-facts/ diff --git a/translated/tech/20200219 How to Install Latest Git Version on Ubuntu.md b/translated/tech/20200219 How to Install Latest Git Version on Ubuntu.md new file mode 100644 index 0000000000..b6b240dadc --- /dev/null +++ b/translated/tech/20200219 How to Install Latest Git Version on Ubuntu.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Install Latest Git Version on Ubuntu) +[#]: via: (https://itsfoss.com/install-git-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何在 Ubuntu 上安装最新版本的 Git +====== + +在 Ubuntu 上安装 Git 非常容易。它存在于 [Ubuntu 的主仓库][1]中,你可以像这样[使用 apt 命令][2]安装它: + +``` +sudo apt install git +``` + +很简单?是不是? + +只有一点点小问题(这可能根本不是问题),就是它安装的 [Git][3] 版本。 + +在 LTS 系统上,软件稳定性至关重要,这就是为什么 Ubuntu 18.04 和其他发行版经常提供较旧但稳定的软件版本的原因,它们都经过发行版的良好测试。 + +这就是为什么当你检查 Git 版本时,会看到安装的版本会比 [Git 网站上当前最新 Git 版本][4]旧: + +``` +[email protected]:~$ git --version +git version 2.17.1 +``` + +在编写本教程时,网站上提供的版本为 2.25。那么,如何在 Ubuntu 上安装最新的 Git? + +### 在基于 Ubuntu 的 Linux 发行版上安装最新的 Git + +![][5] + +一种方法是[从源代码安装][6]。这种很酷又老派的方法不适合所有人。值得庆幸的是,Ubuntu Git 维护团队提供了 [PPA][7],莫可以使用它轻松地安装最新的稳定 Git 版本。 + +``` +sudo add-apt-repository ppa:git-core/ppa +sudo apt update +sudo apt install git +``` + +即使你以前使用 apt 安装了 Git,它也将更新为最新的稳定版本。 + +``` +[email protected]:~$ git --version +git version 2.25.0 +``` + +[使用PPA][8] 的好处在于,如果发布了新的 Git 稳定版本,那么就可以通过系统更新获得它。[仅更新 Ubuntu][9]来获取最新的 Git 稳定版本。 + +### 配置Git (推荐给开发者) + +如果你出于开发目的安装了 Git,你会很快开始克隆仓库,进行更改并提交更改。 + +如果你尝试提交代码,那么你可能会看到 “Please tell me who you are” 这样的错误: + +``` +[email protected]:~/compress-pdf$ git commit -m "update readme" + +*** Please tell me who you are. + +Run + + git config --global user.email "[email protected]" + git config --global user.name "Your Name" + +to set your account's default identity. +Omit --global to set the identity only in this repository. + +fatal: unable to auto-detect email address (got '[email protected](none)') +``` + +这是因为你还没配置必要的个人信息。 + +正如错误已经暗示的那样,你可以像这样设置全局 Git 配置: + +``` +git config --global user.name "Your Name" +git config --global user.email "[email protected]" +``` + +你可以使用以下命令检查 Git 配置: + +``` +git config --list +``` + +它应该显示如下输出: + +``` +[email protected] +user.name=abhishek +``` + +配置保存在 \~/.gitconfig 中。你可以手动修改配置。 + +* * * + +**结尾** + +我希望这个小教程可以帮助你在 Ubuntu 上安装 Git。使用 PPA,你可以轻松获得最新的 Git 版本。 + +如果你有任何疑问或建议,请随时在评论部分提问。也欢迎直接写“谢谢” :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-git-ubuntu/ + +作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-repositories/ +[2]: https://itsfoss.com/apt-command-guide/ +[3]: https://git-scm.com/ +[4]: https://git-scm.com/downloads +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/install_git_ubuntu.png?ssl=1 +[6]: https://itsfoss.com/install-software-from-source-code/ +[7]: https://launchpad.net/~git-core/+archive/ubuntu/ppa +[8]: https://itsfoss.com/ppa-guide/ +[9]: https://itsfoss.com/update-ubuntu/ \ No newline at end of file From 13ec002065a277ca03d839c3369fa1ca3a05e789 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 24 Feb 2020 09:53:15 +0800 Subject: [PATCH 136/315] Rename sources/tech/20200224 Discussing Past, Present and Future of FreeBSD Project.md to sources/talk/20200224 Discussing Past, Present and Future of FreeBSD Project.md --- ...0224 Discussing Past, Present and Future of FreeBSD Project.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200224 Discussing Past, Present and Future of FreeBSD Project.md (100%) diff --git a/sources/tech/20200224 Discussing Past, Present and Future of FreeBSD Project.md b/sources/talk/20200224 Discussing Past, Present and Future of FreeBSD Project.md similarity index 100% rename from sources/tech/20200224 Discussing Past, Present and Future of FreeBSD Project.md rename to sources/talk/20200224 Discussing Past, Present and Future of FreeBSD Project.md From a90371bf99cb94f4b5a3521f7f4545ec60868af6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 Feb 2020 10:43:08 +0800 Subject: [PATCH 137/315] PRF @Morisun029 --- ...13 Why developers like to code at night.md | 62 +++++++++---------- 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/translated/tech/20200213 Why developers like to code at night.md b/translated/tech/20200213 Why developers like to code at night.md index 9221f322cf..6756b79234 100644 --- a/translated/tech/20200213 Why developers like to code at night.md +++ b/translated/tech/20200213 Why developers like to code at night.md @@ -1,92 +1,87 @@ [#]: collector: (lujun9972) [#]: translator: (Morisun029) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Why developers like to code at night) [#]: via: (https://opensource.com/article/20/2/why-developers-code-night) [#]: author: (Matt Shealy https://opensource.com/users/mshealy) -开发人员为什么喜欢在晚上编码 +程序员为什么喜欢在晚上编码 ====== -对许多开源程序员来说,夜间工作计划是创造力和生产力来源的关键。 -![Person programming on a laptop on a building][1] +> 对许多开源程序员来说,夜间的工作计划是创造力和生产力来源的关键。 + +![](https://img.linux.net.cn/data/attachment/album/202002/24/104251b2hxch46h45c8zwd.jpg) 如果你问大多数开发人员更喜欢在什么时候工作,大部人会说他们最高效的时间在晚上。这对于那些在工作之余为开源项目做贡献的人来说更是如此(尽管如此,希望在他们的健康范围内[避免透支][2])。 -有些人喜欢从晚上开始,一直工作到凌晨,而另一些人则很早就起床(例如,凌晨4点),以便在开始日常工作之前完成大部分编程工作。 +有些人喜欢从晚上开始,一直工作到凌晨,而另一些人则很早就起床(例如,凌晨 4 点),以便在开始日常工作之前完成大部分编程工作。 -这种工作习惯可能会使许多开发人员看起来像个怪胎和不称职。 但是,为什么有这么多的程序员喜欢在非正常时间工作,这其中有很多原因: +这种工作习惯可能会使许多开发人员看起来像个怪人,不合时宜。但是,为什么有这么多的程序员喜欢在非正常时间工作,原因有很多: -### maker 日程 +### 制造者日程 -根据[Paul Graham][3]的观点, "生产东西" 的人倾向于遵守 maker's schedule—他们更愿意以半天或更长时间为单位使用时间。事实上,大多数 [开发人员也有相同的偏好][4]. +根据 [保罗·格雷厄姆][3]Paul Graham 的观点,“生产东西”的人倾向于遵守 制造者日程 —— 他们更愿意以半天或更长时间为单位使用时间。事实上,大多数[开发人员也有相同的偏好][4]。(LCTT 译注:保罗·格雷厄姆有[一篇文章][8]述及制造者日程和管理者日程。) -一方面,开发人员从事大型抽象系统工作,需要思维空间来处理整个模型。 将他们的日程分割成15分钟或30分钟的时间段来处理电子邮件,会议,电话以及来自同事的打断,工作效果只会适得其反。 +一方面,开发人员从事大型抽象系统工作,需要思维空间来处理整个模型。将他们的日程分割成 15 分钟或 30 分钟的时间段来处理电子邮件、会议、电话以及来自同事的打断,工作效果只会适得其反。 -另一方面,通常不可能以一个小时为单位进行有效编程。 因为这么短的时间几乎不够来处理当前的任务并开始工作。 +另一方面,通常不可能以小时为单位进行有效编程。因为这么短的时间几乎不够让你把思绪放在手头的任务上并开始工作。 -上下文切换也会对编程产生不利影响。 在晚上工作,开发人员可以避免尽可能多的干扰。 在没有持续中断的情况下,他们可以花几个小时专注于手头任务,并尽可能提高工作效率。 +上下文切换也会对编程产生不利影响。在晚上工作,开发人员可以避免尽可能多的干扰。在没有不断的干扰的情况下,他们可以花几个小时专注于手头任务,并尽可能提高工作效率。 ### 平和安静的环境 -由于晚上或凌晨不太会有来自各种活动的噪音(例如,办公室闲谈,街道上的交通),这使许多程序员感到放松,促使他们更具创造力和生产力,特别是在处理诸如编码之类的精神刺激任务时。 +由于晚上或凌晨不太会有来自各种活动的噪音(例如,办公室闲谈、街道上的交通),这使许多程序员感到放松,促使他们更具创造力和生产力,特别是在处理诸如编码之类的精神刺激任务时。 -独处与平和,加上知道自己将有几个小时不被中断的工作时间,通常会使他们摆脱白天工作计划相关的时间压力,从而产出高质量的工作。 +独处与平静,加上他们知道自己将有几个小时不被中断的工作时间,通常会使他们摆脱白天工作计划相关的时间压力,从而产出高质量的工作。 更不用说了,当解决了一个棘手的问题后,没有什么比尽情享受自己最喜欢的午夜小吃更美好的事情了! - ### 沟通 -与在公司内里工作的程序员相比,从事开源项目的开发人员可以拥有不同的沟通节奏。 大多数开源项目的沟通都是通过邮件或 GitHub 上的评论等渠道异步完成。 很多时候,其他程序员在不同的国家和时区,因此实时交流通常需要开发人员变成一个夜猫子。 +与在公司内工作的程序员相比,从事开源项目的开发人员可以拥有不同的沟通节奏。大多数开源项目的沟通都是通过邮件或 GitHub 上的评论等渠道异步完成的。很多时候,其他程序员在不同的国家和时区,因此实时交流通常需要开发人员变成一个夜猫子。 ### 昏昏欲睡的大脑 +这听起来可能违反直觉,但是随着时间的推移,大脑会变得非常疲倦,因此只能专注于一项任务。晚上工作从根本上消除了多任务处理,而这是保持专注和高效的主要障碍。当大脑处于昏昏欲睡的状态时,你是无法保持专注的! -这听起来可能违反直觉,但是随着时间的推移,大脑会变得非常疲倦,因此只能专注于一项任务。 晚上工作从根本上消除了多任务处理,多任务处理是保持专注和高效的主要障碍。 当大脑处于昏昏欲睡的状态时,你是无法保持专注的! - -许多开发人员在入睡时思考要解决的问题通常会取得重大进展。 潜意识开始工作,答案通常在他们半睡半醒的早些时候就出现了。 - -这不足为奇,因为[睡眠可增强大脑功能][5],可帮助我们理解新信息并进行更有创造性的思考。当解决方案在凌晨出现时,这些开发人员便会起来并开始工作,不错过任何机会。 - +此外,许多开发人员在入睡时思考要解决的问题通常会取得重大进展。潜意识开始工作,答案通常在他们半睡半醒的凌晨时分就出现了。 +这不足为奇,因为[睡眠可增强大脑功能][5],可帮助我们理解新信息并进行更有创造性的思考。当解决方案在凌晨出现时,这些开发人员便会起来开始工作,不错过任何机会。 ### 灵活和创造性思考 -许多程序员体会到晚上创造力会提升。 前额叶皮层,即与集中能力有关的大脑部分,在一天结束时会感到疲倦。 这似乎为某些人提供了更灵活和更具创造性的思考。 +许多程序员体会到晚上创造力会提升。前额叶皮层,即大脑中与集中能力有关的部分,在一天结束时会感到疲倦。这似乎为某些人提供了更灵活和更具创造性的思考。 -匹兹堡大学医学院精神病学助理教授[Brant Hasler][6] 表示:“由于自上而下的控制和'认知抑制'功能较少,大脑可能会解放出来进行更多样化的思考,从而使人们更容易地将不同概念之间的联系建立起来。” 结合轻松环境所带来的积极情绪,开发人员可以更轻松地产生创新想法。 +匹兹堡大学医学院精神病学助理教授 [Brant Hasler][6] 表示:“由于自上而下的控制和‘认知抑制’的减少,大脑可能会解放出来进行更发散的思考,从而使人们更容易地将不同概念之间的联系建立起来。” 结合轻松环境所带来的积极情绪,开发人员可以更轻松地产生创新想法。 -此外,在没有干扰的情况下集中精力几个小时,“沉浸在你做的事情中”。 这可以帮助你更好地专注于项目并参与其中,而不必担心周围发生的事情。 +此外,在没有干扰的情况下集中精力几个小时,“沉浸在你做的事情中”。这可以帮助你更好地专注于项目并参与其中,而不必担心周围发生的事情。 ### 明亮的电脑屏幕 +因为整天看着明亮的屏幕, 许多程序员的睡眠周期被延迟。电脑屏幕发出的蓝光[扰乱我们的昼夜节律][7],延迟了释放诱发睡眠的褪黑激素和提高人的机敏性,并将人体生物钟重置到更晚的时间。从而导致,开发人员往往睡得越来越晚。 -因为整天看着明亮的屏幕, 许多程序员的睡眠周期被延迟。电脑屏幕发出的蓝光[扰乱我们的昼夜节律][7]通过延迟释放诱发睡眠的褪黑激素和提高人的机敏性将人体生物钟重置到更晚的时间。从而导致,开发人员往往睡得越来越晚。 +### 来自过去的影响 -### 过去的影响 - -过去,大多数开发人员是出于必要在晚上工作,因为在白天当公司其他人都在使用服务器时,共享服务器的计算能力支撑不了编程工作,所以开发人员需要等到深夜才能执行白天无法进行的任务,例如测试项目,运行大量的代码编译运行调试周期以及部署新代码。现在尽管服务器功能变强大了,大多数可以满足需求,但夜间工作的趋势仍是这种文化的一部分。 +过去,大多数开发人员是出于必要在晚上工作,因为在白天当公司其他人都在使用服务器时,共享服务器的计算能力支撑不了编程工作,所以开发人员需要等到深夜才能执行白天无法进行的任务,例如测试项目、运行大量的“编码-编译-运行-调试”周期以及部署新代码。现在尽管服务器功能变强大了,大多数可以满足需求,但夜间工作的趋势仍是这种文化的一部分。 ### 结语 -尽管开发人员喜欢在晚上工作出于多种原因,但请记住,成为夜猫子并不意味着你应该克扣睡眠时间。 睡眠不足会导致压力和焦虑,并最终导致倦怠。 +尽管开发人员喜欢在晚上工作的原因很多,但请记住,做为夜猫子并不意味着你应该克扣睡眠时间。睡眠不足会导致压力和焦虑,并最终导致倦怠。 -获得足够质量的睡眠是维持良好身体健康和大脑功能的关键。 例如,它可以帮助你整合新信息,巩固记忆,创造性思考,清除身体积聚的毒素,调节食欲并防止过早衰老。 +获得足够质量的睡眠是维持良好身体健康和大脑功能的关键。例如,它可以帮助你整合新信息、巩固记忆、创造性思考、清除身体积聚的毒素、调节食欲并防止过早衰老。 无论你是哪种日程,请确保让你的大脑得到充分的休息,这样你就可以在一整天及每天的工作中发挥最大的作用! - -------------------------------------------------------------------------------- via: https://opensource.com/article/20/2/why-developers-code-night 作者:[Matt Shealy][a] 选题:[lujun9972][b] -译者:[Morisun029](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[Morisun029](https://github.com/Morisun029) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -99,3 +94,4 @@ via: https://opensource.com/article/20/2/why-developers-code-night [5]: https://amerisleep.com/blog/sleep-impacts-brain-health/ [6]: https://www.vice.com/en_us/article/mb58a8/late-night-creativity-spike [7]: https://www.sleepfoundation.org/articles/how-blue-light-affects-kids-sleep +[8]: http://www.paulgraham.com/makersschedule.html From 71d234deb925e87c76c24733f954a0c62c9992d8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 Feb 2020 10:44:06 +0800 Subject: [PATCH 138/315] PUB @Morisun029 https://linux.cn/article-11924-1.html --- .../20200213 Why developers like to code at night.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200213 Why developers like to code at night.md (99%) diff --git a/translated/tech/20200213 Why developers like to code at night.md b/published/20200213 Why developers like to code at night.md similarity index 99% rename from translated/tech/20200213 Why developers like to code at night.md rename to published/20200213 Why developers like to code at night.md index 6756b79234..144345c44f 100644 --- a/translated/tech/20200213 Why developers like to code at night.md +++ b/published/20200213 Why developers like to code at night.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Morisun029) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11924-1.html) [#]: subject: (Why developers like to code at night) [#]: via: (https://opensource.com/article/20/2/why-developers-code-night) [#]: author: (Matt Shealy https://opensource.com/users/mshealy) From 70e906f1cac03217a338c7528b2467308a032ced Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 Feb 2020 11:32:35 +0800 Subject: [PATCH 139/315] PRF @lujun9972 --- ...romium - Firefox sessions with org-mode.md | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/translated/tech/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md b/translated/tech/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md index 7c1bf841df..690e1ec431 100644 --- a/translated/tech/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md +++ b/translated/tech/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md @@ -1,22 +1,24 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -[#]: subject: (#:acid 'words: Handle Chromium & Firefox sessions with org-mode) +[#]: subject: (Handle Chromium & Firefox sessions with org-mode) [#]: via: (https://acidwords.com/posts/2019-12-04-handle-chromium-and-firefox-sessions-with-org-mode.html) [#]: author: (Sanel Z https://acidwords.com/) -通过 org-mode 管理 Chromium 和 Firefox 会话 +通过 Org 模式管理 Chromium 和 Firefox 会话 ====== -我是 [Session Manager][1] 的大粉丝,它是 Chrome 和 Chromium 的小插件,可以保存所有打开的选项卡,为会话命名,并在需要时恢复会话。 +![](https://img.linux.net.cn/data/attachment/album/202002/24/113047w8jtoh2o5j085750.jpg) -它非常有用,特别是如果你像我一样,白天的时候需要在多个“思维活动”之间切换——研究、开发或者新闻阅读。或者您只是单纯地希望记住几天前的工作流(和选项卡)。 +我是[会话管理器][1]的铁粉,它是 Chrome 和 Chromium 的小插件,可以保存所有打开的选项卡,为会话命名,并在需要时恢复会话。 -在我决定放弃 chromium 上除了 [uBlock Origin][2] 之外的所有扩展后,也到了寻找替代品的时候了。我的主要目标是使之与浏览器无关同时会话链接需要保存在文本文件中,这样我就可以享受所有纯文本的好处了。还有什么比 [org-mode][3] 更好呢 ;) +它非常有用,特别是如果你像我一样,白天的时候需要在多个“思维活动”之间切换——研究、开发或者阅读新闻。或者你只是单纯地希望记住几天前的工作流(和选项卡)。 -很久以前我就发现了这个小诀窍:[通过命令行获取当前在谷歌 Chrome 中打开的标签 ][4] 再加上些 elisp 代码: +在我决定放弃 chromium 上除了 [uBlock Origin][2] 之外的所有扩展后,就必须寻找一些替代品了。我的主要目标是使之与浏览器无关,同时会话链接必须保存在文本文件中,这样我就可以享受所有纯文本的好处了。还有什么比 [org 模式][3]更好呢 ;) + +很久以前我就发现了这个小诀窍:[通过命令行获取当前在谷歌 Chrome 中打开的标签][4] 再加上些 elisp 代码: ``` (require 'cl-lib) @@ -59,7 +61,7 @@ Make sure to put cursor on date heading that contains list of urls." 那么,它的工作原理是什么呢? -运行上述代码,打开一个新 org-mode 文件并调用 `M-x save-chromium-session`。它会创建类似这样的东西: +运行上述代码,打开一个新 org 模式文件并调用 `M-x save-chromium-session`。它会创建类似这样的东西: ``` * [2019-12-04 12:14:02] @@ -88,20 +90,19 @@ Make sure to put cursor on date heading that contains list of urls." - https://news.ycombinator.com ``` -请注意,用于读取 Chromium 会话的方法并不完美:`strings` 将从二进制数据库中读取任何类似 URL 字符串的内容,有时这将产生不完整的 url。不过,您可以很方便地地编辑它们,从而保持会话文件简洁。 +请注意,用于读取 Chromium 会话的方法并不完美:`strings` 将从二进制数据库中读取任何类似 URL 字符串的内容,有时这将产生不完整的 URL。不过,你可以很方便地地编辑它们,从而保持会话文件简洁。 -为了真正打开标签,elisp 代码中使用到了 [browse-url][5],它可以通过 `browse-url-browser-function` 变量进一步定制成运行 Chromium,Firefox 或任何其他浏览器。请务必阅读该变量的相关文档。 +为了真正打开标签,elisp 代码中使用到了 [browse-url][5],它可以通过 `browse-url-browser-function` 变量进一步定制成运行 Chromium、Firefox 或任何其他浏览器。请务必阅读该变量的相关文档。 别忘了把会话文件放在 git、mercurial 或 svn 中,这样你就再也不会丢失会话历史记录了 :) ### 那么 Firefox 呢? -如果您正在使用 Firefox( 最近的版本),并且想要获取会话 url,下面是操作方法。 +如果你正在使用 Firefox(最近的版本),并且想要获取会话 URL,下面是操作方法。 -首先,下载并编译 [lz4json][6],这是一个可以解压缩 Mozilla lz4json 格式的小工具,Firefox 以这种格式来存储会话数据。会话数据(在撰写本文时)存储在 `$HOME/.mozilla/firefox//sessionstore-backup /recovery.jsonlz4` 中。 +首先,下载并编译 [lz4json][6],这是一个可以解压缩 Mozilla lz4json 格式的小工具,Firefox 以这种格式来存储会话数据。会话数据(在撰写本文时)存储在 `$HOME/.mozilla/firefox//sessionstore-backup /recovery.jsonlz4` 中。 如果 Firefox 没有运行,则没有 `recovery.jsonlz4`,这种情况下用 `previous.jsonlz4` 代替。 -=恢复。jsonlz4= 将不存在,但使用=先前。jsonlz4 =。 要提取网址,尝试在终端运行: @@ -132,7 +133,7 @@ via: https://acidwords.com/posts/2019-12-04-handle-chromium-and-firefox-sessions 作者:[Sanel Z][a] 选题:[lujun9972][b] 译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 76d61e0cc4e1d7764cfcaba7d458da19bfcdd96d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 Feb 2020 11:33:06 +0800 Subject: [PATCH 140/315] PUB @lujun9972 https://linux.cn/article-11926-1.html --- ...words- Handle Chromium - Firefox sessions with org-mode.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md (98%) diff --git a/translated/tech/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md b/published/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md similarity index 98% rename from translated/tech/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md rename to published/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md index 690e1ec431..31c93609ab 100644 --- a/translated/tech/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md +++ b/published/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11926-1.html) [#]: subject: (Handle Chromium & Firefox sessions with org-mode) [#]: via: (https://acidwords.com/posts/2019-12-04-handle-chromium-and-firefox-sessions-with-org-mode.html) [#]: author: (Sanel Z https://acidwords.com/) From d8709fbfe1267f45154c3c5b66b9fefe7ee880cd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 Feb 2020 20:17:40 +0800 Subject: [PATCH 141/315] APL --- sources/tech/20200220 Tools for SSH key management.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200220 Tools for SSH key management.md b/sources/tech/20200220 Tools for SSH key management.md index 816993315c..639f5f615e 100644 --- a/sources/tech/20200220 Tools for SSH key management.md +++ b/sources/tech/20200220 Tools for SSH key management.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 032757210377eb88fce81a61af7dbbb8bf90bae7 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Feb 2020 20:47:16 +0800 Subject: [PATCH 142/315] translating by lujun9972 --- .../20200128 Send email and check your calendar with Emacs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200128 Send email and check your calendar with Emacs.md b/sources/tech/20200128 Send email and check your calendar with Emacs.md index 48be7e8e45..fb0183c1da 100644 --- a/sources/tech/20200128 Send email and check your calendar with Emacs.md +++ b/sources/tech/20200128 Send email and check your calendar with Emacs.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lujun9972) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -124,7 +124,7 @@ via: https://opensource.com/article/20/1/emacs-mail-calendar 作者:[Kevin Sonney][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[lujun9972](https://github.com/lujun9972) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From cc00466d8d4d8fb46a0986d55f44d43eff0be38d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 24 Feb 2020 20:59:57 +0800 Subject: [PATCH 143/315] TSL --- .../20200220 Tools for SSH key management.md | 110 ------------------ .../20200220 Tools for SSH key management.md | 104 +++++++++++++++++ 2 files changed, 104 insertions(+), 110 deletions(-) delete mode 100644 sources/tech/20200220 Tools for SSH key management.md create mode 100644 translated/tech/20200220 Tools for SSH key management.md diff --git a/sources/tech/20200220 Tools for SSH key management.md b/sources/tech/20200220 Tools for SSH key management.md deleted file mode 100644 index 639f5f615e..0000000000 --- a/sources/tech/20200220 Tools for SSH key management.md +++ /dev/null @@ -1,110 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Tools for SSH key management) -[#]: via: (https://opensource.com/article/20/2/ssh-tools) -[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) - -Tools for SSH key management -====== -Time-saving shortcuts for a commonly used open source tool. -![collection of hardware on blue backround][1] - -I use SSH constantly. Every day I find myself logged in to multiple servers and Pis (both in the same room as me and over the internet). I have many devices I need access to, and different requirements for gaining access, so in addition to using various SSH/SCP command options, I have to maintain a config file with all the connection details. - -Over time I’ve come up with a few time-saving tips and tools that you might find useful, too. - -### SSH keys - -SSH keys are a way to authenticate SSH connections without using a password, either to speed up your access or as a security measure, if you turn password access off and ensure only authorized keys are permitted. To create an SSH key, run the command: - - -``` -`$ ssh-keygen` -``` - -This will create a key-pair (a public and private key) in **~/.ssh/**. Keep the private key (id_rsa) on the PC and never share it. You can share the public key (id_rsa.pub) with others or place it on other servers. - -### ssh-copy-id - -If I’m working on a Pi at home or work, I tend to leave SSH settings at their default, as I’m not concerned with security on an internal trusted network, and I usually copy my SSH key to the Pi to avoid having to authenticate with a password every time. To do this, I use the **ssh-copy-id** command to copy it to the Pi. This automatically adds your key to the Pi: - - -``` -`$ ssh-copy-id pi@192.168.1.20` -``` - -On production servers, I tend to turn off password authentication and only allow authorized SSH keys. - -### ssh-import-id - -Another similar tool is ssh-import-id. You can use this to give yourself (or others) access to a computer or server by importing their keys from GitHub. For example, I have registered my various SSH keys with my GitHub account, so I can push to GitHub without a password. These public keys are made available, so ssh-import-id can use them to authorize me from any of my computers: - - -``` -`$ ssh-import-id gh:bennuttall` -``` - -I can also use this to give someone else access to a server without asking them for their keys: - - -``` -`$ ssh-import-id gh:waveform80` -``` - -### storm - -I also use a tool called Storm, which helps you add SSH connections to your SSH config, so you don’t have to remember them all. You can install it with pip: - - -``` -`$ sudo pip3 install stormssh` -``` - -Then you can add an SSH connection to your config with the following command: - - -``` -`$ storm add pi3 pi@192.168.1.20` -``` - -Then you can just use **ssh pi3** to gain access. Similarly, **scp file.txt pi3:** or **sshfs pi pi3:** - -You can also use more SSH options, such as the port number: - - -``` -$ storm add pi3 pi@192.168.1.20:2000 -``` - -You can list, search, and edit saved connections easily using Storm’s [documentation][2]. All Storm actually does is manage items in your ssh config file at **~/.ssh/config**. Once you see how these are stored, you might choose to edit them manually. An example connection in config looks like this: - - -``` -Host pi3 -   user pi -   hostname 192.168.1.20 -   port 22 -``` - -### Conclusion - -SSH is an important tool for system administration, from Raspberry Pi to the largest cloud infrastructures. Familiarizing yourself with key management will forever be handy. Do you have other SSH tricks to add? I would love to have you share them in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/ssh-tools - -作者:[Ben Nuttall][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/bennuttall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_BUS_Apple_520.png?itok=ZJu-hBV1 (collection of hardware on blue backround) -[2]: https://stormssh.readthedocs.io/en/stable/usage.html diff --git a/translated/tech/20200220 Tools for SSH key management.md b/translated/tech/20200220 Tools for SSH key management.md new file mode 100644 index 0000000000..0c9efe9752 --- /dev/null +++ b/translated/tech/20200220 Tools for SSH key management.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tools for SSH key management) +[#]: via: (https://opensource.com/article/20/2/ssh-tools) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +SSH 密钥管理工具 +====== + +> 常用开源工具的省时快捷方式。 + +![collection of hardware on blue backround][1] + +我经常使用 SSH。我发现自己每天都要登录多个服务器和树莓派(与我位于同一房间,并接入互联网)。我有许多设备需要访问,并且获得访问权限的要求也不同,因此,除了使用各种 `ssh` / `scp` 命令选项之外,我还必须维护一个包含所有连接详细信息的配置文件。 + +随着时间的推移,我发现了一些省时的技巧和工具,你可能也会发现它们有用。 + +### SSH 密钥 + +SSH 密钥是一种在不使用密码的情况下认证 SSH 连接的方法,可以用来加快访问速度或作为一种安全措施(如果你关闭了密码访问权限并确保仅允许授权的密钥)。要创建 SSH 密钥,请运行以下命令: + +``` +$ ssh-keygen +``` + +这将在 `~/.ssh/` 中创建一个密钥对(公钥和私钥)。将私钥(`id_rsa`)保留在 PC 上,切勿共享。你可以与其他人共享公钥(`id_rsa.pub`)或将其放置在其他服务器上。 + +### ssh-copy-id + +如果我在家中或公司工作时使用树莓派,则倾向于将 SSH 设置保留为默认设置,因为我不担心内部信任网络上的安全性,并且通常将 SSH 密钥(公钥)复制到树莓派上,以避免每次都使用密码进行身份验证。为此,我使用 `ssh-copy-id` 命令将其复制到树莓派。这会自动将你的密钥(公钥)添加到树莓派: + +``` +$ ssh-copy-id pi@192.168.1.20 +``` + +在生产服务器上,我倾向于关闭密码身份验证,仅允许授权的 SSH 密钥登录。 + +### ssh-import-id + +另一个类似的工具是 `ssh-import-id`。你可以使用此方法通过从 GitHub 导入密钥来授予你自己(或其他人)对计算机或服务器的访问权限。例如,我已经在我的 GitHub 帐户中注册了各个 SSH 密钥,因此无需密码即可推送到 GitHub。这些公钥是有效的,因此 `ssh-import-id` 可以使用它们在我的任何计算机上授权我: + +``` +$ ssh-import-id gh:bennuttall +``` + +我还可以使用它来授予其他人访问服务器的权限,而无需询问他们的密钥: + +``` +$ ssh-import-id gh:waveform80 +``` + +### storm + +我还使用了名为 Storm 的工具,该工具可帮助你将 SSH 连接添加到 SSH 配置中,因此你不必记住这些连接细节信息。你可以使用 `pip` 安装它: + +``` +$ sudo pip3 install stormssh +``` + +然后,你可以使用以下命令将 SSH 连接添加到配置中: + +``` +$ storm add pi3 pi@192.168.1.20 +``` + +然后,你可以只使用 `ssh pi3` 来获得访问权限。类似的还有 `scp file.txt pi3:` 或 `sshfs pi pi3:`。 + +你还可以使用更多的 SSH 选项,例如端口号: + +``` +$ storm add pi3 pi@192.168.1.20:2000 +``` + +你可以参考 Storm 的[文档][2]轻松列出、搜索和编辑已保存的连接。Storm 实际所做的只是管理 SSH 配置文件 `~/.ssh/config` 中的项目。一旦了解了它们是如何存储的,你就可以选择手动编辑它们。配置中的示例连接如下所示: + +``` +Host pi3 +   user pi +   hostname 192.168.1.20 +   port 22 +``` + +### 结论 + +从树莓派到大型的云基础设施,SSH 是系统管理的重要工具。熟悉密钥管理会很方便。你还有其他 SSH 技巧要添加吗?我希望你在评论中分享他们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/ssh-tools + +作者:[Ben Nuttall][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_BUS_Apple_520.png?itok=ZJu-hBV1 (collection of hardware on blue backround) +[2]: https://stormssh.readthedocs.io/en/stable/usage.html From 62462a9d9328b05ff1d17bf3c089d65935817921 Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Mon, 24 Feb 2020 21:31:37 +0800 Subject: [PATCH 144/315] translated --- ...sing Python and GNU Octave to plot data.md | 720 ------------------ ...sing Python and GNU Octave to plot data.md | 689 +++++++++++++++++ 2 files changed, 689 insertions(+), 720 deletions(-) delete mode 100644 sources/tech/20200220 Using Python and GNU Octave to plot data.md create mode 100644 translated/tech/20200220 Using Python and GNU Octave to plot data.md diff --git a/sources/tech/20200220 Using Python and GNU Octave to plot data.md b/sources/tech/20200220 Using Python and GNU Octave to plot data.md deleted file mode 100644 index 5c9bd4facd..0000000000 --- a/sources/tech/20200220 Using Python and GNU Octave to plot data.md +++ /dev/null @@ -1,720 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (heguangzhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using Python and GNU Octave to plot data) -[#]: via: (https://opensource.com/article/20/2/python-gnu-octave-data-science) -[#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) - -Using Python and GNU Octave to plot data -====== -Learn how to do a common data science task with Python and GNU Octave. -![Analytics: Charts and Graphs][1] - -Data science is a domain of knowledge that spans programming languages. Some are well-known for solving problems in this space, while others are lesser-known. This article will help you become familiar with doing data science with some popular languages. - -### Choosing Python and GNU Octave for data science - -Every so often, I try to learn a new programming language. Why? It is mostly a combination of boredom with the old ways and curiosity about the new ways. When I started programming, the only language I knew was C. Life was hard and dangerous in those years, as I had to manually allocate memory, manage pointers, and remember to free memory. - -Then a friend suggested I try Python, and life became much easier. Programs became much slower, but I did not have to suffer through writing analysis software. However, I soon realized that each language was more suitable than others for some applications. I later studied some other languages, and each one brought some new bit of enlightenment. Discovering new programming styles let me backport some solutions to other languages, and everything became much more interesting. - -To get a feeling for a new programming language (and its documentation), I always start by writing some example programs that perform a task I know well. To that ends, I will explain how to write a program in Python and GNU Octave for a particular task you could classify as data science. If you are already familiar with one of the languages, start with that one and go through the others to look for similarities and differences. It is not intended to be an exhaustive comparison of the languages, just a little showcase. - -All of the programs are meant to be run on the [command line][2], not with a [graphical user interface][3] (GUI). The full examples are available in the [polyglot_fit repository][4]. - -### The programming task - -The program you will write in this series: - - * Reads data from a [CSV file][5] - * Interpolates the data with a straight line (i.e., _f(x)=m ⋅ x + q_) - * Plots the result to an image file - - - -This is a common situation that many data scientists have encountered. The example data is the first set of [Anscombe's quartet][6], shown in the table below. This is a set of artificially constructed data that gives the same results when fitted with a straight line, but their plots are very different. The data file is a text file with tabs as column separators and a few lines as a header. This task will use only the first set (i.e., the first two columns). - -[**Anscombe's quartet**][6] - -I - -II - -III - -IV - -x - -y - -x - -y - -x - -y - -x - -y - -10.0 - -8.04 - -10.0 - -9.14 - -10.0 - -7.46 - -8.0 - -6.58 - -8.0 - -6.95 - -8.0 - -8.14 - -8.0 - -6.77 - -8.0 - -5.76 - -13.0 - -7.58 - -13.0 - -8.74 - -13.0 - -12.74 - -8.0 - -7.71 - -9.0 - -8.81 - -9.0 - -8.77 - -9.0 - -7.11 - -8.0 - -8.84 - -11.0 - -8.33 - -11.0 - -9.26 - -11.0 - -7.81 - -8.0 - -8.47 - -14.0 - -9.96 - -14.0 - -8.10 - -14.0 - -8.84 - -8.0 - -7.04 - -6.0 - -7.24 - -6.0 - -6.13 - -6.0 - -6.08 - -8.0 - -5.25 - -4.0 - -4.26 - -4.0 - -3.10 - -4.0 - -5.39 - -19.0 - -12.50 - -12.0 - -10.84 - -12.0 - -9.13 - -12.0 - -8.15 - -8.0 - -5.56 - -7.0 - -4.82 - -7.0 - -7.26 - -7.0 - -6.42 - -8.0 - -7.91 - -5.0 - -5.68 - -5.0 - -4.74 - -5.0 - -5.73 - -8.0 - -6.89 - -### The Python way - -[Python][7] is a general-purpose programming language that is among the most popular languages in use today (as evidenced by findings from the [TIOBE index][8], [RedMonk Programming Language Rankings][9], [Popularity of Programming Language Index][10], [State of the Octoverse of GitHub][11], and other sources). It is an [interpreted language][12]; therefore, the source code is read and evaluated by a program that executes the instructions. It has a comprehensive [standard library][13] and is generally very pleasant to use (I have no reference for this last statement; it is just my humble opinion). - -#### Installation - -To develop with Python, you need the interpreter and a few libraries. The minimum requirements are: - - * [NumPy][14] for convenient array and matrices manipulation - * [SciPy][15] for scientific calculations - * [Matplotlib][16] for plotting - - - -Installing them in [Fedora][17] is easy: - - -``` -`sudo dnf install python3 python3-numpy python3-scipy python3-matplotlib` -``` - -#### Commenting code - -In Python, [comments][18] are achieved by putting a **#** at the beginning of the line, and the rest of the line will be discarded by the interpreter: - - -``` -`# This is a comment ignored by the interpreter.` -``` - -The [fitting_python.py][19] example uses comments to insert licensing information in the source code, and the first line is a [special comment][20] that enables the script to be executed on the command line: - - -``` -`#! /usr/bin/env python3` -``` - -This line informs the command-line interpreter that the script needs to be executed by the program **python3**. - -#### Required libraries - -Libraries and modules can be imported in Python as an object (as in the first line in the example) with all the functions and members of the library. There is a convenient option to rename them with a custom label by using the **as** specification: - - -``` -import numpy as np -from scipy import stats -import matplotlib.pyplot as plt -``` - -You may also decide to import only a submodule (as in the second and third lines). The syntax has two (more or less) equivalent options: **import module.submodule** and **from module import submodule**. - -#### Defining variables - -Python's variables are declared the first time a value is assigned to them: - - -``` -input_file_name = "anscombe.csv" -delimiter = "\t" -skip_header = 3 -column_x = 0 -column_y = 1 -``` - -The variable types are inferred by the value that is assigned to the variable. There are no variables with constant values unless they are declared in a module and can only be read. Idiomatically, variables that should not be modified should be named in uppercase. - -#### Printing output - -Running the programs through the command line means that the output is just printed on the terminal. Python has the [**print()**][21] function that, by default, prints its argument and adds a newline at the end of the output: - - -``` -`print("#### Anscombe's first set with Python ####")` -``` - -It is possible to combine the **print()** function with the [formatting power][22] of the [string class][23] in Python. Strings have the **format** method that can be used to add some formatted text to the string itself. For instance, it is possible to add a formatted float number, e.g.: - - -``` -`print("Slope: {:f}".format(slope))` -``` - -#### Reading data - -Reading CSV files is very easy with NumPy and the function [**genfromtxt()**][24], which generates a [NumPy array][25]: - - -``` -`data = np.genfromtxt(input_file_name, delimiter = delimiter, skip_header = skip_header)` -``` - -In Python, a function can have a variable number of arguments, and you can have it pass a subset by specifying the desired ones. Arrays are very powerful matrix-like objects that can be easily sliced into smaller arrays: - - -``` -x = data[:, column_x] -y = data[:, column_y] -``` - -The colons select the whole range, and they can also be used to select a subrange. For instance, to select the first two rows of the array, you would use: - - -``` -`first_two_rows = data[0:1, :]` -``` - -#### Fitting data - -SciPy provides convenient functions for data fitting, such as the [**linregress()**][26] function. This function provides some significant values related to the fit, such as the slope, intercept, and the correlation coefficient of the two datasets: - - -``` -slope, intercept, r_value, p_value, std_err = stats.linregress(x, y) - -print("Slope: {:f}".format(slope)) -print("Intercept: {:f}".format(intercept)) -print("Correlation coefficient: {:f}".format(r_value)) -``` - -Since **linregress()** provides several pieces of information, the result can be saved to several variables at the same time. - -#### Plotting - -The Matplotlib library plots only data points; therefore, you should define the points you want to plot. The **x** and **y** arrays were already defined, so you can directly plot them, but you also need data points that will represent the straight line. - - -``` -`fit_x = np.linspace(x.min() - 1, x.max() + 1, 100)` -``` - -The [**linspace()**][27] function conveniently generates a set of equally spaced values between two values. The ordinates can be easily calculated by exploiting the powerful NumPy arrays, which can be used in a formula as if they were ordinary numeric variables: - - -``` -`fit_y = slope * fit_x + intercept` -``` - -The formula is applied element-by-element on the array; therefore, the result has the same number of entries in the initial array. - -To create the plot, first, define a [figure object][28] that will contain all the graphics: - - -``` -fig_width = 7 #inch -fig_height = fig_width / 16 * 9 #inch -fig_dpi = 100 - -fig = plt.figure(figsize = (fig_width, fig_height), dpi = fig_dpi) -``` - -Several plots can be drawn on a figure; in Matplotlib, the plots are called [axes][29]. This example defines a single axis object to plot the data points: - - -``` -ax = fig.add_subplot(111) - -ax.plot(fit_x, fit_y, label = "Fit", linestyle = '-') -ax.plot(x, y, label = "Data", marker = '.', linestyle = '') - -ax.legend() -ax.set_xlim(min(x) - 1, max(x) + 1) -ax.set_ylim(min(y) - 1, max(y) + 1) -ax.set_xlabel('x') -ax.set_ylabel('y') -``` - -Save the figure to a [PNG image file][30] with: - - -``` -`fig.savefig('fit_python.png')` -``` - -If you want to display (instead of saving) the plot, call: - - -``` -`plt.show()` -``` - -This example references all the objects used in the plotting section: it defines the object **fig** and the object **ax**. This technicality is not necessary, as the **plt** object can be used directly to plot the datasets. The [Matplotlib tutorial][31] shows an interface such as: - - -``` -`plt.plot(fit_x, fit_y)` -``` - -Frankly, I do not like this approach because it hides the non-trivial interactions that happen between the various objects. Unfortunately, sometimes the [official examples][32] are a bit confusing because they tend to use different approaches. Referencing graphical objects is not necessary in this simple example, but it becomes important in more complex ones (such as when embedding plots in GUIs). - -#### Results - -The output on the command line is: - - -``` -#### Anscombe's first set with Python #### -Slope: 0.500091 -Intercept: 3.000091 -Correlation coefficient: 0.816421 -``` - -Here is the image Matplotlib generates. - -![Plot and fit of the dataset obtained with Python][33] - -### The GNU Octave way - -The [GNU Octave][34] language is primarily intended for numerical computations. It offers a simple syntax for manipulating vectors and matrices and has some powerful plotting facilities. It is an interpreted language like Python. Since Octave's syntax is [mostly compatible][35] with [MATLAB][36], it is often described as a free alternative to MATLAB. Octave is not listed among the most popular programming languages, but MATLAB is, so Octave is rather popular in a sense. MATLAB predates NumPy, and I have the feeling that it was inspired by the former. While you go through the example, you will see the analogies. - -#### Installation - -The [fitting_octave.m][37] example only needs the basic Octave package, making the installation in Fedora rather simple: - - -``` -`sudo dnf install octave` -``` - -#### Commenting code - -In Octave, you can add comments to code with the percent symbol (**%**), and you can also use **#** if MATLAB compatibility is not needed. The option to use **#** allows you to write the same special comment line from the Python example to execute the script directly on the command line. - -#### Necessary libraries - -Everything used in this example is contained in the basic package, so you do not need to load any new libraries. If you need a library, the [syntax][38] is **pkg load module**. This command adds the module's functions to the list of available functions. In this regard, Python has more flexibility. - -#### Defining variables - -Variables are defined with pretty much the same syntax as Python: - - -``` -input_file_name = "anscombe.csv"; -delimiter = "\t"; -skip_header = 3; -column_x = 1; -column_y = 2; -``` - -Note that the end of the line has a semicolon; this is not necessary, but it suppresses the output of the results of the line. Without a semicolon, the interpreter would print the result of the expression: - - -``` -octave:1> input_file_name = "anscombe.csv" -input_file_name = anscombe.csv -octave:2> sqrt(2) -ans =  1.4142 -``` - -#### Printing output - -The powerful function [**printf()**][39] is used to print on the terminal. Unlike in Python, the **printf()** function does not automatically add a newline at the end of the printed string, so you have to add it. The first argument is a string that can contain format information for the other arguments to be passed to the function, such as: - - -``` -`printf("Slope: %f\n", slope);` -``` - -In Python, the formatting is built into the string itself, but in Octave, it is specific to the **printf()** function. - -#### Reading data - -The [**dlmread()**][40] function can read text files structured like CSV files: - - -``` -`data = dlmread(input_file_name, delimiter, skip_header, 0);` -``` - -The result is a [matrix][41] object, which is one of the fundamental data types in Octave. Matrices may be sliced with a syntax similar to Python: - - -``` -x = data(:, column_x); -y = data(:, column_y); -``` - -The fundamental difference is that the indexes start at one instead of zero. Therefore, in the example, the __x__ column is column number one. - -#### Fitting data - -To fit the data with a straight line, you can use the [**polyfit()**][42] function. It fits the input data with a polynomial, so you just need to use a polynomial of order one: - - -``` -p = polyfit(x, y, 1); - -slope = p(1); -intercept = p(2); -``` - -The result is a matrix with the polynomial coefficients; therefore, it selects the first two indexes. To determine the correlation coefficient, use the [**corr()**][43] function: - - -``` -`r_value = corr(x, y);` -``` - -Finally, print the results with the **printf()** function: - - -``` -printf("Slope: %f\n", slope); -printf("Intercept: %f\n", intercept); -printf("Correlation coefficient: %f\n", r_value); -``` - -#### Plotting - -As in the Matplotlib example, you first need to create a dataset that represents the fitted line: - - -``` -fit_x = linspace(min(x) - 1, max(x) + 1, 100); -fit_y = slope * fit_x + intercept; -``` - -The analogy with NumPy is also evident here, as it uses the [**linspace()**][44] function that behaves just like the Python's equivalent version. - -Again, as with Matplotlib, create a [figure][45] object first, then create an [axes][46] object to hold the plots: - - -``` -fig_width = 7; %inch -fig_height = fig_width / 16 * 9; %inch -fig_dpi = 100; - -fig = figure("units", "inches", -             "position", [1, 1, fig_width, fig_height]); - -ax = axes("parent", fig); - -set(ax, "fontsize", 14); -set(ax, "linewidth", 2); -``` - -To set properties of the axes object, use the [**set()**][47] function. The interface is rather confusing, though, as the function expects a comma-separated list of property and value pairs. These pairs are just a succession of a string representing the property name and a second object representing the value for that property. There are also other functions to set various properties: - - -``` -xlim(ax, [min(x) - 1, max(x) + 1]); -ylim(ax, [min(y) - 1, max(y) + 1]); -xlabel(ax, 'x'); -ylabel(ax, 'y'); -``` - -Plotting is achieved with the [**plot()**][48] function. The default behavior is that each call resets the axes, so you need to use the function [**hold()**][49]. - - -``` -hold(ax, "on"); - -plot(ax, fit_x, fit_y, -     "marker", "none", -     "linestyle", "-", -     "linewidth", 2); -plot(ax, x, y, -     "marker", ".", -     "markersize", 20, -     "linestyle", "none"); - -hold(ax, "off"); -``` - -Also, it is possible in the **plot()** function to add the property and value pairs. The [legend][50] must be created separately, and the labels should be stated manually: - - -``` -lg = legend(ax, "Fit", "Data"); -set(lg, "location", "northwest"); -``` - -Finally, save the output to a PNG image: - - -``` -image_size = sprintf("-S%f,%f", fig_width * fig_dpi, fig_height * fig_dpi); -image_resolution = sprintf("-r%f,%f", fig_dpi); - -print(fig, 'fit_octave.png', -      '-dpng', -      image_size, -      image_resolution); -``` - -Confusingly, in this case, the options are passed as a single string with the property name and the value. Since in Octave strings do not have the formatting facilities of Python, you must use the [**sprintf()**][51] function. It behaves just like the **printf()** function, but its result is not printed, rather it is returned as a string. - -In this example, as in the Python one, the graphical objects are referenced to keep their interactions evident. If Python's documentation in this regard is a little bit confusing, [Octave's documentation][52] is even worse. Most of the examples I found did not care about referencing the objects; instead, they rely on the fact that the plotting commands act on the currently active figure. A global [root graphics object][53] keeps track of the existing figures and axes. - -#### Results - -The resulting output on the command line is: - - -``` -#### Anscombe's first set with Octave #### -Slope: 0.500091 -Intercept: 3.000091 -Correlation coefficient: 0.816421 -``` - -And this shows the resulting image generated with Octave. - -![Plot and fit of the dataset obtained with Octave][54] - -### Next up - -Both Python and GNU Octave can plot the same information, though they differ in how they get there. If you're looking to explore other languages to complete similar tasks, I highly recommend looking at [Rosetta Code][55]. It's a marvelous resource to see how to solve the same problems in many languages.  - -What language do you like to plot data in? Share your thoughts in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/python-gnu-octave-data-science - -作者:[Cristiano L. Fontana][a] -选题:[lujun9972][b] -译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/cristianofontana -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/analytics-graphs-charts.png?itok=sersoqbV (Analytics: Charts and Graphs) -[2]: https://en.wikipedia.org/wiki/Command-line_interface -[3]: https://en.wikipedia.org/wiki/Graphical_user_interface -[4]: https://gitlab.com/cristiano.fontana/polyglot_fit -[5]: https://en.wikipedia.org/wiki/Comma-separated_values -[6]: https://en.wikipedia.org/wiki/Anscombe%27s_quartet -[7]: https://www.python.org/ -[8]: https://www.tiobe.com/tiobe-index/ -[9]: https://redmonk.com/sogrady/2019/07/18/language-rankings-6-19/ -[10]: http://pypl.github.io/PYPL.html -[11]: https://octoverse.github.com/ -[12]: https://en.wikipedia.org/wiki/Interpreted_language -[13]: https://docs.python.org/3/library/ -[14]: https://numpy.org/ -[15]: https://www.scipy.org/ -[16]: https://matplotlib.org/ -[17]: https://getfedora.org/ -[18]: https://en.wikipedia.org/wiki/Comment_(computer_programming) -[19]: https://gitlab.com/cristiano.fontana/polyglot_fit/-/blob/master/fitting_python.py -[20]: https://en.wikipedia.org/wiki/Shebang_(Unix) -[21]: https://docs.python.org/3/library/functions.html#print -[22]: https://docs.python.org/3/library/string.html#string-formatting -[23]: https://docs.python.org/3/library/string.html -[24]: https://docs.scipy.org/doc/numpy/reference/generated/numpy.genfromtxt.html -[25]: https://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html -[26]: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.linregress.html -[27]: https://docs.scipy.org/doc/numpy/reference/generated/numpy.linspace.html -[28]: https://matplotlib.org/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure -[29]: https://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes -[30]: https://en.wikipedia.org/wiki/Portable_Network_Graphics -[31]: https://matplotlib.org/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py -[32]: https://matplotlib.org/gallery/index.html -[33]: https://opensource.com/sites/default/files/uploads/fit_python.png (Plot and fit of the dataset obtained with Python) -[34]: https://www.gnu.org/software/octave/ -[35]: https://wiki.octave.org/FAQ#Differences_between_Octave_and_Matlab -[36]: https://en.wikipedia.org/wiki/MATLAB -[37]: https://gitlab.com/cristiano.fontana/polyglot_fit/-/blob/master/fitting_octave.m -[38]: https://octave.org/doc/v5.1.0/Using-Packages.html#Using-Packages -[39]: https://octave.org/doc/v5.1.0/Formatted-Output.html#XREFprintf -[40]: https://octave.org/doc/v5.1.0/Simple-File-I_002fO.html#XREFdlmread -[41]: https://octave.org/doc/v5.1.0/Matrices.html -[42]: https://octave.org/doc/v5.1.0/Polynomial-Interpolation.html -[43]: https://octave.org/doc/v5.1.0/Correlation-and-Regression-Analysis.html#XREFcorr -[44]: https://octave.sourceforge.io/octave/function/linspace.html -[45]: https://octave.org/doc/v5.1.0/Multiple-Plot-Windows.html -[46]: https://octave.org/doc/v5.1.0/Graphics-Objects.html#XREFaxes -[47]: https://octave.org/doc/v5.1.0/Graphics-Objects.html#XREFset -[48]: https://octave.org/doc/v5.1.0/Two_002dDimensional-Plots.html#XREFplot -[49]: https://octave.org/doc/v5.1.0/Manipulation-of-Plot-Windows.html#XREFhold -[50]: https://octave.org/doc/v5.1.0/Plot-Annotations.html#XREFlegend -[51]: https://octave.org/doc/v5.1.0/Formatted-Output.html#XREFsprintf -[52]: https://octave.org/doc/v5.1.0/Two_002dDimensional-Plots.html#Two_002dDimensional-Plots -[53]: https://octave.org/doc/v5.1.0/Graphics-Objects.html#XREFgroot -[54]: https://opensource.com/sites/default/files/uploads/fit_octave.png (Plot and fit of the dataset obtained with Octave) -[55]: http://www.rosettacode.org/ diff --git a/translated/tech/20200220 Using Python and GNU Octave to plot data.md b/translated/tech/20200220 Using Python and GNU Octave to plot data.md new file mode 100644 index 0000000000..0c11406995 --- /dev/null +++ b/translated/tech/20200220 Using Python and GNU Octave to plot data.md @@ -0,0 +1,689 @@ +[#]: collector: (lujun9972) +[#]: translator: (heguangzhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using Python and GNU Octave to plot data) +[#]: via: (https://opensource.com/article/20/2/python-gnu-octave-data-science) +[#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) + +使用 Python 和 GNU Octave 绘制数据 +====== + +了解如何使用 Python 和 GNU Octave 完成一项常见的数据科学任务。 +![分析:图表和图形][1] + +数据科学是跨越编程语言的知识领域。有些人以解决这一领域的问题而闻名,而另一些人则鲜为人知。这篇文章将帮助你熟悉用一些流行语言做数据科学。 + +### 为数据科学选择 Python 和 GNU Octave + +我经常尝试学习一种新的编程语言。为什么?这主要是对旧方式的厌倦和对新方式的好奇的结合。当我开始编程时,我唯一知道的语言是 C 语言。那些年的编程生涯既艰难又危险,因为我不得不手动分配内存,管理指针,并记得释放内存。 + +然后一个朋友建议我试试 Python,现在编程生活变得简单多了。虽然程序运行变得慢多了,但我不必通过编写分析软件来受苦了。然而,我很快就意识到每种语言都有比其他语言更适合自己应用场景。后来我学习了其他一些语言,每种语言都给我带来了一些新的启发。发现新的编程风格让我可以将一些解决方案移植到其他语言中,这样一切都变得有趣多了。 + +为了对一种新的编程语言(及其文档)有所了解,我总是从编写一些执行我熟悉的任务的示例程序开始。为此,我将解释如何用 Python 和 GNU Octave 编写一个程序来完成一个你可以归类为数据科学的特殊任务。如果你已经熟悉其中一种语言,从中开始,浏览其他语言,寻找相似之处和不同之处。这并不是对编程语言的详尽比较,只是一个小小的展示。 + +所有的程序都应该在[命令行][2]上运行,而不是用[图形用户界面][3](GUI)。完整的例子可以在[多语种知识库][4]中找到。 + +### 编程任务 + +你将在本系列中编写的程序: + + * 从[CSV文件][5]中读取数据 + * 用直线插入数据(例如 _f(x)=m ⋅ x + q_) + * 将结果生成图像文件 + +这是许多数据科学家遇到的常见情况。示例数据是第一组[Anscombe's quartet][6],如下表所示。这是一组人工构建的数据,当用直线拟合时会给出相同的结果,但是它们的曲线非常不同。数据文件是一个文本文件,以制表符作为列分隔,以几行作为标题。此任务将仅使用第一组(例如:前两列)。 + +I + +II + +III + +IV + +x + +y + +x + +y + +x + +y + +x + +y + +10.0 + +8.04 + +10.0 + +9.14 + +10.0 + +7.46 + +8.0 + +6.58 + +8.0 + +6.95 + +8.0 + +8.14 + +8.0 + +6.77 + +8.0 + +5.76 + +13.0 + +7.58 + +13.0 + +8.74 + +13.0 + +12.74 + +8.0 + +7.71 + +9.0 + +8.81 + +9.0 + +8.77 + +9.0 + +7.11 + +8.0 + +8.84 + +11.0 + +8.33 + +11.0 + +9.26 + +11.0 + +7.81 + +8.0 + +8.47 + +14.0 + +9.96 + +14.0 + +8.10 + +14.0 + +8.84 + +8.0 + +7.04 + +6.0 + +7.24 + +6.0 + +6.13 + +6.0 + +6.08 + +8.0 + +5.25 + +4.0 + +4.26 + +4.0 + +3.10 + +4.0 + +5.39 + +19.0 + +12.50 + +12.0 + +10.84 + +12.0 + +9.13 + +12.0 + +8.15 + +8.0 + +5.56 + +7.0 + +4.82 + +7.0 + +7.26 + +7.0 + +6.42 + +8.0 + +7.91 + +5.0 + +5.68 + +5.0 + +4.74 + +5.0 + +5.73 + +8.0 + +6.89 + +### Python 方式 + + +[Python][7]是一种通用编程语言,是当今最流行的语言之一(从[TIOBE index][8]、[RedMonk编程语言排名][9]、[编程语言流行指数][10]、[State of the Octoverse of GitHub][11]和其他来源的调查结果可以看出)。这是一种[解释的语言][12];因此,源代码由执行指令的程序读取和评估。它有一个全面的[标准库][13]并且总体上非常好用(我没有参考这最后一句话;这只是我的拙见)。 + +#### 安装 + +要使用 Python 开发,你需要解释器和一些库。最低要求是: + + * [NumPy][14]用于合适的数组和矩阵操作 + * [SciPy][15]进行数据科学 + * [Matplotlib][16]绘图 + +在 [Fedora][17] 安装它们是很容易的: + + +``` +`sudo dnf install python3 python3-numpy python3-scipy python3-matplotlib` +``` + +#### 注释代码 + + +在 Python中,[注释][18]是通过在行首添加一个 **#** 来实现的,该行的其余部分将被解释器丢弃: + +``` +`# This is a comment ignored by the interpreter.` +``` + +[fitting_python.py][19]示例使用注释在源代码中插入许可信息,第一行是[特殊注释][20],它允许在命令行上执行脚本: + +``` +`#! /usr/bin/env python3` +``` +这一行通知命令行解释器,脚本需要由程序**python3**执行。 + +#### Required libraries + +在 Python 中,库和模块可以作为一个对象导入(如示例中的第一行),其中包含库的所有函数和成员。通过使用 **as** 规范可以用于定义标签并重命名它们: + +``` +import numpy as np +from scipy import stats +import matplotlib.pyplot as plt +``` + +你也可以决定只导入一个子模块(如第二行和第三行)。语法有两个(或多或少)等效选项: **import module.submodule** 和 **from module import submodule**。 + +#### 定义变量 + +Python 的变量是在第一次赋值时被声明的: + +``` +input_file_name = "anscombe.csv" +delimiter = "\t" +skip_header = 3 +column_x = 0 +column_y = 1 +``` + +变量类型由分配给变量的值推断。没有常量值的变量,除非它们在模块中声明并且只能被读取。习惯上,不被修改的变量应该用大写字母命名。 + +#### 打印输出 + +通过命令行运行程序意味着输出只能打印在终端上。Python 有[**print()**][21]函数,默认情况下,该函数打印其参数,并在输出的末尾添加一个换行符: + +``` +`print("#### Anscombe's first set with Python ####")` +``` + +在 Python 中,可以将**print()**函数与[字符串类][23]的[格式化能力][22]相结合。字符串具有**format**方法,可用于向字符串本身添加一些格式化文本。例如,可以添加格式化的浮点数,例如: + + +``` +`print("Slope: {:f}".format(slope))` +``` + +#### 读取数据 + +使用 NumPy 和 函数[**genfromtxt()**][24]读取CSV文件非常容易,该函数生成[NumPy数组][25]: + + +``` +`data = np.genfromtxt(input_file_name, delimiter = delimiter, skip_header = skip_header)` +``` + +在 Python中,一个函数可以有可变数量的参数,您可以通过指定所需的参数来让它传递一个子集。数组是非常强大的矩阵状对象,可以很容易地分割成更小的数组: + +``` +x = data[:, column_x] +y = data[:, column_y] +``` + +冒号选择整个范围,也可以用来选择子范围。例如,要选择数组的前两行,可以使用: + +``` +`first_two_rows = data[0:1, :]` +``` + +#### 拟合数据 + +SciPy提供了方便的数据拟合功能,例如[**linregress()**][26]功能。该函数提供了一些与拟合相关的重要值,如斜率、截距和两个数据集的相关系数: + +``` +slope, intercept, r_value, p_value, std_err = stats.linregress(x, y) + +print("Slope: {:f}".format(slope)) +print("Intercept: {:f}".format(intercept)) +print("Correlation coefficient: {:f}".format(r_value)) +``` + +因为**linregress()**提供了几条信息,所以结果可以同时保存到几个变量中。 + +#### 绘图 + +Matplotlib 库仅仅绘制数据点,因此,你应该定义要绘制的点的坐标。已经定义了**x** 和 **y** 数组,所以你可以直接绘制它们,但是你还需要代表直线的数据点。 + +``` +`fit_x = np.linspace(x.min() - 1, x.max() + 1, 100)` +``` + +[**linspace()**][27]函数可以方便地在两个值之间生成一组等距值。利用强大的 NumPy 数组可以轻松计算纵坐标,该数组可以像普通数值变量一样在公式中使用: + +``` +`fit_y = slope * fit_x + intercept` +``` + +公式在数组中逐元素应用;因此,结果在初始数组中具有相同数量的条目。 + +要绘图,首先,定义一个包含所有图形的[图形对象][28]: + +``` +fig_width = 7 #inch +fig_height = fig_width / 16 * 9 #inch +fig_dpi = 100 + +fig = plt.figure(figsize = (fig_width, fig_height), dpi = fig_dpi) +``` + +一个图形可以画几个图;在 Matplotlib 中,这些图块被称为[轴][29]。本示例定义一个单轴对象来绘制数据点: + +``` +ax = fig.add_subplot(111) + +ax.plot(fit_x, fit_y, label = "Fit", linestyle = '-') +ax.plot(x, y, label = "Data", marker = '.', linestyle = '') + +ax.legend() +ax.set_xlim(min(x) - 1, max(x) + 1) +ax.set_ylim(min(y) - 1, max(y) + 1) +ax.set_xlabel('x') +ax.set_ylabel('y') +``` + +将该图保存到[PNG image file][30]中,有: + +``` +`fig.savefig('fit_python.png')` +``` + +如果要显示(而不是保存)绘图,请调用: + + +``` +`plt.show()` +``` + +此示例引用了绘图部分中使用的所有对象:它定义了对象 **fig** 和对象 **ax**。这种技术细节是不必要的,因为 **plt** 对象可以直接用于绘制数据集。《[Matplotlib 教程][31]展示了这样一个界面: + +``` +`plt.plot(fit_x, fit_y)` +``` + +坦率地说,我不喜欢这种方法,因为它隐藏了各种对象之间发生的重要的的交互。不幸的是,有时[官方的例子][32]有点令人困惑,因为他们倾向于使用不同的方法。在这个简单的例子中,引用图形对象是不必要的,但是在更复杂的例子中(例如在图形用户界面中嵌入图形时),引用图形对象就变得很重要了。 + +#### 结果 + +命令行输入: + +``` +#### Anscombe's first set with Python #### +Slope: 0.500091 +Intercept: 3.000091 +Correlation coefficient: 0.816421 +``` + +这是 Matplotlib 产生的图像: + +![Plot and fit of the dataset obtained with Python][33] + +### GNU Octave 方式 + +[GNU Octave][34]语言主要用于数值计算。它提供了一个简单的操作向量和矩阵的语法,并且有一些强大的绘图工具。这是一种像 Python 一样的解释语言。由于 Octave的语法是[最兼容][35] [MATLAB][36],它经常被描述为一个免费的替代 MATLAB 的方案。Octave 没有被列为最流行的编程语言,但是 MATLAB 是,所以 Octave 在某种意义上是相当流行的。MATLAB 早于 NumPy,我觉得它是受到了前者的启发。当你看这个例子时,你会看到相似之处。 + +#### 安装 + +[fitting_octave.m][37]的例子只需要基本的 Octave 包,在 Fedora 中安装相当简单: + +``` +`sudo dnf install octave` +``` + +#### 注释代码 + +在Octave中,你可以用百分比符号(**%**)为代码添加注释,如果不需要与 MATLAB 兼容,你也可以使用 **#**。使用 **#** 的选项允许你从 Python 示例中编写相同的特殊注释行,以便直接在命令行上执行脚本。 + +#### 必要的库 + +本例中使用的所有内容都包含在基本包中,因此你不需要加载任何新的库。如果你需要一个库,[语法][38]是 **pkg load module**。该命令将模块的功能添加到可用功能列表中。在这方面,Python 具有更大的灵活性。 + +#### 定义变量 + +变量的定义与 Python 的语法基本相同: + +``` +input_file_name = "anscombe.csv"; +delimiter = "\t"; +skip_header = 3; +column_x = 1; +column_y = 2; +``` + +请注意,行尾有一个分号;这不是必需的,但是它会抑制行结果的输出。如果没有分号,解释器将打印表达式的结果: + +``` +octave:1> input_file_name = "anscombe.csv" +input_file_name = anscombe.csv +octave:2> sqrt(2) +ans =  1.4142 +``` + +#### 打印输出结果 + +强大的功能[**printf()**][39]是用来在终端上打印的。与 Python 不同,**printf()** 函数不会自动在打印字符串的末尾添加换行,因此你必须添加它。第一个参数是一个字符串,可以包含要传递给函数的其他参数的格式信息,例如: + +``` +`printf("Slope: %f\n", slope);` +``` + +在 Python 中,格式是内置在字符串本身中的,但是在 Octave 中,它是特定于 **printf()** 函数。 + +#### 读取数据 + +[**dlmread()**][40]函数可以读取类似CSV文件的文本内容: + +``` +`data = dlmread(input_file_name, delimiter, skip_header, 0);` +``` + +结果是一个[矩阵][41]对象,这是 Octave 中的基本数据类型之一。矩阵可以用类似于 Python 的语法进行切片: + +``` +x = data(:, column_x); +y = data(:, column_y); +``` + +根本的区别是索引从1开始,而不是从0开始。因此,在该示例中,__x__列是第一列。 + +#### 拟合数据 + +要用直线拟合数据,可以使用[**polyfit()**][42]函数。它用一个多项式拟合输入数据,所以你只需要使用一阶多项式: + + +``` +p = polyfit(x, y, 1); + +slope = p(1); +intercept = p(2); +``` + +结果是具有多项式系数的矩阵;因此,它选择前两个索引。要确定相关系数,请使用[**corr()**][43]函数: + + +``` +`r_value = corr(x, y);` +``` + +最后,使用 **printf()** 函数打印结果: + +``` +printf("Slope: %f\n", slope); +printf("Intercept: %f\n", intercept); +printf("Correlation coefficient: %f\n", r_value); +``` + +#### 绘图 + +与 Matplotlib 示例一样,首先需要创建一个表示拟合直线的数据集: + +``` +fit_x = linspace(min(x) - 1, max(x) + 1, 100); +fit_y = slope * fit_x + intercept; +``` + +与 NumPy 的相似性也很明显,因为它使用了[**linspace()**][44]函数,其行为就像 Python 的等效版本一样。 + +同样,与 Matplotlib 一样,首先创建一个[图][45]对象,然后创建一个[轴][46]对象来保存这些图: + +``` +fig_width = 7; %inch +fig_height = fig_width / 16 * 9; %inch +fig_dpi = 100; + +fig = figure("units", "inches", +             "position", [1, 1, fig_width, fig_height]); + +ax = axes("parent", fig); + +set(ax, "fontsize", 14); +set(ax, "linewidth", 2); +``` + + +要设置轴对象的属性,请使用[**set()**][47]函数。然而,该接口相当混乱,因为该函数需要一个逗号分隔的属性和值对列表。这些对只是代表属性名的一个字符串和代表该属性值的第二个对象的连续。还有其他设置各种属性的功能: + +``` +xlim(ax, [min(x) - 1, max(x) + 1]); +ylim(ax, [min(y) - 1, max(y) + 1]); +xlabel(ax, 'x'); +ylabel(ax, 'y'); +``` + +标图是用[**plot()**][48]功能实现的。默认行为是每次调用都会重置坐标轴,因此需要使用函数[**hold()**][49]。 + + +``` +hold(ax, "on"); + +plot(ax, fit_x, fit_y, +     "marker", "none", +     "linestyle", "-", +     "linewidth", 2); +plot(ax, x, y, +     "marker", ".", +     "markersize", 20, +     "linestyle", "none"); + +hold(ax, "off"); +``` + +此外,还可以在 **plot()** 函数中添加属性和值对。[legend][50]必须单独创建,标签应手动声明: + +``` +lg = legend(ax, "Fit", "Data"); +set(lg, "location", "northwest"); +``` + +最后,将输出保存到PNG图像: + +``` +image_size = sprintf("-S%f,%f", fig_width * fig_dpi, fig_height * fig_dpi); +image_resolution = sprintf("-r%f,%f", fig_dpi); + +print(fig, 'fit_octave.png', +      '-dpng', +      image_size, +      image_resolution); +``` + +令人困惑的是,在这种情况下,选项被作为一个字符串传递,带有属性名和值。因为在 Octave 字符串中没有 Python 的格式化工具,所以必须使用[**sprintf()**][51]函数。它的行为就像**printf()**函数,但是它的结果不是打印出来的,而是作为字符串返回的。 + +在这个例子中,就像在 Python 中一样,图形对象很明显被引用以保持它们之间的交互。如果说 Python 在这方面的文档有点混乱,那么[Octave 的文档][52]就更糟糕了。我发现的大多数例子都不关心引用对象;相反,它们依赖于绘图命令作用于当前活动图形。全局[根图形对象][53]跟踪现有的图形和轴。 + +#### 结果 + +命令行上的结果输出是: + +``` +#### Anscombe's first set with Octave #### +Slope: 0.500091 +Intercept: 3.000091 +Correlation coefficient: 0.816421 +``` + +它显示了用 Octave 生成的结果图像。 + +![Plot and fit of the dataset obtained with Octave][54] + +### 下一个 + +Python 和 GNU Octave 都可以绘制出相同的信息,尽管它们的实现方式不同。如果你想探索其他语言来完成类似的任务,我强烈建议你看看[Rosetta 代码][55]。这是一个了不起的资源,可以看到如何用多种语言解决同样的问题。 + +你喜欢用什么语言绘制数据?在评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/python-gnu-octave-data-science + +作者:[Cristiano L. Fontana][a] +选题:[lujun9972][b] +译者:[heguangzhi](https://github.com/heguangzhi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cristianofontana +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/analytics-graphs-charts.png?itok=sersoqbV (Analytics: Charts and Graphs) +[2]: https://en.wikipedia.org/wiki/Command-line_interface +[3]: https://en.wikipedia.org/wiki/Graphical_user_interface +[4]: https://gitlab.com/cristiano.fontana/polyglot_fit +[5]: https://en.wikipedia.org/wiki/Comma-separated_values +[6]: https://en.wikipedia.org/wiki/Anscombe%27s_quartet +[7]: https://www.python.org/ +[8]: https://www.tiobe.com/tiobe-index/ +[9]: https://redmonk.com/sogrady/2019/07/18/language-rankings-6-19/ +[10]: http://pypl.github.io/PYPL.html +[11]: https://octoverse.github.com/ +[12]: https://en.wikipedia.org/wiki/Interpreted_language +[13]: https://docs.python.org/3/library/ +[14]: https://numpy.org/ +[15]: https://www.scipy.org/ +[16]: https://matplotlib.org/ +[17]: https://getfedora.org/ +[18]: https://en.wikipedia.org/wiki/Comment_(computer_programming) +[19]: https://gitlab.com/cristiano.fontana/polyglot_fit/-/blob/master/fitting_python.py +[20]: https://en.wikipedia.org/wiki/Shebang_(Unix) +[21]: https://docs.python.org/3/library/functions.html#print +[22]: https://docs.python.org/3/library/string.html#string-formatting +[23]: https://docs.python.org/3/library/string.html +[24]: https://docs.scipy.org/doc/numpy/reference/generated/numpy.genfromtxt.html +[25]: https://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html +[26]: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.linregress.html +[27]: https://docs.scipy.org/doc/numpy/reference/generated/numpy.linspace.html +[28]: https://matplotlib.org/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure +[29]: https://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes +[30]: https://en.wikipedia.org/wiki/Portable_Network_Graphics +[31]: https://matplotlib.org/tutorials/introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py +[32]: https://matplotlib.org/gallery/index.html +[33]: https://opensource.com/sites/default/files/uploads/fit_python.png (Plot and fit of the dataset obtained with Python) +[34]: https://www.gnu.org/software/octave/ +[35]: https://wiki.octave.org/FAQ#Differences_between_Octave_and_Matlab +[36]: https://en.wikipedia.org/wiki/MATLAB +[37]: https://gitlab.com/cristiano.fontana/polyglot_fit/-/blob/master/fitting_octave.m +[38]: https://octave.org/doc/v5.1.0/Using-Packages.html#Using-Packages +[39]: https://octave.org/doc/v5.1.0/Formatted-Output.html#XREFprintf +[40]: https://octave.org/doc/v5.1.0/Simple-File-I_002fO.html#XREFdlmread +[41]: https://octave.org/doc/v5.1.0/Matrices.html +[42]: https://octave.org/doc/v5.1.0/Polynomial-Interpolation.html +[43]: https://octave.org/doc/v5.1.0/Correlation-and-Regression-Analysis.html#XREFcorr +[44]: https://octave.sourceforge.io/octave/function/linspace.html +[45]: https://octave.org/doc/v5.1.0/Multiple-Plot-Windows.html +[46]: https://octave.org/doc/v5.1.0/Graphics-Objects.html#XREFaxes +[47]: https://octave.org/doc/v5.1.0/Graphics-Objects.html#XREFset +[48]: https://octave.org/doc/v5.1.0/Two_002dDimensional-Plots.html#XREFplot +[49]: https://octave.org/doc/v5.1.0/Manipulation-of-Plot-Windows.html#XREFhold +[50]: https://octave.org/doc/v5.1.0/Plot-Annotations.html#XREFlegend +[51]: https://octave.org/doc/v5.1.0/Formatted-Output.html#XREFsprintf +[52]: https://octave.org/doc/v5.1.0/Two_002dDimensional-Plots.html#Two_002dDimensional-Plots +[53]: https://octave.org/doc/v5.1.0/Graphics-Objects.html#XREFgroot +[54]: https://opensource.com/sites/default/files/uploads/fit_octave.png (Plot and fit of the dataset obtained with Octave) +[55]: http://www.rosettacode.org/ From 44d57572779f5b397e8662cf7a713281da4b0317 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Feb 2020 21:52:56 +0800 Subject: [PATCH 145/315] translate done: 20200128 Send email and check your calendar with Emacs.md --- ...6 things you should be doing with Emacs.md | 53 +++++- ...mail and check your calendar with Emacs.md | 152 ----------------- ...mail and check your calendar with Emacs.md | 154 ++++++++++++++++++ 3 files changed, 200 insertions(+), 159 deletions(-) delete mode 100644 sources/tech/20200128 Send email and check your calendar with Emacs.md create mode 100644 translated/tech/20200128 Send email and check your calendar with Emacs.md diff --git a/sources/tech/20200123 6 things you should be doing with Emacs.md b/sources/tech/20200123 6 things you should be doing with Emacs.md index b01830cd8e..059cd4b18e 100644 --- a/sources/tech/20200123 6 things you should be doing with Emacs.md +++ b/sources/tech/20200123 6 things you should be doing with Emacs.md @@ -8,84 +8,123 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) 6 things you should be doing with Emacs +你应该用Emacs做的6件事 ====== Here are six things you may not have realized you could do with Emacs. +下面是您可能没有意识到的Emacs可以做的六件事。 Then, get our new cheat sheet to get the most out of Emacs. +然后,使用我们的新备忘单来充分利用Emacs。 ![Text editor on a browser, in blue][1] +[在蓝色浏览器上给编辑发短信][1] Imagine using Python's IDLE interface to edit text. You would be able to load files into memory, edit them, and save changes. But every action you perform would be defined by a Python function. Making a word all capitals, for instance, calls **upper()**, opening a file calls **open**, and so on. Everything in your text document is a Python object and can be manipulated accordingly. From the user's perspective, it's the same experience as any text editor. For a Python developer, it's a rich Python environment that can be changed and developed with just a few custom functions in a config file. +想象一下使用Python的空闲接口来编辑文本。您可以将文件加载到内存中,编辑它们,并保存更改。但是您执行的每个操作都将由Python函数定义。例如,使一个单词全部大写,调用**upper()**,打开一个文件调用**open**,等等。文本文档中的所有内容都是Python对象,可以相应地进行操作。从用户的角度来看,这与任何文本编辑器的体验都是一样的。对于Python开发人员来说,这是一个丰富的Python环境,只需在配置文件中添加几个自定义函数就可以对其进行更改和开发。 This is what [Emacs][2] does for the 1958 programming language [Lisp][3]. In Emacs, there's no separation between the Lisp engine running the application and the arbitrary text you type into it. To Emacs, everything is Lisp data, so everything can be analyzed and manipulated programmatically. +这就是[Emacs][2]对1958年的编程语言[Lisp][3]所做的。在Emacs中,运行应用程序的Lisp引擎与您输入的任意文本之间没有分离。对于Emacs,一切都是Lisp数据,因此一切都可以通过编程进行分析和操作。 That makes for a powerful user interface (UI). But if you're a casual Emacs user, you may only be scratching the surface of what it can do for you. Here are six things you may not have realized you could do with Emacs. +这就形成了一个强大的用户界面(UI)。但是,如果您是Emacs的普通用户,您可能只了解它能为您做些什么。下面是您可能没有意识到的Emacs可以做的六件事。 ## Use Tramp mode for cloud editing +使用流浪汉模式进行克劳德编辑 Emacs has been network-transparent for a lot longer than has been trendy, and today it still provides one of the smoothest remote editor experiences available. The [Tramp mode][4] in Emacs (formerly known as RPC mode) stands for "Transparent Remote (file) Access, Multiple Protocol," which spells out exactly what it offers: easy access to remote files you want to edit over most popular network protocols. The most popular and safest protocol for remote editing these days is [OpenSSH][5], so that's the default. +Emacs实现网络透明的时间要比流行的时间长得多,而且时至今日,它仍然提供最流畅的远程编辑体验。Emacs中的[Tramp模式][4](以前称为RPC模式)代表“透明的远程(文件)访问,多协议”,它详细说明了它提供的功能:通过最流行的网络协议轻松访问您希望编辑的远程文件。目前最流行、最安全的远程编辑协议是[OpenSSH][5],因此它是默认的。 Tramp is already included in Emacs 22.1 or greater, so to use Tramp, you just open a file in the Tramp syntax. In the **File** menu of Emacs, select **Open File**. When prompted in the mini-buffer at the bottom of the Emacs window, enter the file name using this syntax: +在Emacs 22.1或更高版本中已经包含了Tramp,因此要使用Tramp,只需在Tramp语法中打开一个文件。在Emacs的**File**菜单中,选择**Open File**。当在Emacs窗口底部的小缓冲区中出现提示时,使用以下语法输入文件名: ``` +引用---------------------------------------------------- `/ssh:user@example.com:/path/to/file` ``` If you are required to log in interactively, Tramp prompts you for your password. However, Tramp uses OpenSSH directly, so to avoid interactive prompts, you can also add your hostname, username, and SSH key path to your **~/.ssh/config** file. Like Git, Emacs uses your SSH config first and only stops to ask for more information in the event of an error. +如果需要交互式登录,Tramp会提示您输入密码。但是,Tramp直接使用OpenSSH,所以为了避免交互提示,您还可以将您的主机名、用户名和SSH密钥路径添加到您的**~/。ssh / config文件* *。与Git一样,Emacs首先使用SSH配置,只有在出现错误时才会停下来询问更多信息。 Tramp is great for editing files that don't exist on your computer, and the user experience is not noticeably any different from editing a local file. The next time you start to SSH into a server just to launch a Vim or Emacs session, try Tramp instead. +Tramp非常适合编辑计算机上不存在的文件,用户体验与编辑本地文件没有明显的区别。下一次,当您为了启动Vim或Emacs会话而开始SSH到服务器时,请尝试使用Tramp。 ## Calendaring +# Calendaring If you parse text better than you parse graphical interfaces, you'll be happy to know that you can schedule your day (or life) in plain text with Emacs but still get fancy notifications on your mobile device with open source [Org mode][6] viewers. +如果您解析文本比解析图形界面更好,那么您会很高兴地知道,您可以使用Emacs以纯文本方式安排您的一天(或生活),但仍然可以在您的移动设备上使用开放源码[Org模式][6]查看器获得花哨的通知。 The process takes a little setup to create a convenient way to sync your agenda with your mobile device (I use Git, but you could invoke Bluetooth, KDE Connect, Nextcloud, or your file synchronization tool of choice), and you have to install an Org mode viewer (such as [Orgzly][7]) and a Git client app on your mobile. Once you've got your infrastructure sorted, though, the process is inherently perfectly integrated with your usual (or developing, if you're a new user) Emacs workflow. You can refer to your agenda easily in Emacs, make updates to your schedule, and generally stay on task. Pushing changes to your agenda is reflected on your mobile, so you can stay organized even when Emacs isn't available. +这个过程需要一些设置创建一个方便的方式来移动设备同步你的议程(我使用Git,但你可以调用蓝牙,KDE连接,Nextcloud,或您的文件同步工具的选择),你必须安装一个组织模式查看器(如[Orgzly][7])和一个Git客户对你的移动应用程序。但是,一旦您对基础设施进行了排序,该流程就会与您通常使用的Emacs工作流完美地集成在一起(如果您是新用户,则会进行开发)。您可以在Emacs中方便地查阅您的日程,更新您的日程,并通常停留在任务上。推动您的议程的变化反映在您的移动设备上,因此即使Emacs不可用,您也可以保持组织性。 ![][8] Intrigued? Read my step-by-step guide about [calendaring with Org mode and Git][9]. +感兴趣吗?阅读我的关于[使用Org模式和Git进行日历][9]的逐步指南。 ## Access the terminal +访问终端 There are [lots of terminal emulators][10] available. Although the Elisp terminal emulator in Emacs isn't the greatest general-purpose one, it's got two notable advantages. +有[许多终端模拟器][10]可用。尽管Emacs中的Elisp终端仿真器不是最强大的通用仿真器,但是它有两个显著的优点。 - 1. **Opens in an Emacs buffer: **I use Emacs' Elisp shell because it's conveniently located in my Emacs window, which I often run in fullscreen. It's a small but significant advantage to have a terminal just a **Ctrl+x+o** (or C-x o in Emacs notation) away, and it's especially nice to be able to glance over at it for status reports when it's running a lengthy job. - 2. **Easy copying and pasting if no system clipboard is available:** Whether I'm too lazy to move my hand from the keys to the mouse, or I don't have mouse functionality because I'm running Emacs in a remote console, having a terminal in Emacs can sometimes mean a quick transfer of data from my Emacs buffer to Bash. +1. **Opens in an Emacs buffer: **I use Emacs' Elisp shell because it's conveniently located in my Emacs window, which I often run in fullscreen. It's a small but significant advantage to have a terminal just a **Ctrl+x+o** (or C-x o in Emacs notation) away, and it's especially nice to be able to glance over at it for status reports when it's running a lengthy job. +1. 我使用Emacs的Elisp shell,因为它方便地位于我的Emacs窗口,我经常在全屏运行。这是一个小但重要的优势,有一个终端只是**Ctrl+x+o**(或C-x o在Emacs符号),它是特别好的,能够浏览它的状态报告,当它运行一个漫长的作业。 +2. **Easy copying and pasting if no system clipboard is available:** Whether I'm too lazy to move my hand from the keys to the mouse, or I don't have mouse functionality because I'm running Emacs in a remote console, having a terminal in Emacs can sometimes mean a quick transfer of data from my Emacs buffer to Bash. +2. * *简单的复制和粘贴,如果没有可用系统剪贴板:* *是否我太懒惰的关键将我的手从鼠标,或者我没有鼠标功能,因为我在远程控制台运行Emacs,在Emacs有时意味着终端快速传输数据从我的Emacs缓冲Bash。 To try the Emacs terminal, type **Alt**+**x** (**M-x** in Emacs notation), then type **shell**, and press **Return**. +要尝试Emacs终端,输入**Alt**+**x** (Emacs符号中的**M-x**),然后输入**shell**,然后按**Return**。 ## Use Racket mode +使用球拍模式 [Racket][11] is an exciting emerging Lisp dialect with a dynamic programming environment, a GUI toolkit, and a passionate community. The default editor when learning Racket is DrRacket, which has a Definitions panel at the top and an Interactions panel at the bottom. Using this setup, the user writes definitions that affect the Racket runtime. Imagine the old [Logo Turtle][12] program, but with a terminal instead of just a turtle. +[11]是一种激动人心的新兴Lisp语言,拥有动态编程环境、GUI工具包和热情的社区。学习球拍的默认编辑器是dr球拍,它的顶部有一个定义面板,底部有一个交互面板。使用此设置,用户可以编写影响球拍运行时的定义。想象一下旧的[Logo Turtle][12]程序,但是有一个终端而不是一个Turtle。 ![Racket-mode][13] +[Racket-mode] [13] ! LGPL sample code by PLT +由PLT提供的LGPL示例代码 Emacs, being based on Lisp, makes a great integrated development environment (IDE) for advanced Racket coders. It doesn't ship with [Racket mode][14] (yet), but you can install Racket mode and several other helper extensions using the Emacs package installer. To install it, press **Alt**+**X** (**M-x** in Emacs notation), type **package-install**, and press **Return**. Then enter the package you want to install (**racket-mode**), and press **Return**. +基于Lisp的Emacs为高级球拍编程人员提供了一个很好的集成开发环境(IDE)。它还没有[球拍模式][14],但你可以安装球拍模式和其他几个助手扩展使用Emacs包安装程序。要安装它,按**Alt**+**X** (**M-x** Emacs符号),键入**package-install**,然后按**Return**。然后输入要安装的包(**rac模式**),按**Return**。 Enter Racket mode with **M-x racket-mode**. If you're new to Racket but not to Lisp or Emacs, start with the excellent [Quick introduction to Racket with pictures][15]. +进入球拍模式,使用**M-x球拍模式**。如果你是球拍新手,但不是口齿不清或Emacs,开始优秀[快速介绍球拍与图片][15]。 ## Scripting +# # Scripting You might know that Bash scripts are popular for automating and enhancing your Linux or Unix experience. You may have heard that Python does a pretty good job of that, too. But did you know that Lisp scripts can be run in much the same way? There's sometimes confusion about just how useful Lisp really is because many people are introduced to Lisp through Emacs, so there's the latent impression that the only way to run Lisp in the 21st century is to open an Emacs window. Luckily, that's not the case at all, and Emacs is a great IDE for the tools that enable you to run Lisp scripts as general system executables. +您可能知道,Bash脚本在自动化和增强您的Linux或Unix体验方面很流行。您可能听说过Python在这方面也做得很好。但是你知道Lisp脚本可以用同样的方式运行吗?有时人们会对Lisp到底有多有用感到困惑,因为许多人是通过Emacs来了解Lisp的,因此有一种潜在的印象,即在21世纪运行Lisp的惟一方法是打开Emacs窗口。幸运的是,事实并非如此,Emacs是一个很好的IDE,它支持将Lisp脚本作为一般的系统可执行文件来运行。 There are two popular modern Lisps, aside from Elisp, that are easy to run as standalone scripts. +除了Elisp之外,有两种流行的现代lisp很容易作为独立脚本运行。 - 1. **Racket:** You can run Racket scripts relying on your system's Racket install to provide runtime support, or you can use **raco exe** to produce an executable. The **raco exe** command packages your code together with runtime support files to create an executable. The **raco distribute** command then packages that executable into a distribution that works on other machines. Emacs has many Racket-specific tools, so creating Racket files in Emacs is easy and efficient. +1. **Racket:** You can run Racket scripts relying on your system's Racket install to provide runtime support, or you can use **raco exe** to produce an executable. The **raco exe** command packages your code together with runtime support files to create an executable. The **raco distribute** command then packages that executable into a distribution that works on other machines. Emacs has many Racket-specific tools, so creating Racket files in Emacs is easy and efficient. +1. **球拍:**你可以运行球拍脚本依赖于你的系统的球拍安装提供运行时支持,或者你可以使用**raco exe**产生一个可执行文件。**raco exe**命令将代码和运行时支持文件打包,以创建可执行文件。然后,**raco distribution **命令将可执行文件打包到在其他机器上工作的发行版中。Emacs有许多特定于球拍的工具,因此在Emacs中创建球拍文件既简单又有效。 - 2. **GNU Guile:** [GNU Guile][16] (short for "GNU Ubiquitous Intelligent Language for Extensions") is an implementation of the [Scheme][17] programming language that's used for creating applications and games for the desktop, internet, terminal, and more. Writing Scheme is easy, using any one of the many Scheme extensions in Emacs. For example, here's a "Hello world" script in Guile: [code] #!/usr/bin/guile -s +2. **GNU Guile:** [GNU Guile][16] (short for "GNU Ubiquitous Intelligent Language for Extensions") is an implementation of the [Scheme][17] programming language that's used for creating applications and games for the desktop, internet, terminal, and more. Writing Scheme is easy, using any one of the many Scheme extensions in Emacs. For example, here's a "Hello world" script in Guile: [code] #!/usr/bin/guile -s +2. **GNU Guile:** [GNU Guile][16](“GNU通用智能语言扩展”的缩写)是[Scheme][17]编程语言的一个实现,它用于为桌面、internet、终端等创建应用程序和游戏。使用Emacs中众多Scheme扩展中的任何一个,编写Scheme都很容易。例如,这里有一个用Guile编写的“Hello world”脚本:[code] #!/usr/bin/guile - s !# (display "hello world") +(显示“hello world”)      (newline) [/code] Compile and run it with the **guile** command: [code] $ guile ./hello.scheme +(换行)[/code]编译并运行**guile**命令:[code] $ guile ./hello.scheme ;;; compiling /home/seth/./hello.scheme +;;;compiling / home /塞斯-你好。怀廷 ;;; compiled [...]/hello.scheme.go +;;;[…]/ hello.scheme.go编译 hello world +你好,世界 $ guile ./hello.scheme -hello world +你好,scheme +hello world +你好,世界 ``` +引用---------------------------------------------------- ## Run Elisp without Emacs - -Emacs can serve as an Elisp runtime, but you don't have to "open" Emacs in the traditional sense. The **\--script** option allows you to run Elisp scripts using Emacs as the engine but without launching the Emacs GUI (not even its terminal-based one). In this example, the **-Q** option causes Emacs to ignore your **.emacs** file to avoid any delays in executing the Elisp script (if your script relies upon something \ No newline at end of file diff --git a/sources/tech/20200128 Send email and check your calendar with Emacs.md b/sources/tech/20200128 Send email and check your calendar with Emacs.md deleted file mode 100644 index fb0183c1da..0000000000 --- a/sources/tech/20200128 Send email and check your calendar with Emacs.md +++ /dev/null @@ -1,152 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lujun9972) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Send email and check your calendar with Emacs) -[#]: via: (https://opensource.com/article/20/1/emacs-mail-calendar) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Send email and check your calendar with Emacs -====== -Manage your email and view your schedule with the Emacs text editor in -the eighteenth in our series on 20 ways to be more productive with open -source in 2020. -![Document sending][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### Doing (almost) all the things with Emacs, part 1 - -Two days ago, I shared that I use both [Vim][2] and [Emacs][3] regularly, and on days [16][4] and [17][5] of this series, I explained how to do almost everything in Vim. Now, it's time for Emacs! - -![Mail and calendar in Emacs][6] - -Before I get too far, I should explain two things. First, I'm doing everything here using the default Emacs configuration, not [Spacemacs][7], which I have [written about][8]. Why? Because I will be using the default keyboard mappings so that you can refer back to the documentation and not have to translate things from "native Emacs" to Spacemacs. Second, I'm not setting up Org mode in this series. Org mode almost needs an entire series on its own, and, while it is very powerful, the setup can be quite complex. - -#### Configure Emacs - -Configuring Emacs is a little bit more complicated than configuring Vim, but in my opinion, it is worth it in the long run. Start by creating a configuration file and opening it in Emacs: - - -``` -mkdir ~/.emacs.d -emacs ~/.emacs.d/init.el -``` - -Next, add some additional package sources to the built-in package manager. Add the following to **init.el**: - - -``` -(package-initialize) -(add-to-list 'package-archives '("melpa" . "")) -(add-to-list 'package-archives '("org" . "") t) -(add-to-list 'package-archives '("gnu" . "")) -(package-refresh-contents) -``` - -Save the file with **Ctrl**+**x** **Ctrl**+**s**, exit with **Ctrl**+**x** **Ctrl**+**c**, and restart Emacs. It will download all the package lists at startup, and then you should be ready to install things with the built-in package manager. Start by typing **Meta**+**x** to bring up a command prompt (the **Meta** key is the **Alt** key on most keyboards or **Option** on MacOS). At the command prompt, type **package-list-packages** to bring up a list of packages you can install. Go through the list and select the following packages with the **i** key: - - -``` -bbdb -bbdb-vcard -calfw -calfw-ical -notmuch -``` - -Once the packages are selected, press **x** to install them. Depending on your internet connection, this could take a while. You may see some compile errors, but it's safe to ignore them. Once it completes, open **~/.emacs.d/init.el** with the key combination **Ctrl**+**x** **Ctrl**+**f**, and add the following lines to the file after **(package-refresh-packages)** and before **(custom-set-variables**. Emacs uses the **(custom-set-variables** line internally, and you should never, ever modify anything below it. Lines beginning with **;;** are comments. - - -``` -;; Set up bbdb -(require 'bbdb) -(bbdb-initialize 'message) -(bbdb-insinuate-message) -(add-hook 'message-setup-hook 'bbdb-insinuate-mail) -;; set up calendar -(require 'calfw) -(require 'calfw-ical) -;; Set this to the URL of your calendar. Google users will use -;; the Secret Address in iCalendar Format from the calendar settings -(cfw:open-ical-calendar "") -;; Set up notmuch -(require 'notmuch) -;; set up mail sending using sendmail -(setq send-mail-function (quote sendmail-send-it)) -(setq user-mail-address "[myemail@mydomain.com][9]" -      user-full-name "My Name") -``` - -Now you are ready to start Emacs with your setup! Save the **init.el** file (**Ctrl**+**x** **Ctrl**+**s**), exit Emacs (**Ctrl**+**x** **Ctrl**+**c**), and then restart it. It will take a little longer to start this time. - -#### Read and write email in Emacs with Notmuch - -Once you are at the Emacs splash screen, you can start reading your email with [Notmuch][10]. Type **Meta**+**x notmuch**, and you'll get Notmuch's Emacs interface. - -![Reading mail with Notmuch][11] - -All the items in bold type are links to email views. You can access them with either a mouse click or by tabbing between them and pressing **Return** or **Enter**. You can use the search bar to - -search Notmuch's database using the [same syntax][12] as you use on Notmuch's command line. If you want, you can save any searches for later use with the **[save]** button, and they will be added to the list at the top of the screen. If you follow one of the links, you will get a list of the relevant email messages. You can navigate the list with the **Arrow** keys, and press **Enter** on the message you want to read. Pressing **r** will reply to a message, **f** will forward the message, and **q** will exit the current screen. - -You can write a new message by typing **Meta**+**x compose-mail**. Composing, replying, and forwarding all bring up the mail writing interface. When you are done writing your email, press **Ctrl**+**c Ctrl**+**c** to send it. If you decide you don't want to send it, press **Ctrl**+**c Ctrl**+**k** to kill the message compose buffer (window). - -#### Autocomplete email addresses in Emacs with BBDB - -![Composing a message with BBDB addressing][13] - -But what about your address book? That's where [BBDB][14] comes in. But first, import all your addresses from [abook][15] by opening a command line and running the following export command: - - -``` -`abook --convert --outformat vcard --outfile ~/all-my-addresses.vcf --infile ~/.abook/addresses` -``` - -Once Emacs starts, run **Meta**+**x bbdb-vcard-import-file**. It will prompt you for the file name you want to import, which is **~/all-my-addresses.vcf**. After the import finishes, when you compose a message, you can start typing a name and use **Tab** to search and autocomplete the "To" field. BBDB will also open a buffer for the contact so you can make sure it's the correct one. - -Why do it this way when you already have each address as a **vcf.** file from [vdirsyncer][16]? If you are like me, you have a LOT of addresses, and doing them one at a time is a lot of work. This way, you can take everything you have in abook and make one big file. - -#### View your calendar in Emacs with calfw - -![calfw calendar][17] - -Finally, you can use Emacs to look at your calendar. In the configuration section above, you installed the [calfw][18] package and added lines to tell it where to find the calendars to load. Calfw is short for the Calendar Framework for Emacs, and it supports many calendar formats. Since I use Google calendar, that is the link I put into my config. Your calendar will auto-load at startup, and you can view it by switching the **cfw-calendar** buffer with the **Ctrl**+**x**+**b** command. - -Calfw offers views by the day, week, two weeks, and month. You can select the view from the top of the calendar and navigate your calendar with the **Arrow** keys. Unfortunately, calfw can only view calendars, so you'll still need to use something like [khal][19] or a web interface to add, delete, and modify events. - -So there you have it: mail, calendars, and addresses in Emacs. Tomorrow I'll do even more. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/emacs-mail-calendar - -作者:[Kevin Sonney][a] -选题:[lujun9972][b] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_paper_envelope_document.png?itok=uPj_kouJ (Document sending) -[2]: https://www.vim.org/ -[3]: https://www.gnu.org/software/emacs/ -[4]: https://opensource.com/article/20/1/vim-email-calendar -[5]: https://opensource.com/article/20/1/vim-task-list-reddit-twitter -[6]: https://opensource.com/sites/default/files/uploads/productivity_18-1.png (Mail and calendar in Emacs) -[7]: https://www.spacemacs.org/ -[8]: https://opensource.com/article/19/12/spacemacs -[9]: mailto:myemail@mydomain.com -[10]: https://notmuchmail.org/ -[11]: https://opensource.com/sites/default/files/uploads/productivity_18-2.png (Reading mail with Notmuch) -[12]: https://opensource.com/article/20/1/organize-email-notmuch -[13]: https://opensource.com/sites/default/files/uploads/productivity_18-3.png (Composing a message with BBDB addressing) -[14]: https://www.jwz.org/bbdb/ -[15]: https://opensource.com/article/20/1/sync-contacts-locally -[16]: https://opensource.com/article/20/1/open-source-calendar -[17]: https://opensource.com/sites/default/files/uploads/productivity_18-4.png (calfw calendar) -[18]: https://github.com/kiwanami/emacs-calfw -[19]: https://khal.readthedocs.io/en/v0.9.2/index.html diff --git a/translated/tech/20200128 Send email and check your calendar with Emacs.md b/translated/tech/20200128 Send email and check your calendar with Emacs.md new file mode 100644 index 0000000000..cb5fff0849 --- /dev/null +++ b/translated/tech/20200128 Send email and check your calendar with Emacs.md @@ -0,0 +1,154 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Send email and check your calendar with Emacs) +[#]: via: (https://opensource.com/article/20/1/emacs-mail-calendar) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +使用 Emacs 发送电子邮件和检查日历 +====== +使用 Emacs 文本编辑器管理电子邮件和查看日程安排,这是本系列文章 (2020 年使用开放源码提高生产力的 20 种方法)的第十八篇,。 + +![Document sending][1] + +去年,我给你们带来了 2019 年的 19 天新生产力工具系列。今年,我将采取一种不同的方式:建立一个新的环境,让你使用已用或未用的工具来在新的一年里变得更有效率。 + +### 使用 Emacs 做(几乎)所有的事情,第 1 部分 + +两天前,我曾经说过我经常使用 [Vim][2] 和 [Emacs][3],在本系列的 [16][4] 和 [17][5] 天,我讲解了如何在 Vim 中做几乎所有的事情。现在,Emacs 的时间到了! + +[Emacs 中的邮件和日历 ][6] + +在深入之前,我需要说明两件事。首先,我这里使用默认的 Emacs 配置,而不是我之前[写过 ][8] 的 [Spacemacs][7]。为什么呢?因为这样一来我使用的就是默认快捷键,从而使你可以参考文档,而不必将“本机 Emacs” 转换为 Spacemacs。第二,在本系列文章中我没有对 Org 模式进行任何设置。Org 模式本身几乎可以自成一个完整的系列,它非常强大,但是设置可能非常复杂。 + +#### 配置 Emacs + +配置 Emacs 比配置 Vim 稍微复杂一些,但以我之见,从长远来看,这样做是值得的。首先我们创建一个配置文件,并在 Emacs 中打开它: + + +``` +mkdir ~/.emacs.d +emacs ~/.emacs.d/init.el +``` + +Next,add some additional package sources to the built-in package manager。Add the following to **init.el**: +接下来,向内置的包管理器添加一些额外的包源。在 **init.el** 中添加以下内容: + + +``` +(package-initialize) +(add-to-list 'package-archives '("melpa" . "")) +(add-to-list 'package-archives '("org" . "") t) +(add-to-list 'package-archives '("gnu" . "")) +(package-refresh-contents) +``` + +使用 `Ctrl+x Ctrl+s` 保存文件,然后按下 `Ctrl+x Ctrl+c` 退出,再重启 Emacs。Emacs 会在启动时下载所有的插件包列表,之后你就可以使用内置的包管理器安装插件了。 +输入 `Meta+x` 会弹出命令提示符(大多数键盘上 **Meta** 键就是的 **Alt** 键,而在 MacOS 上则是 **Option**)。在命令提示符下输入 **package-list-packages** 就会显示可以安装的包列表。遍历该列表并使用 **i** 键选择以下包: + + +``` +bbdb +bbdb-vcard +calfw +calfw-ical +notmuch +``` + +选好软件包后按 **x** 安装它们。根据你的网络连接情况,这可能需要一段时间。你也许会看到一些编译错误,但是可以忽略它们。 +安装完成后,使用组合键 `Ctrl+x Ctrl+f` 打开 `~/.emacs.d/init.el`,并在 `(package-refresh-packages)` 之后 `(custom-set-variables` 之前添加以下行到文件中。 +`(custom-set-variables` 行由 Emacs 内部维护,你永远不应该修改它之后的任何内容。以**;;**开头的行则是注释。 + + +``` +;; Set up bbdb +(require 'bbdb) +(bbdb-initialize 'message) +(bbdb-insinuate-message) +(add-hook 'message-setup-hook 'bbdb-insinuate-mail) +;; set up calendar +(require 'calfw) +(require 'calfw-ical) +;; Set this to the URL of your calendar. Google users will use +;; the Secret Address in iCalendar Format from the calendar settings +(cfw:open-ical-calendar "") +;; Set up notmuch +(require 'notmuch) +;; set up mail sending using sendmail +(setq send-mail-function (quote sendmail-send-it)) +(setq user-mail-address "[myemail@mydomain.com][9]" +      user-full-name "My Name") +``` + +现在,您已经准备好使用自己的配置启动 Emacs 了!保存 `init.el` 文件 (`Ctrl+x Ctrl+s`),退出 Emacs(`Ctrl+x Ctrl+c`),然后重启之。这次重启要多花些时间。 + +#### 使用 Notmuch 在 Emacs 中读写电子邮件 + +一旦你看到了 Emacs 启动屏幕,你就可以使用 [Notmuch][10] 来阅读电子邮件了。键入 `Meta+x notmuch`,您将看到 notmuch 的 Emacs 接口。 + +![使用 notmuch 阅读邮件 ][11] + +所有加粗的项目都是指向电子邮件视图的链接。你可以通过点击鼠标或者使用 tab 键在它们之间跳转并按 **Return** 或 **Enter** 来访问它们。你可以使用搜索栏来搜索 Notmuch 的数据库,语法与 Notmuch 命令行上的[语法 ][12] 相同。如果你愿意,还可以使用 **[save]** 按钮保存搜索以便未来使用,这些搜索会被添加到屏幕顶部的列表中。如果你进入一个链接就会看到一个相关电子邮件的列表。您可以使用**箭头**键在列表中导航,并在要读取的消息上按 **Enter**。按 **r** 可以回复一条消息,**f** 转发该消息,**q** 退出当前屏幕。 + +You can write a new message by typing **Meta**+**x compose-mail**。Composing,replying,and forwarding all bring up the mail writing interface。When you are done writing your email,press **Ctrl**+**c Ctrl**+**c** to send it。If you decide you don't want to send it,press **Ctrl**+**c Ctrl**+**k** to kill the message compose buffer (window)。 +您可以通过键入 `Meta+x compose-mail` 来编写新消息。撰写、回复和转发都将打开编写邮件的接口。写完邮件后,按 `Ctrl+c Ctrl+c` 发送。如果你决定不发送它,按 `Ctrl+c Ctrl+k` 关闭消息撰写缓冲区(窗口)。 + +#### 使用 BBDB 在 Emacs 中自动补完电子邮件地址 + +[在消息中使用 BBDB 地址 ][13] + +那么通讯录怎么办?这就是 [BBDB][14] 发挥作用的地方。但首先我们需要从 [abook][15] 导入所有地址,方法是打开命令行并运行以下导出命令: + + +``` +`abook --convert --outformat vcard --outfile ~/all-my-addresses.vcf --infile ~/.abook/addresses` +``` + +Emacs 启动后,运行 `Meta+x bbdb-vcard-import-file`。它将提示你输入要导入的文件名,即 `~/all-my-address.vcf`。导入完成后,在编写消息时,可以开始输入名称并使用 **Tab** 搜索和自动完成 “to” 字段的内容。BBDB 还会打开一个联系人缓冲区,以便你确保它是正确的。 + +既然在 [vdirsyncer][16] 中已经为每个地址都生成了对应的 vcf。文件了,为什么我们还要这样做呢?如果你像我一样,有许多地址,一次处理一个地址是很麻烦的。这样做,你就可以把所有的东西都放在一本书里,做成一个大文件。 + +#### 使用 calfw 在 Emacs 中浏览日历 + +![calfw 日历 ][17] + +最后,你可以使用 Emacs 查看日历。在上面的配置中,你安装了 [calfw][18] 包,并添加了一些行来告诉它在哪里可以找到要加载的日历。Calfw 是 Emacs 日历框架的简称,它支持多种日历格式。我使用的是谷歌日历,这也是我放在配置中的链接。日历将在启动时自动加载,您可以通过 `Ctrl+x+b` 命令切换到 **cfw-calendar** 缓冲区来查看日历。 + +Calfw 提供日、周、双周和月视图。您可以在日历顶部选择视图,并使用**箭头**键导航日历。不幸的是,calfw 只能查看日历,所以您仍然需要使用 [khal][19] 之类的工具或通过 web 界面来添加、删除和修改事件。 + +这就是 Emacs 中的邮件、日历和邮件地址。明天我会展示更多。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/emacs-mail-calendar + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_paper_envelope_document.png?itok=uPj_kouJ (Document sending) +[2]: https://www.vim.org/ +[3]: https://www.gnu.org/software/emacs/ +[4]: https://opensource.com/article/20/1/vim-email-calendar +[5]: https://opensource.com/article/20/1/vim-task-list-reddit-twitter +[6]: https://opensource.com/sites/default/files/uploads/productivity_18-1.png (Mail and calendar in Emacs) +[7]: https://www.spacemacs.org/ +[8]: https://opensource.com/article/19/12/spacemacs +[9]: mailto:myemail@mydomain.com +[10]: https://notmuchmail.org/ +[11]: https://opensource.com/sites/default/files/uploads/productivity_18-2.png (Reading mail with Notmuch) +[12]: https://opensource.com/article/20/1/organize-email-notmuch +[13]: https://opensource.com/sites/default/files/uploads/productivity_18-3.png (Composing a message with BBDB addressing) +[14]: https://www.jwz.org/bbdb/ +[15]: https://opensource.com/article/20/1/sync-contacts-locally +[16]: https://opensource.com/article/20/1/open-source-calendar +[17]: https://opensource.com/sites/default/files/uploads/productivity_18-4.png (calfw calendar) +[18]: https://github.com/kiwanami/emacs-calfw +[19]: https://khal.readthedocs.io/en/v0.9.2/index.html From e85c77a9b7ed1a76b026419e6fcf6bdc19423649 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Feb 2020 22:02:39 +0800 Subject: [PATCH 146/315] revert --- ...6 things you should be doing with Emacs.md | 53 +++---------------- 1 file changed, 7 insertions(+), 46 deletions(-) diff --git a/sources/tech/20200123 6 things you should be doing with Emacs.md b/sources/tech/20200123 6 things you should be doing with Emacs.md index 059cd4b18e..b01830cd8e 100644 --- a/sources/tech/20200123 6 things you should be doing with Emacs.md +++ b/sources/tech/20200123 6 things you should be doing with Emacs.md @@ -8,123 +8,84 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) 6 things you should be doing with Emacs -你应该用Emacs做的6件事 ====== Here are six things you may not have realized you could do with Emacs. -下面是您可能没有意识到的Emacs可以做的六件事。 Then, get our new cheat sheet to get the most out of Emacs. -然后,使用我们的新备忘单来充分利用Emacs。 ![Text editor on a browser, in blue][1] -[在蓝色浏览器上给编辑发短信][1] Imagine using Python's IDLE interface to edit text. You would be able to load files into memory, edit them, and save changes. But every action you perform would be defined by a Python function. Making a word all capitals, for instance, calls **upper()**, opening a file calls **open**, and so on. Everything in your text document is a Python object and can be manipulated accordingly. From the user's perspective, it's the same experience as any text editor. For a Python developer, it's a rich Python environment that can be changed and developed with just a few custom functions in a config file. -想象一下使用Python的空闲接口来编辑文本。您可以将文件加载到内存中,编辑它们,并保存更改。但是您执行的每个操作都将由Python函数定义。例如,使一个单词全部大写,调用**upper()**,打开一个文件调用**open**,等等。文本文档中的所有内容都是Python对象,可以相应地进行操作。从用户的角度来看,这与任何文本编辑器的体验都是一样的。对于Python开发人员来说,这是一个丰富的Python环境,只需在配置文件中添加几个自定义函数就可以对其进行更改和开发。 This is what [Emacs][2] does for the 1958 programming language [Lisp][3]. In Emacs, there's no separation between the Lisp engine running the application and the arbitrary text you type into it. To Emacs, everything is Lisp data, so everything can be analyzed and manipulated programmatically. -这就是[Emacs][2]对1958年的编程语言[Lisp][3]所做的。在Emacs中,运行应用程序的Lisp引擎与您输入的任意文本之间没有分离。对于Emacs,一切都是Lisp数据,因此一切都可以通过编程进行分析和操作。 That makes for a powerful user interface (UI). But if you're a casual Emacs user, you may only be scratching the surface of what it can do for you. Here are six things you may not have realized you could do with Emacs. -这就形成了一个强大的用户界面(UI)。但是,如果您是Emacs的普通用户,您可能只了解它能为您做些什么。下面是您可能没有意识到的Emacs可以做的六件事。 ## Use Tramp mode for cloud editing -使用流浪汉模式进行克劳德编辑 Emacs has been network-transparent for a lot longer than has been trendy, and today it still provides one of the smoothest remote editor experiences available. The [Tramp mode][4] in Emacs (formerly known as RPC mode) stands for "Transparent Remote (file) Access, Multiple Protocol," which spells out exactly what it offers: easy access to remote files you want to edit over most popular network protocols. The most popular and safest protocol for remote editing these days is [OpenSSH][5], so that's the default. -Emacs实现网络透明的时间要比流行的时间长得多,而且时至今日,它仍然提供最流畅的远程编辑体验。Emacs中的[Tramp模式][4](以前称为RPC模式)代表“透明的远程(文件)访问,多协议”,它详细说明了它提供的功能:通过最流行的网络协议轻松访问您希望编辑的远程文件。目前最流行、最安全的远程编辑协议是[OpenSSH][5],因此它是默认的。 Tramp is already included in Emacs 22.1 or greater, so to use Tramp, you just open a file in the Tramp syntax. In the **File** menu of Emacs, select **Open File**. When prompted in the mini-buffer at the bottom of the Emacs window, enter the file name using this syntax: -在Emacs 22.1或更高版本中已经包含了Tramp,因此要使用Tramp,只需在Tramp语法中打开一个文件。在Emacs的**File**菜单中,选择**Open File**。当在Emacs窗口底部的小缓冲区中出现提示时,使用以下语法输入文件名: ``` -引用---------------------------------------------------- `/ssh:user@example.com:/path/to/file` ``` If you are required to log in interactively, Tramp prompts you for your password. However, Tramp uses OpenSSH directly, so to avoid interactive prompts, you can also add your hostname, username, and SSH key path to your **~/.ssh/config** file. Like Git, Emacs uses your SSH config first and only stops to ask for more information in the event of an error. -如果需要交互式登录,Tramp会提示您输入密码。但是,Tramp直接使用OpenSSH,所以为了避免交互提示,您还可以将您的主机名、用户名和SSH密钥路径添加到您的**~/。ssh / config文件* *。与Git一样,Emacs首先使用SSH配置,只有在出现错误时才会停下来询问更多信息。 Tramp is great for editing files that don't exist on your computer, and the user experience is not noticeably any different from editing a local file. The next time you start to SSH into a server just to launch a Vim or Emacs session, try Tramp instead. -Tramp非常适合编辑计算机上不存在的文件,用户体验与编辑本地文件没有明显的区别。下一次,当您为了启动Vim或Emacs会话而开始SSH到服务器时,请尝试使用Tramp。 ## Calendaring -# Calendaring If you parse text better than you parse graphical interfaces, you'll be happy to know that you can schedule your day (or life) in plain text with Emacs but still get fancy notifications on your mobile device with open source [Org mode][6] viewers. -如果您解析文本比解析图形界面更好,那么您会很高兴地知道,您可以使用Emacs以纯文本方式安排您的一天(或生活),但仍然可以在您的移动设备上使用开放源码[Org模式][6]查看器获得花哨的通知。 The process takes a little setup to create a convenient way to sync your agenda with your mobile device (I use Git, but you could invoke Bluetooth, KDE Connect, Nextcloud, or your file synchronization tool of choice), and you have to install an Org mode viewer (such as [Orgzly][7]) and a Git client app on your mobile. Once you've got your infrastructure sorted, though, the process is inherently perfectly integrated with your usual (or developing, if you're a new user) Emacs workflow. You can refer to your agenda easily in Emacs, make updates to your schedule, and generally stay on task. Pushing changes to your agenda is reflected on your mobile, so you can stay organized even when Emacs isn't available. -这个过程需要一些设置创建一个方便的方式来移动设备同步你的议程(我使用Git,但你可以调用蓝牙,KDE连接,Nextcloud,或您的文件同步工具的选择),你必须安装一个组织模式查看器(如[Orgzly][7])和一个Git客户对你的移动应用程序。但是,一旦您对基础设施进行了排序,该流程就会与您通常使用的Emacs工作流完美地集成在一起(如果您是新用户,则会进行开发)。您可以在Emacs中方便地查阅您的日程,更新您的日程,并通常停留在任务上。推动您的议程的变化反映在您的移动设备上,因此即使Emacs不可用,您也可以保持组织性。 ![][8] Intrigued? Read my step-by-step guide about [calendaring with Org mode and Git][9]. -感兴趣吗?阅读我的关于[使用Org模式和Git进行日历][9]的逐步指南。 ## Access the terminal -访问终端 There are [lots of terminal emulators][10] available. Although the Elisp terminal emulator in Emacs isn't the greatest general-purpose one, it's got two notable advantages. -有[许多终端模拟器][10]可用。尽管Emacs中的Elisp终端仿真器不是最强大的通用仿真器,但是它有两个显著的优点。 -1. **Opens in an Emacs buffer: **I use Emacs' Elisp shell because it's conveniently located in my Emacs window, which I often run in fullscreen. It's a small but significant advantage to have a terminal just a **Ctrl+x+o** (or C-x o in Emacs notation) away, and it's especially nice to be able to glance over at it for status reports when it's running a lengthy job. -1. 我使用Emacs的Elisp shell,因为它方便地位于我的Emacs窗口,我经常在全屏运行。这是一个小但重要的优势,有一个终端只是**Ctrl+x+o**(或C-x o在Emacs符号),它是特别好的,能够浏览它的状态报告,当它运行一个漫长的作业。 -2. **Easy copying and pasting if no system clipboard is available:** Whether I'm too lazy to move my hand from the keys to the mouse, or I don't have mouse functionality because I'm running Emacs in a remote console, having a terminal in Emacs can sometimes mean a quick transfer of data from my Emacs buffer to Bash. -2. * *简单的复制和粘贴,如果没有可用系统剪贴板:* *是否我太懒惰的关键将我的手从鼠标,或者我没有鼠标功能,因为我在远程控制台运行Emacs,在Emacs有时意味着终端快速传输数据从我的Emacs缓冲Bash。 + 1. **Opens in an Emacs buffer: **I use Emacs' Elisp shell because it's conveniently located in my Emacs window, which I often run in fullscreen. It's a small but significant advantage to have a terminal just a **Ctrl+x+o** (or C-x o in Emacs notation) away, and it's especially nice to be able to glance over at it for status reports when it's running a lengthy job. + 2. **Easy copying and pasting if no system clipboard is available:** Whether I'm too lazy to move my hand from the keys to the mouse, or I don't have mouse functionality because I'm running Emacs in a remote console, having a terminal in Emacs can sometimes mean a quick transfer of data from my Emacs buffer to Bash. To try the Emacs terminal, type **Alt**+**x** (**M-x** in Emacs notation), then type **shell**, and press **Return**. -要尝试Emacs终端,输入**Alt**+**x** (Emacs符号中的**M-x**),然后输入**shell**,然后按**Return**。 ## Use Racket mode -使用球拍模式 [Racket][11] is an exciting emerging Lisp dialect with a dynamic programming environment, a GUI toolkit, and a passionate community. The default editor when learning Racket is DrRacket, which has a Definitions panel at the top and an Interactions panel at the bottom. Using this setup, the user writes definitions that affect the Racket runtime. Imagine the old [Logo Turtle][12] program, but with a terminal instead of just a turtle. -[11]是一种激动人心的新兴Lisp语言,拥有动态编程环境、GUI工具包和热情的社区。学习球拍的默认编辑器是dr球拍,它的顶部有一个定义面板,底部有一个交互面板。使用此设置,用户可以编写影响球拍运行时的定义。想象一下旧的[Logo Turtle][12]程序,但是有一个终端而不是一个Turtle。 ![Racket-mode][13] -[Racket-mode] [13] ! LGPL sample code by PLT -由PLT提供的LGPL示例代码 Emacs, being based on Lisp, makes a great integrated development environment (IDE) for advanced Racket coders. It doesn't ship with [Racket mode][14] (yet), but you can install Racket mode and several other helper extensions using the Emacs package installer. To install it, press **Alt**+**X** (**M-x** in Emacs notation), type **package-install**, and press **Return**. Then enter the package you want to install (**racket-mode**), and press **Return**. -基于Lisp的Emacs为高级球拍编程人员提供了一个很好的集成开发环境(IDE)。它还没有[球拍模式][14],但你可以安装球拍模式和其他几个助手扩展使用Emacs包安装程序。要安装它,按**Alt**+**X** (**M-x** Emacs符号),键入**package-install**,然后按**Return**。然后输入要安装的包(**rac模式**),按**Return**。 Enter Racket mode with **M-x racket-mode**. If you're new to Racket but not to Lisp or Emacs, start with the excellent [Quick introduction to Racket with pictures][15]. -进入球拍模式,使用**M-x球拍模式**。如果你是球拍新手,但不是口齿不清或Emacs,开始优秀[快速介绍球拍与图片][15]。 ## Scripting -# # Scripting You might know that Bash scripts are popular for automating and enhancing your Linux or Unix experience. You may have heard that Python does a pretty good job of that, too. But did you know that Lisp scripts can be run in much the same way? There's sometimes confusion about just how useful Lisp really is because many people are introduced to Lisp through Emacs, so there's the latent impression that the only way to run Lisp in the 21st century is to open an Emacs window. Luckily, that's not the case at all, and Emacs is a great IDE for the tools that enable you to run Lisp scripts as general system executables. -您可能知道,Bash脚本在自动化和增强您的Linux或Unix体验方面很流行。您可能听说过Python在这方面也做得很好。但是你知道Lisp脚本可以用同样的方式运行吗?有时人们会对Lisp到底有多有用感到困惑,因为许多人是通过Emacs来了解Lisp的,因此有一种潜在的印象,即在21世纪运行Lisp的惟一方法是打开Emacs窗口。幸运的是,事实并非如此,Emacs是一个很好的IDE,它支持将Lisp脚本作为一般的系统可执行文件来运行。 There are two popular modern Lisps, aside from Elisp, that are easy to run as standalone scripts. -除了Elisp之外,有两种流行的现代lisp很容易作为独立脚本运行。 -1. **Racket:** You can run Racket scripts relying on your system's Racket install to provide runtime support, or you can use **raco exe** to produce an executable. The **raco exe** command packages your code together with runtime support files to create an executable. The **raco distribute** command then packages that executable into a distribution that works on other machines. Emacs has many Racket-specific tools, so creating Racket files in Emacs is easy and efficient. -1. **球拍:**你可以运行球拍脚本依赖于你的系统的球拍安装提供运行时支持,或者你可以使用**raco exe**产生一个可执行文件。**raco exe**命令将代码和运行时支持文件打包,以创建可执行文件。然后,**raco distribution **命令将可执行文件打包到在其他机器上工作的发行版中。Emacs有许多特定于球拍的工具,因此在Emacs中创建球拍文件既简单又有效。 + 1. **Racket:** You can run Racket scripts relying on your system's Racket install to provide runtime support, or you can use **raco exe** to produce an executable. The **raco exe** command packages your code together with runtime support files to create an executable. The **raco distribute** command then packages that executable into a distribution that works on other machines. Emacs has many Racket-specific tools, so creating Racket files in Emacs is easy and efficient. -2. **GNU Guile:** [GNU Guile][16] (short for "GNU Ubiquitous Intelligent Language for Extensions") is an implementation of the [Scheme][17] programming language that's used for creating applications and games for the desktop, internet, terminal, and more. Writing Scheme is easy, using any one of the many Scheme extensions in Emacs. For example, here's a "Hello world" script in Guile: [code] #!/usr/bin/guile -s -2. **GNU Guile:** [GNU Guile][16](“GNU通用智能语言扩展”的缩写)是[Scheme][17]编程语言的一个实现,它用于为桌面、internet、终端等创建应用程序和游戏。使用Emacs中众多Scheme扩展中的任何一个,编写Scheme都很容易。例如,这里有一个用Guile编写的“Hello world”脚本:[code] #!/usr/bin/guile - s + 2. **GNU Guile:** [GNU Guile][16] (short for "GNU Ubiquitous Intelligent Language for Extensions") is an implementation of the [Scheme][17] programming language that's used for creating applications and games for the desktop, internet, terminal, and more. Writing Scheme is easy, using any one of the many Scheme extensions in Emacs. For example, here's a "Hello world" script in Guile: [code] #!/usr/bin/guile -s !# (display "hello world") -(显示“hello world”)      (newline) [/code] Compile and run it with the **guile** command: [code] $ guile ./hello.scheme -(换行)[/code]编译并运行**guile**命令:[code] $ guile ./hello.scheme ;;; compiling /home/seth/./hello.scheme -;;;compiling / home /塞斯-你好。怀廷 ;;; compiled [...]/hello.scheme.go -;;;[…]/ hello.scheme.go编译 hello world -你好,世界 $ guile ./hello.scheme -你好,scheme -hello world -你好,世界 +hello world ``` -引用---------------------------------------------------- ## Run Elisp without Emacs + +Emacs can serve as an Elisp runtime, but you don't have to "open" Emacs in the traditional sense. The **\--script** option allows you to run Elisp scripts using Emacs as the engine but without launching the Emacs GUI (not even its terminal-based one). In this example, the **-Q** option causes Emacs to ignore your **.emacs** file to avoid any delays in executing the Elisp script (if your script relies upon something \ No newline at end of file From 3dd212a7ccdbee49029d7d3a5df945933ace2a30 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Feb 2020 22:06:52 +0800 Subject: [PATCH 147/315] translating by lujun9972 --- ...200129 Use Emacs to get social and track your todo list.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200129 Use Emacs to get social and track your todo list.md b/sources/tech/20200129 Use Emacs to get social and track your todo list.md index 3893aac377..097f1919a3 100644 --- a/sources/tech/20200129 Use Emacs to get social and track your todo list.md +++ b/sources/tech/20200129 Use Emacs to get social and track your todo list.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lujun9972) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -132,7 +132,7 @@ via: https://opensource.com/article/20/1/emacs-social-track-todo-list 作者:[Kevin Sonney][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[lujun9972](https://github.com/lujun9972) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 20796c61d4e8420b81936790216cdc0cf781ea20 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 25 Feb 2020 00:58:37 +0800 Subject: [PATCH 148/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200224=20Make?= =?UTF-8?q?=20free=20encrypted=20backups=20to=20the=20cloud=20on=20Fedora?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200224 Make free encrypted backups to the cloud on Fedora.md --- ...ncrypted backups to the cloud on Fedora.md | 237 ++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 sources/tech/20200224 Make free encrypted backups to the cloud on Fedora.md diff --git a/sources/tech/20200224 Make free encrypted backups to the cloud on Fedora.md b/sources/tech/20200224 Make free encrypted backups to the cloud on Fedora.md new file mode 100644 index 0000000000..6015e6dc92 --- /dev/null +++ b/sources/tech/20200224 Make free encrypted backups to the cloud on Fedora.md @@ -0,0 +1,237 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Make free encrypted backups to the cloud on Fedora) +[#]: via: (https://fedoramagazine.org/make-free-encrypted-backups-to-the-cloud-on-fedora/) +[#]: author: (Curt Warfield https://fedoramagazine.org/author/rcurtiswarfield/) + +Make free encrypted backups to the cloud on Fedora +====== + +![][1] + +Most free cloud storage is limited to 5GB or less. Even Google Drive is limited to 15GB. While not heavily advertised, IBM offers free accounts with a whopping **25GB** of cloud storage for free. This is not a limited time offer, and you don’t have to provide a credit card. It’s absolutely free! Better yet, since it’s S3 compatible, most of the S3 tools available for backups should work fine. + +This article will show you how to use restic for encrypted backups onto this free storage. Please also refer to [this previous Magazine article about installing and configuring restic.][2] Let’s get started! + +### Creating your free IBM account and storage + +Head over to the IBM cloud services site and follow the steps to sign up for a free account here: . You’ll need to verify your account from the email confirmation that IBM sends to you. + +Then log in to your account to bring up your dashboard, at . + +Click on the **Create resource** button. + +![][3] + +Click on **Storage** and then **Object Storage**. + +![][4] + +Next click on the **Create Bucket** button. + +![][5] + +This brings up the **Configure your resource** section. + +![][6] + +Next, click on the ****Create** button to use the default settings. + +![][7] + +Under **Predefined buckets** click on the **Standard** box: + +![][8] + +A unique bucket name is automatically created, but it’s suggested that you change this. + +![][9] + +In this example, the bucket name is changed to __freecloudstorage_._** + +Click on the **Next** button after choosing a bucket name: + +![][10] + +Continue to click on the **Next** button until you get the the **Summary** page: + +![][11] + +Scroll down to the **Endpoints** section. + +![][12] + +The information in the **Public** section is the location of your bucket. This is what you need to specify in restic when you create your backups. In this example, the location is **s3.us-south.cloud-object-storage.appdomain.cloud**. + +### Making your credentials + +The last thing that you need to do is create an access ID and secret key. To start, click on **Service credentials**. + +![][13] + +Click on the **New credential** button. + +![][14] + +Choose a name for your credential, make sure you check the **Include HMAC Credential** box and then click on the **Add** button. In this example I’m using the name **resticbackup**. + +![][15] + +Click on **View credentials**. + +![][16] + +The _access_key_id_ and _secret_access_key_ is what you are looking for. (For obvious reasons, the author’s details here are obscured.) + +You will need to export these by calling them with the _export_ alias in the shell, or putting them into a backup script. + +![][17] + +### Preparing a new repository + +Restic refers to your backup as a _repository_, and can make backups to any bucket on your IBM cloud account. First, setup the following environment variables using your _access_key_id_ and _secret_access_key_ that you retrieved from your IBM cloud bucket. These can also be set in any backup script you may create. + +``` +$ export AWS_ACCESS_KEY_ID= +$ export AWS_SECRET_ACCESS_KEY= +``` + +Even though you are using IBM Cloud and not AWS, as previously mentioned, IBM Cloud storage is S3 compatible, and restic uses its interal AWS commands for any S3 compatible storage. So these AWS keys really refer to the keys from your IBM bucket. + +Create the repository by initializing it. A prompt appears for you to type a password for the repository. _**Do not lose this password because your data is irrecoverable without it!**_ + +``` +restic -r s3:http://PUBLIC_ENDPOINT_LOCATION/BUCKET init +``` + +The _PUBLIC_ENDPOINT_LOCATION_ was specified in the Endpoint section of your Bucket summary. + +![][18] + +For example: + +``` +$ restic -r s3:http://s3.us-south.cloud-object-storage.appdomain.cloud/freecloudstorage init +``` + +### Creating backups + +Now it’s time to backup some data. Backups are called _snapshots_. Run the following command and enter the repository password when prompted. + +``` +restic -r s3:http://PUBLIC_ENDPOINT_LOCATION/BUCKET backup files_to_backup +``` + +For example: + +``` +$ restic -r s3:http://s3.us-south.cloud-object-storage.appdomain.cloud/freecloudstorage backup Documents/ +Enter password for repository: + repository 106a2eb4 opened successfully, password is correct + Files: 51 new, 0 changed, 0 unmodified + Dirs: 0 new, 0 changed, 0 unmodified + Added to the repo: 11.451 MiB + processed 51 files, 11.451 MiB in 0:06 + snapshot 611e9577 saved +``` + +### Restoring from backups + +Now that you’ve backed up some files, it’s time to make sure you know how to restore them. To get a list of all of your backup snapshots, use this command: + +``` +restic -r s3:http://PUBLIC_ENDPOINT_LOCATION/BUCKET snapshots +``` + +For example: + +``` +$ restic -r s3:http://s3.us-south.cloud-object-storage.appdomain.cloud/freecloudstorage snapshots +Enter password for repository: +ID Date Host Tags Directory +------------------------------------------------------------------- +106a2eb4 2020-01-15 15:20:42 client /home/curt/Documents +``` + +To restore an entire snapshot, run a command like this: + +``` +restic -r s3:http://s3.us-south.cloud-object-storage.appdomain.cloud/freecloudstorage restore snapshotID --target restoreDirectory +``` + +For example: + +``` +$ restic -r s3:http://s3.us-south.cloud-object-storage.appdomain.cloud/freecloudstorage restore 106a2eb4 --target ~ +Enter password for repository: +repository 106a2eb4 opened successfully, password is correct +restoring to /tmp +``` + +* * * + +_Photo by [Alex Machado][19] on [Unsplash][20]._ + +[EDITORS NOTE: The Fedora Project is [sponsored][21] by [Red Hat][22], which is owned by [IBM][23].] + +[EDITORS NOTE: Updated at 1647 UTC on 24 February 2020 to correct a broken link.] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/make-free-encrypted-backups-to-the-cloud-on-fedora/ + +作者:[Curt Warfield][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/rcurtiswarfield/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/01/encrypted-backups-ibm-cloud-816x345.jpg +[2]: https://fedoramagazine.org/use-restic-encrypted-backups/ +[3]: https://fedoramagazine.org/wp-content/uploads/2020/01/ibmclouddash-3-e1579713553261.png +[4]: https://fedoramagazine.org/wp-content/uploads/2020/01/ibmcloudresourcestorage-3.png +[5]: https://fedoramagazine.org/wp-content/uploads/2020/01/ibmcloudbucket-3.png +[6]: https://fedoramagazine.org/wp-content/uploads/2020/01/ibmcloudbucket2.png +[7]: https://fedoramagazine.org/wp-content/uploads/2020/01/ibmcloudbucket3-e1579713758635.png +[8]: https://fedoramagazine.org/wp-content/uploads/2020/01/ibmcloudbucket4.png +[9]: https://fedoramagazine.org/wp-content/uploads/2020/01/createbucket1.png +[10]: https://fedoramagazine.org/wp-content/uploads/2020/01/next.png +[11]: https://fedoramagazine.org/wp-content/uploads/2020/01/bucketsummary-1024x368.png +[12]: https://fedoramagazine.org/wp-content/uploads/2020/01/endpoints-1024x272.png +[13]: https://fedoramagazine.org/wp-content/uploads/2020/01/servicecreds.png +[14]: https://fedoramagazine.org/wp-content/uploads/2020/01/newcred.png +[15]: https://fedoramagazine.org/wp-content/uploads/2020/01/addnewcred.png +[16]: https://fedoramagazine.org/wp-content/uploads/2020/01/keys-1024x298.png +[17]: https://fedoramagazine.org/wp-content/uploads/2020/01/keys2.png +[18]: https://fedoramagazine.org/wp-content/uploads/2020/01/publicendpoint.png +[19]: https://unsplash.com/@alexmachado?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[20]: https://unsplash.com/s/photos/backups-to-cloud?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[21]: https://getfedora.org/sponsors/ +[22]: https://redhat.com +[23]: https://www.ibm.com/cloud/redhat From 01b8789117cdd437dc43db00aa6a1d1b07d0f8a4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 25 Feb 2020 01:04:03 +0800 Subject: [PATCH 149/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200224=20Using?= =?UTF-8?q?=20C=20and=20C++=20for=20data=20science?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200224 Using C and C-- for data science.md --- ...200224 Using C and C-- for data science.md | 747 ++++++++++++++++++ 1 file changed, 747 insertions(+) create mode 100644 sources/tech/20200224 Using C and C-- for data science.md diff --git a/sources/tech/20200224 Using C and C-- for data science.md b/sources/tech/20200224 Using C and C-- for data science.md new file mode 100644 index 0000000000..10cdb5e59f --- /dev/null +++ b/sources/tech/20200224 Using C and C-- for data science.md @@ -0,0 +1,747 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using C and C++ for data science) +[#]: via: (https://opensource.com/article/20/2/c-data-science) +[#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) + +Using C and C++ for data science +====== +Let's work through common data science task with C99 and C++11. +![metrics and data shown on a computer screen][1] + +While languages like [Python][2] and [R][3] are increasingly popular for data science, C and C++ can be a strong choice for efficient and effective data science. In this article, we will use [C99][4] and [C++11][5] to write a program that uses the [Anscombe’s quartet][6] dataset, which I'll explain about next. + +I wrote about my motivation for continually learning languages in an article covering [Python and GNU Octave][7], which is worth reviewing. All of the programs are meant to be run on the [command line][8], not with a [graphical user interface][9] (GUI). The full examples are available in the [polyglot_fit repository][10]. + +### The programming task + +The program you will write in this series: + + * Reads data from a [CSV file][11] + * Interpolates the data with a straight line (i.e., _f(x)=m ⋅ x + q_) + * Plots the result to an image file + + + +This is a common situation that many data scientists have encountered. The example data is the first set of [Anscombe's quartet][6], shown in the table below. This is a set of artificially constructed data that gives the same results when fitted with a straight line, but their plots are very different. The data file is a text file with tabs as column separators and a few lines as a header. This task will use only the first set (i.e., the first two columns). + +[**Anscombe's quartet**][6] + +I + +II + +III + +IV + +x + +y + +x + +y + +x + +y + +x + +y + +10.0 + +8.04 + +10.0 + +9.14 + +10.0 + +7.46 + +8.0 + +6.58 + +8.0 + +6.95 + +8.0 + +8.14 + +8.0 + +6.77 + +8.0 + +5.76 + +13.0 + +7.58 + +13.0 + +8.74 + +13.0 + +12.74 + +8.0 + +7.71 + +9.0 + +8.81 + +9.0 + +8.77 + +9.0 + +7.11 + +8.0 + +8.84 + +11.0 + +8.33 + +11.0 + +9.26 + +11.0 + +7.81 + +8.0 + +8.47 + +14.0 + +9.96 + +14.0 + +8.10 + +14.0 + +8.84 + +8.0 + +7.04 + +6.0 + +7.24 + +6.0 + +6.13 + +6.0 + +6.08 + +8.0 + +5.25 + +4.0 + +4.26 + +4.0 + +3.10 + +4.0 + +5.39 + +19.0 + +12.50 + +12.0 + +10.84 + +12.0 + +9.13 + +12.0 + +8.15 + +8.0 + +5.56 + +7.0 + +4.82 + +7.0 + +7.26 + +7.0 + +6.42 + +8.0 + +7.91 + +5.0 + +5.68 + +5.0 + +4.74 + +5.0 + +5.73 + +8.0 + +6.89 + +### The C way + +[C][12] is a general-purpose programming language that is among the most popular languages in use today (according to data from the [TIOBE Index][13], [RedMonk Programming Language Rankings][14], [Popularity of Programming Language Index][15], and [State of the Octoverse of GitHub][16]). It is a quite old language (circa 1973), and many successful programs were written in it (e.g., the Linux kernel and Git to name just two). It is also one of the closest languages to the inner workings of the computer, as it is used to manipulate memory directly. It is a [compiled language][17]; therefore, the source code has to be translated by a [compiler][18] into [machine code][19]. Its [standard library][20] is small and light on features, so other libraries have been developed to provide missing functionalities. + +It is the language I use the most for [number crunching][21], mostly because of its performance. I find it rather tedious to use, as it needs a lot of [boilerplate code][22], but it is well supported in various environments. The C99 standard is a recent revision that adds some nifty features and is well supported by compilers. + +I will cover the necessary background of C and C++ programming along the way so both beginners and advanced users can follow along.   + +#### Installation + +To develop with C99, you need a compiler. I normally use [Clang][23], but [GCC][24] is another valid open source compiler. For linear fitting, I chose to use the [GNU Scientific Library][25]. For plotting, I could not find any sensible library, and therefore this program relies on an external program: [Gnuplot][26]. The example also uses a dynamic data structure to store data, which is defined in the [Berkeley Software Distribution][27] (BSD). + +Installing in [Fedora][28] is as easy as running: + + +``` +`sudo dnf install clang gnuplot gsl gsl-devel` +``` + +#### Commenting code + +In C99, [comments][29] are formatted by putting **//** at the beginning of the line, and the rest of the line will be discarded by the interpreter. Alternatively, anything between **/*** and ***/** is discarded, as well. + + +``` +// This is a comment ignored by the interpreter. +/* Also this is ignored */ +``` + +#### Necessary libraries + +Libraries are composed of two parts: + + * A [header file][30] that contains a description of the functions + * A source file that contains the functions' definitions + + + +Header files are included in the source, while the libraries' sources are [linked][31] against the executable. Therefore, the header files needed for this example are: + + +``` +// Input/Output utilities +#include <stdio.h> +// The standard library +#include <stdlib.h> +// String manipulation utilities +#include <string.h> +// BSD queue +#include <sys/queue.h> +// GSL scientific utilities +#include <gsl/gsl_fit.h> +#include <gsl/gsl_statistics_double.h> +``` + +#### Main function + +In C, the program must be inside a special function called **[main()][32]:** + + +``` +int main(void) { +    ... +} +``` + +This differs from Python, as covered in the last tutorial, which will run whatever code it finds in the source files. + +#### Defining variables + +In C, variables have to be declared before they are used, and they have to be associated with a type. Whenever you want to use a variable, you have to decide what kind of data to store in it. You can also specify if you intend to use a variable as a constant value, which is not necessary, but the compiler can benefit from this information. From the [fitting_C99.c program][33] in the repository: + + +``` +const char *input_file_name = "anscombe.csv"; +const char *delimiter = "\t"; +const unsigned int skip_header = 3; +const unsigned int column_x = 0; +const unsigned int column_y = 1; +const char *output_file_name = "fit_C99.csv"; +const unsigned int N = 100; +``` + +Arrays in C are not dynamic, in the sense that their length has to be decided in advance (i.e., before compilation): + + +``` +`int data_array[1024];` +``` + +Since you normally do not know how many data points are in a file, use a [singly linked list][34]. This is a dynamic data structure that can grow indefinitely. Luckily, the BSD [provides linked lists][35]. Here is an example definition: + + +``` +struct data_point { +    double x; +    double y; + +    SLIST_ENTRY(data_point) entries; +}; + +SLIST_HEAD(data_list, data_point) head = SLIST_HEAD_INITIALIZER(head); +SLIST_INIT(&head); +``` + +This example defines a **data_point** list comprised of structured values that contain both an **x** value and a **y** value. The syntax is rather complicated but intuitive, and describing it in detail would be too wordy. + +#### Printing output + +To print on the terminal, you can use the [**printf()**][36] function, which works like Octave's **printf()** function (described in the first article): + + +``` +`printf("#### Anscombe's first set with C99 ####\n");` +``` + +The **printf()** function does not automatically add a newline at the end of the printed string, so you have to add it. The first argument is a string that can contain format information for the other arguments that can be passed to the function, such as: + + +``` +`printf("Slope: %f\n", slope);` +``` + +#### Reading data + +Now comes the hard part… There are some libraries for CSV file parsing in C, but none seemed stable or popular enough to be in the Fedora packages repository. Instead of adding a dependency for this tutorial, I decided to write this part on my own. Again, going into details would be too wordy, so I will only explain the general idea. Some lines in the source will be ignored for the sake of brevity, but you can find the complete example in the repository. + +First, open the input file: + + +``` +`FILE* input_file = fopen(input_file_name, "r");` +``` + +Then read the file line-by-line until there is an error or the file ends: + + +``` +while (![ferror][37](input_file) && ![feof][38](input_file)) { +    size_t buffer_size = 0; +    char *buffer = NULL; +    +    getline(&buffer, &buffer_size, input_file); + +    ... +} +``` + +The [**getline()**][39] function is a nice recent addition from the [POSIX.1-2008 standard][40]. It can read a whole line in a file and take care of allocating the necessary memory. Each line is then split into [tokens][41] with the [**strtok()**][42] function. Looping over the token, select the columns that you want: + + +``` +char *token = [strtok][43](buffer, delimiter); + +while (token != NULL) +{ +    double value; +    [sscanf][44](token, "%lf", &value); + +    if (column == column_x) { +        x = value; +    } else if (column == column_y) { +        y = value; +    } + +    column += 1; +    token = [strtok][43](NULL, delimiter); +} +``` + +Finally, when the **x** and **y** values are selected, insert the new data point in the linked list: + + +``` +struct data_point *datum = [malloc][45](sizeof(struct data_point)); +datum->x = x; +datum->y = y; + +SLIST_INSERT_HEAD(&head, datum, entries); +``` + +The [**malloc()**][46] function dynamically allocates (reserves) some persistent memory for the new data point. + +#### Fitting data + +The GSL linear fitting function [**gsl_fit_linear()**][47] expects simple arrays for its input. Therefore, since you won't know in advance the size of the arrays you create, you must manually allocate their memory: + + +``` +const size_t entries_number = row - skip_header - 1; + +double *x = [malloc][45](sizeof(double) * entries_number); +double *y = [malloc][45](sizeof(double) * entries_number); +``` + +Then, loop over the linked list to save the relevant data to the arrays: + + +``` +SLIST_FOREACH(datum, &head, entries) { +    const double current_x = datum->x; +    const double current_y = datum->y; + +    x[i] = current_x; +    y[i] = current_y; + +    i += 1; +} +``` + +Now that you are done with the linked list, clean it up. _Always_ release the memory that has been manually allocated to prevent a [memory leak][48]. Memory leaks are bad, bad, bad. Every time memory is not released, a garden gnome loses its head: + + +``` +while (!SLIST_EMPTY(&head)) { +    struct data_point *datum = SLIST_FIRST(&head); + +    SLIST_REMOVE_HEAD(&head, entries); + +    [free][49](datum); +} +``` + +Finally, finally(!), you can fit your data: + + +``` +gsl_fit_linear(x, 1, y, 1, entries_number, +               &intercept, &slope, +               &cov00, &cov01, &cov11, &chi_squared); +const double r_value = gsl_stats_correlation(x, 1, y, 1, entries_number); + +[printf][50]("Slope: %f\n", slope); +[printf][50]("Intercept: %f\n", intercept); +[printf][50]("Correlation coefficient: %f\n", r_value); +``` + +#### Plotting + +You must use an external program for the plotting. Therefore, save the fitting function to an external file: + + +``` +const double step_x = ((max_x + 1) - (min_x - 1)) / N; + +for (unsigned int i = 0; i < N; i += 1) { +    const double current_x = (min_x - 1) + step_x * i; +    const double current_y = intercept + slope * current_x; + +    [fprintf][51](output_file, "%f\t%f\n", current_x, current_y); +} +``` + +The Gnuplot command for plotting both files is: + + +``` +`plot 'fit_C99.csv' using 1:2 with lines title 'Fit', 'anscombe.csv' using 1:2 with points pointtype 7 title 'Data'` +``` + +#### Results + +Before running the program, you must compile it: + + +``` +`clang -std=c99 -I/usr/include/ fitting_C99.c -L/usr/lib/ -L/usr/lib64/ -lgsl -lgslcblas -o fitting_C99` +``` + +This command tells the compiler to use the C99 standard, read the **fitting_C99.c** file, load the libraries **gsl** and **gslcblas**, and save the result to **fitting_C99**. The resulting output on the command line is: + + +``` +#### Anscombe's first set with C99 #### +Slope: 0.500091 +Intercept: 3.000091 +Correlation coefficient: 0.816421 +``` + +Here is the resulting image generated with Gnuplot. + +![Plot and fit of the dataset obtained with C99][52] + +### The C++11 way + +[C++][53] is a general-purpose programming language that is also among the most popular languages in use today. It was created as a [successor of C][54] (in 1983) with an emphasis on [object-oriented programming][55] (OOP). C++ is commonly regarded as a superset of C, so a C program should be able to be compiled with a C++ compiler. This is not exactly true, as there are some corner cases where they behave differently. In my experience, C++ needs less boilerplate than C, but the syntax is more difficult if you want to develop objects. The C++11 standard is a recent revision that adds some nifty features and is more or less supported by compilers. + +Since C++ is largely compatible with C, I will just highlight the differences between the two. If I do not cover a section in this part, it means that it is the same as in C. + +#### Installation + +The dependencies for the C++ example are the same as the C example. On Fedora, run: + + +``` +`sudo dnf install clang gnuplot gsl gsl-devel` +``` + +#### Necessary libraries + +Libraries work in the same way as in C, but the **include** directives are slightly different: + + +``` +#include <cstdlib> +#include <cstring> +#include <iostream> +#include <fstream> +#include <string> +#include <vector> +#include <algorithm> + +extern "C" { +#include <gsl/gsl_fit.h> +#include <gsl/gsl_statistics_double.h> +} +``` + +Since the GSL libraries are written in C, you must inform the compiler about this peculiarity. + +#### Defining variables + +C++ supports more data types (classes) than C, such as a **string** type that has many more features than its C counterpart. Update the definition of the variables accordingly: + + +``` +`const std::string input_file_name("anscombe.csv");` +``` + +For structured objects like strings, you can define the variable without using the **=** sign. + +#### Printing output + +You can use the **printf()** function, but the **cout** object is more idiomatic. Use the operator **<<** to indicate the string (or objects) that you want to print with **cout**: + + +``` +std::cout << "#### Anscombe's first set with C++11 ####" << std::endl; + +... + +std::cout << "Slope: " << slope << std::endl; +std::cout << "Intercept: " << intercept << std::endl; +std::cout << "Correlation coefficient: " << r_value << std::endl; +``` + +#### Reading data + +The scheme is the same as before. The file is opened and read line-by-line, but with a different syntax: + + +``` +std::ifstream input_file(input_file_name); + +while (input_file.good()) { +    std::string line; + +    getline(input_file, line); + +    ... +} +``` + +The line tokens are extracted with the same function as in the C99 example. Instead of using standard C arrays, use two [vectors][56]. Vectors are an extension of C arrays in the [C++ standard library][57] that allows dynamic management of memory without explicitly calling **malloc()**: + + +``` +std::vector<double> x; +std::vector<double> y; + +// Adding an element to x and y: +x.emplace_back(value); +y.emplace_back(value); +``` + +#### Fitting data + +For fitting in C++, you do not have to loop over the list, as vectors are guaranteed to have contiguous memory. You can directly pass to the fitting function the pointers to the vectors buffers: + + +``` +gsl_fit_linear(x.data(), 1, y.data(), 1, entries_number, +               &intercept, &slope, +               &cov00, &cov01, &cov11, &chi_squared); +const double r_value = gsl_stats_correlation(x.data(), 1, y.data(), 1, entries_number); + +std::cout << "Slope: " << slope << std::endl; +std::cout << "Intercept: " << intercept << std::endl; +std::cout << "Correlation coefficient: " << r_value << std::endl; +``` + +#### Plotting + +Plotting is done with the same approach as before. Write to a file: + + +``` +const double step_x = ((max_x + 1) - (min_x - 1)) / N; + +for (unsigned int i = 0; i < N; i += 1) { +    const double current_x = (min_x - 1) + step_x * i; +    const double current_y = intercept + slope * current_x; + +    output_file << current_x << "\t" << current_y << std::endl; +} + +output_file.close(); +``` + +And then use Gnuplot for the plotting. + +#### Results + +Before running the program, it must be compiled with a similar command: + + +``` +`clang++ -std=c++11 -I/usr/include/ fitting_Cpp11.cpp -L/usr/lib/ -L/usr/lib64/ -lgsl -lgslcblas -o fitting_Cpp11` +``` + +The resulting output on the command line is: + + +``` +#### Anscombe's first set with C++11 #### +Slope: 0.500091 +Intercept: 3.00009 +Correlation coefficient: 0.816421 +``` + +And this is the resulting image generated with Gnuplot. + +![Plot and fit of the dataset obtained with C++11][58] + +### Conclusion + +This article provides examples for a data fitting and plotting task in C99 and C++11. Since C++ is largely compatible with C, this article exploited their similarities for writing the second example. In some aspects, C++ is easier to use because it partially relieves the burden of explicitly managing memory. But the syntax is more complex because it introduces the possibility of writing classes for OOP. However, it is still possible to write software in C with the OOP approach. Since OOP is a style of programming, it can be used in any language. There are some great examples of OOP in C, such as the [GObject][59] and [Jansson][60] libraries. + +For number crunching, I prefer working in C99 due to its simpler syntax and widespread support. Until recently, C++11 was not as widely supported, and I tended to avoid the rough edges in the previous versions. For more complex software, C++ could be a good choice. + +Do you use C or C++ for data science as well? Share your experiences in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/c-data-science + +作者:[Cristiano L. Fontana][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/cristianofontana +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://opensource.com/article/18/9/top-3-python-libraries-data-science +[3]: https://opensource.com/article/19/5/learn-python-r-data-science +[4]: https://en.wikipedia.org/wiki/C99 +[5]: https://en.wikipedia.org/wiki/C%2B%2B11 +[6]: https://en.wikipedia.org/wiki/Anscombe%27s_quartet +[7]: https://opensource.com/article/20/2/python-gnu-octave-data-science +[8]: https://en.wikipedia.org/wiki/Command-line_interface +[9]: https://en.wikipedia.org/wiki/Graphical_user_interface +[10]: https://gitlab.com/cristiano.fontana/polyglot_fit +[11]: https://en.wikipedia.org/wiki/Comma-separated_values +[12]: https://en.wikipedia.org/wiki/C_%28programming_language%29 +[13]: https://www.tiobe.com/tiobe-index/ +[14]: https://redmonk.com/sogrady/2019/07/18/language-rankings-6-19/ +[15]: http://pypl.github.io/PYPL.html +[16]: https://octoverse.github.com/ +[17]: https://en.wikipedia.org/wiki/Compiled_language +[18]: https://en.wikipedia.org/wiki/Compiler +[19]: https://en.wikipedia.org/wiki/Machine_code +[20]: https://en.wikipedia.org/wiki/C_standard_library +[21]: https://en.wiktionary.org/wiki/number-crunching +[22]: https://en.wikipedia.org/wiki/Boilerplate_code +[23]: https://clang.llvm.org/ +[24]: https://gcc.gnu.org/ +[25]: https://www.gnu.org/software/gsl/ +[26]: http://www.gnuplot.info/ +[27]: https://en.wikipedia.org/wiki/Berkeley_Software_Distribution +[28]: https://getfedora.org/ +[29]: https://en.wikipedia.org/wiki/Comment_(computer_programming) +[30]: https://en.wikipedia.org/wiki/Include_directive +[31]: https://en.wikipedia.org/wiki/Linker_%28computing%29 +[32]: https://en.wikipedia.org/wiki/Entry_point#C_and_C++ +[33]: https://gitlab.com/cristiano.fontana/polyglot_fit/-/blob/master/fitting_C99.c +[34]: https://en.wikipedia.org/wiki/Linked_list#Singly_linked_list +[35]: http://man7.org/linux/man-pages/man3/queue.3.html +[36]: https://en.wikipedia.org/wiki/Printf_format_string +[37]: http://www.opengroup.org/onlinepubs/009695399/functions/ferror.html +[38]: http://www.opengroup.org/onlinepubs/009695399/functions/feof.html +[39]: http://man7.org/linux/man-pages/man3/getline.3.html +[40]: https://en.wikipedia.org/wiki/POSIX +[41]: https://en.wikipedia.org/wiki/Lexical_analysis#Token +[42]: http://man7.org/linux/man-pages/man3/strtok.3.html +[43]: http://www.opengroup.org/onlinepubs/009695399/functions/strtok.html +[44]: http://www.opengroup.org/onlinepubs/009695399/functions/sscanf.html +[45]: http://www.opengroup.org/onlinepubs/009695399/functions/malloc.html +[46]: http://man7.org/linux/man-pages/man3/malloc.3.html +[47]: https://www.gnu.org/software/gsl/doc/html/lls.html +[48]: https://en.wikipedia.org/wiki/Memory_leak +[49]: http://www.opengroup.org/onlinepubs/009695399/functions/free.html +[50]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[51]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html +[52]: https://opensource.com/sites/default/files/uploads/fit_c99.png (Plot and fit of the dataset obtained with C99) +[53]: https://en.wikipedia.org/wiki/C%2B%2B +[54]: http://www.cplusplus.com/info/history/ +[55]: https://en.wikipedia.org/wiki/Object-oriented_programming +[56]: https://en.wikipedia.org/wiki/Sequence_container_%28C%2B%2B%29#Vector +[57]: https://en.wikipedia.org/wiki/C%2B%2B_Standard_Library +[58]: https://opensource.com/sites/default/files/uploads/fit_cpp11.png (Plot and fit of the dataset obtained with C++11) +[59]: https://en.wikipedia.org/wiki/GObject +[60]: http://www.digip.org/jansson/ From d177d35c672fb3c515c323cd7df5aee680ccc41e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 25 Feb 2020 01:05:03 +0800 Subject: [PATCH 150/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200224=20What?= =?UTF-8?q?=20developers=20need=20to=20know=20about=20domain-specific=20la?= =?UTF-8?q?nguages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200224 What developers need to know about domain-specific languages.md --- ...to know about domain-specific languages.md | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sources/tech/20200224 What developers need to know about domain-specific languages.md diff --git a/sources/tech/20200224 What developers need to know about domain-specific languages.md b/sources/tech/20200224 What developers need to know about domain-specific languages.md new file mode 100644 index 0000000000..8c274f42b8 --- /dev/null +++ b/sources/tech/20200224 What developers need to know about domain-specific languages.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What developers need to know about domain-specific languages) +[#]: via: (https://opensource.com/article/20/2/domain-specific-languages) +[#]: author: (Girish Managoli https://opensource.com/users/gammay) + +What developers need to know about domain-specific languages +====== +DSLs are used for a specific context in a particular domain. Learn more +about what they are and why you might want to use one. +![Various programming languages in use][1] + +A [domain-specific language][2] (DSL) is a language meant for use in the context of a particular domain. A domain could be a business context (e.g., banking, insurance, etc.) or an application context (e.g., a web application, database, etc.) In contrast, a general-purpose language (GPL) can be used for a wide range of business problems and applications. + +A DSL does not attempt to please all. Instead, it is created for a limited sphere of applicability and use, but it's powerful enough to represent and address the problems and solutions in that sphere. A good example of a DSL is HTML. It is a language for the web application domain. It can't be used for, say, number crunching, but it is clear how widely used HTML is on the web. + +A GPL creator does not know where the language might be used or the problems the user intends to solve with it. So, a GPL is created with generic constructs that potentially are usable for any problem, solution, business, or need. Java is a GPL, as it's used on desktops and mobile devices, embedded in the web across banking, finance, insurance, manufacturing, etc., and more. + +### Classifying DSLs + +In the DSL world, there are two types of languages: + + * **Domain-specific language (DSL):** The language in which a DSL is written or presented + * **Host language:** The language in which a DSL is executed or processed + + + +A DSL written in a distinct language and processed by another host language is called an **external** DSL. + +This is a DSL in SQL that can be processed in a host language: + + +``` +SELECT account +FROM accounts +WHERE account = '123' AND branch = 'abc' AND amount >= 1000 +``` + +For that matter, a DSL could be written in English with a defined vocabulary and form that can be processed in another host language using a parser generator like ANTLR: + + +``` +`if smokes then increase premium by 10%` +``` + +If the DSL and host language are the same, then the DSL type is **internal**, where the DSL is written in the language's semantics and processed by it. These are also referred to as **embedded** DSLs. Here are two examples. + + * A Bash DSL that can be executed in a Bash engine: [code]`if today_is_christmas; then apply_christmas_discount; fi` [/code] This is valid Bash that is written like English. + * A DSL written in a GPL like Java: [code] orderValue = orderValue +                .applyFestivalDiscount() +                .applyCustomerLoyalityDiscount() +                .applyCustomerAgeDiscount(); [/code] This uses a fluent style and is readable like English. + + + +Yes, the boundaries between DSL and GPL sometimes blur. + +### DSL examples + +Some languages used for DSLs include: + + * Web: HTML + * Shell: sh, Bash, CSH, and the likes for *nix; MS-DOS, Windows Terminal, PowerShell for Windows + * Markup languages: XML + * Modeling: UML + * Data management: SQL and its variants + * Business rules: Drools + * Hardware: Verilog, VHD + * Build tools: Maven, Gradle + * Numerical computation and simulation: MATLAB (commercial), GNU Octave, Scilab + * Various types of parsers and generators: Lex, YACC, GNU Bison, ANTLR + + + +### Why DSL? + +The purpose of a DSL is to capture or document the requirements and behavior of one domain. A DSL's usage might be even narrower for particular aspects within the domain (e.g., commodities trading in finance). DSLs bring business and technical teams together. This does not imply a DSL is for business use alone. For example, designers and developers can use a DSL to represent or design an application. + +A DSL can also be used to generate source code for an addressed domain or problem. However, code generation from a DSL is not considered mandatory, as its primary purpose is domain knowledge. However, when it is used, code generation is a serious advantage in domain engineering. + +### DSL pros and cons + +On the plus side, DSLs are powerful for capturing a domain's attributes. Also, since DSLs are small, they are easy to learn and use. Finally, a DSL offers a language for domain experts and between domain experts and developers. + +On the downside, a DSL is narrowly used within the intended domain and purpose. Also, a DSL has a learning curve, although it may not be very high. Additionally, although there may be advantages to using tools for DSL capture, they are not essential, and the development or configuration of such tools is an added effort. Finally, DSL creators need domain knowledge as well as language-development knowledge, and individuals rarely have both. + +### DSL software options + +Open source DSL software options include: + + * **Xtext:** Xtext enables the development of DSLs and is integrated with Eclipse. It makes code generation possible and has been used by several open source and commercial products to provide specific functions. [MADS][3] (Multipurpose Agricultural Data System) is an interesting idea based on Xtext for "modeling and analysis of agricultural activities" (however, the project seems to be no longer active). + * **JetBrains MPS:** JetBrains MPS is an integrated development environment (IDE) to create DSLs. It calls itself a projectional editor that stores a document as its underlying abstract tree structure. (This concept is also used by programs such as Microsoft Word.) JetBrains MPS also supports code generation to Java, C, JavaScript, or XML. + + + +### DSL best practices + +Want to use a DSL? Here are a few tips: + + * DSLs are not GPLs. Try to address limited ranges of problems in the definitive domain. + * You do not need to define your own DSL. That would be tedious. Look for an existing DSL that solves your need on sites like [DSLFIN][4], which lists DSLs for the finance domain. If you are unable to find a suitable DSL, you could define your own. + * It is better to make DSLs "like English" rather than too technical. + * Code generation from a DSL is not mandatory, but it offers significant and productive advantages when it is done. + * DSLs are called languages but, unlike GPLs, they need not be executable. Being executable is not the intent of a DSL. + * DSLs can be written with word processors. However, using a DSL editor makes syntax and semantics checks easier. + + + +If you are using DSL now or plan to do so in the future, please share your experience in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/domain-specific-languages + +作者:[Girish Managoli][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/gammay +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_language_c.png?itok=mPwqDAD9 (Various programming languages in use) +[2]: https://en.wikipedia.org/wiki/Domain-specific_language +[3]: http://mads.sourceforge.net/ +[4]: http://www.dslfin.org/resources.html From a3b8b7e34d6f5035dadd35461921a199362f071d Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Tue, 25 Feb 2020 01:45:43 +0800 Subject: [PATCH 151/315] hankchow translating --- ...200214 Digging up IP addresses with the Linux dig command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200214 Digging up IP addresses with the Linux dig command.md b/sources/tech/20200214 Digging up IP addresses with the Linux dig command.md index 1a941f9ff8..a0cc485bf6 100644 --- a/sources/tech/20200214 Digging up IP addresses with the Linux dig command.md +++ b/sources/tech/20200214 Digging up IP addresses with the Linux dig command.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f4ab09d35d2ecdf88d530a8238fca6e74ebf5bd8 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Tue, 25 Feb 2020 03:02:17 +0800 Subject: [PATCH 152/315] hankchow translated --- ...IP addresses with the Linux dig command.md | 45 +++++++++---------- 1 file changed, 21 insertions(+), 24 deletions(-) rename {sources => translated}/tech/20200214 Digging up IP addresses with the Linux dig command.md (63%) diff --git a/sources/tech/20200214 Digging up IP addresses with the Linux dig command.md b/translated/tech/20200214 Digging up IP addresses with the Linux dig command.md similarity index 63% rename from sources/tech/20200214 Digging up IP addresses with the Linux dig command.md rename to translated/tech/20200214 Digging up IP addresses with the Linux dig command.md index a0cc485bf6..0b95b0a753 100644 --- a/sources/tech/20200214 Digging up IP addresses with the Linux dig command.md +++ b/translated/tech/20200214 Digging up IP addresses with the Linux dig command.md @@ -7,27 +7,26 @@ [#]: via: (https://www.networkworld.com/article/3527430/digging-up-ip-addresses-with-the-dig-command.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) -Digging up IP addresses with the Linux dig command +使用 dig 命令查询 IP 地址 ====== -The dig command is extremely versatile both for retrieving information from domain name servers and for troubleshooting. -Thinkstock +命令行工具 `dig` 是用于解析域名和故障排查的一个利器。 -Not unlike **nslookup** in function, but with a lot more options, the **dig** command provides information that name servers manage and can be very useful for troubleshooting problems. It’s both simple to use and has lots of useful options. +从主要功能上来说,`dig` 和 `nslookup` 之间差异不大,但 `dig` 更像一个加强版的 `nslookup`,可以查询到一些由域名服务器管理的信息,这在排查某些问题的时候非常有用。总的来说,`dig` 是一个既简单易用又功能强大的命令行工具。 -The name “dig” stands for “domain information groper” since domain groping is basically what it does. The amount of information that it provides depends on a series of options that you can use to tailor its output to your needs. Dig can provide a lot of detail or be surprisingly terse. +`dig` 最基本的功能就是查询域名信息,因此它的名称实际上是“域名信息查询工具Domain Information Groper”的缩写。`dig` 向用户返回的内容可以非常详尽,也可以非常简洁,展现内容的多少完全由用户在查询时使用的选项来决定。 [[Get regularly scheduled insights by signing up for Network World newsletters.]][1] -### Just the IP, please +### 我只需要查询 IP 地址 -To get _just_ the IP address for a system, add the **+short** option to your dig command like this: +如果只需要查询某个域名指向的 IP 地址,可以使用 `+short` 选项: ``` $ dig facebook.com +short 31.13.66.35 ``` -Don't be surprised, however, if some domains are tied to multiple IP addresses to make the sites they support more reliable. +在查询的时候发现有的域名会指向多个 IP 地址?这其实是网站提高其可用性的一种措施。 ``` $ dig networkworld.com +short @@ -37,7 +36,7 @@ $ dig networkworld.com +short 151.101.194.165 ``` -Also, don't be surprised if the order of the IP addresses changes from one query to the next. This is a side effect of load balancing. +也正是由于这些网站通过负载均衡实现高可用,在下一次查询的时候,或许会发现这几个 IP 地址的排序有所不同。 ``` $ dig networkworld.com +short @@ -47,9 +46,9 @@ $ dig networkworld.com +short 151.101.66.165 ``` -### Standard dig output +### 标准返回 -The standard dig display provides details on dig itself along with the response from the name server. +`dig` 的标准返回内容则包括这个工具本身的一些信息,以及请求域名服务器时返回的响应内容: ``` $ dig networkworld.com @@ -77,7 +76,7 @@ networkworld.com. 300 IN A 151.101.2.165 ;; MSG SIZE rcvd: 109 ``` -Since name servers generally cache collected data for a while, the query time shown at the bottom of dig output might sometimes might say "0 msec": +由于域名服务器有缓存机制,返回的内容可能是之前缓存好的信息。在这种情况下,`dig` 最后显示的查询时间Query time会是 0 毫秒(0 msec): [][2] @@ -88,11 +87,11 @@ Since name servers generally cache collected data for a while, the query time sh ;; MSG SIZE rcvd: 109 ``` -### Who you gonna ask? +### 向谁查询? -By default, dig will refer to your **/etc/resolv.conf** file to determine what name server to query, but you can refer queries to other DNS servers by adding an **@** option. +在默认情况下,`dig` 会根据 `/etc/resolv.conf` 这个文件的内容决定向哪个域名服务器获取查询结果。你也可以使用 `@` 来指定 `dig` 请求的域名服务器。 -In the example below, for example, the query is being sent to Google's name server (i.e., 8.8.8.8). +在下面的例子中,就指定了 `dig` 向 Google 的域名服务器 8.8.8.8 查询域名信息。 ``` $ dig @8.8.8.8 networkworld.com @@ -121,21 +120,21 @@ networkworld.com. 299 IN A 151.101.2.165 ;; MSG SIZE rcvd: 109 ``` -To determine what version of dig you’re using, use the **-v** option. You should see something like this: +想要知道正在使用的 `dig` 工具的版本,可以使用 `-v` 选项。你会看到类似这样: ``` $ dig -v DiG 9.11.5-P4-5.1ubuntu2.1-Ubuntu ``` -or this: +或者这样的返回信息: ``` $ dig -v DiG 9.11.4-P2-RedHat-9.11.4-22.P2.el8 ``` -To get just the answer portion of this response, you can omit name server details, but still get the answer you're looking for by using both a **+noall** (don't show everything) and a **+answer** (but show the answer section) like this: +如果你觉得 `dig` 返回的内容过于详细,可以使用 `+noall`(不显示所有内容)和 `+answer`(仅显示域名服务器的响应内容)选项,域名服务器的详细信息就会被忽略,只保留域名解析结果。 ``` $ dig networkworld.com +noall +answer @@ -148,9 +147,9 @@ networkworld.com. 300 IN A 151.101.66.165 networkworld.com. 300 IN A 151.101.2.165 ``` -### Looking up a batch of systems +### 批量查询域名 -If you want to dig for a series of domain names, you can list the domain names in a file and then use a command like this one to have dig run through the list and provide the information. +如果你要查询多个域名,可以把这些域名写入到一个文件内,然后使用下面的 `dig` 命令遍历整个文件并给出所有查询结果。 ``` $ dig +noall +answer -f domains @@ -165,7 +164,7 @@ amazon.com. 18 IN A 176.32.98.166 amazon.com. 18 IN A 205.251.242.103 ``` -You could add +short to the command above but, with some sites having multiple IP addresses, this might not be very useful. To cut down on the detail but be sure that you can tell which IP belongs to which domain, you could instead pass the output to **awk** to display just the first and last columns of data: +你也可以在上面的命令中使用 `+short` 选项,但如果其中有些域名指向多个 IP 地址,就无法看出哪些 IP 地址对应哪个域名了。在这种情况下,更好地做法应该是让 `awk` 对返回内容进行处理,只留下第一列和最后一列: ``` $ dig +noall +answer -f domains | awk '{print $1,$NF}' @@ -179,15 +178,13 @@ amazon.com. 205.251.242.103 amazon.com. 176.32.103.205 ``` -Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. - -------------------------------------------------------------------------------- via: https://www.networkworld.com/article/3527430/digging-up-ip-addresses-with-the-dig-command.html 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[HankChow](https://github.com/HankChow) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ac0babf872f0e55e86b3d721bde61a0b26d92790 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 Feb 2020 08:31:30 +0800 Subject: [PATCH 153/315] translated --- .../20200219 Don-t like IDEs- Try grepgitvi.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) rename {sources => translated}/tech/20200219 Don-t like IDEs- Try grepgitvi.md (69%) diff --git a/sources/tech/20200219 Don-t like IDEs- Try grepgitvi.md b/translated/tech/20200219 Don-t like IDEs- Try grepgitvi.md similarity index 69% rename from sources/tech/20200219 Don-t like IDEs- Try grepgitvi.md rename to translated/tech/20200219 Don-t like IDEs- Try grepgitvi.md index 0b3d10a279..a9b0118513 100644 --- a/sources/tech/20200219 Don-t like IDEs- Try grepgitvi.md +++ b/translated/tech/20200219 Don-t like IDEs- Try grepgitvi.md @@ -7,27 +7,27 @@ [#]: via: (https://opensource.com/article/20/2/no-ide-script) [#]: author: (Yedidyah Bar David https://opensource.com/users/didib) -Don't like IDEs? Try grepgitvi +不喜欢 IDE 么?试试看 grepgitvi ====== -A simple and primitive script to open Vim with your file of choice. +一个简单又原始的脚本来用 Vim 打开你选择的文件。 ![Files in a folder][1] -Like most developers, I search and read source code all day long. Personally, I've never gotten used to integrated development environments (IDEs), and for years, I mainly used **grep** and copy/pasted file names to open Vi(m). +像大多数开发者一样,我整天都在搜索和阅读源码。就我个人而言,我从来没有习惯集成开发环境 (IDE),多年来,我主要使用 **grep** 并复制/粘贴的文件名来打开 Vi(m)。 -Eventually, I came up with this script, slowly refining it as needed. +最终,我写了这个脚本,并根据需要缓慢地对其进行了完善。 -Its dependencies are [Vim][2] and [rlwrap][3], and it is open source under the Apache 2.0 license. To use the script, [put it in your PATH][4], and run it inside a directory of text files with: +它依赖 [Vim][2] 和 [rlwrap][3],并使用 Apache 2.0 许可开源。要使用该脚本,请[将它放到 PATH 中][4],然后在文本目录下运行: ``` `grepgitvi ` ``` -It will return a numbered list of search results, prompt you for the number of the result you want to use, and open Vim with that result. After you exit Vim, it will show the list again in a loop until you enter anything other than a result number. You can also use the Up and Down arrow keys to select a file; this makes it easier (for me) to find which results I've already looked at. +它将返回搜索结果的编号列表,并提示你输入结果编号并打开 Vim。退出 Vim 后,它将再次显示列表,直到你输入除结果编号以外的任何内容。你也可以使用向上和向下箭头键选择一个文件。(这对我来说)更容易找到我已经看过的结果。 -It's simple and primitive compared to modern IDEs, or even to more sophisticated uses of Vim, but that's what does the job for me. +与现代 IDE 甚至与 Vim 的更复杂的用法相比,它简单而原始,但它对我有用。 -### The script +### 脚本 ``` @@ -90,7 +90,7 @@ via: https://opensource.com/article/20/2/no-ide-script 作者:[Yedidyah Bar David][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 320498ba05c98ecb0c3340627b051098ab080f29 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 Feb 2020 08:34:14 +0800 Subject: [PATCH 154/315] translating --- sources/tech/20200217 How to get MongoDB Server on Fedora.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200217 How to get MongoDB Server on Fedora.md b/sources/tech/20200217 How to get MongoDB Server on Fedora.md index 6f85674c67..4eaad84766 100644 --- a/sources/tech/20200217 How to get MongoDB Server on Fedora.md +++ b/sources/tech/20200217 How to get MongoDB Server on Fedora.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4990d0f07cef1e921ea5bcdaabd49be1338ebe1e Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 Feb 2020 08:57:31 +0800 Subject: [PATCH 155/315] translating --- ... to use byobu to multiplex SSH sessions.md | 2 +- ...217 How to get MongoDB Server on Fedora.md | 132 ------------------ 2 files changed, 1 insertion(+), 133 deletions(-) delete mode 100644 sources/tech/20200217 How to get MongoDB Server on Fedora.md diff --git a/sources/tech/20200212 How to use byobu to multiplex SSH sessions.md b/sources/tech/20200212 How to use byobu to multiplex SSH sessions.md index bd36764af1..7b79a351f8 100644 --- a/sources/tech/20200212 How to use byobu to multiplex SSH sessions.md +++ b/sources/tech/20200212 How to use byobu to multiplex SSH sessions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20200217 How to get MongoDB Server on Fedora.md b/sources/tech/20200217 How to get MongoDB Server on Fedora.md deleted file mode 100644 index 4eaad84766..0000000000 --- a/sources/tech/20200217 How to get MongoDB Server on Fedora.md +++ /dev/null @@ -1,132 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to get MongoDB Server on Fedora) -[#]: via: (https://fedoramagazine.org/how-to-get-mongodb-server-on-fedora/) -[#]: author: (Honza Horak https://fedoramagazine.org/author/hhorak/) - -How to get MongoDB Server on Fedora -====== - -![][1] - -Mongo (from “humongous”) is a high-performance, open source, schema-free document-oriented database, which is one of the most favorite so-called [NoSQL][2] databases. It uses JSON as a document format, and it is designed to be scalable and replicable across multiple server nodes. - -### Story about license change - -It’s been more than a year when the upstream MongoDB decided to change the license of the Server code. The previous license was GNU Affero General Public License v3 (AGPLv3). However, upstream wrote a new license designed to make companies running MongoDB as a service contribute back to the community. The new license is called Server Side Public License (SSPLv1) and more about this step and its rationale can be found at [MongoDB SSPL FAQ][3]. - -Fedora has always included only free (as in “freedom”) software. When SSPL was released, Fedora [determined][4] that it is not a free software license in this meaning. All versions of MongoDB released before the license change date (October 2018) could be potentially kept in Fedora, but never updating the packages in the future would bring security issues. Hence the Fedora community decided to [remove the MongoDB server][5] entirely, starting Fedora 30. - -### What options are left to developers? - -Well, alternatives exist, for example PostgreSQL also supports JSON in the recent versions, and it can be used in cases when MongoDB cannot be used any more. With JSONB type, indexing works very well in PostgreSQL with performance comparable with MongoDB, and even without any compromises from ACID. - -The technical reasons that a developer may have chosen MongoDB did not change with the license, so many still want to use it. What is important to realize is that the SSPL license was only changed to the MongoDB server. There are other projects that MongoDB upstream develops, like MongoDB tools, C and C++ client libraries and connectors for various dynamic languages, that are used on the client side (in applications that want to communicate with the server over the network). Since the license is kept free (Apache License mostly) for those packages, they are staying in Fedora repositories, so users can use them for the application development. - -The only change is really the server package itself, which was removed entirely from Fedora repos. Let’s see what a Fedora user can do to get the non-free packages. - -### How to install MongoDB server from the upstream - -When Fedora users want to install a MongoDB server, they need to approach MongoDB upstream directly. However, the upstream does not ship RPM packages for Fedora itself. Instead, the MongoDB server is either available as the source tarball, that users need to compile themselves (which requires some developer knowledge), or Fedora user can use some compatible packages. From the compatible options, the best choice is the RHEL-8 RPMs at this point. The following steps describe, how to install them and how to start the daemon. - -#### 1\. Create a repository with upstream RPMs (RHEL-8 builds) -``` - -``` - -$ sudo cat > /etc/yum.repos.d/mongodb.repo &lt;&lt;EOF -[mongodb-upstream] -name=MongoDB Upstream Repository -baseurl= -gpgcheck=1 -enabled=1 -gpgkey= -EOF -``` - -``` - -#### 2\. Install the meta-package, that pulls the server and tools packages -``` - -``` - -$ sudo dnf install mongodb-org -&lt;snipped> -Installed: -  mongodb-org-4.2.3-1.el8.x86_64           mongodb-org-mongos-4.2.3-1.el8.x86_64   -  mongodb-org-server-4.2.3-1.el8.x86_64    mongodb-org-shell-4.2.3-1.el8.x86_64 -  mongodb-org-tools-4.2.3-1.el8.x86_64           - -Complete! -``` - -``` - -#### 3\. Start the MongoDB daemon -``` - -``` - -$ sudo systemctl status mongod -● mongod.service - MongoDB Database Server -   Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled) -   Active: active (running) since Sat 2020-02-08 12:33:45 EST; 2s ago -     Docs: -  Process: 15768 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS) -  Process: 15769 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS) -  Process: 15770 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS) -  Process: 15771 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS) - Main PID: 15773 (mongod) -   Memory: 70.4M -      CPU: 611ms -   CGroup: /system.slice/mongod.service -           └─15773 /usr/bin/mongod -f /etc/mongod.conf -``` - -``` - -#### 4\. Verify that the server runs by connecting to it from the mongo shell -``` - -``` - -$ mongo -MongoDB shell version v4.2.3 -connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&amp;gssapiServiceName=mongodb -Implicit session: session { "id" : UUID("20b6e61f-c7cc-4e9b-a25e-5e306d60482f") } -MongoDB server version: 4.2.3 -Welcome to the MongoDB shell. -For interactive help, type "help". -For more comprehensive documentation, see -    -\--- - -> _ -``` - -``` - -That’s all. As you see, the RHEL-8 packages are pretty compatible and it should stay that way for as long as the Fedora packages remain compatible with what’s in RHEL-8. Just be careful that you comply with the SSPLv1 license in your use. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/how-to-get-mongodb-server-on-fedora/ - -作者:[Honza Horak][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/hhorak/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/mongodb-816x348.png -[2]: https://en.wikipedia.org/wiki/NoSQL -[3]: https://www.mongodb.com/licensing/server-side-public-license/faq -[4]: https://lists.fedoraproject.org/archives/list/legal@lists.fedoraproject.org/thread/IQIOBOGWJ247JGKX2WD6N27TZNZZNM6C/ -[5]: https://fedoraproject.org/wiki/Changes/MongoDB_Removal From d8afa83e61bc0105e834e61cd42b3912de33b066 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 25 Feb 2020 10:32:51 +0800 Subject: [PATCH 156/315] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zhangxiangping 翻译的不错 --- ...e tools for natural language processing.md | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/translated/tech/20190322 12 open source tools for natural language processing.md b/translated/tech/20190322 12 open source tools for natural language processing.md index b6ef9f8091..3ae521d493 100644 --- a/translated/tech/20190322 12 open source tools for natural language processing.md +++ b/translated/tech/20190322 12 open source tools for natural language processing.md @@ -1,93 +1,95 @@ [#]: collector: (lujun9972) [#]: translator: (zhangxiangping) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (12 open source tools for natural language processing) [#]: via: (https://opensource.com/article/19/3/natural-language-processing-tools) -[#]: author: (Dan Barker https://opensource.com/users/barkerd427) +[#]: author: (Dan Barker https://opensource.com/users/barkerd427) -12种自然语言处理的开源工具 +12 种自然语言处理的开源工具 ====== -看看可以用在你自己NLP应用中的十几个工具吧。 +> 让我们看看可以用在你自己的 NLP 应用中的十几个工具吧。 -![Chat bubbles][1] +![](https://img.linux.net.cn/data/attachment/album/202002/25/103230j77i7zx8uyymj7y3.jpg) -在过去的几年里,自然语言处理(NLP)推动了聊天机器人、语音助手、文本预测,这些在我们的日常生活中常用的语音或文本应用程技术的发展。目前有着各种各样开源的NLP工具,所以我决定调查一下当前开源的NLP工具来帮助您制定您开发下一个基于语音或文本的应用程序的计划。 +在过去的几年里,自然语言处理(NLP)推动了聊天机器人、语音助手、文本预测等这些渗透到我们的日常生活中的语音或文本应用程技术的发展。目前有着各种各样开源的 NLP 工具,所以我决定调查一下当前开源的 NLP 工具来帮助你制定开发下一个基于语音或文本的应用程序的计划。 -我将从我所熟悉的编程语言出发来介绍这些工具,尽管我对这些工具不是很熟悉(我没有在我不熟悉的语言中找工具)。也就是说,出于各种原因,我排除了三种我熟悉的语言中的工具。 +尽管我并不熟悉所有工具,但我将从我所熟悉的编程语言出发来介绍这些工具(对于我不熟悉的语言,我无法找到大量的工具)。也就是说,出于各种原因,我排除了三种我熟悉的语言之外的工具。 -R语言是没有被包含在内的,因为我发现的大多数库都有一年多没有更新了。这并不总是意味着他们没有得到很好的维护,但我认为他们应该得到更多的更新,以便和同一领域的其他工具竞争。我还选择了最有可能在生产场景中使用的语言和工具(而不是在学术界和研究中使用),虽然我主要是使用R作为研究和发现工具。 +R 语言可能是没有被包含在内的最重要的语言,因为我发现的大多数库都有一年多没有更新了。这并不一定意味着它们没有得到很好的维护,但我认为它们应该得到更多的更新,以便和同一领域的其他工具竞争。我还选择了最有可能用在生产场景中的语言和工具(而不是在学术界和研究中使用),而我主要是使用 R 作为研究和发现工具。 -我发现Scala的很多库都没有更新了。我上次使用Scala已经有好几年了,当时它非常流行。但是大多数库从那个时候就再没有更新过,或者只有少数一些有更新。 +我也惊讶地发现 Scala 的很多库都没有更新了。我上次使用 Scala 已经过去了两年了,当时它非常流行。但是大多数库从那个时候就再没有更新过,或者只有少数一些有更新。 -最后,我排除了C++。这主要是因为我在的公司很久没有使用C++来进行NLP或者任何数据科学的工作。 +最后,我排除了 C++。 这主要是因为我上次使用 C++ 编写程序已经有很多年了,而我所工作的组织还没有将 C++ 用于 NLP 或任何数据科学方面的工作。 -### Python工具 -#### Natural Language Toolkit (NLTK) +### Python 工具 -[Natural Language Toolkit (NLTK)][2]是我调研的所有工具中功能最完善的一个。它完美地实现了自然语言处理中多数功能组件,比如分类,令牌化,词干化,标注,分词和语义推理。每一种方法都有多种不同的实现方式,所以你可以选择具体的算法和方式去使用它。同时,它也支持不同语言。然而,它将所有的数据都表示为字符串的形式,对于一些简单的数据结构来说可能很方便,但是如果要使用一些高级的功能来说就可能有点困难。它的使用文档有点复杂,但也有很多其他人编写的使用文档,比如[a great book][3]。和其他的工具比起来,这个工具库的运行速度有点慢。但总的来说,这个工具包非常不错,可以用于需要具体算法组合的实验,探索和实际应用当中。 +#### 自然语言工具包(NLTK) + +毋庸置疑,[自然语言工具包(NLTK)][2]是我调研过的所有工具中功能最完善的一个。它几乎实现了自然语言处理中多数功能组件,比如分类、令牌化、词干化、标注、分词和语义推理。每一个都有多种不同的实现方式,所以你可以选择具体的算法和方式。同时,它也支持不同的语言。然而,它以字符串的形式表示所有的数据,对于一些简单的数据结构来说可能很方便,但是如果要使用一些高级的功能来说就可能有点困难。它的使用文档有点复杂,但也有很多其他人编写的使用文档,比如[这本很棒的书][3]。和其他的工具比起来,这个工具库的运行速度有点慢。但总的来说,这个工具包非常不错,可以用于需要具体算法组合的实验、探索和实际应用当中。 #### SpaCy -[SpaCy][4]是NLTK的主要竞争者。在大多数情况下都比NLTK的速度更快,但是SpaCy对自然语言处理的功能组件只有单一实现。SpaCy把所有的东西都表示为一个对象而不是字符串,这样就能够为构建应用简化接口。这也方便它能够集成多种框架和数据科学的工具,使得你更容易理解你的文本数据。然而,SpaCy不像NLTK那样支持多种语言。它对每个接口都有一些简单的选项和文档,包括用于语言处理和分析各种组件的多种神经网络模型。总的来说,如果创造一个新的应用的生产过程中不需要使用特定的算法的话,这是一个很不错的工具。 +[SpaCy][4] 可能是 NLTK 的主要竞争者。在大多数情况下都比 NLTK 的速度更快,但是 SpaCy 的每个自然语言处理的功能组件只有一个实现。SpaCy 把所有的东西都表示为一个对象而不是字符串,从而简化了应用构建接口。这也方便它与多种框架和数据科学工具的集成,使得你更容易理解你的文本数据。然而,SpaCy 不像 NLTK 那样支持多种语言。它确实接口简单,具有简化的选项集和完备的文档,以及用于语言处理和分析各种组件的多种神经网络模型。总的来说,对于需要在生产中表现出色且不需要特定算法的新应用程序,这是一个很不错的工具。 #### TextBlob -[TextBlob][5]是NLTK的一个扩展库。你可以通过TextBlob用一种更简单的方式来使用NLTK的功能,TextBlob也包括了Pattern库中的功能。如果你刚刚开始学习,这将会是一个不错的工具可以用于生产对性能要求不太高的应用。TextBlob适用于任何场景,但是对小型项目会更加合适。 +[TextBlob][5] 是 NLTK 的一个扩展库。你可以通过 TextBlob 用一种更简单的方式来使用 NLTK 的功能,TextBlob 也包括了 Pattern 库中的功能。如果你刚刚开始学习,这将会是一个不错的工具,可以用于对性能要求不太高的生产环境的应用。总体来说,TextBlob 适用于任何场景,但是对小型项目尤佳。 #### Textacy -这个工具是我用过的名字最好听的。读"[Textacy][6]" 时先发出"ex"再发出"cy"。它不仅仅是名字好,同时它本身也是一个很不错的工具。它使用SpaCy作为它自然语言处理核心功能,但它在处理过程的前后做了很多工作。如果你想要使用SpaCy,你可以先使用Textacy,从而不用去多写额外的附加代码你就可以处理不同种类的数据。 +这个工具是我用过的名字最好听的。先重读“ex”再带出“cy”,多读“[Textacy][6]”几次试试。它不仅仅是名字读起来好,同时它本身也是一个很不错的工具。它使用 SpaCy 作为它自然语言处理核心功能,但它在处理过程的前后做了很多工作。如果你想要使用 SpaCy,那么最好使用 Textacy,从而不用去编写额外的附加代码就可以处理不同种类的数据。 #### PyTorch-NLP -[PyTorch-NLP][7]才出现短短的一年,但它已经有一个庞大的社区了。它适用于快速原型开发。当公司或者研究人员推出很多其他工具去完成新奇的处理任务,比如图像转换,它就会被更新。PyTorch的目标用户是研究人员,但它也能用于原型开发,或在最开始的生产任务中使用最好的算法。基于此基础上的创建的库也是值得研究的。 +[PyTorch-NLP][7] 才出现短短的一年,但它已经有一个庞大的社区了。它适用于快速原型开发。当出现了最新的研究,或大公司或者研究人员推出了完成新奇的处理任务的其他工具时,比如图像转换,它就会被更新。总体来说,PyTorch 的目标用户是研究人员,但它也能用于原型开发,或使用最先进算法的初始生产载荷中。基于此基础上的创建的库也是值得研究的。 -### 节点工具 +### Node.js 工具 #### Retext -[Retext][8]是[unified collective][9]的一部分。Unified是一个接口,能够集成不同的工具和插件以便他们能够高效的工作。Retext是unified工具集三个中的一个,另外的两个分别是用于markdown编辑的Remark和用于HTML处理的Rehype。这是一个非常有趣的想法,我很高兴看到这个社区的发展。Retext没有暴露过多的底层技术,更多的是使用插件去完成你在NLP任务中想要做的事情。拼写检查,固定排版,情绪检测和可读性分析都可以用简单的插件来完成。如果你不想了解底层处理技术又想完成你的任务的话,这个工具和社区是一个不错的选择。 +[Retext][8] 是 [Unified 集合][9]的一部分。Unified 是一个接口,能够集成不同的工具和插件以便它们能够高效的工作。Retext 是 Unified 工具中使用的三种语法之一,另外的两个分别是用于 Markdown 的 Remark 和用于 HTML 的 Rehype。这是一个非常有趣的想法,我很高兴看到这个社区的发展。Retext 没有涉及很多的底层技术,更多的是使用插件去完成你在 NLP 任务中想要做的事情。拼写检查、字形修复、情绪检测和增强可读性都可以用简单的插件来完成。总体来说,如果你不想了解底层处理技术又想完成你的任务的话,这个工具和社区是一个不错的选择。 #### Compromise -如果你在找拥有最高级的功能和最复杂的系统的工具的话,[Compromise][10]不是你的选择。 然而,如果你想要一个性能好,应用广泛,还能在客户端运行的工具的话,Compromise值得一试。实际上,它的名字是准确的,因为作者更关注更具体功能的小软件包,而在功能性和准确性上做出了牺牲,这些功能得益于用户对使用环境的理解。 +[Compromise][10] 显然不是最复杂的工具,如果你正在找拥有最先进的算法和最完备的系统的话,它可能不适合你。然而,如果你想要一个性能好、功能广泛、还能在客户端运行的工具的话,Compromise 值得一试。总体来说,它的名字(“折中”)是准确的,因为作者更关注更具体功能的小软件包,而在功能性和准确性上有所折中,这些小软件包得益于用户对使用环境的理解。 #### Natural -[Natural][11]包含了一般自然语言处理库所具有的大多数功能。它主要是处理英文文本,但也包括一些其他语言,它的社区也支持额外的语言。它能够进行令牌化,词干化,分类,语音处理,词频-逆文档频率计算(TF-IDF),WordNet,字符相似度计算和一些变换。它和NLTK有的一比,因为它想要把所有东西都包含在一个包里头,使用方便但是可能不太适合专注的研究。总的来说,这是一个不错的功能齐全的库,目前仍在开发但可能需要对底层实现有更多的了解才能完更有效。 +[Natural][11] 包含了常规自然语言处理库所具有的大多数功能。它主要是处理英文文本,但也包括一些其它语言,它的社区也欢迎支持其它的语言。它能够进行令牌化、词干化、分类、语音处理、词频-逆文档频率计算(TF-IDF)、WordNet、字符相似度计算和一些变换。它和 NLTK 有的一比,因为它想要把所有东西都包含在一个包里头,但它更易于使用,而且不一定专注于研究。总的来说,这是一个非常完整的库,目前仍在活跃开发中,但可能需要对底层实现有更多的了解才能完全发挥效力。 #### Nlp.js -[Nlp.js][12]是在其他几个NLP库上开发的,包括Franc和Brain.js。它提供了一个能很好支持NLP组件的接口,比如分类,情感分析,词干化,命名实体识别和自然语言生成。它也支持一些其他语言,在你处理除了英语之外的语言时也能提供一些帮助。总之,它是一个不错的通用工具,能够提供简单的接口去调用其他工具。在你需要更强大或更灵活的工具之前,这个工具可能会在你的应用程序中用上很长一段时间。 +[Nlp.js][12] 建立在其他几个 NLP 库之上,包括 Franc 和 Brain.js。它为许多 NLP 组件提供了一个很好的接口,比如分类、情感分析、词干化、命名实体识别和自然语言生成。它也支持一些其它语言,在你处理英语之外的语言时能提供一些帮助。总之,它是一个不错的通用工具,并且提供了调用其他工具的简化接口。在你需要更强大或更灵活的工具之前,这个工具可能会在你的应用程序中用上很长一段时间。 + +### Java 工具 -### Java工具 #### OpenNLP -[OpenNLP][13]是由Apache基金会维护的,所以它可以很方便地集成到其他Apache项目中,比如Apache Flink,Apache NiFi和Apache Spark。这是一个通用的NLP工具,包含了所有NLP组件中的通用功能,可以通过命令行或者以包的形式导入到应用中来使用它。它也支持很多种语言。OpenNLP是一个很高效的工具,包含了很多特性,如果你用Java开发生产的话,它是个很好的选择。 +[OpenNLP][13] 是由 Apache 基金会管理的,所以它可以很方便地集成到其他 Apache 项目中,比如 Apache Flink、Apache NiFi 和 Apache Spark。这是一个通用的 NLP 工具,包含了所有 NLP 组件中的通用功能,可以通过命令行或者以包的形式导入到应用中来使用它。它也支持很多种语言。OpenNLP 是一个很高效的工具,包含了很多特性,如果你用 Java 开发生产环境产品的话,它是个很好的选择。 -#### StanfordNLP +#### Stanford CoreNLP -[Stanford CoreNLP][14]是一个工具集,提供了基于统计的,基于深度学习和基于规则的NLP功能。这个工具也有许多其他编程语言的版本,所以可以脱离Java来使用。它是由高水平的研究机构创建的一个高效的工具,但在生产环境中可能不是最好的。此工具具有双重许可,并具有可以用于商业目的的特殊许可。总之,在研究和实验中它是一个很棒的工具,但在生产系统中可能会带来一些额外的开销。比起Java版本来说,读者可能对它的Python版本更感兴趣。斯坦福教授在Coursera上教的最好的机器学习课程之一,[点此][15]访问其他不错的资源。 +[Stanford CoreNLP][14] 是一个工具集,提供了统计 NLP、深度学习 NLP 和基于规则的 NLP 功能。这个工具也有许多其他编程语言的版本,所以可以脱离 Java 来使用。它是由高水平的研究机构创建的一个高效的工具,但在生产环境中可能不是最好的。此工具采用双许可证,具有可以用于商业目的的特定许可证。总之,在研究和实验中它是一个很棒的工具,但在生产系统中可能会带来一些额外的成本。比起 Java 版本来说,读者可能对它的 Python 版本更感兴趣。同样,在 Coursera 上最好的机器学习课程之一是斯坦福教授提供的,[点此][15]访问其他不错的资源。 #### CogCompNLP -[CogCompNLP][16]由伊利诺斯大学开发的一个工具,它也有一个相似功能的Python版本事项。它可以用于处理文本,包括本地处理和远程处理,能够极大地缓解你本地设备的压力。它提供了很多处理函数,比如令牌化,词性分析,标注,断句,命名实体标注,词型还原,依存分析和语义角色标注。它是一个很好的研究工具,你可以自己探索它的不同功能。我不确定它是否适合生产环境,但如果你使用Java的话,它值得一试。 +[CogCompNLP][16] 由伊利诺斯大学开发的一个工具,它也有一个相似功能的 Python 版本。它可以用于处理文本,包括本地处理和远程处理,能够极大地缓解你本地设备的压力。它提供了很多处理功能,比如令牌化、词性标注、断句、命名实体标注、词型还原、依存分析和语义角色标注。它是一个很好的研究工具,你可以自己探索它的不同功能。我不确定它是否适合生产环境,但如果你使用 Java 的话,它值得一试。 * * * -你最喜欢的开源的NLP工具和库是什么?请在评论区分享文中没有提到的工具。 +你最喜欢的开源 NLP 工具和库是什么?请在评论区分享文中没有提到的工具。 -------------------------------------------------------------------------------- via: https://opensource.com/article/19/3/natural-language-processing-tools -作者:[Dan Barker (Community Moderator)][a] +作者:[Dan Barker][a] 选题:[lujun9972][b] 译者:[zxp](https://github.com/zhangxiangping) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 855d11a28eaa147610e4162bd0df01f2c8614274 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 25 Feb 2020 10:35:22 +0800 Subject: [PATCH 157/315] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zhangxiangping 恭喜你完成了第一篇翻译贡献,翻译的不错。抱歉整整两周才发布出来。 本文首发地址: https://linux.cn/article-11927-1.html 你的 LCTT 专页地址: https://linux.cn/lctt/zhangxiangping 请注册以领取 LCCN: https://lctt.linux.cn/ --- ...22 12 open source tools for natural language processing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190322 12 open source tools for natural language processing.md (99%) diff --git a/translated/tech/20190322 12 open source tools for natural language processing.md b/published/20190322 12 open source tools for natural language processing.md similarity index 99% rename from translated/tech/20190322 12 open source tools for natural language processing.md rename to published/20190322 12 open source tools for natural language processing.md index 3ae521d493..ee4bf2e0ec 100644 --- a/translated/tech/20190322 12 open source tools for natural language processing.md +++ b/published/20190322 12 open source tools for natural language processing.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (zhangxiangping) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11927-1.html) [#]: subject: (12 open source tools for natural language processing) [#]: via: (https://opensource.com/article/19/3/natural-language-processing-tools) [#]: author: (Dan Barker https://opensource.com/users/barkerd427) From c1d131120ff5e57d073e8b67962313245152bd77 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 25 Feb 2020 11:48:47 +0800 Subject: [PATCH 158/315] PRF @geekpi --- ...to Install Latest Git Version on Ubuntu.md | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/translated/tech/20200219 How to Install Latest Git Version on Ubuntu.md b/translated/tech/20200219 How to Install Latest Git Version on Ubuntu.md index b6b240dadc..6e0654d7a3 100644 --- a/translated/tech/20200219 How to Install Latest Git Version on Ubuntu.md +++ b/translated/tech/20200219 How to Install Latest Git Version on Ubuntu.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Install Latest Git Version on Ubuntu) @@ -25,7 +25,7 @@ sudo apt install git 这就是为什么当你检查 Git 版本时,会看到安装的版本会比 [Git 网站上当前最新 Git 版本][4]旧: ``` -[email protected]:~$ git --version +$ git --version git version 2.17.1 ``` @@ -43,35 +43,35 @@ sudo apt update sudo apt install git ``` -即使你以前使用 apt 安装了 Git,它也将更新为最新的稳定版本。 +即使你以前使用 `apt` 安装了 Git,它也将更新为最新的稳定版本。 ``` -[email protected]:~$ git --version +$ git --version git version 2.25.0 ``` -[使用PPA][8] 的好处在于,如果发布了新的 Git 稳定版本,那么就可以通过系统更新获得它。[仅更新 Ubuntu][9]来获取最新的 Git 稳定版本。 +[使用PPA][8] 的好处在于,如果发布了新的 Git 稳定版本,那么就可以通过系统更新获得它。[仅更新 Ubuntu][9] 来获取最新的 Git 稳定版本。 -### 配置Git (推荐给开发者) +### 配置 Git (推荐给开发者) 如果你出于开发目的安装了 Git,你会很快开始克隆仓库,进行更改并提交更改。 如果你尝试提交代码,那么你可能会看到 “Please tell me who you are” 这样的错误: ``` -[email protected]:~/compress-pdf$ git commit -m "update readme" +$ git commit -m "update readme" *** Please tell me who you are. Run - git config --global user.email "[email protected]" + git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. -fatal: unable to auto-detect email address (got '[email protected](none)') +fatal: unable to auto-detect email address (got 'abhishek@itsfoss.(none)') ``` 这是因为你还没配置必要的个人信息。 @@ -80,7 +80,7 @@ fatal: unable to auto-detect email address (got '[email protected](none)') ``` git config --global user.name "Your Name" -git config --global user.email "[email protected]" +git config --global user.email "you@example.com" ``` 你可以使用以下命令检查 Git 配置: @@ -92,15 +92,13 @@ git config --list 它应该显示如下输出: ``` -[email protected] -user.name=abhishek +user.email=you@example.com +user.name=Your Name ``` -配置保存在 \~/.gitconfig 中。你可以手动修改配置。 +配置保存在 `~/.gitconfig` 中。你可以手动修改配置。 -* * * - -**结尾** +### 结尾 我希望这个小教程可以帮助你在 Ubuntu 上安装 Git。使用 PPA,你可以轻松获得最新的 Git 版本。 @@ -113,7 +111,7 @@ via: https://itsfoss.com/install-git-ubuntu/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -127,4 +125,4 @@ via: https://itsfoss.com/install-git-ubuntu/ [6]: https://itsfoss.com/install-software-from-source-code/ [7]: https://launchpad.net/~git-core/+archive/ubuntu/ppa [8]: https://itsfoss.com/ppa-guide/ -[9]: https://itsfoss.com/update-ubuntu/ \ No newline at end of file +[9]: https://itsfoss.com/update-ubuntu/ From 6ec54b5d70e2758ab80ffefb7b9e171d1a39b7a7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 25 Feb 2020 11:49:21 +0800 Subject: [PATCH 159/315] PUB @geekpi https://linux.cn/article-11929-1.html --- .../20200219 How to Install Latest Git Version on Ubuntu.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200219 How to Install Latest Git Version on Ubuntu.md (98%) diff --git a/translated/tech/20200219 How to Install Latest Git Version on Ubuntu.md b/published/20200219 How to Install Latest Git Version on Ubuntu.md similarity index 98% rename from translated/tech/20200219 How to Install Latest Git Version on Ubuntu.md rename to published/20200219 How to Install Latest Git Version on Ubuntu.md index 6e0654d7a3..c05c0d3c02 100644 --- a/translated/tech/20200219 How to Install Latest Git Version on Ubuntu.md +++ b/published/20200219 How to Install Latest Git Version on Ubuntu.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11929-1.html) [#]: subject: (How to Install Latest Git Version on Ubuntu) [#]: via: (https://itsfoss.com/install-git-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 5bd3368f0d5bda0a79ce227fc9a8b0b6a2dc28e7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 25 Feb 2020 12:55:33 +0800 Subject: [PATCH 160/315] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @guevaraya 翻译后应该审读至少一遍。 --- ...etes with the power of tmux and kubectl.md | 161 +++++++++--------- 1 file changed, 79 insertions(+), 82 deletions(-) diff --git a/translated/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md b/translated/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md index b807e99fb1..1f5a4e3ff6 100644 --- a/translated/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md +++ b/translated/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md @@ -1,58 +1,58 @@ [#]: collector: (lujun9972) -[#]: translator: ( guevaraya) -[#]: reviewer: ( ) +[#]: translator: (guevaraya) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Troubleshoot Kubernetes with the power of tmux and kubectl) [#]: via: (https://opensource.com/article/20/2/kubernetes-tmux-kubectl) [#]: author: (Abhishek Tamrakar https://opensource.com/users/tamrakar) -解决 Kubernetes 问题的利器 Tmux 和 kubectl +利用 Tmux 和 kubectl 解决 Kubernetes 故障 ====== -一个 kubectl 插件 用 tmux 使 Kubernetes 疑难问题变得更简单。 -![一个坐在笔记本面前的妇女][1] +> 一个使用 tmux 的 kubectl 插件可以使 Kubernetes 疑难问题变得更简单。 -[Kubernetes][2] 是一个活跃的开源容器管理平台,它提供了可扩展性,高可用性,健壮性和富有弹性的应用程序管理。它的众多特性之一是支持通过原生的客户端程序 [kubectl][3] 运行定制脚本或可执行程序,Kubectl 很强大的,允许用户在 Kubernetes 集群上用它直接做很多事情。 +![](https://img.linux.net.cn/data/attachment/album/202002/25/125435a4v3vpss3s4w3sks.jpg) + +[Kubernetes][2] 是一个活跃的开源容器管理平台,它提供了可扩展性、高可用性、健壮性和富有弹性的应用程序管理。它的众多特性之一是支持通过其主要的二进制客户端 [kubectl][3] 运行定制脚本或可执行程序,kubectl 很强大的,允许用户在 Kubernetes 集群上用它直接做很多事情。 ### 使用别名进行 Kubernetes 的故障排查 -使用 Kubernetes 的容器管理的人都知道由于设计上原因带来了其复杂性。因此迫切的需要快速的以及几乎不需要人工干预方式简化故障排查(除过特殊情况)。 +使用 Kubernetes 进行容器编排的人都知道由于设计上原因带来了其功能的复杂性。举例说,迫切需要以更快的速度并且几乎不需要手动干预的方式来简化 Kubernetes 中的故障排除(除过特殊情况)。 -在故障排查功能方面,这有很多场景需要考虑。有一个场景,你知道你需要运行什么,但是这个命令的语法(即使作为一个单独的命令运行)过于复杂,或需要一、两次交互才能起作用。 +在故障排查功能方面,有很多场景需要考虑。在一种场景下,你知道你需要运行什么,但是这个命令的语法(即使作为一个单独的命令运行)过于复杂,或需要一、两次交互才能起作用。 -例如,如果你频繁的需要调整一个系统命名空间里正在运行的容器,你可能发现自己在重复的写入: +例如,如果你需要经常进入一个系统命名空间中运行的容器,你可能发现自己在重复地键入: ``` -`kubectl --namespace=kube-system exec -i -t ` -``` -为了简化故障排查,你可以用这些指令的命令行补全功能。比如,你可以增加下面命令到你的隐藏配置文件(.bashrc 或 .zshrc): - -``` -`alias ksysex='kubectl --namespace=kube-system exec -i -t'` +kubectl --namespace=kube-system exec -i -t ``` -这是来自于常见的 [Kubernetes 别名仓][4]的一个例子,它展示了一个 kubectl 简化的功能的方法。像这个场景的简化情况,使用别名很有用。 +为了简化故障排查,你可以用这些指令的命令行别名。比如,你可以增加下面命令到你的隐藏配置文件(`.bashrc` 或 `.zshrc`): + +``` +alias ksysex='kubectl --namespace=kube-system exec -i -t' +``` + +这是来自于 [Kubernetes 常见别名][4]存储库的一个例子,它展示了一种简化 `kubectl` 中的功能的方法。像这种场景下的简单情形,使用别名很有用。 ### 切换到 kubectl 插件 -更复杂的故障排查场景是需要执行很多命令,一个一个的执行,然后去调查环境,最后得出结论。单用别名方法是不能解决这种情况的;你需要知道你所部署的Kubernetes 之间逻辑和和相关性,你真是需要的是自动化来短时间输出你想要的。 +更复杂的故障排查场景是需要一个一个的执行很多命令,调查环境,最后得出结论。仅仅用别名方法是不能解决这种情况的;你需要知道你所部署的 Kubernetes 之间逻辑和相关性,你真正需要的是自动化,以在更短的时间内输出你想要的。 -考虑到你的集群有10到20或50到100个命名空间来提供不同的微服务。一般在进行故障排查时,做什么事情对你有帮助? +考虑到你的集群有 10 ~ 20 或 50 ~ 100 个命名空间来提供不同的微服务。一般在进行故障排查时,什么对你有帮助? - * 你需要某个东西可快速的告知哪个 Pod 哪个 命名空间抛的错误。 - * 你需要某个东西可监视一个命名空间的所有 pod 的日志。 - * 你可能也需要监视出现错误的指定命名空间的特定 pod 的日志。 +* 你需要能够快速分辨出抛出错误的是哪个 命名空间的哪个 Pod 的东西。 +* 你需要一些可监视一个命名空间的所有 Pod 日志的东西。 +* 你可能也需要监视特定命名空间的出现错误的某个 Pod 的日志。 +涵盖这些要点的解决方案对于定位生产环境的问题有很大的帮助,以及在开发和测试环节中也很有用。 -只要包含以上任意的解决方案将对定位产品问题很大的帮助,包含对开发和测试周期过程。 +你可以用 [kubectl 插件][5]创建比简单的别名更强大的功能。插件类似于其它用任何语言编写的独立脚本,但被设计为可以扩充 Kubernetes 管理员的主要命令。 -你可以用 [kubectl 插件][5] 创建比简易别名更强大的方法。插件类似于其他用任何语言编写的独立脚本,被设计为 Kubernetes 管理员的主要命令扩展。 - -创建一个插件,你必须用正确的语法 **kubectl-<your-plugin-name>** 来拷贝这个脚本到导出目录 **$PATH** ,需要赋予可执行权限(**chmod +x**)。 - -创建插件之后把他移动到你的目录,你需要立即运行。例如,你的目录下有一个 kubectl-krawl 和 kubectl-kmux: +创建一个插件,你必须用 `kubectl-` 的正确的语法来拷贝这个脚本到 `$PATH` 中的导出目录之一,并需要为其赋予可执行权限(`chmod +x`)。 +创建插件之后将其移动到路径中,你可以立即运行它。例如,我的路径下有一个 `kubectl-krawl` 和 `kubectl-kmux`: ``` $ kubectl plugin list @@ -63,80 +63,77 @@ The following compatible plugins are available: $ kubectl kmux ``` + 现在让我们见识下带有 tmux 的 Kubernetes 的有多强大。 ### 驾驭强大的 tmux -[Tmux][6] 是一个非常强大的工具,许多管理员和操作团队通过它来反馈问题故障,通过易于分屏的方式到窗口上并行调试多个机器以及管理日志。他的主要的优点是可基于命令行或自动化的脚本。 +[Tmux][6] 是一个非常强大的工具,许多管理员和运维团队都依赖它来解决与易操作性相关的问题:通过将窗口分成多个窗格以便在多台计算机上运行并行的调试来监视日志。它的主要的优点是可在命令行或自动化脚本中使用。 -我创建[一个 kubectl 插件][7] 用 tmux 使故障排查更加简单。我将通过注释来了解插件背后的逻辑(我们来瞅一瞅插件的整个源码): +我创建[一个 kubectl 插件][7],使用 tmux 使故障排查更加简单。我将通过注释来解析插件背后的逻辑(插件的完整代码留待给你实现): ``` -#NAMESPACE is namespace to monitor. -#POD is pod name -#Containers is container names +# NAMESPACE 是要监控的名字空间 +# POD 是 Pod 名称 +# Containers 是容器名称 -# initialize a counter n to count the number of loop counts, later be used by tmux to split panes. +# 初始化一个计数器 n 以计算循环计数的数量, +# 之后 tmux 使用它来拆分窗格。 n=0; -# start a loop on a list of pod and containers +# 在 Pod 和容器列表上开始循环 while IFS=' ' read -r POD CONTAINERS do + # tmux 为每个 Pod 创建一个新窗口 + tmux neww $COMMAND -n $POD 2>/dev/null + # 对运行中的 Pod 中 的所有容器启动循环 + for CONTAINER in ${CONTAINERS//,/ } + do + if [ x$POD = x -o x$CONTAINER = x ]; then + # 如果任何值为 null,则退出。 + warn "Looks like there is a problem getting pods data." + break + fi + + # 设置要执行的命令 + COMMAND=”kubectl logs -f $POD -c $CONTAINER -n $NAMESPACE” + # 检查 tmux 会话 + if tmux has-session -t <会话名> 2>/dev/null; + then + <设置会话退出> + else + <创建会话> + fi + # 在当前窗口为每个容器切分窗格 + tmux selectp -t $n \; \ + splitw $COMMAND \; \ + select-layout tiled \; + # 终止容器循环 + done + + # 用 Pod 名称重命名窗口以识别 + tmux renamew $POD 2>/dev/null + + # 增加计数器 + ((n+=1)) -           # tmux create the new window for each pod -            tmux neww $COMMAND -n $POD 2>/dev/null +# 终止 Pod 循环 +done<<(<从 kubernetes 集群获取 Pod 和容器的列表>) -           # start a loop for all containers inside a running pod -        for CONTAINER in ${CONTAINERS//,/ } -        do - -        if [ x$POD = x -o x$CONTAINER = x ]; then -        # if any of the values is null, exit. -        warn "Looks like there is a problem getting pods data." -        break -        fi -            -            # set the command to execute -        COMMAND=”kubectl logs -f $POD -c $CONTAINER -n $NAMESPACE” -        # check tmux session -        if tmux has-session -t <session name> 2>/dev/null; -        then -        <set session exists> -        else -        <create session> -        fi - -           # split planes in the current window for each containers -        tmux selectp -t $n \; \ -        splitw $COMMAND \; \ -        select-layout tiled \; - -           # end loop for containers -        done - -           # rename the window to identify by pod name -        tmux renamew $POD 2>/dev/null -        -            # increment the counter -        ((n+=1)) - -# end loop for pods -done< <(<fetch list of pod and containers from kubernetes cluster>) - -# finally select the window and attach session - tmux selectw -t <session name>:1 \; \ -  attach-session -t <session name>\; +# 最后选择窗口并附加会话 +tmux selectw -t <会话名>:1 \; \ +attach-session -t <会话名>\; ``` -运行插件脚本后,它将在当前目录会生成一个同名的镜像。每个 pod 有一个窗口,每个容器(如果有多个)被分割成不同 pos 窗口,日志以数据流形式输出。 漂亮的tmux 如下;如果配置正确,你将会看到哪个窗口是否处于激活运行状态(可看到标签是白色的)。 +运行插件脚本后,将产生类似于下图的输出。每个 Pod 有一个自己的窗口,每个容器(如果有多个)被分割到其窗口中 Pod 窗格中,并在日志到达时输出。Tmux 之美如下可见;通过正确的配置,你甚至会看到哪个窗口正处于激活运行状态(可看到标签是白色的)。 ![kmux 插件的输出][8] ### 总结 -别名是在 Kubernetes 环境下常见的也有用的简易故障排查方法。当环境变得复杂,用高级脚本生成的kubectl 插件是一个很强大的方法。至于用哪个编程语言来编写 kubectl 插件是没有限制。唯一的要求是路径命名是可执行的,并且不能与已知的 kubectl 命令重复。 +别名是在 Kubernetes 环境下常见的也有用的简易故障排查方法。当环境变得复杂,用高级脚本生成的kubectl 插件是一个更强大的方法。至于用哪个编程语言来编写 kubectl 插件是没有限制。唯一的要求是该名字在路径中是可执行的,并且不能与已知的 kubectl 命令重复。 -为了阅读完整的插件源码,我们尝试创建了一个插件,请查看我的 [kube-plugins-github][7] 仓。欢迎提交问题和补丁。 +要阅读完整的插件源码,或试试我创建的插件,请查看我的 [kube-plugins-github][7] 存储库。欢迎提交提案和补丁。 -------------------------------------------------------------------------------- @@ -144,8 +141,8 @@ via: https://opensource.com/article/20/2/kubernetes-tmux-kubectl 作者:[Abhishek Tamrakar][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/guevaraya) -校对:[校对者ID](https://github.com/校对者ID) +译者:[guevaraya](https://github.com/guevaraya) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -158,4 +155,4 @@ via: https://opensource.com/article/20/2/kubernetes-tmux-kubectl [5]: https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/ [6]: https://opensource.com/article/19/6/tmux-terminal-joy [7]: https://github.com/abhiTamrakar/kube-plugins -[8]: https://opensource.com/sites/default/files/uploads/kmux-output.png (Output of kmux plugin) +[8]: https://raw.githubusercontent.com/abhiTamrakar/kube-plugins/master/kmux/kmux.png From c9a1f4480067ad4740d6902ce0a1b28645d95e2e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 25 Feb 2020 12:56:08 +0800 Subject: [PATCH 161/315] PUB @guevaraya https://linux.cn/article-11930-1.html --- ...ubleshoot Kubernetes with the power of tmux and kubectl.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md (99%) diff --git a/translated/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md b/published/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md similarity index 99% rename from translated/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md rename to published/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md index 1f5a4e3ff6..8fe0552828 100644 --- a/translated/tech/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md +++ b/published/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (guevaraya) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11930-1.html) [#]: subject: (Troubleshoot Kubernetes with the power of tmux and kubectl) [#]: via: (https://opensource.com/article/20/2/kubernetes-tmux-kubectl) [#]: author: (Abhishek Tamrakar https://opensource.com/users/tamrakar) From 00562ca93f610a4ef789f1335d887c1ab283ccad Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Tue, 25 Feb 2020 20:32:26 +0800 Subject: [PATCH 162/315] Update 20200219 How to find what you-re looking for on Linux with find.md --- ... How to find what you-re looking for on Linux with find.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200219 How to find what you-re looking for on Linux with find.md b/sources/tech/20200219 How to find what you-re looking for on Linux with find.md index 3b0aa3ed68..9bcb73d4e5 100644 --- a/sources/tech/20200219 How to find what you-re looking for on Linux with find.md +++ b/sources/tech/20200219 How to find what you-re looking for on Linux with find.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (heguangzhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -227,7 +227,7 @@ via: https://www.networkworld.com/article/3527420/how-to-find-what-you-re-lookin 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[heguangzhi](https://github.com/heguangzhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b57b53943fb09d9b239e1585d03418323ce65ea2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 25 Feb 2020 20:34:27 +0800 Subject: [PATCH 163/315] APL --- sources/tech/20200224 Using C and C-- for data science.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200224 Using C and C-- for data science.md b/sources/tech/20200224 Using C and C-- for data science.md index 10cdb5e59f..c4fda5ba68 100644 --- a/sources/tech/20200224 Using C and C-- for data science.md +++ b/sources/tech/20200224 Using C and C-- for data science.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 231361b91e3a567eda06a3cef10b843dfefdffa9 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 25 Feb 2020 22:39:49 +0800 Subject: [PATCH 164/315] translate done: 20200129 Use Emacs to get social and track your todo list.md --- ... to get social and track your todo list.md | 162 ----------------- ... to get social and track your todo list.md | 165 ++++++++++++++++++ 2 files changed, 165 insertions(+), 162 deletions(-) delete mode 100644 sources/tech/20200129 Use Emacs to get social and track your todo list.md create mode 100644 translated/tech/20200129 Use Emacs to get social and track your todo list.md diff --git a/sources/tech/20200129 Use Emacs to get social and track your todo list.md b/sources/tech/20200129 Use Emacs to get social and track your todo list.md deleted file mode 100644 index 097f1919a3..0000000000 --- a/sources/tech/20200129 Use Emacs to get social and track your todo list.md +++ /dev/null @@ -1,162 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lujun9972) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use Emacs to get social and track your todo list) -[#]: via: (https://opensource.com/article/20/1/emacs-social-track-todo-list) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Use Emacs to get social and track your todo list -====== -Access Twitter, Reddit, chat, email, RSS, and your todo list in the -nineteenth in our series on 20 ways to be more productive with open -source in 2020. -![Team communication, chat][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### Doing (almost) all the things with Emacs, part 2 - -[Yesterday][2], I talked about how to read email, access your addresses, and show calendars in Emacs. Emacs has tons and tons of functionality, and you can also use it for Twitter, chatting, to-do lists, and more! - -![All the things with Emacs][3] - -To do all of this, you need to install some Emacs packages. As you did yesterday, open the Emacs package manager with **Meta**+**x package-manager** (Meta is **Alt** on most keyboards or **Option** on MacOS). Now select the following packages with **i**, then install them by typing **x**: - - -``` -nnreddit -todotxt -twittering-mode -``` - -Once they are installed, open **~/.emacs.d/init.el** with **Ctrl**+**x Ctrl**+**x**, and add the following before the **(custom-set-variables** line: - - -``` -;; Todo.txt -(require 'todotxt) -(setq todotxt-file (expand-file-name "~/.todo/todo.txt")) - -;; Twitter -(require 'twittering-mode) -(setq twittering-use-master-password t) -(setq twittering-icon-mode t) - -;; Python3 for nnreddit -(setq elpy-rpc-python-command "python3") -``` - -Save the file with **Ctrl**+**x Ctrl**+**a**, exit Emacs with **Ctrl**+**x Ctrl**+**c**, then restart Emacs. - -#### Tweet from Emacs with twittering-mode - -![Twitter in Emacs][4] - -[Twittering-mode][5] is one of the best Emacs interfaces for Twitter. It supports almost all the features of Twitter and has some easy-to-use keyboard shortcuts. - -To get started, type **Meta**+**x twit** to launch twittering-mode. It will give a URL to open—and prompt you to launch a browser with it if you want—so you can log in and get an authorization token. Copy and paste the token into Emacs, and your Twitter timeline should load. You can scroll with the **Arrow** keys, use **Tab** to move from item to item, and press **Enter** to view the URL the cursor is on. If the cursor is on a username, pressing **Enter** will open that timeline in a web browser. If you are on a tweet's text, pressing **Enter** will reply to that tweet. You can create a new tweet with **u**, retweet something with **Ctrl**+**c**+**Enter**, and send a direct message with **d**—the dialog it opens has instructions on how to send, cancel, and shorten URLs. - -Pressing **V** will open a prompt to get to other timelines. To open your mentions, type **:mentions**. The home timeline is **:home**, and typing a username will take you to that user's timeline. Finally, pressing **q** will quit twittering-mode and close the window. - -There is a lot more functionality available in twittering-mode, and I encourage you to read the [full list][6] on its GitHub page. - -#### Track your to-do's in Emacs with Todotxt.el - -![todo.txt in emacs][7] - -[Todotxt.el][8] is a nice interface for the [todo.txt][9] to-do list manager. It has hotkeys for just about everything. - -To start it up, type **Meta**+**x todotxt**, and it will load the todo.txt file you specified in the **todotxt-file** variable (which you set in the first part of this article). Inside the buffer (window) for todo.txt, you can press **a** to add a new task and **c** to mark it complete. You can set priorities with **r**, and add projects and context to an item with **t**. When you are ready to move everything to **done.txt**, just press **A**. And you can filter the list with **/** or refresh back to the full list with **l**. And again, you can press **q** to exit. - -#### Chat in Emacs with ERC - -![Chatting with erc][10] - -One of Vim's shortcomings is that trying to use chat with it is difficult (at best). Emacs, on the other hand, has the [ERC][11] client built into the default distribution. Start ERC with **Meta**+**x erc**, and you will be prompted for a server name, username, and password. You can use the same information you used a few days ago when you set up [BitlBee][12]: server **localhost**, port **6667**, and the same username with no password. It should be the same as using almost any other IRC client. Each channel will be split into a new buffer (window), and you can switch between them with **Ctrl**+**x Ctrl**+**b**, which also switches between other buffers in Emacs. The **/quit** command will exit ERC. - -#### Read email, Reddit, and RSS feeds with Gnus - -![Mail, Reddit, and RSS feeds with Gnus][13] - -I'm sure many long-time Emacs users were asking, "but what about [Gnus][14]?" yesterday when I was talking about reading mail in Emacs. And it's a valid question. Gnus is a mail and newsreader built into Emacs, although it doesn't support [Notmuch][15] as a mail reader, just as a search engine. However, if you are configuring it for Reddit and RSS feeds (as you'll do in a moment), it's smart to add in mail functionality as well. - -Gnus was created for reading Usenet News and grew from there. So, a lot of its look and feel (and terminology) seem a lot like a Usenet newsreader. - -Gnus has its own configuration file in **~/.gnus** (the configuration can also be included in the main **~/.emacs.d/init.el**). Open **~/.gnus** with **Ctrl**+**x Ctrl**+**f** and add the following: - - -``` -;; Required packages -(require 'nnir) -(require 'nnrss) - -;; Primary Mailbox -(setq gnus-select-method -      '(nnmaildir "Local" -                  (directory "~/Maildir") -                  (nnir-search-engine notmuch) -      )) -(add-to-list 'gnus-secondary-select-methods -             '(nnreddit "")) -``` - -Save the file with **Ctrl**+**x Ctrl**+**s**. This tells Gnus to read mail from the local mailbox in **~/Maildir** as the primary source (**gnus-select-method**) and add a second source (**gnus-secondary-select-methods**) using the [nnreddit][16] plugin. You can also define multiple secondary sources, including Usenet News (nntp), IMAP (nnimap), mbox (nnmbox), and virtual collections (nnvirtual). You can learn more about all the options in the [Gnus manual][17]. - -Once you save the file, start Gnus with **Meta**+**x gnus**. The first run will install [Reddit Terminal Viewer][18] in a Python virtual environment, which is how it gets Reddit articles. It will then launch your browser to log into Reddit. After that, it will scan and load your subscribed Reddit groups. You will see a list of email folders with new mail and the list of subreddits with new content. Pressing **Enter** on any of them will load the list of messages for the group. You can navigate with the **Arrow** keys and press **Enter** to load and read a message. Pressing **q** will go back to the prior view when viewing message lists, and pressing **q** from the main window will exit Gnus. When reading a Reddit group, **a** creates a new message; in a mail group, **m** creates a new email; and **r** replies to messages in either view. - -You can also add RSS feeds to the Gnus interface and read them like mail and newsgroups. To add an RSS feed, type **G**+**R** and fill in the RSS feed's URL. You will be prompted for the title and description of the feed, which should be auto-filled from the feed. Now type **g** to check for new messages (this checks for new messages in all groups). Reading a feed is like reading Reddit groups and mail, so it uses the same keys. - -There is a _lot_ of functionality in Gnus, and there are a whole lot more key combinations. The [Gnus Reference Card][19] lists all of them for each view (on five pages in very small type). - -#### See your position with nyan-mode - -As a final note, you might notice [Nyan cat][20] at the bottom of some of my screenshots. This is [nyan-mode][21], which indicates where you are in a buffer, so it gets longer as you get closer to the bottom of a document or buffer. You can install it with the package manager and set it up with the following code in **~/.emacs.d/init.el**: - - -``` -;; Nyan Cat -(setq nyan-wavy-trail t) -(setq nyan-bar-length 20) -(nyan-mode) -``` - -### Scratching Emacs' surface - -This is just scratching the surface of all the things you can do with Emacs. It is _very_ powerful, and it is one of my go-to tools for being productive whether I'm tracking to-dos, reading and responding to mail, editing text, or chatting with my friends and co-workers. It takes a bit of getting used to, but once you do, it can become one of the most useful tools on your desktop. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/emacs-social-track-todo-list - -作者:[Kevin Sonney][a] -选题:[lujun9972][b] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) -[2]: https://opensource.com/article/20/1/emacs-mail-calendar -[3]: https://opensource.com/sites/default/files/uploads/productivity_19-1.png (All the things with Emacs) -[4]: https://opensource.com/sites/default/files/uploads/productivity_19-2.png (Twitter in Emacs) -[5]: https://github.com/hayamiz/twittering-mode -[6]: https://github.com/hayamiz/twittering-mode#features -[7]: https://opensource.com/sites/default/files/uploads/productivity_19-3.png (todo.txt in emacs) -[8]: https://github.com/rpdillon/todotxt.el -[9]: http://todotxt.org/ -[10]: https://opensource.com/sites/default/files/uploads/productivity_19-4.png (Chatting with erc) -[11]: https://www.gnu.org/software/emacs/manual/html_mono/erc.html -[12]: https://opensource.com/article/20/1/open-source-chat-tool -[13]: https://opensource.com/sites/default/files/uploads/productivity_19-5.png (Mail, Reddit, and RSS feeds with Gnus) -[14]: https://www.gnus.org/ -[15]: https://opensource.com/article/20/1/organize-email-notmuch -[16]: https://github.com/dickmao/nnreddit -[17]: https://www.gnus.org/manual/gnus.html -[18]: https://pypi.org/project/rtv/ -[19]: https://www.gnu.org/software/emacs/refcards/pdf/gnus-refcard.pdf -[20]: http://www.nyan.cat/ -[21]: https://github.com/TeMPOraL/nyan-mode diff --git a/translated/tech/20200129 Use Emacs to get social and track your todo list.md b/translated/tech/20200129 Use Emacs to get social and track your todo list.md new file mode 100644 index 0000000000..fff71fcc19 --- /dev/null +++ b/translated/tech/20200129 Use Emacs to get social and track your todo list.md @@ -0,0 +1,165 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Emacs to get social and track your todo list) +[#]: via: (https://opensource.com/article/20/1/emacs-social-track-todo-list) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +使用 Emacs 进行社交并跟踪你的待办事项列表 +====== +访问 Twitter、Reddit、 交谈、电子邮件 、RSS 和你的待办事项列表,这是我们关于 2020 年使用开源提高效率的 20 个方法系列的第 19 个。 +![团队沟通、交谈 ][1] + +去年,我给你们带来了 2019 年的 19 天新生产力工具。今年,我将采取一种不同的方法:建立一个新的环境,让你使用已用或未用的工具在新的一年里更有效率,。 + +### 使用 Emacs 做(几乎)所有的事情,第 2 部分 + +[昨天 ][2],我谈到了如何在 Emacs 中读取电子邮件、访问电子邮件地址和显示日历。Emacs 功能繁多,你还可以将它用于 Twitter、 交谈、待办事项列表等等! + +[在 Emacs 中处理所有事情 ][3] + +要完成所有这些,您需要安装一些 Emacs 包。和昨天一样,用 `Meta+x package-manager` 打开 Emacs 包管理器 (Meta 在大多数键盘上是 **Alt**,在 MacOS 上是 **Option**)。然后通过 **i** 选择以下带有的软件包,然后输入 **x** 进行安装: + + +``` +nnreddit +todotxt +twittering-mode +``` + +安装之后,按下 `Ctrl+x ctrl+f` 打开 `~/.emacs.d/init.el`,并在 `(custom-set-variables` 行前加上: + + +``` +;; Todo.txt +(require 'todotxt) +(setq todotxt-file (expand-file-name "~/.todo/todo.txt")) + +;; Twitter +(require 'twittering-mode) +(setq twittering-use-master-password t) +(setq twittering-icon-mode t) + +;; Python3 for nnreddit +(setq elpy-rpc-python-command "python3") +``` + +按下 `Ctrl+x Ctrl+s` 保存文件,使用 `Ctrl+x Ctrl+c` 退出 Emacs,然后重启 Emacs。 + +#### 使用 twittering-mode 在 Emacs 中发推 + +![Emacs 中的 Twitter][4] + +[Twittering-mode][5] 是 Twitter 最好的 Emacs 接口之一。它几乎支持 Twitter 的所有功能,并且键盘快捷键也易于使用。 + +首先,输入 `Meta+x twit` 来启动 twitter-mode。它会提供一个 URL 并提示你启动浏览器来访问它,你登录该 URL 后就能获得授权令牌。将令牌复制并粘贴到 Emacs 中,您的 Twitter 时间线就会加载了。您可以使用**箭头**键滚动,使用 **Tab** 从一个项目移动到另一个项目,并按 **Enter** 访问光标所在的 URL。如果光标在用户名上,按 **Enter** 将在 web 浏览器中打开时间轴。如果你在一条 tweet 的文本上,按 **Enter** 将回复该 tweet。你可以用 **u** 创建一个新的 tweet,用 `Ctrl+c+Enter` 转发一些内容,然后用 **d** 发送一条直接消息——它打开的对话框中有关于如何发送、取消和缩短 url 的说明。 + +按 **V** 会打开一个提示让你跳转到其他时间线。输入 **:mentions** 打开你的提及。输入 **:home** 打开你的主时间线,输入用户名将进入该用户的时间线。最后,按 **q** 会退出 twittering-mode 并关闭窗口。 + +twitter-mode 还有更多功能,我鼓励你阅读它 GitHub 页面上的[完整功能列表 ][6]。 + +#### 在 Emacs 上使用 Todotxt.el 追踪你的待办事项 + +![Emacs 中的 todo.txt][7] + +[Todotxt.el][8] 是一个很棒的 [todo.txt][9] 待办列表管理器接口。它的快捷键几乎无所不包。 + +输入 `Meta+x todotxt` 启动它将加载 **todotxt-file** 变量中指定的 todo.txt 文件(本文的第一部分中设置了该文件)。 +在 todo.txt 的缓冲区(窗口*,您可以按 **a** 添加新任务并和按 **c** 标记它已被完成。你还可以使用 **r** 设置优先级,并使用 **t** 添加项目和上下文。 +完成事项后只需要按下 **A** 即可将任务移如 **done.txt**。你可以使用**/**过滤列表,也可以使用 **l** 刷新完整列表。同样,您可以按 **q** 退出。 + +#### 在 Emacs 中使用 ERC 进行交谈 + +![使用 ERC 与人交谈 ][10] + +Vim 的缺点之一是很难用它与人交谈。另一方面,Emacs 则将 [ERC][11] 客户端内置到默认发行版中。使用 `Meta+x ERC` 启动 ERC,系统将提示您输入服务器、用户名和密码。你可以使用几天前介绍设置 [BitlBee][12] 时使用的相同信息:服务器为 **localhost**,端口为 **6667**,相同用户名,无需密码。 +ERC 使用起来与其他 IRC 客户端一样。每个频道单独一个缓冲区(窗口),您可以使用 `Ctrl+x ctrl+b` 进行频道间切换,这也可以在 Emacs 中的其他缓冲区之间进行切换。`/quit` 命令将退出 ERC。 + +#### 使用 Gnus 阅读电子邮件,Reddit 和 RSS + +![Mail,Reddit,and RSS feeds with Gnus][13] + +我相信昨天在我提及在 Emacs 中阅读邮件时,许多 Emacs 的老用户会问,“怎么没有 [Gnus][14] 呢?” +这个疑问很合理。Gnus 是一个内置在 Emacs 中的邮件和新闻阅读器,尽管它这个邮件阅读器不支持以 [Notmuch][15] 作为搜索引擎。但是,如果你将其配置来阅读 Reddit 和 RSS feed( 稍后您将这样做),那么同时使用它来阅读邮件是个聪明的选择。 + +Gnus 是为阅读 Usenet 新闻而创建的,并从此发展而来。因此,它的很多外观和感觉(以及术语)看起来很像 Usenet 的新闻阅读器。 + +Gnus 以 `~/.gnus` 作为自己的配置文件。(该配置也可以包含在 `~/.emacs.d/init.el` 中)。使用 `Ctrl+x Ctrl+f` 打开 `~/.gnus`,并添加以下内容: + + +``` +;; Required packages +(require 'nnir) +(require 'nnrss) + +;; Primary Mailbox +(setq gnus-select-method +      '(nnmaildir "Local" +                  (directory "~/Maildir") +                  (nnir-search-engine notmuch) +      )) +(add-to-list 'gnus-secondary-select-methods +             '(nnreddit "")) +``` + +用 `Ctrl+x Ctrl+s` 保存文件。这分配置告诉 Gnus 从 `~/Maildir` 这个本地邮箱中读取邮件作为主源(参见 **gnus-select-method** 变量),并使用 [nnreddit][16] 插件添加辅源 (**gnus-secondary-select-methods** 变量)。你还可以定义多个辅助源,包括 Usenet 新闻 (nntp)、IMAP (nnimap)、mbox (nnmbox) 和虚拟集合 (nnvirtual)。您可以在 [Gnus 手册 ][17] 中了解更多有关所有选项的信息。 + +保存文件后,使用 `Meta+x Gnus` 启动 Gnus。第一次运行将在 Python 虚拟环境中安装 [Reddit 终端查看器 ][18],Gnus 通过它获取 Reddit 上的文章。然后它会启动浏览器来登录 Reddit。之后,它会扫描并加载你订阅的 Reddit 群组。你会看到一个有新邮件的邮件夹列表和一个有新内容的看板列表。在任一列表上按 **Enter** 将加载该组中的消息列表。您可以使用**箭头**键导航并按 **Enter** 加载和读取消息。在查看消息列表时,按 **q** 将返回到前一个视图,从主窗口按 **q** 将退出 Gnus。在阅读 Reddit 群组时,**a** 会创建一条新消息;在邮件组中,**m** 创建一个新的电子邮件;并且在任何一个视图中按 **r** 回复邮件。 + +您还可以向 Gnus 接口中添加 RSS feed,并像阅读邮件和新闻组一样阅读它们。要添加 RSS feed,输入 `G+R` 并填写 RSS feed 的 URL。会有提示让你输入 feed 的标题和描述,这些信息可以从 feed 中提取出来并填充进去。现在输入 **g** 来检查新消息(这将检查所有组中的新消息)。阅读 feed 就像阅读 Reddit 群组和邮件一样,它们使用相同的快捷键。 + +Gnus 中有_很多_功能,还有大量的键组合。[Gnus 参考卡 ][19] 为每个视图列出了所有这些键组合(以非常小的字体显示在 5 页纸上)。 + +#### 使用 nyan-mode 查看位置 + +As a final note,you might notice [Nyan cat][20] at the bottom of some of my screenshots。This is [nyan-mode][21],which indicates where you are in a buffer,so it gets longer as you get closer to the bottom of a document or buffer。You can install it with the package manager and set it up with the following code in **~/.emacs.d/init.el**: +最后,你可能会一些截屏底部注意到 [Nyan cat][20]。这是 [nyan-mode][21],它指示了你在缓冲区中的位置,因此当您接近文档或缓冲区的底部时,它会变长。您可以使用包管理器安装它,并在 `~/.emacs.d/init.el` 中使用以下代码进行设置: + + +``` +;; Nyan Cat +(setq nyan-wavy-trail t) +(setq nyan-bar-length 20) +(nyan-mode) +``` + +### Emacs 的皮毛 + +这只是 Emacs 所有功能的皮毛。Emacs_ 非常_强大,是我用来提高工作效率的必要工具之一,无论我是在追踪待办事项、阅读和回复邮件、编辑文本,还是与朋友和同事交流我都用它。这需要一点时间来适应,但是一旦你习惯了,它就会成为你桌面上最有用的工具之一。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/emacs-social-track-todo-list + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) +[2]: https://opensource.com/article/20/1/emacs-mail-calendar +[3]: https://opensource.com/sites/default/files/uploads/productivity_19-1.png (All the things with Emacs) +[4]: https://opensource.com/sites/default/files/uploads/productivity_19-2.png (Twitter in Emacs) +[5]: https://github.com/hayamiz/twittering-mode +[6]: https://github.com/hayamiz/twittering-mode#features +[7]: https://opensource.com/sites/default/files/uploads/productivity_19-3.png (todo.txt in emacs) +[8]: https://github.com/rpdillon/todotxt.el +[9]: http://todotxt.org/ +[10]: https://opensource.com/sites/default/files/uploads/productivity_19-4.png (Chatting with erc) +[11]: https://www.gnu.org/software/emacs/manual/html_mono/erc.html +[12]: https://opensource.com/article/20/1/open-source-chat-tool +[13]: https://opensource.com/sites/default/files/uploads/productivity_19-5.png (Mail, Reddit, and RSS feeds with Gnus) +[14]: https://www.gnus.org/ +[15]: https://opensource.com/article/20/1/organize-email-notmuch +[16]: https://github.com/dickmao/nnreddit +[17]: https://www.gnus.org/manual/gnus.html +[18]: https://pypi.org/project/rtv/ +[19]: https://www.gnu.org/software/emacs/refcards/pdf/gnus-refcard.pdf +[20]: http://www.nyan.cat/ +[21]: https://github.com/TeMPOraL/nyan-mode From 7eee3a2aee70e1ee8649dbd75948437a32c2fda9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 25 Feb 2020 23:22:50 +0800 Subject: [PATCH 165/315] TSL PART 1 --- ...200224 Using C and C-- for data science.md | 747 ------------------ ...200224 Using C and C-- for data science.md | 525 ++++++++++++ 2 files changed, 525 insertions(+), 747 deletions(-) delete mode 100644 sources/tech/20200224 Using C and C-- for data science.md create mode 100644 translated/tech/20200224 Using C and C-- for data science.md diff --git a/sources/tech/20200224 Using C and C-- for data science.md b/sources/tech/20200224 Using C and C-- for data science.md deleted file mode 100644 index c4fda5ba68..0000000000 --- a/sources/tech/20200224 Using C and C-- for data science.md +++ /dev/null @@ -1,747 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using C and C++ for data science) -[#]: via: (https://opensource.com/article/20/2/c-data-science) -[#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) - -Using C and C++ for data science -====== -Let's work through common data science task with C99 and C++11. -![metrics and data shown on a computer screen][1] - -While languages like [Python][2] and [R][3] are increasingly popular for data science, C and C++ can be a strong choice for efficient and effective data science. In this article, we will use [C99][4] and [C++11][5] to write a program that uses the [Anscombe’s quartet][6] dataset, which I'll explain about next. - -I wrote about my motivation for continually learning languages in an article covering [Python and GNU Octave][7], which is worth reviewing. All of the programs are meant to be run on the [command line][8], not with a [graphical user interface][9] (GUI). The full examples are available in the [polyglot_fit repository][10]. - -### The programming task - -The program you will write in this series: - - * Reads data from a [CSV file][11] - * Interpolates the data with a straight line (i.e., _f(x)=m ⋅ x + q_) - * Plots the result to an image file - - - -This is a common situation that many data scientists have encountered. The example data is the first set of [Anscombe's quartet][6], shown in the table below. This is a set of artificially constructed data that gives the same results when fitted with a straight line, but their plots are very different. The data file is a text file with tabs as column separators and a few lines as a header. This task will use only the first set (i.e., the first two columns). - -[**Anscombe's quartet**][6] - -I - -II - -III - -IV - -x - -y - -x - -y - -x - -y - -x - -y - -10.0 - -8.04 - -10.0 - -9.14 - -10.0 - -7.46 - -8.0 - -6.58 - -8.0 - -6.95 - -8.0 - -8.14 - -8.0 - -6.77 - -8.0 - -5.76 - -13.0 - -7.58 - -13.0 - -8.74 - -13.0 - -12.74 - -8.0 - -7.71 - -9.0 - -8.81 - -9.0 - -8.77 - -9.0 - -7.11 - -8.0 - -8.84 - -11.0 - -8.33 - -11.0 - -9.26 - -11.0 - -7.81 - -8.0 - -8.47 - -14.0 - -9.96 - -14.0 - -8.10 - -14.0 - -8.84 - -8.0 - -7.04 - -6.0 - -7.24 - -6.0 - -6.13 - -6.0 - -6.08 - -8.0 - -5.25 - -4.0 - -4.26 - -4.0 - -3.10 - -4.0 - -5.39 - -19.0 - -12.50 - -12.0 - -10.84 - -12.0 - -9.13 - -12.0 - -8.15 - -8.0 - -5.56 - -7.0 - -4.82 - -7.0 - -7.26 - -7.0 - -6.42 - -8.0 - -7.91 - -5.0 - -5.68 - -5.0 - -4.74 - -5.0 - -5.73 - -8.0 - -6.89 - -### The C way - -[C][12] is a general-purpose programming language that is among the most popular languages in use today (according to data from the [TIOBE Index][13], [RedMonk Programming Language Rankings][14], [Popularity of Programming Language Index][15], and [State of the Octoverse of GitHub][16]). It is a quite old language (circa 1973), and many successful programs were written in it (e.g., the Linux kernel and Git to name just two). It is also one of the closest languages to the inner workings of the computer, as it is used to manipulate memory directly. It is a [compiled language][17]; therefore, the source code has to be translated by a [compiler][18] into [machine code][19]. Its [standard library][20] is small and light on features, so other libraries have been developed to provide missing functionalities. - -It is the language I use the most for [number crunching][21], mostly because of its performance. I find it rather tedious to use, as it needs a lot of [boilerplate code][22], but it is well supported in various environments. The C99 standard is a recent revision that adds some nifty features and is well supported by compilers. - -I will cover the necessary background of C and C++ programming along the way so both beginners and advanced users can follow along.   - -#### Installation - -To develop with C99, you need a compiler. I normally use [Clang][23], but [GCC][24] is another valid open source compiler. For linear fitting, I chose to use the [GNU Scientific Library][25]. For plotting, I could not find any sensible library, and therefore this program relies on an external program: [Gnuplot][26]. The example also uses a dynamic data structure to store data, which is defined in the [Berkeley Software Distribution][27] (BSD). - -Installing in [Fedora][28] is as easy as running: - - -``` -`sudo dnf install clang gnuplot gsl gsl-devel` -``` - -#### Commenting code - -In C99, [comments][29] are formatted by putting **//** at the beginning of the line, and the rest of the line will be discarded by the interpreter. Alternatively, anything between **/*** and ***/** is discarded, as well. - - -``` -// This is a comment ignored by the interpreter. -/* Also this is ignored */ -``` - -#### Necessary libraries - -Libraries are composed of two parts: - - * A [header file][30] that contains a description of the functions - * A source file that contains the functions' definitions - - - -Header files are included in the source, while the libraries' sources are [linked][31] against the executable. Therefore, the header files needed for this example are: - - -``` -// Input/Output utilities -#include <stdio.h> -// The standard library -#include <stdlib.h> -// String manipulation utilities -#include <string.h> -// BSD queue -#include <sys/queue.h> -// GSL scientific utilities -#include <gsl/gsl_fit.h> -#include <gsl/gsl_statistics_double.h> -``` - -#### Main function - -In C, the program must be inside a special function called **[main()][32]:** - - -``` -int main(void) { -    ... -} -``` - -This differs from Python, as covered in the last tutorial, which will run whatever code it finds in the source files. - -#### Defining variables - -In C, variables have to be declared before they are used, and they have to be associated with a type. Whenever you want to use a variable, you have to decide what kind of data to store in it. You can also specify if you intend to use a variable as a constant value, which is not necessary, but the compiler can benefit from this information. From the [fitting_C99.c program][33] in the repository: - - -``` -const char *input_file_name = "anscombe.csv"; -const char *delimiter = "\t"; -const unsigned int skip_header = 3; -const unsigned int column_x = 0; -const unsigned int column_y = 1; -const char *output_file_name = "fit_C99.csv"; -const unsigned int N = 100; -``` - -Arrays in C are not dynamic, in the sense that their length has to be decided in advance (i.e., before compilation): - - -``` -`int data_array[1024];` -``` - -Since you normally do not know how many data points are in a file, use a [singly linked list][34]. This is a dynamic data structure that can grow indefinitely. Luckily, the BSD [provides linked lists][35]. Here is an example definition: - - -``` -struct data_point { -    double x; -    double y; - -    SLIST_ENTRY(data_point) entries; -}; - -SLIST_HEAD(data_list, data_point) head = SLIST_HEAD_INITIALIZER(head); -SLIST_INIT(&head); -``` - -This example defines a **data_point** list comprised of structured values that contain both an **x** value and a **y** value. The syntax is rather complicated but intuitive, and describing it in detail would be too wordy. - -#### Printing output - -To print on the terminal, you can use the [**printf()**][36] function, which works like Octave's **printf()** function (described in the first article): - - -``` -`printf("#### Anscombe's first set with C99 ####\n");` -``` - -The **printf()** function does not automatically add a newline at the end of the printed string, so you have to add it. The first argument is a string that can contain format information for the other arguments that can be passed to the function, such as: - - -``` -`printf("Slope: %f\n", slope);` -``` - -#### Reading data - -Now comes the hard part… There are some libraries for CSV file parsing in C, but none seemed stable or popular enough to be in the Fedora packages repository. Instead of adding a dependency for this tutorial, I decided to write this part on my own. Again, going into details would be too wordy, so I will only explain the general idea. Some lines in the source will be ignored for the sake of brevity, but you can find the complete example in the repository. - -First, open the input file: - - -``` -`FILE* input_file = fopen(input_file_name, "r");` -``` - -Then read the file line-by-line until there is an error or the file ends: - - -``` -while (![ferror][37](input_file) && ![feof][38](input_file)) { -    size_t buffer_size = 0; -    char *buffer = NULL; -    -    getline(&buffer, &buffer_size, input_file); - -    ... -} -``` - -The [**getline()**][39] function is a nice recent addition from the [POSIX.1-2008 standard][40]. It can read a whole line in a file and take care of allocating the necessary memory. Each line is then split into [tokens][41] with the [**strtok()**][42] function. Looping over the token, select the columns that you want: - - -``` -char *token = [strtok][43](buffer, delimiter); - -while (token != NULL) -{ -    double value; -    [sscanf][44](token, "%lf", &value); - -    if (column == column_x) { -        x = value; -    } else if (column == column_y) { -        y = value; -    } - -    column += 1; -    token = [strtok][43](NULL, delimiter); -} -``` - -Finally, when the **x** and **y** values are selected, insert the new data point in the linked list: - - -``` -struct data_point *datum = [malloc][45](sizeof(struct data_point)); -datum->x = x; -datum->y = y; - -SLIST_INSERT_HEAD(&head, datum, entries); -``` - -The [**malloc()**][46] function dynamically allocates (reserves) some persistent memory for the new data point. - -#### Fitting data - -The GSL linear fitting function [**gsl_fit_linear()**][47] expects simple arrays for its input. Therefore, since you won't know in advance the size of the arrays you create, you must manually allocate their memory: - - -``` -const size_t entries_number = row - skip_header - 1; - -double *x = [malloc][45](sizeof(double) * entries_number); -double *y = [malloc][45](sizeof(double) * entries_number); -``` - -Then, loop over the linked list to save the relevant data to the arrays: - - -``` -SLIST_FOREACH(datum, &head, entries) { -    const double current_x = datum->x; -    const double current_y = datum->y; - -    x[i] = current_x; -    y[i] = current_y; - -    i += 1; -} -``` - -Now that you are done with the linked list, clean it up. _Always_ release the memory that has been manually allocated to prevent a [memory leak][48]. Memory leaks are bad, bad, bad. Every time memory is not released, a garden gnome loses its head: - - -``` -while (!SLIST_EMPTY(&head)) { -    struct data_point *datum = SLIST_FIRST(&head); - -    SLIST_REMOVE_HEAD(&head, entries); - -    [free][49](datum); -} -``` - -Finally, finally(!), you can fit your data: - - -``` -gsl_fit_linear(x, 1, y, 1, entries_number, -               &intercept, &slope, -               &cov00, &cov01, &cov11, &chi_squared); -const double r_value = gsl_stats_correlation(x, 1, y, 1, entries_number); - -[printf][50]("Slope: %f\n", slope); -[printf][50]("Intercept: %f\n", intercept); -[printf][50]("Correlation coefficient: %f\n", r_value); -``` - -#### Plotting - -You must use an external program for the plotting. Therefore, save the fitting function to an external file: - - -``` -const double step_x = ((max_x + 1) - (min_x - 1)) / N; - -for (unsigned int i = 0; i < N; i += 1) { -    const double current_x = (min_x - 1) + step_x * i; -    const double current_y = intercept + slope * current_x; - -    [fprintf][51](output_file, "%f\t%f\n", current_x, current_y); -} -``` - -The Gnuplot command for plotting both files is: - - -``` -`plot 'fit_C99.csv' using 1:2 with lines title 'Fit', 'anscombe.csv' using 1:2 with points pointtype 7 title 'Data'` -``` - -#### Results - -Before running the program, you must compile it: - - -``` -`clang -std=c99 -I/usr/include/ fitting_C99.c -L/usr/lib/ -L/usr/lib64/ -lgsl -lgslcblas -o fitting_C99` -``` - -This command tells the compiler to use the C99 standard, read the **fitting_C99.c** file, load the libraries **gsl** and **gslcblas**, and save the result to **fitting_C99**. The resulting output on the command line is: - - -``` -#### Anscombe's first set with C99 #### -Slope: 0.500091 -Intercept: 3.000091 -Correlation coefficient: 0.816421 -``` - -Here is the resulting image generated with Gnuplot. - -![Plot and fit of the dataset obtained with C99][52] - -### The C++11 way - -[C++][53] is a general-purpose programming language that is also among the most popular languages in use today. It was created as a [successor of C][54] (in 1983) with an emphasis on [object-oriented programming][55] (OOP). C++ is commonly regarded as a superset of C, so a C program should be able to be compiled with a C++ compiler. This is not exactly true, as there are some corner cases where they behave differently. In my experience, C++ needs less boilerplate than C, but the syntax is more difficult if you want to develop objects. The C++11 standard is a recent revision that adds some nifty features and is more or less supported by compilers. - -Since C++ is largely compatible with C, I will just highlight the differences between the two. If I do not cover a section in this part, it means that it is the same as in C. - -#### Installation - -The dependencies for the C++ example are the same as the C example. On Fedora, run: - - -``` -`sudo dnf install clang gnuplot gsl gsl-devel` -``` - -#### Necessary libraries - -Libraries work in the same way as in C, but the **include** directives are slightly different: - - -``` -#include <cstdlib> -#include <cstring> -#include <iostream> -#include <fstream> -#include <string> -#include <vector> -#include <algorithm> - -extern "C" { -#include <gsl/gsl_fit.h> -#include <gsl/gsl_statistics_double.h> -} -``` - -Since the GSL libraries are written in C, you must inform the compiler about this peculiarity. - -#### Defining variables - -C++ supports more data types (classes) than C, such as a **string** type that has many more features than its C counterpart. Update the definition of the variables accordingly: - - -``` -`const std::string input_file_name("anscombe.csv");` -``` - -For structured objects like strings, you can define the variable without using the **=** sign. - -#### Printing output - -You can use the **printf()** function, but the **cout** object is more idiomatic. Use the operator **<<** to indicate the string (or objects) that you want to print with **cout**: - - -``` -std::cout << "#### Anscombe's first set with C++11 ####" << std::endl; - -... - -std::cout << "Slope: " << slope << std::endl; -std::cout << "Intercept: " << intercept << std::endl; -std::cout << "Correlation coefficient: " << r_value << std::endl; -``` - -#### Reading data - -The scheme is the same as before. The file is opened and read line-by-line, but with a different syntax: - - -``` -std::ifstream input_file(input_file_name); - -while (input_file.good()) { -    std::string line; - -    getline(input_file, line); - -    ... -} -``` - -The line tokens are extracted with the same function as in the C99 example. Instead of using standard C arrays, use two [vectors][56]. Vectors are an extension of C arrays in the [C++ standard library][57] that allows dynamic management of memory without explicitly calling **malloc()**: - - -``` -std::vector<double> x; -std::vector<double> y; - -// Adding an element to x and y: -x.emplace_back(value); -y.emplace_back(value); -``` - -#### Fitting data - -For fitting in C++, you do not have to loop over the list, as vectors are guaranteed to have contiguous memory. You can directly pass to the fitting function the pointers to the vectors buffers: - - -``` -gsl_fit_linear(x.data(), 1, y.data(), 1, entries_number, -               &intercept, &slope, -               &cov00, &cov01, &cov11, &chi_squared); -const double r_value = gsl_stats_correlation(x.data(), 1, y.data(), 1, entries_number); - -std::cout << "Slope: " << slope << std::endl; -std::cout << "Intercept: " << intercept << std::endl; -std::cout << "Correlation coefficient: " << r_value << std::endl; -``` - -#### Plotting - -Plotting is done with the same approach as before. Write to a file: - - -``` -const double step_x = ((max_x + 1) - (min_x - 1)) / N; - -for (unsigned int i = 0; i < N; i += 1) { -    const double current_x = (min_x - 1) + step_x * i; -    const double current_y = intercept + slope * current_x; - -    output_file << current_x << "\t" << current_y << std::endl; -} - -output_file.close(); -``` - -And then use Gnuplot for the plotting. - -#### Results - -Before running the program, it must be compiled with a similar command: - - -``` -`clang++ -std=c++11 -I/usr/include/ fitting_Cpp11.cpp -L/usr/lib/ -L/usr/lib64/ -lgsl -lgslcblas -o fitting_Cpp11` -``` - -The resulting output on the command line is: - - -``` -#### Anscombe's first set with C++11 #### -Slope: 0.500091 -Intercept: 3.00009 -Correlation coefficient: 0.816421 -``` - -And this is the resulting image generated with Gnuplot. - -![Plot and fit of the dataset obtained with C++11][58] - -### Conclusion - -This article provides examples for a data fitting and plotting task in C99 and C++11. Since C++ is largely compatible with C, this article exploited their similarities for writing the second example. In some aspects, C++ is easier to use because it partially relieves the burden of explicitly managing memory. But the syntax is more complex because it introduces the possibility of writing classes for OOP. However, it is still possible to write software in C with the OOP approach. Since OOP is a style of programming, it can be used in any language. There are some great examples of OOP in C, such as the [GObject][59] and [Jansson][60] libraries. - -For number crunching, I prefer working in C99 due to its simpler syntax and widespread support. Until recently, C++11 was not as widely supported, and I tended to avoid the rough edges in the previous versions. For more complex software, C++ could be a good choice. - -Do you use C or C++ for data science as well? Share your experiences in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/c-data-science - -作者:[Cristiano L. Fontana][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/cristianofontana -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) -[2]: https://opensource.com/article/18/9/top-3-python-libraries-data-science -[3]: https://opensource.com/article/19/5/learn-python-r-data-science -[4]: https://en.wikipedia.org/wiki/C99 -[5]: https://en.wikipedia.org/wiki/C%2B%2B11 -[6]: https://en.wikipedia.org/wiki/Anscombe%27s_quartet -[7]: https://opensource.com/article/20/2/python-gnu-octave-data-science -[8]: https://en.wikipedia.org/wiki/Command-line_interface -[9]: https://en.wikipedia.org/wiki/Graphical_user_interface -[10]: https://gitlab.com/cristiano.fontana/polyglot_fit -[11]: https://en.wikipedia.org/wiki/Comma-separated_values -[12]: https://en.wikipedia.org/wiki/C_%28programming_language%29 -[13]: https://www.tiobe.com/tiobe-index/ -[14]: https://redmonk.com/sogrady/2019/07/18/language-rankings-6-19/ -[15]: http://pypl.github.io/PYPL.html -[16]: https://octoverse.github.com/ -[17]: https://en.wikipedia.org/wiki/Compiled_language -[18]: https://en.wikipedia.org/wiki/Compiler -[19]: https://en.wikipedia.org/wiki/Machine_code -[20]: https://en.wikipedia.org/wiki/C_standard_library -[21]: https://en.wiktionary.org/wiki/number-crunching -[22]: https://en.wikipedia.org/wiki/Boilerplate_code -[23]: https://clang.llvm.org/ -[24]: https://gcc.gnu.org/ -[25]: https://www.gnu.org/software/gsl/ -[26]: http://www.gnuplot.info/ -[27]: https://en.wikipedia.org/wiki/Berkeley_Software_Distribution -[28]: https://getfedora.org/ -[29]: https://en.wikipedia.org/wiki/Comment_(computer_programming) -[30]: https://en.wikipedia.org/wiki/Include_directive -[31]: https://en.wikipedia.org/wiki/Linker_%28computing%29 -[32]: https://en.wikipedia.org/wiki/Entry_point#C_and_C++ -[33]: https://gitlab.com/cristiano.fontana/polyglot_fit/-/blob/master/fitting_C99.c -[34]: https://en.wikipedia.org/wiki/Linked_list#Singly_linked_list -[35]: http://man7.org/linux/man-pages/man3/queue.3.html -[36]: https://en.wikipedia.org/wiki/Printf_format_string -[37]: http://www.opengroup.org/onlinepubs/009695399/functions/ferror.html -[38]: http://www.opengroup.org/onlinepubs/009695399/functions/feof.html -[39]: http://man7.org/linux/man-pages/man3/getline.3.html -[40]: https://en.wikipedia.org/wiki/POSIX -[41]: https://en.wikipedia.org/wiki/Lexical_analysis#Token -[42]: http://man7.org/linux/man-pages/man3/strtok.3.html -[43]: http://www.opengroup.org/onlinepubs/009695399/functions/strtok.html -[44]: http://www.opengroup.org/onlinepubs/009695399/functions/sscanf.html -[45]: http://www.opengroup.org/onlinepubs/009695399/functions/malloc.html -[46]: http://man7.org/linux/man-pages/man3/malloc.3.html -[47]: https://www.gnu.org/software/gsl/doc/html/lls.html -[48]: https://en.wikipedia.org/wiki/Memory_leak -[49]: http://www.opengroup.org/onlinepubs/009695399/functions/free.html -[50]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html -[51]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html -[52]: https://opensource.com/sites/default/files/uploads/fit_c99.png (Plot and fit of the dataset obtained with C99) -[53]: https://en.wikipedia.org/wiki/C%2B%2B -[54]: http://www.cplusplus.com/info/history/ -[55]: https://en.wikipedia.org/wiki/Object-oriented_programming -[56]: https://en.wikipedia.org/wiki/Sequence_container_%28C%2B%2B%29#Vector -[57]: https://en.wikipedia.org/wiki/C%2B%2B_Standard_Library -[58]: https://opensource.com/sites/default/files/uploads/fit_cpp11.png (Plot and fit of the dataset obtained with C++11) -[59]: https://en.wikipedia.org/wiki/GObject -[60]: http://www.digip.org/jansson/ diff --git a/translated/tech/20200224 Using C and C-- for data science.md b/translated/tech/20200224 Using C and C-- for data science.md new file mode 100644 index 0000000000..26dab50b03 --- /dev/null +++ b/translated/tech/20200224 Using C and C-- for data science.md @@ -0,0 +1,525 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using C and C++ for data science) +[#]: via: (https://opensource.com/article/20/2/c-data-science) +[#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) + +在数据科学中使用 C 和 C++ +====== + +> 让我们使用 C99 和 C++ 11 完成常见的数据科学任务。 + +![metrics and data shown on a computer screen][1] + +虽然 [Python][2] 和 [R][3] 之类的语言在数据科学中越来越受欢迎,但是 C 和 C++ 对于高效的数据科学来说是一个不错的选择。在本文中,我们将使用 [C99][4] 和 [C++ 11][5] 编写一个程序,该程序使用 [Anscombe 的四重奏][6]数据集,下面将对其进行解释。 + +我在一篇涉及 [Python 和 GNU Octave][7] 的文章中写了我不断学习语言的动机,值得大家回顾。所有程序都应在[命令行][8]上运行,而不是在[图形用户界面(GUI)][9]上运行。完整的示例可在 [polyglot_fit 存储库][10]中找到。 + +### 编程任务 + +你将在本系列中编写的程序: + +* 从 [CSV 文件] [11]中读取数据 +* 用直线插值数据(即 `f(x)=m ⋅ x + q`) +* 将结果绘制到图像文件 + +这是许多数据科学家遇到的普遍情况。示例数据是 [Anscombe 的四重奏] [6]的第一组,如下表所示。这是一组人工构建的数据,当拟合直线时可以提供相同的结果,但是它们的曲线非常不同。数据文件是一个文本文件,其中的制表符用作列分隔符,几行作为标题。该任务将仅使用第一组(即前两列)。 + +[Anscombe 的四重奏][6] + + +### C 语言的方式 + +[C][12] 语言是通用编程语言,是当今使用最广泛的语言之一(依据 [TIOBE 榜单][13]、[RedMonk 编程语言排名][14]、[编程语言流行度榜单][15]和 [GitHub Octoverse 状态][16])。这是一种相当古老的语言(大约诞生在 1973 年),并且用它编写了许多成功的程序(例如 Linux 内核和 Git 仅是其中两个例子)。它也是最接近计算机内部运行的语言之一,因为它直接用于操作内存。它是一种[编译语言] [17];因此,源代码必须由[编译器][18]转换为[机器代码][19]。它的[标准库][20]很小,功能也不多,因此开发了其他库来提供缺少的功能。 + +我最常在[数字运算][21]中使用该语言,主要是因为其性能。我觉得使用起来很繁琐,因为它需要很多[样板代码][22],但是它在各种环境中都得到了很好的支持。C99 标准是最新版本,增加了一些漂亮的功能,并且得到了编译器的良好支持。 + +我将一路介绍 C 和 C++ 编程的必要背景,以便初学者和高级用户都可以继续学习。 + +#### 安装 + +要使用 C99 进行开发,你需要一个编译器。我通常使用 [Clang][23],不过 [GCC][24] 是另一个有效的开源编译器。对于线性拟合,我选择使用 [GNU 科学库] [25]。对于绘图,我找不到任何明智的库,因此该程序依赖于外部程序:[Gnuplot] [26]。该示例还使用动态数据结构来存储数据,该结构在[伯克利软件分发版(BSD)][27]中定义。 + +在 [Fedora][28] 中安装很容易: + +``` +sudo dnf install clang gnuplot gsl gsl-devel +``` + +#### 注释代码 + +在 C99 中,[注释][29]的格式是在行的开头放置 `//`,行的其它部分将被解释器丢弃。另外,`/*` 和 `*/` 之间的任何内容也将被丢弃。 + +``` +// 这是一个注释,会被解释器忽略 +/* 这也被忽略 */ +``` + +#### 必要的库 + +库由两部分组成: + +* [头文件][30],其中包含函数说明 +* 包含函数定义的源文件 + +头文件包含在源文件中,而库文件的源文件则与可执行文件[链接][31]。因此,此示例所需的头文件是: + +``` +// 输入/输出功能 +#include +// 标准库 +#include +// 字符串操作功能 +#include +// BSD 队列 +#include +// GSL 科学功能 +#include +#include +``` + +#### 主函数 + +在 C 语言中,程序必须位于称为主函数 [main()][32]:的特殊函数内: + +``` +int main(void) { +    ... +} +``` + +这与上一教程中介绍的 Python 不同,后者将运行在源文件中找到的所有代码。 + +#### 定义变量 + +在 C 语言中,变量必须在使用前声明,并且必须与类型关联。每当你要使用变量时,都必须决定要在其中存储哪种数据。你也可以指定是否打算将变量用作常量值,这不是必需的,但是编译器可以从此信息中受益。 来自存储库中的 [fitting_C99.c 程序] [33]: + +``` +const char *input_file_name = "anscombe.csv"; +const char *delimiter = "\t"; +const unsigned int skip_header = 3; +const unsigned int column_x = 0; +const unsigned int column_y = 1; +const char *output_file_name = "fit_C99.csv"; +const unsigned int N = 100; +``` + +C 语言中的数组不是动态的,从某种意义上说,数组的长度必须事先确定(即,在编译之前): + +``` +int data_array[1024]; +``` + +由于你通常不知道文件中有多少个数据点,因此请使用[单链接列表][34]。这是一个动态数据结构,可以无限增长。幸运的是,BSD [提供了链表][35]。这是一个示例定义: + +``` +struct data_point { + double x; + double y; + + SLIST_ENTRY(data_point) entries; +}; + +SLIST_HEAD(data_list, data_point) head = SLIST_HEAD_INITIALIZER(head); +SLIST_INIT(&head); +``` + +该示例定义了一个由结构化值组成的 `data_point` 列表,该结构化值同时包含 `x` 值和 `y` 值。语法相当复杂,但是很直观,详细描述它就会太冗长了。 + +#### 打印输出 + +要在终端上打印,可以使用 [printf()][36] 函数,其功能类似于 Octave 的 `printf()` 函数(在第一篇文章中介绍): + +``` +printf("#### Anscombe's first set with C99 ####\n"); +``` + +`printf()` 函数不会在打印字符串的末尾自动添加换行符,因此你必须添加换行符。第一个参数是一个字符串,可以包含传递给函数的其他参数的格式信息,例如: + +``` +printf("Slope: %f\n", slope); +``` + +#### 读取数据 + +现在来到了困难的部分……有一些用 C 语言解析 CSV 文件的库,但是似乎没有一个库足够稳定或流行到可以放入到 Fedora 软件包存储库中。我没有为本教程添加依赖项,而是决定自己编写此部分。同样,讨论这些细节太啰嗦了,所以我只会解释大致的思路。为了简洁起见,将忽略源代码中的某些行,但是你可以在存储库中找到完整的示例。 + +首先,打开输入文件: + +``` +FILE* input_file = fopen(input_file_name, "r"); +``` + +然后逐行读取文件,直到出现错误或文件结束: + +``` +while (!ferror(input_file) && !feof(input_file)) { + size_t buffer_size = 0; + char *buffer = NULL; + + getline(&buffer, &buffer_size, input_file); + + ... +} +``` + +[getline()][39] 函数是 [POSIX.1-2008 标准][40]新增的一个不错的函数。它可以读取文件中的整行,并负责分配必要的内存。然后使用 [strtok()][42] 函数将每一行分成[字元][41]token。遍历字元,选择所需的列: + +``` +char *token = strtok(buffer, delimiter); + +while (token != NULL) +{ + double value; + sscanf(token, "%lf", &value); + + if (column == column_x) { + x = value; + } else if (column == column_y) { + y = value; + } + + column += 1; + token = strtok(NULL, delimiter); +} +``` + +最后,当选择了 `x` 和 `y` 值时,将新数据点插入链表中: + +``` +struct data_point *datum = malloc(sizeof(struct data_point)); +datum->x = x; +datum->y = y; + +SLIST_INSERT_HEAD(&head, datum, entries); +``` + +[malloc()][46] 函数为新数据点动态分配(保留)一些持久性内存。 + +#### 拟合数据 + +GSL 线性拟合函数 [gsl_fit_linear()][47] 期望其输入为简单数组。因此,由于你将不知道要创建的数组的大小,因此必须手动分配它们的内存: + +``` +const size_t entries_number = row - skip_header - 1; + +double *x = malloc(sizeof(double) * entries_number); +double *y = malloc(sizeof(double) * entries_number); +``` + +然后,遍历链接列表以将相关数据保存到数组: + +``` +SLIST_FOREACH(datum, &head, entries) { + const double current_x = datum->x; + const double current_y = datum->y; + + x[i] = current_x; + y[i] = current_y; + + i += 1; +} +``` + +现在你已经完成了链接列表,请清理它。要**总是**释放已手动分配的内存,以防止[内存泄漏][48]。内存泄漏是糟糕的、糟糕的、糟糕的(重要的话说三遍)。每次内存没有释放时,花园侏儒都会找不到自己的头: + +``` +while (!SLIST_EMPTY(&head)) { + struct data_point *datum = SLIST_FIRST(&head); + + SLIST_REMOVE_HEAD(&head, entries); + + free(datum); +} +``` + +终于,终于!你可以拟合你的数据了: + +``` +gsl_fit_linear(x, 1, y, 1, entries_number, + &intercept, &slope, + &cov00, &cov01, &cov11, &chi_squared); +const double r_value = gsl_stats_correlation(x, 1, y, 1, entries_number); + +printf("Slope: %f\n", slope); +printf("Intercept: %f\n", intercept); +printf("Correlation coefficient: %f\n", r_value); +``` + +#### 绘图 + +你必须使用外部程序进行绘图。因此,将拟合数据保存到外部文件: + +``` +const double step_x = ((max_x + 1) - (min_x - 1)) / N; + +for (unsigned int i = 0; i < N; i += 1) { + const double current_x = (min_x - 1) + step_x * i; + const double current_y = intercept + slope * current_x; + + fprintf(output_file, "%f\t%f\n", current_x, current_y); +} +``` + +用于绘制两个文件的 Gnuplot 命令是: + +``` +plot 'fit_C99.csv' using 1:2 with lines title 'Fit', 'anscombe.csv' using 1:2 with points pointtype 7 title 'Data' +``` + +#### 结果 + +在运行程序之前,你必须编译它: + +``` +clang -std=c99 -I/usr/include/ fitting_C99.c -L/usr/lib/ -L/usr/lib64/ -lgsl -lgslcblas -o fitting_C99 +``` + +这个命令告诉编译器使用 C99 标准,读取 `fitting_C99.c` 文件,加载 `gsl` 和 `gslcblas` 库,并将结果保存到 `fitting_C99`。命令行上的结果输出为: + +``` +#### Anscombe's first set with C99 #### +Slope: 0.500091 +Intercept: 3.000091 +Correlation coefficient: 0.816421 +``` + +这是用 Gnuplot 生成的结果图像。 + +![Plot and fit of the dataset obtained with C99][52] + +### The C++11 way + +[C++][53] is a general-purpose programming language that is also among the most popular languages in use today. It was created as a [successor of C][54] (in 1983) with an emphasis on [object-oriented programming][55] (OOP). C++ is commonly regarded as a superset of C, so a C program should be able to be compiled with a C++ compiler. This is not exactly true, as there are some corner cases where they behave differently. In my experience, C++ needs less boilerplate than C, but the syntax is more difficult if you want to develop objects. The C++11 standard is a recent revision that adds some nifty features and is more or less supported by compilers. + +Since C++ is largely compatible with C, I will just highlight the differences between the two. If I do not cover a section in this part, it means that it is the same as in C. + +#### Installation + +The dependencies for the C++ example are the same as the C example. On Fedora, run: + + +``` +`sudo dnf install clang gnuplot gsl gsl-devel` +``` + +#### Necessary libraries + +Libraries work in the same way as in C, but the `include` directives are slightly different: + + +``` +#include <cstdlib> +#include <cstring> +#include <iostream> +#include <fstream> +#include <string> +#include <vector> +#include <algorithm> + +extern "C" { +#include <gsl/gsl_fit.h> +#include <gsl/gsl_statistics_double.h> +} +``` + +Since the GSL libraries are written in C, you must inform the compiler about this peculiarity. + +#### Defining variables + +C++ supports more data types (classes) than C, such as a `string` type that has many more features than its C counterpart. Update the definition of the variables accordingly: + + +``` +`const std::string input_file_name("anscombe.csv");` +``` + +For structured objects like strings, you can define the variable without using the `=` sign. + +#### Printing output + +You can use the `printf()` function, but the `cout` object is more idiomatic. Use the operator `<<` to indicate the string (or objects) that you want to print with `cout`: + + +``` +std::cout << "#### Anscombe's first set with C++11 ####" << std::endl; + +... + +std::cout << "Slope: " << slope << std::endl; +std::cout << "Intercept: " << intercept << std::endl; +std::cout << "Correlation coefficient: " << r_value << std::endl; +``` + +#### Reading data + +The scheme is the same as before. The file is opened and read line-by-line, but with a different syntax: + + +``` +std::ifstream input_file(input_file_name); + +while (input_file.good()) { +    std::string line; + +    getline(input_file, line); + +    ... +} +``` + +The line tokens are extracted with the same function as in the C99 example. Instead of using standard C arrays, use two [vectors][56]. Vectors are an extension of C arrays in the [C++ standard library][57] that allows dynamic management of memory without explicitly calling `malloc()`: + + +``` +std::vector<double> x; +std::vector<double> y; + +// Adding an element to x and y: +x.emplace_back(value); +y.emplace_back(value); +``` + +#### Fitting data + +For fitting in C++, you do not have to loop over the list, as vectors are guaranteed to have contiguous memory. You can directly pass to the fitting function the pointers to the vectors buffers: + + +``` +gsl_fit_linear(x.data(), 1, y.data(), 1, entries_number, +               &intercept, &slope, +               &cov00, &cov01, &cov11, &chi_squared); +const double r_value = gsl_stats_correlation(x.data(), 1, y.data(), 1, entries_number); + +std::cout << "Slope: " << slope << std::endl; +std::cout << "Intercept: " << intercept << std::endl; +std::cout << "Correlation coefficient: " << r_value << std::endl; +``` + +#### Plotting + +Plotting is done with the same approach as before. Write to a file: + + +``` +const double step_x = ((max_x + 1) - (min_x - 1)) / N; + +for (unsigned int i = 0; i < N; i += 1) { +    const double current_x = (min_x - 1) + step_x * i; +    const double current_y = intercept + slope * current_x; + +    output_file << current_x << "\t" << current_y << std::endl; +} + +output_file.close(); +``` + +And then use Gnuplot for the plotting. + +#### Results + +Before running the program, it must be compiled with a similar command: + + +``` +`clang++ -std=c++11 -I/usr/include/ fitting_Cpp11.cpp -L/usr/lib/ -L/usr/lib64/ -lgsl -lgslcblas -o fitting_Cpp11` +``` + +The resulting output on the command line is: + + +``` +#### Anscombe's first set with C++11 #### +Slope: 0.500091 +Intercept: 3.00009 +Correlation coefficient: 0.816421 +``` + +And this is the resulting image generated with Gnuplot. + +![Plot and fit of the dataset obtained with C++11][58] + +### Conclusion + +This article provides examples for a data fitting and plotting task in C99 and C++11. Since C++ is largely compatible with C, this article exploited their similarities for writing the second example. In some aspects, C++ is easier to use because it partially relieves the burden of explicitly managing memory. But the syntax is more complex because it introduces the possibility of writing classes for OOP. However, it is still possible to write software in C with the OOP approach. Since OOP is a style of programming, it can be used in any language. There are some great examples of OOP in C, such as the [GObject][59] and [Jansson][60] libraries. + +For number crunching, I prefer working in C99 due to its simpler syntax and widespread support. Until recently, C++11 was not as widely supported, and I tended to avoid the rough edges in the previous versions. For more complex software, C++ could be a good choice. + +Do you use C or C++ for data science as well? Share your experiences in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/c-data-science + +作者:[Cristiano L. Fontana][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/cristianofontana +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://opensource.com/article/18/9/top-3-python-libraries-data-science +[3]: https://opensource.com/article/19/5/learn-python-r-data-science +[4]: https://en.wikipedia.org/wiki/C99 +[5]: https://en.wikipedia.org/wiki/C%2B%2B11 +[6]: https://en.wikipedia.org/wiki/Anscombe%27s_quartet +[7]: https://opensource.com/article/20/2/python-gnu-octave-data-science +[8]: https://en.wikipedia.org/wiki/Command-line_interface +[9]: https://en.wikipedia.org/wiki/Graphical_user_interface +[10]: https://gitlab.com/cristiano.fontana/polyglot_fit +[11]: https://en.wikipedia.org/wiki/Comma-separated_values +[12]: https://en.wikipedia.org/wiki/C_%28programming_language%29 +[13]: https://www.tiobe.com/tiobe-index/ +[14]: https://redmonk.com/sogrady/2019/07/18/language-rankings-6-19/ +[15]: http://pypl.github.io/PYPL.html +[16]: https://octoverse.github.com/ +[17]: https://en.wikipedia.org/wiki/Compiled_language +[18]: https://en.wikipedia.org/wiki/Compiler +[19]: https://en.wikipedia.org/wiki/Machine_code +[20]: https://en.wikipedia.org/wiki/C_standard_library +[21]: https://en.wiktionary.org/wiki/number-crunching +[22]: https://en.wikipedia.org/wiki/Boilerplate_code +[23]: https://clang.llvm.org/ +[24]: https://gcc.gnu.org/ +[25]: https://www.gnu.org/software/gsl/ +[26]: http://www.gnuplot.info/ +[27]: https://en.wikipedia.org/wiki/Berkeley_Software_Distribution +[28]: https://getfedora.org/ +[29]: https://en.wikipedia.org/wiki/Comment_(computer_programming) +[30]: https://en.wikipedia.org/wiki/Include_directive +[31]: https://en.wikipedia.org/wiki/Linker_%28computing%29 +[32]: https://en.wikipedia.org/wiki/Entry_point#C_and_C++ +[33]: https://gitlab.com/cristiano.fontana/polyglot_fit/-/blob/master/fitting_C99.c +[34]: https://en.wikipedia.org/wiki/Linked_list#Singly_linked_list +[35]: http://man7.org/linux/man-pages/man3/queue.3.html +[36]: https://en.wikipedia.org/wiki/Printf_format_string +[37]: http://www.opengroup.org/onlinepubs/009695399/functions/ferror.html +[38]: http://www.opengroup.org/onlinepubs/009695399/functions/feof.html +[39]: http://man7.org/linux/man-pages/man3/getline.3.html +[40]: https://en.wikipedia.org/wiki/POSIX +[41]: https://en.wikipedia.org/wiki/Lexical_analysis#Token +[42]: http://man7.org/linux/man-pages/man3/strtok.3.html +[43]: http://www.opengroup.org/onlinepubs/009695399/functions/strtok.html +[44]: http://www.opengroup.org/onlinepubs/009695399/functions/sscanf.html +[45]: http://www.opengroup.org/onlinepubs/009695399/functions/malloc.html +[46]: http://man7.org/linux/man-pages/man3/malloc.3.html +[47]: https://www.gnu.org/software/gsl/doc/html/lls.html +[48]: https://en.wikipedia.org/wiki/Memory_leak +[49]: http://www.opengroup.org/onlinepubs/009695399/functions/free.html +[50]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[51]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html +[52]: https://opensource.com/sites/default/files/uploads/fit_c99.png (Plot and fit of the dataset obtained with C99) +[53]: https://en.wikipedia.org/wiki/C%2B%2B +[54]: http://www.cplusplus.com/info/history/ +[55]: https://en.wikipedia.org/wiki/Object-oriented_programming +[56]: https://en.wikipedia.org/wiki/Sequence_container_%28C%2B%2B%29#Vector +[57]: https://en.wikipedia.org/wiki/C%2B%2B_Standard_Library +[58]: https://opensource.com/sites/default/files/uploads/fit_cpp11.png (Plot and fit of the dataset obtained with C++11) +[59]: https://en.wikipedia.org/wiki/GObject +[60]: http://www.digip.org/jansson/ From 921a5a9a67e75f9cfb1ef8aba312e581ba28aa57 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 25 Feb 2020 23:49:12 +0800 Subject: [PATCH 166/315] TSL FINAL --- ...200224 Using C and C-- for data science.md | 141 ++++++++---------- 1 file changed, 66 insertions(+), 75 deletions(-) diff --git a/translated/tech/20200224 Using C and C-- for data science.md b/translated/tech/20200224 Using C and C-- for data science.md index 26dab50b03..c2b3ca0a87 100644 --- a/translated/tech/20200224 Using C and C-- for data science.md +++ b/translated/tech/20200224 Using C and C-- for data science.md @@ -14,7 +14,7 @@ ![metrics and data shown on a computer screen][1] -虽然 [Python][2] 和 [R][3] 之类的语言在数据科学中越来越受欢迎,但是 C 和 C++ 对于高效的数据科学来说是一个不错的选择。在本文中,我们将使用 [C99][4] 和 [C++ 11][5] 编写一个程序,该程序使用 [Anscombe 的四重奏][6]数据集,下面将对其进行解释。 +虽然 [Python][2] 和 [R][3] 之类的语言在数据科学中越来越受欢迎,但是 C 和 C++ 对于高效的数据科学来说是一个不错的选择。在本文中,我们将使用 [C99][4] 和 [C++11][5] 编写一个程序,该程序使用 [Anscombe 的四重奏][6]数据集,下面将对其进行解释。 我在一篇涉及 [Python 和 GNU Octave][7] 的文章中写了我不断学习语言的动机,值得大家回顾。所有程序都应在[命令行][8]上运行,而不是在[图形用户界面(GUI)][9]上运行。完整的示例可在 [polyglot_fit 存储库][10]中找到。 @@ -291,145 +291,136 @@ Correlation coefficient: 0.816421 ![Plot and fit of the dataset obtained with C99][52] -### The C++11 way +### C++11 方式 -[C++][53] is a general-purpose programming language that is also among the most popular languages in use today. It was created as a [successor of C][54] (in 1983) with an emphasis on [object-oriented programming][55] (OOP). C++ is commonly regarded as a superset of C, so a C program should be able to be compiled with a C++ compiler. This is not exactly true, as there are some corner cases where they behave differently. In my experience, C++ needs less boilerplate than C, but the syntax is more difficult if you want to develop objects. The C++11 standard is a recent revision that adds some nifty features and is more or less supported by compilers. +[C++][53] 语言是一种通用编程语言,也是当今使用的最受欢迎的语言之一。它是作为 [C 的继承人][54]创建的(诞生于 1983 年),重点是[面向对象程序设计(OOP)][55]。C++ 通常被视为 C 的超集,因此 C 程序应该能够使用 C++ 编译器进行编译。这并非完全正确,因为在某些极端情况下它们的行为有所不同。 根据我的经验,C++ 比 C 需要更少的样板代码,但是如果要进行对象开发,语法会更困难。C++11 标准是最新版本,增加了一些漂亮的功能,并且或多或少得到了编译器的支持。 -Since C++ is largely compatible with C, I will just highlight the differences between the two. If I do not cover a section in this part, it means that it is the same as in C. +由于 C++ 在很大程度上与 C 兼容,因此我将仅强调两者之间的区别。我在本部分中没有涵盖的任何部分,则意味着它与 C 中的相同。 -#### Installation +#### 安装 -The dependencies for the C++ example are the same as the C example. On Fedora, run: +这个 C++ 示例的依赖项与 C 示例相同。 在 Fedora 上,运行: + +``` +sudo dnf install clang gnuplot gsl gsl-devel +``` + +#### 必要的库 + +库的工作方式与 C 语言相同,但是 `include` 指令略有不同: ``` -`sudo dnf install clang gnuplot gsl gsl-devel` -``` - -#### Necessary libraries - -Libraries work in the same way as in C, but the `include` directives are slightly different: - - -``` -#include <cstdlib> -#include <cstring> -#include <iostream> -#include <fstream> -#include <string> -#include <vector> -#include <algorithm> +#include +#include +#include +#include +#include +#include +#include extern "C" { -#include <gsl/gsl_fit.h> -#include <gsl/gsl_statistics_double.h> +#include +#include } ``` -Since the GSL libraries are written in C, you must inform the compiler about this peculiarity. +由于 GSL 库是用 C 编写的,因此你必须将这种特殊性告知编译器。 -#### Defining variables - -C++ supports more data types (classes) than C, such as a `string` type that has many more features than its C counterpart. Update the definition of the variables accordingly: +#### 定义变量 +与 C 语言相比,C++ 支持更多的数据类型(类),例如,与其 C 语言版本相比,`string` 类型具有更多的功能。相应地更新变量的定义: ``` -`const std::string input_file_name("anscombe.csv");` +const std::string input_file_name("anscombe.csv"); ``` -For structured objects like strings, you can define the variable without using the `=` sign. +对于字符串之类的结构化对象,你可以定义变量而无需使用 `=` 符号。 -#### Printing output - -You can use the `printf()` function, but the `cout` object is more idiomatic. Use the operator `<<` to indicate the string (or objects) that you want to print with `cout`: +#### 打印输出 +你可以使用 `printf()` 函数,但是 `cout` 对象更惯用。使用运算符 `<<` 来指示要使用 `cout` 打印的字符串(或对象): ``` -std::cout << "#### Anscombe's first set with C++11 ####" << std::endl; +std::cout << "#### Anscombe's first set with C++11 ####" << std::endl; ... -std::cout << "Slope: " << slope << std::endl; -std::cout << "Intercept: " << intercept << std::endl; -std::cout << "Correlation coefficient: " << r_value << std::endl; +std::cout << "Slope: " << slope << std::endl; +std::cout << "Intercept: " << intercept << std::endl; +std::cout << "Correlation coefficient: " << r_value << std::endl; ``` -#### Reading data - -The scheme is the same as before. The file is opened and read line-by-line, but with a different syntax: +#### 读取数据 +该方案与以前相同。将打开文件并逐行读取文件,但语法不同: ``` std::ifstream input_file(input_file_name); while (input_file.good()) { -    std::string line; + std::string line; -    getline(input_file, line); + getline(input_file, line); -    ... + ... } ``` -The line tokens are extracted with the same function as in the C99 example. Instead of using standard C arrays, use two [vectors][56]. Vectors are an extension of C arrays in the [C++ standard library][57] that allows dynamic management of memory without explicitly calling `malloc()`: - +使用与 C99 示例相同的功能提取行字元。代替使用标准的 C 数组,而是使用两个[向量][56]。向量是 [C++ 标准库][57]中对 C 数组的扩展,它允许动态管理内存而无需显式调用 `malloc()`: ``` -std::vector<double> x; -std::vector<double> y; +std::vector x; +std::vector y; // Adding an element to x and y: x.emplace_back(value); y.emplace_back(value); ``` -#### Fitting data - -For fitting in C++, you do not have to loop over the list, as vectors are guaranteed to have contiguous memory. You can directly pass to the fitting function the pointers to the vectors buffers: +#### 拟合数据 +要在 C++ 中拟合,你不必遍历列表,因为向量可以保证具有连续的内存。你可以将向量缓冲区的指针直接传递给拟合函数: ``` gsl_fit_linear(x.data(), 1, y.data(), 1, entries_number, -               &intercept, &slope, -               &cov00, &cov01, &cov11, &chi_squared); + &intercept, &slope, + &cov00, &cov01, &cov11, &chi_squared); const double r_value = gsl_stats_correlation(x.data(), 1, y.data(), 1, entries_number); -std::cout << "Slope: " << slope << std::endl; -std::cout << "Intercept: " << intercept << std::endl; -std::cout << "Correlation coefficient: " << r_value << std::endl; +std::cout << "Slope: " << slope << std::endl; +std::cout << "Intercept: " << intercept << std::endl; +std::cout << "Correlation coefficient: " << r_value << std::endl; ``` -#### Plotting - -Plotting is done with the same approach as before. Write to a file: +#### 绘图 +使用与以前相同的方法进行绘图。 写入文件: ``` const double step_x = ((max_x + 1) - (min_x - 1)) / N; -for (unsigned int i = 0; i < N; i += 1) { -    const double current_x = (min_x - 1) + step_x * i; -    const double current_y = intercept + slope * current_x; +for (unsigned int i = 0; i < N; i += 1) { + const double current_x = (min_x - 1) + step_x * i; + const double current_y = intercept + slope * current_x; -    output_file << current_x << "\t" << current_y << std::endl; + output_file << current_x << "\t" << current_y << std::endl; } output_file.close(); ``` -And then use Gnuplot for the plotting. +然后使用 Gnuplot 进行绘图。 -#### Results - -Before running the program, it must be compiled with a similar command: +#### 结果 +在运行程序之前,必须使用类似的命令对其进行编译: ``` -`clang++ -std=c++11 -I/usr/include/ fitting_Cpp11.cpp -L/usr/lib/ -L/usr/lib64/ -lgsl -lgslcblas -o fitting_Cpp11` +clang++ -std=c++11 -I/usr/include/ fitting_Cpp11.cpp -L/usr/lib/ -L/usr/lib64/ -lgsl -lgslcblas -o fitting_Cpp11 ``` -The resulting output on the command line is: - +命令行上的结果输出为: ``` #### Anscombe's first set with C++11 #### @@ -438,17 +429,17 @@ Intercept: 3.00009 Correlation coefficient: 0.816421 ``` -And this is the resulting image generated with Gnuplot. +这就是用 Gnuplot 生成的结果图像。 ![Plot and fit of the dataset obtained with C++11][58] -### Conclusion +### 结论 -This article provides examples for a data fitting and plotting task in C99 and C++11. Since C++ is largely compatible with C, this article exploited their similarities for writing the second example. In some aspects, C++ is easier to use because it partially relieves the burden of explicitly managing memory. But the syntax is more complex because it introduces the possibility of writing classes for OOP. However, it is still possible to write software in C with the OOP approach. Since OOP is a style of programming, it can be used in any language. There are some great examples of OOP in C, such as the [GObject][59] and [Jansson][60] libraries. +本文提供了用 C99 和 C++11 编写的数据拟合和绘图任务的示例。由于 C++ 在很大程度上与 C 兼容,因此本文利用了它们的相似性来编写了第二个示例。在某些方面,C++ 更易于使用,因为它部分减轻了显式管理内存的负担。但是其语法更加复杂,因为它引入了为 OOP 编写类的可能性。但是,仍然可以用 C 使用 OOP 方法编写软件。由于 OOP 是一种编程风格,因此可以以任何语言使用。在 C 中有一些很好的 OOP 示例,例如 [GObject][59] 和 [Jansson][60]库。 -For number crunching, I prefer working in C99 due to its simpler syntax and widespread support. Until recently, C++11 was not as widely supported, and I tended to avoid the rough edges in the previous versions. For more complex software, C++ could be a good choice. +对于数字运算,我更喜欢在 C99 中进行,因为它的语法更简单并且得到了广泛的支持。直到最近,C++11 还没有得到广泛的支持,我倾向于避免使用先前版本中的粗糙不足之处。对于更复杂的软件,C++ 可能是一个不错的选择。 -Do you use C or C++ for data science as well? Share your experiences in the comments. +你是否也将 C 或 C++ 用于数据科学? 在评论中分享你的经验。 -------------------------------------------------------------------------------- @@ -456,7 +447,7 @@ via: https://opensource.com/article/20/2/c-data-science 作者:[Cristiano L. Fontana][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6648fa74b8bbd7493dc8d8c41ffd46bc572d146f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 26 Feb 2020 01:04:52 +0800 Subject: [PATCH 167/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200225=203=20eB?= =?UTF-8?q?ook=20readers=20for=20the=20Linux=20desktop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200225 3 eBook readers for the Linux desktop.md --- ...5 3 eBook readers for the Linux desktop.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sources/tech/20200225 3 eBook readers for the Linux desktop.md diff --git a/sources/tech/20200225 3 eBook readers for the Linux desktop.md b/sources/tech/20200225 3 eBook readers for the Linux desktop.md new file mode 100644 index 0000000000..1c057a15ed --- /dev/null +++ b/sources/tech/20200225 3 eBook readers for the Linux desktop.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 eBook readers for the Linux desktop) +[#]: via: (https://opensource.com/article/20/2/linux-ebook-readers) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +3 eBook readers for the Linux desktop +====== +Any of these open source eBook applications will make it easy to read +your books on a larger screen. +![Computer browser with books on the screen][1] + +I usually read eBooks on my phone or with my Kobo eReader. I've never been comfortable reading books on larger screens. However, many people regularly read books on their laptops or desktops. If you are one of them (or think you might be), I'd like to introduce you to three eBook readers for the Linux desktop. + +### Bookworm + +[Bookworm][2] is billed as a "simple, focused eBook reader." And it is. Bookworm has a basic set of features, which some people will complain about being _too basic_ or lacking _functionality_ (whatever that word means). Bookworm does one thing and does it well without unnecessary frills. + +The application's interface is very clean and uncluttered. + +![Bookworm e-book application][3] + +You navigate through a book by pressing: + + * The space bar to move down a page + * The Down and Up arrow keys to move down and up a single line + * The Right and Left arrow keys to jump to the next or previous chapter + + + +You can also annotate portions of a book and insert bookmarks to jump back to a page. + +![Annotations in Bookworm][4] + +Bookworm doesn't have many configuration options. You can change the size and spacing of a book's font, enable a two-page reading view or dark mode, and add folders that Bookworm will scan to find new eBooks. + +![Bookworm preferences][5] + +Bookworm supports the most widely used eBook formats: EPUB, PDF, MOBI, and [FB2][6]. You can also use Bookworm to read popular digital comic book formats [CBR][7] and CBZ. I've tested Bookworm with only the first three formats. PDF files are readable, but they load slowly and the formatting can be rather ugly. + +### Foliate + +As far as features go, [Foliate][8] is a step or two above Bookworm. Not only does it have several more features, but it also has more configuration options. You get all of that in a zippy, clean, and uncluttered package. + +![Foliate e-book application][9] + +You can navigate through an eBook in Foliate using the space bar, arrow keys, or PgUp and PgDn keys. There's nothing unique there. + +You can also annotate text, look up and translate words and phrases, and look up the meanings of words. If you have a text-to-speech application installed on your computer, Foliate can use it to read books aloud. + +![Annotating a book in Foliate][10] + +Foliate has a few more customization options than Bookworm. You can change a book's font and its size, the spacing of lines, and the size of a book's margins. You can also increase or decrease the brightness and select one of four built-in themes. + +![Foliate settings][11] + +You can read books in the EPUB, MOBI, AZW, and AZW3 formats using Foliate. In case you're wondering, the latter three are closed formats used with books published for Amazon's Kindle eReader + +### Calibre's eBook viewer + +[eBook viewer][12] is a component of the [Calibre][13] eBook management tool. Like its parent, the eBook viewer feature isn't the prettiest piece of software out there. + +![E-book Viewer application][14] + +Don't let that put you off, though. It's a solid desktop eBook reader. + +You navigate through an eBook in Calibre's e-book viewer using the arrow and PgUp/PgDn keys or by pressing the space bar. You can also look up words in an online dictionary and add bookmarks throughout a book. E-book viewer lacks an annotation function, but its built-in search engine is solid, and you can save books as PDFs (though I'm not sure why you'd want to). + +Configuration options are an area where this eBook viewer shines. It has far more of them than both Bookworm and Foliate combined. You can change everything from fonts to the layout of text to how text is broken up into pages. On top of that, you can customize the keyboard shortcuts for using the application and add your favorite dictionary website or sites to help you look up words in a book you're reading. + +![E-book Viewer preferences][15] + +One useful feature of Calibre's eBook viewer is the ability to apply your own CSS file to your e-books. CSS, in case you're wondering, is a way to format web pages (which is what many e-books are made of). If you're a master with CSS, you can copy and paste your CSS file into the **User stylesheet** tab in eBook viewer's Preferences window. That's the ultimate in customization. + +eBook viewer, according to its developer, "can display all the major e-book formats." If you're wondering what those formats are, [here's a list][16]. I've tested it with just a few of those formats and have had no problems with them. + +### Final thought + +Whether you're looking for a simple eBook reader or one with bells and whistles and whatever else, the three applications in this article are good choices. Any of them can make reading an eBook on a larger screen easier. + +* * * + +_This article is based on an article published on [Open Source Musings][17] and appears here via a [CC BY-SA 4.0][18] license._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/linux-ebook-readers + +作者:[Scott Nesbitt][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/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_browser_program_books_read.jpg?itok=iNMWe8Bu (Computer browser with books on the screen) +[2]: https://babluboy.github.io/bookworm/ +[3]: https://opensource.com/sites/default/files/uploads/bookworm-reading.png (Bookworm e-book application) +[4]: https://opensource.com/sites/default/files/uploads/bookworm-annotations.png (Annotations in Bookworm) +[5]: https://opensource.com/sites/default/files/uploads/bookworm-preferences.png (Bookworm preferences) +[6]: https://en.wikipedia.org/wiki/FictionBook +[7]: https://en.wikipedia.org/wiki/Comic_book_archive +[8]: https://johnfactotum.github.io/foliate/ +[9]: https://opensource.com/sites/default/files/uploads/foliate-reading.png (Foliate e-book application) +[10]: https://opensource.com/sites/default/files/uploads/foliate-annotation_0.png +[11]: https://opensource.com/sites/default/files/uploads/foliate-settings.png (Foliate settings) +[12]: https://calibre-ebook.com/about +[13]: https://opensourcemusings.com/managing-your-ebooks-with-calibre +[14]: https://opensource.com/sites/default/files/uploads/e-book_viewer-reading.png (E-book Viewer application) +[15]: https://opensource.com/sites/default/files/uploads/ebook-viewer-preferences.png (E-book Viewer preferences) +[16]: https://manual.calibre-ebook.com/faq.html#what-formats-does-calibre-support-conversion-to-from +[17]: https://opensourcemusings.com/three-ebook-readers-for-the-linux-desktop +[18]: https://creativecommons.org/licenses/by-sa/4.0/ From 8c860862f68636d1d557e7acedde96de9c94e4f6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 26 Feb 2020 01:05:35 +0800 Subject: [PATCH 168/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200225=207=20ti?= =?UTF-8?q?ps=20for=20writing=20an=20effective=20technical=20resume?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200225 7 tips for writing an effective technical resume.md --- ...r writing an effective technical resume.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/tech/20200225 7 tips for writing an effective technical resume.md diff --git a/sources/tech/20200225 7 tips for writing an effective technical resume.md b/sources/tech/20200225 7 tips for writing an effective technical resume.md new file mode 100644 index 0000000000..b3a32876b4 --- /dev/null +++ b/sources/tech/20200225 7 tips for writing an effective technical resume.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (7 tips for writing an effective technical resume) +[#]: via: (https://opensource.com/article/20/2/technical-resume-writing) +[#]: author: (Emily Brand https://opensource.com/users/emily-brand) + +7 tips for writing an effective technical resume +====== +Present yourself in the best light to potential employers by following +these essentials. +![Two hands holding a resume with computer, clock, and desk chair ][1] + +If you're a software engineer or a manager in the technology sector, creating or updating your resume can be a daunting task. What is most important to consider? How should you handle the formatting, the content, and your objective or summary? What work experience is relevant? How can you make sure automated recruitment tools don't filter out your resume? + +As a hiring manager over the last seven years, I have seen a wide range of resumes and CVs; while some have been impressive, many more have been terribly written. + +When writing or updating your resume, here are seven easy rules to follow. + +### 1\. Summary statement + +The short paragraph at the top of your resume should be clean and concise, have a clear purpose, and avoid excessive use of adjectives and adverbs. Words such as "impressive," "extensive," and "excellent" do not improve your hiring chances; instead, they look and feel like overused filler words. An important question to ask yourself regarding your objective is: **Does it tell the hiring manager what kind of job I'm looking for and how I can provide value to them?** If not, either strengthen and streamline it to answer that question or leave it out altogether. + +### 2\. Work experience + +Numbers, numbers, numbers. Hard facts help you convey your point far more than general statements such as "Helped build, manage, deliver many projects that directly contributed to my customers' bottom line." Your wording should include statistics such as "Directly impacted five projects with top banks that accelerated their time to market by 40%," how many lines of code you committed, or how many teams you managed. Data is far more effective than frilly language to showcase your abilities and value. + +If you are less-experienced and have fewer jobs to showcase, do not include irrelevant experience like part-time summer jobs. Instead, add detail about the specifics of your relevant experience and what you learned that would make you a better employee for the organization you are applying for. + +### 3\. Search terms and jargon + +With technology playing such a huge role in the hiring process, it is extremely important to make sure your resume gets flagged for the right positions—but do not oversell yourself on your resume. If you mention agile skills but do not know what kanban is, think twice. If you mention that you are skilled in Java but haven't used it in five years, beware. If there are languages and frameworks you are familiar with but not necessarily current in, create a different category or divide your experience into "proficient in" and "familiar with." + +### 4\. Education + +If you are not a recent college graduate, there is no need to include your GPA or the clubs or fraternities you participated in, unless you plan on using them as talking points to gain trust during an interview. Be sure that anything you have published or patented is included, even if it is not relevant to the job. If you do not have a college degree, add a certification section in place of education. If you were in the military, include your active duty and reserve time. + +### 5\. Certifications + +Do not include expired certifications unless you are trying to re-enter a field you have left, such as if you were a people manager and are now looking to get back into hands-on programming. If you have certifications that are no longer relevant to the field, do not include them since it can be distracting and unappealing. Leverage your LinkedIn profile to add more color to your resume, as most people will read your resume and your LinkedIn profile before they interview you. + +### 6\. Spelling and grammar + +Ask others to proofread your resume. So often, I have seen misspelled words in a resume or mistaken uses of words like their, they're, and there. These are avoidable and fixable errors that will create a negative impression. Ideally, your resume will be in active tense, but if that makes you uncomfortable, write it in past tense—the most important thing is to maintain a consistent tense throughout. Improper spelling and grammar will convey that you either do not really care about the job you are applying for or do not have the level of attention to detail necessary for the job. + +### 7\. Formatting + +Ensuring your resume looks up-to-date and appealing is an easy way to make a good first impression. Ensuring consistent formatting, e.g., similar margins, similar spacing, capitalization, and colors (but keep color palettes to a minimum) is the most mundane part of resume writing, but it's necessary to show that you take pride in your work and value yourself and your future employer. Use tables where appropriate to space information in a visually appealing way. If given the option, upload your resume in .pdf and .docx formats, and Google Docs exports to the .odt format, which can be opened easily in LibreOffice. Here is an easy Google Docs [resume template][2] that I recommend. You can also purchase templates from companies that do attractive designs for a small fee (under $10). + +### Update regularly + +Updating your resume regularly will minimize your stress if you're asked to (or want to) apply for a job, and it will help you create and maintain a more accurate version of yourself. When working on your resume, be forward-thinking and be sure to ask at least three other people to review it for content, spelling, and grammar. Even if you are recruited by or referred to a company, your interviewers may know you only by your resume, so ensure that it creates a positive first impression of you. + +_Do you have additional tips to add?_ + +Emily Dunham shares her technique for leveraging open source contributions to stand out as a great... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/technical-resume-writing + +作者:[Emily Brand][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/emily-brand +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/resume_career_document_general.png?itok=JEaFL2XI (Two hands holding a resume with computer, clock, and desk chair ) +[2]: https://docs.google.com/document/d/1ARVyybC5qQEiCzUOLElwAdPpKOK0Qf88srr682eHdCQ/edit From db2ef93c0a80927b7f1d9b05fe6439f90934cd42 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 26 Feb 2020 01:06:51 +0800 Subject: [PATCH 169/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200225=20Spilli?= =?UTF-8?q?ng=20over:=20How=20working=20openly=20with=20anxiety=20affects?= =?UTF-8?q?=20my=20team?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200225 Spilling over- How working openly with anxiety affects my team.md --- ...ing openly with anxiety affects my team.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20200225 Spilling over- How working openly with anxiety affects my team.md diff --git a/sources/tech/20200225 Spilling over- How working openly with anxiety affects my team.md b/sources/tech/20200225 Spilling over- How working openly with anxiety affects my team.md new file mode 100644 index 0000000000..2a89fd37a5 --- /dev/null +++ b/sources/tech/20200225 Spilling over- How working openly with anxiety affects my team.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Spilling over: How working openly with anxiety affects my team) +[#]: via: (https://opensource.com/open-organization/20/2/working-anxiety-team-performance) +[#]: author: (Sam Knuth https://opensource.com/users/samfw) + +Spilling over: How working openly with anxiety affects my team +====== +The team might interpret my behavior as evidence of exacting standards +or high expectations. But I know my anxiety does impact their +performance. +![Spider web on green background][1] + +_Editor's note: This article is part of a series on working with mental health conditions. It details the author's personal experiences and is not meant to convey professional medical advice or guidance._ + +I was speaking with one of my direct reports recently about a discussion we'd had with the broader team earlier in the week. In that discussion I had expressed some frustration that we weren't as far along on a particular project as I thought we needed to be. + +"I knew you were disappointed," my staff member said, recalling the meeting, "like you wanted us to be doing something that we weren't doing, or that what we were doing wasn't good enough." + +They paused for a moment and then said, "Sam, I get this feeling from you all the time." + +That comment struck me pretty profoundly. To my team member, perhaps the scenario above is a reflection of my exacting standards, my high expectations, or my desire to see continual improvement with the team. Those are all reasonable explanations for my behavior. + +But there's another ingredient my team may not be aware of: my anxiety. + +### It's not just personal + +[Previously I discussed][2] how my anxiety, beginning with a worry that I'm not "doing enough," can fuel my proactive tendencies, leading to higher performance at work. What I hadn't considered is my team can interpret my _personal_ feeling of not doing enough as an indicator that _they_ are not doing enough. + +Living with anxiety and other mental health conditions feels personal. It's not something I've talked about at work. It's not something I generally discuss, and it's something I've always felt I was coping with as a private part of my life. + +Living with anxiety and other mental health conditions feels personal. It's not something I've talked about at work. It's not something I generally discuss, and it's something I've always felt I was coping with as a private part of my life. + +But that discussion with my staff member made me realize that I can't contain my personality so neatly. In truth, my anxiety spills over to my team in ways I hadn't considered. I don't know if anxiety can "rub off" on someone, but when I try to think about it objectively, I imagine someone with anxiety would feel it heightened if they worked for me (perhaps my anxiety would feed theirs), and one without anxiety might feel I have unreasonable or unmeetable expectations. + +As a leader—even in an open organization, where [hierarchy is not the most important factor][3] in determining influence—I'm aware that I am in a position of a certain amount of power. People observe my behavior more closely than I realize; how I treat people has a big impact on them, the broader organization, and ultimately the success of the team. + +I try hard to treat people with respect, [to assume positive intent][4], to give people the room to do their work in the way they see fit. But, nonetheless, do my team members feel the kind of judgment from me that I continually impose on myself? + +### Counting our achievements + +What feels "good" to me (what calms my anxiety) is to focus _not_ on what we _have achieved_, but on what we _have yet to do_; not to _celebrate success_, but to _find areas for improvement_. So, when we hit a big milestone, my gut reaction is to say, "Great, now that we've come this far, what else can we do to have a bigger impact?" Stopping and celebrating the team's accomplishments before moving on to the next challenge feels foriegn to me. It also makes me anxious that we are pausing in our progress. + +This is [what I've called an anxiety-driven performance loop][2]. The sense of accomplishment (and the external acknowledgement) after an achievement fuels a desire to immediately start looking for the next challenge. To some extent, this performance loop keeps me productive—even though it has other consequences, too. + +What I want to _avoid_ is transferring my anxiety to my team members. I don't want them to feel that I am continually saying, "What have you done for me lately?" even though that is how I feel the world is looking at me. That's an aspect of what I've called [an anxiety inaction loop][5]. + +I try hard to treat people with respect, to assume positive intent, to give people the room to do their work in the way they see fit. But, nonetheless, do my team members feel the kind of judgment from me that I continually impose on myself? + +At a fundamental level, I believe work is never done, that there is always another challenge to explore, other ways to have a larger impact. Leaders need to inspire and motivate us to embrace that reality as an exciting opportunity rather than an endless drudge or a source of continual worry. + +As a leader who suffers from anxiety, this is more challenging to do in practice than it is to understand intellectually. + +While this is an area of continual work for me, I've received some good advice on how to shield my colleagues from my own anxiety-driven loops, like: + + * If celebrating success and acknowledging achievement doesn't come naturally for you, build it into the plan from the start. Ensure you have the celebration of accomplishment accounted for from the beginning of a project. This can help reduce the "what have you done for me lately?" impulse that comes from moving quickly to the next challenge without pausing to acknowledge achievements. + * Work with another team member on acknowledgment and celebration efforts. Others might have different ideas on how to do this effectively, and may also enjoy the process. Giving this responsibility to someone else can help ensure it isn't lost. + * Practice compassion, gratitude, and empathy. This may not come naturally and may take some effort. Putting yourself in someone else's shoes, thinking about their perspective, thanking people for what they have done, and understanding their challenges can go a long way in shifting your own perspective. + * If you find yourself judging others, ask yourself, "Is this useful in terms of what I want or need from this situation?" That is, is carrying judgment going to help you accomplish your goal? Most likely, the answer is no. And, in fact, it may have the opposite effect! + + + +The above tips have been helpful for me. But the goal of this series hasn't been to provide solutions but rather to share my experiences and to use writing to explore my own tendencies and the impact they have on myself and others. I believe that acknowledging and sharing our personal challenges can reduce the [stigma][6] associated with mental illness, create the space needed to start exploring solutions, and to create environments that are more positive and invigorating to work in. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/20/2/working-anxiety-team-performance + +作者:[Sam Knuth][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/samfw +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-lead-web-internet.png?itok=UQ0zMNJ3 (Spider web on green background) +[2]: https://opensource.com/open-organization/20/1/leading-openly-anxiety +[3]: https://opensource.com/open-organization/resources/open-org-definition +[4]: https://opensource.com/article/17/2/what-happens-when-we-just-assume-positive-intent +[5]: https://opensource.com/open-organization/20/2/working-anxiety-inaction-loop +[6]: https://www.bloomberg.com/news/articles/2019-11-13/mental-health-is-still-a-don-t-ask-don-t-tell-subject-at-work From bd4b713df929278cace9bf4f91696d6cd9060d9f Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 26 Feb 2020 08:30:43 +0800 Subject: [PATCH 170/315] translated --- ...217 How to get MongoDB Server on Fedora.md | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 translated/tech/20200217 How to get MongoDB Server on Fedora.md diff --git a/translated/tech/20200217 How to get MongoDB Server on Fedora.md b/translated/tech/20200217 How to get MongoDB Server on Fedora.md new file mode 100644 index 0000000000..c7da999f65 --- /dev/null +++ b/translated/tech/20200217 How to get MongoDB Server on Fedora.md @@ -0,0 +1,132 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to get MongoDB Server on Fedora) +[#]: via: (https://fedoramagazine.org/how-to-get-mongodb-server-on-fedora/) +[#]: author: (Honza Horak https://fedoramagazine.org/author/hhorak/) + +如何在 Fedora 上获取 MongoDB 服务器 +====== + +![][1] + +Mongo(来自 “humongous”)是一个高性能,开源,无模式的面向文档的数据库,它是最受欢迎的 [NoSQL][2] 数据库之一。它使用 JSON 作为文档格式,并且可以在多个服务器节点之间进行扩展和复制。 + +### 有关许可证更改的故事 + +上游 MongoD 决定更改服务器代码的许可证已经一年多了。先前的许可证是 GNU Affero General Public License v3(AGPLv3)。但是,上游写了一个新许可证,为了使运行 MongoDB 即服务的公司回馈社区。新许可证称为 Server Side Public License(SSPLv1),关于这个及其原理的更多说明,请参见[MongoDB SSPL FAQ][3]。 + +Fedora 一直只包含自由软件。当 SSPL 发布后,Fedora [确定][4]它并不是自由软件许可。许可证更改日期(2018 年 10 月)之前发布的所有 MongoDB 版本都可保留在 Fedora 中,但之后再也不更新软件包会带来安全问题。因此,从 Fedora 30 开始,Fedora 社区决定完全[移除 MongoDB 服务器][5]。 + +### 开发人员还有哪些选择? + +是的,还有替代方案,例如 PostgreSQL 在最新版本中也支持 JSON,它可以在无法再使用 MongoDB 的情况下使用它。使用 JSONB 类型,索引在 PostgreSQL 中可以很好地工作,其性能可与 MongoDB 媲美,甚至不会受到 ACID 的影响。 + +开发人员可能选择 MongoDB 的技术原因并未随许可证而改变,因此许多人仍想使用它。重要的是要意识到,SSPL 许可证仅更改仅针对 MongoDB 服务器。MongoDB 上游还开发了其他项目,例如 MongoDB 工具,C 和 C++ 客户端库以及用于各种动态语言的连接器,这些项目在客户端(要通过网络与服务器通信的应用中)使用。由于这些包的许可证是自由的(主要是 Apache 许可证),因此它们保留在 Fedora 仓库中,因此用户可以将其用于应用开发。 + +唯一的变化实际是服务器包本身,它已从 Fedora 仓库中完全删除。让我们看看 Fedora 用户可以如何获取非自由的包。 + +### 如何从上游安装 MongoDB 服务器 + +当 Fedora 用户想要安装 MongoDB 服务器时,他们需要直接向上游获取 MongoDB。但是,上游不为 Fedora 提供 RPM 包。相反,MongoDB 服务器可以获取源码 tarball,用户需要自己进行编译(这需要一些开发知识),或者 Fedora 用户可以使用一些兼容的包。在兼容的选项中,最好的选择是 RHEL-8 RPM。以下步骤描述了如何安装它们以及如何启动守护进程。 + +#### 1\. 使用上游 RPM 创建仓库(RHEL-8 构建) +``` + +``` + +$ sudo cat > /etc/yum.repos.d/mongodb.repo &lt;&lt;EOF +[mongodb-upstream] +name=MongoDB Upstream Repository +baseurl= +gpgcheck=1 +enabled=1 +gpgkey= +EOF +``` + +``` + +#### 2\. 安装元软件包,来拉取服务器和工具包 +``` + +``` + +$ sudo dnf install mongodb-org +&lt;snipped> +Installed: +  mongodb-org-4.2.3-1.el8.x86_64           mongodb-org-mongos-4.2.3-1.el8.x86_64   +  mongodb-org-server-4.2.3-1.el8.x86_64    mongodb-org-shell-4.2.3-1.el8.x86_64 +  mongodb-org-tools-4.2.3-1.el8.x86_64           + +Complete! +``` + +``` + +#### 3\. 启动 MongoDB 守护进程 +``` + +``` + +$ sudo systemctl status mongod +● mongod.service - MongoDB Database Server +   Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled) +   Active: active (running) since Sat 2020-02-08 12:33:45 EST; 2s ago +     Docs: +  Process: 15768 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS) +  Process: 15769 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS) +  Process: 15770 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS) +  Process: 15771 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS) + Main PID: 15773 (mongod) +   Memory: 70.4M +      CPU: 611ms +   CGroup: /system.slice/mongod.service +           └─15773 /usr/bin/mongod -f /etc/mongod.conf +``` + +``` + +#### 4\. 通过 mongo shell 连接服务器来验证是否运行 +``` + +``` + +$ mongo +MongoDB shell version v4.2.3 +connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&amp;gssapiServiceName=mongodb +Implicit session: session { "id" : UUID("20b6e61f-c7cc-4e9b-a25e-5e306d60482f") } +MongoDB server version: 4.2.3 +Welcome to the MongoDB shell. +For interactive help, type "help". +For more comprehensive documentation, see +    +\--- + +> _ +``` + +``` + +就是这样了。如你所见,RHEL-8 包完美兼容,只要 Fedora 包还与 RHEL-8 兼容,它就应该会一直兼容。 请注意,在使用时必须遵守 SSPLv1 许可证。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-to-get-mongodb-server-on-fedora/ + +作者:[Honza Horak][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/hhorak/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/mongodb-816x348.png +[2]: https://en.wikipedia.org/wiki/NoSQL +[3]: https://www.mongodb.com/licensing/server-side-public-license/faq +[4]: https://lists.fedoraproject.org/archives/list/legal@lists.fedoraproject.org/thread/IQIOBOGWJ247JGKX2WD6N27TZNZZNM6C/ +[5]: https://fedoraproject.org/wiki/Changes/MongoDB_Removal From 89554a64694c63b36874d3adc21828d5653340e9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 26 Feb 2020 08:34:08 +0800 Subject: [PATCH 171/315] translating --- .../20200121 Syncthing- Open Source P2P File Syncing Tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md b/sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md index aa87c0f873..fe48819ada 100644 --- a/sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md +++ b/sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 65a5009c831672a177fa24aa25ec54a219f164aa Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 26 Feb 2020 08:55:03 +0800 Subject: [PATCH 172/315] Rename sources/tech/20200225 7 tips for writing an effective technical resume.md to sources/talk/20200225 7 tips for writing an effective technical resume.md --- .../20200225 7 tips for writing an effective technical resume.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200225 7 tips for writing an effective technical resume.md (100%) diff --git a/sources/tech/20200225 7 tips for writing an effective technical resume.md b/sources/talk/20200225 7 tips for writing an effective technical resume.md similarity index 100% rename from sources/tech/20200225 7 tips for writing an effective technical resume.md rename to sources/talk/20200225 7 tips for writing an effective technical resume.md From eda5156e9391cce8fd35c2d65fc08af93b3cb78e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 26 Feb 2020 08:56:35 +0800 Subject: [PATCH 173/315] Rename sources/tech/20200225 Spilling over- How working openly with anxiety affects my team.md to sources/talk/20200225 Spilling over- How working openly with anxiety affects my team.md --- ...lling over- How working openly with anxiety affects my team.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200225 Spilling over- How working openly with anxiety affects my team.md (100%) diff --git a/sources/tech/20200225 Spilling over- How working openly with anxiety affects my team.md b/sources/talk/20200225 Spilling over- How working openly with anxiety affects my team.md similarity index 100% rename from sources/tech/20200225 Spilling over- How working openly with anxiety affects my team.md rename to sources/talk/20200225 Spilling over- How working openly with anxiety affects my team.md From bebc2f2957399d3e68e77b0921c5cc1c1c2e84d6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 26 Feb 2020 09:41:59 +0800 Subject: [PATCH 174/315] PRF @HankChow --- ...IP addresses with the Linux dig command.md | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/translated/tech/20200214 Digging up IP addresses with the Linux dig command.md b/translated/tech/20200214 Digging up IP addresses with the Linux dig command.md index 0b95b0a753..95a29d30a8 100644 --- a/translated/tech/20200214 Digging up IP addresses with the Linux dig command.md +++ b/translated/tech/20200214 Digging up IP addresses with the Linux dig command.md @@ -1,22 +1,23 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Digging up IP addresses with the Linux dig command) [#]: via: (https://www.networkworld.com/article/3527430/digging-up-ip-addresses-with-the-dig-command.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) -使用 dig 命令查询 IP 地址 +使用 dig 命令挖掘域名解析信息 ====== -命令行工具 `dig` 是用于解析域名和故障排查的一个利器。 -从主要功能上来说,`dig` 和 `nslookup` 之间差异不大,但 `dig` 更像一个加强版的 `nslookup`,可以查询到一些由域名服务器管理的信息,这在排查某些问题的时候非常有用。总的来说,`dig` 是一个既简单易用又功能强大的命令行工具。 +> 命令行工具 `dig` 是用于解析域名和故障排查的一个利器。 + +![](https://img.linux.net.cn/data/attachment/album/202002/26/094028jgvzguau1pdgicpz.jpg) + +从主要功能上来说,`dig` 和 `nslookup` 之间差异不大,但 `dig` 更像一个加强版的 `nslookup`,可以查询到一些由域名服务器管理的信息,这在排查某些问题的时候非常有用。总的来说,`dig` 是一个既简单易用又功能强大的命令行工具。(LCTT 译注:`dig` 和 `nslookup` 行为的主要区别来自于 `dig` 使用是是操作系统本身的解析库,而 `nslookup` 使用的是该程序自带的解析库,这有时候会带来一些行为差异。此外,从表现形式上看,`dig` 返回是结果是以 BIND 配置信息的格式返回的,也带有更多的技术细节。) `dig` 最基本的功能就是查询域名信息,因此它的名称实际上是“域名信息查询工具Domain Information Groper”的缩写。`dig` 向用户返回的内容可以非常详尽,也可以非常简洁,展现内容的多少完全由用户在查询时使用的选项来决定。 -[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] - ### 我只需要查询 IP 地址 如果只需要查询某个域名指向的 IP 地址,可以使用 `+short` 选项: @@ -36,7 +37,7 @@ $ dig networkworld.com +short 151.101.194.165 ``` -也正是由于这些网站通过负载均衡实现高可用,在下一次查询的时候,或许会发现这几个 IP 地址的排序有所不同。 +也正是由于这些网站通过负载均衡实现高可用,在下一次查询的时候,或许会发现这几个 IP 地址的排序有所不同。(LCTT 译注:浏览器等应用默认会使用返回的第一个 IP 地址,因此这样实现了一种简单的负载均衡。) ``` $ dig networkworld.com +short @@ -78,8 +79,6 @@ networkworld.com. 300 IN A 151.101.2.165 由于域名服务器有缓存机制,返回的内容可能是之前缓存好的信息。在这种情况下,`dig` 最后显示的查询时间Query time会是 0 毫秒(0 msec): -[][2] - ``` ;; Query time: 0 msec <== ;; SERVER: 127.0.0.53#53(127.0.0.53) @@ -149,7 +148,7 @@ networkworld.com. 300 IN A 151.101.2.165 ### 批量查询域名 -如果你要查询多个域名,可以把这些域名写入到一个文件内,然后使用下面的 `dig` 命令遍历整个文件并给出所有查询结果。 +如果你要查询多个域名,可以把这些域名写入到一个文件内(`domains`),然后使用下面的 `dig` 命令遍历整个文件并给出所有查询结果。 ``` $ dig +noall +answer -f domains @@ -185,7 +184,7 @@ via: https://www.networkworld.com/article/3527430/digging-up-ip-addresses-with-t 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 446cc742c5498046d736ee142db2d7eccfd72665 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 26 Feb 2020 09:42:42 +0800 Subject: [PATCH 175/315] PUB @HankChow https://linux.cn/article-11931-1.html --- ...0214 Digging up IP addresses with the Linux dig command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200214 Digging up IP addresses with the Linux dig command.md (99%) diff --git a/translated/tech/20200214 Digging up IP addresses with the Linux dig command.md b/published/20200214 Digging up IP addresses with the Linux dig command.md similarity index 99% rename from translated/tech/20200214 Digging up IP addresses with the Linux dig command.md rename to published/20200214 Digging up IP addresses with the Linux dig command.md index 95a29d30a8..01f72b47fd 100644 --- a/translated/tech/20200214 Digging up IP addresses with the Linux dig command.md +++ b/published/20200214 Digging up IP addresses with the Linux dig command.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11931-1.html) [#]: subject: (Digging up IP addresses with the Linux dig command) [#]: via: (https://www.networkworld.com/article/3527430/digging-up-ip-addresses-with-the-dig-command.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From 31e7c3d234b0229d3a04d29d2396d3c168d434e6 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 26 Feb 2020 09:44:57 +0800 Subject: [PATCH 176/315] translating by lujun9972 --- .../tech/20200123 6 things you should be doing with Emacs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200123 6 things you should be doing with Emacs.md b/sources/tech/20200123 6 things you should be doing with Emacs.md index b01830cd8e..e23e9b7ccb 100644 --- a/sources/tech/20200123 6 things you should be doing with Emacs.md +++ b/sources/tech/20200123 6 things you should be doing with Emacs.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lujun9972) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8eb343dfa7346eec67903fe3f0b198f3e8884ff3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 26 Feb 2020 10:36:48 +0800 Subject: [PATCH 177/315] PRF @lujun9972 --- ...mail and check your calendar with Emacs.md | 62 ++++++++----------- 1 file changed, 27 insertions(+), 35 deletions(-) diff --git a/translated/tech/20200128 Send email and check your calendar with Emacs.md b/translated/tech/20200128 Send email and check your calendar with Emacs.md index cb5fff0849..04ccdee3f1 100644 --- a/translated/tech/20200128 Send email and check your calendar with Emacs.md +++ b/translated/tech/20200128 Send email and check your calendar with Emacs.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Send email and check your calendar with Emacs) @@ -9,9 +9,10 @@ 使用 Emacs 发送电子邮件和检查日历 ====== -使用 Emacs 文本编辑器管理电子邮件和查看日程安排,这是本系列文章 (2020 年使用开放源码提高生产力的 20 种方法)的第十八篇,。 -![Document sending][1] +> 在 2020 年用开源实现更高生产力的二十种方式的第十八篇文章中,使用 Emacs 文本编辑器管理电子邮件和查看日程安排。 + +![](https://img.linux.net.cn/data/attachment/album/202002/26/103647mnee75vxhcc00z06.jpg) 去年,我给你们带来了 2019 年的 19 天新生产力工具系列。今年,我将采取一种不同的方式:建立一个新的环境,让你使用已用或未用的工具来在新的一年里变得更有效率。 @@ -19,23 +20,20 @@ 两天前,我曾经说过我经常使用 [Vim][2] 和 [Emacs][3],在本系列的 [16][4] 和 [17][5] 天,我讲解了如何在 Vim 中做几乎所有的事情。现在,Emacs 的时间到了! -[Emacs 中的邮件和日历 ][6] +![Emacs 中的邮件和日历][6] -在深入之前,我需要说明两件事。首先,我这里使用默认的 Emacs 配置,而不是我之前[写过 ][8] 的 [Spacemacs][7]。为什么呢?因为这样一来我使用的就是默认快捷键,从而使你可以参考文档,而不必将“本机 Emacs” 转换为 Spacemacs。第二,在本系列文章中我没有对 Org 模式进行任何设置。Org 模式本身几乎可以自成一个完整的系列,它非常强大,但是设置可能非常复杂。 +在深入之前,我需要说明两件事。首先,我这里使用默认的 Emacs 配置,而不是我之前[写过][8]的 [Spacemacs][7]。为什么呢?因为这样一来我使用的就是默认快捷键,从而使你可以参考文档,而不必将“原生的 Emacs” 转换为 Spacemacs。第二,在本系列文章中我没有对 Org 模式进行任何设置。Org 模式本身几乎可以自成一个完整的系列,它非常强大,但是设置可能非常复杂。 #### 配置 Emacs 配置 Emacs 比配置 Vim 稍微复杂一些,但以我之见,从长远来看,这样做是值得的。首先我们创建一个配置文件,并在 Emacs 中打开它: - ``` mkdir ~/.emacs.d emacs ~/.emacs.d/init.el ``` -Next,add some additional package sources to the built-in package manager。Add the following to **init.el**: -接下来,向内置的包管理器添加一些额外的包源。在 **init.el** 中添加以下内容: - +接下来,向内置的包管理器添加一些额外的包源。在 `init.el` 中添加以下内容: ``` (package-initialize) @@ -45,9 +43,7 @@ Next,add some additional package sources to the built-in package manager。Add (package-refresh-contents) ``` -使用 `Ctrl+x Ctrl+s` 保存文件,然后按下 `Ctrl+x Ctrl+c` 退出,再重启 Emacs。Emacs 会在启动时下载所有的插件包列表,之后你就可以使用内置的包管理器安装插件了。 -输入 `Meta+x` 会弹出命令提示符(大多数键盘上 **Meta** 键就是的 **Alt** 键,而在 MacOS 上则是 **Option**)。在命令提示符下输入 **package-list-packages** 就会显示可以安装的包列表。遍历该列表并使用 **i** 键选择以下包: - +使用 `Ctrl+x Ctrl+s` 保存文件,然后按下 `Ctrl+x Ctrl+c` 退出,再重启 Emacs。Emacs 会在启动时下载所有的插件包列表,之后你就可以使用内置的包管理器安装插件了。输入 `Meta+x` 会弹出命令提示符(大多数键盘上 `Meta` 键就是的 `Alt` 键,而在 MacOS 上则是 `Option`)。在命令提示符下输入 `package-list-packages` 就会显示可以安装的包列表。遍历该列表并使用 `i` 键选择以下包: ``` bbdb @@ -57,10 +53,8 @@ calfw-ical notmuch ``` -选好软件包后按 **x** 安装它们。根据你的网络连接情况,这可能需要一段时间。你也许会看到一些编译错误,但是可以忽略它们。 -安装完成后,使用组合键 `Ctrl+x Ctrl+f` 打开 `~/.emacs.d/init.el`,并在 `(package-refresh-packages)` 之后 `(custom-set-variables` 之前添加以下行到文件中。 -`(custom-set-variables` 行由 Emacs 内部维护,你永远不应该修改它之后的任何内容。以**;;**开头的行则是注释。 - +选好软件包后按 `x` 安装它们。根据你的网络连接情况,这可能需要一段时间。你也许会看到一些编译错误,但是可以忽略它们。安装完成后,使用组合键 `Ctrl+x Ctrl+f` 打开 `~/.emacs.d/init.el`,并在 `(package-refresh-packages)` 之后、 `(custom-set-variables` 之前添加以下行到文件中。 +`(custom-set-variables` 行由 Emacs 内部维护,你永远不应该修改它之后的任何内容。以 `;;` 开头的行则是注释。 ``` ;; Set up bbdb @@ -82,41 +76,39 @@ notmuch       user-full-name "My Name") ``` -现在,您已经准备好使用自己的配置启动 Emacs 了!保存 `init.el` 文件 (`Ctrl+x Ctrl+s`),退出 Emacs(`Ctrl+x Ctrl+c`),然后重启之。这次重启要多花些时间。 +现在,你已经准备好使用自己的配置启动 Emacs 了!保存 `init.el` 文件(`Ctrl+x Ctrl+s`),退出 Emacs(`Ctrl+x Ctrl+c`),然后重启之。这次重启要多花些时间。 #### 使用 Notmuch 在 Emacs 中读写电子邮件 -一旦你看到了 Emacs 启动屏幕,你就可以使用 [Notmuch][10] 来阅读电子邮件了。键入 `Meta+x notmuch`,您将看到 notmuch 的 Emacs 接口。 +一旦你看到了 Emacs 启动屏幕,你就可以使用 [Notmuch][10] 来阅读电子邮件了。键入 `Meta+x notmuch`,你将看到 notmuch 的 Emacs 界面。 -![使用 notmuch 阅读邮件 ][11] +![使用 notmuch 阅读邮件][11] -所有加粗的项目都是指向电子邮件视图的链接。你可以通过点击鼠标或者使用 tab 键在它们之间跳转并按 **Return** 或 **Enter** 来访问它们。你可以使用搜索栏来搜索 Notmuch 的数据库,语法与 Notmuch 命令行上的[语法 ][12] 相同。如果你愿意,还可以使用 **[save]** 按钮保存搜索以便未来使用,这些搜索会被添加到屏幕顶部的列表中。如果你进入一个链接就会看到一个相关电子邮件的列表。您可以使用**箭头**键在列表中导航,并在要读取的消息上按 **Enter**。按 **r** 可以回复一条消息,**f** 转发该消息,**q** 退出当前屏幕。 +所有加粗的项目都是指向电子邮件视图的链接。你可以通过点击鼠标或者使用 `tab` 键在它们之间跳转并按回车来访问它们。你可以使用搜索栏来搜索 Notmuch 的数据库,语法与 Notmuch 命令行上的[语法][12] 相同。如果你愿意,还可以使用 `[save]` 按钮保存搜索以便未来使用,这些搜索会被添加到屏幕顶部的列表中。如果你进入一个链接就会看到一个相关电子邮件的列表。你可以使用箭头键在列表中导航,并在要读取的消息上按回车。按 `r` 可以回复一条消息,`f` 转发该消息,`q` 退出当前屏幕。 -You can write a new message by typing **Meta**+**x compose-mail**。Composing,replying,and forwarding all bring up the mail writing interface。When you are done writing your email,press **Ctrl**+**c Ctrl**+**c** to send it。If you decide you don't want to send it,press **Ctrl**+**c Ctrl**+**k** to kill the message compose buffer (window)。 -您可以通过键入 `Meta+x compose-mail` 来编写新消息。撰写、回复和转发都将打开编写邮件的接口。写完邮件后,按 `Ctrl+c Ctrl+c` 发送。如果你决定不发送它,按 `Ctrl+c Ctrl+k` 关闭消息撰写缓冲区(窗口)。 +你可以通过键入 `Meta+x compose-mail` 来编写新消息。撰写、回复和转发都将打开编写邮件的界面。写完邮件后,按 `Ctrl+c Ctrl+c` 发送。如果你决定不发送它,按 `Ctrl+c Ctrl+k` 关闭消息撰写缓冲区(窗口)。 #### 使用 BBDB 在 Emacs 中自动补完电子邮件地址 -[在消息中使用 BBDB 地址 ][13] +![在消息中使用 BBDB 地址][13] 那么通讯录怎么办?这就是 [BBDB][14] 发挥作用的地方。但首先我们需要从 [abook][15] 导入所有地址,方法是打开命令行并运行以下导出命令: - ``` -`abook --convert --outformat vcard --outfile ~/all-my-addresses.vcf --infile ~/.abook/addresses` +abook --convert --outformat vcard --outfile ~/all-my-addresses.vcf --infile ~/.abook/addresses ``` -Emacs 启动后,运行 `Meta+x bbdb-vcard-import-file`。它将提示你输入要导入的文件名,即 `~/all-my-address.vcf`。导入完成后,在编写消息时,可以开始输入名称并使用 **Tab** 搜索和自动完成 “to” 字段的内容。BBDB 还会打开一个联系人缓冲区,以便你确保它是正确的。 +Emacs 启动后,运行 `Meta+x bbdb-vcard-import-file`。它将提示你输入要导入的文件名,即 `~/all-my-address.vcf`。导入完成后,在编写消息时,可以开始输入名称并使用 `Tab` 搜索和自动完成 “to” 字段的内容。BBDB 还会打开一个联系人缓冲区,以便你确保它是正确的。 -既然在 [vdirsyncer][16] 中已经为每个地址都生成了对应的 vcf。文件了,为什么我们还要这样做呢?如果你像我一样,有许多地址,一次处理一个地址是很麻烦的。这样做,你就可以把所有的东西都放在一本书里,做成一个大文件。 +既然在 [vdirsyncer][16] 中已经为每个地址都生成了对应的 .vcf 文件了,为什么我们还要这样做呢?如果你像我一样,有许多地址,一次处理一个地址是很麻烦的。这样做,你就可以把所有的东西都放在 abook 里,做成一个大文件。 #### 使用 calfw 在 Emacs 中浏览日历 ![calfw 日历 ][17] -最后,你可以使用 Emacs 查看日历。在上面的配置中,你安装了 [calfw][18] 包,并添加了一些行来告诉它在哪里可以找到要加载的日历。Calfw 是 Emacs 日历框架的简称,它支持多种日历格式。我使用的是谷歌日历,这也是我放在配置中的链接。日历将在启动时自动加载,您可以通过 `Ctrl+x+b` 命令切换到 **cfw-calendar** 缓冲区来查看日历。 +最后,你可以使用 Emacs 查看日历。在上面的配置中,你安装了 [calfw][18] 包,并添加了一些行来告诉它在哪里可以找到要加载的日历。Calfw 是 “Emacs 日历框架Calendar Framework for Emacs”的简称,它支持多种日历格式。我使用的是谷歌日历,这也是我放在配置中的链接。日历将在启动时自动加载,你可以通过 `Ctrl+x+b` 命令切换到 cfw-calendar 缓冲区来查看日历。 -Calfw 提供日、周、双周和月视图。您可以在日历顶部选择视图,并使用**箭头**键导航日历。不幸的是,calfw 只能查看日历,所以您仍然需要使用 [khal][19] 之类的工具或通过 web 界面来添加、删除和修改事件。 +Calfw 提供日、周、双周和月视图。你可以在日历顶部选择视图,并使用箭头键导航日历。不幸的是,calfw 只能查看日历,所以你仍然需要使用 [khal][19] 之类的工具或通过 web 界面来添加、删除和修改事件。 这就是 Emacs 中的邮件、日历和邮件地址。明天我会展示更多。 @@ -127,7 +119,7 @@ via: https://opensource.com/article/20/1/emacs-mail-calendar 作者:[Kevin Sonney][a] 选题:[lujun9972][b] 译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -136,19 +128,19 @@ via: https://opensource.com/article/20/1/emacs-mail-calendar [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_paper_envelope_document.png?itok=uPj_kouJ (Document sending) [2]: https://www.vim.org/ [3]: https://www.gnu.org/software/emacs/ -[4]: https://opensource.com/article/20/1/vim-email-calendar -[5]: https://opensource.com/article/20/1/vim-task-list-reddit-twitter +[4]: https://linux.cn/article-11908-1.html +[5]: https://linux.cn/article-11912-1.html [6]: https://opensource.com/sites/default/files/uploads/productivity_18-1.png (Mail and calendar in Emacs) [7]: https://www.spacemacs.org/ [8]: https://opensource.com/article/19/12/spacemacs [9]: mailto:myemail@mydomain.com [10]: https://notmuchmail.org/ [11]: https://opensource.com/sites/default/files/uploads/productivity_18-2.png (Reading mail with Notmuch) -[12]: https://opensource.com/article/20/1/organize-email-notmuch +[12]: https://linux.cn/article-11807-1.html [13]: https://opensource.com/sites/default/files/uploads/productivity_18-3.png (Composing a message with BBDB addressing) [14]: https://www.jwz.org/bbdb/ -[15]: https://opensource.com/article/20/1/sync-contacts-locally -[16]: https://opensource.com/article/20/1/open-source-calendar +[15]: https://linux.cn/article-11834-1.html +[16]: https://linux.cn/article-11812-1.html [17]: https://opensource.com/sites/default/files/uploads/productivity_18-4.png (calfw calendar) [18]: https://github.com/kiwanami/emacs-calfw [19]: https://khal.readthedocs.io/en/v0.9.2/index.html From dcff6a4c5436cb06be436c8bf6a4a5805565d2aa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 26 Feb 2020 10:40:07 +0800 Subject: [PATCH 178/315] PUB @lujun9972 https://linux.cn/article-11932-1.html --- .../20200128 Send email and check your calendar with Emacs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200128 Send email and check your calendar with Emacs.md (99%) diff --git a/translated/tech/20200128 Send email and check your calendar with Emacs.md b/published/20200128 Send email and check your calendar with Emacs.md similarity index 99% rename from translated/tech/20200128 Send email and check your calendar with Emacs.md rename to published/20200128 Send email and check your calendar with Emacs.md index 04ccdee3f1..2ffdbd22d7 100644 --- a/translated/tech/20200128 Send email and check your calendar with Emacs.md +++ b/published/20200128 Send email and check your calendar with Emacs.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11932-1.html) [#]: subject: (Send email and check your calendar with Emacs) [#]: via: (https://opensource.com/article/20/1/emacs-mail-calendar) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From e325b776eb2fc65600e887d7edd87105888ba91b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 26 Feb 2020 11:49:01 +0800 Subject: [PATCH 179/315] PRF @geekpi --- ...20200219 Don-t like IDEs- Try grepgitvi.md | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/translated/tech/20200219 Don-t like IDEs- Try grepgitvi.md b/translated/tech/20200219 Don-t like IDEs- Try grepgitvi.md index a9b0118513..eaeda1abea 100644 --- a/translated/tech/20200219 Don-t like IDEs- Try grepgitvi.md +++ b/translated/tech/20200219 Don-t like IDEs- Try grepgitvi.md @@ -1,26 +1,27 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Don't like IDEs? Try grepgitvi) [#]: via: (https://opensource.com/article/20/2/no-ide-script) [#]: author: (Yedidyah Bar David https://opensource.com/users/didib) -不喜欢 IDE 么?试试看 grepgitvi +不喜欢 IDE?试试看 grepgitvi ====== -一个简单又原始的脚本来用 Vim 打开你选择的文件。 -![Files in a folder][1] -像大多数开发者一样,我整天都在搜索和阅读源码。就我个人而言,我从来没有习惯集成开发环境 (IDE),多年来,我主要使用 **grep** 并复制/粘贴的文件名来打开 Vi(m)。 +> 一个简单又原始的脚本来用 Vim 打开你选择的文件。 + +![](https://img.linux.net.cn/data/attachment/album/202002/26/113942a99a1aujmjpfnfrh.jpg) + +像大多数开发者一样,我整天都在搜索和阅读源码。就我个人而言,我从来没有习惯过集成开发环境 (IDE),多年来,我主要使用 `grep` (找到文件),并复制/粘贴文件名来打开 Vi(m)。 最终,我写了这个脚本,并根据需要缓慢地对其进行了完善。 -它依赖 [Vim][2] 和 [rlwrap][3],并使用 Apache 2.0 许可开源。要使用该脚本,请[将它放到 PATH 中][4],然后在文本目录下运行: - +它依赖 [Vim][2] 和 [rlwrap][3],并使用 Apache 2.0 许可证开源。要使用该脚本,请[将它放到 PATH 中][4],然后在文本目录下运行: ``` -`grepgitvi ` +grepgitvi ``` 它将返回搜索结果的编号列表,并提示你输入结果编号并打开 Vim。退出 Vim 后,它将再次显示列表,直到你输入除结果编号以外的任何内容。你也可以使用向上和向下箭头键选择一个文件。(这对我来说)更容易找到我已经看过的结果。 @@ -42,7 +43,7 @@ # # Requires vim and rlwrap # -# Usage: grepgitvi <grep options> <grep/vim pattern> +# Usage: grepgitvi # TMPD=$(mktemp -d /tmp/grepgitvi.XXXXXX) @@ -51,36 +52,36 @@ COLORED=${TMPD}/colored RLHIST=${TMPD}/readline-history -[ -z "${DIRS}" ] && DIRS=. +[ -z "${DIRS}" ] && DIRS=. cleanup() { -        rm -rf "${TMPD}" + rm -rf "${TMPD}" } trap cleanup 0 -find ${DIRS} -iname .git -prune -o \\! -iname "*.min.css*" -type f -print0 > ${TMPD}/allfiles +find ${DIRS} -iname .git -prune -o \! -iname "*.min.css*" -type f -print0 > ${TMPD}/allfiles -cat ${TMPD}/allfiles | xargs -0 grep --color=always -n -H "$@" > $COLORED -cat ${TMPD}/allfiles | xargs -0 grep -n -H "$@" > $UNCOLORED +cat ${TMPD}/allfiles | xargs -0 grep --color=always -n -H "$@" > $COLORED +cat ${TMPD}/allfiles | xargs -0 grep -n -H "$@" > $UNCOLORED max=`cat $UNCOLORED | wc -l` pat="${@: -1}" inp='' while true; do -        echo "============================ grep results ===============================" -        cat $COLORED | nl -        echo "============================ grep results ===============================" -        prompt="Enter a number between 1 and $max or anything else to quit: " -        inp=$(rlwrap -H $RLHIST bash -c "read -p \"$prompt\" inp; echo \$inp") -        if ! echo "$inp" | grep -q '^[0-9][0-9]*$' || [ "$inp" -gt "$max" ]; then -                break -        fi + echo "============================ grep results ===============================" + cat $COLORED | nl + echo "============================ grep results ===============================" + prompt="Enter a number between 1 and $max or anything else to quit: " + inp=$(rlwrap -H $RLHIST bash -c "read -p \"$prompt\" inp; echo \$inp") + if ! echo "$inp" | grep -q '^[0-9][0-9]*$' || [ "$inp" -gt "$max" ]; then + break + fi -        filename=$(cat $UNCOLORED | awk -F: "NR==$inp"' {print $1}') -        linenum=$(cat $UNCOLORED | awk -F: "NR==$inp"' {print $2-1}') -        vim +:"$linenum" +"norm zz" +/"${pat}" "$filename" + filename=$(cat $UNCOLORED | awk -F: "NR==$inp"' {print $1}') + linenum=$(cat $UNCOLORED | awk -F: "NR==$inp"' {print $2-1}') + vim +:"$linenum" +"norm zz" +/"${pat}" "$filename" done ``` @@ -91,7 +92,7 @@ via: https://opensource.com/article/20/2/no-ide-script 作者:[Yedidyah Bar David][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/) 荣誉推出 From 0ca2df9cf88212e1a92c1ebe0a38f726c4438934 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 26 Feb 2020 11:50:00 +0800 Subject: [PATCH 180/315] PUB @geekpi https://linux.cn/article-11934-1.html --- .../20200219 Don-t like IDEs- Try grepgitvi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200219 Don-t like IDEs- Try grepgitvi.md (98%) diff --git a/translated/tech/20200219 Don-t like IDEs- Try grepgitvi.md b/published/20200219 Don-t like IDEs- Try grepgitvi.md similarity index 98% rename from translated/tech/20200219 Don-t like IDEs- Try grepgitvi.md rename to published/20200219 Don-t like IDEs- Try grepgitvi.md index eaeda1abea..7284c57f0f 100644 --- a/translated/tech/20200219 Don-t like IDEs- Try grepgitvi.md +++ b/published/20200219 Don-t like IDEs- Try grepgitvi.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11934-1.html) [#]: subject: (Don't like IDEs? Try grepgitvi) [#]: via: (https://opensource.com/article/20/2/no-ide-script) [#]: author: (Yedidyah Bar David https://opensource.com/users/didib) From 1c13f5f3ce0cdca406eed90801400e6fb522bddb Mon Sep 17 00:00:00 2001 From: way-ww <40491614+way-ww@users.noreply.github.com> Date: Wed, 26 Feb 2020 17:56:04 +0800 Subject: [PATCH 181/315] request to translate --- ...isable SSH Access For A Particular User Or Group In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md b/sources/tech/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md index a717d05ed8..07cb009634 100644 --- a/sources/tech/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md +++ b/sources/tech/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (way-ww) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 33f0cd5d5c64795316a73659b0c7aca1756a9049 Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Wed, 26 Feb 2020 17:57:27 +0800 Subject: [PATCH 182/315] translating --- ...20200225 7 tips for writing an effective technical resume.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20200225 7 tips for writing an effective technical resume.md b/sources/talk/20200225 7 tips for writing an effective technical resume.md index b3a32876b4..d91ab742d3 100644 --- a/sources/talk/20200225 7 tips for writing an effective technical resume.md +++ b/sources/talk/20200225 7 tips for writing an effective technical resume.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Morisun029) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8a2039b60557c8854baa2cdcc4420f217f8a6a02 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 26 Feb 2020 18:08:46 +0800 Subject: [PATCH 183/315] translate done: 20200123 6 things you should be doing with Emacs.md --- ...6 things you should be doing with Emacs.md | 91 ---------------- ...6 things you should be doing with Emacs.md | 102 ++++++++++++++++++ 2 files changed, 102 insertions(+), 91 deletions(-) delete mode 100644 sources/tech/20200123 6 things you should be doing with Emacs.md create mode 100644 translated/tech/20200123 6 things you should be doing with Emacs.md diff --git a/sources/tech/20200123 6 things you should be doing with Emacs.md b/sources/tech/20200123 6 things you should be doing with Emacs.md deleted file mode 100644 index e23e9b7ccb..0000000000 --- a/sources/tech/20200123 6 things you should be doing with Emacs.md +++ /dev/null @@ -1,91 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lujun9972) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (6 things you should be doing with Emacs) -[#]: via: (https://opensource.com/article/20/1/emacs-cheat-sheet) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -6 things you should be doing with Emacs -====== -Here are six things you may not have realized you could do with Emacs. -Then, get our new cheat sheet to get the most out of Emacs. -![Text editor on a browser, in blue][1] - -Imagine using Python's IDLE interface to edit text. You would be able to load files into memory, edit them, and save changes. But every action you perform would be defined by a Python function. Making a word all capitals, for instance, calls **upper()**, opening a file calls **open**, and so on. Everything in your text document is a Python object and can be manipulated accordingly. From the user's perspective, it's the same experience as any text editor. For a Python developer, it's a rich Python environment that can be changed and developed with just a few custom functions in a config file. - -This is what [Emacs][2] does for the 1958 programming language [Lisp][3]. In Emacs, there's no separation between the Lisp engine running the application and the arbitrary text you type into it. To Emacs, everything is Lisp data, so everything can be analyzed and manipulated programmatically. - -That makes for a powerful user interface (UI). But if you're a casual Emacs user, you may only be scratching the surface of what it can do for you. Here are six things you may not have realized you could do with Emacs. - -## Use Tramp mode for cloud editing - -Emacs has been network-transparent for a lot longer than has been trendy, and today it still provides one of the smoothest remote editor experiences available. The [Tramp mode][4] in Emacs (formerly known as RPC mode) stands for "Transparent Remote (file) Access, Multiple Protocol," which spells out exactly what it offers: easy access to remote files you want to edit over most popular network protocols. The most popular and safest protocol for remote editing these days is [OpenSSH][5], so that's the default. - -Tramp is already included in Emacs 22.1 or greater, so to use Tramp, you just open a file in the Tramp syntax. In the **File** menu of Emacs, select **Open File**. When prompted in the mini-buffer at the bottom of the Emacs window, enter the file name using this syntax: - - -``` -`/ssh:user@example.com:/path/to/file` -``` - -If you are required to log in interactively, Tramp prompts you for your password. However, Tramp uses OpenSSH directly, so to avoid interactive prompts, you can also add your hostname, username, and SSH key path to your **~/.ssh/config** file. Like Git, Emacs uses your SSH config first and only stops to ask for more information in the event of an error. - -Tramp is great for editing files that don't exist on your computer, and the user experience is not noticeably any different from editing a local file. The next time you start to SSH into a server just to launch a Vim or Emacs session, try Tramp instead. - -## Calendaring - -If you parse text better than you parse graphical interfaces, you'll be happy to know that you can schedule your day (or life) in plain text with Emacs but still get fancy notifications on your mobile device with open source [Org mode][6] viewers. - -The process takes a little setup to create a convenient way to sync your agenda with your mobile device (I use Git, but you could invoke Bluetooth, KDE Connect, Nextcloud, or your file synchronization tool of choice), and you have to install an Org mode viewer (such as [Orgzly][7]) and a Git client app on your mobile. Once you've got your infrastructure sorted, though, the process is inherently perfectly integrated with your usual (or developing, if you're a new user) Emacs workflow. You can refer to your agenda easily in Emacs, make updates to your schedule, and generally stay on task. Pushing changes to your agenda is reflected on your mobile, so you can stay organized even when Emacs isn't available. - -![][8] - -Intrigued? Read my step-by-step guide about [calendaring with Org mode and Git][9]. - -## Access the terminal - -There are [lots of terminal emulators][10] available. Although the Elisp terminal emulator in Emacs isn't the greatest general-purpose one, it's got two notable advantages. - - 1. **Opens in an Emacs buffer: **I use Emacs' Elisp shell because it's conveniently located in my Emacs window, which I often run in fullscreen. It's a small but significant advantage to have a terminal just a **Ctrl+x+o** (or C-x o in Emacs notation) away, and it's especially nice to be able to glance over at it for status reports when it's running a lengthy job. - 2. **Easy copying and pasting if no system clipboard is available:** Whether I'm too lazy to move my hand from the keys to the mouse, or I don't have mouse functionality because I'm running Emacs in a remote console, having a terminal in Emacs can sometimes mean a quick transfer of data from my Emacs buffer to Bash. - - - -To try the Emacs terminal, type **Alt**+**x** (**M-x** in Emacs notation), then type **shell**, and press **Return**. - -## Use Racket mode - -[Racket][11] is an exciting emerging Lisp dialect with a dynamic programming environment, a GUI toolkit, and a passionate community. The default editor when learning Racket is DrRacket, which has a Definitions panel at the top and an Interactions panel at the bottom. Using this setup, the user writes definitions that affect the Racket runtime. Imagine the old [Logo Turtle][12] program, but with a terminal instead of just a turtle. - -![Racket-mode][13] - -LGPL sample code by PLT - -Emacs, being based on Lisp, makes a great integrated development environment (IDE) for advanced Racket coders. It doesn't ship with [Racket mode][14] (yet), but you can install Racket mode and several other helper extensions using the Emacs package installer. To install it, press **Alt**+**X** (**M-x** in Emacs notation), type **package-install**, and press **Return**. Then enter the package you want to install (**racket-mode**), and press **Return**. - -Enter Racket mode with **M-x racket-mode**. If you're new to Racket but not to Lisp or Emacs, start with the excellent [Quick introduction to Racket with pictures][15]. - -## Scripting - -You might know that Bash scripts are popular for automating and enhancing your Linux or Unix experience. You may have heard that Python does a pretty good job of that, too. But did you know that Lisp scripts can be run in much the same way? There's sometimes confusion about just how useful Lisp really is because many people are introduced to Lisp through Emacs, so there's the latent impression that the only way to run Lisp in the 21st century is to open an Emacs window. Luckily, that's not the case at all, and Emacs is a great IDE for the tools that enable you to run Lisp scripts as general system executables. - -There are two popular modern Lisps, aside from Elisp, that are easy to run as standalone scripts. - - 1. **Racket:** You can run Racket scripts relying on your system's Racket install to provide runtime support, or you can use **raco exe** to produce an executable. The **raco exe** command packages your code together with runtime support files to create an executable. The **raco distribute** command then packages that executable into a distribution that works on other machines. Emacs has many Racket-specific tools, so creating Racket files in Emacs is easy and efficient. - - 2. **GNU Guile:** [GNU Guile][16] (short for "GNU Ubiquitous Intelligent Language for Extensions") is an implementation of the [Scheme][17] programming language that's used for creating applications and games for the desktop, internet, terminal, and more. Writing Scheme is easy, using any one of the many Scheme extensions in Emacs. For example, here's a "Hello world" script in Guile: [code] #!/usr/bin/guile -s -!# - -(display "hello world") -     (newline) [/code] Compile and run it with the **guile** command: [code] $ guile ./hello.scheme -;;; compiling /home/seth/./hello.scheme -;;; compiled [...]/hello.scheme.go -hello world -$ guile ./hello.scheme -hello world -``` -## Run Elisp without Emacs - -Emacs can serve as an Elisp runtime, but you don't have to "open" Emacs in the traditional sense. The **\--script** option allows you to run Elisp scripts using Emacs as the engine but without launching the Emacs GUI (not even its terminal-based one). In this example, the **-Q** option causes Emacs to ignore your **.emacs** file to avoid any delays in executing the Elisp script (if your script relies upon something \ No newline at end of file diff --git a/translated/tech/20200123 6 things you should be doing with Emacs.md b/translated/tech/20200123 6 things you should be doing with Emacs.md new file mode 100644 index 0000000000..62ad555cd3 --- /dev/null +++ b/translated/tech/20200123 6 things you should be doing with Emacs.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 things you should be doing with Emacs) +[#]: via: (https://opensource.com/article/20/1/emacs-cheat-sheet) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +6 件你应该用 Emacs 做的事 +====== +下面六件事情你可能都没有意识到可以在 Emacs 下完成。此外,使用我们的新备忘单来充分利用 Emacs 的功能吧。 +![浏览器上给蓝色编辑器 ][1] + +想象一下使用 Python 的 IDLE 界面来编辑文本。你可以将文件加载到内存中,编辑它们,并保存更改。但是你执行的每个操作都由 Python 函数定义。例如,调用 **upper()** 来让一个单词全部大写,调用 **open** 打开文件,等等。文本文档中的所有内容都是 Python 对象,可以进行相应的操作。从用户的角度来看,这与其他文本编辑器的体验一致。对于 Python 开发人员来说,这是一个丰富的 Python 环境,只需在配置文件中添加几个自定义函数就可以对其进行更改和开发。 + +这就是 [Emacs][2] 使用 1958 年的编程语言 [Lisp][3] 所做的事情。在 Emacs 中,运行应用程序的 Lisp 引擎与输入文本之间无缝结合。对 Emacs 来说,一切都是 Lisp 数据,因此一切都可以通过编程进行分析和操作。 + +这就形成了一个强大的用户界面 (UI)。但是,如果您是 Emacs 的普通用户,您可能对它的能力知之甚少。下面是你可能没有意识到 Emacs 可以做的六件事。 + +## 使用 Tramp mode 进行云端编辑 + +Emacs 早在网络流行话之前就实现了透明的网络编辑能力了,而且时至今日,它仍然提供了最流畅的远程编辑体验。Emacs 中的 [Tramp mode][4]( 以前称为 RPC mode) 代表着 “Transparent Remote (file) Access,Multiple Protocol( 透明的远程(文件)访问,多协议)”,这详细描述了它提供的功能:通过最流行的网络协议轻松访问您希望编辑的远程文件。目前最流行、最安全的远程编辑协议是 [OpenSSH][5],因此 Tramp 使用它作为默认的协议。 + +在 Emacs 22.1 或更高版本中已经包含了 Tramp,因此要使用 Tramp,只需使用 Tramp 语法打开一个文件。在 Emacs 的 **File** 菜单中,选择 **Open File**。当在 Emacs 窗口底部的小缓冲区中出现提示时,使用以下语法输入文件名: + +``` +`/ssh:user@example.com:/path/to/file` +``` + +如果需要交互式登录,Tramp 会提示输入密码。但是,Tramp 直接使用 OpenSSH,所以为了避免交互提示,你可以将主机名、用户名和 SSH 密钥路径添加到您的 `~/.ssh/config` 文件。与 Git 一样,Emacs 首先使用 SSH 配置,只有在出现错误时才会停下来询问更多信息。 + +Tramp 非常适合编辑计算机上不存在的文件,它的用户体验与编辑本地文件没有明显的区别。下次,当你 SSH 到服务器启动 Vim 或 Emacs 会话时,请尝试使用 Tramp。 + +## 日历 + +如果你喜欢文本多过图形界面,那么你一定会很高兴地知道,可以使用 Emacs 以纯文本的方式安排你的日程(或生活)。而且你依然可以在移动设备上使用开放源码的 [Org mode][6] 查看器来获得华丽的通知。 + +这个过程需要一些配置来创建一个方便的方式来与移动设备同步你的日程(我使用 Git,但你可以调用蓝牙,KDE Connect,Nextcloud,或其他文件同步工具),此外你必须安装一个 Org mode 查看器(如 [Orgzly][7]) 以及移动设备上的 Git 客户程序。但是,一旦你搭建好了这些基础,该流程就会与您常用的(或正在完善的,如果您是新用户 )Emacs 工作流完美地集成在一起。你可以在 Emacs 中方便地查阅日程,更新日程,并专注于任务上。议程上的变化将会反映在移动设备上,因此即使在 Emacs 不可用的时候,你也可以保持条理性。 + +![][8] + +感兴趣了?阅读我的关于[使用 Org mode 和 Git 进行日程安排 ][9] 的逐步指南。 + +## 访问终端 + +有[许多终端模拟器 ][10] 可用。尽管 Emacs 中的 Elisp 终端仿真器不是最强大的通用仿真器,但是它有两个显著的优点。 + +1。**在 Emacs 缓冲区中打开:**我使用 Emacs 的 Elisp shell,因为它在 Emacs 窗口中打开很方便,我经常全屏运行该窗口。这是一个小而重要的优势,只需要输入 `Ctrl+x+o`( 或用 Emacs 符号来表示就是 C-x) 就能使用终端了,而且它还有一个特别好的地方在于当运行漫长的作业时能够一瞥它的状态报告。 +2。**在没有系统剪贴板的情况下复制和粘贴特别方便:** 无论是因为懒惰不愿将手从键盘移动到鼠标,还是因为在远程控制台运行 Emacs 而无法使用鼠标,在 Emacs 中运行终端有时意味着可以快从 Emacs 缓冲区中传输数据到 Bash。 + + + +要尝试 Emacs 终端,输入 `Alt+x (用 Emacs 符号表示就是 M-x)`,然后输入 **shell**,然后按 **Return**。 + +## 使用 Racket mode + +[Racket][11] 是一种激动人心的新兴 Lisp 方言,拥有动态编程环境 、GUI 工具包和热情的社区。学习 Racket 的默认编辑器是 DrRacket,它的顶部是定义面板,底部是交互面板。使用该设置,用户可以编写影响 Racket 运行时的定义。就像旧的 [Logo Turtle][12] 程序,但是有一个终端而不是仅仅一个海龟。 + +![Racket-mode][13] + +由 PLT 提供的 LGPL 示例代码 + +基于 Lisp 的 Emacs 为资深 Racket 编程人员提供了一个很好的集成开发环境 (IDE)。它还没有自带 [Racket mode][14],但你可以使用 Emacs 包安装程序安装 Racket 模式和辅助扩展。 +要安装它,按下 `Alt+X` (用 Emacs 符号表示就是 **M-x**),键入 **package-install**,然后按 **Return**。然后输入要安装的包 (**racet-mode**),按 **Return**。 + +使用 **M-x racket-mode** 进入 Racket mode。如果你是 Racket 新手,但不是对 Lisp 或 Emacs 比较熟悉,可以从优秀[图解 Racket][15] 入手。 + +## 脚本 + +您可能知道,Bash 脚本在自动化和增强 Linux 或 Unix 体验方面很流行。你可能听说过 Python 在这方面也做得很好。但是你知道 Lisp 脚本可以用同样的方式运行吗?有时人们会对 Lisp 到底有多有用感到困惑,因为许多人是通过 Emacs 来了解 Lisp 的,因此有一种潜在的印象,即在 21 世纪运行 Lisp 的惟一方法是在 Emacs 中运行。幸运的是,事实并非如此,Emacs 是一个很好的 IDE,它支持将 Lisp 脚本作为一般的系统可执行文件来运行。 + +除了 Elisp 之外,还有两种流行的现代 lisp 可以很容易地用来作为独立脚本运行。 + +1。**Racket:** 你可以通过在系统上运行 Racket 来提供运行 Racket 脚本所需的运行时支持,或者你可以使用 **raco exe** 产生一个可执行文件。**raco exe** 命令将代码和运行时支持文件一起打包,以创建可执行文件。然后,**raco distribution** 命令将可执行文件打包成可以在其他机器上工作的发行版。Emacs 有许多 Racket 工具,因此在 Emacs 中创建 Racket 文件既简单又有效。 + +2。**GNU Guile:** [GNU Guile][16](“GNU Ubiquitous Intelligent Language for Extensions”--GNU 通用智能语言扩展的缩写)是 [Scheme][17] 编程语言的一个实现,它用于为桌面 、internet、 终端等创建应用程序和游戏。使用 Emacs 中的 Scheme 扩展众多,使用任何一个扩展来编写 Scheme 都很容易。例如,这里有一个用 Guile 编写的 “Hello world” 脚本: +``` +#!/usr/bin/guile - s + +(display "hello world") +     (newline) [/code] Compile and run it with the **guile** command: [code] $ guile ./hello.scheme +;;; compiling /home/seth/./hello.scheme +;;; compiled [...]/hello.scheme.go +hello world +$ guile ./hello.scheme +hello world +``` +## Run Elisp without Emacs +Emacs 可以作为 Elisp 的运行环境,但是你无需按照传统印象中的必须打开 Emacs 来运行 Elisp。`--script` 选项可以让你使用 Emacs 作为引擎来执行 Elisp 脚本而无需运行 Emacs 图形界面(甚至也无需使用终端界面)。下面这个例子中,`-Q` 选项让 Emacs 忽略 `.emacs` 文件从而避免由于执行 Elisp 脚本时产生延迟(若你的脚本依赖于 Emacs 配置中的内容那么请忽略该选项)。 + +``` +emacs -Q --script ~/path/to/script.el +``` +## 下载 Emacs 备忘录 +Emacs 许多重要功能都不是只能通过 Emacs 来实现的; Org mode 是 Emacs 扩展也是一种格式标准,流行的 Lisp 方言大多不依赖于具体的实现,我们甚至可以在没有可见或可交互式 Emacs 实例的情况下编写和运行 Elisp。然后若你对为什么模糊代码和数据之间的界限能够引发创新和效率感到好奇的话,那么 Emacs 是一个很棒的工具。 + +幸运的是,现在是 21 世纪,Emacs 有了带有传统菜单的图形界面以及大量的文档,因此学习曲线不再像以前那样。然而,要最大化 Emacs 对你的好处,你需要学习它的快捷键。由于 Emacs 支持的每个任务都是一个 Elisp 函数,Emacs 中的任何功能都可以对应一个快捷键,因此要描述所有这些快捷键是不可能完成的任务。你只要学习使用频率 10 倍于不常用功能的那些快捷键即可。 + +我们汇聚了最常用的 Emacs 快捷键成为一份 Emacs 备忘录以便你查询。将它挂在屏幕附近或办公室墙上,把它作为鼠标垫也行。让它触手可及经常翻阅一下。每次翻两下可以让你获得十倍的学习效率。而且一旦开始编写自己的函数,你一定不会后悔获取了这个免费的备忘录副本的! + +[这里下载 Emacs 备忘录 ](https://opensource.com/downloads/emacs-cheat-sheet) From 04102e3a82c7dc95a969137f3c7ba8f11f28b988 Mon Sep 17 00:00:00 2001 From: chenmu-kk <53132802+chenmu-kk@users.noreply.github.com> Date: Wed, 26 Feb 2020 18:55:50 +0800 Subject: [PATCH 184/315] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87=20?= =?UTF-8?q?(#17524)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update 20190113 Editing Subtitles in Linux.md * Update 20190113 Editing Subtitles in Linux.md * Update 20190113 Editing Subtitles in Linux.md * Update 20190113 Editing Subtitles in Linux.md * Update 20190113 Editing Subtitles in Linux.md * Update 20190113 Editing Subtitles in Linux.md * Rename sources/tech/20190113 Editing Subtitles in Linux.md to translated/translated/tech/20190113 Edeiting Subtitcles in Linux.translated * Rename translated/translated/tech/20190113 Edeiting Subtitcles in Linux.translated to translated/tech/20190113 Edeiting Subtitcles in Linux.translated * Update 20190113 Edeiting Subtitcles in Linux.translated * Rename 20190113 Edeiting Subtitcles in Linux.translated to 20190113 Editing Subtitles in Linux.md Co-authored-by: Xingyu.Wang --- .../20190113 Editing Subtitles in Linux.md | 168 ------------------ .../20190113 Editing Subtitles in Linux.md | 167 +++++++++++++++++ 2 files changed, 167 insertions(+), 168 deletions(-) delete mode 100644 sources/tech/20190113 Editing Subtitles in Linux.md create mode 100644 translated/tech/20190113 Editing Subtitles in Linux.md diff --git a/sources/tech/20190113 Editing Subtitles in Linux.md b/sources/tech/20190113 Editing Subtitles in Linux.md deleted file mode 100644 index 57db2754d4..0000000000 --- a/sources/tech/20190113 Editing Subtitles in Linux.md +++ /dev/null @@ -1,168 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (chenmu-kk ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Editing Subtitles in Linux) -[#]: via: (https://itsfoss.com/editing-subtitles) -[#]: author: (Shirish https://itsfoss.com/author/shirish/) - -Editing Subtitles in Linux -====== - -I have been a world movie and regional movies lover for decades. Subtitles are the essential tool that have enabled me to enjoy the best movies in various languages and from various countries. - -If you enjoy watching movies with subtitles, you might have noticed that sometimes the subtitles are not synced or not correct. - -Did you know that you can edit subtitles and make them better? Let me show you some basic subtitle editing in Linux. - -![Editing subtitles in Linux][1] - -### Extracting subtitles from closed captions data - -Around 2012, 2013 I came to know of a tool called [CCEextractor.][2] As time passed, it has become one of the vital tools for me, especially if I come across a media file which has the subtitle embedded in it. - -CCExtractor analyzes video files and produces independent subtitle files from the closed captions data. - -CCExtractor is a cross-platform, free and open source tool. The tool has matured quite a bit from its formative years and has been part of [GSOC][3] and Google Code-in now and [then.][4] - -The tool, to put it simply, is more or less a set of scripts which work one after another in a serialized order to give you an extracted subtitle. - -You can follow the installation instructions for CCExtractor on [this page][5]. - -After installing when you want to extract subtitles from a media file, do the following: - -``` -ccextractor -``` - -The output of the command will be something like this: - -It basically scans the media file. In this case, it found that the media file is in malyalam and that the media container is an [.mkv][6] container. It extracted the subtitle file with the same name as the video file adding _eng to it. - -CCExtractor is a wonderful tool which can be used to enhance subtitles along with Subtitle Edit which I will share in the next section. - -``` -Interesting Read: There is an interesting synopsis of subtitles at [vicaps][7] which tells and shares why subtitles are important to us. It goes into quite a bit of detail of movie-making as well for those interested in such topics. -``` - -### Editing subtitles with SubtitleEditor Tool - -You probably are aware that most subtitles are in [.srt format][8] . The beautiful thing about this format is and was you could load it in your text editor and do little fixes in it. - -A srt file looks something like this when launched into a simple text-editor: - -The excerpt subtitle I have shared is from a pretty Old German Movie called [The Cabinet of Dr. Caligari (1920)][9] - -Subtitleeditor is a wonderful tool when it comes to editing subtitles. Subtitle Editor is and can be used to manipulate time duration, frame-rate of the subtitle file to be in sync with the media file, duration of breaks in-between and much more. I’ll share some of the basic subtitle editing here. - -![][10] - -First install subtitleeditor the same way you installed ccextractor, using your favorite installation method. In Debian, you can use this command: - -``` -sudo apt install subtitleeditor -``` - -When you have it installed, let’s see some of the common scenarios where you need to edit a subtitle. - -#### Manipulating Frame-rates to sync with Media file - -If you find that the subtitles are not synced with the video, one of the reasons could be the difference between the frame rates of the video file and the subtitle file. - -How do you know the frame rates of these files, then? - -To get the frame rate of a video file, you can use the mediainfo tool. You may need to install it first using your distribution’s package manager. - -Using mediainfo is simple: - -``` -$ mediainfo somefile.mkv | grep Frame - Format settings : CABAC / 4 Ref Frames - Format settings, ReFrames : 4 frames - Frame rate mode : Constant - Frame rate : 25.000 FPS - Bits/(Pixel*Frame) : 0.082 - Frame rate : 46.875 FPS (1024 SPF) -``` - -Now you can see that framerate of the video file is 25.000 FPS. The other Frame-rate we see is for the audio. While I can share why particular fps are used in Video-encoding, Audio-encoding etc. it would be a different subject matter. There is a lot of history associated with it. - -Next is to find out the frame rate of the subtitle file and this is a slightly complicated. - -Usually, most subtitles are in a zipped format. Unzipping the .zip archive along with the subtitle file which ends in something.srt. Along with it, there is usually also a .info file with the same name which sometime may have the frame rate of the subtitle. - -If not, then it usually is a good idea to go some site and download the subtitle from a site which has that frame rate information. For this specific German file, I will be using [Opensubtitle.org][11] - -As you can see in the link, the frame rate of the subtitle is 23.976 FPS. Quite obviously, it won’t play well with my video file with frame rate 25.000 FPS. - -In such cases, you can change the frame rate of the subtitle file using the Subtitle Editor tool: - -Select all the contents from the subtitle file by doing CTRL+A. Go to Timings -> Change Framerate and change frame rates from 23.976 fps to 25.000 fps or whatever it is that is desired. Save the changed file. - -![synchronize frame rates of subtitles in Linux][12] - -#### Changing the Starting position of a subtitle file - -Sometimes the above method may be enough, sometimes though it will not be enough. - -You might find some cases when the start of the subtitle file is different from that in the movie or a media file while the frame rate is the same. - -In such cases, do the following: - -Select all the contents from the subtitle file by doing CTRL+A. Go to Timings -> Select Move Subtitle. - -![Move subtitles using Subtitle Editor on Linux][13] - -Change the new Starting position of the subtitle file. Save the changed file. - -![Move subtitles using Subtitle Editor in Linux][14] - -If you wanna be more accurate, then use [mpv][15] to see the movie or media file and click on the timing, if you click on the timing bar which shows how much the movie or the media file has elapsed, clicking on it will also reveal the microsecond. - -I usually like to be accurate so I try to be as precise as possible. It is very difficult in MPV as human reaction time is imprecise. If I wanna be super accurate then I use something like [Audacity][16] but then that is another ball-game altogether as you can do so much more with it. That may be something to explore in a future blog post as well. - -#### Manipulating Duration - -Sometimes even doing both is not enough and you even have to shrink or add the duration to make it sync with the media file. This is one of the more tedious works as you have to individually fix the duration of each sentence. This can happen especially if you have variable frame rates in the media file (nowadays rare but you still get such files). - -In such a scenario, you may have to edit the duration manually and automation is not possible. The best way is either to fix the video file (not possible without degrading the video quality) or getting video from another source at a higher quality and then [transcode][17] it with the settings you prefer. This again, while a major undertaking I could shed some light on in some future blog post. - -### Conclusion - -What I have shared in above is more or less on improving on existing subtitle files. If you were to start a scratch you need loads of time. I haven’t shared that at all because a movie or any video material of say an hour can easily take anywhere from 4-6 hours or even more depending upon skills of the subtitler, patience, context, jargon, accents, native English speaker, translator etc. all of which makes a difference to the quality of the subtitle. - -I hope you find this interesting and from now onward, you’ll handle your subtitles slightly better. If you have any suggestions to add, please leave a comment below. - - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/editing-subtitles - -作者:[Shirish][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/shirish/ -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/editing-subtitles-in-linux.jpeg?resize=800%2C450&ssl=1 -[2]: https://www.ccextractor.org/ -[3]: https://itsfoss.com/best-open-source-internships/ -[4]: https://www.ccextractor.org/public:codein:google_code-in_2018 -[5]: https://github.com/CCExtractor/ccextractor/wiki/Installation -[6]: https://en.wikipedia.org/wiki/Matroska -[7]: https://www.vicaps.com/blog/history-of-silent-movies-and-subtitles/ -[8]: https://en.wikipedia.org/wiki/SubRip#SubRip_text_file_format -[9]: https://www.imdb.com/title/tt0010323/ -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/subtitleeditor.jpg?ssl=1 -[11]: https://www.opensubtitles.org/en/search/sublanguageid-eng/idmovie-4105 -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/subtitleeditor-frame-rate-sync.jpg?resize=800%2C450&ssl=1 -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/Move-subtitles-Caligiri.jpg?resize=800%2C450&ssl=1 -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/move-subtitles.jpg?ssl=1 -[15]: https://itsfoss.com/mpv-video-player/ -[16]: https://www.audacityteam.org/ -[17]: https://en.wikipedia.org/wiki/Transcoding -[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/editing-subtitles-in-linux.jpeg?fit=800%2C450&ssl=1 diff --git a/translated/tech/20190113 Editing Subtitles in Linux.md b/translated/tech/20190113 Editing Subtitles in Linux.md new file mode 100644 index 0000000000..84f299fbf4 --- /dev/null +++ b/translated/tech/20190113 Editing Subtitles in Linux.md @@ -0,0 +1,167 @@ +[#]: collector: (lujun9972) +[#]: translator: (chenmu-kk ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Editing Subtitles in Linux) +[#]: via: (https://itsfoss.com/editing-subtitles) +[#]: author: (Shirish https://itsfoss.com/author/shirish/) + +在 Linux 中编辑字幕 +====== + +我作为一位世界电影和地区电影爱好者已经几十年了。这期间字幕是一个必不可少的工具,它可以使我享受来自不同国家不同语言的优秀电影。 + +如果你喜欢观看带有字幕的电影,你可能会注意到有时字幕并不同步或者说并不正确。 + +你知道你可以自己编写字幕并使得它们更完美吗?让我们向你展示一些 Linux 中的基本字幕编辑吧。 + +![Editing subtitles in Linux][1] + +### 从闭路字幕数据中提取字幕 + +大概在 2012,2013 年我开始了解到有一款叫做 [CCEextractor][2] 的工具。随着时间的推移,它已经成为我必不可少的工具之一 ,尤其是当我偶然发现一份内含有字幕的媒体文件。 + + CCExtractor 负责解析视频文件以及从闭路字幕数据中产生独立的字幕文件。 + + CCExtractor 是一个跨平台、免费且开源的工具。自它形成的那年起该工具已经成熟了不少而如今已成为 [GSOC][3] 和谷歌编码输入的一部分。 + +简单来说,这个工具是一系列或多或少的脚本,这些脚本以一种连续的顺序一个接着一个地给你提供提取到的字幕。 + +你可以按照 [本页][5] 的 CCExtractor 安装指南进行操作。 + +若安装后你想从媒体文件中提取字幕,请按以下步骤操作: + +``` +ccextractor +``` + +该命令将会输出以下内容: + +它会大致浏览媒体文件。在这个例子中,它发现媒体文件是马拉雅拉姆文并且格式是 .mkv[6] 。之后它将字幕文件提取出来,命名为源文件名并添加“_eng”后缀。 + + CCExtractor 是一款用来增强字幕功能和字幕编辑的优秀工具,我将在下一部分对它进行介绍。 + +``` +趣味阅读:在 [vicaps][7] 有一份有趣的字幕简介,会讲解和分享为何字幕对我们如此重要。对于那些对这类话题感兴趣的人来说,这里面也有许多电影制作的细节。 +``` + +### 用 SubtitleEditor 工具编辑字幕 + +你大概意识到大多数的字幕都是 [.srt 格式][8] 的。这种格式的优点在于你可以将它加载到文本编辑器中并对它进行少量的修改。 + +当进入一个简单的文本编辑器时,一个 srt 文件看起来会是这个样子: + +我分享的节选字幕来自于一部非常老的德国电影 [卡里加里博士的小屋 (1920)][9] 。 + + Subtitleeditor 是一款非常棒的字幕编辑软件。字幕编辑器可以用来设置字幕持续时间、与多媒体文件同步的字幕帧率以及字幕间隔时间等等。接下来我将在这分享一些基本的字幕编辑。 + +![][10] + +首先,以安装 ccextractor 工具同样的方式安装 subtitleeditor 工具,使用你自己喜爱的安装方式。在 Debian 中,你可以使用命令: + +``` +sudo apt install subtitleeditor +``` + +当你安装完成后,让我们来看一下在你编辑字幕时一些常见的场景。 + +#### 调整帧率使其媒体文件同步 + +如果你发现字幕与视频不同步,一个原因可能是视频文件的帧率与字幕文件的帧率并不一致。 + +你如何得知这些文件的帧率呢,然后呢? + +为了获取视频文件的帧率,你可以使用 mediainfo 工具。首先你可能需要发行版的包管理器来安装它。 + +使用 mediainfo 非常得简单: + +``` +$ mediainfo somefile.mkv | grep Frame + Format settings : CABAC / 4 Ref Frames + Format settings, ReFrames : 4 frames + Frame rate mode : Constant + Frame rate : 25.000 FPS + Bits/(Pixel*Frame) : 0.082 + Frame rate : 46.875 FPS (1024 SPF) +``` + +现在你可以看到视频文件的帧率是 25.000 FPS 。我们看到的另一个帧率则是音频文件的帧率。虽然我会分享为何在视频解码和音频解码等地方会使用特定的 fps ,但这将会是一个不同的主题,与它相关的历史有很多。 + +下一个问题是解决字幕文件的帧率,这个稍微有点复杂。 + +通常情况下,大多数字幕都是压缩格式的。将.zip归档文件和字幕文件(以 XXX.srt 结尾)一起解压缩。除此之外,通常还会有一个同名的 .info 文件,该文件可能包含字幕的帧率。 + +如果不是,那么通常最好去某个站点并从具有该帧速率信息的站点下载字幕。对于这个特定的德文文件,我将使用 [Opensubtitle.org][11] 。 + +正如你在链接中所看到的,字幕的帧率是 23.976 FPS 。将我的视频文件以 25.000 FPS 的帧率进行播放,显而易见结果并不好。 + +在这种情况下,你可以使用字幕编辑工具来改变字幕文件的帧率: + +按下 CTRL+A 选择字幕文件中的全部内容。点击 Timings -> Change Framerate ,将 23.976 fps 改为 25.000 fps 或者你想要的其他帧率,保存已更改的文件。 + +![synchronize frame rates of subtitles in Linux][12] + +#### 改变字幕文件的起点 + +有时以上的方法就足够解决问题了,但有时候以上方法并不足够解决问题。 + +在帧率相同时,你可能会发现字幕文件的开头与电影或媒体文件中起点并不相同。 + +在这种情况下,请按以下步骤进行操作: + +按下 CTRL+A 键选中字幕文件的全部内容。点击 Timings -> 选择 Move Subtitle 。 + +![Move subtitles using Subtitle Editor on Linux][13] + +设定字幕文件的新起点,保存已更改的文件。 + +![Move subtitles using Subtitle Editor in Linux][14] + +如果你想要时间更精确一点,那么可以使用 [mpv][15] 来查看电影或者媒体文件并点击 timing ,如果你点击了进度条(可以显示电影或者媒体文件的播放进度),它也会显示微秒。 + +通常我喜欢精准无误的操作,因此我会试着尽可能地仔细调节。相较于人类的反应时间来说,MPV中的反应时间很精确。如果我想要极其精确的时间,那么我可以使用像 [Audacity][16] 之类的东西,但是那是另一种工具,你可以在上面做更多的事情。那也将会是我未来博客中将要探讨的东西。 + +#### 调整字幕间隔时间 + +有时,两种方法都采用了还不够,甚至你可能需要缩短或曾加间隔时间以使其与媒体文件同步。这是较为繁琐的工作之一,因为你必须单独确定每个句子的间隔时间。尤其是在媒体文件中帧率可变的情况下(现已很少见,但你仍然会得到此类文件) + +在这种设想下,你可能因为无法实现自动编辑而不得不手动的修改间隔时间。最好的方式是修改视频文件(会降低视频质量)或者换另一个更高质量的片源,用你喜欢的设置对它进行 [转码][17] 。这又是一重大任务,以后我会在我的一些博客文章上阐明。 + +### 结论 + +以上我分享的内容或多或少是对现有字幕文件的改进。如果从头开始,你需要花费大量的时间。我完全没有分享这一点,因为一部电影或一个小时内的任何视频材料都可以轻易地花费 4-6 个小时,甚至更多的时间,这取决于字幕员的技巧、耐心、上下文、行话、口音、是否是以英语为母语的人、翻译等,所有的这些都会对字幕的质量产生影响。 + +我希望自此以后你会觉得这件事很有趣,并将你的字幕处理的更好一点。如果你有其他想要补充的问题,请在下方留言。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/editing-subtitles + +作者:[Shirish][a] +选题:[lujun9972][b] +译者:[chenmu-kk](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/shirish/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/editing-subtitles-in-linux.jpeg?resize=800%2C450&ssl=1 +[2]: https://www.ccextractor.org/ +[3]: https://itsfoss.com/best-open-source-internships/ +[4]: https://www.ccextractor.org/public:codein:google_code-in_2018 +[5]: https://github.com/CCExtractor/ccextractor/wiki/Installation +[6]: https://en.wikipedia.org/wiki/Matroska +[7]: https://www.vicaps.com/blog/history-of-silent-movies-and-subtitles/ +[8]: https://en.wikipedia.org/wiki/SubRip#SubRip_text_file_format +[9]: https://www.imdb.com/title/tt0010323/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/subtitleeditor.jpg?ssl=1 +[11]: https://www.opensubtitles.org/en/search/sublanguageid-eng/idmovie-4105 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/subtitleeditor-frame-rate-sync.jpg?resize=800%2C450&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/Move-subtitles-Caligiri.jpg?resize=800%2C450&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/move-subtitles.jpg?ssl=1 +[15]: https://itsfoss.com/mpv-video-player/ +[16]: https://www.audacityteam.org/ +[17]: https://en.wikipedia.org/wiki/Transcoding +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/editing-subtitles-in-linux.jpeg?fit=800%2C450&ssl=1 From d1d29be14d5dec0ace55b9ceb2402ee5e8660927 Mon Sep 17 00:00:00 2001 From: caiichenr <34886864+caiichenr@users.noreply.github.com> Date: Wed, 26 Feb 2020 20:52:05 +0800 Subject: [PATCH 185/315] translating --- ...3 Building a non-breaking breakpoint for Python debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190813 Building a non-breaking breakpoint for Python debugging.md b/sources/tech/20190813 Building a non-breaking breakpoint for Python debugging.md index 1c33c05a68..0cafd51c17 100644 --- a/sources/tech/20190813 Building a non-breaking breakpoint for Python debugging.md +++ b/sources/tech/20190813 Building a non-breaking breakpoint for Python debugging.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (caiichenr) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 182af28cda1901d7142fc41cb189a20e9f8541e4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 26 Feb 2020 21:45:55 +0800 Subject: [PATCH 186/315] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @mengxinayan 请参阅我的校对,这个系列后面希望可以保持一致。 --- ...tructure a multi-file C program- Part 1.md | 130 +++++++++--------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/translated/tech/20190729 How to structure a multi-file C program- Part 1.md b/translated/tech/20190729 How to structure a multi-file C program- Part 1.md index 92166f2895..ec4c0dd961 100644 --- a/translated/tech/20190729 How to structure a multi-file C program- Part 1.md +++ b/translated/tech/20190729 How to structure a multi-file C program- Part 1.md @@ -1,43 +1,44 @@ [#]: collector: (lujun9972) [#]: translator: (mengxinayan) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to structure a multi-file C program: Part 1) [#]: via: (https://opensource.com/article/19/7/structure-multi-file-c-part-1) [#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjnyhttps://opensource.com/users/jnyjnyhttps://opensource.com/users/jim-salterhttps://opensource.com/users/cldxsolutions) -如何组织构建多文件 C 语言程序:第一部分 +如何组织构建多文件 C 语言程序(一) ====== -准备好你喜欢的饮料,编辑器和编译器,放一些音乐,然后开始构建一个由多个文件组成的 C 语言程序。 -![Programming keyboard.][1] +> 准备好你喜欢的饮料、编辑器和编译器,放一些音乐,然后开始构建一个由多个文件组成的 C 语言程序。 -大家常说计算机编程的艺术是管理复杂性和命名某些事物中的一部分。此外,我认为“有时需要添加绘图”是很正确的。 +![](https://img.linux.net.cn/data/attachment/album/202002/26/214517o5p7q45l2a8jkx4k.jpg) -在这篇文章里,我会在编写一个小型 C 程序时命名一些东西同时管理一些复杂性。程序的结构基于我所在 “[如何写一个好的 C 语言 main 函数][2]” 文中讨论的。但是,这次做一些不同的事。准备好你喜欢的饮料,编辑器和编译器,放一些音乐,让我们一起编写一个有趣的 C 语言程序。 +大家常说计算机编程的艺术部分是处理复杂性,部分是命名某些事物。此外,我认为“有时需要添加绘图”是在很大程度上是正确的。 -### 好的 Unix 程序中的哲学 +在这篇文章里,我会编写一个小型 C 程序,命名一些东西,同时处理一些复杂性。该程序的结构大致基于我在 《[如何写一个好的 C 语言 main 函数][2]》 文中讨论的。但是,这次做一些不同的事。准备好你喜欢的饮料、编辑器和编译器,放一些音乐,让我们一起编写一个有趣的 C 语言程序。 -首先你要知道这个 C 程序是一个 [Unix][3] 命令行工具。这意味着它运行在那些提供(或者可被移植) Unix C 运行环境的操作系统中。当 Unix 在贝尔实验室被发明后,它从一开始便充满了 [设计哲学][4]。用我的话来说:程序只做一件事,并做好它,然后对文件进行一些操作。虽然只做一件事并做好它是有意义的,但是“对文件进行一些操作”在这儿有一点儿不合适。 +### 优秀 Unix 程序哲学 -“文件” 在 Unix 中的抽象非常强大。一个 Unix 文件是以 end-of-file (EOF) 标志为结尾的字节流。文件中其他结构均由应用添加而非操作系统。操作系统提供了系统调用,使得程序能够对文件执行标准操作:打开,读取,写入,寻找和关闭(还有其他,但那是庞大的额外内容)。对于文件的标准化访问使得不同人用不同语言编写的程序能共用相同的抽象同时一起工作。 +首先,你要知道这个 C 程序是一个 [Unix][3] 命令行工具。这意味着它运行在(或者可被移植到)那些提供 Unix C 运行环境的操作系统中。当贝尔实验室发明 Unix 后,它从一开始便充满了[设计哲学][4]。用我自己的话来说就是:程序只做一件事,并做好它,并且对文件进行一些操作。虽然“只做一件事,并做好它”是有意义的,但是“对文件进行一些操作”的部分似乎有点儿不合适。 -具有共享文件接口可以构建 _可组合的_ 的程序。一个程序的输出可以作为另一个程序的输入。Unix 系操作系统默认为每个运行中程序提供了三个文件:标准输入(`stdin`),标准输出(`stdout`),和标准错误(`stderr`)。其中两个文件是只写的:`stdout` 和 `stderr`。而 `stdin` 是只读的。当我们在常见的 Shell 比如 Bash 中使用文件重定向时,可以看到其效果。 +事实证明,Unix 中抽象的 “文件” 非常强大。一个 Unix 文件是以文件结束符(EOF)标志为结尾的字节流。仅此而已。文件中任何其它结构均由应用程序所施加而非操作系统。操作系统提供了系统调用,使得程序能够对文件执行一套标准的操作:打开、读取、写入、寻址和关闭(还有其他,但说起来那就复杂了)。对于文件的标准化访问使得不同的程序共用相同的抽象,而且可以一同工作,即使它们是不同的人用不同语言编写的程序。 + +具有共享的文件接口使得构建*可组合的*的程序成为可能。一个程序的输出可以作为另一个程序的输入。Unix 家族的操作系统默认在执行程序时提供了三个文件:标准输入(`stdin`)、标准输出(`stdout`)和标准错误(`stderr`)。其中两个文件是只写的:`stdout` 和 `stderr`。而 `stdin` 是只读的。当我们在常见的 Shell 比如 Bash 中使用文件重定向时,可以看到其效果。 ``` -`$ ls | grep foo | sed -e 's/bar/baz/g' > ack` +$ ls | grep foo | sed -e 's/bar/baz/g' > ack ``` -这条指令可以被简要地描述为:`ls` 的结果被写入标准输出,它重定向到 `grep` 的标准输入,`grep` 的标准输出重定向到 `sed`的标准输入,`sed` 的标准输出重定向到当前目录下文件名为 `ack` 的文件中。 +这条指令可以被简要地描述为:`ls` 的结果被写入标准输出,它重定向到 `grep` 的标准输入,`grep` 的标准输出重定向到 `sed` 的标准输入,`sed` 的标准输出重定向到当前目录下文件名为 `ack` 的文件中。 -我们希望我们的程序在系统中灵活而又出色,因此让我们编写一个可以读写文件的程序。 +我们希望我们的程序在这个灵活又出色的生态系统中运作良好,因此让我们编写一个可以读写文件的程序。 -### MeowMeow: 流编码器/解码器概念 +### 喵呜喵呜:流编码器/解码器概念 -当我还是一个孩子在 ltmumblesgts 里学习计算机科学时,有许多编码方案。他们中的有些用于压缩文件,有些用于打包文件,另一些毫无用处因此显得十分愚蠢。列举一个最后一种情况例子:[MooMoo 编码方式][5]。 +当我还是一个露着豁牙的孩子懵懵懂懂地学习计算机科学时,学过很多编码方案。它们中的有些用于压缩文件,有些用于打包文件,另一些毫无用处因此显得十分愚蠢。列举最后这种情况的一个例子:[哞哞编码方案][5]。 -为了给我们程序一个目的,我将在 [2000s][6] 更新该概念并且完成一个名为 “MeowMeow” 的编码方式(因为在互联网上大家都喜欢猫)。这里的基本的想法获取文件并且使用文本 “meow” 对每半个字节进行编码。小写字母代表 0,大写字母代表 1。因为它会将 4 比特替换为 32 比特,因此会扩大文件的大小。这毫无实际意义。但想象一下人们看到经过这样编码后的结果。 +为了让我们的程序有个用途,我为它更新了一个 [21 世纪][6] 的概念,并且实现了一个名为“喵呜喵呜” 的编码方案的概念(毕竟网上大家都喜欢猫)。这里的基本的思路是获取文件并且使用文本 “meow” 对每个半字节(半个字节)进行编码。小写字母代表 0,大写字母代表 1。因为它会将 4 个比特替换为 32 个比特,因此会扩大文件的大小。没错,这毫无意义。但是想象一下人们看到经过这样编码后的惊讶表情。 ``` $ cat /home/your_sibling/.super_secret_journal_of_my_innermost_thoughts @@ -46,47 +47,46 @@ MeOWmeOWmeowMEoW... 这非常棒。 -### 最后完成 +### 最终的实现 完整的源代码可以在 [GitHub][7] 上面找到,但是我会写下我在编写程序时的思考。目的是说明如何组织构建多文件 C 语言程序。 -当我已经确定要编写一个 MeowMeow 编码和解码的程序时,我在 Shell 中执行了以下的命令 : +既然已经确定了要编写一个编码和解码“喵呜喵呜”格式的文件的程序时,我在 Shell 中执行了以下的命令 : ``` $ mkdir meowmeow $ cd meowmeow $ git init -$ touch Makefile     # recipes for compiling the program -$ touch main.c       # handles command-line options -$ touch main.h       # "global" constants and definitions -$ touch mmencode.c   # implements encoding a MeowMeow file -$ touch mmencode.h   # describes the encoding API -$ touch mmdecode.c   # implements decoding a MeowMeow file -$ touch mmdecode.h   # describes the decoding API -$ touch table.h      # defines encoding lookup table values -$ touch .gitignore   # names in this file are ignored by git +$ touch Makefile     # 编译程序的方法 +$ touch main.c       # 处理命令行选项 +$ touch main.h       # “全局”常量和定义 +$ touch mmencode.c   # 实现对喵呜喵呜文件的编码 +$ touch mmencode.h   # 描述编码 API +$ touch mmdecode.c   # 实现对喵呜喵呜文件的解码 +$ touch mmdecode.h   # 描述解码 API +$ touch table.h      # 定义编码查找表 +$ touch .gitignore   # 这个文件中的文件名会被 git 忽略 $ git add . $ git commit -m "initial commit of empty files" ``` -简单的说,我创建了一个空文件并且使用 git 提交。 -In short, I created a directory full of empty files and committed them to git. +简单的说,我创建了一个目录,里面全是空文件,并且提交到 git。 -即使文件中没有内容,你依旧可以从它的文件名推断功能。为了避免万一你无法理解,我在每条 `touch` 命令后面进行了简单描述。 +即使这些文件中没有内容,你依旧可以从它的文件名推断每个文件的用途。为了避免万一你无法理解,我在每条 `touch` 命令后面进行了简单描述。 -通常,一个程序从一个简单 `main.c` 文件开始,只需要两三个函数便可以解决问题。然后程序员便可以向自己的朋友或者老板展示该程序,同时突然显示了文件提示框支持所有新的“功能”和“需求”。“程序俱乐部”的第一条规则便是不谈论“程序俱乐部”。第二条规则是最小化单个文件的功能。 +通常,程序从一个简单 `main.c` 文件开始,只有两三个解决问题的函数。然后程序员轻率地向自己的朋友或者老板展示了该程序,然后为了支持所有新的“功能”和“需求”,文件中的函数数量就迅速爆开了。“程序俱乐部”的第一条规则便是不要谈论“程序俱乐部”,第二条规则是尽量减少单个文件中的函数。 -坦率地说,C 编译器并不关心程序中的所有函数是否都在一个文件中。但是我们并不是为计算机或编译器写程序,我们是为其他人(有时也包括我们)而去写程序的。我知道这有些奇怪,但这就是事实。程序是计算机解决问题所采用的一系列算法,保证人们可以理解它们是非常重要的,即使问题的参数发生了意料之外的变化。当在人们修改程序时,发现一个文件中有 2049 函数时会诅咒你的。 +老实说,C 编译器并不关心程序中的所有函数是否都在一个文件中。但是我们并不是为计算机或编译器写程序,我们是为其他人(有时也包括我们)去写程序的。我知道这可能有些奇怪,但这就是事实。程序体现了计算机解决问题所采用的一组算法,当问题的参数发生了意料之外的变化时,保证人们可以理解它们是非常重要的。当在人们修改程序时,发现一个文件中有 2049 函数时他们会诅咒你的。 -因此,好的程序员会将函数分隔开,将相似的函数分组到不同的文件中。这里我用了三个文件 `main.c`,`mmencode.c` 和 `mmdecode.c`。对于这样的小程序,也许看起来有些过头了。但是小程序很难保证一直小下去,因此计划拓展是一个好主意。 +因此,优秀的程序员会将函数分隔开,将相似的函数分组到不同的文件中。这里我用了三个文件 `main.c`、`mmencode.c` 和 `mmdecode.c`。对于这样小的程序,也许看起来有些过头了。但是小的程序很难保证一直小下去,因此哥忒拓展做好计划是一个“好主意”。 -但是那些 `.h` 文件呢?我会在后面解释一般的术语,简单地说,它们被称为头文件,同时它们可以包含 C 语言类型 和 C 预处理指令。头文件中不应该包含任何函数。你可以认为头文件和对应 `.c` 文件提供了用户编程接口(API)的定义,以便其他 `.c` 文件使用。 +但是那些 `.h` 文件呢?我会在后面解释一般的术语,简单地说,它们被称为头文件,同时它们可以包含 C 语言类型定义和 C 预处理指令。头文件中不应该包含任何函数。你可以认为头文件是提供了应用程序接口(API)的定义的一种 `.c` 文件,可以供其它 `.c` 文件使用。 ### 但是 Makefile 是什么呢? -我知道所有的酷小孩都使用 “Ultra CodeShredder 3000” 集成开发环境来编写下一个轰动一时的应用,同时构建你的项目包括在 Ctrl-Meta-Shift-Alt-Super-B 上进行混搭。但是回到今天,使用 Makefile 文件可以帮助做很多有用的工作在构建 C 程序时。Makefile 是一个包含如何处理文件的方式的文本文件,程序员可以使用其自动地从源代码构建二进制程序(包括其他东西!) +我知道下一个轰动一时的应用都是你们这些好孩子们用 “终极代码粉碎者 3000” 集成开发环境来编写的,而构建项目是用 Ctrl-Meta-Shift-Alt-Super-B 等一系列复杂的按键混搭出来的。但是如今(也就是今天),使用 `Makefile` 文件可以在构建 C 程序时帮助做很多有用的工作。`Makefile` 是一个包含如何处理文件的方式的文本文件,程序员可以使用其自动地从源代码构建二进制程序(以及其它东西!) -以下面这个小程序为例: +以下面这个小东西为例: ``` 00 # Makefile @@ -95,15 +95,15 @@ In short, I created a directory full of empty files and committed them to git. 03    cc -o my_sweet_program main.c ``` -‘#’ 符号后面的文本是注释,例如 00 行 +`#` 符号后面的文本是注释,例如 00 行。 -01 行是一个变量赋值,将 `TARGET` 变量赋值为字符串 `my_sweet_program`。按照惯例我的习惯是,所有 Makefile 变量均使用大写字母并用下划线分隔单词。 +01 行是一个变量赋值,将 `TARGET` 变量赋值为字符串 `my_sweet_program`。按照惯例,也是我的习惯,所有 `Makefile` 变量均使用大写字母并用下划线分隔单词。 -02 行包含要创建的文件名和其依赖的文件。在本例中,构建目标是 `my_sweet_program`,其依赖是 `main.c`。 +02 行包含该步骤recipe要创建的文件名和其依赖的文件。在本例中,构建目标target是 `my_sweet_program`,其依赖是 `main.c`。 -03 行是最后一行使用了一个制表符号(tab)而不是四个空格。这是将执行创建目标的命令。在本例中,我们使用 C 编译器前端 `cc` 以编译链接到 `my_sweet_program`。 +最后的 03 行使用了一个制表符号(`tab`)而不是四个空格。这是将要执行创建目标的命令。在本例中,我们使用 C 编译器C compiler前端 `cc` 以编译链接为 `my_sweet_program`。 -使用 Makefile 是非常简单的。 +使用 `Makefile` 是非常简单的。 ``` $ make @@ -112,59 +112,59 @@ $ ls Makefile  main.c  my_sweet_program ``` -将构建我们 MeowMeow 编码和解码器的 [Makefile][8] 比上面的例子要复杂,但其基本结构是相同的。我将在另一篇文章中将其分解为 Barney 风格。 +构建我们喵呜喵呜编码器/解码器的 [Makefile][8] 比上面的例子要复杂,但其基本结构是相同的。我将在另一篇文章中将其分解为 Barney 风格。 ### 形式伴随着功能 -我的想法是程序从一个文件中读取,转换它,并将转换后的结果存储到另一个文件中。以下是我想象使用程序命令行交互时的情况: +我的想法是程序从一个文件中读取、转换它,并将转换后的结果存储到另一个文件中。以下是我想象使用程序命令行交互时的情况: ``` -        $ meow < clear.txt > clear.meow -        $ unmeow < clear.meow > meow.tx -        $ diff clear.txt meow.tx -        $ +$ meow < clear.txt > clear.meow +$ unmeow < clear.meow > meow.tx +$ diff clear.txt meow.tx +$ ``` -我们需要编写命令行解析和处理输入/输出流的代码。我们需要一个函数对流进行编码并将结果写到另一个流中。最后,我们需要一个函数对流进行解码并将结果写到另一个流中。等一下,我们在讨论如何写一个程序,但是在上面的例子中,我调用了两个指令:`meow` 和 `unmeow`?我知道你可能会认为这会导致越变越复杂。 +我们需要编写代码以进行命令行解析和处理输入/输出流。我们需要一个函数对流进行编码并将结果写到另一个流中。最后,我们需要一个函数对流进行解码并将结果写到另一个流中。等一下,我们在讨论如何写一个程序,但是在上面的例子中,我调用了两个指令:`meow` 和 `unmeow`?我知道你可能会认为这会导致越变越复杂。 ### 次要内容:argv[0] 和 ln 指令 回想一下,C 语言 main 函数的结构如下: ``` -`int main(int argc, char *argv[])` +int main(int argc, char *argv[]) ``` -其中 `argc` 是命令行参数数量,`argv` 是字符指针列表(字符串)。`argv[0]` 是正在运行中的文件的路径。在 Unix 系统中许多互补功能的程序(比如:压缩和解压缩)看起来像两个命令,但事实上,它们在文件系统中是拥有两个名称的一个程序。使用 `ln` 命令通过创建文件系统链接来实现两个名称的功能。 +其中 `argc` 是命令行参数的数量,`argv` 是字符指针(字符串)的列表。`argv[0]` 是包含正在执行的程序的文件路径。在 Unix 系统中许多互补功能的程序(比如:压缩和解压缩)看起来像两个命令,但事实上,它们是在文件系统中拥有两个名称的一个程序。这个技巧是通过使用 `ln` 命令创建文件系统链接来实现两个名称的。 -一个在我笔记本中 `/usr/bin` 的例子如下: +在我笔记本电脑中 `/usr/bin` 的一个例子如下: ``` -   $ ls -li /usr/bin/git* +$ ls -li /usr/bin/git* 3376 -rwxr-xr-x. 113 root root     1.5M Aug 30  2018 /usr/bin/git 3376 -rwxr-xr-x. 113 root root     1.5M Aug 30  2018 /usr/bin/git-receive-pack ... ``` -这里 `git` 和 `git-receive-pack` 是同一个文件但是拥有不同的名字。我们说它们是相同的文件因为它们具有相同的 inode 值(第一列)。inode 是一个 Unix 文件系统的特点,其超越了本文的内容。 +这里 `git` 和 `git-receive-pack` 是同一个文件但是拥有不同的名字。我们说它们是相同的文件因为它们具有相同的 inode 值(第一列)。inode 是 Unix 文件系统的一个特点,对它的介绍超越了本文的内容范畴。 -优秀或懒惰的程序可以通过 Unix 文件系统此特点已达到写更少的代码但是交付双倍的程序。首先,我们编写一个基于其 `argv[0]` 的值而作出相应改变的程序,然后我们确保为该行为的名称创建链接。 +优秀或懒惰的程序可以通过 Unix 文件系统的这个特点达到写更少的代码但是交付双倍的程序。首先,我们编写一个基于其 `argv[0]` 的值而作出相应改变的程序,然后我们确保为导致该行为的名称创建链接。 -在我们的 Makefile 中,`unmeow` 链接通过以下的方式来创建: +在我们的 `Makefile` 中,`unmeow` 链接通过以下的方式来创建: ``` - # Makefile - ... - $(DECODER): $(ENCODER) -         $(LN) -f $< $@ -        ... +# Makefile +... +$(DECODER): $(ENCODER) + $(LN) -f $< $@ + ... ``` -我喜欢在 Makefile 中将所有内容参数化,很少使用 “裸” 字符串。我将所有的定义都放置在 Makefile 文件顶部,以便可以简单地找到并改变它们。当您尝试将程序移植到新的平台上时,需要将 `cc` 改变为 `xcc`时,这会产生很大影响。 +我倾向于在 `Makefile` 中将所有内容参数化,很少使用 “裸” 字符串。我将所有的定义都放置在 `Makefile` 文件顶部,以便可以简单地找到并改变它们。当你尝试将程序移植到新的平台上时,需要将 `cc` 改变为某个 `cc` 时,这会很方便。 -除了两个内置变量 `$@` 和 `$<` 之外,其余的变量显得很简单的。第一个便是创建目标的快捷方式,在本例中,`$(DECODER)` (我记忆它因为它看起来像一个目标)。第二个,`$<` 是规则依赖项,在本例中,它解析为 `$(ENCODER)`。 +除了两个内置变量 `$@` 和 `$<` 之外,该步骤recipe看起来相对简单。第一个便是该步骤的目标的快捷方式,在本例中是 `$(DECODER)`(我能记得这个是因为 `@` 符号看起来像是一个目标)。第二个,`$<` 是规则依赖项,在本例中,它解析为 `$(ENCODER)`。 -事情当然在变得复杂,但是它易于管理。 +事情肯定会变得复杂,但它还在管理之中。 -------------------------------------------------------------------------------- @@ -173,14 +173,14 @@ via: https://opensource.com/article/19/7/structure-multi-file-c-part-1 作者:[Erik O'Shaughnessy][a] 选题:[lujun9972][b] 译者:[萌新阿岩](https://github.com/mengxinayan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/jnyjnyhttps://opensource.com/users/jnyjnyhttps://opensource.com/users/jim-salterhttps://opensource.com/users/cldxsolutions [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_keyboard_coding.png?itok=E0Vvam7A (Programming keyboard.) -[2]: https://opensource.com/article/19/5/how-write-good-c-main-function +[2]: https://linux.cn/article-10949-1.html [3]: https://en.wikipedia.org/wiki/Unix [4]: http://harmful.cat-v.org/cat-v/ [5]: http://www.jabberwocky.com/software/moomooencode.html From da291a3f7f84bf8f067eb8b4413d8a3b86f3f324 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 26 Feb 2020 21:46:29 +0800 Subject: [PATCH 187/315] PUB @mengxinayan https://linux.cn/article-11935-1.html --- ...0190729 How to structure a multi-file C program- Part 1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190729 How to structure a multi-file C program- Part 1.md (99%) diff --git a/translated/tech/20190729 How to structure a multi-file C program- Part 1.md b/published/20190729 How to structure a multi-file C program- Part 1.md similarity index 99% rename from translated/tech/20190729 How to structure a multi-file C program- Part 1.md rename to published/20190729 How to structure a multi-file C program- Part 1.md index ec4c0dd961..196892cb41 100644 --- a/translated/tech/20190729 How to structure a multi-file C program- Part 1.md +++ b/published/20190729 How to structure a multi-file C program- Part 1.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (mengxinayan) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11935-1.html) [#]: subject: (How to structure a multi-file C program: Part 1) [#]: via: (https://opensource.com/article/19/7/structure-multi-file-c-part-1) [#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjnyhttps://opensource.com/users/jnyjnyhttps://opensource.com/users/jim-salterhttps://opensource.com/users/cldxsolutions) From 28aae540d8f46d7dd60aa47712d4dad91bcf96c0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 27 Feb 2020 00:56:35 +0800 Subject: [PATCH 188/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200226=20How=20?= =?UTF-8?q?we=20decide=20when=20to=20release=20Fedora?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200226 How we decide when to release Fedora.md --- ...26 How we decide when to release Fedora.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/tech/20200226 How we decide when to release Fedora.md diff --git a/sources/tech/20200226 How we decide when to release Fedora.md b/sources/tech/20200226 How we decide when to release Fedora.md new file mode 100644 index 0000000000..204a917ee4 --- /dev/null +++ b/sources/tech/20200226 How we decide when to release Fedora.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How we decide when to release Fedora) +[#]: via: (https://fedoramagazine.org/how-we-decide-when-to-release-fedora/) +[#]: author: (Ben Cotton https://fedoramagazine.org/author/bcotton/) + +How we decide when to release Fedora +====== + +![][1] + +Open source projects can use a variety of different models for deciding when to put out a release. Some projects release on a set schedule. Others decide on what the next release should contain and release whenever that is ready. Some just wake up one day and decide it’s time to release. And other projects go for a rolling release model, avoiding the question entirely. + +For Fedora, we go with a [schedule-based approach][2]. Releasing twice a year means we can give our contributors time to implement large changes while still keeping on the leading edge. Targeting releases for the end of April and the end of October gives everyone predictability: contributors, users, upstreams, and downstreams. + +But it’s not enough to release whatever’s ready on the scheduled date. We want to make sure that we’re releasing _quality_ software. Over the years, the Fedora community has developed a set of processes to help ensure we can meet both our time and and quality targets. + +### Changes process + +Meeting our goals starts months before the release. Contributors propose changes through our [Changes process][3], which ensures that the community has a chance to provide input and be aware of impacts. For changes with a broad impact (called “system-wide changes”), we require a contingency plan that describes how to back out the change if it’s broken or won’t be ready in time. In addition, the change process includes providing steps for testing. This helps make sure we can properly verify the results of a change. + +Change proposals are due 2-3 months before the beta release date. This gives the community time to evaluate the impact of the change and make adjustments necessary. For example, a new compiler release might require other package maintainers to fix bugs exposed by the new compiler or to make changes that take advantage of new capabilities. + +A few weeks before the beta and final releases, we enter a [code freeze][4]. This ensures a stable target for testing. Bugs identified as blockers and non-blocking bugs that are granted a freeze exception are updated in the repo, but everything else must wait. The freeze lasts until the release. + +### Blocker and freeze exception process + +In a project as large as Fedora, it’s impossible to test every possible combination of packages and configurations. So we have a set of test cases that we run to make sure the key features are covered. + +As much as we’d like to ship with zero bugs, if we waited until we reached that state, there’d never be another Fedora release again. Instead, we’ve defined release criteria that define what bugs can [block the release][5]. We have [basic release criteria][6] that apply to all release milestones, and then separate, cumulative criteria for [beta][7] and [final][8] releases. With beta releases, we’re generally a little more forgiving of rough edges. For a final release, it needs to pass all of beta’s criteria, plus some more that help make it a better user experience. + +The week before a scheduled release, we hold a “[go/no go meeting][9]“. During this meeting, the QA team, release engineering team, and the Fedora Engineering Steering Committee (FESCo) decide whether or not we will ship the release. As part of the decision process, we conduct a final review of blocker bugs. If any accepted blockers remain, we push the release back to a later date. + +Some bugs aren’t severe enough to block the release, but we still would like to get them fixed before the release. This is particularly true of bugs that affect the live image experience. In that case, we grant an [exception for updates that fix those bugs][10]. + +### How you can help + +In all my years as a Fedora contributor, I’ve never heard the QA team say “we don’t need any more help.” Contributing to the pre-release testing processes can be a great way to make your first Fedora contribution. + +The Blocker Review meetings happen most Mondays in #fedora-blocker-review on IRC. All members of the Fedora community are welcome to participate in the discussion and voting. One particularly useful contribution is to look at the [proposed blockers][11] and see if you can reproduce them. Knowing if a bug is widespread or not is important to the blocker decision. + +In addition, the QA team conducts test days and test weeks focused on various parts of the distribution: the kernel, GNOME, etc. Test days are announced on [Fedora Magazine][12]. + +There are plenty of other ways to contribute to the QA process. The Fedora wiki has a [list of tasks and how to contact the QA team][13]. The Fedora 32 Beta release is a few weeks away, so now’s a great time to get started! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-we-decide-when-to-release-fedora/ + +作者:[Ben Cotton][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/bcotton/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/releasing-fedora-1-816x345.png +[2]: https://fedoraproject.org/wiki/Fedora_Release_Life_Cycle#Development_Schedule +[3]: https://docs.fedoraproject.org/en-US/program_management/changes_policy/ +[4]: https://fedoraproject.org/wiki/Milestone_freezes +[5]: https://fedoraproject.org/wiki/QA:SOP_blocker_bug_process +[6]: https://fedoraproject.org/wiki/Basic_Release_Criteria +[7]: https://fedoraproject.org/wiki/Fedora_32_Beta_Release_Criteria +[8]: https://fedoraproject.org/wiki/Fedora_32_Final_Release_Criteria +[9]: https://fedoraproject.org/wiki/Go_No_Go_Meeting +[10]: https://fedoraproject.org/wiki/QA:SOP_freeze_exception_bug_process +[11]: https://qa.fedoraproject.org/blockerbugs/ +[12]: https://fedoramagazine.org/tag/test-day/ +[13]: https://fedoraproject.org/wiki/QA/Join From 98472bfae58d508cd4d16ee3d9b9edbc1b546fb6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 27 Feb 2020 08:23:06 +0800 Subject: [PATCH 189/315] translated --- ... to use byobu to multiplex SSH sessions.md | 86 ------------------- ... to use byobu to multiplex SSH sessions.md | 79 +++++++++++++++++ 2 files changed, 79 insertions(+), 86 deletions(-) delete mode 100644 sources/tech/20200212 How to use byobu to multiplex SSH sessions.md create mode 100644 translated/tech/20200212 How to use byobu to multiplex SSH sessions.md diff --git a/sources/tech/20200212 How to use byobu to multiplex SSH sessions.md b/sources/tech/20200212 How to use byobu to multiplex SSH sessions.md deleted file mode 100644 index 7b79a351f8..0000000000 --- a/sources/tech/20200212 How to use byobu to multiplex SSH sessions.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to use byobu to multiplex SSH sessions) -[#]: via: (https://opensource.com/article/20/2/byobu-ssh) -[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) - -How to use byobu to multiplex SSH sessions -====== -Byobu allows you to maintain multiple terminal windows, connect via SSH, -disconnect, reconnect, and share access, all while keeping the session -alive. -![Person drinking a hat drink at the computer][1] - -[Byobu][2] is a text-based window manager and terminal multiplexer. It's similar to [GNU Screen][3] but more modern and more intuitive. It also works on most Linux, BSD, and Mac distributions. - -Byobu allows you to maintain multiple terminal windows, connect via SSH (secure shell), disconnect, reconnect, and even let other people access it, all while keeping the session alive. - -For example, if you are SSH'd into a Raspberry Pi or server and run (for example) **sudo apt update && sudo apt upgrade**—and lose your internet connection while it is running, your command will be lost to the void. However, if you start a byobu session first, it will continue running and, when you reconnect, you will find it's been running happily without your eyes on it. - -![The byobu logo is a fun play on screens.][4] - -Byobu is named for a Japanese term for decorative, multi-panel screens that serve as folding room dividers, which I think is quite fitting. - -To install byobu on Debian/Raspbian/Ubuntu: - -**sudo apt install byobu** - -Then enable it: - -**byobu-enable** - -Now drop out of your SSH session and log back in—you'll land in a byobu session. Run a command like **sudo apt update** and close the window (or enter the escape sequence ([**Enter**+**~**+**.**][5]) and log back in. You'll see the update running just as you left it. - -There are a _lot_ of features I don't use regularly or at all. The most common ones I use are: - - * **F2** – New window - * **F3/F4** – Navigate between windows - * **Ctrl**+**F2** – Split pane vertically - * **Shift**+**F2** – Split pane horizontally - * **Shift**+**Left arrow/Shift**+**Right arrow** – Navigate between splits - * **Shift**+**F11** – Zoom in (or out) on a split - - - -You can learn more by watching this video: - -### How we're using byobu - -Byobu has been great for the maintenance of [piwheels][6], the convenient, pre-compiled Python packages for Raspberry Pi. We have a horizontal split showing the piwheels monitor in the top half and the syslog entries scrolled in real time on the bottom half. Then, if we want to do something else, we switch to another window. It's particularly handy when we're investigating something collaboratively, as I can see what my colleague Dave types (and correct his typos) while we chat in IRC. - -I have byobu enabled on my home and work servers, so when I log into either machine, everything is as I left it—multiple jobs running, a window left in a particular directory, running a process as another user, that kind of thing. - -![byobu screenshot][7] - -Byobu is handy for development on Raspberry Pis, too. You can launch it on the desktop, run a command, then SSH in and attach yourself to the session where that command is running. Just note that enabling byobu won't change what the terminal launcher does. Just run **byobu** to launch it. - -* * * - -_This article originally appeared on Ben Nuttall's [Tooling blog][8] and is reused with permission._ - -Enter the black raspberry. Rubus occidentalis . It's an ominous name for an ominous fruit: the... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/byobu-ssh - -作者:[Ben Nuttall][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/bennuttall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) -[2]: https://byobu.org/ -[3]: http://www.gnu.org/software/screen/ -[4]: https://opensource.com/sites/default/files/uploads/byobu.png (byobu screen) -[5]: https://www.google.com/search?client=ubuntu&channel=fs&q=Enter-tilde-dot&ie=utf-8&oe=utf-8 -[6]: https://opensource.com/article/20/1/piwheels -[7]: https://opensource.com/sites/default/files/uploads/byobu-screenshot.png (byobu screenshot) -[8]: https://tooling.bennuttall.com/byobu/ diff --git a/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md b/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md new file mode 100644 index 0000000000..9c871b4840 --- /dev/null +++ b/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use byobu to multiplex SSH sessions) +[#]: via: (https://opensource.com/article/20/2/byobu-ssh) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +如何使用 byobu 复用 SSH 会话 +====== +Byobu 能让你在保持会话活跃的情况下维护多个终端窗口、通过 SSH 连接、断开、重连以及共享访问。 +![Person drinking a hat drink at the computer][1] + +[Byobu][2] 是基于文本的窗口管理器和终端多路复用器。它类似于 [GNU Screen][3],但更现代,更直观。它还适用于大多数 Linux、BSD 和 Mac 发行版。 + +Byobu 能让你在保持会话活跃的情况下维护多个终端窗口、通过 SSH (secure shell)连接、断开、重连,甚至让其他人访问。 + +比如,你 SSH 进入树莓派或服务器,并运行(比如) **sudo apt update && sudo apt upgrade**,然后你在它运行的时候失去了互联网连接,你的命令会丢失无效。然而,如果你首先启动 byobu 会话,那么它会继续运行,在你重连后,你会发现它仍在继续运行。 + +![The byobu logo is a fun play on screens.][4] + +Byobu 的日语术语是指装饰性多面板屏风,可作为折叠式隔断,我认为这很合适。 + +要在 Debian/Raspbian/Ubuntu 上安装 byobu: + +**sudo apt install byobu** + +接着启用它 + +**byobu-enable** + +现在,请退出 SSH 会话并重新登录,你将会在 byobu 会话中登录。运行类似 **sudo apt update** 命令并关闭窗口(或输入转义序列([**Enter**+**~**+**.**][5])并重新登录。你将看到更新在你离开后还在运行。 + +有_很多_我不常使用的功能。我通常使用的是: + + * **F2** – 新窗口 + * **F3/F4** – 在窗口间导航 + * **Ctrl**+**F2** – 垂直拆分窗格 + * **Shift**+**F2** – 水平拆分窗格 + * **Shift**+**左箭头/Shift**+**右箭头** – 在拆分窗格间导航 + * **Shift**+**F11** – 放大(或缩小)拆分窗格 + + +### 我们如何使用 byobu + +Byobu 对于 [piwheels][6](一个用于树莓派的方便的,预编译 Python 包)的维护很方便。我门水平拆分了窗格,在上半部分显示了 piwheels 监视器,在下半部分实时显示了 syslog 条目。接着,如果我们想要做其他事情,我们可以切换到另外一个窗口。当我们进行协作调查时,这特别方便,因为当我在 IRC 中聊天时,我可以看到我的同事 Dave 输入了什么(并纠正他的错字)。 + +我在家庭和办公服务器上启用了 byobu,因此,当我登录到任何一台计算机时,一切都与我离开时一样。它正在运行多个作业、在特定目录中保留一个窗口,以另一个用户身份运行进程等。 + +![byobu screenshot][7] + +Byobu 也很方便用于在树莓派上进行开发。你可以在桌面上启动它,运行命令,然后 SSH 进入,并连接到该命令运行所在的会话。请注意,启用 byobu 不会更改终端启动器的功能。只需运行 **byobu** 即可启动它。 + +* * * + +_本文最初发表在 Ben Nuttall 的 [Tooling blog][8] 中,并获许重用_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/byobu-ssh + +作者:[Ben Nuttall][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/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) +[2]: https://byobu.org/ +[3]: http://www.gnu.org/software/screen/ +[4]: https://opensource.com/sites/default/files/uploads/byobu.png (byobu screen) +[5]: https://www.google.com/search?client=ubuntu&channel=fs&q=Enter-tilde-dot&ie=utf-8&oe=utf-8 +[6]: https://opensource.com/article/20/1/piwheels +[7]: https://opensource.com/sites/default/files/uploads/byobu-screenshot.png (byobu screenshot) +[8]: https://tooling.bennuttall.com/byobu/ From 65562443cff06ba0b4e75cb180d500ad2f749896 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 27 Feb 2020 08:43:21 +0800 Subject: [PATCH 190/315] translating --- ... Build your own cloud with Fedora 31 and Nextcloud Server.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md b/sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md index 69b8ad9e06..5aa4ee5023 100644 --- a/sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md +++ b/sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5b335551e91e6cfc08dcd5bc47fdc56f1a47f9d3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 27 Feb 2020 09:41:36 +0800 Subject: [PATCH 191/315] Rename sources/tech/20200226 How we decide when to release Fedora.md to sources/talk/20200226 How we decide when to release Fedora.md --- .../20200226 How we decide when to release Fedora.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200226 How we decide when to release Fedora.md (100%) diff --git a/sources/tech/20200226 How we decide when to release Fedora.md b/sources/talk/20200226 How we decide when to release Fedora.md similarity index 100% rename from sources/tech/20200226 How we decide when to release Fedora.md rename to sources/talk/20200226 How we decide when to release Fedora.md From 5c2e49cb9fe68f98e0df10b3b27bef7e18c6e953 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 Feb 2020 10:29:42 +0800 Subject: [PATCH 192/315] PRF @geekpi --- ...0 Scan Kubernetes for errors with KRAWL.md | 186 +++++++++--------- 1 file changed, 92 insertions(+), 94 deletions(-) diff --git a/translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md b/translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md index dae3043217..ef33fd24c8 100644 --- a/translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md +++ b/translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Scan Kubernetes for errors with KRAWL) @@ -9,25 +9,25 @@ 使用 KRAWL 扫描 Kubernetes 错误 ====== -用 KRAWL 脚本来标识 Kubernetes pod 和容器中的错误。 + +> 用 KRAWL 脚本来识别 Kubernetes Pod 和容器中的错误。 + ![Ship captain sailing the Kubernetes seas][1] -当你使用 Kubernetes 运行容器时,你通常会发现它们堆积。这是设计使然。它是容器的优点之一:每当需要新的容器时,它们启动成本都很低。你可以使用前端(如 OpenShift 或 OKD)来管理 pod 和容器。这些工具使可视化设置变得容易,并且它具有一组丰富的用于快速交互的命令。 +当你使用 Kubernetes 运行容器时,你通常会发现它们堆积在一起。这是设计使然。它是容器的优点之一:每当需要新的容器时,它们启动成本都很低。你可以使用前端工具(如 OpenShift 或 OKD)来管理 Pod 和容器。这些工具使可视化设置变得容易,并且它具有一组丰富的用于快速交互的命令。 -如果管理容器的平台不符合你的要求,你也可以仅使用 Kubernetes 工具链获取这些信息,但这需要大量命令才能全面了解复杂环境。出于这个原因,我编写了 [KRAWL][2],这是一个简单的脚本,可用于扫描 Kubernetes 集群命名空间下的 pod 和容器,并在发现任何事件时,显示事件的输出。它也可用作为 Kubernetes 插件使用。这是获取大量有用信息的快速简便方法。 - -### 预先条件 - - * 必须安装 kubectl。 - * 集群的 kubeconfig 配置必须在它的默认位置 ($HOME/.kube/config) 或已被导出。 +如果管理容器的平台不符合你的要求,你也可以仅使用 Kubernetes 工具链获取这些信息,但这需要大量命令才能全面了解复杂环境。出于这个原因,我编写了 [KRAWL][2],这是一个简单的脚本,可用于扫描 Kubernetes 集群命名空间下的 Pod 和容器,并在发现任何事件时,显示事件的输出。它也可用作为 Kubernetes 插件使用。这是获取大量有用信息的快速简便方法。 +### 先决条件 + * 必须安装 `kubectl`。 + * 集群的 kubeconfig 配置必须在它的默认位置(`$HOME/.kube/config`)或已被导出到环境变量(`KUBECONFIG=/path/to/kubeconfig`)。 ### 使用 ``` -`$ ./krawl` +$ ./krawl ``` ![KRAWL script][3] @@ -38,20 +38,20 @@ ``` #!/bin/bash # AUTHOR: Abhishek Tamrakar -# EMAIL: [abhishek.tamrakar08@gmail.com][4] +# EMAIL: abhishek.tamrakar08@gmail.com # LICENSE: Copyright (C) 2018 Abhishek Tamrakar # -#  Licensed under the Apache License, Version 2.0 (the "License"); -#  you may not use this file except in compliance with the License. -#  You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -#       +# http://www.apache.org/licenses/LICENSE-2.0 # -#   Unless required by applicable law or agreed to in writing, software -#   distributed under the License is distributed on an "AS IS" BASIS, -#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -#   See the License for the specific language governing permissions and -#   limitations under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. ## #define the variables KUBE_LOC=~/.kube/config @@ -66,102 +66,102 @@ normal=$(tput sgr0) # wrapper for printing info messages info() { -  printf '\n\e[34m%s\e[m: %s\n' "INFO" "$@" + printf '\n\e[34m%s\e[m: %s\n' "INFO" "$@" } # cleanup when all done cleanup() { -  rm -f results.csv + rm -f results.csv } # just check if the command we are about to call is available checkcmd() { -  #check if command exists -  local cmd=$1 -  if [ -z "${!cmd}" ] -  then -    printf '\n\e[31m%s\e[m: %s\n' "ERROR"  "check if $1 is installed !!!" -    exit 1 -  fi + #check if command exists + local cmd=$1 + if [ -z "${!cmd}" ] + then + printf '\n\e[31m%s\e[m: %s\n' "ERROR" "check if $1 is installed !!!" + exit 1 + fi } get_namespaces() { -  #get namespaces -  namespaces=( \ -          $($KUBECTL get namespaces --ignore-not-found=true | \ -          $AWK '/Active/ {print $1}' \ -          ORS=" ") \ -          ) + #get namespaces + namespaces=( \ + $($KUBECTL get namespaces --ignore-not-found=true | \ + $AWK '/Active/ {print $1}' \ + ORS=" ") \ + ) #exit if namespaces are not found if [ ${#namespaces[@]} -eq 0 ] then -  printf '\n\e[31m%s\e[m: %s\n' "ERROR"  "No namespaces found!!" -  exit 1 + printf '\n\e[31m%s\e[m: %s\n' "ERROR" "No namespaces found!!" + exit 1 fi } #get events for pods in errored state get_pod_events() { -  printf '\n' -  if [ ${#ERRORED[@]} -ne 0 ] -  then -      info "${#ERRORED[@]} errored pods found." -      for CULPRIT in ${ERRORED[@]} -      do -        info "POD: $CULPRIT" -        info -        $KUBECTL get events \ -        --field-selector=involvedObject.name=$CULPRIT \ -        -ocustom-columns=LASTSEEN:.lastTimestamp,REASON:.reason,MESSAGE:.message \ -        --all-namespaces \ -        --ignore-not-found=true -      done -  else -      info "0 pods with errored events found." -  fi + printf '\n' + if [ ${#ERRORED[@]} -ne 0 ] + then + info "${#ERRORED[@]} errored pods found." + for CULPRIT in ${ERRORED[@]} + do + info "POD: $CULPRIT" + info + $KUBECTL get events \ + --field-selector=involvedObject.name=$CULPRIT \ + -ocustom-columns=LASTSEEN:.lastTimestamp,REASON:.reason,MESSAGE:.message \ + --all-namespaces \ + --ignore-not-found=true + done + else + info "0 pods with errored events found." + fi } #define the logic get_pod_errors() { -  printf "%s %s %s\n" "NAMESPACE,POD_NAME,CONTAINER_NAME,ERRORS" > results.csv -  printf "%s %s %s\n" "---------,--------,--------------,------" >> results.csv -  for NAMESPACE in ${namespaces[@]} -  do -    while IFS=' ' read -r POD CONTAINERS -    do -      for CONTAINER in ${CONTAINERS//,/ } -      do -        COUNT=$($KUBECTL logs --since=1h --tail=20 $POD -c $CONTAINER -n $NAMESPACE 2>/dev/null| \ -        $GET -c '^error|Error|ERROR|Warn|WARN') -        if [ $COUNT -gt 0 ] -        then -            STATE=("${STATE[@]}" "$NAMESPACE,$POD,$CONTAINER,$COUNT") -        else -        #catch pods in errored state -            ERRORED=($($KUBECTL get pods -n $NAMESPACE --no-headers=true | \ -                awk '!/Running/ {print $1}' ORS=" ") \ -                ) -        fi -      done -    done< <($KUBECTL get pods -n $NAMESPACE --ignore-not-found=true -o=custom-columns=NAME:.metadata.name,CONTAINERS:.spec.containers[*].name --no-headers=true) -  done -  printf "%s\n" ${STATE[@]:-None} >> results.csv -  STATE=() + printf "%s %s %s\n" "NAMESPACE,POD_NAME,CONTAINER_NAME,ERRORS" > results.csv + printf "%s %s %s\n" "---------,--------,--------------,------" >> results.csv + for NAMESPACE in ${namespaces[@]} + do + while IFS=' ' read -r POD CONTAINERS + do + for CONTAINER in ${CONTAINERS//,/ } + do + COUNT=$($KUBECTL logs --since=1h --tail=20 $POD -c $CONTAINER -n $NAMESPACE 2>/dev/null| \ + $GET -c '^error|Error|ERROR|Warn|WARN') + if [ $COUNT -gt 0 ] + then + STATE=("${STATE[@]}" "$NAMESPACE,$POD,$CONTAINER,$COUNT") + else + #catch pods in errored state + ERRORED=($($KUBECTL get pods -n $NAMESPACE --no-headers=true | \ + awk '!/Running/ {print $1}' ORS=" ") \ + ) + fi + done + done< <($KUBECTL get pods -n $NAMESPACE --ignore-not-found=true -o=custom-columns=NAME:.metadata.name,CONTAINERS:.spec.containers[*].name --no-headers=true) + done + printf "%s\n" ${STATE[@]:-None} >> results.csv + STATE=() } #define usage for seprate run usage() { -cat << EOF +cat << EOF -  USAGE: "${0##*/} </path/to/kube-config>(optional)" + USAGE: "${0##*/} (optional)" -  This program is a free software under the terms of Apache 2.0 License. -  COPYRIGHT (C) 2018 Abhishek Tamrakar + This program is a free software under the terms of Apache 2.0 License. + COPYRIGHT (C) 2018 Abhishek Tamrakar EOF exit 0 @@ -173,17 +173,17 @@ checkcmd KUBECTL # #set the ground if [ $# -lt 1 ]; then -  if [ ! -e ${KUBE_LOC} -a ! -s ${KUBE_LOC} ] -  then -    info "A readable kube config location is required!!" -    usage -  fi + if [ ! -e ${KUBE_LOC} -a ! -s ${KUBE_LOC} ] + then + info "A readable kube config location is required!!" + usage + fi elif [ $# -eq 1 ] then -  export KUBECONFIG=$1 + export KUBECONFIG=$1 elif [ $# -gt 1 ] then -  usage + usage fi #play get_namespaces @@ -191,7 +191,7 @@ get_pod_errors printf '\n%40s\n' 'KRAWL' printf '%s\n' '---------------------------------------------------------------------------------' -printf '%s\n' '  Krawl is a command line utility to scan pods and prints name of errored pods   ' +printf '%s\n' ' Krawl is a command line utility to scan pods and prints name of errored pods ' printf '%s\n\n' ' +and containers within. To use it as kubernetes plugin, please check their page ' printf '%s\n' '=================================================================================' @@ -199,9 +199,7 @@ cat results.csv | sed 's/,/,|/g'| column -s ',' -t get_pod_events ``` -* * * - -_此文最初发布在 [KRAWL 的 GitHub 仓库][2]下的 README 中,并被或许重用。_ +此文最初发布在 [KRAWL 的 GitHub 仓库][2]下的 README 中,并被或许重用。 -------------------------------------------------------------------------------- @@ -210,7 +208,7 @@ via: https://opensource.com/article/20/2/kubernetes-scanner 作者:[Abhishek Tamrakar][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/) 荣誉推出 From 14bb061b533ed2726d5822aca0860a03fc80a7a8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 Feb 2020 10:30:13 +0800 Subject: [PATCH 193/315] PUB @geekpi https://linux.cn/article-11936-1.html --- .../20200210 Scan Kubernetes for errors with KRAWL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200210 Scan Kubernetes for errors with KRAWL.md (98%) diff --git a/translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md b/published/20200210 Scan Kubernetes for errors with KRAWL.md similarity index 98% rename from translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md rename to published/20200210 Scan Kubernetes for errors with KRAWL.md index ef33fd24c8..22fcd2a098 100644 --- a/translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md +++ b/published/20200210 Scan Kubernetes for errors with KRAWL.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11936-1.html) [#]: subject: (Scan Kubernetes for errors with KRAWL) [#]: via: (https://opensource.com/article/20/2/kubernetes-scanner) [#]: author: (Abhishek Tamrakar https://opensource.com/users/tamrakar) From 9ca40c0db824d6b8733b90eaac1a63ab903c0d62 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 Feb 2020 12:06:17 +0800 Subject: [PATCH 194/315] PRF @lujun9972 --- ...ice for How to Make Emacs Tetris Harder.md | 61 ++++++++----------- 1 file changed, 25 insertions(+), 36 deletions(-) diff --git a/translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md b/translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md index 81d107ec69..8a93358ece 100644 --- a/translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md +++ b/translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md @@ -1,30 +1,28 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Some Advice for How to Make Emacs Tetris Harder) [#]: via: (https://nickdrozd.github.io/2019/01/14/tetris.html) [#]: author: (nickdrozd https://nickdrozd.github.io) -让 Emacs 俄罗斯方块变得更难的一些建议 (Advice) +如何让 Emacs 俄罗斯方块变得更难 ====== -你知道吗,**Emacs** 与 **俄罗斯方块** 的实现捆绑在一起了?只需要输入 `M-x tetris` 就行了。 +你知道吗,Emacs 捆绑了一个俄罗斯方块的实现?只需要输入 `M-x tetris` 就行了。 -![img](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-normal.png) +![](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-normal.png) -在文本编辑器讨论中,Emacs 倡导者经常提到这一点。“没错,但是那个编辑器能运行俄罗斯方块吗?” -我很好奇,这会让大家相信 Emacs 更优秀吗?比如,为什么有人会关心他们是否可以在文本编辑器中玩游戏呢?“是的,但是那台吸尘器能播放 mp3 吗?” +在对文本编辑器的讨论中,Emacs 鼓吹者经常提到这一点。“没错,但是你那个编辑器能运行俄罗斯方块吗?”我很好奇,这会让大家相信 Emacs 更优秀吗?比如,为什么有人会关心他们是否可以在文本编辑器中玩游戏呢?“没错,但是你那台吸尘器能播放 mp3 吗?” -有人说,俄罗斯方块总是很有趣的。像 Emacs 中的所有东西一样,它的源代码是开放的,易于检查和修改,因此 **我们可以使它变得更加有趣**。所谓更多的乐趣,我意思是更难。 +有人说,俄罗斯方块总是很有趣的。像 Emacs 中的所有东西一样,它的源代码是开放的,易于检查和修改,因此 **我们可以使它变得更加有趣**。所谓更加有趣,我的意思是更难。 -让游戏变得更困难的一个最简单的方法就是“不要下一个块预览”。你无法再在知道下一个块会填满空间的情况下有意地将 S/Z 块放在一个危险的位置——你必须碰碰运气,希望出现最好的情况。 -下面是没有预览的情况(如你所见,没有预览,我做出的某些选择带来了“可怕的后果”): +让游戏变得更难的一个最简单的方法就是“隐藏下一个块预览”。你无法在知道下一个块会填满空间的情况下有意地将 S/Z 块放在一个危险的位置——你必须碰碰运气,希望出现最好的情况。下面是没有预览的情况(如你所见,没有预览,我做出的某些选择带来了“可怕的后果”): -![img](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-no-preview.png) +![](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-no-preview.png) -预览框由一个名为 `tetris-draw-next-shape` 的函数设置: +预览框由一个名为 `tetris-draw-next-shape` [^1] 的函数设置: ``` (defun tetris-draw-next-shape () @@ -43,7 +41,7 @@ tetris-shape)))) ``` -首先,我们引入一个标志,决定是否允许显示下一个预览块: +首先,我们引入一个标志,决定是否允许显示下一个预览块 [^2]: ``` (defvar tetris-preview-next-shape nil @@ -63,7 +61,7 @@ 一个更好的方法是使用 **advice**。Emacs 的 advice 类似于 **Python 装饰器**,但是更加灵活,因为 advice 可以从任何地方添加到函数中。这意味着我们可以修改函数而不影响原始的源文件。 -有很多不同的方法使用 Emacs advice([ 查看手册 ][4]),但是这里我们只使用 `advice-add` 函数和 `:around` 标志。advise 函数将原始函数作为参数,原始函数可能执行也可能不执行。我们这里,我们让原始函数只有在预览标志是非空的情况下才能执行: +有很多不同的方法使用 Emacs advice([查看手册][4]),但是这里我们只使用 `advice-add` 函数和 `:around` 标志。advice 函数将原始函数作为参数,原始函数可能执行也可能不执行。我们这里,我们让原始函数只有在预览标志是非空的情况下才能执行: ``` (defun tetris-maybe-draw-next-shape (tetris-draw-next-shape) @@ -75,11 +73,11 @@ 这段代码将修改 `tetris-draw-next-shape` 的行为,而且它可以存储在配置文件中,与实际的俄罗斯方块代码分离。 -去掉预览框是一个简单的改变。一个更激烈的变化是,**让块随机停止在空中**: +去掉预览框是一个简单的改变。一个更激烈的变化是,**让块随机停止在空中**: -![img](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-air.png) +![](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-air.png) -本图中,红色的 I 和绿色的 T 部分没有掉下来,它们被固定下来了。这会让游戏变得 **及其难玩**,但却很容易实现。 +本图中,红色的 I 和绿色的 T 部分没有掉下来,它们被固定下来了。这会让游戏变得 **极其困难**,但却很容易实现。 和前面一样,我们首先定义一个标志: @@ -88,10 +86,9 @@ "If non-nil, pieces will sometimes stop in the air.") ``` -目前,**Emacs 俄罗斯方块的工作方式** 类似这样子:活动部件有 x 和 y 坐标。在每个时钟滴答声中,y 坐标递增(块向下移动一行),然后检查是否有与现存的块重叠。 -如果检测到重叠,则将该块回退(其 y 坐标递减)并设置该活动块到位。为了让一个块在半空中停下来,我们所要做的就是破解检测函数 `tetris-test-shape`。 +目前,**Emacs 俄罗斯方块的工作方式** 类似这样子:活动部件有 x 和 y 坐标。在每个时钟滴答声中,y 坐标递增(块向下移动一行),然后检查是否有与现存的块重叠。如果检测到重叠,则将该块回退(其 y 坐标递减)并设置该活动块到位。为了让一个块在半空中停下来,我们所要做的就是破解检测函数 `tetris-test-shape`。 -**这个函数内部做什么并不重要** —— 重要的是它是一个返回布尔值的无参数函数。我们需要它在正常情况下返回布尔值 true( 否则我们将出现奇怪的重叠情况),但在其他时候也需要它返回 true。我相信有很多方法可以做到这一点,以下是我的方法的: +**这个函数内部做什么并不重要** —— 重要的是它是一个返回布尔值的无参数函数。我们需要它在正常情况下返回布尔值 true(否则我们将出现奇怪的重叠情况),但在其他时候也需要它返回 true。我相信有很多方法可以做到这一点,以下是我的方法的: ``` (defun tetris-test-shape-random (tetris-test-shape) @@ -114,7 +111,7 @@ 这里的硬编码参数使游戏变得更困难,但仍然可玩。当时我在飞机上喝醉了,所以它们可能需要进一步调整。 -顺便说一下,根据我的 `tetris-scores` 文件,我的 **最高分** 是 +顺便说一下,根据我的 `tetris-scores` 文件,我的 **最高分** 是: ``` 01389 Wed Dec 5 15:32:19 2018 @@ -122,23 +119,15 @@ 该文件中列出的分数默认最多为五位数,因此这个分数看起来不是很好。 -**给读者的练习** +### 给读者的练习 -1。使用 advice 修改 Emacs 俄罗斯方块,使得每当方块下移动时就闪烁显示讯息 “OH SHIT”。消息的大小与块堆的高度成比例(当没有块时,消息应该很小的或不存在的,当最高块接近天花板时,消息应该很大)。 +1. 使用 advice 修改 Emacs 俄罗斯方块,使得每当方块下移动时就闪烁显示讯息 “OH SHIT”。消息的大小与块堆的高度成比例(当没有块时,消息应该很小的或不存在的,当最高块接近天花板时,消息应该很大)。 +2. 在这里给出的 `tetris-test-shape-random` 版本中,每隔七格就有一个半空中停止。一个玩家有可能能计算出时间间隔,并利用它来获得优势。修改它,使间隔随机在一些合理的范围内(例如,每 5 到 10 格)。 +3. 另一个对使用 Tetris 使用 advise 的场景,你可以试试 [autotetris-mode][1]。 +4. 想出一个有趣的方法来打乱块的旋转机制,然后使用 advice 来实现它。 -2。在这里给出的 `tetris-test-shape-random` 版本中,每隔七格就有一个半空中停止。一个玩家有可能能计算出时间间隔,并利用它来获得优势。修改它,使间隔随机在一些合理的范围内(例如,每 5 到 10 格)。 - -3。另一个对使用 Tetris 使用 advise 的场景,你可以试试 [`autotetris-mode`][1]。 - -4。想出一个有趣的方法来打乱块的旋转机制,然后使用 advice 来实现它。 - - -附注 -============================================================ - -[1][5] Emacs 只有一个巨大的全局命名空间,因此函数和变量名一般以包名做前缀以避免冲突。 - -[2][6] 很多人会说你不应该使用已有的命名空间前缀而且应该将自己定义的所有东西都放在一个预留的命名空间中,比如像这样 `my/tetris-preview-next-shape`,然而这样很难看而且没什么意义,因此我不会这么干。 +[^1]: Emacs 只有一个巨大的全局命名空间,因此函数和变量名一般以包名做前缀以避免冲突。 +[^2]: 很多人会说你不应该使用已有的命名空间前缀而且应该将自己定义的所有东西都放在一个预留的命名空间中,比如像这样 `my/tetris-preview-next-shape`,然而这样很难看而且没什么意义,因此我不会这么干。 -------------------------------------------------------------------------------- @@ -147,7 +136,7 @@ via: https://nickdrozd.github.io/2019/01/14/tetris.html 作者:[nickdrozd][a] 选题:[lujun9972][b] 译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 69f356b6eaeb02e45e1a1e1128f55f3a714b6311 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 Feb 2020 12:06:49 +0800 Subject: [PATCH 195/315] PUB @lujun9972 https://linux.cn/article-11938-1.html --- ...0190114 Some Advice for How to Make Emacs Tetris Harder.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190114 Some Advice for How to Make Emacs Tetris Harder.md (99%) diff --git a/translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md b/published/20190114 Some Advice for How to Make Emacs Tetris Harder.md similarity index 99% rename from translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md rename to published/20190114 Some Advice for How to Make Emacs Tetris Harder.md index 8a93358ece..7e06e1b241 100644 --- a/translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md +++ b/published/20190114 Some Advice for How to Make Emacs Tetris Harder.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11938-1.html) [#]: subject: (Some Advice for How to Make Emacs Tetris Harder) [#]: via: (https://nickdrozd.github.io/2019/01/14/tetris.html) [#]: author: (nickdrozd https://nickdrozd.github.io) From 3b44f1508fa2c6725ece77dedc6f7ec3a27de0db Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Thu, 27 Feb 2020 13:15:30 +0800 Subject: [PATCH 196/315] hankchow translating --- ...t developers need to know about domain-specific languages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200224 What developers need to know about domain-specific languages.md b/sources/tech/20200224 What developers need to know about domain-specific languages.md index 8c274f42b8..422d91eb22 100644 --- a/sources/tech/20200224 What developers need to know about domain-specific languages.md +++ b/sources/tech/20200224 What developers need to know about domain-specific languages.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e00988555ae953b8b8f4d94e40f564f444052f65 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Thu, 27 Feb 2020 20:30:15 +0800 Subject: [PATCH 197/315] hankchow translated --- ...to know about domain-specific languages.md | 130 ------------------ ...to know about domain-specific languages.md | 130 ++++++++++++++++++ 2 files changed, 130 insertions(+), 130 deletions(-) delete mode 100644 sources/tech/20200224 What developers need to know about domain-specific languages.md create mode 100644 translated/tech/20200224 What developers need to know about domain-specific languages.md diff --git a/sources/tech/20200224 What developers need to know about domain-specific languages.md b/sources/tech/20200224 What developers need to know about domain-specific languages.md deleted file mode 100644 index 422d91eb22..0000000000 --- a/sources/tech/20200224 What developers need to know about domain-specific languages.md +++ /dev/null @@ -1,130 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What developers need to know about domain-specific languages) -[#]: via: (https://opensource.com/article/20/2/domain-specific-languages) -[#]: author: (Girish Managoli https://opensource.com/users/gammay) - -What developers need to know about domain-specific languages -====== -DSLs are used for a specific context in a particular domain. Learn more -about what they are and why you might want to use one. -![Various programming languages in use][1] - -A [domain-specific language][2] (DSL) is a language meant for use in the context of a particular domain. A domain could be a business context (e.g., banking, insurance, etc.) or an application context (e.g., a web application, database, etc.) In contrast, a general-purpose language (GPL) can be used for a wide range of business problems and applications. - -A DSL does not attempt to please all. Instead, it is created for a limited sphere of applicability and use, but it's powerful enough to represent and address the problems and solutions in that sphere. A good example of a DSL is HTML. It is a language for the web application domain. It can't be used for, say, number crunching, but it is clear how widely used HTML is on the web. - -A GPL creator does not know where the language might be used or the problems the user intends to solve with it. So, a GPL is created with generic constructs that potentially are usable for any problem, solution, business, or need. Java is a GPL, as it's used on desktops and mobile devices, embedded in the web across banking, finance, insurance, manufacturing, etc., and more. - -### Classifying DSLs - -In the DSL world, there are two types of languages: - - * **Domain-specific language (DSL):** The language in which a DSL is written or presented - * **Host language:** The language in which a DSL is executed or processed - - - -A DSL written in a distinct language and processed by another host language is called an **external** DSL. - -This is a DSL in SQL that can be processed in a host language: - - -``` -SELECT account -FROM accounts -WHERE account = '123' AND branch = 'abc' AND amount >= 1000 -``` - -For that matter, a DSL could be written in English with a defined vocabulary and form that can be processed in another host language using a parser generator like ANTLR: - - -``` -`if smokes then increase premium by 10%` -``` - -If the DSL and host language are the same, then the DSL type is **internal**, where the DSL is written in the language's semantics and processed by it. These are also referred to as **embedded** DSLs. Here are two examples. - - * A Bash DSL that can be executed in a Bash engine: [code]`if today_is_christmas; then apply_christmas_discount; fi` [/code] This is valid Bash that is written like English. - * A DSL written in a GPL like Java: [code] orderValue = orderValue -                .applyFestivalDiscount() -                .applyCustomerLoyalityDiscount() -                .applyCustomerAgeDiscount(); [/code] This uses a fluent style and is readable like English. - - - -Yes, the boundaries between DSL and GPL sometimes blur. - -### DSL examples - -Some languages used for DSLs include: - - * Web: HTML - * Shell: sh, Bash, CSH, and the likes for *nix; MS-DOS, Windows Terminal, PowerShell for Windows - * Markup languages: XML - * Modeling: UML - * Data management: SQL and its variants - * Business rules: Drools - * Hardware: Verilog, VHD - * Build tools: Maven, Gradle - * Numerical computation and simulation: MATLAB (commercial), GNU Octave, Scilab - * Various types of parsers and generators: Lex, YACC, GNU Bison, ANTLR - - - -### Why DSL? - -The purpose of a DSL is to capture or document the requirements and behavior of one domain. A DSL's usage might be even narrower for particular aspects within the domain (e.g., commodities trading in finance). DSLs bring business and technical teams together. This does not imply a DSL is for business use alone. For example, designers and developers can use a DSL to represent or design an application. - -A DSL can also be used to generate source code for an addressed domain or problem. However, code generation from a DSL is not considered mandatory, as its primary purpose is domain knowledge. However, when it is used, code generation is a serious advantage in domain engineering. - -### DSL pros and cons - -On the plus side, DSLs are powerful for capturing a domain's attributes. Also, since DSLs are small, they are easy to learn and use. Finally, a DSL offers a language for domain experts and between domain experts and developers. - -On the downside, a DSL is narrowly used within the intended domain and purpose. Also, a DSL has a learning curve, although it may not be very high. Additionally, although there may be advantages to using tools for DSL capture, they are not essential, and the development or configuration of such tools is an added effort. Finally, DSL creators need domain knowledge as well as language-development knowledge, and individuals rarely have both. - -### DSL software options - -Open source DSL software options include: - - * **Xtext:** Xtext enables the development of DSLs and is integrated with Eclipse. It makes code generation possible and has been used by several open source and commercial products to provide specific functions. [MADS][3] (Multipurpose Agricultural Data System) is an interesting idea based on Xtext for "modeling and analysis of agricultural activities" (however, the project seems to be no longer active). - * **JetBrains MPS:** JetBrains MPS is an integrated development environment (IDE) to create DSLs. It calls itself a projectional editor that stores a document as its underlying abstract tree structure. (This concept is also used by programs such as Microsoft Word.) JetBrains MPS also supports code generation to Java, C, JavaScript, or XML. - - - -### DSL best practices - -Want to use a DSL? Here are a few tips: - - * DSLs are not GPLs. Try to address limited ranges of problems in the definitive domain. - * You do not need to define your own DSL. That would be tedious. Look for an existing DSL that solves your need on sites like [DSLFIN][4], which lists DSLs for the finance domain. If you are unable to find a suitable DSL, you could define your own. - * It is better to make DSLs "like English" rather than too technical. - * Code generation from a DSL is not mandatory, but it offers significant and productive advantages when it is done. - * DSLs are called languages but, unlike GPLs, they need not be executable. Being executable is not the intent of a DSL. - * DSLs can be written with word processors. However, using a DSL editor makes syntax and semantics checks easier. - - - -If you are using DSL now or plan to do so in the future, please share your experience in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/domain-specific-languages - -作者:[Girish Managoli][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/gammay -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_language_c.png?itok=mPwqDAD9 (Various programming languages in use) -[2]: https://en.wikipedia.org/wiki/Domain-specific_language -[3]: http://mads.sourceforge.net/ -[4]: http://www.dslfin.org/resources.html diff --git a/translated/tech/20200224 What developers need to know about domain-specific languages.md b/translated/tech/20200224 What developers need to know about domain-specific languages.md new file mode 100644 index 0000000000..299ed726fc --- /dev/null +++ b/translated/tech/20200224 What developers need to know about domain-specific languages.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What developers need to know about domain-specific languages) +[#]: via: (https://opensource.com/article/20/2/domain-specific-languages) +[#]: author: (Girish Managoli https://opensource.com/users/gammay) + + +开发者需要了解的领域特定语言 +====== +> 领域特定语言是在特定领域下用于特定上下文的语言。作为开发者,很有必要了解领域特定语言的含义,以及为什么要使用特定领域语言。 + +![Various programming languages in use][1] + +领域特定语言domain-specific language(DSL)是在特定领域下用于特定上下文的语言。这里的领域是指某种商业上的(例如银行业、保险业等)上下文,也可以指某种应用程序的(例如 Web 应用、数据库等)上下文。与之相比的另一个概念是通用语言general-purpose language(GPL),通用语言则可以广泛应用于各种商业或应用问题当中。 + +DSL 并不具备很强的普适性,它是仅为某个适用的领域而设计的,但它也足以用于表示这个领域中的问题以及构建对应的解决方案。HTML 是 DSL 的一个典型,它是在 Web 应用上使用的语言,尽管 HTML 无法进行数字运算,但也不影响它在这方面的广泛应用。 + +而 GPL 则没有特定针对的领域,GPL 的设计者不可能知道这种语言会在什么领域被使用,更不清楚用户打算解决的问题是什么,因此 GPL 会被设计成可用于解决任何一种问题、适合任何一种业务、满足任何一种需求。例如 Java 就属于 GPL,它可以在 PC 或移动设备上运行,嵌入到银行、金融、保险、制造业等各种行业的应用中去。 + +### DSL 的类别 + +从使用方式的角度,语言可以划分出以下两类: + + * DSL:使用 DSL 形式编写或表示的语言 + * 宿主语言host language:用于执行或处理 DSL 的语言 + +当 DSL 以独有的形式表达,并由另一种宿主语言来处理时,这种 DSL 称为外部external DSL。 + +以下就是可以在宿主语言中处理的 SQL: + + +``` +SELECT account +FROM accounts +WHERE account = '123' AND branch = 'abc' AND amount >= 1000 +``` + +因此,只要在规定了词汇和语法的情况下,DSL 也可以直接使用英语来编写,并使用诸如 ANTLR 这样的解析器生成器parser generator以另一种宿主语言来处理 DSL: + + +``` +`if smokes then increase premium by 10%` +``` + +如果 DSL 和宿主语言是同一种语言,这种 DSL 称为内部internal DSL,其中 DSL 由以同一种语义的宿主语言编写和处理,因此又称为嵌入式embedded DSL。以下是两个例子: + + * Bash 形式的 DSL 可以由 Bash 解释器执行:`if today_is_christmas; then apply_christmas_discount; fi` 同时这也是一段看起来符合英语语法的 Bash。 + * 使用类似 Java 语法编写的 DSL: +``` +orderValue = orderValue + .applyFestivalDiscount() + .applyCustomerLoyalityDiscount() + .applyCustomerAgeDiscount(); +``` +这一段的可读性也相当强。 + +实际上,DSL 和 GPL 之间并没有非常明确的界限。 + +### DSL 家族 + +以下这些语言都可以作为 DSL 使用: + + * Web 应用:HTML + * Shell:用于类 Unix 系统的 sh、Bash、CSH 等;用于 Windows 系统的 MS-DOS、Windows Terminal、PowerShell 等 + * 标记语言:XML + * 建模:UML + * 数据处理:SQL 及其变体 + * 业务规则管理:Drools + * 硬件:Verilog、VHD + * 构建工具:Maven、Gradle + * 数值计算和模拟:MATLAB(商业)、GNU Octave、Scilab + * 解析器和生成器:Lex、YACC、GNU Bison、ANTLR + + + +### 为什么要使用 DSL? + +DSL 的目的是在某个领域中记录一些需求和行为,在某些方面(例如金融商品交易)中,DSL 的适用场景可能更加狭窄。业务团队和技术团队能通过 DSL 有效地协同工作,因此 DSL 除了在业务用途上有所发挥,还可以让设计人员和开发人员用于设计和开发应用程序。 + +DSL 还可以用于生成一些用于解决特定问题的代码,但生成代码并不是 DSL 的重点并不在此,而是对专业领域知识的结合。当然,代码生成在领域工程中是一个巨大的优势。 + +### DSL 的优点和缺点 + +DSL 的优点是,它对于领域的特征捕捉得非常好,同时它不像 GPL 那样包罗万有,学习和使用起来相对比较简单。因此,它在专业人员之间、专业人员和开发人员之间都提供了一个沟通的桥梁。 + +而 DSL 最显著的缺点就在于它只能用于一个特定的领域和目标。尽管学习起来不算太难,但学习成本仍然存在。如果使用到 DSL 相关的工具,即使对工作效率有所提升,但开发或配置这些工具也会增加一定的工作负担。另外,如果要设计一款 DSL,设计者必须具备专业领域知识和语言开发知识,而同时具备这两种知识的人却少之又少。 + +### DSL 相关软件 + +开源的 DSL 软件包括: + + * Xtext:Xtext 可以与 Eclipse 集成,并支持 DSL 开发。它能够实现代码生成,因此一些开源和商业产品都用它来提供特定的功能。用于农业活动建模分析的多用途农业数据系统Multipurpose Agricultural Data System(MADS)就是基于 Xtext 实现的一个项目,可惜的是这个项目现在已经不太活跃了。 + * JetBrains MPS:JetBrains MPS 是一个可供开发 DSL 的集成开发环境Integrated Development Environment,它将文档在底层存储为一个抽象树结构(Microsoft Word 也使用了这一概念),因此它也自称为一个投影编辑器projectional editor。JetBrains MPS 支持 Java、C、JavaScript 和 XML 的代码生成。 + +### DSL 的最佳实践 + +如果你想使用 DSL,记住以下几点: + + * DSL 不同于 GPL,DSL 只能用于解决特定领域中有限范围内的问题。 + * 不必动辄建立自己的 DSL,可以首先尝试寻找已有的 DSL。例如 [DSLFIN][4] 这个网站就提供了很多金融方面的 DSL。在实在找不到合适的 DSL 的情况下,才需要建立自己的 DSL。 + * DSL 最好像平常的语言一样具有可读性。 + * 尽管代码生成不是一项必需的工作,但它确实会大大提高工作效率。 + * 虽然 DSL 被称为语言,但 DSL 不需要像 GPL 一样可以被执行,可执行性并不是 DSL 需要达到的目的。 + * DSL 可以使用文本编辑器编写,但专门的 DSL 编辑器可以更轻松地完成 DSL 的语法和语义检查。 + + + +如果你正在使用或将要使用 DSL,欢迎在评论区留言。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/domain-specific-languages + +作者:[Girish Managoli][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gammay +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_language_c.png?itok=mPwqDAD9 (Various programming languages in use) +[2]: https://en.wikipedia.org/wiki/Domain-specific_language +[3]: http://mads.sourceforge.net/ +[4]: http://www.dslfin.org/resources.html From d240a751f23172fb579968220c48b787d4191db6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 Feb 2020 22:17:07 +0800 Subject: [PATCH 198/315] APL --- ... You Can Buy Open Source Apps for Your Linux Distribution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md b/sources/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md index 1019db718d..903c8418e1 100644 --- a/sources/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md +++ b/sources/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5665e4c58295257ed44cb1aa10949b3141ac68f0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 Feb 2020 23:33:28 +0800 Subject: [PATCH 199/315] TSL&PRF --- ...Source Apps for Your Linux Distribution.md | 97 ------------------- ...Source Apps for Your Linux Distribution.md | 95 ++++++++++++++++++ 2 files changed, 95 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md create mode 100644 translated/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md diff --git a/sources/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md b/sources/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md deleted file mode 100644 index 903c8418e1..0000000000 --- a/sources/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution) -[#]: via: (https://itsfoss.com/appcenter-for-everyone/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution -====== - -_**Brief: elementary OS is building an app center ecosystem where you can buy open source applications for your Linux distribution.**_ - -### Crowdfunding to build an open source AppCenter for everyone - -![][1] - -[elementary OS][2] recently announced that it is [crowdfunding a campaign to build an app center][3] from where you can buy open source applications. The applications in the app center will be in Flatpak format. - -Though it’s an initiative taken by elementary OS, this new app center will be available for other distributions as well. - -The campaign aims to fund a week of in-person development sprint in Denver, Colorado (USA) featuring developers from elementary OS, [Endless][4], [Flathub][5] and [GNOME][6]. - -The crowdfunding campaign has already crossed its goal of raising $10,000. You can still fund it as additional funds will be used for the development of elementary OS. - -[Crowdfunding Campaign][3] - -### What features this AppCenter brings - -The focus is on providing ‘secure’ applications and hence [Flatpak][7] apps are used to provide confined applications. In this format, apps will be restricted from accessing system or personal files and will be isolated from other apps on a technical level by default. - -Apps will have access to operating system and personal files only if you explicitly provide your consent for it. - -Apart from security, [Flatpak][8] also bundles all the dependencies. This way, app developers can utilize the cutting edge technologies even if it is not available on the current Linux distribution. - -AppCenter will also have the wallet feature to save your card details. This enables you to quickly pay for apps without entering the card details each time. - -![][9] - -This new open source ‘app center’ will be available for other Linux distributions as well. - -### Inspired by the success of elementary OS’s own ‘Pay What You Want’ app center model - -A couple of years ago, elementary OS launched its own app center. The ‘pay what you want’ approach for the app center was quite a hit. The developers can put a minimum amount for their open source apps and the users can choose to pay an amount equal to or more than the minimum amount. - -![][10] - -This helped several indie developers get paid for their open source applications. The app store now has around 160 native applications and elementary OS says that thousands of dollars have been paid to the developers through the app center. - -Inspired by the success of this app center experiment in elementary OS, they now want to bring this app center approach to other distributions as well. - -### If the applications are open source, how can you charge money for it? - -Some people still get confused with the idea of FOSS (free and open source). Here, the **source** code of the software is **open** and anyone is **free** to modify it and redistribute it. - -It doesn’t mean that open source software has to be free of cost. Some developers rely on donations while some charge a fee for support. - -Getting paid for the open source apps may encourage developers to create [applications for Linux][11]. - -### Let’s see if it could work - -![][12] - -Personally, I am not a huge fan of Flatpak or Snap packaging format. They do have their benefits but they take relatively more time to start and they are huge in size. If you install several such Snaps or Flatpaks, your disk space may start running out of free space. - -There is also a need to be vigilant about the fake and scam developers in this new app ecosystem. Imagine if some scammers starts creating Flatpak package of obscure open source applications and put it on the app center? I hope the developers put some sort of mechanism to weed out such apps. - -I do hope that this new AppCenter replicates the success it has seen in elementary OS. We definitely need a better ecosystem for open source apps for desktop Linux. - -What are your views on it? Is it the right approach? What suggestions do you have for the improvement of the AppCenter? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/appcenter-for-everyone/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/appcenter.png?ssl=1 -[2]: https://elementary.io/ -[3]: https://www.indiegogo.com/projects/appcenter-for-everyone/ -[4]: https://itsfoss.com/endless-linux-computers/ -[5]: https://flathub.org/ -[6]: https://www.gnome.org/ -[7]: https://flatpak.org/ -[8]: https://itsfoss.com/flatpak-guide/ -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/appcenter-wallet.png?ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/appcenter-payment.png?ssl=1 -[11]: https://itsfoss.com/essential-linux-applications/ -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/open_source_app_center.png?ssl=1 diff --git a/translated/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md b/translated/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md new file mode 100644 index 0000000000..fdc7ac1132 --- /dev/null +++ b/translated/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md @@ -0,0 +1,95 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution) +[#]: via: (https://itsfoss.com/appcenter-for-everyone/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +elementary OS 正在构建一个可以买应用的开源应用商店 +====== + +> elementary OS 正在构建一个应用中心生态系统,你可以在其中购买用于 Linux 发行版的开源应用程序。 + +### 众筹构建一个开源应用中心 + +![][1] + +[elementary OS][2] 最近宣布,它正在[众筹举办一个构建应用中心的活动][3],你可以从这个应用中心购买开源应用程序。应用中心中的应用程序将为 Flatpak 格式。 + +尽管这是 elementary OS 发起的活动,但这个新的应用中心也将适用于其他发行版。 + +该活动旨在资助在美国科罗拉多州丹佛市进行的一项一周个人开发冲刺活动,其中包括来自 elementary OS、[Endless][4]、[Flathub][5] 和 [GNOME][6] 的开发人员。 + +众筹活动已经超过了筹集 1 万美元的目标(LCTT 译注:截止至本译文发布,已近 15000 美金)。但你仍然可以为其提供资金,因为其他资金将用于开发 elementary OS。 + +### 这个应用中心将带来什么功能 + +其重点是提供“安全”应用程序,因此使用 [Flatpak][7] 应用来提供受限的应用程序。在这种格式下,默认情况下将会限制应用程序访问系统或个人文件,并在技术层面上将它们与其他应用程序隔离。 + +仅当你明确表示同意时,应用程序才能访问操作系统和个人文件。 + +除了安全性,[Flatpak][8] 还捆绑了所有依赖项。这样,即使当前 Linux 发行版中不提供这些依赖项,应用程序开发人员也可以利用这种最先进的技术使用它。 + +AppCenter 还具有钱包功能,可以保存你的信用卡详细信息。这样,你无需每次输入卡的详细信息即可快速为应用付费。 + +![][9] + +这个新的开源“应用中心”也将适用于其他 Linux 发行版。 + +### 受到了 elementary OS 自己的“按需付费”应用中心模型成功的启发 + +几年前,elementary OS 推出了自己的应用中心。应用中心的“按需付费”方法很受欢迎。开发人员可以为其开源应用设置最低金额,而用户可以选择支付等于或高于最低金额的金额。 + +![][10] + +这帮助了几位独立开发人员可以对其开源应用程序接受付款。该应用中心现在拥有约 160 个原生应用程序,elementary OS 表示已通过应用中心向开发人员支付了数千美元。 + +受到此应用中心实验在 elementary OS 中的成功的启发,他们现在也希望将此应用中心的方法也引入其他发行版。 + +### 如果应用程序是开源的,你怎么为此付费? + +某些人仍然对 FOSS(自由而开源)的概念感到困惑。在这里,该软件的“源代码”是“开源的”,任何人都可以“自由”进行修改和重新分发。 + +但这并不意味着开源软件必须免费。一些开发者依靠捐赠,而另一些则收取支持费用。 + +获得开源应用程序的报酬可能会鼓励开发人员创建 [Linux 应用程序][11]。 + +### 让我们拭目以待 + +![][12] + +就个人而言,我不是 Flatpak 或 Snap 包格式的忠实拥护者。它们确实有其优点,但是它们花费了相对更多的时间来启动,并且它们的包大小很大。如果安装了多个此类 Snap 或 Flatpak 软件包,磁盘空间就会慢慢耗尽。 + +也需要对这个新的应用程序生态系统中的假冒和欺诈开发者保持警惕。想象一下,如果某些骗子开始创建冷门的开源应用程序的 Flatpak 程序包,并将其放在应用中心上?我希望开发人员采用某种机制来淘汰此类应用程序。 + +我确实希望这个新的应用中心能够复制在 elementary OS 中已经看到的成功。对于桌面 Linux 的开源应用程序,我们绝对需要更好的生态系统。 + +你对此有何看法?这是正确的方法吗?你对改进应用中心有什么建议? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/appcenter-for-everyone/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/appcenter.png?ssl=1 +[2]: https://elementary.io/ +[3]: https://www.indiegogo.com/projects/appcenter-for-everyone/ +[4]: https://itsfoss.com/endless-linux-computers/ +[5]: https://flathub.org/ +[6]: https://www.gnome.org/ +[7]: https://flatpak.org/ +[8]: https://itsfoss.com/flatpak-guide/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/appcenter-wallet.png?ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/appcenter-payment.png?ssl=1 +[11]: https://itsfoss.com/essential-linux-applications/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/open_source_app_center.png?ssl=1 From 09fe9739520ea6a08cd58836c64e61b33c4dfa29 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 Feb 2020 00:10:43 +0800 Subject: [PATCH 200/315] PUB @wxy https://linux.cn/article-11939-1.html --- ...ou Can Buy Open Source Apps for Your Linux Distribution.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md (98%) diff --git a/translated/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md b/published/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md similarity index 98% rename from translated/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md rename to published/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md index fdc7ac1132..6619254799 100644 --- a/translated/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md +++ b/published/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11939-1.html) [#]: subject: (elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution) [#]: via: (https://itsfoss.com/appcenter-for-everyone/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From a1cd1e2f36a35ef899bdd050ef406d6005bb6803 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 28 Feb 2020 01:02:06 +0800 Subject: [PATCH 201/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200226=20Mirant?= =?UTF-8?q?is:=20Balancing=20Open=20Source=20with=20Guardrails?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200226 Mirantis- Balancing Open Source with Guardrails.md --- ...- Balancing Open Source with Guardrails.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20200226 Mirantis- Balancing Open Source with Guardrails.md diff --git a/sources/tech/20200226 Mirantis- Balancing Open Source with Guardrails.md b/sources/tech/20200226 Mirantis- Balancing Open Source with Guardrails.md new file mode 100644 index 0000000000..5eeb400060 --- /dev/null +++ b/sources/tech/20200226 Mirantis- Balancing Open Source with Guardrails.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Mirantis: Balancing Open Source with Guardrails) +[#]: via: (https://www.linux.com/articles/mirantis-balancing-open-source-with-guardrails/) +[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) + +Mirantis: Balancing Open Source with Guardrails +====== + +[![][1]][2] + +[![][1]][2] + +Mirantis, an open infrastructure company that rose to popularity with its OpenStack offering, is now moving into the Kubernetes space very aggressively. [Last year, the company acquired the Docker Enterprise business from Docker.][3] [This week, it announced that they were hiring the Kubernetes experts from the Finnish company Kontena a][4]nd established a Mirantis office in Finland, expanding the company’s footprint in Europe. Mirantis already has a significant presence in Europe due to large customers such as Bosch and [Volkswagen][5]. + +The Kontena team primarily focused on two technologies. One was a Kubernetes distro called [Pharos][6], which differentiated itself from other distributions by specializing in addressing life cycle management challenges. They had developed some unique capabilities for deployment and for updating Kubernetes itself. + +The second product by Kontena is [Lens][6]. “It’s like a Kubernetes dashboard on steroids. In addition to offering the standard dashboard functions, it went multiple steps further by providing a terminal for command line interfacing to nodes and containers, and additional real-time insights, role-based access controls and a number of other capabilities that are currently absent from the Kubernetes dashboard,” said [Dave Van Everen][7], SVP of Marketing at Mirantis. + +Everything that Kontena does is open source. These open source projects are already used by hundreds of organizations around the world. “They have a proven track record of contributing valuable technology pieces to the Kubernetes ecosystem, and we saw an opportunity to bring the team on board and capitalized on that opportunity as quickly as we could,” said Van Everen. + +Mirantis will integrate many of the technology concepts and benefits from Pharos into its Docker Enterprise offering. With Kontena engineers on board, Mirantis expects to incorporate the best of what Kontena offered into its commercially supported Docker Enterprise and [Kubernetes][8] technology. + +With this acquisition, Mirantis has hinted at a very aggressive 2020. The company is weeks away from launching the first Docker Enterprise release since the acquisition. The release brings many new capabilities on top of Docker Enterprise 3.0. The company is working on merging the [Mirantis KaaS][9] capabilities with Docker Enterprise. “We will add new capabilities, including multi-cluster management and continuous automated updates to the Kubernetes that’s already within Docker Enterprise,” said Van Everen. + +**What is Mirantis today?** + +Mirantis started out as a pure-play OpenStack company, but as the market dynamics changed, the company adjusted its own positioning and bet on CD platforms like Spinnaker and container orchestration technologies like Kubernetes. So, what are they focusing on today? + +Van Everen said that Mirantis is definitely embracing Kubernetes as the open standard used by enterprises for modern applications. Kubernetes itself has a massive ecosystem of technologies that a customer needs to leverage. “When we speak about Kubernetes, we speak about full-stack Kubernetes, which includes that ecosystem consisting of a couple dozen components in a typical cluster deployment. Our job as a trusted partner in helping our customers accelerate their path to modern applications is to streamline and automate all of the infrastructure and DevOps tooling supporting their app development lifecycle,” san Van Everen. + +In a nutshell, Mirantis is making it easier for customers to use Kubernetes. + +Over the years, [Mirantis][10] has gained expertise in IaaS with the work they did on OpenStack. “All of that plays a role in helping companies move faster and become more agile as they’re modernizing their applications. We apply many of those same strengths to the Kubernetes ecosystem,” he said. + +Mirantis is also building expertise in continuous delivery platforms like [Argo CD][11] and is offering customers a spectrum of professional services around application modernization, from writing code that is based in microservices architecture, to integrating CI/CD pipelines and modernizing the tooling for CI/CD to better support cloud-native patterns. By supporting Kubernetes technology with app modernization services, Mirantis is helping customers wherever they are in their digital transformation and cloud-native journey. + +“All of those things that our services team provides are complementary to the technology. That’s a unique value that only Mirantis can provide to the market, where we can couple open source technologies with strong services to ensure that companies really get the most out of that open source technology and fulfill their ultimate goal, which is to accelerate their pace of innovation,” Van Everen said. + +Container networking is a critical piece of the cloud-native world and Mirantis already has expertise in the area, thanks to their work on OpenStack. The company recently joined the Linux Foundation’s [LF Networking project][12] which is home to [Tungsten Fabric][13] (formerly known as OpenContrail), a technology that Mirantis uses for its [OpenStack][14] offerings. + +He explains, “While we use Calico for the container networking, Tungsten Fabric would be an important part of the underlying networking supporting Kubernetes deployments. Staying true to our heritage, we want to be involved in the open community and have both a voice and a stake in the direction the communities are moving in.” + +[As for the ongoing debate or controversy around two competing service mesh technologies Istio and Linkerd,][15] the company has made its bet on Istio. A few months ago, Mirantis announced a training program for Istio, which was bundled with Mirantis’ KaaS offerings. + +“We include Istio as a service mesh by default in child clusters under Mirantis KaaS management. It’ll be used as an ingress with Docker Enterprise initially. Moving forward, we’re still looking at how to best deploy it in a service mesh configuration by default and provide a configurable but still functional default deployment for Istio as a service mesh,” said Van Everen. + +It might seem like Mirantis is latching on to the latest hot technologies like OpenStack, [Spinnaker][16], Docker Enterprise, Kubernetes, and Istio to see what sticks. In reality, there is a method to it: the company is going where its customers are going, with the technologies that customers are using. It’s a fine balancing act. + +“That’s the type of technology challenge that Mirantis embraces. We are open source experts and continue to provide the greatest flexibility and choice in our industry, but we do it in such a way that there are guardrails in place so that companies don’t end up having something that’s overly complex and unmanageable, or configured incorrectly,” he concluded. + +Note: Cross posted to [TFIR][17] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/articles/mirantis-balancing-open-source-with-guardrails/ + +作者:[Swapnil Bhartiya][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/author/swapnil/ +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/wp-content/uploads/2019/09/world-network-1068x713.jpg (world-network) +[2]: https://www.linux.com/wp-content/uploads/2019/09/world-network.jpg +[3]: https://www.youtube.com/watch?v=cBOrVKuomcU&feature=emb_title +[4]: https://containerjournal.com/topics/container-ecosystems/mirantis-acquires-kubernetes-assets-from-kontena/ +[5]: https://www.mirantis.com/company/press-center/company-news/volkswagen-group-selects-mirantis-openstack-software-next-generation-cloud/ +[6]: https://github.com/kontena +[7]: https://twitter.com/davidvaneveren?lang=en +[8]: https://kubernetes.io/ +[9]: https://www.tfir.io/mirantis-launches-kaas-across-bare-metal-public-and-private-clouds/ +[10]: https://www.mirantis.com/ +[11]: https://argoproj.github.io/argo-cd/ +[12]: https://www.linuxfoundation.org/projects/networking/ +[13]: https://tungsten.io/ +[14]: https://www.openstack.org/ +[15]: https://twitter.com/hashtag/istio?lang=en +[16]: https://www.tfir.io/?s=spinnaker +[17]: https://www.tfir.io/mirantis-balancing-open-source-with-guardrails/ From 5fd81991eeac517453619507dbff21bd3cb485ff Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 28 Feb 2020 01:03:07 +0800 Subject: [PATCH 202/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200228=20No=20M?= =?UTF-8?q?ore=20WhatsApp!=20The=20EU=20Commission=20Switches=20To=20?= =?UTF-8?q?=E2=80=98Signal=E2=80=99=20For=20Internal=20Communication?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md --- ... To ‘Signal- For Internal Communication.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md diff --git a/sources/tech/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md b/sources/tech/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md new file mode 100644 index 0000000000..8b47602a54 --- /dev/null +++ b/sources/tech/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (No More WhatsApp! The EU Commission Switches To ‘Signal’ For Internal Communication) +[#]: via: (https://itsfoss.com/eu-commission-switches-to-signal/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +No More WhatsApp! The EU Commission Switches To ‘Signal’ For Internal Communication +====== + +_**In a move to improve the cyber-security, EU has recommended its staff to use open source secure messaging app Signal instead of the popular apps like WhatsApp.**_ + +[Signal is an open source secure messaging application][1] with end to end encryption. It is praised by the likes of [Edward Snowden][2] and other privacy activists, journalists and researchers. We’ve recently covered it in our ‘[open source app of the week][3]‘ series. + +[Signal][4] is in news for good reasons. The European Union Commissions have instructed its staff to use Signal for public instant messaging. + +This is part of EU”s new cybersecurity strategy. There has been cases of data leaks and hacking against EU diplomats and thus policy is being put in place to encourage better security practices. + +### Governments recommending open source technology is a good sign + +![][5] + +No matter what the reason is, Government bodies recommending open-source services for better security is definitely a good thing for the open-source community in general. + +[Politico][6] originally reported this by mentioning that the EU instructed its staff to use Signal as the recommended public instant messaging app: + +> The instruction appeared on internal messaging boards in early February, notifying employees that “Signal has been selected as the recommended application for public instant messaging.” + +The report also mentioned the potential advantage of Signal (which is why the EU is considering using it): + +> “It’s like Facebook’s WhatsApp and Apple’s iMessage but it’s based on an encryption protocol that’s very innovative,” said Bart Preneel, cryptography expert at the University of Leuven. “Because it’s open-source, you can check what’s happening under the hood,” he added. + +Even though they just want to secure their communication or want to prevent high-profile leaks, switching to an open-source solution instead of [WhatsApp][7] sounds good to me. + +### Signal gets a deserving promotion + +Even though Signal is a centralized solution that requires a phone number as of now, it is still a no-nonsense open-source messaging app that you may trust. + +Privacy enthusiasts already know a lot of services (or alternatives) to keep up with the latest security and privacy threats. However, with the EU Commission recommending it to its staff, Signal will get an indirect promotion for common mobile and desktop users. + +### Wrapping Up + +It is still an irony that some Government bodies hate encrypted solutions while opting to use them for their own requirement. + +Nevertheless, it is good progress for open-source services and tech, in general, is recommended as a secure alternative. + +What do you think about the EU’s decision on switching to the Signal app for its internal communication? Feel free to let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/eu-commission-switches-to-signal/ + +作者:[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://itsfoss.com/signal-messaging-app/ +[2]: https://en.wikipedia.org/wiki/Edward_Snowden +[3]: https://itsfoss.com/tag/app-of-the-week/ +[4]: https://www.signal.org/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/Signal-eu.jpg?ssl=1 +[6]: https://www.politico.eu/pro/eu-commission-to-staff-switch-to-signal-messaging-app/ +[7]: https://www.whatsapp.com/ From df37dc49cd4f83d1bab0ea689ddf4556a61549ee Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 28 Feb 2020 01:07:15 +0800 Subject: [PATCH 203/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200226=20Use=20?= =?UTF-8?q?logzero=20for=20simple=20logging=20in=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200226 Use logzero for simple logging in Python.md --- ...se logzero for simple logging in Python.md | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 sources/tech/20200226 Use logzero for simple logging in Python.md diff --git a/sources/tech/20200226 Use logzero for simple logging in Python.md b/sources/tech/20200226 Use logzero for simple logging in Python.md new file mode 100644 index 0000000000..1fbd61b68f --- /dev/null +++ b/sources/tech/20200226 Use logzero for simple logging in Python.md @@ -0,0 +1,156 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use logzero for simple logging in Python) +[#]: via: (https://opensource.com/article/20/2/logzero-python) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +Use logzero for simple logging in Python +====== +A quick primer on the handy log library that can help you master this +important programming concept. +![Snake charmer cartoon with a yellow snake and a blue snake][1] + +The logzero library makes logging as easy as a print statement, which is quite a feat of simplicity. I'm not sure whether logzero took its name to fit in with the series of "zero boilerplate" libraries like pygame-zero, GPIO Zero, and guizero, but it's certainly in that category. It's a Python library that makes logging straightforward. + +You can just use its basic logging to stdout the same way you might use print for information and debugging purposes, and it has a smooth learning curve towards more advanced logging, like logging to a file. + +To start, install logzero with pip: + + +``` +`$ sudo pip3 install logzero` +``` + +Now in a Python file, import logger and try one or all of these logging examples: + + +``` +from logzero import logger + +logger.debug("hello") +logger.info("info") +logger.warning("warning") +logger.error("error") +``` + +The output is automatically colored in an easy-to-read way: + +![Python, Raspberry Pi: import logger][2] + +So now, instead of using **print** to figure out what's going on, use logger instead, with the relevant log level. + +### Writing logs to a file in Python + +If you only read this far and make that one change in the way you write code, that's good enough for me. If you want to go further, read on! + +Writing to **stdout** is fun for testing a new program, but it is only useful if you are logged into the computer where the script is running. Many times when using an application you'll want to execute the code remotely and review errors after the fact. That's when it's helpful to log to a file instead. Let's try it: + + +``` +from logzero import logger, logfile + +logfile('/home/pi/test.log') +``` + +Now your log entries will be logged into the file **test.log**. Remember to make sure that the [script has permission][3] to write to that file and its directory structure. + +You can specify some more options too: + + +``` +`logfile(’/home/pi/test.log’, maxBytes=1e6, backupCount=3)` +``` + +Now when the file provided to **logfile** reaches 1MB (1×106 bytes), it will rotate entries through **test.log.1**, **test.log.2**, and so on. This behavior is nice to avoid generating a massive log file that is I/O intensive for the system to open and close. You might also want to log to **/var/log** like a pro. Assuming you're on Linux, you a directory and make your user the owner so they can write to it: + + +``` +$ sudo mkdir /var/log/test +$ sudo chown pi /var/log/test +``` + +Then in your Python code, change the **logfile** path: + + +``` +`logfile(’/var/log/test/test.log’, maxBytes=1e6, backupCount=3)` +``` + +When it comes to catching exceptions in your **logfile**, you can either use **logging.exception:** + + +``` +try: +    c = a / b +except Exception as e: +    logger.exception(e) +``` + +This will produce the following (in the case that b is zero): + + +``` +[E 190422 23:41:59 test:9] division by zero +     Traceback (most recent call last): +       File "test.py", line 7, in +         c = a / b +     ZeroDivisionError: division by zero +``` + +You get the log entry, followed by the full traceback. Alternatively, you could use **logging.error** and hide the traceback: + + +``` +try: +    c = a / b +except Exception as e: +    logger.error(f"{e.__class__.__name__}: {e}") +``` + +Now this will produce the more succinct: + + +``` +`[E 190423 00:04:16 test:9] ZeroDivisionError: division by zero` +``` + +* * * + +* * * + +* * * + +**![Logging output][4]** + +There are plenty more options which you can read in the docs at [logzero.readthedocs.io][5]. + +### logzero shines for education + +Logging can be a challenging concept for a new programmer. Most frameworks depend on flow control and lots of variable manipulation to make a meaningful log, but logzero is different. With its syntax being similar to a print statement, it is a big win for education as it saves from explaining another concept. Give it a try on your next project. + +\-- + +_This article was originally written on [my blog][6] and is republished with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/logzero-python + +作者:[Ben Nuttall][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/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Snake charmer cartoon with a yellow snake and a blue snake) +[2]: https://opensource.com/sites/default/files/uploads/rpi_ben_1.png (Python, Raspberry Pi: import logger) +[3]: https://opensource.com/article/19/6/understanding-linux-permissions +[4]: https://opensource.com/sites/default/files/uploads/rpi_ben_2.png (Logging output) +[5]: https://logzero.readthedocs.io/en/latest/ +[6]: https://tooling.bennuttall.com/logzero/ From e811f79f7b1831f2290a37cf9f56a1e3144e3865 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 28 Feb 2020 08:28:12 +0800 Subject: [PATCH 204/315] translated --- ...hing- Open Source P2P File Syncing Tool.md | 146 ------------------ ...hing- Open Source P2P File Syncing Tool.md | 146 ++++++++++++++++++ 2 files changed, 146 insertions(+), 146 deletions(-) delete mode 100644 sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md create mode 100644 translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md diff --git a/sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md b/sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md deleted file mode 100644 index fe48819ada..0000000000 --- a/sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md +++ /dev/null @@ -1,146 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Syncthing: Open Source P2P File Syncing Tool) -[#]: via: (https://itsfoss.com/syncthing/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Syncthing: Open Source P2P File Syncing Tool -====== - -_**Brief: Syncthing is an open-source peer-to-peer file synchronization tool that you can use for syncing files between multiple devices (including an Android phone).**_ - -Usually, we have a cloud sync solution like [MEGA][1] or Dropbox to have a backup of our files on the cloud while making it easier to share it. - -But, what do you do if you want to sync your files across multiple devices without storing them on the cloud? - -That is where [Syncthing][2] comes to the rescue. - -### Syncthing: An open source tool to synchronize files across devices - -![][3] - -Syncthing lets you sync your files across multiple devices (including the support for Android smartphones). It primarily works through a web UI on Linux but also offers a GUI (to separately install). - -However, Syncthing does not utilize the cloud at all – it is a [peer-to-peer][4] file synchronization tool. Your data doesn’t go to a central server. Instead, the data is synced with all the devices between them. So, it does not really replace the [typical cloud storage services on Linux][5]. - -To add remote devices, you just need the device ID (or simply scan the QR code), no IP addresses involved. - -If you want a remote backup of your files – you should probably rely on the cloud. - -![Syncthing GUI][6] - -All things considered, Syncthing can come in handy for a lot of things. Technically, you can have your important files accessible on multiple systems securely and privately without worrying about anyone spying on your data. - -For instance, you may not want to store some of the sensitive files on the cloud – so you can add other trusted devices to sync and keep a copy of those files. - -Even though I described it briefly, there’s more to it and than meets the eye. I’d also recommend reading the [official FAQ][7] to clear some confusion on how it works – if you’re interested. - -### Features of Syncthing - -You probably do not want a lot of options in a synchronization tool – it should be dead simple to work reliably to sync your files. - -Syncthing is indeed quite simple and easy to understand – even though it is recommended that you should go through the [documentation][8] if you want to use every bit of its functionality. - -Here, I’ll highlight a few useful features of Syncthing: - -#### Cross-Platform Support - -![Syncthing on Android][9] - -Being an open-source solution, it does support Windows, Linux, and macOS. - -In addition to that, it also supports Android smartphones. You’ll be disappointed if you have an iOS device – so far, no plans for iOS support. - -#### File Versioning - -![Syncthing File Versioning][10] - -Syncthing utilizes a variety of [File Versioning methods][11] to archive the old files if they are replaced or deleted. - -By default, you won’t find it enabled. But, when you create a folder to sync, that’s when you will find the option to toggle the file versioning to your preferred method. - -#### Easy To Use - -While being a peer-to-peer file synchronization tool, it just works out of the box with no advanced tweaks. - -However, it does let you configure advanced settings when needed. - -#### Security & Privacy - -Even though you do not share your data with any cloud service providers, there are still some connections made that might gain the attention of an eavesdropper. So, Syncthing makes sure the communication is secured using TLS. - -In addition to that, there are solid authentication methods to ensure that only the devices/connections you allow explicitly will be granted access to sync/read data. - -For Android smartphones, you can also force the traffic through Tor if you’re using the [Orbot app][12]. You’ll find several other options for Android as well. - -#### Other Functionalities - -![][13] - -When exploring the tool yourself, you will notice that there are no limits to how many folders you can sync and the number of devices that you can sync. - -So, being a free and open-source solution with lots of useful features makes it an impressive choice for Linux users looking to have a peer-to-peer sync client. - -### Installing Syncthing on Linux - -You may not observe a .deb file or an .AppImage file for it on its official download webpage. But, you do get a snap package on the [Snap store][14] – if you’re curious you can read about [using snap apps][15] on Linux to get started. - -You may not find it in the software center (if you do – it may not be the latest version). - -**Note:** _There’s also a [Syncthing-GTK][16] available if you want a GUI to manage that – instead of a browser._ - -[Syncthing][2] - -You can also utilize the terminal to get it installed if you have a Debian-based distro – the instructions are on the [official download page][17]. - -### My experience with Syncthing - -Personally, I got it installed on Pop!_OS 19.10 and used it for a while before writing this up. - -I tried syncing folders, removing them, adding duplicate files to see how the file versioning works, and so on. It worked just fine. - -However, when I tried syncing it to a phone (Android) – the sync started a bit late, it wasn’t very quick. So, if we could have an option to explicitly force sync, that could help. Or, did I miss the option? Let me know in the comments if I did. - -Technically, it uses the resources of your system to work – so if you have a number of devices connected to sync, it should potentially improve the sync speed (upload/download). - -Overall, it works quite well – but I must say that you shouldn’t rely on it as the only backup solution to your data. - -**Wrapping Up** - -Have you tried Syncthing yet? If yes, how was your experience with it? Feel free to share it in the comments below. - -Also, if you know about some awesome alternatives to this – let me know about it as well. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/syncthing/ - -作者:[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://itsfoss.com/install-mega-cloud-storage-linux/ -[2]: https://syncthing.net/ -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-screenshot.jpg?ssl=1 -[4]: https://en.wikipedia.org/wiki/Peer-to-peer -[5]: https://itsfoss.com/cloud-services-linux/ -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-gtk.png?ssl=1 -[7]: https://docs.syncthing.net/users/faq.html -[8]: https://docs.syncthing.net/users/index.html -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-android.jpg?ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-file-versioning.jpg?ssl=1 -[11]: https://docs.syncthing.net/users/versioning.html -[12]: https://play.google.com/store/apps/details?id=org.torproject.android&hl=en_IN -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-screenshot1.jpg?ssl=1 -[14]: https://snapcraft.io/syncthing -[15]: https://itsfoss.com/install-snap-linux/ -[16]: https://github.com/syncthing/syncthing-gtk/releases/latest -[17]: https://syncthing.net/downloads/ diff --git a/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md b/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md new file mode 100644 index 0000000000..013a3569a4 --- /dev/null +++ b/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Syncthing: Open Source P2P File Syncing Tool) +[#]: via: (https://itsfoss.com/syncthing/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Syncthing:开源 P2P 文件同步工具 +====== + +_ **简介:Syncthing 是一个开源的 P2P 文件同步工具,可用于在多个设备(包括 Android 手机)之间同步文件。** _ + +通常,我们有 [MEGA][1] 或 Dropbox 之类的云同步解决方案,以便在云上备份我们的文件,同时更易于共享。 + +但是,如果要跨多个设备同步文件而不将其存储在云中怎么办? + +这就是 [Syncthing][2] 派上用场的地方了。 + +### Syncthing:一个跨设备同步文件的开源工具 + +![][3] + +Syncthing 可让你跨多个设备同步文件(包括对 Android 智能手机的支持)。它主要通过 Linux上 的 Web UI 进行工作,但也提供了 GUI(需要单独安装)。 + +然而,Syncthing 完全没有利用云,它是 [P2P][4] 文件同步工具。你的数据不会被发送到中央服务器。而是会在所有设备之间同步。因此,它并不能真正取代 [Linux 上的典型云存储服务][5]。 + +要添加远程设备,你只需要设备 ID(或直接扫描二维码),而无需 IP 地址。 + +如果你想要远程备份文件,那么你可能应该依靠云。 + +![Syncthing GUI][6] + +考虑到所有因素,Syncthing 可以在很多方面派上用场。从技术上讲,你可以安全、私密地在多个系统上访问重要文件,而不必担心有人监视你的数据。 + +例如,你可能不想在云上存储一些敏感文件,因此你可以添加其他受信任的设备来同步并保留这些文件的副本。 + +即使我简单描述了它,但它并不像看到的那么简单。如果你感兴趣的话,我建议你阅读[官方 FAQ][7] 来了解它如何工作的。 + +### Syncthing 的特性 + +你可能不希望同步工具中有很多选项。它要可靠地同步文件,应该非常简单。 + +Syncthing 确实非常简单且易于理解。即使这样,如果你想使用它的所有功能,那么也建议你阅读它的[文档][8]。 + +在这里,我将重点介绍 Syncthing 的一些有用特性: + +#### 跨平台支持 + +![Syncthing on Android][9] + +作为开源解决方案,它支持 Windows、Linux 和 macOS。 + +除此之外,它还支持 Android 智能手机。如果你使用的是 iOS 设备,那么你会感到失望。到目前为止,它还没有支持 iOS 的计划。 + +#### 文件版本控制 + +![Syncthing File Versioning][10] + +如果替换或删除了旧文件,那么 Syncthing 会利用各种[文件版本控制方法][11]来存档旧文件。 + +默认情况下,你不会发现它启用。但是,当你创建一个要同步的文件夹时,你将找到将文件版本控制切换为首选方法的选项。 + +#### 易于使用 + +作为 P2P 文件同步工具,它无需高级调整即可使用。 + +但是,它允许你在需要时配置高级设置。 + +#### 安全和隐私 + +即使你不与任何云服务提供商共享数据,仍会有一些连接可能会引起窃听者的注意。因此,Syncthing 使用 TLS 保护通信。 + +此外,它还有可靠的身份验证方法,以确保仅授予只有你允许的设备/连接能够取得同步/读取数据的权限。 + +对于 Android 智能手机,如果你使用 [Orbot 应用][12],你还可以强制将流量通过 Tor。在 Android 中你还有几个不同选择。 + +#### 其他功能 + +![][13] + +当你探索这个工具时,你会注意到可以同步的文件夹数和可同步的设备数没有限制。 + +因此,作为一个有着丰富有用特性的自由开源解决方案,对于在寻找 P2P 同步客户端的 Linux 用户而言是一个令人印象深刻的选择。 + +### 在 Linux 上安装 Syncthing + +你可能无法在官网上找到 .deb 或者 .AppImage 文件。但是,你可在 [Snap 商店][14]中找到 snap 包。如果你好奇,你可以阅读在 Linux 上[使用 snap 应用][15]的文章来开始使用。 + +你可能无法在软件中心找到它(如果你找到了,那它可能不是最新版本)。 + +**注意:**_如果你需要一个 GUI 而不是浏览器来管理它,它还有一个 [Syncthing-GTK][16]。_ + +[Syncthing][2] + +如果你有基于 Debian 的发行版,你也可以利用终端来安装它,这些说明位于[官方下载页面][17] 上。 + +### 我在 Syncthing 方面的体验 + +就个人而言,我把它安装在 Pop!\_OS 19.10 上,并在写这篇文章之前用了一会儿。 + +我尝试同步文件夹、删除它们、添加重复文件以查看文件版本控制是否工作,等等。它工作良好。 + +然而,当我尝试同步它到手机(安卓),同步启动有点晚,它不是很快。因此,如果我们可以选择显式强制同步,那会有所帮助。或者,我错过了什么选项吗?如果是的话,请在评论中让我知道。 + +从技术上讲,它使用系统资源来工作,因此,如果你连接了多个设备进行同步,这可能会提高同步速度(上传/下载)。 + +总体而言,它工作良好,但我必须说,你不应该依赖它作为唯一的数据备份方案。 + +**总结** + +你试过 Syncthing 了吗?如果有的话,你的体验如何?欢迎在下面的评论中分享。 + +此外,如果你知道一些不错的替代品,也请让我知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/syncthing/ + +作者:[Ankush Das][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://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-mega-cloud-storage-linux/ +[2]: https://syncthing.net/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-screenshot.jpg?ssl=1 +[4]: https://en.wikipedia.org/wiki/Peer-to-peer +[5]: https://itsfoss.com/cloud-services-linux/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-gtk.png?ssl=1 +[7]: https://docs.syncthing.net/users/faq.html +[8]: https://docs.syncthing.net/users/index.html +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-android.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-file-versioning.jpg?ssl=1 +[11]: https://docs.syncthing.net/users/versioning.html +[12]: https://play.google.com/store/apps/details?id=org.torproject.android&hl=en_IN +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-screenshot1.jpg?ssl=1 +[14]: https://snapcraft.io/syncthing +[15]: https://itsfoss.com/install-snap-linux/ +[16]: https://github.com/syncthing/syncthing-gtk/releases/latest +[17]: https://syncthing.net/downloads/ From ac5171ccda017e545b5c0895bd654127657efdcb Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 28 Feb 2020 08:32:28 +0800 Subject: [PATCH 205/315] translating --- sources/tech/20200214 PHP Development on Fedora with Eclipse.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200214 PHP Development on Fedora with Eclipse.md b/sources/tech/20200214 PHP Development on Fedora with Eclipse.md index a682381686..24ecdcb232 100644 --- a/sources/tech/20200214 PHP Development on Fedora with Eclipse.md +++ b/sources/tech/20200214 PHP Development on Fedora with Eclipse.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c97e47b5c0b4cb7789082f1acdf7c024445dd8fe Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 28 Feb 2020 09:25:49 +0800 Subject: [PATCH 206/315] Rename sources/tech/20200226 Mirantis- Balancing Open Source with Guardrails.md to sources/talk/20200226 Mirantis- Balancing Open Source with Guardrails.md --- .../20200226 Mirantis- Balancing Open Source with Guardrails.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200226 Mirantis- Balancing Open Source with Guardrails.md (100%) diff --git a/sources/tech/20200226 Mirantis- Balancing Open Source with Guardrails.md b/sources/talk/20200226 Mirantis- Balancing Open Source with Guardrails.md similarity index 100% rename from sources/tech/20200226 Mirantis- Balancing Open Source with Guardrails.md rename to sources/talk/20200226 Mirantis- Balancing Open Source with Guardrails.md From 465776f4d618d910e6d4b0783287d484a929b10a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 28 Feb 2020 09:27:18 +0800 Subject: [PATCH 207/315] =?UTF-8?q?Rename=20sources/tech/20200228=20No=20M?= =?UTF-8?q?ore=20WhatsApp-=20The=20EU=20Commission=20Switches=20To=20?= =?UTF-8?q?=E2=80=98Signal-=20For=20Internal=20Communication.md=20to=20sou?= =?UTF-8?q?rces/talk/20200228=20No=20More=20WhatsApp-=20The=20EU=20Commiss?= =?UTF-8?q?ion=20Switches=20To=20=E2=80=98Signal-=20For=20Internal=20Commu?= =?UTF-8?q?nication.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Commission Switches To ‘Signal- For Internal Communication.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md (100%) diff --git a/sources/tech/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md b/sources/talk/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md similarity index 100% rename from sources/tech/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md rename to sources/talk/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md From f05ea42dbb0cda276a889994225f9f3e52698abc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 Feb 2020 12:46:57 +0800 Subject: [PATCH 208/315] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @lujun9972 这篇不错 --- .../tech/20170918 Fun and Games in Emacs.md | 137 ++++++++---------- 1 file changed, 57 insertions(+), 80 deletions(-) diff --git a/translated/tech/20170918 Fun and Games in Emacs.md b/translated/tech/20170918 Fun and Games in Emacs.md index b4baee63b4..9b547de0de 100644 --- a/translated/tech/20170918 Fun and Games in Emacs.md +++ b/translated/tech/20170918 Fun and Games in Emacs.md @@ -7,106 +7,91 @@ [#]: via: (https://www.masteringemacs.org/article/fun-games-in-emacs) [#]: author: (Mickey Petersen https://www.masteringemacs.org/about) -Emacs 中的游戏与乐趣 +“Emacs 游戏机”完全指南 ====== -又是周一,你正在为你的老板 Lumbergh 努力倒腾那些 [无聊之极的文档 ][1]。为什么不玩玩 Emacs 中类似 zork 的文本冒险游戏来让你的大脑从单调的工作中解脱出来呢? - -但说真的,Emacs 中既有游戏,也有古怪的玩物。有些你可能有所耳闻。这些玩意唯一的共同点就是,它们大多是很久以前就添加到 Emacs 中的:有些东西真的是相当古怪(如您将在下面看到的),而另一些则显然是由无聊的员工或毕业生编写的。 -它们中都带着一种奇思妙想和随意性,这在今天的 Emacs 中很少见。 -Emacs 现在变得十分严肃,在某种程度上,它已经与 20 世纪 80 年代那些玩意被编写出来的时候大不一样。 +又是周一,你正在为你的老板 Lumbergh (LCTT 译注:《上班一条虫》中的副总裁)努力倒腾那些 [无聊之极的文档][1]。为什么不玩玩 Emacs 中类似 zork 的文字冒险游戏来让你的大脑从单调的工作中解脱出来呢? +但说真的,Emacs 中既有游戏,也有古怪的玩物。有些你可能有所耳闻。这些玩意唯一的共同点就是,它们大多是很久以前就添加到 Emacs 中的:有些东西真的是相当古怪(如你将在下面看到的),而另一些则显然是由无聊的员工或学生们编写的。它们全有一个共同点,都带着一种奇思妙想和随意性,这在今天的 Emacs 中很少见。Emacs 现在变得十分严肃,在某种程度上,它已经与 20 世纪 80 年代那些游戏被编写出来的时候大不一样。 ### 汉诺塔 -[汉诺塔 ][2] 是一款古老的数学解密游戏,有些人可能对它很熟悉,因为它的递归和迭代解决方案经常被用与计算机科学教学辅助。 - +[汉诺塔][2] 是一款古老的数学解密游戏,有些人可能对它很熟悉,因为它的递归和迭代解决方案经常被用于计算机科学教学辅助。 ![Tower of Hanoi Screenshot](https://www.masteringemacs.org/static/uploads/hanoi.png) -Emacs 中有三个命令可以运行汉诺塔:`M-x hanoi` 默认为 3 个碟子; `M-x hanoi-unix` 和 `M-x hanoi-unix-64` 使用 unix 时间戳的位数 (32bit 或 64bit) 作为默认盘子的个数,并且每秒钟自动移动一次,两者不同之处在于后者假装使用 64 位时钟(因此有 64 个碟子)。 +Emacs 中有三个命令可以运行汉诺塔:`M-x hanoi` 默认为 3 个碟子; `M-x hanoi-unix` 和 `M-x hanoi-unix-64` 使用 unix 时间戳的位数(32 位或 64 位)作为默认盘子的个数,并且每秒钟自动移动一次,两者不同之处在于后者假装使用 64 位时钟(因此有 64 个碟子)。 -Emacs 中汉诺塔的实现可以追溯到 20 世纪 80 年代中期——确实是久得可怕。它有一些自定义选项 (`M-x customize-group RET hanoi RET`),如启用彩色光盘等。 -当你离开汉诺塔缓冲区或输入一个字符,你会收到一个讽刺的告别信息(见上文)。 +Emacs 中汉诺塔的实现可以追溯到 20 世纪 80 年代中期——确实是久得可怕。它有一些自定义选项(`M-x customize-group RET hanoi RET`),如启用彩色碟子等。当你离开汉诺塔缓冲区或输入一个字符,你会收到一个讽刺的告别信息(见上图)。 ### 5x5 ![5x5 game grid](https://www.masteringemacs.org/static/uploads/5x5.png) +5x5 的游戏是一个逻辑解密游戏:你有一个 5x5 的网格,中间的十字被填满;你的目标是通过按正确的顺序切换它们的空满状态来填充所有的单元格,从而获得胜利。这并不像听起来那么容易! -5x5 的游戏是一个逻辑解密游戏:你有一个 5x5 的网格,中间的十字被填满;你的目标是通过按正确的顺序切换它们的空满状态来填充所有的单元格,从而获得胜利。这并不像听起来那么容易! +输入 `M-x 5x5` 就可以开始玩了,使用可选的数字参数可以改变网格的大小。这款游戏的有趣之处在于它能向你建议下一步行动并尝试找到该游戏网格的解法。它用到了 Emacs 自己的一款非常酷的符号 RPN 计算器 `M-x calc`(在《[Emacs 快乐计算][3]》这篇文章中,我使用它来解决了一个简单的问题)。 -输入 `M-x 5x5` 就可以开始玩了,使用可选的数字参数可以改变网格的大小。 -这款游戏的有趣之处在于它能向你建议下一步行动并尝试解决该游戏网格。它用到了了 Emacs 自己的一款非常酷的符号 RPN 计算器 `M-x calc` (在 [Fun with Emacs Calc][3] 这篇文章中,我使用它来解决了一个简单的问题。) +所以我喜欢这个游戏的原因是它提供了一个非常复杂的解题器——真的,你应该通过 `M-x find-library RET 5x5` 来阅读其源代码——这是一个试图通过暴力破解游戏解法的“破解器”。 -所以我喜欢这个游戏的原因是它提供了一个非常复杂的解决器——真的,你应该通过 `M-x find-library RET 5x5` 来阅读其源代码——和一个试图通过强力破解游戏的“破解器”。 +创建一个更大的游戏网格,例如输入 `M-10 M-x 5x5`,然后运行下面某个 `crack` 命令。破解器将尝试通过迭代获得最佳解决方案。它会实时运行该游戏,观看起来非常有趣: -创建一个更大的游戏网格,例如输入 `M-10 M-x 5x5`,然后运行下面某个 `crack` 命令。破坏者将尝试通过迭代获得最佳解决方案。它会实时运行该游戏,观看起来非常有趣: - -- `M-x 5x5-crack-mutating-best`: 试图通过修改最佳解决方案来破解 5x5。 - -- `M-x 5x5-crack-mutating-current`: 试图通过修改当前解决方案来破解 5x5。 - -- `M-x 5x5-crack-random`: 尝试使用随机方案解破解 5x5。 - -- `M-x 5x5-crack-xor-mutate`: 尝试通过将当前方案和最佳方案进行异或运算来破解 5x5。 +- `M-x 5x5-crack-mutating-best`: 试图通过变异最佳解决方案来破解 5x5。 +- `M-x 5x5-crack-mutating-current`: 试图通过变异当前解决方案来破解 5x5。 +- `M-x 5x5-crack-random`: 尝试使用随机方案解破解 5x5。 +- `M-x 5x5-crack-xor-mutate`: 尝试通过将当前方案和最佳方案进行异或运算来破解 5x5。 ### 文本动画 -您可以通过运行 `M-x animation-birthday-present` 并给出名字来显示一个奇特的生日礼物动画。它看起来很酷! +你可以通过运行 `M-x animation-birthday-present` 并给出你的名字来显示一个奇特的生日礼物动画。它看起来很酷! ![xkcd](https://imgs.xkcd.com/comics/real_programmers.png) -`M-x butterfly` 命令中也使用了 `animate` 包,butterfly 命令被添加到 Emacs 中,以向上面的 [XKCD][4] 漫画致敬。当然,漫画中的 Emacs 命令在技术上是无效的,但它的幽默足以弥补这一点。 +这里用的 `animate` 包也用在了 `M-x butterfly` 命令中,这是一个向上面的 [XKCD][4] 漫画致敬而添加到 Emacs 中的命令。当然,漫画中的 Emacs 命令在技术上是无效的,但它的幽默足以弥补这一点。 ### 黑箱 我将逐字引用这款游戏的目标: > 游戏的目标是通过向黑盒子发射光线来找到四个隐藏的球。有四种可能: -> 1) 射线将通过盒子不受干扰, -> 2) 它将击中一个球并被吸收, +> 1) 射线将通过盒子不受干扰; +> 2) 它将击中一个球并被吸收; > 3) 它将偏转并退出盒子,或 -> 4) 立即偏转,甚至不被允许进入盒子。 +> 4) 立即偏转,甚至不能进入盒子。 -所以,这有点像我们小时候玩的 [Battleship][5],但是……是专为物理专业高学历的人准备的? +所以,这有点像我们小时候玩的[战舰游戏][5],但是……是专为物理专业高学历的人准备的吧? -这是另一款添加于 20 世纪 80 年代的游戏。我建议你输入 `C-h f blackbox` 来阅读玩法说明(文档巨大)。 +这是另一款添加于 20 世纪 80 年代的游戏。我建议你输入 `C-h f blackbox` 来阅读玩法说明(文档巨大)。 ### 泡泡 ![Bubbles game](https://www.masteringemacs.org/static/uploads/bubbles.png) +`M-x bubble` 游戏相当简单:你必须用尽可能少移动清除尽可能多的“泡泡”。当你移除气泡时,其他气泡会掉落并粘在一起。这是一款有趣的游戏,此外如果你使用 Emacs 的图形用户界面,它还支持图像显示。而且它还支持鼠标。 -`M-x bubble` 游戏相当简单:你必须用尽可能少移动清除尽可能多的“泡泡”。当你移除气泡时,其他气泡会掉落并粘在一起。 -这是一款有趣的游戏,此外如果你使用 Emacs 的图形用户界面,它还支持图像现实。而且它还支持鼠标。 - -您可以通过调用 `M-x bubbles-set-game-< 难度>` 来设置难度,其中嗯 `<难度>` 可以是其中之一:`easy`,`medium=,=difficult`,`hard`,或 `userdefined`。 -此外,您可以使用:`M-x custom-group bubbles` 来更改图形、网格大小和颜色。 +你可以通过调用 `M-x bubbles-set-game-` 来设置难度,其中 `` 可以是这些之一:`easy`、`medium`、`difficult`、`hard` 或 `userdefined`。此外,你可以使用:`M-x custom-group bubbles` 来更改图形、网格大小和颜色。 由于它即简单又有趣,这是 Emacs 中我最喜欢的游戏之一。 ### 幸运饼干 -我喜欢 `fortune` 命令。每当我启动一个新 shell 时,就会有刻薄、无益、常常带有讽刺意味的“建议(以及文学摘要,谜语)”就会点亮我的一天。 +我喜欢 `fortune` 命令。每当我启动一个新 shell 时,这些与文学片段、谜语相结合的刻薄、无益、常常带有讽刺意味的“建议”就会点亮我的一天。 -令人困惑的是,Emacs 中有两个包做了类似的事情:`fortune` 和 `cookie`。前者主要用于在电子邮件签名中添加幸运饼干消息,而后者只是一个简单的 fortune 格式阅读器。 +令人困惑的是,Emacs 中有两个包或多或少地做着类似的事情:`fortune` 和 `cookie1`。前者主要用于在电子邮件签名中添加幸运饼干消息,而后者只是一个简单的 fortune 格式阅读器。 -不管怎样,使用 Emacs 的 `cookie` 包前,你首先需要通过 `customize-option RET cookie RET` 来自定义变量 `cookie-file` 告诉它从哪找到 fortune 文件。 +不管怎样,使用 Emacs 的 `cookie1` 包前,你首先需要通过 `customize-option RET cookie RET` 来自定义变量 `cookie-file` 告诉它从哪找到 fortune 文件。 如果你的操作系统是 Ubuntu,那么你先安装 `fortune` 软件包,然后就能在 `/usr/share/games/fortune/` 目录中找到这些文件了。 -之后你就可以调用 `M-x cookie` 随机显示 fortune 内容,或者,如果你想的话,也可以调用 `M-x cookie-apropos` 查找所有匹配的 cookie。 +之后你就可以调用 `M-x cookie` 随机显示 fortune 内容,或者,如果你想的话,也可以调用 `M-x cookie-apropos` 查找所有匹配的饼干。 -### Decipher +### 破译器 -这个包完美地抓住了 Emacs 的实用本质:这个包为你破解简单的替换密码(如密码谜题)提供了一个很有用的界面。 -你知道,二十多年前,某人确实迫切需要破解很多基础密码。正是像这个模块这样的小玩意让我非常高兴地用起 Emacs 来:这个模块只对少数人有用,但是,如果你突然需要它了,那么它就在那里等着你。 +这个包完美地抓住了 Emacs 的功利本质:这个包为你破解简单的替换密码(如“密码谜题”)提供了一个很有用的界面。你知道,二十多年前,有些人确实迫切需要破解很多基本的密码。正是像这个模块这样的小玩意让我非常高兴地用起 Emacs 来:一个只对少数人有用的模块,但是,如果你突然需要它了,那么它就在那里等着你。 那么如何使用它呢?让我们假设使用 “rot13” 密码:在 26 个字符的字母表中,将字符旋转 13 个位置。 -通过 `M-x ielm` (Emacs 用于 [运行 Elisp][6] 的 REPL 环境)可以很容易在 Emacs 中进行尝试: - +通过 `M-x ielm` (Emacs 用于 [运行 Elisp][6] 的 REPL 环境)可以很容易在 Emacs 中进行尝试: ``` *** Welcome to IELM *** Type (describe-mode) for help. @@ -117,21 +102,20 @@ ELISP> (rot13 "Uryyb, Jbeyq") ELISP> ``` -那么,decipher 模块又是如何帮助我们的呢?让我们创建一个新的缓冲区 `test-cipher` 并输入您的密码文本(在我的例子中是 `Uryyb,Jbeyq`) +简而言之,你将明文旋转了 13 个位置,就得到了密文。你又旋转了一次 13 个位置,就返回了最初的明文。 这就是这个包可以帮助你解决的问题。 + +那么,decipher 模块又是如何帮助我们的呢?让我们创建一个新的缓冲区 `test-cipher` 并输入你的密文(在我的例子中是 `Uryyb,Jbeyq`)。 ![cipher](https://www.masteringemacs.org/static/uploads/cipher.png) -您现在面对的是一个相当复杂的接口。现在把光标放在紫行秘文中的任意字符上,猜猜这个字符可能是什么:Emacs 将根据你的选择更新其他明文的猜测结果,并告诉你字母表中的字符是如何分配的。 +你现在面对的是一个相当复杂的界面。现在把光标放在紫色行的密文的任意字符上,并猜测这个字符可能是什么:Emacs 将根据你的选择更新其他明文的猜测结果,并告诉你目前为止字母表中的字符是如何分配的。 -您现在可以下面各种 helper 命令来帮助推断密码字符可能对应的明文字符: +你现在可以用下面各种助手命令来关闭选项,以帮助推断密码字符可能对应的明文字符: -- **`D`:** 显示数字符号(密码中两个字符组合)及其频率的列表 - -- **`F`:** 表示每个密文字母的频率 - -- **`N`:** 显示字符的邻接信息。我不确定这是干啥的。 - -- **`M` 和 `R`:** 保存和恢复一个检查点,允许你对工作进行分支以探索破解密码的不同方法。 +- `D`: 列出示意图(该加密算法中双字符对)及其频率 +- `F`: 表示每个密文字母的频率 +- `N`: 显示字符的邻近信息。我不确定这是干啥的。 +- `M` 和 `R`: 保存和恢复一个检查点,允许你对工作进行分支以探索破解密码的不同方法。 总而言之,对于这样一个深奥的任务,这个包是相当令人印象深刻的!如果你经常破解密码,也许这个程序包能帮上忙? @@ -139,36 +123,35 @@ ELISP> ![doctor](https://www.masteringemacs.org/static/uploads/doctor.png) -啊,Emacs 医生。其基于最初的 [ELIZA][7],“ 医生”试图对你说的话进行心理分析,并试图把问题复述给你。体验它的那几分钟相当有趣,它也是 Emacs 中最著名的古怪玩意之一。你可以使用 `M-x doctor` 来运行它。 +啊,Emacs 医生。其基于最初的 [ELIZA][7],“医生”试图对你说的话进行心理分析,并试图把问题复述给你。体验几分钟,相当有趣,它也是 Emacs 中最著名的古怪玩意之一。你可以使用 `M-x doctor` 来运行它。 ### Dunnet -Emacs 自己特有的类 Zork 文本冒险游戏。输入 `M-x dunnet` 就能玩了。 -这是一款相当不错的游戏,虽然时间不长,但非常著名,很少有人真正玩到最后。 +Emacs 自己特有的类 Zork 文字冒险游戏。输入 `M-x dunnet` 就能玩了。这是一款相当不错的游戏,简单的说,它是另一款非常著名的 Emacs 游戏,很少有人真正玩到通关。 如果你发现自己能在无聊的文档工作之间空出时间来,那么这是一个超级棒的游戏,内置“老板屏幕”,因为它是纯文本的。 -哦,还有,不要吃掉那块 CPU 卡 :) +哦,还有,不要想着吃掉那块 CPU 卡 :) ### 五子棋 ![gomoku](https://www.masteringemacs.org/static/uploads/gomoku.png) -另一款写于 20 世纪 80 年代的游戏。你必须连接 5 个方块,井字游戏风格。你可以运行 `M-x gomoku` 来与 Emacs 对抗。游戏还支持鼠标,非常方便。您也可以自定义 `gomoku` 组来调整网格的大小。 +另一款写于 20 世纪 80 年代的游戏。你必须将 5 个方块连成一条线,井字棋风格。你可以运行 `M-x gomoku` 来与 Emacs 对抗。游戏还支持鼠标,非常方便。你也可以自定义 `gomoku` 组来调整网格的大小。 ### 生命游戏 -[Conway 的生命游戏 ][8] 是细胞自动机的一个著名例子。Emacs 版本提供了一些启动模式,你可以(通过 elisp 编程)通过调整 `life-patterns` 变量来更改这些模式。 +[康威的生命游戏][8] 是细胞自动机的一个著名例子。Emacs 版本提供了一些启动模式,你可以(通过 elisp 编程)调整 `life-patterns` 变量来更改这些模式。 -你可以用 `M-x life` 触发生命游戏。事实上,所有的东西,包括代码,注释和所有的东西,总共不到 300 行,这也让人印象深刻。 +你可以用 `M-x life` 触发生命游戏。事实上,所有的东西,包括显示代码、注释等等一切,总共不到 300 行,这也让人印象深刻。 ### 乒乓,贪吃蛇和俄罗斯方块 ![tetris](https://www.masteringemacs.org/static/uploads/tetris.png) -这些经典游戏都是使用 Emacs 包 `gamegrid` 实现的,这是一个用于构建网格游戏(如俄罗斯方块和贪吃蛇)的通用框架。gamegrid 包的伟大之处在于它同时兼容图形化和终端 Emacs: 如果你在 GUI 中运行 Emacs,你会得到精美的图形;如果你没有,你得到简单的 ASCII 艺术。 +这些经典游戏都是使用 Emacs 包 `gamegrid` 实现的,这是一个用于构建网格游戏(如俄罗斯方块和贪吃蛇)的通用框架。gamegrid 包的伟大之处在于它同时兼容图形化和终端 Emacs:如果你在 GUI 中运行 Emacs,你会得到精美的图形;如果你没有,你看到简单的 ASCII 艺术。 -你可以通过输入 `M-x pong`,`M-x snake`,`M-x tetris` 来运行这些游戏。 +你可以通过输入 `M-x pong`、`M-x snake`、`M-x tetris` 来运行这些游戏。 特别是俄罗斯方块游戏实现的非常到位,会逐渐增加速度并且能够滑块。而且既然你已经有了源代码,你完全可以移除那个讨厌的 Z 形块,没人喜欢它! @@ -176,8 +159,7 @@ Emacs 自己特有的类 Zork 文本冒险游戏。输入 `M-x dunnet` 就能玩 ![solitaire image](https://www.masteringemacs.org/static/uploads/solitaire.png) -可惜,这不是纸牌游戏,而是一个基于 peg 的游戏,你可以选择一块石头 (`o`) 并“跳过”相邻的石头进入洞中(`。`),并在这个过程中去掉你跳过的那些石头,最终只能在棋盘上留下一块石头, -重复该过程直到板子被请空(只保留一个石头)。 +可惜,这不是纸牌游戏,而是一个基于“钉子”的游戏,你可以选择一块石头(`o`)并“跳过”相邻的石头进入洞中(`.`),并在这个过程中去掉你跳过的石头,最终只能在棋盘上留下一块石头,重复该过程直到棋盘被请空(只保留一个石头)。 如果你卡住了,有一个内置的解题器名为 `M-x solitire-solve`。 @@ -187,16 +169,15 @@ Emacs 自己特有的类 Zork 文本冒险游戏。输入 `M-x dunnet` 就能玩 输入 `M-x zone`,然后看看屏幕上发生了什么! -您可以通过运行 `M-x zone-when-idle` (或从 elisp 调用它)来配置屏幕保护程序的空闲时间,时间以秒为单位。 -您也可以通过 `M-x zone-leave-me-alone` 来关闭它。 +你可以通过运行 `M-x zone-when-idle`(或从 elisp 调用它)来配置屏幕保护程序的空闲时间,时间以秒为单位。你也可以通过 `M-x zone-leave-me-alone` 来关闭它。 -如果它在你的同事看着的时候被启动,你的同事肯定会抓狂的。 +如果在你的同事看着的时候启动它,你的同事肯定会抓狂的。 ### 乘法解谜 ![mpuz](https://www.masteringemacs.org/static/uploads/mpuz.png) -这是另一个脑筋急转弯的益智游戏。当您运行 `M-x mpuz` 时,将看到一个乘法解谜题,你必须将字母替换为对应的数字,并确保数字相加(相乘?)符合结果 +这是另一个脑筋急转弯的益智游戏。当你运行 `M-x mpuz` 时,将看到一个乘法解谜题,你必须将字母替换为对应的数字,并确保数字相加(相乘?)符合结果。 如果遇到难题,可以运行 `M-x mpuz-show-solution` 来解决。 @@ -205,19 +186,15 @@ Emacs 自己特有的类 Zork 文本冒险游戏。输入 `M-x dunnet` 就能玩 还有更多好玩的东西,但它们就不如刚才那些那么好玩好用了: - 你可以通过 `M-x morse-region` 和 `M-x unmorse-region` 将一个区域翻译成莫尔斯电码。 -- Dissociated Press 是一个非常简单的命令,它将类似随机游动 markov 链生成器应用到 buffer 中的文本中,并以此生成无意义的文本。试一下 `M-x dissociated-press`。 -- Gamegrid 包是构建网格游戏的通用框架。到目前为止,只有俄罗斯方块,乒乓和贪吃蛇使用了它。其名为 `gamegrid`。 +- Dissociated Press 是一个非常简单的命令,它将一个类似随机穿行的马尔可夫链生成器应用到缓冲区中的文本中,并以此生成无意义的文本。试一下 `M-x dissociated-press`。 - `gametree` 软件包是一个通过电子邮件记录和跟踪国际象棋游戏的复杂方法。 -- `M-x spook` 命令插入随机单词(通常是在电子邮件中),目的是混淆/超载 “NSA trukn trawler”—— 记住,这个模块可以追溯到 20 世纪 80 年代和 90 年代——那时应该有间谍们在监听各种单词。当然,即使是在十年前,这样做也会显得非常偏执和古怪,不过现在看来已经不那么奇怪了…… +- `M-x spook` 命令插入随机单词(通常是到电子邮件中),目的是混淆/超载 “NSA 拖网渔船” —— 记住,这个模块可以追溯到 20 世纪 80 年代和 90 年代,那时应该有间谍们在监听各种单词。当然,即使是在十年前,这样做也会显得非常偏执和古怪,不过现在看来已经不那么奇怪了…… +### 总结 -### 结论 +我喜欢 Emacs 附带的游戏和玩具。它们大多来自于,嗯,我们姑且称之为一个不同的时代:一个允许或甚至鼓励奇思妙想的时代。有些玩意非常经典(如俄罗斯方块和汉诺塔),有些对经典游戏进行了有趣的变种(如黑盒)——但我很高兴这么多年后它们依然存在于 Emacs 中。我想知道时至今日,类似这些的玩意是否还会再纳入 Emacs 的代码库中;嗯,它们很可能不会——它们将被归入包管理仓库中,而在这个干净而无菌的世界中,它们无疑属于包管理仓库。 -我喜欢 Emacs 附带的游戏和玩具。它们大多来自于,嗯,我们姑且称之为一个不同的时代:一个允许或甚至鼓励奇思妙想的时代。 -有些玩意非常经典(如俄罗斯方块和汉诺塔),有些对经典游戏进行了有趣的变种(如黑盒)——但我很高兴这么多年后他们依然在 Emacs 中。 -我想知道时至今日,这些玩意是否还会纳入 Emacs 的代码库中;嗯,它们很可能不会——它们将被归入包管理仓库中,而在这个干净而贫瘠的世界中,它们无疑属于包管理仓库。 - -Emacs 要求将对 Emacs 体验不重要的内容转移到包管理仓库 ELPA 中。我的意思是,作为一个开发者,这是有道理的,但是……对于每一个被移出并流放到 ELPA 的包,我们都在蚕食 Emacs 的精髓。 +Emacs 要求将对 Emacs 体验不重要的内容转移到包管理仓库 ELPA 中。我的意思是,作为一个开发者,这是有道理的,但是……对于每一个被移出并流放到 ELPA 的包,我们是不是在蚕食 Emacs 的精髓? -------------------------------------------------------------------------------- @@ -227,7 +204,7 @@ via: https://www.masteringemacs.org/article/fun-games-in-emacs 作者:[Mickey Petersen][a] 选题:[lujun9972][b] 译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bcf69025122cd9c1fc1454d83b3702a09e2b5ced Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 Feb 2020 13:12:25 +0800 Subject: [PATCH 209/315] PRF @heguangzhi --- ...came the Standard for Compute Resources.md | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md b/translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md index 901635d6a5..135cfc1b07 100644 --- a/translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md +++ b/translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How Kubernetes Became the Standard for Compute Resources) @@ -10,28 +10,27 @@ Kubernetes 如何成为计算资源的标准 ====== +![](https://www.linux.com/wp-content/uploads/2019/08/elevator-1598431_1920.jpg) - +对于原生云生态系统来说,2019 年是改变游戏规则的一年。有大的[并购][1],如 Red Hat Docker 和 Pivotal,并出现其他的玩家,如 Rancher Labs 和 Mirantis。 -对于原生云生态系统来说,2019年是改变游戏规则的一年。有大的[并购][1),如 Red Hat Docker 和 Pivotal,并出现其他的玩家 如Rancher Labs 和 Mirantis 。 +Rancher Labs (一家为采用容器的团队提供完整软件栈的公司)的联合创始人兼首席执行官盛亮表示:“所有这些整合和并购,都表明这一领域的市场成熟的速度很快。” -“所有这些并购",Rancher Labs (一家为采用容器的团队提供完整软件栈的公司) 的联合创始人兼首席执行官盛亮表示:“这一领域的成功表明市场成熟的速度很快。”。 +传统上,像 Kubernetes 和 Docker 这样的新兴技术吸引着开发者和像脸书和谷歌这样的超级用户。除了这群人之外则没什么兴趣。然而,这两种技术都在企业层面得到了广泛采用。突然间,出现了一个巨大的市场,有着巨大的机会。几乎每个人都跳了进去。有人带来了创新的解决方案,也有人试图赶上其他人。它很快变得非常拥挤和热闹起来。 -传统上,像 Kubernetes 和 Docker 这样的新兴技术吸引着开发者和像脸书和谷歌这样的超级用户。这群人之外没什么其他的兴趣。然而,这两种技术都在企业层面得到了广泛采用。突然间,有了一个巨大的市场,有了巨大的机会。几乎每个人都跳了进去。有人带来了创新的解决方案,也有人试图赶上其他人。它很快变得非常拥挤和热闹起来。 +它也改变了创新的方式。[早期采用者通常是精通技术的公司][2]。现在,几乎每个人都在使用它,即使是在不被认为是 Kubernetes 地盘的地方。它改变了市场动态,像 Rancher Labs 这样的公司见证了独特的用例。 -它也改变了创新的方式。[早期采用者通常是精通技术的公司。][2]现在,几乎每个人都在使用它,即使是在不被认为是 Kubernetes 地盘的地方。它改变了市场动态,像 Rancher Labs 这样的公司见证了独特的用例。 - -梁补充道,“我从来没有经历过像 Kubernete 这样快速、动态的市场或这样的技术进化。当我们五年前开始的时候,这是一个非常拥挤的空间。随着时间的推移,我们大多数的同龄人因为这样或那样的原因消失了。他们要么无法适应变化,要么选择不适应某些变化。” +盛亮补充道,“我从来没有经历过像 Kubernete 这样快速、动态的市场或技术演变。当我们五年前开始的时候,这是一个非常拥挤的空间。随着时间的推移,我们大多数的友商因为这样或那样的原因消失了。他们要么无法适应变化,要么选择不适应某些变化。” 在 Kubernetes 的早期,最明显的机会是建立 Kubernetes 发行版本和 Kubernetes 业务。这是新技术。众所周知,它的安装、升级和操作相当的复杂。 -当谷歌、AWS 和微软进入市场时,一切都变了。当时,有一群供应商蜂拥而至,为平台提供解决方案。梁表示:“一旦像谷歌这样的云提供商决定将Kubernetes 作为一项服务,并亏本出售的商品免费提供,以推动基础设施消费;我们就知道,运营和支持 Kubernetes 业务的优势将非常有限了。”。 +当谷歌、AWS 和微软进入市场时,一切都变了。当时,一群供应商蜂拥而至,为平台提供解决方案。盛亮表示:“一旦像谷歌这样的云提供商决定将 Kubernetes 作为一项服务,并免费提供亏本出售的商品,以推动基础设施消费;我们就知道,运营和支持 Kubernetes 业务的优势将非常有限了。” -对非谷歌玩家来说,并非一切都不好。由于云供应商通过将它作为服务来提供,消除了 Kubernetes 带来的所有复杂性,这意味着更广泛地采用该技术,即使是那些由于运营成本而不愿使用该技术的人也是如此。这意味着 Kubernetes 将变得无处不在,并将成为一个行业标准。 +对谷歌之外的其它玩家来说,并非一切都不好。由于云供应商通过将它作为服务来提供,消除了 Kubernetes 带来的所有复杂性,这意味着更广泛地采用该技术,即使是那些由于运营成本而不愿使用该技术的人也是如此。这意味着 Kubernetes 将变得无处不在,并将成为一个行业标准。 -“Rancher Labs 是极少数将此视为机遇并比其他公司看得更远的公司之一。我们意识到 Kubernetes 将成为新的计算标准,就像TCP/IP成为网络标准一样,”梁说。 +“Rancher Labs 是极少数将此视为机遇并比其他公司看得更远的公司之一。我们意识到 Kubernetes 将成为新的计算标准,就像 TCP/IP 成为网络标准一样,”盛亮说。 -CNCF围绕 Kubernetes 构建一个充满活力的生态系统方面发挥着至关重要的作用,创建了一个庞大的社区来构建、培育和商业化原生云开源技术。 +CNCF 在围绕 Kubernetes 构建一个充满活力的生态系统方面发挥着至关重要的作用,创建了一个庞大的社区来构建、培育和商业化原生云开源技术。 -------------------------------------------------------------------------------- @@ -40,7 +39,7 @@ via: https://www.linux.com/articles/how-kubernetes-became-the-standard-for-compu 作者:[Swapnil Bhartiya][a] 选题:[lujun9972][b] 译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 18a96ff143d250f947aac6e59e7e5a237c6032a5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 Feb 2020 13:17:56 +0800 Subject: [PATCH 210/315] PUB @heguangzhi https://linux.cn/article-11940-1.html --- ... Kubernetes Became the Standard for Compute Resources.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20200219 How Kubernetes Became the Standard for Compute Resources.md (96%) diff --git a/translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md b/published/20200219 How Kubernetes Became the Standard for Compute Resources.md similarity index 96% rename from translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md rename to published/20200219 How Kubernetes Became the Standard for Compute Resources.md index 135cfc1b07..3d1a903916 100644 --- a/translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md +++ b/published/20200219 How Kubernetes Became the Standard for Compute Resources.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11940-1.html) [#]: subject: (How Kubernetes Became the Standard for Compute Resources) [#]: via: (https://www.linux.com/articles/how-kubernetes-became-the-standard-for-compute-resources/) [#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) @@ -10,7 +10,7 @@ Kubernetes 如何成为计算资源的标准 ====== -![](https://www.linux.com/wp-content/uploads/2019/08/elevator-1598431_1920.jpg) +![](https://img.linux.net.cn/data/attachment/album/202002/28/131634mwzyylmv93m4ccws.jpg) 对于原生云生态系统来说,2019 年是改变游戏规则的一年。有大的[并购][1],如 Red Hat Docker 和 Pivotal,并出现其他的玩家,如 Rancher Labs 和 Mirantis。 From f70ccaf54e435f48a09810655536dfd538a0bade Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 Feb 2020 14:27:25 +0800 Subject: [PATCH 211/315] PRF @geekpi --- ...217 How to get MongoDB Server on Fedora.md | 87 ++++++++----------- 1 file changed, 35 insertions(+), 52 deletions(-) diff --git a/translated/tech/20200217 How to get MongoDB Server on Fedora.md b/translated/tech/20200217 How to get MongoDB Server on Fedora.md index c7da999f65..604e85c184 100644 --- a/translated/tech/20200217 How to get MongoDB Server on Fedora.md +++ b/translated/tech/20200217 How to get MongoDB Server on Fedora.md @@ -1,116 +1,99 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to get MongoDB Server on Fedora) [#]: via: (https://fedoramagazine.org/how-to-get-mongodb-server-on-fedora/) [#]: author: (Honza Horak https://fedoramagazine.org/author/hhorak/) -如何在 Fedora 上获取 MongoDB 服务器 +如何在 Fedora 上安装 MongoDB 服务器 ====== ![][1] -Mongo(来自 “humongous”)是一个高性能,开源,无模式的面向文档的数据库,它是最受欢迎的 [NoSQL][2] 数据库之一。它使用 JSON 作为文档格式,并且可以在多个服务器节点之间进行扩展和复制。 +Mongo(来自 “humongous” —— 巨大的)是一个高性能、开源、无模式的、面向文档的数据库,它是最受欢迎的 [NoSQL][2] 数据库之一。它使用 JSON 作为文档格式,并且可以在多个服务器节点之间进行扩展和复制。 ### 有关许可证更改的故事 -上游 MongoD 决定更改服务器代码的许可证已经一年多了。先前的许可证是 GNU Affero General Public License v3(AGPLv3)。但是,上游写了一个新许可证,为了使运行 MongoDB 即服务的公司回馈社区。新许可证称为 Server Side Public License(SSPLv1),关于这个及其原理的更多说明,请参见[MongoDB SSPL FAQ][3]。 +MongoDB 上游决定更改服务器代码的许可证已经一年多了。先前的许可证是 GNU Affero General Public License v3(AGPLv3)。但是,上游公司写了一个新许可证,旨在使运行 MongoDB 即服务的公司可以回馈社区。新许可证称为 Server Side Public License(SSPLv1),关于这个举措及其解释的更多说明,请参见 [MongoDB SSPL FAQ][3]。 -Fedora 一直只包含自由软件。当 SSPL 发布后,Fedora [确定][4]它并不是自由软件许可。许可证更改日期(2018 年 10 月)之前发布的所有 MongoDB 版本都可保留在 Fedora 中,但之后再也不更新软件包会带来安全问题。因此,从 Fedora 30 开始,Fedora 社区决定完全[移除 MongoDB 服务器][5]。 +Fedora 一直只包含自由软件。当 SSPL 发布后,Fedora [确定][4]它并不是自由软件许可证。许可证更改日期(2018 年 10 月)之前发布的所有 MongoDB 版本都可保留在 Fedora 中,但之后再也不更新的软件包会带来安全问题。因此,从 Fedora 30 开始,Fedora 社区决定完全[移除 MongoDB 服务器][5]。 ### 开发人员还有哪些选择? 是的,还有替代方案,例如 PostgreSQL 在最新版本中也支持 JSON,它可以在无法再使用 MongoDB 的情况下使用它。使用 JSONB 类型,索引在 PostgreSQL 中可以很好地工作,其性能可与 MongoDB 媲美,甚至不会受到 ACID 的影响。 -开发人员可能选择 MongoDB 的技术原因并未随许可证而改变,因此许多人仍想使用它。重要的是要意识到,SSPL 许可证仅更改仅针对 MongoDB 服务器。MongoDB 上游还开发了其他项目,例如 MongoDB 工具,C 和 C++ 客户端库以及用于各种动态语言的连接器,这些项目在客户端(要通过网络与服务器通信的应用中)使用。由于这些包的许可证是自由的(主要是 Apache 许可证),因此它们保留在 Fedora 仓库中,因此用户可以将其用于应用开发。 +开发人员可能选择 MongoDB 的技术原因并未随许可证而改变,因此许多人仍想使用它。重要的是要意识到,SSPL 许可证仅更改仅针对 MongoDB 服务器。MongoDB 上游还开发了其他项目,例如 MongoDB 工具、C 和 C++ 客户端库以及用于各种动态语言的连接器,这些项目在客户端使用(通过网络与服务器通信的应用中)。由于这些包的许可证人保持自由(主要是 Apache 许可证),因此它们保留在 Fedora 仓库中,因此用户可以将其用于应用开发。 -唯一的变化实际是服务器包本身,它已从 Fedora 仓库中完全删除。让我们看看 Fedora 用户可以如何获取非自由的包。 +唯一的变化实际是服务器软件包本身,它已从 Fedora 仓库中完全删除。让我们看看 Fedora 用户可以如何获取非自由的包。 ### 如何从上游安装 MongoDB 服务器 当 Fedora 用户想要安装 MongoDB 服务器时,他们需要直接向上游获取 MongoDB。但是,上游不为 Fedora 提供 RPM 包。相反,MongoDB 服务器可以获取源码 tarball,用户需要自己进行编译(这需要一些开发知识),或者 Fedora 用户可以使用一些兼容的包。在兼容的选项中,最好的选择是 RHEL-8 RPM。以下步骤描述了如何安装它们以及如何启动守护进程。 -#### 1\. 使用上游 RPM 创建仓库(RHEL-8 构建) -``` +#### 1、使用上游 RPM 创建仓库(RHEL-8 构建) ``` - -$ sudo cat > /etc/yum.repos.d/mongodb.repo &lt;&lt;EOF +$ sudo cat > /etc/yum.repos.d/mongodb.repo >>EOF [mongodb-upstream] name=MongoDB Upstream Repository -baseurl= +baseurl=https://repo.mongodb.org/yum/redhat/8Server/mongodb-org/4.2/x86_64/ gpgcheck=1 enabled=1 -gpgkey= +gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc EOF ``` -``` - -#### 2\. 安装元软件包,来拉取服务器和工具包 -``` +#### 2、安装元软件包,来拉取服务器和工具包 ``` - $ sudo dnf install mongodb-org -&lt;snipped> +...... Installed: -  mongodb-org-4.2.3-1.el8.x86_64           mongodb-org-mongos-4.2.3-1.el8.x86_64   -  mongodb-org-server-4.2.3-1.el8.x86_64    mongodb-org-shell-4.2.3-1.el8.x86_64 -  mongodb-org-tools-4.2.3-1.el8.x86_64           + mongodb-org-4.2.3-1.el8.x86_64 mongodb-org-mongos-4.2.3-1.el8.x86_64 + mongodb-org-server-4.2.3-1.el8.x86_64 mongodb-org-shell-4.2.3-1.el8.x86_64 + mongodb-org-tools-4.2.3-1.el8.x86_64 Complete! ``` -``` - -#### 3\. 启动 MongoDB 守护进程 -``` +#### 3、启动 MongoDB 守护进程 ``` - $ sudo systemctl status mongod ● mongod.service - MongoDB Database Server -   Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled) -   Active: active (running) since Sat 2020-02-08 12:33:45 EST; 2s ago -     Docs: -  Process: 15768 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS) -  Process: 15769 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS) -  Process: 15770 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS) -  Process: 15771 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS) - Main PID: 15773 (mongod) -   Memory: 70.4M -      CPU: 611ms -   CGroup: /system.slice/mongod.service -           └─15773 /usr/bin/mongod -f /etc/mongod.conf -``` + Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled) + Active: active (running) since Sat 2020-02-08 12:33:45 EST; 2s ago + Docs: https://docs.mongodb.org/manual + Process: 15768 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS) + Process: 15769 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS) + Process: 15770 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS) + Process: 15771 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS) + Main PID: 15773 (mongod) + Memory: 70.4M + CPU: 611ms + CGroup: /system.slice/mongod.service ``` -#### 4\. 通过 mongo shell 连接服务器来验证是否运行 -``` +#### 4、通过 mongo shell 连接服务器来验证是否运行 ``` - $ mongo MongoDB shell version v4.2.3 -connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&amp;gssapiServiceName=mongodb +connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("20b6e61f-c7cc-4e9b-a25e-5e306d60482f") } MongoDB server version: 4.2.3 Welcome to the MongoDB shell. For interactive help, type "help". For more comprehensive documentation, see -    -\--- - -> _ + http://docs.mongodb.org/ +--- ``` + -``` - -就是这样了。如你所见,RHEL-8 包完美兼容,只要 Fedora 包还与 RHEL-8 兼容,它就应该会一直兼容。 请注意,在使用时必须遵守 SSPLv1 许可证。 +就是这样了。如你所见,RHEL-8 包完美兼容,只要 Fedora 包还与 RHEL-8 兼容,它就应该会一直兼容。请注意,在使用时必须遵守 SSPLv1 许可证。 -------------------------------------------------------------------------------- @@ -119,7 +102,7 @@ via: https://fedoramagazine.org/how-to-get-mongodb-server-on-fedora/ 作者:[Honza Horak][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/) 荣誉推出 From 394d4d2e958fdff1a5a304894c1735c753211f8c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 Feb 2020 14:29:01 +0800 Subject: [PATCH 212/315] PUB @geekpi https://linux.cn/article-11942-1.html --- .../20200217 How to get MongoDB Server on Fedora.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200217 How to get MongoDB Server on Fedora.md (98%) diff --git a/translated/tech/20200217 How to get MongoDB Server on Fedora.md b/published/20200217 How to get MongoDB Server on Fedora.md similarity index 98% rename from translated/tech/20200217 How to get MongoDB Server on Fedora.md rename to published/20200217 How to get MongoDB Server on Fedora.md index 604e85c184..8c5522b477 100644 --- a/translated/tech/20200217 How to get MongoDB Server on Fedora.md +++ b/published/20200217 How to get MongoDB Server on Fedora.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11942-1.html) [#]: subject: (How to get MongoDB Server on Fedora) [#]: via: (https://fedoramagazine.org/how-to-get-mongodb-server-on-fedora/) [#]: author: (Honza Horak https://fedoramagazine.org/author/hhorak/) From 8204a45dd2b7d1b57bea285c58790b88156e2314 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 00:55:39 +0800 Subject: [PATCH 213/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200228=20Fedora?= =?UTF-8?q?=E2=80=99s=20gaggle=20of=20desktops?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200228 Fedora-s gaggle of desktops.md --- .../20200228 Fedora-s gaggle of desktops.md | 411 ++++++++++++++++++ 1 file changed, 411 insertions(+) create mode 100644 sources/tech/20200228 Fedora-s gaggle of desktops.md diff --git a/sources/tech/20200228 Fedora-s gaggle of desktops.md b/sources/tech/20200228 Fedora-s gaggle of desktops.md new file mode 100644 index 0000000000..d92d84344a --- /dev/null +++ b/sources/tech/20200228 Fedora-s gaggle of desktops.md @@ -0,0 +1,411 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fedora’s gaggle of desktops) +[#]: via: (https://fedoramagazine.org/fedoras-gaggle-of-desktops/) +[#]: author: (Troy Dawson https://fedoramagazine.org/author/tdawson/) + +Fedora’s gaggle of desktops +====== + +![][1] + +There are 38 different desktops or window managers in Fedora 31. You could try a different one every day for a month, and still have some left over. Some have very few features. Some have so many features they are called a desktop environment. This article can’t go into detail on each, but it’s interesting to see the whole list in one place. + +### Criteria for desktops + +To be on this list, the desktop must show up on the desktop manager’s selection list. If the desktop has more than one entry in the desktop manager list, they are counted just as that one desktop. An example is “GNOME”, “GNOME Classic” and “GNOME (Wayland).” These all show up on the desktop manager list, but they are still just GNOME. + +### List of desktops +``` + +``` + +#### [**9wm**][2] + +``` +Emulation of the Plan 9 window manager 8 1/2 + dnf install 9wm +``` + +#### [**awesome**][3] + +``` +Highly configurable, framework window manager for X. Fast, light and extensible +https://fedoramagazine.org/5-cool-tiling-window-managers/ + dnf install awesome +``` + +#### [**blackbox**][4] + +``` +Very small and fast Window Manager +Fedora uses the maintained fork on github + dnf install blackbox +``` + +#### [**bspwm**][5] + +``` +A tiling window manager based on binary space partitioning +https://github.com/windelicato/dotfiles/wiki/bspwm-for-dummies + dnf install bspwm +``` + +#### **[byobu][6]** + +``` +Light-weight, configurable window manager built upon GNU screen + dnf install byobu +``` + +#### **[Cinnamon][7]** + +``` +Cinnamon provides a desktop with a traditional layout, advanced features, easy to use, powerful and flexible. +https://projects.linuxmint.com/cinnamon/ +https://opensource.com/article/19/12/cinnamon-linux-desktop + dnf group install "Cinnamon Desktop" +``` + +#### **[cwm][8]** + +``` +Calm Window Manager by OpenBSD project +https://steemit.com/technology/@jamesdeagle/the-calm-window-manager-cwm-a-quick-start-guide + dnf install cwm +``` + +#### **[Deepin][9]** + +``` +Deepin desktop is the desktop environment released with deepin (the linux distribution). It aims at being elegant and easy to use. + dnf group install "Deepin Desktop" + (optional) dnf group install "Deepin Desktop Office" "Media packages for Deepin Desktop" +``` + +#### **[dwm][10]** + +``` +Dynamic window manager for X +https://fedoramagazine.org/lets-try-dwm-dynamic-window-manger/ +https://fedoramagazine.org/5-cool-tiling-window-managers/ + dnf install dwm + (optional) dnf install dwm-user +``` + +#### **[enlightenment][11]** + +``` +Enlightenment window manager +https://opensource.com/article/19/12/linux-enlightenment-desktop + dnf install enlightenment +``` + +#### **[e16][11]** + +``` +The Enlightenment window manager, DR16 + dnf install e16 + (optional) dnf install e16-epplets e16-keyedit e16-themes +``` + +#### **[fluxbox][12]** + +``` +Window Manager based on Blackbox + dnf install fluxbox + (optional) dnf install fluxbox-pulseaudio fluxbox-vim-syntax +``` + +#### **[fvwm][13]** + +``` +Highly configurable multiple virtual desktop window manager +http://www.fvwm.org/ +https://opensource.com/article/19/12/fvwm-linux-desktop + dnf install fvwm +``` + +#### **[GNOME][14]** + +``` +GNOME is a highly intuitive and user friendly desktop environment. +* both X11 and wayland +https://opensource.com/article/19/12/gnome-linux-desktop +https://fedoramagazine.org/3-simple-and-useful-gnome-shell-extensions/ + dnf group install "GNOME" + (optional but large) dnf group install "Fedora Workstation" +``` + +#### **[herbstluftwm][15]** + +``` +A manual tiling window manager +https://opensource.com/article/19/12/herbstluftwm-linux-desktop + dnf install herbstluftwm + (optional) dnf install herbstluftwm-zsh herbstluftwm-fish +``` + +#### **[i3][16]** + +``` +Improved tiling window manager +https://fedoramagazine.org/getting-started-i3-window-manager/ +https://fedoramagazine.org/using-i3-with-multiple-monitors/ + dnf install i3 + (optional) dnf install i3-doc i3-ipc +``` + +#### **[icewm][17]** + +``` +Window manager designed for speed, usability, and consistency +https://fedoramagazine.org/icewm-a-really-cool-desktop/ + dnf install icewm + (optional) dnf install icewm-minimal-session +``` + +#### **[jwm][18]** + +``` +Joe's Window Manager +https://opensource.com/article/19/12/joes-window-manager-linux-desktop + dnf install jwm +``` + +#### **[KDE Plasma Desktop][19]** + +``` +The KDE Plasma Workspaces, a highly-configurable graphical user interface which includes a panel, desktop, system icons and desktop widgets, and many powerful KDE applications. +* both X11 and wayland +https://opensource.com/article/19/12/linux-kde-plasma +https://fedoramagazine.org/installing-kde-plasma-5/ + dnf group install "KDE Plasma Workspaces" + (optional) dnf group install "KDE Applications" "KDE Educational applications" "KDE Multimedia support" "KDE Office" "KDE Telepathy" + (optional for wayland) dnf install kwin-wayland plasma-workspace-wayland +``` + +#### **[lumina][20]** + +``` +A lightweight, portable desktop environment +https://opensource.com/article/19/12/linux-lumina-desktop + dnf install lumina-desktop + (optional) dnf install lumina-* +``` + +#### **[LXDE][21]** + +``` +LXDE is a lightweight X11 desktop environment designed for computers with low hardware specifications like netbooks, mobile devices or older computers. +https://opensource.com/article/19/12/lxqt-lxde-linux-desktop + dnf group install "LXDE Desktop" + (optional) dnf group install "LXDE Office" "Multimedia support for LXDE" +``` + +#### **[LXQt][22]** + +``` +LXQt is a lightweight X11 desktop environment designed for computers with low hardware specifications like netbooks, mobile devices or older computers. +https://opensource.com/article/19/12/lxqt-lxde-linux-desktop + dnf group install "LXQt Desktop" + (optional) dnf group install "LXQt Office" "Multimedia support for LXQt" +``` + +#### **[MATE][23]** + +``` +MATE Desktop is based on GNOME 2 and provides a powerful graphical user interface for users who seek a simple easy to use traditional desktop interface. +https://opensource.com/article/19/12/mate-linux-desktop +https://fedoramagazine.org/installing-another-desktop/ + dnf group install "MATE Desktop" + (optional) dnf group install "MATE Applications" +``` + +#### **[musca][24]** + +``` +A simple dynamic window manager fox X + dnf install musca +``` + +#### **[openbox][25]** + +``` +A highly configurable and standards-compliant X11 window manager +https://opensource.com/article/19/12/openbox-linux-desktop +https://fedoramagazine.org/openbox-fedora/ + dnf install openbox + (optional) dnf install openbox-kde openbox-theme-mistral-thin-dark +``` + +#### **[Pantheon][26]** + +``` +The Pantheon desktop environment is the DE that powers elementaryOS. +https://github.com/elementary +https://opensource.com/article/19/12/pantheon-linux-desktop + dnf group install "Pantheon Desktop" + (optional) dnf install elementary-capnet-assist elementary-greeter elementary-shortcut-overlay +``` + +#### **[pekwm][27]** + +``` +A small and flexible window manager +https://opensource.com/article/19/12/pekwm-linux-desktop + dnf install pekwm +``` + +#### **[qtile][28]** + +``` +A pure-Python tiling window manager +https://fedoramagazine.org/5-cool-tiling-window-managers/ + dnf install qtile +``` + +#### **[ratpoison][29]** + +``` +Minimalistic window manager +https://opensource.com/article/19/12/ratpoison-linux-desktop + dnf install ratpoison +``` + +#### **[sawfish][30]** + +``` +An extensible window manager for the X Window System + dnf install sawfish + (optional) dnf install sawfish-pager +``` + +#### **[spectrwm][31]** + +``` +Minimalist tiling window manager written in C + dnf install spectrwm +``` + +#### **[Sugar][32]** + +``` +A software playground for learning about learning. +* Possibly the most unique desktop of this list. + dnf group install "Sugar Desktop Environment" + (optional) dnf group install "Additional Sugar Activities" +``` + +#### **[sway][33]** + +``` +i3-compatible window manager for Wayland +* Wayland only +https://fedoramagazine.org/setting-up-the-sway-window-manager-on-fedora/ +https://fedoramagazine.org/5-cool-tiling-window-managers/ + dnf install sway +``` + +#### **[twm][34]** + +``` +X.Org X11 twm window manager +https://en.wikipedia.org/wiki/Twm +https://opensource.com/article/19/12/twm-linux-desktop + dnf install xorg-x11-twm +``` + +#### **[WindowMaker][35]** + +``` +A fast, feature rich Window Manager +https://opensource.com/article/19/12/linux-window-maker-desktop + dnf install WindowMaker + (optional) dnf install WindowMaker-extra +``` + +#### **[wmx][36]** + +``` +A really simple window manager for X + dnf install wmx +``` + +#### **[XFCE][37]** + +``` +A lightweight desktop environment that works well on low end machines. +https://opensource.com/article/19/12/xfce-linux-desktop + dnf group install "Xfce Desktop" + (optional) dnf group install "Applications for the Xfce Desktop" "Extra plugins for the Xfce panel" "Multimedia support for Xfce" "Xfce Office" +``` + +#### **[xmonad][38]** + +``` +A tiling window manager + dnf install xmonad + (optional) dnf install xmonad-mate +``` + +* * * + +_Photo by [Annie Spratt][39] on [Unsplash][40]._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedoras-gaggle-of-desktops/ + +作者:[Troy Dawson][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/tdawson/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/01/gaggle-desktops-816x345.jpg +[2]: https://github.com/9wm/9wm +[3]: https://awesomewm.org/ +[4]: https://github.com/bbidulock/blackboxwm +[5]: https://github.com/baskerville/bspwm +[6]: https://byobu.org/ +[7]: https://github.com/linuxmint/cinnamon +[8]: https://github.com/leahneukirchen/cwm +[9]: https://www.deepin.org/en/dde/ +[10]: http://dwm.suckless.org/ +[11]: https://www.enlightenment.org/ +[12]: http://fluxbox.org/ +[13]: https://github.com/fvwmorg/fvwm +[14]: https://www.gnome.org/ +[15]: http://herbstluftwm.org/ +[16]: https://i3wm.org/ +[17]: https://ice-wm.org/ +[18]: http://joewing.net/projects/jwm/ +[19]: https://kde.org/ +[20]: https://lumina-desktop.org/ +[21]: https://lxde.org/ +[22]: https://lxqt.org/ +[23]: https://mate-desktop.org/ +[24]: https://github.com/enticeing/musca +[25]: http://openbox.org +[26]: https://elementary.io/ +[27]: http://www.pekwm.org/ +[28]: http://qtile.org +[29]: http://www.nongnu.org/ratpoison/ +[30]: http://sawfish.wikia.com/ +[31]: https://github.com/conformal/spectrwm +[32]: https://sugarlabs.org/ +[33]: https://github.com/swaywm/sway +[34]: https://www.x.org/releases/X11R7.6/doc/man/man1/twm.1.xhtml +[35]: http://www.windowmaker.org +[36]: http://www.all-day-breakfast.com/wmx/ +[37]: https://www.xfce.org/ +[38]: https://hackage.haskell.org/package/xmonad +[39]: https://unsplash.com/@anniespratt?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[40]: https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 0b2183cb55f3cd4014954ff38357691a09d62d87 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 01:01:50 +0800 Subject: [PATCH 214/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200227=20How=20?= =?UTF-8?q?Melissa=20Di=20Donato=20Is=20Going=20To=20Reinvent=20SUSE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md --- ...ssa Di Donato Is Going To Reinvent SUSE.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md diff --git a/sources/tech/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md b/sources/tech/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md new file mode 100644 index 0000000000..eb5fa59eb0 --- /dev/null +++ b/sources/tech/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How Melissa Di Donato Is Going To Reinvent SUSE) +[#]: via: (https://www.linux.com/articles/how-melissa-di-donato-is-going-to-reinvent-suse/) +[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) + +How Melissa Di Donato Is Going To Reinvent SUSE +====== + +[![][1]][2] + +[![][1]][2] + +SUSE is one of the oldest open source companies and the first to market Linux for the enterprise. Even though it has undergone several acquisitions and a merger, it remains a strong player in the business. It has maintained its integrity and core values around open source. It continues to rely on its tried-and-tested Linux business and European markets, and generally shies away from making big moves taking big risks. + +Until now. + +[SUSE appointed Melissa Di Donato as its first female CEO][3]. She is making some serious changes to the company, from building a diverse and inclusive culture to betting on emerging technologies and taking risks. + +Soon after taking the helm last year, Di Donato spent the first few months traveling around the globe to meet SUSE teams and customers and get a better sense of the perception of the market about the company. + +Just like [Red Hat CEO Jim Whitehurst,][4] Di Donato didn’t come to the company from an open source background. She had spent the last 25 years of her career as a SUSE customer, so she did have an outsider’s perspective of the company. + +“I am not interested in what SUSE was when I joined. I am more interested in what we want to become,” she said. + +**Innovating for customers** + +After her 100-day global tour, Di Donato had a much clearer picture of the company. She found that more than 80% of SUSE customers were still traditionalists, i.e., companies such as Walgreens and Daimler who have been around for a long time. + +Over the years, these customers brought technologies into their environments to simplify things, but they ended up creating more complexities. It’s a tall order to weave through the legacy technical debt they incurred and embrace emerging technologies such as Cloud Foundry, Kubernetes and so on. + +These customers want to modernize their legacy environments and workloads, but they can’t do that with the complex environments they have built. They can’t iterate faster; they can’t respond to new opportunities and new competitors faster. + +They want to leverage cloud-native technologies like Kubernetes and containers, but it is overwhelming to evaluate technologies that are emerging at such a rapid pace. Which ones are just shiny new things and which ones do they really need them to accelerate their business goals? + +“We have to help our customers simplify their infrastructure and environment so that they can start modernizing it and start leveraging new technologies,” Di Donato said. + +While SUSE will continue to focus on core Linux OS, it will also invest in the next generation of Linux. It has been working on technologies like Kubic and MicroOS that change the way Linux is installed, managed, and operated. + +She explains, “We are going to reinvent the way operating systems are used. We are going to make sure that we provide solutions that help our customers optimize their environment, automate components to help the applications run in a much more efficient and modern way. That’s what SUSE is going to be — an innovator. We’re not there quite yet, but that’s our focus.”. + +**Evolving the company ** + +Historically, SUSE has been a fairly conservative company compared to other companies like Red Hat, which has been embracing emerging technologies at a much faster rate than any other open source software vendor. + +“We have not been in a place where we’ve been considered the risk taker. We’re the steady, stable provider of the most comprehensive unbreakable solutions in the market,” Di Donato admitted. “But we need to take that strong foundation and begin to become a bit of a risk taker, and begin to become very innovative.” + +She is also gunning for explosive growth. “We’re going to double in size by 2023. We have to go from just under half-a-billion in revenue to a billion.” + +To achieve that, SUSE will be looking at both organic and inorganic growth, including acquisition of companies, talent and technologies. “We are going to be the default choice for innovation. We are going to be the default choice for highly innovative technologies that really change the landscape,” Di Donato said. + +**Refining the brand** + +Aside from making significant changes within the company, Di Donato is working on refining the SUSE brand. She hired seasoned Ivo Totev to lead Product and Marketing and showcase the company’s differentiation. + +“We’re trying to get into the psychology of reinventing the brand,” Di Donato said. Her goal is to allocate 30-40% of SUSE’s total revenue outside of the core Linux OS towards emerging markets and develop the technologies that they’ve already built. + +SUSE _is_ home to many innovative technologies that are being used by other open source communities, even its competitors. It just didn’t market them the way Red Hat would market its technologies and projects. Even though SUSE started before Red Hat, the latter has much more visibility around the globe. + +“It’s a matter of getting the word out. We build things, but we don’t talk about it or do anything about it. We actually have to put a package around it and start selling it so people can see who we are and what value we bring to them.” + +In Di Donato’s eyes, though, good marketing isn’t everything. She argued that customers are going to demand flexibility and they are going to demand innovation that is not tied to the stack of a company. “Red Hat has a very locked-in stack that doesn’t allow them to be agnostic at all.” + +It’s quite true that unlike Red Hat, SUSE is known as an “open open-source company”, one that believes in working with partners to create an ecosystem around open source, instead of creating a tightly integrated stack that locks everyone out. + +She believes that eventually, customers would want the freedom and flexibility of picking and choosing the components they want in their stack. + +**Conclusion** + +Expect some big moves from SUSE in the near future. Less than a year into the company, new CEO Di Donato has developed a very clear vision. “We’re going to build this company based on an innovative and agile mindset. We’re not going to give up the stability and the quality of our core. What we are going to do is surround the core with really innovative thought-leading technologies that are going to set us apart from our competition… You are going to feel and experience a very different sense of excitement because we’re going to be talking much, much louder than we’ve ever talked about it before.” + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/articles/how-melissa-di-donato-is-going-to-reinvent-suse/ + +作者:[Swapnil Bhartiya][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/author/swapnil/ +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/wp-content/uploads/2020/02/Melissa-Di-Donato-1068x763.jpg (Melissa Di Donato) +[2]: https://www.linux.com/wp-content/uploads/2020/02/Melissa-Di-Donato-scaled.jpg +[3]: https://www.tfir.io/suse-gets-its-first-female-ceo-melissa-di-donato/ +[4]: https://www.cio.com/article/3090140/jim-whitehurst-if-its-important-to-the-linux-community-its-important-to-red-hat.html From f513b255ef9fcce40917f1311436b205f5bede02 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 01:02:45 +0800 Subject: [PATCH 215/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200229=20Solus?= =?UTF-8?q?=20Linux=20Creator=20Ikey=20Doherty=20Enters=20the=20Game=20Dev?= =?UTF-8?q?=20Business=20With=20a=20New=20Open=20Source=20Game=20Engine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md --- ...ness With a New Open Source Game Engine.md | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 sources/tech/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md diff --git a/sources/tech/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md b/sources/tech/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md new file mode 100644 index 0000000000..a61dfca27f --- /dev/null +++ b/sources/tech/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md @@ -0,0 +1,120 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine) +[#]: via: (https://itsfoss.com/ikey-doherty-serpent-interview/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine +====== + +[Ikey Doherty][1], the creator and former lead dev of [Solus][2], is back with a new project. His new company, [Lispy Snake, Ltd][3], uses open source technology to create games, with a focus on Linux support. + +I asked Ikey some questions about his new project. Here are his answers. + +![][4] + +_**It’s FOSS: What made you decide to get into game development?**_ + +**Ikey**: Honestly I would have to say a respect for older games. The creativity that came from so much limitation is frankly amazing. If you think of how limited the NES or C64 were, (or indeed my [Amstrad CPC][5]) – yet how much joy people experienced from those platforms. It’s a buzz I can’t avoid. Even though we’re a long way now from that world, I still look to model that technical excellence and creativity as best I can. I’m a sucker for good stories. + +_**It’s FOSS: There are already several open-source game engines. Why did you decide to make your own? What is Serpent’s killer feature?**_ + +**Ikey**: There are a good number of open and closed source ones, each with a great set of features. However, I’m a pretty old school developer and there is nothing I hate more than an IDE or ‘drag n drop’ codeless environment. I simply wanted to create indie games with the least fuss possible and using a framework where I didn’t have to compromise. Once you get to ‘must work nicely on Linux and be open source’ you’re kinda short on choice. + +I collected a set of projects that I’d use as the foundation for Lispy Snake’s first games, but needed something of a framework to tie them all together, as a reusable codebase across all games and updates. + +I wouldn’t say killer features are present yet – just a set of sensible decisions. Serpent is written in D so it’s highly performant with a lower barrier of entry than say C or C++. It’s allowing me to flesh out a framework that suits my development ideals and pays attention to industry requirements, such as a performant multithreading Entity Component System or the sprite batching system. + +When you rope together all the features and decisions, you get a portable codebase, that thanks to its choice of libraries like SDL and bgfx, will eventually run on all major platforms with minimal effort on our part. That basically means we’re getting OpenGL, DirectX, Vulkan and Metal “for free”. + +Being able to target the latest APIs and create indie games easily, with industry standard features emerging constantly, from a framework that doesn’t impose itself on your workflow…that’s a pretty good combination. + +![][6] + +_**It’s FOSS: Why did you name your company LispySnake? Did you have a pet snake with a speech impediment when you were a kid?**_ + +**Ikey**: Honestly? [Naughty Dog][7] was taken. Gotta love some Bandicoot. Plus, originally we were taking on some Python contracting work and I found the name amusing. It’s pretty much a nonsensical name like many of my previous projects (Like Dave. Or Dave2.) + +_**It’s FOSS: After being an operating system developer for many years, how does it feel to be working on something smaller? Would you say that your time as an OS developer gives you an edge as a game dev?**_ + +**Ikey**: OS dev needs a very high level view constantly, with the ability to context switch from macro to micro and back again. Many, many moving parts in a large ecosystem. + +Serpent is much more task orientated – though similarities in the workflow exist in terms of defining macro systems and interleaving micro features to build a cohesive whole. My background in OS dev is obviously a huge help here. + +Where it especially shines is dealing with the ‘guts’. I think a lot of indie devs (forgive me for being sweeping) are generally happy to just build from an existing kit and either embrace it or workaround the issues. There are some true gems out there like Factorio that go above and beyond and I have to hold my hat to them. + +In terms of building a new kit we get to think, properly, about cache coherency, parallel performance, memory fragmentation, context switching and such. + +Consumers of Serpent (when released in a more stable form) will know that the framework has been designed to leverage Linux features, not just spitting out builds for it. + +![][8] + +_**It’s FOSS: Recently you ported your [Serpent][9] game engine from C to the [D language][10]. Why did you make this move? What features does D have over C?**_ + +**Ikey**: Yeah honestly that was an interesting move. We were originally working on a project called lispysnake2d which was to be a trivial wrapper around SDL to give us a micro-game library. This simply used SDL_Renderer APIs to blit 2D sprites and initially seemed sufficient. Unfortunately as development progressed it was clear we needed a 3D pipeline for 2D, so we could utilize shaders and special effects. At that point SDL_Renderer is no good to you anymore and you need to go with Vulkan or OpenGL. We began abstracting the pipelines and saw the madness ensue. + +After taking a step back, I analyzed all the shortcomings in the approach, and tired of the portability issues that would definitely arise. I’m not talking in terms of libraries, I’m talking about dealing with various filepaths, encodings, Win32 APIs, DirectX vs OpenGL vs Vulkan…etc. Then whack in boilerplate time, C string shortcomings, and the amount of reinventing required to avoid linking to bloated “cross-platform” standard library style libraries. It was a bad picture. + +Having done a lot of [Go][11] development, I started researching alternatives to C that were concurrency-aware, string-sane, and packed with a powerful cross-platform standard library. This is the part where everyone will automatically tell you to use Rust. + +Unfortunately, I’m too stupid to use [Rust][12] because the syntax literally offends my eyes. I don’t get it, and I never will. Rust is a fantastic language and as academic endeavours go, highly successful. Unfortunately, I’m too practically minded and seek comfort in C-style languages, having lived in that world too long. So, D was the best candidate to tick all the boxes, whilst having C & C++ interoptability. + +It took us a while to restore feature parity but now we have a concurrency-friendly framework which is tested with both OpenGL and Vulkan, supports sprite batching and has nice APIs. Plus, much of the reinvention is gone as we’re leveraging all the features of SDL, bgfx and the DLang standard library. Win win. + +![The first game from LispySnake][13] + +_**It’s FOSS: How are you planning to distribute your games?**_ + +**Ikey**: Demo wise we’ll initially only focus on Linux, and it’s looking like we’ll use Flatpak for that. As time goes on, when we’ve introduced support and testing for macOS + Windows, we’ll likely look to the Steam Store. Despite the closed source nature, Valve have been far more friendly and supportive of Linux over the years, whilst the likes of Epic Games have a long history of being highly anti-Linux. So that’s a no go. + +_**It’s FOSS: How can people support and contribute to the development of the Serpent game engine?**_ + +**Ikey**: We have a few different methods, for what it’s worth. The easiest is to [buy a Lifetime License][14] – which is $20. This grants you lifetime access to all of our 2D games and helps fund development of our game titles and Serpent. + +Alternatively, you can [sponsor me directly on GitHub][15] to work on Serpent and upstream where needed. Bit of FOSS love. + +[Support with Lifetime License][16] + +[Sponsor the development on GitHub][15] + +* * * + +I would like to thank Ikey for taking the time to answer my questions about his latest project. + +Have any of you created a game with open source tools? If so, what tools and how was the experience? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][17]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ikey-doherty-serpent-interview/ + +作者:[John Paul][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/john/ +[b]: https://github.com/lujun9972 +[1]: https://twitter.com/ikey_doherty +[2]: https://getsol.us/home/ +[3]: https://lispysnake.com/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/ikey_doherty_serpent_interview.png?ssl=1 +[5]: https://en.wikipedia.org/wiki/Amstrad_CPC +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/lipsy_snake_screenshot.png?ssl=1 +[7]: https://www.naughtydog.com/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/lipsy_snake.png?ssl=1 +[9]: https://github.com/lispysnake/serpent +[10]: https://dlang.org/ +[11]: https://golang.org/ +[12]: https://www.rust-lang.org/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/last_peacekeeper_game.png?ssl=1 +[14]: https://lispysnake.com/the-game-raiser/ +[15]: https://github.com/sponsors/ikeycode +[16]: https://lispysnake.com/the-game-raiser +[17]: https://reddit.com/r/linuxusersgroup From 8396b2482b57da9a4a7235813a52ae60bb2df1a7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 01:04:05 +0800 Subject: [PATCH 216/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200228=20How=20?= =?UTF-8?q?to=20process=20real-time=20data=20with=20Apache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200228 How to process real-time data with Apache.md --- ...w to process real-time data with Apache.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20200228 How to process real-time data with Apache.md diff --git a/sources/tech/20200228 How to process real-time data with Apache.md b/sources/tech/20200228 How to process real-time data with Apache.md new file mode 100644 index 0000000000..7bf16741b4 --- /dev/null +++ b/sources/tech/20200228 How to process real-time data with Apache.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to process real-time data with Apache) +[#]: via: (https://opensource.com/article/20/2/real-time-data-processing) +[#]: author: (Simon Crosby https://opensource.com/users/simon-crosby) + +How to process real-time data with Apache +====== +Open source is leading the way with a rich canvas of projects for +processing real-time events. +![Alarm clocks with different time][1] + +In the "always-on" future with billions of connected devices, storing raw data for analysis later will not be an option because users want accurate responses in real time. Prediction of failures and other context-sensitive conditions require data to be processed in real time—certainly before it hits a database. + +It's tempting to simply say "the cloud will scale" to meet demands to process streaming data in real time, but some simple examples show that it can never meet the need for real-time responsiveness to boundless data streams. In these situations—from mobile devices to IoT—a new paradigm is needed. Whereas cloud computing relies on a "store then analyze" big data approach, there is a critical need for software frameworks that are comfortable instantly processing endless, noisy, and voluminous streams of data as they arrive to permit a real-time response, prediction, or insight. + +For example, the city of Palo Alto, Calif. produces more streaming data from its traffic infrastructure per day than the Twitter Firehose. That's a lot of data. Predicting city traffic for consumers like Uber, Lyft, and FedEx requires real-time analysis, learning, and prediction. Event processing in the cloud leads to an inescapable latency of about half a second per event. + +We need a simple yet powerful programming paradigm that lets applications process boundless data streams on the fly in these and similar situations: + + * Data volumes are huge, or moving raw data is expensive. + * Data is generated by widely distributed assets (such as mobile devices). + * Data is of ephemeral value, and analysis can't wait. + * It is critical to always have the latest insight, and extrapolation won't do. + + + +### Publish and subscribe + +A key architectural pattern in the domain of event-driven systems is the concept of pub/sub or publish/subscribe messaging. This is an asynchronous communication method in which messages are delivered from _publishers_ (anything producing data) to *subscribers (*applications that process data). Pub/sub decouples arbitrary numbers of senders from an unknown set of consumers. + +In pub/sub, sources _publish_ events for a _topic_ to a _broker_ that stores them in the order in which they are received. An application _subscribes_ to one or more _topics_, and the _broker_ forwards matching events. Apache Kafka and Pulsar and CNCF NATS are pub/sub systems. Cloud services for pub/sub include Google Pub/Sub, AWS Kinesis, Azure Service Bus, Confluent Cloud, and others. + +Pub/sub systems do not _run_ subscriber applications—they simply _deliver_ data to topic subscribers. + +Streaming data often contains events that are updates to the state of applications or infrastructure. When choosing an architecture to process data, the role of a data-distribution system such as a pub/sub framework is limited. The "how" of the consumer application lies beyond the scope of the pub/sub system. This leaves an enormous amount of complexity for the developer to manage. So-called stream processors are a special kind of subscriber that analyzes data on the fly and delivers results back to the same broker. + +### Apache Spark + +[Apache Spark][2] is a unified analytics engine for large-scale data processing. Often, Apache Spark Streaming is used as a stream processor, for example, to feed machine learning models with new data. Spark Streaming breaks data into mini-batches that are each independently analyzed by a Spark model or some other system. The stream of events is grouped into mini-batches for analysis, but the stream processor itself must be elastic: + + * The stream processor must be capable of scaling with the data rate, even across servers and clouds, and also balance load across instances, ensuring resilience and other application-layer needs. + * It must be able to analyze data from sources that report at widely different rates, meaning it must be stateful—or store state in a database. This latter approach is often used when Spark Streaming is used as the stream processor and can cause performance problems when ultra-low latency responses are needed. + + + +A related project, [Apache Samza][3], offers a way to process real-time event streams, and to scale elastically using [Hadoop Yarn][4] or [Apache Mesos][5] to manage compute resources. + +### Solving the problem of scaling data + +It's important to note that even Samza cannot entirely alleviate data processing demands for the application developer. Scaling data rates mean that tasks to process events need to be load-balanced across many instances, and the only way to share the resulting application-layer state between instances is to use a database. However, the moment state coordination between tasks of an application devolves to a database, there is an inevitable knock-on effect upon performance. Moreover, the choice of database is crucial. As the system scales, cluster management for the database becomes the next potential bottleneck. + +This can be solved with alternative solutions that are stateful, elastic, and can be used in place of a stream processor. At the application level (within each container or instance), these solutions build a stateful model of concurrent, interlinked "web agents" on the fly from streaming updates. Agents are concurrent "nano-services" that consume raw data for a single source and maintain their state. Agents interlink to share state based on real-world relationships between sources found in the data, such as containment and proximity. Agents thus form a graph of concurrent services that can analyze their own state and the states of agents to which they are linked. Each agent provides a nano-service for a single data source that converts from raw data to state and analyzes, learns, and predicts from its own changes and those of its linked subgraph. + +These solutions simplify application architecture by allowing agents—digital twins of real-world sources—to be widely distributed, even while maintaining the distributed graph that interlinks them at the application layer. This is because the links are URLs that map to the current runtime execution instance of the solution and the agent itself. In this way, the application seamlessly scales across instances without DevOps concerns. Agents consume data and maintain state. They also compute over their own state and that of other agents. Because agents are stateful, there is no need for a database, and insights are computed at memory speed. + +### Reading world data with open source + +There is a sea change afoot in the way we view data: Instead of the database being the system of record, the real world is, and digital twins of real-world things can continuously stream their state. Fortunately, the open source community is leading the way with a rich canvas of projects for processing real-time events. From pub/sub, where the most active communities are Apache Kafka, Pulsar, and CNCF NATS, to the analytical frameworks that continually process streamed data, including Apache Spark, [Flink][6], [Beam][7], Samza, and Apache-licensed [SwimOS][8] and [Hazelcast][9], developers have the widest choices of software systems. Specifically, there is no richer set of proprietary software frameworks available. Developers have spoken, and the future of software is open source. + +Introduction to Apache Hadoop, an open source software framework for storage and large scale... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/real-time-data-processing + +作者:[Simon Crosby][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/simon-crosby +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/clocks_time.png?itok=_ID09GDk (Alarm clocks with different time) +[2]: https://spark.apache.org/ +[3]: https://samza.apache.org/ +[4]: https://hadoop.apache.org/ +[5]: http://mesos.apache.org/ +[6]: https://flink.apache.org/ +[7]: https://beam.apache.org +[8]: https://github.com/swimos/swim +[9]: https://hazelcast.com/ From 668e3a1e8b9db7eb73cdcdeaeade068b539de720 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 01:04:54 +0800 Subject: [PATCH 217/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200228=20Revive?= =?UTF-8?q?=20your=20RSS=20feed=20with=20Newsboat=20in=20the=20Linux=20ter?= =?UTF-8?q?minal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200228 Revive your RSS feed with Newsboat in the Linux terminal.md --- ...eed with Newsboat in the Linux terminal.md | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 sources/tech/20200228 Revive your RSS feed with Newsboat in the Linux terminal.md diff --git a/sources/tech/20200228 Revive your RSS feed with Newsboat in the Linux terminal.md b/sources/tech/20200228 Revive your RSS feed with Newsboat in the Linux terminal.md new file mode 100644 index 0000000000..27a8d6ecbd --- /dev/null +++ b/sources/tech/20200228 Revive your RSS feed with Newsboat in the Linux terminal.md @@ -0,0 +1,152 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Revive your RSS feed with Newsboat in the Linux terminal) +[#]: via: (https://opensource.com/article/20/2/newsboat) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +Revive your RSS feed with Newsboat in the Linux terminal +====== +Newsboat is an excellent RSS reader, whether you need a basic set of +features or want your application to do a whole lot more. +![Boat on the ocean with Creative Commons sail][1] + +Psst. Word on the web is that RSS died in 2013. That's when Google pulled the plug on Google Reader. + +Don't believe everything that you hear. RSS is alive. It's well. It's still a great way to choose the information you want to read without algorithms making the decision for you. All you need is the [right feed reader][2]. + +Back in January, Opensource.com Correspondent [Kevin Sonney][3] introduced a nifty terminal RSS reader [called Newsboat][4]. In his article, Kevin scratched Newsboat's surface. I figured it was time to take a deeper dive into what Newsboat can do. + +### Adding RSS feeds to Newsboat + +As Kevin writes, "installing Newsboat is pretty easy since it is included with most distributions (and Homebrew on macOS)." You can, as Kevin also notes, import a [file containing RSS feeds][5] from another reader. If this is your first kick at the RSS can or it's been a while since you've used an RSS reader, chances are you don't have one of those files handy. + +Not to worry. You just need to do some copying and pasting. Go to the folder **.newsboat** in your **/home** directory. Once you're there, open the file **urls** in a text editor. Then, go to the websites you want to read, find the links to their RSS feeds, and copy and paste them into the **urls** file. + +![Newsboat urls file][6] + +Start Newsboat, and you're ready to get reading. + +### Reading your feeds + +As Kevin Sonney points out, you refresh your feeds by pressing the **r** or **R** keys on your keyboard. To read the articles from a feed, press **Enter** to open that feed and scroll down the list. Then, press **Enter** to read an item. + +![Newsboat reading][7] + +Return to the list of articles by pressing **q**. Press **q** again to return to your list of feeds. + +Every so often, you might run into a feed that shows just part of an article. That can be annoying. To get the full article, press **o** to open it in your desktop's default web browser. On my desktop, for example, that's Firefox. You can change the browser Newsboat works with; I'll explain that below. + +### Following links + +Hyperlinking has been a staple of the web since its beginnings at CERN in the early 1990s. It's hard to find an article published online that doesn't contain at least a couple of links that point elsewhere. + +Instead of leaving links embedded in an article or post, Newsboat gathers them into a numbered list at the end of the article or post. + +![Hyperlinks in Newsboat][8] + +To follow a link, press the number beside it. In the screenshot above, you'd press **4** to open the link to the homepage of one of the contributors to that article. The link, as you've probably guessed, opens in your default browser. + +### Using Newsboat as a client for other feed readers + +You might use a web-based feed reader, but might also want to read your RSS feeds in something a bit more minimal on your desktop. Newsboat can do that. + +It works with several feed readers, including The Old Reader, Inoreader, Newsblur, Tiny Tiny RSS, FeedHQ, and the newsreader apps for [ownCloud][9] and [Nextcloud][10]. Before you can read feeds from any of them, you'll need to do a little work. + +Go back to the **.newsboat** folder in your **/home** directory and create a file named **config**. Then add the settings that hook Newsboat into one of the RSS readers it supports. You can find more information about the specific settings for each reader in [Newsboat's documentation][11]. + +Here's an example of the settings I use to connect Newsboat with the newsreader app in my instance of Nextcloud: + + +``` +urls-source "ocnews" +ocnews-url "" +ocnews-login "myUserName" +ocnews-password "NotTellingYouThat!" +``` + +I've tested this with Nextcloud, The Old Reader, Inoreader, and Newsblur. Newsboat worked seamlessly with all of them. + +![Newsboat with The Old Reader][12] + +### Other useful configuration tricks + +You can really unleash Newsboat's power and flexibility by tapping into [its configuration options][13]. That includes changing text colors, the order Newsboat sorts feeds, where it saves articles, the length of time Newsboat keeps articles, and more. + +Below are a few of the options I've added to my configuration file. + +#### Change Newsboat's default browser + +As I mentioned a few paragraphs back, Newsboat opens articles in your default graphical web browser. If you want to read feeds in a [text-only browser][14] like w3m or ELinks, add this to your Newsboat configuration file: + + +``` +`browser "/path/to/browser %u"` +``` + +In my configuration file, I've set w3m up as my browser: + + +``` +`browser "/usr/bin/w3m %u"` +``` + +![Newsboat with w3m][15] + +#### Remove read articles + +I like an uncluttered RSS feed. That means getting rid of articles I've already read. Add this setting to the configuration file to have Newsboat do that automatically: + + +``` +`show-read-feeds  no` +``` + +#### Refresh feeds at launch + +Life gets busy. Sometimes, I go a day or two without checking my RSS feeds. That means having to refresh them after I fire Newsboat up. Sure, I can press **r** or **R**, but why not have the application do it for me? I've added this setting to my configuration file to have Newsboat refresh all of my feeds when I launch it: + + +``` +`refresh-on-startup  yes` +``` + +If you have a lot of feeds, it can take a while to refresh them. I have around 80 feeds, and it takes over a minute to get new content from all of them. + +### Is that everything? + +Not even close. In addition to all of its configuration options, Newsboat also has a number of command-line switches you can use when you fire it up. Read more about them in the [documentation][16]. + +On the surface, Newsboat is simple. But a lot of power and flexibility hides under its hood. That makes Newsboat an excellent RSS reader for anyone who needs a basic set of features or for someone who needs their RSS reader to do a whole lot more. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/newsboat + +作者:[Scott Nesbitt][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/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/CreativeCommons_ideas_520x292_1112JS.png?itok=otei0vKb (Boat on the ocean with Creative Commons sail) +[2]: https://opensource.com/article/17/3/rss-feed-readers +[3]: https://opensource.com/users/ksonney +[4]: https://opensource.com/article/20/1/open-source-rss-feed-reader +[5]: https://en.wikipedia.org/wiki/OPML +[6]: https://opensource.com/sites/default/files/uploads/newsboat-urls-file.png (Newsboat urls file) +[7]: https://opensource.com/sites/default/files/uploads/newsboat-reading.png (Newsboat reading) +[8]: https://opensource.com/sites/default/files/uploads/newsboat-links.png (Hyperlinks in Newsboat) +[9]: https://github.com/owncloudarchive/news +[10]: https://github.com/nextcloud/news +[11]: https://newsboat.org/releases/2.18/docs/newsboat.html#_newsboat_as_a_client_for_newsreading_services +[12]: https://opensource.com/sites/default/files/uploads/newsboat-oldreader.png (Newsboat with The Old Reader) +[13]: https://newsboat.org/releases/2.18/docs/newsboat.html#_example_configuration +[14]: https://opensource.com/article/16/12/web-browsers-linux-command-line +[15]: https://opensource.com/sites/default/files/uploads/newsboat-read-with-w3m.png (Newsboat with w3m) +[16]: https://newsboat.org/releases/2.18/docs/newsboat.html From 326eff472a6031364315642d540e388e846deacb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 01:05:34 +0800 Subject: [PATCH 218/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200228=20Gettin?= =?UTF-8?q?g=20started=20with=20Linux=20firewalls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200228 Getting started with Linux firewalls.md --- ...28 Getting started with Linux firewalls.md | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 sources/tech/20200228 Getting started with Linux firewalls.md diff --git a/sources/tech/20200228 Getting started with Linux firewalls.md b/sources/tech/20200228 Getting started with Linux firewalls.md new file mode 100644 index 0000000000..c77d60b618 --- /dev/null +++ b/sources/tech/20200228 Getting started with Linux firewalls.md @@ -0,0 +1,128 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with Linux firewalls) +[#]: via: (https://opensource.com/article/20/2/firewall-cheat-sheet) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Getting started with Linux firewalls +====== +A firewall is your computer's first line of defense against network +intrusion. Download our cheat sheet to make sure you're secure. +![Cheat Sheet cover image][1] + +A sensible firewall is your computer's first line of defense against network intrusion. When you're at home, you're probably behind a firewall built into the router supplied by your internet service provider. When you're away from home, though, the only firewall you have is the one running on your computer, so it's important to configure and control the firewall on your Linux computer. If you run a Linux server, it's just as important to know how to manage your firewall so that you can protect it from unwanted traffic both locally and remotely. + +### Install a firewall + +Many Linux distributions ship with a firewall already installed, and traditionally that was **iptables**. It is extremely effective and customizable, but it can be complex to configure. Luckily, developers have produced several frontends to help users control their firewall without writing lengthy iptables rules. + +On Fedora, CentOS, Red Hat, and similar distributions, the firewall software installed by default is **firewalld**, which is configured and controlled with the **firewall-cmd** command. On Debian and most other distributions, firewalld is available to install from your software repository. Ubuntu ships with the Uncomplicated Firewall (ufw), so to use firewalld, you must enable the **universe** repository: + + +``` +$ sudo add-apt-repository universe +$ sudo apt install firewalld +``` + +You must also deactivate ufw: + + +``` +`$ sudo systemctl disable ufw` +``` + +There's no reason _not_ to use ufw. It's an excellent firewall frontend. However, this article focuses on firewalld because of its wide availability and integration into systemd, which is shipped with nearly every distribution. + +Regardless of your distribution, for a firewall to be effective, it must be active, and it should be loaded at boot time: + + +``` +`$ sudo systemctl enable --now firewalld` +``` + +### Understanding firewall zones + +Firewalld aims to make firewall configuration as simple as possible. It does this by establishing _zones_. A zone is a set of sensible, common rules that suit the everyday needs of most users. There are nine by default: + + * **trusted:** All network connections are accepted. This is the least paranoid firewall setting and should only be used in a trusted environment, such as a test lab or in a family home where everyone on the local network is known to be friendly. + * **home, work, internal:** In these three zones, most incoming connections are accepted. They each exclude traffic on ports that usually expect no activity. Any of them is a reasonable setting for use in a home setting where there is no reason to expect network traffic to obscure ports, and you generally trust the other users on the network. + * **public:** For use in public areas. This is a paranoid setting, intended for times when you do not trust other computers on the network. Only selected common and mostly safe incoming connections are accepted. + * **dmz:** DMZ stands for demilitarized zone. This zone is intended for computers that are publically accessible, located on an organization's external network with limited access to the internal network. For personal computers, this is usually not a useful zone, but it is an important option for certain types of servers. + * **external:** For use on external networks with masquerading enabled (meaning the addresses of your private network are mapped to and hidden behind a public IP address). Similar to the dmz zone, only selected incoming connections are accepted, including SSH. + * **block:** Only network connections initiated within this system are possible, and all incoming network connections are rejected with an **icmp-host-prohibited** message. This is an extremely paranoid setting and is an important option for certain types of servers or personal computers in an untrusted or hostile environment. + * **drop:** Any and all incoming network packets are dropped with no reply. Only outgoing network connections are possible. The only setting more paranoid than this one is turning off your WiFi and unplugging your Ethernet cable. + + + +You can read about each zone and any other zones defined by your distribution or sysadmin by looking at the configuration files in **/usr/lib/firewalld/zones**. For instance, here's the FedoraWorkstation zone that ships with Fedora 31: + + +``` +$ cat /usr/lib/firewalld/zones/FedoraWorkstation.xml +<?xml version="1.0" encoding="utf-8"?> +<zone> +  <short>Fedora Workstation</short> +  <description>Unsolicited incoming network packets are rejected from port 1 to 1024, except for select network services. Incoming packets that are related to outgoing network connections are accepted. Outgoing network connections are allowed.</description> +  <service name="dhcpv6-client"/> +  <service name="ssh"/> +  <service name="samba-client"/> +  <port protocol="udp" port="1025-65535"/> +  <port protocol="tcp" port="1025-65535"/> +</zone> +``` + +### Getting your current zone + +You can see what zone you're in at any time with the **\--get-active-zones** option: + + +``` +`$ sudo firewall-cmd --get-active-zones` +``` + +In response, you receive the name of the active zone along with the network interface assigned to it. On a laptop, that usually means you have a WiFi card in the default zone: + + +``` +FedoraWorkstation +  interfaces: wlp61s0 +``` + +### Change your current zone + +To change your zone, reassign your network interface to a different zone. For instance, to change the example **wlp61s0** card to the public zone: + + +``` +$ sudo firewall-cmd --change-interface=wlp61s0 \ +\--zone=public +``` + +You can change the active zone for an interface any time you please and for any reason—whether you're going out to a café and feel the need to increase your laptop's security policy, or you're going to work and need to open up some ports to get on the intranet, or for any other reason. The options for **firewall-cmd** auto-complete when you press the **Tab** key, so as long as you remember the keywords "change" and "zone," you can stumble through the command until you learn it by memory. + +### Learn more + +There's a lot more you can do with your firewall, including customizing existing zones, setting a default zone, and more. The more comfortable with firewalls you get, the more secure your online activities are, so we've created a [cheat sheet][2] for quick and easy reference. + +### Download your [firewall cheat sheet][2] + +David Both shares how he replaced his dedicated network firewall computer with a Raspberry Pi 2. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/firewall-cheat-sheet + +作者:[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/coverimage_cheat_sheet.png?itok=lYkNKieP (Cheat Sheet cover image) +[2]: https://opensource.com/downloads/firewall-cmd-cheat-sheet From 51cacd4975666515c89f6873b608ac6eb7499a89 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 01:06:19 +0800 Subject: [PATCH 219/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200228=204=20te?= =?UTF-8?q?chnologists=20on=20careers=20in=20tech=20for=20minorities?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200228 4 technologists on careers in tech for minorities.md --- ...gists on careers in tech for minorities.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20200228 4 technologists on careers in tech for minorities.md diff --git a/sources/tech/20200228 4 technologists on careers in tech for minorities.md b/sources/tech/20200228 4 technologists on careers in tech for minorities.md new file mode 100644 index 0000000000..806300d5db --- /dev/null +++ b/sources/tech/20200228 4 technologists on careers in tech for minorities.md @@ -0,0 +1,126 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 technologists on careers in tech for minorities) +[#]: via: (https://opensource.com/article/20/2/careers-tech-minorities) +[#]: author: (Shilla Saebi https://opensource.com/users/shillasaebi) + +4 technologists on careers in tech for minorities +====== +Learn what Black History Month means to them, what influences their +career, resources for minorities wanting to break into tech, and more. +![Team meeting][1] + +In honor of Black History Month, I've garnered the opinions of a few of my favorite technology professionals and open source contributors. These four individuals are paving the way for the next generation alongside the work they're doing in the technology industry. Learn what Black History Month means to them, what influences their career, resources for minorities wanting to break into tech, and more. + +**[Tameika Reed][2], founder of Women In Linux** + +Since its launch, Tameika leads initiatives with a focus on exploring careers in infrastructure, cybersecurity, DevOps and IoT, pivoting into leadership and continuous skill-building. As a self-taught system administrator, Tameika believes the best way to learn tech is by just diving in. In efforts to give women a 360° view of tech, Tameika hosts a weekly virtual meetup to explore outside the norm of just Linux but introducing hyperledger, Kubernetes, microservices, and high-performance computing. Tameika’s career includes different conference talks from OSCon, LISA 2018, Seagl, HashiCorp EU 2019, and various local events. + +**[Michael Scott Winslow][3], Director, Core Applications and Platforms, Comcast** + +"I'm a father, husband, brother, and son. I come from a small family so I have fun turning friends into an extended family. When I attach my name to something, I obsess over its success, so I am very careful what I agree to be a part of. Oh, so as far as my career I have been involved with software development for decades. I solve problems. I work with others to help solve large problems. I lead, guide and mentor newer software engineers while observing others that I want to learn from." + +**[Bryan Liles][4], senior staff engineer, VMware** + +"I’m working with our team to rethink how developers interact with Kubernetes. When not working, I’m out in the community trying to inspire the next generation of software engineers and building robots." + +**[Mutale Nkonde][5], founding CEO of AI For the People (AFP)** + +AFP is a nonprofit creative agency. Prior to starting a nonprofit she worked in AI Governance. During that time she was part of the team that introduced the Algorithmic and Deep Fakes Algorithmic Acts, as well as the No Biometric Barriers to Housing Act to the US House of Representatives. Nkonde started her career as a broadcast journalist and worked at the BBC, CNN & ABC. She also writes widely on race and tech, as well as holding fellowships at Harvard and Stanford. + +### What influenced you to pursue a career in technology? + +My fear of the computer when I went back to college. I was afraid of the computer because I dropped out of college. After and going back, I made it my mission to learn all I can. This is still my motto to this day, learning never stops. —Tameika Reed + +I won’t mince words, I was a child geek! At 10 years old I started writing GW-BASIC from code that I read in printed magazines. Every single day. I gave it a bit of a break to have a life while I went to high school, but when it came time to pick a major for college, it was an easy choice. I stayed in technology thanks to the amazing mentors and colleagues I’ve had along the way. —Michael Scott Winslow + +I’ve been writing software since I was in middle school. I like being able to tell computers to do things and seeing the results. As an adult, I quickly realized that having a job that gave me satisfaction and paid well was the way to go. —Bryan Liles + +I wanted to explore the questions around why so few black women were being hired by tech companies. —Mutale Nkonde + +### Is there a particular person or people in open source and the tech world who have inspired you? + +I get inspired by a lot of other people and projects. For example, I love seeing others come to [Women In Linux][6] and are sure where they want to go. I try to give people a 360-view of tech so they can make a decision on what they like. Its easy to say I want to be in tech but it’s hard to get started and stay. You don’t have to be just a coder/programmer but you can be a cloud architect. —Tameika Reed + +[Kelsey Hightower][7], [Bryan Liles][4], and Kim Scott inspire me very much. They are so REAL! They say things that I feel and experience every day. Get your job done! Stop complaining! Own your actions and understand how you contribute to your situation! [Gene Kim][8] is a big inspiration as well. As a leader in the DevOps movement, I see myself following and emulating a lot of things he does. —Michael Scott Winslow + +No. I didn’t see the inspiration I wanted, so I’ve worked hard to be the inspiration I needed 20 years ago. —Bryan Liles + +There are so many! One of my favorites is [Dorothy Vaughan][9]: She was the first person in the US to program an IBM Watson computer. Her story is captured in the movie Hidden Figures. —Mutale Nkonde + +### Are there particular resources you would recommend for minorities wanting to break into tech? + +Yes, I recommend finding folks on Twitter and just ask questions. Here is a list of people I follow and admire in tech: —Tameika Reed + + * [@techgirl1908][10] + * [@bryanl][4] + * [@kelseyhightower][7] + * [@kstewart][11] + * [@tiffani][12] + * [@EricaJoy][13] + * [@womeninlinux][6] + * [@ArlanWasHere][14] + * [@blkintechnology][15] + * [@digundiv][16] + + + +Respected bootcamps are really cutting down the time it takes to break into the tech industry. I’ve met several professionals who went through bootcamps who have outshined their 4-year institution counterparts. I think we can really start respecting everything that people bring to the table, rather than technical fluency. —Michael Scott Winslow + +I’m not sure I can recommend anything specific. Tech is a big thing and there isn’t an easy answer. My advice is to pick something you think will be interested in and work to become an expert on the topic. Start asking why instead of how, and also start understanding how things work together. — Bryan Liles + +It really depends on the type of work they want to do. For people working at the intersection of tech and social justice, I would recommend the book [Algorithms of Oppression][17] by Safiya Noble. —Mutale Nkonde + +### What advice would you give to a person of color considering technology as their career? + +I suggest you study your craft. You will be a forever learner. There will always be someone or something in your way how you respond and move will be on you. Never take the first offer push back and know your worth. I look at tech like I look at art. It takes time to develop so be patient with yourself. It's okay to unplug and say no. —Tameika Reed + +As someone who is a bit of a protector of the industry, I don’t want people who are not suited for technology. So really decide if you have the personality for tech. Are you a problem solver? Are you more logical than emotional? Do you constantly find yourself creating processes? If so, no matter your background, I think you can find a home in tech. —Michael Scott Winslow + +It is not going to be simple. Your progress will be slowed because of your race. You will have to work harder. Use this adversity as a strength. You will be better prepared than those around you and when the opportunity arises, you will be able to tackle it. Find a network of those who look like you. Air grievances in private and show strength in public. You belong and you can succeed. —Bryan Liles + +To think beyond working for a company, the field of public interest tech is growing, our work centers on how technology impacts real people. Many of the people leading this work are women of color and Black women are making huge strides. Mutale Nkonde + +### What does Black History Month mean to you? + +It means never stop because you can never forget. —Tameika Reed + +Black History Month to me means focusing on the Tuskegee Airmen and not slavery. Highlighting how we contributed to history and not how were victims of it. I want people to understand where our pride comes from and not our anger. There are a lot of really bad things that happened to our people and we are still right here. Strong! —Michael Scott Winslow + +Black History Month is a time to reflect on the forgotten history of black people in the United States. I take it as a time to be thankful for the sacrifices my ancestors made. —Bryan Liles + +It is a time to center the contributions black people have made across the globe. I love it, it is one of my favorite times of year. —Mutale Nkonde + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/careers-tech-minorities + +作者:[Shilla Saebi][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/shillasaebi +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/meeting-team-listen-communicate.png?itok=KEBP6vZ_ (Team meeting) +[2]: https://www.linkedin.com/in/tameika-reed-1a7290128/ +[3]: https://twitter.com/michaelswinslow +[4]: https://twitter.com/bryanl +[5]: https://twitter.com/mutalenkonde +[6]: https://twitter.com/WomenInLinux +[7]: https://twitter.com/kelseyhightower +[8]: https://twitter.com/RealGeneKim +[9]: https://en.wikipedia.org/wiki/Dorothy_Vaughan +[10]: https://twitter.com/techgirl1908 +[11]: https://twitter.com/kstewart +[12]: https://twitter.com/tiffani +[13]: https://twitter.com/EricaJoy +[14]: https://twitter.com/ArlanWasHere +[15]: https://twitter.com/blkintechnology +[16]: https://twitter.com/digundiv +[17]: http://algorithmsofoppression.com/ From 06f08a2029e56fe85c2b6164e12a9dc205924238 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 01:08:56 +0800 Subject: [PATCH 220/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200228=20Intel?= =?UTF-8?q?=20takes=20aim=20at=20Huawei=205G=20market=20presence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200228 Intel takes aim at Huawei 5G market presence.md --- ... takes aim at Huawei 5G market presence.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 sources/talk/20200228 Intel takes aim at Huawei 5G market presence.md diff --git a/sources/talk/20200228 Intel takes aim at Huawei 5G market presence.md b/sources/talk/20200228 Intel takes aim at Huawei 5G market presence.md new file mode 100644 index 0000000000..22caa3c0f6 --- /dev/null +++ b/sources/talk/20200228 Intel takes aim at Huawei 5G market presence.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Intel takes aim at Huawei 5G market presence) +[#]: via: (https://www.networkworld.com/article/3529354/intel-takes-aim-at-huawei-5g-market-presence.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Intel takes aim at Huawei 5G market presence +====== +Intel has ambitious plans to grab the 5G base station marketplace, which is still in its infancy. +Christopher Hebert/IDG + +Intel on Monday introduced a raft of new processors, and while updates to the Xeon Scalable lineup led the parade, the real news is Intel's efforts to go after the embattled Huawei Technologies in the 5G market. + +Intel unveiled its first ever 5G integrated chip platform, the Atom P5900, for use in base stations. Navin Shenoy, executive vice president and general manager of the data platforms group at Intel, said the product is designed for 5G's high bandwidth and low latency and combines compute, 100Gb performance and acceleration into a single SoC. + +"It delivers a performance punch in packet security throughput, and improved packet balancing throughput versus using software alone," Shenoy said in the video accompanying the announcement. Intel claims the dynamic load balancer native to the Atom P5900 chip is 3.7 times more efficient at packet balancing throughput than software alone. + +Shenoy said Ericsson, Nokia, and ZTE have announced that they will use the Atom P5900 in their base stations. Intel hopes to be the market leader for silicon base station chips by 2021, aiming for 40% of the market and six million 5G base stations by 2024. + +That's pretty aggressive, but the 5G fields are very green and there is plenty of room for growth. Despite all the mobile provider's commercials boasting of 5G availability, the fact is, true 5G phones are only just coming to market now, and the number of base stations is minimal. 5G has a long ramp ahead. + +The Atom P5900 puts Intel in competition with China's Huawei, which U.S. federal authorities have repeatedly labeled a security risk. Huawei has been barred from several nations, including the U.S., England, Japan, and Australia. However, Huawei also said it has secured more than 90 commercial 5G contracts globally. + +Until now, Ericsson and Nokia have asked developers such as Broadcom to help develop base station chips, while Samsung designs and manufactures its own 5G base station chips. + +**[ [Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][1] ]** + +### Second Generation Xeon Scalable processors + +Intel's latest launch also includes 18 2nd Gen Xeon Scalable processors; one is branded Bronze, four are Silver, and 13 are Gold. The upgraded lineup targets the entry-level to medium-range market, leaving the Platinum to duke it out with the high end AMD Epyc processors. + +The new processors range from 8 to 28 cores and include a variety of clock speeds that go down as the core count goes up. They have TDP ratings that range from 85 watts for the eight-core, 1.9Ghz Bronze 3206R to 205 watts for the 28-core, 2.7Ghz Gold 6258R. (Intel and other chip makers measure a processor's power draw with a specification called thermal design power, or TDP.) ** +** + +While most of the chips are meant for standard data center use, some processors – including the Xeon Gold 6200U, Silver 4200R, Sliver 4210T and Bronze 3200R – are specifically meant for single-socket, entry-level servers, as well as edge, networking and IoT uses. + +Intel also introduced the Intel Ethernet 700 Network Adapter, which comes with hardware-enhanced precision timing designed specifically for 5G and other scenarios with very low latency and timing requirements. + +Join the Network World communities on [Facebook][2] and [LinkedIn][3] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3529354/intel-takes-aim-at-huawei-5g-market-presence.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[2]: https://www.facebook.com/NetworkWorld/ +[3]: https://www.linkedin.com/company/network-world From 0ae335104bb7c430b4afec3b44532b1ee6d0a40b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 01:10:25 +0800 Subject: [PATCH 221/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200228=20Conver?= =?UTF-8?q?ting=20between=20uppercase=20and=20lowercase=20on=20the=20Linux?= =?UTF-8?q?=20command=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md --- ...and lowercase on the Linux command line.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md diff --git a/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md b/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md new file mode 100644 index 0000000000..a2819e3ff7 --- /dev/null +++ b/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md @@ -0,0 +1,161 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Converting between uppercase and lowercase on the Linux command line) +[#]: via: (https://www.networkworld.com/article/3529409/converting-between-uppercase-and-lowercase-on-the-linux-command-line.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Converting between uppercase and lowercase on the Linux command line +====== +Converting text between uppercase and lowercase can be very tedious, especially when you want to avoid inadvertent misspellings. Fortunately, Linux provides a handful of commands that can make the job very easy. +[andy.brandon50][1] [(CC BY-SA 2.0)][2] + +There are many ways to change text on the Linux command line from lowercase to uppercase and vice versa. In fact, you have an impressive set of commands to choose from. This post examines some of the best commands for the job and how you can get them to do just what you want. + +### Using tr + +The **tr** (translate) command is one of the easiest to use on the command line or within a script. If you have a string that you want to be sure is in uppercase, you just pass it through a **tr** command like this: + +``` +$ echo Hello There | tr [:lower:] [:upper:] +HELLO THERE +``` + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] + +Below is an example of using this kind of command in a script when you want to be sure that all of the text that is added to a file is in uppercase for consistency: + +``` +#!/bin/bash + +echo -n "Enter department name: " +read dept +echo $dept | tr [:lower:] [:upper:] >> depts +``` + +Switching the order to [:upper:] [:lower:] would have the opposite effect, putting all the department names in lowercase: + +``` +echo $dept | tr [:upper:] [:lower:] >> depts +``` + +Similarly, you could use the **sed** command's **A-Z** and **a-z** strings to accomplish the same thing: + +``` +echo $dept | tr a-z A-Z >> depts +``` + +As you undoubtedly suspect, reversing the order of the a-z and A-Z strings will have the opposite effect, turning the text to all lowercase. + +### Using awk + +The **awk** command lets you do the same thing with its **toupper** and **tolower** options. The command in the script shown in the previous example could be done this way instead: + +[][4] + +``` +echo $dept | awk '{print toupper($0)}' >> depts +``` + +The reverse (switching to lowercase) would look like this: + +``` +echo $dept | awk '{print tolower($0)}' >> depts +``` + +### Using sed + +The **sed** (stream editor) command also does a great job of switching between upper- and lowercase. This command would have the same effect as the first of the two shown above. + +``` +echo $dept | sed 's/[a-z]/\U&/g' >> depts +``` + +Switching from uppercase to lowercase would simply involve replacing the **U** near the end of the line with an **L**. + +``` +echo $dept | sed 's/[A-Z]/\L&/g' >> depts +``` + +### Manipulating text in a file + +Both **awk** and **sed** also allow you to change the case of text for entire files. So, you just found out your boss wanted those department names in all lowercase? No problem. Just run a command like this with the file name provided: + +``` +$ awk '{print tolower($0)}' depts +finance +billing +bookkeeping +``` + +If you want to overwrite the **depts** file, instead of just displaying its contents in lowercase, you would need to do something like this: + +``` +$ awk '{print tolower($0)}' depts > depts- +$ mv depts- depts +``` + +Making the change with **sed**, however, you can avoid that last step because **sed** can edit a file "in place" as shown here, leaving the file intact, but the text in all lowercase: + +``` +$ sed 's/[A-Z]/\L&/g' depts +``` + +### Capitalizing first letters only + +To capitalize only the first letters of words in a string, you can do something like this: + +``` +$ echo design \& engineering| sed -e "s/\b\(.\)/\u\1/g" +Design & Engineering +``` + +That command will ensure that first letters are capitalized, but won't change the rest of the letters. + +### Making sure only first letters are uppercase + +It's a little more challenging when you want to change text so that only first letters are in uppercase. Say you're manipulating a list of staff members' names and you want them to be formatted in the normal Firstname Lastname manner. + +##### with sed + +You could use a considerably more complex **sed** command to ensure this result: + +``` +$ echo design \& ENGINEERING | sed 's/\b\([[:alpha:]]\)\([[:alpha:]]*\)\b/\u\1\L\2/g' +Design & Engineering +``` + +##### with python + +If you have python loaded, you can run a command like this that also formats text so that only the first letters of each word are capitalized and the command may be a little easier to parse than the **sed** command shown above: + +``` +$ echo -n "design & engineering" | python3 -c "import sys; print(sys.stdin.read().title())" +Design & Engineering +``` + +There are many ways to change the formatting of text between upper- and lowercase. Which works best depends in part of whether you're manipulating a single string or an entire file and how you want the end result to look. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3529409/converting-between-uppercase-and-lowercase-on-the-linux-command-line.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.flickr.com/photos/54027476@N07/4999959929 +[2]: https://creativecommons.org/licenses/by-sa/2.0/legalcode +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From dd6a1537e8aa381ddf567afe9929f2a0f321a0a8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 29 Feb 2020 11:47:56 +0800 Subject: [PATCH 222/315] PRF @heguangzhi --- ...sing Python and GNU Octave to plot data.md | 388 ++++-------------- 1 file changed, 90 insertions(+), 298 deletions(-) diff --git a/translated/tech/20200220 Using Python and GNU Octave to plot data.md b/translated/tech/20200220 Using Python and GNU Octave to plot data.md index 0c11406995..f0728a32d4 100644 --- a/translated/tech/20200220 Using Python and GNU Octave to plot data.md +++ b/translated/tech/20200220 Using Python and GNU Octave to plot data.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using Python and GNU Octave to plot data) @@ -10,270 +10,69 @@ 使用 Python 和 GNU Octave 绘制数据 ====== -了解如何使用 Python 和 GNU Octave 完成一项常见的数据科学任务。 -![分析:图表和图形][1] +> 了解如何使用 Python 和 GNU Octave 完成一项常见的数据科学任务。 -数据科学是跨越编程语言的知识领域。有些人以解决这一领域的问题而闻名,而另一些人则鲜为人知。这篇文章将帮助你熟悉用一些流行语言做数据科学。 +![](https://img.linux.net.cn/data/attachment/album/202002/29/114750tr7qykssk90yrvyz.jpg) -### 为数据科学选择 Python 和 GNU Octave +数据科学是跨越编程语言的知识领域。有些语言以解决这一领域的问题而闻名,而另一些则鲜为人知。这篇文章将帮助你熟悉用一些流行的语言完成数据科学的工作。 -我经常尝试学习一种新的编程语言。为什么?这主要是对旧方式的厌倦和对新方式的好奇的结合。当我开始编程时,我唯一知道的语言是 C 语言。那些年的编程生涯既艰难又危险,因为我不得不手动分配内存,管理指针,并记得释放内存。 +### 选择 Python 和 GNU Octave 做数据科学工作 -然后一个朋友建议我试试 Python,现在编程生活变得简单多了。虽然程序运行变得慢多了,但我不必通过编写分析软件来受苦了。然而,我很快就意识到每种语言都有比其他语言更适合自己应用场景。后来我学习了其他一些语言,每种语言都给我带来了一些新的启发。发现新的编程风格让我可以将一些解决方案移植到其他语言中,这样一切都变得有趣多了。 +我经常尝试学习一种新的编程语言。为什么?这既有对旧方式的厌倦,也有对新方式的好奇。当我开始学习编程时,我唯一知道的语言是 C 语言。那些年的编程生涯既艰难又危险,因为我必须手动分配内存、管理指针、并记得释放内存。 -为了对一种新的编程语言(及其文档)有所了解,我总是从编写一些执行我熟悉的任务的示例程序开始。为此,我将解释如何用 Python 和 GNU Octave 编写一个程序来完成一个你可以归类为数据科学的特殊任务。如果你已经熟悉其中一种语言,从中开始,浏览其他语言,寻找相似之处和不同之处。这并不是对编程语言的详尽比较,只是一个小小的展示。 +后来一个朋友建议我试试 Python,现在我的编程生活变得轻松多了。虽然程序运行变得慢多了,但我不必通过编写分析软件来受苦了。然而,我很快就意识到每种语言都有比其它语言更适合自己的应用场景。后来我学习了一些其它语言,每种语言都给我带来了一些新的启发。发现新的编程风格让我可以将一些解决方案移植到其他语言中,这样一切都变得有趣多了。 -所有的程序都应该在[命令行][2]上运行,而不是用[图形用户界面][3](GUI)。完整的例子可以在[多语种知识库][4]中找到。 +为了对一种新的编程语言(及其文档)有所了解,我总是从编写一些执行我熟悉的任务的示例程序开始。为此,我将解释如何用 Python 和 GNU Octave 编写一个程序来完成一个你可以归类为数据科学的特殊任务。如果你已经熟悉其中一种语言,从它开始,然后通过其他语言寻找相似之处和不同之处。这篇文章并不是对编程语言的详尽比较,只是一个小小的展示。 + +所有的程序都应该在[命令行][2]上运行,而不是用[图形用户界面][3](GUI)。完整的例子可以在 [polyglot_fit 存储库][4]中找到。 ### 编程任务 你将在本系列中编写的程序: - * 从[CSV文件][5]中读取数据 - * 用直线插入数据(例如 _f(x)=m ⋅ x + q_) + * 从 [CSV 文件][5]中读取数据 + * 用直线插入数据(例如 `f(x)=m ⋅ x + q`) * 将结果生成图像文件 -这是许多数据科学家遇到的常见情况。示例数据是第一组[Anscombe's quartet][6],如下表所示。这是一组人工构建的数据,当用直线拟合时会给出相同的结果,但是它们的曲线非常不同。数据文件是一个文本文件,以制表符作为列分隔,以几行作为标题。此任务将仅使用第一组(例如:前两列)。 - -I - -II - -III - -IV - -x - -y - -x - -y - -x - -y - -x - -y - -10.0 - -8.04 - -10.0 - -9.14 - -10.0 - -7.46 - -8.0 - -6.58 - -8.0 - -6.95 - -8.0 - -8.14 - -8.0 - -6.77 - -8.0 - -5.76 - -13.0 - -7.58 - -13.0 - -8.74 - -13.0 - -12.74 - -8.0 - -7.71 - -9.0 - -8.81 - -9.0 - -8.77 - -9.0 - -7.11 - -8.0 - -8.84 - -11.0 - -8.33 - -11.0 - -9.26 - -11.0 - -7.81 - -8.0 - -8.47 - -14.0 - -9.96 - -14.0 - -8.10 - -14.0 - -8.84 - -8.0 - -7.04 - -6.0 - -7.24 - -6.0 - -6.13 - -6.0 - -6.08 - -8.0 - -5.25 - -4.0 - -4.26 - -4.0 - -3.10 - -4.0 - -5.39 - -19.0 - -12.50 - -12.0 - -10.84 - -12.0 - -9.13 - -12.0 - -8.15 - -8.0 - -5.56 - -7.0 - -4.82 - -7.0 - -7.26 - -7.0 - -6.42 - -8.0 - -7.91 - -5.0 - -5.68 - -5.0 - -4.74 - -5.0 - -5.73 - -8.0 - -6.89 +这是许多数据科学家遇到的常见情况。示例数据是 [Anscombe 的四重奏][6]的第一组,如下表所示。这是一组人工构建的数据,当用直线拟合时会给出相同的结果,但是它们的曲线非常不同。数据文件是一个文本文件,以制表符作为列分隔符,开头几行作为标题。此任务将仅使用第一组(即前两列)。 ### Python 方式 - -[Python][7]是一种通用编程语言,是当今最流行的语言之一(从[TIOBE index][8]、[RedMonk编程语言排名][9]、[编程语言流行指数][10]、[State of the Octoverse of GitHub][11]和其他来源的调查结果可以看出)。这是一种[解释的语言][12];因此,源代码由执行指令的程序读取和评估。它有一个全面的[标准库][13]并且总体上非常好用(我没有参考这最后一句话;这只是我的拙见)。 +[Python][7] 是一种通用编程语言,是当今最流行的语言之一(依据 [TIOBE 指数][8]、[RedMonk 编程语言排名][9]、[编程语言流行指数][10]、[GitHub Octoverse 状态][11]和其他来源的调查结果)。它是一种[解释型语言][12];因此,源代码由执行该指令的程序读取和评估。它有一个全面的[标准库][13]并且总体上非常好用(我对这最后一句话没有证据;这只是我的拙见)。 #### 安装 -要使用 Python 开发,你需要解释器和一些库。最低要求是: +要使用 Python 开发,你需要解释器和一些库。最低要求是: - * [NumPy][14]用于合适的数组和矩阵操作 - * [SciPy][15]进行数据科学 - * [Matplotlib][16]绘图 +* [NumPy][14] 用于简化数组和矩阵的操作 +* [SciPy][15] 用于数据科学 +* [Matplotlib][16] 用于绘图 在 [Fedora][17] 安装它们是很容易的: - ``` -`sudo dnf install python3 python3-numpy python3-scipy python3-matplotlib` +sudo dnf install python3 python3-numpy python3-scipy python3-matplotlib ``` -#### 注释代码 +#### 代码注释 - -在 Python中,[注释][18]是通过在行首添加一个 **#** 来实现的,该行的其余部分将被解释器丢弃: +在 Python中,[注释][18]是通过在行首添加一个 `#` 来实现的,该行的其余部分将被解释器丢弃: ``` -`# This is a comment ignored by the interpreter.` +# 这是被解释器忽略的注释。 ``` -[fitting_python.py][19]示例使用注释在源代码中插入许可信息,第一行是[特殊注释][20],它允许在命令行上执行脚本: +[fitting_python.py][19] 示例使用注释在源代码中插入许可证信息,第一行是[特殊注释][20],它允许该脚本在命令行上执行: ``` -`#! /usr/bin/env python3` +#!/usr/bin/env python3 ``` -这一行通知命令行解释器,脚本需要由程序**python3**执行。 -#### Required libraries +这一行通知命令行解释器,该脚本需要由程序 `python3` 执行。 -在 Python 中,库和模块可以作为一个对象导入(如示例中的第一行),其中包含库的所有函数和成员。通过使用 **as** 规范可以用于定义标签并重命名它们: +#### 需要的库 + +在 Python 中,库和模块可以作为一个对象导入(如示例中的第一行),其中包含库的所有函数和成员。可以通过使用 `as` 方式用自定义标签重命名它们: ``` import numpy as np @@ -281,11 +80,11 @@ from scipy import stats import matplotlib.pyplot as plt ``` -你也可以决定只导入一个子模块(如第二行和第三行)。语法有两个(或多或少)等效选项: **import module.submodule** 和 **from module import submodule**。 +你也可以决定只导入一个子模块(如第二行和第三行)。语法有两个(基本上)等效的方式:`import module.submodule` 和 `from module import submodule`。 #### 定义变量 -Python 的变量是在第一次赋值时被声明的: +Python 的变量是在第一次赋值时被声明的: ``` input_file_name = "anscombe.csv" @@ -295,48 +94,46 @@ column_x = 0 column_y = 1 ``` -变量类型由分配给变量的值推断。没有常量值的变量,除非它们在模块中声明并且只能被读取。习惯上,不被修改的变量应该用大写字母命名。 +变量类型由分配给变量的值推断。没有具有常量值的变量,除非它们在模块中声明并且只能被读取。习惯上,不应被修改的变量应该用大写字母命名。 #### 打印输出 -通过命令行运行程序意味着输出只能打印在终端上。Python 有[**print()**][21]函数,默认情况下,该函数打印其参数,并在输出的末尾添加一个换行符: +通过命令行运行程序意味着输出只能打印在终端上。Python 有 [print()][21] 函数,默认情况下,该函数打印其参数,并在输出的末尾添加一个换行符: ``` -`print("#### Anscombe's first set with Python ####")` +print("#### Anscombe's first set with Python ####") ``` -在 Python 中,可以将**print()**函数与[字符串类][23]的[格式化能力][22]相结合。字符串具有**format**方法,可用于向字符串本身添加一些格式化文本。例如,可以添加格式化的浮点数,例如: - +在 Python 中,可以将 `print()` 函数与[字符串类][23]的[格式化能力][22]相结合。字符串具有`format` 方法,可用于向字符串本身添加一些格式化文本。例如,可以添加格式化的浮点数,例如: ``` -`print("Slope: {:f}".format(slope))` +print("Slope: {:f}".format(slope)) ``` #### 读取数据 -使用 NumPy 和 函数[**genfromtxt()**][24]读取CSV文件非常容易,该函数生成[NumPy数组][25]: - +使用 NumPy 和函数 [genfromtxt()][24] 读取 CSV 文件非常容易,该函数生成 [NumPy 数组][25]: ``` -`data = np.genfromtxt(input_file_name, delimiter = delimiter, skip_header = skip_header)` +data = np.genfromtxt(input_file_name, delimiter = delimiter, skip_header = skip_header) ``` -在 Python中,一个函数可以有可变数量的参数,您可以通过指定所需的参数来让它传递一个子集。数组是非常强大的矩阵状对象,可以很容易地分割成更小的数组: +在 Python 中,一个函数可以有数量可变的参数,你可以通过指定所需的参数来传递一个参数的子集。数组是非常强大的矩阵状对象,可以很容易地分割成更小的数组: ``` x = data[:, column_x] y = data[:, column_y] ``` -冒号选择整个范围,也可以用来选择子范围。例如,要选择数组的前两行,可以使用: +冒号选择整个范围,也可以用来选择子范围。例如,要选择数组的前两行,可以使用: ``` -`first_two_rows = data[0:1, :]` +first_two_rows = data[0:1, :] ``` #### 拟合数据 -SciPy提供了方便的数据拟合功能,例如[**linregress()**][26]功能。该函数提供了一些与拟合相关的重要值,如斜率、截距和两个数据集的相关系数: +SciPy 提供了方便的数据拟合功能,例如 [linregress()][26] 功能。该函数提供了一些与拟合相关的重要值,如斜率、截距和两个数据集的相关系数: ``` slope, intercept, r_value, p_value, std_err = stats.linregress(x, y) @@ -346,25 +143,25 @@ print("Intercept: {:f}".format(intercept)) print("Correlation coefficient: {:f}".format(r_value)) ``` -因为**linregress()**提供了几条信息,所以结果可以同时保存到几个变量中。 +因为 `linregress()` 提供了几条信息,所以结果可以同时保存到几个变量中。 #### 绘图 -Matplotlib 库仅仅绘制数据点,因此,你应该定义要绘制的点的坐标。已经定义了**x** 和 **y** 数组,所以你可以直接绘制它们,但是你还需要代表直线的数据点。 +Matplotlib 库仅仅绘制数据点,因此,你应该定义要绘制的点的坐标。已经定义了 `x` 和 `y` 数组,所以你可以直接绘制它们,但是你还需要代表直线的数据点。 ``` -`fit_x = np.linspace(x.min() - 1, x.max() + 1, 100)` +fit_x = np.linspace(x.min() - 1, x.max() + 1, 100) ``` -[**linspace()**][27]函数可以方便地在两个值之间生成一组等距值。利用强大的 NumPy 数组可以轻松计算纵坐标,该数组可以像普通数值变量一样在公式中使用: +[linspace()][27] 函数可以方便地在两个值之间生成一组等距值。利用强大的 NumPy 数组可以轻松计算纵坐标,该数组可以像普通数值变量一样在公式中使用: ``` -`fit_y = slope * fit_x + intercept` +fit_y = slope * fit_x + intercept ``` -公式在数组中逐元素应用;因此,结果在初始数组中具有相同数量的条目。 +该公式在数组中逐元素应用;因此,结果在初始数组中具有相同数量的条目。 -要绘图,首先,定义一个包含所有图形的[图形对象][28]: +要绘图,首先,定义一个包含所有图形的[图形对象][28]: ``` fig_width = 7 #inch @@ -374,7 +171,7 @@ fig_dpi = 100 fig = plt.figure(figsize = (fig_width, fig_height), dpi = fig_dpi) ``` -一个图形可以画几个图;在 Matplotlib 中,这些图块被称为[轴][29]。本示例定义一个单轴对象来绘制数据点: +一个图形可以画几个图;在 Matplotlib 中,这些图被称为[轴][29]。本示例定义一个单轴对象来绘制数据点: ``` ax = fig.add_subplot(111) @@ -389,26 +186,25 @@ ax.set_xlabel('x') ax.set_ylabel('y') ``` -将该图保存到[PNG image file][30]中,有: +将该图保存到 [PNG 图形文件][30]中,有: ``` -`fig.savefig('fit_python.png')` +fig.savefig('fit_python.png') ``` -如果要显示(而不是保存)绘图,请调用: - +如果要显示(而不是保存)该绘图,请调用: ``` -`plt.show()` +plt.show() ``` -此示例引用了绘图部分中使用的所有对象:它定义了对象 **fig** 和对象 **ax**。这种技术细节是不必要的,因为 **plt** 对象可以直接用于绘制数据集。《[Matplotlib 教程][31]展示了这样一个界面: +此示例引用了绘图部分中使用的所有对象:它定义了对象 `fig` 和对象 `ax`。这在技术上是不必要的,因为 `plt` 对象可以直接用于绘制数据集。《[Matplotlib 教程][31]》展示了这样一个接口: ``` -`plt.plot(fit_x, fit_y)` +plt.plot(fit_x, fit_y) ``` -坦率地说,我不喜欢这种方法,因为它隐藏了各种对象之间发生的重要的的交互。不幸的是,有时[官方的例子][32]有点令人困惑,因为他们倾向于使用不同的方法。在这个简单的例子中,引用图形对象是不必要的,但是在更复杂的例子中(例如在图形用户界面中嵌入图形时),引用图形对象就变得很重要了。 +坦率地说,我不喜欢这种方法,因为它隐藏了各种对象之间发生的重要交互。不幸的是,有时[官方的例子][32]有点令人困惑,因为他们倾向于使用不同的方法。在这个简单的例子中,引用图形对象是不必要的,但是在更复杂的例子中(例如在图形用户界面中嵌入图形时),引用图形对象就变得很重要了。 #### 结果 @@ -427,27 +223,27 @@ Correlation coefficient: 0.816421 ### GNU Octave 方式 -[GNU Octave][34]语言主要用于数值计算。它提供了一个简单的操作向量和矩阵的语法,并且有一些强大的绘图工具。这是一种像 Python 一样的解释语言。由于 Octave的语法是[最兼容][35] [MATLAB][36],它经常被描述为一个免费的替代 MATLAB 的方案。Octave 没有被列为最流行的编程语言,但是 MATLAB 是,所以 Octave 在某种意义上是相当流行的。MATLAB 早于 NumPy,我觉得它是受到了前者的启发。当你看这个例子时,你会看到相似之处。 +[GNU Octave][34] 语言主要用于数值计算。它提供了一个简单的操作向量和矩阵的语法,并且有一些强大的绘图工具。这是一种像 Python 一样的解释语言。由于 Octave 的语法[几乎兼容][35] [MATLAB][36],它经常被描述为一个替代 MATLAB 的免费方案。Octave 没有被列为最流行的编程语言,而 MATLAB 则是,所以 Octave 在某种意义上是相当流行的。MATLAB 早于 NumPy,我觉得它是受到了前者的启发。当你看这个例子时,你会看到相似之处。 #### 安装 -[fitting_octave.m][37]的例子只需要基本的 Octave 包,在 Fedora 中安装相当简单: +[fitting_octave.m][37] 的例子只需要基本的 Octave 包,在 Fedora 中安装相当简单: ``` -`sudo dnf install octave` +sudo dnf install octave ``` -#### 注释代码 +#### 代码注释 -在Octave中,你可以用百分比符号(**%**)为代码添加注释,如果不需要与 MATLAB 兼容,你也可以使用 **#**。使用 **#** 的选项允许你从 Python 示例中编写相同的特殊注释行,以便直接在命令行上执行脚本。 +在 Octave 中,你可以用百分比符号(``%`)为代码添加注释,如果不需要与 MATLAB 兼容,你也可以使用 `#`。使用 `#` 的选项允许你编写像 Python 示例一样的特殊注释行,以便直接在命令行上执行脚本。 #### 必要的库 -本例中使用的所有内容都包含在基本包中,因此你不需要加载任何新的库。如果你需要一个库,[语法][38]是 **pkg load module**。该命令将模块的功能添加到可用功能列表中。在这方面,Python 具有更大的灵活性。 +本例中使用的所有内容都包含在基本包中,因此你不需要加载任何新的库。如果你需要一个库,[语法][38]是 `pkg load module`。该命令将模块的功能添加到可用功能列表中。在这方面,Python 具有更大的灵活性。 #### 定义变量 -变量的定义与 Python 的语法基本相同: +变量的定义与 Python 的语法基本相同: ``` input_file_name = "anscombe.csv"; @@ -457,46 +253,45 @@ column_x = 1; column_y = 2; ``` -请注意,行尾有一个分号;这不是必需的,但是它会抑制行结果的输出。如果没有分号,解释器将打印表达式的结果: +请注意,行尾有一个分号;这不是必需的,但是它会抑制该行结果的输出。如果没有分号,解释器将打印表达式的结果: ``` -octave:1> input_file_name = "anscombe.csv" +octave:1> input_file_name = "anscombe.csv" input_file_name = anscombe.csv -octave:2> sqrt(2) -ans =  1.4142 +octave:2> sqrt(2) +ans = 1.4142 ``` #### 打印输出结果 -强大的功能[**printf()**][39]是用来在终端上打印的。与 Python 不同,**printf()** 函数不会自动在打印字符串的末尾添加换行,因此你必须添加它。第一个参数是一个字符串,可以包含要传递给函数的其他参数的格式信息,例如: +强大的函数 [printf()][39] 是用来在终端上打印的。与 Python 不同,`printf()` 函数不会自动在打印字符串的末尾添加换行,因此你必须添加它。第一个参数是一个字符串,可以包含要传递给函数的其他参数的格式信息,例如: ``` -`printf("Slope: %f\n", slope);` +printf("Slope: %f\n", slope); ``` -在 Python 中,格式是内置在字符串本身中的,但是在 Octave 中,它是特定于 **printf()** 函数。 +在 Python 中,格式是内置在字符串本身中的,但是在 Octave 中,它是特定于 `printf()` 函数。 #### 读取数据 -[**dlmread()**][40]函数可以读取类似CSV文件的文本内容: +[dlmread()][40] 函数可以读取类似 CSV 文件的文本内容: ``` -`data = dlmread(input_file_name, delimiter, skip_header, 0);` +data = dlmread(input_file_name, delimiter, skip_header, 0); ``` -结果是一个[矩阵][41]对象,这是 Octave 中的基本数据类型之一。矩阵可以用类似于 Python 的语法进行切片: +结果是一个[矩阵][41]对象,这是 Octave 中的基本数据类型之一。矩阵可以用类似于 Python 的语法进行切片: ``` x = data(:, column_x); y = data(:, column_y); ``` -根本的区别是索引从1开始,而不是从0开始。因此,在该示例中,__x__列是第一列。 +根本的区别是索引从 1 开始,而不是从 0 开始。因此,在该示例中,`x` 列是第一列。 #### 拟合数据 -要用直线拟合数据,可以使用[**polyfit()**][42]函数。它用一个多项式拟合输入数据,所以你只需要使用一阶多项式: - +要用直线拟合数据,可以使用 [polyfit()][42] 函数。它用一个多项式拟合输入数据,所以你只需要使用一阶多项式: ``` p = polyfit(x, y, 1); @@ -505,14 +300,13 @@ slope = p(1); intercept = p(2); ``` -结果是具有多项式系数的矩阵;因此,它选择前两个索引。要确定相关系数,请使用[**corr()**][43]函数: - +结果是具有多项式系数的矩阵;因此,它选择前两个索引。要确定相关系数,请使用 [corr()][43] 函数: ``` -`r_value = corr(x, y);` +r_value = corr(x, y); ``` -最后,使用 **printf()** 函数打印结果: +最后,使用 `printf()` 函数打印结果: ``` printf("Slope: %f\n", slope); @@ -529,9 +323,9 @@ fit_x = linspace(min(x) - 1, max(x) + 1, 100); fit_y = slope * fit_x + intercept; ``` -与 NumPy 的相似性也很明显,因为它使用了[**linspace()**][44]函数,其行为就像 Python 的等效版本一样。 +与 NumPy 的相似性也很明显,因为它使用了 [linspace()][44] 函数,其行为就像 Python 的等效版本一样。 -同样,与 Matplotlib 一样,首先创建一个[图][45]对象,然后创建一个[轴][46]对象来保存这些图: +同样,与 Matplotlib 一样,首先创建一个[图][45]对象,然后创建一个[轴][46]对象来保存这些图: ``` fig_width = 7; %inch @@ -547,8 +341,7 @@ set(ax, "fontsize", 14); set(ax, "linewidth", 2); ``` - -要设置轴对象的属性,请使用[**set()**][47]函数。然而,该接口相当混乱,因为该函数需要一个逗号分隔的属性和值对列表。这些对只是代表属性名的一个字符串和代表该属性值的第二个对象的连续。还有其他设置各种属性的功能: +要设置轴对象的属性,请使用 [set()][47] 函数。然而,该接口相当混乱,因为该函数需要一个逗号分隔的属性和值对列表。这些对只是代表属性名的一个字符串和代表该属性值的第二个对象的连续。还有其他设置各种属性的函数: ``` xlim(ax, [min(x) - 1, max(x) + 1]); @@ -557,8 +350,7 @@ xlabel(ax, 'x'); ylabel(ax, 'y'); ``` -标图是用[**plot()**][48]功能实现的。默认行为是每次调用都会重置坐标轴,因此需要使用函数[**hold()**][49]。 - +绘图是用 [plot()][48] 功能实现的。默认行为是每次调用都会重置坐标轴,因此需要使用函数 [hold()][49]。 ``` hold(ax, "on"); @@ -575,14 +367,14 @@ plot(ax, x, y, hold(ax, "off"); ``` -此外,还可以在 **plot()** 函数中添加属性和值对。[legend][50]必须单独创建,标签应手动声明: +此外,还可以在 `plot()` 函数中添加属性和值对。[legend][50] 必须单独创建,标签应手动声明: ``` lg = legend(ax, "Fit", "Data"); set(lg, "location", "northwest"); ``` -最后,将输出保存到PNG图像: +最后,将输出保存到 PNG 图像: ``` image_size = sprintf("-S%f,%f", fig_width * fig_dpi, fig_height * fig_dpi); @@ -594,13 +386,13 @@ print(fig, 'fit_octave.png',       image_resolution); ``` -令人困惑的是,在这种情况下,选项被作为一个字符串传递,带有属性名和值。因为在 Octave 字符串中没有 Python 的格式化工具,所以必须使用[**sprintf()**][51]函数。它的行为就像**printf()**函数,但是它的结果不是打印出来的,而是作为字符串返回的。 +令人困惑的是,在这种情况下,选项被作为一个字符串传递,带有属性名和值。因为在 Octave 字符串中没有 Python 的格式化工具,所以必须使用 [sprintf()][51] 函数。它的行为就像 `printf()` 函数,但是它的结果不是打印出来的,而是作为字符串返回的。 -在这个例子中,就像在 Python 中一样,图形对象很明显被引用以保持它们之间的交互。如果说 Python 在这方面的文档有点混乱,那么[Octave 的文档][52]就更糟糕了。我发现的大多数例子都不关心引用对象;相反,它们依赖于绘图命令作用于当前活动图形。全局[根图形对象][53]跟踪现有的图形和轴。 +在这个例子中,就像在 Python 中一样,图形对象很明显被引用以保持它们之间的交互。如果说 Python 在这方面的文档有点混乱,那么 [Octave 的文档][52]就更糟糕了。我发现的大多数例子都不关心引用对象;相反,它们依赖于绘图命令作用于当前活动图形。全局[根图形对象][53]跟踪现有的图形和轴。 #### 结果 -命令行上的结果输出是: +命令行上的结果输出是: ``` #### Anscombe's first set with Octave #### @@ -613,9 +405,9 @@ Correlation coefficient: 0.816421 ![Plot and fit of the dataset obtained with Octave][54] -### 下一个 +###接下来 -Python 和 GNU Octave 都可以绘制出相同的信息,尽管它们的实现方式不同。如果你想探索其他语言来完成类似的任务,我强烈建议你看看[Rosetta 代码][55]。这是一个了不起的资源,可以看到如何用多种语言解决同样的问题。 +Python 和 GNU Octave 都可以绘制出相同的信息,尽管它们的实现方式不同。如果你想探索其他语言来完成类似的任务,我强烈建议你看看 [Rosetta Code][55]。这是一个了不起的资源,可以看到如何用多种语言解决同样的问题。 你喜欢用什么语言绘制数据?在评论中分享你的想法。 @@ -626,7 +418,7 @@ via: https://opensource.com/article/20/2/python-gnu-octave-data-science 作者:[Cristiano L. Fontana][a] 选题:[lujun9972][b] 译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 51190970f87ace21c1516d08ad4baa24ae394979 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 29 Feb 2020 11:48:25 +0800 Subject: [PATCH 223/315] PUB @heguangzhi https://linux.cn/article-11943-1.html --- .../20200220 Using Python and GNU Octave to plot data.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200220 Using Python and GNU Octave to plot data.md (99%) diff --git a/translated/tech/20200220 Using Python and GNU Octave to plot data.md b/published/20200220 Using Python and GNU Octave to plot data.md similarity index 99% rename from translated/tech/20200220 Using Python and GNU Octave to plot data.md rename to published/20200220 Using Python and GNU Octave to plot data.md index f0728a32d4..f2f773d67e 100644 --- a/translated/tech/20200220 Using Python and GNU Octave to plot data.md +++ b/published/20200220 Using Python and GNU Octave to plot data.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11943-1.html) [#]: subject: (Using Python and GNU Octave to plot data) [#]: via: (https://opensource.com/article/20/2/python-gnu-octave-data-science) [#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) From 86e28a40ab3652b66b0d68e84bd31e7220c105d1 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 29 Feb 2020 12:19:28 +0800 Subject: [PATCH 224/315] Rename sources/tech/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md to sources/talk/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md --- .../20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md (100%) diff --git a/sources/tech/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md b/sources/talk/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md similarity index 100% rename from sources/tech/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md rename to sources/talk/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md From eb022d4afda3b7be570ce9ef6721ca3fff0db9d0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 29 Feb 2020 12:29:09 +0800 Subject: [PATCH 225/315] PRF --- .../20200220 Using Python and GNU Octave to plot data.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/published/20200220 Using Python and GNU Octave to plot data.md b/published/20200220 Using Python and GNU Octave to plot data.md index f2f773d67e..5f2b7dba66 100644 --- a/published/20200220 Using Python and GNU Octave to plot data.md +++ b/published/20200220 Using Python and GNU Octave to plot data.md @@ -36,6 +36,8 @@ 这是许多数据科学家遇到的常见情况。示例数据是 [Anscombe 的四重奏][6]的第一组,如下表所示。这是一组人工构建的数据,当用直线拟合时会给出相同的结果,但是它们的曲线非常不同。数据文件是一个文本文件,以制表符作为列分隔符,开头几行作为标题。此任务将仅使用第一组(即前两列)。 +![](https://img.linux.net.cn/data/attachment/album/202002/29/122805h3yrs1dkrgysssxk.png) + ### Python 方式 [Python][7] 是一种通用编程语言,是当今最流行的语言之一(依据 [TIOBE 指数][8]、[RedMonk 编程语言排名][9]、[编程语言流行指数][10]、[GitHub Octoverse 状态][11]和其他来源的调查结果)。它是一种[解释型语言][12];因此,源代码由执行该指令的程序读取和评估。它有一个全面的[标准库][13]并且总体上非常好用(我对这最后一句话没有证据;这只是我的拙见)。 @@ -235,7 +237,7 @@ sudo dnf install octave #### 代码注释 -在 Octave 中,你可以用百分比符号(``%`)为代码添加注释,如果不需要与 MATLAB 兼容,你也可以使用 `#`。使用 `#` 的选项允许你编写像 Python 示例一样的特殊注释行,以便直接在命令行上执行脚本。 +在 Octave 中,你可以用百分比符号(`%`)为代码添加注释,如果不需要与 MATLAB 兼容,你也可以使用 `#`。使用 `#` 的选项允许你编写像 Python 示例一样的特殊注释行,以便直接在命令行上执行脚本。 #### 必要的库 From 36acc8122a1f524e3a7d69d373686804504b8525 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 29 Feb 2020 12:31:33 +0800 Subject: [PATCH 226/315] Rename sources/tech/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md to sources/talk/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md --- ...rs the Game Dev Business With a New Open Source Game Engine.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md (100%) diff --git a/sources/tech/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md b/sources/talk/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md similarity index 100% rename from sources/tech/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md rename to sources/talk/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md From e35b0a7bb23ccfc3130b7067cef0771185db2d2b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 29 Feb 2020 12:50:29 +0800 Subject: [PATCH 227/315] PRF @geekpi --- ... to use byobu to multiplex SSH sessions.md | 51 ++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md b/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md index 9c871b4840..220223b8ac 100644 --- a/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md +++ b/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to use byobu to multiplex SSH sessions) @@ -9,52 +9,55 @@ 如何使用 byobu 复用 SSH 会话 ====== -Byobu 能让你在保持会话活跃的情况下维护多个终端窗口、通过 SSH 连接、断开、重连以及共享访问。 + +> Byobu 能让你在保持会话活跃的情况下维护多个终端窗口,通过 SSH 连接、断开、重连以及共享访问。 + ![Person drinking a hat drink at the computer][1] -[Byobu][2] 是基于文本的窗口管理器和终端多路复用器。它类似于 [GNU Screen][3],但更现代,更直观。它还适用于大多数 Linux、BSD 和 Mac 发行版。 +[Byobu][2] 是基于文本的窗口管理器和终端多路复用器。它类似于 [GNU Screen][3],但更现代、更直观。它还适用于大多数 Linux、BSD 和 Mac 发行版。 -Byobu 能让你在保持会话活跃的情况下维护多个终端窗口、通过 SSH (secure shell)连接、断开、重连,甚至让其他人访问。 +Byobu 能让你在保持会话活跃的情况下维护多个终端窗口、通过 SSH(secure shell)连接、断开、重连,甚至让其他人访问。 -比如,你 SSH 进入树莓派或服务器,并运行(比如) **sudo apt update && sudo apt upgrade**,然后你在它运行的时候失去了互联网连接,你的命令会丢失无效。然而,如果你首先启动 byobu 会话,那么它会继续运行,在你重连后,你会发现它仍在继续运行。 +比如,你 SSH 进入树莓派或服务器,并运行(比如) `sudo apt update && sudo apt upgrade`,然后你在它运行的时候失去了互联网连接,你的命令会丢失无效。然而,如果你首先启动 byobu 会话,那么它会继续运行,在你重连后,你会发现它仍在继续运行。 ![The byobu logo is a fun play on screens.][4] -Byobu 的日语术语是指装饰性多面板屏风,可作为折叠式隔断,我认为这很合适。 +Byobu 名称来自于日语的装饰性多面板屏风,它可作为折叠式隔断,我认为这很合适。 要在 Debian/Raspbian/Ubuntu 上安装 byobu: -**sudo apt install byobu** +``` +sudo apt install byobu +``` -接着启用它 +接着启用它: -**byobu-enable** +``` +byobu-enable +``` -现在,请退出 SSH 会话并重新登录,你将会在 byobu 会话中登录。运行类似 **sudo apt update** 命令并关闭窗口(或输入转义序列([**Enter**+**~**+**.**][5])并重新登录。你将看到更新在你离开后还在运行。 +现在,请退出 SSH 会话并重新登录,你将会在 byobu 会话中登录。运行类似 `sudo apt update` 命令并关闭窗口(或输入转义序列([Enter + ~ + .][5])并重新登录。你将看到更新命令在你离开后还在运行。 -有_很多_我不常使用的功能。我通常使用的是: - - * **F2** – 新窗口 - * **F3/F4** – 在窗口间导航 - * **Ctrl**+**F2** – 垂直拆分窗格 - * **Shift**+**F2** – 水平拆分窗格 - * **Shift**+**左箭头/Shift**+**右箭头** – 在拆分窗格间导航 - * **Shift**+**F11** – 放大(或缩小)拆分窗格 +有*很多*我不常使用的功能。我通常使用的是: + * `F2` – 新窗口 + * `F3/F4` – 在窗口间导航 + * `Ctrl`+`F2` – 垂直拆分窗格 + * `Shift`+`F2` – 水平拆分窗格 + * `Shift`+`左箭头/Shift`+`右箭头` – 在拆分窗格间导航 + * `Shift`+`F11` – 放大(或缩小)拆分窗格 ### 我们如何使用 byobu -Byobu 对于 [piwheels][6](一个用于树莓派的方便的,预编译 Python 包)的维护很方便。我门水平拆分了窗格,在上半部分显示了 piwheels 监视器,在下半部分实时显示了 syslog 条目。接着,如果我们想要做其他事情,我们可以切换到另外一个窗口。当我们进行协作调查时,这特别方便,因为当我在 IRC 中聊天时,我可以看到我的同事 Dave 输入了什么(并纠正他的错字)。 +Byobu 对于维护 [piwheels][6](一个用于树莓派的方便的,预编译 Python 包)很好用。我水平拆分了窗格,在上半部分显示了 piwheels 监视器,在下半部分实时显示了 syslog 条目。接着,如果我们想要做其他事情,我们可以切换到另外一个窗口。当我们进行协作分析时,这特别方便,因为当我在 IRC 中聊天时,我可以看到我的同事 Dave 输入了什么(并纠正他的错字)。 我在家庭和办公服务器上启用了 byobu,因此,当我登录到任何一台计算机时,一切都与我离开时一样。它正在运行多个作业、在特定目录中保留一个窗口,以另一个用户身份运行进程等。 ![byobu screenshot][7] -Byobu 也很方便用于在树莓派上进行开发。你可以在桌面上启动它,运行命令,然后 SSH 进入,并连接到该命令运行所在的会话。请注意,启用 byobu 不会更改终端启动器的功能。只需运行 **byobu** 即可启动它。 +Byobu 对于在树莓派上进行开发也很方便。你可以在桌面上启动它,运行命令,然后 SSH 进入,并连接到该命令运行所在的会话。请注意,启用 byobu 不会更改终端启动器的功能。只需运行 `byobu` 即可启动它。 -* * * - -_本文最初发表在 Ben Nuttall 的 [Tooling blog][8] 中,并获许重用_ +本文最初发表在 Ben Nuttall 的 [Tooling blog][8] 中,并获许重用。 -------------------------------------------------------------------------------- @@ -63,7 +66,7 @@ via: https://opensource.com/article/20/2/byobu-ssh 作者:[Ben Nuttall][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/) 荣誉推出 From 16b0bee0a9e0fc0ec81bb17196196c14596b4f44 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 29 Feb 2020 12:51:39 +0800 Subject: [PATCH 228/315] PUB @geekpi https://linux.cn/article-11944-1.html --- .../20200212 How to use byobu to multiplex SSH sessions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200212 How to use byobu to multiplex SSH sessions.md (98%) diff --git a/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md b/published/20200212 How to use byobu to multiplex SSH sessions.md similarity index 98% rename from translated/tech/20200212 How to use byobu to multiplex SSH sessions.md rename to published/20200212 How to use byobu to multiplex SSH sessions.md index 220223b8ac..061ca4c41a 100644 --- a/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md +++ b/published/20200212 How to use byobu to multiplex SSH sessions.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11944-1.html) [#]: subject: (How to use byobu to multiplex SSH sessions) [#]: via: (https://opensource.com/article/20/2/byobu-ssh) [#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) From 627e8617369fe7b7eafc72c2bb964f9603451574 Mon Sep 17 00:00:00 2001 From: hj24 Date: Sat, 29 Feb 2020 23:21:19 +0800 Subject: [PATCH 229/315] translating by hj24 --- .../20190702 One CI-CD pipeline per product to rule them all.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190702 One CI-CD pipeline per product to rule them all.md b/sources/tech/20190702 One CI-CD pipeline per product to rule them all.md index 2a7fcb31de..0fd04ee54a 100644 --- a/sources/tech/20190702 One CI-CD pipeline per product to rule them all.md +++ b/sources/tech/20190702 One CI-CD pipeline per product to rule them all.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (hj24) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b727c5df8020aa2589fefa0c525ccae3ea7d5412 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 1 Mar 2020 01:01:31 +0800 Subject: [PATCH 230/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200301=20Rememb?= =?UTF-8?q?er=20Unity8=20from=20Ubuntu=3F=20UBports=20is=20Renaming=20it?= =?UTF-8?q?=20to=20Lomiri?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md --- ...buntu- UBports is Renaming it to Lomiri.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md diff --git a/sources/tech/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md b/sources/tech/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md new file mode 100644 index 0000000000..7badbfc8a2 --- /dev/null +++ b/sources/tech/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Remember Unity8 from Ubuntu? UBports is Renaming it to Lomiri) +[#]: via: (https://itsfoss.com/unity8-lomiri/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Remember Unity8 from Ubuntu? UBports is Renaming it to Lomiri +====== + +Ever since Ubuntu abandoned the Unity project, UBports continued the maintenance and development of Unity. On February 27th 2020, [UBports][1] announced that they are giving Unity8 a new branding in the form of Lomiri. + +### Unity8 is now Lomiri + +![Unity8 in action | Image Credit: UBports][2] + +[UBports announced][3] that the Unity8 desktop environment would be renamed as Lomiri. They gave three reasons for this fairly drastic announcement. + +First, they want to avoid confusion with the [Unity game engine][4]. Quite a few people confused the two. UBports noted that they are frequently receiving questions regarding “how to import 3D models and meshes into our shell”. When you search “Unity” in your favorite search engine, most of the top links are for the game engine. + +The second reason for the name change has to do with the new effort to package Unity8 for Debian. Unfortunately, many of the Unity8’s dependencies have Ubuntu in the name, for example, _**ubuntu-ui-toolkit**_. Debian packagers warned that packages that have Ubuntu in the name may not be accepted into [Debian][5]. + +Finally, UBports said the name change would improve verbal communications. Saying Unity8 repeatedly can be a mouthful. People would not have to worry about confusing “users of Ubuntu Unity and Unity (the game engine)”. + +UBports went on to stress that the name change was not “triggered by any action from Canonical or the Ubuntu community, legal or otherwise”. + +They noted that this name change was the perfect time for them to switch to [GitHub alternative GitLab][6] for their development. + +Interestingly, the announcement did not explain how they picked Lomiri as the new name. All they said is that “We went through many different names before settling on Lomiri. All of them had problems with pronunciation, availability, or other related issues.” + +UBports noted that most Ubuntu Touch users would be unaffected by the name change. Developers and power users might notice some changes, but UBports “will strive to maintain backwards compatibility within Ubuntu Touch for the foreseeable future”. + +### What Exactly is Being Renamed? + +![][7] + +According to the announcement, packages that have either Ubuntu or Unity in the title will be affected. For example, + + * **unity8**, containing the shell, will become **lomiri** + * **ubuntu-ui-toolkit** will become **lomiri-ui-toolkit** + * **ubuntu-download-manager** will become **lomiri-download-manager** + + + +On top of this, interfaces call will change, as well. “For example, the **Ubuntu.Components** QML import will change to **Lomiri.Components**.” For the sake of backwards compatibility, Ubuntu Touch images will not change too much. “Developers will only need to update to the new API when they’d like to package their apps for other distributions.” + +### What Will Stay the Same? + +Since renaming packages can cause quite a few cascading problems, UBports wants to limit the number of packages they change. They don’t expect the following things to change. + + * Packages that don’t use the “Ubuntu” or “Unity” names + * Ubuntu Touch will remain the same + * Any components which are already used by other projects and accepted into other distributions + + + +### Final Thoughts + +![][8] + +Overall, I think this change will be good for Ubuntu Touch in the long run. I understand why [Canonical][9] picked the Unity name for their convergence desktop, but I think the desktop environment was overshadowed by the game engine from the beginning. This will give them room to breathe and also free up valuable coding time. The less time spent replying to questions about 3D models the more time that can be spent creating a convergent desktop. + +If you have any further questions or concerns about the name change, you visit the [UBports forms][10]. They have set up a thread specifically for this topic. + +Don’t hesitate to share our views on it in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/unity8-lomiri/ + +作者:[John Paul][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/john/ +[b]: https://github.com/lujun9972 +[1]: https://ubports.com/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/unity8_ubports.png?ssl=1 +[3]: https://ubports.com/blog/ubports-blog-1/post/lomiri-new-name-same-great-unity8-265 +[4]: https://en.wikipedia.org/wiki/Unity_(game_engine) +[5]: https://www.debian.org/ +[6]: https://itsfoss.com/github-alternatives/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/Unity8-lomiri.png?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/ubports.jpeg?ssl=1 +[9]: https://canonical.com/ +[10]: https://forums.ubports.com/topic/3874/unity8-is-now-lomiri From 80a007676b6f09812f1ed41cb99d8fe3231ab5d5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 1 Mar 2020 09:26:05 +0800 Subject: [PATCH 231/315] Rename sources/tech/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md to sources/news/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md --- ...member Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md (100%) diff --git a/sources/tech/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md b/sources/news/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md similarity index 100% rename from sources/tech/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md rename to sources/news/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md From 58c05ae5709820e9091d40d901b605ea057e0f8e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 1 Mar 2020 11:29:25 +0800 Subject: [PATCH 232/315] PRF @chenmu-kk --- .../20190113 Editing Subtitles in Linux.md | 146 +++++++++++++----- 1 file changed, 107 insertions(+), 39 deletions(-) diff --git a/translated/tech/20190113 Editing Subtitles in Linux.md b/translated/tech/20190113 Editing Subtitles in Linux.md index 84f299fbf4..24d66c4ad7 100644 --- a/translated/tech/20190113 Editing Subtitles in Linux.md +++ b/translated/tech/20190113 Editing Subtitles in Linux.md @@ -1,13 +1,13 @@ [#]: collector: (lujun9972) -[#]: translator: (chenmu-kk ) -[#]: reviewer: ( ) +[#]: translator: (chenmu-kk) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Editing Subtitles in Linux) [#]: via: (https://itsfoss.com/editing-subtitles) [#]: author: (Shirish https://itsfoss.com/author/shirish/) -在 Linux 中编辑字幕 +如何在 Linux 中编辑字幕 ====== 我作为一位世界电影和地区电影爱好者已经几十年了。这期间字幕是一个必不可少的工具,它可以使我享受来自不同国家不同语言的优秀电影。 @@ -20,15 +20,15 @@ ### 从闭路字幕数据中提取字幕 -大概在 2012,2013 年我开始了解到有一款叫做 [CCEextractor][2] 的工具。随着时间的推移,它已经成为我必不可少的工具之一 ,尤其是当我偶然发现一份内含有字幕的媒体文件。 +大概在 2012、2013 年我开始了解到有一款叫做 [CCEextractor][2] 的工具。随着时间的推移,它已经成为我必不可少的工具之一,尤其是当我偶然发现一份内含有字幕的媒体文件。 - CCExtractor 负责解析视频文件以及从闭路字幕数据中产生独立的字幕文件。 +CCExtractor 负责解析视频文件以及从闭路字幕closed captions数据中产生独立的字幕文件。 - CCExtractor 是一个跨平台、免费且开源的工具。自它形成的那年起该工具已经成熟了不少而如今已成为 [GSOC][3] 和谷歌编码输入的一部分。 +CCExtractor 是一个跨平台的、自由开源工具。自它形成的那年起该工具已经成熟了不少而如今已成为 [GSOC][3] 和谷歌编码输入的一部分。 -简单来说,这个工具是一系列或多或少的脚本,这些脚本以一种连续的顺序一个接着一个地给你提供提取到的字幕。 +简单来说,这个工具基本上是一系列脚本,这些脚本以一种顺序方式一个接着一个地给你提供提取到的字幕。 -你可以按照 [本页][5] 的 CCExtractor 安装指南进行操作。 +你可以按照[本页][5]的 CCExtractor 安装指南进行操作。 若安装后你想从媒体文件中提取字幕,请按以下步骤操作: @@ -38,13 +38,70 @@ ccextractor 该命令将会输出以下内容: -它会大致浏览媒体文件。在这个例子中,它发现媒体文件是马拉雅拉姆文并且格式是 .mkv[6] 。之后它将字幕文件提取出来,命名为源文件名并添加“_eng”后缀。 - - CCExtractor 是一款用来增强字幕功能和字幕编辑的优秀工具,我将在下一部分对它进行介绍。 - ``` -趣味阅读:在 [vicaps][7] 有一份有趣的字幕简介,会讲解和分享为何字幕对我们如此重要。对于那些对这类话题感兴趣的人来说,这里面也有许多电影制作的细节。 +$ ccextractor $something.mkv +CCExtractor 0.87, Carlos Fernandez Sanz, Volker Quetschke. +Teletext portions taken from Petr Kutalek's telxcc +-------------------------------------------------------------------------- +Input: $something.mkv +[Extract: 1] [Stream mode: Autodetect] +[Program : Auto ] [Hauppage mode: No] [Use MythTV code: Auto] +[Timing mode: Auto] [Debug: No] [Buffer input: No] +[Use pic_order_cnt_lsb for H.264: No] [Print CC decoder traces: No] +[Target format: .srt] [Encoding: UTF-8] [Delay: 0] [Trim lines: No] +[Add font color data: Yes] [Add font typesetting: Yes] +[Convert case: No] [Video-edit join: No] +[Extraction start time: not set (from start)] +[Extraction end time: not set (to end)] +[Live stream: No] [Clock frequency: 90000] +[Teletext page: Autodetect] +[Start credits text: None] +[Quantisation-mode: CCExtractor's internal function] +----------------------------------------------------------------- +Opening file: $something.mkv +File seems to be a Matroska/WebM container +Analyzing data in Matroska mode + +Document type: matroska +Timecode scale: 1000000 +Muxing app: libebml v1.3.1 + libmatroska v1.4.2 +Writing app: mkvmerge v8.2.0 ('World of Adventure') 64bit +Title: $something + +Track entry: + Track number: 1 + UID: 1 + Type: video + Codec ID: V_MPEG4/ISO/AVC + Language: mal + Name: $something + +Track entry: + Track number: 2 + UID: 2 + Type: audio + Codec ID: A_MPEG/L3 + Language: mal + Name: $something + +Track entry: + Track number: 3 + UID: somenumber + Type: subtitle + Codec ID: S_TEXT/UTF8 + Name: $something + 99% | 144:34 +100% | 144:34 +Output file: $something_eng.srt +Done, processing time = 6 seconds +Issues? Open a ticket here +https://github.com/CCExtractor/ccextractor/issues ``` +它会大致浏览媒体文件。在这个例子中,它发现该媒体文件是马拉雅拉姆语言(mal)并且格式是 [.mkv][6]。之后它将字幕文件提取出来,命名为源文件名并添加“_eng”后缀。 + +CCExtractor 是一款用来增强字幕功能和字幕编辑的优秀工具,我将在下一部分对它进行介绍。 + +> 趣味阅读:在 [vicaps][7] 有一份有趣的字幕提要,它讲解和分享为何字幕对我们如此重要。对于那些对这类话题感兴趣的人来说,这里面也有许多电影制作的细节。 ### 用 SubtitleEditor 工具编辑字幕 @@ -52,9 +109,22 @@ ccextractor 当进入一个简单的文本编辑器时,一个 srt 文件看起来会是这个样子: -我分享的节选字幕来自于一部非常老的德国电影 [卡里加里博士的小屋 (1920)][9] 。 +``` +1 +00:00:00,959 --> 00:00:13,744 +"THE CABINET +OF DR. CALIGARI" - Subtitleeditor 是一款非常棒的字幕编辑软件。字幕编辑器可以用来设置字幕持续时间、与多媒体文件同步的字幕帧率以及字幕间隔时间等等。接下来我将在这分享一些基本的字幕编辑。 +2 +00:00:40,084 --> 00:01:02,088 +A TALE of the modern re-appearance of an 11th Century Myth +involting the strange and mysterious influence +of a mountebank monk over a somnambulist. +``` + +我分享的节选字幕来自于一部非常老的德国电影《[卡里加里博士的小屋][9]》(1920)。 + +Subtitleeditor 是一款非常棒的字幕编辑软件。字幕编辑器可以用来设置字幕持续时间、与多媒体文件同步的字幕帧率以及字幕间隔时间等等。接下来我将在这分享一些基本的字幕编辑。 ![][10] @@ -70,35 +140,33 @@ sudo apt install subtitleeditor 如果你发现字幕与视频不同步,一个原因可能是视频文件的帧率与字幕文件的帧率并不一致。 -你如何得知这些文件的帧率呢,然后呢? +你如何得知这些文件的帧率呢,然后呢?为了获取视频文件的帧率,你可以使用 `mediainfo` 工具。首先你可能需要发行版的包管理器来安装它。 -为了获取视频文件的帧率,你可以使用 mediainfo 工具。首先你可能需要发行版的包管理器来安装它。 - -使用 mediainfo 非常得简单: +使用 `mediainfo` 非常简单: ``` $ mediainfo somefile.mkv | grep Frame - Format settings : CABAC / 4 Ref Frames - Format settings, ReFrames : 4 frames - Frame rate mode : Constant - Frame rate : 25.000 FPS - Bits/(Pixel*Frame) : 0.082 - Frame rate : 46.875 FPS (1024 SPF) + Format settings : CABAC / 4 Ref Frames + Format settings, ReFrames : 4 frames + Frame rate mode : Constant + Frame rate : 25.000 FPS + Bits/(Pixel*Frame) : 0.082 + Frame rate : 46.875 FPS (1024 SPF) ``` -现在你可以看到视频文件的帧率是 25.000 FPS 。我们看到的另一个帧率则是音频文件的帧率。虽然我会分享为何在视频解码和音频解码等地方会使用特定的 fps ,但这将会是一个不同的主题,与它相关的历史有很多。 +现在你可以看到视频文件的帧率是 25.000 FPS 。我们看到的另一个帧率则是音频文件的帧率。虽然我可以分享为何在视频解码和音频解码等地方会使用特定的 fps,但这将会是一个不同的主题,与它相关的历史信息有很多。 下一个问题是解决字幕文件的帧率,这个稍微有点复杂。 -通常情况下,大多数字幕都是压缩格式的。将.zip归档文件和字幕文件(以 XXX.srt 结尾)一起解压缩。除此之外,通常还会有一个同名的 .info 文件,该文件可能包含字幕的帧率。 +通常情况下,大多数字幕都是压缩格式的。将.zip 归档文件和字幕文件(以 XXX.srt 结尾)一起解压缩。除此之外,通常还会有一个同名的 .info 文件,该文件可能包含字幕的帧率。 -如果不是,那么通常最好去某个站点并从具有该帧速率信息的站点下载字幕。对于这个特定的德文文件,我将使用 [Opensubtitle.org][11] 。 +如果不是,那么通常最好去某个站点并从具有该帧速率信息的站点下载字幕。对于这个特定的德文文件,我使用 [Opensubtitle.org][11] 来找到它。 -正如你在链接中所看到的,字幕的帧率是 23.976 FPS 。将我的视频文件以 25.000 FPS 的帧率进行播放,显而易见结果并不好。 +正如你在链接中所看到的,字幕的帧率是 23.976 FPS 。很明显,它不能与帧率为 25.000 FPS 的视频文件一起很好地播放。 -在这种情况下,你可以使用字幕编辑工具来改变字幕文件的帧率: +在这种情况下,你可以使用字幕编辑工具来改变字幕文件的帧率。 -按下 CTRL+A 选择字幕文件中的全部内容。点击 Timings -> Change Framerate ,将 23.976 fps 改为 25.000 fps 或者你想要的其他帧率,保存已更改的文件。 +按下 `CTRL+A` 选择字幕文件中的全部内容。点击 “Timings -> Change Framerate” ,将 23.976 fps 改为 25.000 fps 或者你想要的其他帧率,保存已更改的文件。 ![synchronize frame rates of subtitles in Linux][12] @@ -110,7 +178,7 @@ $ mediainfo somefile.mkv | grep Frame 在这种情况下,请按以下步骤进行操作: -按下 CTRL+A 键选中字幕文件的全部内容。点击 Timings -> 选择 Move Subtitle 。 +按下 `CTRL+A` 键选中字幕文件的全部内容。点击 “Timings -> Select Move Subtitle” 。 ![Move subtitles using Subtitle Editor on Linux][13] @@ -118,17 +186,17 @@ $ mediainfo somefile.mkv | grep Frame ![Move subtitles using Subtitle Editor in Linux][14] -如果你想要时间更精确一点,那么可以使用 [mpv][15] 来查看电影或者媒体文件并点击 timing ,如果你点击了进度条(可以显示电影或者媒体文件的播放进度),它也会显示微秒。 +如果你想要时间更精确一点,那么可以使用 [mpv][15] 来查看电影或者媒体文件并点击进度条(可以显示电影或者媒体文件的播放进度),它也会显示微秒。 -通常我喜欢精准无误的操作,因此我会试着尽可能地仔细调节。相较于人类的反应时间来说,MPV中的反应时间很精确。如果我想要极其精确的时间,那么我可以使用像 [Audacity][16] 之类的东西,但是那是另一种工具,你可以在上面做更多的事情。那也将会是我未来博客中将要探讨的东西。 +通常我喜欢精准无误的操作,因此我会试着尽可能地仔细调节。相较于人类的反应时间来说,MPV 中的反应时间很精确。如果我想要极其精确的时间,那么我可以使用像 [Audacity][16] 之类的东西,但是那是另一种工具,你可以在上面做更多的事情。那也将会是我未来博客中将要探讨的东西。 #### 调整字幕间隔时间 -有时,两种方法都采用了还不够,甚至你可能需要缩短或曾加间隔时间以使其与媒体文件同步。这是较为繁琐的工作之一,因为你必须单独确定每个句子的间隔时间。尤其是在媒体文件中帧率可变的情况下(现已很少见,但你仍然会得到此类文件) +有时,两种方法都采用了还不够,甚至你可能需要缩短或增加间隔时间以使其与媒体文件同步。这是较为繁琐的工作之一,因为你必须单独确定每个句子的间隔时间。尤其是在媒体文件中帧率可变的情况下(现已很少见,但你仍然会得到此类文件) -在这种设想下,你可能因为无法实现自动编辑而不得不手动的修改间隔时间。最好的方式是修改视频文件(会降低视频质量)或者换另一个更高质量的片源,用你喜欢的设置对它进行 [转码][17] 。这又是一重大任务,以后我会在我的一些博客文章上阐明。 +在这种设想下,你可能因为无法实现自动编辑而不得不手动的修改间隔时间。最好的方式是修改视频文件(会降低视频质量)或者换另一个更高质量的片源,用你喜欢的设置对它进行[转码][17] 。这又是一重大任务,以后我会在我的一些博客文章上阐明。 -### 结论 +### 总结 以上我分享的内容或多或少是对现有字幕文件的改进。如果从头开始,你需要花费大量的时间。我完全没有分享这一点,因为一部电影或一个小时内的任何视频材料都可以轻易地花费 4-6 个小时,甚至更多的时间,这取决于字幕员的技巧、耐心、上下文、行话、口音、是否是以英语为母语的人、翻译等,所有的这些都会对字幕的质量产生影响。 @@ -140,8 +208,8 @@ via: https://itsfoss.com/editing-subtitles 作者:[Shirish][a] 选题:[lujun9972][b] -译者:[chenmu-kk](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[chenmu-kk](https://github.com/chenmu-kk) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7fc1cf392abba3e988c8dfadc25f7e4f9e4e7b0a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 1 Mar 2020 11:35:25 +0800 Subject: [PATCH 233/315] PUB @chenmu-kk https://linux.cn/article-11946-1.html --- .../tech => published}/20190113 Editing Subtitles in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190113 Editing Subtitles in Linux.md (99%) diff --git a/translated/tech/20190113 Editing Subtitles in Linux.md b/published/20190113 Editing Subtitles in Linux.md similarity index 99% rename from translated/tech/20190113 Editing Subtitles in Linux.md rename to published/20190113 Editing Subtitles in Linux.md index 24d66c4ad7..fe3a66da99 100644 --- a/translated/tech/20190113 Editing Subtitles in Linux.md +++ b/published/20190113 Editing Subtitles in Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (chenmu-kk) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11946-1.html) [#]: subject: (Editing Subtitles in Linux) [#]: via: (https://itsfoss.com/editing-subtitles) [#]: author: (Shirish https://itsfoss.com/author/shirish/) From 8b0f8fff024f98d228f21bc33485e2d222c4ed7f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 1 Mar 2020 11:36:50 +0800 Subject: [PATCH 234/315] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20202002?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ur components of a distributed tracing system work together.md | 0 .../20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md | 0 .../20190114 Some Advice for How to Make Emacs Tetris Harder.md | 0 ...ing files on Linux- the many variations and how to use them.md | 0 ...190322 12 open source tools for natural language processing.md | 0 .../{ => 202002}/20190407 Manage multimedia files with Git.md | 0 .../20190729 How to structure a multi-file C program- Part 1.md | 0 .../20191022 How to Go About Linux Boot Time Optimisation.md | 0 ...id -words- Handle Chromium - Firefox sessions with org-mode.md | 0 .../20191225 8 Commands to Check Memory Usage on Linux.md | 0 .../20191227 Top CI-CD resources to set you up for success.md | 0 .../20200102 Data streaming and functional programming in Java.md | 0 .../{ => 202002}/20200103 Add scorekeeping to your Python game.md | 0 published/{ => 202002}/20200109 My favorite Bash hacks.md | 0 .../{ => 202002}/20200109 What-s HTTPS for secure computing.md | 0 .../20200112 What I learned going from prison to Python.md | 0 ...00117 Use this Python script to find bugs in your Overcloud.md | 0 ... Keep a journal of your activities with this Python program.md | 0 ...w to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md | 0 .../20200119 One open source chat tool to rule them all.md | 0 ...se this Twitter client for Linux to tweet from the terminal.md | 0 .../{ => 202002}/20200121 Read Reddit from the Linux terminal.md | 0 ... feeds and podcasts in one place with this open source tool.md | 0 ... Screenshot your Linux system configuration with Bash tools.md | 0 .../{ => 202002}/20200123 How to stop typosquatting attacks.md | 0 ...se this open source tool to get your local weather forecast.md | 0 .../20200124 3 handy command-line internet speed tests.md | 0 ...e consoles at once with this open source window environment.md | 0 .../20200125 Use tmux to create the console of your dreams.md | 0 .../20200126 Use Vim to send email and check your calendar.md | 0 .../20200126 What-s your favorite Linux distribution.md | 0 ... Vim to manage your task list and access Reddit and Twitter.md | 0 .../20200128 Send email and check your calendar with Emacs.md | 0 ...0200129 4 cool new projects to try in COPR for January 2020.md | 0 .../20200129 Joplin- The True Open Source Evernote Alternative.md | 0 .../20200129 Showing memory usage in Linux by process and user.md | 0 .../20200130 Meet FuryBSD- A New Desktop BSD Distribution.md | 0 .../{ => 202002}/20200131 Intro to the Linux command line.md | 0 .../20200202 4 Key Changes to Look Out for in Linux Kernel 5.6.md | 0 .../20200203 Give an old MacBook new life with Linux.md | 0 ... Troubleshoot Kubernetes with the power of tmux and kubectl.md | 0 ...ed End of Life- Existing Users Must Upgrade to Ubuntu 19.10.md | 0 published/{ => 202002}/20200205 Getting started with GnuCash.md | 0 .../{ => 202002}/20200206 3 ways to use PostgreSQL commands.md | 0 ...ource eCommerce Platforms to Build Online Shopping Websites.md | 0 ...0200207 Connect Fedora to your Android phone with GSConnect.md | 0 ...7 Customize your internet with an open source search engine.md | 0 ... Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md | 0 ...0207 What is WireGuard- Why Linux Users Going Crazy Over it.md | 0 ...a Codecs in Ubuntu With This Single Command -Beginner-s Tip.md | 0 ... Playing Music on your Fedora Terminal with MPD and ncmpcpp.md | 0 .../20200210 Scan Kubernetes for errors with KRAWL.md | 0 .../20200210 Top hacks for the YaCy open source search engine.md | 0 .../20200211 Dino is a Modern Looking Open Source XMPP Client.md | 0 .../20200212 How to Change the Default Terminal in Ubuntu.md | 0 .../20200212 How to use byobu to multiplex SSH sessions.md | 0 ...re You Can Buy Open Source Apps for Your Linux Distribution.md | 0 .../{ => 202002}/20200213 Why developers like to code at night.md | 0 ...20200214 Digging up IP addresses with the Linux dig command.md | 0 .../{ => 202002}/20200217 How to get MongoDB Server on Fedora.md | 0 published/{ => 202002}/20200217 How to install Vim plugins.md | 0 published/{ => 202002}/20200219 Don-t like IDEs- Try grepgitvi.md | 0 ...19 How Kubernetes Became the Standard for Compute Resources.md | 0 .../20200219 How to Install Latest Git Version on Ubuntu.md | 0 .../20200220 Using Python and GNU Octave to plot data.md | 0 65 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 202002}/20180503 How the four components of a distributed tracing system work together.md (100%) rename published/{ => 202002}/20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md (100%) rename published/{ => 202002}/20190114 Some Advice for How to Make Emacs Tetris Harder.md (100%) rename published/{ => 202002}/20190116 Zipping files on Linux- the many variations and how to use them.md (100%) rename published/{ => 202002}/20190322 12 open source tools for natural language processing.md (100%) rename published/{ => 202002}/20190407 Manage multimedia files with Git.md (100%) rename published/{ => 202002}/20190729 How to structure a multi-file C program- Part 1.md (100%) rename published/{ => 202002}/20191022 How to Go About Linux Boot Time Optimisation.md (100%) rename published/{ => 202002}/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md (100%) rename published/{ => 202002}/20191225 8 Commands to Check Memory Usage on Linux.md (100%) rename published/{ => 202002}/20191227 Top CI-CD resources to set you up for success.md (100%) rename published/{ => 202002}/20200102 Data streaming and functional programming in Java.md (100%) rename published/{ => 202002}/20200103 Add scorekeeping to your Python game.md (100%) rename published/{ => 202002}/20200109 My favorite Bash hacks.md (100%) rename published/{ => 202002}/20200109 What-s HTTPS for secure computing.md (100%) rename published/{ => 202002}/20200112 What I learned going from prison to Python.md (100%) rename published/{ => 202002}/20200117 Use this Python script to find bugs in your Overcloud.md (100%) rename published/{ => 202002}/20200118 Keep a journal of your activities with this Python program.md (100%) rename published/{ => 202002}/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md (100%) rename published/{ => 202002}/20200119 One open source chat tool to rule them all.md (100%) rename published/{ => 202002}/20200120 Use this Twitter client for Linux to tweet from the terminal.md (100%) rename published/{ => 202002}/20200121 Read Reddit from the Linux terminal.md (100%) rename published/{ => 202002}/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md (100%) rename published/{ => 202002}/20200122 Screenshot your Linux system configuration with Bash tools.md (100%) rename published/{ => 202002}/20200123 How to stop typosquatting attacks.md (100%) rename published/{ => 202002}/20200123 Use this open source tool to get your local weather forecast.md (100%) rename published/{ => 202002}/20200124 3 handy command-line internet speed tests.md (100%) rename published/{ => 202002}/20200124 Run multiple consoles at once with this open source window environment.md (100%) rename published/{ => 202002}/20200125 Use tmux to create the console of your dreams.md (100%) rename published/{ => 202002}/20200126 Use Vim to send email and check your calendar.md (100%) rename published/{ => 202002}/20200126 What-s your favorite Linux distribution.md (100%) rename published/{ => 202002}/20200127 Use Vim to manage your task list and access Reddit and Twitter.md (100%) rename published/{ => 202002}/20200128 Send email and check your calendar with Emacs.md (100%) rename published/{ => 202002}/20200129 4 cool new projects to try in COPR for January 2020.md (100%) rename published/{ => 202002}/20200129 Joplin- The True Open Source Evernote Alternative.md (100%) rename published/{ => 202002}/20200129 Showing memory usage in Linux by process and user.md (100%) rename published/{ => 202002}/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md (100%) rename published/{ => 202002}/20200131 Intro to the Linux command line.md (100%) rename published/{ => 202002}/20200202 4 Key Changes to Look Out for in Linux Kernel 5.6.md (100%) rename published/{ => 202002}/20200203 Give an old MacBook new life with Linux.md (100%) rename published/{ => 202002}/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md (100%) rename published/{ => 202002}/20200204 Ubuntu 19.04 Has Reached End of Life- Existing Users Must Upgrade to Ubuntu 19.10.md (100%) rename published/{ => 202002}/20200205 Getting started with GnuCash.md (100%) rename published/{ => 202002}/20200206 3 ways to use PostgreSQL commands.md (100%) rename published/{ => 202002}/20200207 Best Open Source eCommerce Platforms to Build Online Shopping Websites.md (100%) rename published/{ => 202002}/20200207 Connect Fedora to your Android phone with GSConnect.md (100%) rename published/{ => 202002}/20200207 Customize your internet with an open source search engine.md (100%) rename published/{ => 202002}/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md (100%) rename published/{ => 202002}/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md (100%) rename published/{ => 202002}/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md (100%) rename published/{ => 202002}/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md (100%) rename published/{ => 202002}/20200210 Scan Kubernetes for errors with KRAWL.md (100%) rename published/{ => 202002}/20200210 Top hacks for the YaCy open source search engine.md (100%) rename published/{ => 202002}/20200211 Dino is a Modern Looking Open Source XMPP Client.md (100%) rename published/{ => 202002}/20200212 How to Change the Default Terminal in Ubuntu.md (100%) rename published/{ => 202002}/20200212 How to use byobu to multiplex SSH sessions.md (100%) rename published/{ => 202002}/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md (100%) rename published/{ => 202002}/20200213 Why developers like to code at night.md (100%) rename published/{ => 202002}/20200214 Digging up IP addresses with the Linux dig command.md (100%) rename published/{ => 202002}/20200217 How to get MongoDB Server on Fedora.md (100%) rename published/{ => 202002}/20200217 How to install Vim plugins.md (100%) rename published/{ => 202002}/20200219 Don-t like IDEs- Try grepgitvi.md (100%) rename published/{ => 202002}/20200219 How Kubernetes Became the Standard for Compute Resources.md (100%) rename published/{ => 202002}/20200219 How to Install Latest Git Version on Ubuntu.md (100%) rename published/{ => 202002}/20200220 Using Python and GNU Octave to plot data.md (100%) diff --git a/published/20180503 How the four components of a distributed tracing system work together.md b/published/202002/20180503 How the four components of a distributed tracing system work together.md similarity index 100% rename from published/20180503 How the four components of a distributed tracing system work together.md rename to published/202002/20180503 How the four components of a distributed tracing system work together.md diff --git a/published/20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md b/published/202002/20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md similarity index 100% rename from published/20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md rename to published/202002/20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md diff --git a/published/20190114 Some Advice for How to Make Emacs Tetris Harder.md b/published/202002/20190114 Some Advice for How to Make Emacs Tetris Harder.md similarity index 100% rename from published/20190114 Some Advice for How to Make Emacs Tetris Harder.md rename to published/202002/20190114 Some Advice for How to Make Emacs Tetris Harder.md diff --git a/published/20190116 Zipping files on Linux- the many variations and how to use them.md b/published/202002/20190116 Zipping files on Linux- the many variations and how to use them.md similarity index 100% rename from published/20190116 Zipping files on Linux- the many variations and how to use them.md rename to published/202002/20190116 Zipping files on Linux- the many variations and how to use them.md diff --git a/published/20190322 12 open source tools for natural language processing.md b/published/202002/20190322 12 open source tools for natural language processing.md similarity index 100% rename from published/20190322 12 open source tools for natural language processing.md rename to published/202002/20190322 12 open source tools for natural language processing.md diff --git a/published/20190407 Manage multimedia files with Git.md b/published/202002/20190407 Manage multimedia files with Git.md similarity index 100% rename from published/20190407 Manage multimedia files with Git.md rename to published/202002/20190407 Manage multimedia files with Git.md diff --git a/published/20190729 How to structure a multi-file C program- Part 1.md b/published/202002/20190729 How to structure a multi-file C program- Part 1.md similarity index 100% rename from published/20190729 How to structure a multi-file C program- Part 1.md rename to published/202002/20190729 How to structure a multi-file C program- Part 1.md diff --git a/published/20191022 How to Go About Linux Boot Time Optimisation.md b/published/202002/20191022 How to Go About Linux Boot Time Optimisation.md similarity index 100% rename from published/20191022 How to Go About Linux Boot Time Optimisation.md rename to published/202002/20191022 How to Go About Linux Boot Time Optimisation.md diff --git a/published/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md b/published/202002/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md similarity index 100% rename from published/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md rename to published/202002/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md diff --git a/published/20191225 8 Commands to Check Memory Usage on Linux.md b/published/202002/20191225 8 Commands to Check Memory Usage on Linux.md similarity index 100% rename from published/20191225 8 Commands to Check Memory Usage on Linux.md rename to published/202002/20191225 8 Commands to Check Memory Usage on Linux.md diff --git a/published/20191227 Top CI-CD resources to set you up for success.md b/published/202002/20191227 Top CI-CD resources to set you up for success.md similarity index 100% rename from published/20191227 Top CI-CD resources to set you up for success.md rename to published/202002/20191227 Top CI-CD resources to set you up for success.md diff --git a/published/20200102 Data streaming and functional programming in Java.md b/published/202002/20200102 Data streaming and functional programming in Java.md similarity index 100% rename from published/20200102 Data streaming and functional programming in Java.md rename to published/202002/20200102 Data streaming and functional programming in Java.md diff --git a/published/20200103 Add scorekeeping to your Python game.md b/published/202002/20200103 Add scorekeeping to your Python game.md similarity index 100% rename from published/20200103 Add scorekeeping to your Python game.md rename to published/202002/20200103 Add scorekeeping to your Python game.md diff --git a/published/20200109 My favorite Bash hacks.md b/published/202002/20200109 My favorite Bash hacks.md similarity index 100% rename from published/20200109 My favorite Bash hacks.md rename to published/202002/20200109 My favorite Bash hacks.md diff --git a/published/20200109 What-s HTTPS for secure computing.md b/published/202002/20200109 What-s HTTPS for secure computing.md similarity index 100% rename from published/20200109 What-s HTTPS for secure computing.md rename to published/202002/20200109 What-s HTTPS for secure computing.md diff --git a/published/20200112 What I learned going from prison to Python.md b/published/202002/20200112 What I learned going from prison to Python.md similarity index 100% rename from published/20200112 What I learned going from prison to Python.md rename to published/202002/20200112 What I learned going from prison to Python.md diff --git a/published/20200117 Use this Python script to find bugs in your Overcloud.md b/published/202002/20200117 Use this Python script to find bugs in your Overcloud.md similarity index 100% rename from published/20200117 Use this Python script to find bugs in your Overcloud.md rename to published/202002/20200117 Use this Python script to find bugs in your Overcloud.md diff --git a/published/20200118 Keep a journal of your activities with this Python program.md b/published/202002/20200118 Keep a journal of your activities with this Python program.md similarity index 100% rename from published/20200118 Keep a journal of your activities with this Python program.md rename to published/202002/20200118 Keep a journal of your activities with this Python program.md diff --git a/published/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md b/published/202002/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md similarity index 100% rename from published/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md rename to published/202002/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md diff --git a/published/20200119 One open source chat tool to rule them all.md b/published/202002/20200119 One open source chat tool to rule them all.md similarity index 100% rename from published/20200119 One open source chat tool to rule them all.md rename to published/202002/20200119 One open source chat tool to rule them all.md diff --git a/published/20200120 Use this Twitter client for Linux to tweet from the terminal.md b/published/202002/20200120 Use this Twitter client for Linux to tweet from the terminal.md similarity index 100% rename from published/20200120 Use this Twitter client for Linux to tweet from the terminal.md rename to published/202002/20200120 Use this Twitter client for Linux to tweet from the terminal.md diff --git a/published/20200121 Read Reddit from the Linux terminal.md b/published/202002/20200121 Read Reddit from the Linux terminal.md similarity index 100% rename from published/20200121 Read Reddit from the Linux terminal.md rename to published/202002/20200121 Read Reddit from the Linux terminal.md diff --git a/published/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md b/published/202002/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md similarity index 100% rename from published/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md rename to published/202002/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md diff --git a/published/20200122 Screenshot your Linux system configuration with Bash tools.md b/published/202002/20200122 Screenshot your Linux system configuration with Bash tools.md similarity index 100% rename from published/20200122 Screenshot your Linux system configuration with Bash tools.md rename to published/202002/20200122 Screenshot your Linux system configuration with Bash tools.md diff --git a/published/20200123 How to stop typosquatting attacks.md b/published/202002/20200123 How to stop typosquatting attacks.md similarity index 100% rename from published/20200123 How to stop typosquatting attacks.md rename to published/202002/20200123 How to stop typosquatting attacks.md diff --git a/published/20200123 Use this open source tool to get your local weather forecast.md b/published/202002/20200123 Use this open source tool to get your local weather forecast.md similarity index 100% rename from published/20200123 Use this open source tool to get your local weather forecast.md rename to published/202002/20200123 Use this open source tool to get your local weather forecast.md diff --git a/published/20200124 3 handy command-line internet speed tests.md b/published/202002/20200124 3 handy command-line internet speed tests.md similarity index 100% rename from published/20200124 3 handy command-line internet speed tests.md rename to published/202002/20200124 3 handy command-line internet speed tests.md diff --git a/published/20200124 Run multiple consoles at once with this open source window environment.md b/published/202002/20200124 Run multiple consoles at once with this open source window environment.md similarity index 100% rename from published/20200124 Run multiple consoles at once with this open source window environment.md rename to published/202002/20200124 Run multiple consoles at once with this open source window environment.md diff --git a/published/20200125 Use tmux to create the console of your dreams.md b/published/202002/20200125 Use tmux to create the console of your dreams.md similarity index 100% rename from published/20200125 Use tmux to create the console of your dreams.md rename to published/202002/20200125 Use tmux to create the console of your dreams.md diff --git a/published/20200126 Use Vim to send email and check your calendar.md b/published/202002/20200126 Use Vim to send email and check your calendar.md similarity index 100% rename from published/20200126 Use Vim to send email and check your calendar.md rename to published/202002/20200126 Use Vim to send email and check your calendar.md diff --git a/published/20200126 What-s your favorite Linux distribution.md b/published/202002/20200126 What-s your favorite Linux distribution.md similarity index 100% rename from published/20200126 What-s your favorite Linux distribution.md rename to published/202002/20200126 What-s your favorite Linux distribution.md diff --git a/published/20200127 Use Vim to manage your task list and access Reddit and Twitter.md b/published/202002/20200127 Use Vim to manage your task list and access Reddit and Twitter.md similarity index 100% rename from published/20200127 Use Vim to manage your task list and access Reddit and Twitter.md rename to published/202002/20200127 Use Vim to manage your task list and access Reddit and Twitter.md diff --git a/published/20200128 Send email and check your calendar with Emacs.md b/published/202002/20200128 Send email and check your calendar with Emacs.md similarity index 100% rename from published/20200128 Send email and check your calendar with Emacs.md rename to published/202002/20200128 Send email and check your calendar with Emacs.md diff --git a/published/20200129 4 cool new projects to try in COPR for January 2020.md b/published/202002/20200129 4 cool new projects to try in COPR for January 2020.md similarity index 100% rename from published/20200129 4 cool new projects to try in COPR for January 2020.md rename to published/202002/20200129 4 cool new projects to try in COPR for January 2020.md diff --git a/published/20200129 Joplin- The True Open Source Evernote Alternative.md b/published/202002/20200129 Joplin- The True Open Source Evernote Alternative.md similarity index 100% rename from published/20200129 Joplin- The True Open Source Evernote Alternative.md rename to published/202002/20200129 Joplin- The True Open Source Evernote Alternative.md diff --git a/published/20200129 Showing memory usage in Linux by process and user.md b/published/202002/20200129 Showing memory usage in Linux by process and user.md similarity index 100% rename from published/20200129 Showing memory usage in Linux by process and user.md rename to published/202002/20200129 Showing memory usage in Linux by process and user.md diff --git a/published/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md b/published/202002/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md similarity index 100% rename from published/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md rename to published/202002/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md diff --git a/published/20200131 Intro to the Linux command line.md b/published/202002/20200131 Intro to the Linux command line.md similarity index 100% rename from published/20200131 Intro to the Linux command line.md rename to published/202002/20200131 Intro to the Linux command line.md diff --git a/published/20200202 4 Key Changes to Look Out for in Linux Kernel 5.6.md b/published/202002/20200202 4 Key Changes to Look Out for in Linux Kernel 5.6.md similarity index 100% rename from published/20200202 4 Key Changes to Look Out for in Linux Kernel 5.6.md rename to published/202002/20200202 4 Key Changes to Look Out for in Linux Kernel 5.6.md diff --git a/published/20200203 Give an old MacBook new life with Linux.md b/published/202002/20200203 Give an old MacBook new life with Linux.md similarity index 100% rename from published/20200203 Give an old MacBook new life with Linux.md rename to published/202002/20200203 Give an old MacBook new life with Linux.md diff --git a/published/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md b/published/202002/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md similarity index 100% rename from published/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md rename to published/202002/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md diff --git a/published/20200204 Ubuntu 19.04 Has Reached End of Life- Existing Users Must Upgrade to Ubuntu 19.10.md b/published/202002/20200204 Ubuntu 19.04 Has Reached End of Life- Existing Users Must Upgrade to Ubuntu 19.10.md similarity index 100% rename from published/20200204 Ubuntu 19.04 Has Reached End of Life- Existing Users Must Upgrade to Ubuntu 19.10.md rename to published/202002/20200204 Ubuntu 19.04 Has Reached End of Life- Existing Users Must Upgrade to Ubuntu 19.10.md diff --git a/published/20200205 Getting started with GnuCash.md b/published/202002/20200205 Getting started with GnuCash.md similarity index 100% rename from published/20200205 Getting started with GnuCash.md rename to published/202002/20200205 Getting started with GnuCash.md diff --git a/published/20200206 3 ways to use PostgreSQL commands.md b/published/202002/20200206 3 ways to use PostgreSQL commands.md similarity index 100% rename from published/20200206 3 ways to use PostgreSQL commands.md rename to published/202002/20200206 3 ways to use PostgreSQL commands.md diff --git a/published/20200207 Best Open Source eCommerce Platforms to Build Online Shopping Websites.md b/published/202002/20200207 Best Open Source eCommerce Platforms to Build Online Shopping Websites.md similarity index 100% rename from published/20200207 Best Open Source eCommerce Platforms to Build Online Shopping Websites.md rename to published/202002/20200207 Best Open Source eCommerce Platforms to Build Online Shopping Websites.md diff --git a/published/20200207 Connect Fedora to your Android phone with GSConnect.md b/published/202002/20200207 Connect Fedora to your Android phone with GSConnect.md similarity index 100% rename from published/20200207 Connect Fedora to your Android phone with GSConnect.md rename to published/202002/20200207 Connect Fedora to your Android phone with GSConnect.md diff --git a/published/20200207 Customize your internet with an open source search engine.md b/published/202002/20200207 Customize your internet with an open source search engine.md similarity index 100% rename from published/20200207 Customize your internet with an open source search engine.md rename to published/202002/20200207 Customize your internet with an open source search engine.md diff --git a/published/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md b/published/202002/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md similarity index 100% rename from published/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md rename to published/202002/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md diff --git a/published/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md b/published/202002/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md similarity index 100% rename from published/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md rename to published/202002/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md diff --git a/published/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md b/published/202002/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md similarity index 100% rename from published/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md rename to published/202002/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md diff --git a/published/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md b/published/202002/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md similarity index 100% rename from published/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md rename to published/202002/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md diff --git a/published/20200210 Scan Kubernetes for errors with KRAWL.md b/published/202002/20200210 Scan Kubernetes for errors with KRAWL.md similarity index 100% rename from published/20200210 Scan Kubernetes for errors with KRAWL.md rename to published/202002/20200210 Scan Kubernetes for errors with KRAWL.md diff --git a/published/20200210 Top hacks for the YaCy open source search engine.md b/published/202002/20200210 Top hacks for the YaCy open source search engine.md similarity index 100% rename from published/20200210 Top hacks for the YaCy open source search engine.md rename to published/202002/20200210 Top hacks for the YaCy open source search engine.md diff --git a/published/20200211 Dino is a Modern Looking Open Source XMPP Client.md b/published/202002/20200211 Dino is a Modern Looking Open Source XMPP Client.md similarity index 100% rename from published/20200211 Dino is a Modern Looking Open Source XMPP Client.md rename to published/202002/20200211 Dino is a Modern Looking Open Source XMPP Client.md diff --git a/published/20200212 How to Change the Default Terminal in Ubuntu.md b/published/202002/20200212 How to Change the Default Terminal in Ubuntu.md similarity index 100% rename from published/20200212 How to Change the Default Terminal in Ubuntu.md rename to published/202002/20200212 How to Change the Default Terminal in Ubuntu.md diff --git a/published/20200212 How to use byobu to multiplex SSH sessions.md b/published/202002/20200212 How to use byobu to multiplex SSH sessions.md similarity index 100% rename from published/20200212 How to use byobu to multiplex SSH sessions.md rename to published/202002/20200212 How to use byobu to multiplex SSH sessions.md diff --git a/published/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md b/published/202002/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md similarity index 100% rename from published/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md rename to published/202002/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md diff --git a/published/20200213 Why developers like to code at night.md b/published/202002/20200213 Why developers like to code at night.md similarity index 100% rename from published/20200213 Why developers like to code at night.md rename to published/202002/20200213 Why developers like to code at night.md diff --git a/published/20200214 Digging up IP addresses with the Linux dig command.md b/published/202002/20200214 Digging up IP addresses with the Linux dig command.md similarity index 100% rename from published/20200214 Digging up IP addresses with the Linux dig command.md rename to published/202002/20200214 Digging up IP addresses with the Linux dig command.md diff --git a/published/20200217 How to get MongoDB Server on Fedora.md b/published/202002/20200217 How to get MongoDB Server on Fedora.md similarity index 100% rename from published/20200217 How to get MongoDB Server on Fedora.md rename to published/202002/20200217 How to get MongoDB Server on Fedora.md diff --git a/published/20200217 How to install Vim plugins.md b/published/202002/20200217 How to install Vim plugins.md similarity index 100% rename from published/20200217 How to install Vim plugins.md rename to published/202002/20200217 How to install Vim plugins.md diff --git a/published/20200219 Don-t like IDEs- Try grepgitvi.md b/published/202002/20200219 Don-t like IDEs- Try grepgitvi.md similarity index 100% rename from published/20200219 Don-t like IDEs- Try grepgitvi.md rename to published/202002/20200219 Don-t like IDEs- Try grepgitvi.md diff --git a/published/20200219 How Kubernetes Became the Standard for Compute Resources.md b/published/202002/20200219 How Kubernetes Became the Standard for Compute Resources.md similarity index 100% rename from published/20200219 How Kubernetes Became the Standard for Compute Resources.md rename to published/202002/20200219 How Kubernetes Became the Standard for Compute Resources.md diff --git a/published/20200219 How to Install Latest Git Version on Ubuntu.md b/published/202002/20200219 How to Install Latest Git Version on Ubuntu.md similarity index 100% rename from published/20200219 How to Install Latest Git Version on Ubuntu.md rename to published/202002/20200219 How to Install Latest Git Version on Ubuntu.md diff --git a/published/20200220 Using Python and GNU Octave to plot data.md b/published/202002/20200220 Using Python and GNU Octave to plot data.md similarity index 100% rename from published/20200220 Using Python and GNU Octave to plot data.md rename to published/202002/20200220 Using Python and GNU Octave to plot data.md From b91025ef63069c41651cb551bb9477ca26d71ed1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 1 Mar 2020 12:23:41 +0800 Subject: [PATCH 235/315] PRF @wxy --- translated/tech/20200220 Tools for SSH key management.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/translated/tech/20200220 Tools for SSH key management.md b/translated/tech/20200220 Tools for SSH key management.md index 0c9efe9752..be784e5b25 100644 --- a/translated/tech/20200220 Tools for SSH key management.md +++ b/translated/tech/20200220 Tools for SSH key management.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Tools for SSH key management) @@ -12,7 +12,7 @@ SSH 密钥管理工具 > 常用开源工具的省时快捷方式。 -![collection of hardware on blue backround][1] +![](https://img.linux.net.cn/data/attachment/album/202003/01/122336zyldgpse6eyrbymt.jpg) 我经常使用 SSH。我发现自己每天都要登录多个服务器和树莓派(与我位于同一房间,并接入互联网)。我有许多设备需要访问,并且获得访问权限的要求也不同,因此,除了使用各种 `ssh` / `scp` 命令选项之外,我还必须维护一个包含所有连接详细信息的配置文件。 @@ -60,7 +60,7 @@ $ ssh-import-id gh:waveform80 $ sudo pip3 install stormssh ``` -然后,你可以使用以下命令将 SSH 连接添加到配置中: +然后,你可以使用以下命令将 SSH 连接信息添加到配置中: ``` $ storm add pi3 pi@192.168.1.20 @@ -94,7 +94,7 @@ via: https://opensource.com/article/20/2/ssh-tools 作者:[Ben Nuttall][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 40b1c746562cb201e8b41e30c06fabfd20cb3784 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 1 Mar 2020 12:24:10 +0800 Subject: [PATCH 236/315] PUB @wxy https://linux.cn/article-11947-1.html --- .../20200220 Tools for SSH key management.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200220 Tools for SSH key management.md (98%) diff --git a/translated/tech/20200220 Tools for SSH key management.md b/published/20200220 Tools for SSH key management.md similarity index 98% rename from translated/tech/20200220 Tools for SSH key management.md rename to published/20200220 Tools for SSH key management.md index be784e5b25..9331cf701f 100644 --- a/translated/tech/20200220 Tools for SSH key management.md +++ b/published/20200220 Tools for SSH key management.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11947-1.html) [#]: subject: (Tools for SSH key management) [#]: via: (https://opensource.com/article/20/2/ssh-tools) [#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) From a785bde73f56b6dc99a8e33f7d5cceafe9956c8a Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Sun, 1 Mar 2020 17:47:09 +0800 Subject: [PATCH 237/315] Translated --- ...r writing an effective technical resume.md | 74 ------------------- ...r writing an effective technical resume.md | 71 ++++++++++++++++++ 2 files changed, 71 insertions(+), 74 deletions(-) delete mode 100644 sources/talk/20200225 7 tips for writing an effective technical resume.md create mode 100644 translated/talk/20200225 7 tips for writing an effective technical resume.md diff --git a/sources/talk/20200225 7 tips for writing an effective technical resume.md b/sources/talk/20200225 7 tips for writing an effective technical resume.md deleted file mode 100644 index d91ab742d3..0000000000 --- a/sources/talk/20200225 7 tips for writing an effective technical resume.md +++ /dev/null @@ -1,74 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Morisun029) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (7 tips for writing an effective technical resume) -[#]: via: (https://opensource.com/article/20/2/technical-resume-writing) -[#]: author: (Emily Brand https://opensource.com/users/emily-brand) - -7 tips for writing an effective technical resume -====== -Present yourself in the best light to potential employers by following -these essentials. -![Two hands holding a resume with computer, clock, and desk chair ][1] - -If you're a software engineer or a manager in the technology sector, creating or updating your resume can be a daunting task. What is most important to consider? How should you handle the formatting, the content, and your objective or summary? What work experience is relevant? How can you make sure automated recruitment tools don't filter out your resume? - -As a hiring manager over the last seven years, I have seen a wide range of resumes and CVs; while some have been impressive, many more have been terribly written. - -When writing or updating your resume, here are seven easy rules to follow. - -### 1\. Summary statement - -The short paragraph at the top of your resume should be clean and concise, have a clear purpose, and avoid excessive use of adjectives and adverbs. Words such as "impressive," "extensive," and "excellent" do not improve your hiring chances; instead, they look and feel like overused filler words. An important question to ask yourself regarding your objective is: **Does it tell the hiring manager what kind of job I'm looking for and how I can provide value to them?** If not, either strengthen and streamline it to answer that question or leave it out altogether. - -### 2\. Work experience - -Numbers, numbers, numbers. Hard facts help you convey your point far more than general statements such as "Helped build, manage, deliver many projects that directly contributed to my customers' bottom line." Your wording should include statistics such as "Directly impacted five projects with top banks that accelerated their time to market by 40%," how many lines of code you committed, or how many teams you managed. Data is far more effective than frilly language to showcase your abilities and value. - -If you are less-experienced and have fewer jobs to showcase, do not include irrelevant experience like part-time summer jobs. Instead, add detail about the specifics of your relevant experience and what you learned that would make you a better employee for the organization you are applying for. - -### 3\. Search terms and jargon - -With technology playing such a huge role in the hiring process, it is extremely important to make sure your resume gets flagged for the right positions—but do not oversell yourself on your resume. If you mention agile skills but do not know what kanban is, think twice. If you mention that you are skilled in Java but haven't used it in five years, beware. If there are languages and frameworks you are familiar with but not necessarily current in, create a different category or divide your experience into "proficient in" and "familiar with." - -### 4\. Education - -If you are not a recent college graduate, there is no need to include your GPA or the clubs or fraternities you participated in, unless you plan on using them as talking points to gain trust during an interview. Be sure that anything you have published or patented is included, even if it is not relevant to the job. If you do not have a college degree, add a certification section in place of education. If you were in the military, include your active duty and reserve time. - -### 5\. Certifications - -Do not include expired certifications unless you are trying to re-enter a field you have left, such as if you were a people manager and are now looking to get back into hands-on programming. If you have certifications that are no longer relevant to the field, do not include them since it can be distracting and unappealing. Leverage your LinkedIn profile to add more color to your resume, as most people will read your resume and your LinkedIn profile before they interview you. - -### 6\. Spelling and grammar - -Ask others to proofread your resume. So often, I have seen misspelled words in a resume or mistaken uses of words like their, they're, and there. These are avoidable and fixable errors that will create a negative impression. Ideally, your resume will be in active tense, but if that makes you uncomfortable, write it in past tense—the most important thing is to maintain a consistent tense throughout. Improper spelling and grammar will convey that you either do not really care about the job you are applying for or do not have the level of attention to detail necessary for the job. - -### 7\. Formatting - -Ensuring your resume looks up-to-date and appealing is an easy way to make a good first impression. Ensuring consistent formatting, e.g., similar margins, similar spacing, capitalization, and colors (but keep color palettes to a minimum) is the most mundane part of resume writing, but it's necessary to show that you take pride in your work and value yourself and your future employer. Use tables where appropriate to space information in a visually appealing way. If given the option, upload your resume in .pdf and .docx formats, and Google Docs exports to the .odt format, which can be opened easily in LibreOffice. Here is an easy Google Docs [resume template][2] that I recommend. You can also purchase templates from companies that do attractive designs for a small fee (under $10). - -### Update regularly - -Updating your resume regularly will minimize your stress if you're asked to (or want to) apply for a job, and it will help you create and maintain a more accurate version of yourself. When working on your resume, be forward-thinking and be sure to ask at least three other people to review it for content, spelling, and grammar. Even if you are recruited by or referred to a company, your interviewers may know you only by your resume, so ensure that it creates a positive first impression of you. - -_Do you have additional tips to add?_ - -Emily Dunham shares her technique for leveraging open source contributions to stand out as a great... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/technical-resume-writing - -作者:[Emily Brand][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/emily-brand -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/resume_career_document_general.png?itok=JEaFL2XI (Two hands holding a resume with computer, clock, and desk chair ) -[2]: https://docs.google.com/document/d/1ARVyybC5qQEiCzUOLElwAdPpKOK0Qf88srr682eHdCQ/edit diff --git a/translated/talk/20200225 7 tips for writing an effective technical resume.md b/translated/talk/20200225 7 tips for writing an effective technical resume.md new file mode 100644 index 0000000000..20f7edf8f1 --- /dev/null +++ b/translated/talk/20200225 7 tips for writing an effective technical resume.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: (Morisun029) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (7 tips for writing an effective technical resume) +[#]: via: (https://opensource.com/article/20/2/technical-resume-writing) +[#]: author: (Emily Brand https://opensource.com/users/emily-brand) + +撰写有效技术简历的7个技巧 +====== +遵循以下这些要点,把自己最好的一面呈现给潜在雇主。 +![Two hands holding a resume with computer, clock, and desk chair ][1] + +如果你是一名软件工程师或技术领域的经理,那么创建或更新简历可能是一项艰巨的任务。 要考虑的重点是什么? 应该怎么处理格式,内容以及目标或摘要? 哪些工作经验相关? 如何确保自动招聘工具不会过滤掉你的简历? + +在过去的七年中,作为一名招聘经理,我看到了各种各样的简历; 尽管有些令人印象深刻,但还有很多人写的很糟糕。 + +在编写或更新简历时,请遵循以下七个简单原则。 + +### 1\. 概述 + +简历顶部的简短段落应简洁明了,目的明确,避免过多使用形容词和副词。 诸如“令人印象深刻”,“广泛”和“优秀”之类的词,这些词不会增加你的招聘机会; 相反,它们看起来和感觉上像是过度使用的填充词。 关于你的目标,问自己一个重要的问题: **它是否告诉招聘经理我正在寻找什么样的工作以及如何为他们提供价值?** 如果不是,请加强并简化它以回答该问题,或者将其完全排除在外。 + +### 2\. 工作经验 + +数字,数字,数字。 用事实传达观点远比一般的陈述,例如“帮助构建,管理,交付许多对客户利润有贡献的项目” 更能对你有帮助。 你的表达中应包括统计数据,例如“直接影响了五个顶级银行的项目,这些项目将其上市时间缩短了40%”,你提交了多少行代码或管理了几个团队。 数据比修饰语更能有效地展示你的能力和价值。 + +如果你经验不足,没有什么工作经验可展示,那无关的经验,如暑期兼职工作,就不要写了。 相反,将相关经验的细节以及你所学到的知识的详细信息写进简历,这些可以使你成为一个更好的候选人。 + +### 3\. 搜索术语和行话 + +随着技术在招聘过程中发挥如此巨大的作用,确保简历被标记为正确的职位非常重要,但不要在简历上过分吹嘘自己。 如果你提到敏捷技能但不知道看板是什么,请三思。 如果你提到自己精通Java,但是已经有五年都没有使用过Java了,请小心。 如果存在你熟悉但不一定是最新的语言和框架,请创建其他类别或将你的经验分为“精通”和“熟悉”。 + +### 4\. 教育 + +如果你不是应届大学毕业生,那就没必要再写你的GPA或你参加过的俱乐部或兄弟会,除非你计划将它们用作谈话要点以在面试中赢得信任。 确保你发表的或获取过专利的东西包括在内,即使与你的工作无关。 如果你没有大学学位,请添加一个证书部分代替教育背景部分。 如果你是军人,请包括现役和预备时间。 + +### 5\. 资质证书 + +除非你想重新进入之前离开的领域,否则不要写过期的证书,例如,如果你曾经是一名人事经理,而现在正寻求动手编程的工作。 如果你拥有与该领域不再相关的认证,就不要写这些认证,因为这些可能会分散招聘者的注意力,使你的简历失去吸引力。 利用你的 LinkedIn 个人资料为简历添加更多色彩,因为大多数人在面试之前都会阅读你的简历和 LinkedIn 个人资料。 + +### 6\. 拼写和语法 + + +让其他人对你的简历进行校对。 很多时候,我在简历中看到拼写错误的单词,或者错误用词,如“他们的”、“他们是”、“那些”。 这些可以避免和修复的错误会产生负面影响。 理想情况下,你的简历应用主动语态,但是如果这样会使你感到不舒服,那么就用过去时书写-最重要的是要始终保持一致。 不正确的拼写和语法会传递你要么不是很在乎所申请的工作,要么没有足够注意细节。 + +### 7\. 格式 + +确保你的简历是最新的并且富有吸引力,这是留下良好第一印象的简便方法。 确保格式一致,例如相同的页边距,相同的间距,大写字母和颜色(将调色板保持在最低水平)是简历写作中最基本的部分,但有必要表明你对工作感到豪感,并重视自己的价值和未来的雇主。 在适当的地方使用表格,以视觉吸引人的方式分配信息。 如果有给定模板,以 .pdf 和 .docx 格式上传简历,然后用 Google Docs 导出为 .odt 格式,这样可以在 LibreOffice 中轻松打开。 这是我推荐的简单的 Google 文档简历模板。 你还可以支付少量费用(不到10美元)从一些设计公司购买。 + +### 定期更新 + +如果你被要求(或希望)申请一份工作,定期更新简历可以最大程度地减少压力,也可以帮助你创建和维护更准确的简历版本。 撰写简历时,要有远见,确保至少让其他三个人对你的简历内容,拼写和语法进行检查。 即使你是由公司招募或其他人推荐给公司的,面试官也可能仅通过简历认识你,因此请确保它为你带来良好的第一印象。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/technical-resume-writing + +作者:[Emily Brand][a] +选题:[lujun9972][b] +译者:[Morisun029](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/emily-brand +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/resume_career_document_general.png?itok=JEaFL2XI (Two hands holding a resume with computer, clock, and desk chair ) +[2]: https://docs.google.com/document/d/1ARVyybC5qQEiCzUOLElwAdPpKOK0Qf88srr682eHdCQ/edit From 9c574bbcc0dffe3b2bc92fa2c83e46ca9c83de82 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 2 Mar 2020 00:55:58 +0800 Subject: [PATCH 238/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200302=20How=20?= =?UTF-8?q?to=20Add=20New=20Brushes=20in=20GIMP=20[Quick=20Tip]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md --- ...w to Add New Brushes in GIMP -Quick Tip.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md diff --git a/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md b/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md new file mode 100644 index 0000000000..6443a00482 --- /dev/null +++ b/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Add New Brushes in GIMP [Quick Tip]) +[#]: via: (https://itsfoss.com/add-brushes-gimp/) +[#]: author: (Community https://itsfoss.com/author/itsfoss/) + +How to Add New Brushes in GIMP [Quick Tip] +====== + +[GIMP][1], is the most popular free and open-source image editor and perhaps the best [Adobe Photoshop alternative][2] on Linux. + +When you [install GIMP on Ubuntu][3] or any other operating system, you’ll find a few brushes already installed for basic image editing. If you need something more specific, you can always add new brushes in GIMP. + +How? Let me show you that in this quick tutorial. + +### How to add brushes in GIMP + +![][4] + +There are three steps involved in installing new brushes in GIMP: + + * Get new brush + * Put it in the designated folder + * Refresh the brushes in GIMP + + + +#### Step 1: Download new GIMP brushes + +The first step is to get new brushes for GIMP. Where do you get it from? From the internet, of course. + +You can search on Google or [alternative private search engines like Duck Duck Go][5] for ‘GIMP brushes’ and download the ones you like from a reputed website. + +GIMP brushes are usually available in .gbr and .gih file formats. The .gbr file is for regular brushes while .gih is used for animated brushes. + +Did you know? + +For the versions 2.4 and above, GIMP makes installing and using Photoshop brushes (.abr file) quite straightforward. All you need to do is place the Photoshop brush files in the proper folder. +Do keep in mind that the latest Photoshop brushes might not work with GIMP flawlessly. + +#### Step 2: Copy the new brushes into its location + +After you get your brush file, the next step is to copy and paste it to the right folder in GIMP configuration directory. + +On **Windows**, you’ll have to go to a folder like “**C:\Documents and Settings\myusername.gimp-2.10\brushes**“. + +I’ll show detailed steps for **Linux** because It’s FOSS is a Linux-focused website. + +After selecting the brush files press **Ctrl+h** in your **Home** folder to [see hidden files in Linux][6]. + +![Press Ctrl+H to see hidden files in the home directory][7] + +You should go to **.config/GIMP/2.10/brushes** folder (if you are using GIMP version 2.10). If you are using some other version, you should see an equivalent folder under .config/GIMP. + +![Adding New Brushes in GIMP][8] + +Paste the brush files in this folder. Optionally, you can hide the hidden files by pressing **Ctrl+h** again. + +#### Step 3: Refresh the brushes (to avoid restarting GIMP) + +GIMP will automatically load brushes when it’s launched. If you are already running it and don’t want to close it, you can refresh the brushes. + +In GIMP go to **Windows**->**Dockable Dialogues**->**Brushes** in the main menu. + +![Refresh GIMP Brushes by going go to Windows->Dockable Dialogues-> Brushes][9] + +Locate the **refresh** icon in the **Brushes** dialog on the right side bar. + +![Refresh GIMP Brushes][10] + +If your brushes are not present, you can always try to restart GIMP. + +Bonus Tip! + +Adding new brushes in [GIMP also allows you easily watermark images][11]. Just use your logo as a brush and add it to the images in a single click. + +I hope you enjoyed this quick GIMP tip. Stay tuned for more. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/add-brushes-gimp/ + +作者:[Community][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/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://www.gimp.org/ +[2]: https://itsfoss.com/open-source-photoshop-alternatives/ +[3]: https://itsfoss.com/gimp-2-10-release/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Install-New-Brushes-in-GIMP.jpg?ssl=1 +[5]: https://itsfoss.com/privacy-search-engines/ +[6]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/adding-brushes-GIMP-1.jpg?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/adding-brushes-GIMP.png?ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Refresh-GIMP-Brushes.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Refresh-GIMP-Brushes-2.jpg?ssl=1 +[11]: https://itsfoss.com/add-watermark-gimp-linux/ From aa5987badd1b4d3514eb0fb955a3f64b56ec3593 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 2 Mar 2020 08:28:44 +0800 Subject: [PATCH 239/315] translated --- ...oud with Fedora 31 and Nextcloud Server.md | 60 +++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) rename {sources => translated}/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md (63%) diff --git a/sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md b/translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md similarity index 63% rename from sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md rename to translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md index 5aa4ee5023..c5cd454f7d 100644 --- a/sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md +++ b/translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md @@ -7,57 +7,57 @@ [#]: via: (https://fedoramagazine.org/build-your-own-cloud-with-fedora-31-and-nextcloud-server/) [#]: author: (storyteller https://fedoramagazine.org/author/storyteller/) -Build your own cloud with Fedora 31 and Nextcloud Server +使用 Fedora 31 和 Nextcloud 服务器构建自己的云 ====== ![][1] -[Nextcloud][2] is a software suite for storing and syncing your data across multiple devices. You can learn more about Nextcloud Server’s features from [https://github.com/nextcloud/server][3]. +[Nextcloud][2] 是用于跨多个设备存储和同步数据的软件套件。你可以从 [https://github.com/nextcloud/server][3] 了解有关 Nextcloud 服务器的更多特性信息。 -This article demonstrates how to build a personal cloud using Fedora and Nextcloud in a few simple steps. For this tutorial you will need a dedicated computer or a virtual machine running Fedora 31 server edition and an internet connection. +本文通过几个简单的步骤演示了如何使用 Fedora 和 Nextcloud 构建个人云。对于本教程,你将需要一台独立计算机或运行 Fedora 31 服务器版的虚拟机,还需要互联网连接。 -### Step 1: Install the prerequisites +### 步骤 1:预先安装条件 -Before installing and configuring Nextcloud, a few prerequisites must be satisfied. +在安装和配置 Nextcloud 之前,必须满足一些预先条件。 -First, install Apache web server: +首先,安装 Apache Web 服务器: ``` # dnf install httpd ``` -Next, install PHP and some additional modules. Make sure that the PHP version being installed meets [Nextcloud’s requirements][4]: +接下来,安装 PHP 和一些其他模块。确保所安装的 PHP 版本符合 [Nextcloud 的要求][4]: ``` # dnf install php php-gd php-mbstring php-intl php-pecl-apcu php-mysqlnd php-pecl-redis php-opcache php-imagick php-zip php-process ``` -After PHP is installed enable and start the Apache web server: +安装 PHP 后,启用并启动 Apache Web 服务器: ``` # systemctl enable --now httpd ``` -Next, allow _HTTP_ traffic through the firewall: +接下来,允许 _HTTP_ 流量穿过防火墙: ``` # firewall-cmd --permanent --add-service=http # firewall-cmd --reload ``` -Next, install the MariaDB server and client: +接下来,安装 MariaDB 服务器和客户端: ``` # dnf install mariadb mariadb-server ``` -Then enable and start the MariaDB server: +然后启用并启动 MariaDB 服务器 ``` # systemctl enable --now mariadb ``` -Now that MariaDB is running on your server, you can run the _mysql_secure_installation_ command to secure it: +现在,MariaDB 正在运行,你可以运行 _mysql_secure_installation_ 命令来保护它: ``` # mysql_secure_installation @@ -128,7 +128,7 @@ MariaDB installation should now be secure. Thanks for using MariaDB! ``` -Next, create a dedicated user and database for your Nextcloud instance: +接下来,为你的 Nextcloud 实例创建独立的用户和数据库: ``` # mysql -p @@ -139,23 +139,23 @@ Next, create a dedicated user and database for your Nextcloud instance: > exit; ``` -### Step 2: Install Nextcloud Server +### 步骤 2:安装 Nextcloud 服务器 -Now that the prerequisites for your Nextcloud installation have been satisfied, download and unzip [the Nextcloud archive][5]: +现在,你已满足 Nextcloud 安装的预先条件,请下载并解压 [Nextcloud 压缩包][5]: ``` # wget https://download.nextcloud.com/server/releases/nextcloud-17.0.2.zip # unzip nextcloud-17.0.2.zip -d /var/www/html/ ``` -Next, create a data folder and grant Apache read and write access to the _nextcloud_ directory tree: +接下来,创建一个数据文件夹,并授予 Apache 对 _nextcloud_ 目录树的读写访问权限: ``` # mkdir /var/www/html/nextcloud/data # chown -R apache:apache /var/www/html/nextcloud ``` -SELinux must be configured to work with Nextcloud. The basic commands are those bellow, but a lot more, by features used on nexcloud installation, are posted here: [Nextcloud SELinux configuration][6] +SELinux 必须配置为可与 Nextcloud 一起使用。基本命令如下所示,但在 nexcloud 安装中还有很多其他的命令,发布在这里:[Nextcloud SELinux 配置][6] ``` # semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/config(/.*)?' @@ -166,30 +166,30 @@ SELinux must be configured to work with Nextcloud. The basic commands are those # restorecon -Rv '/var/www/html/nextcloud/' ``` -### Step 3: Configure N**extclou**d +### 步骤 3:配置 Nextcloud -Nextcloud can be configured using its web interface or from the command line. +可以使用它的 Web 界面或在命令行配置 Nextcloud。 -#### Using the web interface +#### 使用 Web 界面 -From your favorite browser, access __ and fill the fields: +在你喜欢的浏览器中,访问 __ 并输入字段: ![][7] -#### Using the command line +#### 使用命令行 -From the command line, just enter the following, substituting the values you used when you created a dedicated Nextcloud user in MariaDB earlier: +在命令行中,只需输入以下内容,使用你之前在 MariaDB 中创建的独立 Nextcloud 用户替换相应的值: ``` # sudo -u apache php occ maintenance:install --data-dir /var/www/html/nextcloud/data/ --database "mysql" --database-name "nextcloud" --database-user "nc_admin" --database-pass "DB_SeCuRe_PaSsWoRd" --admin-user "admin" --admin-pass "Admin_SeCuRe_PaSsWoRd" ``` -### Final Notes +### 最后几点 - * I used the _http_ protocol, but Nextcloud also works over _https_. I might write a follow-up about securing Nextcloud in a future article. - * I disabled SELinux, but your server will be more secure if you configure it. - * The recommend PHP memory limit for Nextcloud is 512M. To change it, edit the _memory_limit_ variable in the _/etc/php.ini_ configuration file and restart your _httpd_ service. - * By default, the web interface can only be accessed using the __ URL. If you want to allow access using other domain names, [you can do so by editing the _/var/www/html/nextcloud/config/config.php_ file][8]. The * character can be used to bypass the domain name restriction and allow the use of any URL that resolves to one of your server’s IP addresses. + * 我使用的是 _http_ 协议,但是 Nextcloud 也可以在 _https_ 上运行。我可能会在以后的文章中写一篇有关保护 Nextcloud 的文章。 +  * 我禁用了 SELinux,但是如果配置它,你的服务器将更加安全。 +  * Nextcloud 的建议 PHP 内存限制为 512M。要更改它,请编辑 _/etc/php.ini_ 配置文件中的 _memory_limit_ 变量,然后重新启动 _httpd_ 服务。 +  * 默认情况下,只能使用 __ URL 访问 Web 界面。如果要允许使用其他域名访问,[你可编辑 _/var/www/html/nextcloud/config/config.php_ 来进行此操作][8]。\* 字符可用于绕过域名限制,并允许任何解析为服务器 IP 的 URL 访问。 @@ -201,15 +201,13 @@ From the command line, just enter the following, substituting the values you use ), ``` -_— Updated on January 28th, 2020 to include SELinux configuration —_ - -------------------------------------------------------------------------------- via: https://fedoramagazine.org/build-your-own-cloud-with-fedora-31-and-nextcloud-server/ 作者:[storyteller][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d1985dfa85a6178e5679dda0fea5b7758729b238 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 2 Mar 2020 08:34:10 +0800 Subject: [PATCH 240/315] translating --- .../tech/20200226 Use logzero for simple logging in Python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200226 Use logzero for simple logging in Python.md b/sources/tech/20200226 Use logzero for simple logging in Python.md index 1fbd61b68f..467b30d968 100644 --- a/sources/tech/20200226 Use logzero for simple logging in Python.md +++ b/sources/tech/20200226 Use logzero for simple logging in Python.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 446b31046160a7375a66baaaba9f85bf2ce5a046 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 09:40:32 +0800 Subject: [PATCH 241/315] PUB @lujun9972 https://linux.cn/article-11949-1.html --- .../tech => published}/20170918 Fun and Games in Emacs.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20170918 Fun and Games in Emacs.md (99%) diff --git a/translated/tech/20170918 Fun and Games in Emacs.md b/published/20170918 Fun and Games in Emacs.md similarity index 99% rename from translated/tech/20170918 Fun and Games in Emacs.md rename to published/20170918 Fun and Games in Emacs.md index 9b547de0de..beb061fb1b 100644 --- a/translated/tech/20170918 Fun and Games in Emacs.md +++ b/published/20170918 Fun and Games in Emacs.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11949-1.html) [#]: subject: (Fun and Games in Emacs) [#]: via: (https://www.masteringemacs.org/article/fun-games-in-emacs) [#]: author: (Mickey Petersen https://www.masteringemacs.org/about) From 524627ce1e7587eb7d5e1aac1087a677d900894d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 09:55:49 +0800 Subject: [PATCH 242/315] PRF --- published/20170918 Fun and Games in Emacs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/published/20170918 Fun and Games in Emacs.md b/published/20170918 Fun and Games in Emacs.md index beb061fb1b..2602ba804c 100644 --- a/published/20170918 Fun and Games in Emacs.md +++ b/published/20170918 Fun and Games in Emacs.md @@ -78,9 +78,9 @@ Emacs 中汉诺塔的实现可以追溯到 20 世纪 80 年代中期——确实 我喜欢 `fortune` 命令。每当我启动一个新 shell 时,这些与文学片段、谜语相结合的刻薄、无益、常常带有讽刺意味的“建议”就会点亮我的一天。 -令人困惑的是,Emacs 中有两个包或多或少地做着类似的事情:`fortune` 和 `cookie1`。前者主要用于在电子邮件签名中添加幸运饼干消息,而后者只是一个简单的 fortune 格式阅读器。 +令人困惑的是,Emacs 中有两个包或多或少地做着类似的事情:`fortune` 和 `cookie`。前者主要用于在电子邮件签名中添加幸运饼干消息,而后者只是一个简单的 fortune 格式阅读器。 -不管怎样,使用 Emacs 的 `cookie1` 包前,你首先需要通过 `customize-option RET cookie RET` 来自定义变量 `cookie-file` 告诉它从哪找到 fortune 文件。 +不管怎样,使用 Emacs 的 `cookie` 包前,你首先需要通过 `customize-option RET cookie RET` 来自定义变量 `cookie-file` 告诉它从哪找到 fortune 文件。 如果你的操作系统是 Ubuntu,那么你先安装 `fortune` 软件包,然后就能在 `/usr/share/games/fortune/` 目录中找到这些文件了。 From 63801b20077b070fea5cffc5e8e870a7f59df093 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 10:19:42 +0800 Subject: [PATCH 243/315] PRF @wxy --- ...200224 Using C and C-- for data science.md | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/translated/tech/20200224 Using C and C-- for data science.md b/translated/tech/20200224 Using C and C-- for data science.md index c2b3ca0a87..d6c30dec4b 100644 --- a/translated/tech/20200224 Using C and C-- for data science.md +++ b/translated/tech/20200224 Using C and C-- for data science.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using C and C++ for data science) @@ -10,30 +10,29 @@ 在数据科学中使用 C 和 C++ ====== -> 让我们使用 C99 和 C++ 11 完成常见的数据科学任务。 +> 让我们使用 C99 和 C++11 完成常见的数据科学任务。 ![metrics and data shown on a computer screen][1] 虽然 [Python][2] 和 [R][3] 之类的语言在数据科学中越来越受欢迎,但是 C 和 C++ 对于高效的数据科学来说是一个不错的选择。在本文中,我们将使用 [C99][4] 和 [C++11][5] 编写一个程序,该程序使用 [Anscombe 的四重奏][6]数据集,下面将对其进行解释。 -我在一篇涉及 [Python 和 GNU Octave][7] 的文章中写了我不断学习语言的动机,值得大家回顾。所有程序都应在[命令行][8]上运行,而不是在[图形用户界面(GUI)][9]上运行。完整的示例可在 [polyglot_fit 存储库][10]中找到。 +我在一篇涉及 [Python 和 GNU Octave][7] 的文章中写了我不断学习编程语言的动机,值得大家回顾。这里所有的程序都需要在[命令行][8]上运行,而不是在[图形用户界面(GUI)][9]上运行。完整的示例可在 [polyglot_fit 存储库][10]中找到。 ### 编程任务 你将在本系列中编写的程序: -* 从 [CSV 文件] [11]中读取数据 +* 从 [CSV 文件][11]中读取数据 * 用直线插值数据(即 `f(x)=m ⋅ x + q`) * 将结果绘制到图像文件 -这是许多数据科学家遇到的普遍情况。示例数据是 [Anscombe 的四重奏] [6]的第一组,如下表所示。这是一组人工构建的数据,当拟合直线时可以提供相同的结果,但是它们的曲线非常不同。数据文件是一个文本文件,其中的制表符用作列分隔符,几行作为标题。该任务将仅使用第一组(即前两列)。 - -[Anscombe 的四重奏][6] +这是许多数据科学家遇到的普遍情况。示例数据是 [Anscombe 的四重奏][6]的第一组,如下表所示。这是一组人工构建的数据,当拟合直线时可以提供相同的结果,但是它们的曲线非常不同。数据文件是一个文本文件,其中的制表符用作列分隔符,前几行作为标题。该任务将仅使用第一组(即前两列)。 +![](https://img.linux.net.cn/data/attachment/album/202002/29/122805h3yrs1dkrgysssxk.png) ### C 语言的方式 -[C][12] 语言是通用编程语言,是当今使用最广泛的语言之一(依据 [TIOBE 榜单][13]、[RedMonk 编程语言排名][14]、[编程语言流行度榜单][15]和 [GitHub Octoverse 状态][16])。这是一种相当古老的语言(大约诞生在 1973 年),并且用它编写了许多成功的程序(例如 Linux 内核和 Git 仅是其中两个例子)。它也是最接近计算机内部运行的语言之一,因为它直接用于操作内存。它是一种[编译语言] [17];因此,源代码必须由[编译器][18]转换为[机器代码][19]。它的[标准库][20]很小,功能也不多,因此开发了其他库来提供缺少的功能。 +[C][12] 语言是通用编程语言,是当今使用最广泛的语言之一(依据 [TIOBE 指数][13]、[RedMonk 编程语言排名][14]、[编程语言流行度指数][15]和 [GitHub Octoverse 状态][16] 得来)。这是一种相当古老的语言(大约诞生在 1973 年),并且用它编写了许多成功的程序(例如 Linux 内核和 Git 仅是其中的两个例子)。它也是最接近计算机内部运行机制的语言之一,因为它直接用于操作内存。它是一种[编译语言][17];因此,源代码必须由[编译器][18]转换为[机器代码][19]。它的[标准库][20]很小,功能也不多,因此人们开发了其它库来提供缺少的功能。 我最常在[数字运算][21]中使用该语言,主要是因为其性能。我觉得使用起来很繁琐,因为它需要很多[样板代码][22],但是它在各种环境中都得到了很好的支持。C99 标准是最新版本,增加了一些漂亮的功能,并且得到了编译器的良好支持。 @@ -41,7 +40,7 @@ #### 安装 -要使用 C99 进行开发,你需要一个编译器。我通常使用 [Clang][23],不过 [GCC][24] 是另一个有效的开源编译器。对于线性拟合,我选择使用 [GNU 科学库] [25]。对于绘图,我找不到任何明智的库,因此该程序依赖于外部程序:[Gnuplot] [26]。该示例还使用动态数据结构来存储数据,该结构在[伯克利软件分发版(BSD)][27]中定义。 +要使用 C99 进行开发,你需要一个编译器。我通常使用 [Clang][23],不过 [GCC][24] 是另一个有效的开源编译器。对于线性拟合,我选择使用 [GNU 科学库][25]。对于绘图,我找不到任何明智的库,因此该程序依赖于外部程序:[Gnuplot][26]。该示例还使用动态数据结构来存储数据,该结构在[伯克利软件分发版(BSD)][27]中定义。 在 [Fedora][28] 中安装很容易: @@ -49,7 +48,7 @@ sudo dnf install clang gnuplot gsl gsl-devel ``` -#### 注释代码 +#### 代码注释 在 C99 中,[注释][29]的格式是在行的开头放置 `//`,行的其它部分将被解释器丢弃。另外,`/*` 和 `*/` 之间的任何内容也将被丢弃。 @@ -65,7 +64,7 @@ sudo dnf install clang gnuplot gsl gsl-devel * [头文件][30],其中包含函数说明 * 包含函数定义的源文件 -头文件包含在源文件中,而库文件的源文件则与可执行文件[链接][31]。因此,此示例所需的头文件是: +头文件包含在源文件中,而库文件的源文件则[链接][31]到可执行文件。因此,此示例所需的头文件是: ``` // 输入/输出功能 @@ -83,7 +82,7 @@ sudo dnf install clang gnuplot gsl gsl-devel #### 主函数 -在 C 语言中,程序必须位于称为主函数 [main()][32]:的特殊函数内: +在 C 语言中,程序必须位于称为主函数 [main()][32] 的特殊函数内: ``` int main(void) { @@ -95,7 +94,7 @@ int main(void) { #### 定义变量 -在 C 语言中,变量必须在使用前声明,并且必须与类型关联。每当你要使用变量时,都必须决定要在其中存储哪种数据。你也可以指定是否打算将变量用作常量值,这不是必需的,但是编译器可以从此信息中受益。 来自存储库中的 [fitting_C99.c 程序] [33]: +在 C 语言中,变量必须在使用前声明,并且必须与类型关联。每当你要使用变量时,都必须决定要在其中存储哪种数据。你也可以指定是否打算将变量用作常量值,这不是必需的,但是编译器可以从此信息中受益。 以下来自存储库中的 [fitting_C99.c 程序][33]: ``` const char *input_file_name = "anscombe.csv"; @@ -113,7 +112,7 @@ C 语言中的数组不是动态的,从某种意义上说,数组的长度必 int data_array[1024]; ``` -由于你通常不知道文件中有多少个数据点,因此请使用[单链接列表][34]。这是一个动态数据结构,可以无限增长。幸运的是,BSD [提供了链表][35]。这是一个示例定义: +由于你通常不知道文件中有多少个数据点,因此请使用[单链列表][34]。这是一个动态数据结构,可以无限增长。幸运的是,BSD [提供了链表][35]。这是一个示例定义: ``` struct data_point { @@ -145,7 +144,7 @@ printf("Slope: %f\n", slope); #### 读取数据 -现在来到了困难的部分……有一些用 C 语言解析 CSV 文件的库,但是似乎没有一个库足够稳定或流行到可以放入到 Fedora 软件包存储库中。我没有为本教程添加依赖项,而是决定自己编写此部分。同样,讨论这些细节太啰嗦了,所以我只会解释大致的思路。为了简洁起见,将忽略源代码中的某些行,但是你可以在存储库中找到完整的示例。 +现在来到了困难的部分……有一些用 C 语言解析 CSV 文件的库,但是似乎没有一个库足够稳定或流行到可以放入到 Fedora 软件包存储库中。我没有为本教程添加依赖项,而是决定自己编写此部分。同样,讨论这些细节太啰嗦了,所以我只会解释大致的思路。为了简洁起见,将忽略源代码中的某些行,但是你可以在存储库中找到完整的示例代码。 首先,打开输入文件: @@ -210,7 +209,7 @@ double *x = malloc(sizeof(double) * entries_number); double *y = malloc(sizeof(double) * entries_number); ``` -然后,遍历链接列表以将相关数据保存到数组: +然后,遍历链表以将相关数据保存到数组: ``` SLIST_FOREACH(datum, &head, entries) { @@ -224,7 +223,7 @@ SLIST_FOREACH(datum, &head, entries) { } ``` -现在你已经完成了链接列表,请清理它。要**总是**释放已手动分配的内存,以防止[内存泄漏][48]。内存泄漏是糟糕的、糟糕的、糟糕的(重要的话说三遍)。每次内存没有释放时,花园侏儒都会找不到自己的头: +现在你已经处理完了链表,请清理它。要**总是**释放已手动分配的内存,以防止[内存泄漏][48]。内存泄漏是糟糕的、糟糕的、糟糕的(重要的话说三遍)。每次内存没有释放时,花园侏儒都会找不到自己的头: ``` while (!SLIST_EMPTY(&head)) { @@ -278,7 +277,7 @@ plot 'fit_C99.csv' using 1:2 with lines title 'Fit', 'anscombe.csv' using 1:2 wi clang -std=c99 -I/usr/include/ fitting_C99.c -L/usr/lib/ -L/usr/lib64/ -lgsl -lgslcblas -o fitting_C99 ``` -这个命令告诉编译器使用 C99 标准,读取 `fitting_C99.c` 文件,加载 `gsl` 和 `gslcblas` 库,并将结果保存到 `fitting_C99`。命令行上的结果输出为: +这个命令告诉编译器使用 C99 标准、读取 `fitting_C99.c` 文件、加载 `gsl` 和 `gslcblas` 库、并将结果保存到 `fitting_C99`。命令行上的结果输出为: ``` #### Anscombe's first set with C99 #### @@ -287,13 +286,13 @@ Intercept: 3.000091 Correlation coefficient: 0.816421 ``` -这是用 Gnuplot 生成的结果图像。 +这是用 Gnuplot 生成的结果图像: ![Plot and fit of the dataset obtained with C99][52] ### C++11 方式 -[C++][53] 语言是一种通用编程语言,也是当今使用的最受欢迎的语言之一。它是作为 [C 的继承人][54]创建的(诞生于 1983 年),重点是[面向对象程序设计(OOP)][55]。C++ 通常被视为 C 的超集,因此 C 程序应该能够使用 C++ 编译器进行编译。这并非完全正确,因为在某些极端情况下它们的行为有所不同。 根据我的经验,C++ 比 C 需要更少的样板代码,但是如果要进行对象开发,语法会更困难。C++11 标准是最新版本,增加了一些漂亮的功能,并且或多或少得到了编译器的支持。 +[C++][53] 语言是一种通用编程语言,也是当今使用的最受欢迎的语言之一。它是作为 [C 的继承人][54]创建的(诞生于 1983 年),重点是[面向对象程序设计(OOP)][55]。C++ 通常被视为 C 的超集,因此 C 程序应该能够使用 C++ 编译器进行编译。这并非完全正确,因为在某些极端情况下它们的行为有所不同。 根据我的经验,C++ 与 C 相比需要更少的样板代码,但是如果要进行面向对象开发,语法会更困难。C++11 标准是最新版本,增加了一些漂亮的功能,并且基本上得到了编译器的支持。 由于 C++ 在很大程度上与 C 兼容,因此我将仅强调两者之间的区别。我在本部分中没有涵盖的任何部分,则意味着它与 C 中的相同。 @@ -309,7 +308,6 @@ sudo dnf install clang gnuplot gsl gsl-devel 库的工作方式与 C 语言相同,但是 `include` 指令略有不同: - ``` #include #include @@ -325,7 +323,7 @@ extern "C" { } ``` -由于 GSL 库是用 C 编写的,因此你必须将这种特殊性告知编译器。 +由于 GSL 库是用 C 编写的,因此你必须将这个特殊情况告知编译器。 #### 定义变量 @@ -429,17 +427,17 @@ Intercept: 3.00009 Correlation coefficient: 0.816421 ``` -这就是用 Gnuplot 生成的结果图像。 +这就是用 Gnuplot 生成的结果图像: ![Plot and fit of the dataset obtained with C++11][58] ### 结论 -本文提供了用 C99 和 C++11 编写的数据拟合和绘图任务的示例。由于 C++ 在很大程度上与 C 兼容,因此本文利用了它们的相似性来编写了第二个示例。在某些方面,C++ 更易于使用,因为它部分减轻了显式管理内存的负担。但是其语法更加复杂,因为它引入了为 OOP 编写类的可能性。但是,仍然可以用 C 使用 OOP 方法编写软件。由于 OOP 是一种编程风格,因此可以以任何语言使用。在 C 中有一些很好的 OOP 示例,例如 [GObject][59] 和 [Jansson][60]库。 +本文提供了用 C99 和 C++11 编写的数据拟合和绘图任务的示例。由于 C++ 在很大程度上与 C 兼容,因此本文利用了它们的相似性来编写了第二个示例。在某些方面,C++ 更易于使用,因为它部分减轻了显式管理内存的负担。但是其语法更加复杂,因为它引入了为 OOP 编写类的可能性。但是,仍然可以用 C 使用 OOP 方法编写软件。由于 OOP 是一种编程风格,因此可以在任何语言中使用。在 C 中有一些很好的 OOP 示例,例如 [GObject][59] 和 [Jansson][60]库。 对于数字运算,我更喜欢在 C99 中进行,因为它的语法更简单并且得到了广泛的支持。直到最近,C++11 还没有得到广泛的支持,我倾向于避免使用先前版本中的粗糙不足之处。对于更复杂的软件,C++ 可能是一个不错的选择。 -你是否也将 C 或 C++ 用于数据科学? 在评论中分享你的经验。 +你是否也将 C 或 C++ 用于数据科学?在评论中分享你的经验。 -------------------------------------------------------------------------------- @@ -448,7 +446,7 @@ via: https://opensource.com/article/20/2/c-data-science 作者:[Cristiano L. Fontana][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -460,7 +458,7 @@ via: https://opensource.com/article/20/2/c-data-science [4]: https://en.wikipedia.org/wiki/C99 [5]: https://en.wikipedia.org/wiki/C%2B%2B11 [6]: https://en.wikipedia.org/wiki/Anscombe%27s_quartet -[7]: https://opensource.com/article/20/2/python-gnu-octave-data-science +[7]: https://linux.cn/article-11943-1.html [8]: https://en.wikipedia.org/wiki/Command-line_interface [9]: https://en.wikipedia.org/wiki/Graphical_user_interface [10]: https://gitlab.com/cristiano.fontana/polyglot_fit From 998fa6d8041271294c6dbb2bd1570bcc7f0709b5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 10:20:21 +0800 Subject: [PATCH 244/315] PUB @wxy https://linux.cn/article-11950-1.html --- .../20200224 Using C and C-- for data science.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200224 Using C and C-- for data science.md (99%) diff --git a/translated/tech/20200224 Using C and C-- for data science.md b/published/20200224 Using C and C-- for data science.md similarity index 99% rename from translated/tech/20200224 Using C and C-- for data science.md rename to published/20200224 Using C and C-- for data science.md index d6c30dec4b..f1dfdce174 100644 --- a/translated/tech/20200224 Using C and C-- for data science.md +++ b/published/20200224 Using C and C-- for data science.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11950-1.html) [#]: subject: (Using C and C++ for data science) [#]: via: (https://opensource.com/article/20/2/c-data-science) [#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) From 69f04a92a8c9f3d4f555086a0b4a503119dc5e1e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 20:02:01 +0800 Subject: [PATCH 245/315] APL --- .../20200212 Extend the life of your SSD drive with fstrim.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md b/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md index c8108d68c9..18af55a6d0 100644 --- a/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md +++ b/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 665f2f083cd647d127969f4dc4baae907ad7e924 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 20:36:59 +0800 Subject: [PATCH 246/315] TSL --- ... the life of your SSD drive with fstrim.md | 107 ++++++++---------- 1 file changed, 49 insertions(+), 58 deletions(-) diff --git a/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md b/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md index 18af55a6d0..24ed876272 100644 --- a/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md +++ b/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md @@ -7,95 +7,90 @@ [#]: via: (https://opensource.com/article/20/2/trim-solid-state-storage-linux) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) -Extend the life of your SSD drive with fstrim +在 Linux 下使用 fstrim 延长 SSD 驱动器的寿命 ====== -A new systemd service to make your life easier. + +> 这个新的系统服务可以使你的生活更轻松。 + ![Linux keys on the keyboard for a desktop computer][1] -Over the past decade, solid-state drives (SSD) have brought about a new way of managing storage. SSDs have benefits like silent and cooler operation and a faster interface spec, compared to their elder spinning ancestors. Of course, new technology brings with it new methods of maintenance and management. SSDs have a feature called TRIM. This is essentially a method for reclaiming unused blocks on the device, which may have been previously written, but no longer contain valid data and therefore, can be returned to the general storage pool for reuse. Opensource.com’s Don Watkins first wrote about TRIM in his 2017 article ["Solid-state drives in Linux: Enabling TRIM for SSDs."][2] +在过去的十年中,固态驱动器(SSD)带来了一种管理存储的新方法。与上一代的转盘产品相比,SSD 具有无声、更冷却的操作和更快的接口规格等优点。当然,新技术带来了新的维护和管理方法。SSD 具有称为 TRIM 的功能。从本质上讲,这是一种用于回收设备上未使用的块的方法,该块可能先前已被写入,但不再包含有效数据,因此可以返回到通用存储池以供重用。Opensource.com 的 Don Watkins 在首先其 2017 年的文章《[Linux 固态驱动器:为 SSD 启用 TRIM][2]》中介绍了 TRIM 的内容。 -If you have been using this feature on your Linux system, then you are probably familiar with the two methods described below. +如果你一直在 Linux 系统上使用此功能,则你可能熟悉下面描述的两种方法。 -### The old ways +### 老的方式 -#### Discard - -I initially enabled this with the discard option to the mount command. The configuration is placed into the **/etc/fstab** file for each file system. +#### 丢弃选项 +我最初使用 `mount` 命令的 `discard` 选项启用了此功能。每个文件系统的配置都放在 `/etc/fstab` 文件中。 ``` # cat /etc/fstab UUID=3453g54-6628-2346-8123435f  /home  xfs  defaults,discard   0 0 ``` -The discard option enables automatic online TRIM. There has recently been debate on whether this is the best method due to possible negative performance impacts. Using this option causes a TRIM to be initiated every time new data is written to the drive. This may introduce additional activity that interferes with storage performance. +丢弃选项可启用自动的在线 TRIM。由于可能会对性能造成负面影响,最近关于这是否是最佳方法一直存在争议。使用此选项会在每次将新数据写入驱动器时启动 TRIM。这可能会引入其他活动,从而影响存储性能。 -#### Cron - -I removed the discard option from the **fstab** file. Then I created a cron job to call the command on a scheduled basis. +#### Cron 作业 +我从 `fstab` 文件中删除了丢弃选项。然后,我创建了一个 cron 作业来按计划调用该命令。 ``` # crontab -l @midnight /usr/bin/trim ``` -This is the method I used most recently on my Ubuntu Linux systems until I learned about another way. +这是我最近在 Ubuntu Linux 系统上使用的方法,直到我了解到另一种方法。 -### A new TRIM service +### 一个新的 TRIM 服务 -I recently discovered that a systemd service for TRIM exists. Fedora [introduced][3] this into their distribution in version 30, and, although it is not enabled by default in versions 30 and 31, it is planned to be in version 32. If you’re working on Fedora Workstation 31 and you want to begin using this feature, you can enable it very easily. I’ll also show you how to test it below. This service is not unique to Fedora. The existence and status will depend on an individual distribution basis. +我最近发现有一个用于 TRIM 的 systemd 服务。Fedora 在版本 30 中将其[引入][3],尽管默认情况下在版本 30 和 31 中未启用它,但计划在版本 32 中使用它。如果你使用的是 Fedora 工作站 31,并且你想要开始使用此功能,可以非常轻松地启用它。我还将在下面向你展示如何对其进行测试。该服务并非 Fedora 独有的服务。它是否存在和地位将因发行版而异。 -#### Test - -I like to test first, to better understand what is happening behind the scenes. I do this by opening a terminal and issuing the command that the service is configured to call. +#### 测试 +我喜欢先进行测试,以更好地了解幕后情况。我通过打开终端并发出配置服务调用的命令来执行此操作。 ``` -`/usr/sbin/fstrim --fstab --verbose --quiet` +/usr/sbin/fstrim --fstab --verbose --quiet ``` -The **–help** argument to **fstrim** will describe these and other arguments. - +`fstrim` 的 `-help` 参数将描述这些信息和其他参数。 ``` $ sudo /usr/sbin/fstrim --help Usage: - fstrim [options] <mount point> + fstrim [options] Discard unused blocks on a mounted filesystem. Options: - -a, --all           trim all supported mounted filesystems - -A, --fstab         trim all supported mounted filesystems from /etc/fstab - -o, --offset <num>  the offset in bytes to start discarding from - -l, --length <num>  the number of bytes to discard - -m, --minimum <num> the minimum extent length to discard - -v, --verbose       print number of discarded bytes -     --quiet         suppress error messages - -n, --dry-run       does everything, but trim + -a, --all trim all supported mounted filesystems + -A, --fstab trim all supported mounted filesystems from /etc/fstab + -o, --offset the offset in bytes to start discarding from + -l, --length the number of bytes to discard + -m, --minimum the minimum extent length to discard + -v, --verbose print number of discarded bytes + --quiet suppress error messages + -n, --dry-run does everything, but trim - -h, --help          display this help - -V, --version       display version + -h, --help display this help + -V, --version display version ``` -So, now I can see that the systemd service is configured to run the trim on all supported mounted filesystems in my **/etc/fstab** file **–fstab** and print the number of discarded bytes **–verbose** but suppress any error messages that might occur **–quiet**. Knowing these options is helpful for testing. For instance, I can start with the safest one, which is the dry run. I’ll also leave off the quiet argument so I can determine if any errors will occur with my drive setup. - +因此,现在我可以看到这个 systemd 服务已配置为在我的 `/etc/fstab` 文件中的所有受支持的挂载文件系统上运行该修剪操作( `-fstab`),并打印出丢弃的字节数(`-verbose`),但是抑制了任何可能会发生的错误消息(`–quiet`)。了解这些选项对测试很有帮助。例如,我可以从最安全的方法开始,即空运行。 我还将去掉 `-quiet` 参数,以便确定驱动器设置是否发生任何错误。 ``` -`$ sudo /usr/sbin/fstrim --fstab --verbose --dry-run` +$ sudo /usr/sbin/fstrim --fstab --verbose --dry-run ``` -This will simply show what the **fstrim** command will do based on the file systems that it finds configured in your **/etc/fstab** file. - +这就会显示 `fstrim` 命令根据在 `/etc/fstab` 文件中找到的文件系统要执行的操作。 ``` -`$ sudo /usr/sbin/fstrim --fstab --verbose` +$ sudo /usr/sbin/fstrim --fstab --verbose ``` -This will now send the TRIM operation to the drive and report on the number of discarded bytes from each file system. Below is an example after my recent fresh install of Fedora on a new NVME SSD. - +现在,这会将 TRIM 操作发送到驱动器,并报告每个文件系统中丢弃的字节数。以下是我最近在新的 NVME SSD 上全新安装 Fedora 之后的示例。 ``` /home: 291.5 GiB (313011310592 bytes) trimmed on /dev/mapper/wkst-home @@ -104,44 +99,40 @@ This will now send the TRIM operation to the drive and report on the number of d /: 60.7 GiB (65154805760 bytes) trimmed on /dev/mapper/wkst-root ``` -#### Enable - -Fedora Linux implements systemd timer service, scheduled to run on a weekly basis. To check the existence and current status, run **systemctl status**. +#### 启用 +Fedora Linux 实现了一个计划每周运行它的 systemd 计时器服务。要检查其是否存在和当前状态,请运行 `systemctl status`。 ``` -`$ sudo systemctl status fstrim.timer` +$ sudo systemctl status fstrim.timer ``` -Now, enable the service. - +现在,启用该服务。 ``` -`$ sudo systemctl enable fstrim.timer` +$ sudo systemctl enable fstrim.timer ``` -#### Verify - -Then you can verify that the timer is enabled by listing all of the timers. +#### 验证 +然后,你可以通过列出所有计时器来验证该计时器是否已启用。 ``` -`$ sudo systemctl list-timers --all` +$ sudo systemctl list-timers --all ``` -The following line referring to the **fstrim.timer** will appear. Notice that the timer actually activates **fstrim.service**. This is from where the actual **fstrim** is called. The time-related fields show **n/a** because the service has just been enabled and has not run yet. - +会显示出下列表明 `fstrim.timer` 存在的行。注意,该计时器实际上激活了 `fstrim.service`。这是 `fstrim` 实际调用的地方。与时间相关的字段显示为 `n/a`,因为该服务已启用且尚未运行。 ``` NEXT   LEFT    LAST   PASSED   UNIT           ACTIVATES n/a    n/a     n/a    n/a      fstrim.timer   fstrim.service ``` -### Conclusion +### 结论 -This service seems like the best way to run TRIM on your drives. It is much simpler than having to create your own crontab entry to call the **fstrim** command. It is also safer not having to edit the **fstab** file. It has been interesting to watch the evolution of solid-state storage technology and nice to know that it appears Linux is moving toward a standard and safe way to implement it. +该服务似乎是在驱动器上运行 TRIM 的最佳方法。这比必须创建自己的 crontab 条目来调用 `fstrim` 命令要简单得多。不必编辑 `fstab` 文件也更安全。观察固态存储技术的发展很有趣,并且我很高兴看到 Linux 似乎正在朝着标准且安全的方向实现它。 -In this article, learn how solid state drives differ from traditional hard drives and what it means... +在本文中,学习了固态驱动器与传统硬盘驱动器有何不同以及它的含义... -------------------------------------------------------------------------------- @@ -149,7 +140,7 @@ via: https://opensource.com/article/20/2/trim-solid-state-storage-linux 作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -157,5 +148,5 @@ via: https://opensource.com/article/20/2/trim-solid-state-storage-linux [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/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) -[2]: https://opensource.com/article/17/1/solid-state-drives-linux-enabling-trim-ssds +[2]: https://linux.cn/article-8177-1.html [3]: https://fedoraproject.org/wiki/Changes/EnableFSTrimTimer (Fedora Project WIKI: Changes/EnableFSTrimTimer) From 68205fa9cfa70b1a6529c166d36ad02517a4895e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 21:03:28 +0800 Subject: [PATCH 247/315] APL --- .../20200130 4 open source productivity tools on my wishlist.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200130 4 open source productivity tools on my wishlist.md b/sources/tech/20200130 4 open source productivity tools on my wishlist.md index d36f020aa3..1b19980605 100644 --- a/sources/tech/20200130 4 open source productivity tools on my wishlist.md +++ b/sources/tech/20200130 4 open source productivity tools on my wishlist.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a6032e24bb9afc57f482ff07463a4c86db53ead4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 21:47:00 +0800 Subject: [PATCH 248/315] TSL --- ...ource productivity tools on my wishlist.md | 76 ------------------- ...ource productivity tools on my wishlist.md | 76 +++++++++++++++++++ 2 files changed, 76 insertions(+), 76 deletions(-) delete mode 100644 sources/tech/20200130 4 open source productivity tools on my wishlist.md create mode 100644 translated/tech/20200130 4 open source productivity tools on my wishlist.md diff --git a/sources/tech/20200130 4 open source productivity tools on my wishlist.md b/sources/tech/20200130 4 open source productivity tools on my wishlist.md deleted file mode 100644 index 1b19980605..0000000000 --- a/sources/tech/20200130 4 open source productivity tools on my wishlist.md +++ /dev/null @@ -1,76 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (4 open source productivity tools on my wishlist) -[#]: via: (https://opensource.com/article/20/1/open-source-productivity-tools) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -4 open source productivity tools on my wishlist -====== -Find out what the open source world needs to work on in the final -article in our series on 20 ways to be more productive with open source -in 2020. -![Two diverse hands holding a globe][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### But what about… - -When searching for productivity apps, I never find everything I want, and I almost always miss something great that my readers share with me. So, as I bring this series to a close, it's time [again][2] to talk about some of the topics I failed to cover in this year's series. - -![Desktop with Joplin, Emacs, and Firefox][3] - -#### Chatting in Vim - -I tried. I really, _really_ tried to get chat to work in Vim, but it was not to be. The one package I was able to find, [VimIRC.vim][4], never did work for me, and I tried for a few days to no avail. The other option I explored was [Irc it][5], which requires a lot more [effort to set up][6] than I could fit into my available space or time. I tried, I really did, and for the Vim users out there, I'm sorry I wasn't able to get something workable for you. - -#### Org mode - -![Org Mode in Emacs][7] - -I love [Org Mode][8], and I use it daily. I could spend several days _just_ talking about Org. It provides basic [task tracking][9]; Google [calendar][10] sync and [CalFW][11] integration; rich text documents, websites, and presentations; linking to all the things; and; and; and… - -I expect you will hear more from me about Org in 2020 because it really is pretty cool. - -#### GUI programs - -In 2019's productivity series, I shared a lot of programs with a graphical user interface (GUI), and this year almost all are command-line applications. There are some great graphical programs to help with some of the things I talked about this year—[mail][12] programs to talk to Maildir mailboxes, calendar programs to read local calendar files, [weather][13] apps, and so on. I even tried several new-to-me things to see if they would fit with the overall theme. With the exception of [twin][14], I didn't feel that there were any GUI programs that were new (to me) or notable (again, to me) to write about this year. And that brings me to… - -#### Mobile - -More and more people are using tablets (sometimes in conjunction with a laptop) as their primary device. I use my phone for most of my social media and instant messaging, and, more often than not, I use my tablet (OK, let's be honest, _tablets_) to read or browse the web. It isn't that open source mobile apps aren't out there, that's for sure, but they didn't fit with my themes this year. There is a lot going on with open source and mobile apps, and I'm watching carefully for things that can help me be more productive on my phone and tablet. - -### Your turn - -Thank you very much for reading the series this year. Please comment with what you think I missed or need to look at for 2021. And as I say on the [Productivity Alchemy][15] podcast: "Remember folks: Stay productive!" - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/open-source-productivity-tools - -作者:[Kevin Sonney][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/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_hands_diversity.png?itok=zm4EDxgE (Two diverse hands holding a globe) -[2]: https://opensource.com/article/19/1/productivity-tool-wish-list -[3]: https://opensource.com/sites/default/files/uploads/productivity_20-1.png (Desktop with Joplin, Emacs, and Firefox) -[4]: https://github.com/vim-scripts/VimIRC.vim -[5]: https://tools.suckless.org/ii/ -[6]: https://www.reddit.com/r/vim/comments/48t7ws/vim_ii_irc_client_xpost_runixporn/d0macnl/ -[7]: https://opensource.com/sites/default/files/uploads/productivity_20-2.png (Org Mode in Emacs) -[8]: https://orgmode.org/ -[9]: https://opensource.com/article/20/1/open-source-to-do-list -[10]: https://opensource.com/article/20/1/open-source-calendar -[11]: https://github.com/kiwanami/emacs-calfw -[12]: https://opensource.com/article/20/1/organize-email-notmuch -[13]: https://opensource.com/article/20/1/open-source-weather-forecast -[14]: https://github.com/cosmos72/twin -[15]: https://productivityalchemy.com diff --git a/translated/tech/20200130 4 open source productivity tools on my wishlist.md b/translated/tech/20200130 4 open source productivity tools on my wishlist.md new file mode 100644 index 0000000000..eaebf35f1d --- /dev/null +++ b/translated/tech/20200130 4 open source productivity tools on my wishlist.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 open source productivity tools on my wishlist) +[#]: via: (https://opensource.com/article/20/1/open-source-productivity-tools) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +我的愿望清单上的 4 个开源生产力工具 +====== + +> 在 2020 年用开源实现更高生产力的二十种方式的最后一篇文章中,了解开源世界需要做什么。 + +![Two diverse hands holding a globe][1] + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 不过… + +在搜索生产力应用程序时,我找不到想要的一切应用,而且几乎总是会丢失一些读者与我分享的精彩内容。 因此,当我结束本系列文章时,是时候[再次][2]谈论我在本年度系列文章中未能涵盖的一些主题。 + +![Desktop with Joplin, Emacs, and Firefox][3] + +#### 在 Vim 中聊天 + +我试过了。我真的非常非常想能够在 Vim 中聊天,但我做不到。我找到的一个软件包 [VimIRC.vim][4] 一直就工作不起来,我试了几天也没用。我探索的另一个选项是 [Irc it][5],这需要我付出更多的[努力去设置][6],超过了我正常可以付出的耐心或时间。我尝试过了,也确实做到了,但对于同处于相同境地的 Vim 用户,对不起,我无法帮到你。 + +#### Org 模式 + +![Org Mode in Emacs][7] + +我喜欢 [Org 模式][8],并且每天都使用它。关于 Org 模式我可以滔滔不绝的说上几天。它提供了基本的[任务跟踪][9];谷歌[日历][10]同步和 [CalFW][11] 集成;富文本文档、网站和演示文稿;链接到任何事物;等等、等等…… + +我希望你会在 2020 年从我这里收到更多有关 Org 模式的信息,因为它真的很酷。 + +#### 图形用户界面程序 + +在 2019 年的生产力系列中,我共享了很多图形用户界面程序,而今年几乎都是命令行应用程序。有一些很棒的图形程序可以帮助解决我今年谈论的一些问题,例如可以使用 Maildir 邮箱的[邮件][12]程序、用于读取本地日历文件的日历程序、[天气][13]应用程序等等。我甚至尝试了几项对我而言新奇的事物,看它们是否适合这个主题。除了 [twin][14] 之外,我没有感觉到有什么图形用户界面程序是新颖的(对我而言)或值得注意的(同样对我而言)今年要写的。至于…… + +#### 移动应用程序 + +越来越多的人将平板电脑(有时与笔记本电脑结合使用)作为主要设备。我将手机用于大多数社交媒体和即时消息传递,并且经常使用平板电脑(好的,老实说,好几个平板电脑)来阅读或浏览网络。可以肯定的是,并不是开源移动应用程序不存在,但是它们与我今年的主题不符。开源和移动应用程序正在发生很多变化,我正在仔细地寻找可以帮助我在手机和平板电脑上提高工作效率的事物。 + +### 该你了 + +非常感谢你阅读今年的系列文章。请你发表评论,告诉我错过的或需要在 2021 年看到的内容。正如我在 [Productivity Alchemy] [15] 播客上所说:“哥们,记着:保持生产力!” + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-productivity-tools + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_hands_diversity.png?itok=zm4EDxgE (Two diverse hands holding a globe) +[2]: https://opensource.com/article/19/1/productivity-tool-wish-list +[3]: https://opensource.com/sites/default/files/uploads/productivity_20-1.png (Desktop with Joplin, Emacs, and Firefox) +[4]: https://github.com/vim-scripts/VimIRC.vim +[5]: https://tools.suckless.org/ii/ +[6]: https://www.reddit.com/r/vim/comments/48t7ws/vim_ii_irc_client_xpost_runixporn/d0macnl/ +[7]: https://opensource.com/sites/default/files/uploads/productivity_20-2.png (Org Mode in Emacs) +[8]: https://orgmode.org/ +[9]: https://opensource.com/article/20/1/open-source-to-do-list +[10]: https://opensource.com/article/20/1/open-source-calendar +[11]: https://github.com/kiwanami/emacs-calfw +[12]: https://opensource.com/article/20/1/organize-email-notmuch +[13]: https://opensource.com/article/20/1/open-source-weather-forecast +[14]: https://github.com/cosmos72/twin +[15]: https://productivityalchemy.com From e410bb05f7ce7a1be8a7994b8baa48019ed5edd9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 22:04:23 +0800 Subject: [PATCH 249/315] TSL --- .../20200212 Extend the life of your SSD drive with fstrim.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20200212 Extend the life of your SSD drive with fstrim.md (100%) diff --git a/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md b/translated/tech/20200212 Extend the life of your SSD drive with fstrim.md similarity index 100% rename from sources/tech/20200212 Extend the life of your SSD drive with fstrim.md rename to translated/tech/20200212 Extend the life of your SSD drive with fstrim.md From 964218debcd387146e69fc5c57f1442cd0fb2999 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 22:28:26 +0800 Subject: [PATCH 250/315] =?UTF-8?q?=E8=B6=85=E6=9C=9F=E5=9B=9E=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Morisun029 @lixin555 @nacyro @lnrCoder @summer2233 @BrunoJu @lxbwolf --- ...ear in review, and more industry trends.md | 71 ---------- ... years of Java, and other industry news.md | 71 ---------- ...wered by Ceph, and more industry trends.md | 66 ---------- ...a Major Update With Version 2.5 Release.md | 115 ----------------- ...sma 5.18 LTS Released With New Features.md | 121 ------------------ ...GNU-Linux is Turning into Hyperbola BSD.md | 2 +- ...r your System Drive using Software RAID.md | 2 +- ...your awk skills with two easy tutorials.md | 2 +- ...1 A guide to intermediate awk scripting.md | 2 +- ...8 How to use regular expressions in awk.md | 2 +- ...and tutorials for beginners and experts.md | 2 +- ...ll No Longer Have The Default Root User.md | 87 ------------- ...113 How to setup a DNS server with bind.md | 2 +- 13 files changed, 7 insertions(+), 538 deletions(-) delete mode 100644 sources/news/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md delete mode 100644 sources/news/20200205 The Y2038 problem in the Linux kernel, 25 years of Java, and other industry news.md delete mode 100644 sources/news/20200211 Building a Linux desktop, CERN powered by Ceph, and more industry trends.md delete mode 100644 sources/news/20200212 OpenShot Video Editor Gets a Major Update With Version 2.5 Release.md delete mode 100644 sources/news/20200213 KDE Plasma 5.18 LTS Released With New Features.md delete mode 100644 sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md diff --git a/sources/news/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md b/sources/news/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md deleted file mode 100644 index 7a3a40d845..0000000000 --- a/sources/news/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (NSA cloud advice, Facebook open source year in review, and more industry trends) -[#]: via: (https://opensource.com/article/20/1/nsa-facebook-more-industry-trends) -[#]: author: (Tim Hildred https://opensource.com/users/thildred) - -NSA cloud advice, Facebook open source year in review, and more industry trends -====== -A weekly look at open source community and industry trends. -![Person standing in front of a giant computer screen with numbers, data][1] - -As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. - -## [Facebook open source year in review][2] - -> Last year was a busy one for our [open source][3] engineers. In 2019 we released 170 new open source projects, bringing our portfolio to a total of 579 [active repositories][3]. While it’s important for our internal engineers to contribute to these projects (and they certainly do — with more than 82,000 commits this year), we are also incredibly grateful for the massive support from external contributors. Approximately 2,500 external contributors committed more than 32,000 changes. In addition to these contributions, nearly 93,000 new people starred our projects this year, growing the most important component of any open source project — the community! Facebook Open Source would not be here without your contributions, so we want to thank you for your participation in 2019. - -**The impact**: Facebook got ~33% more changes than they would have had they decided to develop these as closed projects. Organizations addressing similar challenges got an 82,000-commit boost in exchange. What a clear illustration of the business impact of open source development. - -## [Cloud advice from the NSA][4] - -> This document divides cloud vulnerabilities into four classes (misconfiguration, poor access control, shared tenancy vulnerabilities, and supply chain vulnerabilities) that encompass the vast majority of known vulnerabilities. Cloud customers have a critical role in mitigating misconfiguration and poor access control, but can also take actions to protect cloud resources from the exploitation of shared tenancy and supply chain vulnerabilities. Descriptions of each vulnerability class along with the most effective mitigations are provided to help organizations lock down their cloud resources. By taking a risk-based approach to cloud adoption, organizations can securely benefit from the cloud’s extensive capabilities. - -**The impact**: The Fear, Uncertainty, and Doubt (FUD) that has been associated with cloud adoption is being debunked more all the time. None other then the US Department of Defense has done a lot of the thinking so you don't have to, and there is a good chance that their concerns are at least as dire as yours are. - -## [With Kubernetes, China Minsheng Bank transformed its legacy applications][5] - -> But all of CMBC’s legacy applications—for example, the core banking system, payment systems, and channel systems—were written in C and Java, using traditional architecture. “We wanted to do distributed applications because in the past we used VMs in our own data center, and that was quite expensive and with low resource utilization rate,” says Zhang. “Our biggest challenge is how to make our traditional legacy applications adaptable to the cloud native environment.” So far, around 20 applications are running in production on the Kubernetes platform, and 30 new applications are in active development to adopt the Kubernetes platform. - -**The impact**: This illustrates nicely the challenges and opportunities facing businesses in a competitive environment, and suggests a common adoption pattern. Do new stuff the new way, and move the old stuff as it makes sense. - -## [The '5 Rs' of the move to cloud native: Re-platform, re-host, re-factor, replace, retire][6] - -> The bottom line is that telcos and service providers will go cloud native when it is cheaper for them to migrate to the cloud and pay cloud costs than it is to remain in the data centre. That time is now and by adhering to the "5 Rs" of the move to cloud native, Re-platform, Re-host, Re-factor, Replace and/or Retire, the path is open, clearly marked and the goal eminently achievable. - -**The impact**: Cloud-native is basically used as a synonym for open source in this interview; there is no other type of technology that will deliver the same lift. - -## [Fedora CoreOS out of preview][7] - -> Fedora CoreOS is a new Fedora Edition built specifically for running containerized workloads securely and at scale. It’s the successor to both [Fedora Atomic Host][8] and [CoreOS Container Linux][9] and is part of our effort to explore new ways of assembling and updating an OS. Fedora CoreOS combines the provisioning tools and automatic update model of Container Linux with the packaging technology, OCI support, and SELinux security of Atomic Host.  For more on the Fedora CoreOS philosophy, goals, and design, see the [announcement of the preview release][10]. - -**The impact**: Collapsing these two branches of the Linux family tree into one another moves the state of the art forward for everyone (once you get through the migration). - -_I hope you enjoyed this list of what stood out to me from last week and come back next Monday for more open source community, market, and industry trends._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/nsa-facebook-more-industry-trends - -作者:[Tim Hildred][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/thildred -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) -[2]: https://opensource.com/article/20/1/hybrid-developer-future-industry-trends -[3]: https://opensource.facebook.com/ -[4]: https://media.defense.gov/2020/Jan/22/2002237484/-1/-1/0/CSI-MITIGATING-CLOUD-VULNERABILITIES_20200121.PDF -[5]: https://www.cncf.io/blog/2020/01/23/with-kubernetes-china-minsheng-bank-transformed-its-legacy-applications-and-moved-into-ai-blockchain-and-big-data/ -[6]: https://www.telecomtv.com/content/cloud-native/the-5-rs-of-the-move-to-cloud-native-re-platform-re-host-re-factor-replace-retire-37473/ -[7]: https://fedoramagazine.org/fedora-coreos-out-of-preview/ -[8]: https://www.projectatomic.io/ -[9]: https://coreos.com/os/docs/latest/ -[10]: https://fedoramagazine.org/introducing-fedora-coreos/ diff --git a/sources/news/20200205 The Y2038 problem in the Linux kernel, 25 years of Java, and other industry news.md b/sources/news/20200205 The Y2038 problem in the Linux kernel, 25 years of Java, and other industry news.md deleted file mode 100644 index 2e814fdfc0..0000000000 --- a/sources/news/20200205 The Y2038 problem in the Linux kernel, 25 years of Java, and other industry news.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (The Y2038 problem in the Linux kernel, 25 years of Java, and other industry news) -[#]: via: (https://opensource.com/article/20/2/linux-java-and-other-industry-news) -[#]: author: (Tim Hildred https://opensource.com/users/thildred) - -The Y2038 problem in the Linux kernel, 25 years of Java, and other industry news -====== -A weekly look at open source community and industry trends. -![Person standing in front of a giant computer screen with numbers, data][1] - -As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. - -## [Need 32-bit Linux to run past 2038? When version 5.6 of the kernel pops, you're in for a treat][2] - -> Arnd Bergmann, an engineer working on the thorny Y2038 problem in the Linux kernel, posted to the [mailing list][3] that, yup, Linux 5.6 "should be the first release that can serve as a base for a 32-bit system designed to run beyond year 2038." - -**The impact:** Y2K didn't get fixed; it just got bigger and delayed. There is no magic in software or computers; just people trying to solve complicated problems as best they can, and some times introducing more complicated problems for different people to solve at some point in the future. - -## [What the dev? Celebrating Java's 25th anniversary][4] - -> Java is coming up on a big milestone: Its 25th anniversary! To celebrate, we take a look back over the last 25 years to see how Java has evolved over time. In this episode, Social Media and Online Editor Jenna Sargent talks to Rich Sharples, senior director of product management for middleware at Red Hat, to learn more. - -**The impact:** There is something comforting about immersing yourself in a deep well of lived experience. Rich clearly lived through what he is talking about and shares insider knowlege with you (and his dog). - -## [Do I need an API Gateway if I use a service mesh?][5] - -> This post may not be able to break through the noise around API Gateways and Service Mesh. However, it’s 2020 and there is still abundant confusion around these topics. I have chosen to write this to help bring real concrete explanation to help clarify differences, overlap, and when to use which. Feel free to [@ me on twitter (@christianposta)][6] if you feel I’m adding to the confusion, disagree, or wish to buy me a beer (and these are not mutually exclusive reasons). - -**The impact:** Yes, though they use similar terms and concepts they have different concerns and scopes. - -## [What Australia's AGL Energy learned about Cloud Native compliance][7] - -> This is really at the heart of what open source is, enabling everybody to contribute equally. Within large enterprises, there are controls that are needed, but if we can automate the management of the majority of these controls, we can enable an amazing culture and development experience. - -**The impact:** They say "software is eating the world" and "developers are the new kingmakers." The fact that compliance in an energy utility is subject to developer experience improvement basically proves both statements. - -## [Monoliths are the future][8] - -> And then what they end up doing is creating 50 deployables, but it’s really a _distributed_ monolith. So it’s actually the same thing, but instead of function calls and class instantiation, they’re initiating things and throwing it over a network and hoping that it comes back. And since they can’t reliably _make it_ come back, they introduce things like [Prometheus][9], [OpenTracing][10], all of this stuff. I’m like, **“What are you doing?!”** - -**The impact:** Do things for real reasons with a clear-eyed understanding of what those reasons are and how they'll make your business or your organization better. - -_I hope you enjoyed this list of what stood out to me from last week and come back next Monday for more open source community, market, and industry trends._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/linux-java-and-other-industry-news - -作者:[Tim Hildred][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/thildred -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) -[2]: https://www.theregister.co.uk/2020/01/30/linux_5_6_2038/ -[3]: https://lkml.org/lkml/2020/1/29/355 -[4]: https://whatthedev.buzzsprout.com/673192/2543290-celebrating-java-s-25th-anniversary-episode-16 -[5]: https://blog.christianposta.com/microservices/do-i-need-an-api-gateway-if-i-have-a-service-mesh/ (Do I Need an API Gateway if I Use a Service Mesh?) -[6]: http://twitter.com/christianposta?lang=en -[7]: https://thenewstack.io/what-australias-agl-energy-learned-about-cloud-native-compliance/ -[8]: https://changelog.com/posts/monoliths-are-the-future -[9]: https://prometheus.io/ -[10]: https://opentracing.io diff --git a/sources/news/20200211 Building a Linux desktop, CERN powered by Ceph, and more industry trends.md b/sources/news/20200211 Building a Linux desktop, CERN powered by Ceph, and more industry trends.md deleted file mode 100644 index 424f69bcc2..0000000000 --- a/sources/news/20200211 Building a Linux desktop, CERN powered by Ceph, and more industry trends.md +++ /dev/null @@ -1,66 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Building a Linux desktop, CERN powered by Ceph, and more industry trends) -[#]: via: (https://opensource.com/article/20/2/linux-desktop-cern-more-industry-trends) -[#]: author: (Tim Hildred https://opensource.com/users/thildred) - -Building a Linux desktop, CERN powered by Ceph, and more industry trends -====== -A weekly look at open source community and industry trends. -![Person standing in front of a giant computer screen with numbers, data][1] - -As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. - -## [Building a Linux desktop for cloud-native development][2] - -> This post covers the building of my Linux Desktop PC for Cloud Native Development. I'll be covering everything from parts, to peripherals, to CLIs, to SaaS software with as many links and snippets as I can manage. I hope that you enjoy reading about my experience, learn something, and possibly go on to build your own Linux Desktop. - -**The impact**: I hope the irony is not lost on anyone that step 1, when doing cloud-native software development, is to install Linux on a physical computer. - -## [Enabling CERN’s particle physics research with open source][3] - -> Ceph is an open-source software-defined storage platform. While it’s not often in the spotlight, it’s working hard behind the scenes, playing a crucial role in enabling ambitious, world-renowned projects such as CERN’s particle physics research, Immunity Bio’s cancer research, The Human Brain Project, MeerKat radio telescope, and more. These ventures are propelling the collective understanding of our planet and the human race beyond imaginable realms, and the outcomes will forever change how we perceive our existence and potential.  - -**The impact**: It is not often that you get to see a straight line drawn between storage and the perception of human existence. Thanks for that, CERN! - -## [2020 cloud predictions][4] - -> "Serverless" as a concept provides a simplified developer experience that will become a platform feature. More platform-as-a-service providers will incorporate serverless traits into the daily activities developers perform when building cloud-native applications, becoming the default computing paradigm for the cloud. - -**The impact:** All of the trends in the predictions in this post are basically about maturation as ideas like serverless, edge computing, DevOps, and other cloud-adjacent buzz words move from the early adopters into the early majority phase of the adoption curve. - -## [End-of-life announcement for CoreOS Container Linux][5] - -> As we've [previously announced][6], [Fedora CoreOS][7] is the official successor to CoreOS Container Linux. Fedora CoreOS is a [new Fedora Edition][8] built specifically for running containerized workloads securely and at scale. It combines the provisioning tools and automatic update model of Container Linux with the packaging technology, OCI support, and SELinux security of Atomic Host. For more on the Fedora CoreOS philosophy, goals, and design, see the [announcement of the preview release][9] and the [Fedora CoreOS documentation][10]. - -**The impact**: Milestones like this are often bittersweet for both creators and users. The CoreOS team built something that their community loved to use, which is something to be celebrated. Hopefully, that community can find a [new home][11] in the wider [Fedora ecosystem][8]. - -_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/linux-desktop-cern-more-industry-trends - -作者:[Tim Hildred][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/thildred -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) -[2]: https://blog.alexellis.io/building-a-linux-desktop-for-cloud-native-development/ -[3]: https://insidehpc.com/2020/02/how-ceph-powers-exciting-research-with-open-source/ -[4]: https://www.devopsdigest.com/2020-cloud-predictions-2 -[5]: https://coreos.com/os/eol/ -[6]: https://groups.google.com/d/msg/coreos-user/zgqkG88DS3U/PFP9yrKbAgAJ -[7]: https://getfedora.org/coreos/ -[8]: https://fedoramagazine.org/fedora-coreos-out-of-preview/ -[9]: https://fedoramagazine.org/introducing-fedora-coreos/ -[10]: https://docs.fedoraproject.org/en-US/fedora-coreos/ -[11]: https://getfedora.org/en/coreos/ diff --git a/sources/news/20200212 OpenShot Video Editor Gets a Major Update With Version 2.5 Release.md b/sources/news/20200212 OpenShot Video Editor Gets a Major Update With Version 2.5 Release.md deleted file mode 100644 index bb3b2dc59a..0000000000 --- a/sources/news/20200212 OpenShot Video Editor Gets a Major Update With Version 2.5 Release.md +++ /dev/null @@ -1,115 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (OpenShot Video Editor Gets a Major Update With Version 2.5 Release) -[#]: via: (https://itsfoss.com/openshot-2-5-release/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -OpenShot Video Editor Gets a Major Update With Version 2.5 Release -====== - -[OpenShot][1] is one of the [best open-source video editors][2] out there. With all the features that it offered – it was already a good video editor on Linux. - -Now, with a major update to it (**v.2.5.0**), OpenShot has added a lot of new improvements and features. And, trust me, it’s not just any regular release – it is a huge release packed with features that you probably wanted for a very long time. - -In this article, I will briefly mention the key changes involved in the latest release. - -![][3] - -### OpenShot 2.5.0 Key Features - -Here are some of the major new features and improvements in OpenShot 2.5: - -#### Hardware Acceleration Support - -The hardware acceleration support is still an experimental addition – however, it is a useful feature to have. - -Instead of relying on your CPU to do all the hard work, you can utilize your GPU to encode/decode video data when working with MP4/H.264 video files. - -This will affect (or improve) the performance of OpenShot in a meaningful way. - -#### Support Importing/Exporting Files From Final Cut Pro & Premiere - -![][4] - -[Final Cut Pro][5] and [Adobe Premiere][6] are the two popular video editors for professional content creators. OpenShot 2.5 now allows you to work on projects created on these platforms. It can import (or export) the files from Final Cut Pro & Premiere in EDL & XML formats. - -#### Thumbnail Generation Improved - -This isn’t a big feature – but a necessary improvement to most of the video editors. You don’t want broken images in the thumbnails (your timeline/library). So, with this update, OpenShot now generates the thumbnails using a local HTTP server, can check multiple folder locations, and regenerate missing ones. - -#### Blender 2.8+ Support - -The new OpenShot release also supports the latest [Blender][7] (.blend) format – so it should come in handy if you’re using Blender as well. - -#### Easily Recover Previous Saves & Improved Auto-backup - -![][8] - -It was always a horror to lose your timeline work after you accidentally deleted it – which was then auto-saved to overwrite your saved project. - -Now, the auto-backup feature has improved with an added ability to easily recover your previous saved version of the project. - -Even though you can recover your previous saves now – you will find a limited number of the saved versions, so you have to still remain careful. - -#### Other Improvements - -In addition to all the key highlights mentioned above, you will also notice a performance improvement when using the keyframe system. - -Several other issues like SVG compatibility, exporting & modifying keyframe data, and resizable preview window have been fixed in this major update. For privacy-concerned users, OpenShot no longer sends usage data unless you opt-in to share it with them. - -For more information, you can take a look at [OpenShot’s official blog post][9] to get the release notes. - -### Installing OpenShot 2.5 on Linux - -You can simply download the .AppImage file from its [official download page][10] to [install the latest OpenShot version][11]. If you’re new to AppImage, you should also check out [how to use AppImage][12] on Linux to easily launch OpenShot. - -[Download Latest OpenShot Release][10] - -Some distributions like Arch Linux may also provide the latest OpenShot release with regular system updates. - -#### PPA available for Ubuntu-based distributions - -On Ubuntu-based distributions, if you don’t want to use AppImage, you can [use the official PPA][13] from OpenShot: - -``` -sudo add-apt-repository ppa:openshot.developers/ppa -sudo apt update -sudo apt install openshot-qt -``` - -You may want to know how to remove PPA if you want to uninstall it later. - -**Wrapping Up** - -With all the latest changes/improvements considered, do you see [OpenShot][11] as your primary [video editor on Linux][14]? If not, what more do you expect to see in OpenShot? Feel free to share your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/openshot-2-5-release/ - -作者:[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://www.openshot.org/ -[2]: https://itsfoss.com/open-source-video-editors/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/openshot-2-5-0.png?ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/openshot-xml-edl.png?ssl=1 -[5]: https://www.apple.com/in/final-cut-pro/ -[6]: https://www.adobe.com/in/products/premiere.html -[7]: https://www.blender.org/ -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/openshot-recovery.jpg?ssl=1 -[9]: https://www.openshot.org/blog/2020/02/08/openshot-250-released-video-editing-hardware-acceleration/ -[10]: https://www.openshot.org/download/ -[11]: https://itsfoss.com/openshot-video-editor-release/ -[12]: https://itsfoss.com/use-appimage-linux/ -[13]: https://itsfoss.com/ppa-guide/ -[14]: https://itsfoss.com/best-video-editing-software-linux/ diff --git a/sources/news/20200213 KDE Plasma 5.18 LTS Released With New Features.md b/sources/news/20200213 KDE Plasma 5.18 LTS Released With New Features.md deleted file mode 100644 index 8100290280..0000000000 --- a/sources/news/20200213 KDE Plasma 5.18 LTS Released With New Features.md +++ /dev/null @@ -1,121 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (KDE Plasma 5.18 LTS Released With New Features) -[#]: via: (https://itsfoss.com/kde-plasma-5-18-release/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -KDE Plasma 5.18 LTS Released With New Features -====== - -[KDE plasma][1] desktop is undoubtedly one of the most impressive [Linux desktop environments][2] available out there right now. - -Now, with the latest release, the KDE Plasma desktop just got more awesome! - -KDE Plasma 5.18 marks itself as an LTS (Long Term Support) release i.e it will be maintained by the KDE contributors for the next 2 years while the regular versions are maintained for just 4 months. - -![KDE Plasma 5.18 on KDE Neon][3] - -So, if you want more stability on your KDE-powered Linux system, it would be a good idea to upgrade to KDE’s Plasma 5.18 LTS release. - -### KDE Plasma 5.18 LTS Features - -Here are the main new features added in this release: - -#### Emoji Selector - -![Emoji Selector in KDE][4] - -Normally, you would Google an emoji to copy it to your clipboard or simply use the good-old emoticons to express yourself. - -Now, with the latest update, you get an emoji selector in Plasma Desktop. You can simply find it by searching for it in the application launcher or by just pressing (Windows key/Meta/Super Key) + . (**period/dot)**. - -The shortcut should come in handy when you need to use an emoji while sending an email or any other sort of messages. - -#### Global Edit Mode - -![Global Edit Mode][5] - -You probably would have used the old desktop toolbox on the top-right corner of the screen in the Plasma desktop, but the new release gets rid of that and instead – provides you with a global edit mode when you right-click on the desktop and click on “**Customize Layout**“. - -#### Night Color Control - -![Night Color Control][6] - -Now, you can easily toggle the night color mode right from the system tray. In addition to that, you can even choose to set a keyboard shortcut for both night color and the do not disturb mode. - -#### Privacy Improvements For User Feedback - -![Improved Privacy][7] - -It is worth noting that KDE Plasma lets you control the user feedback information that you share with them. - -You can either choose to disable sharing any information at all or control the level of information you share (basic, intermediate, and detailed). - -#### Global Themes - -![Themes][8] - -You can either choose from the default global themes available or download community-crafted themes to set up on your system. - -#### UI Improvements - -There are several subtle improvements and changes. For instance, the look and feel of the notifications have improved. - -You can also notice a couple of differences in the software center (Discover) to help you easily install apps. - -Not just limited to that, but you also get the ability to mute the volume of a window from the taskbar (just like you normally do on your browser’s tab). Similarly, there are a couple of changes here and there to improve the KDE Plasma experience. - -#### Other Changes - -In addition to the visual changes and customization ability, the performance of KDE Plasma has improved when coupled with a graphics hardware. - -To know more about the changes, you can refer the [official announcement post][9] for KDE Plasma 5.18 LTS. - -[Subscribe to our YouTube channel for more Linux videos][10] - -### How To Get KDE Plasma 5.18 LTS? - -If you are using a rolling release distribution like Arch Linux, you might have got it with the system updates. If you haven’t performed an update yet, simply check for updates from the system settings. - -If you are using Kubuntu, you can add the Kubuntu backports PPA to update the Plasma desktop with the following commands: - -``` -sudo add-apt-repository ppa:kubuntu-ppa/backports -sudo apt update && sudo apt full-upgrade -``` - -If you do not have KDE as your desktop environment, you can refer our article on [how to install KDE on Ubuntu][11] to get started. - -**Wrapping Up** - -KDE Plasma 5.18 may not involve a whole lot of changes – but being an LTS release, the key new features seem helpful and should come in handy to improve the Plasma desktop experience for everyone. - -What do you think about the latest Plasma desktop release? Feel free to let me know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/kde-plasma-5-18-release/ - -作者:[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://kde.org/plasma-desktop/ -[2]: https://itsfoss.com/best-linux-desktop-environments/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-plasma-5-18-info.jpg?ssl=1 -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-plasma-emoji-pick.jpg?ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-plasma-global-editor.jpg?ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-plasma-night-color.jpg?ssl=1 -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/user-feedback-kde-plasma.png?ssl=1 -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-plasma-global-themes.jpg?ssl=1 -[9]: https://kde.org/announcements/plasma-5.18.0.php -[10]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[11]: https://itsfoss.com/install-kde-on-ubuntu/ diff --git a/sources/talk/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md b/sources/talk/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md index a2bca0089f..68ede9acfa 100644 --- a/sources/talk/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md +++ b/sources/talk/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (Morisun029) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20190503 Mirror your System Drive using Software RAID.md b/sources/tech/20190503 Mirror your System Drive using Software RAID.md index e72f3a5722..ba62a2f21a 100644 --- a/sources/tech/20190503 Mirror your System Drive using Software RAID.md +++ b/sources/tech/20190503 Mirror your System Drive using Software RAID.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (lixin555) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20191031 Advance your awk skills with two easy tutorials.md b/sources/tech/20191031 Advance your awk skills with two easy tutorials.md index 76f7a54e5f..f84e4ebe3a 100644 --- a/sources/tech/20191031 Advance your awk skills with two easy tutorials.md +++ b/sources/tech/20191031 Advance your awk skills with two easy tutorials.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (nacyro) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20191111 A guide to intermediate awk scripting.md b/sources/tech/20191111 A guide to intermediate awk scripting.md index 7e788b2adc..53e7126eb1 100644 --- a/sources/tech/20191111 A guide to intermediate awk scripting.md +++ b/sources/tech/20191111 A guide to intermediate awk scripting.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (lnrCoder) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20191118 How to use regular expressions in awk.md b/sources/tech/20191118 How to use regular expressions in awk.md index a0be0df4d7..2cf5881263 100644 --- a/sources/tech/20191118 How to use regular expressions in awk.md +++ b/sources/tech/20191118 How to use regular expressions in awk.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (lixin555) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md b/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md index 03fc77a8e1..3172f26ea1 100644 --- a/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md +++ b/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (summer2233) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md b/sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md deleted file mode 100644 index 0f087529b9..0000000000 --- a/sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md +++ /dev/null @@ -1,87 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (BrunoJu) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Kali Linux Will No Longer Have The Default Root User) -[#]: via: (https://itsfoss.com/kali-linux-root-user/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Kali Linux Will No Longer Have The Default Root User -====== - -Kali Linux is a specialized Linux distribution for cyber security testing and hacking related tasks. - -If you’ve used [Kali Linux][1], you probably know that it followed a default root user policy. In other words, you are always root in Kali Linux. Whatever you do – you will be accessing tools/applications as root by default. - -It looks like everything back then was kind of “root for all” for everything. So, the default root user policy existed. - -They also explained the history for this in their [announcement post][2]: - -> A lot of those tools back then either required root access to run or ran better when ran as root. With this operating system that would be ran from a CD, never be updated, and had a lot of tools that needed root access to run it was a simple decision to have a “everything as root” security model. It made complete sense for the time. - -### Kali Linux will now have a default non-root user (like most other distributions) - -![][3] - -A default non-root model was necessary because a lot of users now use Kali Linux as their daily driver. - -Of course, they [do not recommend using Kali Linux][4] as a replacement for stable distributions like Ubuntu/Fedora/Manjaro – however, with its active development, some users do consider using it on a day-to-day basis instead of just using it for its tools. - -So, with a wide mainstream usage of the distro, the Kali Linux team thought of switching to a default non-root model because nowadays a lot of applications/tools do not require root access. - -> While we don’t encourage people to run Kali as their day to day operating system, over the last few years more and more users have started to do so _(even if they are not using it to do penetration testing full time)_, including some members of the Kali development team. When people do so, they obviously don’t run as default root user. With this usage over time, there is the obvious conclusion that default root user is no longer necessary and Kali will be better off moving to a more traditional security model. - -So I am reiterating that you should not consider Kali Linux to be fit for your daily tasks if you do not utilize security-related [Kali Linux tools][5]. Feel free to experiment – but I wouldn’t be so sure to rely on it. - -So from the next release, when you install Kali Linux, you’ll be asked to create non-root user that will have admin privileges. Tools and commands that require root access will be run with sudo. - -![][6] - -#### [Pretend to be Using Windows with Kali Linux Undercover Mode][7] - -The new undercover mode in Kali Linux switches the desktop layout to make it look like Windows 10. Find out how to activate the undercover mode. - -### New default user and password for Kali Linux live mode - -![Kali Linux has new user-password in the live system][8] - -Technically, you won’t find a groundbreaking difference. Just note that the default user ID and password in live mode is “**kali**“. - -You can find the new non-root model implemented in the new daily/weekly builds if you want to test it early. - -In either case, you can wait for the 2020.1 release scheduled for late January to take a look at the new default non-root user model. - -### Getting back the old root model in Kali Linux - -If you are a long time Kali Linux user, you may not find it convenient to add sudo before commands and then manually enter the password. - -The good news here is that you can still get the old password-less root rights with this command: - -``` -sudo dpkg-reconfigure kali-grant-root -``` - -What do you think about the default non-root user model? Is it a good decision? Let me know your thoughts in the comments. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/kali-linux-root-user/ - -作者:[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://www.kali.org/ -[2]: https://www.kali.org/news/kali-default-non-root-user/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/kali_linux_default_root_user.png?ssl=1 -[4]: https://itsfoss.com/kali-linux-review/ -[5]: https://itsfoss.com/best-kali-linux-tools/ -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/11/kali_linux_undercover_mode.jpg?fit=800%2C450&ssl=1 -[7]: https://itsfoss.com/kali-linux-undercover-mode/ -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/kali-linux-live-password.png?ssl=1 diff --git a/sources/tech/20200113 How to setup a DNS server with bind.md b/sources/tech/20200113 How to setup a DNS server with bind.md index 74cc32e747..897dc825a8 100644 --- a/sources/tech/20200113 How to setup a DNS server with bind.md +++ b/sources/tech/20200113 How to setup a DNS server with bind.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (lxbwolf) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8850cbbdc4f4fdc054733314702fd3e369847a4e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 22:40:49 +0800 Subject: [PATCH 251/315] =?UTF-8?q?=E8=B6=85=E6=9C=9F=E5=9B=9E=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @MonkeyDEcho --- sources/tech/20180416 Cgo and Python.md | 1 - ...181105 5 Minimal Web Browsers for Linux.md | 171 ------------------ 2 files changed, 172 deletions(-) delete mode 100644 sources/tech/20181105 5 Minimal Web Browsers for Linux.md diff --git a/sources/tech/20180416 Cgo and Python.md b/sources/tech/20180416 Cgo and Python.md index c78a820276..e5688d43c8 100644 --- a/sources/tech/20180416 Cgo and Python.md +++ b/sources/tech/20180416 Cgo and Python.md @@ -1,5 +1,4 @@ Cgo and Python -[#] MonkeyDEcho translating ============================================================ ![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_hero.png?auto=format&w=1900&dpr=1) diff --git a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md deleted file mode 100644 index 34c0c1e18e..0000000000 --- a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md +++ /dev/null @@ -1,171 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MonkeyDEcho ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (5 Minimal Web Browsers for Linux) -[#]: via: (https://www.linux.com/blog/intro-to-linux/2018/11/5-minimal-web-browsers-linux) -[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) -[#]: url: ( ) - -5 Minimal Web Browsers for Linux -====== -linux上的五种微型浏览器 -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimal.jpg?itok=ifA0Y3pV) - -There are so many reasons to enjoy the Linux desktop. One reason I often state up front is the almost unlimited number of choices to be found at almost every conceivable level. From how you interact with the operating system (via a desktop interface), to how daemons run, to what tools you use, you have a multitude of options. -有太多理由去选择使用linux系统。很重要的一个理由是,我们可以按照我们自己的想法去选择想要的。从操作系统的交互方式(桌面系统)到守护系统的运行方式,在到使用的工具,你用更多的选择。 - -The same thing goes for web browsers. You can use anything from open source favorites, such as [Firefox][1] and [Chromium][2], or closed sourced industry darlings like [Vivaldi][3] and [Chrome][4]. Those options are full-fledged browsers with every possible bell and whistle you’ll ever need. For some, these feature-rich browsers are perfect for everyday needs. -web浏览器也是如此。你可以使用开源的[火狐][1],[Chromium][2];或者未开源的[Vivaldi][3],[Chrome][4]。这些功能强大的浏览器有你需要的各种功能。对于某些人,这些功能完备的浏览器是日常必需的。 - -There are those, however, who prefer using a web browser without all the frills. In fact, there are many reasons why you might prefer a minimal browser over a standard browser. For some, it’s about browser security, while others look at a web browser as a single-function tool (as opposed to a one-stop shop application). Still others might be running low-powered machines that cannot handle the requirements of, say, Firefox or Chrome. Regardless of the reason, Linux has you covered. -但是,有些人更喜欢没有冗余功能的纯粹的浏览器。实际上,有很多原因导致你会选择微型的浏览器而不选择上述功能完备的浏览器。对于某些人来说,与浏览器的安全有关;而有些人则将浏览器当作一种简单的工具(而不是一站式商店应用程序);还有一些可能运行在低功率的计算机上,这些计算机无法满足火狐,chrome浏览器的运行要求。无论出于何种原因,在linux系统上都可以满足你的要求。 - -Let’s take a look at five of the minimal browsers that can be installed on Linux. I’ll be demonstrating these browsers on the Elementary OS platform, but each of these browsers are available to nearly every distribution in the known Linuxverse. Let’s dive in. -让我们看一下可以在linux上安装运行的五种微型浏览器。我将在 Elementary 的操作系统平台上演示这些浏览器,在已知的linux发型版中几乎每个版本都可以使用这些浏览器。让我们一起来看一下吧! - -### GNOME Web - -GNOME Web (codename Epiphany, which means [“a usually sudden manifestation or perception of the essential nature or meaning of something”][5]) is the default web browser for Elementary OS, but it can be installed from the standard repositories. (Note, however, that the recommended installation of Epiphany is via Flatpak or Snap). If you choose to install via the standard package manager, issue a command such as sudo apt-get install epiphany-browser -y for successful installation. -GNOME web (Epiphany 含义:[顿悟][5])是Elementary系统默认的web浏览器,也可以从标准存储库中安装。(注意,建议通过使用 Flatpak 或者 Snap 工具安装),如果你想选择标准软件包管理器进行安装,请执行 ```sudo apt-get install epiphany-browser -y``` 命令成功安装。 - -Epiphany uses the WebKit rendering engine, which is the same engine used in Apple’s Safari browser. Couple that rendering engine with the fact that Epiphany has very little in terms of bloat to get in the way, you will enjoy very fast page-rendering speeds. Epiphany development follows strict adherence to the following guidelines: - - * Simplicity - Feature bloat and user interface clutter are considered evil. - - * Standards compliance - No non-standard features will ever be introduced to the codebase. - - * Software freedom - Epiphany will always be released under a license that respects freedom. - - * Human interface - Epiphany follows the [GNOME Human Interface Guidelines][6]. - - * Minimal preferences - Preferences are only added when they make sense and after careful consideration. - - * Target audience - Non-technical users are the primary target audience (which helps to define the types of features that are included). - - - - -GNOME Web is as clean and simple a web browser as you’ll find (Figure 1). - -![GNOME Web][8] - -Figure 1: The GNOME Web browser displaying a minimal amount of preferences for the user. - -[Used with permission][9] - -The GNOME Web manifesto reads: - -A web browser is more than an application: it is a way of thinking, a way of seeing the world. Epiphany's principles are simplicity, standards compliance, and software freedom. - -### Netsurf - -The [Netsurf][10] minimal web browser opens almost faster than you can release the mouse button. Netsurf uses its own layout and rendering engine (designed completely from scratch), which is rather hit and miss in its rendering (Figure 2). - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_2.jpg?itok=KhGhIKlj) - -Although you might find Netsurf to suffer from rendering issues on certain sites, understand the Hubbub HTML parser is following the work-in-progress HTML5 specification, so there will be issues popup now and then. To ease those rendering headaches, Netsurf does include HTTPS support, web page thumbnailing, URL completion, scale view, bookmarks, full-screen mode, keyboard shorts, and no particular GUI toolkit requirements. That last bit is important, especially when you switch from one desktop to another. - -For those curious as to the requirements for Netsurf, the browser can run on a machine as slow as a 30Mhz ARM 6 computer with 16MB of RAM. That’s impressive, by today’s standard. - -### QupZilla - -If you’re looking for a minimal browser that uses the Qt Framework and the QtWebKit rendering engine, [QupZilla][11] might be exactly what you’re looking for. QupZilla does include all the standard features and functions you’d expect from a web browser, such as bookmarks, history, sidebar, tabs, RSS feeds, ad blocking, flash blocking, and CA Certificates management. Even with those features, QupZilla still manages to remain a very fast lightweight web browser. Other features include: Fast startup, speed dial homepage, built-in screenshot tool, browser themes, and more. -One feature that should appeal to average users is that QupZilla has a more standard preferences tools than found in many lightweight browsers (Figure 3). So, if going too far outside the lines isn’t your style, but you still want something lighter weight, QupZilla is the browser for you. - -![QupZilla][13] - -Figure 3: The QupZilla preferences tool. - -[Used with permission][9] - -### Otter Browser - -Otter Browser is a free, open source attempt to recreate the closed-source offerings found in the Opera Browser. Otter Browser uses the WebKit rendering engine and has an interface that should be immediately familiar with any user. Although lightweight, Otter Browser does include full-blown features such as: - - * Passwords manager - - * Add-on manager - - * Content blocking - - * Spell checking - - * Customizable GUI - - * URL completion - - * Speed dial (Figure 4) - - * Bookmarks and various related features - - * Mouse gestures - - * User style sheets - - * Built-in Note tool - - -![Otter][15] - -Figure 4: The Otter Browser Speed Dial tab. - -[Used with permission][9] - -Otter Browser can be run on nearly any Linux distribution from an [AppImage][16], so there’s no installation required. Just download the AppImage file, give the file executable permissions (with the command chmod u+x otter-browser-*.AppImage), and then launch the app with the command ./otter-browser*.AppImage. - -Otter Browser does an outstanding job of rendering websites and could function as your go-to minimal browser with ease. - -### Lynx - -Let’s get really minimal. When I first started using Linux, back in ‘97, one of the web browsers I often turned to was a text-only take on the app called [Lynx][17]. It should come as no surprise that Lynx is still around and available for installation from the standard repositories. As you might expect, Lynx works from the terminal window and doesn’t display pretty pictures or render much in the way of advanced features (Figure 5). In fact, Lynx is as bare-bones a browser as you will find available. Because of how bare-bones this web browser is, it’s not recommended for everyone. But if you happen to have a gui-less web server and you have a need to be able to read the occasional website, Lynx can be a real lifesaver. - -![Lynx][19] - -Figure 5: The Lynx browser rendering the Linux.com page. - -[Used with permission][9] - -I have also found Lynx an invaluable tool when troubleshooting certain aspects of a website (or if some feature on a website is preventing me from viewing the content in a regular browser). Another good reason to use Lynx is when you only want to view the content (and not the extraneous elements). - -### Plenty More Where This Came From - -There are plenty more minimal browsers than this. But the list presented here should get you started down the path of minimalism. One (or more) of these browsers are sure to fill that need, whether you’re running it on a low-powered machine or not. - -Learn more about Linux through the free ["Introduction to Linux" ][20]course from The Linux Foundation and edX. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/intro-to-linux/2018/11/5-minimal-web-browsers-linux - -作者:[Jack Wallen][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/jlwallen -[b]: https://github.com/lujun9972 -[1]: https://www.mozilla.org/en-US/firefox/new/ -[2]: https://www.chromium.org/ -[3]: https://vivaldi.com/ -[4]: https://www.google.com/chrome/ -[5]: https://www.merriam-webster.com/dictionary/epiphany -[6]: https://developer.gnome.org/hig/stable/ -[7]: /files/images/minimalbrowsers1jpg -[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_1.jpg?itok=Q7wZLF8B (GNOME Web) -[9]: /licenses/category/used-permission -[10]: https://www.netsurf-browser.org/ -[11]: https://qupzilla.com/ -[12]: /files/images/minimalbrowsers3jpg -[13]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_3.jpg?itok=O8iMALWO (QupZilla) -[14]: /files/images/minimalbrowsers4jpg -[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_4.jpg?itok=5bCa0z-e (Otter) -[16]: https://sourceforge.net/projects/otter-browser/files/ -[17]: https://lynx.browser.org/ -[18]: /files/images/minimalbrowsers5jpg -[19]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_5.jpg?itok=p_Lmiuxh (Lynx) -[20]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From cd96fd2215eb1dcb5e92974e060d9f9c62c117b1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 22:45:05 +0800 Subject: [PATCH 252/315] TSL --- .../tech/20181231 Troubleshooting hardware problems in Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20181231 Troubleshooting hardware problems in Linux.md (100%) diff --git a/sources/tech/20181231 Troubleshooting hardware problems in Linux.md b/translated/tech/20181231 Troubleshooting hardware problems in Linux.md similarity index 100% rename from sources/tech/20181231 Troubleshooting hardware problems in Linux.md rename to translated/tech/20181231 Troubleshooting hardware problems in Linux.md From 90a3e3db8f716d7d398d4ba3181cf04429d1ce1b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 3 Mar 2020 00:54:20 +0800 Subject: [PATCH 253/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200303=20Sessio?= =?UTF-8?q?n:=20An=20Open=20Source=20Private=20Messenger=20That=20Doesn?= =?UTF-8?q?=E2=80=99t=20Need=20Your=20Phone=20Number?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md --- ...ger That Doesn-t Need Your Phone Number.md | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md diff --git a/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md b/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md new file mode 100644 index 0000000000..bc4dece67e --- /dev/null +++ b/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md @@ -0,0 +1,143 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Session: An Open Source Private Messenger That Doesn’t Need Your Phone Number) +[#]: via: (https://itsfoss.com/session-messenger/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Session: An Open Source Private Messenger That Doesn’t Need Your Phone Number +====== + +_**Brief: Our open source software highlight of the week is Session. It is a fork of another increasingly popular private messenger Signal. Session doesn’t even need your phone number to operate.**_ + +### Session: A private messenger in true sense + +![][1] + +Privacy concerned people are always in the search of an ultimate service that lets you communicate securely while respecting our privacy across multiple platforms. + +Recently, I came across an interesting open-source messaging app “[Session][2]” by [Loki Foundation][3], which is technically a fork of another [open source encrypted messenger Signal][4]. + +In this article, I’ll be sharing my experience with the Session app while highlighting the features it offers. + +Session is fairly new to the scene – I’ve mentioned some of the bugs that I encountered at the bottom of the article. + +### Features of Session Messenger + +I’ll highlight the key features of Session that will help you decide if it’s good enough for you to try. + +#### Session does not require a phone number + +![][5] + +For privacy-enthusiasts, registering the phone number with Signal or other such applications is a potential risk. + +But, with Session, you do not need a phone number, simply click on “**Create Account**” after you install it on your desktop or phone and it will simply generate a random (unique) **Session ID**. + +It’ll look something like this: **05652245af9a8bfee4f5a8138fd5c……..** + +So, you just have to share your Session ID with the contact you want to add. Or, you can also opt to get the **QR Code** after account creation which you can share with your friends to add you back. + +#### Session uses blockchain (and other crypto tech) + +![Session ID][6] + +For the users who’re aware of what a [blockchain][7] is – they’ve been waiting for real-world applications that an average user can utilize. Session is one such example that utilizes blockchain at its core and you don’t need to know it’s there. + +If you’re curious about how it works, you can take a look at their [official blog post][8] explaining it. + +#### Cross-Platform Support + +![][9] + +For something strictly privacy-focused, you’d also want it to be available across multiple platforms. + +Of course, primarily, I’d focus on the Linux and Android support but it also supports Windows/Mac/iOS. So, you can easily sync between multiple devices cross-platform. + +#### Includes Essential Privacy Options + +![][10] + +Undoubtedly, it offers some essential privacy-focused features that will help make the experience more secure. + +For starters, you have the following options: + + * **Message TTL**: This lets you control how long the message exists before the recipient sees the message. + * **Read Receipts**: Let others know that you’ve seen the message or if your message has been read. + + + +#### Session uses a decentralized network and protects your metadata + +Even though Session isn’t a peer-to-peer technology, it does not have a central server for the network. + +It takes a decentralized approach to how the messages are transmitted (or routed). If you’ve no idea what I’m talking about, you can follow Session’s official blog post to know the [difference between centralization and decentralization][11] and explore how it potentially works. + +And, this approach of network helps them to protect the metadata (the information associated with a message like IP address). + +#### Other Features + +Not just limited to the latest/greatest privacy-friendly features, but it also supports group chats, voice messages, and also allows you to send attachments. + +### Installing Session on Linux + +If you head to the [official download page][12], you will be able to download an .**AppImage** file. In case you have no clue how it works, you should take a look at our article on [how to use AppImage][13]. + +In either case, you can also head to their [GitHub releases page][14] and grab the **.deb** file. + +[Download Session][12] + +### My Experience On Using Session App + +I’ve managed to try it on multiple platforms. For the desktop, I utilized the .AppImage file on **Pop!_OS 19.10** to run Session. + +Overall, the user experience was impressive and had no UI glitches. + +It’s also easy to recover your account once you’ve backed up your secret code (which is known as **seed**) from the settings. + +![][15] + +But, I also noticed a couple of issues- which can be fixed/improved: + + * Delay in accepting a friend request + * The way of linking devices is not intuitive + * Sometimes when you reply from two separate devices (using the same ID), the receiver gets two different conversations. + + + +**Conclusion** + +Of course, nothing’s ever perfect. For now, I’m thinking of keeping it installed and considering Session’s features, it is definitely something a privacy-focused user should try. + +What do you think about it? Feel free to let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/session-messenger/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-app.jpg?ssl=1 +[2]: https://getsession.org/ +[3]: https://loki.foundation/ +[4]: https://itsfoss.com/signal-messaging-app/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-create.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/session-application-id.jpg?ssl=1 +[7]: https://en.wikipedia.org/wiki/Blockchain +[8]: https://getsession.org/how-session-protects-your-anonymity-with-blockchain-and-crypto/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-cross-platform.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-settings.jpg?fit=800%2C512&ssl=1 +[11]: https://getsession.org/centralisation-vs-decentralisation-in-private-messaging/ +[12]: https://getsession.org/download/ +[13]: https://itsfoss.com/use-appimage-linux/ +[14]: https://github.com/loki-project/session-desktop/releases +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-seed.jpg?ssl=1 From 64c310139c390e7d12d9075d3ee858edbe1cd3fb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 3 Mar 2020 00:55:35 +0800 Subject: [PATCH 254/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200302=20Instal?= =?UTF-8?q?l=20GNU=20Emacs=20on=20Windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200302 Install GNU Emacs on Windows.md --- .../20200302 Install GNU Emacs on Windows.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sources/tech/20200302 Install GNU Emacs on Windows.md diff --git a/sources/tech/20200302 Install GNU Emacs on Windows.md b/sources/tech/20200302 Install GNU Emacs on Windows.md new file mode 100644 index 0000000000..be429efe50 --- /dev/null +++ b/sources/tech/20200302 Install GNU Emacs on Windows.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Install GNU Emacs on Windows) +[#]: via: (https://opensource.com/article/20/3/emacs-windows) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Install GNU Emacs on Windows +====== +Even if your operating system is closed source, you can still use this +popular open source text editor. +![Tall building with windows][1] + +GNU Emacs is a popular text editor designed for programmers of all sorts. Because it was developed on Unix and is widely used on Linux (and shipped with macOS), people sometimes don't realize that it's also available for Microsoft Windows. You don't need to be an experienced or full-time programmer to make use of Emacs, either. You can download and install Emacs with just a few clicks, and this article shows you how. + +You can install Windows manually or with a package manager, like [Chocolatey][2]. + +### 7-zip + +If you haven't already installed 7-zip for Windows, you should do that first. [7-zip][3] is an open source archive utility with the ability to create and extract ZIP, 7z, TAR, XZ, BZIP2, and GZIP (and more) files. It's an invaluable tool for Windows users. + +After installing 7-zip, you have new 7-zip archive options in your right-click menu when browsing files in Windows Explorer. + +### Powershell and Chocolatey + +To install GNU Emacs on Windows using Chocolatey: + + +``` +`PS> choco install emacs-full` +``` + +Once it has installed, launch Emacs from Powershell: + + +``` +`PS> emacs` +``` + +![Emacs running on Windows][4] + +### Download GNU Emacs for Windows + +To manually install GNU Emacs on Windows, you must [download Emacs][5]. + +![GNU Windows downloader][6] + +This takes you to a server near you, which shows you a list of all available Emacs releases. Find the directory with the highest release number and click into it. There are many different builds of Emacs for Windows, but the most general-purpose version is just named **emacs-VERSION-ARCHITECTURE.zip**. The **VERSION** depends upon which release you're downloading, while the **ARCHITECTURE** depends on whether you have a 32-bit or 64-bit machine. Most modern computers are 64-bit, but if you're in doubt you can download the 32-bit version, which runs on both. + +If you're downloading version 26 of Emacs for a 64-bit machine, you would click the link titled **emacs-26.2-x86_64.zip**. There are smaller downloads available (such as the **no-deps** variety) but you must be familiar with how Emacs is built from source code, knowing which libraries it needs and which of those your computer has on it already. Generally, it's easiest to get the large version of Emacs, because it contains everything it needs to run on your computer. + +### Extract Emacs + +Next, unarchive the ZIP file you downloaded. To extract it, right-click on the Emacs ZIP file and select **Extract to Emacs-VERSION** from the 7-zip sub-menu. It's a big archive, so it may take a while to uncompress, but when it does, you have a new directory containing all the files distributed with Emacs. For example, in this example, the file **emacs-26.2-x86_64.zip** was downloaded, so the unarchived directory is **emacs-26.2-x86_64**. + +### Launch Emacs + +Within the Emacs directory, find the **bin** directory. This folder stores all the binary executable files (EXE files) distributed with Emacs. Double-click the **emacs.exe** file to launch the application. + +![Emacs running on Windows][7] + +You can create a shortcut to **emacs.exe** on your desktop for easier access. + +### Learn Emacs + +Emacs isn't as obtuse as its reputation may indicate. It's got its own traditions and conventions, but when you're typing text into it, you can treat it exactly as you treat Notepad or any given text field on any given website. + +The important differences occur when you _edit_ the text you've typed. + +The only way to learn is to start using it, though, so make Emacs your go-to text editor for simple tasks. When you'd normally open Notepad or Word or Evernote or whatever it is you use for quick notes or as a temporary scratchpad, launch Emacs instead. + +Emacs has the reputation of being a terminal-based application, but obviously it has a GUI, so use the GUI often, just as you would with any application. Copy, cut, and paste (or "yank" in Emacs terminology) from the menu instead of with the keyboard, and open and save files from the menu or toolbar. Start from the beginning and learn the application based on what it is and not how you think it should act based on your experience with other editors. + +### Download our [cheatsheet][8]! + +_Thanks to Matthias Pfuetzner and Stephen Smoogen._ + +These are Jimmy's six favorite open source applications that he immediately installs on a new... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/emacs-windows + +作者:[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/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) +[2]: https://github.com/chocolatey/choco +[3]: https://www.7-zip.org/ +[4]: https://opensource.com/sites/default/files/uploads/windows-ps-choco-emacs.jpg (Emacs running on Windows) +[5]: https://www.gnu.org/software/emacs/download.html +[6]: https://opensource.com/sites/default/files/uploads/windows-emacs-download.jpg (GNU Windows downloader) +[7]: https://opensource.com/sites/default/files/uploads/windows-emacs.jpg (Emacs running on Windows) +[8]: https://opensource.com/downloads/emacs-cheat-sheet From ec7255480e6bcac1bde1267401c05181bca9767c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 3 Mar 2020 00:57:27 +0800 Subject: [PATCH 255/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200302=20Using?= =?UTF-8?q?=20LibreOffice=20for=20your=20open=20source=20budgeting=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200302 Using LibreOffice for your open source budgeting tool.md --- ...ice for your open source budgeting tool.md | 168 ++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 sources/tech/20200302 Using LibreOffice for your open source budgeting tool.md diff --git a/sources/tech/20200302 Using LibreOffice for your open source budgeting tool.md b/sources/tech/20200302 Using LibreOffice for your open source budgeting tool.md new file mode 100644 index 0000000000..9d26ff39c7 --- /dev/null +++ b/sources/tech/20200302 Using LibreOffice for your open source budgeting tool.md @@ -0,0 +1,168 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using LibreOffice for your open source budgeting tool) +[#]: via: (https://opensource.com/article/20/3/libreoffice-open-source-budget) +[#]: author: (Jess Weichler https://opensource.com/users/cyanide-cupcake) + +Using LibreOffice for your open source budgeting tool +====== +Figure out where your money is going with this LibreOffice Calc budget +template. +![scientific calculator][1] + +Budgets can be intimidating for beginners. It can feel overwhelming to think about money, much less about how to keep track of it. But it's important to know where your money is coming and going. + +In this article, I'll step through a sample budget by explaining the logic behind important money decisions as well as the formulas you need to automate the process. Fortunately, LibreOffice makes it easy for anyone to keep their yearly budget in check, even the math-averse. + +### Getting started + +Begin by downloading and installing [LibreOffice][2], if you don't already have it. Next, download my [LibreOffice Calc template][3], which you can use as a starting point to create your own budget to meet your spending and savings goals. + +It's important to interact with your spreadsheet frequently. You can input transactions as they happen, daily, or weekly. You even could save up your receipts to calculate all your expenses at the end of the month, but this can be a hard slog. You want budgeting to be as quick and easy as possible. + +### Categories + +The first step to creating a budget is to decide on the categories you want to track. These categories can be as simple or as complex as you like. Think about what is useful to your personal situation and financial goals. You can easily add or change categories as your needs change. + +The template has a number of example categories you can start with. There is no right or wrong way to choose categories; your budget has to work for you. Look through the list in Column A of the **Budget** tab and decide which ones to keep, which to delete, and any others you want to add. Then edit that list to align with your personal income and expense situation. + +#### Create category drop-down menus + +![Budget categories][4] + +The template uses a drop-down menu to make it easy to assign categories to income and expenses. You can view them on the **Monthly** sheets (accessed with the tabs at the bottom of the LibreOffice window). Click on a cell in Column C, and a drop-down arrow will appear on the right. Click the arrow, and you'll see the example categories. You may need to change some of them so that they will match the categories in your budget (Column A of the **Budget** tab). + +To add or remove categories from the dropdown menu, click on Column C in a Monthly sheet to select all **Category** cells. Then, in the main menu, select **Data** > **Validity**. This opens up a dialog box. + +In **Validity**, select the **Criteria** tab, then click on the arrow to the right of **Allow**, set it to **List**, and type the categories you want to use in the **Entries** box. Type one category per line. Make sure to use the exact same categories you used on the **Budget** sheet in Column A. + +### Estimating your budget + +Once you have defined your categories, it's time to estimate how much you expect to earn and spend. You can calculate these amounts monthly, yearly, or using a mix of the two. + +Your first year of budgeting estimates won't be perfect, and you may be surprised at how much or little you spend on certain categories. But doing this will help you get a realistic idea of where your money is going. You can make adjustments in your second year to create a more accurate budget based upon what you spend in year one. + +In Column B (**Monthly Estimate**) of the **Budget** tab, enter your anticipated _monthly_ income and expenses for each category (an exception is the **Charity** row, which is automatically calculated as a percentage of your income). For _annual_ expenses and income (e.g., taxes, insurance, tuition, etc.), enter them in Column P (**Yearly Estimate**). + +#### Calculating the annual cost of monthly expenses + +Most expenses occur monthly. To find the yearly cost of a monthly expense, multiply your monthly estimate by 12. You could do this manually for each category, but it is much easier to use formulas. + +Formulas are automated calculations that determine the value of a cell. Formulas do all the heavy lifting, so you don't have to do a lot of sums in your head. + +In the template, you can use the **Yearly Estimate** column to make an equation to annualize a monthly expense or income. In a cell in Column P, type this: + + +``` +`=SUM(x*12)` +``` + +but change _x_ to the name of the **Monthly Estimate** cell you want to use. (For example, to calculate the annual cost of your phone service using the template, the formula would read **=SUM(B12*13)**.) + +#### Calculating the monthly cost of yearly expenses + +You may pay some expenses, such as car insurance, only once a year. You can either ignore these expenses in the monthly estimates or put money aside for them in your budget each month. + +If you want to do the latter, you need to divide your **Yearly Estimate** by 12 and put that amount into your monthly budget. To do so, place this equation in the appropriate cell in the **Monthly Estimate** column: + + +``` +`=SUM(x/12)` +``` + +where _x_ is the corresponding **Yearly Estimate** cell on your spreadsheet (from Column P). + +#### Finding percentages + +If you want to donate or save a percentage of your income, there's a function for that, too! + +The common recommendation is to put aside 20% of your take-home pay for savings. While I don't focus on this too much, I do find it helpful to see if I'm meeting my savings goals from month to month. + +For instance, Row 32 of the **Budget** tab template uses this formula to calculate the 20% of your income that you should allocate to savings: + + +``` +`=SUM(B2*0.2)` +``` + +This same method can be used if you give a percentage (e.g., 10%) of your income to charity (Row 21 of the template): + + +``` +`=SUM(B2*-0.1)` +``` + +This formula uses a negative percentage because donating to charity is an expense. + +### Entering monthly income and expenses + +The template pulls data totals from the **Monthly** sheets (the tabs at the bottom of the spreadsheet) to populate Columns C through N on the **Budget** sheet. + +It's useful to place each month's transactions on separate sheets of your budget spreadsheet. By keeping your receipts from purchases and entering them into each month's sheet, you create a digital record of your money. + +Enter income as positive numbers and expenses as negative numbers. Select the appropriate category using the drop-down in the **Category** column. + +In LibreOffice, the **SUMIF** function can look at values in a specific column and extract only the ones that occur next to a specific word. My template uses a **SUMIF** formula to extract values based on the adjacent category in order to enter an amount in the correct cell on the **Budget** tab. For example, to enter January's internet expenses into the **Budget** spreadsheet, enter this formula in cell C12: + + +``` +`=SUMIF(january.$C:$C,A12,january.$D:$D)` +``` + +This looks at January's Column C and, if it sees an entry that contains the word in A12 on the **Budget** tab (Internet), then it extracts the number from Column D on the **January** tab and enters that value into the cell that contains the formula on the **Budget** tab (C12). + +### Analyzing your budget data + +#### Adding a range of numbers to calculate YTD spending + +To see how much you have spent overall this year to date (YTD), select the cell where you want to display that data (in the template, it's cell O29, under the **YTD** column), and enter the following formula to total the range of numbers corresponding to your monthly **Total Expense**: + + +``` +`=SUM(x:y)` +``` + +Instead of _x_ and _y_, enter the first cell and the last cell in the range. You can type them in manually, but it's easier and less error-prone to just click and drag from the first to last cell. LibreOffice does the calculation and enters the appropriate values. + +#### Seeing how you're doing on your budget + +A big part of budgeting is comparing your estimates to your actual income and expenses. In the template, this is the **Budget** tab's Column Q. This column subtracts the contents of each cell in Column O (**YTD**) from Column P (**Yearly Estimate**).  + + +``` +`=SUM(x-y)` +``` + +where _x_ and _y_ equal the corresponding cells from Column P and O. For example, using the template to calculate how much you've spent on Utilities compared to your budget, you would enter **=SUM(P11-O11)**. + +![Budget overview][5] + +### Tracking expenses + +Now that your yearly budget is set up, you are ready to start meeting your financial goals. + +It's important to look at your budget often—and it's equally important to do so without guilt. Think of this process as gathering data so that you can adjust your estimates for the next year. The primary goal of budgeting is to understand your own spending habits and refine either your expectations or your behavior so that you can plan better for how your income is used. + +Which open source tools and apps do you use to budget? Tell us in the comments! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/libreoffice-open-source-budget + +作者:[Jess Weichler][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/cyanide-cupcake +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/calculator_money_currency_financial_tool.jpg?itok=2QMa1y8c (scientific calculator) +[2]: https://www.libreoffice.org/download/download/ +[3]: https://opensource.com/sites/default/files/uploads/budget_template_0.ods +[4]: https://opensource.com/sites/default/files/uploads/imagebudget_cat.png (Budget categories) +[5]: https://opensource.com/sites/default/files/uploads/imagebudget_overview.png (Budget overview) From a5c982d71d5d9547357c898676750677ea3865cb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 3 Mar 2020 00:59:21 +0800 Subject: [PATCH 256/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200302=208=20re?= =?UTF-8?q?asons=20to=20consider=20hyperconverged=20infrastructure=20for?= =?UTF-8?q?=20your=20data=20center?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200302 8 reasons to consider hyperconverged infrastructure for your data center.md --- ...ged infrastructure for your data center.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 sources/talk/20200302 8 reasons to consider hyperconverged infrastructure for your data center.md diff --git a/sources/talk/20200302 8 reasons to consider hyperconverged infrastructure for your data center.md b/sources/talk/20200302 8 reasons to consider hyperconverged infrastructure for your data center.md new file mode 100644 index 0000000000..10b1e0575d --- /dev/null +++ b/sources/talk/20200302 8 reasons to consider hyperconverged infrastructure for your data center.md @@ -0,0 +1,113 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (8 reasons to consider hyperconverged infrastructure for your data center) +[#]: via: (https://www.networkworld.com/article/3530072/eight-reasons-to-consider-hyperconverged-infrastructure-for-your-data-center.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +8 reasons to consider hyperconverged infrastructure for your data center +====== + +Thinkstock + +Demand for on-premises data center equipment is shrinking as organizations move workloads to the cloud. But on-prem is far from dead, and one segment that’s thriving is hyperconverged infrastructure ([HCI][1]). + +HCI is a form of scale-out, software-integrated infrastructure that applies a modular approach to compute, network and storage capacity. Rather than silos with specialized hardware, HCI leverages distributed, horizontal blocks of commodity hardware and delivers a single-pane dashboard for reporting and management. Form factors vary: Enterprises can choose to deploy hardware-agnostic [hyperconvergence software][2] from vendors such as Nutanix and VMware, or an integrated HCI appliance from vendors such as HP Enterprise, Dell, Cisco, and Lenovo. + +**Learn more about enterprise infrastructure trends** + + * [Making the right hyperconvergence choice: HCI hardware or software?][3] + * [10 of the world's fastest supercomputers][4] + * [NVMe over Fabrics creates data-center storage disruption][5] + * [For enterprise storage, persistent memory is here to stay][6] + + + +The market is growing fast. By 2023, Gartner projects 70% of enterprises will be running some form of hyperconverged infrastructure, up from less than 30% in 2019. And as HCI grows in popularity, cloud providers such as Amazon, Google and Microsoft are providing connections to on-prem HCI products for hybrid deployment and management. + +So why is it so popular? Here are some of the top reasons. + +### 1) Simplified design + +A traditional data center design is comprised of separate storage silos with individual tiers of servers and specialized networking spanning the compute and storage silos. This worked in the pre-cloud era, but it’s too rigid for the cloud era. “It’s untenable for IT teams to take weeks or months to provision new infrastructure so the dev team can produce new apps and get to market quickly,” says Greg Smith, vice president of product marketing at Nutanix. + +“HCI radically simplifies data center architectures and operations, reducing the time and expense of managing data and delivering apps,” he says. + +### 2) Cloud integration + +HCI software, such as from Nutanix or VMware, is deployed the same way in both a customer’s data center and cloud instances; it runs on bare metal instances in the cloud exactly the same as it does in a data center. HCI “is the best foundation for companies that want to build a hybrid cloud. They can deploy apps in their data center and meld it with a public cloud,” Smith says. + +[][7] + +“Because it’s the same on both ends, I can have one team manage an end-to-end hybrid cloud and with confidence that whatever apps run in my private cloud will also run in that public cloud environment,” he adds. + +### 3) Ability to start small, grow large + +“HCI allows you to consolidate compute, network, and storage into one box, and grow this solution quickly and easily without a lot of downtime,” says Tom Lockhart, IT systems manager with Hastings Prince Edward Public Health in Bellville, Ontario, Canada. + +In a legacy approach, multiple pieces of hardware – a server, Fiber Channel switch, host-based adapters, and a hypervisor – have to be installed and configured separately. With hyperconvergence, everything is software-defined. HCI uses the storage in the server, and the software almost entirely auto-configures and detects the hardware, setting up the connections between compute, storage, and networking. + +“Once we get in on a workload, [customers] typically have a pretty good experience. A few months later, they try another workload, then another, and they start to extend it out of their data center to remote sites,” says Chad Dunn, vice president of product management for HCI at Dell. + +“They can start small and grow incrementally larger but also have a consistent operating model experience, whether they have 1,000 nodes or three nodes per site across 1,000 sites, whether they have 40 terabytes of data or 40 petabytes. They have consistent software updates where they don’t have to retrain their people because it’s the same toolset,” Dunn added. + +### 4) Reduced footprint + +By starting small, customers find they can reduce their hardware stack to just what they need, rather than overprovision excessive capacity. Moving away from the siloed approach also allows users to eliminate certain hardware. + +Josh Goodall, automation engineer with steel fabricator USS-POSCO Industries, says his firm deployed HCI primarily for its ability to do stretched clusters, where the hardware cluster is in two physical locations but linked together. This is primarily for use as a backup, so if one site went down, the other can take over the workload. In the process, though, USS-POSCO got rid of a lot of expensive hardware and software. “We eliminated several CPU [software] licenses, we eliminated the SAN from other site, we didn’t need SRM [site recovery management] software, and we didn’t need Commvault licensing. We saved between $25,000 and $30,000 on annual license renewals,” Goodall says. + +### 5) No special skills needed + +To run a traditional three-tiered environment, companies need specialists in compute, storage, and networking. With HCI, a company can manage its environment with general technology consultants and staff rather than the more expensive specialists. + +“HCI has empowered the storage generalist,” Smith says. “You don’t have to hire a storage expert, a network expert. Everyone has to have infrastructure, but they made the actual maintenance of infrastructure a lot easier than under a typical scenario, where a deep level of expertise is needed to manage under those three skill sets.” + +Lockhart of Hastings Prince Edward Public Health says adding new compute/storage/networking is also much faster when compared to traditional infrastructure. “An upgrade to our server cluster was 20 minutes with no down time, versus hours of downtime with an interruption in service using the traditional method,” he says. + +“Instead of concentrating on infrastructure, you can expand the amount of time and resources you spend on workloads, which adds value to your business. When you don’t have to worry about infrastructure, you can spend more time on things that add value to your clients,” Lockhart adds. + +### 6) Faster disaster recovery + +Key elements of hyperconvergence products are their backup, recovery, data protection, and data deduplication capabilities, plus analytics to examine it all. Disaster recovery components are managed from a single dashboard, and HCI monitors not only the on-premises storage but also cloud storage resources. With deduplication, compression rates as high as 55:1, and backups can be done in minutes. + +USS-POSCO Industries is an HP Enterprise shop and uses HPE’s SimpliVity HCI software, which includes dedupe, backup, and recovery. Goodall says he gets about 12-15:1 compression on mixed workloads, and that has eliminated the need for third-party backup software. + +More importantly, recovery timeframes have dropped. “The best recent example is a Windows update messed up a manufacturing line, and the error wasn’t realized for a few weeks. In about 30 minutes, I rolled through four weeks of backups, updated the system, rebooted and tested a 350GB system. Restoring just one backup would have been a multi-hour process,” Goodall says. + +### 7) Hyperconvergence analytics + +HCI products come with a considerable amount of analytics software to monitor workloads and find resource constraints. The monitoring software is consolidated into a single dashboard view of system performance, including negatively impacted performance. + +Hastings recently had a problem with a Windows 7 migration, but the HCI model made it easy to get performance info. “It showed that workloads, depending on time of day, were running out of memory, and there was excessive CPU queuing and paging,” Lockhart says. “We had the entire [issue] written up in an hour. It was easy to determine where problems lie. It can take a lot longer without that single-pane-of-glass view.” + +### 8) Less time managing network, storage resources + +Goodall says he used to spend up to 50% of his time dealing with storage issues and backup matrixes. Now he spends maybe 20% of his time dealing with it and most of his time tackling and addressing legacy systems. And his apps are better performing under HCI. “We’ve had no issues with our SQL databases; if anything, we’ve seen huge performance gain due to the move to full SSDs [instead of hard disks] and the data dedupe, reducing reads and writes in the environment.” + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3530072/eight-reasons-to-consider-hyperconverged-infrastructure-for-your-data-center.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3207567/what-is-hyperconvergence.html?nsdr=true +[2]: https://www.networkworld.com/article/3318683/making-the-right-hyperconvergence-choice-hci-hardware-or-software.html +[3]: https://www.networkworld.com/article/3318683/making-the-right-hyperconvergence-choice-hci-hardware-or-software +[4]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html#slide1 +[5]: https://www.networkworld.com/article/3394296/nvme-over-fabrics-creates-data-center-storage-disruption.html +[6]: https://www.networkworld.com/article/3398988/for-enterprise-storage-persistent-memory-is-here-to-stay.html +[7]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From fbfbece223dc77a960fc97da5741cffd189c4b26 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 3 Mar 2020 08:22:50 +0800 Subject: [PATCH 257/315] translated --- ... PHP Development on Fedora with Eclipse.md | 89 ------------------- ... PHP Development on Fedora with Eclipse.md | 89 +++++++++++++++++++ 2 files changed, 89 insertions(+), 89 deletions(-) delete mode 100644 sources/tech/20200214 PHP Development on Fedora with Eclipse.md create mode 100644 translated/tech/20200214 PHP Development on Fedora with Eclipse.md diff --git a/sources/tech/20200214 PHP Development on Fedora with Eclipse.md b/sources/tech/20200214 PHP Development on Fedora with Eclipse.md deleted file mode 100644 index 24ecdcb232..0000000000 --- a/sources/tech/20200214 PHP Development on Fedora with Eclipse.md +++ /dev/null @@ -1,89 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (PHP Development on Fedora with Eclipse) -[#]: via: (https://fedoramagazine.org/php-development-on-fedora-with-eclipse/) -[#]: author: (Mehdi Haghgoo https://fedoramagazine.org/author/powergame/) - -PHP Development on Fedora with Eclipse -====== - -![][1] - -[Eclipse][2] is a full-featured free and open source IDE developed by the Eclipse Foundation. It has been around since 2001. You can write anything from C/C++ and Java to PHP, Python, HTML, JavaScript, Kotlin, and more in this IDE. - -### Installation - -The software is available from Fedora’s official repository. To install it, invoke: - -``` -sudo dnf install eclipse -``` - -This will install the base IDE and Eclipse platform, which enables you to develop Java applications. In order to add PHP development support to the IDE, run this command: - -``` -sudo dnf install eclipse-pdt -``` - -This will install PHP development tools like PHP project wizard, PHP server configurations, composer support, etc. - -### Features - -This IDE has many features that make PHP development easier. For example, it has a comprehensive project wizard (where you can configure many options for your new projects). It also has built-in features like composer support, debugging support, a browser,a terminal, and more. - -### Sample project - -Now that the IDE is installed, let’s create a simple PHP project. Go to _File →New → Project_. From the resulting dialog, select _PHP project_. Enter a name for your project. There are some other options you might want to change, like changing the project’s default location, enabling JavaScript, and changing PHP version. See the following screenshot. - -![Create A New PHP Project in Eclipse][3] - -You can click the _Finish_ button to create the project or press _Next_ to configure other options like adding include and build paths. You don’t need to change those in most cases. - -Once the project is created, right click on the project folder and select _New → PHP File_ to add a new PHP file to the project. For this tutorial I named it _index.php_, the conventionally-recognized default file in every PHP project. - -![][4] - -Then add the your code to the new file. - -![Demo PHP code][5] - -In the example above, I used CSS, JavaScript, and PHP tags on the same page mainly to show that the IDE is capable of supporting all of them together. - -Once your page is ready, you can see the result output by moving the file to your web server document root or by creating a development PHP server in the project directory. - -Thanks to the built-in terminal in Eclipse, we can launch a PHP development server right from within the IDE. Simply click the terminal icon on the toolbar (![Terminal Icon][6]) and click _OK_. In the new terminal, change to the project directory and run the following command: - -``` -php -S localhost:8080 -t . index.php -``` - -![Terminal output][7] - -Now, open a browser and head over to . If everything has been done correctly per instructions and your code is error-free, you will see the output of your PHP script in the browser. - -![PHP output in Fedora][8] - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/php-development-on-fedora-with-eclipse/ - -作者:[Mehdi Haghgoo][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/powergame/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/php-eclipse-816x346.png -[2]: https://projects.eclipse.org/projects/eclipse -[3]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-01-58-39.png -[4]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-02-02-05-1024x576.png -[5]: https://fedoramagazine.org/wp-content/uploads/2020/02/code-1024x916.png -[6]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-03-50-05.png -[7]: https://fedoramagazine.org/wp-content/uploads/2020/02/terminal-1024x239.png -[8]: https://fedoramagazine.org/wp-content/uploads/2020/02/output.png diff --git a/translated/tech/20200214 PHP Development on Fedora with Eclipse.md b/translated/tech/20200214 PHP Development on Fedora with Eclipse.md new file mode 100644 index 0000000000..a9e0e48a56 --- /dev/null +++ b/translated/tech/20200214 PHP Development on Fedora with Eclipse.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (PHP Development on Fedora with Eclipse) +[#]: via: (https://fedoramagazine.org/php-development-on-fedora-with-eclipse/) +[#]: author: (Mehdi Haghgoo https://fedoramagazine.org/author/powergame/) + +使用 Eclipse 在 Fedora 上进行 PHP 开发 +====== + +![][1] + +[Eclipse][2] 是由 Eclipse 基金会开发的功能全面的免费开源 IDE。自 2001 年以来一直存在。你可以在此 IDE 中编写从 C/C++ 和 Java 到 PHP、Python、HTML、JavaScript、Kotlin 等。 + +### 安装 + +该软件可从 Fedora 的官方仓库中获得。要安装它,请用: + +``` +sudo dnf install eclipse +``` + +这将安装基本的 IDE 和 Eclipse 平台,能让你开发 Java 应用。为了将 PHP 开发支持添加到 IDE,请运行以下命令: + +``` +sudo dnf install eclipse-pdt +``` + +这将安装 PHP 开发工具,如 PHP 项目向导、PHP 服务器配置,composer 支持等。 + +### 功能 + +该 IDE 有许多使 PHP 开发更加容易的功能。例如,它有全面的项目向导(你可以在其中为新项目配置许多选项)。它还有如 composer 支持、调试支持、浏览器、终端等内置功能。 + +### 示例项目 + +现在已经安装了 IDE,让我们创建一个简单的 PHP 项目。进入 _File →New → Project_。在出现的对话框中,选择 _PHP project_。输入项目的名称。你可能还需要更改其他一些选项,例如更改项目的默认位置,启用 JavaScript 以及更改 PHP 版本。请看以下截图。 + +![Create A New PHP Project in Eclipse][3] + +你可以单击 _Finish_ 按钮创建项目,或按 _Next_ 配置其他选项,例如添加包含和构建路径。在大多数情况下,你无需更改这些设置。 + +创建项目后,右键单击项目文件夹,然后选择 _New→PHP File_ 将新的 PHP 文件添加到项目。在本教程中,我将其命名为 _index.php_,这是每个 PHP 项目中公认的默认文件。 + +![][4] + +接着在新文件中添加代码。 + +![Demo PHP code][5] + +在上面的例子中,我在同一页面上使用了 CSS、JavaScript 和 PHP 标记,主要是为了展示 IDE 能够支持所有这些标记。 + +页面完成后,你可以将文件移至 Web 服务器文档根目录或在项目目录中创建一个开发 PHP 服务器来查看输出。 + +借助 Eclipse 中的内置终端,我们可以直接在 IDE 中启动 PHP 开发服务器。只需单击工具栏上的终端图标(![Terminal Icon][6]),然后单击 _OK_。在新终端中,进入项目目录,然后运行以下命令: + +``` +php -S localhost:8080 -t . index.php +``` + +![Terminal output][7] + +现在,打开浏览器并进入 。如果按照说明正确完成了所有操作,并且代码没有错误,那么你将在浏览器中看到 PHP 脚本的输出。 + +![PHP output in Fedora][8] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/php-development-on-fedora-with-eclipse/ + +作者:[Mehdi Haghgoo][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/powergame/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/php-eclipse-816x346.png +[2]: https://projects.eclipse.org/projects/eclipse +[3]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-01-58-39.png +[4]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-02-02-05-1024x576.png +[5]: https://fedoramagazine.org/wp-content/uploads/2020/02/code-1024x916.png +[6]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-03-50-05.png +[7]: https://fedoramagazine.org/wp-content/uploads/2020/02/terminal-1024x239.png +[8]: https://fedoramagazine.org/wp-content/uploads/2020/02/output.png From c2fb406528fd3c1016b4ab1191b2b1fa331e88eb Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 3 Mar 2020 08:26:51 +0800 Subject: [PATCH 258/315] translating --- .../tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md b/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md index 6443a00482..6a93204805 100644 --- a/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md +++ b/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 62bbf6fd7e9a6c67d2ad092ac81bd96fc6541890 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 3 Mar 2020 10:13:04 +0800 Subject: [PATCH 259/315] PRF @wxy --- ...1 Troubleshooting hardware problems in Linux.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/translated/tech/20181231 Troubleshooting hardware problems in Linux.md b/translated/tech/20181231 Troubleshooting hardware problems in Linux.md index eee2160639..cffbb8f5b2 100644 --- a/translated/tech/20181231 Troubleshooting hardware problems in Linux.md +++ b/translated/tech/20181231 Troubleshooting hardware problems in Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Troubleshooting hardware problems in Linux) @@ -12,11 +12,11 @@ Linux 硬件故障排除指南 > 了解是什么原因导致你的 Linux 硬件发生故障,以便你可以将其恢复并快速运行。 -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_other11x_cc.png?itok=I_kCDYj0) +![](https://img.linux.net.cn/data/attachment/album/202003/03/101312zcazy02wl2g8uhy1.jpg) -[Linux 服务器][1]在物理机、虚拟化、私有云、公共云和混合云等许多不同种类的基础设施中运行着关键的业务应用程序。对于 Linux 系统管理员来说,了解如何管理 Linux 硬件基础设施(包括与 [网络][2]、存储、Linux 容器相关的软件定义的功能)和 Linux 服务器上的多种工具非常重要。 +[Linux 服务器][1]在物理机、虚拟化、私有云、公共云和混合云等许多不同种类的基础设施中运行着关键的业务应用程序。对于 Linux 系统管理员来说,了解如何管理 Linux 硬件基础设施(包括与 [网络][2]、存储、Linux 容器相关的软件定义功能)和 Linux 服务器上的多种工具非常重要。 -在 Linux 上进行故障排除和解决与硬件相关的问题可能需要一些时间。即使是经验丰富的系统管理员,有时也会花费数小时来解决神秘的硬件和软件差异。 +在 Linux 上进行排除和解决与硬件相关的问题可能需要一些时间。即使是经验丰富的系统管理员,有时也会花费数小时来解决神秘的硬件和软件差异。 以下提示可以使你更快、更轻松地对 Linux 中的硬件进行故障排除。许多不同的事情都可能导致 Linux 硬件出现问题。在开始诊断它们之前,明智的做法是了解最常见的问题以及最有可能找到问题的地方。 @@ -54,7 +54,7 @@ xvdb    202:16   0  20G  0 disk .... ``` -### 深入到多个日志当中 +### 深入到各个日志当中 使用 `dmesg` 可以找出内核最新消息中的错误和警告。例如,这是 `dmesg | more` 命令的输出: @@ -93,7 +93,7 @@ Dec  1 13:21:33 bastion dnsmasq[30201]: using nameserver 127.0.0.1#53 for domai ### 分析网络功能 -你可能有成千上万的云原生应用程序在一个复杂的网络环境中为业务提供服务。其中可能包括虚拟化、多云和混合云。这意味着,作为故障排除的一部分,你应该分析网络连接是否正常工作。弄清 Linux 服务器中网络功能的有用命令包括:`ip addr`、`traceroute`、`nslookup`、`dig` 和 `ping` 等。例如,这是 `ip addr show` 命令的输出: +你可能有成千上万的云原生应用程序在一个复杂的网络环境中为业务提供服务,其中可能包括虚拟化、多云和混合云。这意味着,作为故障排除的一部分,你应该分析网络连接是否正常工作。弄清 Linux 服务器中网络功能的有用命令包括:`ip addr`、`traceroute`、`nslookup`、`dig` 和 `ping` 等。例如,这是 `ip addr show` 命令的输出: ``` # ip addr show @@ -129,7 +129,7 @@ via: https://opensource.com/article/18/12/troubleshooting-hardware-problems-linu 作者:[Daniel Oh][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 55baf904b467ff0b6fef690da266577a0bbbf395 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 3 Mar 2020 10:13:45 +0800 Subject: [PATCH 260/315] PUB @wxy https://linux.cn/article-11953-1.html --- .../20181231 Troubleshooting hardware problems in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181231 Troubleshooting hardware problems in Linux.md (99%) diff --git a/translated/tech/20181231 Troubleshooting hardware problems in Linux.md b/published/20181231 Troubleshooting hardware problems in Linux.md similarity index 99% rename from translated/tech/20181231 Troubleshooting hardware problems in Linux.md rename to published/20181231 Troubleshooting hardware problems in Linux.md index cffbb8f5b2..34dbed5f44 100644 --- a/translated/tech/20181231 Troubleshooting hardware problems in Linux.md +++ b/published/20181231 Troubleshooting hardware problems in Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11953-1.html) [#]: subject: (Troubleshooting hardware problems in Linux) [#]: via: (https://opensource.com/article/18/12/troubleshooting-hardware-problems-linux) [#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) From 03cb1976135ed46c877cff013e3bc004872b6067 Mon Sep 17 00:00:00 2001 From: MFG <48886453+MFGJT@users.noreply.github.com> Date: Tue, 3 Mar 2020 13:33:53 +0800 Subject: [PATCH 261/315] Update 20190422 9 ways to save the planet.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2020.03.03申领原文 --- sources/tech/20190422 9 ways to save the planet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190422 9 ways to save the planet.md b/sources/tech/20190422 9 ways to save the planet.md index d3301006cc..a448fa7660 100644 --- a/sources/tech/20190422 9 ways to save the planet.md +++ b/sources/tech/20190422 9 ways to save the planet.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MFGJT) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 67c1663127915b8fc43b632c27866430f200b9c9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 3 Mar 2020 20:59:46 +0800 Subject: [PATCH 262/315] APL --- ...to set up your own fast, private open source mesh network.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200214 How to set up your own fast, private open source mesh network.md b/sources/tech/20200214 How to set up your own fast, private open source mesh network.md index b68b57da3d..fa8b645527 100644 --- a/sources/tech/20200214 How to set up your own fast, private open source mesh network.md +++ b/sources/tech/20200214 How to set up your own fast, private open source mesh network.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7095936674f53ee70f3ef8325fb05089a608b1d2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 3 Mar 2020 21:34:12 +0800 Subject: [PATCH 263/315] TSL --- ... fast, private open source mesh network.md | 110 ----------------- ... fast, private open source mesh network.md | 112 ++++++++++++++++++ 2 files changed, 112 insertions(+), 110 deletions(-) delete mode 100644 sources/tech/20200214 How to set up your own fast, private open source mesh network.md create mode 100644 translated/tech/20200214 How to set up your own fast, private open source mesh network.md diff --git a/sources/tech/20200214 How to set up your own fast, private open source mesh network.md b/sources/tech/20200214 How to set up your own fast, private open source mesh network.md deleted file mode 100644 index fa8b645527..0000000000 --- a/sources/tech/20200214 How to set up your own fast, private open source mesh network.md +++ /dev/null @@ -1,110 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to set up your own fast, private open source mesh network) -[#]: via: (https://opensource.com/article/20/2/mesh-network-freemesh) -[#]: author: (Spencer Thomason https://opensource.com/users/spencerthomason) - -How to set up your own fast, private open source mesh network -====== -FreeMesh is an affordable, performant, privacy-respecting mesh system -that installs in less than 10 minutes. -![people on top of a connected globe][1] - -The [FreeMesh][2] system promises to bring fully open source mesh networking to the masses. I recently had a chance to test it; it installed quickly, and the performance was great—especially for the price. - -### Why mesh and open source? - -The reason to use open source is simple: privacy. With FreeMesh, your data is your own. It doesn't track or collect data. Don't trust it? You can easily check—it's open source, after all! With some other popular mesh solutions, say those provided by very large tech conglomerates, would you trust them with your data? - -Another important factor: updates. FreeMesh says it is committed to pushing out security and performance updates regularly. What about 10 years from now? With an open source solution, you are free to update the product for as long as you want. - -So why mesh? In a mesh network, multiple wireless routers work together to broadcast a single, very large wireless network. Each router in a mesh network intelligently communicates with the other(s) to provide the best "path" for your data. The following images from FreeMesh's website highlight the difference between using a single wireless router and a mesh network. The red network represents a single wireless router, and the green is a mesh network. - -![Single-router network][3] | ![Mesh network][4] ----|--- - -### Get the equipment - -To get started with FreeMesh, [order a kit][5]. Two kits are available: standard and 4G LTE. - -The 4G LTE kit, as the name suggests, supports cellular data connections. This feature is a rarity in the consumer networking space, and it will be _very_ useful to some folks. You can set up a portable mesh network anywhere with power and cell service with full fast-failover capability. - -The FreeMesh kits come with a primary router and two nodes. The router and nodes use 802.11ac, 802.11r, and 802.11s standards. The included firmware runs a customized version of [OpenWrt][6], a Linux distro for embedded devices. - -The FreeMesh router has some really good specs: - - * **CPU:** Dual-core 880MHz MediaTek MT7621AT (two cores/four threads!) - * **RAM:** DDR3 512MB - * **Interfaces:** 1x GbE WAN, 4x GbE LAN, 1x USB 2.0 ports, 1x microSD card slot, 1x SIM slot - * **Antenna:** 2x 5dBi 2.4GHz, 2x 5dBi 5GHz, 2x 3dBi 3G/4G (built-in) - * **4G LTE modem:** LTE category 4 module, 150Mbps downlink and 50Mbps uplink - - - -### Setup - -Setup is easy, and FreeMesh's [README][7] offers simple instructions and diagrams. Start by setting up the primary router first. Then follow these simple steps: - - 1. Connect the first node (blue WAN port) to the primary router (yellow LAN port). -![FreeMesh setup step 1][8] - 2. Wait about 30 to 60 seconds. The node will flash its LEDs when the setup is complete. -![FreeMesh setup step 2][9] - 3. Move the node to another location. - - - -That's it! There is no manual setup required for the nodes; you simply plug them into the primary router, and it does the rest. You can add more nodes the same way; just repeat the steps above. - -### Features - -Out of the box, FreeMesh runs a combination of OpenWRT and LuCI. It has all the features you'd expect from a router. Want to install new features or packages? SSH in and start hacking! - -![Real-time load on FreeMesh network][10] - -![Overview of FreeMesh network][11] - -![OpenWrt status report][12] - -### Performance - -After setting up the FreeMesh system, I moved the nodes to various places around my house. I used [iPerf][13] to test the bandwidth and was getting around 150Mbps. WiFi can be affected by any number of environmental variables, so your mileage may vary. Distance between the nodes and the primary router also plays a large factor in bandwidth. - -However, the real advantage of a mesh network isn't its top-end speed but much better average speed across a space. Even at the far reaches of my home, I was still able to stream videos and work without interruption. I was even able to work in my backyard. I simply repositioned one of the nodes in front of a window before heading outside. - -### Conclusion - -FreeMesh is really compelling; it offers performance, privacy, and price, all in a simple, open source package. - -In my experience, setup is a breeze, and it is more than fast enough. The range is excellent and far exceeds any single-router setup. You are free to hack and customize your FreeMesh setup, but I didn't feel the need to. It has everything I need out of the box. - -If you are looking for an affordable, performant, privacy-respecting mesh system that installs in less than 10 minutes, you might want to consider FreeMesh. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/mesh-network-freemesh - -作者:[Spencer Thomason][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/spencerthomason -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-networking.png?itok=fHmulI9p (people on top of a connected globe) -[2]: https://freemeshwireless.com/ -[3]: https://opensource.com/sites/default/files/uploads/singlerouternetwork.png (Single-router network) -[4]: https://opensource.com/sites/default/files/uploads/meshnetwork.png (Mesh network) -[5]: https://freemeshwireless.com/#pricing -[6]: https://openwrt.org/ -[7]: https://gitlab.com/slthomason/freemesh/-/blob/master/README.md -[8]: https://opensource.com/sites/default/files/uploads/connecttorouter.png (FreeMesh setup step 1) -[9]: https://opensource.com/sites/default/files/uploads/setupcomplete.png (FreeMesh setup step 2) -[10]: https://opensource.com/sites/default/files/uploads/freemeshrealtimeload.png (Real-time load on FreeMesh network) -[11]: https://opensource.com/sites/default/files/uploads/freemeshwirelessoverview.png (Overview of FreeMesh network) -[12]: https://opensource.com/sites/default/files/uploads/openwrt.png (OpenWrt status report) -[13]: https://opensource.com/article/20/1/internet-speed-tests diff --git a/translated/tech/20200214 How to set up your own fast, private open source mesh network.md b/translated/tech/20200214 How to set up your own fast, private open source mesh network.md new file mode 100644 index 0000000000..1ce5cdae9d --- /dev/null +++ b/translated/tech/20200214 How to set up your own fast, private open source mesh network.md @@ -0,0 +1,112 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to set up your own fast, private open source mesh network) +[#]: via: (https://opensource.com/article/20/2/mesh-network-freemesh) +[#]: author: (Spencer Thomason https://opensource.com/users/spencerthomason) + +如何建立自己的快速、私有的开源网状网络 +====== + +> 只需要不到 10 分钟的安装时间,就可以用 FreeMesh 搭建一个经济实惠、性能卓越、尊重隐私的网格系统。 + +![people on top of a connected globe][1] + +[FreeMesh][2] 系统有望为大众带来完全开源的网格网络mesh network。我最近有机会进行了测试;它安装迅速,性能非常好 —— 特别是相对它的价格而言。 + +### 为什么要网格化和开源? + +使用开源的原因很简单:隐私。有了 FreeMesh,你的数据就是你自己的。它不会跟踪或收集数据。不相信吗?毕竟,你可以轻松检查 —— 它是开源的!而其它大型高科技企业集团提供的一些流行的网格解决方案,你是否相信它们会保护你的数据? + +另一个重要因素:更新。FreeMesh 表示,它将致力于定期发布安全性和性能更新。从现在起到 10 年后呢?使用开放源代码解决方案,你可以根据需要自由地更新产品。 + +那么为什么要用网格呢?在网状网络中,多个无线路由器一起工作以广播单个超大型的无线网络。网状网络中的每个路由器都可与其他路由器智能地通信,以便为你的数据提供最佳的“路径”。FreeMesh 网站上的以下图片突出显示了使用单个无线路由器和网状网络之间的区别。 红色网络表示单个无线路由器,绿色网络是网状网络。 + +![单路由器网络] [3] + +![网状网络] [4] + +### 采购设备 + +要开始使用 FreeMesh,请[订购套件][5]。它提供两种套件:标准套件和 4G LTE。 + +顾名思义,4G LTE 套件支持蜂窝数据连接。此功能在消费级网络领域非常罕见,但对某些人来说非常有用。你可以在提供电源和电池的任何地方建立具有完整的快速故障转移功能的便携式网状网络。 + +FreeMesh 套件带有一个主路由器和两个节点。路由器和节点使用 802.11ac、802.11r 和 802.11s 标准。随附的固件运行定制版本的 [OpenWrt] [6],这是嵌入式设备的 Linux 发行版。 + +FreeMesh 路由器的一些规格非常好: + +* CPU:双核 880MHz MediaTek MT7621AT(双核/四线程!) +* 内存:DDR3 512MB +* 接口:1 个 GbE WAN、4 个 GbE LAN、1 个 USB 2.0 端口、1 个 microSD 卡插槽、1 个 SIM 插槽 +* 天线:2 个 5dBi 2.4GHz、2 个 5dBi 5GHz、2 个 3dBi 3G/4G(内置) +* 4G LTE 调制解调器:LTE 4 类模块,下行 150Mbps/上行 50Mbps + +### 设置 + +设置很容易,FreeMesh 的 [README][7] 提供了简单的说明和图表。首先首先设置主路由器。然后按照以下简单步骤操作: + +1、将第一个节点(蓝色 WAN 端口)连接到主路由器(黄色 LAN 端口)。 + +![FreeMesh 设置步骤 1][8] + +2、等待约 30 至 60 秒。设置完成后,节点将闪烁其 LED。 + +![FreeMesh 设置步骤 2][9] + +3、将节点移到另一个位置。 + +仅此而已!节点不需要手动设置。你只需将它们插入主路由器,其余的工作就完成了。你可以以相同的方式添加更多节点;只需重复上述步骤即可。 + +### 功能 + +FreeMesh 是开箱即用的,它由 OpenWRT 和 LuCI 组合而成。它具有你期望路由器提供的所有功能。是否要安装新功能或软件包?SSH 连入并开始魔改! + +![FreeMesh 网络上的实时负载][10] + +![FreeMesh 网络概览][11] + +![OpenWrt 状态报告][12] + +### 性能如何 + +设置完 FreeMesh 系统后,我将节点移动到了房屋周围的各个地方。我使用 [iPerf][13] 测试带宽,它达到了约 150Mbps。WiFi 可能会受到许多环境变量的影响,因此你的结果可能会有所不同。节点与主路由器之间的距离在带宽中也有很大的影响。 + +但是,网状网络的真正优势不是高峰速度,而是整个空间的平均速度要好得多。即使在我家很远的地方,我仍然能够流媒体播放视频并正常工作。我甚至可以在后院工作。在出门之前,我只是将一个节点重新放在窗口前面而已。 + +### 结论 + +FreeMesh 确实令人信服。它以简单、开源的形式为你提供高性价比和隐私。 + +以我的经验,设置非常容易,而且足够快。覆盖范围非常好,远远超过了任何单路由器环境。你可以随意魔改和定制 FreeMesh 设置,但是我觉得没有必要。它提供了我需要的一切。 + +如果你正在寻找价格可承受、性能良好且尊重隐私的网格系统,且该系统可以在不到 10 分钟的时间内安装完毕,你可以考虑一下 FreeMesh。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/mesh-network-freemesh + +作者:[Spencer Thomason][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/spencerthomason +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-networking.png?itok=fHmulI9p (people on top of a connected globe) +[2]: https://freemeshwireless.com/ +[3]: https://opensource.com/sites/default/files/uploads/singlerouternetwork.png (Single-router network) +[4]: https://opensource.com/sites/default/files/uploads/meshnetwork.png (Mesh network) +[5]: https://freemeshwireless.com/#pricing +[6]: https://openwrt.org/ +[7]: https://gitlab.com/slthomason/freemesh/-/blob/master/README.md +[8]: https://opensource.com/sites/default/files/uploads/connecttorouter.png (FreeMesh setup step 1) +[9]: https://opensource.com/sites/default/files/uploads/setupcomplete.png (FreeMesh setup step 2) +[10]: https://opensource.com/sites/default/files/uploads/freemeshrealtimeload.png (Real-time load on FreeMesh network) +[11]: https://opensource.com/sites/default/files/uploads/freemeshwirelessoverview.png (Overview of FreeMesh network) +[12]: https://opensource.com/sites/default/files/uploads/openwrt.png (OpenWrt status report) +[13]: https://opensource.com/article/20/1/internet-speed-tests From 313bfe0bc3ae2e96975d6f89c04e45c095da1f5b Mon Sep 17 00:00:00 2001 From: wetshoes <43409711+Fisherman110@users.noreply.github.com> Date: Tue, 3 Mar 2020 22:20:13 +0800 Subject: [PATCH 264/315] Update 20180306 Exploring free and open web fonts.md --- sources/tech/20180306 Exploring free and open web fonts.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180306 Exploring free and open web fonts.md b/sources/tech/20180306 Exploring free and open web fonts.md index 533286ca2c..d01accfbce 100644 --- a/sources/tech/20180306 Exploring free and open web fonts.md +++ b/sources/tech/20180306 Exploring free and open web fonts.md @@ -1,3 +1,5 @@ +Fisherman110 translating + Exploring free and open web fonts ====== From 52fbbba1b8db0840303587bb1fe08dad97cceb4f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 4 Mar 2020 00:59:25 +0800 Subject: [PATCH 265/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200304=20Drauge?= =?UTF-8?q?r=20OS=20Linux=20Aims=20to=20Bring=20Console=20Gaming=20Experie?= =?UTF-8?q?nce=20on=20the=20Desktop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md --- ...onsole Gaming Experience on the Desktop.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md diff --git a/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md b/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md new file mode 100644 index 0000000000..5cd5c57024 --- /dev/null +++ b/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md @@ -0,0 +1,139 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop) +[#]: via: (https://itsfoss.com/drauger-os/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop +====== + +For years (or decades) people complained that one of the reasons to not [use Linux][1] is lack of mainstream games. [Gaming on Linux][2] has improved drastically in last few years specially with the [introduction of Steam Proton][3] project that enables you to [play a lot of Windows-only games on Linux][4]. + +This also has encourages several [Linux distributions centered around gaming][5]. Take [Lakka][6] for example. You can [turn your old computer into a retro gaming console thanks to Lakka Linux][7]. + +Another such gaming focused Linux distribution is [Draguer OS][8] and we are going to take a look at it today. + +### What is Drauger OS? + +Accord to [the project’s website][9], “Drauger OS is a Linux desktop gaming operating system. It aims to provide a platform for gamers to use where they can get great performance without sacrificing their security. Furthermore, it aims to make it easy for anyone to game, whether they use a keyboard and mouse, or some sort of controller.” + +They stress that Drauger OS is not for everyday use. As such, many of the productivity tools that most other distros come with are not in Drauger OS. + +![Drauger OS 7.4.1][10] + +Drauger OS is [based][9] on the Ubuntu. The current version (7.4.1 Jiangshi) uses “[Liquorix][11] low latency Linux kernel, a pre-compiled ZEN kernel designed with a balance between latency and throughput in mind”. However, that will be changing in the next release. They only have one desktop environment choice, a modified version of [Xfce][12]. + +Drauger OS has several applications and tools installed out of the box to improve the gaming experience. These include: + + * [PlayOnLinux][13] + * WINE + * [Lutris][14] + * Steam + * [DXVK][15] + + + +It also has an interesting set of tools that are not gaming related. [Drauger Installer][16] is a .deb installer and alternative to Gdebi. [Multiple Repository App Installer][17] (mrai) is “an AUR-helper-like script for Debian-based Linux Operating Systems”. Mrai is designed to work with apt, snaps, flatpaks, and can install apps from GitHub. + +Interestingly, Drauger OS’ name is an error. Lead dev [Thomas Castleman][18] (aka batcastle) has intended to name his distro Draugr, but had mistyped the name. In [episode 23][19] of the Drauger OS podcast, Castleman said the name will stay misspelled because it would be a lot of work to correct it. According to [Wikipedia][20], a draugr is “an undead creature from Norse mythology”. + +Yes, you read that correctly. Drauger OS is one of only a few distros that have its own [podcast][21]. When asked about it, Castleman told me that “I wanted to ensure that we had the maximum transparency possible with our community, no matter their circumstances.” Most of the time, the podcast is an audio version of the Drauger OS blog, but sometimes they use it to make an announcement when they don’t have time to write a blog post. + +### The Future for Drauger OS + +![Drauger OS][22] + +The developers behind Druager OS are working on their next major release: 7.5.1. This release will be based on Ubuntu 19.10. There will be three major changes. First, the Liquorix kernel will be [replaced][23] with “a kernel we are building in-house.” This kernel will be based on the Linux Kernel GitHub repository, “so it’s about as vanilla as it gets”. + +The second major change in the new release will a new layout for their desktop. Based on user feedback, they have decided to change it to something that looks more GNOME-like. + +Thirdly, they are dropping SystemBack as their backup tool and installer. They have instead written a new [installer][24] from scratch. + +The Dev team is also working on an [ARM version][25] of Drauger OS. They hope to release it sometime in 2022. + +### System requirements for Draguer OS + +The Drauger OS [system requirements][25] are pretty modest. Keep in mind that Drauger OS will only run on 64-bit systems. + +#### Minimum system requirements + + * CPU: Dual-Core, 1.8GHz, 64-bit processor + * RAM: 1 GB + * Storage: 16 GB + * Graphics Processor: Integrated + * Screen Resolution: 1024×768 at 60Hz + * External Ports: 1 Port for Display (HDMI / DisplayPort / VGA / DVI), 2 USB Ports for Installation USB Drive and Keyboard (Mouse optional, but recommended) + + + +#### Recommended system requirements + + * CPU: Quad-Core, 2.2Ghz, 64-bit processor + * RAM: 4 GB + * Storage: 128 GB + * Graphics Processor: NVIDIA GTX 1050, AMD RX 460, or equivalent card + * Screen Resolution: 1080p at 60Hz + * External Ports: 1 Port for Display (HDMI / DisplayPort / VGA / DVI), 3 USB Ports for Installation USB Drive, Keyboard, and Mouse, 1 Audio Out Port + + + +### How you can help out Drauger OS + +There are several ways that you can help out the Drauger OS if you are interestedin doing so. They are always looking for [financial support][26] to keep development going. + +If you want yo contribute code, they are looking for people with experience in BASH, C++, and Python. All of their code is up on [GitHub][27]. You can also [contact][28] them on social media. + +### Final Thoughts + +Drauger OS is quite a project. I’ve seen a couple of other [gaming-oriented distributions][29], but Drauger OS is single-minded in its focus on gaming. Since I am more of a casual gamer, this distro doesn’t appeal to me personally. But, I can see how it could lure gaming enthusiasts to Linux. I wish them good luck in their future releases. + +What are your thoughts on this gaming-only distro? What is your favorite Linux gaming solution? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][30]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/drauger-os/ + +作者:[John Paul][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/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/why-use-linux/ +[2]: https://itsfoss.com/linux-gaming-guide/ +[3]: https://itsfoss.com/steam-play-proton/ +[4]: https://itsfoss.com/steam-play/ +[5]: https://itsfoss.com/linux-gaming-distributions/ +[6]: http://www.lakka.tv/ +[7]: https://itsfoss.com/lakka-retrogaming-linux/ +[8]: https://draugeros.org/go/ +[9]: https://www.draugeros.org/go/about/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.4.1.jpg?ssl=1 +[11]: https://liquorix.net/ +[12]: https://www.xfce.org/ +[13]: https://www.playonlinux.com/en/ +[14]: https://lutris.net/ +[15]: https://github.com/doitsujin/dxvk +[16]: https://github.com/drauger-os-development/drauger-installer +[17]: https://github.com/drauger-os-development/mrai +[18]: https://github.com/Batcastle +[19]: https://anchor.fm/drauger-os/episodes/Episode-23-eapu47 +[20]: https://en.wikipedia.org/wiki/Draugr +[21]: https://anchor.fm/drauger-os +[22]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.5.1.png?ssl=1 +[23]: https://www.draugeros.org/go/2020/01/20/major-changes-in-drauger-os-7-5-1/ +[24]: https://github.com/drauger-os-development/system-installer +[25]: https://www.draugeros.org/go/system-requirements/ +[26]: https://www.draugeros.org/go/contribute/ +[27]: https://github.com/drauger-os-development +[28]: https://www.draugeros.org/go/contact-us/ +[29]: https://itsfoss.com/manjaro-gaming-linux/ +[30]: https://reddit.com/r/linuxusersgroup From 6988bbe4e11d1694c26b65fb6cf8ffc434c41974 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 4 Mar 2020 01:01:24 +0800 Subject: [PATCH 266/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200303=20Most-u?= =?UTF-8?q?sed=20libraries,=20open=20source=20adoption,=20and=20more=20ind?= =?UTF-8?q?ustry=20trends?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200303 Most-used libraries, open source adoption, and more industry trends.md --- ...urce adoption, and more industry trends.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/tech/20200303 Most-used libraries, open source adoption, and more industry trends.md diff --git a/sources/tech/20200303 Most-used libraries, open source adoption, and more industry trends.md b/sources/tech/20200303 Most-used libraries, open source adoption, and more industry trends.md new file mode 100644 index 0000000000..769f4f550e --- /dev/null +++ b/sources/tech/20200303 Most-used libraries, open source adoption, and more industry trends.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Most-used libraries, open source adoption, and more industry trends) +[#]: via: (https://opensource.com/article/20/3/libraries-5G-more-industry-trends) +[#]: author: (Tim Hildred https://opensource.com/users/thildred) + +Most-used libraries, open source adoption, and more industry trends +====== +A weekly look at open source community and industry trends. +![Person standing in front of a giant computer screen with numbers, data][1] + +As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. + +## [Most-used libraries revealed – plus 10 things developers should be doing to keep their code secure][2] + +> “The report begins to give us an inventory of the most important shared software and potential vulnerabilities and is the first step to understand more about these projects so that we can create tools and standards that results in trust and transparency in software," explained Jim Zemlin, executive director at the Linux Foundation, in a statement. + +**The impact**: Importantly, there is also a great list of packages for backdoors here. + +## [Survey: Open source adoption, quality gains][3] + +> Overall, the survey finds there has been [a marked shift away from proprietary software][4]. Only 42% said that more than half of the software they use today is proprietary, down from 55% a year ago. Two years from now only 32% said they expect proprietary software to account for more than half their portfolio. On average, respondents said 36% of their organization’s software is open source, which in two years is expected to increase to 44% in two years. A total of 77% said they would increase usage of open source software over the next 12 months. + +**The impact**: There is a clear virtuous cycle of companies getting more comfortable with open source and more open source software being created. If there isn't already, there will be a rule 34 about open source software. + +## [5G must go cloud-native from edge to core][5] + +> A containerised core will be the heart of cloud-native 5G networks. Managing and scaling networking apps in containers using a modular microservices approach will help service providers to dynamically orchestrate and grow service capacity across a distributed architecture. + +**The impact**: When you're building something complicated and reliable, you really can't look past starting with open source software. Unless you want to be in a foot race against "a Kawasaki" (that's a motorbike, right?). + +## [High-performance object storage, Kubernetes, + why you can't containerize a storage appliance][6] + +> True multi-tenancy isn’t possible unless the storage system is extremely lightweight and able to be packaged with the application stack. If the storage system takes too many resources or contains too many APIs, it won’t be possible to pack many tenants on the same infrastructure. + +**The impact**: The title of this post is a challenge to someone much more skilled and knowledgable than I. + +_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/libraries-5G-more-industry-trends + +作者:[Tim Hildred][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/thildred +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) +[2]: https://www.theregister.co.uk/2020/02/20/linux_foundation_report/ +[3]: https://devops.com/surevey-sees-open-source-adoption-quality-gains/ +[4]: https://devops.com/devops-deeper-dive-devops-accelerates-open-source-innovation-pace/ +[5]: https://www.5gradar.com/features/5g-must-go-cloud-native-from-edge-to-core +[6]: https://blog.min.io/high-performance-object-storage-with-kubernetes/ From 3508b38c19610121c0558ee9dd10abae5b4f2320 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 4 Mar 2020 01:05:06 +0800 Subject: [PATCH 267/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200303=20Gettin?= =?UTF-8?q?g=20started=20with=20the=20Rust=20package=20manager,=20Cargo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200303 Getting started with the Rust package manager, Cargo.md --- ...ed with the Rust package manager, Cargo.md | 607 ++++++++++++++++++ 1 file changed, 607 insertions(+) create mode 100644 sources/tech/20200303 Getting started with the Rust package manager, Cargo.md diff --git a/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md b/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md new file mode 100644 index 0000000000..d77410b904 --- /dev/null +++ b/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md @@ -0,0 +1,607 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with the Rust package manager, Cargo) +[#]: via: (https://opensource.com/article/20/3/rust-cargo) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) + +Getting started with the Rust package manager, Cargo +====== +Get to know Rust's package manager and build tool. +![Shipping containers stacked in a yard][1] + +[Rust][2] is a modern programming language that provides performance, reliability, and productivity. It has consistently been voted as the [most-loved language][3] on StackOverflow surveys for a few years now. + +In addition to being a great programming language, Rust also features a build system and package manager called Cargo. Cargo handles a lot of tasks, like building code, downloading libraries or dependencies, and so on. The two are bundled together, so you get Cargo when you install Rust. + +### Installing Rust and Cargo + +Before getting started, you need to install Rust and Cargo. The Rust project provides a downloadable script to handle the installation. To get the script, open a browser to [https://sh.rustup.rs][4] and save the file. Read the script to make sure you're happy with what it intends to do, and then run it: + + +``` +`$ sh ./rustup.rs` +``` + +You can also refer to the [Install Rust][5] webpage for more information. + +After installing Rust and Cargo, you must source the env file: + + +``` +`$ source $HOME/.cargo/env` +``` + +Better yet, add the required directory to your PATH variable: + + +``` +`$ source $HOME/.cargo/env` +``` + +If you prefer to use your package manager (such as DNF or Apt on Linux), look for Rust and Cargo packages in your distribution's repositories and install accordingly. For example: + + +``` +`$ dnf install rust cargo` +``` + +Once they're installed and set up, verify which versions of Rust and Cargo you have: + + +``` +$ rustc --version +rustc 1.41.0 (5e1a79984 2020-01-27) +$ cargo --version +cargo 1.41.0 (626f0f40e 2019-12-03) +``` + +### Building and running Rust by hand + +Start with a simple program that prints "Hello, world!" on the screen. Open your favorite text editor and type the following program: + + +``` +$ cat hello.rs +fn main() { +    println!("Hello, world!"); +} +``` + +Save the file with an **.rs** extension to identify it as a Rust source code file. + +Compile your program using the Rust compiler, **rustc**: + + +``` +`$ rustc hello.rs` +``` + +After compilation, you will have a binary that has the same name as the source program: + + +``` +$ ls -l +total 2592 +-rwxr-xr-x. 1 user group 2647944 Feb 13 14:14 hello +-rw-r--r--. 1 user group      45 Feb 13 14:14 hello.rs +$ +``` + +Execute your program to verify that it runs as expected: + + +``` +$ ./hello +Hello, world! +``` + +These steps are sufficient for smaller programs or whenever you want to test out something quickly. However, when working on bigger programs involving multiple people, Cargo is the best way forward. + +### Creating a new package using Cargo + +Cargo is a build system and package manager for Rust. It helps developers download and manage dependencies and assists in creating Rust packages. Packages in Rust are often called "crates" in the Rust community, but in this article, the two words are interchangeable. Refer to the Cargo [FAQ][6] provided by the Rust community for clarification. + +If you need any help with Cargo's command-line utility, use the **\--help** or **-h** command-line argument: + + +``` +`$ cargo –help` +``` + +To create a new package, use the **new** keyword, followed by the package name. For this example, use **hello_opensource** as your new package name. After running the command, you will see a message confirming that Cargo has created a binary package with the given name: + + +``` +$ cargo new hello_opensource +     Created binary (application) `hello_opensource` package +``` + +Running a **tree** command to see the directory structure reports that some files and directories were created. First, it creates a directory with the name of the package, and within that directory is an **src** directory for your source code files: + + +``` +$ tree . +. +└── hello_opensource +    ├── Cargo.toml +    └── src +        └── main.rs + +2 directories, 2 files +``` + +Cargo not only creates a package, but it also creates a simple **Hello, world!** program. Open the **main.rs** file and have a look: + + +``` +$ cat hello_opensource/src/main.rs +fn main() { +    println!("Hello, world!"); +} +``` + +The next file to work with is **Cargo.toml**, which is a configuration file for your package. It contains information about the package, such as its name, version, author information, and Rust edition information. + +A program often depends on external libraries or dependencies to run, which enables you to write applications that perform tasks that you don't know how to code or you don't want to spend time coding. All your dependencies will be listed in this file. At this point, you do not have any dependencies for your new program. Open the **Cargo.toml** file and view its contents: + + +``` +$ cat hello_opensource/Cargo.toml +[package] +name = "hello_opensource" +version = "0.1.0" +authors = ["user <[user@mail.com][7]>"] +edition = "2018" + +# See more keys and their definitions at + +[dependencies] +``` + +### Building the program using Cargo + +So far, so good. Now that you have a package in place, build a binary (also called an executable). Before doing that, move into the package directory: + + +``` +`$ cd hello_opensource/` +``` + +You can use Cargo's **build** command to build the package. Notice the messages that say it is **Compiling** your program: + + +``` +$ cargo build +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.38s +``` + +Check what happens to your project directory after you run the **build** command: + + +``` +$ tree . +. +├── Cargo.lock +├── Cargo.toml +├── src +│   └── main.rs +└── target +    └── debug +        ├── build +        ├── deps +        │   ├── hello_opensource-147b8a0f466515dd +        │   └── hello_opensource-147b8a0f466515dd.d +        ├── examples +        ├── hello_opensource +        ├── hello_opensource.d +        └── incremental +            └── hello_opensource-3pouh4i8ttpvz +                ├── s-fkmhjmt8tj-x962ep-1hivstog8wvf +                │   ├── 1r37g6m45p8rx66m.o +                │   ├── 2469ykny0eqo592v.o +                │   ├── 2g5i2x8ie8zed30i.o +                │   ├── 2yrvd7azhgjog6zy.o +                │   ├── 3g9rrdr4hyk76jtd.o +                │   ├── dep-graph.bin +                │   ├── query-cache.bin +                │   ├── work-products.bin +                │   └── wqif2s56aj0qtct.o +                └── s-fkmhjmt8tj-x962ep.lock + +9 directories, 17 files +``` + +Wow! The compilations process produced a lot of intermediate files. Your binary, though, is saved in the **./target/debug** directory with the same name as your package. + +### Running your application using Cargo + +Now that your binary is built, run it using Cargo's **run** command. As expected, it prints **Hello, world!** on the screen. + + +``` +$ cargo run +    Finished dev [unoptimized + debuginfo] target(s) in 0.01s +     Running `target/debug/hello_opensource` +Hello, world! +``` + +Alternatively, you can run the binary directly, which is located at: + + +``` +$ ls -l ./target/debug/hello_opensource +-rwxr-xr-x. 2 root root 2655552 Feb 13 14:19 ./target/debug/hello_opensource +``` + +As expected, it produces the same results: + + +``` +$ ./target/debug/hello_opensource +Hello, world! +``` + +Say you need to rebuild your package and get rid of all the binaries and the intermediate files created by the earlier compilation process. Cargo provides a handy **clean** option to remove all intermediate files except the source code and other required files: + + +``` +$ cargo clean +$ tree . +. +├── Cargo.lock +├── Cargo.toml +└── src +    └── main.rs + +1 directory, 3 files +``` + +Make some changes to the program and run it again to see how it works. For example, this minor change adds **Opensource** to the **Hello, world!** string: + + +``` +$ cat src/main.rs +fn main() { +    println!("Hello, Opensource world!"); +} +``` + +Now, build the program and run it again. This time you see **Hello, Opensource world!** displayed on the screen: + + +``` +$ cargo build +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.39s + +$ cargo run +    Finished dev [unoptimized + debuginfo] target(s) in 0.01s +     Running `target/debug/hello_opensource` +Hello, Opensource world! +``` + +### Adding dependencies using Cargo + +Cargo allows you to add dependencies that your program needs to run. Adding a dependency is extremely easy with Cargo. Every Rust package includes a **Cargo.toml** file, which contains a list (empty by default) of dependencies. Open the file in your favorite text editor, find the **[dependencies]** section, and add the library you want to include in your package. For example, to add the **rand** library as your dependency: + + +``` +$ cat Cargo.toml +[package] +name = "hello_opensource" +version = "0.1.0" +authors = ["test user <[test@mail.com][8]>"] +edition = "2018" + +# See more keys and their definitions at + +[dependencies] +rand = "0.3.14" +``` + +Try building your package to see what happens. + + +``` +$ cargo build +    Updating crates.io index +   Compiling libc v0.2.66 +   Compiling rand v0.4.6 +   Compiling rand v0.3.23 +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 4.48s +``` + +Cargo is now reaching out to [Crates.io][9], which is Rust's central repository for crates (or packages) and downloading and compiling **rand**. But wait—what about the **libc** package? You did not ask for **libc** to be installed. Well, the **rand** package is dependent on the **libc** package; hence, Cargo downloads and compiles **libc** as well. + +New versions of libraries keep coming, and Cargo provides an easy way to update all of their dependencies using the **update** command: + + +``` +`cargo update` +``` + +You can also choose to update specific libraries using the **-p** flag followed by the package name: + + +``` +`cargo update -p rand` +``` + +### Compiling and running with a single command + +So far, you have used **build** followed by **run** whenever you make changes to your program. There is an easier way: you can simply use the **run** command, which internally compiles and runs the program. To see how it works, first clean up your package directory: + + +``` +$ cargo clean +$ tree . +. +├── Cargo.lock +├── Cargo.toml +└── src +    └── main.rs + +1 directory, 3 files +``` + +Now execute **run**. The output states that it compiled and then ran the program, and this means you don't need to explicitly run **build** each time: + + +``` +$ cargo run +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.41s +     Running `target/debug/hello_opensource` +Hello, world! +``` + +### Checking your code in development + +You often go through multiple iterations when developing a program. You need to ensure that your program has no coding errors and compiles fine. You don't need the overhead of generating the binary on each compilation. Cargo has you covered with a **check** option that compiles your code but skips the final step of generating an executable. + +Start by running **cargo clean** within your package directory: + + +``` +$ tree . +. +├── Cargo.lock +├── Cargo.toml +└── src +    └── main.rs + +1 directory, 3 files +``` + +Now run the **check** command and see what changes were made to the directory: + + +``` +$ cargo check +    Checking hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.18s +``` + +The output shows that, even though intermediate files were created as part of the compilation process, the final binary or executable was not created. This saves some time, which matters a lot if the package is huge with thousands of lines of code: + + +``` +$ tree . +. +├── Cargo.lock +├── Cargo.toml +├── src +│   └── main.rs +└── target +    └── debug +        ├── build +        ├── deps +        │   ├── hello_opensource-842d9a06b2b6a19b.d +        │   └── libhello_opensource-842d9a06b2b6a19b.rmeta +        ├── examples +        └── incremental +            └── hello_opensource-1m3f8arxhgo1u +                ├── s-fkmhw18fjk-542o8d-18nukzzq7hpxe +                │   ├── dep-graph.bin +                │   ├── query-cache.bin +                │   └── work-products.bin +                └── s-fkmhw18fjk-542o8d.lock + +9 directories, 9 files +``` + +To see if you are really saving time, time the **build** and **check** commands and compare them. + +First, the **build** command: + + +``` +$ time cargo build +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.40s + +real    0m0.416s +user    0m0.251s +sys     0m0.199s +``` + +Clean the directory before running the **check** command: + + +``` +`$ cargo clean` +``` + +The **check** command: + + +``` +$ time cargo check +    Checking hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.15s + +real    0m0.166s +user    0m0.086s +sys     0m0.081s +``` + +Clearly, the **check** command is much faster. + +### Building external Rust packages + +Everything you've done so far will apply to any Rust crate you get from the internet. You simply need to download or clone the repository, move to the package folder, and run the **build** command, and you are good to go: + + +``` +git clone <github-like-url> +cd <package-folder> +cargo build +``` + +### Building optimized Rust programs using Cargo + +You've run **build** multiple times so far, but did you notice its output? No worries, build it again and watch closely: + + +``` +$ cargo build +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.36s +``` + +See the **[unoptimized + debuginfo]** text after each compilation? This means that the binary generated by Cargo includes a lot of debugging information and is not optimized for execution. Developers often go through multiple iterations of development and need this debugging information for analysis. Also, performance is not the immediate goal while developing software. Therefore, this is OK for now. + +However, once the software is ready for release, it doesn't need to have the debugging information anymore. But it does need to be optimized for best performance. In the final stages of development, you can use the **\--release** flag with **build**. Watch closely; you should see the **[optimized]** text after compilation: + + +``` +$ cargo build --release +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished release [optimized] target(s) in 0.29s +``` + +If you want to, you can go through the exercise to find out your time savings when running optimized vs. unoptimized software. + +### Creating a library vs. a binary using Cargo + +Any software program can be roughly categorized as either a standalone binary or a library. A standalone binary can be run as it is, even though it might make use of external libraries. A library, however, is utilized by another standalone binary. All the programs you've built so far in this tutorial are standalone binaries since that is Cargo's default. To create a **library**, add the **\--lib** option: + + +``` +$ cargo new --lib libhello +     Created library `libhello` package +``` + +This time, Cargo does not create a **main.rs** file; instead, it creates a **lib.rs** file. The code for your library should go here: + + +``` +$ tree . +. +└── libhello +    ├── Cargo.toml +    └── src +        └── lib.rs + +2 directories, 2 files +``` + +Knowing Cargo, don't be surprised that it put some code in your new library file. Find out what it added by moving to the package directory and viewing the file. By default, Cargo puts a test function within library files. + +### Running tests using Cargo + +Rust provides first-class support for unit and integration testing, and Cargo allows you to execute any of these tests: + + +``` +$ cd libhello/ + +$ cat src/lib.rs +#[cfg(test)] +mod tests { +    #[test] +    fn it_works() { +        assert_eq!(2 + 2, 4); +    } +} +``` + +Cargo has a handy **test** option to run any test that is present in your code. Try running the tests that Cargo put in the library code by default: + + +``` +$ cargo test +   Compiling libhello v0.1.0 (/opensource/libhello) +    Finished test [unoptimized + debuginfo] target(s) in 0.55s +     Running target/debug/deps/libhello-d52e35bb47939653 + +running 1 test +test tests::it_works ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out + +   Doc-tests libhello + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out +``` + +### Looking under Cargo's hood + +You may be interested in knowing what Cargo does under the hood when you run a command. After all, Cargo is, in many ways, a wrapper. To find out what it's doing, you can use the **-v** option with any Cargo command to output verbose information to the screen. + +Here are a couple of examples that run **build** and **clean** using the **-v** option. + +In the **build** command, you can see that the underlying **rustc** (Rust compiler) fired with the given command-line options: + + +``` +$ cargo build -v +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +     Running `rustc --edition=2018 --crate-name hello_opensource src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=147b8a0f466515dd -C extra-filename=-147b8a0f466515dd --out-dir /opensource/hello_opensource/target/debug/deps -C incremental=/opensource/hello_opensource/target/debug/incremental -L dependency=/opensource/hello_opensource/target/debug/deps` +    Finished dev [unoptimized + debuginfo] target(s) in 0.36s +``` + +Whereas the **clean** command shows that it is simply removing the directory that contains the intermediate files and the binary: + + +``` +$ cargo clean -v +    Removing /opensource/hello_opensource/target +``` + +### Don't let your skills get rusty + +To expand your skills, try writing and running a slightly more complex program using Rust and Cargo. Something simple will do: for instance, try listing all files in the current directory (it can be done in nine lines of code), or try echoing input back out at yourself. Small practice applications help you get comfortable with the syntax and the process of writing and testing code. + +This article offers plenty of information for budding Rust programmers to get started with Cargo. However, as you begin working on larger and more complicated programs, you'll need a more advanced understanding of Cargo. When you're ready for more, download and read the open source [Cargo Book][10] written by the Rust team, and see what you can create! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/rust-cargo + +作者:[Gaurav Kamathe][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/gkamathe +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-containers2.png?itok=idd8duC_ (Shipping containers stacked in a yard) +[2]: https://www.rust-lang.org/ +[3]: https://insights.stackoverflow.com/survey/2019#technology-_-most-loved-dreaded-and-wanted-languages +[4]: https://sh.rustup.rs/ +[5]: https://www.rust-lang.org/tools/install +[6]: https://doc.rust-lang.org/cargo/faq.html +[7]: mailto:user@mail.com +[8]: mailto:test@mail.com +[9]: http://crates.io +[10]: https://doc.rust-lang.org/cargo From 396b5d6cb440f3c07b8d7ff564da3db3ede12d25 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 4 Mar 2020 01:06:15 +0800 Subject: [PATCH 268/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200303=20Gettin?= =?UTF-8?q?g=20started=20with=20lightweight=20alternatives=20to=20GNU=20Em?= =?UTF-8?q?acs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200303 Getting started with lightweight alternatives to GNU Emacs.md --- ...h lightweight alternatives to GNU Emacs.md | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 sources/tech/20200303 Getting started with lightweight alternatives to GNU Emacs.md diff --git a/sources/tech/20200303 Getting started with lightweight alternatives to GNU Emacs.md b/sources/tech/20200303 Getting started with lightweight alternatives to GNU Emacs.md new file mode 100644 index 0000000000..5f86c79b84 --- /dev/null +++ b/sources/tech/20200303 Getting started with lightweight alternatives to GNU Emacs.md @@ -0,0 +1,164 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with lightweight alternatives to GNU Emacs) +[#]: via: (https://opensource.com/article/20/3/lightweight-emacs) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Getting started with lightweight alternatives to GNU Emacs +====== +Slimmed-down (in size and features) alternatives allow you to take your +text editor anywhere you go. +![Text editor on a browser, in blue][1] + +I work on a lot of servers, and sometimes I find a host that hasn't installed [GNU Emacs][2]. There's usually a [GNU Nano][3] installation to keep me from resorting to [Vi][4], but I'm not used to Nano the way I am Emacs, and I inevitably run into complications when I try to save my document (**C-x** in Nano stands for Exit, and **C-s** locks Konsole). + +While it would be nice to have GNU Emacs available everywhere, it's a lot of program for making a simple update to a config file. My need for a small and lightweight emacs is what took me down the path of discovering MicroEmacs, Jove, and Zile—tiny, self-contained [emacsen][5] that you can put on a thumb drive, an SD card, and nearly any server, so you'll never be without an emacs editor. + +### Editing macros + +The term "emacs" is a somewhat generic term in the way that only open source produces, and a portmanteau. Before there was [GNU Emacs][6], there were collections of batch process scripts (called _macros_) that could perform common tasks for a user. For instance, if you often found yourself typing "teh" instead of "the," you could either go in and correct each one manually (no small feat when your editor can't even load the entire document into memory, as was often the case in the early 1980s), or you could invoke a macro to perform a quick swap of the "e" and "h." + +Eventually, these macros were bundled together into a package called editing macros, or EMACS for short. GNU Emacs is the most famous emacsen (yes, the -en suffix is used to describe many emacs, as in the word "oxen"), but it's not the only one. And it's certainly not the smallest. Quite the contrary, GNU Emacs is probably one of the largest. + +Fortunately, GNU Emacs is so popular that other emacs implementations tend to mimic most of the GNU version's basic controls. If you're looking for a basic, fast, and efficient editor that isn't Vim, you'll likely be happy with any of these options. + +### MicroEmacs + +![µemacs][7] + +[MicroEmacs][8], also known as uemacs (as in the Greek letter µ, which denotes "micro" in scientific notation), was written by Dave Conroy, but there's a long list of users who have cloned it and modified it. One user who maintains a personal version of µemacs is a programmer named Linus Torvalds, and his copy is available from his website, [kernel.org][9] (which also, incidentally, includes a small side project of his called [Linux][10]). + +#### Size + +It takes me five seconds to compile µemacs at the slowest setting I can impose on my computer, and the resulting binary is a mere 493KB. Admittedly, that's not literally "micro" compared to the typical size of a GNU Emacs download (1 millionth of 70MB is 70 bytes, by my calculation), but it's respectably small. For instance, it's easy enough to send it to yourself by email or over Signal, and certainly small enough to keep handy on every thumb drive or SD card you own. + +By default, Linus's version expects libcurses, but you can override this setting in the Makefile so that it uses libtermcap instead. The resulting binary is independent enough to run on most Linux boxes: + + +``` +$ ldd em +linux-vdso.so.1 +libtermcap.so.2 => /lib64/libtermcap.so.2 +libc.so.6 => /lib64/libc.so.6 +/lib64/ld-linux-x86-64.so.2 +``` + +#### Features + +The [keyboard shortcuts][11] are just as you'd expect. You can open files and edit them without ever realizing you're not in GNU Emacs. + +Some advanced features are missing. For instance, there's no vertical buffer split, although there is a horizontal split. There's no eval command, so you won't use µemacs for Lisp programming. + +The search function is also a little different from what you may be used to: instead of **C-s**, it's **M-s**, which could make all the difference if your terminal emulator accepts **Ctrl+S** as a freeze command. The help page for µemacs is very complete, so use **M-x help** to get familiar with what it has available. + +#### License + +The license for µemacs is custom to the project with a non-commercial condition. You're free to share, use, and modify µemacs, but you can't do anything commercial with it. +While not as liberal a policy as I typically prefer, it's a good-enough license for personal use; just don't build a business around it. + +### GNU Zile + +![GNU Zile][12] + +[GNU Zile][13] claims to be a development kit for text editors. It's meant as a framework to enable people to quickly develop their own custom text editor without having to reinvent common data structures. It's a great idea and probably very useful, but as I have no interest in making my own editor, I just use the example implementation that ships with its codebase as a pleasant, lightweight emacs. + +The build process for the example editor (supposedly called Zemacs, although the binary it renders is named zile) is the standard [Autotools][14] procedure: + + +``` +$ ./configure +$ make +``` + +#### Size + +Compiling it from source takes me a minute on one core or about 50 seconds on six cores (the configuration process is the long part). The binary produced in the end is 1.2MB, making this the heaviest of the lightweight emacsen I use, but compared to even GNU Emacs without X (which is 14MB on my system), it's relatively trivial. + +Of the lightweight emacsen I use, it's also the most complex. You can exclude some library links by disabling features during configuration, but here are the defaults: + + +``` +$ ldd src/zile +linux-vdso.so.1 +libacl.so.1 => /lib64/libacl.so.1 +libncurses.so.5 => /lib64/libncurses.so.5 +libgc.so.1 => /usr/lib64/libgc.so.1 +libc.so.6 => /lib64/libc.so.6 +libattr.so.1 => /lib64/libattr.so.1 +libdl.so.2 => /lib64/libdl.so.2 +libpthread.so.0 => /lib64/libpthread.so.0 +/lib64/ld-linux-x86-64.so.2 +``` + +#### Features + +Zile acts a little more like GNU Emacs than µemacs or Jove, but it's still a minimal experience. But some little touches are refreshing: Tab completion happens in a buffer, you can run shell commands from the mini-buffer, and you have a good assortment of functions available. It's by no means a GNU Emacs replacement, though, and if you wander too far in search of advanced features, you'll find out why it's only 1.2MB. + +I've been unable to find in-application help files, and the man page bundled with it is minimal. However, if you're comfortable with Emacs, Zile is a good compromise between the full 14MB (or greater, if you're using a GUI) version and the extremely lightweight implementations. + +### Jove + +![Jove][15] + +[Jove][16] was my first tiny emacs and remains the smallest I've found yet. This was an easy discovery for me, as it ships with [Slackware][17] Linux and, with a surreptitious symlink, quickly became my personal replacement for the Vi binary. Jove is based on GNU Emacs, but the man page cautions that feature parity is by no means to be expected. I find Jove surprisingly feature-rich for such a small binary (in fact, this article was written in Jove version 4.17.06-9), but there's no question that renaming .emacs to .joverc does _not_ behave as you might hope. + +#### Size + +It takes me five seconds to compile Jove at the slowest setting (-j1) and about a second using all cores. The resulting binary, confusingly called jjove by default, is just 293KB. + +The Jove binary is independent enough to run on most Linux boxes: + + +``` +$ ldd jjove +linux-vdso.so.1 +libtermcap.so.2 => /lib64/libtermcap.so.2 +libc.so.6 => /lib64/libc.so.6 +/lib64/ld-linux-x86-64.so.2 +``` + +#### Features + +Jove has good documentation in the form of a man page. You can also get a helpful listing of all available commands by typing **M-x ?** and using the Spacebar to scroll. If you're entirely new to emacs, you can run **teachjove** to learn Jove (and emacs, accordingly). + +Most common editing commands and keybindings work as expected. Some oddities exist; for example, there's no vertical split, and Tab completion for paths in the mini-buffer is non-existent. However, it's the smallest emacs I've found and yet has a full GNU Emacs feel to it. + +### Try Emacs + +If you've only ever tried GNU Emacs, then you might find that the world of emacsen is richer than you may have expected. There's a rich tradition behind emacs, and trying some of its variants, spin-offs, and alternate implementations is part of the joy of being comfortable with how emacsen work. Get to know emacs; carry a few builds around everywhere you go, and you'll never have to use a substandard editor again! + +GNU Emacs can be much more than just a text editor. Learn how to get started. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/lightweight-emacs + +作者:[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/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue) +[2]: https://www.gnu.org/software/emacs/ +[3]: https://www.nano-editor.org/ +[4]: https://opensource.com/article/19/3/getting-started-vim +[5]: https://www.emacswiki.org/emacs/Emacsen +[6]: https://opensource.com/article/20/2/who-cares-about-emacs +[7]: https://opensource.com/sites/default/files/uploads/lightweight-emacs-uemacs.jpg (µemacs) +[8]: https://en.wikipedia.org/wiki/MicroEMACS +[9]: https://git.kernel.org/pub/scm/editors/uemacs/uemacs.git +[10]: https://opensource.com/tags/linux +[11]: https://opensource.com/downloads/emacs-cheat-sheet +[12]: https://opensource.com/sites/default/files/uploads/lightweight-emacs-zile.jpg (GNU Zile) +[13]: https://www.gnu.org/software/zile/ +[14]: https://opensource.com/article/19/7/introduction-gnu-autotools +[15]: https://opensource.com/sites/default/files/uploads/lightweight-emacs-jove.jpg (Jove) +[16]: https://opensource.com/article/17/1/jove-lightweight-alternative-vim +[17]: http://slackware.com From 842af9ddb8e9532d7505601d567d34a0f68d7400 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 4 Mar 2020 01:07:23 +0800 Subject: [PATCH 269/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200303=20How=20?= =?UTF-8?q?to=20assess=20your=20organization's=20technological=20maturity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200303 How to assess your organization-s technological maturity.md --- ...r organization-s technological maturity.md | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 sources/tech/20200303 How to assess your organization-s technological maturity.md diff --git a/sources/tech/20200303 How to assess your organization-s technological maturity.md b/sources/tech/20200303 How to assess your organization-s technological maturity.md new file mode 100644 index 0000000000..75c3cda6ff --- /dev/null +++ b/sources/tech/20200303 How to assess your organization-s technological maturity.md @@ -0,0 +1,173 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to assess your organization's technological maturity) +[#]: via: (https://opensource.com/open-organization/20/3/communication-technology-worksheet) +[#]: author: (Ron McFarland https://opensource.com/users/ron-mcfarland) + +How to assess your organization's technological maturity +====== +Implementing new communications technologies can make your organization +more open. Use this worksheet to determine whether your organization—and +its people—are prepared. +![Someone wearing a hardhat and carrying code ][1] + +New communication technologies can promote and improve [open organizational principles and practices][2]—both within a company and between customers and strategic partners, leading to greater sales and business opportunities. + +Previously, I've discussed how companies adopting new communication technologies tend to [fall into four basic categories][3] of investment and utilization. In this article, I'll demonstrate how someone might assess an organization's level of preparedness for technological innovations and the cultural changes it requires. + +### Becoming a superstar + +For the purpose of this exercise, imagine you're a salesperson working for a company that provides communication or information technology solutions to companies that need advanced information systems and would benefit by becoming "[communication superstars][3]." You'll likely want to impress upon your customers the benefits of becoming this type of user—benefits such as: + + * Enhanced customer interaction: When _our_ customers' salespeople visit _their_ customers, they'll need to make the best impression they can to build some level of trust. Therefore—before offering any product—a salesperson must get a customer talking about his situation in order to discover his particular needs, concerns, and opportunities for growth. When the customer asks the salesperson questions about what he can do to address these issues, imagine our customer's salespeople being able to answer him in seconds with detailed information, instead of making the customer wait for hours, day, or even weeks for the answers. Such technologies can increase one's capacity to make proposals, lead to faster and wiser purchasing decisions, and maximize salesperson-customer interactions—all extremely important benefits. + * Better operations: In manufacturing especially, production bottlenecks can be a drain on in-process inventory costs, and alleviating those bottlenecks is critical. Knowing _exactly_ the situation (in-process inventory levels and processing speed, for example) of _every_ stage of a production line in real time can greatly [improve productivity][4]. + * Development of new business strategies: With new communication technology expertise, a company could open up new markets and opportunities that would have historically been out of its reach. + + + +### **Let's do some research** + +Armed with knowledge of those benefits, again imagine you're a salesperson at an enterprise communication or information technology company. You meet a potential customer at an exhibition or business summit, and she describes the following situation to you: + +> "I'm the Operations Manager of a small, local transportation company that makes deliveries within and between several of the surrounding cities. We have a fleet of 30 trucks, all of various sizes and makes. I know the company's information system must to be improved; much of our communication is done through email attachments, texting, and mobile phone calls. We have no central information operating system." + +A large, public, national trucking company has set up in her area. She's studied this competitor and read several of its news releases and annual reports. She's learned the company has a centralized communications system, and that all its trucks have tracking technologies that monitor the location of every truck in operation. Trucks also feature sensors that monitor many vehicle operations, including average and specific engine RPM per route by vehicle and driver, and miles travelled in particular conditions (to determine fuel economy and maintenance schedules). An electronic parts delivery system connects this company's service operations with a network of dealers to reduce the time service technicians must wait for parts. + +This is what the small local trucking company must compete against. So its operations manager asks you, the IT company salesperson, what you can do to help. + +You decide that your first step is to conduct a survey to learn more about both the company's current communication technology system and the personnel's attitude toward this system in order to see what _could_ and _should_ be done to improve the situation. While there, you want to learn this trucking company's IT status _before_ making any recommendations. + +I've created a worksheet you might use to facilitate this conversation. + +### Taking the temperature + +The first part of the worksheet can help you develop a baseline assessment of an organization's readiness for technological change. + +#### Part 1: Baseline maturity relative to competitors + +Generally, if the customer scores between 10 and 42, then that customer needs more assistance adopting new communication technology, but this varies by industry. If the score is between 43 and 70, then (when compared to competitors the customer is likely already mature in its use of communication technologies. + +#### Part 2: Leaders' relationship to communication technologies + +Next, you need to assess the company leadership's relationship to technologies, associated processes, and cultural changes. So let's make those calculations in Part 2 of the worksheet. + +Here again, depending on the competitive environment, if the score is between 10 and 42, then the company is generally _not_ completely utilizing the communication technology it has. If the score is between 43 and 70, then generally the company puts the communication technology it has to good, creative use. + +Organizational leaders must lead the conversation about using more advanced communication systems in the organization. Therefore management must establish training programs to teach everyone in the organization the skills required to _use_ that technology (a step often forgotten or poorly implemented). + +#### Part 3: Awareness of challenges and opportunities + +We now need to help the organization think more strategically about its use of communication technologies to implement open processes and open culture. We'll do this with Part 3 of the worksheet. + +If an organization scores higher than 15, the company understands the communication technology landscape fairly well. If the score is between 9 and 15, the organization needs to isolate its weakest areas and remedy them. A score of less than 9 indicates that the organization should consider conducting new awareness exercises and/or communication technology discovery programs. + +#### Part 4: Technological mastery relative to competitors + +Next, we need to better understand the trucking company's current strategic assets and its level of technological mastery relative to competitors. We'll do that with Part 4 of the worksheet. + +An organization that scores above 16 in this section likely knows where it stands and what its innovation trajectory is in comparison to competitors. A score of 7 to 16 means the organization needs to build alignment around a viable renewal path. A score of less than 7 might mean the organization should conduct a communication technology maturity assessment and update its best practices. + +#### Part 5: Ability to articulate technological vision + +Now let's explore how well the organization's senior leaders can articulate a vision for the role communication technology will play in the company's future. That's Part 5 of the worksheet. + +If the organization scores over 24, then its members likely believe its executives are aligned on a technological vision (and are considering competitors). A score of 14 to 24 should prompt us to isolate the root causes of the concerns and work with the team to remedy them. Anything less than 14 should spur a structured senior executive alignment initiative. + +Questions like these can clarify the extent to which employees must be involved in communication technology investment decision-making and utilization. Front-line members typically know what's necessary, what's available, and what the organization should introduce. + +### From vision to action + +I've seen first-hand that in situations like these, purchasing technologies is only half the problem. Getting people to buy into the system and use it to full capacity are far bigger challenges. + +In this section, we'll assess the organization's ability to translate technological vision into action. + +#### Part 6: Ability to translate vision to action + +First, let's see how the company is currently converting its vision into an action plan relative to competitors. We'll return to the worksheet, specifically Part 6. + +A company scoring more than 17 points likely has a robust plan and evaluation system in place, and is focused on engaging people in executing technological adoption efforts relative to competitors. Organizations scoring 7 to 17 should review the action plan and milestone checklist weekly for content and alignment. Those scoring less than 7 should conduct a full review of its milestone checklist and action plan processes. + +#### Part 7: Supervision strategies + +Few plans succeed without proper supervision, so you'll want to assess the organization's plans to oversee change management efforts. We'll use the trusty worksheet—this time, Part 7. + +Did the company score something greater than 15? Then its supervision model is in good shape. Maybe 8 to 15? It should check its governance principles and/or program leadership. Less than 8? Time to rework (or design for the first time) its supervision principles. + +#### Part 8: Funding strategy for implementation + +Of course, organizational initiatives like these require funding. So you'll want to assess the organization's financial commitment to technological change. Once again, let's use our worksheet (Part 8 this time). + +Scoring more than 16 points means the company's funding for new communication technologies is strong. Scoring 8 to 16 means the company should work to ensure that the company portfolio, funding, and business strategy are better aligned. Anything less than 8 means company needs to rework its investment and funding strategy for new technologies. + +#### Part 9: Clarity and promotion of vision + +Organizational leaders should constantly be clarifying and advocating plans to adopt new technologies. How are they doing? Let's review Part 9 of our worksheet. + +If the company scores over 17, then it's likely doing a good job of marketing its ambitions. If it scores somewhere between 7 and 17, it should isolate dimensions of its messaging that need refinement and work with the team to remedy them. If it scores less than 7, it should consider developing a specific program to convey the company's ambition more broadly. + +#### Part 10: Ability to build and sustain engagement + +Changes to technological systems and processes don't happen automatically. People need to invest in them, and leaders need to sustain their engagement in the organizational changes. Not everyone will buy in (as I've [written previously][5]). We can assess how well the organization is doing this with Part 10 of the worksheet. + +A score over 23 indicates that the company is doing a good job building momentum while introducing communication technologies. A score of 12 to 23 means that organization might need to isolate some part of the process that's not proceeding satisfactorily and remedy that component. Less than 12? The company needs to design and conduct a full engagement program. + +### Organizational considerations + +This final section assesses specific _organizational_ capacities—that is, the organization's culture, its structure, and its processes. Becoming more open by adopting new communication technologies is only possible if the organization itself is flexible and willing to change. + +#### Part 11: Organizational culture + +Is the organizational environment amenable to the kinds of changes necessary for effectively adopting new communication activities? We'll assess that in Part 11 of our worksheet. + +An organization scoring more than 16 points is already shifting its organizational behaviors and culture ahead of competitors. One scoring between 7 and 16 points should investigate root causes of concerns about cultural changes and work with the team to remedy problems. An organization scoring less than 7 should begin working to shift its culture around communication practices and expectations. + +#### Part 12: Organizational structure + +Does the organization's current structure allow it to sustain communication technology innovations? Use Part 12 of the worksheet to gather an initial impression. + +Scoring over 16 means the company possesses the basic structural capabilities necessary for sustained, steady, technical changes. Scoring between 8 and 16 means the company has only begun implementing projects aimed at developing necessary structural capabilities, but more effort is needed. And a score of less than 8 indicates that the company needs to consider specific programs for improving basic structural capabilities. + +#### Part 13: Reward and incentive structures + +Are the organization's reward and incentive structures aligned with the organization's goals for introducing and adopting new communication technologies? Let's look at the worksheet one last time. + +A score over 14 indicates that the company's current reward structures are aligned with its communication technology objectives. A score between 6 and 14 tells us that the organization should build stronger consensus around a viable reward strategy aligned to communication technology renewal. And a score of less than 6 should prompt leadership to implement specific reward structures that accomplish its communication technology adoption goals. + +### Post-survey debrief + +After collecting those data, you're now in a position to ask how your information technology company can help your potential customer in four areas: + + 1. Data gathering and company strategy analytics + 2. Social media, internet utilization, and interaction internally + 3. Telecommunication utilization within company (to avoid excess and unnecessary traveling for meetings, etc.) + 4. Automation technology utilization within the company + + + +You're also able to inquire within your company (among solution architects, for example) who we potentially should partner with if need be in order to achieve this transportation company's goals in these four areas." + +In these kinds of strategic partnerships, open organization principles—especially transparency, inclusivity, collaboration, and community—come alive. One person cannot do this kind of work alone. + +I've seen first-hand that in situations like these, purchasing technologies is only _half the problem._ Getting people to _buy into the system_ and _use it to full capacity_ are far bigger challenges. These challenges are cultural, not technological. Being a "communication superstar" means being great in both those areas—both the communication technology itself, as well as the culture and process expertise necesasry for actual utilization. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/20/3/communication-technology-worksheet + +作者:[Ron McFarland][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/ron-mcfarland +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/build_structure_tech_program_code_construction.png?itok=nVsiLuag (Someone wearing a hardhat and carrying code ) +[2]: https://opensource.com/open-organization/resources/open-org-definition +[3]: https://opensource.com/open-organization/20/1/communication-technology-superstars +[4]: https://www.slideshare.net/RonMcFarland1/improving-processes-65115172?qid=b0a0fde3-62c6-4538-88c8-1bfd70485cee&v=&b=&from_search=5 +[5]: https://opensource.com/open-organization/17/1/escape-the-cave From d2f3f6dbad41ec895c0b5b33c95ceeac8aba8717 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 4 Mar 2020 01:09:06 +0800 Subject: [PATCH 270/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200303=20Key=20?= =?UTF-8?q?Takeaways=20from=20Cisco=E2=80=99s=20Annual=20Internet=20Report?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200303 Key Takeaways from Cisco-s Annual Internet Report.md --- ...ays from Cisco-s Annual Internet Report.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sources/talk/20200303 Key Takeaways from Cisco-s Annual Internet Report.md diff --git a/sources/talk/20200303 Key Takeaways from Cisco-s Annual Internet Report.md b/sources/talk/20200303 Key Takeaways from Cisco-s Annual Internet Report.md new file mode 100644 index 0000000000..d450597913 --- /dev/null +++ b/sources/talk/20200303 Key Takeaways from Cisco-s Annual Internet Report.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Key Takeaways from Cisco’s Annual Internet Report) +[#]: via: (https://www.networkworld.com/article/3529989/key-takeaways-from-cisco-s-annual-internet-report.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +Key Takeaways from Cisco’s Annual Internet Report +====== +Businesses need to be ready for the massive wave of devices and bandwidth that are coming in the next vide years +Natalya Burova / Getty Images + +By 2023, two-thirds of the world’s population will have Internet access—that’s 5.3 billion total Internet users, compared to 3.9 billion in 2018. The number of devices and connections will also skyrocket. There will be 3.6 networked devices per capita by 2023, whereas in 2018, there were 2.4 networked devices per capita. + +These findings come from Cisco’s _[Annual Internet Report (2018 – 2023) ][1]_(AIR) - previously known as Visual Network Index (VNI), which assesses the digital transformation across different business segments and their adoption of networking technologies, including fixed broadband, Wi-Fi, and mobile (3G, 4G, 5G).  + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][2] + +The report described an increased demand for new or enhanced applications that boost workforce productivity or improve customer experiences. In today’s mobile world, users expect their devices (and networks) to deliver on all fronts: quality, ease of use, and seamless connectivity.  + +[Cisco][3] + +The report can be useful as companies plan out their network strategies. One of the aspects of the VNI that Cisco carried over to AIR is an [online tool][4] that lets people slice and dice the information by country, device or other factors. They also included an [“Internet readiness” tool ][5]that explores how prepared different regions are for the coming wave of devices and need for bandwidth.  + +**More network automation is needed** + +To meet growing demand for enhanced apps, enterprises need automated network monitoring and optimization, andt that can be achieved with software-defined wide area networking (SD-WAN). Software-driven networks create more flexible infrastructures that can adapt to changing traffic requirements, which becomes necessary as more enterprises move to hybrid clouds, the report says. + +Policy-based automation and Intent-Based Networking (IBN) are just as important when it comes to building agile, portable, and scalable networks. IBN, as the name implies, captures business intent through analytics and machine learning. One trend Cisco observed in its report is how business WAN traffic flow patterns are becoming more software-based and hybrid in nature, creating a need for IBN solutions, the report says. + +[][6] + +**SD-WAN is core to network success** + +SD-WAN is important to the network edge, which brings computing, storage, and networking resources closer to users and devices. Cisco found many use cases driving the need for greater edge-computing capabilities. One of them is finding ways to control data from the billions of Internet of Things (IoT) endpoints being added to the network edge. + +Out of the 29.3 billion networked devices in use by 2023, about half will support various IoT applications, per Cisco’s report. As for machine-to-machine (M2M) communication, there will be 14.7 billion connections by 2023. Consumers will hold the biggest share (74%) of total devices and connections, with businesses claiming approximately 26%. However, the consumer share will grow at a slower rate than business. + +How will enterprises manage to secure all networked devices and data? Cisco recommends creating a security policy that strikes a balance between data protection and ease of use. In other words, networks will have to be intelligent enough to grant access to the right users without putting them through a difficult authentication process. + +**Network managers still struggle to lower operational costs** + +Network managers continue to struggle with rising operational costs, as the explosion of devices and data outpaces IT resources. Cisco found nearly 95% of network changes are still performed manually, resulting in operational costs that outweigh network costs. That’s where IT automation can help, enabled by SDN, intelligent network-edge enhancements, and unified domain controls. + +In addition to exploring business-specific networking needs, Cisco outlined some trends in consumer and small-to-medium business (SMB) markets. Here are the key takeaways: + + * **Next-generation applications**—built with artificial intelligence (AI) and machine learning—will create complex requirements and new business models. Mobile applications, specifically, will drive future consumer, SMB, and enterprise needs, with 299.1 billion mobile apps downloaded worldwide by 2023. + * **Mixed devices and connections** are enabling myriad M2M apps. Connected-home, video-surveillance, connected appliances, and tracking apps will make up 48% of M2M connections by 2023. Connected-car apps will be the fastest-growing category, with connected cities coming in second. + * **Accelerating broadband speeds** will affect traffic growth and use of high-bandwidth content and applications. Average broadband speeds will more than double globally from 45.9 Mbps (in 2018) to 110.4 Mbps (in 2023). Fiber-to-the-home (FTTH), high-speed DSL, and cable broadband adoption will contribute to the growth. + * **Wi-Fi will gain momentum** as devices and IoT connections increase. By 2023, the number of public Wi-Fi hotspots will grow to 628 million, up from 169 million in 2018. Wi-Fi 6 promises to boost speeds by up to 30%, compared to the current generation. More importantly, next-gen Wi-Fi will significantly improve real-time communications and high-definition video, impacting both consumer and business sectors. + + + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3529989/key-takeaways-from-cisco-s-annual-internet-report.html + +作者:[Zeus Kerravala][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Zeus-Kerravala/ +[b]: https://github.com/lujun9972 +[1]: http://www.cisco.com/go/ciscoair +[2]: https://www.networkworld.com/newsletters/signup.html +[3]: https://www.cisco.com/c/en/us/solutions/collateral/executive-perspectives/annual-internet-report/white-paper-c11-741490.html +[4]: https://www.cisco.com/c/en/us/solutions/executive-perspectives/annual-internet-report/air-highlights.html +[5]: https://www.cisco.com/c/en/us/solutions/service-provider/cloud-readiness-tool/index.html +[6]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From 77330e72f751d0dea17086412d79458ed8735ab5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 4 Mar 2020 01:18:38 +0800 Subject: [PATCH 271/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200303=20Watchi?= =?UTF-8?q?ng=20activity=20on=20Linux=20with=20watch=20and=20tail=20comman?= =?UTF-8?q?ds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200303 Watching activity on Linux with watch and tail commands.md --- ...y on Linux with watch and tail commands.md | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 sources/tech/20200303 Watching activity on Linux with watch and tail commands.md diff --git a/sources/tech/20200303 Watching activity on Linux with watch and tail commands.md b/sources/tech/20200303 Watching activity on Linux with watch and tail commands.md new file mode 100644 index 0000000000..15780a5b34 --- /dev/null +++ b/sources/tech/20200303 Watching activity on Linux with watch and tail commands.md @@ -0,0 +1,148 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Watching activity on Linux with watch and tail commands) +[#]: via: (https://www.networkworld.com/article/3529891/watching-activity-on-linux-with-watch-and-tail-commands.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Watching activity on Linux with watch and tail commands +====== +The watch and tail commands can help monitor activity on Linux systems. This post looks at some helpful ways to use these commands. +Loops7 / Getty Images + +The **watch** and **tail** commands provide some interesting options for examining activity on a Linux system in an ongoing manner. + +That is, instead of just asking a question and getting an answer (like asking **who** and getting a list of currently logged in users), you can get **watch** to provide you with a display showing who is logged in along with updates as users come and go. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] + +With **tail**, you can display the bottoms of files and see content as it is added. This kind of monitoring is often very helpful and requires less effort than running commands periodically. + +### Using watch + +One of the simplest examples of using **watch** is to use the command **watch who**. You should see a list showing who is logged in along with when they logged in and where they logged in from. Notice that the default is to update the display every two seconds (top left) and that the date and time (upper right) updates itself at that interval. The list of users will grow and shrink as users log in and out. + +### $ watch who + +This command will dissplay a list of logins like this: + +``` +Every 2.0s: who dragonfly: Thu Feb 27 10:52:00 2020 + +nemo pts/0 2020-02-27 08:07 (192.168.0.11) +shs pts/1 2020-02-27 10:58 (192.168.0.5) +``` + +You can change the interval to get less frequent updates by adding a **-n** option (e.g., -n 10) to select a different number of seconds between updates. + +### $ watch -n 10 who + +The new interval will be displayed and the time shown will change less frequently, aligning itself with the selected interval. + +[][2] + +``` +Every 10.0s: who dragonfly: Thu Feb 27 11:05:47 2020 + +nemo pts/0 2020-02-27 08:07 (192.168.0.11) +shs pts/1 2020-02-27 10:58 (192.168.0.5) +``` + +If you prefer to see only the command's output and not the heading (the top 2 lines), you can omit those lines by adding the **-t** (no title) option. + +### $ watch -t who + +Your display will then look like this: + +``` +nemo pts/0 2020-02-27 08:07 (192.168.0.11) +shs pts/1 2020-02-27 10:58 (192.168.0.5) +``` + +If every time the watched command runs, its output is the same, only the title line (if not omitted) will change. The rest of the displayed information will stay the same. + +If you want your **watch** command to exit as soon as the output of the command that it is watching changes, you can use a **-g** (think of this as the "go away") option. You might choose to do this if, for example, you are simply waiting for others to start logging into the system. + +You can also highlight changes in the displayed output using the **-d** (differences) option. The highlighting will only last for one interval (2 seconds by default), but can help to draw your attention to the changes. + +Here's a more complex example of using the **watch** command to display services that are listening for connections and the ports they are using. While the output isn't likely to change, it would alert you to any new service starting up or one going down. + +``` +$ watch 'sudo lsof -i -P -n | grep LISTEN' +``` + +Notice that the command being run needs to be enclosed in quotes to ensure that the **watch** command doesn't send its output to the grep command. + +Using the **watch -h** command will provide you with a list of the command's options. + +``` +$ watch -h + +Usage: + watch [options] command + +Options: + -b, --beep beep if command has a non-zero exit + -c, --color interpret ANSI color and style sequences + -d, --differences[=] + highlight changes between updates + -e, --errexit exit if command has a non-zero exit + -g, --chgexit exit when output from command changes + -n, --interval seconds to wait between updates + -p, --precise attempt run command in precise intervals + -t, --no-title turn off header + -x, --exec pass command to exec instead of "sh -c" + + -h, --help display this help and exit + -v, --version output version information and exit +``` + +### Using tail -f + +The **tail -f** command has something in common with **watch**. It will both display the bottom of a file and additional content as it is added. Instead of having to run a "tail" command again and again, you run one command and get a repeatedly updated view of its output. For example, you could watch a system log with a command like this: + +``` +$ tail -f /var/log/syslog +``` + +Some files, like **/var/log/wtmp**, don't lend themselves to this type of handling because they're not formatted as normal text files, but you could get a similar result by combining **watch** and **tail** like this: + +``` +watch 'who /var/log/wtmp | tail -20' +``` + +This command will display the most recent 5 logins regardless of how many of the users are still logged in. If another login occurs, a line will be added and the top line removed. + +``` +Every 60.0s: who /var/log/wtmp | tail -5 dragonfly: Thu Feb 27 12:46:07 2020 + +shs pts/0 2020-02-27 08:07 (192.168.0.5) +nemo pts/1 2020-02-27 08:26 (192.168.0.5) +shs pts/1 2020-02-27 10:58 (192.168.0.5) +nemo pts/1 2020-02-27 11:34 (192.168.0.5) +dory pts/1 2020-02-27 12:14 (192.168.0.5) +``` + +Both the **watch** and **tail -f** commands can provide auto-updating views of information that you might at times want to monitor, making the task of monitoring quite a bit easier whether you're monitoring processes, logins or system resources. + +Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3529891/watching-activity-on-linux-with-watch-and-tail-commands.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/newsletters/signup.html +[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From 206f0206d03b3c49f013fc44b2ac4ba5da0b8658 Mon Sep 17 00:00:00 2001 From: wenwensnow <963555237@qq.com> Date: Tue, 3 Mar 2020 22:10:19 +0100 Subject: [PATCH 272/315] Update 20200225 3 eBook readers for the Linux desktop.md --- sources/tech/20200225 3 eBook readers for the Linux desktop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200225 3 eBook readers for the Linux desktop.md b/sources/tech/20200225 3 eBook readers for the Linux desktop.md index 1c057a15ed..0fea0ba883 100644 --- a/sources/tech/20200225 3 eBook readers for the Linux desktop.md +++ b/sources/tech/20200225 3 eBook readers for the Linux desktop.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wenwensnow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b08890fe07482b838c8c9cb8bab5b763936598c6 Mon Sep 17 00:00:00 2001 From: wenwensnow <963555237@qq.com> Date: Tue, 3 Mar 2020 22:37:35 +0100 Subject: [PATCH 273/315] Update 20200225 3 eBook readers for the Linux desktop.md --- .../tech/20200225 3 eBook readers for the Linux desktop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200225 3 eBook readers for the Linux desktop.md b/sources/tech/20200225 3 eBook readers for the Linux desktop.md index 0fea0ba883..700f56aeed 100644 --- a/sources/tech/20200225 3 eBook readers for the Linux desktop.md +++ b/sources/tech/20200225 3 eBook readers for the Linux desktop.md @@ -7,10 +7,10 @@ [#]: via: (https://opensource.com/article/20/2/linux-ebook-readers) [#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) -3 eBook readers for the Linux desktop +3 eBook readers for the Linux desktop 针对Linux桌面版的3个电子书阅读器 ====== Any of these open source eBook applications will make it easy to read -your books on a larger screen. +your books on a larger screen. 任意一个开源电子书应用都能使你在更大屏幕上的阅读体验得到提升。 ![Computer browser with books on the screen][1] I usually read eBooks on my phone or with my Kobo eReader. I've never been comfortable reading books on larger screens. However, many people regularly read books on their laptops or desktops. If you are one of them (or think you might be), I'd like to introduce you to three eBook readers for the Linux desktop. From 0e966feb51d1ddfa043b7ee320479b4a3b808489 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 4 Mar 2020 08:23:12 +0800 Subject: [PATCH 274/315] translated --- ...se logzero for simple logging in Python.md | 156 ------------------ ...se logzero for simple logging in Python.md | 155 +++++++++++++++++ 2 files changed, 155 insertions(+), 156 deletions(-) delete mode 100644 sources/tech/20200226 Use logzero for simple logging in Python.md create mode 100644 translated/tech/20200226 Use logzero for simple logging in Python.md diff --git a/sources/tech/20200226 Use logzero for simple logging in Python.md b/sources/tech/20200226 Use logzero for simple logging in Python.md deleted file mode 100644 index 467b30d968..0000000000 --- a/sources/tech/20200226 Use logzero for simple logging in Python.md +++ /dev/null @@ -1,156 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use logzero for simple logging in Python) -[#]: via: (https://opensource.com/article/20/2/logzero-python) -[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) - -Use logzero for simple logging in Python -====== -A quick primer on the handy log library that can help you master this -important programming concept. -![Snake charmer cartoon with a yellow snake and a blue snake][1] - -The logzero library makes logging as easy as a print statement, which is quite a feat of simplicity. I'm not sure whether logzero took its name to fit in with the series of "zero boilerplate" libraries like pygame-zero, GPIO Zero, and guizero, but it's certainly in that category. It's a Python library that makes logging straightforward. - -You can just use its basic logging to stdout the same way you might use print for information and debugging purposes, and it has a smooth learning curve towards more advanced logging, like logging to a file. - -To start, install logzero with pip: - - -``` -`$ sudo pip3 install logzero` -``` - -Now in a Python file, import logger and try one or all of these logging examples: - - -``` -from logzero import logger - -logger.debug("hello") -logger.info("info") -logger.warning("warning") -logger.error("error") -``` - -The output is automatically colored in an easy-to-read way: - -![Python, Raspberry Pi: import logger][2] - -So now, instead of using **print** to figure out what's going on, use logger instead, with the relevant log level. - -### Writing logs to a file in Python - -If you only read this far and make that one change in the way you write code, that's good enough for me. If you want to go further, read on! - -Writing to **stdout** is fun for testing a new program, but it is only useful if you are logged into the computer where the script is running. Many times when using an application you'll want to execute the code remotely and review errors after the fact. That's when it's helpful to log to a file instead. Let's try it: - - -``` -from logzero import logger, logfile - -logfile('/home/pi/test.log') -``` - -Now your log entries will be logged into the file **test.log**. Remember to make sure that the [script has permission][3] to write to that file and its directory structure. - -You can specify some more options too: - - -``` -`logfile(’/home/pi/test.log’, maxBytes=1e6, backupCount=3)` -``` - -Now when the file provided to **logfile** reaches 1MB (1×106 bytes), it will rotate entries through **test.log.1**, **test.log.2**, and so on. This behavior is nice to avoid generating a massive log file that is I/O intensive for the system to open and close. You might also want to log to **/var/log** like a pro. Assuming you're on Linux, you a directory and make your user the owner so they can write to it: - - -``` -$ sudo mkdir /var/log/test -$ sudo chown pi /var/log/test -``` - -Then in your Python code, change the **logfile** path: - - -``` -`logfile(’/var/log/test/test.log’, maxBytes=1e6, backupCount=3)` -``` - -When it comes to catching exceptions in your **logfile**, you can either use **logging.exception:** - - -``` -try: -    c = a / b -except Exception as e: -    logger.exception(e) -``` - -This will produce the following (in the case that b is zero): - - -``` -[E 190422 23:41:59 test:9] division by zero -     Traceback (most recent call last): -       File "test.py", line 7, in -         c = a / b -     ZeroDivisionError: division by zero -``` - -You get the log entry, followed by the full traceback. Alternatively, you could use **logging.error** and hide the traceback: - - -``` -try: -    c = a / b -except Exception as e: -    logger.error(f"{e.__class__.__name__}: {e}") -``` - -Now this will produce the more succinct: - - -``` -`[E 190423 00:04:16 test:9] ZeroDivisionError: division by zero` -``` - -* * * - -* * * - -* * * - -**![Logging output][4]** - -There are plenty more options which you can read in the docs at [logzero.readthedocs.io][5]. - -### logzero shines for education - -Logging can be a challenging concept for a new programmer. Most frameworks depend on flow control and lots of variable manipulation to make a meaningful log, but logzero is different. With its syntax being similar to a print statement, it is a big win for education as it saves from explaining another concept. Give it a try on your next project. - -\-- - -_This article was originally written on [my blog][6] and is republished with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/logzero-python - -作者:[Ben Nuttall][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/bennuttall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Snake charmer cartoon with a yellow snake and a blue snake) -[2]: https://opensource.com/sites/default/files/uploads/rpi_ben_1.png (Python, Raspberry Pi: import logger) -[3]: https://opensource.com/article/19/6/understanding-linux-permissions -[4]: https://opensource.com/sites/default/files/uploads/rpi_ben_2.png (Logging output) -[5]: https://logzero.readthedocs.io/en/latest/ -[6]: https://tooling.bennuttall.com/logzero/ diff --git a/translated/tech/20200226 Use logzero for simple logging in Python.md b/translated/tech/20200226 Use logzero for simple logging in Python.md new file mode 100644 index 0000000000..f246475da4 --- /dev/null +++ b/translated/tech/20200226 Use logzero for simple logging in Python.md @@ -0,0 +1,155 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use logzero for simple logging in Python) +[#]: via: (https://opensource.com/article/20/2/logzero-python) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +使用 logzero 在 Python 中进行简单日志记录 +====== +一个方便的日志库快速入门,来帮助你掌握这个重要的编程概念。 +![Snake charmer cartoon with a yellow snake and a blue snake][1] + +logzero 库使日志记录就像打印语句一样容易,是简单性的杰出代表。我不确定 logzero 的名称是否要与 pygame-zero、GPIO Zero 和 guizero 这样的 “zero 样板库”契合,但是肯定属于该类别。它是一个 Python 库,使得日志记录变得简单明了。 + +你可以使用它的基本日志记录到标准输出,就像你可以使用 print 来获得信息和调试一样,它还有学习更高级日志记录(例如记录到文件)的平滑学习曲线。 + +首先,使用 pip 安装 logzero: + + +``` +`$ sudo pip3 install logzero` +``` + +在 Python 文件中,导入 logger 并尝试以下一个或所有日志实例: + + +``` +from logzero import logger + +logger.debug("hello") +logger.info("info") +logger.warning("warning") +logger.error("error") +``` + +输出以易于阅读的方式自动着色: + +![Python, Raspberry Pi: import logger][2] + +因此现在不要再使用 **print** 来了解发生了什么,而应使用有相关日志级别的 logger。 + +### 在 Python 中将日志写入文件 + +如果你阅读至此,并会在你写代码时做一点改变,这对我就足够了。如果你要了解更多,请继续阅读! + +写到**标准输出**对于测试新程序不错,但是仅当你登录到运行脚本的计算机时才有用。在很多时候,你需要远程执行代码并在事后查看错误。这种情况下,记录到文件很有帮助。让我们尝试一下: + + +``` +from logzero import logger, logfile + +logfile('/home/pi/test.log') +``` + +现在,你的日志条目将记录到文件 **test.log** 中。记住确保[脚本有权限] [3]写入该文件及其目录结构。 + +你也可以指定更多选项: + + +``` +`logfile(’/home/pi/test.log’, maxBytes=1e6, backupCount=3)` +``` + +现在,当提供给 **logfile** 文件达到 1MB(10^6 字节)时,它将通过 **test.log.1**、**test.log.2** 等文件轮询写入。这种行为可以避免系统打开和关闭大量 I/O 密集的日志文件,以至于系统无法打开和关闭。你或许还要记录到 **/var/log**。假设你使用的是 Linux,那么创建一个目录并将用户设为所有者,以便可以写入该目录: + + +``` +$ sudo mkdir /var/log/test +$ sudo chown pi /var/log/test +``` + +然后在你的 Python 代码中,更改 **logfile** 路径: + + +``` +`logfile(’/var/log/test/test.log’, maxBytes=1e6, backupCount=3)` +``` + +当要在 **logfile** 中捕获异常时,可以使用 **logging.exception**:。 + + +``` +try: +    c = a / b +except Exception as e: +    logger.exception(e) +``` + +这将输出(在 b 为零的情况下): + + +``` +[E 190422 23:41:59 test:9] division by zero +     Traceback (most recent call last): +       File "test.py", line 7, in +         c = a / b +     ZeroDivisionError: division by zero +``` + +你会得到日志,还有完整回溯。另外,你可以使用 **logging.error** 并隐藏回溯: + + +``` +try: +    c = a / b +except Exception as e: +    logger.error(f"{e.__class__.__name__}: {e}") +``` + +现在,将产生更简洁的结果: + + +``` +`[E 190423 00:04:16 test:9] ZeroDivisionError: division by zero` +``` + +* * * + +* * * + +* * * + +**![Logging output][4]** + +你可以在 [logzero.readthedocs.io] [5] 中阅读更多选项。 + +### logzero 为教育而生 + +对于新手程序员来说,日志记录可能是一个具有挑战性的概念。大多数框架依赖于流控制和大量变量操作来生成有意义的日志,但是 logzero不同。由于它的语法类似于 print 语句,因此它在教育上很成功,因为它无需解释其他概念。在你的下个项目中试试它。 + +\-- + +_此文章最初发布在[我的博客] [6]上,经许可重新发布。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/logzero-python + +作者:[Ben Nuttall][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/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Snake charmer cartoon with a yellow snake and a blue snake) +[2]: https://opensource.com/sites/default/files/uploads/rpi_ben_1.png (Python, Raspberry Pi: import logger) +[3]: https://opensource.com/article/19/6/understanding-linux-permissions +[4]: https://opensource.com/sites/default/files/uploads/rpi_ben_2.png (Logging output) +[5]: https://logzero.readthedocs.io/en/latest/ +[6]: https://tooling.bennuttall.com/logzero/ From cdbbfc8b788a0a5cc3c10c0ce2ee80429c6ba98b Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 4 Mar 2020 08:29:03 +0800 Subject: [PATCH 275/315] translating --- sources/tech/20200302 Install GNU Emacs on Windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200302 Install GNU Emacs on Windows.md b/sources/tech/20200302 Install GNU Emacs on Windows.md index be429efe50..7ba0e633bb 100644 --- a/sources/tech/20200302 Install GNU Emacs on Windows.md +++ b/sources/tech/20200302 Install GNU Emacs on Windows.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 37a895dd36c454f99aa53ccea3a23711b896acbc Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 4 Mar 2020 09:37:37 +0800 Subject: [PATCH 276/315] Rename sources/tech/20200303 Most-used libraries, open source adoption, and more industry trends.md to sources/talk/20200303 Most-used libraries, open source adoption, and more industry trends.md --- ...d libraries, open source adoption, and more industry trends.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200303 Most-used libraries, open source adoption, and more industry trends.md (100%) diff --git a/sources/tech/20200303 Most-used libraries, open source adoption, and more industry trends.md b/sources/talk/20200303 Most-used libraries, open source adoption, and more industry trends.md similarity index 100% rename from sources/tech/20200303 Most-used libraries, open source adoption, and more industry trends.md rename to sources/talk/20200303 Most-used libraries, open source adoption, and more industry trends.md From eacc073cf1bd6976e46e6faffe94c6aa3afdf846 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 4 Mar 2020 09:44:16 +0800 Subject: [PATCH 277/315] Rename sources/tech/20200303 How to assess your organization-s technological maturity.md to sources/talk/20200303 How to assess your organization-s technological maturity.md --- ...03 How to assess your organization-s technological maturity.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200303 How to assess your organization-s technological maturity.md (100%) diff --git a/sources/tech/20200303 How to assess your organization-s technological maturity.md b/sources/talk/20200303 How to assess your organization-s technological maturity.md similarity index 100% rename from sources/tech/20200303 How to assess your organization-s technological maturity.md rename to sources/talk/20200303 How to assess your organization-s technological maturity.md From e7c8cdc4e89fc540edc7e80068e76f397660d4c5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 4 Mar 2020 10:09:23 +0800 Subject: [PATCH 278/315] PRF @lujun9972 --- ... to get social and track your todo list.md | 64 +++++++++---------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/translated/tech/20200129 Use Emacs to get social and track your todo list.md b/translated/tech/20200129 Use Emacs to get social and track your todo list.md index fff71fcc19..88e21c0f94 100644 --- a/translated/tech/20200129 Use Emacs to get social and track your todo list.md +++ b/translated/tech/20200129 Use Emacs to get social and track your todo list.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Use Emacs to get social and track your todo list) @@ -9,19 +9,20 @@ 使用 Emacs 进行社交并跟踪你的待办事项列表 ====== -访问 Twitter、Reddit、 交谈、电子邮件 、RSS 和你的待办事项列表,这是我们关于 2020 年使用开源提高效率的 20 个方法系列的第 19 个。 -![团队沟通、交谈 ][1] -去年,我给你们带来了 2019 年的 19 天新生产力工具。今年,我将采取一种不同的方法:建立一个新的环境,让你使用已用或未用的工具在新的一年里更有效率,。 +> 在 2020 年用开源实现更高生产力的二十种方式的第十九篇文章中,访问 Twitter、Reddit、 交谈、电子邮件 、RSS 和你的待办事项列表。 + +![](https://img.linux.net.cn/data/attachment/album/202003/04/100911lg2vrv92692b422y.jpg) + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 ### 使用 Emacs 做(几乎)所有的事情,第 2 部分 -[昨天 ][2],我谈到了如何在 Emacs 中读取电子邮件、访问电子邮件地址和显示日历。Emacs 功能繁多,你还可以将它用于 Twitter、 交谈、待办事项列表等等! +[昨天][2],我谈到了如何在 Emacs 中读取电子邮件、访问电子邮件地址和显示日历。Emacs 功能繁多,你还可以将它用于 Twitter、交谈、待办事项列表等等! -[在 Emacs 中处理所有事情 ][3] - -要完成所有这些,您需要安装一些 Emacs 包。和昨天一样,用 `Meta+x package-manager` 打开 Emacs 包管理器 (Meta 在大多数键盘上是 **Alt**,在 MacOS 上是 **Option**)。然后通过 **i** 选择以下带有的软件包,然后输入 **x** 进行安装: +![在 Emacs 中处理所有事情][3] +要完成所有这些,你需要安装一些 Emacs 包。和昨天一样,用 `Meta+x package-manager` 打开 Emacs 包管理器(Meta 键在大多数键盘上是 `Alt`,在 MacOS 上是 `Option`)。然后通过 `i` 选择以下带有的软件包,然后输入 `x` 进行安装: ``` nnreddit @@ -31,7 +32,6 @@ twittering-mode 安装之后,按下 `Ctrl+x ctrl+f` 打开 `~/.emacs.d/init.el`,并在 `(custom-set-variables` 行前加上: - ``` ;; Todo.txt (require 'todotxt) @@ -54,11 +54,11 @@ twittering-mode [Twittering-mode][5] 是 Twitter 最好的 Emacs 接口之一。它几乎支持 Twitter 的所有功能,并且键盘快捷键也易于使用。 -首先,输入 `Meta+x twit` 来启动 twitter-mode。它会提供一个 URL 并提示你启动浏览器来访问它,你登录该 URL 后就能获得授权令牌。将令牌复制并粘贴到 Emacs 中,您的 Twitter 时间线就会加载了。您可以使用**箭头**键滚动,使用 **Tab** 从一个项目移动到另一个项目,并按 **Enter** 访问光标所在的 URL。如果光标在用户名上,按 **Enter** 将在 web 浏览器中打开时间轴。如果你在一条 tweet 的文本上,按 **Enter** 将回复该 tweet。你可以用 **u** 创建一个新的 tweet,用 `Ctrl+c+Enter` 转发一些内容,然后用 **d** 发送一条直接消息——它打开的对话框中有关于如何发送、取消和缩短 url 的说明。 +首先,输入 `Meta+x twit` 来启动 twittering-mode。它会提供一个 URL 并提示你启动浏览器来访问它,你登录该 URL 后就能获得授权令牌。将令牌复制并粘贴到 Emacs 中,你的 Twitter 时间线就会加载了。你可以使用箭头键滚动,使用 `Tab` 从一个项目移动到另一个项目,并按回车访问光标所在的 URL。如果光标在用户名上,按回车将在 web 浏览器中打开时间轴。如果你在一条推文的文本上,按回车将回复该推文。你可以用 `u` 创建一个新的推文,用 `Ctrl+c+Enter` 转发一些内容,然后用 `d` 发送一条即时消息——它打开的对话框中有关于如何发送、取消和缩短 URL 的说明。 -按 **V** 会打开一个提示让你跳转到其他时间线。输入 **:mentions** 打开你的提及。输入 **:home** 打开你的主时间线,输入用户名将进入该用户的时间线。最后,按 **q** 会退出 twittering-mode 并关闭窗口。 +按 `V` 会打开一个提示让你跳转到其他时间线。输入 `:mentions` 打开你的提及。输入 `:home` 打开你的主时间线,输入用户名将进入该用户的时间线。最后,按 `q` 会退出 twittering-mode 并关闭窗口。 -twitter-mode 还有更多功能,我鼓励你阅读它 GitHub 页面上的[完整功能列表 ][6]。 +twitter-mode 还有更多功能,我鼓励你阅读它 GitHub 页面上的[完整功能列表][6]。 #### 在 Emacs 上使用 Todotxt.el 追踪你的待办事项 @@ -66,27 +66,27 @@ twitter-mode 还有更多功能,我鼓励你阅读它 GitHub 页面上的[完 [Todotxt.el][8] 是一个很棒的 [todo.txt][9] 待办列表管理器接口。它的快捷键几乎无所不包。 -输入 `Meta+x todotxt` 启动它将加载 **todotxt-file** 变量中指定的 todo.txt 文件(本文的第一部分中设置了该文件)。 -在 todo.txt 的缓冲区(窗口*,您可以按 **a** 添加新任务并和按 **c** 标记它已被完成。你还可以使用 **r** 设置优先级,并使用 **t** 添加项目和上下文。 -完成事项后只需要按下 **A** 即可将任务移如 **done.txt**。你可以使用**/**过滤列表,也可以使用 **l** 刷新完整列表。同样,您可以按 **q** 退出。 +输入 `Meta+x todotxt` 启动它将加载 `todotxt-file` 变量中指定的 `todo.txt` 文件(本文的第一部分中设置了该文件)。在 `todo.txt` 的缓冲区(窗口),你可以按 `a` 添加新任务并和按 `c` 标记它已被完成。你还可以使用 `r` 设置优先级,并使用 `t` 添加项目和上下文。完成事项后只需要按下 `A` 即可将任务移如 `done.txt`。你可以使用 `/` 过滤列表,也可以使用 `l` 刷新完整列表。同样,你可以按 `q` 退出。 #### 在 Emacs 中使用 ERC 进行交谈 ![使用 ERC 与人交谈 ][10] -Vim 的缺点之一是很难用它与人交谈。另一方面,Emacs 则将 [ERC][11] 客户端内置到默认发行版中。使用 `Meta+x ERC` 启动 ERC,系统将提示您输入服务器、用户名和密码。你可以使用几天前介绍设置 [BitlBee][12] 时使用的相同信息:服务器为 **localhost**,端口为 **6667**,相同用户名,无需密码。 -ERC 使用起来与其他 IRC 客户端一样。每个频道单独一个缓冲区(窗口),您可以使用 `Ctrl+x ctrl+b` 进行频道间切换,这也可以在 Emacs 中的其他缓冲区之间进行切换。`/quit` 命令将退出 ERC。 +Vim 的缺点之一是很难用它与人交谈。另一方面,Emacs 则将 [ERC][11] 客户端内置到默认发行版中。使用 `Meta+x ERC` 启动 ERC,系统将提示你输入服务器、用户名和密码。你可以使用几天前介绍设置 [BitlBee][12] 时使用的相同信息:服务器为 `localhost`,端口为 `6667`,相同用户名,无需密码。 + +ERC 使用起来与其他 IRC 客户端一样。每个频道单独一个缓冲区(窗口),你可以使用 `Ctrl+x ctrl+b` 进行频道间切换,这也可以在 Emacs 中的其他缓冲区之间进行切换。`/quit` 命令将退出 ERC。 #### 使用 Gnus 阅读电子邮件,Reddit 和 RSS ![Mail,Reddit,and RSS feeds with Gnus][13] 我相信昨天在我提及在 Emacs 中阅读邮件时,许多 Emacs 的老用户会问,“怎么没有 [Gnus][14] 呢?” -这个疑问很合理。Gnus 是一个内置在 Emacs 中的邮件和新闻阅读器,尽管它这个邮件阅读器不支持以 [Notmuch][15] 作为搜索引擎。但是,如果你将其配置来阅读 Reddit 和 RSS feed( 稍后您将这样做),那么同时使用它来阅读邮件是个聪明的选择。 -Gnus 是为阅读 Usenet 新闻而创建的,并从此发展而来。因此,它的很多外观和感觉(以及术语)看起来很像 Usenet 的新闻阅读器。 +这个疑问很合理。Gnus 是一个内置在 Emacs 中的邮件和新闻阅读器,尽管它这个邮件阅读器不支持以 [Notmuch][15] 作为搜索引擎。但是,如果你将其配置来阅读 Reddit 和 RSS feed(稍后你将这样做),那么同时使用它来阅读邮件是个聪明的选择。 -Gnus 以 `~/.gnus` 作为自己的配置文件。(该配置也可以包含在 `~/.emacs.d/init.el` 中)。使用 `Ctrl+x Ctrl+f` 打开 `~/.gnus`,并添加以下内容: +Gnus 是为阅读 Usenet 新闻而创建的,并从此发展而来。因此,它的很多外观和感觉(以及术语)看起来很像 Usenet 的新闻阅读器。 + +Gnus 以 `~/.gnus` 作为自己的配置文件。(该配置也可以包含在 `~/.emacs.d/init.el` 中)。使用 `Ctrl+x Ctrl+f` 打开 `~/.gnus`,并添加以下内容: ``` @@ -104,19 +104,17 @@ Gnus 以 `~/.gnus` 作为自己的配置文件。(该配置也可以包含在 `~              '(nnreddit "")) ``` -用 `Ctrl+x Ctrl+s` 保存文件。这分配置告诉 Gnus 从 `~/Maildir` 这个本地邮箱中读取邮件作为主源(参见 **gnus-select-method** 变量),并使用 [nnreddit][16] 插件添加辅源 (**gnus-secondary-select-methods** 变量)。你还可以定义多个辅助源,包括 Usenet 新闻 (nntp)、IMAP (nnimap)、mbox (nnmbox) 和虚拟集合 (nnvirtual)。您可以在 [Gnus 手册 ][17] 中了解更多有关所有选项的信息。 +用 `Ctrl+x Ctrl+s` 保存文件。这分配置告诉 Gnus 从 `~/Maildir` 这个本地邮箱中读取邮件作为主源(参见 `gnus-select-method` 变量),并使用 [nnreddit][16] 插件添加辅源(`gnus-secondary-select-methods` 变量)。你还可以定义多个辅助源,包括 Usenet 新闻(nntp)、IMAP (nnimap)、mbox(nnmbox)和虚拟集合(nnvirtual)。你可以在 [Gnus 手册][17] 中了解更多有关所有选项的信息。 -保存文件后,使用 `Meta+x Gnus` 启动 Gnus。第一次运行将在 Python 虚拟环境中安装 [Reddit 终端查看器 ][18],Gnus 通过它获取 Reddit 上的文章。然后它会启动浏览器来登录 Reddit。之后,它会扫描并加载你订阅的 Reddit 群组。你会看到一个有新邮件的邮件夹列表和一个有新内容的看板列表。在任一列表上按 **Enter** 将加载该组中的消息列表。您可以使用**箭头**键导航并按 **Enter** 加载和读取消息。在查看消息列表时,按 **q** 将返回到前一个视图,从主窗口按 **q** 将退出 Gnus。在阅读 Reddit 群组时,**a** 会创建一条新消息;在邮件组中,**m** 创建一个新的电子邮件;并且在任何一个视图中按 **r** 回复邮件。 +保存文件后,使用 `Meta+x Gnus` 启动 Gnus。第一次运行将在 Python 虚拟环境中安装 [Reddit 终端查看器][18],Gnus 通过它获取 Reddit 上的文章。然后它会启动浏览器来登录 Reddit。之后,它会扫描并加载你订阅的 Reddit 群组。你会看到一个有新邮件的邮件夹列表和一个有新内容的看板列表。在任一列表上按回车将加载该组中的消息列表。你可以使用箭头键导航并按回车加载和读取消息。在查看消息列表时,按 `q` 将返回到前一个视图,从主窗口按 `q` 将退出 Gnus。在阅读 Reddit 群组时,`a` 会创建一条新消息;在邮件组中,`m` 创建一个新的电子邮件;并且在任何一个视图中按 `r` 回复邮件。 -您还可以向 Gnus 接口中添加 RSS feed,并像阅读邮件和新闻组一样阅读它们。要添加 RSS feed,输入 `G+R` 并填写 RSS feed 的 URL。会有提示让你输入 feed 的标题和描述,这些信息可以从 feed 中提取出来并填充进去。现在输入 **g** 来检查新消息(这将检查所有组中的新消息)。阅读 feed 就像阅读 Reddit 群组和邮件一样,它们使用相同的快捷键。 +你还可以向 Gnus 接口中添加 RSS 流,并像阅读邮件和新闻组一样阅读它们。要添加 RSS 流,输入 `G+R` 并填写 RSS 流的 URL。会有提示让你输入 RSS 的标题和描述,这些信息可以从流中提取出来并填充进去。现在输入 `g` 来检查新消息(这将检查所有组中的新消息)。阅读 RSS 流 就像阅读 Reddit 群组和邮件一样,它们使用相同的快捷键。 -Gnus 中有_很多_功能,还有大量的键组合。[Gnus 参考卡 ][19] 为每个视图列出了所有这些键组合(以非常小的字体显示在 5 页纸上)。 +Gnus 中有*很多*功能,还有大量的键组合。[Gnus 参考卡][19]为每个视图列出了所有这些键组合(以非常小的字体显示在 5 页纸上)。 #### 使用 nyan-mode 查看位置 -As a final note,you might notice [Nyan cat][20] at the bottom of some of my screenshots。This is [nyan-mode][21],which indicates where you are in a buffer,so it gets longer as you get closer to the bottom of a document or buffer。You can install it with the package manager and set it up with the following code in **~/.emacs.d/init.el**: -最后,你可能会一些截屏底部注意到 [Nyan cat][20]。这是 [nyan-mode][21],它指示了你在缓冲区中的位置,因此当您接近文档或缓冲区的底部时,它会变长。您可以使用包管理器安装它,并在 `~/.emacs.d/init.el` 中使用以下代码进行设置: - +最后,你可能会一些截屏底部注意到 [Nyan cat][20]。这是 [nyan-mode][21],它指示了你在缓冲区中的位置,因此当你接近文档或缓冲区的底部时,它会变长。你可以使用包管理器安装它,并在 `~/.emacs.d/init.el` 中使用以下代码进行设置: ``` ;; Nyan Cat @@ -125,9 +123,9 @@ As a final note,you might notice [Nyan cat][20] at the bottom of some of my sc (nyan-mode) ``` -### Emacs 的皮毛 +### Emacs 的基本功能 -这只是 Emacs 所有功能的皮毛。Emacs_ 非常_强大,是我用来提高工作效率的必要工具之一,无论我是在追踪待办事项、阅读和回复邮件、编辑文本,还是与朋友和同事交流我都用它。这需要一点时间来适应,但是一旦你习惯了,它就会成为你桌面上最有用的工具之一。 +这只是 Emacs 所有功能的皮毛。Emacs *非常*强大,是我用来提高工作效率的必要工具之一,无论我是在追踪待办事项、阅读和回复邮件、编辑文本,还是与朋友和同事交流我都用它。这需要一点时间来适应,但是一旦你习惯了,它就会成为你桌面上最有用的工具之一。 -------------------------------------------------------------------------------- @@ -136,14 +134,14 @@ via: https://opensource.com/article/20/1/emacs-social-track-todo-list 作者:[Kevin Sonney][a] 选题:[lujun9972][b] 译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/ksonney [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) -[2]: https://opensource.com/article/20/1/emacs-mail-calendar +[2]: https://linux.cn/article-11932-1.html [3]: https://opensource.com/sites/default/files/uploads/productivity_19-1.png (All the things with Emacs) [4]: https://opensource.com/sites/default/files/uploads/productivity_19-2.png (Twitter in Emacs) [5]: https://github.com/hayamiz/twittering-mode @@ -153,10 +151,10 @@ via: https://opensource.com/article/20/1/emacs-social-track-todo-list [9]: http://todotxt.org/ [10]: https://opensource.com/sites/default/files/uploads/productivity_19-4.png (Chatting with erc) [11]: https://www.gnu.org/software/emacs/manual/html_mono/erc.html -[12]: https://opensource.com/article/20/1/open-source-chat-tool +[12]: https://linux.cn/article-11856-1.html [13]: https://opensource.com/sites/default/files/uploads/productivity_19-5.png (Mail, Reddit, and RSS feeds with Gnus) [14]: https://www.gnus.org/ -[15]: https://opensource.com/article/20/1/organize-email-notmuch +[15]: https://linux.cn/article-11807-1.html [16]: https://github.com/dickmao/nnreddit [17]: https://www.gnus.org/manual/gnus.html [18]: https://pypi.org/project/rtv/ From 777a63e16c44aa36eec1906520a883323a786c5e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 4 Mar 2020 10:11:26 +0800 Subject: [PATCH 279/315] PUB @lujun9972 https://linux.cn/article-11956-1.html --- ...200129 Use Emacs to get social and track your todo list.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200129 Use Emacs to get social and track your todo list.md (99%) diff --git a/translated/tech/20200129 Use Emacs to get social and track your todo list.md b/published/20200129 Use Emacs to get social and track your todo list.md similarity index 99% rename from translated/tech/20200129 Use Emacs to get social and track your todo list.md rename to published/20200129 Use Emacs to get social and track your todo list.md index 88e21c0f94..0d7bbc42c5 100644 --- a/translated/tech/20200129 Use Emacs to get social and track your todo list.md +++ b/published/20200129 Use Emacs to get social and track your todo list.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11956-1.html) [#]: subject: (Use Emacs to get social and track your todo list) [#]: via: (https://opensource.com/article/20/1/emacs-social-track-todo-list) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From b51fc20c83fb670333651c6c8ed64f1fe4ad04cb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 4 Mar 2020 11:22:43 +0800 Subject: [PATCH 280/315] PRF @HankChow --- ...to know about domain-specific languages.md | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/translated/tech/20200224 What developers need to know about domain-specific languages.md b/translated/tech/20200224 What developers need to know about domain-specific languages.md index 299ed726fc..f0578a307f 100644 --- a/translated/tech/20200224 What developers need to know about domain-specific languages.md +++ b/translated/tech/20200224 What developers need to know about domain-specific languages.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (What developers need to know about domain-specific languages) @@ -8,29 +8,29 @@ [#]: author: (Girish Managoli https://opensource.com/users/gammay) -开发者需要了解的领域特定语言 +开发者需要了解的领域特定语言(DSL) ====== + > 领域特定语言是在特定领域下用于特定上下文的语言。作为开发者,很有必要了解领域特定语言的含义,以及为什么要使用特定领域语言。 -![Various programming languages in use][1] +![](https://img.linux.net.cn/data/attachment/album/202003/04/112240b0os2988kolritlo.jpg) -领域特定语言domain-specific language(DSL)是在特定领域下用于特定上下文的语言。这里的领域是指某种商业上的(例如银行业、保险业等)上下文,也可以指某种应用程序的(例如 Web 应用、数据库等)上下文。与之相比的另一个概念是通用语言general-purpose language(GPL),通用语言则可以广泛应用于各种商业或应用问题当中。 +领域特定语言domain-specific language(DSL)是一种旨在特定领域下的上下文的语言。这里的领域是指某种商业上的(例如银行业、保险业等)上下文,也可以指某种应用程序的(例如 Web 应用、数据库等)上下文。与之相比的另一个概念是通用语言general-purpose language(GPL,LCTT 译注:注意不要和 GPL 许可证混淆),通用语言则可以广泛应用于各种商业或应用问题当中。 DSL 并不具备很强的普适性,它是仅为某个适用的领域而设计的,但它也足以用于表示这个领域中的问题以及构建对应的解决方案。HTML 是 DSL 的一个典型,它是在 Web 应用上使用的语言,尽管 HTML 无法进行数字运算,但也不影响它在这方面的广泛应用。 -而 GPL 则没有特定针对的领域,GPL 的设计者不可能知道这种语言会在什么领域被使用,更不清楚用户打算解决的问题是什么,因此 GPL 会被设计成可用于解决任何一种问题、适合任何一种业务、满足任何一种需求。例如 Java 就属于 GPL,它可以在 PC 或移动设备上运行,嵌入到银行、金融、保险、制造业等各种行业的应用中去。 +而 GPL 则没有特定针对的领域,这种语言的设计者不可能知道这种语言会在什么领域被使用,更不清楚用户打算解决的问题是什么,因此 GPL 会被设计成可用于解决任何一种问题、适合任何一种业务、满足任何一种需求。例如 Java 就属于 GPL,它可以在 PC 或移动设备上运行,嵌入到银行、金融、保险、制造业等各种行业的应用中去。 ### DSL 的类别 从使用方式的角度,语言可以划分出以下两类: - * DSL:使用 DSL 形式编写或表示的语言 - * 宿主语言host language:用于执行或处理 DSL 的语言 +* DSL:使用 DSL 形式编写或表示的语言 +* 宿主语言host language:用于执行或处理 DSL 的语言 -当 DSL 以独有的形式表达,并由另一种宿主语言来处理时,这种 DSL 称为外部external DSL。 - -以下就是可以在宿主语言中处理的 SQL: +由不同的语言编写并由另一种宿主语言处理的 DSL 被称为外部external DSL。 +以下就是可以在宿主语言中处理的 SQL 形式的 DSL: ``` SELECT account @@ -40,22 +40,27 @@ WHERE account = '123' AND branch = 'abc' AND amount >= 1000 因此,只要在规定了词汇和语法的情况下,DSL 也可以直接使用英语来编写,并使用诸如 ANTLR 这样的解析器生成器parser generator以另一种宿主语言来处理 DSL: - ``` -`if smokes then increase premium by 10%` +if smokes then increase premium by 10% ``` -如果 DSL 和宿主语言是同一种语言,这种 DSL 称为内部internal DSL,其中 DSL 由以同一种语义的宿主语言编写和处理,因此又称为嵌入式embedded DSL。以下是两个例子: +如果 DSL 和宿主语言是同一种语言,这种 DSL 称为内部internalDSL,其中 DSL 由以同一种语义的宿主语言编写和处理,因此又称为嵌入式embedded DSL。以下是两个例子: - * Bash 形式的 DSL 可以由 Bash 解释器执行:`if today_is_christmas; then apply_christmas_discount; fi` 同时这也是一段看起来符合英语语法的 Bash。 - * 使用类似 Java 语法编写的 DSL: +* Bash 形式的 DSL 可以由 Bash 解释器执行: + + ``` +if today_is_christmas; then apply_christmas_discount; fi ``` + 同时这也是一段看起来符合英语语法的 Bash。 +* 使用类似 Java 语法编写的 DSL: + + ``` orderValue = orderValue .applyFestivalDiscount() .applyCustomerLoyalityDiscount() .applyCustomerAgeDiscount(); ``` -这一段的可读性也相当强。 + 这一段的可读性也相当强。 实际上,DSL 和 GPL 之间并没有非常明确的界限。 @@ -63,18 +68,16 @@ orderValue = orderValue 以下这些语言都可以作为 DSL 使用: - * Web 应用:HTML - * Shell:用于类 Unix 系统的 sh、Bash、CSH 等;用于 Windows 系统的 MS-DOS、Windows Terminal、PowerShell 等 - * 标记语言:XML - * 建模:UML - * 数据处理:SQL 及其变体 - * 业务规则管理:Drools - * 硬件:Verilog、VHD - * 构建工具:Maven、Gradle - * 数值计算和模拟:MATLAB(商业)、GNU Octave、Scilab - * 解析器和生成器:Lex、YACC、GNU Bison、ANTLR - - +* Web 应用:HTML +* Shell:用于类 Unix 系统的 sh、Bash、CSH 等;用于 Windows 系统的 MS-DOS、Windows Terminal、PowerShell 等 +* 标记语言:XML +* 建模:UML +* 数据处理:SQL 及其变体 +* 业务规则管理:Drools +* 硬件:Verilog、VHD +* 构建工具:Maven、Gradle +* 数值计算和模拟:MATLAB(商业)、GNU Octave、Scilab +* 解析器和生成器:Lex、YACC、GNU Bison、ANTLR ### 为什么要使用 DSL? @@ -92,25 +95,22 @@ DSL 的优点是,它对于领域的特征捕捉得非常好,同时它不像 开源的 DSL 软件包括: - * Xtext:Xtext 可以与 Eclipse 集成,并支持 DSL 开发。它能够实现代码生成,因此一些开源和商业产品都用它来提供特定的功能。用于农业活动建模分析的多用途农业数据系统Multipurpose Agricultural Data System(MADS)就是基于 Xtext 实现的一个项目,可惜的是这个项目现在已经不太活跃了。 - * JetBrains MPS:JetBrains MPS 是一个可供开发 DSL 的集成开发环境Integrated Development Environment,它将文档在底层存储为一个抽象树结构(Microsoft Word 也使用了这一概念),因此它也自称为一个投影编辑器projectional editor。JetBrains MPS 支持 Java、C、JavaScript 和 XML 的代码生成。 +* Xtext:Xtext 可以与 Eclipse 集成,并支持 DSL 开发。它能够实现代码生成,因此一些开源和商业产品都用它来提供特定的功能。用于农业活动建模分析的多用途农业数据系统Multipurpose Agricultural Data System(MADS)就是基于 Xtext 实现的一个项目,可惜的是这个项目现在已经不太活跃了。 +* JetBrains MPS:JetBrains MPS 是一个可供开发 DSL 的集成开发环境Integrated Development Environment,它将文档在底层存储为一个抽象树结构(Microsoft Word 也使用了这一概念),因此它也自称为一个投影编辑器projectional editor。JetBrains MPS 支持 Java、C、JavaScript 和 XML 的代码生成。 ### DSL 的最佳实践 如果你想使用 DSL,记住以下几点: - * DSL 不同于 GPL,DSL 只能用于解决特定领域中有限范围内的问题。 - * 不必动辄建立自己的 DSL,可以首先尝试寻找已有的 DSL。例如 [DSLFIN][4] 这个网站就提供了很多金融方面的 DSL。在实在找不到合适的 DSL 的情况下,才需要建立自己的 DSL。 - * DSL 最好像平常的语言一样具有可读性。 - * 尽管代码生成不是一项必需的工作,但它确实会大大提高工作效率。 - * 虽然 DSL 被称为语言,但 DSL 不需要像 GPL 一样可以被执行,可执行性并不是 DSL 需要达到的目的。 - * DSL 可以使用文本编辑器编写,但专门的 DSL 编辑器可以更轻松地完成 DSL 的语法和语义检查。 - - +* DSL 不同于 GPL,DSL 只能用于解决特定领域中有限范围内的问题。 +* 不必动辄建立自己的 DSL,可以首先尝试寻找已有的 DSL。例如 [DSLFIN][4] 这个网站就提供了很多金融方面的 DSL。在实在找不到合适的 DSL 的情况下,才需要建立自己的 DSL。 +* DSL 最好像平常的语言一样具有可读性。 +* 尽管代码生成不是一项必需的工作,但它确实会大大提高工作效率。 +* 虽然 DSL 被称为语言,但 DSL 不需要像 GPL 一样可以被执行,可执行性并不是 DSL 需要达到的目的。 +* DSL 可以使用文本编辑器编写,但专门的 DSL 编辑器可以更轻松地完成 DSL 的语法和语义检查。 如果你正在使用或将要使用 DSL,欢迎在评论区留言。 - -------------------------------------------------------------------------------- via: https://opensource.com/article/20/2/domain-specific-languages @@ -118,7 +118,7 @@ via: https://opensource.com/article/20/2/domain-specific-languages 作者:[Girish Managoli][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7a14c7909813c0b5936ed89f9b0c7d88c8055bae Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 4 Mar 2020 11:23:43 +0800 Subject: [PATCH 281/315] PUB @HankChow https://linux.cn/article-11957-1.html --- ...developers need to know about domain-specific languages.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200224 What developers need to know about domain-specific languages.md (99%) diff --git a/translated/tech/20200224 What developers need to know about domain-specific languages.md b/published/20200224 What developers need to know about domain-specific languages.md similarity index 99% rename from translated/tech/20200224 What developers need to know about domain-specific languages.md rename to published/20200224 What developers need to know about domain-specific languages.md index f0578a307f..c0e01b7923 100644 --- a/translated/tech/20200224 What developers need to know about domain-specific languages.md +++ b/published/20200224 What developers need to know about domain-specific languages.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11957-1.html) [#]: subject: (What developers need to know about domain-specific languages) [#]: via: (https://opensource.com/article/20/2/domain-specific-languages) [#]: author: (Girish Managoli https://opensource.com/users/gammay) From c8eadb41681baeea182c8a3da5fc1d6b0437442f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 4 Mar 2020 12:16:14 +0800 Subject: [PATCH 282/315] PRF @wxy --- ...d the life of your SSD drive with fstrim.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translated/tech/20200212 Extend the life of your SSD drive with fstrim.md b/translated/tech/20200212 Extend the life of your SSD drive with fstrim.md index 24ed876272..439c9524a7 100644 --- a/translated/tech/20200212 Extend the life of your SSD drive with fstrim.md +++ b/translated/tech/20200212 Extend the life of your SSD drive with fstrim.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Extend the life of your SSD drive with fstrim) @@ -12,9 +12,9 @@ > 这个新的系统服务可以使你的生活更轻松。 -![Linux keys on the keyboard for a desktop computer][1] +![](https://img.linux.net.cn/data/attachment/album/202003/04/121625sl380ga10g56d33h.jpg) -在过去的十年中,固态驱动器(SSD)带来了一种管理存储的新方法。与上一代的转盘产品相比,SSD 具有无声、更冷却的操作和更快的接口规格等优点。当然,新技术带来了新的维护和管理方法。SSD 具有称为 TRIM 的功能。从本质上讲,这是一种用于回收设备上未使用的块的方法,该块可能先前已被写入,但不再包含有效数据,因此可以返回到通用存储池以供重用。Opensource.com 的 Don Watkins 在首先其 2017 年的文章《[Linux 固态驱动器:为 SSD 启用 TRIM][2]》中介绍了 TRIM 的内容。 +在过去的十年中,固态驱动器(SSD)带来了一种管理存储的新方法。与上一代的转盘产品相比,SSD 具有无声、更冷却的操作和更快的接口规格等优点。当然,新技术带来了新的维护和管理方法。SSD 具有一种称为 TRIM 的功能。从本质上讲,这是一种用于回收设备上未使用的块的方法,该块可能先前已被写入,但不再包含有效数据,因此可以返回到通用存储池以供重用。Opensource.com 的 Don Watkins 首先在其 2017 年的文章《[Linux 固态驱动器:为 SSD 启用 TRIM][2]》中介绍过 TRIM 的内容。 如果你一直在 Linux 系统上使用此功能,则你可能熟悉下面描述的两种方法。 @@ -29,7 +29,7 @@ UUID=3453g54-6628-2346-8123435f  /home  xfs  defaults,discard   0 0 ``` -丢弃选项可启用自动的在线 TRIM。由于可能会对性能造成负面影响,最近关于这是否是最佳方法一直存在争议。使用此选项会在每次将新数据写入驱动器时启动 TRIM。这可能会引入其他活动,从而影响存储性能。 +丢弃选项可启用自动的在线 TRIM。由于可能会对性能造成负面影响,最近关于这是否是最佳方法一直存在争议。使用此选项会在每次将新数据写入驱动器时启动 TRIM。这可能会引入其他磁盘活动,从而影响存储性能。 #### Cron 作业 @@ -44,7 +44,7 @@ UUID=3453g54-6628-2346-8123435f  /home  xfs  defaults,discard   0 0 ### 一个新的 TRIM 服务 -我最近发现有一个用于 TRIM 的 systemd 服务。Fedora 在版本 30 中将其[引入][3],尽管默认情况下在版本 30 和 31 中未启用它,但计划在版本 32 中使用它。如果你使用的是 Fedora 工作站 31,并且你想要开始使用此功能,可以非常轻松地启用它。我还将在下面向你展示如何对其进行测试。该服务并非 Fedora 独有的服务。它是否存在和地位将因发行版而异。 +我最近发现有一个用于 TRIM 的 systemd 服务。Fedora 在版本 30 中将其[引入][3],尽管默认情况下在版本 30 和 31 中未启用它,但计划在版本 32 中使用它。如果你使用的是 Fedora 工作站 31,并且你想要开始使用此功能,可以非常轻松地启用它。我还将在下面向你展示如何对其进行测试。该服务并非 Fedora 独有的服务。它是否存在及其地位将因发行版而异。 #### 测试 @@ -78,7 +78,7 @@ Options: -V, --version display version ``` -因此,现在我可以看到这个 systemd 服务已配置为在我的 `/etc/fstab` 文件中的所有受支持的挂载文件系统上运行该修剪操作( `-fstab`),并打印出丢弃的字节数(`-verbose`),但是抑制了任何可能会发生的错误消息(`–quiet`)。了解这些选项对测试很有帮助。例如,我可以从最安全的方法开始,即空运行。 我还将去掉 `-quiet` 参数,以便确定驱动器设置是否发生任何错误。 +因此,现在我可以看到这个 systemd 服务已配置为在我的 `/etc/fstab` 文件中的所有受支持的挂载文件系统上运行该修剪操作(`-fstab`),并打印出所丢弃的字节数(`-verbose`),但是抑制了任何可能会发生的错误消息(`–quiet`)。了解这些选项对测试很有帮助。例如,我可以从最安全的方法开始,即空运行。我还将去掉 `-quiet` 参数,以便确定驱动器设置是否发生任何错误。 ``` $ sudo /usr/sbin/fstrim --fstab --verbose --dry-run @@ -101,7 +101,7 @@ $ sudo /usr/sbin/fstrim --fstab --verbose #### 启用 -Fedora Linux 实现了一个计划每周运行它的 systemd 计时器服务。要检查其是否存在和当前状态,请运行 `systemctl status`。 +Fedora Linux 实现了一个计划每周运行它的 systemd 计时器服务。要检查其是否存在及当前状态,请运行 `systemctl status`。 ``` $ sudo systemctl status fstrim.timer @@ -121,7 +121,7 @@ $ sudo systemctl enable fstrim.timer $ sudo systemctl list-timers --all ``` -会显示出下列表明 `fstrim.timer` 存在的行。注意,该计时器实际上激活了 `fstrim.service`。这是 `fstrim` 实际调用的地方。与时间相关的字段显示为 `n/a`,因为该服务已启用且尚未运行。 +会显示出下列行,表明 `fstrim.timer` 存在。注意,该计时器实际上激活了 `fstrim.service` 服务。这是实际调用 `fstrim` 的地方。与时间相关的字段显示为 `n/a`,因为该服务已启用且尚未运行。 ``` NEXT   LEFT    LAST   PASSED   UNIT           ACTIVATES @@ -141,7 +141,7 @@ via: https://opensource.com/article/20/2/trim-solid-state-storage-linux 作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9f238d0eeee284460edc7e5ba069949b0b1dde2f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 4 Mar 2020 12:17:35 +0800 Subject: [PATCH 283/315] PUB @wxy https://linux.cn/article-11959-1.html --- .../20200212 Extend the life of your SSD drive with fstrim.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200212 Extend the life of your SSD drive with fstrim.md (98%) diff --git a/translated/tech/20200212 Extend the life of your SSD drive with fstrim.md b/published/20200212 Extend the life of your SSD drive with fstrim.md similarity index 98% rename from translated/tech/20200212 Extend the life of your SSD drive with fstrim.md rename to published/20200212 Extend the life of your SSD drive with fstrim.md index 439c9524a7..dfb2969cf9 100644 --- a/translated/tech/20200212 Extend the life of your SSD drive with fstrim.md +++ b/published/20200212 Extend the life of your SSD drive with fstrim.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11959-1.html) [#]: subject: (Extend the life of your SSD drive with fstrim) [#]: via: (https://opensource.com/article/20/2/trim-solid-state-storage-linux) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) From 5ea37b69d253a13e65cf2217aa52fa5cf00db6de Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Wed, 4 Mar 2020 15:32:42 +0800 Subject: [PATCH 284/315] Transtlated --- ...t you-re looking for on Linux with find.md | 240 ----------------- ...t you-re looking for on Linux with find.md | 241 ++++++++++++++++++ 2 files changed, 241 insertions(+), 240 deletions(-) delete mode 100644 sources/tech/20200219 How to find what you-re looking for on Linux with find.md create mode 100644 translated/tech/20200219 How to find what you-re looking for on Linux with find.md diff --git a/sources/tech/20200219 How to find what you-re looking for on Linux with find.md b/sources/tech/20200219 How to find what you-re looking for on Linux with find.md deleted file mode 100644 index 9bcb73d4e5..0000000000 --- a/sources/tech/20200219 How to find what you-re looking for on Linux with find.md +++ /dev/null @@ -1,240 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (heguangzhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to find what you’re looking for on Linux with find) -[#]: via: (https://www.networkworld.com/article/3527420/how-to-find-what-you-re-looking-for-on-linux-with-find.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -How to find what you’re looking for on Linux with find -====== -The find command has a huge array of options to help you locate exactly the files you're looking for on a Linux system. This post explores a series of extremely useful commands. -CSA Images / Getty Images - -There are a number of commands for finding files on Linux systems, but there are also a huge number of options that you can deploy when looking for them. - -For example, you can find files not just by their names, but by their owners and/or groups, their age, their size, the assigned permissions, the last time they were accessed, the associated inodes and even whether the files belong to an account or group that no longer exists on the system and so on. - -[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] - -You can also specify where a search should start, how deeply into the file system the search should reach and how much the search result will tell you about the files it finds. - -And all these criteria can be handled by the **find** command. - -Examples of finding files by these criteria are provided below. In some commands, errors (such as trying to list files that you don’t have read access to), error output will be sent to **/dev/null** so that we don’t have to look at it. In others, we’ll simply run as root to avoid this problem. - -Keep in mind that additional options exist. This post covers a lot of ground, but not all of the ways that the **find** command can help locate files for you. - -### Picking a starting point - -With **find**, you can either select a point or start where you are. To select a starting spot, enter it following the word “find”. For example, “find /usr” or “find ./bin” would search starting the **/usr** directory or the **bin** directory in the current location while “find ~” would start in your home directory even if you’re currently located in some other location in the file system. - -[][2] - -### Picking what you want to see - -One of the most commonly used search strategies is to search for files by name. This requires using the **-name** option. - -By default, **find** will show you the full path to the files it finds. This is the same thing you would see if you add **-print** to your command. If you want to see the details associated with a file – its length, permissions, etc., you would need to add **-ls** to the end of your **find** command. - -``` -$ find ~/bin -name tryme -/home/shs/bin/tryme -$ find ~/bin -name tryme -print -/home/shs/bin/tryme -$ find ~/bin -name tryme -ls - 917528 4 -rwx------ 1 shs shs 139 Apr 8 2019 /home/shs/bin/tryme -``` - -You can also find files using substrings. For example, if you replace "tryme" in the example above with "try*", you'll find all the files with names that begin with "try". - -Finding files by name is probably the most typical use of the **find** command, but there are so many other ways to look for files and good reasons to want to. The sections below show how to use many of the other criteria available. - -In addition, when searching for files by size, group, inode etc., you probably will want some confirmation that the files found match what you were looking for. Using the **-ls** option to display the details is often very helpful. - -### Finding files by size - -Finding files by size requires use of the **-size** option and a little finesse with the specifications. If you specify **-size 189b**, for you example, you’re going to find files that are 189 blocks long, not 189 bytes. For bytes, you would need to use **-size 189c** (characters). And, if you specify **-size 200w**, you’re going to find files that are 200 words – words as in "two-byte increments", not words as in "those things we all say to each other". You can also look for file by providing sizes in kilobytes (k), megabytes (M) and gigabytes (G). - -Most of the time, Linux users will be searching for files that are larger than some selected size. For example, to find files that are larger than a gigabyte, you might use a command like this where the +1G means "larger than a gigabyte": - -``` -$ find -size +1G -ls 2>/dev/null - 787715 1053976 -rw-rw-r-- 1 shs shs 1079263432 Dec 21 2018 ./backup.zip - 801834 1052556 -rw-rw-r-- 1 shs shs 1077809525 Dec 21 2018 ./2019/hold.zip -``` - -### Finding files by inode # - -You can find files by the inode that is used to maintain the file’s metadata (i.e., everything but the file content and file name). - -``` -$ find -inum 919674 -ls 2>/dev/null - 919674 4 -rw-rw-r-- 1 shs shs 512 Dec 27 15:25 ./bin/my.log -``` - -### Finding files with a specific file owner or group - -Finding files by owner or group is also very straightforward. Here we use sudo to overcome permission issues. - -``` -$ sudo find /home -user nemo -name "*.png"-ls - 1705219 4 drwxr-xr-x 2 nemo nemo 4096 Jan 28 08:50 /home/nemo/Pictures/me.png -``` - -In this command, we look for a file that is owned by a multi-user group called “admins”. - -``` -# find /tmp -group admins -ls - 262199 4 -rwxr-x--- 1 dory admins 27 Feb 16 18:57 /tmp/testscript -``` - -### Finding files with no owners or groups - -You can look for files that don't belong to any users currently set up on the system by using the **-nouser** option as shown in the command below. - -``` -# find /tmp -nouser -ls -262204 4 -rwx------ 1 1016 1016 17 Feb 17 16:42 /tmp/hello -``` - -Notice that the listing shows the old user's UID and GID – a clear indication that this user is not defined on the system. This kind of command will find files that were likely created in other-than-home directories by users whose accounts have since been removed from the system or in home directories that were not removed after the user account was removed. Similarly, the **-nogroup** option would find such files – especially when these users were the only members of the associated groups. - -### Finding files by last update time - -In this command, we look for files that have been updated in the last 24 hours in a particular user's home directory. The **sudo** is being used to allow searching another user’s home directory. - -``` -$ sudo find /home/nemo -mtime -1 -/home/nemo -/home/nemo/snap/cheat -/home/nemo/tryme -``` - -### Finding files by when permissions were last changed - -The **-ctime** option can help you find files that have had their status (e.g., permissions) changed within some referenced time frame. Here’s an example of looking for files that had permission changes within the last day: - -``` -$ find . -ctime -1 -ls - 787987 4 -rwxr-xr-x 1 shs shs 189 Feb 11 07:31 ./tryme -``` - -Keep in mind that the date and time displayed reflect the last updates to the file contents. You will have to use a command like **stat** to see all three times associated with a file (file creation, modification and status changes) . - -### Finding files based on last access times - -In this command, we look for local pdf files that were accessed within the last two days using the **-atime** option. - -``` -$ find -name "*.pdf" -atime -2 -./Wingding_Invites.pdf -``` - -### Finding files based on their age relative to another file - -You can use the -newer option to find files that are newer than some other file. - -``` -$ find . -newer dig1 -ls - 786434 68 drwxr-xr-x 67 shs shs 69632 Feb 16 19:05 . - 1064442 4 drwxr-xr-x 5 shs shs 4096 Feb 16 11:06 ./snap/cheat - 791846 4 -rw-rw-r-- 1 shs shs 649 Feb 13 14:26 ./dig -``` - -There is no corresponding **-older** option, but you can get a similar result with **! -newer** (i.e., not newer), which means almost the same thing. - -### Finding files by type - -Finding a file by file type, you get a lot of choices – regular files, directories, block and character files, etc. Here’s a list of the file type options: - -``` -b block (buffered) special -c character (unbuffered) special -d directory -p named pipe (FIFO) -f regular file -l symbolic link -s socket -``` - -Here’s an example looking for symbolic links: - -``` -$ find . -type l -ls - 805717 0 lrwxrwxrwx 1 shs shs 11 Apr 10 2019 ./volcano -> volcano.pdf - 918552 0 lrwxrwxrwx 1 shs shs 1 Jun 16 2018 ./letter -> pers/letter2mom -``` - -### Limiting how deeply find should look - -The **-mindepth** and **-maxdepth** options control how deeply into the file system (from the current location or starting point) your searches will look. - -``` -$ find -maxdepth 3 -name "*loop" -./bin/save/oldloop -./bin/long-loop -./private/loop -``` - -### Finding files only if empty - -In this command, we look for empty files, but no further than directories and their subdirectories. - -``` -$ find . -maxdepth 2 -empty -type f -ls - 917517 0 -rw-rw-r-- 1 shs shs 0 Sep 23 11:00 ./complaints/newfile - 792050 0 -rw-rw-r-- 1 shs shs 0 Oct 4 19:02 ./junk -``` - -### Finding files by permissions - -You can find files that have specific permissions set using the **-perm** option. In the example below, we are looking only for regular files (**-type f**) to avoid seeing symbolic links that are given these permissions by default even if the file they refer to is restricted. - -``` -$ find -perm 777 -type f -ls -find: ‘./.dbus’: Permission denied - 798748 4 -rwxrwxrwx 1 shs shs 15 Mar 28 2019 ./runme -``` - -### Using find to help you get rid of files - -You can use the find command to both locate and then remove files if you use a command like this one: - -``` -$ find . -name runme -exec rm {} \; -``` - -The {} represents the name of each of the files located by the search criteria. - -One very useful option is to replace **-exec** with **-ok**. When you do this, **find** will ask for a confirmation before it removes any file. - -``` -$ find . -name runme -ok rm -rf {} \; -< rm ... ./bin/runme > ? -``` - -Removing a file isn't the only thing that **-ok** and **-rm** can do for you. For example, you could copy, rename or move files. - -There are really a lot of options for using the find command effectively and undoubtedly some that haven’t been covered in this post. I hope you’ve found some that are new and especially promising. - -Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3527420/how-to-find-what-you-re-looking-for-on-linux-with-find.html - -作者:[Sandra Henry-Stocker][a] -选题:[lujun9972][b] -译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ -[b]: https://github.com/lujun9972 -[1]: https://www.networkworld.com/newsletters/signup.html -[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) -[3]: https://www.facebook.com/NetworkWorld/ -[4]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20200219 How to find what you-re looking for on Linux with find.md b/translated/tech/20200219 How to find what you-re looking for on Linux with find.md new file mode 100644 index 0000000000..f54e9a3924 --- /dev/null +++ b/translated/tech/20200219 How to find what you-re looking for on Linux with find.md @@ -0,0 +1,241 @@ +[#]: collector: (lujun9972) +[#]: translator: (heguangzhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to find what you’re looking for on Linux with find) +[#]: via: (https://www.networkworld.com/article/3527420/how-to-find-what-you-re-looking-for-on-linux-with-find.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如何在 Linux上通过 find 命令找到你要找的东西 +====== +find 命令有大量选项可以帮助你准确定位你在 Linux 系统上需要寻找的文件。这篇文章讨论了一系列非常有用的选项。 + +CSA 图片/ Getty 图片 + +在 Linux 系统上有许多用于查找文件的命令,但是在查找文件时也有大量的选项可以选择。 + +例如,你不仅可以通过文件的名称来查找文件,还可以通过文件的所有者或者组、它们的创建时间、大小、分配的权限、最后一次访问它们的时间、关联的信息节点,甚至是文件是否属于系统上不再存在的帐户或组等等来查找文件。 + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] +你还可以指定搜索从哪里开始,搜索应该深入到文件系统的什么位置,以及搜索结果将告诉你它所找到的文件的数量。 + +而所有这些要求都可以通过 **find** 命令来处理。 + +下面提供了根据这些标准查找文件的示例。在某些命令中,错误(例如试图列出你没有读取权限的文件),错误输出将被发送到 **/dev/null**,以便我们不必查看它。在其他情况下,我们将简单地以 root 身份运行以避免这个问题。 + +请记住,还其他选项存在。这篇文章涵盖了很多内容,但并不是 **find** 命令帮助你定位查找文件的所有方式。 + +### 选择起点 + +使用 **find**,您可以选择一个起点或从你所在的位置开始。请在单词“find”后输入要选择起点。例如,“find /usr” 或 “find ./bin "将在 **/usr** 目录或 **bin** 目录开始搜索,而" find ~ " 将在你的主目录中开始,即使你位于当前文件系统中的其他位置。 + +[][2] + +### 选择你想看的 + +最常用的搜索策略之一是按名称搜索文件。这需要使用 **-name** 选项。 + +默认情况下,**查找** 会显示找到的文件的完整路径。如果你在命令中添加 **-print**,你会看到同样的情况。如果你想查看与文件相关的详细信息—-例如:文件的长度、权限等,您需要在你的 **查找** 命令的末尾添加 **-ls** 命令。 + +``` +$ find ~/bin -name tryme +/home/shs/bin/tryme +$ find ~/bin -name tryme -print +/home/shs/bin/tryme +$ find ~/bin -name tryme -ls + 917528 4 -rwx------ 1 shs shs 139 Apr 8 2019 /home/shs/bin/tryme +``` + +你也可以使用子字符串来查找文件。例如,如果你将上面示例中的“tryme”替换为“try*”,你将会找到所有名称以“try”开头的文件。 + +按名称查找文件可能是 **find** 命令最典型的用法,但是有很多其他的方式来查找文件,并且有很好的理由这样做。下面的部分展示了如何使用其他可用的方式。 + +此外,当按大小、组、索引节点等条件来搜索文件时,你需要确认找到的文件与你要查找的文件是否相匹配。使用 **-ls** 选项来显示细节是非常有用。 + +### 通过大小查找文件 + +按大小查找文件需要使用 **-size** 选项并且对相应规范使用一点技巧。如果你指定 **-size 189b**,例如,你将找到189个块长的文件,而不是189个字节。对于字节,你需要使用 **--size 189c**(字符)。而且,如果你指定 **--size 200w** ,你将会找到200个单词的文件——以“双字节增量”为单位的单词,而不是“我们彼此都在说的那些事情”中的单词。你还可以通过以千字节(k)、兆字节(M)和千兆字节(G)为单位提供大小来查找文件。 + + +大多数情况下,Linux用户会搜索比所选文件大的文件。例如,要查找大于1千兆字节的文件,你可以使用这样的命令,其中 +1G 表示“大于1千兆字节”: + +``` +$ find -size +1G -ls 2>/dev/null + 787715 1053976 -rw-rw-r-- 1 shs shs 1079263432 Dec 21 2018 ./backup.zip + 801834 1052556 -rw-rw-r-- 1 shs shs 1077809525 Dec 21 2018 ./2019/hold.zip +``` + +### 通过索引节点查找文件 # + +你可以通过用于维护文件元数据(即除文件内容和文件名之外的所有内容)的索引节点来查找文件。 + +``` +$ find -inum 919674 -ls 2>/dev/null + 919674 4 -rw-rw-r-- 1 shs shs 512 Dec 27 15:25 ./bin/my.log +``` + +### 查找具有特定文件所有者或组的文件 + +按所有者或组查找文件也非常简单。这里我们使用 sudo 来解决权限问题。 + +``` +$ sudo find /home -user nemo -name "*.png"-ls + 1705219 4 drwxr-xr-x 2 nemo nemo 4096 Jan 28 08:50 /home/nemo/Pictures/me.png +``` + +在这个命令中,我们寻找一个被称为 “admins” 的多用户组拥有的文件。 + +``` +# find /tmp -group admins -ls + 262199 4 -rwxr-x--- 1 dory admins 27 Feb 16 18:57 /tmp/testscript +``` + +### 查找没有所有者或组的文件 + +你可以使用如下命令所示的 **-nouser** 选项来查找系统上没有任何现存用户属性的文件。 + +``` +# find /tmp -nouser -ls +262204 4 -rwx------ 1 1016 1016 17 Feb 17 16:42 /tmp/hello +``` + +请注意,该列表显示了旧用户的 UID 和 GID,这清楚地表明该用户未在系统上定义。这种命令将查找由于帐户已从系统中删除的用户在非主目录中创建的文件,或者在用户帐户被删除后未被删除的主目录中创建的文件。类似地,**-nogroup** 选项会找到这样的文件,尤其是当这些用户是相关组的唯一成员时。 + +### 按上次更新时间查找文件 + +在此命令中,我们在特定用户的主目录中查找过去24小时内更新过的文件。**sudo** 用于搜索另一个用户的主目录。 + +``` +$ sudo find /home/nemo -mtime -1 +/home/nemo +/home/nemo/snap/cheat +/home/nemo/tryme +``` + +### 按上次更改权限的时间查找文件 + +**-ctime** 选项可以帮助你查找在某个参考时间范围内状态(如权限)发生更改的文件。以下是查找在最后一天内权限发生更改的文件的示例: + +``` +$ find . -ctime -1 -ls + 787987 4 -rwxr-xr-x 1 shs shs 189 Feb 11 07:31 ./tryme +``` + +请记住,显示的日期和时间反映了文件内容的最后更新。你需要使用像 **stat** 这样的命令来查看与文件相关联的三个状态(文件创建、修改和状态更改)。 + +### Finding files based on last access times + +在这个命令中,我们使用 **-atime** 选项查找在过去两天内访问过的本地 pdf 文件。 + +``` +$ find -name "*.pdf" -atime -2 +./Wingding_Invites.pdf +``` + +### 根据文件相对于另一个文件的时间来查找文件 + +你可以使用 -newer 选项来查找比其他文件更新的文件。 + +``` +$ find . -newer dig1 -ls + 786434 68 drwxr-xr-x 67 shs shs 69632 Feb 16 19:05 . + 1064442 4 drwxr-xr-x 5 shs shs 4096 Feb 16 11:06 ./snap/cheat + 791846 4 -rw-rw-r-- 1 shs shs 649 Feb 13 14:26 ./dig +``` + +没有相应的 **-older** 选项,但是你可以用**,得到类似的结果 **! -newer**(即更旧),这意味着几乎相同的事情。 + +### 按类型查找文件 + +通过文件类型找到一个文件,你有很多选项——常规文件、目录、块和字符文件等等。以下是文件类型选项列表: + +``` +b block (buffered) special +c character (unbuffered) special +d directory +p named pipe (FIFO) +f regular file +l symbolic link +s socket +``` + +这里有一个寻找符号链接的例子: + +``` +$ find . -type l -ls + 805717 0 lrwxrwxrwx 1 shs shs 11 Apr 10 2019 ./volcano -> volcano.pdf + 918552 0 lrwxrwxrwx 1 shs shs 1 Jun 16 2018 ./letter -> pers/letter2mom +``` + +### 限制查找的深度 + +**-mindepth** 和 **-maxdepth** 选项控制在文件系统中搜索的深度(从当前位置或起始点开始)。 + +``` +$ find -maxdepth 3 -name "*loop" +./bin/save/oldloop +./bin/long-loop +./private/loop +``` + +### 查找空文件 + +在这个命令中,我们寻找空文件,但不超过目录及其子目录。 + +``` +$ find . -maxdepth 2 -empty -type f -ls + 917517 0 -rw-rw-r-- 1 shs shs 0 Sep 23 11:00 ./complaints/newfile + 792050 0 -rw-rw-r-- 1 shs shs 0 Oct 4 19:02 ./junk +``` + +### 按权限查找文件 + +你可以使用 **-perm** 选项查找具有特定权限集的文件。在下面的示例中,我们只查找常规文件(**-type f**),以避免看到默认情况下被赋予这些权限的符号链接,即使它们引用的文件是受限的。 + +``` +$ find -perm 777 -type f -ls +find: ‘./.dbus’: Permission denied + 798748 4 -rwxrwxrwx 1 shs shs 15 Mar 28 2019 ./runme +``` + +### 使用查找来帮助你删除文件 + +如果使用如下命令,你可以使用 find 命令定位并删除文件: + +``` +$ find . -name runme -exec rm {} \; +``` + +{} 代表根据搜索条件找到的每个文件的名称。 + +一个非常有用的选项是将 **-exec** 替换为 **-ok**。当您这样做时,**find** 会在删除任何文件之前要求确认。 + +``` +$ find . -name runme -ok rm -rf {} \; +< rm ... ./bin/runme > ? +``` + +删除文件并不是 **-ok** 和 **-rm** 能为你做的唯一事情。例如,你可以复制、重命名或移动文件。 + +确实有很多选择可以有效地使用 find 命令,毫无疑问还有一些在本文中没有涉及到。我希望你已经找到一些新的,特别有帮助的。 + +加入[Facebook][3]和[LinkedIn][4]上的网络世界社区,评论最热门的话题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3527420/how-to-find-what-you-re-looking-for-on-linux-with-find.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[heguangzhi](https://github.com/heguangzhi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/newsletters/signup.html +[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From ed2ab44e7c059405853af1f2bb78e17d23bd2bc3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 4 Mar 2020 19:36:46 +0800 Subject: [PATCH 285/315] APL --- ...ux Aims to Bring Console Gaming Experience on the Desktop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md b/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md index 5cd5c57024..95566050a5 100644 --- a/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md +++ b/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 17c0d8fac6bcc18dc2b64d3edf8beece18a273ab Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 4 Mar 2020 20:56:42 +0800 Subject: [PATCH 286/315] TSL --- ...onsole Gaming Experience on the Desktop.md | 139 ------------------ ...onsole Gaming Experience on the Desktop.md | 131 +++++++++++++++++ 2 files changed, 131 insertions(+), 139 deletions(-) delete mode 100644 sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md create mode 100644 translated/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md diff --git a/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md b/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md deleted file mode 100644 index 95566050a5..0000000000 --- a/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md +++ /dev/null @@ -1,139 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop) -[#]: via: (https://itsfoss.com/drauger-os/) -[#]: author: (John Paul https://itsfoss.com/author/john/) - -Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop -====== - -For years (or decades) people complained that one of the reasons to not [use Linux][1] is lack of mainstream games. [Gaming on Linux][2] has improved drastically in last few years specially with the [introduction of Steam Proton][3] project that enables you to [play a lot of Windows-only games on Linux][4]. - -This also has encourages several [Linux distributions centered around gaming][5]. Take [Lakka][6] for example. You can [turn your old computer into a retro gaming console thanks to Lakka Linux][7]. - -Another such gaming focused Linux distribution is [Draguer OS][8] and we are going to take a look at it today. - -### What is Drauger OS? - -Accord to [the project’s website][9], “Drauger OS is a Linux desktop gaming operating system. It aims to provide a platform for gamers to use where they can get great performance without sacrificing their security. Furthermore, it aims to make it easy for anyone to game, whether they use a keyboard and mouse, or some sort of controller.” - -They stress that Drauger OS is not for everyday use. As such, many of the productivity tools that most other distros come with are not in Drauger OS. - -![Drauger OS 7.4.1][10] - -Drauger OS is [based][9] on the Ubuntu. The current version (7.4.1 Jiangshi) uses “[Liquorix][11] low latency Linux kernel, a pre-compiled ZEN kernel designed with a balance between latency and throughput in mind”. However, that will be changing in the next release. They only have one desktop environment choice, a modified version of [Xfce][12]. - -Drauger OS has several applications and tools installed out of the box to improve the gaming experience. These include: - - * [PlayOnLinux][13] - * WINE - * [Lutris][14] - * Steam - * [DXVK][15] - - - -It also has an interesting set of tools that are not gaming related. [Drauger Installer][16] is a .deb installer and alternative to Gdebi. [Multiple Repository App Installer][17] (mrai) is “an AUR-helper-like script for Debian-based Linux Operating Systems”. Mrai is designed to work with apt, snaps, flatpaks, and can install apps from GitHub. - -Interestingly, Drauger OS’ name is an error. Lead dev [Thomas Castleman][18] (aka batcastle) has intended to name his distro Draugr, but had mistyped the name. In [episode 23][19] of the Drauger OS podcast, Castleman said the name will stay misspelled because it would be a lot of work to correct it. According to [Wikipedia][20], a draugr is “an undead creature from Norse mythology”. - -Yes, you read that correctly. Drauger OS is one of only a few distros that have its own [podcast][21]. When asked about it, Castleman told me that “I wanted to ensure that we had the maximum transparency possible with our community, no matter their circumstances.” Most of the time, the podcast is an audio version of the Drauger OS blog, but sometimes they use it to make an announcement when they don’t have time to write a blog post. - -### The Future for Drauger OS - -![Drauger OS][22] - -The developers behind Druager OS are working on their next major release: 7.5.1. This release will be based on Ubuntu 19.10. There will be three major changes. First, the Liquorix kernel will be [replaced][23] with “a kernel we are building in-house.” This kernel will be based on the Linux Kernel GitHub repository, “so it’s about as vanilla as it gets”. - -The second major change in the new release will a new layout for their desktop. Based on user feedback, they have decided to change it to something that looks more GNOME-like. - -Thirdly, they are dropping SystemBack as their backup tool and installer. They have instead written a new [installer][24] from scratch. - -The Dev team is also working on an [ARM version][25] of Drauger OS. They hope to release it sometime in 2022. - -### System requirements for Draguer OS - -The Drauger OS [system requirements][25] are pretty modest. Keep in mind that Drauger OS will only run on 64-bit systems. - -#### Minimum system requirements - - * CPU: Dual-Core, 1.8GHz, 64-bit processor - * RAM: 1 GB - * Storage: 16 GB - * Graphics Processor: Integrated - * Screen Resolution: 1024×768 at 60Hz - * External Ports: 1 Port for Display (HDMI / DisplayPort / VGA / DVI), 2 USB Ports for Installation USB Drive and Keyboard (Mouse optional, but recommended) - - - -#### Recommended system requirements - - * CPU: Quad-Core, 2.2Ghz, 64-bit processor - * RAM: 4 GB - * Storage: 128 GB - * Graphics Processor: NVIDIA GTX 1050, AMD RX 460, or equivalent card - * Screen Resolution: 1080p at 60Hz - * External Ports: 1 Port for Display (HDMI / DisplayPort / VGA / DVI), 3 USB Ports for Installation USB Drive, Keyboard, and Mouse, 1 Audio Out Port - - - -### How you can help out Drauger OS - -There are several ways that you can help out the Drauger OS if you are interestedin doing so. They are always looking for [financial support][26] to keep development going. - -If you want yo contribute code, they are looking for people with experience in BASH, C++, and Python. All of their code is up on [GitHub][27]. You can also [contact][28] them on social media. - -### Final Thoughts - -Drauger OS is quite a project. I’ve seen a couple of other [gaming-oriented distributions][29], but Drauger OS is single-minded in its focus on gaming. Since I am more of a casual gamer, this distro doesn’t appeal to me personally. But, I can see how it could lure gaming enthusiasts to Linux. I wish them good luck in their future releases. - -What are your thoughts on this gaming-only distro? What is your favorite Linux gaming solution? Please let us know in the comments below. - -If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][30]. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/drauger-os/ - -作者:[John Paul][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/john/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/why-use-linux/ -[2]: https://itsfoss.com/linux-gaming-guide/ -[3]: https://itsfoss.com/steam-play-proton/ -[4]: https://itsfoss.com/steam-play/ -[5]: https://itsfoss.com/linux-gaming-distributions/ -[6]: http://www.lakka.tv/ -[7]: https://itsfoss.com/lakka-retrogaming-linux/ -[8]: https://draugeros.org/go/ -[9]: https://www.draugeros.org/go/about/ -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.4.1.jpg?ssl=1 -[11]: https://liquorix.net/ -[12]: https://www.xfce.org/ -[13]: https://www.playonlinux.com/en/ -[14]: https://lutris.net/ -[15]: https://github.com/doitsujin/dxvk -[16]: https://github.com/drauger-os-development/drauger-installer -[17]: https://github.com/drauger-os-development/mrai -[18]: https://github.com/Batcastle -[19]: https://anchor.fm/drauger-os/episodes/Episode-23-eapu47 -[20]: https://en.wikipedia.org/wiki/Draugr -[21]: https://anchor.fm/drauger-os -[22]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.5.1.png?ssl=1 -[23]: https://www.draugeros.org/go/2020/01/20/major-changes-in-drauger-os-7-5-1/ -[24]: https://github.com/drauger-os-development/system-installer -[25]: https://www.draugeros.org/go/system-requirements/ -[26]: https://www.draugeros.org/go/contribute/ -[27]: https://github.com/drauger-os-development -[28]: https://www.draugeros.org/go/contact-us/ -[29]: https://itsfoss.com/manjaro-gaming-linux/ -[30]: https://reddit.com/r/linuxusersgroup diff --git a/translated/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md b/translated/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md new file mode 100644 index 0000000000..c8d6710e02 --- /dev/null +++ b/translated/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md @@ -0,0 +1,131 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop) +[#]: via: (https://itsfoss.com/drauger-os/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Drauger OS Linux 旨在为台式机带来主机游戏体验 +====== + +多年来(或数十年),人们抱怨不[使用Linux][1] 的原因之一是缺乏主流游戏。[Linux 上的游戏][2]在最近几年有了显著改进,特别是 [Steam Proton][3] 项目的引入使你可以[在 Linux 上玩很多 Windows 专用的游戏][4]。 + +这也鼓励了一些[以游戏为中心的 Linux发行版][5]。以 [Lakka][6] 为例,你可以[借助 Lakka Linux 将旧计算机变成复古的街机游戏机][7]。 + +另一个以游戏为中心的 Linux 发行版是 [Draguer OS][8],我们今天将对其进行研究。 + +### Drauger OS + +根据[该项目的网站][9],“Drauger OS 是 Linux 桌面游戏操作系统。它旨在为游戏玩家提供一个平台,使他们可以在不牺牲安全性的情况下获得出色的性能。此外,它旨在使任何人都可以轻松玩游戏,无论他们使用键盘和鼠标还是某种控制器。” + +他们强调 Drauger OS 并非供日常使用。因此,大多数其他发行版附带的许多生产力工具都不在 Drauger OS 中。 + +![Drauger OS 7.4.1][10] + +Drauger OS [基于][9] Ubuntu 之上。当前版本(7.4.1 Jiangshi)使用 “[Liquorix][11] 低延迟Linux 内核,这是一种预编译的 ZEN 内核,设计时考虑了延迟和吞吐量之间的平衡”。但是,这将在下一版本中更改。他们只有一个桌面环境可供选择,即一个修改版本的 [Xfce][12]。 + +Drauger OS 开箱即用地安装了多个应用程序和工具,以改善游戏体验。这些包括: + +* [PlayOnLinux][13] +* WINE +* [Lutris][14] +* Steam +* [DXVK][15] + +它还具有一组与游戏无关的有趣工具。[Drauger Installer][16] 是 .deb 安装程序,是 Gdebi 的替代品。[多软件库应用安装器][17](mrai)是“用于基于 Debian 的 Linux 操作系统的类似于 AUR-helper 的脚本”。Mrai 旨在与 apt、snap、flatpaks 配合使用,并且可以从 GitHub 安装应用程序。 + +有趣的是,Drauger OS 的名称是一个错误。首席开发者 [Thomas Castleman][18](即 batcastle)曾打算为其发行版命名为 Draugr,但是却打错了名字。在 Drauger OS 播客的[第 23 集][19]中,Castleman 说保持这个拼写错误的名称,因为要对其进行更正需要大量工作。根据 [Wikipedia][20] 的描述,Draugr 是“来自北欧神话中的不死生物”。 + +是的,你没看错。Drauger OS 是仅有的几个具有自己的[播客][21]的发行版之一。当被问到这个问题时,Castleman 告诉我:“无论他们的情况如何,我都希望确保我们的社区拥有最大的透明度。”多数情况下,播客是 Drauger OS 博客的音频版本,但有时他们会在没有时间撰写博客文章时使用它来发布公告。 + +### Drauger OS 的未来 + +![Drauger OS][22] + +Druager OS 背后的开发人员正在开发其下一个主要版本:7.5.1。此版本将基于 Ubuntu 19.10。将有三个主要变化。首先,将使用“我们内部构建的内核” [替换][23] Liquorix 内核。该内核将基于 Linux Kernel GitHub 存储库,“因此,它变得越来越原汁原味”。 + +新版本的第二个主要变化将是为其桌面提供新布局。根据用户的反馈,他们决定将其更改为看起来更类似于 GNOME 的样子。 + +第三,他们放弃了 SystemBack 作为其备份工具和安装程序。相反,他们从头开始编写了新的[安装程序][24]。 + +开发团队也正在研究 Drauger OS 的 [ARM 版本][25]。他们希望在 2022 年的某个时候发布它。 + +### 系统要求 + +Drauger OS [系统要求][25]非常适中。请记住,Drauger OS 仅在 64 位系统上运行。 + +#### 最低系统要求 + +* CPU:双核、1.8GHz、64 位处理器 +* RAM:1 GB +* 储存空间:16 GB +* 图形处理器:集成 +* 屏幕分辨率:60Hz 时为 1024×768 +* 外部端口:1 个用于显示的端口(HDMI/DisplayPort/VGA/DVI),2 个用于安装 USB 驱动器和键盘的 USB 端口(鼠标可选,但建议使用) +   +#### 推荐系统要求 + +* CPU:四核、2.2Ghz、64 位处理器 +* RAM:4 GB +* 储存空间:128 GB +* 图形处理器:NVIDIA GTX 1050、AMD RX 460 或同等显卡 +* 屏幕分辨率:60Hz 时为 1080p +* 外部端口:1 个用于显示的端口(HDMI/DisplayPort/VGA/DVI),3 个用于安装 USB 驱动器、键盘和鼠标的 USB 端口,1 个音频输出端口 + +### 如何为Drauger OS提供帮助 + +如果你有兴趣,可以通过多种方法来帮助 Drauger OS。他们一直在寻找[财政支持][26]以保持发展。 + +如果你想贡献代码,他们正在寻找具有 BASH、C++ 和 Python 经验的人员。他们所有的代码都在 [GitHub][27] 上。你也可以在社交媒体上[联系][28]他们。 + +### 结语 + +Drauger OS 只是这类项目之一。我还见过其他[面向游戏的发行版][29],但 Drauger OS 在专注于游戏方面一心一意。由于我更喜欢休闲游戏,因此该发行版对我个人而言并不具有吸引力。但是,我可以看到它如何吸引游戏爱好者使用 Linux。祝他们在以后的发行中好运。 + +你对这个仅限于游戏的发行版有何想法?你最喜欢的 Linux 游戏解决方案是什么?请在下面的评论中告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/drauger-os/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/why-use-linux/ +[2]: https://itsfoss.com/linux-gaming-guide/ +[3]: https://itsfoss.com/steam-play-proton/ +[4]: https://itsfoss.com/steam-play/ +[5]: https://itsfoss.com/linux-gaming-distributions/ +[6]: http://www.lakka.tv/ +[7]: https://itsfoss.com/lakka-retrogaming-linux/ +[8]: https://draugeros.org/go/ +[9]: https://www.draugeros.org/go/about/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.4.1.jpg?ssl=1 +[11]: https://liquorix.net/ +[12]: https://www.xfce.org/ +[13]: https://www.playonlinux.com/en/ +[14]: https://lutris.net/ +[15]: https://github.com/doitsujin/dxvk +[16]: https://github.com/drauger-os-development/drauger-installer +[17]: https://github.com/drauger-os-development/mrai +[18]: https://github.com/Batcastle +[19]: https://anchor.fm/drauger-os/episodes/Episode-23-eapu47 +[20]: https://en.wikipedia.org/wiki/Draugr +[21]: https://anchor.fm/drauger-os +[22]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.5.1.png?ssl=1 +[23]: https://www.draugeros.org/go/2020/01/20/major-changes-in-drauger-os-7-5-1/ +[24]: https://github.com/drauger-os-development/system-installer +[25]: https://www.draugeros.org/go/system-requirements/ +[26]: https://www.draugeros.org/go/contribute/ +[27]: https://github.com/drauger-os-development +[28]: https://www.draugeros.org/go/contact-us/ +[29]: https://itsfoss.com/manjaro-gaming-linux/ +[30]: https://reddit.com/r/linuxusersgroup From aee1eebca76a0f90aa16ce7565eece098e2b2c2f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 5 Mar 2020 01:05:14 +0800 Subject: [PATCH 287/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200305=20Instal?= =?UTF-8?q?l=20and=20Use=20Wireshark=20on=20Ubuntu=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md --- ...stall and Use Wireshark on Ubuntu Linux.md | 219 ++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md diff --git a/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md b/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md new file mode 100644 index 0000000000..3b0a4f6468 --- /dev/null +++ b/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md @@ -0,0 +1,219 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Install and Use Wireshark on Ubuntu Linux) +[#]: via: (https://itsfoss.com/install-wireshark-ubuntu/) +[#]: author: (Community https://itsfoss.com/author/itsfoss/) + +Install and Use Wireshark on Ubuntu Linux +====== + +_**Brief: You’ll learn to install the latest Wireshark on Ubuntu and other Ubuntu-based distribution in this tutorial. You’ll also learn how to run Wireshark without sudo and how to set it up for packet sniffing.**_ + +[Wireshark][1] is a free and open-source network protocol analyzer widely used around the globe. + +With Wireshark, you can capture incoming and outgoing packets of a network in real-time and use it for network troubleshooting, packet analysis, software and communication protocol development, and many more. + +It is available on all major desktop operating systems like Windows, Linux, macOS, BSD and more. + +In this tutorial, I will guide you to install Wireshark on Ubuntu and other Ubuntu-based distributions. I’ll also show a little about setting up and configuring Wireshark to capture packets. + +### Installing Wireshark on Ubuntu based Linux distributions + +![][2] + +Wireshark is available on all major Linux distributions. You should check out the [official installation instructions][3]. because in this tutorial, I’ll focus on installing the latest Wireshark version on Ubuntu-based distributions only. + +Wireshark is available in the Universe repository of Ubuntu. You can [enable universe repository][4] and then install it like this: + +``` +sudo add-apt-repository universe +sudo apt install wireshark +``` + +One slight problem in this approach is that you might not always get the latest version of Wireshark. + +For example, in Ubuntu 18.04, if you [use the apt command][5] to check the available version of Wireshark, it is 2.6. + +``` +[email protected]:~$ apt show wireshark +Package: wireshark +Version: 2.6.10-1~ubuntu18.04.0 +Priority: optional +Section: universe/net +Origin: Ubuntu +Maintainer: Balint Reczey <[email protected]> +``` + +However, [Wireshark 3.2 stable version][6] has been released months ago. New release brings new features, of course. + +So, what do you do in such case? Thankfully, Wiresshark developers provide an official PPA that you can use to install the latest stable version of Wireshark on Ubuntu and other Ubuntu-based distributions. + +I hope you are acquainted with PPA. If not, please [read our excellent guide on PPA to understand it completely][7]. + +Open a terminal and use the following commands one by one: + +``` +sudo add-apt-repository ppa:wireshark-dev/stable +sudo apt update +sudo apt install wireshark +``` + +Even if you have an older version of Wireshark installed, it will be updated to the newer version. + +While installing, you will be asked whether to allow non-superusers to capture packets. Select Yes to allow and No to restrict non-superusers to capture packets & finish the installation. + +### Running Wireshark without sudo + +If you have selected **No** in the previous installation, then run the following command as root: + +``` +sudo dpkg-reconfigure wireshark-common +``` + +And select **Yes** by pressing the tab key and then using enter key: + +![][8] + +Since you have allowed the non-superuser to capture packets, you have to add the user to wireshark group. Use the [usermod command][9] to add yourself to the wireshark group. + +``` +sudo usermod -aG wireshark $(whoami) +``` + +Finally, [restart your Ubuntu system][10] to make the necessary changes to your system. + +Trivia + +First released in 1998, Wireshark was initially known as Ethereal. Developers had to change its name to Wireshark in 2006 due to trademark issues. + +### Starting Wireshark + +Launching Wireshark application can be done from the application launcher or the CLI. + +To start from CLI, just type **wireshark** on your console: + +``` +wireshark +``` + +From **GUI**, search for Wireshark application on the search bar and hit enter. + +![][11] + +Now let’s play with Wireshark. + +### Capturing packets using Wireshark + +When you start Wireshark, you will see a list of interfaces that you can use to capture packets to and from. + +There are many types of interfaces available which you can monitor using Wireshark such as, Wired, External devices, etc. According to your preference, you can choose to show specific types of interfaces in the welcome screen from the marked area in the given image below. + +![Select interface][12] + +For instance, I listed only the **Wired** network interfaces. + +![][13] + +Next, to start capturing packets, you have to select the interface (which in my case is ens33) and click on the **Start capturing packets** icon as marked in the image below. + +![Start capturing packets with Wireshark][14] + +You can also capture packets to and from multiple interfaces at the same time. Just press and hold the **CTRL** button while clicking on the interfaces that you want to capture to and from and then hit the **Start capturing packets** icon as marked in the image below. + +![][15] + +Next, I tried using **ping google.com** command in the terminal and as you can see, many packets were captured. + +![Captured packets][16] + +Now you can select on any packet to check that particular packet. After clicking on a particular packet you can see the information about different layers of TCP/IP Protocol associated with it. + +![Packet info][17] + +You can also see the RAW data of that particular packet at the bottom as shown in the image below. + +![Check RAW data in the captured packets][18] + +This is why end-to-end encryption is important + +Imagine you are logging into a website that doesn’t use HTTPS. Anyone on the same network as you can sniff the packets and see the user name and password in the RAW data. +This is why most chat applications use end to end encryption and most websites these days use https (instead of http). + +#### Stopping packet capture in Wireshark + +You can click on the red icon as marked in the given image to stop capturing Wireshark packets. + +![Stop packet capture in Wireshark][19] + +#### Save captured packets to a file + +You can click on the marked icon in the image below to save captured packets to a file for future use. + +![Save captured packets by Wireshark][20] + +**Note**: _Output can be exported to XML, PostScript®, CSV, or plain text._ + +Next, select a destination folder, and type the file name and click on **Save**. +Then select the file and click on **Open**. + +![][21] + +Now you can open and analyze the saved packets anytime. To open the file, press **\ + o** +or go to **File > Open** from Wireshark. + +The captured packets should be loaded from the file. + +![][22] + +### Conclusion + +Wireshark supports many different communication protocols. There are many options and features that provide you the power to capture and analyze the network packets in a unique way. You can learn more about Wireshark from their [official documentation][23]. + +I hope this detailed helped you to install Wireshark on Ubuntu. Please let me know your questions and suggestions. + +![][24] + +### Kushal Rai + +A computer science student & Linux and open source lover. He likes sharing knowledge for he believes technology shapes the perception of modern world. Kushal also loves music and photography. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-wireshark-ubuntu/ + +作者:[Community][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/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://www.wireshark.org/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/wireshark_ubuntu.png?ssl=1 +[3]: https://www.wireshark.org/docs/wsug_html_chunked/ChBuildInstallUnixInstallBins.html +[4]: https://itsfoss.com/ubuntu-repositories/ +[5]: https://itsfoss.com/apt-command-guide/ +[6]: https://www.wireshark.org/news/20191218.html +[7]: https://itsfoss.com/ppa-guide/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/yes.png?ssl=1 +[9]: https://linuxhandbook.com/usermod-command/ +[10]: https://itsfoss.com/schedule-shutdown-ubuntu/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/wire.png?ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/interfaces.jpg?ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/intoption.jpg?ssl=1 +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/singleinterface.jpg?ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/selint.jpg?ssl=1 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/capture.jpg?ssl=1 +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/packetinfo.png?ssl=1 +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/raw.png?ssl=1 +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/stopcapture.png?ssl=1 +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/savepackets.jpg?ssl=1 +[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/savename.jpg?ssl=1 +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/openpacket.png?ssl=1 +[23]: https://www.wireshark.org/docs/https://www.wireshark.org/docs/ +[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/kushal_rai.jpg?ssl=1 From 8a284e908dae7d6a92202233a65bd00d86e323b9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 5 Mar 2020 01:07:52 +0800 Subject: [PATCH 288/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200304=20How=20?= =?UTF-8?q?service=20virtualization=20relates=20to=20test-driven=20develop?= =?UTF-8?q?ment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200304 How service virtualization relates to test-driven development.md --- ...tion relates to test-driven development.md | 428 ++++++++++++++++++ 1 file changed, 428 insertions(+) create mode 100644 sources/tech/20200304 How service virtualization relates to test-driven development.md diff --git a/sources/tech/20200304 How service virtualization relates to test-driven development.md b/sources/tech/20200304 How service virtualization relates to test-driven development.md new file mode 100644 index 0000000000..4ff4243603 --- /dev/null +++ b/sources/tech/20200304 How service virtualization relates to test-driven development.md @@ -0,0 +1,428 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How service virtualization relates to test-driven development) +[#]: via: (https://opensource.com/article/20/3/service-virtualization-test-driven-development) +[#]: author: (Alex Bunardzic https://opensource.com/users/alex-bunardzic) + +How service virtualization relates to test-driven development +====== +Mountebank simulates services you're dependent on so autonomous teams +can continue development activities without having to wait on anyone. +![Person using a laptop][1] + +The agile approach to software development relies on service virtualization to give each IT team autonomy. This approach removes blockages and allows autonomous teams to continue development activities without having to wait on anyone. That way, integration testing can commence as soon as teams start iterating/sprinting. + +### How automated services work + +Any automated service is available to consumers via a published endpoint. This means services can be automated only if they're made available online. + +Any consumer wishing to leverage available automated services must be capable of sending requests to that service's endpoint via an HTTP protocol. Some of those services will, upon receiving the request via the HTTP protocol, respond by simply sending back some data. Other services may respond to receiving a request via HTTP protocol by actually performing some work. For example, a service may create a resource (for example, create an order), update a resource (update an order), or delete a resource (cancel an order). + +All those activities get triggered via the HTTP protocol. In the simplest of cases, the action instigated by the service consumer is GET (e.g., HTTP GET). That request may arrive with some query values; those values will get used by the service to narrow down the search (such as "search for order number 12345 and return the data"). + +In more elaborate cases, a request may arrive with the instruction to POST some values; a service will accept that request and expect some values to be associated with it. Those values are usually called the payload. When the service accepts an HTTP POST request containing the payload, it will attempt to process it. It may or may not succeed in processing it, but either way, it will respond to the service consumer with a status code and an optional status message. That way, service consumers will be notified of the success/failure of their request so that they can decide what the next step should be. + +### What is service virtualization? + +Now that we understand how automated services work, it should be easier to understand how to virtualize them. In a nutshell, it is possible to simulate any service that is published on a hosting site. Instead of sending HTTP requests directly to the service provider's endpoint, you can interject a fake, pretend service that simulates the behavior of the real service. + +From the service consumer's standpoint, it makes absolutely no difference whether it is interacting with a real or a fake service. The interaction remains identical. + +### Virtualize one service + +OK, enough talking, I'll roll up my sleeves and show how to do it in practical terms. Suppose your team is starting a new project and receives requirements in the form of a fully fleshed user story: + +#### Authenticate user + +_As a new app_ +_I want to authenticate the user_ +_Because we want to ensure proper security for the app_ + +#### Acceptance criteria + +**Scenario #1:** _New app successfully authenticates the user_ +Given that the user has navigated to the login page +And the user has submitted credentials +When new app receives login request +Then new app successfully authenticates the user +And new app displays response message "User successfully logged in." + +**Scenario #2:** _New app cannot authenticate the user on the first attempt_ +Given that the user has navigated to the login page +And the user has submitted credentials +When new app receives login request +Then new app fails to successfully authenticate the user +And new app displays response message "Incorrect login. You have 2 more attempts left." + +**Scenario #3:** _New app cannot authenticate the user on the second attempt_ +Given that the user has navigated to the login page +And the user has submitted credentials +When new app receives login request +Then new app fails to successfully authenticate the user +And new app displays response message "Incorrect login. You have 1 more attempt left." + +**Scenario #4:** _New app cannot authenticate the user on the third attempt_ +Given that the user has navigated to the login page +And the user has submitted credentials +When new app receives login request +Then new app fails to successfully authenticate the user +And new app displays response message "Incorrect login. You have no more attempts left." + +The first thing to do when starting the work on this user story is to create the so-called "walking skeleton" (for this exercise, I will be using the standard **.Net Core** platform plus **xUnit.net** I discussed in my previous articles ([starting with this one][2] with [another example here][3]). Please refer to them for technical details on how to install, configure, and run the required tools. + +Create the walking skeleton infrastructure by opening the command line and typing: + + +``` +`mkdir AuthenticateUser` +``` + +Then move inside the **AuthenticateUser** folder: + + +``` +`cd AuthenticateUser` +``` + +And create a separate folder for tests: + + +``` +`mkdir tests` +``` + +Move into the **tests** folder (**cd tests**) and initiate the **xUnit** framework: + + +``` +`dotnet new xunit` +``` + +Now move one folder up (back to **AuthenticateUser**) and create the app folder: + + +``` +mkdir app +cd app +``` + +Create the scaffold necessary for C# code: + + +``` +`dotnet new classlib` +``` + +The walking skeleton is now ready! Open the editor of your choice and start coding. + +### Write a failing test first + +In the spirit of TDD, start by writing the failing test (refer to the [previous article][4] to learn why is it important to see your test fail before attempting to make it pass): + + +``` +using System; +using Xunit; +using app; + +namespace tests { +    public class UnitTest1 { +        Authenticate auth = [new][5] Authenticate(); + +        [Fact] +        public void SuccessLogin(){ +            var given = "credentials"; +            var expected = "Successful login."; +            var actual = auth.Login(given); +            Assert.Equal(expected, actual); +        } +    } +} +``` + +This test states that if someone supplies some credentials (i.e., a secret username and password) to the **Login** method of the **Authenticate** component when it processes the request, it is expected to return the message "Successful login." + +Of course, this is functionality that does not exist yet—the instantiated **Authenticate** module in the **SuccessLogin()** module hasn't been written yet. So you might as well go ahead and take the first stab at writing the desired functionality. Create a new file (**Authenticate.cs**) in the **app** folder and add the following code: + + +``` +using System; + +namespace app { +    public class Authenticate { +        public string Login(string credentials) { +            return "Not implemented"; +        } +    } +} +``` + +Now, navigate to the **tests** folder and run: + + +``` +`dotnet test` +``` + +![Output of dotnet.test][6] + +The test fails because it was expecting a "Successful login" output but instead got the "Not implemented" output. + +### Increasing complexity for day two operations + +Now that you have created the "happy path" expectation and made it fail, it is time to work on implementing the functionality that will make the failing test pass. The following day, you attend the standup and report that you have started on the "Authenticate user" story. You let the team know that you have created the first failing test for the "happy path," and today, the plan is to implement the code to make the failing test pass. + +You explain your intention to first create a **User** table containing the **username**, **password**, and other pertinent attributes. But the scrum master interrupts and explains that the **User** module is being handled by another team. It would be bad practice to duplicate the maintenance of users, as the information will quickly get out of sync. So instead of building the **User** module (which would include the authentication logic), you are to leverage the authentication services that the **User** team is working on. + +That's great news because it saves you the trouble of having to write a lot of code to implement the **User** processing. Emboldened, you enthusiastically announce that you will quickly cobble up a function that will take user credentials and send them to the service that the **User** team has built. + +Alas, your intentions get squashed again as you learn that the **User** team hasn't started building the **User authentication** service yet. They're still in the process of assigning user stories to the backlog. Disheartened, you resign to the fact that it will be at least a few days (if not weeks?) before you can start working on the **User authentication** story. + +The scrum master then says that there is no reason to wait for the **User authentication** service to be built and deployed to testing. You could start developing the authentication functionality right away. But how can you do that? + +The scrum master offers a simple suggestion: leverage service virtualization. Since all specifications for the **User** module have been solidified and signed off, you have a solid, non-volatile contract to build your solution against. The contract published by the **User** services team states that in order to authenticate a user, specific expectations must be fulfilled: + + 1. A client wishing to authenticate a user should send an **HTTP POST** request to the endpoint . + 2. The **HTTP POST** sent to the above endpoint must have a **JSON** payload that contains the user credentials (i.e., username and password). + 3. Upon receiving the request, the service will attempt to log the user in. If the username and password match the information on record, the service will return an **HTTP** response containing status code 200 with the body of the response containing the message "User successfully logged in." + + + +So, now that you know the contract details, you can start building the solution. Here's the code that connects to the endpoint, sends the **HTTP POST** request, and receives the **HTTP** response: + + +``` +using System; +using System.Net.Http; +using System.Threading.Tasks; +using System.Collections.Generic; + +namespace app { +    public class Authenticate { +        HttpClient client = [new][5] HttpClient(); +        string endPoint = ""; + +        public string Login(string credentials) { +            Task<string> response = CheckLogin(credentials); +            return response.Result; +        } + +        private async Task<string> CheckLogin(string credentials) { +            var values = [new][5] Dictionary<string, string>{{"credentials", credentials}}; +            var content = [new][5] FormUrlEncodedContent(values); +            var response = await client.PostAsync(endPoint, content); +            return await response.Content.ReadAsStringAsync(); +        } +    } +} +``` + +This code won't work because does not exist (yet). Are you stuck now, waiting for the other team to eventually build and deploy that service? + +Not really. Service virtualization to rescue! Let's pretend that the service is already there and continue the development. + +### How to virtualize a service + +One way to virtualize the **User authentication** service would be to write a new app (the new API) and run it locally. This API will mirror the contract specified by the real **User authentication** API and will only return hard-coded stubbed data (it will be a fake service). + +Sounds like a good plan. Again, the team pushes back during the standup, questioning the need for writing, building, testing, and deploying a brand new app just to accomplish this fake functionality. It kind of wouldn't be worth the trouble because, by the time you deliver that new fake app, the other team would probably be ready with the real service. + +So you've reached an impasse. It looks like you are forced to wait on your dependency to materialize. You've failed to control your dependencies; you now have no recourse but to work in a sequential fashion. + +Not so fast! There is a great new tool called [mountebank][7] that is ideal for virtualizing any service. Using this tool, you can quickly stand up a local server that listens on a port you specify and takes orders. To make it simulate a service, you only have to tell it which port to listen to and which protocol to handle. The choice of protocols is: + + * HTTP + * HTTPS + * SMTP + * TCP + + + +In this case, you need the HTTP protocol. First, install mountebank—if you have **npm** on your computer, you can simply type on the command line: + + +``` +`npm install -g mountebank` +``` + +After it's installed, run mountebank by typing: + + +``` +`mb` +``` + +At startup, mountebank will show: + +![mountebank startup][8] + +Now you're ready to virtualize an HTTP service. In this case, the **User authentication** service expects to receive an HTTP POST request; here is how the implemented code sends an HTTP POST request: + + +``` +`var response = await client.PostAsync(endPoint, content);` +``` + +You now have to establish that **endPoint**. Ideally, all virtualized services should be propped in the **localhost** server to ensure quick execution of integration tests. + +To do that, you need to configure the **imposter**. In its bare-bones form, the **imposter** is a simple JSON collection of key-value pairs containing the definition of a port and a protocol: + + +``` +{ +    "port": 3001, +    "protocol": "http" +} +``` + +This imposter is configured to handle the HTTP protocol and to listen to incoming requests on port 3001. + +Just listening to incoming HTTP requests on port 3001 is not going to do much. Once the request arrives at that port, mountebank needs to be told what to do with that request. In other words, you are virtualizing not only the availability of a service on a specific port but also the way that virtualized service is going to respond to the request. + +To accomplish that level of service virtualization, you need to tell mountebank how to configure stubs. Each stub consists of two components: + + 1. A collection of predicates + 2. A collection of expected responses + + + +A predicate (sometimes called a matcher) narrows down the scope of the incoming request. For example, using the HTTP protocol, you can expect more than one type of method (e.g., GET, POST, PUT, DELETE, PATCH, etc.). In most service-virtualization scenarios, we are interested in simulating the behavior that is specific to a particular HTTP method. This scenario is about responding to the HTTP POST request, so you need to configure your stub to match on HTTP POST requests only: + + +``` +{ +    "port": 3001, +    "protocol": "http", +    "stubs": [ +        { +            "predicates": [ +                { +                    "equals": { +                        "method": "post" +                    } +                } +            ] +        } +    ] +} +``` + +This imposter defines one predicate that matches (using the keyword **equals**) on the HTTP POST request only. + +Now take a closer look at the **endPoint** value, as defined in the implemented code: + + +``` +`string endPoint = "http://localhost:3001/api/v1/users/login";` +``` + +In addition to listening to port 3001 (as defined in ), the **endPoint** is more specific, in that it expects the incoming HTTP POST request to go to the /api/v1/users/login path. How do you tell mountebank to only match exactly on the /api/v1/users/login path? By adding the path key-value pair to the stub's predicate: + + +``` +{ +    "port": 3001, +    "protocol": "http", +    "stubs": [ +        { +            "predicates": [ +                { +                    "equals": { +                        "method": "post", +                        "path": "/api/v1/users/login" +                    } +                } +            ] +        } +    ] +} +``` + +This imposter now knows that HTTP requests arriving at port 3001 must be a POST method and must point at the /api/v1/users/login path. The only thing left to simulate is the expected HTTP response. + +Add the response to the JSON imposter: + + +``` +{ +    "port": 3001, +    "protocol": "http", +    "stubs": [ +        { +            "predicates": [ +                { +                    "equals": { +                        "method": "post", +                        "path": "/api/v1/users/login" +                    } +                } +            ], +            "responses": [ +                { +                    "is": { +                        "statusCode": 200, +                        "body": "Successful login." +                    } +                } +            ] +        } +    ] +} +``` + +With mountebank imposters, you define responses as a collection of JSON key-value pairs. In most cases, it is sufficient to simply state that a response is a **statusCode** and a **body**. This case is simulating the "happy path" response that has the status code **OK (200)** and the body containing a simple message **Successful login** (as specified in the acceptance criteria). + +### How to run virtualized services? + +OK, now that you have virtualized the **User authentication** service (at least its "happy path"), how do you run it? + +Remember that you have already started mountebank, and it reported that it is running in memory as the domain. Mountebank is listening on port 2525 and taking orders. + +Great, now you have to tell mountebank that you have the imposter ready. How do you do that? Send an HTTP POST request to . The requests body must contain the JSON you created above. There are a few techniques available to send that request. If you're versed in [curl][9], using it to send HTTP POST requests would be the simplest, quickest way to stand up the imposter. But many people prefer a more user-friendly way to send the HTTP POST to mountebank. + +The easy way to do that is to use [Postman][10]. If you download and install Postman, you can point it at , select the POST method from the pulldown menu, and copy and paste the imposter JSON into the raw body. + +When you click Send, the imposter will be created, and you should get Status 201 (Created). + +![Postman output][11] + +Your virtualized service is now running! You can verify it by navigating to the **tests** folder and running the **dotnet test** command: + +![dotnet test output][12] + +### Conclusion + +This demo shows how easy it is to remove blockages and control dependencies by simulating services you're dependent on. Mountebank is a fantastic tool that easily and cheaply simulates all kinds of very elaborate, sophisticated services. + +In this installment, I just had time to illustrate how to virtualize a simple "happy path" service. If you go back to the actual user story, you will notice that its acceptance criteria contain several "less happy" paths (cases when someone is repeatedly trying to log in using invalid credentials). It's a bit trickier to properly virtualize and test those use cases, so I've left that exercise for the next installment in this series. + +How will you use service virtualization to solve your testing needs? I would love to hear about it in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/service-virtualization-test-driven-development + +作者:[Alex Bunardzic][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/alex-bunardzic +[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://opensource.com/article/19/8/mutation-testing-evolution-tdd +[3]: https://opensource.com/article/19/9/mutation-testing-example-tdd +[4]: https://opensource.com/article/20/2/automate-unit-tests +[5]: http://www.google.com/search?q=new+msdn.microsoft.com +[6]: https://opensource.com/sites/default/files/uploads/dotnet-test.png (Output of dotnet.test) +[7]: http://www.mbtest.org/ +[8]: https://opensource.com/sites/default/files/uploads/mountebank-startup.png (mountebank startup) +[9]: https://curl.haxx.se/ +[10]: https://www.postman.com/ +[11]: https://opensource.com/sites/default/files/uploads/status-201.png (Postman output) +[12]: https://opensource.com/sites/default/files/uploads/dotnet-test2.png (dotnet test output) From 398dd2ab5afdae764c9c5e30eb42cfc55c2613c4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 5 Mar 2020 01:09:29 +0800 Subject: [PATCH 289/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200304=20Gettin?= =?UTF-8?q?g=20started=20with=20the=20Gutenberg=20editor=20in=20Drupal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md --- ...ted with the Gutenberg editor in Drupal.md | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md diff --git a/sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md b/sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md new file mode 100644 index 0000000000..6050adebfa --- /dev/null +++ b/sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md @@ -0,0 +1,122 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with the Gutenberg editor in Drupal) +[#]: via: (https://opensource.com/article/20/3/gutenberg-editor-drupal) +[#]: author: (MaciejLukianski https://opensource.com/users/maciejlukianski) + +Getting started with the Gutenberg editor in Drupal +====== +Learn how to use the WYSIWYG editor, made popular in WordPress, with +Drupal. +![Text editor on a browser, in blue][1] + +Since 2017, WordPress has had a really great WYSIWYG editor in the [Gutenberg][2] plugin. But the Drupal community hasn't yet reached consensus on the best approach to the content management system's (CMS) editorial experience. But a strong new option appeared when, with a lot of community effort, [Gutenberg was integrated with Drupal][3]. + +Previously, there were two main approaches to content creation in Drupal 8: + + * In the [**Paragraph-based approach**][4], content is assembled out of entities called paragraphs. Currently, approximately 100,000 websites use the Paragraphs module (according to Drupal). + * The [**Layout-Builder approach**][5] uses an editorial tool shipped with Drupal 8.5. It is still undergoing improvements, but it is the next strong contender because it is really well integrated with the Drupal core. Stats on usage are not available since Layout Builder is part of Drupal. + + + +At the end of 2018, the Drupal community, lead by Fronkom (a Norwegian digital agency strongly focused on open source solutions), ported the WordPress Gutenberg project as a contributed module into Drupal. Let's take a look at how Gutenberg works in Drupal (including some cool Drupal-specific integrations). + +### Installation + +Installing the [Gutenberg module][6] is as straightforward as installing any Drupal module, and it has good [installation documentation][7]. + +### Configuration + +Gutenberg is integrated into Drupal's default content-entity creation workflow. You can use it on any of the content types you choose, provided that the content type has at least one text area field, which is where the Gutenberg editor's output will be saved. + +To enable the Gutenberg project on a content type in Drupal, you have to navigate to its settings: **Structure > Content types** and, from the dropdown next to the content type where you want to use Gutenberg, click **Edit**. + +![Drupal settings][8] + +In the form that appears, scroll down and select the **Gutenberg experience** tab on the left, where you can find the settings described below. Select the **Enable Gutenberg experience** box. + +![Drupal Gutenberg settings][9] + +#### Template + +This is one of the cool features that is not available in WordPress out of the box. It enables you to define a template for a new page in a JSON structure. This will pre-populate all newly created articles with dummy placeholder content, which will help editors structure content correctly. In the screenshot above, I added a heading and a paragraph. Note that any double-quotes have to be escaped. + +#### Template lock + +This setting allows you to define whether users are allowed to delete the placeholder content, add new blocks, or just edit the existing, pre-populated content. + +#### Allowed Gutenberg and Drupal blocks + +This is another super-cool feature on the Drupal side of Gutenberg. Drupal allows users to create various types of blocks to design a page. For example, you could create a block with a list of the five latest blog posts, the most recent comments, or a form to collect users' emails. + +Gutenberg's deep integration with Drupal allows users to select which Drupal blocks are available to users while they are editing (e.g., limit embeds to YouTube) and use blocks as inline content. This is a very handy feature that allows granular control of the user experience. + +There's not much to choose from in a blank Drupal installation, but a live site usually has many blocks that provide various functionalities. In the screenshot below, the **Search form** Drupal block is selected. + +![Drupal Gutenberg blocks][10] + +After you finish the configuration, hit **Save content type**. + +### Publishing content with Drupal Gutenberg + +When Gutenberg is enabled for a content type, it takes over most of the editorial experience. + +![Drupal Gutenberg content screen][11] + +In the main window, you can see the dummy placeholder content I added in the Template configuration above. + +#### Drupal-specific options + +On the right-hand side, there are a few fields and settings that Drupal provides. For example, the **Title** field is a required separate field in Drupal, and therefore it is not on the main Gutenberg screen. + +Underneath the **Title**, there are additional settings that can vary, depending on the modules installed and options set up in Drupal. You can see **Revision log messages**, **Menu settings**, **Comment settings**, and a place to add a **URL alias**. + +Typically, Drupal content types are composed of several text fields, such as tags, categories, checkboxes, image fields for teasers, etc. When you enable Gutenberg for a content type, these additional fields are available in the **More settings** tab. + +You can now add your content—it works the same as it does in WordPress Gutenberg, with the additional option to add Drupal blocks. + +In the screenshot below, you can see what happens when I add some text to replace the placeholder text, a search block from Drupal, a title, tags, and a custom URL alias. + +![Drupal Gutenberg entering text][12] + +After you hit **Save**, your content will be published. + +![Drupal Gutenberg output][13] + +And that is it. It works like a charm! + +### Working together for better software experiences + +Gutenberg in Drupal works well. It is an alternative option that allows editors to control the look and feel of their websites down to the tiniest details. Adoption is growing well, with over 1,000 installations as of this writing and 50 new ones every month. The Drupal integration adds other cool features like fine-grained permissions, placeholder content, and the ability to include Drupal blocks inline, which aren't available in the WordPress plugin. + +It is great to see the communities of two separate projects working together to achieve the common goal of giving people better software. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/gutenberg-editor-drupal + +作者:[MaciejLukianski][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/maciejlukianski +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue) +[2]: https://wordpress.org/plugins/gutenberg/ +[3]: https://drupalgutenberg.org/ +[4]: https://www.droptica.com/blog/flexible-and-easy-content-creation-drupal-paragraphs-module/ +[5]: https://www.droptica.com/blog/layout-builder-building-drupal-8-layouts/ +[6]: https://www.drupal.org/project/gutenberg +[7]: https://www.drupal.org/docs/8/extending-drupal-8/installing-drupal-8-modules +[8]: https://opensource.com/sites/default/files/uploads/gutenberg_edit.png (Drupal settings) +[9]: https://opensource.com/sites/default/files/uploads/gutenberg_settings.png (Drupal Gutenberg settings) +[10]: https://opensource.com/sites/default/files/uploads/gutenberg_blocks.png (Drupal Gutenberg blocks) +[11]: https://opensource.com/sites/default/files/uploads/gutenberg_contentwindow.png (Drupal Gutenberg content screen) +[12]: https://opensource.com/sites/default/files/uploads/gutenberg_entry.png (Drupal Gutenberg entering text) +[13]: https://opensource.com/sites/default/files/uploads/gutenberg-demo.png (Drupal Gutenberg output) From c813eb3c075a18e26bb944fc3e031d3d4620141e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 5 Mar 2020 01:19:05 +0800 Subject: [PATCH 290/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200304=20Seawat?= =?UTF-8?q?er,=20humidity=20inspire=20new=20ways=20to=20generate=20power?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200304 Seawater, humidity inspire new ways to generate power.md --- ...dity inspire new ways to generate power.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/talk/20200304 Seawater, humidity inspire new ways to generate power.md diff --git a/sources/talk/20200304 Seawater, humidity inspire new ways to generate power.md b/sources/talk/20200304 Seawater, humidity inspire new ways to generate power.md new file mode 100644 index 0000000000..7e2dc5927f --- /dev/null +++ b/sources/talk/20200304 Seawater, humidity inspire new ways to generate power.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Seawater, humidity inspire new ways to generate power) +[#]: via: (https://www.networkworld.com/article/3529893/seawater-humidity-inspire-new-ways-to-generate-power.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Seawater, humidity inspire new ways to generate power +====== +Researchers around the globe are working on new ways to generate huge amounts of power that will be needed for the shift to a data-driven society. +Getty Imags + +The possiblity of a future power-availability crunch – spurred in part by a global increase in data usage – is driving researchers to get creative with a slew of new and modified ways to generate and store energy. + +Ongoing projects include the use of seawater for batteries; grabbing ambient humidity; massive water storage systems for hydropower; and solar panels that work at night. Here are some details: + +### Batteries based on seawater + +Seawater will provide "super-batteries," says the University of Southern Denmark. Researchers there have been studying how to use sodium, which is abundant in seawater, as an alternative to lithium in batteries. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] + +"Sodium is a very readily available resource," the school says in a [press release][2], and it can be easily extracted from seawater. Lithium, on the other hand, is a limited resource that's mined only in a few places in the world, says research leader Dorthe Bomholdt Ravnsbæk of the department of physics, chemistry and pharmacy at the university. Batteries based on seawater would also alleviate the need for cobalt, which is used in lithium cells. The team in Denmark (working with Massachusetts Institute of Technology) believes it has come up with a new electrode material, based on manganese, that will make the seawater battery ultimately viable. + +### Using ambient moisture to generate power + +Humidity captured with bio-electronics could end up being a viable power source for sensors, say some scientists. + +"Harvesting energy from the environment offers the promise of clean power for self-sustained systems," notes University of Massachusetts researchers [in an article published in Nature][3]. However, known technologies often have restrictive environmental requirements – solar panels that must be mounted outside, for example – that limit their energy-producing potential. + +Moisture harvesting with thin-film, protein nanowires doesn't have restrictive environmental requirements. Sustained voltages of about half a volt can be obtained from moisture present in normal, ambient air. "Connecting several devices linearly scales up the voltage and current to power electronics," the Amherst group claims. "Our results demonstrate the feasibility of a continuous energy-harvesting strategy that is less restricted by location or environmental conditions than other sustainable approaches." + +[][4] + +### Seasonally pumped hydropower storage  + +On a larger scale, inland water storage could solve renewable power issues, say scientists at the International Institute for Applied Systems Analysis. + +One big problem collecting power from the environment, as opposed to using fossil fuels, is where to store the on-the-fly electricity being generated. The Austrian organization believes that hydropower systems should be used to contain renewable energy. It's cheap, for starters. In addition, seasonal pumped hydropower storage (SPHS) is better than wind or solar, the group claims, because it not only generates the power in real time as it’s needed, but also isn't affected by variations— a windy day isn't required, for example. + +SPHS operates by pumping water into dammed, river-adjacent reservoirs when water flow is high but power demand is low. Water is then allowed to flow out of the reservoir, through turbines—similar to hydroelectric—when energy demand increases. Electricity is thus created. The group, in a [press release][5] related to a study just released, says the technique is highly economical, even including required land purchases, excavation and tunneling. + +### Nighttime, anti-solar cells + +Contrary to popular belief, photovoltaic solar panels don't actually need full sun to function. Cloud cover allows some to work just fine, just not as well. Nighttime photovoltaic, however, is something more radical: + +The earth should be used as a heat source, and the night sky a heat sink, say Jeremy Munday and Tristan Deppe of the department of electrical and computer engineering at University of California, Davis. They shared their idea for nighttime photovoltaic cells in an [abstract of a paper][6] published by American Chemical Society's ACS Photonics. + +What they are suggesting is using thermoradiative photovoltaics, where deep space radiative cooling ([which I’ve written about before][7]) is combined with photovoltaics. Current is created as infrared light – or heat, in other words – is radiated into extremely cold, deep space. + +"Similar to the way a normal solar cell works, but in reverse," Munday says of their anti-solar panel concept, quoted in a [UC Davis news article][8].  + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3529893/seawater-humidity-inspire-new-ways-to-generate-power.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/newsletters/signup.html +[2]: https://www.sdu.dk/en/nyheder/Forskningsnyheder/skal_fremtidens_superbatterier_laves_af_havvand +[3]: https://www.nature.com/articles/s41586-020-2010-9 +[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[5]: https://iiasa.ac.at/web/home/about/news/200219-seasonal-pumped-storage.html +[6]: https://pubs.acs.org/toc/apchd5/7/1 +[7]: https://www.networkworld.com/article/3222850/space-radiated-cooling-cuts-power-use-21.html +[8]: https://www.ucdavis.edu/news/anti-solar-cells-photovoltaic-cell-works-night +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From 2be87fcfdcca73633cc7878507786f3fed6043c8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 5 Mar 2020 08:26:00 +0800 Subject: [PATCH 291/315] translated --- ...w to Add New Brushes in GIMP -Quick Tip.md | 105 ------------------ ...w to Add New Brushes in GIMP -Quick Tip.md | 105 ++++++++++++++++++ 2 files changed, 105 insertions(+), 105 deletions(-) delete mode 100644 sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md create mode 100644 translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md diff --git a/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md b/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md deleted file mode 100644 index 6a93204805..0000000000 --- a/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md +++ /dev/null @@ -1,105 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Add New Brushes in GIMP [Quick Tip]) -[#]: via: (https://itsfoss.com/add-brushes-gimp/) -[#]: author: (Community https://itsfoss.com/author/itsfoss/) - -How to Add New Brushes in GIMP [Quick Tip] -====== - -[GIMP][1], is the most popular free and open-source image editor and perhaps the best [Adobe Photoshop alternative][2] on Linux. - -When you [install GIMP on Ubuntu][3] or any other operating system, you’ll find a few brushes already installed for basic image editing. If you need something more specific, you can always add new brushes in GIMP. - -How? Let me show you that in this quick tutorial. - -### How to add brushes in GIMP - -![][4] - -There are three steps involved in installing new brushes in GIMP: - - * Get new brush - * Put it in the designated folder - * Refresh the brushes in GIMP - - - -#### Step 1: Download new GIMP brushes - -The first step is to get new brushes for GIMP. Where do you get it from? From the internet, of course. - -You can search on Google or [alternative private search engines like Duck Duck Go][5] for ‘GIMP brushes’ and download the ones you like from a reputed website. - -GIMP brushes are usually available in .gbr and .gih file formats. The .gbr file is for regular brushes while .gih is used for animated brushes. - -Did you know? - -For the versions 2.4 and above, GIMP makes installing and using Photoshop brushes (.abr file) quite straightforward. All you need to do is place the Photoshop brush files in the proper folder. -Do keep in mind that the latest Photoshop brushes might not work with GIMP flawlessly. - -#### Step 2: Copy the new brushes into its location - -After you get your brush file, the next step is to copy and paste it to the right folder in GIMP configuration directory. - -On **Windows**, you’ll have to go to a folder like “**C:\Documents and Settings\myusername.gimp-2.10\brushes**“. - -I’ll show detailed steps for **Linux** because It’s FOSS is a Linux-focused website. - -After selecting the brush files press **Ctrl+h** in your **Home** folder to [see hidden files in Linux][6]. - -![Press Ctrl+H to see hidden files in the home directory][7] - -You should go to **.config/GIMP/2.10/brushes** folder (if you are using GIMP version 2.10). If you are using some other version, you should see an equivalent folder under .config/GIMP. - -![Adding New Brushes in GIMP][8] - -Paste the brush files in this folder. Optionally, you can hide the hidden files by pressing **Ctrl+h** again. - -#### Step 3: Refresh the brushes (to avoid restarting GIMP) - -GIMP will automatically load brushes when it’s launched. If you are already running it and don’t want to close it, you can refresh the brushes. - -In GIMP go to **Windows**->**Dockable Dialogues**->**Brushes** in the main menu. - -![Refresh GIMP Brushes by going go to Windows->Dockable Dialogues-> Brushes][9] - -Locate the **refresh** icon in the **Brushes** dialog on the right side bar. - -![Refresh GIMP Brushes][10] - -If your brushes are not present, you can always try to restart GIMP. - -Bonus Tip! - -Adding new brushes in [GIMP also allows you easily watermark images][11]. Just use your logo as a brush and add it to the images in a single click. - -I hope you enjoyed this quick GIMP tip. Stay tuned for more. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/add-brushes-gimp/ - -作者:[Community][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/itsfoss/ -[b]: https://github.com/lujun9972 -[1]: https://www.gimp.org/ -[2]: https://itsfoss.com/open-source-photoshop-alternatives/ -[3]: https://itsfoss.com/gimp-2-10-release/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Install-New-Brushes-in-GIMP.jpg?ssl=1 -[5]: https://itsfoss.com/privacy-search-engines/ -[6]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/adding-brushes-GIMP-1.jpg?ssl=1 -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/adding-brushes-GIMP.png?ssl=1 -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Refresh-GIMP-Brushes.jpg?ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Refresh-GIMP-Brushes-2.jpg?ssl=1 -[11]: https://itsfoss.com/add-watermark-gimp-linux/ diff --git a/translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md b/translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md new file mode 100644 index 0000000000..1e43b2bc71 --- /dev/null +++ b/translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Add New Brushes in GIMP [Quick Tip]) +[#]: via: (https://itsfoss.com/add-brushes-gimp/) +[#]: author: (Community https://itsfoss.com/author/itsfoss/) + +如何在 GIMP 中添加新画笔(快速技巧) +====== + +[GIMP][1] 是最流行的免费和开源图像编辑器,它也许是 Linux 上最好的 [Adobe Photoshop 替代品][2]。 + +当你[在 Ubuntu 或其他任何操作系统上安装了 GIMP 后][3],你会发现已经安装了一些用于基本图像编辑的画笔。如果你需要更具体的画笔,你可以随时在 GIMP 中添加新画笔。 + +怎么样?让我在这个快速教程中向你展示。 + +### 如何在 GIMP 中添加画笔 + +![][4] + +在 GIMP 中安装新画笔需要三个步骤: + + * 获取新画笔 + * 将其放入指定的文件夹中 + * 刷新 GIMP 中的画笔 + + + +#### 步骤 1:下载新的 GIMP 画笔 + +第一步是获取新的 GIMP 画笔。你从哪里获取?当然是从互联网上。 + +你可以在 Google 或[隐私搜索引擎,如 Duck Duck Go][5] 种搜索 “GIMP画笔”,并从网站下载一个你喜欢的。 + +GIMP 画笔通常以 .gbr 和 .gih 文件格式提供。.gbr 文件用于常规画笔,而 .gih 用于动画画笔。 + +你知道吗? + +从 2.4 版本起,GIMP 使安装和使用 Photoshop 画笔(.abr 文件)非常简单。你只需将 Photoshop 画笔文件放在正确的文件夹中。 +请记住,最新的 Photoshop 画笔可能无法完美地在 GIMP 中使用。 + +#### 步骤 2:将新画笔复制到它的位置 + +获取画笔文件后,下一步是复制该文件并将其粘贴到 GIMP 配置目录中所在的文件夹。 + +在 **Windows** 上,你必须进入类似 “**C:\Documents and Settings\myusername.gimp-2.10\brushes**” 这样的文件夹。 + +我将展示 **Linux** 上的详细步骤,因为 It’s FOSS 是一个专注于 Linux 的网站。 + +选择画笔文件后,在 **Home** 目录中按下 **Ctrl+h** [查看 Linux 中的隐藏文件][6]。 + +![Press Ctrl+H to see hidden files in the home directory][7] + +你应该进入 **.config/GIMP/2.10/brushes** 文件夹(如果你使用的是 GIMP 2.10)。如果使用其他版本,那么应在 .config/GIMP 下看到相应文件夹。 + +![Adding New Brushes in GIMP][8] + +将画笔文件粘贴到此文件夹中。可选地,你可以通过再次按 **Ctrl+h** 来隐藏隐藏的文件。 + +#### 步骤 3:刷新画笔(避免重启 GIMP) + +GIMP 将在启动时自动加载画笔。如果已在运行,并且不想关闭它,你可以刷新画笔。 + +在 GIMP 的主菜单中找到 **Windows**->**Dockable Dialogues**->**Brushes**。 + +![Refresh GIMP Brushes by going go to Windows->Dockable Dialogues-> Brushes][9] + +在右侧栏的 **Brushes** 对话框中找到**刷新**图标。 + +![Refresh GIMP Brushes][10] + +如果你的画笔没有出现,那么你可以试试重启 GIMP。 + +额外的技巧! + +在 [GIMP 中添加新画笔还能让你轻松给图片添加水印][11]。只需将 logo 用作画笔,并点击一下就可添加到图片中。 + +我希望你喜欢这个快速 GIMP 技巧。敬请期待更多。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/add-brushes-gimp/ + +作者:[Community][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://itsfoss.com/author/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://www.gimp.org/ +[2]: https://itsfoss.com/open-source-photoshop-alternatives/ +[3]: https://itsfoss.com/gimp-2-10-release/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Install-New-Brushes-in-GIMP.jpg?ssl=1 +[5]: https://itsfoss.com/privacy-search-engines/ +[6]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/adding-brushes-GIMP-1.jpg?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/adding-brushes-GIMP.png?ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Refresh-GIMP-Brushes.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Refresh-GIMP-Brushes-2.jpg?ssl=1 +[11]: https://itsfoss.com/add-watermark-gimp-linux/ From 785572ee1b12fe309ffd4bbc969989fe83cde4a8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 5 Mar 2020 08:37:11 +0800 Subject: [PATCH 292/315] translating --- ... an open source scientific calculator for your smartphone.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md b/sources/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md index 32d467465a..b69120beaa 100644 --- a/sources/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md +++ b/sources/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From fdbde56c54955e14cee2b608135200a577d6e7da Mon Sep 17 00:00:00 2001 From: qianmingtian <40565099+qianmingtian@users.noreply.github.com> Date: Thu, 5 Mar 2020 09:15:05 +0800 Subject: [PATCH 293/315] Translating by qianmingtian --- .../tech/20200305 Install and Use Wireshark on Ubuntu Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md b/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md index 3b0a4f6468..b1f3b76e2b 100644 --- a/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md +++ b/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qianmingtian) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 167fc66be563afadc2e3998cdc67ea579104be1c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 5 Mar 2020 09:42:08 +0800 Subject: [PATCH 294/315] PRF @geekpi --- ...hing- Open Source P2P File Syncing Tool.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md b/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md index 013a3569a4..0905f1aa3f 100644 --- a/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md +++ b/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Syncthing: Open Source P2P File Syncing Tool) @@ -10,11 +10,11 @@ Syncthing:开源 P2P 文件同步工具 ====== -_ **简介:Syncthing 是一个开源的 P2P 文件同步工具,可用于在多个设备(包括 Android 手机)之间同步文件。** _ +> Syncthing 是一个开源的 P2P 文件同步工具,可用于在多个设备(包括 Android 手机)之间同步文件。 -通常,我们有 [MEGA][1] 或 Dropbox 之类的云同步解决方案,以便在云上备份我们的文件,同时更易于共享。 +![](https://img.linux.net.cn/data/attachment/album/202003/05/094211oy2dosttvoaseovk.jpg) -但是,如果要跨多个设备同步文件而不将其存储在云中怎么办? +通常,我们有 [MEGA][1] 或 Dropbox 之类的云同步解决方案,以便在云上备份我们的文件,同时更易于共享。但是,如果要跨多个设备同步文件而不将其存储在云中怎么办? 这就是 [Syncthing][2] 派上用场的地方了。 @@ -22,7 +22,7 @@ _ **简介:Syncthing 是一个开源的 P2P 文件同步工具,可用于在 ![][3] -Syncthing 可让你跨多个设备同步文件(包括对 Android 智能手机的支持)。它主要通过 Linux上 的 Web UI 进行工作,但也提供了 GUI(需要单独安装)。 +Syncthing 可让你跨多个设备同步文件(包括对 Android 智能手机的支持)。它主要通过 Linux 上的 Web UI 进行工作,但也提供了 GUI(需要单独安装)。 然而,Syncthing 完全没有利用云,它是 [P2P][4] 文件同步工具。你的数据不会被发送到中央服务器。而是会在所有设备之间同步。因此,它并不能真正取代 [Linux 上的典型云存储服务][5]。 @@ -36,7 +36,7 @@ Syncthing 可让你跨多个设备同步文件(包括对 Android 智能手机 例如,你可能不想在云上存储一些敏感文件,因此你可以添加其他受信任的设备来同步并保留这些文件的副本。 -即使我简单描述了它,但它并不像看到的那么简单。如果你感兴趣的话,我建议你阅读[官方 FAQ][7] 来了解它如何工作的。 +即使我对它的描述很简单,但它并不像看到的那么简单。如果你感兴趣的话,我建议你阅读[官方 FAQ][7] 来了解它如何工作的。 ### Syncthing 的特性 @@ -90,15 +90,15 @@ Syncthing 确实非常简单且易于理解。即使这样,如果你想使用 你可能无法在软件中心找到它(如果你找到了,那它可能不是最新版本)。 -**注意:**_如果你需要一个 GUI 而不是浏览器来管理它,它还有一个 [Syncthing-GTK][16]。_ +**注意:**如果你需要一个 GUI 应用而不是浏览器来管理它,它还有一个 [Syncthing-GTK][16]。 -[Syncthing][2] +- [Syncthing][2] -如果你有基于 Debian 的发行版,你也可以利用终端来安装它,这些说明位于[官方下载页面][17] 上。 +如果你有基于 Debian 的发行版,你也可以利用终端来安装它,这些说明位于[官方下载页面][17]上。 ### 我在 Syncthing 方面的体验 -就个人而言,我把它安装在 Pop!\_OS 19.10 上,并在写这篇文章之前用了一会儿。 +就个人而言,我把它安装在 Pop!_OS 19.10 上,并在写这篇文章之前用了一会儿。 我尝试同步文件夹、删除它们、添加重复文件以查看文件版本控制是否工作,等等。它工作良好。 @@ -108,7 +108,7 @@ Syncthing 确实非常简单且易于理解。即使这样,如果你想使用 总体而言,它工作良好,但我必须说,你不应该依赖它作为唯一的数据备份方案。 -**总结** +### 总结 你试过 Syncthing 了吗?如果有的话,你的体验如何?欢迎在下面的评论中分享。 @@ -121,7 +121,7 @@ via: https://itsfoss.com/syncthing/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 06e8186da15eb1d33a2020f08855d0cc5542299c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 5 Mar 2020 09:44:51 +0800 Subject: [PATCH 295/315] PUB @geekpi https://linux.cn/article-11960-1.html --- .../20200121 Syncthing- Open Source P2P File Syncing Tool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200121 Syncthing- Open Source P2P File Syncing Tool.md (98%) diff --git a/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md b/published/20200121 Syncthing- Open Source P2P File Syncing Tool.md similarity index 98% rename from translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md rename to published/20200121 Syncthing- Open Source P2P File Syncing Tool.md index 0905f1aa3f..383fc2f351 100644 --- a/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md +++ b/published/20200121 Syncthing- Open Source P2P File Syncing Tool.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11960-1.html) [#]: subject: (Syncthing: Open Source P2P File Syncing Tool) [#]: via: (https://itsfoss.com/syncthing/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 6a3c2a7534b5754cca8c90b74e46a7df0c6ae5e6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 5 Mar 2020 10:18:15 +0800 Subject: [PATCH 296/315] PRF @wxy --- ...ource productivity tools on my wishlist.md | 45 ++++++++++++++----- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/translated/tech/20200130 4 open source productivity tools on my wishlist.md b/translated/tech/20200130 4 open source productivity tools on my wishlist.md index eaebf35f1d..7570c78433 100644 --- a/translated/tech/20200130 4 open source productivity tools on my wishlist.md +++ b/translated/tech/20200130 4 open source productivity tools on my wishlist.md @@ -1,30 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (4 open source productivity tools on my wishlist) [#]: via: (https://opensource.com/article/20/1/open-source-productivity-tools) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) -我的愿望清单上的 4 个开源生产力工具 +我的愿望清单上的 4 种开源生产力工具 ====== -> 在 2020 年用开源实现更高生产力的二十种方式的最后一篇文章中,了解开源世界需要做什么。 +> 在 2020 年用开源实现更高生产力的二十种方式的最后一篇文章中,了解开源世界还需要什么。 -![Two diverse hands holding a globe][1] +![](https://img.linux.net.cn/data/attachment/album/202003/05/100642k52u7oydcwnc1c2w.jpg) 去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 -### 不过… +### 然而… -在搜索生产力应用程序时,我找不到想要的一切应用,而且几乎总是会丢失一些读者与我分享的精彩内容。 因此,当我结束本系列文章时,是时候[再次][2]谈论我在本年度系列文章中未能涵盖的一些主题。 +在搜索生产力应用程序时,我找不到想要的所有应用,而且几乎总是会丢失一些读者与我分享的精彩内容。 因此,当我结束本系列文章时,是时候[再次][2]谈论我在本年度系列文章中未能涵盖的一些主题。 ![Desktop with Joplin, Emacs, and Firefox][3] #### 在 Vim 中聊天 -我试过了。我真的非常非常想能够在 Vim 中聊天,但我做不到。我找到的一个软件包 [VimIRC.vim][4] 一直就工作不起来,我试了几天也没用。我探索的另一个选项是 [Irc it][5],这需要我付出更多的[努力去设置][6],超过了我正常可以付出的耐心或时间。我尝试过了,也确实做到了,但对于同处于相同境地的 Vim 用户,对不起,我无法帮到你。 +我试过了。我真的非常、非常想能够在 Vim 中聊天,但我做不到。我找到的一个软件包 [VimIRC.vim][4] 一直就工作不起来,我试了几天也没用。我探索的另一个选项是 [Irc it][5],这需要我付出更多的[努力去设置][6],超过了我正常可以付出的耐心或时间。我尝试过了,也确实做到了,但对于同处于相同境地的 Vim 用户,对不起,我无法帮到你。 #### Org 模式 @@ -36,15 +36,38 @@ #### 图形用户界面程序 -在 2019 年的生产力系列中,我共享了很多图形用户界面程序,而今年几乎都是命令行应用程序。有一些很棒的图形程序可以帮助解决我今年谈论的一些问题,例如可以使用 Maildir 邮箱的[邮件][12]程序、用于读取本地日历文件的日历程序、[天气][13]应用程序等等。我甚至尝试了几项对我而言新奇的事物,看它们是否适合这个主题。除了 [twin][14] 之外,我没有感觉到有什么图形用户界面程序是新颖的(对我而言)或值得注意的(同样对我而言)今年要写的。至于…… +在 2019 年的生产力系列中,我共享了很多图形用户界面程序,而今年几乎都是命令行应用程序。有一些很棒的图形程序可以帮助解决我今年谈论的一些问题,例如可以使用 Maildir 邮箱的[邮件][12]程序、用于读取本地日历文件的日历程序、[天气][13]应用程序等等。我甚至尝试了几项对我而言新奇的事物,看它们是否适合这个主题。除了 [twin][14] 之外,我没有感觉到有什么图形用户界面程序是新颖的(对我而言)或值得注意的(同样对我而言)是今年要写的。至于…… #### 移动应用程序 -越来越多的人将平板电脑(有时与笔记本电脑结合使用)作为主要设备。我将手机用于大多数社交媒体和即时消息传递,并且经常使用平板电脑(好的,老实说,好几个平板电脑)来阅读或浏览网络。可以肯定的是,并不是开源移动应用程序不存在,但是它们与我今年的主题不符。开源和移动应用程序正在发生很多变化,我正在仔细地寻找可以帮助我在手机和平板电脑上提高工作效率的事物。 +越来越多的人将平板电脑(有时与笔记本电脑结合使用)作为主要设备。我将手机用于大多数社交媒体和即时消息传递,并且经常使用平板电脑(好的,老实说,好几个平板电脑)来阅读或浏览网络。可以肯定的是,并不是没有开源移动应用程序,但是它们与我今年的主题不符。开源和移动应用程序正在发生很多变化,我正在仔细地寻找可以帮助我在手机和平板电脑上提高工作效率的事物。 ### 该你了 -非常感谢你阅读今年的系列文章。请你发表评论,告诉我错过的或需要在 2021 年看到的内容。正如我在 [Productivity Alchemy] [15] 播客上所说:“哥们,记着:保持生产力!” +非常感谢你阅读今年的系列文章。请你发表评论,告诉我错过的或需要在 2021 年看到的内容。正如我在 [Productivity Alchemy][15] 播客上所说:“哥们,记着:要保持生产力!” + +### 本系列汇总 + +1. [使用 Syncthing 在多个设备间同步文件](https://linux.cn/article-11793-1.html) +2. [使用 Stow 管理多台机器配置](https://linux.cn/article-11796-1.html) +3. [使用 OfflineIMAP 同步邮件](https://linux.cn/article-11804-1.html) +4. [使用 Notmuch 组织你的邮件](https://linux.cn/article-11807-1.html) +5. [使用 khal 和 vdirsyncer 组织和同步你的日历](https://linux.cn/article-11812-1.html) +6. [用于联系人管理的三个开源工具](https://linux.cn/article-11834-1.html) +7. [开始使用开源待办事项清单管理器](https://linux.cn/article-11835-1.html) +8. [使用这个 Python 程序记录你的活动](https://linux.cn/article-11846-1.html) +9. [一个通过 IRC 管理所有聊天的开源聊天工具](https://linux.cn/article-11856-1.html) +10. [使用这个 Twitter 客户端在 Linux 终端中发推特](https://linux.cn/article-11858-1.html) +11. [在 Linux 终端中阅读 Reddit](https://linux.cn/article-11869-1.html) +12. [使用此开源工具在一起收取你的 RSS 订阅源和播客](https://linux.cn/article-11876-1.html) +13. [使用这个开源工具获取本地天气预报](https://linux.cn/article-11879-1.html) +14. [使用此开源窗口环境一次运行多个控制台](https://linux.cn/article-11892-1.html) +15. [使用 tmux 创建你的梦想主控台](https://linux.cn/article-11900-1.html) +16. [使用 Vim 发送邮件和检查日历](https://linux.cn/article-11908-1.html) +17. [使用 Vim 管理任务列表和访问 Reddit 和 Twitter](https://linux.cn/article-11912-1.html) +18. [使用 Emacs 发送电子邮件和检查日历](https://linux.cn/article-11932-1.html) +19. [使用 Emacs 进行社交并跟踪你的待办事项列表](https://linux.cn/article-11956-1.html) +20. [我的愿望清单上的 4 种开源生产力工具](https://linux.cn/article-11961-1.html) -------------------------------------------------------------------------------- @@ -53,7 +76,7 @@ via: https://opensource.com/article/20/1/open-source-productivity-tools 作者:[Kevin Sonney][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 48849f6708f7dd121d1ad26ad5438a879d31a027 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 5 Mar 2020 10:18:44 +0800 Subject: [PATCH 297/315] PUB @wxy https://linux.cn/article-11961-1.html --- ...0200130 4 open source productivity tools on my wishlist.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200130 4 open source productivity tools on my wishlist.md (98%) diff --git a/translated/tech/20200130 4 open source productivity tools on my wishlist.md b/published/20200130 4 open source productivity tools on my wishlist.md similarity index 98% rename from translated/tech/20200130 4 open source productivity tools on my wishlist.md rename to published/20200130 4 open source productivity tools on my wishlist.md index 7570c78433..533247844b 100644 --- a/translated/tech/20200130 4 open source productivity tools on my wishlist.md +++ b/published/20200130 4 open source productivity tools on my wishlist.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11961-1.html) [#]: subject: (4 open source productivity tools on my wishlist) [#]: via: (https://opensource.com/article/20/1/open-source-productivity-tools) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From 22ec776fbb6af45f69863ef820b4cf96230584ed Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 5 Mar 2020 16:37:46 +0800 Subject: [PATCH 298/315] APL --- ...0303 Getting started with the Rust package manager, Cargo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md b/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md index d77410b904..9d3429f1bd 100644 --- a/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md +++ b/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 792460af0e4bd1846de1970d8cf85b046f43c74f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 5 Mar 2020 18:23:10 +0800 Subject: [PATCH 299/315] TSL --- ...ed with the Rust package manager, Cargo.md | 607 ------------------ ...ed with the Rust package manager, Cargo.md | 561 ++++++++++++++++ 2 files changed, 561 insertions(+), 607 deletions(-) delete mode 100644 sources/tech/20200303 Getting started with the Rust package manager, Cargo.md create mode 100644 translated/tech/20200303 Getting started with the Rust package manager, Cargo.md diff --git a/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md b/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md deleted file mode 100644 index 9d3429f1bd..0000000000 --- a/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md +++ /dev/null @@ -1,607 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting started with the Rust package manager, Cargo) -[#]: via: (https://opensource.com/article/20/3/rust-cargo) -[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) - -Getting started with the Rust package manager, Cargo -====== -Get to know Rust's package manager and build tool. -![Shipping containers stacked in a yard][1] - -[Rust][2] is a modern programming language that provides performance, reliability, and productivity. It has consistently been voted as the [most-loved language][3] on StackOverflow surveys for a few years now. - -In addition to being a great programming language, Rust also features a build system and package manager called Cargo. Cargo handles a lot of tasks, like building code, downloading libraries or dependencies, and so on. The two are bundled together, so you get Cargo when you install Rust. - -### Installing Rust and Cargo - -Before getting started, you need to install Rust and Cargo. The Rust project provides a downloadable script to handle the installation. To get the script, open a browser to [https://sh.rustup.rs][4] and save the file. Read the script to make sure you're happy with what it intends to do, and then run it: - - -``` -`$ sh ./rustup.rs` -``` - -You can also refer to the [Install Rust][5] webpage for more information. - -After installing Rust and Cargo, you must source the env file: - - -``` -`$ source $HOME/.cargo/env` -``` - -Better yet, add the required directory to your PATH variable: - - -``` -`$ source $HOME/.cargo/env` -``` - -If you prefer to use your package manager (such as DNF or Apt on Linux), look for Rust and Cargo packages in your distribution's repositories and install accordingly. For example: - - -``` -`$ dnf install rust cargo` -``` - -Once they're installed and set up, verify which versions of Rust and Cargo you have: - - -``` -$ rustc --version -rustc 1.41.0 (5e1a79984 2020-01-27) -$ cargo --version -cargo 1.41.0 (626f0f40e 2019-12-03) -``` - -### Building and running Rust by hand - -Start with a simple program that prints "Hello, world!" on the screen. Open your favorite text editor and type the following program: - - -``` -$ cat hello.rs -fn main() { -    println!("Hello, world!"); -} -``` - -Save the file with an **.rs** extension to identify it as a Rust source code file. - -Compile your program using the Rust compiler, **rustc**: - - -``` -`$ rustc hello.rs` -``` - -After compilation, you will have a binary that has the same name as the source program: - - -``` -$ ls -l -total 2592 --rwxr-xr-x. 1 user group 2647944 Feb 13 14:14 hello --rw-r--r--. 1 user group      45 Feb 13 14:14 hello.rs -$ -``` - -Execute your program to verify that it runs as expected: - - -``` -$ ./hello -Hello, world! -``` - -These steps are sufficient for smaller programs or whenever you want to test out something quickly. However, when working on bigger programs involving multiple people, Cargo is the best way forward. - -### Creating a new package using Cargo - -Cargo is a build system and package manager for Rust. It helps developers download and manage dependencies and assists in creating Rust packages. Packages in Rust are often called "crates" in the Rust community, but in this article, the two words are interchangeable. Refer to the Cargo [FAQ][6] provided by the Rust community for clarification. - -If you need any help with Cargo's command-line utility, use the **\--help** or **-h** command-line argument: - - -``` -`$ cargo –help` -``` - -To create a new package, use the **new** keyword, followed by the package name. For this example, use **hello_opensource** as your new package name. After running the command, you will see a message confirming that Cargo has created a binary package with the given name: - - -``` -$ cargo new hello_opensource -     Created binary (application) `hello_opensource` package -``` - -Running a **tree** command to see the directory structure reports that some files and directories were created. First, it creates a directory with the name of the package, and within that directory is an **src** directory for your source code files: - - -``` -$ tree . -. -└── hello_opensource -    ├── Cargo.toml -    └── src -        └── main.rs - -2 directories, 2 files -``` - -Cargo not only creates a package, but it also creates a simple **Hello, world!** program. Open the **main.rs** file and have a look: - - -``` -$ cat hello_opensource/src/main.rs -fn main() { -    println!("Hello, world!"); -} -``` - -The next file to work with is **Cargo.toml**, which is a configuration file for your package. It contains information about the package, such as its name, version, author information, and Rust edition information. - -A program often depends on external libraries or dependencies to run, which enables you to write applications that perform tasks that you don't know how to code or you don't want to spend time coding. All your dependencies will be listed in this file. At this point, you do not have any dependencies for your new program. Open the **Cargo.toml** file and view its contents: - - -``` -$ cat hello_opensource/Cargo.toml -[package] -name = "hello_opensource" -version = "0.1.0" -authors = ["user <[user@mail.com][7]>"] -edition = "2018" - -# See more keys and their definitions at - -[dependencies] -``` - -### Building the program using Cargo - -So far, so good. Now that you have a package in place, build a binary (also called an executable). Before doing that, move into the package directory: - - -``` -`$ cd hello_opensource/` -``` - -You can use Cargo's **build** command to build the package. Notice the messages that say it is **Compiling** your program: - - -``` -$ cargo build -   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished dev [unoptimized + debuginfo] target(s) in 0.38s -``` - -Check what happens to your project directory after you run the **build** command: - - -``` -$ tree . -. -├── Cargo.lock -├── Cargo.toml -├── src -│   └── main.rs -└── target -    └── debug -        ├── build -        ├── deps -        │   ├── hello_opensource-147b8a0f466515dd -        │   └── hello_opensource-147b8a0f466515dd.d -        ├── examples -        ├── hello_opensource -        ├── hello_opensource.d -        └── incremental -            └── hello_opensource-3pouh4i8ttpvz -                ├── s-fkmhjmt8tj-x962ep-1hivstog8wvf -                │   ├── 1r37g6m45p8rx66m.o -                │   ├── 2469ykny0eqo592v.o -                │   ├── 2g5i2x8ie8zed30i.o -                │   ├── 2yrvd7azhgjog6zy.o -                │   ├── 3g9rrdr4hyk76jtd.o -                │   ├── dep-graph.bin -                │   ├── query-cache.bin -                │   ├── work-products.bin -                │   └── wqif2s56aj0qtct.o -                └── s-fkmhjmt8tj-x962ep.lock - -9 directories, 17 files -``` - -Wow! The compilations process produced a lot of intermediate files. Your binary, though, is saved in the **./target/debug** directory with the same name as your package. - -### Running your application using Cargo - -Now that your binary is built, run it using Cargo's **run** command. As expected, it prints **Hello, world!** on the screen. - - -``` -$ cargo run -    Finished dev [unoptimized + debuginfo] target(s) in 0.01s -     Running `target/debug/hello_opensource` -Hello, world! -``` - -Alternatively, you can run the binary directly, which is located at: - - -``` -$ ls -l ./target/debug/hello_opensource --rwxr-xr-x. 2 root root 2655552 Feb 13 14:19 ./target/debug/hello_opensource -``` - -As expected, it produces the same results: - - -``` -$ ./target/debug/hello_opensource -Hello, world! -``` - -Say you need to rebuild your package and get rid of all the binaries and the intermediate files created by the earlier compilation process. Cargo provides a handy **clean** option to remove all intermediate files except the source code and other required files: - - -``` -$ cargo clean -$ tree . -. -├── Cargo.lock -├── Cargo.toml -└── src -    └── main.rs - -1 directory, 3 files -``` - -Make some changes to the program and run it again to see how it works. For example, this minor change adds **Opensource** to the **Hello, world!** string: - - -``` -$ cat src/main.rs -fn main() { -    println!("Hello, Opensource world!"); -} -``` - -Now, build the program and run it again. This time you see **Hello, Opensource world!** displayed on the screen: - - -``` -$ cargo build -   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished dev [unoptimized + debuginfo] target(s) in 0.39s - -$ cargo run -    Finished dev [unoptimized + debuginfo] target(s) in 0.01s -     Running `target/debug/hello_opensource` -Hello, Opensource world! -``` - -### Adding dependencies using Cargo - -Cargo allows you to add dependencies that your program needs to run. Adding a dependency is extremely easy with Cargo. Every Rust package includes a **Cargo.toml** file, which contains a list (empty by default) of dependencies. Open the file in your favorite text editor, find the **[dependencies]** section, and add the library you want to include in your package. For example, to add the **rand** library as your dependency: - - -``` -$ cat Cargo.toml -[package] -name = "hello_opensource" -version = "0.1.0" -authors = ["test user <[test@mail.com][8]>"] -edition = "2018" - -# See more keys and their definitions at - -[dependencies] -rand = "0.3.14" -``` - -Try building your package to see what happens. - - -``` -$ cargo build -    Updating crates.io index -   Compiling libc v0.2.66 -   Compiling rand v0.4.6 -   Compiling rand v0.3.23 -   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished dev [unoptimized + debuginfo] target(s) in 4.48s -``` - -Cargo is now reaching out to [Crates.io][9], which is Rust's central repository for crates (or packages) and downloading and compiling **rand**. But wait—what about the **libc** package? You did not ask for **libc** to be installed. Well, the **rand** package is dependent on the **libc** package; hence, Cargo downloads and compiles **libc** as well. - -New versions of libraries keep coming, and Cargo provides an easy way to update all of their dependencies using the **update** command: - - -``` -`cargo update` -``` - -You can also choose to update specific libraries using the **-p** flag followed by the package name: - - -``` -`cargo update -p rand` -``` - -### Compiling and running with a single command - -So far, you have used **build** followed by **run** whenever you make changes to your program. There is an easier way: you can simply use the **run** command, which internally compiles and runs the program. To see how it works, first clean up your package directory: - - -``` -$ cargo clean -$ tree . -. -├── Cargo.lock -├── Cargo.toml -└── src -    └── main.rs - -1 directory, 3 files -``` - -Now execute **run**. The output states that it compiled and then ran the program, and this means you don't need to explicitly run **build** each time: - - -``` -$ cargo run -   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished dev [unoptimized + debuginfo] target(s) in 0.41s -     Running `target/debug/hello_opensource` -Hello, world! -``` - -### Checking your code in development - -You often go through multiple iterations when developing a program. You need to ensure that your program has no coding errors and compiles fine. You don't need the overhead of generating the binary on each compilation. Cargo has you covered with a **check** option that compiles your code but skips the final step of generating an executable. - -Start by running **cargo clean** within your package directory: - - -``` -$ tree . -. -├── Cargo.lock -├── Cargo.toml -└── src -    └── main.rs - -1 directory, 3 files -``` - -Now run the **check** command and see what changes were made to the directory: - - -``` -$ cargo check -    Checking hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished dev [unoptimized + debuginfo] target(s) in 0.18s -``` - -The output shows that, even though intermediate files were created as part of the compilation process, the final binary or executable was not created. This saves some time, which matters a lot if the package is huge with thousands of lines of code: - - -``` -$ tree . -. -├── Cargo.lock -├── Cargo.toml -├── src -│   └── main.rs -└── target -    └── debug -        ├── build -        ├── deps -        │   ├── hello_opensource-842d9a06b2b6a19b.d -        │   └── libhello_opensource-842d9a06b2b6a19b.rmeta -        ├── examples -        └── incremental -            └── hello_opensource-1m3f8arxhgo1u -                ├── s-fkmhw18fjk-542o8d-18nukzzq7hpxe -                │   ├── dep-graph.bin -                │   ├── query-cache.bin -                │   └── work-products.bin -                └── s-fkmhw18fjk-542o8d.lock - -9 directories, 9 files -``` - -To see if you are really saving time, time the **build** and **check** commands and compare them. - -First, the **build** command: - - -``` -$ time cargo build -   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished dev [unoptimized + debuginfo] target(s) in 0.40s - -real    0m0.416s -user    0m0.251s -sys     0m0.199s -``` - -Clean the directory before running the **check** command: - - -``` -`$ cargo clean` -``` - -The **check** command: - - -``` -$ time cargo check -    Checking hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished dev [unoptimized + debuginfo] target(s) in 0.15s - -real    0m0.166s -user    0m0.086s -sys     0m0.081s -``` - -Clearly, the **check** command is much faster. - -### Building external Rust packages - -Everything you've done so far will apply to any Rust crate you get from the internet. You simply need to download or clone the repository, move to the package folder, and run the **build** command, and you are good to go: - - -``` -git clone <github-like-url> -cd <package-folder> -cargo build -``` - -### Building optimized Rust programs using Cargo - -You've run **build** multiple times so far, but did you notice its output? No worries, build it again and watch closely: - - -``` -$ cargo build -   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished dev [unoptimized + debuginfo] target(s) in 0.36s -``` - -See the **[unoptimized + debuginfo]** text after each compilation? This means that the binary generated by Cargo includes a lot of debugging information and is not optimized for execution. Developers often go through multiple iterations of development and need this debugging information for analysis. Also, performance is not the immediate goal while developing software. Therefore, this is OK for now. - -However, once the software is ready for release, it doesn't need to have the debugging information anymore. But it does need to be optimized for best performance. In the final stages of development, you can use the **\--release** flag with **build**. Watch closely; you should see the **[optimized]** text after compilation: - - -``` -$ cargo build --release -   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished release [optimized] target(s) in 0.29s -``` - -If you want to, you can go through the exercise to find out your time savings when running optimized vs. unoptimized software. - -### Creating a library vs. a binary using Cargo - -Any software program can be roughly categorized as either a standalone binary or a library. A standalone binary can be run as it is, even though it might make use of external libraries. A library, however, is utilized by another standalone binary. All the programs you've built so far in this tutorial are standalone binaries since that is Cargo's default. To create a **library**, add the **\--lib** option: - - -``` -$ cargo new --lib libhello -     Created library `libhello` package -``` - -This time, Cargo does not create a **main.rs** file; instead, it creates a **lib.rs** file. The code for your library should go here: - - -``` -$ tree . -. -└── libhello -    ├── Cargo.toml -    └── src -        └── lib.rs - -2 directories, 2 files -``` - -Knowing Cargo, don't be surprised that it put some code in your new library file. Find out what it added by moving to the package directory and viewing the file. By default, Cargo puts a test function within library files. - -### Running tests using Cargo - -Rust provides first-class support for unit and integration testing, and Cargo allows you to execute any of these tests: - - -``` -$ cd libhello/ - -$ cat src/lib.rs -#[cfg(test)] -mod tests { -    #[test] -    fn it_works() { -        assert_eq!(2 + 2, 4); -    } -} -``` - -Cargo has a handy **test** option to run any test that is present in your code. Try running the tests that Cargo put in the library code by default: - - -``` -$ cargo test -   Compiling libhello v0.1.0 (/opensource/libhello) -    Finished test [unoptimized + debuginfo] target(s) in 0.55s -     Running target/debug/deps/libhello-d52e35bb47939653 - -running 1 test -test tests::it_works ... ok - -test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out - -   Doc-tests libhello - -running 0 tests - -test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out -``` - -### Looking under Cargo's hood - -You may be interested in knowing what Cargo does under the hood when you run a command. After all, Cargo is, in many ways, a wrapper. To find out what it's doing, you can use the **-v** option with any Cargo command to output verbose information to the screen. - -Here are a couple of examples that run **build** and **clean** using the **-v** option. - -In the **build** command, you can see that the underlying **rustc** (Rust compiler) fired with the given command-line options: - - -``` -$ cargo build -v -   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) -     Running `rustc --edition=2018 --crate-name hello_opensource src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=147b8a0f466515dd -C extra-filename=-147b8a0f466515dd --out-dir /opensource/hello_opensource/target/debug/deps -C incremental=/opensource/hello_opensource/target/debug/incremental -L dependency=/opensource/hello_opensource/target/debug/deps` -    Finished dev [unoptimized + debuginfo] target(s) in 0.36s -``` - -Whereas the **clean** command shows that it is simply removing the directory that contains the intermediate files and the binary: - - -``` -$ cargo clean -v -    Removing /opensource/hello_opensource/target -``` - -### Don't let your skills get rusty - -To expand your skills, try writing and running a slightly more complex program using Rust and Cargo. Something simple will do: for instance, try listing all files in the current directory (it can be done in nine lines of code), or try echoing input back out at yourself. Small practice applications help you get comfortable with the syntax and the process of writing and testing code. - -This article offers plenty of information for budding Rust programmers to get started with Cargo. However, as you begin working on larger and more complicated programs, you'll need a more advanced understanding of Cargo. When you're ready for more, download and read the open source [Cargo Book][10] written by the Rust team, and see what you can create! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/rust-cargo - -作者:[Gaurav Kamathe][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/gkamathe -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-containers2.png?itok=idd8duC_ (Shipping containers stacked in a yard) -[2]: https://www.rust-lang.org/ -[3]: https://insights.stackoverflow.com/survey/2019#technology-_-most-loved-dreaded-and-wanted-languages -[4]: https://sh.rustup.rs/ -[5]: https://www.rust-lang.org/tools/install -[6]: https://doc.rust-lang.org/cargo/faq.html -[7]: mailto:user@mail.com -[8]: mailto:test@mail.com -[9]: http://crates.io -[10]: https://doc.rust-lang.org/cargo diff --git a/translated/tech/20200303 Getting started with the Rust package manager, Cargo.md b/translated/tech/20200303 Getting started with the Rust package manager, Cargo.md new file mode 100644 index 0000000000..b289dd6f00 --- /dev/null +++ b/translated/tech/20200303 Getting started with the Rust package manager, Cargo.md @@ -0,0 +1,561 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with the Rust package manager, Cargo) +[#]: via: (https://opensource.com/article/20/3/rust-cargo) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) + +Rust 包管理器 Cargo 入门 +====== + +> 了解 Rust 的软件包管理器和构建工具。 + +![Shipping containers stacked in a yard][1] + +[Rust][2] 是一种现代编程语言,可提供高性能、可靠性和生产力。几年来,它一直被 StackOverflow 调查评为[最受欢迎的语言][3]。 + +除了是一种出色的编程语言之外,Rust 还具有一个称为 Cargo 的构建系统和软件包管理器。Cargo 处理许多任务,例如构建代码、下载库或依赖项等等。这两者捆绑在一起,因此在安装 Rust 时会得到 Cargo。 + +### 安装 Rust 和 Cargo + +在开始之前,你需要安装 Rust 和 Cargo。Rust 项目提供了一个可下载的脚本来处理安装。要获取该脚本,请打开浏览器以访问 [https://sh.rustup.rs][4] 并保存该文件。阅读脚本以确保你对它的具体行为有所了解,然后运行它: + +``` +$ sh ./rustup.rs +``` + +你也可以参考这个[安装 Rust][5]网页以获取更多信息。 + +安装 Rust 和 Cargo 之后,你必须获取source `env` 文件: + +``` +$ source $HOME/.cargo/env +``` + +更好的是,将所需目录添加到 `PATH` 环境变量中: + +``` +export PATH=$PATH:~/.cargo/bin +``` + +如果你更喜欢使用软件包管理器(例如 Linux 上的 DNF 或 Apt),请在发行版本的存储库中查找 Rust 和 Cargo 软件包,并进行相应的安装。 例如: + +``` +$ dnf install rust cargo +``` + +安装并设置它们后,请验证你拥有的 Rust 和 Cargo 版本: + +``` +$ rustc --version +rustc 1.41.0 (5e1a79984 2020-01-27) +$ cargo --version +cargo 1.41.0 (626f0f40e 2019-12-03) +``` + +### 手动构建和运行 Rust + +从在屏幕上打印“Hello, world!”的简单程序开始。打开你喜欢的文本编辑器,然后键入以下程序: + +``` +$ cat hello.rs +fn main() { +    println!("Hello, world!"); +} +``` + +以扩展名 `.rs` 保存文件,以将其标识为 Rust 源代码文件。 + +使用 Rust 编译器 `rustc` 编译程序: + +``` +$ rustc hello.rs +``` + +编译后,你将拥有一个与源程序同名的二进制文件: + +``` +$ ls -l +total 2592 +-rwxr-xr-x. 1 user group 2647944 Feb 13 14:14 hello +-rw-r--r--. 1 user group      45 Feb 13 14:14 hello.rs +$ +``` + +执行程序以验证其是否按预期运行: + +``` +$ ./hello +Hello, world! +``` + +这些步骤对于较小的程序或任何你想快速测试的东西就足够了。但是,在进行涉及多人的大型计划时,Cargo 是前进的最佳之路。 + +### 使用 Cargo 创建新包 + +Cargo 是 Rust 的构建系统和包管理器。它可以帮助开发人员下载和管理依赖项,并帮助创建 Rust 包。在Rust 社区中,Rust 中的“包”通常被称为“crate”(板条箱),但是在本文中,这两个词是可以互换的。请参阅 Rust 社区提供的 Cargo [FAQ][6] 来区分。 + +如果你需要有关 Cargo 命令行实用程序的任何帮助,请使用 `--help` 或 `-h` 命令行参数: + +``` +$ cargo –help +``` + +要创建一个新的包,请使用关键字 `new`,跟上包名称。在这个例子中,使用 `hello_opensource` 作为新的包名称。运行该命令后,你将看到一条消息,确认 Cargo 已创建具有给定名称的二进制包: + +``` +$ cargo new hello_opensource +     Created binary (application) `hello_opensource` package +``` + +运行 `tree` 命令以查看目录结构,它会报告已创建了一些文件和目录。首先,它创建一个带有包名称的目录,并且在该目录内有一个存放你的源代码文件的 `src` 目录: + +``` +$ tree . +. +└── hello_opensource +    ├── Cargo.toml +    └── src +        └── main.rs + +2 directories, 2 files +``` + +Cargo 不仅可以创建包,它也创建了一个简单的 “Hello, world” 程序。打开 `main.rs` 文件看看: + +``` +$ cat hello_opensource/src/main.rs +fn main() { +    println!("Hello, world!"); +} +``` + +下一个要处理的文件是 `Cargo.toml`,这是你的包的配置文件。它包含有关包的信息,例如其名称、版本、作者信息和 Rust 版本信息。 + +程序通常依赖于外部库或依赖项来运行,这使你可以编写应用程序来执行不知道如何编码或不想花时间编码的任务。你所有的依赖项都将在此文件中列出。此时,对你的新程序你没有任何依赖关系。打开 `Cargo.toml` 文件并查看其内容: + +``` +$ cat hello_opensource/Cargo.toml +[package] +name = "hello_opensource" +version = "0.1.0" +authors = ["user "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +``` + +### 使用 Cargo 构建程序 + +到目前为止,一切都很顺利。现在你已经有了一个包,可构建一个二进制文件(也称为可执行文件)。在此之前,进入包目录: + +``` +$ cd hello_opensource/ +``` + +你可以使用 Cargo 的 `build` 命令来构建包。注意消息说它正在“编译”你的程序: + +``` +$ cargo build +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.38s +``` + +运行 `build` 命令后,检查项目目录发生了什么: + +``` +$ tree . +. +├── Cargo.lock +├── Cargo.toml +├── src +│   └── main.rs +└── target +    └── debug +        ├── build +        ├── deps +        │   ├── hello_opensource-147b8a0f466515dd +        │   └── hello_opensource-147b8a0f466515dd.d +        ├── examples +        ├── hello_opensource +        ├── hello_opensource.d +        └── incremental +            └── hello_opensource-3pouh4i8ttpvz +                ├── s-fkmhjmt8tj-x962ep-1hivstog8wvf +                │   ├── 1r37g6m45p8rx66m.o +                │   ├── 2469ykny0eqo592v.o +                │   ├── 2g5i2x8ie8zed30i.o +                │   ├── 2yrvd7azhgjog6zy.o +                │   ├── 3g9rrdr4hyk76jtd.o +                │   ├── dep-graph.bin +                │   ├── query-cache.bin +                │   ├── work-products.bin +                │   └── wqif2s56aj0qtct.o +                └── s-fkmhjmt8tj-x962ep.lock + +9 directories, 17 files +``` + +哇!编译过程产生了许多中间文件。另外,你的二进制文件将以与软件包相同的名称保存在 `./target/debug` 目录中。 + +### 使用 Cargo 运行你的应用程序 + +现在你的二进制文件已经构建好了,使用 Cargo 的 `run` 命令运行它。如预期的那样,它将在屏幕上打印 `Hello, world!`。 + +``` +$ cargo run +    Finished dev [unoptimized + debuginfo] target(s) in 0.01s +     Running `target/debug/hello_opensource` +Hello, world! +``` + +或者,你可以直接运行二进制文件,该文件位于: + +``` +$ ls -l ./target/debug/hello_opensource +-rwxr-xr-x. 2 root root 2655552 Feb 13 14:19 ./target/debug/hello_opensource +``` + +如预期的那样,它产生相同的结果: + +``` +$ ./target/debug/hello_opensource +Hello, world! +``` + +假设你需要重建包,并丢弃早期编译过程创建的所有二进制文件和中间文件。Cargo 提供了一个方便的`clean` 选项来删除所有中间文件,但源代码和其他必需文件除外: + +``` +$ cargo clean +$ tree . +. +├── Cargo.lock +├── Cargo.toml +└── src +    └── main.rs + +1 directory, 3 files +``` + +对程序进行一些更改,然后再次运行以查看其工作方式。例如,下面这个较小的更改将 `Opensource` 添加到 `Hello, world!` 字符串中: + +``` +$ cat src/main.rs +fn main() { +    println!("Hello, Opensource world!"); +} +``` + +现在,构建程序并再次运行它。这次,你会在屏幕上看到 `Hello, Opensource world!`: + +``` +$ cargo build +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.39s + +$ cargo run +    Finished dev [unoptimized + debuginfo] target(s) in 0.01s +     Running `target/debug/hello_opensource` +Hello, Opensource world! +``` + +### 使用 Cargo 添加依赖项 + +Cargo 允许你添加程序需要运行的依赖项。使用 Cargo 添加依赖项非常容易。每个 Rust 包都包含一个 `Cargo.toml` 文件,其中包含一个依赖关系列表(默认为空)。用你喜欢的文本编辑器打开该文件,找到 `[dependencies]` 部分,然后添加要包含在包中的库。例如,将 `rand` 库添加为依赖项: + +``` +$ cat Cargo.toml +[package] +name = "hello_opensource" +version = "0.1.0" +authors = ["test user "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rand = "0.3.14" +``` + +试试构建你的包,看看会发生什么。 + +``` +$ cargo build +    Updating crates.io index +   Compiling libc v0.2.66 +   Compiling rand v0.4.6 +   Compiling rand v0.3.23 +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 4.48s +``` + +现在,Cargo 会联系 [Crates.io][9],这是 Rust 用于存储 crate(或包)的中央仓库,并下载和编译 `rand`。但是,等等 —— `libc` 包是怎么回事?你没有要要安装 libc 啊。是的,`rand` 包依赖于 `libc` 包;因此,Cargo 也会下载并编译 `libc`。 + +库的新版本不断涌现,而 Cargo 提供了一种使用 `update` 命令更新其所有依赖关系的简便方法: + +``` +cargo update +``` + +你还可以选择使用 `-p` 标志跟上包名称来更新特定的库: + +``` +cargo update -p rand +``` + +### 使用单个命令进行编译和运行 + +到目前为止,每当对程序进行更改时,都先使用了 `build` 之后是 `run`。有一个更简单的方法:你可以直接使用 `run` 命令,该命令会在内部进行编译并运行该程序。要查看其工作原理,请首先清理你的软件包目录: + +``` +$ cargo clean +$ tree . +. +├── Cargo.lock +├── Cargo.toml +└── src +    └── main.rs + +1 directory, 3 files +``` + +现在执行 `run`。输出信息表明它已进行编译,然后运行了该程序,这意味着你不需要每次都显式地运行 `build`: + +``` +$ cargo run +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.41s +     Running `target/debug/hello_opensource` +Hello, world! +``` + +### 在开发过程中检查代码 + +在开发程序时,你经常会经历多次迭代。你需要确保你的程序没有编码错误并且可以正常编译。你不需要负担在每次编译时生成二进制文件的开销。Cargo 为你提供了一个 `check` 选项,该选项可以编译代码,但跳过了生成可执行文件的最后一步。首先在包目录中运行 `cargo clean`: + +``` +$ tree . +. +├── Cargo.lock +├── Cargo.toml +└── src +    └── main.rs + +1 directory, 3 files +``` + +现在运行 `check` 命令,查看对目录进行了哪些更改: + +``` +$ cargo check +    Checking hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.18s +``` + +该输出显示,即使在编译过程中创建了中间文件,但没有创建最终的二进制文件或可执行文件。这样可以节省一些时间,如果该包包含了数千行代码,这非常重要: + +``` +$ tree . +. +├── Cargo.lock +├── Cargo.toml +├── src +│   └── main.rs +└── target +    └── debug +        ├── build +        ├── deps +        │   ├── hello_opensource-842d9a06b2b6a19b.d +        │   └── libhello_opensource-842d9a06b2b6a19b.rmeta +        ├── examples +        └── incremental +            └── hello_opensource-1m3f8arxhgo1u +                ├── s-fkmhw18fjk-542o8d-18nukzzq7hpxe +                │   ├── dep-graph.bin +                │   ├── query-cache.bin +                │   └── work-products.bin +                └── s-fkmhw18fjk-542o8d.lock + +9 directories, 9 files +``` + +要查看你是否真的节省了时间,请对 `build` 和 `check` 命令进行计时并进行比较。首先,计时 `build` 命令: + +``` +$ time cargo build +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.40s + +real    0m0.416s +user    0m0.251s +sys     0m0.199s +``` + +在运行 `check` 命令之前清理目录: + +``` +$ cargo clean +``` + +计时 `check` 命令: + +``` +$ time cargo check +    Checking hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.15s + +real    0m0.166s +user    0m0.086s +sys     0m0.081s +``` + +显然,`check` 命令要快得多。 + +### 建立外部 Rust 包 + +到目前为止,你所做的这些都可以应用于你从互联网上获得的任何 Rust crate。你只需要下载或克隆存储库,移至包文件夹,然后运行 `build` 命令,就可以了: + +``` +git clone +cd +cargo build +``` + +### 使用 Cargo 构建优化的 Rust 程序 + +到目前为止,你已经多次运行 `build`,但是你注意到它的输出了吗?不用担心,再次构建它并密切注意: + +``` +$ cargo build +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.36s +``` + +看到了每次编译后的 `[unoptimized + debuginfo]` 文本了吗?这意味着 Cargo 生成的二进制文件包含大量调试信息,并且未针对执行进行优化。开发人员经常经历开发的多次迭代,并且需要此调试信息进行分析。同样,性能并不是开发软件时的近期目标。因此,对于现在而言是没问题的。 + +但是,一旦准备好发布软件,就不再需要这些调试信息。而是需要对其进行优化以获得最佳性能。在开发的最后阶段,可以将 `--release` 标志与 `build` 一起使用。仔细看,编译后,你应该会看到 `[optimized]` 文本: + +``` +$ cargo build --release +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished release [optimized] target(s) in 0.29s +``` + +如果愿意,你可以通过这种练习来了解运行优化软件与未优化软件时节省的时间。 + +### 使用 Cargo 创建库还是二进制文件 + +任何软件程序都可以粗略地分类为独立二进制文件或库。一个独立二进制文件也许即使是当中外部库使用的,自身也是可以运行的。但是,作为一个库,是可以被另一个独立二进制文件所利用的。到目前为止,你在本教程中构建的所有程序都是独立二进制文件,因为这是 Cargo 的默认设置。 要创建一个**库**,请添加 `--lib` 选项: + +``` +$ cargo new --lib libhello +     Created library `libhello` package +``` + +这次,Cargo 不会创建 `main.rs` 文件,而是创建一个 `lib.rs` 文件。 你的库的代码应该是这样的: + +``` +$ tree . +. +└── libhello +    ├── Cargo.toml +    └── src +        └── lib.rs + +2 directories, 2 files +``` + +Cargo 就是这样的,不要奇怪,它在你的新库文件中添加了一些代码。通过移至包目录并查看文件来查找添加的内容。默认情况下,Cargo 在库文件中放置一个测试函数。 + +### 使用 Cargo 运行测试 + +Rust 为单元测试和集成测试提供了一流的支持,而 Cargo 允许你执行以下任何测试: + +``` +$ cd libhello/ + +$ cat src/lib.rs +#[cfg(test)] +mod tests { +    #[test] +    fn it_works() { +        assert_eq!(2 + 2, 4); +    } +} +``` + +Cargo 有一个方便的 `test` 命令,可以运行代码中存在的任何测试。尝试默认运行 Cargo 在库代码中放入的测试: + +``` +$ cargo test +   Compiling libhello v0.1.0 (/opensource/libhello) +    Finished test [unoptimized + debuginfo] target(s) in 0.55s +     Running target/debug/deps/libhello-d52e35bb47939653 + +running 1 test +test tests::it_works ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out + +   Doc-tests libhello + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out +``` + +### 深入了解 Cargo 内部 + +你可能有兴趣了解在运行一个 Cargo 命令时它底下发生了什么。毕竟,在许多方面,Cargo 只是个封装器。要了解它在做什么,你可以将 `-v` 选项与任何 Cargo 命令一起使用,以将详细信息输出到屏幕。 + +这是使用 `-v` 选项运行 `build` 和 `clean` 的几个例子。 + +在 `build` 命令中,你可以看到这些给定的命令行选项触发了底层的 `rustc`(Rust编译器): + +``` +$ cargo build -v +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +     Running `rustc --edition=2018 --crate-name hello_opensource src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=147b8a0f466515dd -C extra-filename=-147b8a0f466515dd --out-dir /opensource/hello_opensource/target/debug/deps -C incremental=/opensource/hello_opensource/target/debug/incremental -L dependency=/opensource/hello_opensource/target/debug/deps` +    Finished dev [unoptimized + debuginfo] target(s) in 0.36s +``` + +而 `clean` 命令表明它只是删除包含中间文件和二进制文件的目录: + +``` +$ cargo clean -v +    Removing /opensource/hello_opensource/target +``` + +### 不要让你的技能生锈 + +要扩展你的技能,请尝试使用 Rust 和 Cargo 编写并运行一个稍微复杂的程序。很简单就可以做到:例如,尝试列出当前目录中的所有文件(可以用 9 行代码完成),或者尝试自己回显输入。小型的实践应用程序可帮助你熟悉语法以及编写和测试代码的过程。 + +本文为刚起步的 Rust 程序员提供了大量信息,以使他们可以开始入门 Cargo。但是,当你开始处理更大、更复杂的程序时,你需要对 Cargo 有更深入的了解。当你准备好迎接更多内容时,请下载并阅读 Rust 团队编写的开源《[Cargo 手册][10]》,看看你可以创造什么! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/rust-cargo + +作者:[Gaurav Kamathe][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gkamathe +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-containers2.png?itok=idd8duC_ (Shipping containers stacked in a yard) +[2]: https://www.rust-lang.org/ +[3]: https://insights.stackoverflow.com/survey/2019#technology-_-most-loved-dreaded-and-wanted-languages +[4]: https://sh.rustup.rs/ +[5]: https://www.rust-lang.org/tools/install +[6]: https://doc.rust-lang.org/cargo/faq.html +[7]: mailto:user@mail.com +[8]: mailto:test@mail.com +[9]: http://crates.io +[10]: https://doc.rust-lang.org/cargo From 93c91e2a44ba0545b2eef72e4d30f13c83abdbfc Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Thu, 5 Mar 2020 22:15:55 +0800 Subject: [PATCH 300/315] hankchow translating --- ...rce Private Messenger That Doesn-t Need Your Phone Number.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md b/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md index bc4dece67e..15529537a0 100644 --- a/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md +++ b/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d4e1dd002f90e8a196c5689ed339dd9f343f436f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 6 Mar 2020 00:52:25 +0800 Subject: [PATCH 301/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200306=20Three?= =?UTF-8?q?=20Ways=20to=20Exclude/Hold/Prevent=20a=20Specific=20Package=20?= =?UTF-8?q?from=20an=20apt=20Upgrade?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md --- ... a Specific Package from an apt Upgrade.md | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md diff --git a/sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md b/sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md new file mode 100644 index 0000000000..b4e47fcc36 --- /dev/null +++ b/sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md @@ -0,0 +1,190 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Three Ways to Exclude/Hold/Prevent a Specific Package from an apt Upgrade) +[#]: via: (https://www.2daygeek.com/debian-ubuntu-exclude-hold-prevent-packages-from-apt-get-upgrade/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Three Ways to Exclude/Hold/Prevent a Specific Package from an apt Upgrade +====== + +Sometimes you may accidentally update packages that are not updated due to some application dependency. + +This is always the case during the entire system update or automatic package upgrade process. + +If this happens, it may break the application function. + +This creates a serious problem and you need to spend a lot of time fixing the problem. + +See the following article if you want to **[Exclude Specific Packages from Yum Update][1]** + +How to avoid this kind of situation? + +How do I exclude packages from apt-get update? + +Yes, it can be done using the following three methods on Debian and Ubuntu systems. + + * **[apt-mark Command][2]** + * **[dpkg Command][3]** + * aptitude Command + + + +We will show in detail each. + +### Method-1: How to Exclude Packages Update on Debian/Ubuntu System Using the apt-mark Command + +The apt-mark is used to mark/unmark a package as being automatically installed. + +The Hold option is used to mark a package as blocked, which prevents the package from being automatically installed, upgraded, or removed. + +The unhold option is used to cancel a previously set hold on a package to allow all actions to be repeated. + +Run the following command to hold the given package using the **apt-mark** command. + +``` +$ sudo apt-mark hold nano +nano set on hold. +``` + +Once you have hold some packages, run the following apt-mark command to view them. + +``` +$ sudo apt-mark showhold +nano +``` + +This will show that the **“nano”** package will not be upgraded when you perform a full system update. + +``` +$ sudo apt update + +Reading package lists… Done +Building dependency tree +Reading state information… Done +Calculating upgrade… Done +The following packages have been kept back: + nano +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. +``` + +Run the following command to unhold the “nano” package using the apt-mark command. + +``` +$ sudo apt-mark unhold nano +Canceled hold on nano. +``` + +### Method-2: How to Exclude Packages Update on Debian/Ubuntu System Using the dpkg Command + +The dpkg command is a CLI tool to install, build, remove and manage Debian packages. The primary and more user-friendly front-end for dpkg is aptitude. + +Run the following command to block a given package using the dpkg command. + +**Syntax:** + +``` +$ echo "package_name hold" | sudo dpkg --set-selections +``` + +Run the below dpkg command to hold the **“apache2”** package. + +``` +$ echo "apache2 hold" | sudo dpkg --set-selections +``` + +Once you have hold some packages, run the following command to view them. + +``` +$ sudo dpkg --get-selections | grep "hold" +apache2 hold +``` + +It will show that the **“apache2”** package will not be upgraded when you perform a full system update. + +``` +$ sudo apt update + +Reading package lists… Done +Building dependency tree +Reading state information… Done +Calculating upgrade… Done +The following packages have been kept back: + apache2 +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. +``` + +Run the following command to unhold the given package using the dpkg command. + +**Syntax:** + +``` +$ echo "package_name install" | sudo dpkg --set-selections +``` + +Run the following command to unhold the “apache2” package using the dpkg command. + +``` +$ echo "apache2 install" | sudo dpkg --set-selections +``` + +### Method-3: How to Exclude Packages Update on Debian/Ubuntu System Using the aptitude Command + +The aptitude command is a text-based package management interface to the Debian and it’s derivative. + +It allows the user to view a list of packages and to perform package management tasks such as installing, upgrading, and removing packages. Actions may be performed from a visual interface or from the command-line. + +Run the following command to hold the given package using the aptitude command. + +``` +$ sudo aptitude hold python3 +``` + +Once you have hold some packages, run the following aptitude command to view them. + +``` +$ sudo dpkg --get-selections | grep "hold" +or +$ sudo apt-mark showhold + +python3 +``` + +This will show that the **“python3”** package will not be upgraded when you perform a full system update. + +``` +$ sudo apt update + +Reading package lists… Done +Building dependency tree +Reading state information… Done +Calculating upgrade… Done +The following packages have been kept back: + python3 +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. +``` + +Run the following command to unhold the **“python3”** package using the apt-mark command. + +``` +$ sudo aptitude unhold python3 +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/debian-ubuntu-exclude-hold-prevent-packages-from-apt-get-upgrade/ + +作者:[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]: https://www.2daygeek.com/redhat-centos-yum-update-exclude-specific-packages/ +[2]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[3]: https://www.2daygeek.com/dpkg-command-to-manage-packages-on-debian-ubuntu-linux-mint-systems/ From a81e47864ae9aadd7e554f4ffa6ac0cf10e29c10 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 6 Mar 2020 00:54:20 +0800 Subject: [PATCH 302/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200306=20What?= =?UTF-8?q?=20is=20Linux=20and=20Why=20There=20are=20100=E2=80=99s=20of=20?= =?UTF-8?q?Linux=20Distributions=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200306 What is Linux and Why There are 100-s of Linux Distributions.md --- ... There are 100-s of Linux Distributions.md | 193 ++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 sources/tech/20200306 What is Linux and Why There are 100-s of Linux Distributions.md diff --git a/sources/tech/20200306 What is Linux and Why There are 100-s of Linux Distributions.md b/sources/tech/20200306 What is Linux and Why There are 100-s of Linux Distributions.md new file mode 100644 index 0000000000..be6a45e211 --- /dev/null +++ b/sources/tech/20200306 What is Linux and Why There are 100-s of Linux Distributions.md @@ -0,0 +1,193 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is Linux and Why There are 100’s of Linux Distributions?) +[#]: via: (https://itsfoss.com/what-is-linux/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +What is Linux and Why There are 100’s of Linux Distributions? +====== + +When you are just starting with Linux, it’s easy to get overwhelmed. + +You probably know only Windows and now you want to use Linux because you read that [Linux is better than Windows][1] as it is more secure and you don’t have to buy a license to use Linux. + +But then when you go about downloading and installing Linux, you learn that Linux is not a single entity. There are [Ubuntu][2], [Fedora][3], [Linux Mint][4], elementary and hundreds of such ‘Linux variants’. The trouble is that some of them look just like the other. + +If that’s the case, why are there multiple of those Linux operating systems? And then you also learn that Linux is just a kernel not an operating system. + +![Too Many Linux!][5] + +It gets messy. And you may feel like pulling out your hair. For a person who has a receding hairline, I would like you to keep your hair intact by explaining things in a way you could easily understand. + +I am going to take an analogy and explain why Linux is just a kernel, why there are hundreds of Linux and why, despite looking similar, they are different. + +The explanation here may not be considered good enough for an answer in an exam or interview but it should give you a better understanding of the topic. + +Apology in advance! + +My analogy may not be entirely correct from mechanical point of view as well. I am not knowledgeable about engines, cars and other related mechanical stuff. +But in my experience, I have noticed that this analogy helps people clearly understand the concept of Linux and operating system. +Also, I have used the term Linux OS instead of Linux distribution deliberately so that newcomers don’t start wondering about distribution. + +### Linux is just a kernel + +_**Linux is not an operating system, it’s just a kernel.**_ + +The statement is entirely true. But how do you understand it. If you look into books, you’ll find Linux kernel structure described like this: + +![Linux Kernel Structure][6] + +There is absolutely correct, however, let’s take a different approach. Think of operating systems as vehicles, any kind of vehicle be it motorbikes, cars or trucks. + +What is at the core of a vehicle? An engine. + +Think of kernel as the engine. It’s an essential part of the vehicle and you cannot use a vehicle without the engine. + +![The Operating System Analogy][7] + +But you cannot drive an engine, can you? You need a lot of other stuff to interact with the engine and drive the vehicle. You need wheels, steering, gears, clutch, brakes and more to drive a vehicle on top of that engine. + +Similarly, you cannot use a kernel on its own. You need lots of tool to interact with the kernel and use the operating system. These stuff could be shell, commands, graphical interface (also called desktop environments) etc. + +This makes sense, right? Now that you understand this analogy, let’s take it further so that you understand the rest of it. + +Windows and other operating systems have kernel too + +Kernel is not something exclusive to Linux. You may not have realized but Windows, macOS and other operating systems have a kernel underneath as well. +Microsoft Windows operating systems are based on [Windows NT kernel][8]. Apple’s macOS is based on the [XNU kernel][9]. + +### Think of operating systems as vehicles + +Think of Microsoft as an automobile company that makes a general purpose car (Windows operating system) that is hugely popular and dominates the car market. They use their own patented engine that no one else can use. But these ‘Microsoft cars’ do not offer scope of customization. You cannot modify the engine on your own. + +Now come to ‘Apple automobile’. They offer shiny looking, luxury cars at an expensive price. If you got a problem, they have a premium support system where they might just replace the car. + +Now comes Linux. Remember, Linux is just an engine (kernel). But this ‘Linux engine’ is not patented and thus anyone is free to modify and build cars (desktop operating system), bikes (small embed system in your toys, tvs etc), trucks (servers) or jet-planes ([supercomputers][10]) on top of it. In real world, no such engine exists but accept it for the sake of this analogy. + +![][11] + + * kernel = engine + * Linux kernel = specific type of engine + * desktop operating systems = cars + * server operating systems = heavy trucks + * embed systems = motor-bikes + * desktop environment = body of the vehicle along with interiors (dashboard and all) + * themes and icons = paint job, rim job and other customization + * applications = accessories you put for specific purpose (like music system) + + + +### Why there are so many Linux OS/distributions? Why some look similar? + +Why there are so many cars? Because there are several vehicle manufacturers using the ‘Linux engine’ and each of them have so many cars of different type and for different purposes. + +Since ‘Linux engine’ is free to use and modify, anyone can use it to build a vehicle on top of it. + +This is why Ubuntu, Debian, Fedora, SUSE, [Manjaro][12] and many other **Linux-based operating systems (also called Linux distributions or Linux distros)** exist. + +You might also have noticed that these Linux operating systems offer different variants but they look similar. I mean look at Fedora’s default GNOME version and Debian’s GNOME version. They do look the same, don’t they? + +![Fedora GNOME vs Debian GNOME: Virtually No Visual Difference][13] + +The component that gives the look and feel in a Linux OS is called [desktop environment][14]. In our analogy here, you can think of it as a combination of outer body and matching interiors. This is what provides the look and feel to your vehicle, does it not? + +It’s from the exterior that you can identify the cars into category of sedan, SUV, hatchback, station wagon, convertible, minivan, van, compact car, 4×4 etc. + +But these ‘type of cars’ are not exclusive to a single automobile company. Ford offers SUV, compact cars, vans etc and so do other companies like General Motors, Toyota. + +![Vehicles of same type look similar even if they are from different automobile companies][15] + +Similarly, distributions (Linux OSes) like Fedora, Ubuntu, Debian, Manjaro etc also offer different variants in the form of GNOME, KDE, Cinnamon, MATE and other [desktop environments][16]. + +Ford’s SUV may look similar to Toyota’s or Renault’s SUV. Fedora’s GNOME version may look similar to Manjaro or Debian’s GNOME version. + +#### Some type of cars consume more fuel, some desktop environments need more RAM + +You probably understand the ‘usefulness’ of different types of cars. Compact cars are good for driving in the cities, vans are good for long trip with family, 4×4 are good for adventures in jungles and other rough terrain. A SUV may look good and feel comfortable for sitting but it consumes more fuel than a compact car that might not be comfortable to sit in. + +Similarly, desktop environments (GNOME, MATE, KDE, Xfce etc) also serve some purpose other than just providing the looks to your Linux operating system. + +GNOME gives a modern looking desktop but it consumes more RAM and thus require that your computer has more than 4 GB of RAM. Xfce on the other hand may look old/vintage but it can run on systems with 1 GB of RAM. + +#### Difference between getting desktop environment from distribution and installing on your own + +As you start using Linux, you’ll also come across suggestions that you can easily install other desktop environments on your current system. + +Remember that Linux is a free world. You are free to modify the engine, customize the looks on your own, if you have the knowledge/experience or if you are an enthusiastic learner. + +Think of it as customizing cars. You may modify a Hundai i20 to look like Suzuki Swift Dzire. But it might not be the same as using a Swift Dzire. + +When you are inside the i20 modified to look like Swiftz Dzire, you’ll find that it may not have the same experience from the inside. Dashboard is different, seats are different. You may also notice that the exterior doesn’t fit the same on i20’s body. + +The same goes for switching desktop environments. You will find that you don’t have the same set of apps in Ubuntu that you should be getting in Mint Cinnamon. Few apps will look out of place. Not to mention that you may find a few things broken, such as network manager indicator missing etc. + +Of course, you can put time, effort and skills to make Hundai i20 look as much like Swift Dzire as possible but you may feel like getting Suzuki Swift Dzire is a better idea in the first place. + +This is the reason why installing Ubuntu MATE is better than installing Ubuntu (GNOME version) and then [installing MATE desktop][17] on it. + +### Linux operating systems also differ in the way they handle applications + +Another major criteria on which the Linux operating systems differ from each other is the package management. + +Package management is basically how you get new software and updates in your systems. It’s up to your Linux distribution/OS to provide the security and maintenance updates. Your Linux OS also provides the means of installing new software on your system. + +Some Linux OS provides all the new software version immediately after their release while some take time to test them for your own good. Some Linux OS (like Ubuntu) provides easier way of installing a new software while you may find it complicated in some other Linux OS (like [Gentoo][18]). + +Keeping the line of our analogy, consider installing software as adding accessories to your vehicle. + +Suppose you have to install a music system in your car. You may have two options here. Your car is designed in such a way that you just insert the music player, you hear the click sound and you know it’s installed. The second option could be to get a screwdriver and then fix the music player on screws. + +Most people would prefer the hassle-free click lock installing system. Some people might take matter (and screwdriver) into their own hands. + +If an automobile company provides scope for installing lots of accessories in click-lock fashion in their cars, they will be preferred, won’t they? + +This is why Linux distributions like Ubuntu have a more users because they have a huge collection of software that can be easily installed in matter of clicks. + +### Conclusion + +Before I conclude this article, I’ll also like to talk about support that plays a significant role in choosing a Linux OS. For your car, you would like to have its official service center or other garages that service the automobile brand you own, don’t you? If the automobile company is popular, naturally, it will have more and more garages providing services. + +The same goes for Linux as well. For a popular Linux OS like Ubuntu, you have some official forums to seek support and a good number of websites and forums providing troubleshooting tips to fix your problem. + +Again, I know this is not a perfect analogy but this helps understand the things slightly better. + +If you are absolutely new to Linux, did this article made things clear for you or you are more confused than before? + +If you already know Linux, how would you explain Linux to someone from non-technical background? + +Your suggestions and feedback is welcome. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/what-is-linux/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/linux-better-than-windows/ +[2]: https://ubuntu.com/ +[3]: https://getfedora.org/ +[4]: https://linuxmint.com/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/too-many-linux-choices.png?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Linux_Kernel_structure.png?ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/operating_system_analogy.png?ssl=1 +[8]: https://en.wikipedia.org/wiki/Architecture_of_Windows_NT +[9]: https://en.wikipedia.org/wiki/XNU +[10]: https://itsfoss.com/linux-runs-top-supercomputers/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/linux-kernel-as-engine.png?ssl=1 +[12]: https://manjaro.org/ +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/fedora-gnome-vs-debian-gnome.jpg?ssl=1 +[14]: https://itsfoss.com/glossary/desktop-environment/ +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/linux_suv_analogy.jpg?ssl=1 +[16]: https://itsfoss.com/best-linux-desktop-environments/ +[17]: https://itsfoss.com/install-mate-desktop-ubuntu/ +[18]: https://www.gentoo.org/ From 8b898f553e50b5f67e627f6a127c0dc7aeb8d334 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 6 Mar 2020 00:56:58 +0800 Subject: [PATCH 303/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200305=205=20pr?= =?UTF-8?q?oductivity=20apps=20for=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200305 5 productivity apps for Linux.md --- .../20200305 5 productivity apps for Linux.md | 153 ++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 sources/tech/20200305 5 productivity apps for Linux.md diff --git a/sources/tech/20200305 5 productivity apps for Linux.md b/sources/tech/20200305 5 productivity apps for Linux.md new file mode 100644 index 0000000000..3e7423dc59 --- /dev/null +++ b/sources/tech/20200305 5 productivity apps for Linux.md @@ -0,0 +1,153 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 productivity apps for Linux) +[#]: via: (https://opensource.com/article/20/3/productivity-apps-linux-elementary) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +5 productivity apps for Linux +====== +Get organized and accomplish more with these five productivity apps for +the Elementary Linux desktop. +![Person drinking a hat drink at the computer][1] + +I've had a soft spot for [Elementary OS][2] since I first encountered it in 2013. A lot of that has to do with the distribution being very clean and simple. + +Since 2013, I've recommended Elementary to people who I've helped [transition to Linux][3] from other operating systems. Some have stuck with it. Some who moved on to other Linux distributions told me that Elementary helped smooth the transition and gave them more confidence using Linux. + +Like the distribution itself, many of the applications created specifically for Elementary OS are simple, clean, and useful. They can help boost your day-to-day productivity, too. + +### About "pay-what-you-want" apps + +Some apps in the Elementary AppCenter ask you to pay what you can. You're not obliged to pay to the full amount a developer asks for (or pay anything, for that matter). However, any money that changes hands goes to support the development of those apps. + +Three of the applications in this article—Quilter, Notes-up, and Envelope—are pay-what-you-want. If you find an app useful, I encourage you to send some money the developer's way. + +### Envelope + +Managing your budget should be simple. More than a few people, though, struggle with the task. That's where [Envelope][4] can help. While Envelope doesn't pack the features of something like [GnuCash][5], it's good enough for most of us. + +The app is built around the [envelope system][6] of personal and household budgeting. The first time you launch Envelope, you need to set up an account. You can do that manually, or you can import a [QIF][7] file containing financial information from another program. + +![Adding an account in Envelope][8] + +Either way, Envelope offers a set of categories (your envelopes). Add or delete categories as you see fit—for example, I don't own a car, so I deleted the Fuel category. + +From there, add transactions. Those can be your expenses or your income. Or both. + +![Entering a transaction in Envelope][9] + +Envelope gives you an overview of your spending and income. To get a more focused view of your budget, you can report on the current or previous month or a specific range of dates. + +### Notes-Up + +[Notes-Up][10]'s look and feel are reminiscent of note-taking tools like [Standard Notes][11], Simplenote, and the macOS Notes app. If you use any of them, switching to Notes-Up will be smooth and painless. Regardless, Notes-Up is easy to learn and use. + +![Notes-Up][12] + +Create a note and start typing. Notes-Up supports Markdown, making it easy to add formatting to your notes. + +![Taking notes in Notes-Up][13] + +If your Markdown is rusty, you can click the buttons on the toolbar to add formatting like lists; bold, italics, and strikethrough; code blocks; images; and more. You can also export your notes as PDF or Markdown files. + +Use Notes-Up for a while, and you'll wind up with a long list of notes. Organize them using _notebooks_. You can, for example, create personal, school, and work notebooks. On top of that, Notes-Up enables you to create sub-notebooks. Under my notebook for Opensource.com, for example, I have sub-notebooks for articles and the news roundups I curate. + +Notebooks not your thing? Then use tags to add keywords to your notes to make them easier to sort. + +### Yishu + +I do as much of my work as I can in [plain text][14]. That includes my task list. For that, I turn to a handy command-line application called [Todo.txt][15]. + +If you aren't comfortable working at the command line, then [Yishu][16] is for you. It has Todo.txt's key features but graphically on the desktop. + +![Yishu][17] + +When you first fire up Yishu, it asks you to open an existing Todo.txt file. If you have one, open it. Otherwise, create a task. That also creates a new file for your tasks. + +![Adding a task in Yishu][18] + +Your options are limited: a description of the task and a priority. You can also add a due date in the format _YYYY-MM-DD_—for example, _2020-02-17_. + +When you click **OK**, Yishu saves the file Todo.txt to your **/home** folder. That might not be where you want to store your tasks. You can tell Yishu to use another folder in its preferences. + +### Reminduck + +Chances are, your notifications and reminders are jarring. A piercing buzz, an annoying beep, a text box that appears when you least expect it. Why not add a bit of [calm][19] and a bit of whimsy to your reminders—with a duck? + +That's the idea behind [Reminduck][20]. It's a simple and fun way to tell yourself it's time to do, well, anything. + +Fire up the app and create a reminder. You can add a description, date, and time for the reminder to appear, and you can set it to repeat. Reminders can repeat after a number of minutes that you set or at specific times every day, week, or month. + +![Reminduck][21] + +You can set up more than one reminder. Reminduck organizes your reminders, and you can edit or delete them. + +![Reminduck reminders][22] + +When the reminder is triggered, a little message pops out of the notification area on the desktop along with a soft alert and an icon of a smiling duck. + +![Reminduck notification][23] + +### Quilter + +It's easy enough to write with [Markdown][24] in a plain old text editor. Some folks, though, prefer to work with a dedicated Markdown editor. On the Elementary OS desktop, one option is [Quilter][25]. + +![Quilter][26] + +Quilter is pretty basic. There's no toolbar to insert formatting; you have to add Markdown by hand. On the other hand, Quilter displays a running word count and an estimate of how long it will take to read what you're writing. + +![Quilter][27] + +The editor's options are few. There's a preview mode, and you can export your documents to PDF or HTML. The result of an export has the same look as a preview. That's not a bad thing. + +Quilter's other options include the ability to change the line spacing and margins, set the editor's font, as well as enable syntax highlighting and spell checking. It also has a mode that you can use to focus on a single line or a single paragraph while you're writing. + +### Final thoughts + +Sometimes, the best tools to boost your productivity are simple ones. Applications like the five above focus on doing one thing and doing it well. + +Envelope, Notes-Up, Yishu, Reminduck, and Quilter won't appeal to everyone. But if you use Elementary OS, give them a try. They can help you keep on track and do what you need to do. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/productivity-apps-linux-elementary + +作者:[Scott Nesbitt][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/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) +[2]: https://elementary.io +[3]: https://opensource.com/article/18/12/help-non-techies +[4]: https://nlaplante.github.io/envelope/ +[5]: https://opensource.com/article/20/2/gnucash +[6]: https://en.wikipedia.org/wiki/Envelope_system +[7]: https://en.wikipedia.org/wiki/Quicken_Interchange_Format +[8]: https://opensource.com/sites/default/files/uploads/envelope-add-account.png (Adding an account in Envelope) +[9]: https://opensource.com/sites/default/files/uploads/envelope-entering-transaction.png (Entering a transaction in Envelope) +[10]: https://appcenter.elementary.io/com.github.philip-scott.notes-up/ +[11]: https://opensource.com/article/18/12/taking-notes-standard-notes +[12]: https://opensource.com/sites/default/files/uploads/notes-up-main-window.png (Notes-Up) +[13]: https://opensource.com/sites/default/files/uploads/notes-up-taking-note.png (Taking notes in Notes-Up) +[14]: https://plaintextproject.online +[15]: https://opensource.com/article/20/1/open-source-to-do-list +[16]: https://appcenter.elementary.io/com.github.lainsce.yishu/ +[17]: https://opensource.com/sites/default/files/uploads/yishu-task-list.png (Yishu) +[18]: https://opensource.com/sites/default/files/uploads/yishu-add-task.png (Adding a task in Yishu) +[19]: https://weeklymusings.net/weekly-musings-025 +[20]: https://appcenter.elementary.io/com.github.matfantinel.reminduck/ +[21]: https://opensource.com/sites/default/files/uploads/reminduck.png (Reminduck) +[22]: https://opensource.com/sites/default/files/uploads/remiunduck-reminders-list.png (Reminduck reminders) +[23]: https://opensource.com/sites/default/files/uploads/reminduck-notification.png (Reminduck notification) +[24]: https://opensource.com/article/19/8/markdown-beginners-cheat-sheet +[25]: https://appcenter.elementary.io/com.github.lainsce.quilter/ +[26]: https://opensource.com/sites/default/files/uploads/quilter.png (Quilter) +[27]: https://opensource.com/sites/default/files/uploads/quilter-editing.png (Quilter) From 3fd33c8ec7b9fca4b13f160daa6b00415a8e7960 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 6 Mar 2020 01:03:53 +0800 Subject: [PATCH 304/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200305=20Report?= =?UTF-8?q?:=20Most=20IoT=20transactions=20are=20not=20secure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200305 Report- Most IoT transactions are not secure.md --- ...t- Most IoT transactions are not secure.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/talk/20200305 Report- Most IoT transactions are not secure.md diff --git a/sources/talk/20200305 Report- Most IoT transactions are not secure.md b/sources/talk/20200305 Report- Most IoT transactions are not secure.md new file mode 100644 index 0000000000..96a2add2d7 --- /dev/null +++ b/sources/talk/20200305 Report- Most IoT transactions are not secure.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Report: Most IoT transactions are not secure) +[#]: via: (https://www.networkworld.com/article/3530476/report-most-iot-transactions-are-not-secure.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Report: Most IoT transactions are not secure +====== +Data gathered by security provider Zscaler shows that not only are most internet-of-things transactions unsecured, they are also unauthorized as IoT creeps in as shadow-IT devices. +Iot + +The majority of [Internet of Things (IoT)][1] transactions don’t use even basic security, and there is a great deal of unauthorized IoT taking place inside the perimeter of enterprise firewalls thanks to shadow IT, a new study finds. + +Security vendor Zscaler analyzed nearly 500 million IoT transactions from more than 2,000 organizations over a two-week period. [The survey][2] found 553 different IoT devices from more than 200 different manufacturers, many of which had their security turned off. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] + +The study was done on Zscaler’s own Internet Access security service. It found the rate of IoT growth to be explosive: When it first started monitoring IoT traffic in May 2019, IoT traffic generated by its enterprise customer base was 56 million IoT transactions per month. By February 2020, that number had soared to 33 million transactions _per day_, or one billion IoT transactions per month, a 1,500% increase. + +Zscaler is a bit generous in what it defines as enterprise IoT devices, from devices such as data-collection terminals, digital signage media players, industrial control devices, medical devices, to decidedly non-business devices like digital home assistants, TV set-top boxes, IP cameras, smart home devices, smart TVs, smart watches and even automotive multimedia systems. + +“What this tells us is that employees inside the office might be checking their nanny cam over the corporate network. Or using their Apple Watch to look at email. Or working from home, connected to the enterprise network, and periodically checking the home security system or accessing media devices,” the company said in its report. + +Which is typical, to be honest, and let (s)he who is without sin cast the first stone in that regard. What’s troubling is that roughly 83% of IoT-based transactions are happening over plaintext channels, while only 17% are using [SSL][4]. The use of plaintext is risky, opening traffic to packet sniffing, eavesdropping, man-in-the-middle attacks and other exploits. + +And there are a lot of exploits. Zscaler said it detects about 14,000 IoT-based malware exploits per month, a seven-fold increase over the previous year. + +“Folks can keep their smart watches, smart closets, and whatever else they think is making them smart. Banning devices is not going to be the answer here. The answer is changing up the narrative on how we think about IoT devices from a security and risk standpoint, and what expectations we put on manufacturers to increase the security posture of these devices,” wrote Deepen Desai, Zscaler’s vice president of security research in a [blog post][5]. + +Desai said the solution is “taking a [zero-trust][6] mentality.” It may be a buzzword but, “it’s about security people not trusting any person or device to touch the network—that is, until you know who the user is, what the device is, and whether that user and device are allowed to access the applications they’re trying to reach.” + +Naturally Zscaler sells such a solution, but he makes a valid point. This is an ages-old problem I have seen time and again; a hot new technology comes along, everyone rushes to embrace it, then they think about securing it later. IoT is no different. + +Whatever your device, at least go into the settings and turn on SSL. + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3530476/report-most-iot-transactions-are-not-secure.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3207535/what-is-iot-the-internet-of-things-explained.html +[2]: https://info.zscaler.com/resources-industry-iot-in-the-enterprise +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.networkworld.com/article/2303073/lan-wan-what-is-transport-layer-security-protocol.html +[5]: https://www.zscaler.com/blogs/corporate/shining-light-shadow-iot-protect-your-organization +[6]: https://www.networkworld.com/article/3487720/the-vpn-is-dying-long-live-zero-trust.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From 4e8e207047dbf849e8af9952a0f77823c91cbffc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 6 Mar 2020 01:09:48 +0800 Subject: [PATCH 305/315] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200305=20Chines?= =?UTF-8?q?e=20auto=20giant=20Geely=20plans=20a=20private=20satellite=20ne?= =?UTF-8?q?twork=20to=20support=20autonomous=20vehicles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200305 Chinese auto giant Geely plans a private satellite network to support autonomous vehicles.md --- ... network to support autonomous vehicles.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/talk/20200305 Chinese auto giant Geely plans a private satellite network to support autonomous vehicles.md diff --git a/sources/talk/20200305 Chinese auto giant Geely plans a private satellite network to support autonomous vehicles.md b/sources/talk/20200305 Chinese auto giant Geely plans a private satellite network to support autonomous vehicles.md new file mode 100644 index 0000000000..8bf990573e --- /dev/null +++ b/sources/talk/20200305 Chinese auto giant Geely plans a private satellite network to support autonomous vehicles.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Chinese auto giant Geely plans a private satellite network to support autonomous vehicles) +[#]: via: (https://www.networkworld.com/article/3530336/chinese-auto-giant-geely-plans-a-private-satellite-network-to-support-autonomous-vehicles.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Chinese auto giant Geely plans a private satellite network to support autonomous vehicles +====== +Geely is developing a satellite network to provide high-bandwidth wireless needed by on-board applications in self-driving vehicles. +Olivier Le Moal / Getty Images + +What does a large automaker that’s morphing into a mobile-technology company and heavily investing in autonomous vehicles need to add to its ecosystem? Probably connectivity, and that’s likely why Chinese car giant Geely says it will be building its own satellite data network. + +A need for “highly accurate, autonomous driving solutions,” is part of what’s driving the strategy, the company says in a [press release][1]. Geely – the largest car maker in China and whose assets include Volvo and a stake in Lotus – has begun building a test facility in Taizhou City where it will develop satellite models, the company says. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][2] + +“The creation of a truly smart, three-dimensional mobility ecosystem,” as the company describes its Geespace project, will include precise navigation, cloud computing and high-speed Internet functions. Geely is investing $326 million in the project [according to Reuters][3], citing a statement from the company. + +Over-the-air updating of vehicle software is a principal reason data networks will become prevalent in automobile technology. Historically, car companies haven’t worried much about the speedy updating of end-user’s systems, in part because they’ve liked getting customers back into the dealership to upsell service options and pitch new cars. A leisurely software patch while the customer hangs around drinking warm coffee and watching daytime soaps suits that purpose. However, autonomous cars are a different story: The safety of self-driving cars can’t tolerate software vulnerabilities. + +Control over vehicle positioning also comes into play. Knowing where the car is and where obstacles are is more important than in traditional vehicles. Lane-change and accident avoidance, for example, are autonomous-vehicle features that require high levels of accuracy. + +“The Geespace low-orbit satellite network will offer much higher centimeter-accurate precision,” Geely says, comparing its proposed constellation with the U.S. government-owned Global Positioning System. + +Data processing, artificial intelligence and infotainment onboard the vehicles all need fat networks, too. Former Intel CEO Brian Krzanich [said at a talk I attended a few years ago][4] that he thought cars would soon create 4,000 GB of data per hour of driving because of the number of sensors, such as cameras, that they’ll be equipped with. + +[][5] + +The Geely private satellite network is the first of its kind for an industrial use and joins [a trend in private wireless networking][6]. Private, terrestrial 5G networks and private LTE networks allow companies to control their own data and uptime, rather than relying on service providers. Mercedes-Benz is reportedly working on a private 5G network for privacy and security. + +“As vehicles become more connected and integrated into the Internet of Things ecosystem, the demand for data has grown exponentially,” Geely says. + +Geely will begin launching the Geespace satellites by the end of 2020. + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3530336/chinese-auto-giant-geely-plans-a-private-satellite-network-to-support-autonomous-vehicles.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: http://zgh.com/media-center/news/2020-03-03-1/?lang=en +[2]: https://www.networkworld.com/newsletters/signup.html +[3]: https://www.reuters.com/article/geely-china-satellite-autonomous/chinas-geely-invests-326-mln-to-build-satellites-for-autonomous-cars-idUSL4N2AV45H +[4]: https://www.networkworld.com/article/3147892/one-autonomous-car-will-use-4000-gb-of-dataday.html +[5]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[6]: https://www.networkworld.com/article/3319176/private-5g-networks-are-coming.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From 3dbcc83a451c69459181255ad043942a3ac4c43e Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 6 Mar 2020 08:03:03 +0800 Subject: [PATCH 306/315] translating --- ...between uppercase and lowercase on the Linux command line.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md b/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md index a2819e3ff7..b830a88c9d 100644 --- a/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md +++ b/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From be4d9c35dd6f1be786bdbfecadf6f342a6bec1ac Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 6 Mar 2020 09:32:59 +0800 Subject: [PATCH 307/315] PRF @geekpi --- ...oud with Fedora 31 and Nextcloud Server.md | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md b/translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md index c5cd454f7d..7c7db7b186 100644 --- a/translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md +++ b/translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Build your own cloud with Fedora 31 and Nextcloud Server) @@ -38,7 +38,7 @@ # systemctl enable --now httpd ``` -接下来,允许 _HTTP_ 流量穿过防火墙: +接下来,允许 HTTP 流量穿过防火墙: ``` # firewall-cmd --permanent --add-service=http @@ -57,7 +57,7 @@ # systemctl enable --now mariadb ``` -现在,MariaDB 正在运行,你可以运行 _mysql_secure_installation_ 命令来保护它: +现在,MariaDB 正在运行,你可以运行 `mysql_secure_installation` 命令来保护它: ``` # mysql_secure_installation @@ -148,14 +148,14 @@ Thanks for using MariaDB! # unzip nextcloud-17.0.2.zip -d /var/www/html/ ``` -接下来,创建一个数据文件夹,并授予 Apache 对 _nextcloud_ 目录树的读写访问权限: +接下来,创建一个数据文件夹,并授予 Apache 对 `nextcloud` 目录树的读写访问权限: ``` # mkdir /var/www/html/nextcloud/data # chown -R apache:apache /var/www/html/nextcloud ``` -SELinux 必须配置为可与 Nextcloud 一起使用。基本命令如下所示,但在 nexcloud 安装中还有很多其他的命令,发布在这里:[Nextcloud SELinux 配置][6] +SELinux 必须配置为可与 Nextcloud 一起使用。基本命令如下所示,但在 nexcloud 安装中还有很多其他的命令,发布在这里:[Nextcloud SELinux 配置][6]。 ``` # semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/config(/.*)?' @@ -172,7 +172,7 @@ SELinux 必须配置为可与 Nextcloud 一起使用。基本命令如下所示 #### 使用 Web 界面 -在你喜欢的浏览器中,访问 __ 并输入字段: +在你喜欢的浏览器中,访问 并输入字段: ![][7] @@ -186,14 +186,12 @@ SELinux 必须配置为可与 Nextcloud 一起使用。基本命令如下所示 ### 最后几点 - * 我使用的是 _http_ 协议,但是 Nextcloud 也可以在 _https_ 上运行。我可能会在以后的文章中写一篇有关保护 Nextcloud 的文章。 -  * 我禁用了 SELinux,但是如果配置它,你的服务器将更加安全。 -  * Nextcloud 的建议 PHP 内存限制为 512M。要更改它,请编辑 _/etc/php.ini_ 配置文件中的 _memory_limit_ 变量,然后重新启动 _httpd_ 服务。 -  * 默认情况下,只能使用 __ URL 访问 Web 界面。如果要允许使用其他域名访问,[你可编辑 _/var/www/html/nextcloud/config/config.php_ 来进行此操作][8]。\* 字符可用于绕过域名限制,并允许任何解析为服务器 IP 的 URL 访问。 +* 我使用的是 http 协议,但是 Nextcloud 也可以在 https 上运行。我可能会在以后的文章中写一篇有关保护 Nextcloud 的文章。 +* 我禁用了 SELinux,但是如果配置它,你的服务器将更加安全。 +* Nextcloud 的建议 PHP 内存限制为 512M。要更改它,请编辑 `/etc/php.ini` 配置文件中的 `memory_limit` 变量,然后重新启动 httpd 服务。 +* 默认情况下,只能使用 URL 访问 Web 界面。如果要允许使用其他域名访问,[你可编辑 /var/www/html/nextcloud/config/config.php 来进行此操作][8]。`*` 字符可用于绕过域名限制,并允许任何解析为服务器 IP 的 URL 访问。 - - -``` + ``` 'trusted_domains' => array ( 0 => 'localhost', @@ -208,7 +206,7 @@ via: https://fedoramagazine.org/build-your-own-cloud-with-fedora-31-and-nextclou 作者:[storyteller][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/) 荣誉推出 From bd5d2583e0098ca744e4ef5d160515cc1e46d998 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 6 Mar 2020 09:33:38 +0800 Subject: [PATCH 308/315] PUB @geekpi https://linux.cn/article-11964-1.html --- ...uild your own cloud with Fedora 31 and Nextcloud Server.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md (99%) diff --git a/translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md b/published/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md similarity index 99% rename from translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md rename to published/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md index 7c7db7b186..295e111690 100644 --- a/translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md +++ b/published/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11964-1.html) [#]: subject: (Build your own cloud with Fedora 31 and Nextcloud Server) [#]: via: (https://fedoramagazine.org/build-your-own-cloud-with-fedora-31-and-nextcloud-server/) [#]: author: (storyteller https://fedoramagazine.org/author/storyteller/) From 4bc2d382657d6716756c220b52d4f40e06f7e015 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Fri, 6 Mar 2020 10:26:06 +0800 Subject: [PATCH 309/315] Update 20200204 DevOps vs Agile- What-s the difference.md Translating by messon007 --- sources/tech/20200204 DevOps vs Agile- What-s the difference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200204 DevOps vs Agile- What-s the difference.md b/sources/tech/20200204 DevOps vs Agile- What-s the difference.md index ec49c22c92..d83e9c17f7 100644 --- a/sources/tech/20200204 DevOps vs Agile- What-s the difference.md +++ b/sources/tech/20200204 DevOps vs Agile- What-s the difference.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (messon007) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From eb44cdacedfb210887e2e4395945f399761da29c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 6 Mar 2020 10:47:38 +0800 Subject: [PATCH 310/315] Rename sources/tech/20200306 What is Linux and Why There are 100-s of Linux Distributions.md to sources/talk/20200306 What is Linux and Why There are 100-s of Linux Distributions.md --- ...hat is Linux and Why There are 100-s of Linux Distributions.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200306 What is Linux and Why There are 100-s of Linux Distributions.md (100%) diff --git a/sources/tech/20200306 What is Linux and Why There are 100-s of Linux Distributions.md b/sources/talk/20200306 What is Linux and Why There are 100-s of Linux Distributions.md similarity index 100% rename from sources/tech/20200306 What is Linux and Why There are 100-s of Linux Distributions.md rename to sources/talk/20200306 What is Linux and Why There are 100-s of Linux Distributions.md From 64b6658edee78c40545a7da5be45aeb5531950a9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 6 Mar 2020 11:38:08 +0800 Subject: [PATCH 311/315] translated --- .../20200302 Install GNU Emacs on Windows.md | 102 ------------------ .../20200302 Install GNU Emacs on Windows.md | 99 +++++++++++++++++ 2 files changed, 99 insertions(+), 102 deletions(-) delete mode 100644 sources/tech/20200302 Install GNU Emacs on Windows.md create mode 100644 translated/tech/20200302 Install GNU Emacs on Windows.md diff --git a/sources/tech/20200302 Install GNU Emacs on Windows.md b/sources/tech/20200302 Install GNU Emacs on Windows.md deleted file mode 100644 index 7ba0e633bb..0000000000 --- a/sources/tech/20200302 Install GNU Emacs on Windows.md +++ /dev/null @@ -1,102 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Install GNU Emacs on Windows) -[#]: via: (https://opensource.com/article/20/3/emacs-windows) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Install GNU Emacs on Windows -====== -Even if your operating system is closed source, you can still use this -popular open source text editor. -![Tall building with windows][1] - -GNU Emacs is a popular text editor designed for programmers of all sorts. Because it was developed on Unix and is widely used on Linux (and shipped with macOS), people sometimes don't realize that it's also available for Microsoft Windows. You don't need to be an experienced or full-time programmer to make use of Emacs, either. You can download and install Emacs with just a few clicks, and this article shows you how. - -You can install Windows manually or with a package manager, like [Chocolatey][2]. - -### 7-zip - -If you haven't already installed 7-zip for Windows, you should do that first. [7-zip][3] is an open source archive utility with the ability to create and extract ZIP, 7z, TAR, XZ, BZIP2, and GZIP (and more) files. It's an invaluable tool for Windows users. - -After installing 7-zip, you have new 7-zip archive options in your right-click menu when browsing files in Windows Explorer. - -### Powershell and Chocolatey - -To install GNU Emacs on Windows using Chocolatey: - - -``` -`PS> choco install emacs-full` -``` - -Once it has installed, launch Emacs from Powershell: - - -``` -`PS> emacs` -``` - -![Emacs running on Windows][4] - -### Download GNU Emacs for Windows - -To manually install GNU Emacs on Windows, you must [download Emacs][5]. - -![GNU Windows downloader][6] - -This takes you to a server near you, which shows you a list of all available Emacs releases. Find the directory with the highest release number and click into it. There are many different builds of Emacs for Windows, but the most general-purpose version is just named **emacs-VERSION-ARCHITECTURE.zip**. The **VERSION** depends upon which release you're downloading, while the **ARCHITECTURE** depends on whether you have a 32-bit or 64-bit machine. Most modern computers are 64-bit, but if you're in doubt you can download the 32-bit version, which runs on both. - -If you're downloading version 26 of Emacs for a 64-bit machine, you would click the link titled **emacs-26.2-x86_64.zip**. There are smaller downloads available (such as the **no-deps** variety) but you must be familiar with how Emacs is built from source code, knowing which libraries it needs and which of those your computer has on it already. Generally, it's easiest to get the large version of Emacs, because it contains everything it needs to run on your computer. - -### Extract Emacs - -Next, unarchive the ZIP file you downloaded. To extract it, right-click on the Emacs ZIP file and select **Extract to Emacs-VERSION** from the 7-zip sub-menu. It's a big archive, so it may take a while to uncompress, but when it does, you have a new directory containing all the files distributed with Emacs. For example, in this example, the file **emacs-26.2-x86_64.zip** was downloaded, so the unarchived directory is **emacs-26.2-x86_64**. - -### Launch Emacs - -Within the Emacs directory, find the **bin** directory. This folder stores all the binary executable files (EXE files) distributed with Emacs. Double-click the **emacs.exe** file to launch the application. - -![Emacs running on Windows][7] - -You can create a shortcut to **emacs.exe** on your desktop for easier access. - -### Learn Emacs - -Emacs isn't as obtuse as its reputation may indicate. It's got its own traditions and conventions, but when you're typing text into it, you can treat it exactly as you treat Notepad or any given text field on any given website. - -The important differences occur when you _edit_ the text you've typed. - -The only way to learn is to start using it, though, so make Emacs your go-to text editor for simple tasks. When you'd normally open Notepad or Word or Evernote or whatever it is you use for quick notes or as a temporary scratchpad, launch Emacs instead. - -Emacs has the reputation of being a terminal-based application, but obviously it has a GUI, so use the GUI often, just as you would with any application. Copy, cut, and paste (or "yank" in Emacs terminology) from the menu instead of with the keyboard, and open and save files from the menu or toolbar. Start from the beginning and learn the application based on what it is and not how you think it should act based on your experience with other editors. - -### Download our [cheatsheet][8]! - -_Thanks to Matthias Pfuetzner and Stephen Smoogen._ - -These are Jimmy's six favorite open source applications that he immediately installs on a new... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/emacs-windows - -作者:[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/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) -[2]: https://github.com/chocolatey/choco -[3]: https://www.7-zip.org/ -[4]: https://opensource.com/sites/default/files/uploads/windows-ps-choco-emacs.jpg (Emacs running on Windows) -[5]: https://www.gnu.org/software/emacs/download.html -[6]: https://opensource.com/sites/default/files/uploads/windows-emacs-download.jpg (GNU Windows downloader) -[7]: https://opensource.com/sites/default/files/uploads/windows-emacs.jpg (Emacs running on Windows) -[8]: https://opensource.com/downloads/emacs-cheat-sheet diff --git a/translated/tech/20200302 Install GNU Emacs on Windows.md b/translated/tech/20200302 Install GNU Emacs on Windows.md new file mode 100644 index 0000000000..3ef9810f0c --- /dev/null +++ b/translated/tech/20200302 Install GNU Emacs on Windows.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Install GNU Emacs on Windows) +[#]: via: (https://opensource.com/article/20/3/emacs-windows) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +在 Windows 上安装 GNU Emacs +====== +即使你的操作系统是闭源的,你仍然可以使用这个流行的开源文本编辑器。 +![Tall building with windows][1] + +GNU Emacs 是一个专为各种程序员设计的流行的文本编辑器。因为它是在 Unix 上开发的,并在 Linux(macOS 中也有)上得到了广泛使用,所以人们有时没有意识到它也可用于 Microsoft Windows 上。你也无需成为有经验的或专职的程序员即可使用 Emacs。只需单击几下就可以下载并安装 Emacs,本文向你展示了如何进行。 + +你可以手动安装 Windows,也可以使用包管理器安装,例如 [Chocolatey][2]。 + +### 7-zip + +如果还没在 Windows 中安装 7-zip,那么就先安装它。[7-zip][3] 是一个开源的存档程序,能够创建和解压 ZIP、7z、TAR、XZ、BZIP2 和 GZIP(以及更多)文件。对于 Windows 用户来说,这是一个宝贵的工具。 + +安装 7-zip 后,在 Windows 资源管理器中浏览文件时,右键单击菜单中就有新的 7-zip 存档选项。 + +### Powershell 和 Chocolatey + +要在 Windows 上使用 Chocolatey 安装 GNU Emacs : + + +``` +`PS> choco install emacs-full` +``` + +安装后,在 Powershell 中启动 Emacs: + + +``` +`PS> emacs` +``` + +![Emacs running on Windows][4] + +### 下载适用于 Windows 的 GNU Emacs + +要在 Windows 上手动安装 GNU Emacs,你必须[下载 Emacs][5]。 + +![GNU Windows downloader][6] + +它会打开连接到离你最近的服务器,并展示所有可用的 Emacs 版本。找到发行版本号最高的目录,然后单击进入。Windows 有许多不同的 Emacs 构建,但是最通用的版本只是被命名为 emacs-VERSION-ARCHITECTURE.zip。**VERSION** 取决于你要下载的版本,而 **ARCHITECTURE** 取决于你使用的是 32 位还是 64 位计算机。大多数现代计算机都是 64 位的,但是如果你有疑问,可以下载 32 位版本,它可在两者上运行。 + +如果要下载 64 位计算机的 Emacs v26,你应该点击 emacs-26.2-x86_64.zip 的链接。有较小的下载包(例如 “no-deps” 等),但是你必须熟悉如何从源码构建 Emacs,知道它需要哪些库以及你的计算机上已经拥有哪些库。通常,获取较大版本的 Emacs 最容易,因为它包含了在计算机上运行所需的一切。 + +### 解压 Emacs + +接下来,解压下载的 ZIP 文件。要解压缩,请右键单击 Emacs ZIP 文件,然后从 7-zip 子菜单中选择 **Extract to Emacs-VERSION**。这是一个很大的压缩包,因此解压可能需要一段时间,但是完成后,你将拥有一个新目录,其中包含与 Emacs 一起分发的所有文件。例如,在此例中,下载了 emacs-26.2-x86_64.zip,因此解压后的目录为 emacs-26.2-x86_64。 + +### 启动 Emacs + +在 Emacs 目录中,找到 **bin** 目录。此文件夹存储随 Emacs 一起分发的所有二进制可执行文件(EXE 文件)。双击 emacs.exe 文件启动应用。 + +![Emacs running on Windows][7] + +你可以在桌面上创建 **emacs.exe** 的快捷方式,以便于访问。 + +### 学习 Emacs + +Emacs 并不像传闻那样难用。它具有自己的传统和惯例,但是当你其中输入文本时,你可以像在记事本或者网站的文本框中那样使用它。 + +重要的区别是在你_编辑_输入的文本时。 + +但是,学习的唯一方法是开始使用它,因此,使 Emacs 成为完成简单任务的首选文本编辑器。当你通常打开记事本、Word 或 Evernote 或其他工具来做快速笔记或临时记录时,请启动 Emacs。 + +Emacs 以基于终端的应用而闻名,但它显然有 GUI,因此请像使用其他程序一样经常使用它的 GUI。从菜单而不是使用键盘复制、剪切和粘贴(paste)(或用 Emacs 的术语 “yank”),然后从菜单或工具栏打开和保存文件。从头开始,并根据应用本身来学习它,而不是根据你以往对其他编辑器的经验就认为它应该是怎样。 + +### 下载[速查表][8]! + +_感谢 Matthias Pfuetzner 和 Stephen Smoogen。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/emacs-windows + +作者:[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/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) +[2]: https://github.com/chocolatey/choco +[3]: https://www.7-zip.org/ +[4]: https://opensource.com/sites/default/files/uploads/windows-ps-choco-emacs.jpg (Emacs running on Windows) +[5]: https://www.gnu.org/software/emacs/download.html +[6]: https://opensource.com/sites/default/files/uploads/windows-emacs-download.jpg (GNU Windows downloader) +[7]: https://opensource.com/sites/default/files/uploads/windows-emacs.jpg (Emacs running on Windows) +[8]: https://opensource.com/downloads/emacs-cheat-sheet From 2c12683835505475605f02f6c8d0161bdc3b35e6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 6 Mar 2020 11:39:16 +0800 Subject: [PATCH 312/315] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @heguangzhi 翻译完再检查一遍会更好 --- ...t you-re looking for on Linux with find.md | 103 +++++++++--------- 1 file changed, 49 insertions(+), 54 deletions(-) diff --git a/translated/tech/20200219 How to find what you-re looking for on Linux with find.md b/translated/tech/20200219 How to find what you-re looking for on Linux with find.md index f54e9a3924..a6d515943e 100644 --- a/translated/tech/20200219 How to find what you-re looking for on Linux with find.md +++ b/translated/tech/20200219 How to find what you-re looking for on Linux with find.md @@ -1,42 +1,40 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to find what you’re looking for on Linux with find) [#]: via: (https://www.networkworld.com/article/3527420/how-to-find-what-you-re-looking-for-on-linux-with-find.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) -如何在 Linux上通过 find 命令找到你要找的东西 +通过 find 命令找到你要找的东西 ====== -find 命令有大量选项可以帮助你准确定位你在 Linux 系统上需要寻找的文件。这篇文章讨论了一系列非常有用的选项。 -CSA 图片/ Getty 图片 +> find 命令有巨多的选项可以帮助你准确定位你在 Linux 系统上需要寻找的文件。这篇文章讨论了一系列非常有用的选项。 -在 Linux 系统上有许多用于查找文件的命令,但是在查找文件时也有大量的选项可以选择。 +![](https://img.linux.net.cn/data/attachment/album/202003/06/113842txki5llopb5aagbt.jpg) + +在 Linux 系统上有许多用于查找文件的命令,而你在使用它们时也有巨多的选项可以使用。 例如,你不仅可以通过文件的名称来查找文件,还可以通过文件的所有者或者组、它们的创建时间、大小、分配的权限、最后一次访问它们的时间、关联的信息节点,甚至是文件是否属于系统上不再存在的帐户或组等等来查找文件。 -[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] 你还可以指定搜索从哪里开始,搜索应该深入到文件系统的什么位置,以及搜索结果将告诉你它所找到的文件的数量。 -而所有这些要求都可以通过 **find** 命令来处理。 +而所有这些要求都可以通过 `find` 命令来处理。 -下面提供了根据这些标准查找文件的示例。在某些命令中,错误(例如试图列出你没有读取权限的文件),错误输出将被发送到 **/dev/null**,以便我们不必查看它。在其他情况下,我们将简单地以 root 身份运行以避免这个问题。 +下面提供了根据这些要求查找文件的示例。在某些命令中,错误(例如试图列出你没有读取权限的文件)输出将被发送到 `/dev/null`,以便我们不必查看它。或者,我们可以简单地以 root 身份运行以避免这个问题。 -请记住,还其他选项存在。这篇文章涵盖了很多内容,但并不是 **find** 命令帮助你定位查找文件的所有方式。 +请记住,还有更多的其他选项。这篇文章涵盖了很多内容,但并不是 `find` 命令帮助你定位查找文件的所有方式。 ### 选择起点 -使用 **find**,您可以选择一个起点或从你所在的位置开始。请在单词“find”后输入要选择起点。例如,“find /usr” 或 “find ./bin "将在 **/usr** 目录或 **bin** 目录开始搜索,而" find ~ " 将在你的主目录中开始,即使你位于当前文件系统中的其他位置。 +使用 `find`,你可以选择一个起点或从你所在的位置开始。要选择的搜索的起点,请在单词 `find` 后输入它。例如,`find /usr` 或 `find ./bin` 将在 `/usr` 目录或当前位置下的 `bin` 目录开始搜索,而 `find ~` 将在你的主目录中开始搜索,即使你当前位于当前文件系统中的其他位置。 -[][2] +### 选择你要找的 -### 选择你想看的 +最常用的搜索策略之一是按名称搜索文件。这需要使用 `-name` 选项。 -最常用的搜索策略之一是按名称搜索文件。这需要使用 **-name** 选项。 - -默认情况下,**查找** 会显示找到的文件的完整路径。如果你在命令中添加 **-print**,你会看到同样的情况。如果你想查看与文件相关的详细信息—-例如:文件的长度、权限等,您需要在你的 **查找** 命令的末尾添加 **-ls** 命令。 +默认情况下,`find` 会显示找到的文件的完整路径。如果你在命令中添加 `-print`,你会看到同样的结果。如果你想查看与文件相关的详细信息—-例如:文件的长度、权限等,你需要在你的 `find` 命令的末尾添加 `-ls` 参数。 ``` $ find ~/bin -name tryme @@ -47,18 +45,17 @@ $ find ~/bin -name tryme -ls 917528 4 -rwx------ 1 shs shs 139 Apr 8 2019 /home/shs/bin/tryme ``` -你也可以使用子字符串来查找文件。例如,如果你将上面示例中的“tryme”替换为“try*”,你将会找到所有名称以“try”开头的文件。 +你也可以使用子字符串来查找文件。例如,如果你将上面示例中的 `tryme` 替换为 `try*`,你将会找到所有名称以 `try` 开头的文件。(LCTT 译注:如果要使用通配符 `*` ,请将搜索字符串放到单引号或双引号内,以避免通配符被 shell 所解释) -按名称查找文件可能是 **find** 命令最典型的用法,但是有很多其他的方式来查找文件,并且有很好的理由这样做。下面的部分展示了如何使用其他可用的方式。 +按名称查找文件可能是 `find` 命令最典型的用法,不过还有很多其他的方式来查找文件,并且有这样做的需要。下面的部分展示了如何使用其他可用的方式。 -此外,当按大小、组、索引节点等条件来搜索文件时,你需要确认找到的文件与你要查找的文件是否相匹配。使用 **-ls** 选项来显示细节是非常有用。 +此外,当按文件大小、组、索引节点等条件来搜索文件时,你需要确认找到的文件与你要查找的文件是否相匹配。使用 `-ls` 选项来显示细节是非常有用。 ### 通过大小查找文件 -按大小查找文件需要使用 **-size** 选项并且对相应规范使用一点技巧。如果你指定 **-size 189b**,例如,你将找到189个块长的文件,而不是189个字节。对于字节,你需要使用 **--size 189c**(字符)。而且,如果你指定 **--size 200w** ,你将会找到200个单词的文件——以“双字节增量”为单位的单词,而不是“我们彼此都在说的那些事情”中的单词。你还可以通过以千字节(k)、兆字节(M)和千兆字节(G)为单位提供大小来查找文件。 +按大小查找文件需要使用 `-size` 选项并且对相应规范使用一点技巧。例如,如果你指定 `-size 189b`,你将找到 189 个块大小的文件,而不是 189 个字节。(LCTT 译注:如果不跟上单位,默认单位是 `b`。一个块是 512 个字节大小,不足或正好 512 个字节将占据一个块。)对于字节,你需要使用 `--size 189c`(字符)。而且,如果你指定 `--size 200w` ,你将会找到 200 个“word”的文件——以“双字节增量”为单位的字,而不是“我们互相谈论的那些事情”中的单词。你还可以通过以千字节(`k`)、兆字节(`M`)和千兆字节(`G`)为单位提供大小来查找文件。(LCTT 译注:乃至还有 `T`、`P`) - -大多数情况下,Linux用户会搜索比所选文件大的文件。例如,要查找大于1千兆字节的文件,你可以使用这样的命令,其中 +1G 表示“大于1千兆字节”: +大多数情况下,Linux 用户会搜索比选定大小要大的文件。例如,要查找大于 1 千兆字节的文件,你可以使用这样的命令,其中 `+1G` 表示“大于 1 千兆字节”: ``` $ find -size +1G -ls 2>/dev/null @@ -66,9 +63,9 @@ $ find -size +1G -ls 2>/dev/null 801834 1052556 -rw-rw-r-- 1 shs shs 1077809525 Dec 21 2018 ./2019/hold.zip ``` -### 通过索引节点查找文件 # +### 通过索引节点号查找文件 -你可以通过用于维护文件元数据(即除文件内容和文件名之外的所有内容)的索引节点来查找文件。 +你可以通过用于维护文件元数据(即除文件内容和文件名之外的所有内容)的索引节点来查找文件。 ``` $ find -inum 919674 -ls 2>/dev/null @@ -77,14 +74,14 @@ $ find -inum 919674 -ls 2>/dev/null ### 查找具有特定文件所有者或组的文件 -按所有者或组查找文件也非常简单。这里我们使用 sudo 来解决权限问题。 +按所有者或组查找文件也非常简单。这里我们使用 `sudo` 来解决权限问题。 ``` -$ sudo find /home -user nemo -name "*.png"-ls +$ sudo find /home -user nemo -name "*.png" -ls 1705219 4 drwxr-xr-x 2 nemo nemo 4096 Jan 28 08:50 /home/nemo/Pictures/me.png ``` -在这个命令中,我们寻找一个被称为 “admins” 的多用户组拥有的文件。 +在下面这个命令中,我们寻找一个被称为 `admins` 的多用户组拥有的文件。 ``` # find /tmp -group admins -ls @@ -93,18 +90,18 @@ $ sudo find /home -user nemo -name "*.png"-ls ### 查找没有所有者或组的文件 -你可以使用如下命令所示的 **-nouser** 选项来查找系统上没有任何现存用户属性的文件。 +你可以使用如下命令所示的 `-nouser` 选项来查找不属于当前系统上的任何用户的文件。 ``` # find /tmp -nouser -ls 262204 4 -rwx------ 1 1016 1016 17 Feb 17 16:42 /tmp/hello ``` -请注意,该列表显示了旧用户的 UID 和 GID,这清楚地表明该用户未在系统上定义。这种命令将查找由于帐户已从系统中删除的用户在非主目录中创建的文件,或者在用户帐户被删除后未被删除的主目录中创建的文件。类似地,**-nogroup** 选项会找到这样的文件,尤其是当这些用户是相关组的唯一成员时。 +请注意,该列表显示了旧用户的 UID 和 GID,这清楚地表明该用户未在系统上定义。这种命令将查找帐户已从系统中删除的用户创建在主目录之外的文件,或者在用户帐户被删除后而未被删除的主目录中创建的文件。类似地,`-nogroup` 选项也会找到这样的文件,尤其是当这些用户是相关组的唯一成员时。 ### 按上次更新时间查找文件 -在此命令中,我们在特定用户的主目录中查找过去24小时内更新过的文件。**sudo** 用于搜索另一个用户的主目录。 +在此命令中,我们在特定用户的主目录中查找过去 24 小时内更新过的文件。`sudo` 用于搜索另一个用户的主目录。 ``` $ sudo find /home/nemo -mtime -1 @@ -115,18 +112,18 @@ $ sudo find /home/nemo -mtime -1 ### 按上次更改权限的时间查找文件 -**-ctime** 选项可以帮助你查找在某个参考时间范围内状态(如权限)发生更改的文件。以下是查找在最后一天内权限发生更改的文件的示例: +`-ctime` 选项可以帮助你查找在某个参考时间范围内状态(如权限)发生更改的文件。以下是查找在最后一天内权限发生更改的文件的示例: ``` $ find . -ctime -1 -ls 787987 4 -rwxr-xr-x 1 shs shs 189 Feb 11 07:31 ./tryme ``` -请记住,显示的日期和时间反映了文件内容的最后更新。你需要使用像 **stat** 这样的命令来查看与文件相关联的三个状态(文件创建、修改和状态更改)。 +请记住,显示的日期和时间只反映了对文件内容进行的最后更新。你需要使用像 `stat` 这样的命令来查看与文件相关联的三个状态(文件创建、修改和状态更改)。 -### Finding files based on last access times +### 按上次访问的时间查找文件 -在这个命令中,我们使用 **-atime** 选项查找在过去两天内访问过的本地 pdf 文件。 +在这个命令中,我们使用 `-atime` 选项查找在过去两天内访问过的本地 pdf 文件。 ``` $ find -name "*.pdf" -atime -2 @@ -135,7 +132,7 @@ $ find -name "*.pdf" -atime -2 ### 根据文件相对于另一个文件的时间来查找文件 -你可以使用 -newer 选项来查找比其他文件更新的文件。 +你可以使用 `-newer` 选项来查找比其他文件更新的文件。 ``` $ find . -newer dig1 -ls @@ -144,23 +141,23 @@ $ find . -newer dig1 -ls 791846 4 -rw-rw-r-- 1 shs shs 649 Feb 13 14:26 ./dig ``` -没有相应的 **-older** 选项,但是你可以用**,得到类似的结果 **! -newer**(即更旧),这意味着几乎相同的事情。 +没有相应的 `-older` 选项,但是你可以用 `! -newer` (即更旧)得到类似的结果,它们基本上一样。 ### 按类型查找文件 通过文件类型找到一个文件,你有很多选项——常规文件、目录、块和字符文件等等。以下是文件类型选项列表: ``` -b block (buffered) special -c character (unbuffered) special -d directory -p named pipe (FIFO) -f regular file -l symbolic link -s socket +b 块特殊文件(缓冲的) +c 字符特殊文件(无缓冲的) +d 目录 +p 命名管道(FIFO) +f 常规文件 +l 符号链接 +s 套接字 ``` -这里有一个寻找符号链接的例子: +这里有一个寻找符号链接的例子: ``` $ find . -type l -ls @@ -170,7 +167,7 @@ $ find . -type l -ls ### 限制查找的深度 -**-mindepth** 和 **-maxdepth** 选项控制在文件系统中搜索的深度(从当前位置或起始点开始)。 +`-mindepth` 和 `-maxdepth` 选项控制在文件系统中搜索的深度(从当前位置或起始点开始)。 ``` $ find -maxdepth 3 -name "*loop" @@ -181,7 +178,7 @@ $ find -maxdepth 3 -name "*loop" ### 查找空文件 -在这个命令中,我们寻找空文件,但不超过目录及其子目录。 +在这个命令中,我们寻找空文件,但不进入目录及其子目录。 ``` $ find . -maxdepth 2 -empty -type f -ls @@ -191,7 +188,7 @@ $ find . -maxdepth 2 -empty -type f -ls ### 按权限查找文件 -你可以使用 **-perm** 选项查找具有特定权限集的文件。在下面的示例中,我们只查找常规文件(**-type f**),以避免看到默认情况下被赋予这些权限的符号链接,即使它们引用的文件是受限的。 +你可以使用 `-perm` 选项查找具有特定权限集的文件。在下面的示例中,我们只查找常规文件(`-type f`),以避免看到符号链接,默认情况下符号链接被赋予了这种权限,即使它们所引用的文件是受限的。 ``` $ find -perm 777 -type f -ls @@ -201,26 +198,24 @@ find: ‘./.dbus’: Permission denied ### 使用查找来帮助你删除文件 -如果使用如下命令,你可以使用 find 命令定位并删除文件: +如果使用如下命令,你可以使用 `find` 命令定位并删除文件: ``` $ find . -name runme -exec rm {} \; ``` -{} 代表根据搜索条件找到的每个文件的名称。 +`{}` 代表根据搜索条件找到的每个文件的名称。 -一个非常有用的选项是将 **-exec** 替换为 **-ok**。当您这样做时,**find** 会在删除任何文件之前要求确认。 +一个非常有用的选项是将 `-exec` 替换为 `-ok`。当你这样做时,`find` 会在删除任何文件之前要求确认。 ``` $ find . -name runme -ok rm -rf {} \; < rm ... ./bin/runme > ? ``` -删除文件并不是 **-ok** 和 **-rm** 能为你做的唯一事情。例如,你可以复制、重命名或移动文件。 +删除文件并不是 `-ok` 和 `-exec` 能为你做的唯一事情。例如,你可以复制、重命名或移动文件。 -确实有很多选择可以有效地使用 find 命令,毫无疑问还有一些在本文中没有涉及到。我希望你已经找到一些新的,特别有帮助的。 - -加入[Facebook][3]和[LinkedIn][4]上的网络世界社区,评论最热门的话题。 +确实有很多选择可以有效地使用 `find` 命令,毫无疑问还有一些在本文中没有涉及到。我希望你已经找到一些新的,特别有帮助的。 -------------------------------------------------------------------------------- @@ -229,7 +224,7 @@ via: https://www.networkworld.com/article/3527420/how-to-find-what-you-re-lookin 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b555e5b49fb433f61b3cc767efbb078fe031e740 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 6 Mar 2020 11:39:57 +0800 Subject: [PATCH 313/315] PUB @heguangzhi https://linux.cn/article-11966-1.html --- ... How to find what you-re looking for on Linux with find.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200219 How to find what you-re looking for on Linux with find.md (99%) diff --git a/translated/tech/20200219 How to find what you-re looking for on Linux with find.md b/published/20200219 How to find what you-re looking for on Linux with find.md similarity index 99% rename from translated/tech/20200219 How to find what you-re looking for on Linux with find.md rename to published/20200219 How to find what you-re looking for on Linux with find.md index a6d515943e..4b2ca325ef 100644 --- a/translated/tech/20200219 How to find what you-re looking for on Linux with find.md +++ b/published/20200219 How to find what you-re looking for on Linux with find.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11966-1.html) [#]: subject: (How to find what you’re looking for on Linux with find) [#]: via: (https://www.networkworld.com/article/3527420/how-to-find-what-you-re-looking-for-on-linux-with-find.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From 443afcf48aa2b8604169a5ef139574c5ca2518fc Mon Sep 17 00:00:00 2001 From: wetshoes <43409711+Fisherman110@users.noreply.github.com> Date: Fri, 6 Mar 2020 11:54:30 +0800 Subject: [PATCH 314/315] Fisherman110 translating (#17652) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update 20180306 Exploring free and open web fonts.md * Update 20180306 Exploring free and open web fonts.md 2020.3.4 * Update 20180306 Exploring free and open web fonts.md * Update 20180306 Exploring free and open web fonts.md * Update 20180306 Exploring free and open web fonts.md * Update 20180306 Exploring free and open web fonts.md first version * Update 20180306 Exploring free and open web fonts.md * Update 20180306 Exploring free and open web fonts.md * Update and rename sources/tech/20180306 Exploring free and open web fonts.md to translated/tech/ Exploring free and open web fonts.md 这是我第一次在LCTT翻译文章,可能会有比较多不足,请校对的朋友不吝指正! * Rename Exploring free and open web fonts.md to 20180306 Exploring free and open web fonts.md Co-authored-by: Xingyu.Wang --- ...80306 Exploring free and open web fonts.md | 72 ------------------ ...80306 Exploring free and open web fonts.md | 73 +++++++++++++++++++ 2 files changed, 73 insertions(+), 72 deletions(-) delete mode 100644 sources/tech/20180306 Exploring free and open web fonts.md create mode 100644 translated/tech/20180306 Exploring free and open web fonts.md diff --git a/sources/tech/20180306 Exploring free and open web fonts.md b/sources/tech/20180306 Exploring free and open web fonts.md deleted file mode 100644 index d01accfbce..0000000000 --- a/sources/tech/20180306 Exploring free and open web fonts.md +++ /dev/null @@ -1,72 +0,0 @@ -Fisherman110 translating - -Exploring free and open web fonts -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-lead-docdish-yellow-typewriter-keys.png?itok=0sPgIdMG) - -There is no question that the face of the web has been transformed in recent years by open source fonts. Prior to 2010, the only typefaces you were likely to see in a web browser were the generic "web safe" [core fonts][1] from Microsoft. But that year saw the start of several revolutions: the introduction of the Web Open Font Format ([WOFF][2]), which offered an open standard for efficiently delivering font files over HTTP, and the launch of web-font services like [Google Fonts][3] and the [Open Font Library][4]—both of which offered web publishers access to a large collection of fonts, for free, available under open licenses. - -It is hard to overstate the positive impact of these events on web typography. But it can be all too easy to equate the successes of open web fonts with open source typography as a whole and conclude that the challenges are behind us, the puzzles solved. That is not the case, so if you care about type, the good news is there are a lot of opportunities to get involved in improvement. - -For starters, it's critical to understand that Google Fonts and Open Font Library offer a specialized service—delivering fonts in web pages—and they don't implement solutions for other use cases. That is not a shortcoming on the services' side; it simply means that we have to develop other solutions. - -There are a number of problems to solve. Probably the most obvious example is the awkwardness of installing fonts on a desktop Linux machine for use in other applications. You can download any of the web fonts offered by either service, but all you will get is a generic ZIP file with some TTF or OTF binaries inside and a plaintext license file. What happens next is up to you to guess. - -Most users learn quickly that the "right" step is to manually copy those font binaries into any one of a handful of special directories on their hard drive. But that just makes the files visible to the operating system; it doesn't offer much in the way of a user experience. Again, this is not a flaw with the web-font service; rather it's evidence of the point where the service stops and more work needs to be done on the other side. - -A big improvement from the user's perspective would be for the OS or the desktop environment to be smarter at this "just downloaded" stage. Not only would it install the font files to the right location but, more importantly, it could add important metadata that the user will want to access when selecting a font to use in a project. - -What this additional information consists of and how it is presented to the user is tied to another challenge: Managing a font collection on Linux is noticeably less pleasant than on other operating systems. Periodically, font manager applications appear (see [GTK+ Font Manager][5] for one of the most recent examples), but they rarely catch on. I've been thinking a lot about where I think they come up short; one core factor is they have limited themselves to displaying only the information embedded in the font binary: basic character-set coverage, weight/width/slope settings, embedded license and copyright statements, etc. - -But a lot of decisions go into the process of selecting a font for a job besides what's in this embedded data. Serious font users—like information designers, journal article authors, or book designers—make their font-selection decisions in the context of each document's requirements and needs. That includes license information, naturally, but it includes much more, like information about the designer and the foundry, stylistic trends, or details about how the font works in use. - -For example, if your document includes both English and Arabic text, you probably want a font where the Latin and Arabic glyphs were designed together by someone experienced with the two scripts. Otherwise, you'll waste a ton of time making tiny adjustments to the font sizes and line spacing trying to get the two languages to mix well. You may have learned from experience that certain designers or vendors are better at multi-script design than others. Or it might be relevant to your project that today's fashion magazines almost exclusively use "[Didone][6]"-style typefaces, a name that refers to super-high-contrast styles pioneered by [Firmin Didot][7] and [Giambattista Bodoni][8] around 200 years ago. It just happens to be the trend. - -But none of those terms (Didone, Didot, or Bodoni) are likely to show up in the binary's embedded data, nor is easy to tell whether the Latin and Arabic fit together or anything else about the typeface's back history. That information might appear in supplementary material like a type specimen or font documentation—if any exists. - -A specimen is a designed document (often a PDF) that shows the font in use and includes background information; it frequently serves a dual role as a marketing piece and a sample to look at when choosing a font. The considered design of a specimen showcases how the font functions in practice and in a manner that an automatically generated character table simply cannot. Documentation may include some other vital information, like how to activate the font's OpenType features, what mathematical or archaic forms it provides, or how it varies stylistically across supported languages. Making this sort of material available to the user in the font-management application would go a long way towards helping users find the fonts that fit their projects' needs. - -Of course, if we're going to consider a font manager that can handle documentation and specimens, we also have to take a hard look at what comes with the font packages provided by distributions. Linux users start with a few fonts automatically installed, and repository-provided packages are the only font source most users have besides downloading the generic ZIP archive. Those packages tend to be pretty bare-bones. Commercial fonts generally include specimens, documentation, and other support items, whereas open source fonts usually do not. - -There are some excellent examples of open fonts that do provide quality specimens and documentation (see [SIL Gentium][9] and [Bungee][10] for two distinctly different but valid approaches), but they rarely (if ever) make their way into the downstream packaging chain. We plainly can do better. - -There are some technical obstacles to offering a richer user experience for interacting with the fonts on your system. For one thing, the [AppStream][11] metadata standard defines a few [parameters][12] specific to font files, but so far includes nothing that would cover specimens, designer and foundry information, and other relevant details. For another, the [SPDX][13] (Software Package Data Exchange) format does not cover many of the software licenses (and license variants) used to distribute fonts. - -Finally, as any audiophile will tell you, a music player that does not let you edit and augment the ID3 tags in your MP3 collection is going to get frustrating quickly. You want to fix errors in the tags, you want to add things like notes and album art—essentially, you want to polish your library. You would want to do the same to keep your local font library in a pleasant-to-use state. - -But editing the embedded data in a font file has been taboo because fonts tend to get embedded and attached to other documents. If you monkey with the fields in a font binary, then redistribute it with your presentation slides, anyone who downloads those slides can end up with bad metadata through no fault of their own. So anyone making improvements to the font-management experience will have to figure out how to strategically wrangle repeated changes to the embedded and external font metadata. - -In addition to the technical angle, enriching the font-management experience is also a design challenge. As I said above, good specimens and well-written documentation exist for several open fonts. But there are many more packages missing both, and there are a lot of older font packages that are no longer being maintained. That probably means the only way that most open font packages are going to get specimens or documentation is for the community to create them. - -Perhaps that's a tall order. But the open source design community is bigger than it has ever been, and it is a highly motivated segment of the overall free and open source software movement. So who knows; maybe this time next year finding, downloading, and using fonts on a desktop Linux system will be an entirely different experience. - -One train of thought on the typography challenges of modern Linux users includes packaging, document design, and maybe even a few new software components for desktop environments. There are other trains to consider, too. The commonality is that where the web-font service ends, matters get more difficult. - -The best news, from my perspective, is that there are more people interested in this topic than ever before. For that, I think we have the higher profile that open fonts have received from big web-font services like Google Fonts and Open Font Library to thank. - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/3/webfonts - -作者:[Nathan Willis][a] -译者:[译者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/n8willis -[1]:https://en.wikipedia.org/wiki/Core_fonts_for_the_Web -[2]:https://en.wikipedia.org/wiki/Web_Open_Font_Format -[3]:https://fonts.google.com/ -[4]:https://fontlibrary.org/ -[5]:https://fontmanager.github.io/ -[6]:https://en.wikipedia.org/wiki/Didone_(typography) -[7]:https://en.wikipedia.org/wiki/Firmin_Didot -[8]:https://en.wikipedia.org/wiki/Giambattista_Bodoni -[9]:https://software.sil.org/gentium/ -[10]:https://djr.com/bungee/ -[11]:https://www.freedesktop.org/wiki/Distributions/AppStream/ -[12]:https://www.freedesktop.org/software/appstream/docs/sect-Metadata-Fonts.html -[13]:https://spdx.org/ diff --git a/translated/tech/20180306 Exploring free and open web fonts.md b/translated/tech/20180306 Exploring free and open web fonts.md new file mode 100644 index 0000000000..605f7514e7 --- /dev/null +++ b/translated/tech/20180306 Exploring free and open web fonts.md @@ -0,0 +1,73 @@ + +探索免费而开放的网络字体 +====== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-lead-docdish-yellow-typewriter-keys.png?itok=0sPgIdMG) + +毫无疑问,近些年来互联网的面貌已经被开放免费的字体所改变。在早些的2010年,你在网络浏览器上几乎只能看到微软制作的最普通的“网络安全字体”[core fonts] +[1]。但这一年(2010)正好是好几轮技术革新开始的见证之年:Web开放字体格式的应用给网络高效传输字体文件提供了一个开放的标准,像[Google Fonts]和 +[Open Font Library]这样的网络字体服务使网络内容发布者在开放证书证书下可以免费使用海量的字体库。 + +要夸大这些网络排印领域大事件的积极影响是很难的。但是要将网络开放字体的成功与开源的网络排印划上等号作为一个整体却非常容易,而且得到的结论是挑战已经远离了我们,困难悉数被解决了。然而事实并非如此,如果你很关注网络字体,好消息是你会有非常多的机会参与到对这些字体的改进工作当中去。 + +对新手来说,必须要意识到谷歌字体和开源字体库为网页提供了特殊的”服务提供“(service—delivering)字体但是他们给其他使用情况制定字体解决方案。这不是服务方的短视,这是是意味这我们必须去建立其他的解决方案。 + +需要解决的问题还非常多。可能最明显的例子就是给linux桌面机器的其他软件安装字体使用所遇到的尴尬情况。你可以通过任何一种服务下载任何一种网络字体,但是你能得到的是一个最普通的压缩包文件,里面有一些TTF或OTF二进制文件和一个普通文本文件的证书。接下来会发生什么完完全全需要你去猜。 + +大部分用户很快学会了”正确“的步骤就是手动地复制这些字体二进制文件到他们硬件驱动里一大把的文件夹里的某个文件夹里。但是这样做只能使这个文件被操作系统检索到。它并不能为用户体验带来什么。再强调一遍,这不是网络字体服务的缺陷,然而它是对于关于服务到哪里停止和更多工作需要在其他方面做这个观点的证据。 + +在用户视角来说,一个巨大的提升可能就是直接在“下载“这个阶段系统或者桌面环境变得更智能。它(系统或桌面环境)不仅会把字体文件安装到正确的位置上,更重要的是,当用户选择在一个工程使用的字体时,它会自己添加用户所需要得到的重要的元数据。 + +附加信息的组成与它如何展示给用户连接着另一个挑战:在linux环境管理一个字体库明显不如任何其他操作系统愉快。字体管理软件总是时不时的出现一下(例如[GTK+ Font Manager][5] 这是最近的一个例子),但是他们(字体管理软件)很少能正确的时候出现。我一直在思考一大堆这些软件让人失望的方面。一个核心的原因是他们把自己限制只展示自己在二进制字体文件内嵌的信息:基本字符集的覆盖,粗细,宽度,和斜度的设定,内置的证书和版权说明等等。 + +但是在选择字体的过程中为了工作的选择(字体)都不能在内置数据中找到。正经的字体用户像信息设计者,杂志文章作者,或者书籍美工设计者,他们的字体选择是在每一份文件的需求上做出的。这些需求包含了证书信息,很自然的,它还包含了更多,像关于设计师和厂商的信息,潮流风格的趋势,或者字体在使用当中的细节。 + +举个例子,如果你的文档包含了英语和阿拉伯文,你多半想要一种某个很熟悉拉丁文和阿拉伯文设计师设计同时设计两种语言的字体。否则,你将浪费一大堆时间来微调字体大小和行间距来使两种语言良好地结合在一起。你可能从经验中学到,特定的设计师或服务商(字体)比其他人更善于多语言设计。或许和你职业相关的是今天的时尚杂志几乎无一例外的采用"[Didone][6]"风格的字体,"[Didone][6]"是指一种两百多年前最先被[Firmin Didot][7] 和 [Giambattista Bodoni][8]设计出来的反差超级大的字体风格。这种字体恰好就是现在的潮流。 + +但是这些字体(Didone, Didot, or Bodoni)中没有一种有可能会出现在内置的二进制文件中,你也不容易发现拉丁文和阿拉伯文是否相得益彰或其他关于字体的背后故事。这些信息有可能出现在补充的材料中,类似某种样本或字体文件中,如果这些东西存在的话。 + +字体样本是一份设计好的文档(一般是PDF),它展示了这种字体在使用的情况而且包括了背景信息。字体样本经常起到两重作用,作为市场样本和在挑选字体时的样本。一份样品精心的设计展示了字体在实际应用中的情况和一种自动生产字符表所不能形成的风格。字体样本文件也有可能包含了一些其他重要信息,比如怎样激活字体的开放特色,它提供了什么样的数学表达式和古体字,或者它怎么在跨支持的语言上风格多样。要使这些资源能够被字体管理软件上的用户使用还要走过帮助用户找到合适他们工程的字体的漫长之路。 + +当然,如果我们要去考虑一个字体管理软件能够解决文件和样本问题,我们也必须仔细观察各种发行版提供的字体包伴随着什么。linux的用户刚开始只有自动安装的那几种字体,并且提供仓库的包是大部分用户除了下载最普通的压缩包档案之外的唯一字体来源。这些资源包往往非常的“骨感”。商业字体总的来说都包含了样本,文档,还有其他的支持项目,然而开源字体往往没有(这些配套文件)。 + +也有一些很棒的开源字体提供了高质量的样本和文档的例子(例如 [SIL Gentium][9] 和 [Bungee][10] 是两种极度不一样但是有效的方案),但是他们几乎不涉足下端的整合包链条。我们肯定能做的(比他们)更好。 + +在和系统的字体交互方面提供更丰富的用户体验上面还有一些技术问题。比如说,[AppStream][11]的元数据标准定义了几项针对字体文件的参数,但是现在为止这些参数没有包含样本,设计师和厂商,和其他相关细节的任何信息。另外一个例子,[SPDX][13] (软件包信息交换)格式也没有包含很多软件证书(和证书参数),这些软件证书是用来分配指定字体的。 + +最后,就像任何一个唱片爱好者都会告诉你,一个不允许你编辑和完善你的mp3库的ID3信息(mp3头部的一个字节,记录歌手信息)的音乐播放器很快就会变得让人失望。你想要处理标志里的错误,你想要添加比如笔记和乐队,艺术家这样的基本信息,你想要提升你的音乐库。你可能想要做一样的事情来使你的本地字体仓库保持在一个方便使用的状态。 + +但是改动字体文件的内置数据已经被禁止了,因为字体往往是被内置或附加到其他文件里的。如果你拿字体二进制文件来胡闹的话,那么你需要重新为你的展示幻灯片分配字体,任何一个人下载这些幻灯片最终都会面对错误的元数据但他们自己并没有过失。所以任何一个要提升字体管理体验的人都要弄清楚如何来战略的讨论内置或外置的字体元数据里反反复复的变化。 + +除了技术角度之外,丰富字体管理的体验也是一个设计的挑战。就像我前面说的一样,有几种开放的字体也带了良好的样本和精心写好的证明文件。但是有更多的字体包两者都没有,还有大量的更老的字体包已经没有人维护了。这很可能意味着大部分开放字体包想要获得样本和证明文件的唯一办法就是让(字体)社区去为它们创造。 + +可能那(前面说的)是一个很高的要求。但是开源设计社区现在比它以前任何时候都要庞大,并且它(社区)是全面免费开源软件运动中的一个高度活跃的组成部分。所以谁知道呢。可能明年这个时候会发现,在linux桌面系统下载和使用字体会变成一种完全不同的体验。 + +在关于现代Linux用户的文字设计上的挑战的一连串思考中包含了打包文件,证明文件设计,甚至有可能需要在桌面环境加入不少新的软件成分。还有其他一连串的东西也需要考虑。共通性就是在网络字体服务不及的地方,事情就变得更加困难。 + +最好的消息是,从我的视角来看,就是现在比起以前有更多的人对这个议题感兴趣。我认为我们要感谢像谷歌字体和开放字体库这样的网络字体服务巨头让开放字体得到了更高的关注。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/3/webfonts + +作者:[Nathan Willis][a] +译者:https://github.com/Fisherman110 +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/n8willis +[1]:https://en.wikipedia.org/wiki/Core_fonts_for_the_Web +[2]:https://en.wikipedia.org/wiki/Web_Open_Font_Format +[3]:https://fonts.google.com/ +[4]:https://fontlibrary.org/ +[5]:https://fontmanager.github.io/ +[6]:https://en.wikipedia.org/wiki/Didone_(typography) +[7]:https://en.wikipedia.org/wiki/Firmin_Didot +[8]:https://en.wikipedia.org/wiki/Giambattista_Bodoni +[9]:https://software.sil.org/gentium/ +[10]:https://djr.com/bungee/ +[11]:https://www.freedesktop.org/wiki/Distributions/AppStream/ +[12]:https://www.freedesktop.org/software/appstream/docs/sect-Metadata-Fonts.html +[13]:https://spdx.org/ From 53ffe89b6b1498bb3e1fccf63480544e0000d30d Mon Sep 17 00:00:00 2001 From: Hank Chow <280630620@qq.com> Date: Fri, 6 Mar 2020 12:16:45 +0800 Subject: [PATCH 315/315] hankchow translated --- ...ger That Doesn-t Need Your Phone Number.md | 143 ------------------ ...ger That Doesn-t Need Your Phone Number.md | 142 +++++++++++++++++ 2 files changed, 142 insertions(+), 143 deletions(-) delete mode 100644 sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md create mode 100644 translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md diff --git a/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md b/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md deleted file mode 100644 index 15529537a0..0000000000 --- a/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md +++ /dev/null @@ -1,143 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Session: An Open Source Private Messenger That Doesn’t Need Your Phone Number) -[#]: via: (https://itsfoss.com/session-messenger/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Session: An Open Source Private Messenger That Doesn’t Need Your Phone Number -====== - -_**Brief: Our open source software highlight of the week is Session. It is a fork of another increasingly popular private messenger Signal. Session doesn’t even need your phone number to operate.**_ - -### Session: A private messenger in true sense - -![][1] - -Privacy concerned people are always in the search of an ultimate service that lets you communicate securely while respecting our privacy across multiple platforms. - -Recently, I came across an interesting open-source messaging app “[Session][2]” by [Loki Foundation][3], which is technically a fork of another [open source encrypted messenger Signal][4]. - -In this article, I’ll be sharing my experience with the Session app while highlighting the features it offers. - -Session is fairly new to the scene – I’ve mentioned some of the bugs that I encountered at the bottom of the article. - -### Features of Session Messenger - -I’ll highlight the key features of Session that will help you decide if it’s good enough for you to try. - -#### Session does not require a phone number - -![][5] - -For privacy-enthusiasts, registering the phone number with Signal or other such applications is a potential risk. - -But, with Session, you do not need a phone number, simply click on “**Create Account**” after you install it on your desktop or phone and it will simply generate a random (unique) **Session ID**. - -It’ll look something like this: **05652245af9a8bfee4f5a8138fd5c……..** - -So, you just have to share your Session ID with the contact you want to add. Or, you can also opt to get the **QR Code** after account creation which you can share with your friends to add you back. - -#### Session uses blockchain (and other crypto tech) - -![Session ID][6] - -For the users who’re aware of what a [blockchain][7] is – they’ve been waiting for real-world applications that an average user can utilize. Session is one such example that utilizes blockchain at its core and you don’t need to know it’s there. - -If you’re curious about how it works, you can take a look at their [official blog post][8] explaining it. - -#### Cross-Platform Support - -![][9] - -For something strictly privacy-focused, you’d also want it to be available across multiple platforms. - -Of course, primarily, I’d focus on the Linux and Android support but it also supports Windows/Mac/iOS. So, you can easily sync between multiple devices cross-platform. - -#### Includes Essential Privacy Options - -![][10] - -Undoubtedly, it offers some essential privacy-focused features that will help make the experience more secure. - -For starters, you have the following options: - - * **Message TTL**: This lets you control how long the message exists before the recipient sees the message. - * **Read Receipts**: Let others know that you’ve seen the message or if your message has been read. - - - -#### Session uses a decentralized network and protects your metadata - -Even though Session isn’t a peer-to-peer technology, it does not have a central server for the network. - -It takes a decentralized approach to how the messages are transmitted (or routed). If you’ve no idea what I’m talking about, you can follow Session’s official blog post to know the [difference between centralization and decentralization][11] and explore how it potentially works. - -And, this approach of network helps them to protect the metadata (the information associated with a message like IP address). - -#### Other Features - -Not just limited to the latest/greatest privacy-friendly features, but it also supports group chats, voice messages, and also allows you to send attachments. - -### Installing Session on Linux - -If you head to the [official download page][12], you will be able to download an .**AppImage** file. In case you have no clue how it works, you should take a look at our article on [how to use AppImage][13]. - -In either case, you can also head to their [GitHub releases page][14] and grab the **.deb** file. - -[Download Session][12] - -### My Experience On Using Session App - -I’ve managed to try it on multiple platforms. For the desktop, I utilized the .AppImage file on **Pop!_OS 19.10** to run Session. - -Overall, the user experience was impressive and had no UI glitches. - -It’s also easy to recover your account once you’ve backed up your secret code (which is known as **seed**) from the settings. - -![][15] - -But, I also noticed a couple of issues- which can be fixed/improved: - - * Delay in accepting a friend request - * The way of linking devices is not intuitive - * Sometimes when you reply from two separate devices (using the same ID), the receiver gets two different conversations. - - - -**Conclusion** - -Of course, nothing’s ever perfect. For now, I’m thinking of keeping it installed and considering Session’s features, it is definitely something a privacy-focused user should try. - -What do you think about it? Feel free to let me know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/session-messenger/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-app.jpg?ssl=1 -[2]: https://getsession.org/ -[3]: https://loki.foundation/ -[4]: https://itsfoss.com/signal-messaging-app/ -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-create.jpg?ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/session-application-id.jpg?ssl=1 -[7]: https://en.wikipedia.org/wiki/Blockchain -[8]: https://getsession.org/how-session-protects-your-anonymity-with-blockchain-and-crypto/ -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-cross-platform.jpg?ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-settings.jpg?fit=800%2C512&ssl=1 -[11]: https://getsession.org/centralisation-vs-decentralisation-in-private-messaging/ -[12]: https://getsession.org/download/ -[13]: https://itsfoss.com/use-appimage-linux/ -[14]: https://github.com/loki-project/session-desktop/releases -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-seed.jpg?ssl=1 diff --git a/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md b/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md new file mode 100644 index 0000000000..3cb2f915c4 --- /dev/null +++ b/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md @@ -0,0 +1,142 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Session: An Open Source Private Messenger That Doesn’t Need Your Phone Number) +[#]: via: (https://itsfoss.com/session-messenger/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Session:一款不需要电话号码的开源通信应用 +====== + +Signal 作为一款私人通信应用,正在变得愈发流行。而我们下面要介绍开源应用 Session 则是 Signal 的一个复刻fork,它的一大亮点是并不需要提供手机号码即可以开始使用。 + +### Session:一款真正意义上的私人通信应用 + +![][1] + +对于私人通信服务来说,有没有既能保护通信安全性,又尊重用户跨平台隐私的集大成者呢?很多注重个人隐私的用户似乎都在寻找这个问题的答案。 + +最近,我留意到 [Loki Foundation][3] 开发的一款叫做 [Session][2] 的开源通信应用。从技术上来说,Session 是另一款[开源、加密的通信应用 Signal][4] 的一个复刻。 + +在本文中,我会讲述我自己使用 Session 的体验,以及 Session 的一些主要功能。 + +Session 在这个领域中算是一款比较新的应用了,因此我还会在文章的最后提到它的一些不足之处。 + +### Session 的一些主要功能 + +接下来我会重点介绍 Session 的主要功能,可以供你参考这款应用是否值得使用。 + +#### Session 的使用过程中不需要提供手机号码 + +![][5] + +在 Signal 或者其它类似的通信应用中,用户都需要提供手机号码才得以成功注册。注重隐私的用户们都认为这样的做法会潜藏着巨大的安全隐患。 + +而使用 Session 则简单得多。在 PC 或手机上安装应用之后,只需要点击“创建账号Create Account”,无须提供手机号码,它就会生成一个类似 **05652245af9a8bfee4f5a8138fd5c……..** 这样的随机且唯一的 Session ID。 + +此后,把 Session ID 分享给想要添加的联系人就可以了。Session 还支持二维码,其他人可以通过扫描二维码添加你的 Session ID 为好友。 + +#### Session 使用了区块链等加密技术 + +![Session ID][6] + +对[区块链][7]有所了解的用户都很期待区块链能为普罗大众做出什么有实际意义的应用,而 Session 可以算得上其中一个。尽管 Session 的核心是基于区块链的,但普通用户在使用时并不需要真正弄懂区块链。 + +如果你好奇它的工作原理,可以参考这篇[官方的博客文章][8],里面有相关的解释。 + +#### 跨平台支持 + +![][9] + +这样严格保护隐私的应用,是否能在不同平台上使用? + +答案是肯定的。首先,它支持 Linux 和 Android 平台,同时也支持 Windows/Mac/iOS 平台。因此跨平台、跨设备的消息同步是没有问题的。 + +#### 包含基本隐私选项 + +![][10] + +毫无疑问,基本的隐私功能是必须有的,这是作为一个以安全为卖点的应用所必备的体验。 + +最基本的选项包括: + + * **消息有效期**:你可以控制一条消息在接收者阅读前的保留时长 + * **已读回执**:消息发送者可以知晓你已经阅读该消息 + + + +#### Session 使用去中心化网络保护你的元数据 + +尽管 Session 不使用端对端peer-to-peer技术,但它也不适用中心化的服务器。 + +Session 采用了去中心化的架构实现消息的传输和路由。如果你不熟悉这方面的内容,可以关注 Session 的官方博客,尝试了解[中心化网络和去中心化网络的区别][11],以及它的实际工作原理。 + +同时,这样的网络架构还有助于保护诸如与 IP 地址相关的信息等元数据。 + +#### 其它功能 + +除了专注于隐私之外,Session 也支持群聊、语音消息、发送附件等通信应用的基本功能。 + +### 在 Linux 上安装 Session + +在[官方下载页面][12]中可以下载到对应的 .AppImage 文件。如果你不了解这个文件的使用方法,可以查阅我们的[相关文章][13]。 + +另外,你也可以在它的 [Github 发布页面][14] 获取到对应的 .deb 安装文件。 + +[下载 Session][12] + +### 我使用 Session 的体验 + +我在各种平台上都试用过 Session,其中在 PC 上我使用了 Pop!_OS 19.10 的 .AppImage 文件运行这个应用。 + +总的来说,使用的体验很不错,用户界面也没有出现问题。 + +在设置中备份了密码(也称为种子seed)后,可以很方便地恢复账号。 + +![][15] + +当然,我也发现了一些需要改进的地方: + + * 在接受好友请求时会出现延迟 + * 设备间连接的方式不太直观 + * 当你在不同的设备上使用同一个 Session ID 向同一个人回复消息时,对方会收到两个不同的对话 + + + +### 总结 + +当然,最完美的事物是不存在的。我也会一直使用 Session 并考虑它发展的方向,这是一个注重引得的用户应该做的事情。 + +欢迎在评论区发表你的看法。 + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/session-messenger/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-app.jpg?ssl=1 +[2]: https://getsession.org/ +[3]: https://loki.foundation/ +[4]: https://itsfoss.com/signal-messaging-app/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-create.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/session-application-id.jpg?ssl=1 +[7]: https://en.wikipedia.org/wiki/Blockchain +[8]: https://getsession.org/how-session-protects-your-anonymity-with-blockchain-and-crypto/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-cross-platform.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-settings.jpg?fit=800%2C512&ssl=1 +[11]: https://getsession.org/centralisation-vs-decentralisation-in-private-messaging/ +[12]: https://getsession.org/download/ +[13]: https://itsfoss.com/use-appimage-linux/ +[14]: https://github.com/loki-project/session-desktop/releases +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-seed.jpg?ssl=1