mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-24 02:20:09 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
b6a4ff2453
@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12368-1.html)
|
||||
[#]: subject: (How to loop forever in bash on Linux)
|
||||
[#]: via: (https://www.networkworld.com/article/3562576/how-to-loop-forever-in-bash-on-linux.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
@ -10,17 +10,15 @@
|
||||
如何在 Linux 的 bash 中永远循环
|
||||
======
|
||||
|
||||
[tine ivanic][1] [(CC0)][2]
|
||||
![tine ivanic][1]
|
||||
|
||||
在 Linux 中有很多永远循环(或直到你决定停止)的方法,你可以在命令行或脚本中执行此操作。
|
||||
|
||||
**for** 和 **while** 命令使这件事非常容易。 关于语法和策略,只有几件事要牢记。
|
||||
|
||||
**另请参见[用于排除 Linux 故障的宝贵技巧][3]。**
|
||||
`for` 和 `while` 命令使这件事非常容易。关于相应的语法和策略,只有几件事要牢记。
|
||||
|
||||
### 使用 while
|
||||
|
||||
最简单的永远循环之一是使用 **while** 命令,后面跟上条件 “true”。 你不必担心诸如 **while [ 1 -eq 1 ]** 之类的逻辑或类似的测试。 **while true** 测试表示循环将一直运行,直到你使用 **CTRL-C** 停止循环、关闭终端窗口或注销为止。 这是一个例子:
|
||||
最简单的永远循环之一是使用 `while` 命令,后面跟上条件 `true`。 你不必使用诸如 `while [ 1 -eq 1 ]` 之类的逻辑或类似的测试。 `while true` 测试表示循环将一直运行,直到你使用 `CTRL-C` 停止循环、关闭终端窗口或注销为止。这是一个例子:
|
||||
|
||||
```
|
||||
$ while true
|
||||
@ -34,7 +32,7 @@ Keep running
|
||||
^C
|
||||
```
|
||||
|
||||
你也可以使用 **while :** 做同样的事情。 这里的关键是 **:** 总是返回成功,因此就像 **while true** 一样,此测试永远不会失败,并且循环会继续运行。
|
||||
你也可以使用 `while :` 做同样的事情。这里的关键是 `:` 总是返回成功,因此就像 `while true` 一样,此测试永远不会失败,并且循环会继续运行:
|
||||
|
||||
```
|
||||
$ while :
|
||||
@ -47,7 +45,7 @@ Keep running
|
||||
^C
|
||||
```
|
||||
|
||||
如果你在脚本中插入了无限循环,并想提醒使用它的人如何退出脚本,那么可以使用 **echo** 命令添加提示:
|
||||
如果你在脚本中插入了无限循环,并想提醒使用它的人如何退出脚本,那么可以使用 `echo` 命令添加提示:
|
||||
|
||||
```
|
||||
while :
|
||||
@ -60,7 +58,7 @@ done
|
||||
|
||||
### 使用 for
|
||||
|
||||
**for** 命令还提供了一种永远循环的简便方法。虽然不如 **while true** 明显,但语法相当简单。你只需要在有界循环中替换参数即可,界限通常类似于 “c 从等于 1 开始递增,直到 5”:
|
||||
`for` 命令还提供了一种永远循环的简便方法。虽然不如 `while true` 明显,但语法相当简单。你只需要在有界循环中替换参数即可,它通常类似于 “c 从等于 1 开始递增,直到 5”:
|
||||
|
||||
```
|
||||
$ for (( c=1; c<=5; c++ ))
|
||||
@ -72,7 +70,7 @@ $ for (( c=1; c<=5; c++ ))
|
||||
$ for (( ; ; ))
|
||||
```
|
||||
|
||||
没有起始值、增量或退出测试,此循环将永远运行或被强制停止。
|
||||
没有起始值、增量或退出测试,此循环将永远运行或被强制停止:
|
||||
|
||||
```
|
||||
$ for (( ; ; ))
|
||||
@ -86,11 +84,11 @@ Keep your spirits up
|
||||
Keep your spirits up
|
||||
```
|
||||
|
||||
### Why loop forever?
|
||||
### 为什么要永远循环?
|
||||
|
||||
在现实中,你不会想永远循环下去,但一直运行直到想要回家、工作完成或者遇到问题才退出并不罕见。任何构造为无限循环的循环都可以设置为根据各种情况退出。
|
||||
|
||||
该脚本将一直处理数据直到下午 5 点。 或检查发现第一次超过 5 点的时间:
|
||||
该脚本将一直处理数据直到下午 5 点,或者说检查发现第一次超过 5 点的时间:
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
@ -105,7 +103,7 @@ do
|
||||
done
|
||||
```
|
||||
|
||||
如果要退出循环而不是退出脚本,请使用 **break** 命令而不是 **exit**。
|
||||
如果要退出循环而不是退出脚本,请使用 `break` 命令而不是 `exit`。
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
@ -121,11 +119,9 @@ done
|
||||
… run other commands here …
|
||||
```
|
||||
|
||||
#### 总结
|
||||
### 总结
|
||||
|
||||
永远循环很容易。 指定要停止循环的条件需要花费一些额外的精力。
|
||||
|
||||
加入 [Facebook][4] 和 [LinkedIn][5] 上的 Network World 社区,评论热门主题。
|
||||
永远循环很容易。指定要停止循环的条件却需要花费一些额外的精力。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -134,13 +130,13 @@ via: https://www.networkworld.com/article/3562576/how-to-loop-forever-in-bash-on
|
||||
作者:[Sandra Henry-Stocker][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://unsplash.com/photos/u2d0BPZFXOY
|
||||
[1]: https://images.idgesg.net/images/article/2020/06/nw_circular-staircase_loop_infinity_nautilus_by-tine-ivanic-via-unsplash-100848725-large.jpg
|
||||
[2]: https://creativecommons.org/publicdomain/zero/1.0/
|
||||
[3]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html
|
||||
[4]: https://www.facebook.com/NetworkWorld/
|
@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12369-1.html)
|
||||
[#]: subject: (4 essential tools to set up your Python environment for success)
|
||||
[#]: via: (https://opensource.com/article/20/6/python-tools)
|
||||
[#]: author: (Moshe Zadka https://opensource.com/users/moshez)
|
||||
@ -12,35 +12,35 @@
|
||||
|
||||
> 选择的这些工具将简化你的 Python 环境,以实现顺畅和一致的开发实践。
|
||||
|
||||
![Python programming language logo with question marks][1]
|
||||

|
||||
|
||||
Python 是一门出色的通用编程语言,经常作为第一门编程语言来教授。二十年来,我为它撰写了很多本书,而它仍然是[我的首选语言][2]。虽然通常来说这门语言是简洁明了的,但是(正如 [xkcd][3] 所说的),从来没有人说过配置 Python 环境也是一样的简单。
|
||||
Python 是一门出色的通用编程语言,经常作为第一门编程语言来教授。二十年来,我为它撰写了很多本书,而它仍然是[我的首选语言][2]。虽然通常来说这门语言是简洁明了的,但是(正如 [xkcd][3] 讽刺的),从来没有人说过配置 Python 环境也是一样的简单。
|
||||
|
||||
![xkcd python illustration][4]
|
||||
|
||||
*一个复杂的Python环境。 [xkcd][3]*
|
||||
|
||||
在日常生活中有很多使用 Python 的方法。我将解释我是如何使用这些 Python 生态系统工具的,坦诚的说,我仍在寻找更多替代品。
|
||||
在日常生活中有很多使用 Python 的方法。我将解释我是如何使用这些 Python 生态系统工具的。但坦诚的说,我仍在寻找更好的替代品。
|
||||
|
||||
### 使用 pyenv 来管理 Python 版本
|
||||
|
||||
我发现在你的机器上运行一个特定版本的 Python 的最好方法是使用 `pyenv`。这个软件可以在 Linux、Mac OS X 和 WSL2 上工作:这是我通常关心的三个 “类 UNIX” 环境。
|
||||
我发现在机器上运行一个特定版本的 Python 的最好方法是使用 `pyenv`。这个软件可以在 Linux、Mac OS X 和 WSL2 上工作:这是我通常关心的三个 “类 UNIX” 环境。
|
||||
|
||||
安装 `pyenv` 本身有时会有点棘手。一种方法是使用专用的 [pyenv 安装程序][5],它使用 `curl | bash` 的方法来进行(详见说明)。
|
||||
安装 `pyenv` 本身有时会有点棘手。一种方法是使用专用的 [pyenv 安装程序][5],它使用 `curl | bash` 方法来进行(详见其说明)。
|
||||
|
||||
如果你是在 Mac 上(或者你运行 Homebrew 的其他系统),你可以按照[这里][6]的说明来安装和使用 `pyenv`。
|
||||
|
||||
按照说明安装和设置了 `pyenv` 之后,你可以使用 `pyenv global` 来设置一个 “默认的” Python 版本。一般来说,你会选择你 “最喜欢的” 版本。这通常是最新的稳定版本,但如果有其他考虑因素也可能做不同的选择。
|
||||
按照说明安装和设置了 `pyenv` 之后,你可以使用 `pyenv global` 来设置一个 “默认的” Python 版本。一般来说,你会选择你的 “首选” 版本。这通常是最新的稳定版本,但如果有其他考虑因素也可能做出不同的选择。
|
||||
|
||||
### 使用 virtualenvwrapper 让虚拟环境更简单
|
||||
|
||||
使用 `pyenv` 安装 Python 的一个好处是,你后继安装的所有后续 Python 解释器环境都是你自己的,而不属于你的操作系统。
|
||||
使用 `pyenv` 安装 Python 的一个好处是,你所有后继安装的 Python 解释器环境都是你自己的,而不是操作系统层面的。
|
||||
|
||||
虽然在 Python 本身内部安装东西通常不是最好的选择,但有一个例外:在上面选择的 “最喜欢的” Python 中,安装并配置 `virtualenvwrapper`。这样你就可以在瞬间创建和切换到虚拟环境。
|
||||
虽然在 Python 本身内部安装东西通常不是最好的选择,但有一个例外:在上面选择的 “首选” Python 中,安装并配置 `virtualenvwrapper`。这样你就可以瞬间创建和切换到虚拟环境。
|
||||
|
||||
我在[这篇文章中][7]具体介绍了如何安装和使用 `virtualenvwrapper`。
|
||||
|
||||
这里我推荐一个独特的工作流程。你可以制作一个虚拟环境,这样你就可以大量重复使用它来运行许多<ruby>运行器<rt>runner</rt></ruby>。在这个环境中,安装你最喜欢的运行器 —— 也就是你会经常用来运行其他软件的软件。就目前而言,我的首选是 `tox`。
|
||||
这里我推荐一个独特的工作流程:你可以制作一个可以大量重复运行的虚拟环境,用来做<ruby>运行器<rt>runner</rt></ruby>。在这个环境中,可以安装你最喜欢的运行器 —— 也就是你会经常用来运行其他软件的软件。就目前而言,我的首选是 `tox`。
|
||||
|
||||
### 使用 tox 作为 Python 运行器
|
||||
|
||||
@ -51,13 +51,13 @@ $ workon runner
|
||||
$ tox
|
||||
```
|
||||
|
||||
这个工作流程之所以重要,是因为我要在多个版本的 Python 和多个版本的库依赖中测试我的代码。这意味着在 `tox` 运行器中会有多个环境。有些人会尝试在最新的依赖关系中运行,有些人会尝试在冻结的依赖关系中运行(接下来会有更多的介绍),我也可能会用 `pip-compile` 在本地生成这些环境。
|
||||
这个工作流程之所以重要,是因为我要在多个版本的 Python 和多个版本的依赖库中测试我的代码。这意味着在 `tox` 运行器中会有多个环境。一些会尝试在最新的依赖关系中运行,一些会尝试在冻结的依赖关系中运行(接下来会有更多的介绍),我也可能会用 `pip-compile` 在本地生成这些环境。
|
||||
|
||||
附注:我目前正在[研究使用 nox][9] 作为 `tox` 的替代品。原因超出了本文的范围,但值得一试。
|
||||
附注:我目前正在[研究使用 nox][9] 作为 `tox` 的替代品。原因超出了本文的范畴,但值得一试。
|
||||
|
||||
### 使用 pip-compile 进行 Python 依赖性管理
|
||||
|
||||
Python 是一种动态编程语言,这意味着它在每次执行代码时都会加载其依赖关系。确切了解每个依赖项的具体运行版本可能意味着是平稳运行代码还是意外崩溃。这意味着我们必须考虑依赖管理工具。
|
||||
Python 是一种动态编程语言,这意味着它在每次执行代码时都会加载其依赖关系。能否确切了解每个依赖项的具体运行版本可能意味着是平稳运行代码还是意外崩溃。这意味着我们必须考虑依赖管理工具。
|
||||
|
||||
对于每个新项目,我都会包含一个 `requirements.in` 文件,(通常)只有以下内容:
|
||||
|
||||
@ -65,15 +65,15 @@ Python 是一种动态编程语言,这意味着它在每次执行代码时都
|
||||
.
|
||||
```
|
||||
|
||||
是的,没错。只有一个点的单行。我在 `setup.py` 文件中记录了 “松散” 的依赖关系,比如 `Twisted>=17.5`。这与 `Twisted==18.1` 这样的确切依赖关系形成了鲜明对比,后者在需要一个特性或错误修复时升级到新版本的库变得更加困难。
|
||||
是的,没错。只有一个点的单行。我在 `setup.py` 文件中记录了 “宽松” 的依赖关系,比如 `Twisted>=17.5`。这与 `Twisted==18.1` 这样的确切依赖关系形成了鲜明对比,后者在需要一个特性或错误修复时,难以升级到新版本的库。
|
||||
|
||||
`.` 的意思是 “当前目录”,它使用当前目录下的 `setup.py` 作为依赖关系的来源。
|
||||
|
||||
这意味着使用 `pip-compile requirements.in > requirements.txt` 将创建一个冻结的依赖文件。你可以在 `virtualenvwrapper` 创建的虚拟环境中或者 `tox.ini` 中使用这个依赖文件。
|
||||
这意味着使用 `pip-compile requirements.in > requirements.txt` 会创建一个冻结的依赖文件。你可以在 `virtualenvwrapper` 创建的虚拟环境中或者 `tox.ini` 中使用这个依赖文件。
|
||||
|
||||
有时,从 `requirements-dev.in`(内容:`.[dev]`)生成的 `requirements-dev.txt` 或从 `requirements-test.in`(内容:`.[test]`)生成的 `requirements-test.txt` 很有用。
|
||||
有时,也可以从 `requirements-dev.in`(内容:`.[dev]`)生成 `requirements-dev.txt`,或从 `requirements-test.in`(内容:`.[test]`)生成 `requirements-test.txt`。
|
||||
|
||||
我正在研究在这个流程中是否应该用 [dephell][10] 代替 `pip-compile`。`dephell` 工具具有许多有趣的功能,比如使用异步 HTTP 请求来下载依赖项。
|
||||
我正在研究在这个流程中是否应该用 [dephell][10] 代替 `pip-compile`。`dephell` 工具有许多有趣的功能,比如使用异步 HTTP 请求来下载依赖项。
|
||||
|
||||
### 结论
|
||||
|
||||
@ -97,8 +97,8 @@ via: https://opensource.com/article/20/6/python-tools
|
||||
[3]: https://xkcd.com/1987/
|
||||
[4]: https://opensource.com/sites/default/files/uploads/python_environment_xkcd_1.png (xkcd python illustration)
|
||||
[5]: https://github.com/pyenv/pyenv-installer
|
||||
[6]: https://opensource.com/article/20/4/pyenv
|
||||
[7]: https://opensource.com/article/19/6/python-virtual-environments-mac
|
||||
[6]: https://linux.cn/article-12241-1.html
|
||||
[7]: https://linux.cn/article-11086-1.html
|
||||
[8]: https://opensource.com/article/19/5/python-tox
|
||||
[9]: https://nox.thea.codes/en/stable/
|
||||
[10]: https://github.com/dephell/dephell
|
@ -0,0 +1,79 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Should API-restricting licenses qualify as open source?)
|
||||
[#]: via: (https://opensource.com/article/20/6/api-copyright)
|
||||
[#]: author: (Richard Fontana https://opensource.com/users/fontana)
|
||||
|
||||
Should API-restricting licenses qualify as open source?
|
||||
======
|
||||
A look at how a closely-watched legal case about copyright and APIs
|
||||
might affect open source licensing
|
||||
![Two government buildings][1]
|
||||
|
||||
In its 2014 _[Oracle v. Google][2]_ decision, the United States Court of Appeals for the Federal Circuit held that the method declarations and "structure, sequence, and organization" (SSO) of the Java SE API were protected by copyright. This much-criticized result contradicted a decades-old industry and professional consensus assumption that APIs were in the public domain, reflected in an ongoing common practice of successive reimplementation of APIs, and persisting even after the general copyrightability of software was settled by statute. Unsurprisingly, that consensus shaped the view of APIs from within open source. Open source licenses, in particular, do not address APIs, and their conditions have not customarily been understood to apply to APIs.
|
||||
|
||||
If the copyrightability ruling survives its current [review][3] by the United States Supreme Court, there is reason to worry that _Oracle v. Google_ will eventually have some detrimental impact on open source licensing. License authors might draft new licenses that would explicitly extend familiar kinds of open source license conditions to activities merely involving APIs. There could also be comparable efforts to advance _Oracle v. Google_-influenced reinterpretations of existing open source licenses.
|
||||
|
||||
We've already seen an example of a new open source-like license that restricts APIs. Last year, Holochain, through its lawyer [Van Lindberg][4], submitted the [Cryptographic Autonomy License][5] (CAL) for approval by the Open Source Initiative (OSI). The [1.0-Beta][6] draft included source availability and licensing requirements placed on works merely containing or derivative of interfaces included in or derived from the licensed work. (CAL 1.0-Beta was [rejected][7] by the OSI for reasons other than the interface copyleft feature. Subsequent revisions of CAL removed explicit references to interfaces, and the OSI approved CAL 1.0 earlier this year.) Licenses like CAL 1.0-Beta would extend copyleft to reimplementations of APIs having no code in common with the original. Though less likely, new permissive licenses might similarly extend notice preservation requirements to mere copies of APIs.
|
||||
|
||||
In my view, API-restricting licenses, though otherwise FOSS-like, would not qualify for the open source label. To simplify what is actually a complicated and contentious issue, let's accept the view that the license approval decisions of the OSI, interpreting the [Open Source Definition][8] (OSD), are the authoritative basis for determining whether a license is open source. The OSD makes no mention of software interfaces. Some advocates of a relaxation of standards for approving open source licenses have argued that if a type of restriction is not explicitly prohibited by the OSD, it should be considered acceptable in an open source license. To guard against this tactic, which amounts to ["gaming" the OSD][9], the OSI [clarified][10] in 2019 that the purpose of the approval process is to ensure that approved licenses not only conform to the OSD but also provide software freedom.
|
||||
|
||||
Though [Luis Villa has raised concerns][11] that it gives rise to a "[no true Scotsman][12]" problem, I believe the emphasis on software freedom as a grounding principle will enable the OSI to deal effectively and in a well-reasoned, predictable way with cases where license submissions expose unforeseen gaps or vagueness in the OSD, which is politically difficult for the OSI to revise. (Disclosure: I was on the OSI board when this change to the license review process was made.) It is also an honest acknowledgment that the OSD, like the [Free Software Definition][13] maintained by the Free Software Foundation, is an unavoidably imperfect and incomplete attempt to distill the underlying community norms and expectations surrounding what FOSS is.
|
||||
|
||||
Software freedom is the outgrowth of a long-lived culture. Judging whether a license that extends FOSS-normative conditions to APIs provides software freedom should begin with an examination of tradition. This leads to a straightforward conclusion. As noted above, from nearly the earliest days of programming and continuing without interruption through the rise of the modern open source commons, software developers have shared and acted on a belief in an unconditional right to reimplement software interfaces. From a historical perspective, it is difficult to think of anything as core to software freedom as this right to reimplement.
|
||||
|
||||
The inquiry cannot be entirely backward-looking, however, since the understanding of software freedom necessarily changes in response to new societal or technological developments. It is worth asking whether a departure from the traditional expectation of unrestricted APIs would advance the broader goals of open source licensing. At first glance, this might seem to be true for copyleft licensing, since, in theory, compliant adoption of API copyleft licenses could expand the open source software commons. But expanding the scope of copyleft to API reimplementations—software traditionally seen as unrelated to the original work—would violate another open source norm, the limited reach of open source licenses, which is partially captured in [OSD 9][14].
|
||||
|
||||
Another observation is that software freedom is endangered by licensing arrangements that are excessively complex and unpredictable and that make compliance too difficult. This would likely be true of API-restricting FOSS-like licenses, especially on the copyleft side. For example, copyleft licenses typically place conditions on the grant of permission to prepare derivative works. Trying to figure out what is a derivative work of a Java method declaration, or the SSO of a set of APIs, could become a compliance nightmare. Would it include reimplementations of APIs? Code merely invoking APIs? The fundamental vagueness of _Oracle v. Google_-style API copyright bears some resemblance to certain kinds of software patent claims. It is not difficult to imagine acquirers of copyrights covered by API-restrictive licenses adopting the litigation strategies of patent trolls. In addition to this risk, accepting API-restrictive licenses as open source would further legitimize API copyrightability in jurisdictions like the United States, where the legal issue is currently unsettled.
|
||||
|
||||
_Oracle v. Google_-influenced interpretations of existing open source licenses would similarly extend familiar open source license conditions to activities merely involving APIs. Such reinterpretations would transform these licenses into ones that fail to provide software freedom and advance the goals of open source, for the same reasons that apply to the new license case. In addition, they would upend the intentions and expectations of the authors of those licenses, as well as nearly all of their licensors and licensees.
|
||||
|
||||
It might be argued that because open source licenses are principally ([though not exclusively][15]) copyright licenses, it is necessary, if not beneficial, for their conditions to closely track the expansion of copyright to APIs. This is not so for new open source licenses, which can be drafted explicitly to nullify the impact of _Oracle v. Google_. As for reinterpretations of existing open source licenses, while the issue of API copyrightability remains unsettled, it would not be appropriate to abandon traditional interpretations in favor of anticipating what an _Oracle v. Google_-influenced court, unfamiliar with open source culture, would decide. Litigation over open source licenses continues to be uncommon, and influential open source license interpretations have emerged in the technical community with little regard to how courts might act. In any event, courts engaged in interpreting commonly-used open source licenses may well be persuaded to treat APIs as unconstrained.
|
||||
|
||||
Some have suggested that interpretation of the GPL should take full advantage of the scope of underlying copyright rights. This is related to a view of copyleft as a "[hack on copyright][16]" or a "[judo move][17]" that "[return[s] the violent force of the oppressor against the oppressor itself][18]." It can be detected in the [copyleft tutorial][19] sponsored by the Software Freedom Conservancy and the FSF, which [says][20]: "The strongest copylefts strive to [use] the exclusive rights that copyright grants to authors as extensively as possible to maximize software freedom." It might seem logical for someone with this perspective to specifically promote an API copyright interpretation of the GPL. But I know of no advocate of strong copyleft who has done so, and the text and interpretive history of the GPL do not support such a reading.
|
||||
|
||||
A somewhat different view of API copyright and GPL interpretation, occasionally voiced, is that _Oracle v. Google_ may put the doctrine of strong copyleft on a surer legal foundation. Similarly, it has sometimes been asserted that strong copyleft rested on some notion of API copyrightability all along, which suggests that _Oracle v. Google_ provides some retroactive legal legitimacy. The latter view is not held by the FSF, which in an earlier era had [opposed the expansion of copyright][21] to user interfaces. This stance made its way into GPLv2, which has a [largely overlooked provision][22] authorizing the original licensor to exclude countries that would restrict "distribution and/or use … either by patents or by copyrighted interfaces." The FSF also [severely criticized][23] Oracle's claim of copyright ownership of Java APIs. And the FSF has never questioned the right to reimplement APIs of GPL-licensed software under non-GPL licenses (as has happened, for example, with the FSF-copyrighted [GNU Readline][24] and the BSD-licensed [libedit][25]). If there were shown to be some legal deficiency in strong copyleft theory that API copyrightability could somehow fix, I believe it would be better either to live with a weaker understanding of GPL copyleft or to pursue revisions to the GPL that would reformulate strong copyleft without relying on API copyright.
|
||||
|
||||
If API copyrightability survives Supreme Court review, it would then be appropriate for license stewards, licensors of existing open source licenses, and drafters of new open source licenses to take constructive steps to minimize the impact on open source. Stewards of widely used open source licenses, where they exist, could publish interpretive guidance clarifying that APIs are not restricted by the license. Updates to existing open source licenses and entirely new licenses could make unrestricted APIs an explicit policy. Licensors of existing open source licenses could make clear, in standardized license notices or through external commitments, that they will not treat open source license conditions as imposing any restriction on activities merely involving APIs.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/api-copyright
|
||||
|
||||
作者:[Richard 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/fontana
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LAW_lawdotgov2.png?itok=n36__lZj (Two government buildings)
|
||||
[2]: http://www.cafc.uscourts.gov/sites/default/files/opinions-orders/13-1021.Opinion.5-7-2014.1.PDF
|
||||
[3]: https://www.scotusblog.com/case-files/cases/google-llc-v-oracle-america-inc/
|
||||
[4]: https://twitter.com/vanl?lang=en
|
||||
[5]: https://github.com/holochain/cryptographic-autonomy-license
|
||||
[6]: http://lists.opensource.org/pipermail/license-review_lists.opensource.org/2019-April/004028.html
|
||||
[7]: http://lists.opensource.org/pipermail/license-review_lists.opensource.org/2019-June/004248.html
|
||||
[8]: https://opensource.org/osd
|
||||
[9]: https://twitter.com/webmink/status/1121873263125118977?s=20
|
||||
[10]: https://opensource.org/approval
|
||||
[11]: https://twitter.com/luis_in_brief/status/1143884765654687744
|
||||
[12]: https://en.wikipedia.org/wiki/No_true_Scotsman
|
||||
[13]: https://www.gnu.org/philosophy/free-sw.en.html
|
||||
[14]: https://opensource.org/osd#not-restrict-other-software
|
||||
[15]: https://opensource.com/article/18/3/patent-grant-mit-license
|
||||
[16]: https://sfconservancy.org/blog/2012/feb/01/gpl-enforcement/
|
||||
[17]: https://gondwanaland.com/mlog/2014/12/01/copyleft-org/#gpl-and-cc-by-sa-differences
|
||||
[18]: https://dustycloud.org/blog/field-guide-to-copyleft/#sec-2-2
|
||||
[19]: https://copyleft.org/guide/
|
||||
[20]: https://copyleft.org/guide/comprehensive-gpl-guidech2.html#x5-120001.2.2
|
||||
[21]: https://www.gnu.org/bulletins/bull21.html
|
||||
[22]: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html#section8
|
||||
[23]: https://www.fsf.org/blogs/licensing/fsf-statement-on-court-of-appeals-ruling-in-oracle-v-google
|
||||
[24]: https://tiswww.case.edu/php/chet/readline/rltop.html
|
||||
[25]: http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/
|
@ -0,0 +1,70 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (The open organization everyone deserves)
|
||||
[#]: via: (https://opensource.com/open-organization/20/6/organization-everyone-deserves)
|
||||
[#]: author: (Jos Groen https://opensource.com/users/jos-groen)
|
||||
|
||||
The open organization everyone deserves
|
||||
======
|
||||
Want to build a sustainably successful organization? Then openness is
|
||||
the way.
|
||||
![Two different business organization charts][1]
|
||||
|
||||
Let me share an email I recently received. It meant the world to me:
|
||||
|
||||
> Hi Jos, just a quick message to thank you for the past six months. I really appreciate how I've been welcomed into the company and I feel like I've genuinely found my place here. There's a great vibe among the entire staff of working hard, lots of learning, having fun, and personal responsibility. Although everyone contributes to this atmosphere, it could only have come about with the support of management. So I just want to thank you for creating such an enjoyable work environment!
|
||||
|
||||
A work environment that encourages the collaborative utilization of everyone's combined skillset, one in which contributors are intrinsically motivated to do their best work, is something I would wish for everyone. That's why, over the past year especially, I've been cultivating an open organizational culture on my team and across my organization, Axians. Openness is the future, and it begins with individuals. In this article, I'll explain the mindset shifts I believe any _individual_ leader must make in order to pave the way for an organizational culture of openness.
|
||||
|
||||
### The technological is social
|
||||
|
||||
Social and technological changes are occurring faster than ever. These often seem like two separate movements—but are they really? The effect of the open source movement on the development of both innovative technologies and organizational cultures is many times greater than we may think. The open source community (as the name suggests) is shouldered by people—people who apply their skills to make the world a little better through new technologies, who realize the value of sharing both knowledge and material goods in both their work as well as their personal lives.
|
||||
|
||||
This means that in order to get the most out of new technologies, you need to have an open organizational culture in which employees contribute from [a place of intrinsic motivation][2]. The current generation of tech employees isn't drawn to organizations with a strong hierarchical culture. They're looking for _open_ organizations that encourage and inspire them to excel every single day. They're looking for the kind of leadership that leaves ample room for individual input and ownership. A successful and future-proof organization demands an open culture and open leadership.
|
||||
|
||||
At its core, a sustainably successful organization revolves around a balance between a focus on people and a focus on the business. In my experience, for the majority of organizations, this balance leans too heavily towards the business. There is an urgent need for a greater focus on people. The open organization is the answer to restoring this balance. That's why establishing and leading an open organization should be the [ultimate goal for contemporary managers][3]. But doing this requires leaders capable of restoring the balance [between business and the humans that work in it][4]—and maintaining that balance.
|
||||
|
||||
A work environment that encourages the collaborative utilization of everyone's combined skillset, one in which contributors are intrinsically motivated to do their best work, is something I would wish for everyone.
|
||||
|
||||
At the same time, a successful organization today is one that enables intelligent collaboration and effective coordination. This will increase the collective intelligence and offer employees the space they need to develop and grow. Unlocking and utilizing the available potential helps shape the kind of organization in which everyone participates and contributes, and this can produce some truly remarkable results. It’s no small task for a leader to establish and lead an organization of this kind.
|
||||
|
||||
### Authentic leadership
|
||||
|
||||
The human dimension present in an organization will in part determine the employers people choose to join, making it vital for managers to establish and lead an open organization. Part of openness is to be clear and honest about your intentions at all times.
|
||||
|
||||
This isn't just a gimmick, nor is it a skill you can easily "acquire." When you're working with people, they will immediately sense if your intentions aren't genuine. Because this process takes place on a subconscious level, it is unlikely people will articulate this feeling. Instead, it'll be reflected in their behavior: you might find people less involved and not opening up to you. In turn, you could experience their behavioras frustrating, even opposition. Sound familiar?
|
||||
|
||||
This is all about your credibility, which takes time to build. You'll be challenged, either consciously or subconsciously, to stick with your intentions. Be prepared to have to overcome mistrust and cynicism at times.
|
||||
|
||||
Are you up for that? Are you willing to examine the cause, to really invest your time and energy in trying to understand the other person? And will you stick to your principles?
|
||||
|
||||
### What about you?
|
||||
|
||||
An open organization is about placing your trust in people and creating a culture of equality. At the end of the day, it's not about you; it's about the collective. _Everyone_ is involved. _Everyone_ gets to make mistakes or ask for help. Even you. As long as you can be open and honest about it.
|
||||
|
||||
So have you put "openness" on the agenda? And what about your organization? Is your management ready to open up—or are they clinging to "command and control"?
|
||||
|
||||
I hope you'll [join me][5] as I explore these issues further [in an upcoming webinar][6].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/open-organization/20/6/organization-everyone-deserves
|
||||
|
||||
作者:[Jos Groen][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/jos-groen
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_crowdvsopen.png?itok=AFjno_8v (Two different business organization charts)
|
||||
[2]: https://opensource.com/open-organization/18/5/rethink-motivation-engagement
|
||||
[3]: https://opensource.com/open-organization/20/6/open-management-practices
|
||||
[4]: https://opensource.com/open-organization/17/7/digital-transformation-people-1
|
||||
[5]: https://www.linkedin.com/in/josgroen/
|
||||
[6]: https://www.redhat.com/en/events/webinar/how-to-drive-the-transformation-journey-through-an-open-organization-approach-2020
|
262
sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md
Normal file
262
sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md
Normal file
@ -0,0 +1,262 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (LaTeX Typesetting – Part 1 (Lists))
|
||||
[#]: via: (https://fedoramagazine.org/latex-typesetting-part-1/)
|
||||
[#]: author: (Earl Ramirez https://fedoramagazine.org/author/earlramirez/)
|
||||
|
||||
LaTeX Typesetting – Part 1 (Lists)
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
This series builds on the previous articles: [Typeset your docs with LaTex and TeXstudio on Fedora][2] and [LaTeX 101 for beginners][3]. This first part of the series is about LaTeX lists.
|
||||
|
||||
### Types of lists
|
||||
|
||||
LaTeX lists are enclosed environments, and each item in the list can take a line of text to a full paragraph. There are three types of lists available in LaTeX. They are:
|
||||
|
||||
* **Itemized**: unordered or bullet
|
||||
* **Enumerated**: ordered
|
||||
* **Description**: descriptive
|
||||
|
||||
|
||||
|
||||
### Creating lists
|
||||
|
||||
To create a list, prefix each list item with the \_item_ command. Precede and follow the list of items with the \_begin_{<type>} and \_end_{<type>} commands respectively where <type> is substituted with the type of the list as illustrated in the following examples.
|
||||
|
||||
#### Itemized list
|
||||
|
||||
```
|
||||
\begin{itemize}
|
||||
\item Fedora
|
||||
\item Fedora Spin
|
||||
\item Fedora Silverblue
|
||||
\end{itemize}
|
||||
```
|
||||
|
||||
![][4]
|
||||
|
||||
#### Enumerated list
|
||||
|
||||
```
|
||||
\begin{enumerate}
|
||||
\item Fedora CoreOS
|
||||
\item Fedora Silverblue
|
||||
\item Fedora Spin
|
||||
\end{enumerate}
|
||||
```
|
||||
|
||||
![][5]
|
||||
|
||||
#### Descriptive list
|
||||
|
||||
```
|
||||
\begin{description}
|
||||
\item[Fedora 6] Code name Zod
|
||||
\item[Fedora 8] Code name Werewolf
|
||||
\end{description}
|
||||
```
|
||||
|
||||
![][6]
|
||||
|
||||
### Spacing list items
|
||||
|
||||
The default spacing can be customized by adding \_usepackage{enumitem}_ to the preamble. The _enumitem_ package enables the _noitemsep_ option and the \_itemsep_ command which you can use on your lists as illustrated below.
|
||||
|
||||
#### Using the noitemsep option
|
||||
|
||||
Enclose the _noitemsep_ option in square brackets and place it on the \_begin_ command as shown below. This option removes the default spacing.
|
||||
|
||||
```
|
||||
\begin{itemize}[noitemsep]
|
||||
\item Fedora
|
||||
\item Fedora Spin
|
||||
\item Fedora Silverblue
|
||||
\end{itemize}
|
||||
```
|
||||
|
||||
![][7]
|
||||
|
||||
#### Using the \itemsep command
|
||||
|
||||
The \_itemsep_ command must be suffixed with a number to indicate how much space there should be between the list items.
|
||||
|
||||
```
|
||||
\begin{itemize} \itemsep0.75pt
|
||||
\item Fedora Silverblue
|
||||
\item Fedora CoreOS
|
||||
\end{itemize}
|
||||
```
|
||||
|
||||
![][8]
|
||||
|
||||
### Nesting lists
|
||||
|
||||
LaTeX supports nested lists up to four levels deep as illustrated below.
|
||||
|
||||
#### Nested itemized lists
|
||||
|
||||
```
|
||||
\begin{itemize}[noitemsep]
|
||||
\item Fedora Versions
|
||||
\begin{itemize}
|
||||
\item Fedora 8
|
||||
\item Fedora 9
|
||||
\begin{itemize}
|
||||
\item Werewolf
|
||||
\item Sulphur
|
||||
\begin{itemize}
|
||||
\item 2007-05-31
|
||||
\item 2008-05-13
|
||||
\end{itemize}
|
||||
\end{itemize}
|
||||
\end{itemize}
|
||||
\item Fedora Spin
|
||||
\item Fedora Silverblue
|
||||
\end{itemize}
|
||||
```
|
||||
|
||||
![][9]
|
||||
|
||||
#### Nested enumerated lists
|
||||
|
||||
```
|
||||
\begin{enumerate}[noitemsep]
|
||||
\item Fedora Versions
|
||||
\begin{enumerate}
|
||||
\item Fedora 8
|
||||
\item Fedora 9
|
||||
\begin{enumerate}
|
||||
\item Werewolf
|
||||
\item Sulphur
|
||||
\begin{enumerate}
|
||||
\item 2007-05-31
|
||||
\item 2008-05-13
|
||||
\end{enumerate}
|
||||
\end{enumerate}
|
||||
\end{enumerate}
|
||||
\item Fedora Spin
|
||||
\item Fedora Silverblue
|
||||
\end{enumerate}
|
||||
```
|
||||
|
||||
![][10]
|
||||
|
||||
### List style names for each list type
|
||||
|
||||
**Enumerated** | **Itemized**
|
||||
---|---
|
||||
\alph* | $\bullet$
|
||||
\Alph* | $\cdot$
|
||||
\arabic* | $\diamond$
|
||||
\roman* | $\ast$
|
||||
\Roman* | $\circ$
|
||||
| $-$
|
||||
|
||||
### Default style by list depth
|
||||
|
||||
**Level** | **Enumerated** | **Itemized**
|
||||
---|---|---
|
||||
1 | Number | Bullet
|
||||
2 | Lowercase alphabet | Dash
|
||||
3 | Roman numerals | Asterisk
|
||||
4 | Uppercase alphabet | Period
|
||||
|
||||
### Setting list styles
|
||||
|
||||
The below example illustrates each of the different itemiszed list styles.
|
||||
|
||||
```
|
||||
% Itemize style
|
||||
\begin{itemize}
|
||||
\item[$\ast$] Asterisk
|
||||
\item[$\diamond$] Diamond
|
||||
\item[$\circ$] Circle
|
||||
\item[$\cdot$] Period
|
||||
\item[$\bullet$] Bullet (default)
|
||||
\item[--] Dash
|
||||
\item[$-$] Another dash
|
||||
\end{itemize}
|
||||
```
|
||||
|
||||
![][11]
|
||||
|
||||
There are three methods of setting list styles. They are illustrated below. These methods are listed by priority; highest priority first. A higher priority will override a lower priority if more than one is defined for a list item.
|
||||
|
||||
#### List styling method 1 – per item
|
||||
|
||||
Enclose the name of the desired style in square brackets and place it on the \_item_ command as demonstrated below.
|
||||
|
||||
```
|
||||
% First method
|
||||
\begin{itemize}
|
||||
\item[$\ast$] Asterisk
|
||||
\item[$\diamond$] Diamond
|
||||
\item[$\circ$] Circle
|
||||
\item[$\cdot$] period
|
||||
\item[$\bullet$] Bullet (default)
|
||||
\item[--] Dash
|
||||
\item[$-$] Another dash
|
||||
\end{itemize}
|
||||
```
|
||||
|
||||
#### List styling method 2 – on the list
|
||||
|
||||
Prefix the name of the desired style with _label=_. Place the parameter, including the _label=_ prefix, in square brackets on the \_begin_ command as demonstrated below.
|
||||
|
||||
```
|
||||
% Second method
|
||||
\begin{enumerate}[label=\Alph*.]
|
||||
\item Fedora 32
|
||||
\item Fedora 31
|
||||
\item Fedora 30
|
||||
\end{enumerate}
|
||||
```
|
||||
|
||||
#### List styling method 3 – on the document
|
||||
|
||||
This method changes the default style for the entire document. Use the \_renewcommand_ to set the values for the labelitems. There is a different labelitem for each of the four label depths as demonstrated below.
|
||||
|
||||
```
|
||||
% Third method
|
||||
\renewcommand{\labelitemi}{$\ast$}
|
||||
\renewcommand{\labelitemii}{$\diamond$}
|
||||
\renewcommand{\labelitemiii}{$\bullet$}
|
||||
\renewcommand{\labelitemiv}{$-$}
|
||||
```
|
||||
|
||||
### Summary
|
||||
|
||||
LaTeX supports three types of lists. The style and spacing of each of the list types can be customized. More LaTeX elements will be explained in future posts.
|
||||
|
||||
Additional reading about LaTeX lists can be found here: [LaTeX List Structures][12]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/latex-typesetting-part-1/
|
||||
|
||||
作者:[Earl Ramirez][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/earlramirez/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2020/06/latex-series-816x345.png
|
||||
[2]: https://fedoramagazine.org/typeset-latex-texstudio-fedora
|
||||
[3]: https://fedoramagazine.org/fedora-classroom-latex-101-beginners
|
||||
[4]: https://fedoramagazine.org/wp-content/uploads/2020/06/image-1.png
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2020/06/image-2.png
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2020/06/image-3.png
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2020/06/image-4.png
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2020/06/image-5.png
|
||||
[9]: https://fedoramagazine.org/wp-content/uploads/2020/06/image-7.png
|
||||
[10]: https://fedoramagazine.org/wp-content/uploads/2020/06/image-8.png
|
||||
[11]: https://fedoramagazine.org/wp-content/uploads/2020/06/image-9.png
|
||||
[12]: https://en.wikibooks.org/wiki/LaTeX/List_Structures
|
@ -1,139 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (nophDog)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (7 open source alternatives to VS Code)
|
||||
[#]: via: (https://opensource.com/article/20/6/open-source-alternatives-vs-code)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
7 open source alternatives to VS Code
|
||||
======
|
||||
Avoid Microsoft's proprietary VS Code build and opt for an open source
|
||||
code editor instead.
|
||||
![Person using a laptop][1]
|
||||
|
||||
Visual Studio Code, also known as VS Code, is a code editor for Linux, Windows, and macOS. It's the kind of editor that walks the line between editing text and managing your entire codebase, like an integrated development environment (IDE). It's extensible through plugins and has proven to be a reliable text editor that's easily beaten out formidable non-open rival editors.
|
||||
|
||||
Microsoft released VS Code as open source, but the version you download from Microsoft is not open source. However, you have several options for using VS Code as open source or selecting one of its open source alternatives.
|
||||
|
||||
### Building VS Code as open source
|
||||
|
||||
VS Code's source code is available [on GitHub][2]. Yet when you download the VS Code application [from Microsoft][3], you'll find that your download is licensed under the [Microsoft Software License][4]. This isn't an open source license. The difference is in the build process.
|
||||
|
||||
Chris Dias, a Microsoft developer on the VS Code project, [makes a comparison][5] between VS Code and, for instance, the Chrome browser and its open source "upstream" project, [Chromium][6]. VS Code is indeed built upon an open source codebase. The official Microsoft-branded release is customized with Microsoft-specific functionality, including a trademark, an extensions gallery, a proprietary C# debugger, and telemetry. But when you clone and build the code yourself, none of these targets is configured, so you generate a "clean" version, which is called Code - OSS (OSS stands for open source software).
|
||||
|
||||
In practice, the differences between VS Code and Code - OSS are minimal. Most notably, VS Code includes telemetry, which is tracking software. It's unlikely that Microsoft is literally tracking your every move, and there's lots of software out there these days that gathers usage data. Whether or not you care about VS Code's telemetry is up to you. If you'd rather do without the usage tracking, here are some great (and open source) alternatives to VS Code.
|
||||
|
||||
### VSCodium
|
||||
|
||||
![Code OSS screenshot][7]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
The easiest alternative to VS Code is VS Code itself, built without Microsoft's proprietary additions. The [VSCodium][9] project provides downloadable executables of Code - OSS, built from the VS Code codebase without Microsoft's `product.json` changes. The VSCodium developers also go to great length to deactivate all hard-to-find telemetry options, delivering the cleanest build of VS Code's source you can find without building it yourself.
|
||||
|
||||
VSCodium cautions that VS Code quietly includes some proprietary tools that cannot be shipped with an open source build. This includes a C# debugger and some gallery extensions. If you need them, there are [documented workarounds][10] for these issues, but if you rely on something very specific in VS Code, you should verify that it functions in VSCodium.
|
||||
|
||||
You should also verify that all [telemetry is deactivated][11].
|
||||
|
||||
### Code - OSS
|
||||
|
||||
If you don't want to use VSCodium's build, you can [compile VS Code from source][12] yourself and end up with the same thing. The executable is called `Code - OSS` rather than `VSCode`, and the license restrictions that apply to VSCodium also apply to your build, but so do the workarounds.
|
||||
|
||||
If you build the application from source, you should verify that all [telemetry is deactivated][11] when you first launch it.
|
||||
|
||||
### Atom
|
||||
|
||||
![Atom screenshot][13]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
[Atom][14] is an open source IDE-like text editor that Microsoft acquired when it purchased GitHub. Like VS Code, you can extend the Atom editor with plugins and customize it with themes and your unique combination of tools. It is also cross-platform and has built-in GitHub integration. In short, Atom is potentially whatever you need it to be, so long as the extensions you need already exist or you're willing to write them.
|
||||
|
||||
Also like VS Code, Atom includes [metrics tracking by default][15]. This can be disabled, and unlike VS Code, there are no arbitrary restrictions on extensions, so you don't have to change up your workflow in exchange for your privacy. Atom is certainly a useful tool for coders, but it's also a pretty great editor for [anyone who uses a computer][16]. If you're looking for a good general-purpose text editor, give Atom a try.
|
||||
|
||||
### GNOME Builder
|
||||
|
||||
![GNOME Builder screenshot][17]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
Developed as an IDE for the GNOME desktop, [GNOME Builder][18] is a code editor for Linux, specifically for building GNOME applications. If you're building applications for Linux and want an easy avenue to compatibility, Builder is the easy choice. Install Builder from [Flathub.org][19]; when you start a project, it'll even prompt you to install the GNOME SDK if you're missing it. This means you don't have to consciously track GNOME as you maintain your application because Builder does it for you.
|
||||
|
||||
However, you can use Builder for much more than just GNOME applications. It supports dozens of programming languages, including Python, Rust, C and C++, Java, Go, JavaScript, TypeScript, VB.NET, several markup and Markdown languages, and more. Some of these have full support with autocompletion and pop-up function definitions, while others only have simple conveniences such as syntax highlighting and auto-bracket matching. The IDE is a pleasure to work with, though, whether you consider yourself a serious programmer or you're just in need of a good HTML and CSS editor.
|
||||
|
||||
### Geany
|
||||
|
||||
![Geany screenshot][20]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
[Geany][21] is a powerful, stable, and lightweight editor with useful features to help you write good Bash, Python, Lua, XML, HTML, LaTeX, and more. There's plenty of support for 50 different programming and scripting languages, markup languages, and miscellaneous filetypes (such as .diff and .po). At the very least, Geany almost certainly provides bracket matching and syntax highlighting—and it usually offers quite a lot more.
|
||||
|
||||
Geany is a modest little editor, but through plugins, you can add features such as a panel for a project view, filesystem tree, debugging, a terminal, and so on until it looks and acts like an IDE. Or, if you prefer, you can keep it simple and understated. If you can't run VS Code on a computer due to limitations in CPU or RAM, Geany is the obvious alternative. It's quick to launch, and its memory footprint is negligible. While Geany is a little heftier than running Vim in a terminal, it's fast and snappy even on a Raspberry Pi.
|
||||
|
||||
### Brackets
|
||||
|
||||
![Brackets screenshot][22]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
[Brackets][23] is a text editor and IDE aimed at web developers. It has strong support for HTML, CSS, JavaScript, PHP, and even Python. However, like VS Code, it has a rich ecosystem of extensions, so you can expand it to serve as your workbench for whatever language you work in the most.
|
||||
|
||||
There are extensions to help parse languages, to run scripts, and even to compile and execute code. Brackets has a traditional interface anyone can understand, whether or not you're familiar with an IDE or even a text editor beyond a simple notepad. If you spend a little time adding relevant extensions and getting to know them, you'll find Brackets a useful and subtle editor that helps you, through autocompletion and linting, avoid silly mistakes in whatever you're typing. And if you're writing code, it'll probably make your testing and debugging workflow faster.
|
||||
|
||||
### Che
|
||||
|
||||
![Che screenshot][24]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
If you enjoy living on the cutting edge, [Che][25] is an editor you need to try. It's a cloud-based IDE, so it runs by default as a Software as a Service (SaaS), but it's entirely open source, so it can be run as _your own_ SaaS, provided you have a Kubernetes instance.
|
||||
|
||||
More than just being an online IDE, though, Che is an IDE built for cloud development. It makes no assumptions that you expect or want a view of your local filesystem. It lives and works in the cloud, so you can too. In fact, if you have a Git server, you can treat it as your filesystem and work on a project directly from its repository. Of course, you can also download any work you do, if you like to have a local backup copy.
|
||||
|
||||
But its main feature, and the one cloud developers are excited about, is that Che is a full-featured, Kubernetes-aware, open source IDE. If you're building apps, sites, or containers (or a combination of the three) for the cloud, then Che is an editor you need to try.
|
||||
|
||||
### What's your choice?
|
||||
|
||||
Are you using one of these alternatives to VS Code? Is there one you would like to try? Please share your feedback in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/open-source-alternatives-vs-code
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop)
|
||||
[2]: https://github.com/microsoft/vscode
|
||||
[3]: https://code.visualstudio.com/
|
||||
[4]: https://code.visualstudio.com/license
|
||||
[5]: https://github.com/Microsoft/vscode/issues/60#issuecomment-161792005
|
||||
[6]: https://www.chromium.org/
|
||||
[7]: https://opensource.com/sites/default/files/uploads/code-oss.png (Code OSS screenshot)
|
||||
[8]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[9]: https://vscodium.com/
|
||||
[10]: https://github.com/VSCodium/vscodium/blob/master/DOCS.md
|
||||
[11]: https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting
|
||||
[12]: https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run
|
||||
[13]: https://opensource.com/sites/default/files/uploads/atom.jpg (Atom screenshot)
|
||||
[14]: http://atom.io
|
||||
[15]: https://discuss.atom.io/t/how-do-i-disable-the-metrics-or-tracking/24520
|
||||
[16]: https://opensource.com/article/19/4/write-git
|
||||
[17]: https://opensource.com/sites/default/files/uploads/builder.png (GNOME Builder screenshot)
|
||||
[18]: https://wiki.gnome.org/Apps/Builder
|
||||
[19]: https://flathub.org/apps/details/org.gnome.Builder
|
||||
[20]: https://opensource.com/sites/default/files/uploads/geany.png (Geany screenshot)
|
||||
[21]: https://www.geany.org/
|
||||
[22]: https://opensource.com/sites/default/files/uploads/brackets.jpg (Brackets screenshot)
|
||||
[23]: http://brackets.io/
|
||||
[24]: https://opensource.com/sites/default/files/uploads/che-cpp.jpg (Che screenshot)
|
||||
[25]: https://www.eclipse.org/che/extend/
|
@ -0,0 +1,248 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (10 ReactJS tools to boost your web development skills)
|
||||
[#]: via: (https://opensource.com/article/20/6/reactjs-tools)
|
||||
[#]: author: (Prayaag Kasundra https://opensource.com/users/prayaag-kasundra)
|
||||
|
||||
10 ReactJS tools to boost your web development skills
|
||||
======
|
||||
Increase your value to employers by learning these top tools for
|
||||
developing web apps in React.
|
||||
![Woman sitting in front of her computer][1]
|
||||
|
||||
Did you know most résumés submitted for jobs get rejected with just a single glance? That's a daunting fact if you are trying to get started in web development, but there are ways to improve what you have to offer prospective employers and clients. For application developers, now is a great time to increase your skills, and open source is the best avenue for professional development. You don't need to attend university to learn new open source skills; all you need is a sense of direction and self-discipline.
|
||||
|
||||
ReactJS is one of many skills you would be wise to learn on your way to becoming a successful web developer. If you're already comfortable with JavaScript and HTML, it is a natural next technology to learn. If you're not familiar with them yet, then you'll find ReactJS a great place to start as a programmer.
|
||||
|
||||
In this article, I'll share my top 10 tools and libraries that will help you qualify for a job (or be a serious hobbyist, if you prefer) as a JavaScript developer.
|
||||
|
||||
### What is React, and why should you learn it?
|
||||
|
||||
React is a JavaScript library for user interface (UI) development that Facebook introduced in May 2013 (and still maintains). It uses JavaScript for development and simple state machine components that render dynamic content with ease.
|
||||
|
||||
Because ReactJS is one of the most powerful frontend JavaScript libraries available, you should learn how to use it if you want to build amazing applications. It's a driving force behind the interfaces of Amazon, PayPal, BBC, CNN, and many other tech giants. Furthermore, the flexible library suits any need and can be plugged into your favorite tech stack to build lightweight apps. You can [use React][2] to build anything scalable—data dashboards, messaging apps, social networking applications, single-page applications, and even personal blog sites.
|
||||
|
||||
One of the most effective ways to get the hang of React is by using its tools to build web apps for real-world projects. Not only will it help you learn the framework and tools, but it also gives you something to show off to prospective employers.
|
||||
|
||||
### 1\. npm
|
||||
|
||||
If you want to get started with JavaScript (including the React library), you need to install Node package manager ([npm][3]). Like the package manager that ships with your Linux distribution (or [Chocolatey][4] on Windows or [Homebrew][5] on macOS), npm provides a command to query a software repository and install what you need. This includes important libraries, like ReactJS components.
|
||||
|
||||
You can probably install Node.js (and npm along with it) from your Linux distribution's repository. On Fedora or Red Hat Enterprise Linux:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install nodejs`
|
||||
```
|
||||
|
||||
On Ubuntu or Debian:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo apt install nodejs npm`
|
||||
```
|
||||
|
||||
If your distribution doesn't offer npm in its repo, visit [Nodejs.org][6] to find out how to install Node.js and npm.
|
||||
|
||||
### 2\. Create React App
|
||||
|
||||
[Create React App][7] is a boilerplate project for getting started with React. Before Facebook released Create React App, setting up a working project in React was a tedious task. But with this tool, you can set up a frontend build pipeline, project structure, developer environment, and app optimization for production in seconds with zero configuration. You can achieve all this with a single command. What's more, if you need a more advanced configuration, you can "eject" from Create React App and edit its config files directly.
|
||||
|
||||
Create React App is open source under the MIT License, and you can access its [source code][8] in its GitHub repo.
|
||||
|
||||
Install it with:
|
||||
|
||||
|
||||
```
|
||||
npm start
|
||||
npm init react-app my-app
|
||||
```
|
||||
|
||||
If you don't want to use Create React App, other boilerplate options are [React Boilerplate][9] and [React Slingshot][10]. Both are well-maintained and open source under the MIT License.
|
||||
|
||||
### 3\. React Sight
|
||||
|
||||
[React Sight][11] is a commonly used visualization tool that provides a live component hierarchy tree (like a flowchart) of your entire app. It can be added directly as a Chrome extension and needs React dev tools for reading information about your app. With its rich interface, you can even add filters to focus on the components you need to interact with the most. By hovering on the nodes, you can display the current state and props. React Sight is very helpful for debugging a large and complex project.
|
||||
|
||||
React Sight is open source under the MIT License, and you can access its [source code][12] in its GitHub repo. Install React Sight from the [Chrome web store][13].
|
||||
|
||||
### 4\. React Belle
|
||||
|
||||
[React Belle][14] is a configurable React component library containing reusable components like Toggle, Rating, DatePicker, Button, Card, Select, and others to provide a smooth user experience. The components are customizable and support [ARIA][15] accessibility standards. It offers different themes, like the popular Belle and Bootstrap.
|
||||
|
||||
Belle is open source under the MIT License, and you can access its [source code][16] in its GitHub repo.
|
||||
|
||||
Install it with:
|
||||
|
||||
|
||||
```
|
||||
`npm install belle`
|
||||
```
|
||||
|
||||
### 5\. Evergreen
|
||||
|
||||
Built on top of the React UI primitive, [Evergreen][17] is a UI framework that contains highly polished components that you can use to build your project. One thing that developers like about this tool is its hassle-free import of components.
|
||||
|
||||
Evergreen is open source under the MIT License, and you can access its [source code][18] in its GitHub repo.
|
||||
|
||||
Install it with:
|
||||
|
||||
|
||||
```
|
||||
`npm install --save evergreen-ui`
|
||||
```
|
||||
|
||||
### 6\. Bit
|
||||
|
||||
[Bit][19] offers an online platform and command-line tool for publishing and sharing React apps. It is one of the best options if you are creating and sharing components. Its marketplace is a store where people can publish their React apps and other people can search for the components they need, so they don't have to reinvent the wheel every time they need a new React app. Bit's core features include:
|
||||
|
||||
* Allows code reuse
|
||||
* Increases design and development efficiency
|
||||
* Retains UI and UX consistency
|
||||
* Increases a project's stability
|
||||
|
||||
|
||||
|
||||
Bit is open source under the Apache 2.0 License, and you can access its [source code][20] in its GitHub repo.
|
||||
|
||||
Install it with:
|
||||
|
||||
|
||||
```
|
||||
`$ npm install bit-bin --global`
|
||||
```
|
||||
|
||||
### 7\. Storybook
|
||||
|
||||
[Storybook][21] lets you set up a live development server that supports hot reloading, so you can create components in isolation from your whole project. It helps with component reuse, testability, and development speed. It also offers an online UI editor that allows you to develop, inspect, and eventually showcase your creations interactively.
|
||||
|
||||
What's more, Storybook's API offers myriad features and facilitates configuration like no other. It is used in production by companies like Coursera, Squarespace, and Lonely Planet.
|
||||
|
||||
Storybook is open source under the MIT License, and you can access its [source code][22] in its GitHub repo.
|
||||
|
||||
First, install Storybook using the following commands (note that one uses an npx command, which is related to npm but unique):
|
||||
|
||||
|
||||
```
|
||||
`$ cd my-react-app`[/code] [code]`$ npx -p @storybook/cli sb init`
|
||||
```
|
||||
|
||||
Next, run it with:
|
||||
|
||||
|
||||
```
|
||||
`$ npm run storybook`
|
||||
```
|
||||
|
||||
### 8\. Formik
|
||||
|
||||
[Formik][23] helps in creating and validating forms for debugging, testing, and reasoning in React. It allows you to generate dynamic forms, so you don't have to manually change or update the state and props of form components. It is a step towards a faster and more pleasant development experience.
|
||||
|
||||
Formik is open source under the MIT License, and you can access its [source code][24] in its GitHub repo.
|
||||
|
||||
Install it with:
|
||||
|
||||
|
||||
```
|
||||
`$ npm install formik --save`
|
||||
```
|
||||
|
||||
### 9\. Immer
|
||||
|
||||
[Immer][25] is a JavaScript library that enables you to modify nested objects without fear of mutating them. Its purpose is to make immutability in your code simple.
|
||||
|
||||
Here are some of Immer's top features:
|
||||
|
||||
* **Immer is strongly typed**: It is useful when your state object has a type.
|
||||
* **Immer reduces boilerplate code**: Most state management tools require you to write a lot of boilerplate code. Immer is different. It lets you write less (and more concise) code.
|
||||
* **Immer allows you to use JS data structures:** You can produce immutable states in Immer by using basic JS data structures.
|
||||
|
||||
|
||||
|
||||
Immer is open source under the MIT License, and you can access its [source code][26] in its GitHub repo.
|
||||
|
||||
Install it with:
|
||||
|
||||
|
||||
```
|
||||
`$ npm install immer`
|
||||
```
|
||||
|
||||
### 10\. React Proto
|
||||
|
||||
[React Proto][27] is an application prototyping tool for developers and designers. It helps you layout your project structure to make decisions in advance, so you don't waste time making changes later in development. This tool specifically helps people who prefer design over coding; for example, you can drag and drop elements instead of writing them. The tool helps you mark all potential components and give them names, properties, and a hierarchy for prototyping.
|
||||
|
||||
React Proto is open source under the MIT License, and you can access its [source code][28] in its GitHub repo.
|
||||
|
||||
To install it, first, fork the [repository][28]. Next, install dependencies with:
|
||||
|
||||
|
||||
```
|
||||
`$ npm install`
|
||||
```
|
||||
|
||||
Run the application with:
|
||||
|
||||
|
||||
```
|
||||
`$ npm start`
|
||||
```
|
||||
|
||||
To start a development environment, run:
|
||||
|
||||
|
||||
```
|
||||
`$ npm run dev`
|
||||
```
|
||||
|
||||
### Boost your career with ReactJS tools
|
||||
|
||||
There's no shortage of resources for JavaScript. To learn more about the frameworks I've mentioned in this article, plus many more, check out the [Awesome React][29] repository on GitHub, a list of awesome things related to React.
|
||||
|
||||
By learning these 10 must-have tools, you'll boost your productivity and your résumé, and more importantly, you'll have a good grasp on JavaScript-based web development.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/reactjs-tools
|
||||
|
||||
作者:[Prayaag Kasundra][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/prayaag-kasundra
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_3.png?itok=qw2A18BM (Woman sitting in front of her computer)
|
||||
[2]: https://www.simform.com/why-use-react/
|
||||
[3]: https://www.npmjs.com/
|
||||
[4]: https://opensource.com/article/20/3/chocolatey
|
||||
[5]: https://opensource.com/article/20/6/homebrew-mac
|
||||
[6]: https://nodejs.org/en/download/package-manager/
|
||||
[7]: https://facebook.github.io/create-react-app/
|
||||
[8]: https://github.com/facebook/create-react-app
|
||||
[9]: http://www.reactboilerplate.com/
|
||||
[10]: https://github.com/coryhouse/react-slingshot
|
||||
[11]: http://www.reactsight.com/
|
||||
[12]: https://github.com/React-Sight/React-Sight
|
||||
[13]: https://chrome.google.com/webstore/detail/react-sight/aalppolilappfakpmdfdkpppdnhpgifn
|
||||
[14]: http://nikgraf.github.io/belle/
|
||||
[15]: https://en.wikipedia.org/wiki/WAI-ARIA
|
||||
[16]: https://github.com/nikgraf/belle
|
||||
[17]: https://evergreen.segment.com/
|
||||
[18]: https://github.com/segmentio/evergreen
|
||||
[19]: https://github.com/teambit/bit
|
||||
[20]: https://github.com/teambit/bit/blob/master/LICENSE
|
||||
[21]: https://storybook.js.org/
|
||||
[22]: https://github.com/storybookjs/storybook
|
||||
[23]: https://jaredpalmer.com/formik/
|
||||
[24]: https://github.com/jaredpalmer/formik
|
||||
[25]: https://immerjs.github.io/immer/docs/introduction
|
||||
[26]: https://github.com/immerjs/immer
|
||||
[27]: https://react-proto.github.io/react-proto/
|
||||
[28]: https://github.com/React-Proto/react-proto
|
||||
[29]: https://github.com/enaqx/awesome-react
|
143
sources/tech/20200630 Painless file extraction on Linux.md
Normal file
143
sources/tech/20200630 Painless file extraction on Linux.md
Normal file
@ -0,0 +1,143 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Painless file extraction on Linux)
|
||||
[#]: via: (https://www.networkworld.com/article/3564265/painless-file-extraction-on-linux.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
Painless file extraction on Linux
|
||||
======
|
||||
|
||||
Thinkstock
|
||||
|
||||
Extracting files from archives in Linux systems is considerably less painful than tooth extraction, but sometimes seems more complicated. In this post, we will take a look at how you can easily extract files from just about any kind of archive you’re likely to run into on a Linux system.
|
||||
|
||||
There’s a pile of them – everything from .gz to .tbz2 files with some variations for how those files are named. Sure, you can memorize all of the various commands available for extracting files from archives along with the options they offer, but you can also just deposit all that know-how into a script and stop worrying about the details.
|
||||
|
||||
In this post, we assemble a series of extraction commands into a script that calls the proper command to extract the content of file archives depending on the archive file names. The script starts with some commands to verify that a file name has been provided as an argument or ask that the person running the script provide one.
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo -n "filename> "
|
||||
read filename
|
||||
else
|
||||
filename=$1
|
||||
fi
|
||||
|
||||
if [ ! -f "$filename" ]; then
|
||||
echo "No such file: $filename"
|
||||
exit $?
|
||||
fi
|
||||
```
|
||||
|
||||
Got that? The script prompts for a file name if no arguments were offered and uses the argument provided if there is one. It then verifies that the file actually exists. If not, the script exits.
|
||||
|
||||
The next step is to use a bash case statement to call the appropriate extraction command for the archive depending on its name. For some of these file types (e.g., .bz2), other commands than tar would also work, but we only include one extraction command for each file naming convention. So, here’s the case statement with the various archive file names.
|
||||
|
||||
```
|
||||
case $filename in
|
||||
*.tar) tar xf $filename;;
|
||||
*.tar.bz2) tar xjf $filename;;
|
||||
*.tbz) tar xjf $filename;;
|
||||
*.tbz2) tar xjf $filename;;
|
||||
*.tgz) tar xzf $filename;;
|
||||
*.tar.gz) tar xzf $filename;;
|
||||
*.gz) gunzip $filename;;
|
||||
*.bz2) bunzip2 $filename;;
|
||||
*.zip) unzip $filename;;
|
||||
*.Z) uncompress $filename;;
|
||||
*) echo "No extract option for $filename"
|
||||
esac
|
||||
```
|
||||
|
||||
If the file provided to the script has a file extension that doesn’t match any of those known to the script, the “No extract option for $filename” message will be issued. If any archive types that you use are missing, just add them along with the required extraction commands.
|
||||
|
||||
Add the bash header to the top of the script, make it executable and you should be ready to go.
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo -n "filename> "
|
||||
read filename
|
||||
else
|
||||
filename=$1
|
||||
fi
|
||||
|
||||
if [ ! -f "$filename" ]; then
|
||||
echo "No such file: $filename"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
case $filename in
|
||||
*.tar) tar xf $filename;;
|
||||
*.tar.bz2) tar xjf $filename;;
|
||||
*.tbz) tar xjf $filename;;
|
||||
*.tbz2) tar xjf $filename;;
|
||||
*.tgz) tar xzf $filename;;
|
||||
*.tar.gz) tar xzf $filename;;
|
||||
*.gz) gunzip $filename;;
|
||||
*.bz2) bunzip2 $filename;;
|
||||
*.zip) unzip $filename;;
|
||||
*.Z) uncompress $filename;;
|
||||
*.rar) rar x $filename ;;
|
||||
*)
|
||||
```
|
||||
|
||||
If you want the script to display the contents of the archive as they are being extracted, add the verbose option (-v) to each string of command arguments:
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo -n "filename> "
|
||||
read filename
|
||||
else
|
||||
filename=$1
|
||||
fi
|
||||
|
||||
if [ ! -f "$filename" ]; then
|
||||
echo "No such file: $filename"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
case $filename in
|
||||
*.tar) tar xvf $filename;;
|
||||
*.tar.bz2) tar xvjf $filename;;
|
||||
*.tbz) tar xvjf $filename;;
|
||||
*.tbz2) tar xvjf $filename;;
|
||||
*.tgz) tar xvzf $filename;;
|
||||
*.tar.gz) tar xvzf $filename;;
|
||||
*.gz) gunzip -v $filename;;
|
||||
*.bz2) bunzip2 -v $filename;;
|
||||
*.zip) unzip -v $filename;;
|
||||
*.Z) uncompress -v $filename;;
|
||||
*) echo "No extract option for $filename"
|
||||
esac
|
||||
```
|
||||
|
||||
### Wrap-up
|
||||
|
||||
While it’s certainly possible to create an alias for each extraction command you’re likely to use, it’s easier to let a script provide the command for each file type you encounter than having to stop and work out each of the commands and options yourself.
|
||||
|
||||
Join the Network World communities on [Facebook][1] and [LinkedIn][2] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3564265/painless-file-extraction-on-linux.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.facebook.com/NetworkWorld/
|
||||
[2]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,142 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (nophDog)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Read and write data from anywhere with redirection in the Linux terminal)
|
||||
[#]: via: (https://opensource.com/article/20/6/redirection-bash)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
Read and write data from anywhere with redirection in the Linux terminal
|
||||
======
|
||||
Redirection is an efficient way to get data from one place to another
|
||||
without a lot of mouse moving and key pressing.
|
||||
![Hands programming][1]
|
||||
|
||||
Redirection of input and output is a natural function of any programming or scripting language. Technically, it happens inherently whenever you interact with a computer. Input gets read from `stdin` (standard input, usually your keyboard or mouse), output goes to `stdout` (standard output, a text or data stream), and errors get sent to `stderr`. Understanding that these data streams exist enables you to control where information goes when you're using a shell, such as [Bash][2] or [Zsh][3].
|
||||
|
||||
Standard in, standard out, and standard error exist as filesystem locations on Linux. You can see them in `/dev`:
|
||||
|
||||
|
||||
```
|
||||
$ ls /dev/std*
|
||||
/dev/stderr@ /dev/stdin@ /dev/stdout@
|
||||
```
|
||||
|
||||
You can't do much with them directly, but it's sometimes useful to think of them as meta-locations where you can send data.
|
||||
|
||||
The basics of redirection are simple: use some number of `>` characters to redirect output, and some number of `<` characters to redirect input.
|
||||
|
||||
### Redirecting output
|
||||
|
||||
To write the output of the [ls][4] command to a file:
|
||||
|
||||
|
||||
```
|
||||
`$ ls > list.txt`
|
||||
```
|
||||
|
||||
You don't see the output of `ls` as you normally would, because the output is written to the `list.txt` file instead of your screen. This is so versatile, in fact, that you can even use it to copy the contents of one file to another. It doesn't have to be a text file, either. You can use redirection for binary data:
|
||||
|
||||
|
||||
```
|
||||
`$ cat image.png > picture.png`
|
||||
```
|
||||
|
||||
(In case you're wondering why you'd ever want to do that, it's for a sometimes-useful repercussion on [file permissions][5].)
|
||||
|
||||
### Redirecting input
|
||||
|
||||
You can redirect input "into" a command, too. This is arguably less useful than redirecting output because many commands are already hard-coded to take input from an argument you provide. It can be useful, however, when a command expects a list of arguments, and you have those arguments in a file and want to quickly "copy and paste" them from the file into your terminal (except you don't actually want to copy and paste):
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install $(<package.list)`
|
||||
```
|
||||
|
||||
Common uses of input redirection are the **here-document** (or just **here-doc** for short) and **here-string** techniques. This input method redirects a block of text into the standard input stream, up to a special end-of-file marker (most people use `EOF`, but it can be any string you expect to be unique). Try typing this (up to the second instance of `EOF`) into a terminal:
|
||||
|
||||
|
||||
```
|
||||
$ echo << EOF
|
||||
> foo
|
||||
> bar
|
||||
> baz
|
||||
> EOF
|
||||
```
|
||||
|
||||
The expected result:
|
||||
|
||||
|
||||
```
|
||||
foo
|
||||
bar
|
||||
baz
|
||||
```
|
||||
|
||||
A **here-doc** is a common trick used by [Bash][2] scripters to dump several lines of text into a file or onto the screen. As long as you don't forget to end the clause with your end-of-file marker, it's an effective way to avoid unwieldy lists of `echo` or `printf` statements.
|
||||
|
||||
A **here-string** is similar to a **here-doc**, but it consists of just one string (or several strings disguised as a single string with quotation marks):
|
||||
|
||||
|
||||
```
|
||||
$ cat <<< "foo bar baz"
|
||||
foo bar baz
|
||||
```
|
||||
|
||||
### Redirecting error messages
|
||||
|
||||
Error messages go to a stream called `stderr`, designated as `2>` for the purposes of redirection. This command directs error messages to a file called `output.log`:
|
||||
|
||||
|
||||
```
|
||||
`$ ls /nope 2> output.log`
|
||||
```
|
||||
|
||||
### Sending data to /dev/null
|
||||
|
||||
Just as there are locations for standard in, standard out, and error, there's also a location for _nowhere_ on the Linux filesystem. It's called `null`, and it's located in `/dev`, so it's often pronounced "devnull" by people who use it too frequently to say "slash dev slash null."
|
||||
|
||||
You can send data to `/dev/null` using redirection. For instance, the `find` command tends to be verbose, and it often reports permission conflicts while searching through your files:
|
||||
|
||||
|
||||
```
|
||||
$ find ~ -type f
|
||||
/home/seth/actual.file
|
||||
find: `/home/seth/foggy': Permission denied
|
||||
find: `/home/seth/groggy': Permission denied
|
||||
find: `/home/seth/soggy': Permission denied
|
||||
/home/seth/zzz.file
|
||||
```
|
||||
|
||||
The `find` command processes that as an error, so you can redirect just the error messages to `/dev/null`:
|
||||
|
||||
|
||||
```
|
||||
$ find ~ -type f 2> /dev/null
|
||||
/home/seth/actual.file
|
||||
/home/seth/zzz.file
|
||||
```
|
||||
|
||||
### Using redirection
|
||||
|
||||
Redirection is an efficient way to get data from one place to another in Bash. You may not use redirection all the time, but learning to use it when you need it can save you a lot of needless opening files and copying and pasting data, all of which generally require mouse movement and lots of key presses. Don't resort to such extremes. Live the good life and use redirection.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/redirection-bash
|
||||
|
||||
作者:[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/programming-code-keyboard-laptop.png?itok=pGfEfu2S (Hands programming)
|
||||
[2]: https://opensource.com/resources/what-bash
|
||||
[3]: https://opensource.com/article/19/9/getting-started-zsh
|
||||
[4]: https://opensource.com/article/19/7/master-ls-command
|
||||
[5]: https://opensource.com/article/19/8/linux-permissions-101
|
72
sources/tech/20200630 What-s New in Harbor 2.0.md
Normal file
72
sources/tech/20200630 What-s New in Harbor 2.0.md
Normal file
@ -0,0 +1,72 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (What’s New in Harbor 2.0)
|
||||
[#]: via: (https://www.linux.com/audience/developers/whats-new-in-harbor-2-0/)
|
||||
[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/)
|
||||
|
||||
What’s New in Harbor 2.0
|
||||
======
|
||||
|
||||
[Harbor][1] is an open-source cloud native registry project that stores, signs, and scans content. Harbor was created by a team of engineers at VMware China. The project was contributed to CNCF for wider adoption and contribution. Recently the project announced its 2.0 release. [Swapnil Bhartiya, the founder of TFiR.io][2], sat down with Michael Michael, Harbor maintainer and VMware’s Director of Product Management, to talk about Harbor, community and the latest release.
|
||||
|
||||
Here is a lightly edited transcript of the interview:
|
||||
|
||||
**Swapnil Bhartiya: Let’s assume that you and I are stuck in an elevator and I suddenly ask you, “What is Harbor?” So please, explain what it is.**
|
||||
Michael Michael: Hopefully you’re not stuck in the elevator for long; but Harbor essentially is an open source cloud-native registry. Think of this as a repository where you can store and serve all of your cloud-native assets, your container images, your Helm charts, and everything else you need to basically build cloud native applications. And then some putting posts on top of that, some very good policy engines that allow you to enforce compliance, make sure your images that you’re serving are free from vulnerabilities and making sure that you have all the guardrails in place so an operator can manage this registry and delivery it to his developers in a self-service way.
|
||||
|
||||
**Swapnil Bhartiya: Harbor came out of VMware China. So I’m also curious that what was the problem that the team saw at that point? Because there were a lot of projects that were doing something similar, that you saw unique that Harbor was created?**
|
||||
Michael Michael: So essentially the need there was, there wasn’t really a good way for an enterprise to have a hosted registry that has all of the enterprise capabilities they were looking for, while at the same time being able to have full control over the registry. Like a lot of the cloud providers have their own registry implementation, there’s Docker Hub out there, or you can go and purchase something at a very expensive price point. But if you’re looking for an open source solution that gives you end to end registered capabilities, like your developers can push images and pull images, and then your operators can go and put a policy that says, Hey, I want to allow this development team to create a project, but not using more than a terabyte of storage. None of those solutions had that, so there was a need, a business need here to develop a registry. And on top of that, we realized that it wasn’t just us that had the same need, there was a lot of users and enterprises out there in the cloud native ecosystem.
|
||||
|
||||
**Swapnil Bhartiya: The project has been out for a while and based on what you just told me, I’m curious what kind of community the product has built around itself and how the project has evolved? Because we will also talk about the new release version 2.0 but before that, I want to talk about the volitional project and the community around it.**
|
||||
Michael Michael: Project has evolved fairly well over the years we have increased our contributors. The contribution statistics are that CNCF is creating are showing that we’re growing our community. We now have maintainers in the project from multiple organizations and there are actually three organizations that have more than one maintainer on the project. So it’s kind of showing you that they’re, the ecosystem has picked up. We are adding more and more functionality into Harbor, and we’re also making Harbor pluggable. So there are areas of Harbor where we’re saying, Hey, here’s the default experience with Harbor, but if you want to extend the experience based on the needs of your users go ahead and do that and here’s an easy way to implement an interface and do that. That has really increased the popularity of Harbor. That means two things, we can give you a batteries-included version of Harbor from the community and then we’ll give you the option to extend that to fit the needs of your organization.
|
||||
|
||||
And more importantly, if you have made investments in other tooling, you can plug and play Harbor in that. When I say other tooling, I mean, things like CI/CD systems, those systems are primarily driving the development life cycle. So for example, you go from source code to container image to something that’s stored in a registry like Harbor. The engine that drives the pipeline, that workflow in a lot of ways is a CI/CD engine. So how do you integrate Harbor well with such systems? We’ve made that a reality now and that has made Harbor easier to put in an organization and get it adopted with existing standards and existing investments.
|
||||
|
||||
**Swapnil Bhartiya: Now let’s talk about the recently announced 2.0. Talk about some of the core features, functionalities that you are excited about in this release.**
|
||||
Michael Michael: Absolutely, there’s like three or four features that really, really excite me. A long time coming is the support for OCI. The OCI is the Open Container Initiative and essentially it’s creating a standardized way to describe what an image looks like. And we in Harbor 2.0 we are able to announce that we have full OCI supporting Harbor. What does that mean for users? In previous releases of Harbor you could only put into Harbor two types of artifacts; a container image and a Helm chart. It satisfies a huge number of the use cases for customers, but it’s not enough in this new cloud native ecosystem, there are additional things that as a developer, as an operator, as a Kubernetes administrator, you might want to push into a repository like Harbor and have them also adopt a lot of the policy engine that Harbor provides.
|
||||
|
||||
Give you a few examples, single bundles, the cloud native application, a bundle. You could have OPA files, you could have singularity and other OCI compliant files. So now Harbor tells you that, Hey, you have any file type out there? If it’s OCI compliant, you can push it to Harbor, you can pull it from Harbor. And then you can add things like coders and retention policies and immutability policies and replication policies on top of that. The thing about that now, just by adding a few more types of supported artifacts into Harbor, those types immediately get to use the full benefit of Harbor in terms of our entire policy engine and the compliance that do offer to administrators of Harbor.
|
||||
|
||||
**Swapnil Bhartiya: What does OCI compliance mean for users? Because by being compliant, you have to be more strict about what you can and cannot do. So can you talk about that? And also how does that also affect the existing users, should they have to worry about something or it doesn’t really matter?**
|
||||
|
||||
Michael Michael: Existing users shouldn’t have to worry about this, there’s fully backward compatibility that can still push their container images, which are OCI compliant. And if you’re using a Helm Chart before, you can still push it into Charts Museum, which is a key component of Harbor, but you can now also put a Helm Chart as an OCI file. So for existing users, not much difference, backward compatibility, we still support them. The users are brothers here, we’re not going to forget them. But what it means now is actually, it’s not more strict this is a lot more open. If you’re developing artifacts that are OCI compliant and they’re following the standard way of describing an image and a standard way of actually executing an image at run time; now Kubernetes is also OCI compliant at the run time. Then you’re getting the benefits of both worlds. You get Harbor as the repository where you can store your images and you also get a run time engine that’s OCI compliant that could potentially execute them. The really great benefit here for the users.
|
||||
|
||||
A couple of other features that Harbor 2.0 Brings are super, super exciting. The first one is the introduction of Trivy by Aqua Security, as the batteries included built-in scanner in Harbor. Previously, we use Claire as our built-in scanner and with the release of Harbor called 1.10 that came out in December 2019, we introduced what we call a pluggable framework, think of this as a way that security vendors like Aqua and Encore can come in and create their own implementation of a security scanner to do static analysis on top of images that are deployed in Harbor.
|
||||
|
||||
So we still included Claire as a built-in scanner and then we added additional extension points. Now we actually liked Trivy that much our community and our users love Trivy it’s the ability to enforce and to study analysis on top of multiple operating systems on top of multiple application managers, it’s very well aligned with the vision that you have from a security standpoint in Harbor. And now we added Trivy as the built-in scanner in Harbor, we ship with it now. A great, great achievement and kudos to the Aqua team for delivering Trivy as an open source project.
|
||||
|
||||
**Swapnil Bhartiya: That’s the question I was going to ask, but I, once again, I’ll ask the same thing again, that, what does it mean for users who were using Claire?**
|
||||
Michael Michael: If you’re using Claire before and you want to continue using Claire, by all means, we’re going to continue updating Claire, Claire is already included in Harbor. There’s no changes in the experience. However, if you’re thinking that Trivy is a better scanner for you, and by the way, you can use them side by side so you can compare the scanning results from each scanner. And if Trivy is a better option for you, we enabled you to make that choice. Now the way Harbor works is that you have a concept of multitenancy and we isolate a lot of the settings and the policy in the organization of images and on a per-project basis. So what does that mean? You can actually go into Harbor and you can define a project and you can say for this project I want Claire to be the built-in scanner.
|
||||
|
||||
And then Claire will scan all your projects in that, all the files in that project. And you can use a second project and say, well, I now want Trivy to be the scanner for this project. And then Trivy of you will scan your images. And if you have the same set of images, you can compare them and see which scanner works best based on your needs as an organization and as a user. This phenomenal, right? To give users choice and we give them all the data, but ultimately they have to make the decision on what is the best scanner for them to use based on their scenarios, the type of application images and containers that they use and the type of libraries in they use those containers.
|
||||
|
||||
**Swapnil Bhartiya: Excellent. Before we wrap this up, what kind of roadmap you have for Harbor, of course, it’s an open source project. So there’s no such thing as when the 2.0 release is coming out. But when we look at 2020, what are the major challenges that you want to address? What are the problems you want to solve and what does the basic roadmap look like?**
|
||||
Michael Michael: Absolutely, I think that one of the things that we’ve been trying to do as a maintainer team for Harbor is to kind of create some themes around the release is kind of put a blueprint down in terms of what is it that we’re trying to achieve? And then identify the features that make sense in that theme. And we’re not coming up with this from a vacuum, we’re talking to users, we’re talking to other companies where we have KubeCon events in the past where we had presentations and individuals came to us asking us sets of questions. We have existing users that give us feedback. When we gather all of that, one of the things that we came up with as the next thing for our release is what you call image distribution. So we have three key features that we’re trying to tackle in that area.
|
||||
|
||||
The first one is how can Harbor act as a proxy cache? To enable organizations that are either deploying Kubernetes environments at the edge and they want a local Harbor instance to proxy or mirror images from the mothership like your main data center and where networking is at the premium. Maybe some of the Kubernetes nodes are not even connected to the network and they want to be a support to pull images from Harbor and then Harbor pulls the images from the upstream data center. Very, very important feature. Continuing down the path of image distribution. We’re integrating Harbor with both Dragonfly by Alibaba and Project Kraken by Uber to facilitate peer to peer distribution mechanisms for your container images. So how can we efficiently distribute images at the edge in multiple data centers in branch offices that don’t have a good network or thick network pipe between them? And how can Harbor make sure that the right images land at the right place? Big, big features that we’re trying to work with the community. And obviously we’re not doing this alone, we’re working with both Kraken and the Dragonfly communities to achieve that.
|
||||
|
||||
And last, the next feature that we have is what you call garbage collection without downtime. Traditionally, we do garbage collection and this is kind of the process where you get to reclaim some of the files and layers of, basically container images that are no longer in use.
|
||||
|
||||
Think of an organization that pushes and pulls thousands of images every day; they re-tag them, they create new versions. Sometimes you end up with layers that are no longer used, in order for those layers to be reclaimed at the storage and by the system, their registry in needs to be locked down as in nobody can be pulling or pushing images to it. In Harbor 2.0 we actually made a significant advancement where we track all the layers and the metadata of images in our database rather than depending on another tool or product to do it. So now this actually paves a road so that in the future, we could actually do garbage collection with zero downtime where Harbor can identify all the layers that are no longer in use, go reclaim them. And then that will have zero adverse impact or downtime to the users are pushing and pulling content. Huge, huge features and that’s the things that we’re working on in the future.
|
||||
|
||||
**Swapnil Bhartiya: Awesome, thank you Michael for explaining things in detail and talking about Harbor. I look forward to talk to you again. Thank you.**
|
||||
Michael Michael: Absolutely. Thank you so much for the opportunity.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/audience/developers/whats-new-in-harbor-2-0/
|
||||
|
||||
作者:[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://goharbor.io/
|
||||
[2]: https://www.tfir.io/author/arnieswap/#:~:text=Swapnil%20Bhartiya%20Swapnil%20Bhartiya%20is%20the%20Founder%20and,audience%20for%20enterprise%20open%20source%20and%20emerging%20technologies.
|
@ -0,0 +1,210 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (13 Things To Do After Installing Linux Mint 20)
|
||||
[#]: via: (https://itsfoss.com/things-to-do-after-installing-linux-mint-20/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
13 Things To Do After Installing Linux Mint 20
|
||||
======
|
||||
|
||||
Linux Mint is easily one of the [best Linux distributions][1] out there and especially considering the features of [Linux Mint 20][2], I’m sure you will agree with that.
|
||||
|
||||
In case you missed our coverage, [Linux Mint 20 is finally available to download][3].
|
||||
|
||||
Of course, if you’ve been using Linux Mint for a while, you probably know what’s best for you. But, for new users, there are a few things that you need to do after installing Linux Mint 20 to make your experience better than ever.
|
||||
|
||||
### Recommended things to do after installing Linux Mint 20
|
||||
|
||||
In this article, I’m going to list some of them for to help you improve your Linux Mint 20 experience.
|
||||
|
||||
#### 1\. Perform a System Update
|
||||
|
||||
![][4]
|
||||
|
||||
The first thing you should check right after installation is — system updates using the update manager as shown in the image above.
|
||||
|
||||
Why? Because you need to build the local cache of available software. It is also a good idea to update all the software updates.
|
||||
|
||||
If you prefer to use the terminal, simply type the following command to perform a system update:
|
||||
|
||||
```
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
```
|
||||
|
||||
#### 2\. Use Timeshift to Create System Snapshots
|
||||
|
||||
![][5]
|
||||
|
||||
It’s always useful have system snapshots if you want to quickly restore your system state after an accidental change or maybe after a bad update.
|
||||
|
||||
Hence, it’s super important to configure and create system snapshots using Timeshift if you want the ability to have a backup of your system state from time to time.
|
||||
|
||||
You can follow our detailed guide on [using Timeshift][6], if you didn’t know already.
|
||||
|
||||
#### 3\. Install Useful Software
|
||||
|
||||
Even though you have a bunch of useful pre-installed applications on Linux Mint 20, you probably need to install some essential apps that do not come baked in.
|
||||
|
||||
You can simply utilize the software manager or the synaptic package manager to find and install software that you need.
|
||||
|
||||
For starters, you can follow our list of [essential Linux apps][7] if you want to explore a variety of tools.
|
||||
|
||||
Here’s a list of my favorite software that I’d want you to try:
|
||||
|
||||
* [VLC media player][8] for video
|
||||
* [FreeFileSync][9] to sync files
|
||||
* [Flameshot][10] for screenshots
|
||||
* [Stacer][11] to optimize and monitor system
|
||||
* [ActivityWatch][12] to track your screen time and stay productive
|
||||
|
||||
|
||||
|
||||
#### 4\. Customize the Themes and Icons
|
||||
|
||||
![][13]
|
||||
|
||||
Of course, this isn’t something technically essential unless you want to change the look and feel of Linux Mint 20.
|
||||
|
||||
But, it’s very [easy to change the theme and icons in Linux Mint][14] 20 without installing anything extra.
|
||||
|
||||
You get the option to customize the look in the welcome screen itself. In either case, you just need to head on to “**Themes**” and start customizing.
|
||||
|
||||
![][15]
|
||||
|
||||
To do that, you can search for it or find it inside the System Settings as shown in the screenshot above.
|
||||
|
||||
Depending on what desktop environment you are on, you can also take a look at some of the [best icon themes][16] available.
|
||||
|
||||
#### 5\. Enable Redshift to protect your eyes
|
||||
|
||||
![][17]
|
||||
|
||||
You can search for “[Redshift][18]” on Linux Mint and launch it to start protecting your eyes at night. As you can see in the screenshot above, it will automatically adjust the color temperature of the screen depending on the time.
|
||||
|
||||
You may want to enable the autostart option so that it launches automatically when you restart the computer. It may not be the same as the night light feature on [Ubuntu 20.04 LTS][19] but it’s good enough if you don’t need custom schedules or the ability to the tweak the color temperature.
|
||||
|
||||
#### 6\. Enable snap (if needed)
|
||||
|
||||
Even though Ubuntu is pushing to use Snap more than ever, the Linux Mint team is against it. Hence, it forbids APT to use snapd.
|
||||
|
||||
So, you won’t have the support for snap out-of-the-box. However, sooner or later, you’ll realize that some software is packaged only in Snap format. In such cases, you’ll have to enable snap support on Mint.
|
||||
|
||||
```
|
||||
sudo apt install snapd
|
||||
```
|
||||
|
||||
Once you do that, you can follow our guide to know more about [installing and using snaps on Linux][20].
|
||||
|
||||
#### 7\. Learn to use Flatpak
|
||||
|
||||
By default, Linux Mint comes with the support for Flatpak. So, no matter whether you hate using snap or simply prefer to use Flatpak, it’s good to have it baked in.
|
||||
|
||||
Now, all you have to do is follow our guide on [using Flatpak on Linux][21] to get started!
|
||||
|
||||
#### 8\. Clean or Optimize Your System
|
||||
|
||||
It’s always good to optimize or clean up your system to get rid of unnecessary junk files occupying storage space.
|
||||
|
||||
You can quickly remove unwanted packages from your system by typing this in your terminal:
|
||||
|
||||
```
|
||||
sudo apt autoremove
|
||||
```
|
||||
|
||||
In addition to this, you can also follow some of our [tips to free up space on Linux Mint][22].
|
||||
|
||||
#### 9\. Using Warpinator to send/receive files across the network
|
||||
|
||||
Warpinator is a new addition to Linux Mint 20 to give you the ability to share files across multiple computers connected to a network. Here’s how it looks:
|
||||
|
||||
![][23]
|
||||
|
||||
You can just search for it in the menu and get started!
|
||||
|
||||
#### 10\. Using the driver manager
|
||||
|
||||
![Driver Manager][24]
|
||||
|
||||
The driver manager is an important place to look for if you’re using Wi-Fi devices that needs a driver, NVIDIA graphics, or AMD graphics, and drivers for other devices if applicable.
|
||||
|
||||
You just need look for the driver manager and launch it. It should detect any proprietary drivers in use or you can also utilize a DVD to install the driver using the driver manager.
|
||||
|
||||
#### 11\. Set up a Firewall
|
||||
|
||||
![][25]
|
||||
|
||||
For the most part, you might have already secured your home connection. But, if you want to have some specific firewall settings on Linux Mint, you can do that by searching for “Firewall” in the menu.
|
||||
|
||||
As you can observe the screenshot above, you get the ability to have different profiles for home, business, and public. You just need to add the rules and define what is allowed and what’s not allowed to access the Internet.
|
||||
|
||||
You may read our detailed guide on [using UFW for configuring a firewall][26].
|
||||
|
||||
#### 12\. Learn to Manage Startup Apps
|
||||
|
||||
If you’re an experienced user, you probably know this already. But, new users often forget to manage their startup applications and eventually, the system boot time gets affected.
|
||||
|
||||
You just need to search for “**Startup Applications**” from the menu and you can launch it find something like this:
|
||||
|
||||
![][27]
|
||||
|
||||
You can simply toggle the ones that you want to disable, add a delay timer, or remove it completely from the list of startup applications.
|
||||
|
||||
#### 13\. Install Essential Apps For Gaming
|
||||
|
||||
Of course, if you’re into gaming, you might want to read our article for [Gaming on Linux][28] to explore all the options.
|
||||
|
||||
But, for starters, you can try installing [GameHub][29], [Steam][30], and [Lutris][31] to play some games.
|
||||
|
||||
**Wrapping Up**
|
||||
|
||||
That’s it folks! For the most part, you should be good to go if you follow the points above after installing Linux Mint 20 to make the best out of it.
|
||||
|
||||
I’m sure there are more things you can do. I’d like to know what you prefer to do right after installing Linux Mint 20. Let me know your thoughts in the comments below!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/things-to-do-after-installing-linux-mint-20/
|
||||
|
||||
作者:[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-distributions/
|
||||
[2]: https://itsfoss.com/linux-mint-20/
|
||||
[3]: https://itsfoss.com/linux-mint-20-download/
|
||||
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-system-update.png?ssl=1
|
||||
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/07/snapshot-linux-mint-timeshift.jpeg?ssl=1
|
||||
[6]: https://itsfoss.com/backup-restore-linux-timeshift/
|
||||
[7]: https://itsfoss.com/essential-linux-applications/
|
||||
[8]: https://www.videolan.org/vlc/
|
||||
[9]: https://itsfoss.com/freefilesync/
|
||||
[10]: https://itsfoss.com/flameshot/
|
||||
[11]: https://itsfoss.com/optimize-ubuntu-stacer/
|
||||
[12]: https://itsfoss.com/activitywatch/
|
||||
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-theme.png?ssl=1
|
||||
[14]: https://itsfoss.com/install-icon-linux-mint/
|
||||
[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-system-settings.png?ssl=1
|
||||
[16]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/
|
||||
[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-redshift-1.png?ssl=1
|
||||
[18]: https://itsfoss.com/install-redshift-linux-mint/
|
||||
[19]: https://itsfoss.com/ubuntu-20-04-release-features/
|
||||
[20]: https://itsfoss.com/install-snap-linux/
|
||||
[21]: https://itsfoss.com/flatpak-guide/
|
||||
[22]: https://itsfoss.com/free-up-space-ubuntu-linux/
|
||||
[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/mint-20-warpinator-1.png?ssl=1
|
||||
[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2013/12/Additional-Driver-Linux-Mint-16.png?ssl=1
|
||||
[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-firewall.png?ssl=1
|
||||
[26]: https://itsfoss.com/set-up-firewall-gufw/
|
||||
[27]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-startup-applications.png?ssl=1
|
||||
[28]: https://itsfoss.com/linux-gaming-guide/
|
||||
[29]: https://itsfoss.com/gamehub/
|
||||
[30]: https://store.steampowered.com
|
||||
[31]: https://lutris.net
|
@ -0,0 +1,138 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (nophDog)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (7 open source alternatives to VS Code)
|
||||
[#]: via: (https://opensource.com/article/20/6/open-source-alternatives-vs-code)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
VS Code 的 7 个开源替代品
|
||||
======
|
||||
为了避免使用微软版本的 VS Code,我们需要另行选择一个开源的代码编辑器。
|
||||
![Person using a laptop][1]
|
||||
|
||||
Visual Studio Code,也叫 VS Code,是一个跨平台代码编辑器,通用于 Linux、Windows 以及 macOS。它既能编辑简单文本,也能像集成开发环境(IDE)一样管理整个代码库。基于插件,VS Code 有很强的扩展性,并且在市场上的地位足以证明,它的确是一个可靠的文本编辑器。
|
||||
|
||||
微软以开源的方式发布了 VS Code,但是你从微软那儿下载的版本其实并不开源。无论如何,你仍有办法以开源的方式使用 VS Code,或者直接选择其它的开源替代品。
|
||||
|
||||
### 以开源的方式构建 VS Code
|
||||
|
||||
你可以在 [GitHub](2) 获得 VS Code 的源代码。当你 [从微软][3] 那里下载 VS Code 后,你会发现它基于 [Microsoft Software License][4] 许可。这并不是一份开源许可。区别在于构建过程。
|
||||
|
||||
Chris Dias 是微软 VS Code 项目开发者之一,他在 VS Code 与 Chrome 浏览器和其开源的“上游”项目 [Chromium][6] 之间 [作了一个对比][5]。VS Code 确确实实是基于开源代码库构建的。微软官方发布的版本带有一些与微软相关的功能,包括一项商标、一个插件库,一个 C# 调试器以及遥测。但如果你克隆然后自行编译,这些东西都不会被加入,所以你得到了一个名为 Code 的“干净”版本 —— OSS(OSS 代表开源软件)。
|
||||
|
||||
实际上,VS Code 与 Code —— OSS 之间的差异很小。最值得注意的是,VS Code 包含遥测功能,它会记录软件数据。微软不可能监控你的一举一动,而且目前越来越多软件都在收集使用数据。在不在乎 VS Code 的遥测功能,完全取决于你自己。如果你不希望它追踪你的使用情况,这里有一些很棒的 VS Code (开源)替代品。
|
||||
|
||||
### VSCodium
|
||||
|
||||
![Code OSS screenshot][7]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
取代 VS Code 最简单的办法就是构建不带微软附属功能的版本。[VSCodium][9] 项目提供下载 Code 的二进制可执行文件 —— OSS,基于 VS Code 代码库编译,没有配置微软的 `product.json` 。VSCodium 的开发者还竭尽全力禁用了所有难以寻找的遥测选项,除非你自行编译,否则这已经是你能找到的最干净的 VS Code 版本。
|
||||
|
||||
VSCodium 提醒说,开源版本无法提供某些 VS Code 默认带有的专利工具。包括一个 C# 调试器和部分插件。如果你需要它们,可以在 [文档中] 找到解决办法,但是假如你依赖 VS Code 中某些特定的功能,请确保你同样能够在 VSCodium 中使用它们。
|
||||
|
||||
此外,你还得验证是否已禁用所有遥测功能。
|
||||
|
||||
### Code - OSS
|
||||
|
||||
如果不想用 VSCodium 的版本,你可以自己 [从头编译 VS Code][12],得到一样的版本。可执行文件叫做 `Code - OSS`,而不是 `VSCode`,
|
||||
|
||||
如果通过编译源码构建应用,你要确保第一次启动时 [所有遥测都已经被禁用]。
|
||||
|
||||
### Atom
|
||||
|
||||
![Atom screenshot][13]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
[Atom][14] 是一个类似于 IDE 的文本编辑器,当微软收购 Github 的同时也收购了它。和 VS Code 一样,你可以使用插件,扩展 Atom 编辑器,此外,你还能通过自己的工具和主题实现定制。它开源且与 Github 集成。简而言之,只要你能找到你想用的插件,或者你愿意自己动手写,那么 Atom 几乎可以满足你的一切需求。
|
||||
|
||||
跟 VS Code 一样,Atom 也 [默认包含遥测][15]。你可以禁用这个功能,而且跟 VS Code 不同的是,使用插件不受任何限制,所以不必再因为隐私改变你的工作流。对写代码的人来说,毫无疑问 Atom 是很有用的工具,而对于 [使用电脑的人][16],它同样会是一个很赞的编辑器。如果你需要一个顺手的通用编辑器,请试试 Atom。
|
||||
|
||||
### GNOME Builder
|
||||
|
||||
![GNOME Builder screenshot][17]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
为 GNOME 桌面开发的 IDE,[GNOME Builder][18] 是 Linux 平台的代码编辑器,专门用于构建 GNOME 应用。如果你为 Linux 构建应用程序,希望轻松解决兼容性问题,那么 Builder 就是最简单的选择。从 [Flathub.org][19] 安装 Builder;当你开启一个新项目,如果没有安装 GNOME SDK,它会提醒你。这意味着当维护你的应用时,你不必刻意关注 GNOME 的状态,因为 Builder 在替你做这件事。
|
||||
|
||||
然而,Builder 不仅能构建 GNOME 程序。它还支持各种各样的编程语言,包括 Python,Rust,C 和 C++,Java,Go,JavaScript,TypeScript,VB.NET,Markdown 和几种标记语言,甚至更多。它对部分语言有全面的支持,包括自动补全以及弹出式函数定义,但是其它语言仅仅含有一些比较方便的功能,例如语法高亮跟自动匹配括号。不管你是不是一个正经的程序员,或者你只想要一个给力的 HTML 和 CSS 编辑器,这个 IDE 都能让你舒心使用。
|
||||
|
||||
### Geany
|
||||
|
||||
![Geany screenshot][20]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
[Geany][21] 是一个强大、稳定却轻量的编辑器,它有很多有用的特性,能帮你写 Bash,Python,Lua,XML,HTML,LaTex,当然远不止这些。对 50 种不同的编程、脚本、标记语言和各种文件类型(比如 .diff 和 .po),Geany 都有很好的支持。退一万步讲,Geany 还有括号匹配和语法高亮 —— 通常来说,它包含更多功能。
|
||||
|
||||
Geany 是一个小型编辑器,但是通过插件,你可以为它添加特性,例如项目展示盘,文件系统树,调试,终端,等等,直到它看起来像一个 IDE。当然,萝卜白菜各有所爱,你也可以尽量使它保持简洁易用。如果因为电脑 CPU 或者内存的限制而无法使用 VS Code,那么很明显 Geany 可以作为你的选择。它只占用少量内存,而且启动迅速。即便跟运行在终端里的 Vim 相比,Geany 稍显笨重,但就算在树莓派,它也能做到快速、灵活。
|
||||
|
||||
### Brackets
|
||||
|
||||
![Brackets screenshot][22]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
[Brackets][23] 是面向网页开发者的文本编辑器和 IDE。对于 HTML,CSS,JavaScript,PHP 甚至 Python,它都有很强大的支持。而且跟 VS Code 一样,它也有一个很丰富的插件生态,所以你可以最大限度地扩展它,以适应你所有编程语言的工作。
|
||||
|
||||
有的插件用于辅助解析语言,运行脚本,甚至编译执行代码。Brackets 有一个通俗的传统界面,不管你是否熟悉 IDE 或者像记事本一样简单的文本编辑器,都能驾轻就熟。如果稍微花点时间,添加几个相关插件,然后熟悉它们,你会发现 Brackets 真的是一个很精妙、很有用的编辑器,不管你输入什么,它都能通过自动补全、提示帮你避免低级错误。假如你是程序员,它能帮你加快测验和调试周期。
|
||||
|
||||
### Che
|
||||
|
||||
![Che screenshot][24]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][8])
|
||||
|
||||
如果你喜欢新技术,那你应当尝试 [Che][25] 编辑器。这是一个基于云的 IDE,所以它默认作为 Software as a Service(SaaS)运行,但它是完全开源的,如果你有 Kubernetes 实例,那就可以运行为_你自己的_ SaaS。
|
||||
|
||||
Che 不仅是一个线上 IDE,而且是一个为云开发而构建的 IDE。在 Che 的概念里,用户无需查看本地文件系统。由于它在云端工作,所以你也可以这么做。事实上,如果你有一台 Git 服务器,那就可以直接在它的仓库中把它当作你的文件系统,并完成你的项目。当然,你有权下载所有文件做本地备份。
|
||||
|
||||
但 Che 的主要特点,也是云开发者最为兴奋的一点,它是一个功能全面、带有 Kubernetes 感知功能的开源 IDE。
|
||||
|
||||
### 那么你的选择是?
|
||||
|
||||
你有没有在使用这些 VS Code 替代品中的某一个呢?想不想挑一个试试呢?欢迎在评论中分享你的见解。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/open-source-alternatives-vs-code
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/nophDog)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop)
|
||||
[2]: https://github.com/microsoft/vscode
|
||||
[3]: https://code.visualstudio.com/
|
||||
[4]: https://code.visualstudio.com/license
|
||||
[5]: https://github.com/Microsoft/vscode/issues/60#issuecomment-161792005
|
||||
[6]: https://www.chromium.org/
|
||||
[7]: https://opensource.com/sites/default/files/uploads/code-oss.png (Code OSS screenshot)
|
||||
[8]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[9]: https://vscodium.com/
|
||||
[10]: https://github.com/VSCodium/vscodium/blob/master/DOCS.md
|
||||
[11]: https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting
|
||||
[12]: https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run
|
||||
[13]: https://opensource.com/sites/default/files/uploads/atom.jpg (Atom screenshot)
|
||||
[14]: http://atom.io
|
||||
[15]: https://discuss.atom.io/t/how-do-i-disable-the-metrics-or-tracking/24520
|
||||
[16]: https://opensource.com/article/19/4/write-git
|
||||
[17]: https://opensource.com/sites/default/files/uploads/builder.png (GNOME Builder screenshot)
|
||||
[18]: https://wiki.gnome.org/Apps/Builder
|
||||
[19]: https://flathub.org/apps/details/org.gnome.Builder
|
||||
[20]: https://opensource.com/sites/default/files/uploads/geany.png (Geany screenshot)
|
||||
[21]: https://www.geany.org/
|
||||
[22]: https://opensource.com/sites/default/files/uploads/brackets.jpg (Brackets screenshot)
|
||||
[23]: http://brackets.io/
|
||||
[24]: https://opensource.com/sites/default/files/uploads/che-cpp.jpg (Che screenshot)
|
||||
[25]: https://www.eclipse.org/che/extend/
|
Loading…
Reference in New Issue
Block a user