Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang 2020-11-12 00:05:35 +08:00
commit f1c9401da9
11 changed files with 366 additions and 371 deletions

View File

@ -1,8 +1,8 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12810-1.html)
[#]: subject: (4 cool new projects to try in COPR from October 2020)
[#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-from-october-2020/)
[#]: author: (frostyx https://fedoramagazine.org/author/frostyx/)
@ -33,13 +33,13 @@ sudo dnf install dialect
### GitHub CLI
[gh][7] 是一个官方的 GitHub 命令行客户端。它在终端提供了快速的访问,并完全控制你的项目问题、拉取请求和发布。题(和其他东西)也可以在浏览器中轻松查看,以获得更标准的用户界面,或与他人分享。
[gh][7] 是一个官方的 GitHub 命令行客户端。它在终端提供了快速的访问,并完全控制你的项目问题、拉取请求和发布。题(和其他东西)也可以在浏览器中轻松查看,以获得更标准的用户界面,或与他人分享。
![][8]
#### 安装说明
目前[仓库][9]在 Fedora 33 和 Fedora Rawhide 中提供了 _gh_ 。要安装它,请使用下面的命令:
目前[仓库][9]在 Fedora 33 和 Fedora Rawhide 中提供了 `gh` 。要安装它,请使用下面的命令:
```
sudo dnf copr enable jdoss/github-cli
@ -69,7 +69,7 @@ sudo dnf install glide-rs
#### 安装说明
目前[仓库][15]在 Fedora 31、32、33 和 Rawhide 还有 EPEL8 中提供了 _vim-ale_ 。要安装它,请使用下面的命令:
目前[仓库][15]在 Fedora 31、32、33 和 Rawhide 还有 EPEL8 中提供了 `vim-ale` 。要安装它,请使用下面的命令:
```
sudo dnf copr enable praiskup/vim-ale
@ -85,7 +85,7 @@ via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-from-october-
作者:[frostyx][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/) 荣誉推出

View File

@ -1,8 +1,8 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: (wxy)
[#]: publisher: ( )
[#]: url: ( )
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12809-1.html)
[#]: subject: (Linux Jargon Buster: What are GUI, CLI and TUI in Linux?)
[#]: via: (https://itsfoss.com/gui-cli-tui/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
@ -10,6 +10,8 @@
Linux 黑话解释:什么是 Linux 中的 GUI、CLI 和 TUI
======
![](https://img.linux.net.cn/data/attachment/album/202011/10/092051zw3ofb365a63fahl.jpg)
当你开始使用 Linux 并关注关于 Linux 的网站和论坛时,你会经常遇到诸如 GUI、CLI 等术语,有时还会遇到 TUI。
这一章的 Linux 黑话解释简要解释了这些术语以便你作为一个新的Linux 用户在使用这些缩写词时能够更好地理解上下文。

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (xiao-song-123)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,121 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (4 reasons why JavaScript is so popular)
[#]: via: (https://opensource.com/article/20/11/javascript-popular)
[#]: author: (Nimisha Mukherjee https://opensource.com/users/nimisha)
4 reasons why JavaScript is so popular
======
There are good reasons why JavaScript is consistently among the top
programming languages.
![JavaScript in Vim][1]
As this chart from GitHub's _[State of the Octoverse][2]_ report shows, [JavaScript][3] has consistently been most popular programming language based on the number of contributors to projects on GitHub.
![Top Languages from The State of the Octoverse report][4]
Top languages, per The State of the Octoverse (© 2019, [GitHub Corp][2])
In the [previous article][5] in this series, I dove into the history of JavaScript. In this article, I'll share four of [the reasons][6] it is so popular.
### 1\. JavaScript caters to beginner, intermediate, and advanced developers
JavaScript does not need any environment setup; just open a browser, like Chrome, navigate to [Developer Tools][7], and start coding. Writing a "Hello World" program is as simple as:
```
`console.log("Hello World");`
```
JavaScript's flexibility is best suited for intermediate developers. The language just helps get things done by letting the developer focus on solving the problem. Developers can use a mix of plugins and their own code snippets to get an application working.
While JavaScript is relatively easy to get started with, it is not straightforward to master. If you want to get to an advanced level, here are some of the concepts you need to know:
* **JavaScript's [multi-paradigm][8] nature:** JavaScript supports both functional programming and object-oriented programming (OOP).
* **Applying [design patterns][9] in JavaScript:** The model-view-* ([MV*][10]) design patterns have been among the most popular and have led to the development of [several modern frameworks][11].
* **[Inheritance with prototype chain][12]:** JavaScript cannot implement OOP in the traditional Java class-based model due to its dynamic nature. OOP in JavaScript is achieved through the prototypal inheritance model.
* **[Closures][13]:** A closure gives access to an outer function's scope from an inner function.
* **[Currying][14]:** Currying is a transformation of functions that translates a function from callable as f(a, b, c) into callable as f(a)(b)(c).
* **[Promises][15] and [Observables][16]:** These help you work with asynchronous functions.
* **[TypeScript][17]:** This adds static typing to JavaScript.
### 2\. Omni-platform
JavaScript can run everywhere, including:
* Devices like mobiles, tablets, and laptops
* On the client-side as well as the server-side
This ability to run everywhere makes JavaScript a universal language.
### 3\. Open standards and community
[ECMAScript][18] is the standardized version of JavaScript as well as an open standard language. Companies can use ECMAScript to create a JavaScript implementation. According to [Wikipedia][19], "an ECMAScript engine  is a program that executes source code written in a version of the ECMAScript language standard, for example, JavaScript." The most popular engines, [V8][20] and [SpiderMonkey][21], are open source projects.
JavaScript has been around for 25 years and has a vast community behind it. A developer is spoiled for choice. The community has built so many plugins and frameworks that the phrase "[framework fatigue][22]" was coined.
### 4\. Modern frameworks
Modern frameworks like [React][23], [Angular][24], and [Vue.js][25] have stabilized and are being optimized for better performance. Most frameworks are very developer-friendly with good community support.
### The future
JavaScript is here to stay. Full-stack development and the modern frontend framework continue to help JavaScript cement its position as one of the most popular programming languages.
The [next wave of JavaScript][26] might put the spotlight on:
* **[Deno][27]:** A modern and secure runtime for JavaScript
* **Web components:** Reusable custom elements
* **Integration with AI and ML:** Projects like [Supernova][28] and [BAYOU][29] have made substantial breakthroughs in integrating JavaScript with artificial intelligence and machine learning.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/11/javascript-popular
作者:[Nimisha Mukherjee][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/nimisha
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/javascript_vim.jpg?itok=mqkAeakO (JavaScript in Vim)
[2]: https://octoverse.github.com/
[3]: https://en.wikipedia.org/wiki/JavaScript
[4]: https://opensource.com/sites/default/files/uploads/toplanguages-the_state_of_the_octoverse.png (Top Languages from The State of the Octoverse report)
[5]: https://opensource.com/article/20/10/javascript-part-1
[6]: https://medium.com/paul-heintzelman/so-why-is-javascript-so-popular-f35bd6cfeb39
[7]: https://developers.google.com/web/tools/chrome-devtools
[8]: https://medium.com/javascript-in-plain-english/what-are-javascript-programming-paradigms-3ef0f576dfdb
[9]: https://addyosmani.com/resources/essentialjsdesignpatterns/book/
[10]: https://developpaper.com/javascript-mv-pattern/
[11]: https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel#JavaScript_frameworks
[12]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain
[13]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures
[14]: https://javascript.info/currying-partials
[15]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
[16]: https://rxjs-dev.firebaseapp.com/guide/observable
[17]: https://en.wikipedia.org/wiki/TypeScript
[18]: https://en.wikipedia.org/wiki/ECMAScript
[19]: https://en.wikipedia.org/wiki/List_of_ECMAScript_engines
[20]: https://en.wikipedia.org/wiki/V8_%28JavaScript_engine%29
[21]: https://en.wikipedia.org/wiki/SpiderMonkey
[22]: https://teropa.info/blog/2015/07/15/overcoming-javascript-framework-fatigue.html
[23]: https://en.wikipedia.org/wiki/React_%28web_framework%29
[24]: https://en.wikipedia.org/wiki/Angular_%28web_framework%29
[25]: https://en.wikipedia.org/wiki/Vue.js
[26]: https://medium.com/@rangleio/the-future-of-javascript-in-the-front-end-world-2544c1814e2
[27]: https://en.wikipedia.org/wiki/Deno_%28software%29
[28]: https://techcrunch.com/2018/03/13/supernova-studio/
[29]: https://futurism.com/military-created-ai-learned-to-program

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,163 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Scan/Detect New LUNs and SCSI Disks on Linux)
[#]: via: (https://www.2daygeek.com/scan-detect-luns-scsi-disks-on-redhat-centos-oracle-linux/)
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
How to Scan/Detect New LUNs and SCSI Disks on Linux
======
When the Linux system has connected to the SAN (Storage Area Network) you need to rescan the iSCSI service to discover new LUNs.
To do so, you must provide the WWN number of the Linux host and required LUN size to the storage team.
The following article will help you [**find the WWN number of a Linux host**][1].
Once the storage team has mapped the LUNs with the given Linux host, they will provide you with the new LUN details.
LUN in storage terms is referred to as serial-hex of LUN.
You need to scan the SCSI host to find new LUNs assigned by the storage team.
This can be done in two ways, scan each scsi host device or run the “rescan-scsi-bus.sh” script to detect new disks.
After scanning they can be found under the “/dev/disk/by-id” directory.
```
# ll /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root 10 Jul 9 17:52 scsi-60a98000486e542d4f5a2f47694d684b -> ../../sdah
lrwxrwxrwx 1 root root 9 Jul 9 17:52 scsi-60a98000486e542d4f5a2f47694d684c -> ../../sdw
.
.
lrwxrwxrwx 1 root root 10 Jul 9 17:52 scsi-60a98000486e542d4f5a2f47694d684d -> ../../sdjk
lrwxrwxrwx 1 root root 10 Jul 9 17:52 scsi-60a98000486e542d4f5a2f47694d684e -> ../../sdaa
lrwxrwxrwx 1 root root 9 Jul 9 17:52 scsi-60a98000486e542d4f5a2f47694d684f -> ../../sdh
```
Also, you can find them using the Multipath command if you already have them configured with Multipath.
Multipath is mostly configured into the Oracle database server for better performance.
```
# multipath -ll
60a98000486e542d4f5a2f47694d684b dm-37 NETAPP,LUN C-Mode
size=512G features='3 queue_if_no_path pg_init_retries 50' hwhandler='1 alua' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 1:0:4:18 sdoe 128:416 active ready running
| |- 0:0:4:18 sdpq 131:256 active ready running
| |- 0:0:5:18 sdsr 135:496 active ready running
| `- 1:0:5:18 sdsq 135:480 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
|- 1:0:1:18 sdfw 131:32 active ready running
|- 1:0:0:18 sdci 69:96 active ready running
|- 0:0:1:18 sdbz 68:208 active ready running
|- 0:0:0:18 sds 65:32 active ready running
|- 1:0:3:18 sdmd 69:336 active ready running
|- 1:0:2:18 sdjj 8:464 active ready running
|- 0:0:3:34 sdjt 65:368 active ready running
`- 0:0:2:34 sdgi 131:224 active ready running
```
This procedure works on Red Hat 6.x, 7.x and 8.x (RHEL Red Hat Enterprise Linux) based systems such as CentOS and Oracle Linux.
### Method-1: How to Scan New LUNs and SCSI Disks on Linux Using the “/sys” Class File
The sysfs filesystem is a pseudo-filesystem which provides an interface to kernel data structures.
The files under sysfs provide information about devices, kernel modules, filesystems, and other kernel components.
The sysfs filesystem is commonly mounted at “/sys”. Typically, it is mounted automatically by the system.
You can use the echo command to scan each scsi host device as shown below.
```
# echo "- - -" > /sys/class/scsi_host/host[n]/scan
```
When you run the above command that rescan everything, the three dash (“- -“) refers the wildcard option. These values would be as follow.
```
# echo "c t l" > /sys/class/scsi_host/host[n]/scan
```
where
* **c ** Channel on the HBA
* **t ** SCSI target ID
* **l ** LUN ID
* **n ** HBA number
Run the below command to find all the host bus number on your system.
```
# ls /sys/class/scsi_host
host0 host1 host2
```
Once you get the host bus number, run the following command to discover new disks.
```
# echo "- - -" > /sys/class/scsi_host/host0/scan
# echo "- - -" > /sys/class/scsi_host/host1/scan
# echo "- - -" > /sys/class/scsi_host/host2/scan
```
Also, it can be scanned using “for loop” with a single command.
```
# for host in ls /sys/class/scsi_host/;do echo "- - -" >/sys/class/scsi_host/${host}/scan; done
```
You can check them using the **[ls command][2]** as mentioned at the beginning of the article.
```
# ls /dev/disk/by-id | grep -i "serial-hex of LUN"
```
### Method-2: How to Scan New LUNs and SCSI Disks on Linux Using the rescan-scsi-bus.sh Script
Make sure you have already installed the “sg3_utils” package to use this script. Otherwise, run the following command to install it.
For **RHEL/CentOS 6/7** systems, use the **[yum command][3]** to install sg3_utils.
```
# yum install -y sg3_utils
```
For **RHEL/CentOS 8** and Fedora systems, use the **[dnf command][4]** to install sg3_utils.
```
# dnf install -y sg3_utils
```
Now you can rescan the LUNs using the rescan-scsi-bus.sh script.
```
# ./rescan-scsi-bus.sh
```
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/scan-detect-luns-scsi-disks-on-redhat-centos-oracle-linux/
作者:[Magesh Maruthamuthu][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/magesh/
[b]: https://github.com/lujun9972
[1]: https://www.2daygeek.com/how-to-find-wwn-wwnn-wwpn-number-of-hba-card-in-linux/
[2]: https://www.2daygeek.com/linux-unix-ls-command-display-directory-contents/
[3]: https://www.2daygeek.com/linux-yum-command-examples-manage-packages-rhel-centos-systems/
[4]: https://www.2daygeek.com/linux-dnf-command-examples-manage-packages-fedora-centos-rhel-systems/

View File

@ -1,75 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Tweak your Git config for multiple user IDs)
[#]: via: (https://opensource.com/article/20/10/git-config)
[#]: author: (Ramanathan M https://opensource.com/users/muthiahramanathan)
Tweak your Git config for multiple user IDs
======
Use the same machine for your work and personal Git commits without
manually resetting your config.
![Chat via email][1]
Git's [git config][2] command (hereafter referred to as "config") enables you to set repository or global options for Git. It has many options, and one of them, `includeIf`, is handy when you have dual roles using Git, for example, working full time as a developer and contributing to open source projects in your spare time. Most people in this situation don't want to use a common config for both roles or, at the very least, would rather keep certain portions of their config distinct, especially if they use the same computer in both roles.
This is my situation, so I keep two separate sets of mail IDs as part of my Git config. This way, commits in repositories related to projects at my workplace carry my office mail ID, whereas the commits made to repositories hosted in my personal GitHub account use my personal mail ID.
To illustrate, here is a sample snippet from my global config (maintained at `$HOME/.gitconfig`), which I will describe below.
```
[includeIf "gitdir:~/priv_scm/"]
        path = ~/priv_scm/.gitconfig
[includeIf "gitdir:~/work_scm/"]
        path = ~/work_scm/.gitconfig
```
### What's includeIf?
The `includeIf.condition.path` variable, part of the `include` config directives, allows you to set a custom config conditionally. Also, the path to the custom config can be set as part of the directive.
This directive supports three keywords: `gitdir`, `gitdir/I`, and `onbranch`. I will briefly explain `gitdir`, which I use in the code snippet above; you can learn about the other two in the [docs][3].
Using the `gitdir` keyword in the `includeIf` directive causes a conditional check to be performed on the pattern. Per the rule, if the current working directory matches the specified directory pattern in `gitdir`, then it picks the config from the given path. I'll apply this rule on the config snippet to show how it's evaluated.
In the config snippet, you can see a simple pattern, `~/`, used along with the `gitdir` keyword. This pattern is substituted with the value stored in the `$HOME` environment variable.
### How to use it
If you're using the same system to work on open source projects hosted on GitHub or GitLab and committing to Git repositories at work, you can have two top-level directories, like `$HOME/priv_scm` and `$HOME/work_scm`. Within these two directories, you can have two separate `.gitconfig` files with settings related to your `user.name` and `user.email`. However, they can also be included in a global `.gitconfig` stored at `$HOME` that can hold all the customizations common to both environments.
Here is a snippet of an example `$HOME/priv_scm/.gitconfig`:
```
$ cat $HOME/priv_scm/.gitconfig
[user]
    name  = Ramanathan Muthiah
    email = <personal-mailid-goes-here>
```
With this config in place, you can switch directories and start working on open source projects without resetting some of the config related to Git manually. These changes are handled automatically in the main `.gitconfig` with the aid of the `includeIf` conditional directive.
### Git tips
I hope this tip helps you organize your Git projects. What are your favorite Git tips? Share them in the comments!
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/10/git-config
作者:[Ramanathan M][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/muthiahramanathan
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_chat_communication_message.png?itok=LKjiLnQu (Chat via email)
[2]: https://git-scm.com/docs/git-config
[3]: https://git-scm.com/docs/git-config#_conditional_includes

View File

@ -0,0 +1,115 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: (wxy)
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (4 reasons why JavaScript is so popular)
[#]: via: (https://opensource.com/article/20/11/javascript-popular)
[#]: author: (Nimisha Mukherjee https://opensource.com/users/nimisha)
JavaScript 如此受欢迎的 4 个原因
======
> JavaScript 之所以能在编程语言中名列前茅,是有充分的理由的。
![JavaScript in Vim][1]
如 GitHub 的 [The State of the Octoverse][2] 报告的这张图所示,如果按 GitHub 上项目的贡献者数量统计,[JavaScript][3] 一直是最受欢迎的编程语言。
![The State of the Octoverse 报告中的热门语言][4]
*热门语言根据《The State of the Octoverse》©2019[GitHub Corp][2]*
在本系列的 [上一篇][5] 中,我们深入了解了 JavaScript 的历史。在这篇文章中,我将分享它如此受欢迎的四个[原因][6]。
### 1、JavaScript 适合初级、中级和高级开发人员
JavaScript 不需要任何环境设置,只要打开浏览器,比如 Chrome 浏览器,导航到[开发者工具][7],就可以开始编码。编写一个 “Hello World” 的程序,就这么简单:
```
console.log("Hello World");
```
JavaScript 的灵活性最适合中级开发人员。该语言只是通过让开发人员专注于解决问题来帮助完成任务。开发者可以混合使用插件和自己的代码片段来让一个应用程序工作。
虽然 JavaScript 比较容易上手,但它并不是一下子就能掌握的。如果你想达到高级水平,这里有一些你需要了解的概念:
* **JavaScript 的[多范式][8]特性:** JavaScript 同时支持函数式编程和面向对象编程OOP
* **在 JavaScript 中应用[设计模式][9]** 模型-视图-*[MV*][10])设计模式一直是最流行的模式之一,并促成了[多个现代框架][11]的发展。
* **[带原型链的继承][12]** JavaScript 由于其动态的特性,无法实现传统的 Java 基于类的模式下的 OOP。JavaScript 中的 OOP 是通过原型继承模型实现的。
* **[闭包][13]** 闭包可以从内部函数中访问外部函数的作用域。
* **[Currying][14]** Currying 是函数的一种转换,它将函数从 `f(a, b, c)` 的调用形式转换为 `f(a)(b)(c)` 调用形式。
* **[Promises][15] 和 [Observables][16]** 这些可以帮助你处理异步函数。
* **[TypeScript][17]** 在 JavaScript 中添加了静态类型。
### 2、全平台
JavaScript 可以在任何地方运行,包括:
* 手机、平板电脑和笔记本电脑等设备。
* 在客户端和服务器端。
这种在任何地方都能运行的能力使 JavaScript 成为一种通用语言。
### 3、开放标准和社区
[ECMAScript][18] 是 JavaScript 的标准化版本,也是一种开放的标准语言。公司可以使用 ECMAScript 来创建 JavaScript 的实现。根据[维基百科][19]“ECMAScript 引擎是执行以 ECMAScript 语言标准编写的源代码例如JavaScript的程序”。最流行的引擎 [V8][20] 和 [SpiderMonkey][21] 是开源项目。
JavaScript 已经存在了 25 年,背后有一个庞大的社区。开发者们简直目不暇接,社区已经构建了如此多的插件和框架,以至于创造了“[框架疲劳][22]”这个词。
### 4、现代框架
现代框架如 [React][23]、[Angular][24] 和 [Vue.js][25] 已经稳定下来,并且正在进行优化以获得更好的性能。大多数框架对开发者非常友好,有良好的社区支持。
### 未来
JavaScript 是永恒的。全栈开发和现代前端框架继续帮助 JavaScript 巩固其作为最受欢迎的编程语言之一的地位。
JavaScript 的[下一波][26]可能会将焦点放在。
* **[Deno][27]** JavaScript 的现代安全运行时。
* **网络组件:** 可重复使用的自定义元素。
* **与 AI 和 ML 的整合:** 像 [Supernova][28] 和 [BAYOU][29] 这样的项目在将 JavaScript 与人工智能和机器学习整合方面取得了实质性的突破。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/11/javascript-popular
作者:[Nimisha Mukherjee][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/nimisha
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/javascript_vim.jpg?itok=mqkAeakO (JavaScript in Vim)
[2]: https://octoverse.github.com/
[3]: https://en.wikipedia.org/wiki/JavaScript
[4]: https://opensource.com/sites/default/files/uploads/toplanguages-the_state_of_the_octoverse.png (Top Languages from The State of the Octoverse report)
[5]: https://opensource.com/article/20/10/javascript-part-1
[6]: https://medium.com/paul-heintzelman/so-why-is-javascript-so-popular-f35bd6cfeb39
[7]: https://developers.google.com/web/tools/chrome-devtools
[8]: https://medium.com/javascript-in-plain-english/what-are-javascript-programming-paradigms-3ef0f576dfdb
[9]: https://addyosmani.com/resources/essentialjsdesignpatterns/book/
[10]: https://developpaper.com/javascript-mv-pattern/
[11]: https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel#JavaScript_frameworks
[12]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain
[13]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures
[14]: https://javascript.info/currying-partials
[15]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
[16]: https://rxjs-dev.firebaseapp.com/guide/observable
[17]: https://en.wikipedia.org/wiki/TypeScript
[18]: https://en.wikipedia.org/wiki/ECMAScript
[19]: https://en.wikipedia.org/wiki/List_of_ECMAScript_engines
[20]: https://en.wikipedia.org/wiki/V8_%28JavaScript_engine%29
[21]: https://en.wikipedia.org/wiki/SpiderMonkey
[22]: https://teropa.info/blog/2015/07/15/overcoming-javascript-framework-fatigue.html
[23]: https://en.wikipedia.org/wiki/React_%28web_framework%29
[24]: https://en.wikipedia.org/wiki/Angular_%28web_framework%29
[25]: https://en.wikipedia.org/wiki/Vue.js
[26]: https://medium.com/@rangleio/the-future-of-javascript-in-the-front-end-world-2544c1814e2
[27]: https://en.wikipedia.org/wiki/Deno_%28software%29
[28]: https://techcrunch.com/2018/03/13/supernova-studio/
[29]: https://futurism.com/military-created-ai-learned-to-program

View File

@ -0,0 +1,163 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Scan/Detect New LUNs and SCSI Disks on Linux)
[#]: via: (https://www.2daygeek.com/scan-detect-luns-scsi-disks-on-redhat-centos-oracle-linux/)
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
如何在 Linux 上扫描/检测新的 LUN 和 SCSI 磁盘?
======
当 Linux 系统连接到 SAN存储区域网络你需要重新扫描 iSCSI 服务以发现新的 LUN。
要做到这一点,你必须向存储团队提供 Linux 主机的 WWN 号和所需的 LUN 大小。
下文将帮助你[**查找 Linux 主机的 WWN 号**][1]。
当存储团队将 LUN 与给定的 Linux 主机进行了映射,他们将为你提供新的 LUN 详细信息。
LUN 在存储术语中被称为 LUN 的串行十六进制。
你需要扫描 SCSI 主机来寻找存储团队分配的新 LUN。
这可以通过两种方式进行,扫描每个 scsi 主机设备或运行 “rescan-scsi-bus.sh” 脚本来检测新磁盘。
扫描后可以在 “/dev/disk/by-id” 目录下找到它们。
```
# ll /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root 10 Jul 9 17:52 scsi-60a98000486e542d4f5a2f47694d684b -> ../../sdah
lrwxrwxrwx 1 root root 9 Jul 9 17:52 scsi-60a98000486e542d4f5a2f47694d684c -> ../../sdw
.
.
lrwxrwxrwx 1 root root 10 Jul 9 17:52 scsi-60a98000486e542d4f5a2f47694d684d -> ../../sdjk
lrwxrwxrwx 1 root root 10 Jul 9 17:52 scsi-60a98000486e542d4f5a2f47694d684e -> ../../sdaa
lrwxrwxrwx 1 root root 9 Jul 9 17:52 scsi-60a98000486e542d4f5a2f47694d684f -> ../../sdh
```
另外,如果你已经用 Multipath 配置了它们,那么可以用 Multipath 命令找到。
Multipath 主要是配置到 Oracle 数据库服务器中,以提高性能。
```
# multipath -ll
60a98000486e542d4f5a2f47694d684b dm-37 NETAPP,LUN C-Mode
size=512G features='3 queue_if_no_path pg_init_retries 50' hwhandler='1 alua' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 1:0:4:18 sdoe 128:416 active ready running
| |- 0:0:4:18 sdpq 131:256 active ready running
| |- 0:0:5:18 sdsr 135:496 active ready running
| `- 1:0:5:18 sdsq 135:480 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
|- 1:0:1:18 sdfw 131:32 active ready running
|- 1:0:0:18 sdci 69:96 active ready running
|- 0:0:1:18 sdbz 68:208 active ready running
|- 0:0:0:18 sds 65:32 active ready running
|- 1:0:3:18 sdmd 69:336 active ready running
|- 1:0:2:18 sdjj 8:464 active ready running
|- 0:0:3:34 sdjt 65:368 active ready running
`- 0:0:2:34 sdgi 131:224 active ready running
```
这个过程适用于基于 Red Hat 6.x、7.x 和 8.xRHEL - Red Hat Enterprise Linux的系统如 CentOS 和 Oracle Linux。
### 方法 1如何使用 “/sys” 类文件在 Linux 上扫描新的 LUN 和 SCSI 磁盘
sysfs 文件系统是一个伪文件系统,它为内核数据结构提供了一个接口。
sysfs 下的文件提供了关于设备、内核模块、文件系统和其他内核组件的信息。
sysfs 文件系统通常被挂载在 “/sys”。通常它是由系统自动挂载的。
你可以使用 echo 命令来扫描每个 scsi 主机设备,如下所示:
```
# echo "- - -" > /sys/class/scsi_host/host[n]/scan
```
当你运行上面的重新扫描所有的命令时,三个破折号(“- -“)指的是通配符选项。这些值如下:
```
# echo "c t l" > /sys/class/scsi_host/host[n]/scan
```
这里:
* **c ** HBA 上的通道
* **t ** SCSI 目标 ID
* **l ** LUN ID
* **n ** HBA 编号
运行下面的命令来查找系统中所有的主机总线编号:
```
# ls /sys/class/scsi_host
host0 host1 host2
```
得到主机总线编号后,运行以下命令来发现新的磁盘:
```
# echo "- - -" > /sys/class/scsi_host/host0/scan
# echo "- - -" > /sys/class/scsi_host/host1/scan
# echo "- - -" > /sys/class/scsi_host/host2/scan
```
另外,还可以用 ”for 循环“用一条命令进行扫描。
```
# for host in ls /sys/class/scsi_host/;do echo "- - -" >/sys/class/scsi_host/${host}/scan; done
```
你可以使用文章开头提到的 **[ls 命令][2]**来检查它们。
```
# ls /dev/disk/by-id | grep -i "serial-hex of LUN"
```
### 方法 2如何使用 rescan-scsi-bus.sh 脚本在 Linux 上扫描新的 LUN 和 SCSI 磁盘
确保你已经安装了 “sg3_utils” 包来使用这个脚本。否则,运行以下命令来安装它。
对于 **RHEL/CentOS 6/7** 系统,使用 **[yum 命令][3]**安装 sg3_utils。
```
# yum install -y sg3_utils
```
对于 **RHEL/CentOS 8** 和 Fedora 系统,使用 **[dnf 命令][4]**安装 sg3_utils。
```
# dnf install -y sg3_utils
```
现在你可以使用 rescan-scsi-bus.sh 脚本重新扫描 LUN。
```
# ./rescan-scsi-bus.sh
```
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/scan-detect-luns-scsi-disks-on-redhat-centos-oracle-linux/
作者:[Magesh Maruthamuthu][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/magesh/
[b]: https://github.com/lujun9972
[1]: https://www.2daygeek.com/how-to-find-wwn-wwnn-wwpn-number-of-hba-card-in-linux/
[2]: https://www.2daygeek.com/linux-unix-ls-command-display-directory-contents/
[3]: https://www.2daygeek.com/linux-yum-command-examples-manage-packages-rhel-centos-systems/
[4]: https://www.2daygeek.com/linux-dnf-command-examples-manage-packages-fedora-centos-rhel-systems/

View File

@ -0,0 +1,74 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Tweak your Git config for multiple user IDs)
[#]: via: (https://opensource.com/article/20/10/git-config)
[#]: author: (Ramanathan M https://opensource.com/users/muthiahramanathan)
调整你的 Git 配置以适应多个用户 ID 的需要
======
使用相同的机器用于工作和个人的 Git 提交,而无需手动重置你的配置。
![Chat via email][1]
Git 的 [git config][2] 命令可以让你为 Git 设置仓库或全局选项。它有很多选项,其中的一个选项 `includeIf` 在你使用在 Git 时有双重角色时非常方便,比如说,你既是全职的开发者,又在业余时间为开源项目做贡献。在这种情况下,大多数人都不想为两个角色使用一个共同的配置,或者,至少,他们宁愿保持配置的某些部分是不同的,尤其是当他们在两个角色中使用同一台计算机时。
我的情况就是这样,所以我在 Git 配置中保留了两组不同的邮件 ID。这样一来在我工作场所的项目仓库中提交的内容就会使用我办公室的邮件 ID而在我个人 GitHub 帐户中提交的内容则使用我个人的邮件 ID。
以下是我的全局配置(维护在 `$HOME/.gitconfig`)中的一个片段,我将在下文中介绍。
```
[includeIf "gitdir:~/priv_scm/"]
        path = ~/priv_scm/.gitconfig
[includeIf "gitdir:~/work_scm/"]
        path = ~/work_scm/.gitconfig
```
### 什么是 includeIf
`includeIf.condition.path` 变量,是 `include` 配置指令的一部分,允许你有条件地设置自定义 config。同时自定义配置的路径也可以作为指令的一部分来设置。
这个指令支持三个关键字:`gitdir`、`gitdir/I` 和 `onbranch`。我将简单解释一下 `gitdir`,我在上面的代码片段中使用了它。你可以在[文档][3]中了解其他两个关键词。
`includeIf` 指令中使用 `gitdir` 关键字会对模式进行条件检查。根据规则,如果当前工作目录与 `gitdir` 中指定的目录模式相匹配,那么它就会从给定的路径中选取配置。我将在配置片段上应用这个规则来展示它是如何被应用的。
在配置片段中,你可以看到一个简单的模式,`~/`,它与 `gitdir` 关键字一起使用。这个模式会被存储在 `$HOME` 环境变量中的值所替代。
### 如何使用它
如果你使用同一个系统在 GitHub 或 GitLab 上的开源项目上工作,并在工作中提交到 Git 仓库,你可以有两个顶级目录,比如 `$HOME/priv_scm``$HOME/work_scm`。在这两个目录中,你可以有两个单独的 `.gitconfig` 文件,其中包含与你的 `user.name``user.email` 相关的设置。然而,它们也可以包含存储在 `$HOME` 的全局 `.gitconfig` 中,它可以保存两个环境通用的所有自定义项。
这里是一个例子 `$HOME/priv_scm/.gitconfig` 的片段:
```
$ cat $HOME/priv_scm/.gitconfig
[user]
    name  = Ramanathan Muthiah
    email = <personal-mailid-goes-here>
```
有了这个配置,你就可以切换目录,并开始在开源项目上工作,而无需手动重置一些与 Git 相关的配置。这些更改会在主 `.gitconfig` 中借助 `includeIf` 条件指令自动处理。
### Git 小贴士
希望这个小贴士能帮助你组织 Git 项目。你最喜欢的 Git 小贴士是什么?请在评论中分享吧!
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/10/git-config
作者:[Ramanathan M][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/muthiahramanathan
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_chat_communication_message.png?itok=LKjiLnQu (Chat via email)
[2]: https://git-scm.com/docs/git-config
[3]: https://git-scm.com/docs/git-config#_conditional_includes